buzzcasting-storage 3.1.1 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buzzcasting-storage.d.ts +3 -0
- package/dist/buzzcasting-storage.esm.js +791 -777
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var k = (
|
|
4
|
-
var N = /* @__PURE__ */ ((
|
|
5
|
-
const ka = "3.1.
|
|
1
|
+
var Aa = Object.defineProperty;
|
|
2
|
+
var xa = (l, r, o) => r in l ? Aa(l, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[r] = o;
|
|
3
|
+
var k = (l, r, o) => xa(l, typeof r != "symbol" ? r + "" : r, o);
|
|
4
|
+
var N = /* @__PURE__ */ ((l) => (l.MESSAGES = "messages", l.CLOUD = "cloud", l.SERIES = "series", l.TOPICS = "topics", l.WIDGET = "widget", l.WIDGETS = "widgets", l.SLIDE = "slide", l))(N || {}), g = /* @__PURE__ */ ((l) => (l.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", l.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", l.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", l.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", l.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", l.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", l.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", l.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", l.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", l.NONE = "color:transparent;background-color:transparent;", l.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", l.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", l.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", l.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", l.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", l.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", l.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", l))(g || {}), re = /* @__PURE__ */ ((l) => (l.ADD_SLIDE = "addSlide", l.APP_READY = "appReady", l.API_UPDATE = "apiUpdate", l.WS_API_REQUEST = "wsApiRequest", l.WS_API_RESPONSE = "wsApiResponse", l.WS_API_UPDATE = "wsApiUpdate", l.APPROVE_MESSAGE = "approveMessage", l.CHANNEL = "channel", l.CLEAN_MESSAGES = "cleanMessages", l.CLOSE_MODAL = "closeModal", l.CLOSE_BUILDER_MODAL = "closeBuilderModal", l.ERROR = "error", l.HIDE_MESSAGE = "hideMessage", l.HIDE_LABELS = "hideLabels", l.MAUPPUT_UPDATE = "layoutUpdate", l.PAUSE_PRESENTATION = "pausePresentation", l.PRESENTATION_READY = "presentationReady", l.PREV_SLIDE = "prevSlide", l.RELOAD_PRESENTATION = "reloadPresentation", l.SHOW_MODAL = "showModal", l.STAR_MESSAGE = "starMessage", l.GOTO_SLIDE = "gotoSlide", l.NEXT_SLIDE = "nextSlide", l.SHOW_BUILDER_MODAL = "showBuilderModal", l.SLIDE_DID_LOAD = "slideDidLoad", l.SLIDE_GOTO = "slideGoto", l.SLIDE_READY = "slideReady", l.SLIDE_LOAD = "loadSlide", l.SLIDE_STORE = "storeSlide", l.SLIDE_TRANSITIONER = "slideTransitioner", l.START_TRANSITIONER = "startTransitioner", l.STORAGE_INIT = "storageInit", l.SUBSCRIBE = "subscribe", l.SUSPEND_ACCOUNT = "suspendAccount", l.REMOVE_CLOUD = "removeCloud", l.UPDATE = "update", l.VERSION = "version", l.WIDGET_UPDATE = "widgetUpdate", l))(re || {}), Zt = /* @__PURE__ */ ((l) => (l.APPROVED = "approved", l.BEFORE = "before", l.DELAYED = "delayed", l.NONE = "none", l.REALTIME = "realtime", l))(Zt || {}), ye = /* @__PURE__ */ ((l) => (l.KEYVAL = "keyval", l.LOCAL = "local", l.SESSION = "session", l.DEXIE = "dexie", l.WINDOW = "window", l))(ye || {});
|
|
5
|
+
const ka = "3.1.2";
|
|
6
6
|
class Da {
|
|
7
7
|
constructor(r) {
|
|
8
8
|
k(this, "options");
|
|
@@ -32,18 +32,18 @@ class Da {
|
|
|
32
32
|
this.options = r, this.url = `https://${r.app}.buzzcasting.net`;
|
|
33
33
|
}
|
|
34
34
|
async get(r) {
|
|
35
|
-
const { version: o } = this.options,
|
|
36
|
-
delete
|
|
37
|
-
const D = Object.keys(
|
|
35
|
+
const { version: o } = this.options, d = this.headers(), A = Object.assign({}, r);
|
|
36
|
+
delete A.slide, delete A.type, delete A.hash, delete A.order, delete A.period;
|
|
37
|
+
const D = Object.keys(A).length > 0 ? `?${new URLSearchParams(A).toString()}` : "";
|
|
38
38
|
return console.info(
|
|
39
39
|
"%capi%c %cfetch",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
g.API,
|
|
41
|
+
g.NONE,
|
|
42
|
+
g.GET_DATA,
|
|
43
43
|
r.widget
|
|
44
|
-
), console.debug("%capi%c %cfetch",
|
|
44
|
+
), console.debug("%capi%c %cfetch", g.API, g.NONE, g.GET_DATA, A), await fetch(
|
|
45
45
|
[this.url, "api", o, r.type].join("/") + D,
|
|
46
|
-
{ ...
|
|
46
|
+
{ ...d, method: "get" }
|
|
47
47
|
).then(async (K) => {
|
|
48
48
|
if (!K.ok)
|
|
49
49
|
throw new Error(`${K.status}`);
|
|
@@ -51,18 +51,25 @@ class Da {
|
|
|
51
51
|
}).then((K) => K.json()).then((K) => (K.query = r, K)).catch((K) => ({ success: !1, message: `${K}`, data: null }));
|
|
52
52
|
}
|
|
53
53
|
async hideMessage(r) {
|
|
54
|
-
const { version: o } = this.options,
|
|
54
|
+
const { version: o } = this.options, d = this.headers(), A = "?action=visible";
|
|
55
55
|
return console.info(
|
|
56
56
|
"%capi%c %cput",
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
g.API,
|
|
58
|
+
g.NONE,
|
|
59
|
+
g.GET_DATA,
|
|
60
60
|
re.HIDE_MESSAGE,
|
|
61
61
|
r.widget,
|
|
62
62
|
r.id
|
|
63
|
+
), console.debug(
|
|
64
|
+
"%capi%c %cput",
|
|
65
|
+
g.API,
|
|
66
|
+
g.NONE,
|
|
67
|
+
g.GET_DATA,
|
|
68
|
+
re.HIDE_MESSAGE,
|
|
69
|
+
r
|
|
63
70
|
), await fetch(
|
|
64
|
-
[this.url, "api", o, "messages", r.id].join("/") +
|
|
65
|
-
{ ...
|
|
71
|
+
[this.url, "api", o, "messages", r.id].join("/") + A,
|
|
72
|
+
{ ...d, method: "put" }
|
|
66
73
|
).then((D) => {
|
|
67
74
|
if (!D.ok)
|
|
68
75
|
throw new Error(D.statusText);
|
|
@@ -70,20 +77,20 @@ class Da {
|
|
|
70
77
|
}).then((D) => D.json()).catch((D) => ({ succes: !1, message: D, data: [] }));
|
|
71
78
|
}
|
|
72
79
|
async hideLabels(r) {
|
|
73
|
-
const { version: o } = this.options,
|
|
80
|
+
const { version: o } = this.options, d = this.formHeaders(), A = new URLSearchParams(), D = r.labels || [];
|
|
74
81
|
for (const [K, U] of D.entries())
|
|
75
|
-
|
|
82
|
+
A.append(`custom_filters[${K}]`, U);
|
|
76
83
|
return console.info(
|
|
77
84
|
"%capi%c %cput",
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
g.API,
|
|
86
|
+
g.NONE,
|
|
87
|
+
g.GET_DATA,
|
|
81
88
|
re.HIDE_LABELS,
|
|
82
89
|
r.widget,
|
|
83
90
|
D
|
|
84
91
|
), await fetch(
|
|
85
92
|
[this.url, "api", o, r.type, r.widget].join("/"),
|
|
86
|
-
{ ...
|
|
93
|
+
{ ...d, body: A, method: "put" }
|
|
87
94
|
).then((K) => {
|
|
88
95
|
if (!K.ok)
|
|
89
96
|
throw new Error(K.statusText);
|
|
@@ -91,17 +98,17 @@ class Da {
|
|
|
91
98
|
}).then((K) => K.json()).catch((K) => ({ succes: !1, message: K, data: [] }));
|
|
92
99
|
}
|
|
93
100
|
async loadSlide(r) {
|
|
94
|
-
const { version: o } = this.options,
|
|
95
|
-
return delete
|
|
101
|
+
const { version: o } = this.options, d = this.headers(), A = Object.assign({}, r);
|
|
102
|
+
return delete A.slide, delete A.type, delete A.hash, console.info(
|
|
96
103
|
"%capi%c %cloadSlide",
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
g.API,
|
|
105
|
+
g.NONE,
|
|
106
|
+
g.SLIDE,
|
|
100
107
|
re.SLIDE_LOAD,
|
|
101
108
|
r.slide
|
|
102
109
|
), await fetch(
|
|
103
110
|
[this.url, "api", o, "slides", r.id].join("/"),
|
|
104
|
-
{ ...
|
|
111
|
+
{ ...d, method: "get" }
|
|
105
112
|
).then(async (D) => {
|
|
106
113
|
if (!D.ok)
|
|
107
114
|
throw new Error(`${D.status}`);
|
|
@@ -116,19 +123,26 @@ class Da {
|
|
|
116
123
|
* @returns
|
|
117
124
|
*/
|
|
118
125
|
async storeSlide(r) {
|
|
119
|
-
const { version: o } = this.options,
|
|
126
|
+
const { version: o } = this.options, d = this.formHeaders();
|
|
120
127
|
delete r.update, delete r.type;
|
|
121
|
-
const
|
|
128
|
+
const A = JSON.stringify(r);
|
|
122
129
|
return console.info(
|
|
123
130
|
"%capi%c %cput",
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
g.API,
|
|
132
|
+
g.NONE,
|
|
133
|
+
g.SLIDE,
|
|
127
134
|
re.SLIDE_STORE,
|
|
128
135
|
r.id
|
|
136
|
+
), console.debug(
|
|
137
|
+
"%capi%c %cput",
|
|
138
|
+
g.API,
|
|
139
|
+
g.NONE,
|
|
140
|
+
g.SLIDE,
|
|
141
|
+
re.SLIDE_STORE,
|
|
142
|
+
r
|
|
129
143
|
), await fetch(
|
|
130
144
|
[this.url, "api", o, "slides", r.id].join("/"),
|
|
131
|
-
{ ...
|
|
145
|
+
{ ...d, body: A, method: "put" }
|
|
132
146
|
).then((D) => {
|
|
133
147
|
if (!D.ok)
|
|
134
148
|
throw new Error(D.statusText);
|
|
@@ -137,14 +151,14 @@ class Da {
|
|
|
137
151
|
}
|
|
138
152
|
}
|
|
139
153
|
var Pa = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
140
|
-
function Ia(
|
|
141
|
-
return
|
|
154
|
+
function Ia(l) {
|
|
155
|
+
return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
|
|
142
156
|
}
|
|
143
157
|
var qt = { exports: {} }, Ca = qt.exports, Rr;
|
|
144
158
|
function Ra() {
|
|
145
|
-
return Rr || (Rr = 1, function(
|
|
146
|
-
(function(o,
|
|
147
|
-
|
|
159
|
+
return Rr || (Rr = 1, function(l, r) {
|
|
160
|
+
(function(o, d) {
|
|
161
|
+
l.exports = d();
|
|
148
162
|
})(Ca, function() {
|
|
149
163
|
var o = function(e, t) {
|
|
150
164
|
return (o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
|
@@ -152,13 +166,13 @@ function Ra() {
|
|
|
152
166
|
} || function(n, a) {
|
|
153
167
|
for (var i in a) Object.prototype.hasOwnProperty.call(a, i) && (n[i] = a[i]);
|
|
154
168
|
})(e, t);
|
|
155
|
-
},
|
|
156
|
-
return (
|
|
169
|
+
}, d = function() {
|
|
170
|
+
return (d = Object.assign || function(e) {
|
|
157
171
|
for (var t, n = 1, a = arguments.length; n < a; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
158
172
|
return e;
|
|
159
173
|
}).apply(this, arguments);
|
|
160
174
|
};
|
|
161
|
-
function
|
|
175
|
+
function A(e, t, n) {
|
|
162
176
|
for (var a, i = 0, s = t.length; i < s; i++) !a && i in t || ((a = a || Array.prototype.slice.call(t, 0, i))[i] = t[i]);
|
|
163
177
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
164
178
|
}
|
|
@@ -175,16 +189,16 @@ function Ra() {
|
|
|
175
189
|
}
|
|
176
190
|
function le(e, t) {
|
|
177
191
|
typeof t == "function" && (t = t(X(e))), (typeof Reflect > "u" ? K : Reflect.ownKeys)(t).forEach(function(n) {
|
|
178
|
-
|
|
192
|
+
Ae(e, n, t[n]);
|
|
179
193
|
});
|
|
180
194
|
}
|
|
181
195
|
var He = Object.defineProperty;
|
|
182
|
-
function
|
|
196
|
+
function Ae(e, t, n, a) {
|
|
183
197
|
He(e, t, M(n && ee(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, a));
|
|
184
198
|
}
|
|
185
199
|
function Ye(e) {
|
|
186
200
|
return { from: function(t) {
|
|
187
|
-
return e.prototype = Object.create(t.prototype),
|
|
201
|
+
return e.prototype = Object.create(t.prototype), Ae(e.prototype, "constructor", e), { extend: le.bind(null, e.prototype) };
|
|
188
202
|
} };
|
|
189
203
|
}
|
|
190
204
|
var Ur = Object.getOwnPropertyDescriptor, Fr = [].slice;
|
|
@@ -401,8 +415,8 @@ function Ra() {
|
|
|
401
415
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
402
416
|
return [t, X(t), e];
|
|
403
417
|
}(), ut = Ne[0], ge = Ne[1], Ne = Ne[2], ge = ge && ge.then, Ke = ut && ut.constructor, on = !!Ne, ct = function(e, t) {
|
|
404
|
-
lt.push([e, t]),
|
|
405
|
-
}, un = !0,
|
|
418
|
+
lt.push([e, t]), At && (queueMicrotask(ta), At = !1);
|
|
419
|
+
}, un = !0, At = !0, Be = [], xt = [], cn = st, xe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: J, pgp: !1, env: {}, finalize: J }, G = xe, lt = [], Le = 0, kt = [];
|
|
406
420
|
function B(e) {
|
|
407
421
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
408
422
|
this._listeners = [], this._lib = !1;
|
|
@@ -430,14 +444,14 @@ function Ra() {
|
|
|
430
444
|
var ln = { get: function() {
|
|
431
445
|
var e = G, t = Ct;
|
|
432
446
|
function n(a, i) {
|
|
433
|
-
var s = this, u = !e.global && (e !== G || t !== Ct), c = u && !De(), h = new B(function(
|
|
434
|
-
fn(s, new tr(ar(a, e, u, c), ar(i, e, u, c),
|
|
447
|
+
var s = this, u = !e.global && (e !== G || t !== Ct), c = u && !De(), h = new B(function(y, v) {
|
|
448
|
+
fn(s, new tr(ar(a, e, u, c), ar(i, e, u, c), y, v, e));
|
|
435
449
|
});
|
|
436
450
|
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
437
451
|
}
|
|
438
452
|
return n.prototype = ot, n;
|
|
439
453
|
}, set: function(e) {
|
|
440
|
-
|
|
454
|
+
Ae(this, "then", e && e.prototype === ot ? ln : { get: function() {
|
|
441
455
|
return e;
|
|
442
456
|
}, set: ln.set });
|
|
443
457
|
} };
|
|
@@ -446,7 +460,7 @@ function Ra() {
|
|
|
446
460
|
}
|
|
447
461
|
function dn(e, t) {
|
|
448
462
|
var n, a;
|
|
449
|
-
|
|
463
|
+
xt.push(t), e._state === null && (n = e._lib && Ve(), t = cn(t), e._state = !1, e._value = t, a = e, Be.some(function(i) {
|
|
450
464
|
return i._value === a._value;
|
|
451
465
|
}) || Be.push(a), nr(e), n && Ze());
|
|
452
466
|
}
|
|
@@ -469,9 +483,9 @@ function Ra() {
|
|
|
469
483
|
function ea(e, t, n) {
|
|
470
484
|
try {
|
|
471
485
|
var a, i = t._value;
|
|
472
|
-
!t._state &&
|
|
486
|
+
!t._state && xt.length && (xt = []), a = me && t._consoleTask ? t._consoleTask.run(function() {
|
|
473
487
|
return e(i);
|
|
474
|
-
}) : e(i), t._state ||
|
|
488
|
+
}) : e(i), t._state || xt.indexOf(i) !== -1 || function(s) {
|
|
475
489
|
for (var u = Be.length; u; ) if (Be[--u]._value === s._value) return Be.splice(u, 1);
|
|
476
490
|
}(t), n.resolve(a);
|
|
477
491
|
} catch (s) {
|
|
@@ -481,13 +495,13 @@ function Ra() {
|
|
|
481
495
|
}
|
|
482
496
|
}
|
|
483
497
|
function ta() {
|
|
484
|
-
Ge(
|
|
498
|
+
Ge(xe, function() {
|
|
485
499
|
Ve() && Ze();
|
|
486
500
|
});
|
|
487
501
|
}
|
|
488
502
|
function Ve() {
|
|
489
503
|
var e = un;
|
|
490
|
-
return
|
|
504
|
+
return At = un = !1, e;
|
|
491
505
|
}
|
|
492
506
|
function Ze() {
|
|
493
507
|
var e, t, n;
|
|
@@ -497,7 +511,7 @@ function Ra() {
|
|
|
497
511
|
a[0].apply(null, a[1]);
|
|
498
512
|
}
|
|
499
513
|
while (0 < lt.length);
|
|
500
|
-
|
|
514
|
+
At = un = !0;
|
|
501
515
|
}
|
|
502
516
|
function hn() {
|
|
503
517
|
var e = Be;
|
|
@@ -550,7 +564,7 @@ function Ra() {
|
|
|
550
564
|
}, e);
|
|
551
565
|
n.then(a, i).finally(clearTimeout.bind(null, s));
|
|
552
566
|
}) : this;
|
|
553
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag &&
|
|
567
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(B.prototype, Symbol.toStringTag, "Dexie.Promise"), xe.env = rr(), le(B, { all: function() {
|
|
554
568
|
var e = Se.apply(null, arguments).map(Rt);
|
|
555
569
|
return new B(function(t, n) {
|
|
556
570
|
e.length === 0 && t([]);
|
|
@@ -594,15 +608,15 @@ function Ra() {
|
|
|
594
608
|
var c, h = this;
|
|
595
609
|
c = function() {
|
|
596
610
|
h.unhandleds.length === 0 ? i() : s(h.unhandleds[0]);
|
|
597
|
-
}, kt.push(function
|
|
598
|
-
c(), kt.splice(kt.indexOf(
|
|
611
|
+
}, kt.push(function y() {
|
|
612
|
+
c(), kt.splice(kt.indexOf(y), 1);
|
|
599
613
|
}), ++Le, ct(function() {
|
|
600
614
|
--Le == 0 && hn();
|
|
601
615
|
}, []);
|
|
602
616
|
}, u.finalize), e();
|
|
603
617
|
}, t, n, a);
|
|
604
618
|
});
|
|
605
|
-
} }), Ke && (Ke.allSettled &&
|
|
619
|
+
} }), Ke && (Ke.allSettled && Ae(B, "allSettled", function() {
|
|
606
620
|
var e = Se.apply(null, arguments).map(Rt);
|
|
607
621
|
return new B(function(t) {
|
|
608
622
|
e.length === 0 && t([]);
|
|
@@ -617,7 +631,7 @@ function Ra() {
|
|
|
617
631
|
});
|
|
618
632
|
});
|
|
619
633
|
});
|
|
620
|
-
}), Ke.any && typeof AggregateError < "u" &&
|
|
634
|
+
}), Ke.any && typeof AggregateError < "u" && Ae(B, "any", function() {
|
|
621
635
|
var e = Se.apply(null, arguments).map(Rt);
|
|
622
636
|
return new B(function(t, n) {
|
|
623
637
|
e.length === 0 && n(new AggregateError([]));
|
|
@@ -634,7 +648,7 @@ function Ra() {
|
|
|
634
648
|
var ae = { awaits: 0, echoes: 0, id: 0 }, na = 0, Pt = [], It = 0, Ct = 0, ra = 0;
|
|
635
649
|
function ke(e, t, n, a) {
|
|
636
650
|
var i = G, s = Object.create(i);
|
|
637
|
-
return s.parent = i, s.ref = 0, s.global = !1, s.id = ++ra,
|
|
651
|
+
return s.parent = i, s.ref = 0, s.global = !1, s.id = ++ra, xe.env, s.env = on ? { Promise: B, PromiseProp: { value: B, configurable: !0, writable: !0 }, all: B.all, race: B.race, allSettled: B.allSettled, any: B.any, resolve: B.resolve, reject: B.reject } : {}, t && M(s, t), ++i.ref, s.finalize = function() {
|
|
638
652
|
--this.parent.ref || this.parent.finalize();
|
|
639
653
|
}, a = Ge(s, e, n, a), s.ref === 0 && s.finalize(), a;
|
|
640
654
|
}
|
|
@@ -659,7 +673,7 @@ function Ra() {
|
|
|
659
673
|
var n, a = G;
|
|
660
674
|
(t ? !ae.echoes || It++ && e === G : !It || --It && e === G) || queueMicrotask(t ? (function(i) {
|
|
661
675
|
++Ct, ae.echoes && --ae.echoes != 0 || (ae.echoes = ae.awaits = ae.id = 0), Pt.push(G), Pe(i, !0);
|
|
662
|
-
}).bind(null, e) : aa), e !== G && (G = e, a ===
|
|
676
|
+
}).bind(null, e) : aa), e !== G && (G = e, a === xe && (xe.env = rr()), on && (n = xe.env.Promise, t = e.env, (a.global || e.global) && (Object.defineProperty(D, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
663
677
|
}
|
|
664
678
|
function rr() {
|
|
665
679
|
var e = D.Promise;
|
|
@@ -716,13 +730,13 @@ function Ra() {
|
|
|
716
730
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
717
731
|
case "binary":
|
|
718
732
|
return function(i, s) {
|
|
719
|
-
for (var u = i.length, c = s.length, h = u < c ? u : c,
|
|
733
|
+
for (var u = i.length, c = s.length, h = u < c ? u : c, y = 0; y < h; ++y) if (i[y] !== s[y]) return i[y] < s[y] ? -1 : 1;
|
|
720
734
|
return u === c ? 0 : u < c ? -1 : 1;
|
|
721
735
|
}(cr(e), cr(t));
|
|
722
736
|
case "Array":
|
|
723
737
|
return function(i, s) {
|
|
724
|
-
for (var u = i.length, c = s.length, h = u < c ? u : c,
|
|
725
|
-
var v = Y(i[
|
|
738
|
+
for (var u = i.length, c = s.length, h = u < c ? u : c, y = 0; y < h; ++y) {
|
|
739
|
+
var v = Y(i[y], s[y]);
|
|
726
740
|
if (v !== 0) return v;
|
|
727
741
|
}
|
|
728
742
|
return u === c ? 0 : u < c ? -1 : 1;
|
|
@@ -741,7 +755,7 @@ function Ra() {
|
|
|
741
755
|
}
|
|
742
756
|
var lr = (Z.prototype._trans = function(e, t, n) {
|
|
743
757
|
var a = this._tx || G.trans, i = this.name, s = me && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
744
|
-
function u(
|
|
758
|
+
function u(y, v, f) {
|
|
745
759
|
if (!f.schema[i]) throw new $.NotFound("Table " + i + " not part of transaction");
|
|
746
760
|
return t(f.idbtrans, f);
|
|
747
761
|
}
|
|
@@ -749,19 +763,19 @@ function Ra() {
|
|
|
749
763
|
try {
|
|
750
764
|
var h = a && a.db._novip === this.db._novip ? a === G.trans ? a._promise(e, u, n) : ke(function() {
|
|
751
765
|
return a._promise(e, u, n);
|
|
752
|
-
}, { trans: a, transless: G.transless || G }) : function
|
|
766
|
+
}, { trans: a, transless: G.transless || G }) : function y(v, f, S, p) {
|
|
753
767
|
if (v.idbdb && (v._state.openComplete || G.letThrough || v._vip)) {
|
|
754
768
|
var b = v._createTransaction(f, S, v._dbSchema);
|
|
755
769
|
try {
|
|
756
770
|
b.create(), v._state.PR1398_maxLoop = 3;
|
|
757
771
|
} catch (w) {
|
|
758
772
|
return w.name === an.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
759
|
-
return
|
|
773
|
+
return y(v, f, S, p);
|
|
760
774
|
})) : te(w);
|
|
761
775
|
}
|
|
762
|
-
return b._promise(f, function(w,
|
|
776
|
+
return b._promise(f, function(w, m) {
|
|
763
777
|
return ke(function() {
|
|
764
|
-
return G.trans = b, p(w,
|
|
778
|
+
return G.trans = b, p(w, m, b);
|
|
765
779
|
});
|
|
766
780
|
}).then(function(w) {
|
|
767
781
|
if (f === "readwrite") try {
|
|
@@ -779,11 +793,11 @@ function Ra() {
|
|
|
779
793
|
v.open().catch(J);
|
|
780
794
|
}
|
|
781
795
|
return v._state.dbReadyPromise.then(function() {
|
|
782
|
-
return
|
|
796
|
+
return y(v, f, S, p);
|
|
783
797
|
});
|
|
784
798
|
}(this.db, e, [this.name], u);
|
|
785
|
-
return s && (h._consoleTask = s, h = h.catch(function(
|
|
786
|
-
return console.trace(
|
|
799
|
+
return s && (h._consoleTask = s, h = h.catch(function(y) {
|
|
800
|
+
return console.trace(y), te(y);
|
|
787
801
|
})), h;
|
|
788
802
|
} finally {
|
|
789
803
|
c && Ze();
|
|
@@ -801,8 +815,8 @@ function Ra() {
|
|
|
801
815
|
var t = K(e);
|
|
802
816
|
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
803
817
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(c) {
|
|
804
|
-
if (c.compound && t.every(function(
|
|
805
|
-
return 0 <= c.keyPath.indexOf(
|
|
818
|
+
if (c.compound && t.every(function(y) {
|
|
819
|
+
return 0 <= c.keyPath.indexOf(y);
|
|
806
820
|
})) {
|
|
807
821
|
for (var h = 0; h < t.length; ++h) if (t.indexOf(c.keyPath[h]) === -1) return !1;
|
|
808
822
|
return !0;
|
|
@@ -823,8 +837,8 @@ function Ra() {
|
|
|
823
837
|
return Y(c, h) === 0;
|
|
824
838
|
}
|
|
825
839
|
var u = t.reduce(function(f, h) {
|
|
826
|
-
var
|
|
827
|
-
return [
|
|
840
|
+
var y = f[0], v = f[1], f = a[h], S = e[h];
|
|
841
|
+
return [y || f, y || !f ? Ue(v, f && f.multi ? function(p) {
|
|
828
842
|
return p = we(p, h), U(p) && p.some(function(b) {
|
|
829
843
|
return i(S, b);
|
|
830
844
|
});
|
|
@@ -856,12 +870,12 @@ function Ra() {
|
|
|
856
870
|
function i() {
|
|
857
871
|
return t !== null && t.apply(this, arguments) || this;
|
|
858
872
|
}
|
|
859
|
-
(this.schema.mappedClass = e).prototype instanceof or && (function(h,
|
|
860
|
-
if (typeof
|
|
873
|
+
(this.schema.mappedClass = e).prototype instanceof or && (function(h, y) {
|
|
874
|
+
if (typeof y != "function" && y !== null) throw new TypeError("Class extends value " + String(y) + " is not a constructor or null");
|
|
861
875
|
function v() {
|
|
862
876
|
this.constructor = h;
|
|
863
877
|
}
|
|
864
|
-
o(h,
|
|
878
|
+
o(h, y), h.prototype = y === null ? Object.create(y) : (v.prototype = y.prototype, new v());
|
|
865
879
|
}(i, t = e), Object.defineProperty(i.prototype, "db", { get: function() {
|
|
866
880
|
return n;
|
|
867
881
|
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
@@ -872,9 +886,9 @@ function Ra() {
|
|
|
872
886
|
});
|
|
873
887
|
function c(h) {
|
|
874
888
|
if (!h) return h;
|
|
875
|
-
var
|
|
876
|
-
for (
|
|
877
|
-
v[
|
|
889
|
+
var y, v = Object.create(e.prototype);
|
|
890
|
+
for (y in h) if (!s.has(y)) try {
|
|
891
|
+
v[y] = h[y];
|
|
878
892
|
} catch {
|
|
879
893
|
}
|
|
880
894
|
return v;
|
|
@@ -938,11 +952,11 @@ function Ra() {
|
|
|
938
952
|
}, Z.prototype.bulkAdd = function(e, t, n) {
|
|
939
953
|
var a = this, i = Array.isArray(t) ? t : void 0, s = (n = n || (i ? void 0 : t)) ? n.allKeys : void 0;
|
|
940
954
|
return this._trans("readwrite", function(u) {
|
|
941
|
-
var
|
|
942
|
-
if (
|
|
955
|
+
var y = a.schema.primKey, c = y.auto, y = y.keyPath;
|
|
956
|
+
if (y && i) throw new $.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
943
957
|
if (i && i.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
944
|
-
var h = e.length,
|
|
945
|
-
return a.core.mutate({ trans: u, type: "add", keys: i, values:
|
|
958
|
+
var h = e.length, y = y && c ? e.map(Mt(y)) : e;
|
|
959
|
+
return a.core.mutate({ trans: u, type: "add", keys: i, values: y, wantResults: s }).then(function(b) {
|
|
946
960
|
var f = b.numFailures, S = b.results, p = b.lastResult, b = b.failures;
|
|
947
961
|
if (f === 0) return s ? S : p;
|
|
948
962
|
throw new Je("".concat(a.name, ".bulkAdd(): ").concat(f, " of ").concat(h, " operations failed"), b);
|
|
@@ -951,11 +965,11 @@ function Ra() {
|
|
|
951
965
|
}, Z.prototype.bulkPut = function(e, t, n) {
|
|
952
966
|
var a = this, i = Array.isArray(t) ? t : void 0, s = (n = n || (i ? void 0 : t)) ? n.allKeys : void 0;
|
|
953
967
|
return this._trans("readwrite", function(u) {
|
|
954
|
-
var
|
|
955
|
-
if (
|
|
968
|
+
var y = a.schema.primKey, c = y.auto, y = y.keyPath;
|
|
969
|
+
if (y && i) throw new $.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
956
970
|
if (i && i.length !== e.length) throw new $.InvalidArgument("Arguments objects and keys must have the same length");
|
|
957
|
-
var h = e.length,
|
|
958
|
-
return a.core.mutate({ trans: u, type: "put", keys: i, values:
|
|
971
|
+
var h = e.length, y = y && c ? e.map(Mt(y)) : e;
|
|
972
|
+
return a.core.mutate({ trans: u, type: "put", keys: i, values: y, wantResults: s }).then(function(b) {
|
|
959
973
|
var f = b.numFailures, S = b.results, p = b.lastResult, b = b.failures;
|
|
960
974
|
if (f === 0) return s ? S : p;
|
|
961
975
|
throw new Je("".concat(a.name, ".bulkPut(): ").concat(f, " of ").concat(h, " operations failed"), b);
|
|
@@ -969,26 +983,26 @@ function Ra() {
|
|
|
969
983
|
}), s = [];
|
|
970
984
|
return this._trans("readwrite", function(u) {
|
|
971
985
|
return n.getMany({ trans: u, keys: a, cache: "clone" }).then(function(c) {
|
|
972
|
-
var h = [],
|
|
986
|
+
var h = [], y = [];
|
|
973
987
|
e.forEach(function(f, S) {
|
|
974
988
|
var p = f.key, b = f.changes, w = c[S];
|
|
975
989
|
if (w) {
|
|
976
|
-
for (var
|
|
977
|
-
var E = _[
|
|
990
|
+
for (var m = 0, _ = Object.keys(b); m < _.length; m++) {
|
|
991
|
+
var E = _[m], O = b[E];
|
|
978
992
|
if (E === t.schema.primKey.keyPath) {
|
|
979
993
|
if (Y(O, p) !== 0) throw new $.Constraint("Cannot update primary key in bulkUpdate()");
|
|
980
994
|
} else fe(w, E, O);
|
|
981
995
|
}
|
|
982
|
-
s.push(S), h.push(p),
|
|
996
|
+
s.push(S), h.push(p), y.push(w);
|
|
983
997
|
}
|
|
984
998
|
});
|
|
985
999
|
var v = h.length;
|
|
986
|
-
return n.mutate({ trans: u, type: "put", keys: h, values:
|
|
1000
|
+
return n.mutate({ trans: u, type: "put", keys: h, values: y, updates: { keys: a, changeSpecs: i } }).then(function(f) {
|
|
987
1001
|
var S = f.numFailures, p = f.failures;
|
|
988
1002
|
if (S === 0) return v;
|
|
989
1003
|
for (var b = 0, w = Object.keys(p); b < w.length; b++) {
|
|
990
|
-
var
|
|
991
|
-
E != null && (
|
|
1004
|
+
var m, _ = w[b], E = s[Number(_)];
|
|
1005
|
+
E != null && (m = p[_], delete p[_], p[E] = m);
|
|
992
1006
|
}
|
|
993
1007
|
throw new Je("".concat(t.name, ".bulkUpdate(): ").concat(S, " of ").concat(v, " operations failed"), p);
|
|
994
1008
|
});
|
|
@@ -1009,8 +1023,8 @@ function Ra() {
|
|
|
1009
1023
|
function dt(e) {
|
|
1010
1024
|
function t(u, c) {
|
|
1011
1025
|
if (c) {
|
|
1012
|
-
for (var h = arguments.length,
|
|
1013
|
-
return n[u].subscribe.apply(null,
|
|
1026
|
+
for (var h = arguments.length, y = new Array(h - 1); --h; ) y[h - 1] = arguments[h];
|
|
1027
|
+
return n[u].subscribe.apply(null, y), e;
|
|
1014
1028
|
}
|
|
1015
1029
|
if (typeof u == "string") return n[u];
|
|
1016
1030
|
}
|
|
@@ -1020,7 +1034,7 @@ function Ra() {
|
|
|
1020
1034
|
return t;
|
|
1021
1035
|
function s(u, c, h) {
|
|
1022
1036
|
if (typeof u != "object") {
|
|
1023
|
-
var
|
|
1037
|
+
var y;
|
|
1024
1038
|
c = c || qr;
|
|
1025
1039
|
var v = { subscribers: [], fire: h = h || J, subscribe: function(f) {
|
|
1026
1040
|
v.subscribers.indexOf(f) === -1 && (v.subscribers.push(f), v.fire = c(v.fire, f));
|
|
@@ -1031,16 +1045,16 @@ function Ra() {
|
|
|
1031
1045
|
} };
|
|
1032
1046
|
return n[u] = t[u] = v;
|
|
1033
1047
|
}
|
|
1034
|
-
K(
|
|
1035
|
-
var S =
|
|
1036
|
-
if (U(S)) s(f,
|
|
1048
|
+
K(y = u).forEach(function(f) {
|
|
1049
|
+
var S = y[f];
|
|
1050
|
+
if (U(S)) s(f, y[f][0], y[f][1]);
|
|
1037
1051
|
else {
|
|
1038
1052
|
if (S !== "asap") throw new $.InvalidArgument("Invalid event config");
|
|
1039
1053
|
var p = s(f, st, function() {
|
|
1040
1054
|
for (var b = arguments.length, w = new Array(b); b--; ) w[b] = arguments[b];
|
|
1041
|
-
p.subscribers.forEach(function(
|
|
1055
|
+
p.subscribers.forEach(function(m) {
|
|
1042
1056
|
Yn(function() {
|
|
1043
|
-
|
|
1057
|
+
m.apply(null, w);
|
|
1044
1058
|
});
|
|
1045
1059
|
});
|
|
1046
1060
|
});
|
|
@@ -1076,13 +1090,13 @@ function Ra() {
|
|
|
1076
1090
|
function Nt(e, t, n, a) {
|
|
1077
1091
|
var i = e.replayFilter ? Ue(e.filter, e.replayFilter()) : e.filter;
|
|
1078
1092
|
if (e.or) {
|
|
1079
|
-
var s = {}, u = function(c, h,
|
|
1093
|
+
var s = {}, u = function(c, h, y) {
|
|
1080
1094
|
var v, f;
|
|
1081
|
-
i && !i(h,
|
|
1095
|
+
i && !i(h, y, function(S) {
|
|
1082
1096
|
return h.stop(S);
|
|
1083
1097
|
}, function(S) {
|
|
1084
1098
|
return h.fail(S);
|
|
1085
|
-
}) || ((f = "" + (v = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(v)), ee(s, f) || (s[f] = !0, t(c, h,
|
|
1099
|
+
}) || ((f = "" + (v = h.primaryKey)) == "[object ArrayBuffer]" && (f = "" + new Uint8Array(v)), ee(s, f) || (s[f] = !0, t(c, h, y)));
|
|
1086
1100
|
};
|
|
1087
1101
|
return Promise.all([e.or._iterate(u, n), fr(dr(e, a, n), e.algorithm, u, !e.keysOnly && e.valueMapper)]);
|
|
1088
1102
|
}
|
|
@@ -1113,7 +1127,7 @@ function Ra() {
|
|
|
1113
1127
|
var t = this["@@propmod"];
|
|
1114
1128
|
if (t.add !== void 0) {
|
|
1115
1129
|
var n = t.add;
|
|
1116
|
-
if (U(n)) return
|
|
1130
|
+
if (U(n)) return A(A([], U(e) ? e : [], !0), n).sort();
|
|
1117
1131
|
if (typeof n == "number") return (Number(e) || 0) + n;
|
|
1118
1132
|
if (typeof n == "bigint") try {
|
|
1119
1133
|
return BigInt(e) + n;
|
|
@@ -1177,12 +1191,12 @@ function Ra() {
|
|
|
1177
1191
|
}).then(e);
|
|
1178
1192
|
}, Q.prototype.sortBy = function(e, t) {
|
|
1179
1193
|
var n = e.split(".").reverse(), a = n[0], i = n.length - 1;
|
|
1180
|
-
function s(h,
|
|
1181
|
-
return
|
|
1194
|
+
function s(h, y) {
|
|
1195
|
+
return y ? s(h[n[y]], y - 1) : h[a];
|
|
1182
1196
|
}
|
|
1183
1197
|
var u = this._ctx.dir === "next" ? 1 : -1;
|
|
1184
|
-
function c(h,
|
|
1185
|
-
return Y(s(h, i), s(
|
|
1198
|
+
function c(h, y) {
|
|
1199
|
+
return Y(s(h, i), s(y, i)) * u;
|
|
1186
1200
|
}
|
|
1187
1201
|
return this.toArray(function(h) {
|
|
1188
1202
|
return h.sort(c);
|
|
@@ -1305,31 +1319,31 @@ function Ra() {
|
|
|
1305
1319
|
var t = this, n = this._ctx;
|
|
1306
1320
|
return this._write(function(a) {
|
|
1307
1321
|
var i, s, u;
|
|
1308
|
-
u = typeof e == "function" ? e : (i = K(e), s = i.length, function(
|
|
1322
|
+
u = typeof e == "function" ? e : (i = K(e), s = i.length, function(m) {
|
|
1309
1323
|
for (var _ = !1, E = 0; E < s; ++E) {
|
|
1310
|
-
var O = i[E],
|
|
1311
|
-
|
|
1324
|
+
var O = i[E], x = e[O], P = we(m, O);
|
|
1325
|
+
x instanceof ht ? (fe(m, O, x.execute(P)), _ = !0) : P !== x && (fe(m, O, x), _ = !0);
|
|
1312
1326
|
}
|
|
1313
1327
|
return _;
|
|
1314
1328
|
});
|
|
1315
|
-
var c = n.table.core, f = c.schema.primaryKey, h = f.outbound,
|
|
1329
|
+
var c = n.table.core, f = c.schema.primaryKey, h = f.outbound, y = f.extractKey, v = 200, f = t.db._options.modifyChunkSize;
|
|
1316
1330
|
f && (v = typeof f == "object" ? f[c.name] || f["*"] || 200 : f);
|
|
1317
|
-
function S(
|
|
1331
|
+
function S(m, O) {
|
|
1318
1332
|
var E = O.failures, O = O.numFailures;
|
|
1319
|
-
b +=
|
|
1320
|
-
for (var
|
|
1321
|
-
var T = P[
|
|
1333
|
+
b += m - O;
|
|
1334
|
+
for (var x = 0, P = K(E); x < P.length; x++) {
|
|
1335
|
+
var T = P[x];
|
|
1322
1336
|
p.push(E[T]);
|
|
1323
1337
|
}
|
|
1324
1338
|
}
|
|
1325
1339
|
var p = [], b = 0, w = [];
|
|
1326
|
-
return t.clone().primaryKeys().then(function(
|
|
1340
|
+
return t.clone().primaryKeys().then(function(m) {
|
|
1327
1341
|
function _(O) {
|
|
1328
|
-
var
|
|
1329
|
-
return c.getMany({ trans: a, keys:
|
|
1330
|
-
for (var T = [], I = [], C = h ? [] : null, j = [], R = 0; R <
|
|
1331
|
-
var L = P[R], W = { value: Te(L), primKey:
|
|
1332
|
-
u.call(W, W.value, W) !== !1 && (W.value == null ? j.push(
|
|
1342
|
+
var x = Math.min(v, m.length - O);
|
|
1343
|
+
return c.getMany({ trans: a, keys: m.slice(O, O + x), cache: "immutable" }).then(function(P) {
|
|
1344
|
+
for (var T = [], I = [], C = h ? [] : null, j = [], R = 0; R < x; ++R) {
|
|
1345
|
+
var L = P[R], W = { value: Te(L), primKey: m[O + R] };
|
|
1346
|
+
u.call(W, W.value, W) !== !1 && (W.value == null ? j.push(m[O + R]) : h || Y(y(L), y(W.value)) === 0 ? (I.push(W.value), h && C.push(m[O + R])) : (j.push(m[O + R]), T.push(W.value)));
|
|
1333
1347
|
}
|
|
1334
1348
|
return Promise.resolve(0 < T.length && c.mutate({ trans: a, type: "add", values: T }).then(function(z) {
|
|
1335
1349
|
for (var H in z.failures) j.splice(parseInt(H), 1);
|
|
@@ -1343,14 +1357,14 @@ function Ra() {
|
|
|
1343
1357
|
return S(j.length, z);
|
|
1344
1358
|
});
|
|
1345
1359
|
}).then(function() {
|
|
1346
|
-
return
|
|
1360
|
+
return m.length > O + x && _(O + v);
|
|
1347
1361
|
});
|
|
1348
1362
|
});
|
|
1349
1363
|
}
|
|
1350
1364
|
var E = tt(n) && n.limit === 1 / 0 && (typeof e != "function" || e === vn) && { index: n.index, range: n.range };
|
|
1351
1365
|
return _(0).then(function() {
|
|
1352
1366
|
if (0 < p.length) throw new Et("Error modifying one or more objects", p, b, w);
|
|
1353
|
-
return
|
|
1367
|
+
return m.length;
|
|
1354
1368
|
});
|
|
1355
1369
|
});
|
|
1356
1370
|
});
|
|
@@ -1389,30 +1403,30 @@ function Ra() {
|
|
|
1389
1403
|
}).limit(0);
|
|
1390
1404
|
}
|
|
1391
1405
|
function Kt(e, t, n, a) {
|
|
1392
|
-
var i, s, u, c, h,
|
|
1406
|
+
var i, s, u, c, h, y, v, f = n.length;
|
|
1393
1407
|
if (!n.every(function(b) {
|
|
1394
1408
|
return typeof b == "string";
|
|
1395
1409
|
})) return he(e, ir);
|
|
1396
1410
|
function S(b) {
|
|
1397
|
-
i = b === "next" ? function(
|
|
1398
|
-
return
|
|
1399
|
-
} : function(
|
|
1400
|
-
return
|
|
1401
|
-
}, s = b === "next" ? function(
|
|
1402
|
-
return
|
|
1403
|
-
} : function(
|
|
1404
|
-
return
|
|
1411
|
+
i = b === "next" ? function(m) {
|
|
1412
|
+
return m.toUpperCase();
|
|
1413
|
+
} : function(m) {
|
|
1414
|
+
return m.toLowerCase();
|
|
1415
|
+
}, s = b === "next" ? function(m) {
|
|
1416
|
+
return m.toLowerCase();
|
|
1417
|
+
} : function(m) {
|
|
1418
|
+
return m.toUpperCase();
|
|
1405
1419
|
}, u = b === "next" ? sa : oa;
|
|
1406
|
-
var w = n.map(function(
|
|
1407
|
-
return { lower: s(
|
|
1408
|
-
}).sort(function(
|
|
1409
|
-
return u(
|
|
1420
|
+
var w = n.map(function(m) {
|
|
1421
|
+
return { lower: s(m), upper: i(m) };
|
|
1422
|
+
}).sort(function(m, _) {
|
|
1423
|
+
return u(m.lower, _.lower);
|
|
1410
1424
|
});
|
|
1411
|
-
c = w.map(function(
|
|
1412
|
-
return
|
|
1413
|
-
}), h = w.map(function(
|
|
1414
|
-
return
|
|
1415
|
-
}), v = (
|
|
1425
|
+
c = w.map(function(m) {
|
|
1426
|
+
return m.upper;
|
|
1427
|
+
}), h = w.map(function(m) {
|
|
1428
|
+
return m.lower;
|
|
1429
|
+
}), v = (y = b) === "next" ? "" : a;
|
|
1416
1430
|
}
|
|
1417
1431
|
S("next"), e = new e.Collection(e, function() {
|
|
1418
1432
|
return Ie(c[0], h[f - 1] + a);
|
|
@@ -1420,12 +1434,12 @@ function Ra() {
|
|
|
1420
1434
|
S(b);
|
|
1421
1435
|
};
|
|
1422
1436
|
var p = 0;
|
|
1423
|
-
return e._addAlgorithm(function(b, w,
|
|
1437
|
+
return e._addAlgorithm(function(b, w, m) {
|
|
1424
1438
|
var _ = b.key;
|
|
1425
1439
|
if (typeof _ != "string") return !1;
|
|
1426
1440
|
var E = s(_);
|
|
1427
1441
|
if (t(E, h, p)) return !0;
|
|
1428
|
-
for (var O = null,
|
|
1442
|
+
for (var O = null, x = p; x < f; ++x) {
|
|
1429
1443
|
var P = function(T, I, C, j, R, L) {
|
|
1430
1444
|
for (var W = Math.min(T.length, j.length), z = -1, H = 0; H < W; ++H) {
|
|
1431
1445
|
var pe = I[H];
|
|
@@ -1433,12 +1447,12 @@ function Ra() {
|
|
|
1433
1447
|
R(T[H], pe) < 0 && (z = H);
|
|
1434
1448
|
}
|
|
1435
1449
|
return W < j.length && L === "next" ? T + C.substr(T.length) : W < T.length && L === "prev" ? T.substr(0, C.length) : z < 0 ? null : T.substr(0, z) + j[z] + C.substr(z + 1);
|
|
1436
|
-
}(_, E, c[
|
|
1437
|
-
P === null && O === null ? p =
|
|
1450
|
+
}(_, E, c[x], h[x], u, y);
|
|
1451
|
+
P === null && O === null ? p = x + 1 : (O === null || 0 < u(O, P)) && (O = P);
|
|
1438
1452
|
}
|
|
1439
1453
|
return w(O !== null ? function() {
|
|
1440
1454
|
b.continue(O + v);
|
|
1441
|
-
} :
|
|
1455
|
+
} : m), !1;
|
|
1442
1456
|
}), e;
|
|
1443
1457
|
}
|
|
1444
1458
|
function Ie(e, t, n, a) {
|
|
@@ -1541,25 +1555,25 @@ function Ra() {
|
|
|
1541
1555
|
if (!_.every(function(E) {
|
|
1542
1556
|
return E[0] !== void 0 && E[1] !== void 0 && i(E[0], E[1]) <= 0;
|
|
1543
1557
|
})) return he(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", $.InvalidArgument);
|
|
1544
|
-
var h = !t || t.includeLowers !== !1,
|
|
1558
|
+
var h = !t || t.includeLowers !== !1, y = t && t.includeUppers === !0, v, f = i;
|
|
1545
1559
|
function S(E, O) {
|
|
1546
1560
|
return f(E[0], O[0]);
|
|
1547
1561
|
}
|
|
1548
1562
|
try {
|
|
1549
1563
|
(v = _.reduce(function(E, O) {
|
|
1550
|
-
for (var
|
|
1551
|
-
var T = E[
|
|
1564
|
+
for (var x = 0, P = E.length; x < P; ++x) {
|
|
1565
|
+
var T = E[x];
|
|
1552
1566
|
if (a(O[0], T[1]) < 0 && 0 < a(O[1], T[0])) {
|
|
1553
1567
|
T[0] = u(T[0], O[0]), T[1] = c(T[1], O[1]);
|
|
1554
1568
|
break;
|
|
1555
1569
|
}
|
|
1556
1570
|
}
|
|
1557
|
-
return
|
|
1571
|
+
return x === P && E.push(O), E;
|
|
1558
1572
|
}, [])).sort(S);
|
|
1559
1573
|
} catch {
|
|
1560
1574
|
return he(this, _e);
|
|
1561
1575
|
}
|
|
1562
|
-
var p = 0, b =
|
|
1576
|
+
var p = 0, b = y ? function(E) {
|
|
1563
1577
|
return 0 < i(E, v[p][1]);
|
|
1564
1578
|
} : function(E) {
|
|
1565
1579
|
return 0 <= i(E, v[p][1]);
|
|
@@ -1567,13 +1581,13 @@ function Ra() {
|
|
|
1567
1581
|
return 0 < s(E, v[p][0]);
|
|
1568
1582
|
} : function(E) {
|
|
1569
1583
|
return 0 <= s(E, v[p][0]);
|
|
1570
|
-
},
|
|
1571
|
-
return Ie(v[0][0], v[v.length - 1][1], !h, !
|
|
1584
|
+
}, m = b, _ = new this.Collection(this, function() {
|
|
1585
|
+
return Ie(v[0][0], v[v.length - 1][1], !h, !y);
|
|
1572
1586
|
});
|
|
1573
1587
|
return _._ondirectionchange = function(E) {
|
|
1574
|
-
f = E === "next" ? (
|
|
1575
|
-
}, _._addAlgorithm(function(E, O,
|
|
1576
|
-
for (var P, T = E.key;
|
|
1588
|
+
f = E === "next" ? (m = b, i) : (m = w, s), v.sort(S);
|
|
1589
|
+
}, _._addAlgorithm(function(E, O, x) {
|
|
1590
|
+
for (var P, T = E.key; m(T); ) if (++p === v.length) return O(x), !1;
|
|
1577
1591
|
return !b(P = T) && !w(P) || (n._cmp(T, v[p][1]) === 0 || n._cmp(T, v[p][0]) === 0 || O(function() {
|
|
1578
1592
|
f === i ? E.continue(v[p][0]) : E.continue(v[p][1]);
|
|
1579
1593
|
}), !1);
|
|
@@ -1728,19 +1742,19 @@ function Ra() {
|
|
|
1728
1742
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1729
1743
|
}
|
|
1730
1744
|
function la(e, t, h) {
|
|
1731
|
-
function a(
|
|
1732
|
-
if (
|
|
1733
|
-
if (
|
|
1734
|
-
var p =
|
|
1735
|
-
return p === void 0 ? b === void 0 ? null : t.upperBound(b, !!
|
|
1745
|
+
function a(m) {
|
|
1746
|
+
if (m.type === 3) return null;
|
|
1747
|
+
if (m.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1748
|
+
var p = m.lower, b = m.upper, w = m.lowerOpen, m = m.upperOpen;
|
|
1749
|
+
return p === void 0 ? b === void 0 ? null : t.upperBound(b, !!m) : b === void 0 ? t.lowerBound(p, !!w) : t.bound(p, b, !!w, !!m);
|
|
1736
1750
|
}
|
|
1737
1751
|
function i(S) {
|
|
1738
1752
|
var p, b = S.name;
|
|
1739
1753
|
return { name: b, schema: S, mutate: function(w) {
|
|
1740
|
-
var
|
|
1754
|
+
var m = w.trans, _ = w.type, E = w.keys, O = w.values, x = w.range;
|
|
1741
1755
|
return new Promise(function(P, T) {
|
|
1742
1756
|
P = q(P);
|
|
1743
|
-
var I =
|
|
1757
|
+
var I = m.objectStore(b), C = I.keyPath == null, j = _ === "put" || _ === "add";
|
|
1744
1758
|
if (!j && _ !== "delete" && _ !== "deleteRange") throw new Error("Invalid operation type: " + _);
|
|
1745
1759
|
var R, L = (E || O || { length: 1 }).length;
|
|
1746
1760
|
if (E && O && E.length !== O.length) throw new Error("Given keys array must have same length as given values array.");
|
|
@@ -1750,8 +1764,8 @@ function Ra() {
|
|
|
1750
1764
|
}
|
|
1751
1765
|
var z = [], H = [], pe = 0;
|
|
1752
1766
|
if (_ === "deleteRange") {
|
|
1753
|
-
if (
|
|
1754
|
-
|
|
1767
|
+
if (x.type === 4) return P({ numFailures: pe, failures: H, results: [], lastResult: void 0 });
|
|
1768
|
+
x.type === 3 ? z.push(R = I.clear()) : z.push(R = I.delete(a(x)));
|
|
1755
1769
|
} else {
|
|
1756
1770
|
var C = j ? C ? [O, E] : [O, null] : [E, null], F = C[0], ue = C[1];
|
|
1757
1771
|
if (j) for (var ce = 0; ce < L; ++ce) z.push(R = ue && ue[ce] !== void 0 ? I[_](F[ce], ue[ce]) : I[_](F[ce])), R.onerror = W;
|
|
@@ -1769,45 +1783,45 @@ function Ra() {
|
|
|
1769
1783
|
}, R.onsuccess = Jt;
|
|
1770
1784
|
});
|
|
1771
1785
|
}, getMany: function(w) {
|
|
1772
|
-
var
|
|
1786
|
+
var m = w.trans, _ = w.keys;
|
|
1773
1787
|
return new Promise(function(E, O) {
|
|
1774
1788
|
E = q(E);
|
|
1775
|
-
for (var
|
|
1789
|
+
for (var x, P = m.objectStore(b), T = _.length, I = new Array(T), C = 0, j = 0, R = function(z) {
|
|
1776
1790
|
z = z.target, I[z._pos] = z.result, ++j === C && E(I);
|
|
1777
|
-
}, L = be(O), W = 0; W < T; ++W) _[W] != null && ((
|
|
1791
|
+
}, L = be(O), W = 0; W < T; ++W) _[W] != null && ((x = P.get(_[W]))._pos = W, x.onsuccess = R, x.onerror = L, ++C);
|
|
1778
1792
|
C === 0 && E(I);
|
|
1779
1793
|
});
|
|
1780
1794
|
}, get: function(w) {
|
|
1781
|
-
var
|
|
1795
|
+
var m = w.trans, _ = w.key;
|
|
1782
1796
|
return new Promise(function(E, O) {
|
|
1783
1797
|
E = q(E);
|
|
1784
|
-
var
|
|
1785
|
-
|
|
1798
|
+
var x = m.objectStore(b).get(_);
|
|
1799
|
+
x.onsuccess = function(P) {
|
|
1786
1800
|
return E(P.target.result);
|
|
1787
|
-
},
|
|
1801
|
+
}, x.onerror = be(O);
|
|
1788
1802
|
});
|
|
1789
|
-
}, query: (p =
|
|
1790
|
-
return new Promise(function(
|
|
1791
|
-
|
|
1792
|
-
var E, O,
|
|
1793
|
-
if (T === 0) return
|
|
1803
|
+
}, query: (p = y, function(w) {
|
|
1804
|
+
return new Promise(function(m, _) {
|
|
1805
|
+
m = q(m);
|
|
1806
|
+
var E, O, x, C = w.trans, P = w.values, T = w.limit, R = w.query, I = T === 1 / 0 ? void 0 : T, j = R.index, R = R.range, C = C.objectStore(b), j = j.isPrimaryKey ? C : C.index(j.name), R = a(R);
|
|
1807
|
+
if (T === 0) return m({ result: [] });
|
|
1794
1808
|
p ? ((I = P ? j.getAll(R, I) : j.getAllKeys(R, I)).onsuccess = function(L) {
|
|
1795
|
-
return
|
|
1796
|
-
}, I.onerror = be(_)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(R) : j.openCursor(R),
|
|
1809
|
+
return m({ result: L.target.result });
|
|
1810
|
+
}, I.onerror = be(_)) : (E = 0, O = !P && "openKeyCursor" in j ? j.openKeyCursor(R) : j.openCursor(R), x = [], O.onsuccess = function(L) {
|
|
1797
1811
|
var W = O.result;
|
|
1798
|
-
return W ? (
|
|
1812
|
+
return W ? (x.push(P ? W.value : W.primaryKey), ++E === T ? m({ result: x }) : void W.continue()) : m({ result: x });
|
|
1799
1813
|
}, O.onerror = be(_));
|
|
1800
1814
|
});
|
|
1801
1815
|
}), openCursor: function(w) {
|
|
1802
|
-
var
|
|
1816
|
+
var m = w.trans, _ = w.values, E = w.query, O = w.reverse, x = w.unique;
|
|
1803
1817
|
return new Promise(function(P, T) {
|
|
1804
1818
|
P = q(P);
|
|
1805
|
-
var j = E.index, I = E.range, C =
|
|
1819
|
+
var j = E.index, I = E.range, C = m.objectStore(b), C = j.isPrimaryKey ? C : C.index(j.name), j = O ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", R = !_ && "openKeyCursor" in C ? C.openKeyCursor(a(I), j) : C.openCursor(a(I), j);
|
|
1806
1820
|
R.onerror = be(T), R.onsuccess = q(function(L) {
|
|
1807
1821
|
var W, z, H, pe, F = R.result;
|
|
1808
1822
|
F ? (F.___id = ++ca, F.done = !1, W = F.continue.bind(F), z = (z = F.continuePrimaryKey) && z.bind(F), H = F.advance.bind(F), pe = function() {
|
|
1809
1823
|
throw new Error("Cursor not stopped");
|
|
1810
|
-
}, F.trans =
|
|
1824
|
+
}, F.trans = m, F.stop = F.continue = F.continuePrimaryKey = F.advance = function() {
|
|
1811
1825
|
throw new Error("Cursor not started");
|
|
1812
1826
|
}, F.fail = q(T), F.next = function() {
|
|
1813
1827
|
var ue = this, ce = 1;
|
|
@@ -1839,11 +1853,11 @@ function Ra() {
|
|
|
1839
1853
|
}, T);
|
|
1840
1854
|
});
|
|
1841
1855
|
}, count: function(w) {
|
|
1842
|
-
var
|
|
1843
|
-
return new Promise(function(
|
|
1856
|
+
var m = w.query, _ = w.trans, E = m.index, O = m.range;
|
|
1857
|
+
return new Promise(function(x, P) {
|
|
1844
1858
|
var T = _.objectStore(b), I = E.isPrimaryKey ? T : T.index(E.name), T = a(O), I = T ? I.count(T) : I.count();
|
|
1845
1859
|
I.onsuccess = q(function(C) {
|
|
1846
|
-
return
|
|
1860
|
+
return x(C.target.result);
|
|
1847
1861
|
}), I.onerror = be(P);
|
|
1848
1862
|
});
|
|
1849
1863
|
} };
|
|
@@ -1851,16 +1865,16 @@ function Ra() {
|
|
|
1851
1865
|
var s, u, c, v = (u = h, c = mr((s = e).objectStoreNames), { schema: { name: s.name, tables: c.map(function(S) {
|
|
1852
1866
|
return u.objectStore(S);
|
|
1853
1867
|
}).map(function(S) {
|
|
1854
|
-
var p = S.keyPath,
|
|
1868
|
+
var p = S.keyPath, m = S.autoIncrement, b = U(p), w = {}, m = { name: S.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: b, keyPath: p, autoIncrement: m, unique: !0, extractKey: En(p) }, indexes: mr(S.indexNames).map(function(_) {
|
|
1855
1869
|
return S.index(_);
|
|
1856
|
-
}).map(function(
|
|
1857
|
-
var E =
|
|
1858
|
-
return w[mt(
|
|
1870
|
+
}).map(function(x) {
|
|
1871
|
+
var E = x.name, O = x.unique, P = x.multiEntry, x = x.keyPath, P = { name: E, compound: U(x), keyPath: x, unique: O, multiEntry: P, extractKey: En(x) };
|
|
1872
|
+
return w[mt(x)] = P;
|
|
1859
1873
|
}), getIndexByKeyPath: function(_) {
|
|
1860
1874
|
return w[mt(_)];
|
|
1861
1875
|
} };
|
|
1862
|
-
return w[":id"] =
|
|
1863
|
-
}) }, hasGetAll: 0 < c.length && "getAll" in u.objectStore(c[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = v.schema,
|
|
1876
|
+
return w[":id"] = m.primaryKey, p != null && (w[mt(p)] = m.primaryKey), m;
|
|
1877
|
+
}) }, hasGetAll: 0 < c.length && "getAll" in u.objectStore(c[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = v.schema, y = v.hasGetAll, v = h.tables.map(i), f = {};
|
|
1864
1878
|
return v.forEach(function(S) {
|
|
1865
1879
|
return f[S.name] = S;
|
|
1866
1880
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(S) {
|
|
@@ -1871,7 +1885,7 @@ function Ra() {
|
|
|
1871
1885
|
function da(e, t, n, a) {
|
|
1872
1886
|
var i = n.IDBKeyRange;
|
|
1873
1887
|
return n.indexedDB, { dbcore: (a = la(t, i, a), e.dbcore.reduce(function(s, u) {
|
|
1874
|
-
return u = u.create,
|
|
1888
|
+
return u = u.create, d(d({}, s), u(s));
|
|
1875
1889
|
}, a)) };
|
|
1876
1890
|
}
|
|
1877
1891
|
function Bt(e, a) {
|
|
@@ -1887,10 +1901,10 @@ function Ra() {
|
|
|
1887
1901
|
n.forEach(function(i) {
|
|
1888
1902
|
var s = a[i];
|
|
1889
1903
|
t.forEach(function(u) {
|
|
1890
|
-
var c = function h(
|
|
1891
|
-
return Ur(
|
|
1904
|
+
var c = function h(y, v) {
|
|
1905
|
+
return Ur(y, v) || (y = X(y)) && h(y, v);
|
|
1892
1906
|
}(u, i);
|
|
1893
|
-
(!c || "value" in c && c.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ?
|
|
1907
|
+
(!c || "value" in c && c.value === void 0) && (u === e.Transaction.prototype || u instanceof e.Transaction ? Ae(u, i, { get: function() {
|
|
1894
1908
|
return this.table(i);
|
|
1895
1909
|
}, set: function(h) {
|
|
1896
1910
|
He(this, i, { value: h, writable: !0, configurable: !0, enumerable: !0 });
|
|
@@ -1913,19 +1927,19 @@ function Ra() {
|
|
|
1913
1927
|
s.create(n), s._completion.catch(a);
|
|
1914
1928
|
var u = s._reject.bind(s), c = G.transless || G;
|
|
1915
1929
|
ke(function() {
|
|
1916
|
-
return G.trans = s, G.transless = c, t !== 0 ? (Bt(e, n),
|
|
1917
|
-
return v ??
|
|
1918
|
-
}) : B.resolve(
|
|
1919
|
-
return S = v, p = s, b = n, w = [], v = (f = e)._versions,
|
|
1930
|
+
return G.trans = s, G.transless = c, t !== 0 ? (Bt(e, n), y = t, ((h = s).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(v) {
|
|
1931
|
+
return v ?? y;
|
|
1932
|
+
}) : B.resolve(y)).then(function(v) {
|
|
1933
|
+
return S = v, p = s, b = n, w = [], v = (f = e)._versions, m = f._dbSchema = $t(0, f.idbdb, b), (v = v.filter(function(_) {
|
|
1920
1934
|
return _._cfg.version >= S;
|
|
1921
1935
|
})).length !== 0 ? (v.forEach(function(_) {
|
|
1922
1936
|
w.push(function() {
|
|
1923
|
-
var E =
|
|
1924
|
-
Ut(f, E, b), Ut(f, O, b),
|
|
1925
|
-
var
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
}),
|
|
1937
|
+
var E = m, O = _._cfg.dbschema;
|
|
1938
|
+
Ut(f, E, b), Ut(f, O, b), m = f._dbSchema = O;
|
|
1939
|
+
var x = An(E, O);
|
|
1940
|
+
x.add.forEach(function(j) {
|
|
1941
|
+
xn(b, j[0], j[1].primKey, j[1].indexes);
|
|
1942
|
+
}), x.change.forEach(function(j) {
|
|
1929
1943
|
if (j.recreate) throw new $.Upgrade("Not yet support for changing primary key");
|
|
1930
1944
|
var R = b.objectStore(j.name);
|
|
1931
1945
|
j.add.forEach(function(L) {
|
|
@@ -1940,21 +1954,21 @@ function Ra() {
|
|
|
1940
1954
|
if (P && _._cfg.version > S) {
|
|
1941
1955
|
Bt(f, b), p._memoizedTables = {};
|
|
1942
1956
|
var T = Qn(O);
|
|
1943
|
-
|
|
1957
|
+
x.del.forEach(function(j) {
|
|
1944
1958
|
T[j] = E[j];
|
|
1945
1959
|
}), On(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], K(T), T), p.schema = T;
|
|
1946
1960
|
var I, C = rn(P);
|
|
1947
|
-
return C && qe(),
|
|
1961
|
+
return C && qe(), x = B.follow(function() {
|
|
1948
1962
|
var j;
|
|
1949
1963
|
(I = P(p)) && C && (j = De.bind(null, null), I.then(j, j));
|
|
1950
|
-
}), I && typeof I.then == "function" ? B.resolve(I) :
|
|
1964
|
+
}), I && typeof I.then == "function" ? B.resolve(I) : x.then(function() {
|
|
1951
1965
|
return I;
|
|
1952
1966
|
});
|
|
1953
1967
|
}
|
|
1954
1968
|
}), w.push(function(E) {
|
|
1955
|
-
var O,
|
|
1956
|
-
O = P,
|
|
1957
|
-
return O[T] == null &&
|
|
1969
|
+
var O, x, P = _._cfg.dbschema;
|
|
1970
|
+
O = P, x = E, [].slice.call(x.db.objectStoreNames).forEach(function(T) {
|
|
1971
|
+
return O[T] == null && x.db.deleteObjectStore(T);
|
|
1958
1972
|
}), On(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), p.schema = f._dbSchema;
|
|
1959
1973
|
}), w.push(function(E) {
|
|
1960
1974
|
f.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(f.idbdb.version / 10) === _._cfg.version ? (f.idbdb.deleteObjectStore("$meta"), delete f._dbSchema.$meta, f._storeNames = f._storeNames.filter(function(O) {
|
|
@@ -1964,22 +1978,22 @@ function Ra() {
|
|
|
1964
1978
|
}), function _() {
|
|
1965
1979
|
return w.length ? B.resolve(w.shift()(p.idbtrans)).then(_) : B.resolve();
|
|
1966
1980
|
}().then(function() {
|
|
1967
|
-
br(
|
|
1981
|
+
br(m, b);
|
|
1968
1982
|
})) : B.resolve();
|
|
1969
|
-
var f, S, p, b, w,
|
|
1983
|
+
var f, S, p, b, w, m;
|
|
1970
1984
|
}).catch(u)) : (K(i).forEach(function(v) {
|
|
1971
|
-
|
|
1985
|
+
xn(n, v, i[v].primKey, i[v].indexes);
|
|
1972
1986
|
}), Bt(e, n), void B.follow(function() {
|
|
1973
1987
|
return e.on.populate.fire(s);
|
|
1974
1988
|
}).catch(u));
|
|
1975
|
-
var h,
|
|
1989
|
+
var h, y;
|
|
1976
1990
|
});
|
|
1977
1991
|
}
|
|
1978
1992
|
function pa(e, t) {
|
|
1979
1993
|
br(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
1980
1994
|
var n = $t(0, e.idbdb, t);
|
|
1981
1995
|
Ut(e, e._dbSchema, t);
|
|
1982
|
-
for (var a = 0, i =
|
|
1996
|
+
for (var a = 0, i = An(n, e._dbSchema).change; a < i.length; a++) {
|
|
1983
1997
|
var s = function(u) {
|
|
1984
1998
|
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 };
|
|
1985
1999
|
var c = t.objectStore(u.name);
|
|
@@ -1990,7 +2004,7 @@ function Ra() {
|
|
|
1990
2004
|
if (typeof s == "object") return s.value;
|
|
1991
2005
|
}
|
|
1992
2006
|
}
|
|
1993
|
-
function
|
|
2007
|
+
function An(e, t) {
|
|
1994
2008
|
var n, a = { del: [], add: [], change: [] };
|
|
1995
2009
|
for (n in e) t[n] || a.del.push(n);
|
|
1996
2010
|
for (n in t) {
|
|
@@ -1999,10 +2013,10 @@ function Ra() {
|
|
|
1999
2013
|
var u = { name: n, def: s, recreate: !1, del: [], add: [], change: [] };
|
|
2000
2014
|
if ("" + (i.primKey.keyPath || "") != "" + (s.primKey.keyPath || "") || i.primKey.auto !== s.primKey.auto) u.recreate = !0, a.change.push(u);
|
|
2001
2015
|
else {
|
|
2002
|
-
var c = i.idxByName, h = s.idxByName,
|
|
2003
|
-
for (
|
|
2004
|
-
for (
|
|
2005
|
-
var v = c[
|
|
2016
|
+
var c = i.idxByName, h = s.idxByName, y = void 0;
|
|
2017
|
+
for (y in c) h[y] || u.del.push(y);
|
|
2018
|
+
for (y in h) {
|
|
2019
|
+
var v = c[y], f = h[y];
|
|
2006
2020
|
v ? v.src !== f.src && u.change.push(f) : u.add.push(f);
|
|
2007
2021
|
}
|
|
2008
2022
|
(0 < u.del.length || 0 < u.add.length || 0 < u.change.length) && a.change.push(u);
|
|
@@ -2011,7 +2025,7 @@ function Ra() {
|
|
|
2011
2025
|
}
|
|
2012
2026
|
return a;
|
|
2013
2027
|
}
|
|
2014
|
-
function
|
|
2028
|
+
function xn(e, t, n, a) {
|
|
2015
2029
|
var i = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2016
2030
|
return a.forEach(function(s) {
|
|
2017
2031
|
return Gt(i, s);
|
|
@@ -2019,7 +2033,7 @@ function Ra() {
|
|
|
2019
2033
|
}
|
|
2020
2034
|
function br(e, t) {
|
|
2021
2035
|
K(e).forEach(function(n) {
|
|
2022
|
-
t.db.objectStoreNames.contains(n) || (me && console.debug("Dexie: Creating missing table", n),
|
|
2036
|
+
t.db.objectStoreNames.contains(n) || (me && console.debug("Dexie: Creating missing table", n), xn(t, n, e[n].primKey, e[n].indexes));
|
|
2023
2037
|
});
|
|
2024
2038
|
}
|
|
2025
2039
|
function Gt(e, t) {
|
|
@@ -2028,8 +2042,8 @@ function Ra() {
|
|
|
2028
2042
|
function $t(e, t, n) {
|
|
2029
2043
|
var a = {};
|
|
2030
2044
|
return _t(t.objectStoreNames, 0).forEach(function(i) {
|
|
2031
|
-
for (var s = n.objectStore(i), u = Sn(yr(
|
|
2032
|
-
var v = s.index(s.indexNames[h]),
|
|
2045
|
+
for (var s = n.objectStore(i), u = Sn(yr(y = s.keyPath), y || "", !0, !1, !!s.autoIncrement, y && typeof y != "string", !0), c = [], h = 0; h < s.indexNames.length; ++h) {
|
|
2046
|
+
var v = s.index(s.indexNames[h]), y = v.keyPath, v = Sn(v.name, y, !!v.unique, !!v.multiEntry, !1, y && typeof y != "string", !1);
|
|
2033
2047
|
c.push(v);
|
|
2034
2048
|
}
|
|
2035
2049
|
a[i] = _n(i, u, c);
|
|
@@ -2040,8 +2054,8 @@ function Ra() {
|
|
|
2040
2054
|
var s = a[i], u = n.objectStore(s);
|
|
2041
2055
|
e._hasGetAll = "getAll" in u;
|
|
2042
2056
|
for (var c = 0; c < u.indexNames.length; ++c) {
|
|
2043
|
-
var h = u.indexNames[c],
|
|
2044
|
-
!t[s] || (
|
|
2057
|
+
var h = u.indexNames[c], y = u.index(h).keyPath, v = typeof y == "string" ? y : "[" + _t(y).join("+") + "]";
|
|
2058
|
+
!t[s] || (y = t[s].idxByName[v]) && (y.name = h, delete t[s].idxByName[v], t[s].idxByName[h] = y);
|
|
2045
2059
|
}
|
|
2046
2060
|
}
|
|
2047
2061
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && D.WorkerGlobalScope && D instanceof D.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
@@ -2145,7 +2159,7 @@ function Ra() {
|
|
|
2145
2159
|
}
|
|
2146
2160
|
function Sr(e) {
|
|
2147
2161
|
var t, n, a = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), i = 1 < a ? "r" : a < -1 ? "l" : "";
|
|
2148
|
-
i && (t = i == "r" ? "l" : "r", n =
|
|
2162
|
+
i && (t = i == "r" ? "l" : "r", n = d({}, e), a = e[i], e.from = a.from, e.to = a.to, e[i] = a[i], n[i] = a[t], (e[t] = n).d = _r(n)), e.d = _r(e);
|
|
2149
2163
|
}
|
|
2150
2164
|
function _r(n) {
|
|
2151
2165
|
var t = n.r, n = n.l;
|
|
@@ -2200,17 +2214,17 @@ function Ra() {
|
|
|
2200
2214
|
}
|
|
2201
2215
|
function Er(e, t, n, a) {
|
|
2202
2216
|
for (var i = [], s = 0, u = Object.entries(e.queries.query); s < u.length; s++) {
|
|
2203
|
-
for (var c = u[s], h = c[0],
|
|
2217
|
+
for (var c = u[s], h = c[0], y = [], v = 0, f = c[1]; v < f.length; v++) {
|
|
2204
2218
|
var S = f[v];
|
|
2205
|
-
Cn(t, S.obsSet) ? S.subscribers.forEach(function(
|
|
2206
|
-
return n.add(
|
|
2207
|
-
}) : a &&
|
|
2219
|
+
Cn(t, S.obsSet) ? S.subscribers.forEach(function(m) {
|
|
2220
|
+
return n.add(m);
|
|
2221
|
+
}) : a && y.push(S);
|
|
2208
2222
|
}
|
|
2209
|
-
a && i.push([h,
|
|
2223
|
+
a && i.push([h, y]);
|
|
2210
2224
|
}
|
|
2211
2225
|
if (a) for (var p = 0, b = i; p < b.length; p++) {
|
|
2212
|
-
var w = b[p], h = w[0],
|
|
2213
|
-
e.queries.query[h] =
|
|
2226
|
+
var w = b[p], h = w[0], y = w[1];
|
|
2227
|
+
e.queries.query[h] = y;
|
|
2214
2228
|
}
|
|
2215
2229
|
}
|
|
2216
2230
|
function ya(e) {
|
|
@@ -2228,18 +2242,18 @@ function Ra() {
|
|
|
2228
2242
|
if (u(), !n) throw new $.MissingAPI();
|
|
2229
2243
|
var b = e.name, w = t.autoSchema || !i ? n.open(b) : n.open(b, i);
|
|
2230
2244
|
if (!w) throw new $.MissingAPI();
|
|
2231
|
-
w.onerror = be(p), w.onblocked = q(e._fireOnBlocked), w.onupgradeneeded = q(function(
|
|
2245
|
+
w.onerror = be(p), w.onblocked = q(e._fireOnBlocked), w.onupgradeneeded = q(function(m) {
|
|
2232
2246
|
var _;
|
|
2233
2247
|
v = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = pt, v.abort(), w.result.close(), (_ = n.deleteDatabase(b)).onsuccess = _.onerror = q(function() {
|
|
2234
2248
|
p(new $.NoSuchDatabase("Database ".concat(b, " doesnt exist")));
|
|
2235
|
-
})) : (v.onerror = be(p),
|
|
2249
|
+
})) : (v.onerror = be(p), m = m.oldVersion > Math.pow(2, 62) ? 0 : m.oldVersion, f = m < 1, e.idbdb = w.result, s && pa(e, v), ha(e, m / 10, v, p));
|
|
2236
2250
|
}, p), w.onsuccess = q(function() {
|
|
2237
2251
|
v = null;
|
|
2238
|
-
var
|
|
2252
|
+
var m, _, E, O, x, P = e.idbdb = w.result, T = _t(P.objectStoreNames);
|
|
2239
2253
|
if (0 < T.length) try {
|
|
2240
2254
|
var I = P.transaction((O = T).length === 1 ? O[0] : O, "readonly");
|
|
2241
|
-
if (t.autoSchema) _ = P, E = I, (
|
|
2242
|
-
else if (Ut(e, e._dbSchema, I), ((
|
|
2255
|
+
if (t.autoSchema) _ = P, E = I, (m = e).verno = _.version / 10, E = m._dbSchema = $t(0, _, E), m._storeNames = _t(_.objectStoreNames, 0), Lt(m, [m._allTables], K(E), E);
|
|
2256
|
+
else if (Ut(e, e._dbSchema, I), ((x = An($t(0, (x = e).idbdb, I), x._dbSchema)).add.length || x.change.some(function(C) {
|
|
2243
2257
|
return C.add.length || C.change.length;
|
|
2244
2258
|
})) && !s) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), P.close(), i = P.version + 1, s = !0, S(c());
|
|
2245
2259
|
Bt(e, I);
|
|
@@ -2249,7 +2263,7 @@ function Ra() {
|
|
|
2249
2263
|
t.vcFired = !0, e.on("versionchange").fire(C);
|
|
2250
2264
|
}), P.onclose = q(function(C) {
|
|
2251
2265
|
e.on("close").fire(C);
|
|
2252
|
-
}), f && (
|
|
2266
|
+
}), f && (x = e._deps, I = b, P = x.indexedDB, x = x.IDBKeyRange, Dn(P) || I === Tt || kn(P, x).put({ name: I }).catch(J)), S();
|
|
2253
2267
|
}, p);
|
|
2254
2268
|
}).catch(function(S) {
|
|
2255
2269
|
switch (S == null ? void 0 : S.name) {
|
|
@@ -2262,7 +2276,7 @@ function Ra() {
|
|
|
2262
2276
|
return B.reject(S);
|
|
2263
2277
|
});
|
|
2264
2278
|
}
|
|
2265
|
-
var h,
|
|
2279
|
+
var h, y = t.dbReadyResolve, v = null, f = !1;
|
|
2266
2280
|
return B.race([a, (typeof navigator > "u" ? B.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(S) {
|
|
2267
2281
|
function p() {
|
|
2268
2282
|
return indexedDB.databases().finally(S);
|
|
@@ -2291,7 +2305,7 @@ function Ra() {
|
|
|
2291
2305
|
}
|
|
2292
2306
|
return a === t.openCanceller && e._close(), te(S);
|
|
2293
2307
|
}).finally(function() {
|
|
2294
|
-
t.openComplete = !0,
|
|
2308
|
+
t.openComplete = !0, y();
|
|
2295
2309
|
}).then(function() {
|
|
2296
2310
|
var S;
|
|
2297
2311
|
return f && (S = {}, e.tables.forEach(function(p) {
|
|
@@ -2321,24 +2335,24 @@ function Ra() {
|
|
|
2321
2335
|
return a;
|
|
2322
2336
|
}
|
|
2323
2337
|
var ma = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2324
|
-
return
|
|
2338
|
+
return d(d({}, e), { table: function(t) {
|
|
2325
2339
|
var n = e.table(t), a = n.schema, i = {}, s = [];
|
|
2326
2340
|
function u(f, S, p) {
|
|
2327
|
-
var b = mt(f), w = i[b] = i[b] || [],
|
|
2328
|
-
return w.push(_), _.isPrimaryKey || s.push(_), 1 <
|
|
2341
|
+
var b = mt(f), w = i[b] = i[b] || [], m = f == null ? 0 : typeof f == "string" ? 1 : f.length, _ = 0 < S, _ = d(d({}, p), { name: _ ? "".concat(b, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: _, keyTail: S, keyLength: m, extractKey: En(f), unique: !_ && p.unique });
|
|
2342
|
+
return w.push(_), _.isPrimaryKey || s.push(_), 1 < m && u(m === 2 ? f[0] : f.slice(0, m - 1), S + 1, p), w.sort(function(E, O) {
|
|
2329
2343
|
return E.keyTail - O.keyTail;
|
|
2330
2344
|
}), _;
|
|
2331
2345
|
}
|
|
2332
2346
|
t = u(a.primaryKey.keyPath, 0, a.primaryKey), i[":id"] = [t];
|
|
2333
2347
|
for (var c = 0, h = a.indexes; c < h.length; c++) {
|
|
2334
|
-
var
|
|
2335
|
-
u(
|
|
2348
|
+
var y = h[c];
|
|
2349
|
+
u(y.keyPath, 0, y);
|
|
2336
2350
|
}
|
|
2337
2351
|
function v(f) {
|
|
2338
2352
|
var S, p = f.query.index;
|
|
2339
|
-
return p.isVirtual ?
|
|
2353
|
+
return p.isVirtual ? d(d({}, f), { query: { index: p.lowLevelIndex, range: (S = f.query.range, p = p.keyTail, { type: S.type === 1 ? 2 : S.type, lower: Yt(S.lower, S.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: Yt(S.upper, S.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : f;
|
|
2340
2354
|
}
|
|
2341
|
-
return
|
|
2355
|
+
return d(d({}, n), { schema: d(d({}, a), { primaryKey: t, indexes: s, getIndexByKeyPath: function(f) {
|
|
2342
2356
|
return (f = i[mt(f)]) && f[0];
|
|
2343
2357
|
} }), count: function(f) {
|
|
2344
2358
|
return n.count(v(f));
|
|
@@ -2347,9 +2361,9 @@ function Ra() {
|
|
|
2347
2361
|
}, openCursor: function(f) {
|
|
2348
2362
|
var S = f.query.index, p = S.keyTail, b = S.isVirtual, w = S.keyLength;
|
|
2349
2363
|
return b ? n.openCursor(v(f)).then(function(_) {
|
|
2350
|
-
return _ &&
|
|
2364
|
+
return _ && m(_);
|
|
2351
2365
|
}) : n.openCursor(f);
|
|
2352
|
-
function
|
|
2366
|
+
function m(_) {
|
|
2353
2367
|
return Object.create(_, { continue: { value: function(E) {
|
|
2354
2368
|
E != null ? _.continue(Yt(E, f.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : f.unique ? _.continue(_.key.slice(0, w).concat(f.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : _.continue();
|
|
2355
2369
|
} }, continuePrimaryKey: { value: function(E, O) {
|
|
@@ -2378,10 +2392,10 @@ function Ra() {
|
|
|
2378
2392
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2379
2393
|
}
|
|
2380
2394
|
var ba = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2381
|
-
return
|
|
2395
|
+
return d(d({}, e), { table: function(t) {
|
|
2382
2396
|
var n = e.table(t), a = n.schema.primaryKey;
|
|
2383
|
-
return
|
|
2384
|
-
var s = G.trans, u = s.table(t).hook, c = u.deleting, h = u.creating,
|
|
2397
|
+
return d(d({}, n), { mutate: function(i) {
|
|
2398
|
+
var s = G.trans, u = s.table(t).hook, c = u.deleting, h = u.creating, y = u.updating;
|
|
2385
2399
|
switch (i.type) {
|
|
2386
2400
|
case "add":
|
|
2387
2401
|
if (h.fire === J) break;
|
|
@@ -2389,7 +2403,7 @@ function Ra() {
|
|
|
2389
2403
|
return v(i);
|
|
2390
2404
|
}, !0);
|
|
2391
2405
|
case "put":
|
|
2392
|
-
if (h.fire === J &&
|
|
2406
|
+
if (h.fire === J && y.fire === J) break;
|
|
2393
2407
|
return s._promise("readwrite", function() {
|
|
2394
2408
|
return v(i);
|
|
2395
2409
|
}, !0);
|
|
@@ -2403,9 +2417,9 @@ function Ra() {
|
|
|
2403
2417
|
return s._promise("readwrite", function() {
|
|
2404
2418
|
return function f(S, p, b) {
|
|
2405
2419
|
return n.query({ trans: S, values: !1, query: { index: a, range: p }, limit: b }).then(function(w) {
|
|
2406
|
-
var
|
|
2407
|
-
return v({ type: "delete", keys:
|
|
2408
|
-
return 0 < _.numFailures ? Promise.reject(_.failures[0]) :
|
|
2420
|
+
var m = w.result;
|
|
2421
|
+
return v({ type: "delete", keys: m, trans: S }).then(function(_) {
|
|
2422
|
+
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : m.length < b ? { failures: [], numFailures: 0, lastResult: void 0 } : f(S, d(d({}, p), { lower: m[m.length - 1], lowerOpen: !0 }), b);
|
|
2409
2423
|
});
|
|
2410
2424
|
});
|
|
2411
2425
|
}(i.trans, i.range, 1e4);
|
|
@@ -2413,24 +2427,24 @@ function Ra() {
|
|
|
2413
2427
|
}
|
|
2414
2428
|
return n.mutate(i);
|
|
2415
2429
|
function v(f) {
|
|
2416
|
-
var S, p, b, w = G.trans,
|
|
2417
|
-
if (!
|
|
2418
|
-
return (f = f.type === "add" || f.type === "put" ?
|
|
2419
|
-
var E =
|
|
2420
|
-
var P, T, I, C = _[
|
|
2421
|
-
return f.type === "delete" ? c.fire.call(j, O, C, w) : f.type === "add" || C === void 0 ? (P = h.fire.call(j, O, f.values[
|
|
2430
|
+
var S, p, b, w = G.trans, m = f.keys || Kn(a, f);
|
|
2431
|
+
if (!m) throw new Error("Keys missing");
|
|
2432
|
+
return (f = f.type === "add" || f.type === "put" ? d(d({}, f), { keys: m }) : d({}, f)).type !== "delete" && (f.values = A([], f.values)), f.keys && (f.keys = A([], f.keys)), S = n, b = m, ((p = f).type === "add" ? Promise.resolve([]) : S.getMany({ trans: p.trans, keys: b, cache: "immutable" })).then(function(_) {
|
|
2433
|
+
var E = m.map(function(O, x) {
|
|
2434
|
+
var P, T, I, C = _[x], j = { onerror: null, onsuccess: null };
|
|
2435
|
+
return f.type === "delete" ? c.fire.call(j, O, C, w) : f.type === "add" || C === void 0 ? (P = h.fire.call(j, O, f.values[x], w), O == null && P != null && (f.keys[x] = O = P, a.outbound || fe(f.values[x], a.keyPath, O))) : (P = Nn(C, f.values[x]), (T = y.fire.call(j, P, O, C, w)) && (I = f.values[x], Object.keys(T).forEach(function(R) {
|
|
2422
2436
|
ee(I, R) ? I[R] = T[R] : fe(I, R, T[R]);
|
|
2423
2437
|
}))), j;
|
|
2424
2438
|
});
|
|
2425
2439
|
return n.mutate(f).then(function(O) {
|
|
2426
|
-
for (var
|
|
2427
|
-
var C = (P ||
|
|
2428
|
-
C == null ? j.onerror && j.onerror(
|
|
2440
|
+
for (var x = O.failures, P = O.results, T = O.numFailures, O = O.lastResult, I = 0; I < m.length; ++I) {
|
|
2441
|
+
var C = (P || m)[I], j = E[I];
|
|
2442
|
+
C == null ? j.onerror && j.onerror(x[I]) : j.onsuccess && j.onsuccess(f.type === "put" && _[I] ? f.values[I] : C);
|
|
2429
2443
|
}
|
|
2430
|
-
return { failures:
|
|
2444
|
+
return { failures: x, results: P, numFailures: T, lastResult: O };
|
|
2431
2445
|
}).catch(function(O) {
|
|
2432
|
-
return E.forEach(function(
|
|
2433
|
-
return
|
|
2446
|
+
return E.forEach(function(x) {
|
|
2447
|
+
return x.onerror && x.onerror(O);
|
|
2434
2448
|
}), Promise.reject(O);
|
|
2435
2449
|
});
|
|
2436
2450
|
});
|
|
@@ -2450,7 +2464,7 @@ function Ra() {
|
|
|
2450
2464
|
var va = { stack: "dbcore", level: -1, create: function(e) {
|
|
2451
2465
|
return { table: function(t) {
|
|
2452
2466
|
var n = e.table(t);
|
|
2453
|
-
return
|
|
2467
|
+
return d(d({}, n), { getMany: function(a) {
|
|
2454
2468
|
if (!a.cache) return n.getMany(a);
|
|
2455
2469
|
var i = Or(a.keys, a.trans._cache, a.cache === "clone");
|
|
2456
2470
|
return i ? B.resolve(i) : n.getMany(a).then(function(s) {
|
|
@@ -2461,10 +2475,10 @@ function Ra() {
|
|
|
2461
2475
|
} });
|
|
2462
2476
|
} };
|
|
2463
2477
|
} };
|
|
2464
|
-
function
|
|
2478
|
+
function Ar(e, t) {
|
|
2465
2479
|
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !t.schema.primaryKey.outbound;
|
|
2466
2480
|
}
|
|
2467
|
-
function
|
|
2481
|
+
function xr(e, t) {
|
|
2468
2482
|
switch (e) {
|
|
2469
2483
|
case "query":
|
|
2470
2484
|
return t.values && !t.unique;
|
|
@@ -2477,20 +2491,20 @@ function Ra() {
|
|
|
2477
2491
|
}
|
|
2478
2492
|
var wa = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2479
2493
|
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2480
|
-
return
|
|
2494
|
+
return d(d({}, e), { transaction: function(a, i, s) {
|
|
2481
2495
|
if (G.subscr && i !== "readonly") throw new $.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(G.querier));
|
|
2482
2496
|
return e.transaction(a, i, s);
|
|
2483
2497
|
}, table: function(a) {
|
|
2484
|
-
var i = e.table(a), s = i.schema, u = s.primaryKey, f = s.indexes, c = u.extractKey, h = u.outbound,
|
|
2498
|
+
var i = e.table(a), s = i.schema, u = s.primaryKey, f = s.indexes, c = u.extractKey, h = u.outbound, y = u.autoIncrement && f.filter(function(p) {
|
|
2485
2499
|
return p.compound && p.keyPath.includes(u.keyPath);
|
|
2486
|
-
}), v =
|
|
2500
|
+
}), v = d(d({}, i), { mutate: function(p) {
|
|
2487
2501
|
function b(R) {
|
|
2488
2502
|
return R = "idb://".concat(t, "/").concat(a, "/").concat(R), O[R] || (O[R] = new oe());
|
|
2489
2503
|
}
|
|
2490
|
-
var w,
|
|
2504
|
+
var w, m, _, E = p.trans, O = p.mutatedParts || (p.mutatedParts = {}), x = b(""), P = b(":dels"), T = p.type, j = p.type === "deleteRange" ? [p.range] : p.type === "delete" ? [p.keys] : p.values.length < 50 ? [Kn(u, p).filter(function(R) {
|
|
2491
2505
|
return R;
|
|
2492
2506
|
}), p.values] : [], I = j[0], C = j[1], j = p.trans._cache;
|
|
2493
|
-
return U(I) ? (
|
|
2507
|
+
return U(I) ? (x.addKeys(I), (j = T === "delete" || I.length === C.length ? Or(I, j) : null) || P.addKeys(I), (j || C) && (w = b, m = j, _ = C, s.indexes.forEach(function(R) {
|
|
2494
2508
|
var L = w(R.name || "");
|
|
2495
2509
|
function W(H) {
|
|
2496
2510
|
return H != null ? R.extractKey(H) : null;
|
|
@@ -2500,14 +2514,14 @@ function Ra() {
|
|
|
2500
2514
|
return L.addKey(pe);
|
|
2501
2515
|
}) : L.addKey(H);
|
|
2502
2516
|
}
|
|
2503
|
-
(
|
|
2504
|
-
var F =
|
|
2517
|
+
(m || _).forEach(function(H, ue) {
|
|
2518
|
+
var F = m && W(m[ue]), ue = _ && W(_[ue]);
|
|
2505
2519
|
Y(F, ue) !== 0 && (F != null && z(F), ue != null && z(ue));
|
|
2506
2520
|
});
|
|
2507
|
-
}))) : I ? (C = { from: (C = I.lower) !== null && C !== void 0 ? C : e.MIN_KEY, to: (C = I.upper) !== null && C !== void 0 ? C : e.MAX_KEY }, P.add(C),
|
|
2521
|
+
}))) : I ? (C = { from: (C = I.lower) !== null && C !== void 0 ? C : e.MIN_KEY, to: (C = I.upper) !== null && C !== void 0 ? C : e.MAX_KEY }, P.add(C), x.add(C)) : (x.add(n), P.add(n), s.indexes.forEach(function(R) {
|
|
2508
2522
|
return b(R.name).add(n);
|
|
2509
2523
|
})), i.mutate(p).then(function(R) {
|
|
2510
|
-
return !I || p.type !== "add" && p.type !== "put" || (
|
|
2524
|
+
return !I || p.type !== "add" && p.type !== "put" || (x.addKeys(R.results), y && y.forEach(function(L) {
|
|
2511
2525
|
for (var W = p.values.map(function(F) {
|
|
2512
2526
|
return L.extractKey(F);
|
|
2513
2527
|
}), z = L.keyPath.findIndex(function(F) {
|
|
@@ -2526,28 +2540,28 @@ function Ra() {
|
|
|
2526
2540
|
}, count: f, query: f, openCursor: f };
|
|
2527
2541
|
return K(S).forEach(function(p) {
|
|
2528
2542
|
v[p] = function(b) {
|
|
2529
|
-
var w = G.subscr,
|
|
2530
|
-
if (
|
|
2543
|
+
var w = G.subscr, m = !!w, _ = Ar(G, i) && xr(p, b) ? b.obsSet = {} : w;
|
|
2544
|
+
if (m) {
|
|
2531
2545
|
var E = function(C) {
|
|
2532
2546
|
return C = "idb://".concat(t, "/").concat(a, "/").concat(C), _[C] || (_[C] = new oe());
|
|
2533
|
-
}, O = E(""),
|
|
2534
|
-
if ((p === "query" &&
|
|
2547
|
+
}, O = E(""), x = E(":dels"), w = S[p](b), m = w[0], w = w[1];
|
|
2548
|
+
if ((p === "query" && m.isPrimaryKey && !b.values ? x : E(m.name || "")).add(w), !m.isPrimaryKey) {
|
|
2535
2549
|
if (p !== "count") {
|
|
2536
|
-
var P = p === "query" && h && b.values && i.query(
|
|
2550
|
+
var P = p === "query" && h && b.values && i.query(d(d({}, b), { values: !1 }));
|
|
2537
2551
|
return i[p].apply(this, arguments).then(function(C) {
|
|
2538
2552
|
if (p === "query") {
|
|
2539
2553
|
if (h && b.values) return P.then(function(W) {
|
|
2540
2554
|
return W = W.result, O.addKeys(W), C;
|
|
2541
2555
|
});
|
|
2542
2556
|
var j = b.values ? C.result.map(c) : C.result;
|
|
2543
|
-
(b.values ? O :
|
|
2557
|
+
(b.values ? O : x).addKeys(j);
|
|
2544
2558
|
} else if (p === "openCursor") {
|
|
2545
2559
|
var R = C, L = b.values;
|
|
2546
2560
|
return R && Object.create(R, { key: { get: function() {
|
|
2547
|
-
return
|
|
2561
|
+
return x.addKey(R.primaryKey), R.key;
|
|
2548
2562
|
} }, primaryKey: { get: function() {
|
|
2549
2563
|
var W = R.primaryKey;
|
|
2550
|
-
return
|
|
2564
|
+
return x.addKey(W), W;
|
|
2551
2565
|
} }, value: { get: function() {
|
|
2552
2566
|
return L && O.addKey(R.primaryKey), R.value;
|
|
2553
2567
|
} } });
|
|
@@ -2555,7 +2569,7 @@ function Ra() {
|
|
|
2555
2569
|
return C;
|
|
2556
2570
|
});
|
|
2557
2571
|
}
|
|
2558
|
-
|
|
2572
|
+
x.add(n);
|
|
2559
2573
|
}
|
|
2560
2574
|
}
|
|
2561
2575
|
return i[p].apply(this, arguments);
|
|
@@ -2567,7 +2581,7 @@ function Ra() {
|
|
|
2567
2581
|
if (n.numFailures === 0) return t;
|
|
2568
2582
|
if (t.type === "deleteRange") return null;
|
|
2569
2583
|
var a = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2570
|
-
return n.numFailures === a ? null : (t =
|
|
2584
|
+
return n.numFailures === a ? null : (t = d({}, t), U(t.keys) && (t.keys = t.keys.filter(function(i, s) {
|
|
2571
2585
|
return !(s in n.failures);
|
|
2572
2586
|
})), "values" in t && U(t.values) && (t.values = t.values.filter(function(i, s) {
|
|
2573
2587
|
return !(s in n.failures);
|
|
@@ -2579,52 +2593,52 @@ function Ra() {
|
|
|
2579
2593
|
}
|
|
2580
2594
|
function Dr(e, t, S, a, i, s) {
|
|
2581
2595
|
if (!S || S.length === 0) return e;
|
|
2582
|
-
var u = t.query.index, c = u.multiEntry, h = t.query.range,
|
|
2583
|
-
var w = p,
|
|
2596
|
+
var u = t.query.index, c = u.multiEntry, h = t.query.range, y = a.schema.primaryKey.extractKey, v = u.extractKey, f = (u.lowLevelIndex || u).extractKey, S = S.reduce(function(p, b) {
|
|
2597
|
+
var w = p, m = [];
|
|
2584
2598
|
if (b.type === "add" || b.type === "put") for (var _ = new oe(), E = b.values.length - 1; 0 <= E; --E) {
|
|
2585
|
-
var O,
|
|
2586
|
-
_.hasKey(P) || (O = v(
|
|
2599
|
+
var O, x = b.values[E], P = y(x);
|
|
2600
|
+
_.hasKey(P) || (O = v(x), (c && U(O) ? O.some(function(R) {
|
|
2587
2601
|
return Bn(R, h);
|
|
2588
|
-
}) : Bn(O, h)) && (_.addKey(P),
|
|
2602
|
+
}) : Bn(O, h)) && (_.addKey(P), m.push(x)));
|
|
2589
2603
|
}
|
|
2590
2604
|
switch (b.type) {
|
|
2591
2605
|
case "add":
|
|
2592
2606
|
var T = new oe().addKeys(t.values ? p.map(function(L) {
|
|
2593
|
-
return
|
|
2594
|
-
}) : p), w = p.concat(t.values ?
|
|
2595
|
-
return L =
|
|
2596
|
-
}) :
|
|
2597
|
-
return
|
|
2607
|
+
return y(L);
|
|
2608
|
+
}) : p), w = p.concat(t.values ? m.filter(function(L) {
|
|
2609
|
+
return L = y(L), !T.hasKey(L) && (T.addKey(L), !0);
|
|
2610
|
+
}) : m.map(function(L) {
|
|
2611
|
+
return y(L);
|
|
2598
2612
|
}).filter(function(L) {
|
|
2599
2613
|
return !T.hasKey(L) && (T.addKey(L), !0);
|
|
2600
2614
|
}));
|
|
2601
2615
|
break;
|
|
2602
2616
|
case "put":
|
|
2603
2617
|
var I = new oe().addKeys(b.values.map(function(L) {
|
|
2604
|
-
return
|
|
2618
|
+
return y(L);
|
|
2605
2619
|
}));
|
|
2606
2620
|
w = p.filter(function(L) {
|
|
2607
|
-
return !I.hasKey(t.values ?
|
|
2608
|
-
}).concat(t.values ?
|
|
2609
|
-
return
|
|
2621
|
+
return !I.hasKey(t.values ? y(L) : L);
|
|
2622
|
+
}).concat(t.values ? m : m.map(function(L) {
|
|
2623
|
+
return y(L);
|
|
2610
2624
|
}));
|
|
2611
2625
|
break;
|
|
2612
2626
|
case "delete":
|
|
2613
2627
|
var C = new oe().addKeys(b.keys);
|
|
2614
2628
|
w = p.filter(function(L) {
|
|
2615
|
-
return !C.hasKey(t.values ?
|
|
2629
|
+
return !C.hasKey(t.values ? y(L) : L);
|
|
2616
2630
|
});
|
|
2617
2631
|
break;
|
|
2618
2632
|
case "deleteRange":
|
|
2619
2633
|
var j = b.range;
|
|
2620
2634
|
w = p.filter(function(L) {
|
|
2621
|
-
return !Bn(
|
|
2635
|
+
return !Bn(y(L), j);
|
|
2622
2636
|
});
|
|
2623
2637
|
}
|
|
2624
2638
|
return w;
|
|
2625
2639
|
}, e);
|
|
2626
2640
|
return S === e ? e : (S.sort(function(p, b) {
|
|
2627
|
-
return Y(f(p), f(b)) || Y(
|
|
2641
|
+
return Y(f(p), f(b)) || Y(y(p), y(b));
|
|
2628
2642
|
}), t.limit && t.limit < 1 / 0 && (S.length > t.limit ? S.length = t.limit : e.length === t.limit && S.length < t.limit && (i.dirty = !0)), s ? Object.freeze(S) : S);
|
|
2629
2643
|
}
|
|
2630
2644
|
function Pr(e, t) {
|
|
@@ -2661,33 +2675,33 @@ function Ra() {
|
|
|
2661
2675
|
}
|
|
2662
2676
|
var Ea = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2663
2677
|
var t = e.schema.name;
|
|
2664
|
-
return
|
|
2678
|
+
return d(d({}, e), { transaction: function(n, a, i) {
|
|
2665
2679
|
var s, u, c = e.transaction(n, a, i);
|
|
2666
2680
|
return a === "readwrite" && (u = (s = new AbortController()).signal, i = function(h) {
|
|
2667
2681
|
return function() {
|
|
2668
2682
|
if (s.abort(), a === "readwrite") {
|
|
2669
|
-
for (var
|
|
2683
|
+
for (var y = /* @__PURE__ */ new Set(), v = 0, f = n; v < f.length; v++) {
|
|
2670
2684
|
var S = f[v], p = Fe["idb://".concat(t, "/").concat(S)];
|
|
2671
2685
|
if (p) {
|
|
2672
2686
|
var b = e.table(S), w = p.optimisticOps.filter(function(L) {
|
|
2673
2687
|
return L.trans === c;
|
|
2674
2688
|
});
|
|
2675
|
-
if (c._explicit && h && c.mutatedParts) for (var
|
|
2676
|
-
return
|
|
2689
|
+
if (c._explicit && h && c.mutatedParts) for (var m = 0, _ = Object.values(p.queries.query); m < _.length; m++) for (var E = 0, O = (T = _[m]).slice(); E < O.length; E++) Cn((I = O[E]).obsSet, c.mutatedParts) && (Me(T, I), I.subscribers.forEach(function(L) {
|
|
2690
|
+
return y.add(L);
|
|
2677
2691
|
}));
|
|
2678
2692
|
else if (0 < w.length) {
|
|
2679
2693
|
p.optimisticOps = p.optimisticOps.filter(function(L) {
|
|
2680
2694
|
return L.trans !== c;
|
|
2681
2695
|
});
|
|
2682
|
-
for (var
|
|
2683
|
-
return
|
|
2696
|
+
for (var x = 0, P = Object.values(p.queries.query); x < P.length; x++) for (var T, I, C, j = 0, R = (T = P[x]).slice(); j < R.length; j++) (I = R[j]).res != null && c.mutatedParts && (h && !I.dirty ? (C = Object.isFrozen(I.res), C = Dr(I.res, I.req, w, b, I, C), I.dirty ? (Me(T, I), I.subscribers.forEach(function(L) {
|
|
2697
|
+
return y.add(L);
|
|
2684
2698
|
})) : C !== I.res && (I.res = C, I.promise = B.resolve({ result: C }))) : (I.dirty && Me(T, I), I.subscribers.forEach(function(L) {
|
|
2685
|
-
return
|
|
2699
|
+
return y.add(L);
|
|
2686
2700
|
})));
|
|
2687
2701
|
}
|
|
2688
2702
|
}
|
|
2689
2703
|
}
|
|
2690
|
-
|
|
2704
|
+
y.forEach(function(L) {
|
|
2691
2705
|
return L();
|
|
2692
2706
|
});
|
|
2693
2707
|
}
|
|
@@ -2695,7 +2709,7 @@ function Ra() {
|
|
|
2695
2709
|
}, c.addEventListener("abort", i(!1), { signal: u }), c.addEventListener("error", i(!1), { signal: u }), c.addEventListener("complete", i(!0), { signal: u })), c;
|
|
2696
2710
|
}, table: function(n) {
|
|
2697
2711
|
var a = e.table(n), i = a.schema.primaryKey;
|
|
2698
|
-
return
|
|
2712
|
+
return d(d({}, a), { mutate: function(s) {
|
|
2699
2713
|
var u = G.trans;
|
|
2700
2714
|
if (i.outbound || u.db._options.cache === "disabled" || u.explicit || u.idbtrans.mode !== "readwrite") return a.mutate(s);
|
|
2701
2715
|
var c = Fe["idb://".concat(t, "/").concat(n)];
|
|
@@ -2706,40 +2720,40 @@ function Ra() {
|
|
|
2706
2720
|
}), u.catch(function() {
|
|
2707
2721
|
Me(c.optimisticOps, s), s.mutatedParts && Ht(s.mutatedParts);
|
|
2708
2722
|
})) : u.then(function(h) {
|
|
2709
|
-
var
|
|
2723
|
+
var y = kr(0, d(d({}, s), { values: s.values.map(function(v, f) {
|
|
2710
2724
|
var S;
|
|
2711
|
-
return h.failures[f] ? v : (v = (S = i.keyPath) !== null && S !== void 0 && S.includes(".") ? Te(v) :
|
|
2725
|
+
return h.failures[f] ? v : (v = (S = i.keyPath) !== null && S !== void 0 && S.includes(".") ? Te(v) : d({}, v), fe(v, i.keyPath, h.results[f]), v);
|
|
2712
2726
|
}) }), h);
|
|
2713
|
-
c.optimisticOps.push(
|
|
2727
|
+
c.optimisticOps.push(y), queueMicrotask(function() {
|
|
2714
2728
|
return s.mutatedParts && Ht(s.mutatedParts);
|
|
2715
2729
|
});
|
|
2716
2730
|
}), u) : a.mutate(s);
|
|
2717
2731
|
}, query: function(s) {
|
|
2718
|
-
if (!
|
|
2719
|
-
var u = ((
|
|
2732
|
+
if (!Ar(G, a) || !xr("query", s)) return a.query(s);
|
|
2733
|
+
var u = ((y = G.trans) === null || y === void 0 ? void 0 : y.db._options.cache) === "immutable", f = G, c = f.requery, h = f.signal, y = function(b, w, m, _) {
|
|
2720
2734
|
var E = Fe["idb://".concat(b, "/").concat(w)];
|
|
2721
2735
|
if (!E) return [];
|
|
2722
|
-
if (!(w = E.queries[
|
|
2736
|
+
if (!(w = E.queries[m])) return [null, !1, E, null];
|
|
2723
2737
|
var O = w[(_.query ? _.query.index.name : null) || ""];
|
|
2724
2738
|
if (!O) return [null, !1, E, null];
|
|
2725
|
-
switch (
|
|
2739
|
+
switch (m) {
|
|
2726
2740
|
case "query":
|
|
2727
|
-
var
|
|
2741
|
+
var x = O.find(function(P) {
|
|
2728
2742
|
return P.req.limit === _.limit && P.req.values === _.values && Pr(P.req.query.range, _.query.range);
|
|
2729
2743
|
});
|
|
2730
|
-
return
|
|
2744
|
+
return x ? [x, !0, E, O] : [O.find(function(P) {
|
|
2731
2745
|
return ("limit" in P.req ? P.req.limit : 1 / 0) >= _.limit && (!_.values || P.req.values) && Sa(P.req.query.range, _.query.range);
|
|
2732
2746
|
}), !1, E, O];
|
|
2733
2747
|
case "count":
|
|
2734
|
-
return
|
|
2748
|
+
return x = O.find(function(P) {
|
|
2735
2749
|
return Pr(P.req.query.range, _.query.range);
|
|
2736
|
-
}), [
|
|
2750
|
+
}), [x, !!x, E, O];
|
|
2737
2751
|
}
|
|
2738
|
-
}(t, n, "query", s), v =
|
|
2752
|
+
}(t, n, "query", s), v = y[0], f = y[1], S = y[2], p = y[3];
|
|
2739
2753
|
return v && f ? v.obsSet = s.obsSet : (f = a.query(s).then(function(b) {
|
|
2740
2754
|
var w = b.result;
|
|
2741
2755
|
if (v && (v.res = w), u) {
|
|
2742
|
-
for (var
|
|
2756
|
+
for (var m = 0, _ = w.length; m < _; ++m) Object.freeze(w[m]);
|
|
2743
2757
|
Object.freeze(w);
|
|
2744
2758
|
} else b.result = Te(w);
|
|
2745
2759
|
return b;
|
|
@@ -2786,7 +2800,7 @@ function Ra() {
|
|
|
2786
2800
|
})), this;
|
|
2787
2801
|
}, ne.prototype.open = function() {
|
|
2788
2802
|
var e = this;
|
|
2789
|
-
return Ge(
|
|
2803
|
+
return Ge(xe, function() {
|
|
2790
2804
|
return ya(e);
|
|
2791
2805
|
});
|
|
2792
2806
|
}, ne.prototype._close = function() {
|
|
@@ -2815,8 +2829,8 @@ function Ra() {
|
|
|
2815
2829
|
t.close(e);
|
|
2816
2830
|
var c = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2817
2831
|
c.onsuccess = q(function() {
|
|
2818
|
-
var h,
|
|
2819
|
-
h = t._deps,
|
|
2832
|
+
var h, y, v;
|
|
2833
|
+
h = t._deps, y = t.name, v = h.indexedDB, h = h.IDBKeyRange, Dn(v) || y === Tt || kn(v, h).delete(y).catch(J), i();
|
|
2820
2834
|
}), c.onerror = be(s), c.onblocked = t._fireOnBlocked;
|
|
2821
2835
|
}
|
|
2822
2836
|
if (n) throw new $.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
@@ -2852,9 +2866,9 @@ function Ra() {
|
|
|
2852
2866
|
var s, u, c = e.indexOf("?") !== -1;
|
|
2853
2867
|
e = e.replace("!", "").replace("?", "");
|
|
2854
2868
|
try {
|
|
2855
|
-
if (u = t.map(function(
|
|
2856
|
-
if (
|
|
2857
|
-
return
|
|
2869
|
+
if (u = t.map(function(y) {
|
|
2870
|
+
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");
|
|
2871
|
+
return y;
|
|
2858
2872
|
}), e == "r" || e === gn) s = gn;
|
|
2859
2873
|
else {
|
|
2860
2874
|
if (e != "rw" && e != yn) throw new $.InvalidArgument("Invalid transaction mode: " + e);
|
|
@@ -2865,43 +2879,43 @@ function Ra() {
|
|
|
2865
2879
|
if (!c) throw new $.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2866
2880
|
i = null;
|
|
2867
2881
|
}
|
|
2868
|
-
i && u.forEach(function(
|
|
2869
|
-
if (i && i.storeNames.indexOf(
|
|
2870
|
-
if (!c) throw new $.SubTransaction("Table " +
|
|
2882
|
+
i && u.forEach(function(y) {
|
|
2883
|
+
if (i && i.storeNames.indexOf(y) === -1) {
|
|
2884
|
+
if (!c) throw new $.SubTransaction("Table " + y + " not included in parent transaction.");
|
|
2871
2885
|
i = null;
|
|
2872
2886
|
}
|
|
2873
2887
|
}), c && i && !i.active && (i = null);
|
|
2874
2888
|
}
|
|
2875
|
-
} catch (
|
|
2889
|
+
} catch (y) {
|
|
2876
2890
|
return i ? i._promise(null, function(v, f) {
|
|
2877
|
-
f(
|
|
2878
|
-
}) : te(
|
|
2891
|
+
f(y);
|
|
2892
|
+
}) : te(y);
|
|
2879
2893
|
}
|
|
2880
|
-
var h = (function
|
|
2894
|
+
var h = (function y(v, f, S, p, b) {
|
|
2881
2895
|
return B.resolve().then(function() {
|
|
2882
|
-
var w = G.transless || G,
|
|
2883
|
-
if (
|
|
2896
|
+
var w = G.transless || G, m = v._createTransaction(f, S, v._dbSchema, p);
|
|
2897
|
+
if (m.explicit = !0, w = { trans: m, transless: w }, p) m.idbtrans = p.idbtrans;
|
|
2884
2898
|
else try {
|
|
2885
|
-
|
|
2899
|
+
m.create(), m.idbtrans._explicit = !0, v._state.PR1398_maxLoop = 3;
|
|
2886
2900
|
} catch (O) {
|
|
2887
2901
|
return O.name === an.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
2888
|
-
return
|
|
2902
|
+
return y(v, f, S, null, b);
|
|
2889
2903
|
})) : te(O);
|
|
2890
2904
|
}
|
|
2891
2905
|
var _, E = rn(b);
|
|
2892
2906
|
return E && qe(), w = B.follow(function() {
|
|
2893
2907
|
var O;
|
|
2894
|
-
(_ = b.call(
|
|
2908
|
+
(_ = b.call(m, m)) && (E ? (O = De.bind(null, null), _.then(O, O)) : typeof _.next == "function" && typeof _.throw == "function" && (_ = jn(_)));
|
|
2895
2909
|
}, w), (_ && typeof _.then == "function" ? B.resolve(_).then(function(O) {
|
|
2896
|
-
return
|
|
2910
|
+
return m.active ? O : te(new $.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2897
2911
|
}) : w.then(function() {
|
|
2898
2912
|
return _;
|
|
2899
2913
|
})).then(function(O) {
|
|
2900
|
-
return p &&
|
|
2914
|
+
return p && m._resolve(), m._completion.then(function() {
|
|
2901
2915
|
return O;
|
|
2902
2916
|
});
|
|
2903
2917
|
}).catch(function(O) {
|
|
2904
|
-
return
|
|
2918
|
+
return m._reject(O), te(O);
|
|
2905
2919
|
});
|
|
2906
2920
|
});
|
|
2907
2921
|
}).bind(null, this, s, u, i, n);
|
|
@@ -2916,42 +2930,42 @@ function Ra() {
|
|
|
2916
2930
|
var n = this;
|
|
2917
2931
|
this._middlewares = {}, this.verno = 0;
|
|
2918
2932
|
var a = ne.dependencies;
|
|
2919
|
-
this._options = t =
|
|
2920
|
-
var i, s, u, c, h,
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
}),
|
|
2924
|
-
|
|
2925
|
-
}), this._state =
|
|
2933
|
+
this._options = t = d({ addons: ne.addons, autoOpen: !0, indexedDB: a.indexedDB, IDBKeyRange: a.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, a = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2934
|
+
var i, s, u, c, h, y = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: J, dbReadyPromise: null, cancelOpen: J, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2935
|
+
y.dbReadyPromise = new B(function(f) {
|
|
2936
|
+
y.dbReadyResolve = f;
|
|
2937
|
+
}), y.openCanceller = new B(function(f, S) {
|
|
2938
|
+
y.cancelOpen = S;
|
|
2939
|
+
}), this._state = y, this.name = e, this.on = dt(this, "populate", "blocked", "versionchange", "close", { ready: [sn, J] }), this.on.ready.subscribe = Hn(this.on.ready.subscribe, function(f) {
|
|
2926
2940
|
return function(S, p) {
|
|
2927
2941
|
ne.vip(function() {
|
|
2928
2942
|
var b, w = n._state;
|
|
2929
|
-
w.openComplete ? (w.dbOpenError || B.resolve().then(S), p && f(S)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(S), p && f(S)) : (f(S), b = n, p || f(function
|
|
2930
|
-
b.on.ready.unsubscribe(S), b.on.ready.unsubscribe(
|
|
2943
|
+
w.openComplete ? (w.dbOpenError || B.resolve().then(S), p && f(S)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(S), p && f(S)) : (f(S), b = n, p || f(function m() {
|
|
2944
|
+
b.on.ready.unsubscribe(S), b.on.ready.unsubscribe(m);
|
|
2931
2945
|
}));
|
|
2932
2946
|
});
|
|
2933
2947
|
};
|
|
2934
|
-
}), this.Collection = (i = this, ft(ia.prototype, function(_,
|
|
2948
|
+
}), this.Collection = (i = this, ft(ia.prototype, function(_, m) {
|
|
2935
2949
|
this.db = i;
|
|
2936
2950
|
var p = sr, b = null;
|
|
2937
|
-
if (
|
|
2938
|
-
p =
|
|
2951
|
+
if (m) try {
|
|
2952
|
+
p = m();
|
|
2939
2953
|
} catch (E) {
|
|
2940
2954
|
b = E;
|
|
2941
2955
|
}
|
|
2942
|
-
var w = _._ctx,
|
|
2943
|
-
this._ctx = { table:
|
|
2956
|
+
var w = _._ctx, m = w.table, _ = m.hook.reading.fire;
|
|
2957
|
+
this._ctx = { table: m, index: w.index, isPrimKey: !w.index || m.schema.primKey.keyPath && w.index === m.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: b, or: w.or, valueMapper: _ !== st ? _ : null };
|
|
2944
2958
|
})), this.Table = (s = this, ft(lr.prototype, function(f, S, p) {
|
|
2945
2959
|
this.db = s, this._tx = p, this.name = f, this.schema = S, this.hook = s._allTables[f] ? s._allTables[f].hook : dt(null, { creating: [Jr, J], reading: [Xr, st], updating: [Zr, J], deleting: [Vr, J] });
|
|
2946
2960
|
})), this.Transaction = (u = this, ft(ua.prototype, function(f, S, p, b, w) {
|
|
2947
|
-
var
|
|
2961
|
+
var m = this;
|
|
2948
2962
|
this.db = u, this.mode = f, this.storeNames = S, this.schema = p, this.chromeTransactionDurability = b, this.idbtrans = null, this.on = dt(this, "complete", "error", "abort"), this.parent = w || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new B(function(_, E) {
|
|
2949
|
-
|
|
2963
|
+
m._resolve = _, m._reject = E;
|
|
2950
2964
|
}), this._completion.then(function() {
|
|
2951
|
-
|
|
2965
|
+
m.active = !1, m.on.complete.fire();
|
|
2952
2966
|
}, function(_) {
|
|
2953
|
-
var E =
|
|
2954
|
-
return
|
|
2967
|
+
var E = m.active;
|
|
2968
|
+
return m.active = !1, m.on.error.fire(_), m.parent ? m.parent._reject(_) : E && m.idbtrans && m.idbtrans.abort(), te(_);
|
|
2955
2969
|
});
|
|
2956
2970
|
})), this.Version = (c = this, ft(ga.prototype, function(f) {
|
|
2957
2971
|
this.db = c, this._cfg = { version: f, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
@@ -3007,7 +3021,7 @@ function Ra() {
|
|
|
3007
3021
|
}
|
|
3008
3022
|
function Ir(e) {
|
|
3009
3023
|
var t, n = !1, a = new Oa(function(i) {
|
|
3010
|
-
var s = rn(e), u, c = !1, h = {},
|
|
3024
|
+
var s = rn(e), u, c = !1, h = {}, y = {}, v = { get closed() {
|
|
3011
3025
|
return c;
|
|
3012
3026
|
}, unsubscribe: function() {
|
|
3013
3027
|
c || (c = !0, u && u.abort(), f && Ce.storagemutated.unsubscribe(p));
|
|
@@ -3016,23 +3030,23 @@ function Ra() {
|
|
|
3016
3030
|
var f = !1, S = function() {
|
|
3017
3031
|
return pn(b);
|
|
3018
3032
|
}, p = function(w) {
|
|
3019
|
-
zt(h, w), Cn(
|
|
3033
|
+
zt(h, w), Cn(y, h) && S();
|
|
3020
3034
|
}, b = function() {
|
|
3021
|
-
var w,
|
|
3035
|
+
var w, m, _;
|
|
3022
3036
|
!c && Xt.indexedDB && (h = {}, w = {}, u && u.abort(), u = new AbortController(), _ = function(E) {
|
|
3023
3037
|
var O = Ve();
|
|
3024
3038
|
try {
|
|
3025
3039
|
s && qe();
|
|
3026
|
-
var
|
|
3027
|
-
return
|
|
3040
|
+
var x = ke(e, E);
|
|
3041
|
+
return x = s ? x.finally(De) : x;
|
|
3028
3042
|
} finally {
|
|
3029
3043
|
O && Ze();
|
|
3030
3044
|
}
|
|
3031
|
-
}(
|
|
3032
|
-
n = !0, t = E, c ||
|
|
3033
|
-
for (var
|
|
3045
|
+
}(m = { subscr: w, signal: u.signal, requery: S, querier: e, trans: null }), Promise.resolve(_).then(function(E) {
|
|
3046
|
+
n = !0, t = E, c || m.signal.aborted || (h = {}, function(O) {
|
|
3047
|
+
for (var x in O) if (ee(O, x)) return;
|
|
3034
3048
|
return 1;
|
|
3035
|
-
}(
|
|
3049
|
+
}(y = w) || f || (Ce(gt, p), f = !0), pn(function() {
|
|
3036
3050
|
return !c && i.next && i.next(E);
|
|
3037
3051
|
}));
|
|
3038
3052
|
}, function(E) {
|
|
@@ -3058,7 +3072,7 @@ function Ra() {
|
|
|
3058
3072
|
Re = t;
|
|
3059
3073
|
}
|
|
3060
3074
|
}
|
|
3061
|
-
le(We,
|
|
3075
|
+
le(We, d(d({}, Ot), { delete: function(e) {
|
|
3062
3076
|
return new We(e, { addons: [] }).delete();
|
|
3063
3077
|
}, exists: function(e) {
|
|
3064
3078
|
return new We(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3138,10 +3152,10 @@ function Ra() {
|
|
|
3138
3152
|
}), addEventListener("pageshow", function(e) {
|
|
3139
3153
|
!Ee.disableBfCache && e.persisted && (me && console.debug("Dexie: handling persisted pageshow"), Cr(), Gn({ all: new oe(-1 / 0, [[]]) }));
|
|
3140
3154
|
})), B.rejectionMapper = function(e, t) {
|
|
3141
|
-
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e &&
|
|
3155
|
+
return !e || e instanceof Xe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e && Ae(t, "stack", { get: function() {
|
|
3142
3156
|
return this.inner.stack;
|
|
3143
3157
|
} }), t);
|
|
3144
|
-
}, qn(me),
|
|
3158
|
+
}, qn(me), d(Ee, Object.freeze({ __proto__: null, Dexie: Ee, liveQuery: Ir, Entity: or, cmp: Y, PropModification: ht, replacePrefix: function(e, t) {
|
|
3145
3159
|
return new ht({ replacePrefix: [e, t] });
|
|
3146
3160
|
}, add: function(e) {
|
|
3147
3161
|
return new ht({ add: e });
|
|
@@ -3155,33 +3169,33 @@ var Ta = Ra();
|
|
|
3155
3169
|
const Wn = /* @__PURE__ */ Ia(Ta), Tr = Symbol.for("Dexie"), en = globalThis[Tr] || (globalThis[Tr] = Wn);
|
|
3156
3170
|
if (Wn.semVer !== en.semVer)
|
|
3157
3171
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Wn.semVer} and ${en.semVer}`);
|
|
3158
|
-
function V(
|
|
3159
|
-
let r = `${
|
|
3160
|
-
return
|
|
3172
|
+
function V(l) {
|
|
3173
|
+
let r = `${l.type}.${l.topics}`;
|
|
3174
|
+
return l.order && (r += `.${l.order}`), l.period && (r += `.${l.period}`), r;
|
|
3161
3175
|
}
|
|
3162
|
-
function Mr(
|
|
3176
|
+
function Mr(l) {
|
|
3163
3177
|
var r;
|
|
3164
|
-
if (
|
|
3165
|
-
const o = (r =
|
|
3166
|
-
o && o.length > 1 ? (
|
|
3178
|
+
if (l.widget === void 0) {
|
|
3179
|
+
const o = (r = l.topics) == null ? void 0 : r.split("-");
|
|
3180
|
+
o && o.length > 1 ? (l.dashboard = o ? o[0] : "", l.widget = o ? o[1] : "") : (l.widget = l.topics, l.dashboard = l.slide);
|
|
3167
3181
|
}
|
|
3168
|
-
return
|
|
3182
|
+
return l.topics === void 0 && (l.topics = `${l.dashboard}-${l.widget}`), l;
|
|
3169
3183
|
}
|
|
3170
|
-
function St(
|
|
3184
|
+
function St(l, r) {
|
|
3171
3185
|
var U;
|
|
3172
|
-
let o,
|
|
3173
|
-
switch (
|
|
3186
|
+
let o, d, A, D, K;
|
|
3187
|
+
switch (l.moderation) {
|
|
3174
3188
|
case Zt.BEFORE:
|
|
3175
|
-
o = /* @__PURE__ */ new Date(),
|
|
3189
|
+
o = /* @__PURE__ */ new Date(), d = (U = l.beforeTime) == null ? void 0 : U.split(":"), A = Number.parseInt(d ? d[0] : "00"), D = Number.parseInt(d ? d[1] : "00"), K = Number.parseInt(d ? d[2] : "00"), r.before = o.setHours(A, D, K, 0) / 1e3, r.period || (r.period = o.getDay() === 1 ? 72 : 24);
|
|
3176
3190
|
break;
|
|
3177
3191
|
case Zt.DELAYED:
|
|
3178
|
-
|
|
3192
|
+
l.delay && l.delay > 0 && (r.delay = `${l.delay}`);
|
|
3179
3193
|
break;
|
|
3180
3194
|
case Zt.APPROVED:
|
|
3181
3195
|
r.approved = "1";
|
|
3182
3196
|
break;
|
|
3183
3197
|
default:
|
|
3184
|
-
|
|
3198
|
+
l.period !== 0 && (r.period = l.period);
|
|
3185
3199
|
}
|
|
3186
3200
|
return r;
|
|
3187
3201
|
}
|
|
@@ -3199,9 +3213,9 @@ class jr {
|
|
|
3199
3213
|
const o = await this.db.table(N.CLOUD).where({ id: r.widget }).last().catch(() => {
|
|
3200
3214
|
console.warn(
|
|
3201
3215
|
"%capi%C %ccloud",
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3216
|
+
g.API,
|
|
3217
|
+
g.NONE,
|
|
3218
|
+
g.CLOUD,
|
|
3205
3219
|
r.slide,
|
|
3206
3220
|
r.widget
|
|
3207
3221
|
);
|
|
@@ -3217,9 +3231,9 @@ class jr {
|
|
|
3217
3231
|
const o = await this.db.table(N.SERIES).where({ id: r.widget }).last().catch(() => {
|
|
3218
3232
|
console.warn(
|
|
3219
3233
|
"%capi%c %cseries",
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3234
|
+
g.API,
|
|
3235
|
+
g.NONE,
|
|
3236
|
+
g.SERIES,
|
|
3223
3237
|
r.slide,
|
|
3224
3238
|
r.widget
|
|
3225
3239
|
);
|
|
@@ -3234,9 +3248,9 @@ class jr {
|
|
|
3234
3248
|
k(this, "getMessages", async (r) => {
|
|
3235
3249
|
const o = (r == null ? void 0 : r.order) ?? "utc";
|
|
3236
3250
|
o !== "utc" && (r.since = Math.floor(Date.now() / 1e3) - 60 * 60 * 24 * 7), this.options.delay != 0 ? r.before = Math.floor(Date.now() / 1e3) - (this.options.delay || 0) : r.before = Math.floor(Date.now() / 1e3);
|
|
3237
|
-
const
|
|
3251
|
+
const d = (K) => K.utc > ((r == null ? void 0 : r.since) || 0), A = (K) => K.utc < ((r == null ? void 0 : r.before) || Date.now() / 1e3), D = (K) => (K == null ? void 0 : K.visible) !== 0;
|
|
3238
3252
|
try {
|
|
3239
|
-
const U = await this.db.table(N.TOPICS).where("widget_id").equals(r.widget).filter(D).filter(
|
|
3253
|
+
const U = await this.db.table(N.TOPICS).where("widget_id").equals(r.widget).filter(D).filter(d).filter(A).reverse().limit((r == null ? void 0 : r.limit) ?? 25).sortBy(o);
|
|
3240
3254
|
if (U.length === 0)
|
|
3241
3255
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3242
3256
|
let M = U.map((X) => this.db.table(N.MESSAGES).get({ id: X.message_id }));
|
|
@@ -3255,18 +3269,18 @@ class jr {
|
|
|
3255
3269
|
};
|
|
3256
3270
|
return console.debug(
|
|
3257
3271
|
"%cstorage%c %cmessages",
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3272
|
+
g.STORAGE,
|
|
3273
|
+
g.NONE,
|
|
3274
|
+
g.MESSAGES,
|
|
3261
3275
|
ee
|
|
3262
3276
|
), ee;
|
|
3263
3277
|
});
|
|
3264
3278
|
} catch (K) {
|
|
3265
3279
|
return console.warn(
|
|
3266
3280
|
"%cstorage%c %cmessages",
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3281
|
+
g.STORAGE,
|
|
3282
|
+
g.NONE,
|
|
3283
|
+
g.MESSAGES,
|
|
3270
3284
|
r,
|
|
3271
3285
|
K
|
|
3272
3286
|
), { data: null, message: "Messages Data error", success: !1 };
|
|
@@ -3283,7 +3297,7 @@ class jr {
|
|
|
3283
3297
|
dashboard_id: r.dashboard,
|
|
3284
3298
|
//data: data.data,
|
|
3285
3299
|
data: o
|
|
3286
|
-
}).then(() => 201).catch((
|
|
3300
|
+
}).then(() => 201).catch((d) => (console.error("%cstorage", g.STORAGE, "set", r, d.message), 400)) : 400);
|
|
3287
3301
|
/**
|
|
3288
3302
|
* Update Series
|
|
3289
3303
|
* @param query IQuery
|
|
@@ -3295,7 +3309,7 @@ class jr {
|
|
|
3295
3309
|
dashboard_id: r.dashboard,
|
|
3296
3310
|
//data: data.data,
|
|
3297
3311
|
data: o
|
|
3298
|
-
}).then(() => 201).catch((
|
|
3312
|
+
}).then(() => 201).catch((d) => (console.error("%cstorage", g.STORAGE, "set", r, d.message), 400)) : 400);
|
|
3299
3313
|
/**
|
|
3300
3314
|
* Update Messages
|
|
3301
3315
|
* @param query IQuery
|
|
@@ -3305,8 +3319,8 @@ class jr {
|
|
|
3305
3319
|
k(this, "setMessages", async (r, o) => {
|
|
3306
3320
|
if (r.type !== N.MESSAGES)
|
|
3307
3321
|
return 400;
|
|
3308
|
-
const
|
|
3309
|
-
let
|
|
3322
|
+
const d = o.data.title;
|
|
3323
|
+
let A = 0;
|
|
3310
3324
|
return o.data.messages.forEach(async (D) => {
|
|
3311
3325
|
var K, U, M, X, se, ee, le;
|
|
3312
3326
|
D.id !== null && (await this.db.table(N.MESSAGES).put({
|
|
@@ -3315,16 +3329,16 @@ class jr {
|
|
|
3315
3329
|
data: D,
|
|
3316
3330
|
expires: D.expires
|
|
3317
3331
|
}).catch((He) => {
|
|
3318
|
-
|
|
3332
|
+
A++, console.error(
|
|
3319
3333
|
"%cstorage",
|
|
3320
|
-
|
|
3334
|
+
g.STORAGE,
|
|
3321
3335
|
"set message",
|
|
3322
|
-
`title: ${
|
|
3336
|
+
`title: ${d}`,
|
|
3323
3337
|
D,
|
|
3324
3338
|
He.message
|
|
3325
3339
|
);
|
|
3326
3340
|
}), await this.db.table(N.TOPICS).put({
|
|
3327
|
-
title:
|
|
3341
|
+
title: d,
|
|
3328
3342
|
widget_id: r.widget,
|
|
3329
3343
|
message_id: D.id,
|
|
3330
3344
|
dashboard_id: r.dashboard,
|
|
@@ -3335,11 +3349,11 @@ class jr {
|
|
|
3335
3349
|
utc: D.utc,
|
|
3336
3350
|
expires: D.expires
|
|
3337
3351
|
}).catch((He) => {
|
|
3338
|
-
|
|
3352
|
+
A++, console.error(
|
|
3339
3353
|
"%cstorage",
|
|
3340
|
-
|
|
3354
|
+
g.STORAGE,
|
|
3341
3355
|
"set topic",
|
|
3342
|
-
`title: ${
|
|
3356
|
+
`title: ${d}`,
|
|
3343
3357
|
D,
|
|
3344
3358
|
He.message
|
|
3345
3359
|
);
|
|
@@ -3347,43 +3361,43 @@ class jr {
|
|
|
3347
3361
|
}), o.data.topics.forEach(async (D) => {
|
|
3348
3362
|
const K = D.message_id, U = D.visible ? 1 : 0, M = D.title;
|
|
3349
3363
|
await this.db.table(N.TOPICS).where("message_id").equals(K).modify({ visible: U }).catch((X) => {
|
|
3350
|
-
|
|
3364
|
+
A++, console.error(
|
|
3351
3365
|
"%cstorage",
|
|
3352
|
-
|
|
3366
|
+
g.STORAGE,
|
|
3353
3367
|
"update message visibility",
|
|
3354
3368
|
`title: ${M}`,
|
|
3355
3369
|
`widget: ${D.widget_id}`,
|
|
3356
3370
|
X.message
|
|
3357
3371
|
);
|
|
3358
3372
|
});
|
|
3359
|
-
}),
|
|
3373
|
+
}), A === 0 ? 201 : 400;
|
|
3360
3374
|
});
|
|
3361
3375
|
/**
|
|
3362
3376
|
* Wipe Message data after expires timestamp
|
|
3363
3377
|
*/
|
|
3364
3378
|
k(this, "cleanMessages", async () => {
|
|
3365
|
-
const r = Date.now() / 1e3, o = (D) => D.expires < r,
|
|
3379
|
+
const r = Date.now() / 1e3, o = (D) => D.expires < r, d = (D) => D.expires < r;
|
|
3366
3380
|
return await this.db.table(N.TOPICS).orderBy("expires").filter(o).delete().catch((D) => (console.error(
|
|
3367
3381
|
"%cstorage%c %cclean",
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3382
|
+
g.STORAGE,
|
|
3383
|
+
g.NONE,
|
|
3384
|
+
g.MESSAGES,
|
|
3371
3385
|
D.message
|
|
3372
|
-
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(
|
|
3386
|
+
), 0)), await this.db.table(N.MESSAGES).orderBy("expires").filter(d).delete().catch((D) => (console.error(
|
|
3373
3387
|
"%cstorage%c %clean",
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3388
|
+
g.STORAGE,
|
|
3389
|
+
g.NONE,
|
|
3390
|
+
g.MESSAGES,
|
|
3377
3391
|
D.message
|
|
3378
3392
|
), 0));
|
|
3379
3393
|
});
|
|
3380
3394
|
k(this, "hideMessage", async (r, o) => {
|
|
3381
|
-
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: o ? 1 : 0 }).catch((
|
|
3395
|
+
await this.db.table(N.TOPICS).where("message_id").equals(r).modify({ visible: o ? 1 : 0 }).catch((d) => (console.error(
|
|
3382
3396
|
"%cstorage%c %chide",
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3397
|
+
g.STORAGE,
|
|
3398
|
+
g.NONE,
|
|
3399
|
+
g.HIDE,
|
|
3400
|
+
d.message
|
|
3387
3401
|
), 0));
|
|
3388
3402
|
});
|
|
3389
3403
|
/**
|
|
@@ -3397,7 +3411,7 @@ class jr {
|
|
|
3397
3411
|
type: r.type
|
|
3398
3412
|
}).then(() => 201).catch((o) => (console.error(
|
|
3399
3413
|
"%cstorage",
|
|
3400
|
-
|
|
3414
|
+
g.STORAGE,
|
|
3401
3415
|
N.WIDGET,
|
|
3402
3416
|
r,
|
|
3403
3417
|
o.message
|
|
@@ -3408,19 +3422,19 @@ class jr {
|
|
|
3408
3422
|
* @returns null
|
|
3409
3423
|
*/
|
|
3410
3424
|
k(this, "subscribe", (r) => (r = Mr(r), this.subscribers.filter(
|
|
3411
|
-
(
|
|
3425
|
+
(d) => d.widget === r.widget
|
|
3412
3426
|
).length > 0 || (r.type === N.MESSAGES && (r = St(this.options, r)), console.info(
|
|
3413
3427
|
"%cstorage%c %csubscribe",
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3428
|
+
g.STORAGE,
|
|
3429
|
+
g.NONE,
|
|
3430
|
+
g.SUBSCRIBE,
|
|
3417
3431
|
r.slide,
|
|
3418
3432
|
r.widget
|
|
3419
3433
|
), console.debug(
|
|
3420
3434
|
"%cstorage%c %csubscribe",
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3435
|
+
g.STORAGE,
|
|
3436
|
+
g.NONE,
|
|
3437
|
+
g.SUBSCRIBE,
|
|
3424
3438
|
r
|
|
3425
3439
|
), this.subscribers.push(r)), null));
|
|
3426
3440
|
/**
|
|
@@ -3437,9 +3451,9 @@ class jr {
|
|
|
3437
3451
|
const o = await this.db.table(N.SLIDE).where({ id: r.id }).last().catch(() => {
|
|
3438
3452
|
console.warn(
|
|
3439
3453
|
"%capi%c %cseries",
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3454
|
+
g.API,
|
|
3455
|
+
g.NONE,
|
|
3456
|
+
g.SERIES,
|
|
3443
3457
|
r.id
|
|
3444
3458
|
);
|
|
3445
3459
|
});
|
|
@@ -3458,7 +3472,7 @@ class jr {
|
|
|
3458
3472
|
css: r.data.css || ""
|
|
3459
3473
|
}).then(() => 200).catch((o) => (console.error(
|
|
3460
3474
|
"%cstorage",
|
|
3461
|
-
|
|
3475
|
+
g.STORAGE,
|
|
3462
3476
|
re.SLIDE_STORE,
|
|
3463
3477
|
r,
|
|
3464
3478
|
o.message
|
|
@@ -3478,26 +3492,26 @@ class jr {
|
|
|
3478
3492
|
}), this.db.open();
|
|
3479
3493
|
}
|
|
3480
3494
|
}
|
|
3481
|
-
function zn(
|
|
3495
|
+
function zn(l) {
|
|
3482
3496
|
return new Promise((r, o) => {
|
|
3483
|
-
|
|
3497
|
+
l.oncomplete = l.onsuccess = () => r(l.result), l.onabort = l.onerror = () => o(l.error);
|
|
3484
3498
|
});
|
|
3485
3499
|
}
|
|
3486
|
-
function Ma(
|
|
3487
|
-
const o = indexedDB.open(
|
|
3500
|
+
function Ma(l, r) {
|
|
3501
|
+
const o = indexedDB.open(l);
|
|
3488
3502
|
o.onupgradeneeded = () => o.result.createObjectStore(r);
|
|
3489
|
-
const
|
|
3490
|
-
return (
|
|
3503
|
+
const d = zn(o);
|
|
3504
|
+
return (A, D) => d.then((K) => D(K.transaction(r, A).objectStore(r)));
|
|
3491
3505
|
}
|
|
3492
3506
|
let Un;
|
|
3493
3507
|
function Nr() {
|
|
3494
3508
|
return Un || (Un = Ma("keyval-store", "keyval")), Un;
|
|
3495
3509
|
}
|
|
3496
|
-
function Vt(
|
|
3497
|
-
return r("readonly", (o) => zn(o.get(
|
|
3510
|
+
function Vt(l, r = Nr()) {
|
|
3511
|
+
return r("readonly", (o) => zn(o.get(l)));
|
|
3498
3512
|
}
|
|
3499
|
-
function wt(
|
|
3500
|
-
return o("readwrite", (
|
|
3513
|
+
function wt(l, r, o = Nr()) {
|
|
3514
|
+
return o("readwrite", (d) => (d.put(r, l), zn(d.transaction)));
|
|
3501
3515
|
}
|
|
3502
3516
|
class Kr {
|
|
3503
3517
|
constructor(r) {
|
|
@@ -3505,15 +3519,15 @@ class Kr {
|
|
|
3505
3519
|
k(this, "options");
|
|
3506
3520
|
k(this, "getCloud", async (r) => {
|
|
3507
3521
|
const o = V(r);
|
|
3508
|
-
return await Vt(o).then((
|
|
3522
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3509
3523
|
});
|
|
3510
3524
|
k(this, "getSeries", async (r) => {
|
|
3511
3525
|
const o = V(r);
|
|
3512
|
-
return await Vt(o).then((
|
|
3526
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", g.API, N.SERIES, r.slide, r.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3513
3527
|
});
|
|
3514
3528
|
k(this, "getMessages", async (r) => {
|
|
3515
3529
|
const o = V(r);
|
|
3516
|
-
return await Vt(o).then((
|
|
3530
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3517
3531
|
});
|
|
3518
3532
|
/**
|
|
3519
3533
|
* Update Cloud
|
|
@@ -3524,8 +3538,8 @@ class Kr {
|
|
|
3524
3538
|
k(this, "setCloud", async (r, o) => {
|
|
3525
3539
|
if (!o.success)
|
|
3526
3540
|
return 400;
|
|
3527
|
-
const
|
|
3528
|
-
return delete o.success, delete o.message, await wt(
|
|
3541
|
+
const d = V(r);
|
|
3542
|
+
return delete o.success, delete o.message, await wt(d, o).then(() => 201).catch((A) => (console.error("%cstorage", g.STORAGE, N.CLOUD, r, A.message), 400));
|
|
3529
3543
|
});
|
|
3530
3544
|
/**
|
|
3531
3545
|
* Update Series
|
|
@@ -3536,8 +3550,8 @@ class Kr {
|
|
|
3536
3550
|
k(this, "setSeries", async (r, o) => {
|
|
3537
3551
|
if (!o.success)
|
|
3538
3552
|
return 400;
|
|
3539
|
-
const
|
|
3540
|
-
return delete o.success, delete o.message, await wt(
|
|
3553
|
+
const d = V(r);
|
|
3554
|
+
return delete o.success, delete o.message, await wt(d, o).then(() => 201).catch((A) => (console.error("%cstorage", g.STORAGE, N.SERIES, r, A.message), 400));
|
|
3541
3555
|
});
|
|
3542
3556
|
/**
|
|
3543
3557
|
* Update Messages
|
|
@@ -3548,8 +3562,8 @@ class Kr {
|
|
|
3548
3562
|
k(this, "setMessages", async (r, o) => {
|
|
3549
3563
|
if (!o.success)
|
|
3550
3564
|
return 400;
|
|
3551
|
-
const
|
|
3552
|
-
return delete o.success, delete o.message, await wt(
|
|
3565
|
+
const d = V(r);
|
|
3566
|
+
return delete o.success, delete o.message, await wt(d, o).then(() => 201).catch((A) => (console.error("%cstorage", g.STORAGE, N.MESSAGES, r, A.message), 400));
|
|
3553
3567
|
});
|
|
3554
3568
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
3555
3569
|
k(this, "hideMessage", async (r, o) => {
|
|
@@ -3563,12 +3577,12 @@ class Kr {
|
|
|
3563
3577
|
* @returns number
|
|
3564
3578
|
*/
|
|
3565
3579
|
k(this, "setWidget", async (r) => {
|
|
3566
|
-
const o = V(r),
|
|
3580
|
+
const o = V(r), d = {
|
|
3567
3581
|
id: r.widget,
|
|
3568
3582
|
dashboard_id: r.dashboard,
|
|
3569
3583
|
type: r.type
|
|
3570
3584
|
};
|
|
3571
|
-
return await wt(o,
|
|
3585
|
+
return await wt(o, d).then(() => 201).catch((A) => (console.error("%cstorage", g.STORAGE, N.WIDGET, r, A.message), 400));
|
|
3572
3586
|
});
|
|
3573
3587
|
/**
|
|
3574
3588
|
* Add component subscriber
|
|
@@ -3576,12 +3590,12 @@ class Kr {
|
|
|
3576
3590
|
* @returns null
|
|
3577
3591
|
*/
|
|
3578
3592
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3579
|
-
(
|
|
3593
|
+
(d) => d.widget === r.widget
|
|
3580
3594
|
).length > 0 || (console.debug(
|
|
3581
3595
|
"%cstorage%c %csubscribe",
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3596
|
+
g.STORAGE,
|
|
3597
|
+
g.NONE,
|
|
3598
|
+
g.SUBSCRIBE,
|
|
3585
3599
|
r.slide,
|
|
3586
3600
|
r.widget
|
|
3587
3601
|
), this.subscribers.push(r)), null));
|
|
@@ -3592,7 +3606,7 @@ class Kr {
|
|
|
3592
3606
|
k(this, "getSubscribers", async () => await new Promise((r) => r(this.subscribers)));
|
|
3593
3607
|
k(this, "loadSlide", async (r) => {
|
|
3594
3608
|
const o = V(r);
|
|
3595
|
-
return await Vt(o).then((
|
|
3609
|
+
return await Vt(o).then((d) => d).catch(() => (console.warn("%capi", g.API, N.SLIDE, r.slide), { data: null, message: "Slide Load error", success: !1 }));
|
|
3596
3610
|
});
|
|
3597
3611
|
/**
|
|
3598
3612
|
* Update Slide
|
|
@@ -3600,14 +3614,14 @@ class Kr {
|
|
|
3600
3614
|
* @returns number
|
|
3601
3615
|
*/
|
|
3602
3616
|
k(this, "storeSlide", async (r) => {
|
|
3603
|
-
const o = V(r),
|
|
3617
|
+
const o = V(r), d = {
|
|
3604
3618
|
id: r.id,
|
|
3605
3619
|
title: r.data.title || "Not set",
|
|
3606
3620
|
json: r.data.json || {},
|
|
3607
3621
|
html: r.data.html || "",
|
|
3608
3622
|
css: r.data.css || ""
|
|
3609
3623
|
};
|
|
3610
|
-
return await wt(o,
|
|
3624
|
+
return await wt(o, d).then(() => 201).catch((A) => (console.error("%cstorage", g.STORAGE, N.SLIDE, r, A.message), 400));
|
|
3611
3625
|
});
|
|
3612
3626
|
this.options = r;
|
|
3613
3627
|
}
|
|
@@ -3620,24 +3634,24 @@ class Br {
|
|
|
3620
3634
|
const o = V(r);
|
|
3621
3635
|
try {
|
|
3622
3636
|
return localStorage.getObject(o);
|
|
3623
|
-
} catch (
|
|
3624
|
-
return console.warn("%capi",
|
|
3637
|
+
} catch (d) {
|
|
3638
|
+
return console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3625
3639
|
}
|
|
3626
3640
|
});
|
|
3627
3641
|
k(this, "getSeries", async (r) => {
|
|
3628
3642
|
const o = V(r);
|
|
3629
3643
|
try {
|
|
3630
3644
|
return localStorage.getObject(o);
|
|
3631
|
-
} catch (
|
|
3632
|
-
return console.warn("%capi",
|
|
3645
|
+
} catch (d) {
|
|
3646
|
+
return console.warn("%capi", g.API, N.SERIES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3633
3647
|
}
|
|
3634
3648
|
});
|
|
3635
3649
|
k(this, "getMessages", async (r) => {
|
|
3636
3650
|
const o = V(r);
|
|
3637
3651
|
try {
|
|
3638
3652
|
return localStorage.getObject(o);
|
|
3639
|
-
} catch (
|
|
3640
|
-
return console.warn("%capi",
|
|
3653
|
+
} catch (d) {
|
|
3654
|
+
return console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3641
3655
|
}
|
|
3642
3656
|
});
|
|
3643
3657
|
/**
|
|
@@ -3647,11 +3661,11 @@ class Br {
|
|
|
3647
3661
|
* @returns number
|
|
3648
3662
|
*/
|
|
3649
3663
|
k(this, "setCloud", async (r, o) => {
|
|
3650
|
-
const
|
|
3664
|
+
const d = V(r);
|
|
3651
3665
|
try {
|
|
3652
|
-
return localStorage.setObject(
|
|
3653
|
-
} catch (
|
|
3654
|
-
return console.error("%cstorage",
|
|
3666
|
+
return localStorage.setObject(d, o), 201;
|
|
3667
|
+
} catch (A) {
|
|
3668
|
+
return console.error("%cstorage", g.STORAGE, N.CLOUD, r, A), 400;
|
|
3655
3669
|
}
|
|
3656
3670
|
});
|
|
3657
3671
|
/**
|
|
@@ -3661,11 +3675,11 @@ class Br {
|
|
|
3661
3675
|
* @returns number
|
|
3662
3676
|
*/
|
|
3663
3677
|
k(this, "setSeries", async (r, o) => {
|
|
3664
|
-
const
|
|
3678
|
+
const d = V(r);
|
|
3665
3679
|
try {
|
|
3666
|
-
return localStorage.setObject(
|
|
3667
|
-
} catch (
|
|
3668
|
-
return console.error("%cstorage",
|
|
3680
|
+
return localStorage.setObject(d, o), 201;
|
|
3681
|
+
} catch (A) {
|
|
3682
|
+
return console.error("%cstorage", g.STORAGE, N.SERIES, r, A), 400;
|
|
3669
3683
|
}
|
|
3670
3684
|
});
|
|
3671
3685
|
/**
|
|
@@ -3675,11 +3689,11 @@ class Br {
|
|
|
3675
3689
|
* @returns number
|
|
3676
3690
|
*/
|
|
3677
3691
|
k(this, "setMessages", async (r, o) => {
|
|
3678
|
-
const
|
|
3692
|
+
const d = V(r);
|
|
3679
3693
|
try {
|
|
3680
|
-
return localStorage.setObject(
|
|
3681
|
-
} catch (
|
|
3682
|
-
return console.error("%cstorage",
|
|
3694
|
+
return localStorage.setObject(d, o), 200;
|
|
3695
|
+
} catch (A) {
|
|
3696
|
+
return console.error("%cstorage", g.STORAGE, N.MESSAGES, r, A), 400;
|
|
3683
3697
|
}
|
|
3684
3698
|
});
|
|
3685
3699
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
@@ -3690,8 +3704,8 @@ class Br {
|
|
|
3690
3704
|
const o = `widget.${r.widget}`;
|
|
3691
3705
|
try {
|
|
3692
3706
|
return localStorage.setObject(o, r), 201;
|
|
3693
|
-
} catch (
|
|
3694
|
-
return console.error("%cstorage",
|
|
3707
|
+
} catch (d) {
|
|
3708
|
+
return console.error("%cstorage", g.STORAGE, N.WIDGET, r, d), 400;
|
|
3695
3709
|
}
|
|
3696
3710
|
});
|
|
3697
3711
|
/**
|
|
@@ -3700,12 +3714,12 @@ class Br {
|
|
|
3700
3714
|
* @returns null
|
|
3701
3715
|
*/
|
|
3702
3716
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3703
|
-
(
|
|
3717
|
+
(d) => d.widget === r.widget
|
|
3704
3718
|
).length || (console.debug(
|
|
3705
3719
|
"%cstorage%c %csubscribe",
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3720
|
+
g.STORAGE,
|
|
3721
|
+
g.NONE,
|
|
3722
|
+
g.SUBSCRIBE,
|
|
3709
3723
|
r.slide,
|
|
3710
3724
|
r.widget
|
|
3711
3725
|
), this.subscribers.push(r)), null));
|
|
@@ -3718,7 +3732,7 @@ class Br {
|
|
|
3718
3732
|
try {
|
|
3719
3733
|
return localStorage.getObject(`${r.type}.${r.id}`);
|
|
3720
3734
|
} catch (o) {
|
|
3721
|
-
return console.warn("%capi",
|
|
3735
|
+
return console.warn("%capi", g.API, N.SLIDE, r.id, o), { data: null, message: "Slide Load error", success: !1 };
|
|
3722
3736
|
}
|
|
3723
3737
|
});
|
|
3724
3738
|
k(this, "storeSlide", async (r) => {
|
|
@@ -3731,14 +3745,14 @@ class Br {
|
|
|
3731
3745
|
css: r.data.css || ""
|
|
3732
3746
|
}), 201;
|
|
3733
3747
|
} catch (o) {
|
|
3734
|
-
return console.error("%cstorage",
|
|
3748
|
+
return console.error("%cstorage", g.STORAGE, N.SLIDE, r, o), 400;
|
|
3735
3749
|
}
|
|
3736
3750
|
});
|
|
3737
|
-
this.options = r, Storage.prototype.setObject = function(o,
|
|
3738
|
-
this.setObject(o, JSON.stringify(
|
|
3751
|
+
this.options = r, Storage.prototype.setObject = function(o, d) {
|
|
3752
|
+
this.setObject(o, JSON.stringify(d));
|
|
3739
3753
|
}, Storage.prototype.getObject = function(o) {
|
|
3740
|
-
const
|
|
3741
|
-
return
|
|
3754
|
+
const d = this.getObject(o);
|
|
3755
|
+
return d && JSON.parse(d);
|
|
3742
3756
|
};
|
|
3743
3757
|
}
|
|
3744
3758
|
}
|
|
@@ -3750,24 +3764,24 @@ class Lr {
|
|
|
3750
3764
|
const o = V(r);
|
|
3751
3765
|
try {
|
|
3752
3766
|
return sessionStorage.getObject(o);
|
|
3753
|
-
} catch (
|
|
3754
|
-
return console.warn("%capi",
|
|
3767
|
+
} catch (d) {
|
|
3768
|
+
return console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3755
3769
|
}
|
|
3756
3770
|
});
|
|
3757
3771
|
k(this, "getSeries", async (r) => {
|
|
3758
3772
|
const o = V(r);
|
|
3759
3773
|
try {
|
|
3760
3774
|
return sessionStorage.getObject(o);
|
|
3761
|
-
} catch (
|
|
3762
|
-
return console.warn("%capi",
|
|
3775
|
+
} catch (d) {
|
|
3776
|
+
return console.warn("%capi", g.API, N.SERIES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3763
3777
|
}
|
|
3764
3778
|
});
|
|
3765
3779
|
k(this, "getMessages", async (r) => {
|
|
3766
3780
|
const o = V(r);
|
|
3767
3781
|
try {
|
|
3768
3782
|
return sessionStorage.getObject(o);
|
|
3769
|
-
} catch (
|
|
3770
|
-
return console.warn("%capi",
|
|
3783
|
+
} catch (d) {
|
|
3784
|
+
return console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3771
3785
|
}
|
|
3772
3786
|
});
|
|
3773
3787
|
/**
|
|
@@ -3777,11 +3791,11 @@ class Lr {
|
|
|
3777
3791
|
* @returns number
|
|
3778
3792
|
*/
|
|
3779
3793
|
k(this, "setCloud", async (r, o) => {
|
|
3780
|
-
const
|
|
3794
|
+
const d = V(r);
|
|
3781
3795
|
try {
|
|
3782
|
-
return sessionStorage.setObject(
|
|
3783
|
-
} catch (
|
|
3784
|
-
return console.error("%cstorage",
|
|
3796
|
+
return sessionStorage.setObject(d, o), 201;
|
|
3797
|
+
} catch (A) {
|
|
3798
|
+
return console.error("%cstorage", g.STORAGE, N.CLOUD, r, A), 400;
|
|
3785
3799
|
}
|
|
3786
3800
|
});
|
|
3787
3801
|
/**
|
|
@@ -3791,11 +3805,11 @@ class Lr {
|
|
|
3791
3805
|
* @returns number
|
|
3792
3806
|
*/
|
|
3793
3807
|
k(this, "setSeries", async (r, o) => {
|
|
3794
|
-
const
|
|
3808
|
+
const d = V(r);
|
|
3795
3809
|
try {
|
|
3796
|
-
return sessionStorage.setObject(
|
|
3797
|
-
} catch (
|
|
3798
|
-
return console.error("%cstorage",
|
|
3810
|
+
return sessionStorage.setObject(d, o), 201;
|
|
3811
|
+
} catch (A) {
|
|
3812
|
+
return console.error("%cstorage", g.STORAGE, N.SERIES, r, A), 400;
|
|
3799
3813
|
}
|
|
3800
3814
|
});
|
|
3801
3815
|
/**
|
|
@@ -3805,11 +3819,11 @@ class Lr {
|
|
|
3805
3819
|
* @returns number
|
|
3806
3820
|
*/
|
|
3807
3821
|
k(this, "setMessages", async (r, o) => {
|
|
3808
|
-
const
|
|
3822
|
+
const d = V(r);
|
|
3809
3823
|
try {
|
|
3810
|
-
return sessionStorage.setObject(
|
|
3811
|
-
} catch (
|
|
3812
|
-
return console.error("%cstorage",
|
|
3824
|
+
return sessionStorage.setObject(d, o), 200;
|
|
3825
|
+
} catch (A) {
|
|
3826
|
+
return console.error("%cstorage", g.STORAGE, N.MESSAGES, r, A), 400;
|
|
3813
3827
|
}
|
|
3814
3828
|
});
|
|
3815
3829
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
@@ -3820,8 +3834,8 @@ class Lr {
|
|
|
3820
3834
|
const o = `widget.${r.widget}`;
|
|
3821
3835
|
try {
|
|
3822
3836
|
return sessionStorage.setObject(o, r), 201;
|
|
3823
|
-
} catch (
|
|
3824
|
-
return console.error("%cstorage",
|
|
3837
|
+
} catch (d) {
|
|
3838
|
+
return console.error("%cstorage", g.STORAGE, N.WIDGET, r, d), 400;
|
|
3825
3839
|
}
|
|
3826
3840
|
});
|
|
3827
3841
|
/**
|
|
@@ -3830,12 +3844,12 @@ class Lr {
|
|
|
3830
3844
|
* @returns null
|
|
3831
3845
|
*/
|
|
3832
3846
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3833
|
-
(
|
|
3847
|
+
(d) => d.widget === r.widget
|
|
3834
3848
|
).length || (console.debug(
|
|
3835
3849
|
"%cstorage%c %csubscribe",
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3850
|
+
g.STORAGE,
|
|
3851
|
+
g.NONE,
|
|
3852
|
+
g.SUBSCRIBE,
|
|
3839
3853
|
r.slide,
|
|
3840
3854
|
r.widget
|
|
3841
3855
|
), this.subscribers.push(r)), null));
|
|
@@ -3848,7 +3862,7 @@ class Lr {
|
|
|
3848
3862
|
try {
|
|
3849
3863
|
return sessionStorage.getObject(`${r.type}.${r.id}`);
|
|
3850
3864
|
} catch (o) {
|
|
3851
|
-
return console.warn("%capi",
|
|
3865
|
+
return console.warn("%capi", g.API, N.SLIDE, r.id, o), { data: null, message: "Store Load error", success: !1 };
|
|
3852
3866
|
}
|
|
3853
3867
|
});
|
|
3854
3868
|
/**
|
|
@@ -3866,14 +3880,14 @@ class Lr {
|
|
|
3866
3880
|
css: r.data.css || ""
|
|
3867
3881
|
}), 200;
|
|
3868
3882
|
} catch (o) {
|
|
3869
|
-
return console.error("%cstorage",
|
|
3883
|
+
return console.error("%cstorage", g.STORAGE, N.SLIDE, r, o), 400;
|
|
3870
3884
|
}
|
|
3871
3885
|
});
|
|
3872
|
-
this.options = r, Storage.prototype.setObject = function(o,
|
|
3873
|
-
this.setItem(o, JSON.stringify(
|
|
3886
|
+
this.options = r, Storage.prototype.setObject = function(o, d) {
|
|
3887
|
+
this.setItem(o, JSON.stringify(d));
|
|
3874
3888
|
}, Storage.prototype.getObject = function(o) {
|
|
3875
|
-
const
|
|
3876
|
-
return
|
|
3889
|
+
const d = this.getItem(o);
|
|
3890
|
+
return d && JSON.parse(d);
|
|
3877
3891
|
};
|
|
3878
3892
|
}
|
|
3879
3893
|
}
|
|
@@ -3885,24 +3899,24 @@ class Gr {
|
|
|
3885
3899
|
const o = V(r);
|
|
3886
3900
|
try {
|
|
3887
3901
|
return window.BuzzCasting.WidgetData[o];
|
|
3888
|
-
} catch (
|
|
3889
|
-
return console.warn("%capi",
|
|
3902
|
+
} catch (d) {
|
|
3903
|
+
return console.warn("%capi", g.API, N.CLOUD, r.slide, r.widget, d), { data: null, message: "Cloud Data error", success: !1 };
|
|
3890
3904
|
}
|
|
3891
3905
|
});
|
|
3892
3906
|
k(this, "getSeries", async (r) => {
|
|
3893
3907
|
const o = V(r);
|
|
3894
3908
|
try {
|
|
3895
3909
|
return window.BuzzCasting.WidgetData[o];
|
|
3896
|
-
} catch (
|
|
3897
|
-
return console.warn("%capi",
|
|
3910
|
+
} catch (d) {
|
|
3911
|
+
return console.warn("%capi", g.API, N.SERIES, r.slide, r.widget, d), { data: null, message: "Series Data error", success: !1 };
|
|
3898
3912
|
}
|
|
3899
3913
|
});
|
|
3900
3914
|
k(this, "getMessages", async (r) => {
|
|
3901
3915
|
const o = V(r);
|
|
3902
3916
|
try {
|
|
3903
3917
|
return window.BuzzCasting.WidgetData[o];
|
|
3904
|
-
} catch (
|
|
3905
|
-
return console.warn("%capi",
|
|
3918
|
+
} catch (d) {
|
|
3919
|
+
return console.warn("%capi", g.API, N.MESSAGES, r.slide, r.widget, d), { data: null, message: "Messages Data error", success: !1 };
|
|
3906
3920
|
}
|
|
3907
3921
|
});
|
|
3908
3922
|
/**
|
|
@@ -3912,11 +3926,11 @@ class Gr {
|
|
|
3912
3926
|
* @returns number
|
|
3913
3927
|
*/
|
|
3914
3928
|
k(this, "setCloud", async (r, o) => {
|
|
3915
|
-
const
|
|
3929
|
+
const d = V(r);
|
|
3916
3930
|
try {
|
|
3917
|
-
return window.BuzzCasting.WidgetData[
|
|
3918
|
-
} catch (
|
|
3919
|
-
return console.error("%cstorage",
|
|
3931
|
+
return window.BuzzCasting.WidgetData[d] = o, 201;
|
|
3932
|
+
} catch (A) {
|
|
3933
|
+
return console.error("%cstorage", g.STORAGE, "set", r, A), 400;
|
|
3920
3934
|
}
|
|
3921
3935
|
});
|
|
3922
3936
|
/**
|
|
@@ -3926,11 +3940,11 @@ class Gr {
|
|
|
3926
3940
|
* @returns number
|
|
3927
3941
|
*/
|
|
3928
3942
|
k(this, "setSeries", async (r, o) => {
|
|
3929
|
-
const
|
|
3943
|
+
const d = V(r);
|
|
3930
3944
|
try {
|
|
3931
|
-
return window.BuzzCasting.WidgetData[
|
|
3932
|
-
} catch (
|
|
3933
|
-
return console.error("%cstorage",
|
|
3945
|
+
return window.BuzzCasting.WidgetData[d] = o, 201;
|
|
3946
|
+
} catch (A) {
|
|
3947
|
+
return console.error("%cstorage", g.STORAGE, "set", r, A), 400;
|
|
3934
3948
|
}
|
|
3935
3949
|
});
|
|
3936
3950
|
/**
|
|
@@ -3940,11 +3954,11 @@ class Gr {
|
|
|
3940
3954
|
* @returns number
|
|
3941
3955
|
*/
|
|
3942
3956
|
k(this, "setMessages", async (r, o) => {
|
|
3943
|
-
const
|
|
3957
|
+
const d = V(r);
|
|
3944
3958
|
try {
|
|
3945
|
-
return window.BuzzCasting.WidgetData[
|
|
3946
|
-
} catch (
|
|
3947
|
-
return console.error("%cstorage",
|
|
3959
|
+
return window.BuzzCasting.WidgetData[d] = o, 201;
|
|
3960
|
+
} catch (A) {
|
|
3961
|
+
return console.error("%cstorage", g.STORAGE, "set", r, A), 400;
|
|
3948
3962
|
}
|
|
3949
3963
|
});
|
|
3950
3964
|
k(this, "cleanMessages", async (r) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((o) => o(0))));
|
|
@@ -3955,8 +3969,8 @@ class Gr {
|
|
|
3955
3969
|
const o = `widget.${r.widget}`;
|
|
3956
3970
|
try {
|
|
3957
3971
|
return window.BuzzCasting.WidgetData[o] = r, 201;
|
|
3958
|
-
} catch (
|
|
3959
|
-
return console.error("%cstorage",
|
|
3972
|
+
} catch (d) {
|
|
3973
|
+
return console.error("%cstorage", g.STORAGE, N.WIDGET, r, d), 400;
|
|
3960
3974
|
}
|
|
3961
3975
|
});
|
|
3962
3976
|
/**
|
|
@@ -3965,12 +3979,12 @@ class Gr {
|
|
|
3965
3979
|
* @returns null
|
|
3966
3980
|
*/
|
|
3967
3981
|
k(this, "subscribe", (r) => (r.type === N.MESSAGES && (r = St(this.options, r)), this.subscribers.filter(
|
|
3968
|
-
(
|
|
3982
|
+
(d) => d.widget === r.widget
|
|
3969
3983
|
).length || (console.debug(
|
|
3970
3984
|
"%cstorage%c %csubscribe",
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3985
|
+
g.STORAGE,
|
|
3986
|
+
g.NONE,
|
|
3987
|
+
g.SUBSCRIBE,
|
|
3974
3988
|
r.slide,
|
|
3975
3989
|
r.widget
|
|
3976
3990
|
), this.subscribers.push(r)), null));
|
|
@@ -3983,7 +3997,7 @@ class Gr {
|
|
|
3983
3997
|
try {
|
|
3984
3998
|
return window.BuzzCasting.SlideData[r.id];
|
|
3985
3999
|
} catch (o) {
|
|
3986
|
-
return console.warn("%capi",
|
|
4000
|
+
return console.warn("%capi", g.API, N.SLIDE, r.id, o), { data: null, message: "Slide Load error", success: !1 };
|
|
3987
4001
|
}
|
|
3988
4002
|
});
|
|
3989
4003
|
k(this, "storeSlide", async (r) => {
|
|
@@ -3996,50 +4010,50 @@ class Gr {
|
|
|
3996
4010
|
css: r.data.css || ""
|
|
3997
4011
|
}, 201;
|
|
3998
4012
|
} catch (o) {
|
|
3999
|
-
return console.error("%cstorage",
|
|
4013
|
+
return console.error("%cstorage", g.STORAGE, N.SLIDE, r, o), 400;
|
|
4000
4014
|
}
|
|
4001
4015
|
});
|
|
4002
4016
|
this.options = r, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
4003
4017
|
}
|
|
4004
4018
|
}
|
|
4005
|
-
function Fa(
|
|
4006
|
-
const r =
|
|
4007
|
-
return r.length > 0 ? (r.forEach((o,
|
|
4008
|
-
r[
|
|
4019
|
+
function Fa(l) {
|
|
4020
|
+
const r = l.toUpperCase().split(/[\s_-]+/);
|
|
4021
|
+
return r.length > 0 ? (r.forEach((o, d) => {
|
|
4022
|
+
r[d] = `${o.charAt(0)}.`;
|
|
4009
4023
|
}), r.join(" ")) : "";
|
|
4010
4024
|
}
|
|
4011
|
-
function Wa(
|
|
4012
|
-
let r = "", o = "",
|
|
4025
|
+
function Wa(l) {
|
|
4026
|
+
let r = "", o = "", d = {
|
|
4013
4027
|
backgroundImage: ""
|
|
4014
4028
|
};
|
|
4015
|
-
return typeof
|
|
4016
|
-
(
|
|
4017
|
-
backgroundImage: `url(${
|
|
4018
|
-
}, o =
|
|
4029
|
+
return typeof l.media < "u" && l.media.forEach((A) => {
|
|
4030
|
+
(A.type === "photo" || A.type === "image") && (d = {
|
|
4031
|
+
backgroundImage: `url(${A.url})`
|
|
4032
|
+
}, o = A.url), A.type === "video" && (r = A.url);
|
|
4019
4033
|
}), {
|
|
4020
4034
|
image: o,
|
|
4021
|
-
background:
|
|
4035
|
+
background: d || null,
|
|
4022
4036
|
video: r
|
|
4023
4037
|
};
|
|
4024
4038
|
}
|
|
4025
|
-
function ja(
|
|
4039
|
+
function ja(l) {
|
|
4026
4040
|
const r = {};
|
|
4027
|
-
for (let o = 0; o <
|
|
4028
|
-
const
|
|
4029
|
-
|
|
4041
|
+
for (let o = 0; o < l.length; o++) {
|
|
4042
|
+
const d = l.item(o);
|
|
4043
|
+
d != null && d.name && (r[d.name] = d.value);
|
|
4030
4044
|
}
|
|
4031
4045
|
return r;
|
|
4032
4046
|
}
|
|
4033
|
-
function za(
|
|
4047
|
+
function za(l) {
|
|
4034
4048
|
const r = {};
|
|
4035
|
-
for (let o = 0; o <
|
|
4036
|
-
const
|
|
4037
|
-
|
|
4049
|
+
for (let o = 0; o < l.length; o++) {
|
|
4050
|
+
const d = l[o];
|
|
4051
|
+
d.name !== "class" && !d.name.includes("data") && (r[d.name] = d.value);
|
|
4038
4052
|
}
|
|
4039
4053
|
return r;
|
|
4040
4054
|
}
|
|
4041
|
-
function Ha(
|
|
4042
|
-
switch (
|
|
4055
|
+
function Ha(l, r) {
|
|
4056
|
+
switch (l) {
|
|
4043
4057
|
case "bl":
|
|
4044
4058
|
return `text-blue fa-solid fa-rss fa-${r}`;
|
|
4045
4059
|
case "co":
|
|
@@ -4080,63 +4094,63 @@ function Ha(d, r) {
|
|
|
4080
4094
|
return "";
|
|
4081
4095
|
}
|
|
4082
4096
|
}
|
|
4083
|
-
function Ya(
|
|
4084
|
-
return
|
|
4097
|
+
function Ya(l) {
|
|
4098
|
+
return l.replace(/^\w|[A-Z]|\b\w/g, (r, o) => o === 0 ? r.toLowerCase() : r.toUpperCase()).replace(/\s+/g, "");
|
|
4085
4099
|
}
|
|
4086
|
-
function Qa(
|
|
4087
|
-
return
|
|
4100
|
+
function Qa(l) {
|
|
4101
|
+
return l.toLowerCase().split("-").reduce((r, o) => r + (o.charAt(0).toUpperCase() + o.slice(1)));
|
|
4088
4102
|
}
|
|
4089
|
-
const Xa = (
|
|
4090
|
-
function Na(
|
|
4103
|
+
const Xa = (l) => l.charAt(0).toUpperCase() + l.slice(1);
|
|
4104
|
+
function Na(l) {
|
|
4091
4105
|
const r = document.createRange();
|
|
4092
|
-
r.selectNodeContents(
|
|
4106
|
+
r.selectNodeContents(l), r.deleteContents();
|
|
4093
4107
|
}
|
|
4094
|
-
function Ka(
|
|
4095
|
-
|
|
4108
|
+
function Ka(l) {
|
|
4109
|
+
l.reduce(
|
|
4096
4110
|
(r, o) => Object.keys(o).reduce(
|
|
4097
|
-
(
|
|
4098
|
-
...
|
|
4099
|
-
[
|
|
4111
|
+
(d, A) => ({
|
|
4112
|
+
...d,
|
|
4113
|
+
[A]: A in r && typeof r[A] == "object" && r[A] !== null && typeof o[A] == "object" && o[A] !== null ? Ka([r[A], o[A]]) : o[A]
|
|
4100
4114
|
}),
|
|
4101
4115
|
r
|
|
4102
4116
|
),
|
|
4103
4117
|
{}
|
|
4104
4118
|
);
|
|
4105
4119
|
}
|
|
4106
|
-
function Ja(
|
|
4107
|
-
return `${(
|
|
4120
|
+
function Ja(l, r = "font-bold") {
|
|
4121
|
+
return `${(l == null ? void 0 : l.title.length) > 0 ? `<div class="${r}">${l.title}</div>` : ""}${l != null && l.content ? l.content.replace(/\n\n/g, `
|
|
4108
4122
|
`).replace(/\n/g, "<br/>") : ""}`;
|
|
4109
4123
|
}
|
|
4110
|
-
function Ba(
|
|
4111
|
-
for (;
|
|
4112
|
-
|
|
4113
|
-
return
|
|
4124
|
+
function Ba(l, r) {
|
|
4125
|
+
for (; l.length < r; )
|
|
4126
|
+
l = `0${l}`;
|
|
4127
|
+
return l;
|
|
4114
4128
|
}
|
|
4115
|
-
function Oe(
|
|
4116
|
-
let o,
|
|
4129
|
+
function Oe(l, r) {
|
|
4130
|
+
let o, d, A;
|
|
4117
4131
|
if (r.length === 0)
|
|
4118
|
-
return
|
|
4119
|
-
for (o = 0,
|
|
4120
|
-
|
|
4121
|
-
return
|
|
4132
|
+
return l;
|
|
4133
|
+
for (o = 0, A = r.length; o < A; o++)
|
|
4134
|
+
d = r.charCodeAt(o), l = (l << 5) - l + d, l |= 0;
|
|
4135
|
+
return l < 0 ? l * -2 : l;
|
|
4122
4136
|
}
|
|
4123
|
-
function La(
|
|
4124
|
-
return Object.keys(r).sort().reduce(
|
|
4125
|
-
function
|
|
4126
|
-
return $r(
|
|
4137
|
+
function La(l, r, o) {
|
|
4138
|
+
return Object.keys(r).sort().reduce(d, l);
|
|
4139
|
+
function d(A, D) {
|
|
4140
|
+
return $r(A, r[D], D, o);
|
|
4127
4141
|
}
|
|
4128
4142
|
}
|
|
4129
|
-
function $r(
|
|
4130
|
-
const
|
|
4143
|
+
function $r(l, r, o, d) {
|
|
4144
|
+
const A = Oe(Oe(Oe(l, o), Ga(r)), typeof r);
|
|
4131
4145
|
if (r === null)
|
|
4132
|
-
return Oe(
|
|
4146
|
+
return Oe(A, "null");
|
|
4133
4147
|
if (r === void 0)
|
|
4134
|
-
return Oe(
|
|
4148
|
+
return Oe(A, "undefined");
|
|
4135
4149
|
if (typeof r == "object" || typeof r == "function") {
|
|
4136
|
-
if (
|
|
4137
|
-
return Oe(
|
|
4138
|
-
|
|
4139
|
-
const D = La(
|
|
4150
|
+
if (d.includes(r))
|
|
4151
|
+
return Oe(A, `[Circular]${o}`);
|
|
4152
|
+
d.push(r);
|
|
4153
|
+
const D = La(A, r, d);
|
|
4140
4154
|
if (!("valueOf" in r) || typeof r.valueOf != "function")
|
|
4141
4155
|
return D;
|
|
4142
4156
|
try {
|
|
@@ -4145,17 +4159,17 @@ function $r(d, r, o, l) {
|
|
|
4145
4159
|
return Oe(D, `[valueOf exception]${K.stack || K.message}`);
|
|
4146
4160
|
}
|
|
4147
4161
|
}
|
|
4148
|
-
return Oe(
|
|
4162
|
+
return Oe(A, r.toString());
|
|
4149
4163
|
}
|
|
4150
|
-
function Ga(
|
|
4151
|
-
return Object.prototype.toString.call(
|
|
4164
|
+
function Ga(l) {
|
|
4165
|
+
return Object.prototype.toString.call(l);
|
|
4152
4166
|
}
|
|
4153
|
-
function Fn(
|
|
4154
|
-
return Ba($r(0,
|
|
4167
|
+
function Fn(l) {
|
|
4168
|
+
return Ba($r(0, l, "", []).toString(16), 8);
|
|
4155
4169
|
}
|
|
4156
|
-
function Va(
|
|
4157
|
-
if (
|
|
4158
|
-
return
|
|
4170
|
+
function Va(l, r) {
|
|
4171
|
+
if (l = l.toString().replace(/[^0-9.]/g, ""), l < 1e3)
|
|
4172
|
+
return l;
|
|
4159
4173
|
const o = [
|
|
4160
4174
|
{ v: 1e3, s: "K" },
|
|
4161
4175
|
{ v: 1e6, s: "M" },
|
|
@@ -4164,12 +4178,12 @@ function Va(d, r) {
|
|
|
4164
4178
|
{ v: 1e15, s: "P" },
|
|
4165
4179
|
{ v: 1e18, s: "E" }
|
|
4166
4180
|
];
|
|
4167
|
-
let
|
|
4168
|
-
for (
|
|
4181
|
+
let d;
|
|
4182
|
+
for (d = o.length - 1; d > 0 && !(l >= o[d].v); d--)
|
|
4169
4183
|
;
|
|
4170
|
-
return (
|
|
4184
|
+
return (l / o[d].v).toFixed(r).replace(/\.0+$|(\.\d*[1-9])0+$/, "$1") + o[d].s;
|
|
4171
4185
|
}
|
|
4172
|
-
function Za(
|
|
4186
|
+
function Za(l, r) {
|
|
4173
4187
|
const o = [
|
|
4174
4188
|
{ value: 1, symbol: "" },
|
|
4175
4189
|
{ value: 1e3, symbol: "K" },
|
|
@@ -4178,14 +4192,14 @@ function Za(d, r) {
|
|
|
4178
4192
|
{ value: 1e12, symbol: "T" },
|
|
4179
4193
|
{ value: 1e15, symbol: "P" },
|
|
4180
4194
|
{ value: 1e18, symbol: "E" }
|
|
4181
|
-
],
|
|
4182
|
-
let
|
|
4183
|
-
for (
|
|
4195
|
+
], d = /\.0+$|(\.\d*[1-9])0+$/;
|
|
4196
|
+
let A;
|
|
4197
|
+
for (A = o.length - 1; A > 0 && !(l >= o[A].value); A--)
|
|
4184
4198
|
;
|
|
4185
|
-
return (
|
|
4199
|
+
return (l / o[A].value).toFixed(r).replace(d, "$1") + o[A].symbol;
|
|
4186
4200
|
}
|
|
4187
|
-
function qa(
|
|
4188
|
-
switch (
|
|
4201
|
+
function qa(l) {
|
|
4202
|
+
switch (l.language) {
|
|
4189
4203
|
case "ar":
|
|
4190
4204
|
return {
|
|
4191
4205
|
direction: "rtl",
|
|
@@ -4195,44 +4209,44 @@ function qa(d) {
|
|
|
4195
4209
|
return {};
|
|
4196
4210
|
}
|
|
4197
4211
|
}
|
|
4198
|
-
function ei(
|
|
4212
|
+
function ei(l) {
|
|
4199
4213
|
const r = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
4200
|
-
return
|
|
4201
|
-
var
|
|
4202
|
-
if (r ? o.content = "License suspended, please contact your Sales Representative to restore service" : o.content = ((
|
|
4214
|
+
return l.forEach((o) => {
|
|
4215
|
+
var d, A, D, K, U;
|
|
4216
|
+
if (r ? o.content = "License suspended, please contact your Sales Representative to restore service" : o.content = ((d = o.content) == null ? void 0 : d.replace(/(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)((\?.*)?)/g, "")) || "", o.sender !== null ? ((((A = o.sender) == null ? void 0 : A.title) === "Unknown author" || ((D = o.sender) == null ? void 0 : D.title) === null) && (o.sender.title = ""), ((K = o.sender) == null ? void 0 : K.name) !== "" && o.sender.title === "" && (o.sender.title = o.sender.name), ((U = o.sender) == null ? void 0 : U.name) !== "" && o.channel === "tw" && (o.sender.name = `@${o.sender.name}`)) : o.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, o.sender.title === "" && o.link !== "") {
|
|
4203
4217
|
const M = new URL(o.link);
|
|
4204
4218
|
o.sender.title = M.hostname.replace("www.", "");
|
|
4205
4219
|
}
|
|
4206
|
-
}),
|
|
4220
|
+
}), l;
|
|
4207
4221
|
}
|
|
4208
|
-
function ti(
|
|
4209
|
-
|
|
4222
|
+
function ti(l, r, o, d) {
|
|
4223
|
+
l.stopPropagation(), r.showModal({
|
|
4210
4224
|
showComponent: "card-modal",
|
|
4211
|
-
props: { data: o, options:
|
|
4225
|
+
props: { data: o, options: d }
|
|
4212
4226
|
});
|
|
4213
4227
|
}
|
|
4214
|
-
function ni(
|
|
4215
|
-
const r = [...
|
|
4228
|
+
function ni(l) {
|
|
4229
|
+
const r = [...l];
|
|
4216
4230
|
for (let o = r.length - 1; o > 0; o--) {
|
|
4217
|
-
const
|
|
4218
|
-
[r[o], r[
|
|
4231
|
+
const d = Math.floor(Math.random() * (o + 1));
|
|
4232
|
+
[r[o], r[d]] = [r[d], r[o]];
|
|
4219
4233
|
}
|
|
4220
4234
|
return r;
|
|
4221
4235
|
}
|
|
4222
4236
|
function ri() {
|
|
4223
|
-
let
|
|
4237
|
+
let l = "";
|
|
4224
4238
|
const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
4225
|
-
for (let o = 0; o < 7; o++)
|
|
4226
|
-
return
|
|
4239
|
+
for (let o = 0; o < 7; o++) l += r.charAt(Math.floor(Math.random() * r.length));
|
|
4240
|
+
return l;
|
|
4227
4241
|
}
|
|
4228
|
-
function ai(
|
|
4229
|
-
return
|
|
4242
|
+
function ai(l) {
|
|
4243
|
+
return l[Math.floor(Math.random() * l.length)];
|
|
4230
4244
|
}
|
|
4231
|
-
const ii = (
|
|
4245
|
+
const ii = (l) => {
|
|
4232
4246
|
switch (!0) {
|
|
4233
|
-
case
|
|
4247
|
+
case l < 0:
|
|
4234
4248
|
return "text-down text-xs";
|
|
4235
|
-
case
|
|
4249
|
+
case l > 0:
|
|
4236
4250
|
return "text-up text-xs";
|
|
4237
4251
|
default:
|
|
4238
4252
|
return "text-white text-xs";
|
|
@@ -4250,11 +4264,11 @@ class si {
|
|
|
4250
4264
|
const o = await this.sm.getSubscribers();
|
|
4251
4265
|
if (o.length === 0)
|
|
4252
4266
|
return;
|
|
4253
|
-
const
|
|
4254
|
-
r ?
|
|
4255
|
-
|
|
4256
|
-
}), await Promise.allSettled(
|
|
4257
|
-
(
|
|
4267
|
+
const d = [];
|
|
4268
|
+
r ? d.push(this.api.get(r)) : o == null || o.forEach((A) => {
|
|
4269
|
+
d.push(this.api.get(A));
|
|
4270
|
+
}), await Promise.allSettled(d).then(
|
|
4271
|
+
(A) => A.forEach(async (D) => {
|
|
4258
4272
|
let K, U = 400;
|
|
4259
4273
|
if (D.status === "fulfilled") {
|
|
4260
4274
|
let M = D.value;
|
|
@@ -4272,17 +4286,17 @@ class si {
|
|
|
4272
4286
|
), M.data.messages = ee, se = Fn(M.data.messages), X.hash === se)
|
|
4273
4287
|
return console.info(
|
|
4274
4288
|
"%capi%c %cno updates",
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4289
|
+
g.API,
|
|
4290
|
+
g.NONE,
|
|
4291
|
+
g.NO_UPDATES,
|
|
4278
4292
|
N.MESSAGES,
|
|
4279
4293
|
M.query.slide,
|
|
4280
4294
|
M.query.widget
|
|
4281
4295
|
), console.debug(
|
|
4282
4296
|
"%capi%c %cno updates",
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4297
|
+
g.API,
|
|
4298
|
+
g.NONE,
|
|
4299
|
+
g.NO_UPDATES,
|
|
4286
4300
|
N.MESSAGES,
|
|
4287
4301
|
M
|
|
4288
4302
|
), 204;
|
|
@@ -4291,17 +4305,17 @@ class si {
|
|
|
4291
4305
|
case N.CLOUD:
|
|
4292
4306
|
se = Fn(M.data), X.hash === se ? (console.info(
|
|
4293
4307
|
"%capi%c %cno updates",
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4308
|
+
g.API,
|
|
4309
|
+
g.NONE,
|
|
4310
|
+
g.NO_UPDATES,
|
|
4297
4311
|
N.CLOUD,
|
|
4298
4312
|
M.query.slide,
|
|
4299
4313
|
M.query.widget
|
|
4300
4314
|
), console.debug(
|
|
4301
4315
|
"%capi%c %cno updates",
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4316
|
+
g.API,
|
|
4317
|
+
g.NONE,
|
|
4318
|
+
g.NO_UPDATES,
|
|
4305
4319
|
N.CLOUD,
|
|
4306
4320
|
M
|
|
4307
4321
|
), U = 204) : (X.hash = se, K = {
|
|
@@ -4322,17 +4336,17 @@ class si {
|
|
|
4322
4336
|
case N.SERIES:
|
|
4323
4337
|
se = Fn(M.data), X.hash === se ? (console.info(
|
|
4324
4338
|
"%capi%c %cno updates",
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4339
|
+
g.API,
|
|
4340
|
+
g.NONE,
|
|
4341
|
+
g.NO_UPDATES,
|
|
4328
4342
|
N.SERIES,
|
|
4329
4343
|
M.query.slide,
|
|
4330
4344
|
M.query.widget
|
|
4331
4345
|
), console.debug(
|
|
4332
4346
|
"%capi%c %cno updates",
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4347
|
+
g.API,
|
|
4348
|
+
g.NONE,
|
|
4349
|
+
g.NO_UPDATES,
|
|
4336
4350
|
N.SERIES,
|
|
4337
4351
|
M
|
|
4338
4352
|
), U = 204) : (X.hash = se, K = {
|
|
@@ -4353,9 +4367,9 @@ class si {
|
|
|
4353
4367
|
default:
|
|
4354
4368
|
console.warn(
|
|
4355
4369
|
"%capi%c %cstorage",
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4370
|
+
g.API,
|
|
4371
|
+
g.NONE,
|
|
4372
|
+
g.STORAGE,
|
|
4359
4373
|
"error",
|
|
4360
4374
|
`data type ${M.query.type} unknown`
|
|
4361
4375
|
);
|
|
@@ -4366,16 +4380,16 @@ class si {
|
|
|
4366
4380
|
case 201:
|
|
4367
4381
|
console.info(
|
|
4368
4382
|
"%capp%c %cbroadcast",
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4383
|
+
g.API,
|
|
4384
|
+
g.NONE,
|
|
4385
|
+
g.BROADCAST,
|
|
4372
4386
|
M.query.slide,
|
|
4373
4387
|
M.data.title ?? M.query.widget
|
|
4374
4388
|
), console.debug(
|
|
4375
4389
|
"%capp%c %cbroadcast",
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4390
|
+
g.API,
|
|
4391
|
+
g.NONE,
|
|
4392
|
+
g.BROADCAST,
|
|
4379
4393
|
M
|
|
4380
4394
|
);
|
|
4381
4395
|
const X = structuredClone(K.query);
|
|
@@ -4392,9 +4406,9 @@ class si {
|
|
|
4392
4406
|
default:
|
|
4393
4407
|
console.warn(
|
|
4394
4408
|
"%capp%c %cbroadcast",
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4409
|
+
g.API,
|
|
4410
|
+
g.NONE,
|
|
4411
|
+
g.BROADCAST,
|
|
4398
4412
|
"Unhandled data type",
|
|
4399
4413
|
M.query
|
|
4400
4414
|
);
|
|
@@ -4409,9 +4423,9 @@ class si {
|
|
|
4409
4423
|
default:
|
|
4410
4424
|
console.warn(
|
|
4411
4425
|
"%capp%c %cbroadcast",
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4426
|
+
g.API,
|
|
4427
|
+
g.NONE,
|
|
4428
|
+
g.BROADCAST,
|
|
4415
4429
|
"Fetch error",
|
|
4416
4430
|
M.query.slide,
|
|
4417
4431
|
M.data.title ?? M.query.widget
|
|
@@ -4422,9 +4436,9 @@ class si {
|
|
|
4422
4436
|
} else
|
|
4423
4437
|
return console.warn(
|
|
4424
4438
|
"%capi%c %cstorage",
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4439
|
+
g.API,
|
|
4440
|
+
g.NONE,
|
|
4441
|
+
g.STORAGE,
|
|
4428
4442
|
re.ERROR,
|
|
4429
4443
|
D.status
|
|
4430
4444
|
), 400;
|
|
@@ -4443,9 +4457,9 @@ class si {
|
|
|
4443
4457
|
case re.UPDATE:
|
|
4444
4458
|
console.debug(
|
|
4445
4459
|
"%capi%c %cstorage",
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4460
|
+
g.API,
|
|
4461
|
+
g.NONE,
|
|
4462
|
+
g.STORAGE,
|
|
4449
4463
|
re.UPDATE,
|
|
4450
4464
|
r.data
|
|
4451
4465
|
), await this.update();
|
|
@@ -4453,36 +4467,36 @@ class si {
|
|
|
4453
4467
|
}
|
|
4454
4468
|
});
|
|
4455
4469
|
k(this, "cleanMessages", async () => {
|
|
4456
|
-
var
|
|
4457
|
-
if ((
|
|
4470
|
+
var d, A, D;
|
|
4471
|
+
if ((d = this.options) != null && d.suspended) {
|
|
4458
4472
|
console.info(
|
|
4459
4473
|
"%cstorage%c %cstorage",
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4474
|
+
g.STORAGE,
|
|
4475
|
+
g.NONE,
|
|
4476
|
+
g.MESSAGES,
|
|
4463
4477
|
"Account suspended"
|
|
4464
4478
|
);
|
|
4465
4479
|
return;
|
|
4466
4480
|
}
|
|
4467
|
-
const r = ((
|
|
4481
|
+
const r = ((A = this.options) == null ? void 0 : A.retention) || 86400 * 4, o = await ((D = this.sm) == null ? void 0 : D.cleanMessages(
|
|
4468
4482
|
r
|
|
4469
4483
|
));
|
|
4470
4484
|
console.info(
|
|
4471
4485
|
"%cstorage%c %cstorage",
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4486
|
+
g.STORAGE,
|
|
4487
|
+
g.NONE,
|
|
4488
|
+
g.MESSAGES,
|
|
4475
4489
|
`${o} messages deleted`
|
|
4476
4490
|
);
|
|
4477
4491
|
});
|
|
4478
4492
|
k(this, "hideMessage", async (r) => {
|
|
4479
|
-
var
|
|
4480
|
-
const o = await ((
|
|
4493
|
+
var d;
|
|
4494
|
+
const o = await ((d = this.sm) == null ? void 0 : d.hideMessage(r.id, 0));
|
|
4481
4495
|
return console.info(
|
|
4482
4496
|
"%cstorage%c %cstorage",
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4497
|
+
g.STORAGE,
|
|
4498
|
+
g.NONE,
|
|
4499
|
+
g.HIDE,
|
|
4486
4500
|
`${o} messages hidden`
|
|
4487
4501
|
), await this.api.hideMessage(r);
|
|
4488
4502
|
});
|
|
@@ -4494,15 +4508,15 @@ class si {
|
|
|
4494
4508
|
k(this, "loadSlide", async (r) => await this.api.loadSlide(r));
|
|
4495
4509
|
k(this, "storeSlide", async (r) => {
|
|
4496
4510
|
var o;
|
|
4497
|
-
return await ((o = this.sm) == null ? void 0 : o.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((
|
|
4498
|
-
|
|
4511
|
+
return await ((o = this.sm) == null ? void 0 : o.storeSlide(r).then(async () => r != null && r.update && r.update ? await this.api.storeSlide(r) : new Promise((d, A) => {
|
|
4512
|
+
d(201);
|
|
4499
4513
|
})));
|
|
4500
4514
|
});
|
|
4501
4515
|
console.info(
|
|
4502
4516
|
"%cstorage%c %cslide",
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4517
|
+
g.STORAGE,
|
|
4518
|
+
g.NONE,
|
|
4519
|
+
g.SLIDE,
|
|
4506
4520
|
r.slide,
|
|
4507
4521
|
re.VERSION,
|
|
4508
4522
|
ka
|
|
@@ -4510,13 +4524,13 @@ class si {
|
|
|
4510
4524
|
const o = (r == null ? void 0 : r.slide) || r.app;
|
|
4511
4525
|
switch (this.bc = new BroadcastChannel(o), console.info(
|
|
4512
4526
|
"%capi%c %cbroadcast",
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4527
|
+
g.API,
|
|
4528
|
+
g.NONE,
|
|
4529
|
+
g.BROADCAST,
|
|
4516
4530
|
re.CHANNEL,
|
|
4517
4531
|
o
|
|
4518
|
-
), this.bc.onmessage = (
|
|
4519
|
-
this.actions(
|
|
4532
|
+
), this.bc.onmessage = (d) => {
|
|
4533
|
+
this.actions(d);
|
|
4520
4534
|
}, this.bc.postMessage({ event: re.STORAGE_INIT, data: {} }), this.api = new Da(r), r.storage) {
|
|
4521
4535
|
case ye.DEXIE:
|
|
4522
4536
|
this.sm = new jr(r);
|
|
@@ -4548,9 +4562,9 @@ class $a {
|
|
|
4548
4562
|
var o;
|
|
4549
4563
|
return r.type !== N.CLOUD ? (console.warn(
|
|
4550
4564
|
"%capp%c %get",
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4565
|
+
g.APP,
|
|
4566
|
+
g.NONE,
|
|
4567
|
+
g.GET_DATA,
|
|
4554
4568
|
r.widget,
|
|
4555
4569
|
"wrong method call for getMessages, type used is",
|
|
4556
4570
|
r.type
|
|
@@ -4569,9 +4583,9 @@ class $a {
|
|
|
4569
4583
|
var o;
|
|
4570
4584
|
return r.type !== N.MESSAGES ? (console.warn(
|
|
4571
4585
|
"%capp%c %get",
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4586
|
+
g.APP,
|
|
4587
|
+
g.NONE,
|
|
4588
|
+
g.GET_DATA,
|
|
4575
4589
|
r.widget,
|
|
4576
4590
|
"wrong method call for getMessages, type used is",
|
|
4577
4591
|
r.type
|
|
@@ -4590,9 +4604,9 @@ class $a {
|
|
|
4590
4604
|
var o;
|
|
4591
4605
|
return r.type !== N.SERIES ? (console.warn(
|
|
4592
4606
|
"%capp%c %get",
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4607
|
+
g.APP,
|
|
4608
|
+
g.NONE,
|
|
4609
|
+
g.GET_DATA,
|
|
4596
4610
|
r.widget,
|
|
4597
4611
|
"wrong method call for getMessages, type used is",
|
|
4598
4612
|
r.type
|
|
@@ -4629,7 +4643,7 @@ class oi {
|
|
|
4629
4643
|
* @param callbacks functions in the widget that will receive the update
|
|
4630
4644
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4631
4645
|
*/
|
|
4632
|
-
constructor(r, o,
|
|
4646
|
+
constructor(r, o, d) {
|
|
4633
4647
|
k(this, "storageReader");
|
|
4634
4648
|
k(this, "broadcastChannel");
|
|
4635
4649
|
k(this, "element");
|
|
@@ -4662,9 +4676,9 @@ class oi {
|
|
|
4662
4676
|
*/
|
|
4663
4677
|
k(this, "getCloud", async () => this.query.type !== N.CLOUD ? (console.warn(
|
|
4664
4678
|
"%cstorage%c %cwidget",
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4679
|
+
g.STORAGE,
|
|
4680
|
+
g.NONE,
|
|
4681
|
+
g.WIDGET,
|
|
4668
4682
|
this.query.widget,
|
|
4669
4683
|
"Wrong method call for getCloud, expected type is",
|
|
4670
4684
|
this.query.type
|
|
@@ -4680,9 +4694,9 @@ class oi {
|
|
|
4680
4694
|
*/
|
|
4681
4695
|
k(this, "getMessages", async () => this.query.type !== N.MESSAGES ? (console.warn(
|
|
4682
4696
|
"%cstorage%c %cwidget",
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4697
|
+
g.STORAGE,
|
|
4698
|
+
g.NONE,
|
|
4699
|
+
g.WIDGET,
|
|
4686
4700
|
this.query.widget,
|
|
4687
4701
|
"Wrong method call for getMessages, expected type is",
|
|
4688
4702
|
this.query.type
|
|
@@ -4692,9 +4706,9 @@ class oi {
|
|
|
4692
4706
|
success: !1
|
|
4693
4707
|
}) : (console.debug(
|
|
4694
4708
|
"%cstorage%c %cwidget",
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4709
|
+
g.API,
|
|
4710
|
+
g.NONE,
|
|
4711
|
+
g.MESSAGES,
|
|
4698
4712
|
this.query
|
|
4699
4713
|
), await this.storageReader.getMessages(this.query)));
|
|
4700
4714
|
/**
|
|
@@ -4704,9 +4718,9 @@ class oi {
|
|
|
4704
4718
|
*/
|
|
4705
4719
|
k(this, "getSeries", async () => this.query.type !== N.SERIES ? (console.warn(
|
|
4706
4720
|
"%cstorage%c %cwidget",
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4721
|
+
g.STORAGE,
|
|
4722
|
+
g.NONE,
|
|
4723
|
+
g.WIDGET,
|
|
4710
4724
|
this.query.widget,
|
|
4711
4725
|
"Wrong method call for getSeries, expected type is",
|
|
4712
4726
|
this.query.type
|
|
@@ -4724,7 +4738,7 @@ class oi {
|
|
|
4724
4738
|
k(this, "showModal", (r) => {
|
|
4725
4739
|
console.debug(
|
|
4726
4740
|
"%cwidget",
|
|
4727
|
-
|
|
4741
|
+
g.WIDGET,
|
|
4728
4742
|
re.SHOW_MODAL,
|
|
4729
4743
|
r.showComponent,
|
|
4730
4744
|
// @ts-ignore
|
|
@@ -4745,11 +4759,11 @@ class oi {
|
|
|
4745
4759
|
window.dispatchEvent(o);
|
|
4746
4760
|
});
|
|
4747
4761
|
var K;
|
|
4748
|
-
this.element = r, this.listeners = o,
|
|
4749
|
-
let
|
|
4750
|
-
|
|
4762
|
+
this.element = r, this.listeners = o, d = typeof d < "u" ? d : "buzzcasting-slide";
|
|
4763
|
+
let A;
|
|
4764
|
+
A = { ...r.dataset }, delete A.hmr, A.slide = ((K = r.closest(d.toUpperCase())) == null ? void 0 : K.id) ?? `${d} not found`, A = Mr(A), this.query = A, Na(r);
|
|
4751
4765
|
const D = window.BuzzCasting.getOptions();
|
|
4752
|
-
this.storageReader = new $a(D), this.broadcastChannel = new BroadcastChannel(
|
|
4766
|
+
this.storageReader = new $a(D), this.broadcastChannel = new BroadcastChannel(A.slide), this.startListener();
|
|
4753
4767
|
}
|
|
4754
4768
|
addListener(r) {
|
|
4755
4769
|
this.listeners.push(r);
|
|
@@ -4760,11 +4774,11 @@ class oi {
|
|
|
4760
4774
|
startListener() {
|
|
4761
4775
|
const r = this.query;
|
|
4762
4776
|
this.broadcastChannel.onmessage = async (o) => {
|
|
4763
|
-
const
|
|
4777
|
+
const d = o.data.data;
|
|
4764
4778
|
switch (o.data.event) {
|
|
4765
4779
|
case re.WIDGET_UPDATE:
|
|
4766
|
-
|
|
4767
|
-
|
|
4780
|
+
d.query.slide === r.slide && d.query.widget === r.widget && this.listeners.forEach((A) => {
|
|
4781
|
+
A(o.data);
|
|
4768
4782
|
});
|
|
4769
4783
|
break;
|
|
4770
4784
|
case re.SLIDE_READY:
|
|
@@ -4780,16 +4794,16 @@ class oi {
|
|
|
4780
4794
|
subscribe() {
|
|
4781
4795
|
console.info(
|
|
4782
4796
|
"%cwidget%c %csubscribe",
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4797
|
+
g.WIDGET,
|
|
4798
|
+
g.NONE,
|
|
4799
|
+
g.SUBSCRIBE,
|
|
4786
4800
|
this.query.slide,
|
|
4787
4801
|
this.query.widget
|
|
4788
4802
|
), console.debug(
|
|
4789
4803
|
"%cwidget%c %csubscribe",
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4804
|
+
g.WIDGET,
|
|
4805
|
+
g.NONE,
|
|
4806
|
+
g.SUBSCRIBE,
|
|
4793
4807
|
this.query
|
|
4794
4808
|
), this.broadcastChannel.postMessage({
|
|
4795
4809
|
event: re.SUBSCRIBE,
|
|
@@ -4804,7 +4818,7 @@ export {
|
|
|
4804
4818
|
N as API,
|
|
4805
4819
|
si as BuzzcastingStorageManager,
|
|
4806
4820
|
$a as BuzzcastingStorageReader,
|
|
4807
|
-
|
|
4821
|
+
g as CSS,
|
|
4808
4822
|
re as EVENTS,
|
|
4809
4823
|
Zt as MODERATION,
|
|
4810
4824
|
ye as STORAGE,
|