buzzcasting-storage 3.13.0 → 3.14.1
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 +2 -0
- package/dist/buzzcasting-storage.esm.js +1037 -1033
- package/package.json +11 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _ = /* @__PURE__ */ ((h) => (h.CLOUD = "cloud", h.DASHBOARD = "dashboard", h.DASHBOARDS = "dashboards", h.IMAGES = "images", h.MESSAGES = "messages", h.PREFERENCE = "preference", h.PREFERENCES = "preferences", h.PRESENTATION = "presentation", h.PRESENTATIONS = "presentations", h.SERIES = "series", h.SLIDE = "slide", h.SLIDES = "slides", h.TOPICS = "topics", h.WIDGET = "widget", h.WIDGETS = "widgets", h))(_ || {}), c = /* @__PURE__ */ ((h) => (h.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", h.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", h.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", h.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", h.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", h.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", h.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", h.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", h.NONE = "color:transparent;background-color:transparent;", h.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", h.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", h.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", h.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", h.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", h.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", h.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", h.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", h))(c || {}), X = /* @__PURE__ */ ((h) => (h.ADD_SLIDE = "addSlide", h.APP_READY = "appReady", h.API_UPDATE = "apiUpdate", h.WS_API_REQUEST = "wsApiRequest", h.WS_API_RESPONSE = "wsApiResponse", h.WS_API_UPDATE = "wsApiRUpdate", h.APPROVE_MESSAGE = "approveMessage", h.CHANNEL = "channel", h.CLEAN_MESSAGES = "cleanMessages", h.CLOSE_BUILDER_DIALOG = "closeBuilderDialog", h.CLOSE_BUILDER_MODAL = "closeBuilderModal", h.CLOSE_MODAL = "closeModal", h.CSS_SET = "setCss", h.CSS_STORE = "storeCss", h.DASHBOARD_LOAD = "loadDashboard", h.DASHBOARD_STORE = "storeDashboard", h.ERROR = "error", h.HIDE_MESSAGE = "hideMessage", h.HIDE_LABELS = "hideLabels", h.IMAGE_GET = "getImage", h.IMAGE_SET = "setImage", h.IMAGE_STORED = "imageStored", h.LAUPPUT_UPDATE = "layoutUpdate", h.PREV_SLIDE = "prevSlide", h.RELOAD_PRESENTATION = "reloadPresentation", h.STAR_MESSAGE = "starMessage", h.GOTO_SLIDE = "gotoSlide", h.NEXT_SLIDE = "nextSlide", h.PREFERENCE_LOAD = "loadPreference", h.PREFERENCE_STORE = "storePreference", h.PAUSE_PRESENTATION = "pausePresentation", h.PRESENTATION_READY = "presentationReady", h.PRESENTATION_LOAD = "loadPresentation", h.PRESENTATION_STORE = "storePresentation", h.SCREENSHOT_TAKE = "takeScreenshot", h.SCREENSHOT_STORE = "storeScreenshot", h.SECTION_UPDATE = "sectionUpdate", h.SHOW_BUILDER_DIALOG = "showBuilderDialog", h.SHOW_BUILDER_MODAL = "showBuilderModal", h.SHOW_MODAL = "showModal", h.SLIDE_DID_LOAD = "slideDidLoad", h.SLIDE_GET = "getSlide", h.SLIDE_GOTO = "slideGoto", h.SLIDE_LOAD = "loadSlide", h.SLIDE_READY = "slideReady", h.SLIDE_SAVED = "slideSaved", h.SLIDE_SET = "setSlide", h.SLIDE_STORE = "storeSlide", h.SLIDE_STORED = "slideStored", h.SLIDE_TRANSITIONER = "slideTransitioner", h.START_TRANSITIONER = "startTransitioner", h.STORAGE_INIT = "storageInit", h.SUBSCRIBE = "subscribe", h.SUSPEND_ACCOUNT = "suspendAccount", h.SWITCH_PRESENTATION = "switchPresentation", h.REMOVE_CLOUD = "removeCloud", h.UPDATE = "update", h.UPLOAD_COMPLETED = "uploadCompleted", h.VERSION = "version", h.WIDGETS_CLEAR = "widgetsClear", h.WIDGET_LOAD = "widgetLoad", h.WIDGET_STORE = "widgetStore", h.WIDGET_UPDATE = "widgetUpdate", h))(X || {}),
|
|
1
|
+
var _ = /* @__PURE__ */ ((h) => (h.CLOUD = "cloud", h.DASHBOARD = "dashboard", h.DASHBOARDS = "dashboards", h.IMAGES = "images", h.MESSAGES = "messages", h.PREFERENCE = "preference", h.PREFERENCES = "preferences", h.PRESENTATION = "presentation", h.PRESENTATIONS = "presentations", h.SERIES = "series", h.SLIDE = "slide", h.SLIDES = "slides", h.TOPICS = "topics", h.WIDGET = "widget", h.WIDGETS = "widgets", h))(_ || {}), c = /* @__PURE__ */ ((h) => (h.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", h.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", h.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", h.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", h.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", h.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", h.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", h.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", h.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", h.NONE = "color:transparent;background-color:transparent;", h.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", h.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", h.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", h.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", h.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", h.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", h.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", h.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", h))(c || {}), X = /* @__PURE__ */ ((h) => (h.ADD_SLIDE = "addSlide", h.APP_READY = "appReady", h.API_UPDATE = "apiUpdate", h.WS_API_REQUEST = "wsApiRequest", h.WS_API_RESPONSE = "wsApiResponse", h.WS_API_UPDATE = "wsApiRUpdate", h.APPROVE_MESSAGE = "approveMessage", h.CHANNEL = "channel", h.CLEAN_MESSAGES = "cleanMessages", h.CLOSE_BUILDER_DIALOG = "closeBuilderDialog", h.CLOSE_BUILDER_MODAL = "closeBuilderModal", h.CLOSE_MODAL = "closeModal", h.CSS_SET = "setCss", h.CSS_STORE = "storeCss", h.DASHBOARD_LOAD = "loadDashboard", h.DASHBOARD_STORE = "storeDashboard", h.ERROR = "error", h.HIDE_MESSAGE = "hideMessage", h.HIDE_LABELS = "hideLabels", h.IMAGE_GET = "getImage", h.IMAGE_SET = "setImage", h.IMAGE_STORED = "imageStored", h.LAUPPUT_UPDATE = "layoutUpdate", h.PREV_SLIDE = "prevSlide", h.RELOAD_PRESENTATION = "reloadPresentation", h.STAR_MESSAGE = "starMessage", h.GOTO_SLIDE = "gotoSlide", h.NEXT_SLIDE = "nextSlide", h.PREFERENCE_LOAD = "loadPreference", h.PREFERENCE_STORE = "storePreference", h.PAUSE_PRESENTATION = "pausePresentation", h.PRESENTATION_READY = "presentationReady", h.PRESENTATION_LOAD = "loadPresentation", h.PRESENTATION_STORE = "storePresentation", h.SCREENSHOT_TAKE = "takeScreenshot", h.SCREENSHOT_STORE = "storeScreenshot", h.SECTION_UPDATE = "sectionUpdate", h.SHOW_BUILDER_DIALOG = "showBuilderDialog", h.SHOW_BUILDER_MODAL = "showBuilderModal", h.SHOW_MODAL = "showModal", h.SLIDE_DID_LOAD = "slideDidLoad", h.SLIDE_GET = "getSlide", h.SLIDE_GOTO = "slideGoto", h.SLIDE_LOAD = "loadSlide", h.SLIDE_READY = "slideReady", h.SLIDE_SAVED = "slideSaved", h.SLIDE_SET = "setSlide", h.SLIDE_STORE = "storeSlide", h.SLIDE_STORED = "slideStored", h.SLIDE_TRANSITIONER = "slideTransitioner", h.START_TRANSITIONER = "startTransitioner", h.STORAGE_INIT = "storageInit", h.SUBSCRIBE = "subscribe", h.SUSPEND_ACCOUNT = "suspendAccount", h.SWITCH_PRESENTATION = "switchPresentation", h.REMOVE_CLOUD = "removeCloud", h.UPDATE = "update", h.UPLOAD_COMPLETED = "uploadCompleted", h.VERSION = "version", h.WIDGETS_CLEAR = "widgetsClear", h.WIDGET_LOAD = "widgetLoad", h.WIDGET_STORE = "widgetStore", h.WIDGET_UPDATE = "widgetUpdate", h))(X || {}), er = /* @__PURE__ */ ((h) => (h.APPROVED = "approved", h.BEFORE = "before", h.DELAYED = "delayed", h.NONE = "none", h.REALTIME = "realtime", h))(er || {}), he = /* @__PURE__ */ ((h) => (h.KEYVAL = "keyval", h.LOCAL = "local", h.SESSION = "session", h.DEXIE = "dexie", h.WINDOW = "window", h))(he || {});
|
|
2
2
|
function Pa(h) {
|
|
3
3
|
const t = {};
|
|
4
4
|
for (let o = 0; o < h.length; o++) {
|
|
@@ -27,10 +27,10 @@ function Oe(h, t) {
|
|
|
27
27
|
function Na(h, t, o) {
|
|
28
28
|
return Object.keys(t).sort().reduce(l, h);
|
|
29
29
|
function l(g, b) {
|
|
30
|
-
return
|
|
30
|
+
return jn(g, t[b], b, o);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function jn(h, t, o, l) {
|
|
34
34
|
const g = Oe(Oe(Oe(h, o), Ra(t)), typeof t);
|
|
35
35
|
if (t === null)
|
|
36
36
|
return Oe(g, "null");
|
|
@@ -54,8 +54,8 @@ function jr(h, t, o, l) {
|
|
|
54
54
|
function Ra(h) {
|
|
55
55
|
return Object.prototype.toString.call(h);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return Ia(
|
|
57
|
+
function Wr(h) {
|
|
58
|
+
return Ia(jn(0, h, "", []).toString(16), 8);
|
|
59
59
|
}
|
|
60
60
|
const st = (h) => {
|
|
61
61
|
let t = {}, o = h.split(",");
|
|
@@ -91,7 +91,7 @@ const K = (h = 0, t) => {
|
|
|
91
91
|
console.error(...t);
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
|
-
},
|
|
94
|
+
}, kn = (h) => {
|
|
95
95
|
switch (h?.type) {
|
|
96
96
|
case _.MESSAGES:
|
|
97
97
|
return c.MESSAGES;
|
|
@@ -119,13 +119,13 @@ function Ot(h, t) {
|
|
|
119
119
|
var o;
|
|
120
120
|
let l, g, b, x, $;
|
|
121
121
|
switch (h.moderation) {
|
|
122
|
-
case
|
|
122
|
+
case er.BEFORE:
|
|
123
123
|
l = /* @__PURE__ */ new Date(), g = (o = h.beforeTime) == null ? void 0 : o.split(":"), b = Number.parseInt(g ? g[0] : "00"), x = Number.parseInt(g ? g[1] : "00"), $ = Number.parseInt(g ? g[2] : "00"), t.before = l.setHours(b, x, $, 0) / 1e3, t.period || (t.period = l.getDay() === 1 ? 72 : 24);
|
|
124
124
|
break;
|
|
125
|
-
case
|
|
125
|
+
case er.DELAYED:
|
|
126
126
|
h.delay && h.delay > 0 && (t.delay = `${h.delay}`);
|
|
127
127
|
break;
|
|
128
|
-
case
|
|
128
|
+
case er.APPROVED:
|
|
129
129
|
t.approved = "1";
|
|
130
130
|
break;
|
|
131
131
|
default:
|
|
@@ -133,7 +133,7 @@ function Ot(h, t) {
|
|
|
133
133
|
}
|
|
134
134
|
return t;
|
|
135
135
|
}
|
|
136
|
-
const xa = "3.
|
|
136
|
+
const xa = "3.14.0";
|
|
137
137
|
class ka {
|
|
138
138
|
options;
|
|
139
139
|
url;
|
|
@@ -488,436 +488,436 @@ var Ca = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
488
488
|
function $a(h) {
|
|
489
489
|
return h && h.__esModule && Object.prototype.hasOwnProperty.call(h, "default") ? h.default : h;
|
|
490
490
|
}
|
|
491
|
-
var
|
|
491
|
+
var tr = { exports: {} }, ja = tr.exports, Cn;
|
|
492
492
|
function Ma() {
|
|
493
|
-
return
|
|
493
|
+
return Cn || (Cn = 1, function(h, t) {
|
|
494
494
|
(function(o, l) {
|
|
495
495
|
h.exports = l();
|
|
496
496
|
})(ja, function() {
|
|
497
|
-
var o = function(e,
|
|
498
|
-
return (o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
499
|
-
|
|
500
|
-
} || function(
|
|
501
|
-
for (var s in a) Object.prototype.hasOwnProperty.call(a, s) && (
|
|
502
|
-
})(e,
|
|
497
|
+
var o = function(e, r) {
|
|
498
|
+
return (o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
499
|
+
n.__proto__ = a;
|
|
500
|
+
} || function(n, a) {
|
|
501
|
+
for (var s in a) Object.prototype.hasOwnProperty.call(a, s) && (n[s] = a[s]);
|
|
502
|
+
})(e, r);
|
|
503
503
|
}, l = function() {
|
|
504
504
|
return (l = Object.assign || function(e) {
|
|
505
|
-
for (var
|
|
505
|
+
for (var r, n = 1, a = arguments.length; n < a; n++) for (var s in r = arguments[n]) Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);
|
|
506
506
|
return e;
|
|
507
507
|
}).apply(this, arguments);
|
|
508
508
|
};
|
|
509
|
-
function g(e,
|
|
510
|
-
for (var a, s = 0, i =
|
|
511
|
-
return e.concat(a || Array.prototype.slice.call(
|
|
509
|
+
function g(e, r, n) {
|
|
510
|
+
for (var a, s = 0, i = r.length; s < i; s++) !a && s in r || ((a = a || Array.prototype.slice.call(r, 0, s))[s] = r[s]);
|
|
511
|
+
return e.concat(a || Array.prototype.slice.call(r));
|
|
512
512
|
}
|
|
513
513
|
var b = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, x = Object.keys, $ = Array.isArray;
|
|
514
|
-
function te(e,
|
|
515
|
-
return typeof
|
|
516
|
-
e[
|
|
514
|
+
function te(e, r) {
|
|
515
|
+
return typeof r != "object" || x(r).forEach(function(n) {
|
|
516
|
+
e[n] = r[n];
|
|
517
517
|
}), e;
|
|
518
518
|
}
|
|
519
519
|
typeof Promise > "u" || b.Promise || (b.Promise = Promise);
|
|
520
520
|
var ge = Object.getPrototypeOf, Ce = {}.hasOwnProperty;
|
|
521
|
-
function ie(e,
|
|
522
|
-
return Ce.call(e,
|
|
521
|
+
function ie(e, r) {
|
|
522
|
+
return Ce.call(e, r);
|
|
523
523
|
}
|
|
524
|
-
function be(e,
|
|
525
|
-
typeof
|
|
526
|
-
Ae(e,
|
|
524
|
+
function be(e, r) {
|
|
525
|
+
typeof r == "function" && (r = r(ge(e))), (typeof Reflect > "u" ? x : Reflect.ownKeys)(r).forEach(function(n) {
|
|
526
|
+
Ae(e, n, r[n]);
|
|
527
527
|
});
|
|
528
528
|
}
|
|
529
529
|
var _t = Object.defineProperty;
|
|
530
|
-
function Ae(e,
|
|
531
|
-
_t(e,
|
|
530
|
+
function Ae(e, r, n, a) {
|
|
531
|
+
_t(e, r, te(n && ie(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, a));
|
|
532
532
|
}
|
|
533
533
|
function Ye(e) {
|
|
534
|
-
return { from: function(
|
|
535
|
-
return e.prototype = Object.create(
|
|
534
|
+
return { from: function(r) {
|
|
535
|
+
return e.prototype = Object.create(r.prototype), Ae(e.prototype, "constructor", e), { extend: be.bind(null, e.prototype) };
|
|
536
536
|
} };
|
|
537
537
|
}
|
|
538
|
-
var
|
|
539
|
-
function At(e,
|
|
540
|
-
return
|
|
538
|
+
var Fn = Object.getOwnPropertyDescriptor, Un = [].slice;
|
|
539
|
+
function At(e, r, n) {
|
|
540
|
+
return Un.call(e, r, n);
|
|
541
541
|
}
|
|
542
|
-
function
|
|
543
|
-
return
|
|
542
|
+
function Hr(e, r) {
|
|
543
|
+
return r(e);
|
|
544
544
|
}
|
|
545
545
|
function ot(e) {
|
|
546
546
|
if (!e) throw new Error("Assertion Failed");
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function Vr(e) {
|
|
549
549
|
b.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
550
550
|
}
|
|
551
|
-
function ve(e,
|
|
552
|
-
if (typeof
|
|
553
|
-
if (!
|
|
554
|
-
if (typeof
|
|
555
|
-
for (var
|
|
556
|
-
var i = ve(e,
|
|
557
|
-
|
|
551
|
+
function ve(e, r) {
|
|
552
|
+
if (typeof r == "string" && ie(e, r)) return e[r];
|
|
553
|
+
if (!r) return e;
|
|
554
|
+
if (typeof r != "string") {
|
|
555
|
+
for (var n = [], a = 0, s = r.length; a < s; ++a) {
|
|
556
|
+
var i = ve(e, r[a]);
|
|
557
|
+
n.push(i);
|
|
558
558
|
}
|
|
559
|
-
return
|
|
559
|
+
return n;
|
|
560
560
|
}
|
|
561
|
-
var u =
|
|
561
|
+
var u = r.indexOf(".");
|
|
562
562
|
if (u !== -1) {
|
|
563
|
-
var d = e[
|
|
564
|
-
return d == null ? void 0 : ve(d,
|
|
563
|
+
var d = e[r.substr(0, u)];
|
|
564
|
+
return d == null ? void 0 : ve(d, r.substr(u + 1));
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
function ue(e,
|
|
568
|
-
if (e &&
|
|
569
|
-
ot(typeof
|
|
570
|
-
for (var a = 0, s =
|
|
567
|
+
function ue(e, r, n) {
|
|
568
|
+
if (e && r !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof r != "string" && "length" in r) {
|
|
569
|
+
ot(typeof n != "string" && "length" in n);
|
|
570
|
+
for (var a = 0, s = r.length; a < s; ++a) ue(e, r[a], n[a]);
|
|
571
571
|
} else {
|
|
572
|
-
var i, u, d =
|
|
573
|
-
d !== -1 ? (i =
|
|
572
|
+
var i, u, d = r.indexOf(".");
|
|
573
|
+
d !== -1 ? (i = r.substr(0, d), (u = r.substr(d + 1)) === "" ? n === void 0 ? $(e) && !isNaN(parseInt(i)) ? e.splice(i, 1) : delete e[i] : e[i] = n : ue(d = !(d = e[i]) || !ie(e, i) ? e[i] = {} : d, u, n)) : n === void 0 ? $(e) && !isNaN(parseInt(r)) ? e.splice(r, 1) : delete e[r] : e[r] = n;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
var
|
|
578
|
-
for (
|
|
579
|
-
return
|
|
576
|
+
function Yr(e) {
|
|
577
|
+
var r, n = {};
|
|
578
|
+
for (r in e) ie(e, r) && (n[r] = e[r]);
|
|
579
|
+
return n;
|
|
580
580
|
}
|
|
581
|
-
var
|
|
582
|
-
function
|
|
583
|
-
return
|
|
581
|
+
var zn = [].concat;
|
|
582
|
+
function Qr(e) {
|
|
583
|
+
return zn.apply([], e);
|
|
584
584
|
}
|
|
585
|
-
var Ge = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(
|
|
586
|
-
return ["Int", "Uint", "Float"].map(function(
|
|
587
|
-
return
|
|
585
|
+
var Ge = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Qr([8, 16, 32, 64].map(function(e) {
|
|
586
|
+
return ["Int", "Uint", "Float"].map(function(r) {
|
|
587
|
+
return r + e + "Array";
|
|
588
588
|
});
|
|
589
589
|
}))).filter(function(e) {
|
|
590
590
|
return b[e];
|
|
591
|
-
}),
|
|
591
|
+
}), Xr = new Set(Ge.map(function(e) {
|
|
592
592
|
return b[e];
|
|
593
593
|
})), it = null;
|
|
594
594
|
function $e(e) {
|
|
595
|
-
return it = /* @__PURE__ */ new WeakMap(), e = function n
|
|
596
|
-
if (!
|
|
597
|
-
var a = it.get(
|
|
595
|
+
return it = /* @__PURE__ */ new WeakMap(), e = function r(n) {
|
|
596
|
+
if (!n || typeof n != "object") return n;
|
|
597
|
+
var a = it.get(n);
|
|
598
598
|
if (a) return a;
|
|
599
|
-
if ($(
|
|
600
|
-
a = [], it.set(
|
|
601
|
-
for (var s = 0, i =
|
|
602
|
-
} else if (
|
|
599
|
+
if ($(n)) {
|
|
600
|
+
a = [], it.set(n, a);
|
|
601
|
+
for (var s = 0, i = n.length; s < i; ++s) a.push(r(n[s]));
|
|
602
|
+
} else if (Xr.has(n.constructor)) a = n;
|
|
603
603
|
else {
|
|
604
|
-
var u, d = ge(
|
|
605
|
-
for (u in a = d === Object.prototype ? {} : Object.create(d), it.set(
|
|
604
|
+
var u, d = ge(n);
|
|
605
|
+
for (u in a = d === Object.prototype ? {} : Object.create(d), it.set(n, a), n) ie(n, u) && (a[u] = r(n[u]));
|
|
606
606
|
}
|
|
607
607
|
return a;
|
|
608
608
|
}(e), it = null, e;
|
|
609
609
|
}
|
|
610
|
-
var
|
|
611
|
-
function
|
|
612
|
-
return
|
|
610
|
+
var Hn = {}.toString;
|
|
611
|
+
function rr(e) {
|
|
612
|
+
return Hn.call(e).slice(8, -1);
|
|
613
613
|
}
|
|
614
|
-
var
|
|
615
|
-
var
|
|
616
|
-
return e != null && (
|
|
614
|
+
var nr = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", Vn = typeof nr == "symbol" ? function(e) {
|
|
615
|
+
var r;
|
|
616
|
+
return e != null && (r = e[nr]) && r.apply(e);
|
|
617
617
|
} : function() {
|
|
618
618
|
return null;
|
|
619
619
|
};
|
|
620
|
-
function je(e,
|
|
621
|
-
return
|
|
620
|
+
function je(e, r) {
|
|
621
|
+
return r = e.indexOf(r), 0 <= r && e.splice(r, 1), 0 <= r;
|
|
622
622
|
}
|
|
623
623
|
var Qe = {};
|
|
624
624
|
function Ee(e) {
|
|
625
|
-
var
|
|
625
|
+
var r, n, a, s;
|
|
626
626
|
if (arguments.length === 1) {
|
|
627
627
|
if ($(e)) return e.slice();
|
|
628
628
|
if (this === Qe && typeof e == "string") return [e];
|
|
629
|
-
if (s =
|
|
630
|
-
for (
|
|
631
|
-
return
|
|
629
|
+
if (s = Vn(e)) {
|
|
630
|
+
for (n = []; !(a = s.next()).done; ) n.push(a.value);
|
|
631
|
+
return n;
|
|
632
632
|
}
|
|
633
633
|
if (e == null) return [e];
|
|
634
|
-
if (typeof (
|
|
635
|
-
for (
|
|
636
|
-
return
|
|
634
|
+
if (typeof (r = e.length) != "number") return [e];
|
|
635
|
+
for (n = new Array(r); r--; ) n[r] = e[r];
|
|
636
|
+
return n;
|
|
637
637
|
}
|
|
638
|
-
for (
|
|
639
|
-
return
|
|
638
|
+
for (r = arguments.length, n = new Array(r); r--; ) n[r] = arguments[r];
|
|
639
|
+
return n;
|
|
640
640
|
}
|
|
641
|
-
var
|
|
641
|
+
var ar = typeof Symbol < "u" ? function(e) {
|
|
642
642
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
643
643
|
} : function() {
|
|
644
644
|
return !1;
|
|
645
|
-
}, lt = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], fe = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(lt),
|
|
646
|
-
function Xe(e,
|
|
647
|
-
this.name = e, this.message =
|
|
648
|
-
}
|
|
649
|
-
function
|
|
650
|
-
return e + ". Errors: " + Object.keys(
|
|
651
|
-
return n
|
|
652
|
-
}).filter(function(
|
|
653
|
-
return s.indexOf(
|
|
645
|
+
}, lt = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], fe = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(lt), Yn = { 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" };
|
|
646
|
+
function Xe(e, r) {
|
|
647
|
+
this.name = e, this.message = r;
|
|
648
|
+
}
|
|
649
|
+
function Jr(e, r) {
|
|
650
|
+
return e + ". Errors: " + Object.keys(r).map(function(n) {
|
|
651
|
+
return r[n].toString();
|
|
652
|
+
}).filter(function(n, a, s) {
|
|
653
|
+
return s.indexOf(n) === a;
|
|
654
654
|
}).join(`
|
|
655
655
|
`);
|
|
656
656
|
}
|
|
657
|
-
function Pt(e,
|
|
658
|
-
this.failures =
|
|
657
|
+
function Pt(e, r, n, a) {
|
|
658
|
+
this.failures = r, this.failedKeys = a, this.successCount = n, this.message = Jr(e, r);
|
|
659
659
|
}
|
|
660
|
-
function Je(e,
|
|
661
|
-
this.name = "BulkError", this.failures = Object.keys(
|
|
662
|
-
return n
|
|
663
|
-
}), this.failuresByPos =
|
|
660
|
+
function Je(e, r) {
|
|
661
|
+
this.name = "BulkError", this.failures = Object.keys(r).map(function(n) {
|
|
662
|
+
return r[n];
|
|
663
|
+
}), this.failuresByPos = r, this.message = Jr(e, this.failures);
|
|
664
664
|
}
|
|
665
665
|
Ye(Xe).from(Error).extend({ toString: function() {
|
|
666
666
|
return this.name + ": " + this.message;
|
|
667
667
|
} }), Ye(Pt).from(Xe), Ye(Je).from(Xe);
|
|
668
|
-
var
|
|
669
|
-
return e[
|
|
670
|
-
}, {}),
|
|
671
|
-
var
|
|
668
|
+
var sr = fe.reduce(function(e, r) {
|
|
669
|
+
return e[r] = r + "Error", e;
|
|
670
|
+
}, {}), Qn = Xe, L = fe.reduce(function(e, r) {
|
|
671
|
+
var n = r + "Error";
|
|
672
672
|
function a(s, i) {
|
|
673
|
-
this.name =
|
|
674
|
-
` + i : ""), this.inner = i || null) : typeof s == "object" && (this.message = "".concat(s.name, " ").concat(s.message), this.inner = s) : (this.message =
|
|
673
|
+
this.name = n, s ? typeof s == "string" ? (this.message = "".concat(s).concat(i ? `
|
|
674
|
+
` + i : ""), this.inner = i || null) : typeof s == "object" && (this.message = "".concat(s.name, " ").concat(s.message), this.inner = s) : (this.message = Yn[r] || n, this.inner = null);
|
|
675
675
|
}
|
|
676
|
-
return Ye(a).from(
|
|
676
|
+
return Ye(a).from(Qn), e[r] = a, e;
|
|
677
677
|
}, {});
|
|
678
678
|
L.Syntax = SyntaxError, L.Type = TypeError, L.Range = RangeError;
|
|
679
|
-
var
|
|
680
|
-
return e[
|
|
681
|
-
}, {}), Dt = fe.reduce(function(e,
|
|
682
|
-
return ["Syntax", "Type", "Range"].indexOf(
|
|
679
|
+
var Zr = lt.reduce(function(e, r) {
|
|
680
|
+
return e[r + "Error"] = L[r], e;
|
|
681
|
+
}, {}), Dt = fe.reduce(function(e, r) {
|
|
682
|
+
return ["Syntax", "Type", "Range"].indexOf(r) === -1 && (e[r + "Error"] = L[r]), e;
|
|
683
683
|
}, {});
|
|
684
684
|
function Q() {
|
|
685
685
|
}
|
|
686
686
|
function ct(e) {
|
|
687
687
|
return e;
|
|
688
688
|
}
|
|
689
|
-
function
|
|
690
|
-
return e == null || e === ct ?
|
|
691
|
-
return
|
|
689
|
+
function Xn(e, r) {
|
|
690
|
+
return e == null || e === ct ? r : function(n) {
|
|
691
|
+
return r(e(n));
|
|
692
692
|
};
|
|
693
693
|
}
|
|
694
|
-
function Me(e,
|
|
694
|
+
function Me(e, r) {
|
|
695
695
|
return function() {
|
|
696
|
-
e.apply(this, arguments),
|
|
696
|
+
e.apply(this, arguments), r.apply(this, arguments);
|
|
697
697
|
};
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
return e === Q ?
|
|
701
|
-
var
|
|
702
|
-
|
|
699
|
+
function Jn(e, r) {
|
|
700
|
+
return e === Q ? r : function() {
|
|
701
|
+
var n = e.apply(this, arguments);
|
|
702
|
+
n !== void 0 && (arguments[0] = n);
|
|
703
703
|
var a = this.onsuccess, s = this.onerror;
|
|
704
704
|
this.onsuccess = null, this.onerror = null;
|
|
705
|
-
var i =
|
|
706
|
-
return a && (this.onsuccess = this.onsuccess ? Me(a, this.onsuccess) : a), s && (this.onerror = this.onerror ? Me(s, this.onerror) : s), i !== void 0 ? i :
|
|
705
|
+
var i = r.apply(this, arguments);
|
|
706
|
+
return a && (this.onsuccess = this.onsuccess ? Me(a, this.onsuccess) : a), s && (this.onerror = this.onerror ? Me(s, this.onerror) : s), i !== void 0 ? i : n;
|
|
707
707
|
};
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
return e === Q ?
|
|
709
|
+
function Zn(e, r) {
|
|
710
|
+
return e === Q ? r : function() {
|
|
711
711
|
e.apply(this, arguments);
|
|
712
|
-
var
|
|
713
|
-
this.onsuccess = this.onerror = null,
|
|
712
|
+
var n = this.onsuccess, a = this.onerror;
|
|
713
|
+
this.onsuccess = this.onerror = null, r.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? Me(n, this.onsuccess) : n), a && (this.onerror = this.onerror ? Me(a, this.onerror) : a);
|
|
714
714
|
};
|
|
715
715
|
}
|
|
716
|
-
function
|
|
717
|
-
return e === Q ?
|
|
716
|
+
function qn(e, r) {
|
|
717
|
+
return e === Q ? r : function(n) {
|
|
718
718
|
var a = e.apply(this, arguments);
|
|
719
|
-
te(
|
|
719
|
+
te(n, a);
|
|
720
720
|
var s = this.onsuccess, i = this.onerror;
|
|
721
|
-
return this.onsuccess = null, this.onerror = null,
|
|
721
|
+
return this.onsuccess = null, this.onerror = null, n = r.apply(this, arguments), s && (this.onsuccess = this.onsuccess ? Me(s, this.onsuccess) : s), i && (this.onerror = this.onerror ? Me(i, this.onerror) : i), a === void 0 ? n === void 0 ? void 0 : n : te(a, n);
|
|
722
722
|
};
|
|
723
723
|
}
|
|
724
|
-
function ea(e,
|
|
725
|
-
return e === Q ?
|
|
726
|
-
return
|
|
724
|
+
function ea(e, r) {
|
|
725
|
+
return e === Q ? r : function() {
|
|
726
|
+
return r.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
727
727
|
};
|
|
728
728
|
}
|
|
729
|
-
function
|
|
730
|
-
return e === Q ?
|
|
731
|
-
var
|
|
732
|
-
if (
|
|
729
|
+
function or(e, r) {
|
|
730
|
+
return e === Q ? r : function() {
|
|
731
|
+
var n = e.apply(this, arguments);
|
|
732
|
+
if (n && typeof n.then == "function") {
|
|
733
733
|
for (var a = this, s = arguments.length, i = new Array(s); s--; ) i[s] = arguments[s];
|
|
734
|
-
return
|
|
735
|
-
return
|
|
734
|
+
return n.then(function() {
|
|
735
|
+
return r.apply(a, i);
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
|
-
return
|
|
738
|
+
return r.apply(this, arguments);
|
|
739
739
|
};
|
|
740
740
|
}
|
|
741
741
|
Dt.ModifyError = Pt, Dt.DexieError = Xe, Dt.BulkError = Je;
|
|
742
742
|
var pe = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
743
|
-
function
|
|
743
|
+
function qr(e) {
|
|
744
744
|
pe = e;
|
|
745
745
|
}
|
|
746
|
-
var ut = {},
|
|
746
|
+
var ut = {}, en = 100, Ge = typeof Promise > "u" ? [] : function() {
|
|
747
747
|
var e = Promise.resolve();
|
|
748
748
|
if (typeof crypto > "u" || !crypto.subtle) return [e, ge(e), e];
|
|
749
|
-
var
|
|
750
|
-
return [
|
|
751
|
-
}(), lt = Ge[0], fe = Ge[1], Ge = Ge[2], fe = fe && fe.then, Ke = lt && lt.constructor,
|
|
752
|
-
ft.push([e,
|
|
753
|
-
},
|
|
749
|
+
var r = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
750
|
+
return [r, ge(r), e];
|
|
751
|
+
}(), lt = Ge[0], fe = Ge[1], Ge = Ge[2], fe = fe && fe.then, Ke = lt && lt.constructor, ir = !!Ge, dt = function(e, r) {
|
|
752
|
+
ft.push([e, r]), It && (queueMicrotask(ra), It = !1);
|
|
753
|
+
}, cr = !0, It = !0, Be = [], Nt = [], ur = ct, Pe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Q, pgp: !1, env: {}, finalize: Q }, B = Pe, ft = [], Le = 0, Rt = [];
|
|
754
754
|
function M(e) {
|
|
755
755
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
756
756
|
this._listeners = [], this._lib = !1;
|
|
757
|
-
var
|
|
757
|
+
var r = this._PSD = B;
|
|
758
758
|
if (typeof e != "function") {
|
|
759
759
|
if (e !== ut) throw new TypeError("Not a function");
|
|
760
|
-
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 &&
|
|
760
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && dr(this, this._value));
|
|
761
761
|
}
|
|
762
|
-
this._state = null, this._value = null, ++
|
|
762
|
+
this._state = null, this._value = null, ++r.ref, function n(a, s) {
|
|
763
763
|
try {
|
|
764
764
|
s(function(i) {
|
|
765
765
|
if (a._state === null) {
|
|
766
766
|
if (i === a) throw new TypeError("A promise cannot be resolved with itself.");
|
|
767
767
|
var u = a._lib && Ze();
|
|
768
|
-
i && typeof i.then == "function" ?
|
|
768
|
+
i && typeof i.then == "function" ? n(a, function(d, p) {
|
|
769
769
|
i instanceof M ? i._then(d, p) : i.then(d, p);
|
|
770
|
-
}) : (a._state = !0, a._value = i,
|
|
770
|
+
}) : (a._state = !0, a._value = i, rn(a)), u && qe();
|
|
771
771
|
}
|
|
772
|
-
},
|
|
772
|
+
}, dr.bind(null, a));
|
|
773
773
|
} catch (i) {
|
|
774
|
-
|
|
774
|
+
dr(a, i);
|
|
775
775
|
}
|
|
776
776
|
}(this, e);
|
|
777
777
|
}
|
|
778
|
-
var
|
|
779
|
-
var e = B,
|
|
780
|
-
function
|
|
781
|
-
var i = this, u = !e.global && (e !== B ||
|
|
782
|
-
|
|
778
|
+
var lr = { get: function() {
|
|
779
|
+
var e = B, r = Ct;
|
|
780
|
+
function n(a, s) {
|
|
781
|
+
var i = this, u = !e.global && (e !== B || r !== Ct), d = u && !Ie(), p = new M(function(y, w) {
|
|
782
|
+
fr(i, new tn(an(a, e, u, d), an(s, e, u, d), y, w, e));
|
|
783
783
|
});
|
|
784
784
|
return this._consoleTask && (p._consoleTask = this._consoleTask), p;
|
|
785
785
|
}
|
|
786
|
-
return
|
|
786
|
+
return n.prototype = ut, n;
|
|
787
787
|
}, set: function(e) {
|
|
788
|
-
Ae(this, "then", e && e.prototype === ut ?
|
|
788
|
+
Ae(this, "then", e && e.prototype === ut ? lr : { get: function() {
|
|
789
789
|
return e;
|
|
790
|
-
}, set:
|
|
790
|
+
}, set: lr.set });
|
|
791
791
|
} };
|
|
792
|
-
function
|
|
793
|
-
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof
|
|
792
|
+
function tn(e, r, n, a, s) {
|
|
793
|
+
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof r == "function" ? r : null, this.resolve = n, this.reject = a, this.psd = s;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
var
|
|
797
|
-
Nt.push(
|
|
795
|
+
function dr(e, r) {
|
|
796
|
+
var n, a;
|
|
797
|
+
Nt.push(r), e._state === null && (n = e._lib && Ze(), r = ur(r), e._state = !1, e._value = r, a = e, Be.some(function(s) {
|
|
798
798
|
return s._value === a._value;
|
|
799
|
-
}) || Be.push(a),
|
|
799
|
+
}) || Be.push(a), rn(e), n && qe());
|
|
800
800
|
}
|
|
801
|
-
function
|
|
802
|
-
var
|
|
801
|
+
function rn(e) {
|
|
802
|
+
var r = e._listeners;
|
|
803
803
|
e._listeners = [];
|
|
804
|
-
for (var
|
|
804
|
+
for (var n = 0, a = r.length; n < a; ++n) fr(e, r[n]);
|
|
805
805
|
var s = e._PSD;
|
|
806
806
|
--s.ref || s.finalize(), Le === 0 && (++Le, dt(function() {
|
|
807
|
-
--Le == 0 &&
|
|
807
|
+
--Le == 0 && hr();
|
|
808
808
|
}, []));
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function fr(e, r) {
|
|
811
811
|
if (e._state !== null) {
|
|
812
|
-
var
|
|
813
|
-
if (
|
|
814
|
-
++
|
|
815
|
-
} else e._listeners.push(
|
|
812
|
+
var n = e._state ? r.onFulfilled : r.onRejected;
|
|
813
|
+
if (n === null) return (e._state ? r.resolve : r.reject)(e._value);
|
|
814
|
+
++r.psd.ref, ++Le, dt(ta, [n, e, r]);
|
|
815
|
+
} else e._listeners.push(r);
|
|
816
816
|
}
|
|
817
|
-
function ta(e,
|
|
817
|
+
function ta(e, r, n) {
|
|
818
818
|
try {
|
|
819
|
-
var a, s =
|
|
820
|
-
!
|
|
819
|
+
var a, s = r._value;
|
|
820
|
+
!r._state && Nt.length && (Nt = []), a = pe && r._consoleTask ? r._consoleTask.run(function() {
|
|
821
821
|
return e(s);
|
|
822
|
-
}) : e(s),
|
|
822
|
+
}) : e(s), r._state || Nt.indexOf(s) !== -1 || function(i) {
|
|
823
823
|
for (var u = Be.length; u; ) if (Be[--u]._value === i._value) return Be.splice(u, 1);
|
|
824
|
-
}(
|
|
824
|
+
}(r), n.resolve(a);
|
|
825
825
|
} catch (i) {
|
|
826
|
-
|
|
826
|
+
n.reject(i);
|
|
827
827
|
} finally {
|
|
828
|
-
--Le == 0 &&
|
|
828
|
+
--Le == 0 && hr(), --n.psd.ref || n.psd.finalize();
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function ra() {
|
|
832
832
|
We(Pe, function() {
|
|
833
833
|
Ze() && qe();
|
|
834
834
|
});
|
|
835
835
|
}
|
|
836
836
|
function Ze() {
|
|
837
|
-
var e =
|
|
838
|
-
return It =
|
|
837
|
+
var e = cr;
|
|
838
|
+
return It = cr = !1, e;
|
|
839
839
|
}
|
|
840
840
|
function qe() {
|
|
841
|
-
var e,
|
|
841
|
+
var e, r, n;
|
|
842
842
|
do
|
|
843
|
-
for (; 0 < ft.length; ) for (e = ft, ft = [],
|
|
844
|
-
var a = e[
|
|
843
|
+
for (; 0 < ft.length; ) for (e = ft, ft = [], n = e.length, r = 0; r < n; ++r) {
|
|
844
|
+
var a = e[r];
|
|
845
845
|
a[0].apply(null, a[1]);
|
|
846
846
|
}
|
|
847
847
|
while (0 < ft.length);
|
|
848
|
-
It =
|
|
848
|
+
It = cr = !0;
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function hr() {
|
|
851
851
|
var e = Be;
|
|
852
852
|
Be = [], e.forEach(function(a) {
|
|
853
853
|
a._PSD.onunhandled.call(null, a._value, a);
|
|
854
854
|
});
|
|
855
|
-
for (var
|
|
855
|
+
for (var r = Rt.slice(0), n = r.length; n; ) r[--n]();
|
|
856
856
|
}
|
|
857
857
|
function Tt(e) {
|
|
858
858
|
return new M(ut, !1, e);
|
|
859
859
|
}
|
|
860
|
-
function Z(e,
|
|
861
|
-
var
|
|
860
|
+
function Z(e, r) {
|
|
861
|
+
var n = B;
|
|
862
862
|
return function() {
|
|
863
863
|
var a = Ze(), s = B;
|
|
864
864
|
try {
|
|
865
|
-
return Ne(
|
|
865
|
+
return Ne(n, !0), e.apply(this, arguments);
|
|
866
866
|
} catch (i) {
|
|
867
|
-
|
|
867
|
+
r && r(i);
|
|
868
868
|
} finally {
|
|
869
869
|
Ne(s, !1), a && qe();
|
|
870
870
|
}
|
|
871
871
|
};
|
|
872
872
|
}
|
|
873
|
-
be(M.prototype, { then:
|
|
874
|
-
|
|
873
|
+
be(M.prototype, { then: lr, _then: function(e, r) {
|
|
874
|
+
fr(this, new tn(null, null, e, r, B));
|
|
875
875
|
}, catch: function(e) {
|
|
876
876
|
if (arguments.length === 1) return this.then(null, e);
|
|
877
|
-
var
|
|
878
|
-
return typeof
|
|
879
|
-
return (a instanceof
|
|
877
|
+
var r = e, n = arguments[1];
|
|
878
|
+
return typeof r == "function" ? this.then(null, function(a) {
|
|
879
|
+
return (a instanceof r ? n : Tt)(a);
|
|
880
880
|
}) : this.then(null, function(a) {
|
|
881
|
-
return (a && a.name ===
|
|
881
|
+
return (a && a.name === r ? n : Tt)(a);
|
|
882
882
|
});
|
|
883
883
|
}, finally: function(e) {
|
|
884
|
-
return this.then(function(
|
|
884
|
+
return this.then(function(r) {
|
|
885
885
|
return M.resolve(e()).then(function() {
|
|
886
|
-
return
|
|
886
|
+
return r;
|
|
887
887
|
});
|
|
888
|
-
}, function(
|
|
888
|
+
}, function(r) {
|
|
889
889
|
return M.resolve(e()).then(function() {
|
|
890
|
-
return Tt(
|
|
890
|
+
return Tt(r);
|
|
891
891
|
});
|
|
892
892
|
});
|
|
893
|
-
}, timeout: function(e,
|
|
894
|
-
var
|
|
893
|
+
}, timeout: function(e, r) {
|
|
894
|
+
var n = this;
|
|
895
895
|
return e < 1 / 0 ? new M(function(a, s) {
|
|
896
896
|
var i = setTimeout(function() {
|
|
897
|
-
return s(new L.Timeout(
|
|
897
|
+
return s(new L.Timeout(r));
|
|
898
898
|
}, e);
|
|
899
|
-
|
|
899
|
+
n.then(a, s).finally(clearTimeout.bind(null, i));
|
|
900
900
|
}) : this;
|
|
901
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(M.prototype, Symbol.toStringTag, "Dexie.Promise"), Pe.env =
|
|
901
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(M.prototype, Symbol.toStringTag, "Dexie.Promise"), Pe.env = nn(), be(M, { all: function() {
|
|
902
902
|
var e = Ee.apply(null, arguments).map($t);
|
|
903
|
-
return new M(function(
|
|
904
|
-
e.length === 0 &&
|
|
903
|
+
return new M(function(r, n) {
|
|
904
|
+
e.length === 0 && r([]);
|
|
905
905
|
var a = e.length;
|
|
906
906
|
e.forEach(function(s, i) {
|
|
907
907
|
return M.resolve(s).then(function(u) {
|
|
908
|
-
e[i] = u, --a ||
|
|
909
|
-
},
|
|
908
|
+
e[i] = u, --a || r(e);
|
|
909
|
+
}, n);
|
|
910
910
|
});
|
|
911
911
|
});
|
|
912
912
|
}, resolve: function(e) {
|
|
913
|
-
return e instanceof M ? e : e && typeof e.then == "function" ? new M(function(
|
|
914
|
-
e.then(
|
|
913
|
+
return e instanceof M ? e : e && typeof e.then == "function" ? new M(function(r, n) {
|
|
914
|
+
e.then(r, n);
|
|
915
915
|
}) : new M(ut, !0, e);
|
|
916
916
|
}, reject: Tt, race: function() {
|
|
917
917
|
var e = Ee.apply(null, arguments).map($t);
|
|
918
|
-
return new M(function(
|
|
918
|
+
return new M(function(r, n) {
|
|
919
919
|
e.map(function(a) {
|
|
920
|
-
return M.resolve(a).then(
|
|
920
|
+
return M.resolve(a).then(r, n);
|
|
921
921
|
});
|
|
922
922
|
});
|
|
923
923
|
}, PSD: { get: function() {
|
|
@@ -931,11 +931,11 @@ function Ma() {
|
|
|
931
931
|
}, set: function(e) {
|
|
932
932
|
dt = e;
|
|
933
933
|
} }, rejectionMapper: { get: function() {
|
|
934
|
-
return
|
|
934
|
+
return ur;
|
|
935
935
|
}, set: function(e) {
|
|
936
|
-
|
|
937
|
-
} }, follow: function(e,
|
|
938
|
-
return new M(function(
|
|
936
|
+
ur = e;
|
|
937
|
+
} }, follow: function(e, r) {
|
|
938
|
+
return new M(function(n, a) {
|
|
939
939
|
return De(function(s, i) {
|
|
940
940
|
var u = B;
|
|
941
941
|
u.unhandleds = [], u.onunhandled = i, u.finalize = Me(function() {
|
|
@@ -945,86 +945,86 @@ function Ma() {
|
|
|
945
945
|
}, Rt.push(function y() {
|
|
946
946
|
d(), Rt.splice(Rt.indexOf(y), 1);
|
|
947
947
|
}), ++Le, dt(function() {
|
|
948
|
-
--Le == 0 &&
|
|
948
|
+
--Le == 0 && hr();
|
|
949
949
|
}, []);
|
|
950
950
|
}, u.finalize), e();
|
|
951
|
-
},
|
|
951
|
+
}, r, n, a);
|
|
952
952
|
});
|
|
953
953
|
} }), Ke && (Ke.allSettled && Ae(M, "allSettled", function() {
|
|
954
954
|
var e = Ee.apply(null, arguments).map($t);
|
|
955
|
-
return new M(function(
|
|
956
|
-
e.length === 0 &&
|
|
957
|
-
var
|
|
955
|
+
return new M(function(r) {
|
|
956
|
+
e.length === 0 && r([]);
|
|
957
|
+
var n = e.length, a = new Array(n);
|
|
958
958
|
e.forEach(function(s, i) {
|
|
959
959
|
return M.resolve(s).then(function(u) {
|
|
960
960
|
return a[i] = { status: "fulfilled", value: u };
|
|
961
961
|
}, function(u) {
|
|
962
962
|
return a[i] = { status: "rejected", reason: u };
|
|
963
963
|
}).then(function() {
|
|
964
|
-
return --
|
|
964
|
+
return --n || r(a);
|
|
965
965
|
});
|
|
966
966
|
});
|
|
967
967
|
});
|
|
968
968
|
}), Ke.any && typeof AggregateError < "u" && Ae(M, "any", function() {
|
|
969
969
|
var e = Ee.apply(null, arguments).map($t);
|
|
970
|
-
return new M(function(
|
|
971
|
-
e.length === 0 &&
|
|
970
|
+
return new M(function(r, n) {
|
|
971
|
+
e.length === 0 && n(new AggregateError([]));
|
|
972
972
|
var a = e.length, s = new Array(a);
|
|
973
973
|
e.forEach(function(i, u) {
|
|
974
974
|
return M.resolve(i).then(function(d) {
|
|
975
|
-
return
|
|
975
|
+
return r(d);
|
|
976
976
|
}, function(d) {
|
|
977
|
-
s[u] = d, --a ||
|
|
977
|
+
s[u] = d, --a || n(new AggregateError(s));
|
|
978
978
|
});
|
|
979
979
|
});
|
|
980
980
|
});
|
|
981
981
|
}), Ke.withResolvers && (M.withResolvers = Ke.withResolvers));
|
|
982
|
-
var
|
|
983
|
-
function De(e,
|
|
982
|
+
var re = { awaits: 0, echoes: 0, id: 0 }, na = 0, xt = [], kt = 0, Ct = 0, aa = 0;
|
|
983
|
+
function De(e, r, n, a) {
|
|
984
984
|
var s = B, i = Object.create(s);
|
|
985
|
-
return i.parent = s, i.ref = 0, i.global = !1, i.id = ++aa, Pe.env, i.env =
|
|
985
|
+
return i.parent = s, i.ref = 0, i.global = !1, i.id = ++aa, Pe.env, i.env = ir ? { 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 } : {}, r && te(i, r), ++s.ref, i.finalize = function() {
|
|
986
986
|
--this.parent.ref || this.parent.finalize();
|
|
987
|
-
}, a = We(i, e,
|
|
987
|
+
}, a = We(i, e, n, a), i.ref === 0 && i.finalize(), a;
|
|
988
988
|
}
|
|
989
989
|
function et() {
|
|
990
|
-
return
|
|
990
|
+
return re.id || (re.id = ++na), ++re.awaits, re.echoes += en, re.id;
|
|
991
991
|
}
|
|
992
992
|
function Ie() {
|
|
993
|
-
return !!
|
|
993
|
+
return !!re.awaits && (--re.awaits == 0 && (re.id = 0), re.echoes = re.awaits * en, !0);
|
|
994
994
|
}
|
|
995
995
|
function $t(e) {
|
|
996
|
-
return
|
|
997
|
-
return Ie(),
|
|
998
|
-
}, function(
|
|
999
|
-
return Ie(), q(
|
|
996
|
+
return re.echoes && e && e.constructor === Ke ? (et(), e.then(function(r) {
|
|
997
|
+
return Ie(), r;
|
|
998
|
+
}, function(r) {
|
|
999
|
+
return Ie(), q(r);
|
|
1000
1000
|
})) : e;
|
|
1001
1001
|
}
|
|
1002
1002
|
function sa() {
|
|
1003
1003
|
var e = xt[xt.length - 1];
|
|
1004
1004
|
xt.pop(), Ne(e, !1);
|
|
1005
1005
|
}
|
|
1006
|
-
function Ne(e,
|
|
1007
|
-
var
|
|
1008
|
-
(
|
|
1009
|
-
++Ct,
|
|
1010
|
-
}.bind(null, e) : sa), e !== B && (B = e, a === Pe && (Pe.env =
|
|
1006
|
+
function Ne(e, r) {
|
|
1007
|
+
var n, a = B;
|
|
1008
|
+
(r ? !re.echoes || kt++ && e === B : !kt || --kt && e === B) || queueMicrotask(r ? function(s) {
|
|
1009
|
+
++Ct, re.echoes && --re.echoes != 0 || (re.echoes = re.awaits = re.id = 0), xt.push(B), Ne(s, !0);
|
|
1010
|
+
}.bind(null, e) : sa), e !== B && (B = e, a === Pe && (Pe.env = nn()), ir && (n = Pe.env.Promise, r = e.env, (a.global || e.global) && (Object.defineProperty(b, "Promise", r.PromiseProp), n.all = r.all, n.race = r.race, n.resolve = r.resolve, n.reject = r.reject, r.allSettled && (n.allSettled = r.allSettled), r.any && (n.any = r.any))));
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function nn() {
|
|
1013
1013
|
var e = b.Promise;
|
|
1014
|
-
return
|
|
1014
|
+
return ir ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(b, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
1015
1015
|
}
|
|
1016
|
-
function We(e,
|
|
1016
|
+
function We(e, r, n, a, s) {
|
|
1017
1017
|
var i = B;
|
|
1018
1018
|
try {
|
|
1019
|
-
return Ne(e, !0), n
|
|
1019
|
+
return Ne(e, !0), r(n, a, s);
|
|
1020
1020
|
} finally {
|
|
1021
1021
|
Ne(i, !1);
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function an(e, r, n, a) {
|
|
1025
1025
|
return typeof e != "function" ? e : function() {
|
|
1026
1026
|
var s = B;
|
|
1027
|
-
|
|
1027
|
+
n && et(), Ne(r, !0);
|
|
1028
1028
|
try {
|
|
1029
1029
|
return e.apply(this, arguments);
|
|
1030
1030
|
} finally {
|
|
@@ -1032,41 +1032,41 @@ function Ma() {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
};
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
Promise === Ke &&
|
|
1035
|
+
function gr(e) {
|
|
1036
|
+
Promise === Ke && re.echoes === 0 ? kt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
1037
1037
|
}
|
|
1038
1038
|
("" + fe).indexOf("[native code]") === -1 && (et = Ie = Q);
|
|
1039
|
-
var q = M.reject, Fe = "", we = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",
|
|
1040
|
-
function Ue(e,
|
|
1041
|
-
return e ?
|
|
1042
|
-
return e.apply(this, arguments) &&
|
|
1043
|
-
} : e :
|
|
1039
|
+
var q = M.reject, Fe = "", we = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", sn = "String expected.", tt = [], jt = "__dbnames", pr = "readonly", mr = "readwrite";
|
|
1040
|
+
function Ue(e, r) {
|
|
1041
|
+
return e ? r ? function() {
|
|
1042
|
+
return e.apply(this, arguments) && r.apply(this, arguments);
|
|
1043
|
+
} : e : r;
|
|
1044
1044
|
}
|
|
1045
|
-
var
|
|
1045
|
+
var on = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
1046
1046
|
function Mt(e) {
|
|
1047
|
-
return typeof e != "string" || /\./.test(e) ? function(
|
|
1048
|
-
return
|
|
1049
|
-
} : function(
|
|
1050
|
-
return
|
|
1047
|
+
return typeof e != "string" || /\./.test(e) ? function(r) {
|
|
1048
|
+
return r;
|
|
1049
|
+
} : function(r) {
|
|
1050
|
+
return r[e] === void 0 && e in r && delete (r = $e(r))[e], r;
|
|
1051
1051
|
};
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function cn() {
|
|
1054
1054
|
throw L.Type();
|
|
1055
1055
|
}
|
|
1056
|
-
function H(e,
|
|
1056
|
+
function H(e, r) {
|
|
1057
1057
|
try {
|
|
1058
|
-
var
|
|
1059
|
-
if (
|
|
1060
|
-
switch (
|
|
1058
|
+
var n = un(e), a = un(r);
|
|
1059
|
+
if (n !== a) return n === "Array" ? 1 : a === "Array" ? -1 : n === "binary" ? 1 : a === "binary" ? -1 : n === "string" ? 1 : a === "string" ? -1 : n === "Date" ? 1 : a !== "Date" ? NaN : -1;
|
|
1060
|
+
switch (n) {
|
|
1061
1061
|
case "number":
|
|
1062
1062
|
case "Date":
|
|
1063
1063
|
case "string":
|
|
1064
|
-
return
|
|
1064
|
+
return r < e ? 1 : e < r ? -1 : 0;
|
|
1065
1065
|
case "binary":
|
|
1066
1066
|
return function(s, i) {
|
|
1067
1067
|
for (var u = s.length, d = i.length, p = u < d ? u : d, y = 0; y < p; ++y) if (s[y] !== i[y]) return s[y] < i[y] ? -1 : 1;
|
|
1068
1068
|
return u === d ? 0 : u < d ? -1 : 1;
|
|
1069
|
-
}(
|
|
1069
|
+
}(ln(e), ln(r));
|
|
1070
1070
|
case "Array":
|
|
1071
1071
|
return function(s, i) {
|
|
1072
1072
|
for (var u = s.length, d = i.length, p = u < d ? u : d, y = 0; y < p; ++y) {
|
|
@@ -1074,36 +1074,36 @@ function Ma() {
|
|
|
1074
1074
|
if (w !== 0) return w;
|
|
1075
1075
|
}
|
|
1076
1076
|
return u === d ? 0 : u < d ? -1 : 1;
|
|
1077
|
-
}(e,
|
|
1077
|
+
}(e, r);
|
|
1078
1078
|
}
|
|
1079
1079
|
} catch {
|
|
1080
1080
|
}
|
|
1081
1081
|
return NaN;
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1084
|
-
var
|
|
1085
|
-
return
|
|
1083
|
+
function un(e) {
|
|
1084
|
+
var r = typeof e;
|
|
1085
|
+
return r != "object" ? r : ArrayBuffer.isView(e) ? "binary" : (e = rr(e), e === "ArrayBuffer" ? "binary" : e);
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function ln(e) {
|
|
1088
1088
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
1089
1089
|
}
|
|
1090
|
-
var
|
|
1090
|
+
var dn = (J.prototype._trans = function(e, r, n) {
|
|
1091
1091
|
var a = this._tx || B.trans, s = this.name, i = pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
1092
1092
|
function u(y, w, f) {
|
|
1093
1093
|
if (!f.schema[s]) throw new L.NotFound("Table " + s + " not part of transaction");
|
|
1094
|
-
return
|
|
1094
|
+
return r(f.idbtrans, f);
|
|
1095
1095
|
}
|
|
1096
1096
|
var d = Ze();
|
|
1097
1097
|
try {
|
|
1098
|
-
var p = a && a.db._novip === this.db._novip ? a === B.trans ? a._promise(e, u,
|
|
1099
|
-
return a._promise(e, u,
|
|
1098
|
+
var p = a && a.db._novip === this.db._novip ? a === B.trans ? a._promise(e, u, n) : De(function() {
|
|
1099
|
+
return a._promise(e, u, n);
|
|
1100
1100
|
}, { trans: a, transless: B.transless || B }) : function y(w, f, O, m) {
|
|
1101
1101
|
if (w.idbdb && (w._state.openComplete || B.letThrough || w._vip)) {
|
|
1102
1102
|
var E = w._createTransaction(f, O, w._dbSchema);
|
|
1103
1103
|
try {
|
|
1104
1104
|
E.create(), w._state.PR1398_maxLoop = 3;
|
|
1105
1105
|
} catch (S) {
|
|
1106
|
-
return S.name ===
|
|
1106
|
+
return S.name === sr.InvalidState && w.isOpen() && 0 < --w._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), w.close({ disableAutoOpen: !1 }), w.open().then(function() {
|
|
1107
1107
|
return y(w, f, O, m);
|
|
1108
1108
|
})) : q(S);
|
|
1109
1109
|
}
|
|
@@ -1136,41 +1136,41 @@ function Ma() {
|
|
|
1136
1136
|
} finally {
|
|
1137
1137
|
d && qe();
|
|
1138
1138
|
}
|
|
1139
|
-
}, J.prototype.get = function(e,
|
|
1140
|
-
var
|
|
1141
|
-
return e && e.constructor === Object ? this.where(e).first(
|
|
1142
|
-
return
|
|
1143
|
-
return
|
|
1139
|
+
}, J.prototype.get = function(e, r) {
|
|
1140
|
+
var n = this;
|
|
1141
|
+
return e && e.constructor === Object ? this.where(e).first(r) : e == null ? q(new L.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(a) {
|
|
1142
|
+
return n.core.get({ trans: a, key: e }).then(function(s) {
|
|
1143
|
+
return n.hook.reading.fire(s);
|
|
1144
1144
|
});
|
|
1145
|
-
}).then(
|
|
1145
|
+
}).then(r);
|
|
1146
1146
|
}, J.prototype.where = function(e) {
|
|
1147
1147
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
1148
1148
|
if ($(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
1149
|
-
var
|
|
1150
|
-
if (
|
|
1151
|
-
var
|
|
1152
|
-
if (d.compound &&
|
|
1149
|
+
var r = x(e);
|
|
1150
|
+
if (r.length === 1) return this.where(r[0]).equals(e[r[0]]);
|
|
1151
|
+
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(d) {
|
|
1152
|
+
if (d.compound && r.every(function(y) {
|
|
1153
1153
|
return 0 <= d.keyPath.indexOf(y);
|
|
1154
1154
|
})) {
|
|
1155
|
-
for (var p = 0; p <
|
|
1155
|
+
for (var p = 0; p < r.length; ++p) if (r.indexOf(d.keyPath[p]) === -1) return !1;
|
|
1156
1156
|
return !0;
|
|
1157
1157
|
}
|
|
1158
1158
|
return !1;
|
|
1159
1159
|
}).sort(function(d, p) {
|
|
1160
1160
|
return d.keyPath.length - p.keyPath.length;
|
|
1161
1161
|
})[0];
|
|
1162
|
-
if (
|
|
1163
|
-
var i =
|
|
1162
|
+
if (n && this.db._maxKey !== Fe) {
|
|
1163
|
+
var i = n.keyPath.slice(0, r.length);
|
|
1164
1164
|
return this.where(i).equals(i.map(function(p) {
|
|
1165
1165
|
return e[p];
|
|
1166
1166
|
}));
|
|
1167
1167
|
}
|
|
1168
|
-
!
|
|
1168
|
+
!n && pe && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(r.join("+"), "]"));
|
|
1169
1169
|
var a = this.schema.idxByName;
|
|
1170
1170
|
function s(d, p) {
|
|
1171
1171
|
return H(d, p) === 0;
|
|
1172
1172
|
}
|
|
1173
|
-
var u =
|
|
1173
|
+
var u = r.reduce(function(f, p) {
|
|
1174
1174
|
var y = f[0], w = f[1], f = a[p], O = e[p];
|
|
1175
1175
|
return [y || f, y || !f ? Ue(w, f && f.multi ? function(m) {
|
|
1176
1176
|
return m = ve(m, p), $(m) && m.some(function(E) {
|
|
@@ -1180,7 +1180,7 @@ function Ma() {
|
|
|
1180
1180
|
return s(O, ve(m, p));
|
|
1181
1181
|
}) : w];
|
|
1182
1182
|
}, [null, null]), i = u[0], u = u[1];
|
|
1183
|
-
return i ? this.where(i.name).equals(e[i.keyPath]).filter(u) :
|
|
1183
|
+
return i ? this.where(i.name).equals(e[i.keyPath]).filter(u) : n ? this.filter(u) : this.where(r).equals("");
|
|
1184
1184
|
}, J.prototype.filter = function(e) {
|
|
1185
1185
|
return this.toCollection().and(e);
|
|
1186
1186
|
}, J.prototype.count = function(e) {
|
|
@@ -1200,18 +1200,18 @@ function Ma() {
|
|
|
1200
1200
|
}, J.prototype.reverse = function() {
|
|
1201
1201
|
return this.toCollection().reverse();
|
|
1202
1202
|
}, J.prototype.mapToClass = function(e) {
|
|
1203
|
-
var
|
|
1203
|
+
var r, n = this.db, a = this.name;
|
|
1204
1204
|
function s() {
|
|
1205
|
-
return
|
|
1205
|
+
return r !== null && r.apply(this, arguments) || this;
|
|
1206
1206
|
}
|
|
1207
|
-
(this.schema.mappedClass = e).prototype instanceof
|
|
1207
|
+
(this.schema.mappedClass = e).prototype instanceof cn && (function(p, y) {
|
|
1208
1208
|
if (typeof y != "function" && y !== null) throw new TypeError("Class extends value " + String(y) + " is not a constructor or null");
|
|
1209
1209
|
function w() {
|
|
1210
1210
|
this.constructor = p;
|
|
1211
1211
|
}
|
|
1212
1212
|
o(p, y), p.prototype = y === null ? Object.create(y) : (w.prototype = y.prototype, new w());
|
|
1213
|
-
}(s,
|
|
1214
|
-
return
|
|
1213
|
+
}(s, r = e), Object.defineProperty(s.prototype, "db", { get: function() {
|
|
1214
|
+
return n;
|
|
1215
1215
|
}, enumerable: !1, configurable: !0 }), s.prototype.table = function() {
|
|
1216
1216
|
return a;
|
|
1217
1217
|
}, e = s);
|
|
@@ -1232,10 +1232,10 @@ function Ma() {
|
|
|
1232
1232
|
return this.mapToClass(function(e) {
|
|
1233
1233
|
te(this, e);
|
|
1234
1234
|
});
|
|
1235
|
-
}, J.prototype.add = function(e,
|
|
1236
|
-
var
|
|
1235
|
+
}, J.prototype.add = function(e, r) {
|
|
1236
|
+
var n = this, a = this.schema.primKey, s = a.auto, i = a.keyPath, u = e;
|
|
1237
1237
|
return i && s && (u = Mt(i)(e)), this._trans("readwrite", function(d) {
|
|
1238
|
-
return
|
|
1238
|
+
return n.core.mutate({ trans: d, type: "add", keys: r != null ? [r] : null, values: [u] });
|
|
1239
1239
|
}).then(function(d) {
|
|
1240
1240
|
return d.numFailures ? M.reject(d.failures[0]) : d.lastResult;
|
|
1241
1241
|
}).then(function(d) {
|
|
@@ -1245,12 +1245,12 @@ function Ma() {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
return d;
|
|
1247
1247
|
});
|
|
1248
|
-
}, J.prototype.update = function(e,
|
|
1249
|
-
return typeof e != "object" || $(e) ? this.where(":id").equals(e).modify(
|
|
1250
|
-
}, J.prototype.put = function(e,
|
|
1251
|
-
var
|
|
1248
|
+
}, J.prototype.update = function(e, r) {
|
|
1249
|
+
return typeof e != "object" || $(e) ? this.where(":id").equals(e).modify(r) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? q(new L.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(r));
|
|
1250
|
+
}, J.prototype.put = function(e, r) {
|
|
1251
|
+
var n = this, a = this.schema.primKey, s = a.auto, i = a.keyPath, u = e;
|
|
1252
1252
|
return i && s && (u = Mt(i)(e)), this._trans("readwrite", function(d) {
|
|
1253
|
-
return
|
|
1253
|
+
return n.core.mutate({ trans: d, type: "put", values: [u], keys: r != null ? [r] : null });
|
|
1254
1254
|
}).then(function(d) {
|
|
1255
1255
|
return d.numFailures ? M.reject(d.failures[0]) : d.lastResult;
|
|
1256
1256
|
}).then(function(d) {
|
|
@@ -1261,30 +1261,30 @@ function Ma() {
|
|
|
1261
1261
|
return d;
|
|
1262
1262
|
});
|
|
1263
1263
|
}, J.prototype.delete = function(e) {
|
|
1264
|
-
var
|
|
1265
|
-
return this._trans("readwrite", function(r) {
|
|
1266
|
-
return n.core.mutate({ trans: r, type: "delete", keys: [e] });
|
|
1267
|
-
}).then(function(r) {
|
|
1268
|
-
return r.numFailures ? M.reject(r.failures[0]) : void 0;
|
|
1269
|
-
});
|
|
1270
|
-
}, J.prototype.clear = function() {
|
|
1271
|
-
var e = this;
|
|
1264
|
+
var r = this;
|
|
1272
1265
|
return this._trans("readwrite", function(n) {
|
|
1273
|
-
return
|
|
1266
|
+
return r.core.mutate({ trans: n, type: "delete", keys: [e] });
|
|
1274
1267
|
}).then(function(n) {
|
|
1275
1268
|
return n.numFailures ? M.reject(n.failures[0]) : void 0;
|
|
1276
1269
|
});
|
|
1270
|
+
}, J.prototype.clear = function() {
|
|
1271
|
+
var e = this;
|
|
1272
|
+
return this._trans("readwrite", function(r) {
|
|
1273
|
+
return e.core.mutate({ trans: r, type: "deleteRange", range: on });
|
|
1274
|
+
}).then(function(r) {
|
|
1275
|
+
return r.numFailures ? M.reject(r.failures[0]) : void 0;
|
|
1276
|
+
});
|
|
1277
1277
|
}, J.prototype.bulkGet = function(e) {
|
|
1278
|
-
var
|
|
1279
|
-
return this._trans("readonly", function(
|
|
1280
|
-
return
|
|
1278
|
+
var r = this;
|
|
1279
|
+
return this._trans("readonly", function(n) {
|
|
1280
|
+
return r.core.getMany({ keys: e, trans: n }).then(function(a) {
|
|
1281
1281
|
return a.map(function(s) {
|
|
1282
|
-
return
|
|
1282
|
+
return r.hook.reading.fire(s);
|
|
1283
1283
|
});
|
|
1284
1284
|
});
|
|
1285
1285
|
});
|
|
1286
|
-
}, J.prototype.bulkAdd = function(e,
|
|
1287
|
-
var a = this, s = Array.isArray(
|
|
1286
|
+
}, J.prototype.bulkAdd = function(e, r, n) {
|
|
1287
|
+
var a = this, s = Array.isArray(r) ? r : void 0, i = (n = n || (s ? void 0 : r)) ? n.allKeys : void 0;
|
|
1288
1288
|
return this._trans("readwrite", function(u) {
|
|
1289
1289
|
var y = a.schema.primKey, d = y.auto, y = y.keyPath;
|
|
1290
1290
|
if (y && s) throw new L.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
@@ -1296,8 +1296,8 @@ function Ma() {
|
|
|
1296
1296
|
throw new Je("".concat(a.name, ".bulkAdd(): ").concat(f, " of ").concat(p, " operations failed"), E);
|
|
1297
1297
|
});
|
|
1298
1298
|
});
|
|
1299
|
-
}, J.prototype.bulkPut = function(e,
|
|
1300
|
-
var a = this, s = Array.isArray(
|
|
1299
|
+
}, J.prototype.bulkPut = function(e, r, n) {
|
|
1300
|
+
var a = this, s = Array.isArray(r) ? r : void 0, i = (n = n || (s ? void 0 : r)) ? n.allKeys : void 0;
|
|
1301
1301
|
return this._trans("readwrite", function(u) {
|
|
1302
1302
|
var y = a.schema.primKey, d = y.auto, y = y.keyPath;
|
|
1303
1303
|
if (y && s) throw new L.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
@@ -1310,20 +1310,20 @@ function Ma() {
|
|
|
1310
1310
|
});
|
|
1311
1311
|
});
|
|
1312
1312
|
}, J.prototype.bulkUpdate = function(e) {
|
|
1313
|
-
var
|
|
1313
|
+
var r = this, n = this.core, a = e.map(function(u) {
|
|
1314
1314
|
return u.key;
|
|
1315
1315
|
}), s = e.map(function(u) {
|
|
1316
1316
|
return u.changes;
|
|
1317
1317
|
}), i = [];
|
|
1318
1318
|
return this._trans("readwrite", function(u) {
|
|
1319
|
-
return
|
|
1319
|
+
return n.getMany({ trans: u, keys: a, cache: "clone" }).then(function(d) {
|
|
1320
1320
|
var p = [], y = [];
|
|
1321
1321
|
e.forEach(function(f, O) {
|
|
1322
1322
|
var m = f.key, E = f.changes, S = d[O];
|
|
1323
1323
|
if (S) {
|
|
1324
1324
|
for (var v = 0, A = Object.keys(E); v < A.length; v++) {
|
|
1325
1325
|
var P = A[v], D = E[P];
|
|
1326
|
-
if (P ===
|
|
1326
|
+
if (P === r.schema.primKey.keyPath) {
|
|
1327
1327
|
if (H(D, m) !== 0) throw new L.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1328
1328
|
} else ue(S, P, D);
|
|
1329
1329
|
}
|
|
@@ -1331,41 +1331,41 @@ function Ma() {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
});
|
|
1333
1333
|
var w = p.length;
|
|
1334
|
-
return
|
|
1334
|
+
return n.mutate({ trans: u, type: "put", keys: p, values: y, updates: { keys: a, changeSpecs: s } }).then(function(f) {
|
|
1335
1335
|
var O = f.numFailures, m = f.failures;
|
|
1336
1336
|
if (O === 0) return w;
|
|
1337
1337
|
for (var E = 0, S = Object.keys(m); E < S.length; E++) {
|
|
1338
1338
|
var v, A = S[E], P = i[Number(A)];
|
|
1339
1339
|
P != null && (v = m[A], delete m[A], m[P] = v);
|
|
1340
1340
|
}
|
|
1341
|
-
throw new Je("".concat(
|
|
1341
|
+
throw new Je("".concat(r.name, ".bulkUpdate(): ").concat(O, " of ").concat(w, " operations failed"), m);
|
|
1342
1342
|
});
|
|
1343
1343
|
});
|
|
1344
1344
|
});
|
|
1345
1345
|
}, J.prototype.bulkDelete = function(e) {
|
|
1346
|
-
var
|
|
1346
|
+
var r = this, n = e.length;
|
|
1347
1347
|
return this._trans("readwrite", function(a) {
|
|
1348
|
-
return
|
|
1348
|
+
return r.core.mutate({ trans: a, type: "delete", keys: e });
|
|
1349
1349
|
}).then(function(u) {
|
|
1350
1350
|
var s = u.numFailures, i = u.lastResult, u = u.failures;
|
|
1351
1351
|
if (s === 0) return i;
|
|
1352
|
-
throw new Je("".concat(
|
|
1352
|
+
throw new Je("".concat(r.name, ".bulkDelete(): ").concat(s, " of ").concat(n, " operations failed"), u);
|
|
1353
1353
|
});
|
|
1354
1354
|
}, J);
|
|
1355
1355
|
function J() {
|
|
1356
1356
|
}
|
|
1357
1357
|
function ht(e) {
|
|
1358
|
-
function
|
|
1358
|
+
function r(u, d) {
|
|
1359
1359
|
if (d) {
|
|
1360
1360
|
for (var p = arguments.length, y = new Array(p - 1); --p; ) y[p - 1] = arguments[p];
|
|
1361
|
-
return
|
|
1361
|
+
return n[u].subscribe.apply(null, y), e;
|
|
1362
1362
|
}
|
|
1363
|
-
if (typeof u == "string") return
|
|
1363
|
+
if (typeof u == "string") return n[u];
|
|
1364
1364
|
}
|
|
1365
|
-
var
|
|
1366
|
-
|
|
1365
|
+
var n = {};
|
|
1366
|
+
r.addEventType = i;
|
|
1367
1367
|
for (var a = 1, s = arguments.length; a < s; ++a) i(arguments[a]);
|
|
1368
|
-
return
|
|
1368
|
+
return r;
|
|
1369
1369
|
function i(u, d, p) {
|
|
1370
1370
|
if (typeof u != "object") {
|
|
1371
1371
|
var y;
|
|
@@ -1377,7 +1377,7 @@ function Ma() {
|
|
|
1377
1377
|
return O !== f;
|
|
1378
1378
|
}), w.fire = w.subscribers.reduce(d, p);
|
|
1379
1379
|
} };
|
|
1380
|
-
return
|
|
1380
|
+
return n[u] = r[u] = w;
|
|
1381
1381
|
}
|
|
1382
1382
|
x(y = u).forEach(function(f) {
|
|
1383
1383
|
var O = y[f];
|
|
@@ -1387,7 +1387,7 @@ function Ma() {
|
|
|
1387
1387
|
var m = i(f, ct, function() {
|
|
1388
1388
|
for (var E = arguments.length, S = new Array(E); E--; ) S[E] = arguments[E];
|
|
1389
1389
|
m.subscribers.forEach(function(v) {
|
|
1390
|
-
|
|
1390
|
+
Vr(function() {
|
|
1391
1391
|
v.apply(null, S);
|
|
1392
1392
|
});
|
|
1393
1393
|
});
|
|
@@ -1396,32 +1396,32 @@ function Ma() {
|
|
|
1396
1396
|
});
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
|
-
function gt(e,
|
|
1400
|
-
return Ye(
|
|
1399
|
+
function gt(e, r) {
|
|
1400
|
+
return Ye(r).from({ prototype: e }), r;
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1403
|
-
return !(e.filter || e.algorithm || e.or) && (
|
|
1402
|
+
function rt(e, r) {
|
|
1403
|
+
return !(e.filter || e.algorithm || e.or) && (r ? e.justLimit : !e.replayFilter);
|
|
1404
1404
|
}
|
|
1405
|
-
function
|
|
1406
|
-
e.filter = Ue(e.filter,
|
|
1405
|
+
function yr(e, r) {
|
|
1406
|
+
e.filter = Ue(e.filter, r);
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1408
|
+
function br(e, r, n) {
|
|
1409
1409
|
var a = e.replayFilter;
|
|
1410
1410
|
e.replayFilter = a ? function() {
|
|
1411
|
-
return Ue(a(),
|
|
1412
|
-
} :
|
|
1411
|
+
return Ue(a(), r());
|
|
1412
|
+
} : r, e.justLimit = n && !a;
|
|
1413
1413
|
}
|
|
1414
|
-
function Gt(e,
|
|
1415
|
-
if (e.isPrimKey) return
|
|
1416
|
-
var
|
|
1417
|
-
if (!
|
|
1418
|
-
return
|
|
1414
|
+
function Gt(e, r) {
|
|
1415
|
+
if (e.isPrimKey) return r.primaryKey;
|
|
1416
|
+
var n = r.getIndexByKeyPath(e.index);
|
|
1417
|
+
if (!n) throw new L.Schema("KeyPath " + e.index + " on object store " + r.name + " is not indexed");
|
|
1418
|
+
return n;
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1421
|
-
var a = Gt(e,
|
|
1422
|
-
return
|
|
1420
|
+
function fn(e, r, n) {
|
|
1421
|
+
var a = Gt(e, r.schema);
|
|
1422
|
+
return r.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: a, range: e.range } });
|
|
1423
1423
|
}
|
|
1424
|
-
function Kt(e,
|
|
1424
|
+
function Kt(e, r, n, a) {
|
|
1425
1425
|
var s = e.replayFilter ? Ue(e.filter, e.replayFilter()) : e.filter;
|
|
1426
1426
|
if (e.or) {
|
|
1427
1427
|
var i = {}, u = function(d, p, y) {
|
|
@@ -1430,22 +1430,22 @@ function Ma() {
|
|
|
1430
1430
|
return p.stop(O);
|
|
1431
1431
|
}, function(O) {
|
|
1432
1432
|
return p.fail(O);
|
|
1433
|
-
}) || ((f = "" + (w = p.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(w)), ie(i, f) || (i[f] = !0,
|
|
1433
|
+
}) || ((f = "" + (w = p.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(w)), ie(i, f) || (i[f] = !0, r(d, p, y)));
|
|
1434
1434
|
};
|
|
1435
|
-
return Promise.all([e.or._iterate(u,
|
|
1435
|
+
return Promise.all([e.or._iterate(u, n), hn(fn(e, a, n), e.algorithm, u, !e.keysOnly && e.valueMapper)]);
|
|
1436
1436
|
}
|
|
1437
|
-
return
|
|
1437
|
+
return hn(fn(e, a, n), Ue(e.algorithm, s), r, !e.keysOnly && e.valueMapper);
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1439
|
+
function hn(e, r, n, a) {
|
|
1440
1440
|
var s = Z(a ? function(i, u, d) {
|
|
1441
|
-
return
|
|
1442
|
-
} :
|
|
1441
|
+
return n(a(i), u, d);
|
|
1442
|
+
} : n);
|
|
1443
1443
|
return e.then(function(i) {
|
|
1444
1444
|
if (i) return i.start(function() {
|
|
1445
1445
|
var u = function() {
|
|
1446
1446
|
return i.continue();
|
|
1447
1447
|
};
|
|
1448
|
-
|
|
1448
|
+
r && !r(i, function(d) {
|
|
1449
1449
|
return u = d;
|
|
1450
1450
|
}, function(d) {
|
|
1451
1451
|
i.stop(d), u = Q;
|
|
@@ -1457,21 +1457,21 @@ function Ma() {
|
|
|
1457
1457
|
});
|
|
1458
1458
|
});
|
|
1459
1459
|
}
|
|
1460
|
-
var pt = (
|
|
1461
|
-
var
|
|
1462
|
-
if (
|
|
1463
|
-
var
|
|
1464
|
-
if ($(
|
|
1465
|
-
if (typeof
|
|
1466
|
-
if (typeof
|
|
1467
|
-
return BigInt(e) +
|
|
1460
|
+
var pt = (gn.prototype.execute = function(e) {
|
|
1461
|
+
var r = this["@@propmod"];
|
|
1462
|
+
if (r.add !== void 0) {
|
|
1463
|
+
var n = r.add;
|
|
1464
|
+
if ($(n)) return g(g([], $(e) ? e : [], !0), n).sort();
|
|
1465
|
+
if (typeof n == "number") return (Number(e) || 0) + n;
|
|
1466
|
+
if (typeof n == "bigint") try {
|
|
1467
|
+
return BigInt(e) + n;
|
|
1468
1468
|
} catch {
|
|
1469
|
-
return BigInt(0) +
|
|
1469
|
+
return BigInt(0) + n;
|
|
1470
1470
|
}
|
|
1471
|
-
throw new TypeError("Invalid term ".concat(
|
|
1471
|
+
throw new TypeError("Invalid term ".concat(n));
|
|
1472
1472
|
}
|
|
1473
|
-
if (
|
|
1474
|
-
var a =
|
|
1473
|
+
if (r.remove !== void 0) {
|
|
1474
|
+
var a = r.remove;
|
|
1475
1475
|
if ($(a)) return $(e) ? e.filter(function(s) {
|
|
1476
1476
|
return !a.includes(s);
|
|
1477
1477
|
}).sort() : [];
|
|
@@ -1483,50 +1483,50 @@ function Ma() {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
throw new TypeError("Invalid subtrahend ".concat(a));
|
|
1485
1485
|
}
|
|
1486
|
-
return
|
|
1487
|
-
},
|
|
1488
|
-
function
|
|
1486
|
+
return n = (n = r.replacePrefix) === null || n === void 0 ? void 0 : n[0], n && typeof e == "string" && e.startsWith(n) ? r.replacePrefix[1] + e.substring(n.length) : e;
|
|
1487
|
+
}, gn);
|
|
1488
|
+
function gn(e) {
|
|
1489
1489
|
this["@@propmod"] = e;
|
|
1490
1490
|
}
|
|
1491
|
-
var oa = (V.prototype._read = function(e,
|
|
1492
|
-
var r = this._ctx;
|
|
1493
|
-
return r.error ? r.table._trans(null, q.bind(null, r.error)) : r.table._trans("readonly", e).then(n);
|
|
1494
|
-
}, V.prototype._write = function(e) {
|
|
1491
|
+
var oa = (V.prototype._read = function(e, r) {
|
|
1495
1492
|
var n = this._ctx;
|
|
1496
|
-
return n.error ? n.table._trans(null, q.bind(null, n.error)) : n.table._trans("
|
|
1493
|
+
return n.error ? n.table._trans(null, q.bind(null, n.error)) : n.table._trans("readonly", e).then(r);
|
|
1494
|
+
}, V.prototype._write = function(e) {
|
|
1495
|
+
var r = this._ctx;
|
|
1496
|
+
return r.error ? r.table._trans(null, q.bind(null, r.error)) : r.table._trans("readwrite", e, "locked");
|
|
1497
1497
|
}, V.prototype._addAlgorithm = function(e) {
|
|
1498
|
-
var
|
|
1499
|
-
|
|
1500
|
-
}, V.prototype._iterate = function(e,
|
|
1501
|
-
return Kt(this._ctx, e,
|
|
1498
|
+
var r = this._ctx;
|
|
1499
|
+
r.algorithm = Ue(r.algorithm, e);
|
|
1500
|
+
}, V.prototype._iterate = function(e, r) {
|
|
1501
|
+
return Kt(this._ctx, e, r, this._ctx.table.core);
|
|
1502
1502
|
}, V.prototype.clone = function(e) {
|
|
1503
|
-
var
|
|
1504
|
-
return e && te(
|
|
1503
|
+
var r = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1504
|
+
return e && te(n, e), r._ctx = n, r;
|
|
1505
1505
|
}, V.prototype.raw = function() {
|
|
1506
1506
|
return this._ctx.valueMapper = null, this;
|
|
1507
1507
|
}, V.prototype.each = function(e) {
|
|
1508
|
-
var
|
|
1509
|
-
return this._read(function(
|
|
1510
|
-
return Kt(
|
|
1508
|
+
var r = this._ctx;
|
|
1509
|
+
return this._read(function(n) {
|
|
1510
|
+
return Kt(r, e, n, r.table.core);
|
|
1511
1511
|
});
|
|
1512
1512
|
}, V.prototype.count = function(e) {
|
|
1513
|
-
var
|
|
1514
|
-
return this._read(function(
|
|
1515
|
-
var a =
|
|
1516
|
-
if (
|
|
1513
|
+
var r = this;
|
|
1514
|
+
return this._read(function(n) {
|
|
1515
|
+
var a = r._ctx, s = a.table.core;
|
|
1516
|
+
if (rt(a, !0)) return s.count({ trans: n, query: { index: Gt(a, s.schema), range: a.range } }).then(function(u) {
|
|
1517
1517
|
return Math.min(u, a.limit);
|
|
1518
1518
|
});
|
|
1519
1519
|
var i = 0;
|
|
1520
1520
|
return Kt(a, function() {
|
|
1521
1521
|
return ++i, !1;
|
|
1522
|
-
},
|
|
1522
|
+
}, n, s).then(function() {
|
|
1523
1523
|
return i;
|
|
1524
1524
|
});
|
|
1525
1525
|
}).then(e);
|
|
1526
|
-
}, V.prototype.sortBy = function(e,
|
|
1527
|
-
var
|
|
1526
|
+
}, V.prototype.sortBy = function(e, r) {
|
|
1527
|
+
var n = e.split(".").reverse(), a = n[0], s = n.length - 1;
|
|
1528
1528
|
function i(p, y) {
|
|
1529
|
-
return y ? i(p[
|
|
1529
|
+
return y ? i(p[n[y]], y - 1) : p[a];
|
|
1530
1530
|
}
|
|
1531
1531
|
var u = this._ctx.dir === "next" ? 1 : -1;
|
|
1532
1532
|
function d(p, y) {
|
|
@@ -1534,61 +1534,61 @@ function Ma() {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
return this.toArray(function(p) {
|
|
1536
1536
|
return p.sort(d);
|
|
1537
|
-
}).then(
|
|
1537
|
+
}).then(r);
|
|
1538
1538
|
}, V.prototype.toArray = function(e) {
|
|
1539
|
-
var
|
|
1540
|
-
return this._read(function(
|
|
1541
|
-
var a =
|
|
1542
|
-
if (a.dir === "next" &&
|
|
1539
|
+
var r = this;
|
|
1540
|
+
return this._read(function(n) {
|
|
1541
|
+
var a = r._ctx;
|
|
1542
|
+
if (a.dir === "next" && rt(a, !0) && 0 < a.limit) {
|
|
1543
1543
|
var s = a.valueMapper, i = Gt(a, a.table.core.schema);
|
|
1544
|
-
return a.table.core.query({ trans:
|
|
1544
|
+
return a.table.core.query({ trans: n, limit: a.limit, values: !0, query: { index: i, range: a.range } }).then(function(d) {
|
|
1545
1545
|
return d = d.result, s ? d.map(s) : d;
|
|
1546
1546
|
});
|
|
1547
1547
|
}
|
|
1548
1548
|
var u = [];
|
|
1549
1549
|
return Kt(a, function(d) {
|
|
1550
1550
|
return u.push(d);
|
|
1551
|
-
},
|
|
1551
|
+
}, n, a.table.core).then(function() {
|
|
1552
1552
|
return u;
|
|
1553
1553
|
});
|
|
1554
1554
|
}, e);
|
|
1555
1555
|
}, V.prototype.offset = function(e) {
|
|
1556
|
-
var
|
|
1557
|
-
return e <= 0 || (
|
|
1558
|
-
var
|
|
1556
|
+
var r = this._ctx;
|
|
1557
|
+
return e <= 0 || (r.offset += e, rt(r) ? br(r, function() {
|
|
1558
|
+
var n = e;
|
|
1559
1559
|
return function(a, s) {
|
|
1560
|
-
return
|
|
1561
|
-
a.advance(
|
|
1560
|
+
return n === 0 || (n === 1 ? --n : s(function() {
|
|
1561
|
+
a.advance(n), n = 0;
|
|
1562
1562
|
}), !1);
|
|
1563
1563
|
};
|
|
1564
|
-
}) :
|
|
1565
|
-
var
|
|
1564
|
+
}) : br(r, function() {
|
|
1565
|
+
var n = e;
|
|
1566
1566
|
return function() {
|
|
1567
|
-
return --
|
|
1567
|
+
return --n < 0;
|
|
1568
1568
|
};
|
|
1569
1569
|
})), this;
|
|
1570
1570
|
}, V.prototype.limit = function(e) {
|
|
1571
|
-
return this._ctx.limit = Math.min(this._ctx.limit, e),
|
|
1572
|
-
var
|
|
1573
|
-
return function(
|
|
1574
|
-
return --
|
|
1571
|
+
return this._ctx.limit = Math.min(this._ctx.limit, e), br(this._ctx, function() {
|
|
1572
|
+
var r = e;
|
|
1573
|
+
return function(n, a, s) {
|
|
1574
|
+
return --r <= 0 && a(s), 0 <= r;
|
|
1575
1575
|
};
|
|
1576
1576
|
}, !0), this;
|
|
1577
|
-
}, V.prototype.until = function(e,
|
|
1578
|
-
return
|
|
1579
|
-
return !e(
|
|
1577
|
+
}, V.prototype.until = function(e, r) {
|
|
1578
|
+
return yr(this._ctx, function(n, a, s) {
|
|
1579
|
+
return !e(n.value) || (a(s), r);
|
|
1580
1580
|
}), this;
|
|
1581
1581
|
}, V.prototype.first = function(e) {
|
|
1582
|
-
return this.limit(1).toArray(function(
|
|
1583
|
-
return
|
|
1582
|
+
return this.limit(1).toArray(function(r) {
|
|
1583
|
+
return r[0];
|
|
1584
1584
|
}).then(e);
|
|
1585
1585
|
}, V.prototype.last = function(e) {
|
|
1586
1586
|
return this.reverse().first(e);
|
|
1587
1587
|
}, V.prototype.filter = function(e) {
|
|
1588
|
-
var
|
|
1589
|
-
return
|
|
1590
|
-
return e(
|
|
1591
|
-
}), (
|
|
1588
|
+
var r;
|
|
1589
|
+
return yr(this._ctx, function(n) {
|
|
1590
|
+
return e(n.value);
|
|
1591
|
+
}), (r = this._ctx).isMatch = Ue(r.isMatch, e), this;
|
|
1592
1592
|
}, V.prototype.and = function(e) {
|
|
1593
1593
|
return this.filter(e);
|
|
1594
1594
|
}, V.prototype.or = function(e) {
|
|
@@ -1598,59 +1598,59 @@ function Ma() {
|
|
|
1598
1598
|
}, V.prototype.desc = function() {
|
|
1599
1599
|
return this.reverse();
|
|
1600
1600
|
}, V.prototype.eachKey = function(e) {
|
|
1601
|
-
var
|
|
1602
|
-
return
|
|
1601
|
+
var r = this._ctx;
|
|
1602
|
+
return r.keysOnly = !r.isMatch, this.each(function(n, a) {
|
|
1603
1603
|
e(a.key, a);
|
|
1604
1604
|
});
|
|
1605
1605
|
}, V.prototype.eachUniqueKey = function(e) {
|
|
1606
1606
|
return this._ctx.unique = "unique", this.eachKey(e);
|
|
1607
1607
|
}, V.prototype.eachPrimaryKey = function(e) {
|
|
1608
|
-
var
|
|
1609
|
-
return
|
|
1608
|
+
var r = this._ctx;
|
|
1609
|
+
return r.keysOnly = !r.isMatch, this.each(function(n, a) {
|
|
1610
1610
|
e(a.primaryKey, a);
|
|
1611
1611
|
});
|
|
1612
1612
|
}, V.prototype.keys = function(e) {
|
|
1613
|
-
var
|
|
1614
|
-
|
|
1615
|
-
var
|
|
1613
|
+
var r = this._ctx;
|
|
1614
|
+
r.keysOnly = !r.isMatch;
|
|
1615
|
+
var n = [];
|
|
1616
1616
|
return this.each(function(a, s) {
|
|
1617
|
-
|
|
1617
|
+
n.push(s.key);
|
|
1618
1618
|
}).then(function() {
|
|
1619
|
-
return
|
|
1619
|
+
return n;
|
|
1620
1620
|
}).then(e);
|
|
1621
1621
|
}, V.prototype.primaryKeys = function(e) {
|
|
1622
|
-
var
|
|
1623
|
-
if (
|
|
1624
|
-
var s = Gt(
|
|
1625
|
-
return
|
|
1622
|
+
var r = this._ctx;
|
|
1623
|
+
if (r.dir === "next" && rt(r, !0) && 0 < r.limit) return this._read(function(a) {
|
|
1624
|
+
var s = Gt(r, r.table.core.schema);
|
|
1625
|
+
return r.table.core.query({ trans: a, values: !1, limit: r.limit, query: { index: s, range: r.range } });
|
|
1626
1626
|
}).then(function(a) {
|
|
1627
1627
|
return a.result;
|
|
1628
1628
|
}).then(e);
|
|
1629
|
-
|
|
1630
|
-
var
|
|
1629
|
+
r.keysOnly = !r.isMatch;
|
|
1630
|
+
var n = [];
|
|
1631
1631
|
return this.each(function(a, s) {
|
|
1632
|
-
|
|
1632
|
+
n.push(s.primaryKey);
|
|
1633
1633
|
}).then(function() {
|
|
1634
|
-
return
|
|
1634
|
+
return n;
|
|
1635
1635
|
}).then(e);
|
|
1636
1636
|
}, V.prototype.uniqueKeys = function(e) {
|
|
1637
1637
|
return this._ctx.unique = "unique", this.keys(e);
|
|
1638
1638
|
}, V.prototype.firstKey = function(e) {
|
|
1639
|
-
return this.limit(1).keys(function(
|
|
1640
|
-
return
|
|
1639
|
+
return this.limit(1).keys(function(r) {
|
|
1640
|
+
return r[0];
|
|
1641
1641
|
}).then(e);
|
|
1642
1642
|
}, V.prototype.lastKey = function(e) {
|
|
1643
1643
|
return this.reverse().firstKey(e);
|
|
1644
1644
|
}, V.prototype.distinct = function() {
|
|
1645
1645
|
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
1646
1646
|
if (!e || !e.multi) return this;
|
|
1647
|
-
var
|
|
1648
|
-
return
|
|
1649
|
-
var a = s.primaryKey.toString(), s = ie(
|
|
1650
|
-
return
|
|
1647
|
+
var r = {};
|
|
1648
|
+
return yr(this._ctx, function(s) {
|
|
1649
|
+
var a = s.primaryKey.toString(), s = ie(r, a);
|
|
1650
|
+
return r[a] = !0, !s;
|
|
1651
1651
|
}), this;
|
|
1652
1652
|
}, V.prototype.modify = function(e) {
|
|
1653
|
-
var
|
|
1653
|
+
var r = this, n = this._ctx;
|
|
1654
1654
|
return this._write(function(a) {
|
|
1655
1655
|
var s, i, u;
|
|
1656
1656
|
u = typeof e == "function" ? e : (s = x(e), i = s.length, function(v) {
|
|
@@ -1660,7 +1660,7 @@ function Ma() {
|
|
|
1660
1660
|
}
|
|
1661
1661
|
return A;
|
|
1662
1662
|
});
|
|
1663
|
-
var d =
|
|
1663
|
+
var d = n.table.core, f = d.schema.primaryKey, p = f.outbound, y = f.extractKey, w = 200, f = r.db._options.modifyChunkSize;
|
|
1664
1664
|
f && (w = typeof f == "object" ? f[d.name] || f["*"] || 200 : f);
|
|
1665
1665
|
function O(v, D) {
|
|
1666
1666
|
var P = D.failures, D = D.numFailures;
|
|
@@ -1671,7 +1671,7 @@ function Ma() {
|
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
1673
|
var m = [], E = 0, S = [];
|
|
1674
|
-
return
|
|
1674
|
+
return r.clone().primaryKeys().then(function(v) {
|
|
1675
1675
|
function A(D) {
|
|
1676
1676
|
var I = Math.min(w, v.length - D);
|
|
1677
1677
|
return d.getMany({ trans: a, keys: v.slice(D, D + I), cache: "immutable" }).then(function(N) {
|
|
@@ -1687,7 +1687,7 @@ function Ma() {
|
|
|
1687
1687
|
return O(R.length, U);
|
|
1688
1688
|
});
|
|
1689
1689
|
}).then(function() {
|
|
1690
|
-
return (0 < j.length || P && e ===
|
|
1690
|
+
return (0 < j.length || P && e === vr) && d.mutate({ trans: a, type: "delete", keys: j, criteria: P, isAdditionalChunk: 0 < D }).then(function(U) {
|
|
1691
1691
|
return O(j.length, U);
|
|
1692
1692
|
});
|
|
1693
1693
|
}).then(function() {
|
|
@@ -1695,7 +1695,7 @@ function Ma() {
|
|
|
1695
1695
|
});
|
|
1696
1696
|
});
|
|
1697
1697
|
}
|
|
1698
|
-
var P =
|
|
1698
|
+
var P = rt(n) && n.limit === 1 / 0 && (typeof e != "function" || e === vr) && { index: n.index, range: n.range };
|
|
1699
1699
|
return A(0).then(function() {
|
|
1700
1700
|
if (0 < m.length) throw new Pt("Error modifying one or more objects", m, E, S);
|
|
1701
1701
|
return v.length;
|
|
@@ -1703,11 +1703,11 @@ function Ma() {
|
|
|
1703
1703
|
});
|
|
1704
1704
|
});
|
|
1705
1705
|
}, V.prototype.delete = function() {
|
|
1706
|
-
var e = this._ctx,
|
|
1707
|
-
return
|
|
1708
|
-
var a = e.table.core.schema.primaryKey, s =
|
|
1709
|
-
return e.table.core.count({ trans:
|
|
1710
|
-
return e.table.core.mutate({ trans:
|
|
1706
|
+
var e = this._ctx, r = e.range;
|
|
1707
|
+
return rt(e) && (e.isPrimKey || r.type === 3) ? this._write(function(n) {
|
|
1708
|
+
var a = e.table.core.schema.primaryKey, s = r;
|
|
1709
|
+
return e.table.core.count({ trans: n, query: { index: a, range: s } }).then(function(i) {
|
|
1710
|
+
return e.table.core.mutate({ trans: n, type: "deleteRange", range: s }).then(function(u) {
|
|
1711
1711
|
var d = u.failures;
|
|
1712
1712
|
if (u.lastResult, u.results, u = u.numFailures, u) throw new Pt("Could not delete some values", Object.keys(d).map(function(p) {
|
|
1713
1713
|
return d[p];
|
|
@@ -1715,32 +1715,32 @@ function Ma() {
|
|
|
1715
1715
|
return i - u;
|
|
1716
1716
|
});
|
|
1717
1717
|
});
|
|
1718
|
-
}) : this.modify(
|
|
1718
|
+
}) : this.modify(vr);
|
|
1719
1719
|
}, V);
|
|
1720
1720
|
function V() {
|
|
1721
1721
|
}
|
|
1722
|
-
var
|
|
1723
|
-
return
|
|
1722
|
+
var vr = function(e, r) {
|
|
1723
|
+
return r.value = null;
|
|
1724
1724
|
};
|
|
1725
|
-
function ia(e,
|
|
1726
|
-
return e <
|
|
1725
|
+
function ia(e, r) {
|
|
1726
|
+
return e < r ? -1 : e === r ? 0 : 1;
|
|
1727
1727
|
}
|
|
1728
|
-
function ca(e,
|
|
1729
|
-
return
|
|
1728
|
+
function ca(e, r) {
|
|
1729
|
+
return r < e ? -1 : e === r ? 0 : 1;
|
|
1730
1730
|
}
|
|
1731
|
-
function le(e,
|
|
1732
|
-
return e = e instanceof
|
|
1731
|
+
function le(e, r, n) {
|
|
1732
|
+
return e = e instanceof mn ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(r), e;
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1734
|
+
function nt(e) {
|
|
1735
1735
|
return new e.Collection(e, function() {
|
|
1736
|
-
return
|
|
1736
|
+
return pn("");
|
|
1737
1737
|
}).limit(0);
|
|
1738
1738
|
}
|
|
1739
|
-
function Bt(e,
|
|
1740
|
-
var s, i, u, d, p, y, w, f =
|
|
1741
|
-
if (!
|
|
1739
|
+
function Bt(e, r, n, a) {
|
|
1740
|
+
var s, i, u, d, p, y, w, f = n.length;
|
|
1741
|
+
if (!n.every(function(E) {
|
|
1742
1742
|
return typeof E == "string";
|
|
1743
|
-
})) return le(e,
|
|
1743
|
+
})) return le(e, sn);
|
|
1744
1744
|
function O(E) {
|
|
1745
1745
|
s = E === "next" ? function(v) {
|
|
1746
1746
|
return v.toUpperCase();
|
|
@@ -1751,7 +1751,7 @@ function Ma() {
|
|
|
1751
1751
|
} : function(v) {
|
|
1752
1752
|
return v.toUpperCase();
|
|
1753
1753
|
}, u = E === "next" ? ia : ca;
|
|
1754
|
-
var S =
|
|
1754
|
+
var S = n.map(function(v) {
|
|
1755
1755
|
return { lower: i(v), upper: s(v) };
|
|
1756
1756
|
}).sort(function(v, A) {
|
|
1757
1757
|
return u(v.lower, A.lower);
|
|
@@ -1772,7 +1772,7 @@ function Ma() {
|
|
|
1772
1772
|
var A = E.key;
|
|
1773
1773
|
if (typeof A != "string") return !1;
|
|
1774
1774
|
var P = i(A);
|
|
1775
|
-
if (
|
|
1775
|
+
if (r(P, p, m)) return !0;
|
|
1776
1776
|
for (var D = null, I = m; I < f; ++I) {
|
|
1777
1777
|
var N = function(C, R, T, j, k, G) {
|
|
1778
1778
|
for (var F = Math.min(C.length, j.length), U = -1, z = 0; z < F; ++z) {
|
|
@@ -1789,89 +1789,89 @@ function Ma() {
|
|
|
1789
1789
|
} : v), !1;
|
|
1790
1790
|
}), e;
|
|
1791
1791
|
}
|
|
1792
|
-
function Re(e,
|
|
1793
|
-
return { type: 2, lower: e, upper:
|
|
1792
|
+
function Re(e, r, n, a) {
|
|
1793
|
+
return { type: 2, lower: e, upper: r, lowerOpen: n, upperOpen: a };
|
|
1794
1794
|
}
|
|
1795
|
-
function
|
|
1795
|
+
function pn(e) {
|
|
1796
1796
|
return { type: 1, lower: e, upper: e };
|
|
1797
1797
|
}
|
|
1798
|
-
var
|
|
1798
|
+
var mn = (Object.defineProperty(ne.prototype, "Collection", { get: function() {
|
|
1799
1799
|
return this._ctx.table.db.Collection;
|
|
1800
|
-
}, enumerable: !1, configurable: !0 }),
|
|
1801
|
-
|
|
1800
|
+
}, enumerable: !1, configurable: !0 }), ne.prototype.between = function(e, r, n, a) {
|
|
1801
|
+
n = n !== !1, a = a === !0;
|
|
1802
1802
|
try {
|
|
1803
|
-
return 0 < this._cmp(e,
|
|
1804
|
-
return Re(e,
|
|
1803
|
+
return 0 < this._cmp(e, r) || this._cmp(e, r) === 0 && (n || a) && (!n || !a) ? nt(this) : new this.Collection(this, function() {
|
|
1804
|
+
return Re(e, r, !n, !a);
|
|
1805
1805
|
});
|
|
1806
1806
|
} catch {
|
|
1807
1807
|
return le(this, we);
|
|
1808
1808
|
}
|
|
1809
|
-
},
|
|
1809
|
+
}, ne.prototype.equals = function(e) {
|
|
1810
1810
|
return e == null ? le(this, we) : new this.Collection(this, function() {
|
|
1811
|
-
return
|
|
1811
|
+
return pn(e);
|
|
1812
1812
|
});
|
|
1813
|
-
},
|
|
1813
|
+
}, ne.prototype.above = function(e) {
|
|
1814
1814
|
return e == null ? le(this, we) : new this.Collection(this, function() {
|
|
1815
1815
|
return Re(e, void 0, !0);
|
|
1816
1816
|
});
|
|
1817
|
-
},
|
|
1817
|
+
}, ne.prototype.aboveOrEqual = function(e) {
|
|
1818
1818
|
return e == null ? le(this, we) : new this.Collection(this, function() {
|
|
1819
1819
|
return Re(e, void 0, !1);
|
|
1820
1820
|
});
|
|
1821
|
-
},
|
|
1821
|
+
}, ne.prototype.below = function(e) {
|
|
1822
1822
|
return e == null ? le(this, we) : new this.Collection(this, function() {
|
|
1823
1823
|
return Re(void 0, e, !1, !0);
|
|
1824
1824
|
});
|
|
1825
|
-
},
|
|
1825
|
+
}, ne.prototype.belowOrEqual = function(e) {
|
|
1826
1826
|
return e == null ? le(this, we) : new this.Collection(this, function() {
|
|
1827
1827
|
return Re(void 0, e);
|
|
1828
1828
|
});
|
|
1829
|
-
},
|
|
1830
|
-
return typeof e != "string" ? le(this,
|
|
1831
|
-
},
|
|
1832
|
-
return e === "" ? this.startsWith(e) : Bt(this, function(
|
|
1833
|
-
return
|
|
1829
|
+
}, ne.prototype.startsWith = function(e) {
|
|
1830
|
+
return typeof e != "string" ? le(this, sn) : this.between(e, e + Fe, !0, !0);
|
|
1831
|
+
}, ne.prototype.startsWithIgnoreCase = function(e) {
|
|
1832
|
+
return e === "" ? this.startsWith(e) : Bt(this, function(r, n) {
|
|
1833
|
+
return r.indexOf(n[0]) === 0;
|
|
1834
1834
|
}, [e], Fe);
|
|
1835
|
-
},
|
|
1836
|
-
return Bt(this, function(
|
|
1837
|
-
return
|
|
1835
|
+
}, ne.prototype.equalsIgnoreCase = function(e) {
|
|
1836
|
+
return Bt(this, function(r, n) {
|
|
1837
|
+
return r === n[0];
|
|
1838
1838
|
}, [e], "");
|
|
1839
|
-
},
|
|
1839
|
+
}, ne.prototype.anyOfIgnoreCase = function() {
|
|
1840
1840
|
var e = Ee.apply(Qe, arguments);
|
|
1841
|
-
return e.length === 0 ?
|
|
1842
|
-
return
|
|
1841
|
+
return e.length === 0 ? nt(this) : Bt(this, function(r, n) {
|
|
1842
|
+
return n.indexOf(r) !== -1;
|
|
1843
1843
|
}, e, "");
|
|
1844
|
-
},
|
|
1844
|
+
}, ne.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1845
1845
|
var e = Ee.apply(Qe, arguments);
|
|
1846
|
-
return e.length === 0 ?
|
|
1847
|
-
return
|
|
1848
|
-
return
|
|
1846
|
+
return e.length === 0 ? nt(this) : Bt(this, function(r, n) {
|
|
1847
|
+
return n.some(function(a) {
|
|
1848
|
+
return r.indexOf(a) === 0;
|
|
1849
1849
|
});
|
|
1850
1850
|
}, e, Fe);
|
|
1851
|
-
},
|
|
1852
|
-
var e = this,
|
|
1851
|
+
}, ne.prototype.anyOf = function() {
|
|
1852
|
+
var e = this, r = Ee.apply(Qe, arguments), n = this._cmp;
|
|
1853
1853
|
try {
|
|
1854
|
-
|
|
1854
|
+
r.sort(n);
|
|
1855
1855
|
} catch {
|
|
1856
1856
|
return le(this, we);
|
|
1857
1857
|
}
|
|
1858
|
-
if (
|
|
1858
|
+
if (r.length === 0) return nt(this);
|
|
1859
1859
|
var a = new this.Collection(this, function() {
|
|
1860
|
-
return Re(
|
|
1860
|
+
return Re(r[0], r[r.length - 1]);
|
|
1861
1861
|
});
|
|
1862
1862
|
a._ondirectionchange = function(i) {
|
|
1863
|
-
|
|
1863
|
+
n = i === "next" ? e._ascending : e._descending, r.sort(n);
|
|
1864
1864
|
};
|
|
1865
1865
|
var s = 0;
|
|
1866
1866
|
return a._addAlgorithm(function(i, u, d) {
|
|
1867
|
-
for (var p = i.key; 0 <
|
|
1868
|
-
return
|
|
1869
|
-
i.continue(
|
|
1867
|
+
for (var p = i.key; 0 < n(p, r[s]); ) if (++s === r.length) return u(d), !1;
|
|
1868
|
+
return n(p, r[s]) === 0 || (u(function() {
|
|
1869
|
+
i.continue(r[s]);
|
|
1870
1870
|
}), !1);
|
|
1871
1871
|
}), a;
|
|
1872
|
-
},
|
|
1872
|
+
}, ne.prototype.notEqual = function(e) {
|
|
1873
1873
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1874
|
-
},
|
|
1874
|
+
}, ne.prototype.noneOf = function() {
|
|
1875
1875
|
var e = Ee.apply(Qe, arguments);
|
|
1876
1876
|
if (e.length === 0) return new this.Collection(this);
|
|
1877
1877
|
try {
|
|
@@ -1879,17 +1879,17 @@ function Ma() {
|
|
|
1879
1879
|
} catch {
|
|
1880
1880
|
return le(this, we);
|
|
1881
1881
|
}
|
|
1882
|
-
var
|
|
1883
|
-
return
|
|
1882
|
+
var r = e.reduce(function(n, a) {
|
|
1883
|
+
return n ? n.concat([[n[n.length - 1][1], a]]) : [[-1 / 0, a]];
|
|
1884
1884
|
}, null);
|
|
1885
|
-
return
|
|
1886
|
-
},
|
|
1887
|
-
var
|
|
1888
|
-
if (A.length === 0) return
|
|
1885
|
+
return r.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(r, { includeLowers: !1, includeUppers: !1 });
|
|
1886
|
+
}, ne.prototype.inAnyRange = function(A, r) {
|
|
1887
|
+
var n = this, a = this._cmp, s = this._ascending, i = this._descending, u = this._min, d = this._max;
|
|
1888
|
+
if (A.length === 0) return nt(this);
|
|
1889
1889
|
if (!A.every(function(P) {
|
|
1890
1890
|
return P[0] !== void 0 && P[1] !== void 0 && s(P[0], P[1]) <= 0;
|
|
1891
1891
|
})) return le(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", L.InvalidArgument);
|
|
1892
|
-
var p = !
|
|
1892
|
+
var p = !r || r.includeLowers !== !1, y = r && r.includeUppers === !0, w, f = s;
|
|
1893
1893
|
function O(P, D) {
|
|
1894
1894
|
return f(P[0], D[0]);
|
|
1895
1895
|
}
|
|
@@ -1922,29 +1922,29 @@ function Ma() {
|
|
|
1922
1922
|
f = P === "next" ? (v = E, s) : (v = S, i), w.sort(O);
|
|
1923
1923
|
}, A._addAlgorithm(function(P, D, I) {
|
|
1924
1924
|
for (var N, C = P.key; v(C); ) if (++m === w.length) return D(I), !1;
|
|
1925
|
-
return !E(N = C) && !S(N) || (
|
|
1925
|
+
return !E(N = C) && !S(N) || (n._cmp(C, w[m][1]) === 0 || n._cmp(C, w[m][0]) === 0 || D(function() {
|
|
1926
1926
|
f === s ? P.continue(w[m][0]) : P.continue(w[m][1]);
|
|
1927
1927
|
}), !1);
|
|
1928
1928
|
}), A;
|
|
1929
|
-
},
|
|
1929
|
+
}, ne.prototype.startsWithAnyOf = function() {
|
|
1930
1930
|
var e = Ee.apply(Qe, arguments);
|
|
1931
|
-
return e.every(function(
|
|
1932
|
-
return typeof
|
|
1933
|
-
}) ? e.length === 0 ?
|
|
1934
|
-
return [
|
|
1931
|
+
return e.every(function(r) {
|
|
1932
|
+
return typeof r == "string";
|
|
1933
|
+
}) ? e.length === 0 ? nt(this) : this.inAnyRange(e.map(function(r) {
|
|
1934
|
+
return [r, r + Fe];
|
|
1935
1935
|
})) : le(this, "startsWithAnyOf() only works with strings");
|
|
1936
|
-
},
|
|
1937
|
-
function
|
|
1936
|
+
}, ne);
|
|
1937
|
+
function ne() {
|
|
1938
1938
|
}
|
|
1939
1939
|
function me(e) {
|
|
1940
|
-
return Z(function(
|
|
1941
|
-
return mt(
|
|
1940
|
+
return Z(function(r) {
|
|
1941
|
+
return mt(r), e(r.target.error), !1;
|
|
1942
1942
|
});
|
|
1943
1943
|
}
|
|
1944
1944
|
function mt(e) {
|
|
1945
1945
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1946
1946
|
}
|
|
1947
|
-
var yt = "storagemutated",
|
|
1947
|
+
var yt = "storagemutated", Er = "x-storagemutated-1", Te = ht(null, yt), ua = (ye.prototype._lock = function() {
|
|
1948
1948
|
return ot(!B.global), ++this._reculock, this._reculock !== 1 || B.global || (B.lockOwnerFor = this), this;
|
|
1949
1949
|
}, ye.prototype._unlock = function() {
|
|
1950
1950
|
if (ot(!B.global), --this._reculock == 0) for (B.global || (B.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
@@ -1958,10 +1958,10 @@ function Ma() {
|
|
|
1958
1958
|
}, ye.prototype._locked = function() {
|
|
1959
1959
|
return this._reculock && B.lockOwnerFor !== this;
|
|
1960
1960
|
}, ye.prototype.create = function(e) {
|
|
1961
|
-
var
|
|
1961
|
+
var r = this;
|
|
1962
1962
|
if (!this.mode) return this;
|
|
1963
|
-
var
|
|
1964
|
-
if (ot(!this.idbtrans), !e && !
|
|
1963
|
+
var n = this.db.idbdb, a = this.db._state.dbOpenError;
|
|
1964
|
+
if (ot(!this.idbtrans), !e && !n) switch (a && a.name) {
|
|
1965
1965
|
case "DatabaseClosedError":
|
|
1966
1966
|
throw new L.DatabaseClosed(a);
|
|
1967
1967
|
case "MissingAPIError":
|
|
@@ -1970,26 +1970,26 @@ function Ma() {
|
|
|
1970
1970
|
throw new L.OpenFailed(a);
|
|
1971
1971
|
}
|
|
1972
1972
|
if (!this.active) throw new L.TransactionInactive();
|
|
1973
|
-
return ot(this._completion._state === null), (e = this.idbtrans = e || (this.db.core ||
|
|
1974
|
-
mt(s),
|
|
1973
|
+
return ot(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = Z(function(s) {
|
|
1974
|
+
mt(s), r._reject(e.error);
|
|
1975
1975
|
}), e.onabort = Z(function(s) {
|
|
1976
|
-
mt(s),
|
|
1976
|
+
mt(s), r.active && r._reject(new L.Abort(e.error)), r.active = !1, r.on("abort").fire(s);
|
|
1977
1977
|
}), e.oncomplete = Z(function() {
|
|
1978
|
-
|
|
1978
|
+
r.active = !1, r._resolve(), "mutatedParts" in e && Te.storagemutated.fire(e.mutatedParts);
|
|
1979
1979
|
}), this;
|
|
1980
|
-
}, ye.prototype._promise = function(e,
|
|
1980
|
+
}, ye.prototype._promise = function(e, r, n) {
|
|
1981
1981
|
var a = this;
|
|
1982
1982
|
if (e === "readwrite" && this.mode !== "readwrite") return q(new L.ReadOnly("Transaction is readonly"));
|
|
1983
1983
|
if (!this.active) return q(new L.TransactionInactive());
|
|
1984
1984
|
if (this._locked()) return new M(function(i, u) {
|
|
1985
1985
|
a._blockedFuncs.push([function() {
|
|
1986
|
-
a._promise(e,
|
|
1986
|
+
a._promise(e, r, n).then(i, u);
|
|
1987
1987
|
}, B]);
|
|
1988
1988
|
});
|
|
1989
|
-
if (
|
|
1989
|
+
if (n) return De(function() {
|
|
1990
1990
|
var i = new M(function(u, d) {
|
|
1991
1991
|
a._lock();
|
|
1992
|
-
var p =
|
|
1992
|
+
var p = r(u, d, a);
|
|
1993
1993
|
p && p.then && p.then(u, d);
|
|
1994
1994
|
});
|
|
1995
1995
|
return i.finally(function() {
|
|
@@ -1997,51 +1997,51 @@ function Ma() {
|
|
|
1997
1997
|
}), i._lib = !0, i;
|
|
1998
1998
|
});
|
|
1999
1999
|
var s = new M(function(i, u) {
|
|
2000
|
-
var d =
|
|
2000
|
+
var d = r(i, u, a);
|
|
2001
2001
|
d && d.then && d.then(i, u);
|
|
2002
2002
|
});
|
|
2003
2003
|
return s._lib = !0, s;
|
|
2004
2004
|
}, ye.prototype._root = function() {
|
|
2005
2005
|
return this.parent ? this.parent._root() : this;
|
|
2006
2006
|
}, ye.prototype.waitFor = function(e) {
|
|
2007
|
-
var
|
|
2008
|
-
|
|
2007
|
+
var r, n = this._root(), a = M.resolve(e);
|
|
2008
|
+
n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
|
|
2009
2009
|
return a;
|
|
2010
|
-
}) : (
|
|
2011
|
-
for (++
|
|
2012
|
-
|
|
2010
|
+
}) : (n._waitingFor = a, n._waitingQueue = [], r = n.idbtrans.objectStore(n.storeNames[0]), function i() {
|
|
2011
|
+
for (++n._spinCount; n._waitingQueue.length; ) n._waitingQueue.shift()();
|
|
2012
|
+
n._waitingFor && (r.get(-1 / 0).onsuccess = i);
|
|
2013
2013
|
}());
|
|
2014
|
-
var s =
|
|
2014
|
+
var s = n._waitingFor;
|
|
2015
2015
|
return new M(function(i, u) {
|
|
2016
2016
|
a.then(function(d) {
|
|
2017
|
-
return
|
|
2017
|
+
return n._waitingQueue.push(Z(i.bind(null, d)));
|
|
2018
2018
|
}, function(d) {
|
|
2019
|
-
return
|
|
2019
|
+
return n._waitingQueue.push(Z(u.bind(null, d)));
|
|
2020
2020
|
}).finally(function() {
|
|
2021
|
-
|
|
2021
|
+
n._waitingFor === s && (n._waitingFor = null);
|
|
2022
2022
|
});
|
|
2023
2023
|
});
|
|
2024
2024
|
}, ye.prototype.abort = function() {
|
|
2025
2025
|
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new L.Abort()));
|
|
2026
2026
|
}, ye.prototype.table = function(e) {
|
|
2027
|
-
var
|
|
2028
|
-
if (ie(
|
|
2029
|
-
var
|
|
2030
|
-
if (!
|
|
2031
|
-
return
|
|
2027
|
+
var r = this._memoizedTables || (this._memoizedTables = {});
|
|
2028
|
+
if (ie(r, e)) return r[e];
|
|
2029
|
+
var n = this.schema[e];
|
|
2030
|
+
if (!n) throw new L.NotFound("Table " + e + " not part of transaction");
|
|
2031
|
+
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), r[e] = n;
|
|
2032
2032
|
}, ye);
|
|
2033
2033
|
function ye() {
|
|
2034
2034
|
}
|
|
2035
|
-
function
|
|
2036
|
-
return { name: e, keyPath:
|
|
2035
|
+
function wr(e, r, n, a, s, i, u) {
|
|
2036
|
+
return { name: e, keyPath: r, unique: n, multi: a, auto: s, compound: i, src: (n && !u ? "&" : "") + (a ? "*" : "") + (s ? "++" : "") + yn(r) };
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2038
|
+
function yn(e) {
|
|
2039
2039
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
2040
2040
|
}
|
|
2041
|
-
function
|
|
2042
|
-
return { name: e, primKey:
|
|
2041
|
+
function Sr(e, r, n) {
|
|
2042
|
+
return { name: e, primKey: r, indexes: n, mappedClass: null, idxByName: (a = function(s) {
|
|
2043
2043
|
return [s.name, s];
|
|
2044
|
-
},
|
|
2044
|
+
}, n.reduce(function(s, i, u) {
|
|
2045
2045
|
return u = a(i, u), u && (s[u[0]] = u[1]), s;
|
|
2046
2046
|
}, {})) };
|
|
2047
2047
|
var a;
|
|
@@ -2057,30 +2057,30 @@ function Ma() {
|
|
|
2057
2057
|
}, Fe;
|
|
2058
2058
|
}
|
|
2059
2059
|
};
|
|
2060
|
-
function
|
|
2060
|
+
function Or(e) {
|
|
2061
2061
|
return e == null ? function() {
|
|
2062
|
-
} : typeof e == "string" ? (
|
|
2063
|
-
return r
|
|
2064
|
-
} : function(
|
|
2065
|
-
return ve(
|
|
2066
|
-
} : function(
|
|
2067
|
-
return ve(
|
|
2062
|
+
} : typeof e == "string" ? (r = e).split(".").length === 1 ? function(n) {
|
|
2063
|
+
return n[r];
|
|
2064
|
+
} : function(n) {
|
|
2065
|
+
return ve(n, r);
|
|
2066
|
+
} : function(n) {
|
|
2067
|
+
return ve(n, e);
|
|
2068
2068
|
};
|
|
2069
|
-
var
|
|
2069
|
+
var r;
|
|
2070
2070
|
}
|
|
2071
|
-
function
|
|
2071
|
+
function bn(e) {
|
|
2072
2072
|
return [].slice.call(e);
|
|
2073
2073
|
}
|
|
2074
2074
|
var la = 0;
|
|
2075
2075
|
function vt(e) {
|
|
2076
2076
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
2077
2077
|
}
|
|
2078
|
-
function da(e,
|
|
2078
|
+
function da(e, r, p) {
|
|
2079
2079
|
function a(v) {
|
|
2080
2080
|
if (v.type === 3) return null;
|
|
2081
2081
|
if (v.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
2082
2082
|
var m = v.lower, E = v.upper, S = v.lowerOpen, v = v.upperOpen;
|
|
2083
|
-
return m === void 0 ? E === void 0 ? null :
|
|
2083
|
+
return m === void 0 ? E === void 0 ? null : r.upperBound(E, !!v) : E === void 0 ? r.lowerBound(m, !!S) : r.bound(m, E, !!S, !!v);
|
|
2084
2084
|
}
|
|
2085
2085
|
function s(O) {
|
|
2086
2086
|
var m, E = O.name;
|
|
@@ -2106,8 +2106,8 @@ function Ma() {
|
|
|
2106
2106
|
else for (oe = 0; oe < G; ++oe) U.push(k = R[A](W[oe])), k.onerror = F;
|
|
2107
2107
|
}
|
|
2108
2108
|
function qt(ce) {
|
|
2109
|
-
ce = ce.target.result, U.forEach(function(Ve,
|
|
2110
|
-
return Ve.error != null && (z[
|
|
2109
|
+
ce = ce.target.result, U.forEach(function(Ve, Lr) {
|
|
2110
|
+
return Ve.error != null && (z[Lr] = Ve.error);
|
|
2111
2111
|
}), N({ numFailures: de, failures: z, results: A === "delete" ? P : U.map(function(Ve) {
|
|
2112
2112
|
return Ve.result;
|
|
2113
2113
|
}), lastResult: ce });
|
|
@@ -2176,8 +2176,8 @@ function Ma() {
|
|
|
2176
2176
|
}, W.stop();
|
|
2177
2177
|
}
|
|
2178
2178
|
var qt = new Promise(function(ce, Ve) {
|
|
2179
|
-
ce = Z(ce), k.onerror = me(Ve), W.fail = Ve, W.stop = function(
|
|
2180
|
-
W.stop = W.continue = W.continuePrimaryKey = W.advance = de, ce(
|
|
2179
|
+
ce = Z(ce), k.onerror = me(Ve), W.fail = Ve, W.stop = function(Lr) {
|
|
2180
|
+
W.stop = W.continue = W.continuePrimaryKey = W.advance = de, ce(Lr);
|
|
2181
2181
|
};
|
|
2182
2182
|
});
|
|
2183
2183
|
return k.onsuccess = Z(function(ce) {
|
|
@@ -2196,13 +2196,13 @@ function Ma() {
|
|
|
2196
2196
|
});
|
|
2197
2197
|
} };
|
|
2198
2198
|
}
|
|
2199
|
-
var i, u, d, w = (u = p, d =
|
|
2199
|
+
var i, u, d, w = (u = p, d = bn((i = e).objectStoreNames), { schema: { name: i.name, tables: d.map(function(O) {
|
|
2200
2200
|
return u.objectStore(O);
|
|
2201
2201
|
}).map(function(O) {
|
|
2202
|
-
var m = O.keyPath, v = O.autoIncrement, E = $(m), S = {}, v = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: m == null, compound: E, keyPath: m, autoIncrement: v, unique: !0, extractKey:
|
|
2202
|
+
var m = O.keyPath, v = O.autoIncrement, E = $(m), S = {}, v = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: m == null, compound: E, keyPath: m, autoIncrement: v, unique: !0, extractKey: Or(m) }, indexes: bn(O.indexNames).map(function(A) {
|
|
2203
2203
|
return O.index(A);
|
|
2204
2204
|
}).map(function(I) {
|
|
2205
|
-
var P = I.name, D = I.unique, N = I.multiEntry, I = I.keyPath, N = { name: P, compound: $(I), keyPath: I, unique: D, multiEntry: N, extractKey:
|
|
2205
|
+
var P = I.name, D = I.unique, N = I.multiEntry, I = I.keyPath, N = { name: P, compound: $(I), keyPath: I, unique: D, multiEntry: N, extractKey: Or(I) };
|
|
2206
2206
|
return S[vt(I)] = N;
|
|
2207
2207
|
}), getIndexByKeyPath: function(A) {
|
|
2208
2208
|
return S[vt(A)];
|
|
@@ -2214,16 +2214,16 @@ function Ma() {
|
|
|
2214
2214
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(O) {
|
|
2215
2215
|
if (!f[O]) throw new Error("Table '".concat(O, "' not found"));
|
|
2216
2216
|
return f[O];
|
|
2217
|
-
}, MIN_KEY: -1 / 0, MAX_KEY: bt(
|
|
2217
|
+
}, MIN_KEY: -1 / 0, MAX_KEY: bt(r), schema: p };
|
|
2218
2218
|
}
|
|
2219
|
-
function fa(e,
|
|
2220
|
-
var s =
|
|
2221
|
-
return
|
|
2219
|
+
function fa(e, r, n, a) {
|
|
2220
|
+
var s = n.IDBKeyRange;
|
|
2221
|
+
return n.indexedDB, { dbcore: (a = da(r, s, a), e.dbcore.reduce(function(i, u) {
|
|
2222
2222
|
return u = u.create, l(l({}, i), u(i));
|
|
2223
2223
|
}, a)) };
|
|
2224
2224
|
}
|
|
2225
2225
|
function Lt(e, a) {
|
|
2226
|
-
var
|
|
2226
|
+
var n = a.db, a = fa(e._middlewares, n, e._deps, a);
|
|
2227
2227
|
e.core = a.dbcore, e.tables.forEach(function(s) {
|
|
2228
2228
|
var i = s.name;
|
|
2229
2229
|
e.core.schema.tables.some(function(u) {
|
|
@@ -2231,12 +2231,12 @@ function Ma() {
|
|
|
2231
2231
|
}) && (s.core = e.core.table(i), e[i] instanceof e.Table && (e[i].core = s.core));
|
|
2232
2232
|
});
|
|
2233
2233
|
}
|
|
2234
|
-
function Wt(e,
|
|
2235
|
-
|
|
2234
|
+
function Wt(e, r, n, a) {
|
|
2235
|
+
n.forEach(function(s) {
|
|
2236
2236
|
var i = a[s];
|
|
2237
|
-
|
|
2237
|
+
r.forEach(function(u) {
|
|
2238
2238
|
var d = function p(y, w) {
|
|
2239
|
-
return
|
|
2239
|
+
return Fn(y, w) || (y = ge(y)) && p(y, w);
|
|
2240
2240
|
}(u, s);
|
|
2241
2241
|
(!d || "value" in d && d.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ? Ae(u, s, { get: function() {
|
|
2242
2242
|
return this.table(s);
|
|
@@ -2246,33 +2246,33 @@ function Ma() {
|
|
|
2246
2246
|
});
|
|
2247
2247
|
});
|
|
2248
2248
|
}
|
|
2249
|
-
function
|
|
2250
|
-
|
|
2251
|
-
for (var a in
|
|
2249
|
+
function _r(e, r) {
|
|
2250
|
+
r.forEach(function(n) {
|
|
2251
|
+
for (var a in n) n[a] instanceof e.Table && delete n[a];
|
|
2252
2252
|
});
|
|
2253
2253
|
}
|
|
2254
|
-
function ha(e,
|
|
2255
|
-
return e._cfg.version -
|
|
2254
|
+
function ha(e, r) {
|
|
2255
|
+
return e._cfg.version - r._cfg.version;
|
|
2256
2256
|
}
|
|
2257
|
-
function ga(e,
|
|
2257
|
+
function ga(e, r, n, a) {
|
|
2258
2258
|
var s = e._dbSchema;
|
|
2259
|
-
|
|
2259
|
+
n.objectStoreNames.contains("$meta") && !s.$meta && (s.$meta = Sr("$meta", En("")[0], []), e._storeNames.push("$meta"));
|
|
2260
2260
|
var i = e._createTransaction("readwrite", e._storeNames, s);
|
|
2261
|
-
i.create(
|
|
2261
|
+
i.create(n), i._completion.catch(a);
|
|
2262
2262
|
var u = i._reject.bind(i), d = B.transless || B;
|
|
2263
2263
|
De(function() {
|
|
2264
|
-
return B.trans = i, B.transless = d,
|
|
2264
|
+
return B.trans = i, B.transless = d, r !== 0 ? (Lt(e, n), y = r, ((p = i).storeNames.includes("$meta") ? p.table("$meta").get("version").then(function(w) {
|
|
2265
2265
|
return w ?? y;
|
|
2266
2266
|
}) : M.resolve(y)).then(function(w) {
|
|
2267
|
-
return O = w, m = i, E =
|
|
2267
|
+
return O = w, m = i, E = n, S = [], w = (f = e)._versions, v = f._dbSchema = Ut(0, f.idbdb, E), (w = w.filter(function(A) {
|
|
2268
2268
|
return A._cfg.version >= O;
|
|
2269
2269
|
})).length !== 0 ? (w.forEach(function(A) {
|
|
2270
2270
|
S.push(function() {
|
|
2271
2271
|
var P = v, D = A._cfg.dbschema;
|
|
2272
2272
|
zt(f, P, E), zt(f, D, E), v = f._dbSchema = D;
|
|
2273
|
-
var I =
|
|
2273
|
+
var I = Ar(P, D);
|
|
2274
2274
|
I.add.forEach(function(j) {
|
|
2275
|
-
|
|
2275
|
+
Pr(E, j[0], j[1].primKey, j[1].indexes);
|
|
2276
2276
|
}), I.change.forEach(function(j) {
|
|
2277
2277
|
if (j.recreate) throw new L.Upgrade("Not yet support for changing primary key");
|
|
2278
2278
|
var k = E.objectStore(j.name);
|
|
@@ -2287,11 +2287,11 @@ function Ma() {
|
|
|
2287
2287
|
var N = A._cfg.contentUpgrade;
|
|
2288
2288
|
if (N && A._cfg.version > O) {
|
|
2289
2289
|
Lt(f, E), m._memoizedTables = {};
|
|
2290
|
-
var C =
|
|
2290
|
+
var C = Yr(D);
|
|
2291
2291
|
I.del.forEach(function(j) {
|
|
2292
2292
|
C[j] = P[j];
|
|
2293
|
-
}),
|
|
2294
|
-
var R, T =
|
|
2293
|
+
}), _r(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], x(C), C), m.schema = C;
|
|
2294
|
+
var R, T = ar(N);
|
|
2295
2295
|
return T && et(), I = M.follow(function() {
|
|
2296
2296
|
var j;
|
|
2297
2297
|
(R = N(m)) && T && (j = Ie.bind(null, null), R.then(j, j));
|
|
@@ -2303,7 +2303,7 @@ function Ma() {
|
|
|
2303
2303
|
var D, I, N = A._cfg.dbschema;
|
|
2304
2304
|
D = N, I = P, [].slice.call(I.db.objectStoreNames).forEach(function(C) {
|
|
2305
2305
|
return D[C] == null && I.db.deleteObjectStore(C);
|
|
2306
|
-
}),
|
|
2306
|
+
}), _r(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), m.schema = f._dbSchema;
|
|
2307
2307
|
}), S.push(function(P) {
|
|
2308
2308
|
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === A._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(D) {
|
|
2309
2309
|
return D !== "$meta";
|
|
@@ -2312,25 +2312,25 @@ function Ma() {
|
|
|
2312
2312
|
}), function A() {
|
|
2313
2313
|
return S.length ? M.resolve(S.shift()(m.idbtrans)).then(A) : M.resolve();
|
|
2314
2314
|
}().then(function() {
|
|
2315
|
-
|
|
2315
|
+
vn(v, E);
|
|
2316
2316
|
})) : M.resolve();
|
|
2317
2317
|
var f, O, m, E, S, v;
|
|
2318
2318
|
}).catch(u)) : (x(s).forEach(function(w) {
|
|
2319
|
-
|
|
2320
|
-
}), Lt(e,
|
|
2319
|
+
Pr(n, w, s[w].primKey, s[w].indexes);
|
|
2320
|
+
}), Lt(e, n), void M.follow(function() {
|
|
2321
2321
|
return e.on.populate.fire(i);
|
|
2322
2322
|
}).catch(u));
|
|
2323
2323
|
var p, y;
|
|
2324
2324
|
});
|
|
2325
2325
|
}
|
|
2326
|
-
function pa(e,
|
|
2327
|
-
|
|
2328
|
-
var
|
|
2329
|
-
zt(e, e._dbSchema,
|
|
2330
|
-
for (var a = 0, s =
|
|
2326
|
+
function pa(e, r) {
|
|
2327
|
+
vn(e._dbSchema, r), r.db.version % 10 != 0 || r.objectStoreNames.contains("$meta") || r.db.createObjectStore("$meta").add(Math.ceil(r.db.version / 10 - 1), "version");
|
|
2328
|
+
var n = Ut(0, e.idbdb, r);
|
|
2329
|
+
zt(e, e._dbSchema, r);
|
|
2330
|
+
for (var a = 0, s = Ar(n, e._dbSchema).change; a < s.length; a++) {
|
|
2331
2331
|
var i = function(u) {
|
|
2332
2332
|
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 };
|
|
2333
|
-
var d =
|
|
2333
|
+
var d = r.objectStore(u.name);
|
|
2334
2334
|
u.add.forEach(function(p) {
|
|
2335
2335
|
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(u.name, ".").concat(p.src)), Ft(d, p);
|
|
2336
2336
|
});
|
|
@@ -2338,13 +2338,13 @@ function Ma() {
|
|
|
2338
2338
|
if (typeof i == "object") return i.value;
|
|
2339
2339
|
}
|
|
2340
2340
|
}
|
|
2341
|
-
function
|
|
2342
|
-
var
|
|
2343
|
-
for (
|
|
2344
|
-
for (
|
|
2345
|
-
var s = e[
|
|
2341
|
+
function Ar(e, r) {
|
|
2342
|
+
var n, a = { del: [], add: [], change: [] };
|
|
2343
|
+
for (n in e) r[n] || a.del.push(n);
|
|
2344
|
+
for (n in r) {
|
|
2345
|
+
var s = e[n], i = r[n];
|
|
2346
2346
|
if (s) {
|
|
2347
|
-
var u = { name:
|
|
2347
|
+
var u = { name: n, def: i, recreate: !1, del: [], add: [], change: [] };
|
|
2348
2348
|
if ("" + (s.primKey.keyPath || "") != "" + (i.primKey.keyPath || "") || s.primKey.auto !== i.primKey.auto) u.recreate = !0, a.change.push(u);
|
|
2349
2349
|
else {
|
|
2350
2350
|
var d = s.idxByName, p = i.idxByName, y = void 0;
|
|
@@ -2355,162 +2355,162 @@ function Ma() {
|
|
|
2355
2355
|
}
|
|
2356
2356
|
(0 < u.del.length || 0 < u.add.length || 0 < u.change.length) && a.change.push(u);
|
|
2357
2357
|
}
|
|
2358
|
-
} else a.add.push([
|
|
2358
|
+
} else a.add.push([n, i]);
|
|
2359
2359
|
}
|
|
2360
2360
|
return a;
|
|
2361
2361
|
}
|
|
2362
|
-
function
|
|
2363
|
-
var s = e.db.createObjectStore(
|
|
2362
|
+
function Pr(e, r, n, a) {
|
|
2363
|
+
var s = e.db.createObjectStore(r, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2364
2364
|
return a.forEach(function(i) {
|
|
2365
2365
|
return Ft(s, i);
|
|
2366
2366
|
}), s;
|
|
2367
2367
|
}
|
|
2368
|
-
function
|
|
2369
|
-
x(e).forEach(function(
|
|
2370
|
-
|
|
2368
|
+
function vn(e, r) {
|
|
2369
|
+
x(e).forEach(function(n) {
|
|
2370
|
+
r.db.objectStoreNames.contains(n) || (pe && console.debug("Dexie: Creating missing table", n), Pr(r, n, e[n].primKey, e[n].indexes));
|
|
2371
2371
|
});
|
|
2372
2372
|
}
|
|
2373
|
-
function Ft(e,
|
|
2374
|
-
e.createIndex(
|
|
2373
|
+
function Ft(e, r) {
|
|
2374
|
+
e.createIndex(r.name, r.keyPath, { unique: r.unique, multiEntry: r.multi });
|
|
2375
2375
|
}
|
|
2376
|
-
function Ut(e,
|
|
2376
|
+
function Ut(e, r, n) {
|
|
2377
2377
|
var a = {};
|
|
2378
|
-
return At(
|
|
2379
|
-
for (var i =
|
|
2380
|
-
var w = i.index(i.indexNames[p]), y = w.keyPath, w =
|
|
2378
|
+
return At(r.objectStoreNames, 0).forEach(function(s) {
|
|
2379
|
+
for (var i = n.objectStore(s), u = wr(yn(y = i.keyPath), y || "", !0, !1, !!i.autoIncrement, y && typeof y != "string", !0), d = [], p = 0; p < i.indexNames.length; ++p) {
|
|
2380
|
+
var w = i.index(i.indexNames[p]), y = w.keyPath, w = wr(w.name, y, !!w.unique, !!w.multiEntry, !1, y && typeof y != "string", !1);
|
|
2381
2381
|
d.push(w);
|
|
2382
2382
|
}
|
|
2383
|
-
a[s] =
|
|
2383
|
+
a[s] = Sr(s, u, d);
|
|
2384
2384
|
}), a;
|
|
2385
2385
|
}
|
|
2386
|
-
function zt(e,
|
|
2387
|
-
for (var a =
|
|
2388
|
-
var i = a[s], u =
|
|
2386
|
+
function zt(e, r, n) {
|
|
2387
|
+
for (var a = n.db.objectStoreNames, s = 0; s < a.length; ++s) {
|
|
2388
|
+
var i = a[s], u = n.objectStore(i);
|
|
2389
2389
|
e._hasGetAll = "getAll" in u;
|
|
2390
2390
|
for (var d = 0; d < u.indexNames.length; ++d) {
|
|
2391
2391
|
var p = u.indexNames[d], y = u.index(p).keyPath, w = typeof y == "string" ? y : "[" + At(y).join("+") + "]";
|
|
2392
|
-
!
|
|
2392
|
+
!r[i] || (y = r[i].idxByName[w]) && (y.name = p, delete r[i].idxByName[w], r[i].idxByName[p] = y);
|
|
2393
2393
|
}
|
|
2394
2394
|
}
|
|
2395
2395
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && b.WorkerGlobalScope && b instanceof b.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2396
2396
|
}
|
|
2397
|
-
function
|
|
2398
|
-
return e.split(",").map(function(
|
|
2399
|
-
var a = (
|
|
2400
|
-
return
|
|
2397
|
+
function En(e) {
|
|
2398
|
+
return e.split(",").map(function(r, n) {
|
|
2399
|
+
var a = (r = r.trim()).replace(/([&*]|\+\+)/g, ""), s = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
|
|
2400
|
+
return wr(a, s || null, /\&/.test(r), /\*/.test(r), /\+\+/.test(r), $(s), n === 0);
|
|
2401
2401
|
});
|
|
2402
2402
|
}
|
|
2403
|
-
var ma = (Ht.prototype._parseStoresSpec = function(e,
|
|
2404
|
-
x(e).forEach(function(
|
|
2405
|
-
if (e[
|
|
2406
|
-
var a =
|
|
2403
|
+
var ma = (Ht.prototype._parseStoresSpec = function(e, r) {
|
|
2404
|
+
x(e).forEach(function(n) {
|
|
2405
|
+
if (e[n] !== null) {
|
|
2406
|
+
var a = En(e[n]), s = a.shift();
|
|
2407
2407
|
if (s.unique = !0, s.multi) throw new L.Schema("Primary key cannot be multi-valued");
|
|
2408
2408
|
a.forEach(function(i) {
|
|
2409
2409
|
if (i.auto) throw new L.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2410
2410
|
if (!i.keyPath) throw new L.Schema("Index must have a name and cannot be an empty string");
|
|
2411
|
-
}), n
|
|
2411
|
+
}), r[n] = Sr(n, s, a);
|
|
2412
2412
|
}
|
|
2413
2413
|
});
|
|
2414
|
-
}, Ht.prototype.stores = function(
|
|
2415
|
-
var
|
|
2416
|
-
this._cfg.storesSource = this._cfg.storesSource ? te(this._cfg.storesSource,
|
|
2417
|
-
var
|
|
2418
|
-
return
|
|
2414
|
+
}, Ht.prototype.stores = function(n) {
|
|
2415
|
+
var r = this.db;
|
|
2416
|
+
this._cfg.storesSource = this._cfg.storesSource ? te(this._cfg.storesSource, n) : n;
|
|
2417
|
+
var n = r._versions, a = {}, s = {};
|
|
2418
|
+
return n.forEach(function(i) {
|
|
2419
2419
|
te(a, i._cfg.storesSource), s = i._cfg.dbschema = {}, i._parseStoresSpec(a, s);
|
|
2420
|
-
}),
|
|
2420
|
+
}), r._dbSchema = s, _r(r, [r._allTables, r, r.Transaction.prototype]), Wt(r, [r._allTables, r, r.Transaction.prototype, this._cfg.tables], x(s), s), r._storeNames = x(s), this;
|
|
2421
2421
|
}, Ht.prototype.upgrade = function(e) {
|
|
2422
|
-
return this._cfg.contentUpgrade =
|
|
2422
|
+
return this._cfg.contentUpgrade = or(this._cfg.contentUpgrade || Q, e), this;
|
|
2423
2423
|
}, Ht);
|
|
2424
2424
|
function Ht() {
|
|
2425
2425
|
}
|
|
2426
|
-
function
|
|
2427
|
-
var
|
|
2428
|
-
return
|
|
2426
|
+
function Dr(e, r) {
|
|
2427
|
+
var n = e._dbNamesDB;
|
|
2428
|
+
return n || (n = e._dbNamesDB = new Se(jt, { addons: [], indexedDB: e, IDBKeyRange: r })).version(1).stores({ dbnames: "name" }), n.table("dbnames");
|
|
2429
2429
|
}
|
|
2430
|
-
function
|
|
2430
|
+
function Ir(e) {
|
|
2431
2431
|
return e && typeof e.databases == "function";
|
|
2432
2432
|
}
|
|
2433
|
-
function
|
|
2433
|
+
function Nr(e) {
|
|
2434
2434
|
return De(function() {
|
|
2435
2435
|
return B.letThrough = !0, e();
|
|
2436
2436
|
});
|
|
2437
2437
|
}
|
|
2438
|
-
function
|
|
2438
|
+
function Rr(e) {
|
|
2439
2439
|
return !("from" in e);
|
|
2440
2440
|
}
|
|
2441
|
-
var ae = function(e,
|
|
2441
|
+
var ae = function(e, r) {
|
|
2442
2442
|
if (!this) {
|
|
2443
|
-
var
|
|
2444
|
-
return e && "d" in e && te(
|
|
2443
|
+
var n = new ae();
|
|
2444
|
+
return e && "d" in e && te(n, e), n;
|
|
2445
2445
|
}
|
|
2446
|
-
te(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ?
|
|
2446
|
+
te(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? r : e } : { d: 0 });
|
|
2447
2447
|
};
|
|
2448
|
-
function Et(e,
|
|
2449
|
-
var a = H(
|
|
2448
|
+
function Et(e, r, n) {
|
|
2449
|
+
var a = H(r, n);
|
|
2450
2450
|
if (!isNaN(a)) {
|
|
2451
2451
|
if (0 < a) throw RangeError();
|
|
2452
|
-
if (
|
|
2452
|
+
if (Rr(e)) return te(e, { from: r, to: n, d: 1 });
|
|
2453
2453
|
var s = e.l, a = e.r;
|
|
2454
|
-
if (H(
|
|
2455
|
-
if (0 < H(
|
|
2456
|
-
H(
|
|
2454
|
+
if (H(n, e.from) < 0) return s ? Et(s, r, n) : e.l = { from: r, to: n, d: 1, l: null, r: null }, Sn(e);
|
|
2455
|
+
if (0 < H(r, e.to)) return a ? Et(a, r, n) : e.r = { from: r, to: n, d: 1, l: null, r: null }, Sn(e);
|
|
2456
|
+
H(r, e.from) < 0 && (e.from = r, e.l = null, e.d = a ? a.d + 1 : 1), 0 < H(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, s && !e.l && wt(e, s), a && n && wt(e, a);
|
|
2457
2457
|
}
|
|
2458
2458
|
}
|
|
2459
|
-
function wt(e,
|
|
2460
|
-
|
|
2459
|
+
function wt(e, r) {
|
|
2460
|
+
Rr(r) || function n(a, p) {
|
|
2461
2461
|
var i = p.from, u = p.to, d = p.l, p = p.r;
|
|
2462
|
-
Et(a, i, u), d &&
|
|
2463
|
-
}(e,
|
|
2462
|
+
Et(a, i, u), d && n(a, d), p && n(a, p);
|
|
2463
|
+
}(e, r);
|
|
2464
2464
|
}
|
|
2465
|
-
function
|
|
2466
|
-
var
|
|
2465
|
+
function wn(e, r) {
|
|
2466
|
+
var n = Vt(r), a = n.next();
|
|
2467
2467
|
if (a.done) return !1;
|
|
2468
2468
|
for (var s = a.value, i = Vt(e), u = i.next(s.from), d = u.value; !a.done && !u.done; ) {
|
|
2469
2469
|
if (H(d.from, s.to) <= 0 && 0 <= H(d.to, s.from)) return !0;
|
|
2470
|
-
H(s.from, d.from) < 0 ? s = (a =
|
|
2470
|
+
H(s.from, d.from) < 0 ? s = (a = n.next(d.from)).value : d = (u = i.next(s.from)).value;
|
|
2471
2471
|
}
|
|
2472
2472
|
return !1;
|
|
2473
2473
|
}
|
|
2474
2474
|
function Vt(e) {
|
|
2475
|
-
var
|
|
2476
|
-
return { next: function(
|
|
2477
|
-
for (var a = 0 < arguments.length;
|
|
2475
|
+
var r = Rr(e) ? null : { s: 0, n: e };
|
|
2476
|
+
return { next: function(n) {
|
|
2477
|
+
for (var a = 0 < arguments.length; r; ) switch (r.s) {
|
|
2478
2478
|
case 0:
|
|
2479
|
-
if (
|
|
2480
|
-
else for (;
|
|
2479
|
+
if (r.s = 1, a) for (; r.n.l && H(n, r.n.from) < 0; ) r = { up: r, n: r.n.l, s: 1 };
|
|
2480
|
+
else for (; r.n.l; ) r = { up: r, n: r.n.l, s: 1 };
|
|
2481
2481
|
case 1:
|
|
2482
|
-
if (
|
|
2482
|
+
if (r.s = 2, !a || H(n, r.n.to) <= 0) return { value: r.n, done: !1 };
|
|
2483
2483
|
case 2:
|
|
2484
|
-
if (
|
|
2485
|
-
|
|
2484
|
+
if (r.n.r) {
|
|
2485
|
+
r.s = 3, r = { up: r, n: r.n.r, s: 0 };
|
|
2486
2486
|
continue;
|
|
2487
2487
|
}
|
|
2488
2488
|
case 3:
|
|
2489
|
-
|
|
2489
|
+
r = r.up;
|
|
2490
2490
|
}
|
|
2491
2491
|
return { done: !0 };
|
|
2492
2492
|
} };
|
|
2493
2493
|
}
|
|
2494
|
-
function
|
|
2495
|
-
var
|
|
2496
|
-
s && (
|
|
2494
|
+
function Sn(e) {
|
|
2495
|
+
var r, n, a = (((r = e.r) === null || r === void 0 ? void 0 : r.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), s = 1 < a ? "r" : a < -1 ? "l" : "";
|
|
2496
|
+
s && (r = s == "r" ? "l" : "r", n = l({}, e), a = e[s], e.from = a.from, e.to = a.to, e[s] = a[s], n[s] = a[r], (e[r] = n).d = On(n)), e.d = On(e);
|
|
2497
2497
|
}
|
|
2498
|
-
function
|
|
2499
|
-
var
|
|
2500
|
-
return (
|
|
2498
|
+
function On(n) {
|
|
2499
|
+
var r = n.r, n = n.l;
|
|
2500
|
+
return (r ? n ? Math.max(r.d, n.d) : r.d : n ? n.d : 0) + 1;
|
|
2501
2501
|
}
|
|
2502
|
-
function Yt(e,
|
|
2503
|
-
return x(
|
|
2504
|
-
e[
|
|
2502
|
+
function Yt(e, r) {
|
|
2503
|
+
return x(r).forEach(function(n) {
|
|
2504
|
+
e[n] ? wt(e[n], r[n]) : e[n] = function a(s) {
|
|
2505
2505
|
var i, u, d = {};
|
|
2506
|
-
for (i in s) ie(s, i) && (u = s[i], d[i] = !u || typeof u != "object" ||
|
|
2506
|
+
for (i in s) ie(s, i) && (u = s[i], d[i] = !u || typeof u != "object" || Xr.has(u.constructor) ? u : a(u));
|
|
2507
2507
|
return d;
|
|
2508
|
-
}(n
|
|
2508
|
+
}(r[n]);
|
|
2509
2509
|
}), e;
|
|
2510
2510
|
}
|
|
2511
|
-
function
|
|
2512
|
-
return e.all ||
|
|
2513
|
-
return n
|
|
2511
|
+
function Tr(e, r) {
|
|
2512
|
+
return e.all || r.all || Object.keys(e).some(function(n) {
|
|
2513
|
+
return r[n] && wn(r[n], e[n]);
|
|
2514
2514
|
});
|
|
2515
2515
|
}
|
|
2516
2516
|
be(ae.prototype, ((fe = { add: function(e) {
|
|
@@ -2518,40 +2518,40 @@ function Ma() {
|
|
|
2518
2518
|
}, addKey: function(e) {
|
|
2519
2519
|
return Et(this, e, e), this;
|
|
2520
2520
|
}, addKeys: function(e) {
|
|
2521
|
-
var
|
|
2522
|
-
return e.forEach(function(
|
|
2523
|
-
return Et(
|
|
2521
|
+
var r = this;
|
|
2522
|
+
return e.forEach(function(n) {
|
|
2523
|
+
return Et(r, n, n);
|
|
2524
2524
|
}), this;
|
|
2525
2525
|
}, hasKey: function(e) {
|
|
2526
|
-
var
|
|
2527
|
-
return
|
|
2528
|
-
} })[
|
|
2526
|
+
var r = Vt(this).next(e).value;
|
|
2527
|
+
return r && H(r.from, e) <= 0 && 0 <= H(r.to, e);
|
|
2528
|
+
} })[nr] = function() {
|
|
2529
2529
|
return Vt(this);
|
|
2530
2530
|
}, fe));
|
|
2531
|
-
var ze = {},
|
|
2531
|
+
var ze = {}, xr = {}, kr = !1;
|
|
2532
2532
|
function Qt(e) {
|
|
2533
|
-
Yt(
|
|
2534
|
-
|
|
2533
|
+
Yt(xr, e), kr || (kr = !0, setTimeout(function() {
|
|
2534
|
+
kr = !1, Cr(xr, !(xr = {}));
|
|
2535
2535
|
}, 0));
|
|
2536
2536
|
}
|
|
2537
|
-
function
|
|
2538
|
-
|
|
2539
|
-
var
|
|
2540
|
-
if (e.all) for (var a = 0, s = Object.values(ze); a < s.length; a++)
|
|
2537
|
+
function Cr(e, r) {
|
|
2538
|
+
r === void 0 && (r = !1);
|
|
2539
|
+
var n = /* @__PURE__ */ new Set();
|
|
2540
|
+
if (e.all) for (var a = 0, s = Object.values(ze); a < s.length; a++) _n(u = s[a], e, n, r);
|
|
2541
2541
|
else for (var i in e) {
|
|
2542
2542
|
var u, d = /^idb\:\/\/(.*)\/(.*)\//.exec(i);
|
|
2543
|
-
d && (i = d[1], d = d[2], (u = ze["idb://".concat(i, "/").concat(d)]) &&
|
|
2543
|
+
d && (i = d[1], d = d[2], (u = ze["idb://".concat(i, "/").concat(d)]) && _n(u, e, n, r));
|
|
2544
2544
|
}
|
|
2545
|
-
|
|
2545
|
+
n.forEach(function(p) {
|
|
2546
2546
|
return p();
|
|
2547
2547
|
});
|
|
2548
2548
|
}
|
|
2549
|
-
function
|
|
2549
|
+
function _n(e, r, n, a) {
|
|
2550
2550
|
for (var s = [], i = 0, u = Object.entries(e.queries.query); i < u.length; i++) {
|
|
2551
2551
|
for (var d = u[i], p = d[0], y = [], w = 0, f = d[1]; w < f.length; w++) {
|
|
2552
2552
|
var O = f[w];
|
|
2553
|
-
|
|
2554
|
-
return
|
|
2553
|
+
Tr(r, O.obsSet) ? O.subscribers.forEach(function(v) {
|
|
2554
|
+
return n.add(v);
|
|
2555
2555
|
}) : a && y.push(O);
|
|
2556
2556
|
}
|
|
2557
2557
|
a && s.push([p, y]);
|
|
@@ -2562,23 +2562,23 @@ function Ma() {
|
|
|
2562
2562
|
}
|
|
2563
2563
|
}
|
|
2564
2564
|
function ya(e) {
|
|
2565
|
-
var
|
|
2566
|
-
if (
|
|
2567
|
-
return
|
|
2565
|
+
var r = e._state, n = e._deps.indexedDB;
|
|
2566
|
+
if (r.isBeingOpened || e.idbdb) return r.dbReadyPromise.then(function() {
|
|
2567
|
+
return r.dbOpenError ? q(r.dbOpenError) : e;
|
|
2568
2568
|
});
|
|
2569
|
-
|
|
2570
|
-
var a =
|
|
2569
|
+
r.isBeingOpened = !0, r.dbOpenError = null, r.openComplete = !1;
|
|
2570
|
+
var a = r.openCanceller, s = Math.round(10 * e.verno), i = !1;
|
|
2571
2571
|
function u() {
|
|
2572
|
-
if (
|
|
2572
|
+
if (r.openCanceller !== a) throw new L.DatabaseClosed("db.open() was cancelled");
|
|
2573
2573
|
}
|
|
2574
2574
|
function d() {
|
|
2575
2575
|
return new M(function(O, m) {
|
|
2576
|
-
if (u(), !
|
|
2577
|
-
var E = e.name, S =
|
|
2576
|
+
if (u(), !n) throw new L.MissingAPI();
|
|
2577
|
+
var E = e.name, S = r.autoSchema || !s ? n.open(E) : n.open(E, s);
|
|
2578
2578
|
if (!S) throw new L.MissingAPI();
|
|
2579
2579
|
S.onerror = me(m), S.onblocked = Z(e._fireOnBlocked), S.onupgradeneeded = Z(function(v) {
|
|
2580
2580
|
var A;
|
|
2581
|
-
w = S.transaction,
|
|
2581
|
+
w = S.transaction, r.autoSchema && !e._options.allowEmptyDB ? (S.onerror = mt, w.abort(), S.result.close(), (A = n.deleteDatabase(E)).onsuccess = A.onerror = Z(function() {
|
|
2582
2582
|
m(new L.NoSuchDatabase("Database ".concat(E, " doesnt exist")));
|
|
2583
2583
|
})) : (w.onerror = me(m), v = v.oldVersion > Math.pow(2, 62) ? 0 : v.oldVersion, f = v < 1, e.idbdb = S.result, i && pa(e, w), ga(e, v / 10, w, m));
|
|
2584
2584
|
}, m), S.onsuccess = Z(function() {
|
|
@@ -2586,23 +2586,23 @@ function Ma() {
|
|
|
2586
2586
|
var v, A, P, D, I, N = e.idbdb = S.result, C = At(N.objectStoreNames);
|
|
2587
2587
|
if (0 < C.length) try {
|
|
2588
2588
|
var R = N.transaction((D = C).length === 1 ? D[0] : D, "readonly");
|
|
2589
|
-
if (
|
|
2590
|
-
else if (zt(e, e._dbSchema, R), ((I =
|
|
2589
|
+
if (r.autoSchema) A = N, P = R, (v = e).verno = A.version / 10, P = v._dbSchema = Ut(0, A, P), v._storeNames = At(A.objectStoreNames, 0), Wt(v, [v._allTables], x(P), P);
|
|
2590
|
+
else if (zt(e, e._dbSchema, R), ((I = Ar(Ut(0, (I = e).idbdb, R), I._dbSchema)).add.length || I.change.some(function(T) {
|
|
2591
2591
|
return T.add.length || T.change.length;
|
|
2592
2592
|
})) && !i) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), N.close(), s = N.version + 1, i = !0, O(d());
|
|
2593
2593
|
Lt(e, R);
|
|
2594
2594
|
} catch {
|
|
2595
2595
|
}
|
|
2596
2596
|
tt.push(e), N.onversionchange = Z(function(T) {
|
|
2597
|
-
|
|
2597
|
+
r.vcFired = !0, e.on("versionchange").fire(T);
|
|
2598
2598
|
}), N.onclose = Z(function(T) {
|
|
2599
2599
|
e.on("close").fire(T);
|
|
2600
|
-
}), f && (I = e._deps, R = E, N = I.indexedDB, I = I.IDBKeyRange,
|
|
2600
|
+
}), f && (I = e._deps, R = E, N = I.indexedDB, I = I.IDBKeyRange, Ir(N) || R === jt || Dr(N, I).put({ name: R }).catch(Q)), O();
|
|
2601
2601
|
}, m);
|
|
2602
2602
|
}).catch(function(O) {
|
|
2603
2603
|
switch (O?.name) {
|
|
2604
2604
|
case "UnknownError":
|
|
2605
|
-
if (0 <
|
|
2605
|
+
if (0 < r.PR1398_maxLoop) return r.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), d();
|
|
2606
2606
|
break;
|
|
2607
2607
|
case "VersionError":
|
|
2608
2608
|
if (0 < s) return s = 0, d();
|
|
@@ -2610,7 +2610,7 @@ function Ma() {
|
|
|
2610
2610
|
return M.reject(O);
|
|
2611
2611
|
});
|
|
2612
2612
|
}
|
|
2613
|
-
var p, y =
|
|
2613
|
+
var p, y = r.dbReadyResolve, w = null, f = !1;
|
|
2614
2614
|
return M.race([a, (typeof navigator > "u" ? M.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(O) {
|
|
2615
2615
|
function m() {
|
|
2616
2616
|
return indexedDB.databases().finally(O);
|
|
@@ -2619,65 +2619,65 @@ function Ma() {
|
|
|
2619
2619
|
}).finally(function() {
|
|
2620
2620
|
return clearInterval(p);
|
|
2621
2621
|
}) : Promise.resolve()).then(d)]).then(function() {
|
|
2622
|
-
return u(),
|
|
2622
|
+
return u(), r.onReadyBeingFired = [], M.resolve(Nr(function() {
|
|
2623
2623
|
return e.on.ready.fire(e.vip);
|
|
2624
2624
|
})).then(function O() {
|
|
2625
|
-
if (0 <
|
|
2626
|
-
var m =
|
|
2627
|
-
return
|
|
2625
|
+
if (0 < r.onReadyBeingFired.length) {
|
|
2626
|
+
var m = r.onReadyBeingFired.reduce(or, Q);
|
|
2627
|
+
return r.onReadyBeingFired = [], M.resolve(Nr(function() {
|
|
2628
2628
|
return m(e.vip);
|
|
2629
2629
|
})).then(O);
|
|
2630
2630
|
}
|
|
2631
2631
|
});
|
|
2632
2632
|
}).finally(function() {
|
|
2633
|
-
|
|
2633
|
+
r.openCanceller === a && (r.onReadyBeingFired = null, r.isBeingOpened = !1);
|
|
2634
2634
|
}).catch(function(O) {
|
|
2635
|
-
|
|
2635
|
+
r.dbOpenError = O;
|
|
2636
2636
|
try {
|
|
2637
2637
|
w && w.abort();
|
|
2638
2638
|
} catch {
|
|
2639
2639
|
}
|
|
2640
|
-
return a ===
|
|
2640
|
+
return a === r.openCanceller && e._close(), q(O);
|
|
2641
2641
|
}).finally(function() {
|
|
2642
|
-
|
|
2642
|
+
r.openComplete = !0, y();
|
|
2643
2643
|
}).then(function() {
|
|
2644
2644
|
var O;
|
|
2645
2645
|
return f && (O = {}, e.tables.forEach(function(m) {
|
|
2646
2646
|
m.schema.indexes.forEach(function(E) {
|
|
2647
2647
|
E.name && (O["idb://".concat(e.name, "/").concat(m.name, "/").concat(E.name)] = new ae(-1 / 0, [[[]]]));
|
|
2648
2648
|
}), O["idb://".concat(e.name, "/").concat(m.name, "/")] = O["idb://".concat(e.name, "/").concat(m.name, "/:dels")] = new ae(-1 / 0, [[[]]]);
|
|
2649
|
-
}), Te(yt).fire(O),
|
|
2649
|
+
}), Te(yt).fire(O), Cr(O, !0)), e;
|
|
2650
2650
|
});
|
|
2651
2651
|
}
|
|
2652
|
-
function
|
|
2653
|
-
function
|
|
2652
|
+
function $r(e) {
|
|
2653
|
+
function r(i) {
|
|
2654
2654
|
return e.next(i);
|
|
2655
2655
|
}
|
|
2656
|
-
var
|
|
2656
|
+
var n = s(r), a = s(function(i) {
|
|
2657
2657
|
return e.throw(i);
|
|
2658
2658
|
});
|
|
2659
2659
|
function s(i) {
|
|
2660
2660
|
return function(p) {
|
|
2661
2661
|
var d = i(p), p = d.value;
|
|
2662
|
-
return d.done ? p : p && typeof p.then == "function" ? p.then(
|
|
2662
|
+
return d.done ? p : p && typeof p.then == "function" ? p.then(n, a) : $(p) ? Promise.all(p).then(n, a) : n(p);
|
|
2663
2663
|
};
|
|
2664
2664
|
}
|
|
2665
|
-
return s(
|
|
2665
|
+
return s(r)();
|
|
2666
2666
|
}
|
|
2667
|
-
function Xt(e,
|
|
2668
|
-
for (var a = $(e) ? e.slice() : [e], s = 0; s <
|
|
2667
|
+
function Xt(e, r, n) {
|
|
2668
|
+
for (var a = $(e) ? e.slice() : [e], s = 0; s < n; ++s) a.push(r);
|
|
2669
2669
|
return a;
|
|
2670
2670
|
}
|
|
2671
2671
|
var ba = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2672
|
-
return l(l({}, e), { table: function(
|
|
2673
|
-
var
|
|
2672
|
+
return l(l({}, e), { table: function(r) {
|
|
2673
|
+
var n = e.table(r), a = n.schema, s = {}, i = [];
|
|
2674
2674
|
function u(f, O, m) {
|
|
2675
|
-
var E = vt(f), S = s[E] = s[E] || [], v = f == null ? 0 : typeof f == "string" ? 1 : f.length, A = 0 < O, A = l(l({}, m), { name: A ? "".concat(E, "(virtual-from:").concat(m.name, ")") : m.name, lowLevelIndex: m, isVirtual: A, keyTail: O, keyLength: v, extractKey:
|
|
2675
|
+
var E = vt(f), S = s[E] = s[E] || [], v = f == null ? 0 : typeof f == "string" ? 1 : f.length, A = 0 < O, A = l(l({}, m), { name: A ? "".concat(E, "(virtual-from:").concat(m.name, ")") : m.name, lowLevelIndex: m, isVirtual: A, keyTail: O, keyLength: v, extractKey: Or(f), unique: !A && m.unique });
|
|
2676
2676
|
return S.push(A), A.isPrimaryKey || i.push(A), 1 < v && u(v === 2 ? f[0] : f.slice(0, v - 1), O + 1, m), S.sort(function(P, D) {
|
|
2677
2677
|
return P.keyTail - D.keyTail;
|
|
2678
2678
|
}), A;
|
|
2679
2679
|
}
|
|
2680
|
-
|
|
2680
|
+
r = u(a.primaryKey.keyPath, 0, a.primaryKey), s[":id"] = [r];
|
|
2681
2681
|
for (var d = 0, p = a.indexes; d < p.length; d++) {
|
|
2682
2682
|
var y = p[d];
|
|
2683
2683
|
u(y.keyPath, 0, y);
|
|
@@ -2686,17 +2686,17 @@ function Ma() {
|
|
|
2686
2686
|
var O, m = f.query.index;
|
|
2687
2687
|
return m.isVirtual ? l(l({}, f), { query: { index: m.lowLevelIndex, range: (O = f.query.range, m = m.keyTail, { type: O.type === 1 ? 2 : O.type, lower: Xt(O.lower, O.lowerOpen ? e.MAX_KEY : e.MIN_KEY, m), lowerOpen: !0, upper: Xt(O.upper, O.upperOpen ? e.MIN_KEY : e.MAX_KEY, m), upperOpen: !0 }) } }) : f;
|
|
2688
2688
|
}
|
|
2689
|
-
return l(l({},
|
|
2689
|
+
return l(l({}, n), { schema: l(l({}, a), { primaryKey: r, indexes: i, getIndexByKeyPath: function(f) {
|
|
2690
2690
|
return (f = s[vt(f)]) && f[0];
|
|
2691
2691
|
} }), count: function(f) {
|
|
2692
|
-
return
|
|
2692
|
+
return n.count(w(f));
|
|
2693
2693
|
}, query: function(f) {
|
|
2694
|
-
return
|
|
2694
|
+
return n.query(w(f));
|
|
2695
2695
|
}, openCursor: function(f) {
|
|
2696
2696
|
var O = f.query.index, m = O.keyTail, E = O.isVirtual, S = O.keyLength;
|
|
2697
|
-
return E ?
|
|
2697
|
+
return E ? n.openCursor(w(f)).then(function(A) {
|
|
2698
2698
|
return A && v(A);
|
|
2699
|
-
}) :
|
|
2699
|
+
}) : n.openCursor(f);
|
|
2700
2700
|
function v(A) {
|
|
2701
2701
|
return Object.create(A, { continue: { value: function(P) {
|
|
2702
2702
|
P != null ? A.continue(Xt(P, f.reverse ? e.MAX_KEY : e.MIN_KEY, m)) : f.unique ? A.continue(A.key.slice(0, S).concat(f.reverse ? e.MIN_KEY : e.MAX_KEY, m)) : A.continue();
|
|
@@ -2714,22 +2714,22 @@ function Ma() {
|
|
|
2714
2714
|
} });
|
|
2715
2715
|
} });
|
|
2716
2716
|
} };
|
|
2717
|
-
function
|
|
2718
|
-
return
|
|
2717
|
+
function jr(e, r, n, a) {
|
|
2718
|
+
return n = n || {}, a = a || "", x(e).forEach(function(s) {
|
|
2719
2719
|
var i, u, d;
|
|
2720
|
-
ie(
|
|
2721
|
-
}), x(
|
|
2722
|
-
ie(e, s) || (
|
|
2723
|
-
}),
|
|
2720
|
+
ie(r, s) ? (i = e[s], u = r[s], typeof i == "object" && typeof u == "object" && i && u ? (d = rr(i)) !== rr(u) ? n[a + s] = r[s] : d === "Object" ? jr(i, u, n, a + s + ".") : i !== u && (n[a + s] = r[s]) : i !== u && (n[a + s] = r[s])) : n[a + s] = void 0;
|
|
2721
|
+
}), x(r).forEach(function(s) {
|
|
2722
|
+
ie(e, s) || (n[a + s] = r[s]);
|
|
2723
|
+
}), n;
|
|
2724
2724
|
}
|
|
2725
|
-
function
|
|
2726
|
-
return
|
|
2725
|
+
function Mr(e, r) {
|
|
2726
|
+
return r.type === "delete" ? r.keys : r.keys || r.values.map(e.extractKey);
|
|
2727
2727
|
}
|
|
2728
2728
|
var va = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2729
|
-
return l(l({}, e), { table: function(
|
|
2730
|
-
var
|
|
2731
|
-
return l(l({},
|
|
2732
|
-
var i = B.trans, u = i.table(
|
|
2729
|
+
return l(l({}, e), { table: function(r) {
|
|
2730
|
+
var n = e.table(r), a = n.schema.primaryKey;
|
|
2731
|
+
return l(l({}, n), { mutate: function(s) {
|
|
2732
|
+
var i = B.trans, u = i.table(r).hook, d = u.deleting, p = u.creating, y = u.updating;
|
|
2733
2733
|
switch (s.type) {
|
|
2734
2734
|
case "add":
|
|
2735
2735
|
if (p.fire === Q) break;
|
|
@@ -2750,7 +2750,7 @@ function Ma() {
|
|
|
2750
2750
|
if (d.fire === Q) break;
|
|
2751
2751
|
return i._promise("readwrite", function() {
|
|
2752
2752
|
return function f(O, m, E) {
|
|
2753
|
-
return
|
|
2753
|
+
return n.query({ trans: O, values: !1, query: { index: a, range: m }, limit: E }).then(function(S) {
|
|
2754
2754
|
var v = S.result;
|
|
2755
2755
|
return w({ type: "delete", keys: v, trans: O }).then(function(A) {
|
|
2756
2756
|
return 0 < A.numFailures ? Promise.reject(A.failures[0]) : v.length < E ? { failures: [], numFailures: 0, lastResult: void 0 } : f(O, l(l({}, m), { lower: v[v.length - 1], lowerOpen: !0 }), E);
|
|
@@ -2759,18 +2759,18 @@ function Ma() {
|
|
|
2759
2759
|
}(s.trans, s.range, 1e4);
|
|
2760
2760
|
}, !0);
|
|
2761
2761
|
}
|
|
2762
|
-
return
|
|
2762
|
+
return n.mutate(s);
|
|
2763
2763
|
function w(f) {
|
|
2764
|
-
var O, m, E, S = B.trans, v = f.keys ||
|
|
2764
|
+
var O, m, E, S = B.trans, v = f.keys || Mr(a, f);
|
|
2765
2765
|
if (!v) throw new Error("Keys missing");
|
|
2766
|
-
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: v }) : l({}, f)).type !== "delete" && (f.values = g([], f.values)), f.keys && (f.keys = g([], f.keys)), O =
|
|
2766
|
+
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: v }) : l({}, f)).type !== "delete" && (f.values = g([], f.values)), f.keys && (f.keys = g([], f.keys)), O = n, E = v, ((m = f).type === "add" ? Promise.resolve([]) : O.getMany({ trans: m.trans, keys: E, cache: "immutable" })).then(function(A) {
|
|
2767
2767
|
var P = v.map(function(D, I) {
|
|
2768
2768
|
var N, C, R, T = A[I], j = { onerror: null, onsuccess: null };
|
|
2769
|
-
return f.type === "delete" ? d.fire.call(j, D, T, S) : f.type === "add" || T === void 0 ? (N = p.fire.call(j, D, f.values[I], S), D == null && N != null && (f.keys[I] = D = N, a.outbound || ue(f.values[I], a.keyPath, D))) : (N =
|
|
2769
|
+
return f.type === "delete" ? d.fire.call(j, D, T, S) : f.type === "add" || T === void 0 ? (N = p.fire.call(j, D, f.values[I], S), D == null && N != null && (f.keys[I] = D = N, a.outbound || ue(f.values[I], a.keyPath, D))) : (N = jr(T, f.values[I]), (C = y.fire.call(j, N, D, T, S)) && (R = f.values[I], Object.keys(C).forEach(function(k) {
|
|
2770
2770
|
ie(R, k) ? R[k] = C[k] : ue(R, k, C[k]);
|
|
2771
2771
|
}))), j;
|
|
2772
2772
|
});
|
|
2773
|
-
return
|
|
2773
|
+
return n.mutate(f).then(function(D) {
|
|
2774
2774
|
for (var I = D.failures, N = D.results, C = D.numFailures, D = D.lastResult, R = 0; R < v.length; ++R) {
|
|
2775
2775
|
var T = (N || v)[R], j = P[R];
|
|
2776
2776
|
T == null ? j.onerror && j.onerror(I[R]) : j.onsuccess && j.onsuccess(f.type === "put" && A[R] ? f.values[R] : T);
|
|
@@ -2786,36 +2786,36 @@ function Ma() {
|
|
|
2786
2786
|
} });
|
|
2787
2787
|
} });
|
|
2788
2788
|
} };
|
|
2789
|
-
function
|
|
2789
|
+
function An(e, r, n) {
|
|
2790
2790
|
try {
|
|
2791
|
-
if (!
|
|
2792
|
-
for (var a = [], s = 0, i = 0; s <
|
|
2791
|
+
if (!r || r.keys.length < e.length) return null;
|
|
2792
|
+
for (var a = [], s = 0, i = 0; s < r.keys.length && i < e.length; ++s) H(r.keys[s], e[i]) === 0 && (a.push(n ? $e(r.values[s]) : r.values[s]), ++i);
|
|
2793
2793
|
return a.length === e.length ? a : null;
|
|
2794
2794
|
} catch {
|
|
2795
2795
|
return null;
|
|
2796
2796
|
}
|
|
2797
2797
|
}
|
|
2798
2798
|
var Ea = { stack: "dbcore", level: -1, create: function(e) {
|
|
2799
|
-
return { table: function(
|
|
2800
|
-
var
|
|
2801
|
-
return l(l({},
|
|
2802
|
-
if (!a.cache) return
|
|
2803
|
-
var s =
|
|
2804
|
-
return s ? M.resolve(s) :
|
|
2799
|
+
return { table: function(r) {
|
|
2800
|
+
var n = e.table(r);
|
|
2801
|
+
return l(l({}, n), { getMany: function(a) {
|
|
2802
|
+
if (!a.cache) return n.getMany(a);
|
|
2803
|
+
var s = An(a.keys, a.trans._cache, a.cache === "clone");
|
|
2804
|
+
return s ? M.resolve(s) : n.getMany(a).then(function(i) {
|
|
2805
2805
|
return a.trans._cache = { keys: a.keys, values: a.cache === "clone" ? $e(i) : i }, i;
|
|
2806
2806
|
});
|
|
2807
2807
|
}, mutate: function(a) {
|
|
2808
|
-
return a.type !== "add" && (a.trans._cache = null),
|
|
2808
|
+
return a.type !== "add" && (a.trans._cache = null), n.mutate(a);
|
|
2809
2809
|
} });
|
|
2810
2810
|
} };
|
|
2811
2811
|
} };
|
|
2812
|
-
function
|
|
2813
|
-
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !
|
|
2812
|
+
function Pn(e, r) {
|
|
2813
|
+
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !r.schema.primaryKey.outbound;
|
|
2814
2814
|
}
|
|
2815
|
-
function
|
|
2815
|
+
function Dn(e, r) {
|
|
2816
2816
|
switch (e) {
|
|
2817
2817
|
case "query":
|
|
2818
|
-
return
|
|
2818
|
+
return r.values && !r.unique;
|
|
2819
2819
|
case "get":
|
|
2820
2820
|
case "getMany":
|
|
2821
2821
|
case "count":
|
|
@@ -2824,7 +2824,7 @@ function Ma() {
|
|
|
2824
2824
|
}
|
|
2825
2825
|
}
|
|
2826
2826
|
var wa = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2827
|
-
var
|
|
2827
|
+
var r = e.schema.name, n = new ae(e.MIN_KEY, e.MAX_KEY);
|
|
2828
2828
|
return l(l({}, e), { transaction: function(a, s, i) {
|
|
2829
2829
|
if (B.subscr && s !== "readonly") throw new L.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(B.querier));
|
|
2830
2830
|
return e.transaction(a, s, i);
|
|
@@ -2833,12 +2833,12 @@ function Ma() {
|
|
|
2833
2833
|
return m.compound && m.keyPath.includes(u.keyPath);
|
|
2834
2834
|
}), w = l(l({}, s), { mutate: function(m) {
|
|
2835
2835
|
function E(k) {
|
|
2836
|
-
return k = "idb://".concat(
|
|
2836
|
+
return k = "idb://".concat(r, "/").concat(a, "/").concat(k), D[k] || (D[k] = new ae());
|
|
2837
2837
|
}
|
|
2838
|
-
var S, v, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I = E(""), N = E(":dels"), C = m.type, j = m.type === "deleteRange" ? [m.range] : m.type === "delete" ? [m.keys] : m.values.length < 50 ? [
|
|
2838
|
+
var S, v, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I = E(""), N = E(":dels"), C = m.type, j = m.type === "deleteRange" ? [m.range] : m.type === "delete" ? [m.keys] : m.values.length < 50 ? [Mr(u, m).filter(function(k) {
|
|
2839
2839
|
return k;
|
|
2840
2840
|
}), m.values] : [], R = j[0], T = j[1], j = m.trans._cache;
|
|
2841
|
-
return $(R) ? (I.addKeys(R), (j = C === "delete" || R.length === T.length ?
|
|
2841
|
+
return $(R) ? (I.addKeys(R), (j = C === "delete" || R.length === T.length ? An(R, j) : null) || N.addKeys(R), (j || T) && (S = E, v = j, A = T, i.indexes.forEach(function(k) {
|
|
2842
2842
|
var G = S(k.name || "");
|
|
2843
2843
|
function F(z) {
|
|
2844
2844
|
return z != null ? k.extractKey(z) : null;
|
|
@@ -2852,8 +2852,8 @@ function Ma() {
|
|
|
2852
2852
|
var W = v && F(v[se]), se = A && F(A[se]);
|
|
2853
2853
|
H(W, se) !== 0 && (W != null && U(W), se != null && U(se));
|
|
2854
2854
|
});
|
|
2855
|
-
}))) : R ? (T = { from: (T = R.lower) !== null && T !== void 0 ? T : e.MIN_KEY, to: (T = R.upper) !== null && T !== void 0 ? T : e.MAX_KEY }, N.add(T), I.add(T)) : (I.add(
|
|
2856
|
-
return E(k.name).add(
|
|
2855
|
+
}))) : R ? (T = { from: (T = R.lower) !== null && T !== void 0 ? T : e.MIN_KEY, to: (T = R.upper) !== null && T !== void 0 ? T : e.MAX_KEY }, N.add(T), I.add(T)) : (I.add(n), N.add(n), i.indexes.forEach(function(k) {
|
|
2856
|
+
return E(k.name).add(n);
|
|
2857
2857
|
})), s.mutate(m).then(function(k) {
|
|
2858
2858
|
return !R || m.type !== "add" && m.type !== "put" || (I.addKeys(k.results), y && y.forEach(function(G) {
|
|
2859
2859
|
for (var F = m.values.map(function(W) {
|
|
@@ -2874,10 +2874,10 @@ function Ma() {
|
|
|
2874
2874
|
}, count: f, query: f, openCursor: f };
|
|
2875
2875
|
return x(O).forEach(function(m) {
|
|
2876
2876
|
w[m] = function(E) {
|
|
2877
|
-
var S = B.subscr, v = !!S, A =
|
|
2877
|
+
var S = B.subscr, v = !!S, A = Pn(B, s) && Dn(m, E) ? E.obsSet = {} : S;
|
|
2878
2878
|
if (v) {
|
|
2879
2879
|
var P = function(T) {
|
|
2880
|
-
return T = "idb://".concat(
|
|
2880
|
+
return T = "idb://".concat(r, "/").concat(a, "/").concat(T), A[T] || (A[T] = new ae());
|
|
2881
2881
|
}, D = P(""), I = P(":dels"), S = O[m](E), v = S[0], S = S[1];
|
|
2882
2882
|
if ((m === "query" && v.isPrimaryKey && !E.values ? I : P(v.name || "")).add(S), !v.isPrimaryKey) {
|
|
2883
2883
|
if (m !== "count") {
|
|
@@ -2903,7 +2903,7 @@ function Ma() {
|
|
|
2903
2903
|
return T;
|
|
2904
2904
|
});
|
|
2905
2905
|
}
|
|
2906
|
-
I.add(
|
|
2906
|
+
I.add(n);
|
|
2907
2907
|
}
|
|
2908
2908
|
}
|
|
2909
2909
|
return s[m].apply(this, arguments);
|
|
@@ -2911,35 +2911,35 @@ function Ma() {
|
|
|
2911
2911
|
}), w;
|
|
2912
2912
|
} });
|
|
2913
2913
|
} };
|
|
2914
|
-
function
|
|
2915
|
-
if (
|
|
2916
|
-
if (
|
|
2917
|
-
var a =
|
|
2918
|
-
return
|
|
2919
|
-
return !(i in
|
|
2920
|
-
})), "values" in
|
|
2921
|
-
return !(i in
|
|
2922
|
-
})),
|
|
2923
|
-
}
|
|
2924
|
-
function
|
|
2925
|
-
return
|
|
2926
|
-
var
|
|
2927
|
-
}
|
|
2928
|
-
function
|
|
2914
|
+
function In(e, r, n) {
|
|
2915
|
+
if (n.numFailures === 0) return r;
|
|
2916
|
+
if (r.type === "deleteRange") return null;
|
|
2917
|
+
var a = r.keys ? r.keys.length : "values" in r && r.values ? r.values.length : 1;
|
|
2918
|
+
return n.numFailures === a ? null : (r = l({}, r), $(r.keys) && (r.keys = r.keys.filter(function(s, i) {
|
|
2919
|
+
return !(i in n.failures);
|
|
2920
|
+
})), "values" in r && $(r.values) && (r.values = r.values.filter(function(s, i) {
|
|
2921
|
+
return !(i in n.failures);
|
|
2922
|
+
})), r);
|
|
2923
|
+
}
|
|
2924
|
+
function Gr(e, r) {
|
|
2925
|
+
return n = e, ((a = r).lower === void 0 || (a.lowerOpen ? 0 < H(n, a.lower) : 0 <= H(n, a.lower))) && (e = e, (r = r).upper === void 0 || (r.upperOpen ? H(e, r.upper) < 0 : H(e, r.upper) <= 0));
|
|
2926
|
+
var n, a;
|
|
2927
|
+
}
|
|
2928
|
+
function Nn(e, r, O, a, s, i) {
|
|
2929
2929
|
if (!O || O.length === 0) return e;
|
|
2930
|
-
var u =
|
|
2930
|
+
var u = r.query.index, d = u.multiEntry, p = r.query.range, y = a.schema.primaryKey.extractKey, w = u.extractKey, f = (u.lowLevelIndex || u).extractKey, O = O.reduce(function(m, E) {
|
|
2931
2931
|
var S = m, v = [];
|
|
2932
2932
|
if (E.type === "add" || E.type === "put") for (var A = new ae(), P = E.values.length - 1; 0 <= P; --P) {
|
|
2933
2933
|
var D, I = E.values[P], N = y(I);
|
|
2934
2934
|
A.hasKey(N) || (D = w(I), (d && $(D) ? D.some(function(k) {
|
|
2935
|
-
return
|
|
2936
|
-
}) :
|
|
2935
|
+
return Gr(k, p);
|
|
2936
|
+
}) : Gr(D, p)) && (A.addKey(N), v.push(I)));
|
|
2937
2937
|
}
|
|
2938
2938
|
switch (E.type) {
|
|
2939
2939
|
case "add":
|
|
2940
|
-
var C = new ae().addKeys(
|
|
2940
|
+
var C = new ae().addKeys(r.values ? m.map(function(G) {
|
|
2941
2941
|
return y(G);
|
|
2942
|
-
}) : m), S = m.concat(
|
|
2942
|
+
}) : m), S = m.concat(r.values ? v.filter(function(G) {
|
|
2943
2943
|
return G = y(G), !C.hasKey(G) && (C.addKey(G), !0);
|
|
2944
2944
|
}) : v.map(function(G) {
|
|
2945
2945
|
return y(G);
|
|
@@ -2952,82 +2952,82 @@ function Ma() {
|
|
|
2952
2952
|
return y(G);
|
|
2953
2953
|
}));
|
|
2954
2954
|
S = m.filter(function(G) {
|
|
2955
|
-
return !R.hasKey(
|
|
2956
|
-
}).concat(
|
|
2955
|
+
return !R.hasKey(r.values ? y(G) : G);
|
|
2956
|
+
}).concat(r.values ? v : v.map(function(G) {
|
|
2957
2957
|
return y(G);
|
|
2958
2958
|
}));
|
|
2959
2959
|
break;
|
|
2960
2960
|
case "delete":
|
|
2961
2961
|
var T = new ae().addKeys(E.keys);
|
|
2962
2962
|
S = m.filter(function(G) {
|
|
2963
|
-
return !T.hasKey(
|
|
2963
|
+
return !T.hasKey(r.values ? y(G) : G);
|
|
2964
2964
|
});
|
|
2965
2965
|
break;
|
|
2966
2966
|
case "deleteRange":
|
|
2967
2967
|
var j = E.range;
|
|
2968
2968
|
S = m.filter(function(G) {
|
|
2969
|
-
return !
|
|
2969
|
+
return !Gr(y(G), j);
|
|
2970
2970
|
});
|
|
2971
2971
|
}
|
|
2972
2972
|
return S;
|
|
2973
2973
|
}, e);
|
|
2974
2974
|
return O === e ? e : (O.sort(function(m, E) {
|
|
2975
2975
|
return H(f(m), f(E)) || H(y(m), y(E));
|
|
2976
|
-
}),
|
|
2976
|
+
}), r.limit && r.limit < 1 / 0 && (O.length > r.limit ? O.length = r.limit : e.length === r.limit && O.length < r.limit && (s.dirty = !0)), i ? Object.freeze(O) : O);
|
|
2977
2977
|
}
|
|
2978
|
-
function
|
|
2979
|
-
return H(e.lower,
|
|
2978
|
+
function Rn(e, r) {
|
|
2979
|
+
return H(e.lower, r.lower) === 0 && H(e.upper, r.upper) === 0 && !!e.lowerOpen == !!r.lowerOpen && !!e.upperOpen == !!r.upperOpen;
|
|
2980
2980
|
}
|
|
2981
|
-
function Sa(e,
|
|
2982
|
-
return function(
|
|
2983
|
-
if (
|
|
2981
|
+
function Sa(e, r) {
|
|
2982
|
+
return function(n, a, s, i) {
|
|
2983
|
+
if (n === void 0) return a !== void 0 ? -1 : 0;
|
|
2984
2984
|
if (a === void 0) return 1;
|
|
2985
|
-
if ((a = H(
|
|
2985
|
+
if ((a = H(n, a)) === 0) {
|
|
2986
2986
|
if (s && i) return 0;
|
|
2987
2987
|
if (s) return 1;
|
|
2988
2988
|
if (i) return -1;
|
|
2989
2989
|
}
|
|
2990
2990
|
return a;
|
|
2991
|
-
}(e.lower,
|
|
2992
|
-
if (
|
|
2991
|
+
}(e.lower, r.lower, e.lowerOpen, r.lowerOpen) <= 0 && 0 <= function(n, a, s, i) {
|
|
2992
|
+
if (n === void 0) return a !== void 0 ? 1 : 0;
|
|
2993
2993
|
if (a === void 0) return -1;
|
|
2994
|
-
if ((a = H(
|
|
2994
|
+
if ((a = H(n, a)) === 0) {
|
|
2995
2995
|
if (s && i) return 0;
|
|
2996
2996
|
if (s) return -1;
|
|
2997
2997
|
if (i) return 1;
|
|
2998
2998
|
}
|
|
2999
2999
|
return a;
|
|
3000
|
-
}(e.upper,
|
|
3000
|
+
}(e.upper, r.upper, e.upperOpen, r.upperOpen);
|
|
3001
3001
|
}
|
|
3002
|
-
function Oa(e,
|
|
3003
|
-
e.subscribers.add(
|
|
3002
|
+
function Oa(e, r, n, a) {
|
|
3003
|
+
e.subscribers.add(n), a.addEventListener("abort", function() {
|
|
3004
3004
|
var s, i;
|
|
3005
|
-
e.subscribers.delete(
|
|
3005
|
+
e.subscribers.delete(n), e.subscribers.size === 0 && (s = e, i = r, setTimeout(function() {
|
|
3006
3006
|
s.subscribers.size === 0 && je(i, s);
|
|
3007
3007
|
}, 3e3));
|
|
3008
3008
|
});
|
|
3009
3009
|
}
|
|
3010
3010
|
var _a = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
3011
|
-
var
|
|
3012
|
-
return l(l({}, e), { transaction: function(
|
|
3013
|
-
var i, u, d = e.transaction(
|
|
3011
|
+
var r = e.schema.name;
|
|
3012
|
+
return l(l({}, e), { transaction: function(n, a, s) {
|
|
3013
|
+
var i, u, d = e.transaction(n, a, s);
|
|
3014
3014
|
return a === "readwrite" && (u = (i = new AbortController()).signal, s = function(p) {
|
|
3015
3015
|
return function() {
|
|
3016
3016
|
if (i.abort(), a === "readwrite") {
|
|
3017
|
-
for (var y = /* @__PURE__ */ new Set(), w = 0, f =
|
|
3018
|
-
var O = f[w], m = ze["idb://".concat(
|
|
3017
|
+
for (var y = /* @__PURE__ */ new Set(), w = 0, f = n; w < f.length; w++) {
|
|
3018
|
+
var O = f[w], m = ze["idb://".concat(r, "/").concat(O)];
|
|
3019
3019
|
if (m) {
|
|
3020
3020
|
var E = e.table(O), S = m.optimisticOps.filter(function(G) {
|
|
3021
3021
|
return G.trans === d;
|
|
3022
3022
|
});
|
|
3023
|
-
if (d._explicit && p && d.mutatedParts) for (var v = 0, A = Object.values(m.queries.query); v < A.length; v++) for (var P = 0, D = (C = A[v]).slice(); P < D.length; P++)
|
|
3023
|
+
if (d._explicit && p && d.mutatedParts) for (var v = 0, A = Object.values(m.queries.query); v < A.length; v++) for (var P = 0, D = (C = A[v]).slice(); P < D.length; P++) Tr((R = D[P]).obsSet, d.mutatedParts) && (je(C, R), R.subscribers.forEach(function(G) {
|
|
3024
3024
|
return y.add(G);
|
|
3025
3025
|
}));
|
|
3026
3026
|
else if (0 < S.length) {
|
|
3027
3027
|
m.optimisticOps = m.optimisticOps.filter(function(G) {
|
|
3028
3028
|
return G.trans !== d;
|
|
3029
3029
|
});
|
|
3030
|
-
for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var C, R, T, j = 0, k = (C = N[I]).slice(); j < k.length; j++) (R = k[j]).res != null && d.mutatedParts && (p && !R.dirty ? (T = Object.isFrozen(R.res), T =
|
|
3030
|
+
for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var C, R, T, j = 0, k = (C = N[I]).slice(); j < k.length; j++) (R = k[j]).res != null && d.mutatedParts && (p && !R.dirty ? (T = Object.isFrozen(R.res), T = Nn(R.res, R.req, S, E, R, T), R.dirty ? (je(C, R), R.subscribers.forEach(function(G) {
|
|
3031
3031
|
return y.add(G);
|
|
3032
3032
|
})) : T !== R.res && (R.res = T, R.promise = M.resolve({ result: T }))) : (R.dirty && je(C, R), R.subscribers.forEach(function(G) {
|
|
3033
3033
|
return y.add(G);
|
|
@@ -3041,20 +3041,20 @@ function Ma() {
|
|
|
3041
3041
|
}
|
|
3042
3042
|
};
|
|
3043
3043
|
}, d.addEventListener("abort", s(!1), { signal: u }), d.addEventListener("error", s(!1), { signal: u }), d.addEventListener("complete", s(!0), { signal: u })), d;
|
|
3044
|
-
}, table: function(
|
|
3045
|
-
var a = e.table(
|
|
3044
|
+
}, table: function(n) {
|
|
3045
|
+
var a = e.table(n), s = a.schema.primaryKey;
|
|
3046
3046
|
return l(l({}, a), { mutate: function(i) {
|
|
3047
3047
|
var u = B.trans;
|
|
3048
3048
|
if (s.outbound || u.db._options.cache === "disabled" || u.explicit || u.idbtrans.mode !== "readwrite") return a.mutate(i);
|
|
3049
|
-
var d = ze["idb://".concat(
|
|
3050
|
-
return d ? (u = a.mutate(i), i.type !== "add" && i.type !== "put" || !(50 <= i.values.length ||
|
|
3049
|
+
var d = ze["idb://".concat(r, "/").concat(n)];
|
|
3050
|
+
return d ? (u = a.mutate(i), i.type !== "add" && i.type !== "put" || !(50 <= i.values.length || Mr(s, i).some(function(p) {
|
|
3051
3051
|
return p == null;
|
|
3052
3052
|
})) ? (d.optimisticOps.push(i), i.mutatedParts && Qt(i.mutatedParts), u.then(function(p) {
|
|
3053
|
-
0 < p.numFailures && (je(d.optimisticOps, i), (p =
|
|
3053
|
+
0 < p.numFailures && (je(d.optimisticOps, i), (p = In(0, i, p)) && d.optimisticOps.push(p), i.mutatedParts && Qt(i.mutatedParts));
|
|
3054
3054
|
}), u.catch(function() {
|
|
3055
3055
|
je(d.optimisticOps, i), i.mutatedParts && Qt(i.mutatedParts);
|
|
3056
3056
|
})) : u.then(function(p) {
|
|
3057
|
-
var y =
|
|
3057
|
+
var y = In(0, l(l({}, i), { values: i.values.map(function(w, f) {
|
|
3058
3058
|
var O;
|
|
3059
3059
|
return p.failures[f] ? w : (w = (O = s.keyPath) !== null && O !== void 0 && O.includes(".") ? $e(w) : l({}, w), ue(w, s.keyPath, p.results[f]), w);
|
|
3060
3060
|
}) }), p);
|
|
@@ -3063,7 +3063,7 @@ function Ma() {
|
|
|
3063
3063
|
});
|
|
3064
3064
|
}), u) : a.mutate(i);
|
|
3065
3065
|
}, query: function(i) {
|
|
3066
|
-
if (!
|
|
3066
|
+
if (!Pn(B, a) || !Dn("query", i)) return a.query(i);
|
|
3067
3067
|
var u = ((y = B.trans) === null || y === void 0 ? void 0 : y.db._options.cache) === "immutable", f = B, d = f.requery, p = f.signal, y = function(E, S, v, A) {
|
|
3068
3068
|
var P = ze["idb://".concat(E, "/").concat(S)];
|
|
3069
3069
|
if (!P) return [];
|
|
@@ -3073,17 +3073,17 @@ function Ma() {
|
|
|
3073
3073
|
switch (v) {
|
|
3074
3074
|
case "query":
|
|
3075
3075
|
var I = D.find(function(N) {
|
|
3076
|
-
return N.req.limit === A.limit && N.req.values === A.values &&
|
|
3076
|
+
return N.req.limit === A.limit && N.req.values === A.values && Rn(N.req.query.range, A.query.range);
|
|
3077
3077
|
});
|
|
3078
3078
|
return I ? [I, !0, P, D] : [D.find(function(N) {
|
|
3079
3079
|
return ("limit" in N.req ? N.req.limit : 1 / 0) >= A.limit && (!A.values || N.req.values) && Sa(N.req.query.range, A.query.range);
|
|
3080
3080
|
}), !1, P, D];
|
|
3081
3081
|
case "count":
|
|
3082
3082
|
return I = D.find(function(N) {
|
|
3083
|
-
return
|
|
3083
|
+
return Rn(N.req.query.range, A.query.range);
|
|
3084
3084
|
}), [I, !!I, P, D];
|
|
3085
3085
|
}
|
|
3086
|
-
}(
|
|
3086
|
+
}(r, n, "query", i), w = y[0], f = y[1], O = y[2], m = y[3];
|
|
3087
3087
|
return w && f ? w.obsSet = i.obsSet : (f = a.query(i).then(function(E) {
|
|
3088
3088
|
var S = E.result;
|
|
3089
3089
|
if (w && (w.res = S), u) {
|
|
@@ -3093,44 +3093,44 @@ function Ma() {
|
|
|
3093
3093
|
return E;
|
|
3094
3094
|
}).catch(function(E) {
|
|
3095
3095
|
return m && w && je(m, w), Promise.reject(E);
|
|
3096
|
-
}), w = { obsSet: i.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: i, dirty: !1 }, m ? m.push(w) : (m = [w], (O = O || (ze["idb://".concat(
|
|
3097
|
-
return { result:
|
|
3096
|
+
}), w = { obsSet: i.obsSet, promise: f, subscribers: /* @__PURE__ */ new Set(), type: "query", req: i, dirty: !1 }, m ? m.push(w) : (m = [w], (O = O || (ze["idb://".concat(r, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[i.query.index.name || ""] = m)), Oa(w, m, d, p), w.promise.then(function(E) {
|
|
3097
|
+
return { result: Nn(E.result, i, O?.optimisticOps, a, w, u) };
|
|
3098
3098
|
});
|
|
3099
3099
|
} });
|
|
3100
3100
|
} });
|
|
3101
3101
|
} };
|
|
3102
|
-
function Jt(e,
|
|
3103
|
-
return new Proxy(e, { get: function(
|
|
3104
|
-
return a === "db" ?
|
|
3102
|
+
function Jt(e, r) {
|
|
3103
|
+
return new Proxy(e, { get: function(n, a, s) {
|
|
3104
|
+
return a === "db" ? r : Reflect.get(n, a, s);
|
|
3105
3105
|
} });
|
|
3106
3106
|
}
|
|
3107
3107
|
var Se = (ee.prototype.version = function(e) {
|
|
3108
3108
|
if (isNaN(e) || e < 0.1) throw new L.Type("Given version is not a positive number");
|
|
3109
3109
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new L.Schema("Cannot add version when database is open");
|
|
3110
3110
|
this.verno = Math.max(this.verno, e);
|
|
3111
|
-
var
|
|
3111
|
+
var r = this._versions, n = r.filter(function(a) {
|
|
3112
3112
|
return a._cfg.version === e;
|
|
3113
3113
|
})[0];
|
|
3114
|
-
return
|
|
3114
|
+
return n || (n = new this.Version(e), r.push(n), r.sort(ha), n.stores({}), this._state.autoSchema = !1, n);
|
|
3115
3115
|
}, ee.prototype._whenReady = function(e) {
|
|
3116
|
-
var
|
|
3117
|
-
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new M(function(
|
|
3118
|
-
if (
|
|
3119
|
-
if (!
|
|
3120
|
-
if (!
|
|
3121
|
-
|
|
3116
|
+
var r = this;
|
|
3117
|
+
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new M(function(n, a) {
|
|
3118
|
+
if (r._state.openComplete) return a(new L.DatabaseClosed(r._state.dbOpenError));
|
|
3119
|
+
if (!r._state.isBeingOpened) {
|
|
3120
|
+
if (!r._state.autoOpen) return void a(new L.DatabaseClosed());
|
|
3121
|
+
r.open().catch(Q);
|
|
3122
3122
|
}
|
|
3123
|
-
|
|
3123
|
+
r._state.dbReadyPromise.then(n, a);
|
|
3124
3124
|
}).then(e);
|
|
3125
3125
|
}, ee.prototype.use = function(e) {
|
|
3126
|
-
var
|
|
3127
|
-
return s && this.unuse({ stack:
|
|
3126
|
+
var r = e.stack, n = e.create, a = e.level, s = e.name;
|
|
3127
|
+
return s && this.unuse({ stack: r, name: s }), e = this._middlewares[r] || (this._middlewares[r] = []), e.push({ stack: r, create: n, level: a ?? 10, name: s }), e.sort(function(i, u) {
|
|
3128
3128
|
return i.level - u.level;
|
|
3129
3129
|
}), this;
|
|
3130
3130
|
}, ee.prototype.unuse = function(e) {
|
|
3131
|
-
var
|
|
3132
|
-
return
|
|
3133
|
-
return a ? s.create !== a : !!
|
|
3131
|
+
var r = e.stack, n = e.name, a = e.create;
|
|
3132
|
+
return r && this._middlewares[r] && (this._middlewares[r] = this._middlewares[r].filter(function(s) {
|
|
3133
|
+
return a ? s.create !== a : !!n && s.name !== n;
|
|
3134
3134
|
})), this;
|
|
3135
3135
|
}, ee.prototype.open = function() {
|
|
3136
3136
|
var e = this;
|
|
@@ -3138,36 +3138,36 @@ function Ma() {
|
|
|
3138
3138
|
return ya(e);
|
|
3139
3139
|
});
|
|
3140
3140
|
}, ee.prototype._close = function() {
|
|
3141
|
-
var e = this._state,
|
|
3142
|
-
if (0 <=
|
|
3141
|
+
var e = this._state, r = tt.indexOf(this);
|
|
3142
|
+
if (0 <= r && tt.splice(r, 1), this.idbdb) {
|
|
3143
3143
|
try {
|
|
3144
3144
|
this.idbdb.close();
|
|
3145
3145
|
} catch {
|
|
3146
3146
|
}
|
|
3147
3147
|
this.idbdb = null;
|
|
3148
3148
|
}
|
|
3149
|
-
e.isBeingOpened || (e.dbReadyPromise = new M(function(
|
|
3150
|
-
e.dbReadyResolve =
|
|
3151
|
-
}), e.openCanceller = new M(function(
|
|
3149
|
+
e.isBeingOpened || (e.dbReadyPromise = new M(function(n) {
|
|
3150
|
+
e.dbReadyResolve = n;
|
|
3151
|
+
}), e.openCanceller = new M(function(n, a) {
|
|
3152
3152
|
e.cancelOpen = a;
|
|
3153
3153
|
}));
|
|
3154
|
-
}, ee.prototype.close = function(
|
|
3155
|
-
var
|
|
3156
|
-
|
|
3154
|
+
}, ee.prototype.close = function(n) {
|
|
3155
|
+
var r = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
3156
|
+
r ? (n.isBeingOpened && n.cancelOpen(new L.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new L.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
3157
3157
|
}, ee.prototype.delete = function(e) {
|
|
3158
|
-
var
|
|
3158
|
+
var r = this;
|
|
3159
3159
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
3160
|
-
var
|
|
3160
|
+
var n = 0 < arguments.length && typeof arguments[0] != "object", a = this._state;
|
|
3161
3161
|
return new M(function(s, i) {
|
|
3162
3162
|
function u() {
|
|
3163
|
-
|
|
3164
|
-
var d =
|
|
3163
|
+
r.close(e);
|
|
3164
|
+
var d = r._deps.indexedDB.deleteDatabase(r.name);
|
|
3165
3165
|
d.onsuccess = Z(function() {
|
|
3166
3166
|
var p, y, w;
|
|
3167
|
-
p =
|
|
3168
|
-
}), d.onerror = me(i), d.onblocked =
|
|
3167
|
+
p = r._deps, y = r.name, w = p.indexedDB, p = p.IDBKeyRange, Ir(w) || y === jt || Dr(w, p).delete(y).catch(Q), s();
|
|
3168
|
+
}), d.onerror = me(i), d.onblocked = r._fireOnBlocked;
|
|
3169
3169
|
}
|
|
3170
|
-
if (
|
|
3170
|
+
if (n) throw new L.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
3171
3171
|
a.isBeingOpened ? a.dbReadyPromise.then(u) : u();
|
|
3172
3172
|
});
|
|
3173
3173
|
}, ee.prototype.backendDB = function() {
|
|
@@ -3183,33 +3183,33 @@ function Ma() {
|
|
|
3183
3183
|
return this._state.autoSchema;
|
|
3184
3184
|
}, Object.defineProperty(ee.prototype, "tables", { get: function() {
|
|
3185
3185
|
var e = this;
|
|
3186
|
-
return x(this._allTables).map(function(
|
|
3187
|
-
return e._allTables[
|
|
3186
|
+
return x(this._allTables).map(function(r) {
|
|
3187
|
+
return e._allTables[r];
|
|
3188
3188
|
});
|
|
3189
3189
|
}, enumerable: !1, configurable: !0 }), ee.prototype.transaction = function() {
|
|
3190
|
-
var e = function(
|
|
3190
|
+
var e = function(r, n, a) {
|
|
3191
3191
|
var s = arguments.length;
|
|
3192
3192
|
if (s < 2) throw new L.InvalidArgument("Too few arguments");
|
|
3193
3193
|
for (var i = new Array(s - 1); --s; ) i[s - 1] = arguments[s];
|
|
3194
|
-
return a = i.pop(), [
|
|
3194
|
+
return a = i.pop(), [r, Qr(i), a];
|
|
3195
3195
|
}.apply(this, arguments);
|
|
3196
3196
|
return this._transaction.apply(this, e);
|
|
3197
|
-
}, ee.prototype._transaction = function(e,
|
|
3197
|
+
}, ee.prototype._transaction = function(e, r, n) {
|
|
3198
3198
|
var a = this, s = B.trans;
|
|
3199
3199
|
s && s.db === this && e.indexOf("!") === -1 || (s = null);
|
|
3200
3200
|
var i, u, d = e.indexOf("?") !== -1;
|
|
3201
3201
|
e = e.replace("!", "").replace("?", "");
|
|
3202
3202
|
try {
|
|
3203
|
-
if (u =
|
|
3203
|
+
if (u = r.map(function(y) {
|
|
3204
3204
|
if (y = y instanceof a.Table ? y.name : y, typeof y != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
3205
3205
|
return y;
|
|
3206
|
-
}), e == "r" || e ===
|
|
3206
|
+
}), e == "r" || e === pr) i = pr;
|
|
3207
3207
|
else {
|
|
3208
|
-
if (e != "rw" && e !=
|
|
3209
|
-
i =
|
|
3208
|
+
if (e != "rw" && e != mr) throw new L.InvalidArgument("Invalid transaction mode: " + e);
|
|
3209
|
+
i = mr;
|
|
3210
3210
|
}
|
|
3211
3211
|
if (s) {
|
|
3212
|
-
if (s.mode ===
|
|
3212
|
+
if (s.mode === pr && i === mr) {
|
|
3213
3213
|
if (!d) throw new L.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
3214
3214
|
s = null;
|
|
3215
3215
|
}
|
|
@@ -3232,14 +3232,14 @@ function Ma() {
|
|
|
3232
3232
|
else try {
|
|
3233
3233
|
v.create(), v.idbtrans._explicit = !0, w._state.PR1398_maxLoop = 3;
|
|
3234
3234
|
} catch (D) {
|
|
3235
|
-
return D.name ===
|
|
3235
|
+
return D.name === sr.InvalidState && w.isOpen() && 0 < --w._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), w.close({ disableAutoOpen: !1 }), w.open().then(function() {
|
|
3236
3236
|
return y(w, f, O, null, E);
|
|
3237
3237
|
})) : q(D);
|
|
3238
3238
|
}
|
|
3239
|
-
var A, P =
|
|
3239
|
+
var A, P = ar(E);
|
|
3240
3240
|
return P && et(), S = M.follow(function() {
|
|
3241
3241
|
var D;
|
|
3242
|
-
(A = E.call(v, v)) && (P ? (D = Ie.bind(null, null), A.then(D, D)) : typeof A.next == "function" && typeof A.throw == "function" && (A =
|
|
3242
|
+
(A = E.call(v, v)) && (P ? (D = Ie.bind(null, null), A.then(D, D)) : typeof A.next == "function" && typeof A.throw == "function" && (A = $r(A)));
|
|
3243
3243
|
}, S), (A && typeof A.then == "function" ? M.resolve(A).then(function(D) {
|
|
3244
3244
|
return v.active ? D : q(new L.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3245
3245
|
}) : S.then(function() {
|
|
@@ -3252,7 +3252,7 @@ function Ma() {
|
|
|
3252
3252
|
return v._reject(D), q(D);
|
|
3253
3253
|
});
|
|
3254
3254
|
});
|
|
3255
|
-
}.bind(null, this, i, u, s,
|
|
3255
|
+
}.bind(null, this, i, u, s, n);
|
|
3256
3256
|
return s ? s._promise(i, p, "lock") : B.trans ? We(B.transless, function() {
|
|
3257
3257
|
return a._whenReady(p);
|
|
3258
3258
|
}) : this._whenReady(p);
|
|
@@ -3260,28 +3260,28 @@ function Ma() {
|
|
|
3260
3260
|
if (!ie(this._allTables, e)) throw new L.InvalidTable("Table ".concat(e, " does not exist"));
|
|
3261
3261
|
return this._allTables[e];
|
|
3262
3262
|
}, ee);
|
|
3263
|
-
function ee(e,
|
|
3264
|
-
var
|
|
3263
|
+
function ee(e, r) {
|
|
3264
|
+
var n = this;
|
|
3265
3265
|
this._middlewares = {}, this.verno = 0;
|
|
3266
3266
|
var a = ee.dependencies;
|
|
3267
|
-
this._options =
|
|
3268
|
-
var s, i, u, d, p, y = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Q, dbReadyPromise: null, cancelOpen: Q, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen:
|
|
3267
|
+
this._options = r = l({ addons: ee.addons, autoOpen: !0, indexedDB: a.indexedDB, IDBKeyRange: a.IDBKeyRange, cache: "cloned" }, r), this._deps = { indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange }, a = r.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3268
|
+
var s, i, u, d, p, y = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Q, dbReadyPromise: null, cancelOpen: Q, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: r.autoOpen };
|
|
3269
3269
|
y.dbReadyPromise = new M(function(f) {
|
|
3270
3270
|
y.dbReadyResolve = f;
|
|
3271
3271
|
}), y.openCanceller = new M(function(f, O) {
|
|
3272
3272
|
y.cancelOpen = O;
|
|
3273
|
-
}), this._state = y, this.name = e, this.on = ht(this, "populate", "blocked", "versionchange", "close", { ready: [
|
|
3273
|
+
}), this._state = y, this.name = e, this.on = ht(this, "populate", "blocked", "versionchange", "close", { ready: [or, Q] }), this.on.ready.subscribe = Hr(this.on.ready.subscribe, function(f) {
|
|
3274
3274
|
return function(O, m) {
|
|
3275
3275
|
ee.vip(function() {
|
|
3276
|
-
var E, S =
|
|
3277
|
-
S.openComplete ? (S.dbOpenError || M.resolve().then(O), m && f(O)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(O), m && f(O)) : (f(O), E =
|
|
3276
|
+
var E, S = n._state;
|
|
3277
|
+
S.openComplete ? (S.dbOpenError || M.resolve().then(O), m && f(O)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(O), m && f(O)) : (f(O), E = n, m || f(function v() {
|
|
3278
3278
|
E.on.ready.unsubscribe(O), E.on.ready.unsubscribe(v);
|
|
3279
3279
|
}));
|
|
3280
3280
|
});
|
|
3281
3281
|
};
|
|
3282
3282
|
}), this.Collection = (s = this, gt(oa.prototype, function(A, v) {
|
|
3283
3283
|
this.db = s;
|
|
3284
|
-
var m =
|
|
3284
|
+
var m = on, E = null;
|
|
3285
3285
|
if (v) try {
|
|
3286
3286
|
m = v();
|
|
3287
3287
|
} catch (P) {
|
|
@@ -3289,8 +3289,8 @@ function Ma() {
|
|
|
3289
3289
|
}
|
|
3290
3290
|
var S = A._ctx, v = S.table, A = v.hook.reading.fire;
|
|
3291
3291
|
this._ctx = { table: v, index: S.index, isPrimKey: !S.index || v.schema.primKey.keyPath && S.index === v.schema.primKey.name, range: m, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: E, or: S.or, valueMapper: A !== ct ? A : null };
|
|
3292
|
-
})), this.Table = (i = this, gt(
|
|
3293
|
-
this.db = i, this._tx = m, this.name = f, this.schema = O, this.hook = i._allTables[f] ? i._allTables[f].hook : ht(null, { creating: [
|
|
3292
|
+
})), this.Table = (i = this, gt(dn.prototype, function(f, O, m) {
|
|
3293
|
+
this.db = i, this._tx = m, this.name = f, this.schema = O, this.hook = i._allTables[f] ? i._allTables[f].hook : ht(null, { creating: [Jn, Q], reading: [Xn, ct], updating: [qn, Q], deleting: [Zn, Q] });
|
|
3294
3294
|
})), this.Transaction = (u = this, gt(ua.prototype, function(f, O, m, E, S) {
|
|
3295
3295
|
var v = this;
|
|
3296
3296
|
this.db = u, this.mode = f, this.storeNames = O, this.schema = m, this.chromeTransactionDurability = E, this.idbtrans = null, this.on = ht(this, "complete", "error", "abort"), this.parent = S || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new M(function(A, P) {
|
|
@@ -3303,7 +3303,7 @@ function Ma() {
|
|
|
3303
3303
|
});
|
|
3304
3304
|
})), this.Version = (d = this, gt(ma.prototype, function(f) {
|
|
3305
3305
|
this.db = d, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3306
|
-
})), this.WhereClause = (p = this, gt(
|
|
3306
|
+
})), this.WhereClause = (p = this, gt(mn.prototype, function(f, O, m) {
|
|
3307
3307
|
if (this.db = p, this._ctx = { table: f, index: O === ":id" ? null : O, or: m }, this._cmp = this._ascending = H, this._descending = function(E, S) {
|
|
3308
3308
|
return H(S, E);
|
|
3309
3309
|
}, this._max = function(E, S) {
|
|
@@ -3312,14 +3312,14 @@ function Ma() {
|
|
|
3312
3312
|
return H(E, S) < 0 ? E : S;
|
|
3313
3313
|
}, this._IDBKeyRange = p._deps.IDBKeyRange, !this._IDBKeyRange) throw new L.MissingAPI();
|
|
3314
3314
|
})), this.on("versionchange", function(f) {
|
|
3315
|
-
0 < f.newVersion ? console.warn("Another connection wants to upgrade database '".concat(
|
|
3315
|
+
0 < f.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
3316
3316
|
}), this.on("blocked", function(f) {
|
|
3317
|
-
!f.newVersion || f.newVersion < f.oldVersion ? console.warn("Dexie.delete('".concat(
|
|
3318
|
-
}), this._maxKey = bt(
|
|
3319
|
-
return new
|
|
3317
|
+
!f.newVersion || f.newVersion < f.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(f.oldVersion / 10));
|
|
3318
|
+
}), this._maxKey = bt(r.IDBKeyRange), this._createTransaction = function(f, O, m, E) {
|
|
3319
|
+
return new n.Transaction(f, O, m, n._options.chromeTransactionDurability, E);
|
|
3320
3320
|
}, this._fireOnBlocked = function(f) {
|
|
3321
|
-
|
|
3322
|
-
return O.name ===
|
|
3321
|
+
n.on("blocked").fire(f), tt.filter(function(O) {
|
|
3322
|
+
return O.name === n.name && O !== n && !O._state.vcFired;
|
|
3323
3323
|
}).map(function(O) {
|
|
3324
3324
|
return O.on("versionchange").fire(f);
|
|
3325
3325
|
});
|
|
@@ -3327,25 +3327,25 @@ function Ma() {
|
|
|
3327
3327
|
var w = new Proxy(this, { get: function(f, O, m) {
|
|
3328
3328
|
if (O === "_vip") return !0;
|
|
3329
3329
|
if (O === "table") return function(S) {
|
|
3330
|
-
return Jt(
|
|
3330
|
+
return Jt(n.table(S), w);
|
|
3331
3331
|
};
|
|
3332
3332
|
var E = Reflect.get(f, O, m);
|
|
3333
|
-
return E instanceof
|
|
3333
|
+
return E instanceof dn ? Jt(E, w) : O === "tables" ? E.map(function(S) {
|
|
3334
3334
|
return Jt(S, w);
|
|
3335
3335
|
}) : O === "_createTransaction" ? function() {
|
|
3336
3336
|
return Jt(E.apply(this, arguments), w);
|
|
3337
3337
|
} : E;
|
|
3338
3338
|
} });
|
|
3339
3339
|
this.vip = w, a.forEach(function(f) {
|
|
3340
|
-
return f(
|
|
3340
|
+
return f(n);
|
|
3341
3341
|
});
|
|
3342
3342
|
}
|
|
3343
|
-
var Zt, fe = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Aa = (
|
|
3344
|
-
return this._subscribe(e && typeof e != "function" ? e : { next: e, error:
|
|
3345
|
-
},
|
|
3343
|
+
var Zt, fe = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Aa = (Kr.prototype.subscribe = function(e, r, n) {
|
|
3344
|
+
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: r, complete: n });
|
|
3345
|
+
}, Kr.prototype[fe] = function() {
|
|
3346
3346
|
return this;
|
|
3347
|
-
},
|
|
3348
|
-
function
|
|
3347
|
+
}, Kr);
|
|
3348
|
+
function Kr(e) {
|
|
3349
3349
|
this._subscribe = e;
|
|
3350
3350
|
}
|
|
3351
3351
|
try {
|
|
@@ -3353,18 +3353,18 @@ function Ma() {
|
|
|
3353
3353
|
} catch {
|
|
3354
3354
|
Zt = { indexedDB: null, IDBKeyRange: null };
|
|
3355
3355
|
}
|
|
3356
|
-
function
|
|
3357
|
-
var
|
|
3358
|
-
var i =
|
|
3356
|
+
function Tn(e) {
|
|
3357
|
+
var r, n = !1, a = new Aa(function(s) {
|
|
3358
|
+
var i = ar(e), u, d = !1, p = {}, y = {}, w = { get closed() {
|
|
3359
3359
|
return d;
|
|
3360
3360
|
}, unsubscribe: function() {
|
|
3361
3361
|
d || (d = !0, u && u.abort(), f && Te.storagemutated.unsubscribe(m));
|
|
3362
3362
|
} };
|
|
3363
3363
|
s.start && s.start(w);
|
|
3364
3364
|
var f = !1, O = function() {
|
|
3365
|
-
return
|
|
3365
|
+
return gr(E);
|
|
3366
3366
|
}, m = function(S) {
|
|
3367
|
-
Yt(p, S),
|
|
3367
|
+
Yt(p, S), Tr(y, p) && O();
|
|
3368
3368
|
}, E = function() {
|
|
3369
3369
|
var S, v, A;
|
|
3370
3370
|
!d && Zt.indexedDB && (p = {}, S = {}, u && u.abort(), u = new AbortController(), A = function(P) {
|
|
@@ -3377,14 +3377,14 @@ function Ma() {
|
|
|
3377
3377
|
D && qe();
|
|
3378
3378
|
}
|
|
3379
3379
|
}(v = { subscr: S, signal: u.signal, requery: O, querier: e, trans: null }), Promise.resolve(A).then(function(P) {
|
|
3380
|
-
|
|
3380
|
+
n = !0, r = P, d || v.signal.aborted || (p = {}, function(D) {
|
|
3381
3381
|
for (var I in D) if (ie(D, I)) return;
|
|
3382
3382
|
return 1;
|
|
3383
|
-
}(y = S) || f || (Te(yt, m), f = !0),
|
|
3383
|
+
}(y = S) || f || (Te(yt, m), f = !0), gr(function() {
|
|
3384
3384
|
return !d && s.next && s.next(P);
|
|
3385
3385
|
}));
|
|
3386
3386
|
}, function(P) {
|
|
3387
|
-
|
|
3387
|
+
n = !1, ["DatabaseClosedError", "AbortError"].includes(P?.name) || d || gr(function() {
|
|
3388
3388
|
d || s.error && s.error(P);
|
|
3389
3389
|
});
|
|
3390
3390
|
}));
|
|
@@ -3392,117 +3392,117 @@ function Ma() {
|
|
|
3392
3392
|
return setTimeout(O, 0), w;
|
|
3393
3393
|
});
|
|
3394
3394
|
return a.hasValue = function() {
|
|
3395
|
-
return r;
|
|
3396
|
-
}, a.getValue = function() {
|
|
3397
3395
|
return n;
|
|
3396
|
+
}, a.getValue = function() {
|
|
3397
|
+
return r;
|
|
3398
3398
|
}, a;
|
|
3399
3399
|
}
|
|
3400
3400
|
var He = Se;
|
|
3401
|
-
function
|
|
3402
|
-
var
|
|
3401
|
+
function Br(e) {
|
|
3402
|
+
var r = xe;
|
|
3403
3403
|
try {
|
|
3404
|
-
xe = !0, Te.storagemutated.fire(e),
|
|
3404
|
+
xe = !0, Te.storagemutated.fire(e), Cr(e, !0);
|
|
3405
3405
|
} finally {
|
|
3406
|
-
xe =
|
|
3406
|
+
xe = r;
|
|
3407
3407
|
}
|
|
3408
3408
|
}
|
|
3409
3409
|
be(He, l(l({}, Dt), { delete: function(e) {
|
|
3410
3410
|
return new He(e, { addons: [] }).delete();
|
|
3411
3411
|
}, exists: function(e) {
|
|
3412
|
-
return new He(e, { addons: [] }).open().then(function(
|
|
3413
|
-
return
|
|
3412
|
+
return new He(e, { addons: [] }).open().then(function(r) {
|
|
3413
|
+
return r.close(), !0;
|
|
3414
3414
|
}).catch("NoSuchDatabaseError", function() {
|
|
3415
3415
|
return !1;
|
|
3416
3416
|
});
|
|
3417
3417
|
}, getDatabaseNames: function(e) {
|
|
3418
3418
|
try {
|
|
3419
|
-
return
|
|
3419
|
+
return r = He.dependencies, n = r.indexedDB, r = r.IDBKeyRange, (Ir(n) ? Promise.resolve(n.databases()).then(function(a) {
|
|
3420
3420
|
return a.map(function(s) {
|
|
3421
3421
|
return s.name;
|
|
3422
3422
|
}).filter(function(s) {
|
|
3423
3423
|
return s !== jt;
|
|
3424
3424
|
});
|
|
3425
|
-
}) :
|
|
3425
|
+
}) : Dr(n, r).toCollection().primaryKeys()).then(e);
|
|
3426
3426
|
} catch {
|
|
3427
3427
|
return q(new L.MissingAPI());
|
|
3428
3428
|
}
|
|
3429
|
-
var
|
|
3429
|
+
var r, n;
|
|
3430
3430
|
}, defineClass: function() {
|
|
3431
3431
|
return function(e) {
|
|
3432
3432
|
te(this, e);
|
|
3433
3433
|
};
|
|
3434
3434
|
}, ignoreTransaction: function(e) {
|
|
3435
3435
|
return B.trans ? We(B.transless, e) : e();
|
|
3436
|
-
}, vip:
|
|
3436
|
+
}, vip: Nr, async: function(e) {
|
|
3437
3437
|
return function() {
|
|
3438
3438
|
try {
|
|
3439
|
-
var
|
|
3440
|
-
return
|
|
3441
|
-
} catch (
|
|
3442
|
-
return q(
|
|
3439
|
+
var r = $r(e.apply(this, arguments));
|
|
3440
|
+
return r && typeof r.then == "function" ? r : M.resolve(r);
|
|
3441
|
+
} catch (n) {
|
|
3442
|
+
return q(n);
|
|
3443
3443
|
}
|
|
3444
3444
|
};
|
|
3445
|
-
}, spawn: function(e,
|
|
3445
|
+
}, spawn: function(e, r, n) {
|
|
3446
3446
|
try {
|
|
3447
|
-
var a =
|
|
3447
|
+
var a = $r(e.apply(n, r || []));
|
|
3448
3448
|
return a && typeof a.then == "function" ? a : M.resolve(a);
|
|
3449
3449
|
} catch (s) {
|
|
3450
3450
|
return q(s);
|
|
3451
3451
|
}
|
|
3452
3452
|
}, currentTransaction: { get: function() {
|
|
3453
3453
|
return B.trans || null;
|
|
3454
|
-
} }, waitFor: function(e,
|
|
3455
|
-
return
|
|
3454
|
+
} }, waitFor: function(e, r) {
|
|
3455
|
+
return r = M.resolve(typeof e == "function" ? He.ignoreTransaction(e) : e).timeout(r || 6e4), B.trans ? B.trans.waitFor(r) : r;
|
|
3456
3456
|
}, Promise: M, debug: { get: function() {
|
|
3457
3457
|
return pe;
|
|
3458
3458
|
}, set: function(e) {
|
|
3459
|
-
|
|
3460
|
-
} }, derive: Ye, extend: te, props: be, override:
|
|
3461
|
-
typeof
|
|
3462
|
-
ue(e,
|
|
3459
|
+
qr(e);
|
|
3460
|
+
} }, derive: Ye, extend: te, props: be, override: Hr, Events: ht, on: Te, liveQuery: Tn, extendObservabilitySet: Yt, getByKeyPath: ve, setByKeyPath: ue, delByKeyPath: function(e, r) {
|
|
3461
|
+
typeof r == "string" ? ue(e, r, void 0) : "length" in r && [].map.call(r, function(n) {
|
|
3462
|
+
ue(e, n, void 0);
|
|
3463
3463
|
});
|
|
3464
|
-
}, shallowClone:
|
|
3464
|
+
}, shallowClone: Yr, deepClone: $e, getObjectDiff: jr, cmp: H, asap: Vr, minKey: -1 / 0, addons: [], connections: tt, errnames: sr, dependencies: Zt, cache: ze, semVer: "4.0.11", version: "4.0.11".split(".").map(function(e) {
|
|
3465
3465
|
return parseInt(e);
|
|
3466
|
-
}).reduce(function(e,
|
|
3467
|
-
return e +
|
|
3466
|
+
}).reduce(function(e, r, n) {
|
|
3467
|
+
return e + r / Math.pow(10, 2 * n);
|
|
3468
3468
|
}) })), He.maxKey = bt(He.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Te(yt, function(e) {
|
|
3469
|
-
xe || (e = new CustomEvent(
|
|
3470
|
-
}), addEventListener(
|
|
3471
|
-
e = e.detail, xe ||
|
|
3469
|
+
xe || (e = new CustomEvent(Er, { detail: e }), xe = !0, dispatchEvent(e), xe = !1);
|
|
3470
|
+
}), addEventListener(Er, function(e) {
|
|
3471
|
+
e = e.detail, xe || Br(e);
|
|
3472
3472
|
}));
|
|
3473
|
-
var at, xe = !1,
|
|
3473
|
+
var at, xe = !1, xn = function() {
|
|
3474
3474
|
};
|
|
3475
|
-
return typeof BroadcastChannel < "u" && ((
|
|
3476
|
-
(at = new BroadcastChannel(
|
|
3477
|
-
return e.data &&
|
|
3475
|
+
return typeof BroadcastChannel < "u" && ((xn = function() {
|
|
3476
|
+
(at = new BroadcastChannel(Er)).onmessage = function(e) {
|
|
3477
|
+
return e.data && Br(e.data);
|
|
3478
3478
|
};
|
|
3479
3479
|
})(), typeof at.unref == "function" && at.unref(), Te(yt, function(e) {
|
|
3480
3480
|
xe || at.postMessage(e);
|
|
3481
3481
|
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
3482
3482
|
if (!Se.disableBfCache && e.persisted) {
|
|
3483
3483
|
pe && console.debug("Dexie: handling persisted pagehide"), at?.close();
|
|
3484
|
-
for (var
|
|
3484
|
+
for (var r = 0, n = tt; r < n.length; r++) n[r].close({ disableAutoOpen: !1 });
|
|
3485
3485
|
}
|
|
3486
3486
|
}), addEventListener("pageshow", function(e) {
|
|
3487
|
-
!Se.disableBfCache && e.persisted && (pe && console.debug("Dexie: handling persisted pageshow"),
|
|
3488
|
-
})), M.rejectionMapper = function(e,
|
|
3489
|
-
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !
|
|
3487
|
+
!Se.disableBfCache && e.persisted && (pe && console.debug("Dexie: handling persisted pageshow"), xn(), Br({ all: new ae(-1 / 0, [[]]) }));
|
|
3488
|
+
})), M.rejectionMapper = function(e, r) {
|
|
3489
|
+
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zr[e.name] ? e : (r = new Zr[e.name](r || e.message, e), "stack" in e && Ae(r, "stack", { get: function() {
|
|
3490
3490
|
return this.inner.stack;
|
|
3491
|
-
} }),
|
|
3492
|
-
},
|
|
3493
|
-
return new pt({ replacePrefix: [e,
|
|
3491
|
+
} }), r);
|
|
3492
|
+
}, qr(pe), l(Se, Object.freeze({ __proto__: null, Dexie: Se, liveQuery: Tn, Entity: cn, cmp: H, PropModification: pt, replacePrefix: function(e, r) {
|
|
3493
|
+
return new pt({ replacePrefix: [e, r] });
|
|
3494
3494
|
}, add: function(e) {
|
|
3495
3495
|
return new pt({ add: e });
|
|
3496
3496
|
}, remove: function(e) {
|
|
3497
3497
|
return new pt({ remove: e });
|
|
3498
|
-
}, default: Se, RangeSet: ae, mergeRanges: wt, rangesOverlap:
|
|
3498
|
+
}, default: Se, RangeSet: ae, mergeRanges: wt, rangesOverlap: wn }), { default: Se }), Se;
|
|
3499
3499
|
});
|
|
3500
|
-
}(
|
|
3500
|
+
}(tr)), tr.exports;
|
|
3501
3501
|
}
|
|
3502
3502
|
var Ga = Ma();
|
|
3503
|
-
const
|
|
3504
|
-
if (
|
|
3505
|
-
throw new Error(`Two different versions of Dexie loaded in the same app: ${
|
|
3503
|
+
const Ur = /* @__PURE__ */ $a(Ga), $n = Symbol.for("Dexie"), St = globalThis[$n] || (globalThis[$n] = Ur);
|
|
3504
|
+
if (Ur.semVer !== St.semVer)
|
|
3505
|
+
throw new Error(`Two different versions of Dexie loaded in the same app: ${Ur.semVer} and ${St.semVer}`);
|
|
3506
3506
|
const {
|
|
3507
3507
|
liveQuery: La,
|
|
3508
3508
|
mergeRanges: Wa,
|
|
@@ -3515,7 +3515,7 @@ const {
|
|
|
3515
3515
|
add: Qa,
|
|
3516
3516
|
remove: Xa
|
|
3517
3517
|
} = St;
|
|
3518
|
-
class
|
|
3518
|
+
class Mn {
|
|
3519
3519
|
db;
|
|
3520
3520
|
subscribers = [];
|
|
3521
3521
|
options;
|
|
@@ -4235,7 +4235,7 @@ class Mr {
|
|
|
4235
4235
|
success: !1
|
|
4236
4236
|
}));
|
|
4237
4237
|
}
|
|
4238
|
-
function
|
|
4238
|
+
function zr(h) {
|
|
4239
4239
|
return new Promise((t, o) => {
|
|
4240
4240
|
h.oncomplete = h.onsuccess = () => t(h.result), h.onabort = h.onerror = () => o(h.error);
|
|
4241
4241
|
});
|
|
@@ -4246,24 +4246,24 @@ function Ka(h, t) {
|
|
|
4246
4246
|
if (o)
|
|
4247
4247
|
return o;
|
|
4248
4248
|
const g = indexedDB.open(h);
|
|
4249
|
-
return g.onupgradeneeded = () => g.result.createObjectStore(t), o =
|
|
4249
|
+
return g.onupgradeneeded = () => g.result.createObjectStore(t), o = zr(g), o.then((b) => {
|
|
4250
4250
|
b.onclose = () => o = void 0;
|
|
4251
4251
|
}, () => {
|
|
4252
4252
|
}), o;
|
|
4253
4253
|
};
|
|
4254
4254
|
return (g, b) => l().then((x) => b(x.transaction(t, g).objectStore(t)));
|
|
4255
4255
|
}
|
|
4256
|
-
let
|
|
4257
|
-
function
|
|
4258
|
-
return
|
|
4256
|
+
let Fr;
|
|
4257
|
+
function Gn() {
|
|
4258
|
+
return Fr || (Fr = Ka("keyval-store", "keyval")), Fr;
|
|
4259
4259
|
}
|
|
4260
|
-
function _e(h, t =
|
|
4261
|
-
return t("readonly", (o) =>
|
|
4260
|
+
function _e(h, t = Gn()) {
|
|
4261
|
+
return t("readonly", (o) => zr(o.get(h)));
|
|
4262
4262
|
}
|
|
4263
|
-
function ke(h, t, o =
|
|
4264
|
-
return o("readwrite", (l) => (l.put(t, h),
|
|
4263
|
+
function ke(h, t, o = Gn()) {
|
|
4264
|
+
return o("readwrite", (l) => (l.put(t, h), zr(l.transaction)));
|
|
4265
4265
|
}
|
|
4266
|
-
class
|
|
4266
|
+
class Kn {
|
|
4267
4267
|
subscribers = [];
|
|
4268
4268
|
options;
|
|
4269
4269
|
constructor(t) {
|
|
@@ -4559,7 +4559,7 @@ class Kr {
|
|
|
4559
4559
|
success: !1
|
|
4560
4560
|
});
|
|
4561
4561
|
}
|
|
4562
|
-
class
|
|
4562
|
+
class Bn {
|
|
4563
4563
|
subscribers = [];
|
|
4564
4564
|
options;
|
|
4565
4565
|
constructor(t) {
|
|
@@ -4894,7 +4894,7 @@ class Br {
|
|
|
4894
4894
|
success: !1
|
|
4895
4895
|
});
|
|
4896
4896
|
}
|
|
4897
|
-
class
|
|
4897
|
+
class Ln {
|
|
4898
4898
|
subscribers = [];
|
|
4899
4899
|
options;
|
|
4900
4900
|
constructor(t) {
|
|
@@ -5234,7 +5234,7 @@ class Lr {
|
|
|
5234
5234
|
success: !1
|
|
5235
5235
|
});
|
|
5236
5236
|
}
|
|
5237
|
-
class
|
|
5237
|
+
class Wn {
|
|
5238
5238
|
subscribers = [];
|
|
5239
5239
|
options;
|
|
5240
5240
|
constructor(t) {
|
|
@@ -5585,25 +5585,28 @@ class Ja {
|
|
|
5585
5585
|
this.actions(l);
|
|
5586
5586
|
}, this.bc.postMessage({ event: X.STORAGE_INIT, data: {} }), this.api = new ka(t), t.storage) {
|
|
5587
5587
|
case he.DEXIE:
|
|
5588
|
-
this.sm = new
|
|
5588
|
+
this.sm = new Mn(t);
|
|
5589
5589
|
break;
|
|
5590
5590
|
case he.LOCAL:
|
|
5591
|
-
this.sm = new
|
|
5591
|
+
this.sm = new Ln(t);
|
|
5592
5592
|
break;
|
|
5593
5593
|
case he.SESSION:
|
|
5594
|
-
this.sm = new
|
|
5594
|
+
this.sm = new Bn(t);
|
|
5595
5595
|
break;
|
|
5596
5596
|
case he.KEYVAL:
|
|
5597
|
-
this.sm = new
|
|
5597
|
+
this.sm = new Kn(t);
|
|
5598
5598
|
break;
|
|
5599
5599
|
case he.WINDOW:
|
|
5600
|
-
this.sm = new
|
|
5600
|
+
this.sm = new Wn(t);
|
|
5601
5601
|
break;
|
|
5602
5602
|
}
|
|
5603
5603
|
}
|
|
5604
5604
|
addSubscriber(t) {
|
|
5605
5605
|
this.subscribers[t.widget] = t;
|
|
5606
5606
|
}
|
|
5607
|
+
deleteSubscriber(t) {
|
|
5608
|
+
delete this.subscribers[t.widget];
|
|
5609
|
+
}
|
|
5607
5610
|
update = async (t) => {
|
|
5608
5611
|
if (this.sm === null || Object.keys(this.subscribers).length === 0)
|
|
5609
5612
|
return;
|
|
@@ -5626,7 +5629,7 @@ class Ja {
|
|
|
5626
5629
|
let x;
|
|
5627
5630
|
x = t.data.messages.filter(
|
|
5628
5631
|
($) => $.id !== null
|
|
5629
|
-
), t.data.messages = x, b = t.data.messages.length > 0 ?
|
|
5632
|
+
), t.data.messages = x, b = t.data.messages.length > 0 ? Wr(t.data.messages[0].utc) : "none", g?.hash && g.hash === b ? (K(3, [
|
|
5630
5633
|
"%cload%c %cleanMessages",
|
|
5631
5634
|
c.NO_UPDATES,
|
|
5632
5635
|
c.NONE,
|
|
@@ -5635,7 +5638,7 @@ class Ja {
|
|
|
5635
5638
|
]), K(4, ["%cmessages", c.MESSAGES, t]), l = 204) : (o = t, g.hash = b, l = await this.sm?.setMessages(t.query, t).then(async ($) => ($ = 201, this.broadcastUpdate($, t))));
|
|
5636
5639
|
break;
|
|
5637
5640
|
case _.CLOUD:
|
|
5638
|
-
b =
|
|
5641
|
+
b = Wr(t.data.cloud), g?.hash && g.hash === b ? (K(3, [
|
|
5639
5642
|
"%cload%c %ccloud",
|
|
5640
5643
|
c.NO_UPDATES,
|
|
5641
5644
|
c.NONE,
|
|
@@ -5651,7 +5654,7 @@ class Ja {
|
|
|
5651
5654
|
}, l = await this.sm?.setCloud(t.query, o.data).then(($) => this.broadcastUpdate($, t)));
|
|
5652
5655
|
break;
|
|
5653
5656
|
case _.SERIES:
|
|
5654
|
-
b =
|
|
5657
|
+
b = Wr(t.data.series), g?.hash && g.hash === b ? (K(3, [
|
|
5655
5658
|
"%cload%c %cseries",
|
|
5656
5659
|
c.NO_UPDATES,
|
|
5657
5660
|
c.NONE,
|
|
@@ -5707,7 +5710,7 @@ class Ja {
|
|
|
5707
5710
|
c.NONE,
|
|
5708
5711
|
c.WIDGET,
|
|
5709
5712
|
c.NONE,
|
|
5710
|
-
|
|
5713
|
+
kn(o.query),
|
|
5711
5714
|
// @ts-ignore
|
|
5712
5715
|
`${o.data?.title ?? ""} ${o.query.widget}`
|
|
5713
5716
|
]), K(4, [
|
|
@@ -5729,7 +5732,7 @@ class Ja {
|
|
|
5729
5732
|
c.NONE,
|
|
5730
5733
|
c.WIDGET,
|
|
5731
5734
|
c.NONE,
|
|
5732
|
-
|
|
5735
|
+
kn(o.query),
|
|
5733
5736
|
"Fetch error",
|
|
5734
5737
|
o.query
|
|
5735
5738
|
]);
|
|
@@ -5798,6 +5801,7 @@ class Ja {
|
|
|
5798
5801
|
};
|
|
5799
5802
|
hideLabels = async (t) => await this.api.hideLabels(t);
|
|
5800
5803
|
getSubscribers = async () => await new Promise((t) => t(this.subscribers));
|
|
5804
|
+
deleteSubscribers = async () => (this.subscribers = [], await new Promise((t) => t(this.subscribers)));
|
|
5801
5805
|
getSlide = async (t) => await this.sm?.getSlide(t);
|
|
5802
5806
|
getSlides = async (t) => await this.sm?.getSlides(t);
|
|
5803
5807
|
setSlide = async (t) => await this.sm?.setSlide(t);
|
|
@@ -5834,19 +5838,19 @@ class Ba {
|
|
|
5834
5838
|
constructor(t) {
|
|
5835
5839
|
switch (this.sm = null, t.storage) {
|
|
5836
5840
|
case he.DEXIE:
|
|
5837
|
-
this.sm = new
|
|
5841
|
+
this.sm = new Mn(t);
|
|
5838
5842
|
break;
|
|
5839
5843
|
case he.LOCAL:
|
|
5840
|
-
this.sm = new
|
|
5844
|
+
this.sm = new Ln(t);
|
|
5841
5845
|
break;
|
|
5842
5846
|
case he.SESSION:
|
|
5843
|
-
this.sm = new
|
|
5847
|
+
this.sm = new Bn(t);
|
|
5844
5848
|
break;
|
|
5845
5849
|
case he.KEYVAL:
|
|
5846
|
-
this.sm = new
|
|
5850
|
+
this.sm = new Kn(t);
|
|
5847
5851
|
break;
|
|
5848
5852
|
case he.WINDOW:
|
|
5849
|
-
this.sm = new
|
|
5853
|
+
this.sm = new Wn(t);
|
|
5850
5854
|
break;
|
|
5851
5855
|
}
|
|
5852
5856
|
}
|