buzzcasting-storage 2.0.4 → 2.0.5
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 +6 -0
- package/dist/buzzcasting-storage.esm.js +1007 -1003
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var A = (M, s, v) => (
|
|
4
|
-
|
|
1
|
+
var yi = Object.defineProperty;
|
|
2
|
+
var mi = (M, s, v) => s in M ? yi(M, s, { enumerable: !0, configurable: !0, writable: !0, value: v }) : M[s] = v;
|
|
3
|
+
var A = (M, s, v) => (mi(M, typeof s != "symbol" ? s + "" : s, v), v);
|
|
4
|
+
const Ne = "messages", Cr = "cloud", Fn = "series", gi = "topics", vi = "keyval", bi = "local", wi = "session", _i = "dexie", ki = "window", pt = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", Bn = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", yt = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;";
|
|
5
|
+
class xi {
|
|
5
6
|
constructor(s) {
|
|
6
7
|
A(this, "options");
|
|
7
8
|
A(this, "url");
|
|
@@ -40,7 +41,7 @@ class pi {
|
|
|
40
41
|
const F = Object.keys(j).length > 0 ? `?${new URLSearchParams(j).toString()}` : "";
|
|
41
42
|
return console.debug(
|
|
42
43
|
"%capi",
|
|
43
|
-
|
|
44
|
+
yt,
|
|
44
45
|
"call",
|
|
45
46
|
s
|
|
46
47
|
), await fetch(
|
|
@@ -56,7 +57,7 @@ class pi {
|
|
|
56
57
|
const { app: v, version: _ } = this.options, j = this.auth(), F = "?action=visible";
|
|
57
58
|
return console.info(
|
|
58
59
|
"%capi",
|
|
59
|
-
|
|
60
|
+
yt,
|
|
60
61
|
"hide",
|
|
61
62
|
[v, "api", _, s.type, s.id].join("/") + F,
|
|
62
63
|
{ ...j, method: "put" }
|
|
@@ -70,15 +71,15 @@ class pi {
|
|
|
70
71
|
}).then((T) => T.json()).catch((T) => ({ succes: !1, message: T, data: [] }));
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
|
-
var
|
|
74
|
-
function
|
|
74
|
+
var Pr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
75
|
+
function Oi(M) {
|
|
75
76
|
return M && M.__esModule && Object.prototype.hasOwnProperty.call(M, "default") ? M.default : M;
|
|
76
77
|
}
|
|
77
|
-
var
|
|
78
|
+
var Kr = { exports: {} };
|
|
78
79
|
(function(M, s) {
|
|
79
80
|
(function(v, _) {
|
|
80
81
|
M.exports = _();
|
|
81
|
-
})(
|
|
82
|
+
})(Pr, function() {
|
|
82
83
|
var v = function(e, t) {
|
|
83
84
|
return (v = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
84
85
|
n.__proto__ = r;
|
|
@@ -100,43 +101,43 @@ var Er = { exports: {} };
|
|
|
100
101
|
!r && i in t || ((r = r || Array.prototype.slice.call(t, 0, i))[i] = t[i]);
|
|
101
102
|
return e.concat(r || Array.prototype.slice.call(t));
|
|
102
103
|
}
|
|
103
|
-
var F = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window :
|
|
104
|
+
var F = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Pr, T = Object.keys, W = Array.isArray;
|
|
104
105
|
function q(e, t) {
|
|
105
106
|
return typeof t != "object" || T(t).forEach(function(n) {
|
|
106
107
|
e[n] = t[n];
|
|
107
108
|
}), e;
|
|
108
109
|
}
|
|
109
110
|
typeof Promise > "u" || F.Promise || (F.Promise = Promise);
|
|
110
|
-
var oe = Object.getPrototypeOf,
|
|
111
|
+
var oe = Object.getPrototypeOf, X = {}.hasOwnProperty;
|
|
111
112
|
function ne(e, t) {
|
|
112
|
-
return
|
|
113
|
+
return X.call(e, t);
|
|
113
114
|
}
|
|
114
115
|
function ze(e, t) {
|
|
115
116
|
typeof t == "function" && (t = t(oe(e))), (typeof Reflect > "u" ? T : Reflect.ownKeys)(t).forEach(function(n) {
|
|
116
117
|
we(e, n, t[n]);
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
|
-
var
|
|
120
|
+
var Un = Object.defineProperty;
|
|
120
121
|
function we(e, t, n, r) {
|
|
121
|
-
|
|
122
|
+
Un(e, t, q(n && ne(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
|
|
122
123
|
}
|
|
123
124
|
function Le(e) {
|
|
124
125
|
return { from: function(t) {
|
|
125
126
|
return e.prototype = Object.create(t.prototype), we(e.prototype, "constructor", e), { extend: ze.bind(null, e.prototype) };
|
|
126
127
|
} };
|
|
127
128
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
130
|
-
return
|
|
129
|
+
var Dr = Object.getOwnPropertyDescriptor, Tr = [].slice;
|
|
130
|
+
function gt(e, t, n) {
|
|
131
|
+
return Tr.call(e, t, n);
|
|
131
132
|
}
|
|
132
|
-
function
|
|
133
|
+
function Wn(e, t) {
|
|
133
134
|
return t(e);
|
|
134
135
|
}
|
|
135
136
|
function Ze(e) {
|
|
136
137
|
if (!e)
|
|
137
138
|
throw new Error("Assertion Failed");
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
+
function $n(e) {
|
|
140
141
|
F.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
141
142
|
}
|
|
142
143
|
function ye(e, t) {
|
|
@@ -168,23 +169,23 @@ var Er = { exports: {} };
|
|
|
168
169
|
u !== -1 ? (o = t.substr(0, u), (a = t.substr(u + 1)) === "" ? n === void 0 ? W(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n : ce(u = !(u = e[o]) || !ne(e, o) ? e[o] = {} : u, a, n)) : n === void 0 ? W(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
+
function Vn(e) {
|
|
172
173
|
var t, n = {};
|
|
173
174
|
for (t in e)
|
|
174
175
|
ne(e, t) && (n[t] = e[t]);
|
|
175
176
|
return n;
|
|
176
177
|
}
|
|
177
|
-
var
|
|
178
|
-
function
|
|
179
|
-
return
|
|
178
|
+
var Br = [].concat;
|
|
179
|
+
function Gn(e) {
|
|
180
|
+
return Br.apply([], e);
|
|
180
181
|
}
|
|
181
|
-
var
|
|
182
|
+
var he = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Gn([8, 16, 32, 64].map(function(e) {
|
|
182
183
|
return ["Int", "Uint", "Float"].map(function(t) {
|
|
183
184
|
return t + e + "Array";
|
|
184
185
|
});
|
|
185
186
|
}))).filter(function(e) {
|
|
186
187
|
return F[e];
|
|
187
|
-
}),
|
|
188
|
+
}), Yn = new Set(he.map(function(e) {
|
|
188
189
|
return F[e];
|
|
189
190
|
})), qe = null;
|
|
190
191
|
function _e(e) {
|
|
@@ -198,7 +199,7 @@ var Er = { exports: {} };
|
|
|
198
199
|
r = [], qe.set(n, r);
|
|
199
200
|
for (var i = 0, o = n.length; i < o; ++i)
|
|
200
201
|
r.push(t(n[i]));
|
|
201
|
-
} else if (
|
|
202
|
+
} else if (Yn.has(n.constructor))
|
|
202
203
|
r = n;
|
|
203
204
|
else {
|
|
204
205
|
var a, u = oe(n);
|
|
@@ -208,13 +209,13 @@ var Er = { exports: {} };
|
|
|
208
209
|
return r;
|
|
209
210
|
}(e), qe = null, e;
|
|
210
211
|
}
|
|
211
|
-
var
|
|
212
|
-
function
|
|
213
|
-
return
|
|
212
|
+
var Ir = {}.toString;
|
|
213
|
+
function Gt(e) {
|
|
214
|
+
return Ir.call(e).slice(8, -1);
|
|
214
215
|
}
|
|
215
|
-
var
|
|
216
|
+
var Yt = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", Rr = typeof Yt == "symbol" ? function(e) {
|
|
216
217
|
var t;
|
|
217
|
-
return e != null && (t = e[
|
|
218
|
+
return e != null && (t = e[Yt]) && t.apply(e);
|
|
218
219
|
} : function() {
|
|
219
220
|
return null;
|
|
220
221
|
};
|
|
@@ -222,14 +223,14 @@ var Er = { exports: {} };
|
|
|
222
223
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
223
224
|
}
|
|
224
225
|
var Ue = {};
|
|
225
|
-
function
|
|
226
|
+
function me(e) {
|
|
226
227
|
var t, n, r, i;
|
|
227
228
|
if (arguments.length === 1) {
|
|
228
229
|
if (W(e))
|
|
229
230
|
return e.slice();
|
|
230
231
|
if (this === Ue && typeof e == "string")
|
|
231
232
|
return [e];
|
|
232
|
-
if (i =
|
|
233
|
+
if (i = Rr(e)) {
|
|
233
234
|
for (n = []; !(r = i.next()).done; )
|
|
234
235
|
n.push(r.value);
|
|
235
236
|
return n;
|
|
@@ -246,15 +247,15 @@ var Er = { exports: {} };
|
|
|
246
247
|
n[t] = arguments[t];
|
|
247
248
|
return n;
|
|
248
249
|
}
|
|
249
|
-
var
|
|
250
|
+
var Ht = typeof Symbol < "u" ? function(e) {
|
|
250
251
|
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
251
252
|
} : function() {
|
|
252
253
|
return !1;
|
|
253
|
-
}, nt = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], le = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(nt),
|
|
254
|
+
}, nt = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], le = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(nt), Mr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
254
255
|
function We(e, t) {
|
|
255
256
|
this.name = e, this.message = t;
|
|
256
257
|
}
|
|
257
|
-
function
|
|
258
|
+
function Hn(e, t) {
|
|
258
259
|
return e + ". Errors: " + Object.keys(t).map(function(n) {
|
|
259
260
|
return t[n].toString();
|
|
260
261
|
}).filter(function(n, r, i) {
|
|
@@ -262,31 +263,31 @@ var Er = { exports: {} };
|
|
|
262
263
|
}).join(`
|
|
263
264
|
`);
|
|
264
265
|
}
|
|
265
|
-
function
|
|
266
|
-
this.failures = t, this.failedKeys = r, this.successCount = n, this.message =
|
|
266
|
+
function vt(e, t, n, r) {
|
|
267
|
+
this.failures = t, this.failedKeys = r, this.successCount = n, this.message = Hn(e, t);
|
|
267
268
|
}
|
|
268
269
|
function $e(e, t) {
|
|
269
270
|
this.name = "BulkError", this.failures = Object.keys(t).map(function(n) {
|
|
270
271
|
return t[n];
|
|
271
|
-
}), this.failuresByPos = t, this.message =
|
|
272
|
+
}), this.failuresByPos = t, this.message = Hn(e, this.failures);
|
|
272
273
|
}
|
|
273
274
|
Le(We).from(Error).extend({ toString: function() {
|
|
274
275
|
return this.name + ": " + this.message;
|
|
275
|
-
} }), Le(
|
|
276
|
-
var
|
|
276
|
+
} }), Le(vt).from(We), Le($e).from(We);
|
|
277
|
+
var Qt = le.reduce(function(e, t) {
|
|
277
278
|
return e[t] = t + "Error", e;
|
|
278
|
-
}, {}),
|
|
279
|
+
}, {}), Fr = We, I = le.reduce(function(e, t) {
|
|
279
280
|
var n = t + "Error";
|
|
280
281
|
function r(i, o) {
|
|
281
282
|
this.name = n, i ? typeof i == "string" ? (this.message = "".concat(i).concat(o ? `
|
|
282
|
-
` + o : ""), this.inner = o || null) : typeof i == "object" && (this.message = "".concat(i.name, " ").concat(i.message), this.inner = i) : (this.message =
|
|
283
|
+
` + o : ""), this.inner = o || null) : typeof i == "object" && (this.message = "".concat(i.name, " ").concat(i.message), this.inner = i) : (this.message = Mr[t] || n, this.inner = null);
|
|
283
284
|
}
|
|
284
|
-
return Le(r).from(
|
|
285
|
+
return Le(r).from(Fr), e[t] = r, e;
|
|
285
286
|
}, {});
|
|
286
287
|
I.Syntax = SyntaxError, I.Type = TypeError, I.Range = RangeError;
|
|
287
|
-
var
|
|
288
|
+
var Qn = nt.reduce(function(e, t) {
|
|
288
289
|
return e[t + "Error"] = I[t], e;
|
|
289
|
-
}, {}),
|
|
290
|
+
}, {}), bt = le.reduce(function(e, t) {
|
|
290
291
|
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = I[t]), e;
|
|
291
292
|
}, {});
|
|
292
293
|
function V() {
|
|
@@ -294,7 +295,7 @@ var Er = { exports: {} };
|
|
|
294
295
|
function et(e) {
|
|
295
296
|
return e;
|
|
296
297
|
}
|
|
297
|
-
function
|
|
298
|
+
function Nr(e, t) {
|
|
298
299
|
return e == null || e === et ? t : function(n) {
|
|
299
300
|
return t(e(n));
|
|
300
301
|
};
|
|
@@ -304,7 +305,7 @@ var Er = { exports: {} };
|
|
|
304
305
|
e.apply(this, arguments), t.apply(this, arguments);
|
|
305
306
|
};
|
|
306
307
|
}
|
|
307
|
-
function
|
|
308
|
+
function zr(e, t) {
|
|
308
309
|
return e === V ? t : function() {
|
|
309
310
|
var n = e.apply(this, arguments);
|
|
310
311
|
n !== void 0 && (arguments[0] = n);
|
|
@@ -314,14 +315,14 @@ var Er = { exports: {} };
|
|
|
314
315
|
return r && (this.onsuccess = this.onsuccess ? Ke(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? Ke(i, this.onerror) : i), o !== void 0 ? o : n;
|
|
315
316
|
};
|
|
316
317
|
}
|
|
317
|
-
function
|
|
318
|
+
function Lr(e, t) {
|
|
318
319
|
return e === V ? t : function() {
|
|
319
320
|
e.apply(this, arguments);
|
|
320
321
|
var n = this.onsuccess, r = this.onerror;
|
|
321
322
|
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? Ke(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? Ke(r, this.onerror) : r);
|
|
322
323
|
};
|
|
323
324
|
}
|
|
324
|
-
function
|
|
325
|
+
function Ur(e, t) {
|
|
325
326
|
return e === V ? t : function(n) {
|
|
326
327
|
var r = e.apply(this, arguments);
|
|
327
328
|
q(n, r);
|
|
@@ -329,12 +330,12 @@ var Er = { exports: {} };
|
|
|
329
330
|
return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), i && (this.onsuccess = this.onsuccess ? Ke(i, this.onsuccess) : i), o && (this.onerror = this.onerror ? Ke(o, this.onerror) : o), r === void 0 ? n === void 0 ? void 0 : n : q(r, n);
|
|
330
331
|
};
|
|
331
332
|
}
|
|
332
|
-
function
|
|
333
|
+
function Wr(e, t) {
|
|
333
334
|
return e === V ? t : function() {
|
|
334
335
|
return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
335
336
|
};
|
|
336
337
|
}
|
|
337
|
-
function
|
|
338
|
+
function Xt(e, t) {
|
|
338
339
|
return e === V ? t : function() {
|
|
339
340
|
var n = e.apply(this, arguments);
|
|
340
341
|
if (n && typeof n.then == "function") {
|
|
@@ -347,20 +348,20 @@ var Er = { exports: {} };
|
|
|
347
348
|
return t.apply(this, arguments);
|
|
348
349
|
};
|
|
349
350
|
}
|
|
350
|
-
|
|
351
|
+
bt.ModifyError = vt, bt.DexieError = We, bt.BulkError = $e;
|
|
351
352
|
var fe = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
352
|
-
function
|
|
353
|
+
function Xn(e) {
|
|
353
354
|
fe = e;
|
|
354
355
|
}
|
|
355
|
-
var tt = {},
|
|
356
|
+
var tt = {}, Jn = 100, he = typeof Promise > "u" ? [] : function() {
|
|
356
357
|
var e = Promise.resolve();
|
|
357
358
|
if (typeof crypto > "u" || !crypto.subtle)
|
|
358
359
|
return [e, oe(e), e];
|
|
359
360
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
360
361
|
return [t, oe(t), e];
|
|
361
|
-
}(), nt =
|
|
362
|
-
ot.push([e, t]),
|
|
363
|
-
},
|
|
362
|
+
}(), nt = he[0], le = he[1], he = he[2], le = le && le.then, rt = nt && nt.constructor, Jt = !!he, it = function(e, t) {
|
|
363
|
+
ot.push([e, t]), wt && (queueMicrotask(Vr), wt = !1);
|
|
364
|
+
}, Zt = !0, wt = !0, Ae = [], _t = [], qt = et, ke = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: V, pgp: !1, env: {}, finalize: V }, D = ke, ot = [], De = 0, kt = [];
|
|
364
365
|
function K(e) {
|
|
365
366
|
if (typeof this != "object")
|
|
366
367
|
throw new TypeError("Promises must be constructed via new");
|
|
@@ -369,7 +370,7 @@ var Er = { exports: {} };
|
|
|
369
370
|
if (typeof e != "function") {
|
|
370
371
|
if (e !== tt)
|
|
371
372
|
throw new TypeError("Not a function");
|
|
372
|
-
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 &&
|
|
373
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && tn(this, this._value));
|
|
373
374
|
}
|
|
374
375
|
this._state = null, this._value = null, ++t.ref, function n(r, i) {
|
|
375
376
|
try {
|
|
@@ -378,64 +379,64 @@ var Er = { exports: {} };
|
|
|
378
379
|
if (o === r)
|
|
379
380
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
380
381
|
var a = r._lib && Ve();
|
|
381
|
-
o && typeof o.then == "function" ? n(r, function(u,
|
|
382
|
-
o instanceof K ? o._then(u,
|
|
383
|
-
}) : (r._state = !0, r._value = o,
|
|
382
|
+
o && typeof o.then == "function" ? n(r, function(u, h) {
|
|
383
|
+
o instanceof K ? o._then(u, h) : o.then(u, h);
|
|
384
|
+
}) : (r._state = !0, r._value = o, qn(r)), a && Ge();
|
|
384
385
|
}
|
|
385
|
-
},
|
|
386
|
+
}, tn.bind(null, r));
|
|
386
387
|
} catch (o) {
|
|
387
|
-
|
|
388
|
+
tn(r, o);
|
|
388
389
|
}
|
|
389
390
|
}(this, e);
|
|
390
391
|
}
|
|
391
|
-
var
|
|
392
|
-
var e = D, t =
|
|
392
|
+
var en = { get: function() {
|
|
393
|
+
var e = D, t = Et;
|
|
393
394
|
function n(r, i) {
|
|
394
|
-
var o = this, a = !e.global && (e !== D || t !==
|
|
395
|
-
|
|
395
|
+
var o = this, a = !e.global && (e !== D || t !== Et), u = a && !Oe(), h = new K(function(l, m) {
|
|
396
|
+
nn(o, new Zn(tr(r, e, a, u), tr(i, e, a, u), l, m, e));
|
|
396
397
|
});
|
|
397
|
-
return this._consoleTask && (
|
|
398
|
+
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
398
399
|
}
|
|
399
400
|
return n.prototype = tt, n;
|
|
400
401
|
}, set: function(e) {
|
|
401
|
-
we(this, "then", e && e.prototype === tt ?
|
|
402
|
+
we(this, "then", e && e.prototype === tt ? en : { get: function() {
|
|
402
403
|
return e;
|
|
403
|
-
}, set:
|
|
404
|
+
}, set: en.set });
|
|
404
405
|
} };
|
|
405
|
-
function
|
|
406
|
+
function Zn(e, t, n, r, i) {
|
|
406
407
|
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = i;
|
|
407
408
|
}
|
|
408
|
-
function
|
|
409
|
+
function tn(e, t) {
|
|
409
410
|
var n, r;
|
|
410
|
-
|
|
411
|
+
_t.push(t), e._state === null && (n = e._lib && Ve(), t = qt(t), e._state = !1, e._value = t, r = e, Ae.some(function(i) {
|
|
411
412
|
return i._value === r._value;
|
|
412
|
-
}) || Ae.push(r),
|
|
413
|
+
}) || Ae.push(r), qn(e), n && Ge());
|
|
413
414
|
}
|
|
414
|
-
function
|
|
415
|
+
function qn(e) {
|
|
415
416
|
var t = e._listeners;
|
|
416
417
|
e._listeners = [];
|
|
417
418
|
for (var n = 0, r = t.length; n < r; ++n)
|
|
418
|
-
|
|
419
|
+
nn(e, t[n]);
|
|
419
420
|
var i = e._PSD;
|
|
420
421
|
--i.ref || i.finalize(), De === 0 && (++De, it(function() {
|
|
421
|
-
--De == 0 &&
|
|
422
|
+
--De == 0 && rn();
|
|
422
423
|
}, []));
|
|
423
424
|
}
|
|
424
|
-
function
|
|
425
|
+
function nn(e, t) {
|
|
425
426
|
if (e._state !== null) {
|
|
426
427
|
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
427
428
|
if (n === null)
|
|
428
429
|
return (e._state ? t.resolve : t.reject)(e._value);
|
|
429
|
-
++t.psd.ref, ++De, it(
|
|
430
|
+
++t.psd.ref, ++De, it($r, [n, e, t]);
|
|
430
431
|
} else
|
|
431
432
|
e._listeners.push(t);
|
|
432
433
|
}
|
|
433
|
-
function
|
|
434
|
+
function $r(e, t, n) {
|
|
434
435
|
try {
|
|
435
436
|
var r, i = t._value;
|
|
436
|
-
!t._state &&
|
|
437
|
+
!t._state && _t.length && (_t = []), r = fe && t._consoleTask ? t._consoleTask.run(function() {
|
|
437
438
|
return e(i);
|
|
438
|
-
}) : e(i), t._state ||
|
|
439
|
+
}) : e(i), t._state || _t.indexOf(i) !== -1 || function(o) {
|
|
439
440
|
for (var a = Ae.length; a; )
|
|
440
441
|
if (Ae[--a]._value === o._value)
|
|
441
442
|
return Ae.splice(a, 1);
|
|
@@ -443,17 +444,17 @@ var Er = { exports: {} };
|
|
|
443
444
|
} catch (o) {
|
|
444
445
|
n.reject(o);
|
|
445
446
|
} finally {
|
|
446
|
-
--De == 0 &&
|
|
447
|
+
--De == 0 && rn(), --n.psd.ref || n.psd.finalize();
|
|
447
448
|
}
|
|
448
449
|
}
|
|
449
|
-
function
|
|
450
|
-
Te(
|
|
450
|
+
function Vr() {
|
|
451
|
+
Te(ke, function() {
|
|
451
452
|
Ve() && Ge();
|
|
452
453
|
});
|
|
453
454
|
}
|
|
454
455
|
function Ve() {
|
|
455
|
-
var e =
|
|
456
|
-
return
|
|
456
|
+
var e = Zt;
|
|
457
|
+
return wt = Zt = !1, e;
|
|
457
458
|
}
|
|
458
459
|
function Ge() {
|
|
459
460
|
var e, t, n;
|
|
@@ -464,17 +465,17 @@ var Er = { exports: {} };
|
|
|
464
465
|
r[0].apply(null, r[1]);
|
|
465
466
|
}
|
|
466
467
|
while (0 < ot.length);
|
|
467
|
-
|
|
468
|
+
wt = Zt = !0;
|
|
468
469
|
}
|
|
469
|
-
function
|
|
470
|
+
function rn() {
|
|
470
471
|
var e = Ae;
|
|
471
472
|
Ae = [], e.forEach(function(r) {
|
|
472
473
|
r._PSD.onunhandled.call(null, r._value, r);
|
|
473
474
|
});
|
|
474
|
-
for (var t =
|
|
475
|
+
for (var t = kt.slice(0), n = t.length; n; )
|
|
475
476
|
t[--n]();
|
|
476
477
|
}
|
|
477
|
-
function
|
|
478
|
+
function xt(e) {
|
|
478
479
|
return new K(tt, !1, e);
|
|
479
480
|
}
|
|
480
481
|
function H(e, t) {
|
|
@@ -490,16 +491,16 @@ var Er = { exports: {} };
|
|
|
490
491
|
}
|
|
491
492
|
};
|
|
492
493
|
}
|
|
493
|
-
ze(K.prototype, { then:
|
|
494
|
-
|
|
494
|
+
ze(K.prototype, { then: en, _then: function(e, t) {
|
|
495
|
+
nn(this, new Zn(null, null, e, t, D));
|
|
495
496
|
}, catch: function(e) {
|
|
496
497
|
if (arguments.length === 1)
|
|
497
498
|
return this.then(null, e);
|
|
498
499
|
var t = e, n = arguments[1];
|
|
499
500
|
return typeof t == "function" ? this.then(null, function(r) {
|
|
500
|
-
return (r instanceof t ? n :
|
|
501
|
+
return (r instanceof t ? n : xt)(r);
|
|
501
502
|
}) : this.then(null, function(r) {
|
|
502
|
-
return (r && r.name === t ? n :
|
|
503
|
+
return (r && r.name === t ? n : xt)(r);
|
|
503
504
|
});
|
|
504
505
|
}, finally: function(e) {
|
|
505
506
|
return this.then(function(t) {
|
|
@@ -508,7 +509,7 @@ var Er = { exports: {} };
|
|
|
508
509
|
});
|
|
509
510
|
}, function(t) {
|
|
510
511
|
return K.resolve(e()).then(function() {
|
|
511
|
-
return
|
|
512
|
+
return xt(t);
|
|
512
513
|
});
|
|
513
514
|
});
|
|
514
515
|
}, timeout: function(e, t) {
|
|
@@ -519,8 +520,8 @@ var Er = { exports: {} };
|
|
|
519
520
|
}, e);
|
|
520
521
|
n.then(r, i).finally(clearTimeout.bind(null, o));
|
|
521
522
|
}) : this;
|
|
522
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && we(K.prototype, Symbol.toStringTag, "Dexie.Promise"),
|
|
523
|
-
var e =
|
|
523
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && we(K.prototype, Symbol.toStringTag, "Dexie.Promise"), ke.env = er(), ze(K, { all: function() {
|
|
524
|
+
var e = me.apply(null, arguments).map(Pt);
|
|
524
525
|
return new K(function(t, n) {
|
|
525
526
|
e.length === 0 && t([]);
|
|
526
527
|
var r = e.length;
|
|
@@ -534,8 +535,8 @@ var Er = { exports: {} };
|
|
|
534
535
|
return e instanceof K ? e : e && typeof e.then == "function" ? new K(function(t, n) {
|
|
535
536
|
e.then(t, n);
|
|
536
537
|
}) : new K(tt, !0, e);
|
|
537
|
-
}, reject:
|
|
538
|
-
var e =
|
|
538
|
+
}, reject: xt, race: function() {
|
|
539
|
+
var e = me.apply(null, arguments).map(Pt);
|
|
539
540
|
return new K(function(t, n) {
|
|
540
541
|
e.map(function(r) {
|
|
541
542
|
return K.resolve(r).then(t, n);
|
|
@@ -546,33 +547,33 @@ var Er = { exports: {} };
|
|
|
546
547
|
}, set: function(e) {
|
|
547
548
|
return D = e;
|
|
548
549
|
} }, totalEchoes: { get: function() {
|
|
549
|
-
return
|
|
550
|
-
} }, newPSD:
|
|
550
|
+
return Et;
|
|
551
|
+
} }, newPSD: xe, usePSD: Te, scheduler: { get: function() {
|
|
551
552
|
return it;
|
|
552
553
|
}, set: function(e) {
|
|
553
554
|
it = e;
|
|
554
555
|
} }, rejectionMapper: { get: function() {
|
|
555
|
-
return
|
|
556
|
+
return qt;
|
|
556
557
|
}, set: function(e) {
|
|
557
|
-
|
|
558
|
+
qt = e;
|
|
558
559
|
} }, follow: function(e, t) {
|
|
559
560
|
return new K(function(n, r) {
|
|
560
|
-
return
|
|
561
|
+
return xe(function(i, o) {
|
|
561
562
|
var a = D;
|
|
562
563
|
a.unhandleds = [], a.onunhandled = o, a.finalize = Ke(function() {
|
|
563
|
-
var u,
|
|
564
|
+
var u, h = this;
|
|
564
565
|
u = function() {
|
|
565
|
-
|
|
566
|
-
},
|
|
567
|
-
u(),
|
|
566
|
+
h.unhandleds.length === 0 ? i() : o(h.unhandleds[0]);
|
|
567
|
+
}, kt.push(function l() {
|
|
568
|
+
u(), kt.splice(kt.indexOf(l), 1);
|
|
568
569
|
}), ++De, it(function() {
|
|
569
|
-
--De == 0 &&
|
|
570
|
+
--De == 0 && rn();
|
|
570
571
|
}, []);
|
|
571
572
|
}, a.finalize), e();
|
|
572
573
|
}, t, n, r);
|
|
573
574
|
});
|
|
574
575
|
} }), rt && (rt.allSettled && we(K, "allSettled", function() {
|
|
575
|
-
var e =
|
|
576
|
+
var e = me.apply(null, arguments).map(Pt);
|
|
576
577
|
return new K(function(t) {
|
|
577
578
|
e.length === 0 && t([]);
|
|
578
579
|
var n = e.length, r = new Array(n);
|
|
@@ -587,7 +588,7 @@ var Er = { exports: {} };
|
|
|
587
588
|
});
|
|
588
589
|
});
|
|
589
590
|
}), rt.any && typeof AggregateError < "u" && we(K, "any", function() {
|
|
590
|
-
var e =
|
|
591
|
+
var e = me.apply(null, arguments).map(Pt);
|
|
591
592
|
return new K(function(t, n) {
|
|
592
593
|
e.length === 0 && n(new AggregateError([]));
|
|
593
594
|
var r = e.length, i = new Array(r);
|
|
@@ -600,39 +601,39 @@ var Er = { exports: {} };
|
|
|
600
601
|
});
|
|
601
602
|
});
|
|
602
603
|
}));
|
|
603
|
-
var ee = { awaits: 0, echoes: 0, id: 0 },
|
|
604
|
-
function
|
|
604
|
+
var ee = { awaits: 0, echoes: 0, id: 0 }, Gr = 0, Ot = [], St = 0, Et = 0, Yr = 0;
|
|
605
|
+
function xe(e, t, n, r) {
|
|
605
606
|
var i = D, o = Object.create(i);
|
|
606
|
-
return o.parent = i, o.ref = 0, o.global = !1, o.id =
|
|
607
|
+
return o.parent = i, o.ref = 0, o.global = !1, o.id = ++Yr, ke.env, o.env = Jt ? { Promise: K, PromiseProp: { value: K, configurable: !0, writable: !0 }, all: K.all, race: K.race, allSettled: K.allSettled, any: K.any, resolve: K.resolve, reject: K.reject } : {}, t && q(o, t), ++i.ref, o.finalize = function() {
|
|
607
608
|
--this.parent.ref || this.parent.finalize();
|
|
608
609
|
}, r = Te(o, e, n, r), o.ref === 0 && o.finalize(), r;
|
|
609
610
|
}
|
|
610
611
|
function Ye() {
|
|
611
|
-
return ee.id || (ee.id = ++
|
|
612
|
+
return ee.id || (ee.id = ++Gr), ++ee.awaits, ee.echoes += Jn, ee.id;
|
|
612
613
|
}
|
|
613
614
|
function Oe() {
|
|
614
|
-
return !!ee.awaits && (--ee.awaits == 0 && (ee.id = 0), ee.echoes = ee.awaits *
|
|
615
|
+
return !!ee.awaits && (--ee.awaits == 0 && (ee.id = 0), ee.echoes = ee.awaits * Jn, !0);
|
|
615
616
|
}
|
|
616
|
-
function
|
|
617
|
+
function Pt(e) {
|
|
617
618
|
return ee.echoes && e && e.constructor === rt ? (Ye(), e.then(function(t) {
|
|
618
619
|
return Oe(), t;
|
|
619
620
|
}, function(t) {
|
|
620
|
-
return Oe(),
|
|
621
|
+
return Oe(), J(t);
|
|
621
622
|
})) : e;
|
|
622
623
|
}
|
|
623
|
-
function
|
|
624
|
-
var e =
|
|
625
|
-
|
|
624
|
+
function Hr() {
|
|
625
|
+
var e = Ot[Ot.length - 1];
|
|
626
|
+
Ot.pop(), Se(e, !1);
|
|
626
627
|
}
|
|
627
628
|
function Se(e, t) {
|
|
628
629
|
var n, r = D;
|
|
629
|
-
(t ? !ee.echoes ||
|
|
630
|
-
++
|
|
631
|
-
}).bind(null, e) :
|
|
630
|
+
(t ? !ee.echoes || St++ && e === D : !St || --St && e === D) || queueMicrotask(t ? (function(i) {
|
|
631
|
+
++Et, ee.echoes && --ee.echoes != 0 || (ee.echoes = ee.awaits = ee.id = 0), Ot.push(D), Se(i, !0);
|
|
632
|
+
}).bind(null, e) : Hr), e !== D && (D = e, r === ke && (ke.env = er()), Jt && (n = ke.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(F, "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))));
|
|
632
633
|
}
|
|
633
|
-
function
|
|
634
|
+
function er() {
|
|
634
635
|
var e = F.Promise;
|
|
635
|
-
return
|
|
636
|
+
return Jt ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(F, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
636
637
|
}
|
|
637
638
|
function Te(e, t, n, r, i) {
|
|
638
639
|
var o = D;
|
|
@@ -642,7 +643,7 @@ var Er = { exports: {} };
|
|
|
642
643
|
Se(o, !1);
|
|
643
644
|
}
|
|
644
645
|
}
|
|
645
|
-
function
|
|
646
|
+
function tr(e, t, n, r) {
|
|
646
647
|
return typeof e != "function" ? e : function() {
|
|
647
648
|
var i = D;
|
|
648
649
|
n && Ye(), Se(t, !0);
|
|
@@ -653,30 +654,30 @@ var Er = { exports: {} };
|
|
|
653
654
|
}
|
|
654
655
|
};
|
|
655
656
|
}
|
|
656
|
-
function
|
|
657
|
-
Promise === rt && ee.echoes === 0 ?
|
|
657
|
+
function on(e) {
|
|
658
|
+
Promise === rt && ee.echoes === 0 ? St === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
658
659
|
}
|
|
659
660
|
("" + le).indexOf("[native code]") === -1 && (Ye = Oe = V);
|
|
660
|
-
var
|
|
661
|
+
var J = K.reject, he = "4.0.1-beta.10", Be = "", ge = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", nr = "String expected.", He = [], jt = "__dbnames", an = "readonly", sn = "readwrite";
|
|
661
662
|
function Ie(e, t) {
|
|
662
663
|
return e ? t ? function() {
|
|
663
664
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
664
665
|
} : e : t;
|
|
665
666
|
}
|
|
666
|
-
var
|
|
667
|
-
function
|
|
667
|
+
var rr = { type: 3, lower: -1 / 0, lowerOpen: !1, upper: [[]], upperOpen: !1 };
|
|
668
|
+
function Ct(e) {
|
|
668
669
|
return typeof e != "string" || /\./.test(e) ? function(t) {
|
|
669
670
|
return t;
|
|
670
671
|
} : function(t) {
|
|
671
672
|
return t[e] === void 0 && e in t && delete (t = _e(t))[e], t;
|
|
672
673
|
};
|
|
673
674
|
}
|
|
674
|
-
function
|
|
675
|
+
function ir() {
|
|
675
676
|
throw I.Type();
|
|
676
677
|
}
|
|
677
678
|
function U(e, t) {
|
|
678
679
|
try {
|
|
679
|
-
var n =
|
|
680
|
+
var n = or(e), r = or(t);
|
|
680
681
|
if (n !== r)
|
|
681
682
|
return n === "Array" ? 1 : r === "Array" ? -1 : n === "binary" ? 1 : r === "binary" ? -1 : n === "string" ? 1 : r === "string" ? -1 : n === "Date" ? 1 : r !== "Date" ? NaN : -1;
|
|
682
683
|
switch (n) {
|
|
@@ -686,17 +687,17 @@ var Er = { exports: {} };
|
|
|
686
687
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
687
688
|
case "binary":
|
|
688
689
|
return function(i, o) {
|
|
689
|
-
for (var a = i.length, u = o.length,
|
|
690
|
+
for (var a = i.length, u = o.length, h = a < u ? a : u, l = 0; l < h; ++l)
|
|
690
691
|
if (i[l] !== o[l])
|
|
691
692
|
return i[l] < o[l] ? -1 : 1;
|
|
692
693
|
return a === u ? 0 : a < u ? -1 : 1;
|
|
693
|
-
}(
|
|
694
|
+
}(ar(e), ar(t));
|
|
694
695
|
case "Array":
|
|
695
696
|
return function(i, o) {
|
|
696
|
-
for (var a = i.length, u = o.length,
|
|
697
|
-
var
|
|
698
|
-
if (
|
|
699
|
-
return
|
|
697
|
+
for (var a = i.length, u = o.length, h = a < u ? a : u, l = 0; l < h; ++l) {
|
|
698
|
+
var m = U(i[l], o[l]);
|
|
699
|
+
if (m !== 0)
|
|
700
|
+
return m;
|
|
700
701
|
}
|
|
701
702
|
return a === u ? 0 : a < u ? -1 : 1;
|
|
702
703
|
}(e, t);
|
|
@@ -705,69 +706,69 @@ var Er = { exports: {} };
|
|
|
705
706
|
}
|
|
706
707
|
return NaN;
|
|
707
708
|
}
|
|
708
|
-
function
|
|
709
|
+
function or(e) {
|
|
709
710
|
var t = typeof e;
|
|
710
|
-
return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e =
|
|
711
|
+
return t != "object" ? t : ArrayBuffer.isView(e) ? "binary" : (e = Gt(e), e === "ArrayBuffer" ? "binary" : e);
|
|
711
712
|
}
|
|
712
|
-
function
|
|
713
|
+
function ar(e) {
|
|
713
714
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
714
715
|
}
|
|
715
|
-
var
|
|
716
|
+
var sr = (Y.prototype._trans = function(e, t, n) {
|
|
716
717
|
var r = this._tx || D.trans, i = this.name, o = fe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
717
|
-
function a(l,
|
|
718
|
+
function a(l, m, c) {
|
|
718
719
|
if (!c.schema[i])
|
|
719
720
|
throw new I.NotFound("Table " + i + " not part of transaction");
|
|
720
721
|
return t(c.idbtrans, c);
|
|
721
722
|
}
|
|
722
723
|
var u = Ve();
|
|
723
724
|
try {
|
|
724
|
-
var
|
|
725
|
+
var h = r && r.db._novip === this.db._novip ? r === D.trans ? r._promise(e, a, n) : xe(function() {
|
|
725
726
|
return r._promise(e, a, n);
|
|
726
|
-
}, { trans: r, transless: D.transless || D }) : function l(
|
|
727
|
-
if (
|
|
728
|
-
var y =
|
|
727
|
+
}, { trans: r, transless: D.transless || D }) : function l(m, c, f, d) {
|
|
728
|
+
if (m.idbdb && (m._state.openComplete || D.letThrough || m._vip)) {
|
|
729
|
+
var y = m._createTransaction(c, f, m._dbSchema);
|
|
729
730
|
try {
|
|
730
|
-
y.create(),
|
|
731
|
-
} catch (
|
|
732
|
-
return
|
|
733
|
-
return l(
|
|
734
|
-
})) :
|
|
731
|
+
y.create(), m._state.PR1398_maxLoop = 3;
|
|
732
|
+
} catch (g) {
|
|
733
|
+
return g.name === Qt.InvalidState && m.isOpen() && 0 < --m._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), m.close({ disableAutoOpen: !1 }), m.open().then(function() {
|
|
734
|
+
return l(m, c, f, d);
|
|
735
|
+
})) : J(g);
|
|
735
736
|
}
|
|
736
|
-
return y._promise(c, function(
|
|
737
|
-
return
|
|
738
|
-
return D.trans = y,
|
|
737
|
+
return y._promise(c, function(g, p) {
|
|
738
|
+
return xe(function() {
|
|
739
|
+
return D.trans = y, d(g, p, y);
|
|
739
740
|
});
|
|
740
|
-
}).then(function(
|
|
741
|
+
}).then(function(g) {
|
|
741
742
|
if (c === "readwrite")
|
|
742
743
|
try {
|
|
743
744
|
y.idbtrans.commit();
|
|
744
745
|
} catch {
|
|
745
746
|
}
|
|
746
|
-
return c === "readonly" ?
|
|
747
|
-
return
|
|
747
|
+
return c === "readonly" ? g : y._completion.then(function() {
|
|
748
|
+
return g;
|
|
748
749
|
});
|
|
749
750
|
});
|
|
750
751
|
}
|
|
751
|
-
if (
|
|
752
|
-
return
|
|
753
|
-
if (!
|
|
754
|
-
if (!
|
|
755
|
-
return
|
|
756
|
-
|
|
752
|
+
if (m._state.openComplete)
|
|
753
|
+
return J(new I.DatabaseClosed(m._state.dbOpenError));
|
|
754
|
+
if (!m._state.isBeingOpened) {
|
|
755
|
+
if (!m._state.autoOpen)
|
|
756
|
+
return J(new I.DatabaseClosed());
|
|
757
|
+
m.open().catch(V);
|
|
757
758
|
}
|
|
758
|
-
return
|
|
759
|
-
return l(
|
|
759
|
+
return m._state.dbReadyPromise.then(function() {
|
|
760
|
+
return l(m, c, f, d);
|
|
760
761
|
});
|
|
761
762
|
}(this.db, e, [this.name], a);
|
|
762
|
-
return o && (
|
|
763
|
-
return console.trace(l),
|
|
764
|
-
})),
|
|
763
|
+
return o && (h._consoleTask = o, h = h.catch(function(l) {
|
|
764
|
+
return console.trace(l), J(l);
|
|
765
|
+
})), h;
|
|
765
766
|
} finally {
|
|
766
767
|
u && Ge();
|
|
767
768
|
}
|
|
768
769
|
}, Y.prototype.get = function(e, t) {
|
|
769
770
|
var n = this;
|
|
770
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ?
|
|
771
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? J(new I.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(r) {
|
|
771
772
|
return n.core.get({ trans: r, key: e }).then(function(i) {
|
|
772
773
|
return n.hook.reading.fire(i);
|
|
773
774
|
});
|
|
@@ -780,18 +781,18 @@ var Er = { exports: {} };
|
|
|
780
781
|
var t = T(e);
|
|
781
782
|
if (t.length === 1)
|
|
782
783
|
return this.where(t[0]).equals(e[t[0]]);
|
|
783
|
-
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(
|
|
784
|
-
if (
|
|
785
|
-
return 0 <=
|
|
784
|
+
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(h) {
|
|
785
|
+
if (h.compound && t.every(function(m) {
|
|
786
|
+
return 0 <= h.keyPath.indexOf(m);
|
|
786
787
|
})) {
|
|
787
788
|
for (var l = 0; l < t.length; ++l)
|
|
788
|
-
if (t.indexOf(
|
|
789
|
+
if (t.indexOf(h.keyPath[l]) === -1)
|
|
789
790
|
return !1;
|
|
790
791
|
return !0;
|
|
791
792
|
}
|
|
792
793
|
return !1;
|
|
793
|
-
}).sort(function(
|
|
794
|
-
return
|
|
794
|
+
}).sort(function(h, l) {
|
|
795
|
+
return h.keyPath.length - l.keyPath.length;
|
|
795
796
|
})[0];
|
|
796
797
|
if (n && this.db._maxKey !== Be) {
|
|
797
798
|
var a = n.keyPath.slice(0, t.length);
|
|
@@ -801,17 +802,17 @@ var Er = { exports: {} };
|
|
|
801
802
|
}
|
|
802
803
|
!n && fe && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
803
804
|
var r = this.schema.idxByName, i = this.db._deps.indexedDB;
|
|
804
|
-
function o(
|
|
805
|
-
return i.cmp(
|
|
805
|
+
function o(h, l) {
|
|
806
|
+
return i.cmp(h, l) === 0;
|
|
806
807
|
}
|
|
807
808
|
var u = t.reduce(function(f, l) {
|
|
808
|
-
var
|
|
809
|
-
return [
|
|
810
|
-
return y = ye(y, l), W(y) && y.some(function(
|
|
811
|
-
return o(
|
|
809
|
+
var m = f[0], c = f[1], f = r[l], d = e[l];
|
|
810
|
+
return [m || f, m || !f ? Ie(c, f && f.multi ? function(y) {
|
|
811
|
+
return y = ye(y, l), W(y) && y.some(function(g) {
|
|
812
|
+
return o(d, g);
|
|
812
813
|
});
|
|
813
814
|
} : function(y) {
|
|
814
|
-
return o(
|
|
815
|
+
return o(d, ye(y, l));
|
|
815
816
|
}) : c];
|
|
816
817
|
}, [null, null]), a = u[0], u = u[1];
|
|
817
818
|
return a ? this.where(a.name).equals(e[a.keyPath]).filter(u) : n ? this.filter(u) : this.where(t).equals("");
|
|
@@ -838,33 +839,33 @@ var Er = { exports: {} };
|
|
|
838
839
|
function i() {
|
|
839
840
|
return t !== null && t.apply(this, arguments) || this;
|
|
840
841
|
}
|
|
841
|
-
(this.schema.mappedClass = e).prototype instanceof
|
|
842
|
+
(this.schema.mappedClass = e).prototype instanceof ir && (function(h, l) {
|
|
842
843
|
if (typeof l != "function" && l !== null)
|
|
843
844
|
throw new TypeError("Class extends value " + String(l) + " is not a constructor or null");
|
|
844
|
-
function
|
|
845
|
-
this.constructor =
|
|
845
|
+
function m() {
|
|
846
|
+
this.constructor = h;
|
|
846
847
|
}
|
|
847
|
-
v(
|
|
848
|
+
v(h, l), h.prototype = l === null ? Object.create(l) : (m.prototype = l.prototype, new m());
|
|
848
849
|
}(i, t = e), Object.defineProperty(i.prototype, "db", { get: function() {
|
|
849
850
|
return n;
|
|
850
851
|
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
851
852
|
return r;
|
|
852
853
|
}, e = i);
|
|
853
854
|
for (var o = /* @__PURE__ */ new Set(), a = e.prototype; a; a = oe(a))
|
|
854
|
-
Object.getOwnPropertyNames(a).forEach(function(
|
|
855
|
-
return o.add(
|
|
855
|
+
Object.getOwnPropertyNames(a).forEach(function(h) {
|
|
856
|
+
return o.add(h);
|
|
856
857
|
});
|
|
857
|
-
function u(
|
|
858
|
-
if (!
|
|
859
|
-
return
|
|
860
|
-
var l,
|
|
861
|
-
for (l in
|
|
858
|
+
function u(h) {
|
|
859
|
+
if (!h)
|
|
860
|
+
return h;
|
|
861
|
+
var l, m = Object.create(e.prototype);
|
|
862
|
+
for (l in h)
|
|
862
863
|
if (!o.has(l))
|
|
863
864
|
try {
|
|
864
|
-
|
|
865
|
+
m[l] = h[l];
|
|
865
866
|
} catch {
|
|
866
867
|
}
|
|
867
|
-
return
|
|
868
|
+
return m;
|
|
868
869
|
}
|
|
869
870
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = u, this.hook("reading", u), e;
|
|
870
871
|
}, Y.prototype.defineClass = function() {
|
|
@@ -873,7 +874,7 @@ var Er = { exports: {} };
|
|
|
873
874
|
});
|
|
874
875
|
}, Y.prototype.add = function(e, t) {
|
|
875
876
|
var n = this, r = this.schema.primKey, i = r.auto, o = r.keyPath, a = e;
|
|
876
|
-
return o && i && (a =
|
|
877
|
+
return o && i && (a = Ct(o)(e)), this._trans("readwrite", function(u) {
|
|
877
878
|
return n.core.mutate({ trans: u, type: "add", keys: t != null ? [t] : null, values: [a] });
|
|
878
879
|
}).then(function(u) {
|
|
879
880
|
return u.numFailures ? K.reject(u.failures[0]) : u.lastResult;
|
|
@@ -886,10 +887,10 @@ var Er = { exports: {} };
|
|
|
886
887
|
return u;
|
|
887
888
|
});
|
|
888
889
|
}, Y.prototype.update = function(e, t) {
|
|
889
|
-
return typeof e != "object" || W(e) ? this.where(":id").equals(e).modify(t) : (e = ye(e, this.schema.primKey.keyPath), e === void 0 ?
|
|
890
|
+
return typeof e != "object" || W(e) ? this.where(":id").equals(e).modify(t) : (e = ye(e, this.schema.primKey.keyPath), e === void 0 ? J(new I.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
890
891
|
}, Y.prototype.put = function(e, t) {
|
|
891
892
|
var n = this, r = this.schema.primKey, i = r.auto, o = r.keyPath, a = e;
|
|
892
|
-
return o && i && (a =
|
|
893
|
+
return o && i && (a = Ct(o)(e)), this._trans("readwrite", function(u) {
|
|
893
894
|
return n.core.mutate({ trans: u, type: "put", values: [a], keys: t != null ? [t] : null });
|
|
894
895
|
}).then(function(u) {
|
|
895
896
|
return u.numFailures ? K.reject(u.failures[0]) : u.lastResult;
|
|
@@ -911,7 +912,7 @@ var Er = { exports: {} };
|
|
|
911
912
|
}, Y.prototype.clear = function() {
|
|
912
913
|
var e = this;
|
|
913
914
|
return this._trans("readwrite", function(t) {
|
|
914
|
-
return e.core.mutate({ trans: t, type: "deleteRange", range:
|
|
915
|
+
return e.core.mutate({ trans: t, type: "deleteRange", range: rr });
|
|
915
916
|
}).then(function(t) {
|
|
916
917
|
return t.numFailures ? K.reject(t.failures[0]) : void 0;
|
|
917
918
|
});
|
|
@@ -932,12 +933,12 @@ var Er = { exports: {} };
|
|
|
932
933
|
throw new I.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
933
934
|
if (i && i.length !== e.length)
|
|
934
935
|
throw new I.InvalidArgument("Arguments objects and keys must have the same length");
|
|
935
|
-
var
|
|
936
|
+
var h = e.length, l = l && u ? e.map(Ct(l)) : e;
|
|
936
937
|
return r.core.mutate({ trans: a, type: "add", keys: i, values: l, wantResults: o }).then(function(y) {
|
|
937
|
-
var c = y.numFailures, f = y.results,
|
|
938
|
+
var c = y.numFailures, f = y.results, d = y.lastResult, y = y.failures;
|
|
938
939
|
if (c === 0)
|
|
939
|
-
return o ? f :
|
|
940
|
-
throw new $e("".concat(r.name, ".bulkAdd(): ").concat(c, " of ").concat(
|
|
940
|
+
return o ? f : d;
|
|
941
|
+
throw new $e("".concat(r.name, ".bulkAdd(): ").concat(c, " of ").concat(h, " operations failed"), y);
|
|
941
942
|
});
|
|
942
943
|
});
|
|
943
944
|
}, Y.prototype.bulkPut = function(e, t, n) {
|
|
@@ -948,12 +949,12 @@ var Er = { exports: {} };
|
|
|
948
949
|
throw new I.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
949
950
|
if (i && i.length !== e.length)
|
|
950
951
|
throw new I.InvalidArgument("Arguments objects and keys must have the same length");
|
|
951
|
-
var
|
|
952
|
+
var h = e.length, l = l && u ? e.map(Ct(l)) : e;
|
|
952
953
|
return r.core.mutate({ trans: a, type: "put", keys: i, values: l, wantResults: o }).then(function(y) {
|
|
953
|
-
var c = y.numFailures, f = y.results,
|
|
954
|
+
var c = y.numFailures, f = y.results, d = y.lastResult, y = y.failures;
|
|
954
955
|
if (c === 0)
|
|
955
|
-
return o ? f :
|
|
956
|
-
throw new $e("".concat(r.name, ".bulkPut(): ").concat(c, " of ").concat(
|
|
956
|
+
return o ? f : d;
|
|
957
|
+
throw new $e("".concat(r.name, ".bulkPut(): ").concat(c, " of ").concat(h, " operations failed"), y);
|
|
957
958
|
});
|
|
958
959
|
});
|
|
959
960
|
}, Y.prototype.bulkUpdate = function(e) {
|
|
@@ -964,31 +965,31 @@ var Er = { exports: {} };
|
|
|
964
965
|
}), o = [];
|
|
965
966
|
return this._trans("readwrite", function(a) {
|
|
966
967
|
return n.getMany({ trans: a, keys: r, cache: "clone" }).then(function(u) {
|
|
967
|
-
var
|
|
968
|
+
var h = [], l = [];
|
|
968
969
|
e.forEach(function(c, f) {
|
|
969
|
-
var
|
|
970
|
-
if (
|
|
970
|
+
var d = c.key, y = c.changes, g = u[f];
|
|
971
|
+
if (g) {
|
|
971
972
|
for (var p = 0, b = Object.keys(y); p < b.length; p++) {
|
|
972
|
-
var w = b[p],
|
|
973
|
+
var w = b[p], k = y[w];
|
|
973
974
|
if (w === t.schema.primKey.keyPath) {
|
|
974
|
-
if (U(
|
|
975
|
+
if (U(k, d) !== 0)
|
|
975
976
|
throw new I.Constraint("Cannot update primary key in bulkUpdate()");
|
|
976
977
|
} else
|
|
977
|
-
ce(
|
|
978
|
+
ce(g, w, k);
|
|
978
979
|
}
|
|
979
|
-
o.push(f),
|
|
980
|
+
o.push(f), h.push(d), l.push(g);
|
|
980
981
|
}
|
|
981
982
|
});
|
|
982
|
-
var
|
|
983
|
-
return n.mutate({ trans: a, type: "put", keys:
|
|
984
|
-
var f = c.numFailures,
|
|
983
|
+
var m = h.length;
|
|
984
|
+
return n.mutate({ trans: a, type: "put", keys: h, values: l, updates: { keys: r, changeSpecs: i } }).then(function(c) {
|
|
985
|
+
var f = c.numFailures, d = c.failures;
|
|
985
986
|
if (f === 0)
|
|
986
|
-
return
|
|
987
|
-
for (var y = 0,
|
|
988
|
-
var p, b =
|
|
989
|
-
w != null && (p =
|
|
987
|
+
return m;
|
|
988
|
+
for (var y = 0, g = Object.keys(d); y < g.length; y++) {
|
|
989
|
+
var p, b = g[y], w = o[Number(b)];
|
|
990
|
+
w != null && (p = d[b], delete d[b], d[w] = p);
|
|
990
991
|
}
|
|
991
|
-
throw new $e("".concat(t.name, ".bulkUpdate(): ").concat(f, " of ").concat(
|
|
992
|
+
throw new $e("".concat(t.name, ".bulkUpdate(): ").concat(f, " of ").concat(m, " operations failed"), d);
|
|
992
993
|
});
|
|
993
994
|
});
|
|
994
995
|
});
|
|
@@ -1008,8 +1009,8 @@ var Er = { exports: {} };
|
|
|
1008
1009
|
function at(e) {
|
|
1009
1010
|
function t(a, u) {
|
|
1010
1011
|
if (u) {
|
|
1011
|
-
for (var
|
|
1012
|
-
l[
|
|
1012
|
+
for (var h = arguments.length, l = new Array(h - 1); --h; )
|
|
1013
|
+
l[h - 1] = arguments[h];
|
|
1013
1014
|
return n[a].subscribe.apply(null, l), e;
|
|
1014
1015
|
}
|
|
1015
1016
|
if (typeof a == "string")
|
|
@@ -1020,18 +1021,18 @@ var Er = { exports: {} };
|
|
|
1020
1021
|
for (var r = 1, i = arguments.length; r < i; ++r)
|
|
1021
1022
|
o(arguments[r]);
|
|
1022
1023
|
return t;
|
|
1023
|
-
function o(a, u,
|
|
1024
|
+
function o(a, u, h) {
|
|
1024
1025
|
if (typeof a != "object") {
|
|
1025
1026
|
var l;
|
|
1026
|
-
u = u ||
|
|
1027
|
-
var
|
|
1028
|
-
|
|
1027
|
+
u = u || Wr;
|
|
1028
|
+
var m = { subscribers: [], fire: h = h || V, subscribe: function(c) {
|
|
1029
|
+
m.subscribers.indexOf(c) === -1 && (m.subscribers.push(c), m.fire = u(m.fire, c));
|
|
1029
1030
|
}, unsubscribe: function(c) {
|
|
1030
|
-
|
|
1031
|
+
m.subscribers = m.subscribers.filter(function(f) {
|
|
1031
1032
|
return f !== c;
|
|
1032
|
-
}),
|
|
1033
|
+
}), m.fire = m.subscribers.reduce(u, h);
|
|
1033
1034
|
} };
|
|
1034
|
-
return n[a] = t[a] =
|
|
1035
|
+
return n[a] = t[a] = m;
|
|
1035
1036
|
}
|
|
1036
1037
|
T(l = a).forEach(function(c) {
|
|
1037
1038
|
var f = l[c];
|
|
@@ -1040,12 +1041,12 @@ var Er = { exports: {} };
|
|
|
1040
1041
|
else {
|
|
1041
1042
|
if (f !== "asap")
|
|
1042
1043
|
throw new I.InvalidArgument("Invalid event config");
|
|
1043
|
-
var
|
|
1044
|
-
for (var y = arguments.length,
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
p.apply(null,
|
|
1044
|
+
var d = o(c, et, function() {
|
|
1045
|
+
for (var y = arguments.length, g = new Array(y); y--; )
|
|
1046
|
+
g[y] = arguments[y];
|
|
1047
|
+
d.subscribers.forEach(function(p) {
|
|
1048
|
+
$n(function() {
|
|
1049
|
+
p.apply(null, g);
|
|
1049
1050
|
});
|
|
1050
1051
|
});
|
|
1051
1052
|
});
|
|
@@ -1059,16 +1060,16 @@ var Er = { exports: {} };
|
|
|
1059
1060
|
function Qe(e, t) {
|
|
1060
1061
|
return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
|
|
1061
1062
|
}
|
|
1062
|
-
function
|
|
1063
|
+
function un(e, t) {
|
|
1063
1064
|
e.filter = Ie(e.filter, t);
|
|
1064
1065
|
}
|
|
1065
|
-
function
|
|
1066
|
+
function cn(e, t, n) {
|
|
1066
1067
|
var r = e.replayFilter;
|
|
1067
1068
|
e.replayFilter = r ? function() {
|
|
1068
1069
|
return Ie(r(), t());
|
|
1069
1070
|
} : t, e.justLimit = n && !r;
|
|
1070
1071
|
}
|
|
1071
|
-
function
|
|
1072
|
+
function Kt(e, t) {
|
|
1072
1073
|
if (e.isPrimKey)
|
|
1073
1074
|
return t.primaryKey;
|
|
1074
1075
|
var n = t.getIndexByKeyPath(e.index);
|
|
@@ -1076,26 +1077,26 @@ var Er = { exports: {} };
|
|
|
1076
1077
|
throw new I.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1077
1078
|
return n;
|
|
1078
1079
|
}
|
|
1079
|
-
function
|
|
1080
|
-
var r =
|
|
1080
|
+
function ur(e, t, n) {
|
|
1081
|
+
var r = Kt(e, t.schema);
|
|
1081
1082
|
return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: r, range: e.range } });
|
|
1082
1083
|
}
|
|
1083
|
-
function
|
|
1084
|
+
function At(e, t, n, r) {
|
|
1084
1085
|
var i = e.replayFilter ? Ie(e.filter, e.replayFilter()) : e.filter;
|
|
1085
1086
|
if (e.or) {
|
|
1086
|
-
var o = {}, a = function(u,
|
|
1087
|
-
var
|
|
1088
|
-
i && !i(
|
|
1089
|
-
return
|
|
1087
|
+
var o = {}, a = function(u, h, l) {
|
|
1088
|
+
var m, c;
|
|
1089
|
+
i && !i(h, l, function(f) {
|
|
1090
|
+
return h.stop(f);
|
|
1090
1091
|
}, function(f) {
|
|
1091
|
-
return
|
|
1092
|
-
}) || ((c = "" + (
|
|
1092
|
+
return h.fail(f);
|
|
1093
|
+
}) || ((c = "" + (m = h.primaryKey)) == "[object ArrayBuffer]" && (c = "" + new Uint8Array(m)), ne(o, c) || (o[c] = !0, t(u, h, l)));
|
|
1093
1094
|
};
|
|
1094
|
-
return Promise.all([e.or._iterate(a, n),
|
|
1095
|
+
return Promise.all([e.or._iterate(a, n), cr(ur(e, r, n), e.algorithm, a, !e.keysOnly && e.valueMapper)]);
|
|
1095
1096
|
}
|
|
1096
|
-
return
|
|
1097
|
+
return cr(ur(e, r, n), Ie(e.algorithm, i), t, !e.keysOnly && e.valueMapper);
|
|
1097
1098
|
}
|
|
1098
|
-
function
|
|
1099
|
+
function cr(e, t, n, r) {
|
|
1099
1100
|
var i = H(r ? function(o, a, u) {
|
|
1100
1101
|
return n(r(o), a, u);
|
|
1101
1102
|
} : n);
|
|
@@ -1117,17 +1118,17 @@ var Er = { exports: {} };
|
|
|
1117
1118
|
});
|
|
1118
1119
|
});
|
|
1119
1120
|
}
|
|
1120
|
-
var
|
|
1121
|
+
var Qr = (L.prototype._read = function(e, t) {
|
|
1121
1122
|
var n = this._ctx;
|
|
1122
|
-
return n.error ? n.table._trans(null,
|
|
1123
|
+
return n.error ? n.table._trans(null, J.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
1123
1124
|
}, L.prototype._write = function(e) {
|
|
1124
1125
|
var t = this._ctx;
|
|
1125
|
-
return t.error ? t.table._trans(null,
|
|
1126
|
+
return t.error ? t.table._trans(null, J.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
1126
1127
|
}, L.prototype._addAlgorithm = function(e) {
|
|
1127
1128
|
var t = this._ctx;
|
|
1128
1129
|
t.algorithm = Ie(t.algorithm, e);
|
|
1129
1130
|
}, L.prototype._iterate = function(e, t) {
|
|
1130
|
-
return
|
|
1131
|
+
return At(this._ctx, e, t, this._ctx.table.core);
|
|
1131
1132
|
}, L.prototype.clone = function(e) {
|
|
1132
1133
|
var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1133
1134
|
return e && q(n, e), t._ctx = n, t;
|
|
@@ -1136,18 +1137,18 @@ var Er = { exports: {} };
|
|
|
1136
1137
|
}, L.prototype.each = function(e) {
|
|
1137
1138
|
var t = this._ctx;
|
|
1138
1139
|
return this._read(function(n) {
|
|
1139
|
-
return
|
|
1140
|
+
return At(t, e, n, t.table.core);
|
|
1140
1141
|
});
|
|
1141
1142
|
}, L.prototype.count = function(e) {
|
|
1142
1143
|
var t = this;
|
|
1143
1144
|
return this._read(function(n) {
|
|
1144
1145
|
var r = t._ctx, i = r.table.core;
|
|
1145
1146
|
if (Qe(r, !0))
|
|
1146
|
-
return i.count({ trans: n, query: { index:
|
|
1147
|
+
return i.count({ trans: n, query: { index: Kt(r, i.schema), range: r.range } }).then(function(a) {
|
|
1147
1148
|
return Math.min(a, r.limit);
|
|
1148
1149
|
});
|
|
1149
1150
|
var o = 0;
|
|
1150
|
-
return
|
|
1151
|
+
return At(r, function() {
|
|
1151
1152
|
return ++o, !1;
|
|
1152
1153
|
}, n, i).then(function() {
|
|
1153
1154
|
return o;
|
|
@@ -1155,28 +1156,28 @@ var Er = { exports: {} };
|
|
|
1155
1156
|
}).then(e);
|
|
1156
1157
|
}, L.prototype.sortBy = function(e, t) {
|
|
1157
1158
|
var n = e.split(".").reverse(), r = n[0], i = n.length - 1;
|
|
1158
|
-
function o(
|
|
1159
|
-
return l ? o(
|
|
1159
|
+
function o(h, l) {
|
|
1160
|
+
return l ? o(h[n[l]], l - 1) : h[r];
|
|
1160
1161
|
}
|
|
1161
1162
|
var a = this._ctx.dir === "next" ? 1 : -1;
|
|
1162
|
-
function u(
|
|
1163
|
-
return
|
|
1163
|
+
function u(h, l) {
|
|
1164
|
+
return h = o(h, i), l = o(l, i), h < l ? -a : l < h ? a : 0;
|
|
1164
1165
|
}
|
|
1165
|
-
return this.toArray(function(
|
|
1166
|
-
return
|
|
1166
|
+
return this.toArray(function(h) {
|
|
1167
|
+
return h.sort(u);
|
|
1167
1168
|
}).then(t);
|
|
1168
1169
|
}, L.prototype.toArray = function(e) {
|
|
1169
1170
|
var t = this;
|
|
1170
1171
|
return this._read(function(n) {
|
|
1171
1172
|
var r = t._ctx;
|
|
1172
1173
|
if (r.dir === "next" && Qe(r, !0) && 0 < r.limit) {
|
|
1173
|
-
var i = r.valueMapper, o =
|
|
1174
|
+
var i = r.valueMapper, o = Kt(r, r.table.core.schema);
|
|
1174
1175
|
return r.table.core.query({ trans: n, limit: r.limit, values: !0, query: { index: o, range: r.range } }).then(function(u) {
|
|
1175
1176
|
return u = u.result, i ? u.map(i) : u;
|
|
1176
1177
|
});
|
|
1177
1178
|
}
|
|
1178
1179
|
var a = [];
|
|
1179
|
-
return
|
|
1180
|
+
return At(r, function(u) {
|
|
1180
1181
|
return a.push(u);
|
|
1181
1182
|
}, n, r.table.core).then(function() {
|
|
1182
1183
|
return a;
|
|
@@ -1184,28 +1185,28 @@ var Er = { exports: {} };
|
|
|
1184
1185
|
}, e);
|
|
1185
1186
|
}, L.prototype.offset = function(e) {
|
|
1186
1187
|
var t = this._ctx;
|
|
1187
|
-
return e <= 0 || (t.offset += e, Qe(t) ?
|
|
1188
|
+
return e <= 0 || (t.offset += e, Qe(t) ? cn(t, function() {
|
|
1188
1189
|
var n = e;
|
|
1189
1190
|
return function(r, i) {
|
|
1190
1191
|
return n === 0 || (n === 1 ? --n : i(function() {
|
|
1191
1192
|
r.advance(n), n = 0;
|
|
1192
1193
|
}), !1);
|
|
1193
1194
|
};
|
|
1194
|
-
}) :
|
|
1195
|
+
}) : cn(t, function() {
|
|
1195
1196
|
var n = e;
|
|
1196
1197
|
return function() {
|
|
1197
1198
|
return --n < 0;
|
|
1198
1199
|
};
|
|
1199
1200
|
})), this;
|
|
1200
1201
|
}, L.prototype.limit = function(e) {
|
|
1201
|
-
return this._ctx.limit = Math.min(this._ctx.limit, e),
|
|
1202
|
+
return this._ctx.limit = Math.min(this._ctx.limit, e), cn(this._ctx, function() {
|
|
1202
1203
|
var t = e;
|
|
1203
1204
|
return function(n, r, i) {
|
|
1204
1205
|
return --t <= 0 && r(i), 0 <= t;
|
|
1205
1206
|
};
|
|
1206
1207
|
}, !0), this;
|
|
1207
1208
|
}, L.prototype.until = function(e, t) {
|
|
1208
|
-
return
|
|
1209
|
+
return un(this._ctx, function(n, r, i) {
|
|
1209
1210
|
return !e(n.value) || (r(i), t);
|
|
1210
1211
|
}), this;
|
|
1211
1212
|
}, L.prototype.first = function(e) {
|
|
@@ -1216,7 +1217,7 @@ var Er = { exports: {} };
|
|
|
1216
1217
|
return this.reverse().first(e);
|
|
1217
1218
|
}, L.prototype.filter = function(e) {
|
|
1218
1219
|
var t;
|
|
1219
|
-
return
|
|
1220
|
+
return un(this._ctx, function(n) {
|
|
1220
1221
|
return e(n.value);
|
|
1221
1222
|
}), (t = this._ctx).isMatch = Ie(t.isMatch, e), this;
|
|
1222
1223
|
}, L.prototype.and = function(e) {
|
|
@@ -1252,7 +1253,7 @@ var Er = { exports: {} };
|
|
|
1252
1253
|
var t = this._ctx;
|
|
1253
1254
|
if (t.dir === "next" && Qe(t, !0) && 0 < t.limit)
|
|
1254
1255
|
return this._read(function(r) {
|
|
1255
|
-
var i =
|
|
1256
|
+
var i = Kt(t, t.table.core.schema);
|
|
1256
1257
|
return t.table.core.query({ trans: r, values: !1, limit: t.limit, query: { index: i, range: t.range } });
|
|
1257
1258
|
}).then(function(r) {
|
|
1258
1259
|
return r.result;
|
|
@@ -1277,7 +1278,7 @@ var Er = { exports: {} };
|
|
|
1277
1278
|
if (!e || !e.multi)
|
|
1278
1279
|
return this;
|
|
1279
1280
|
var t = {};
|
|
1280
|
-
return
|
|
1281
|
+
return un(this._ctx, function(i) {
|
|
1281
1282
|
var r = i.primaryKey.toString(), i = ne(t, r);
|
|
1282
1283
|
return t[r] = !0, !i;
|
|
1283
1284
|
}), this;
|
|
@@ -1287,49 +1288,49 @@ var Er = { exports: {} };
|
|
|
1287
1288
|
var i, o, a;
|
|
1288
1289
|
a = typeof e == "function" ? e : (i = T(e), o = i.length, function(p) {
|
|
1289
1290
|
for (var b = !1, w = 0; w < o; ++w) {
|
|
1290
|
-
var
|
|
1291
|
-
ye(p,
|
|
1291
|
+
var k = i[w], x = e[k];
|
|
1292
|
+
ye(p, k) !== x && (ce(p, k, x), b = !0);
|
|
1292
1293
|
}
|
|
1293
1294
|
return b;
|
|
1294
1295
|
});
|
|
1295
|
-
function u(p,
|
|
1296
|
-
var w =
|
|
1297
|
-
y += p -
|
|
1298
|
-
for (var
|
|
1299
|
-
var P = O[
|
|
1300
|
-
|
|
1296
|
+
function u(p, k) {
|
|
1297
|
+
var w = k.failures, k = k.numFailures;
|
|
1298
|
+
y += p - k;
|
|
1299
|
+
for (var x = 0, O = T(w); x < O.length; x++) {
|
|
1300
|
+
var P = O[x];
|
|
1301
|
+
d.push(w[P]);
|
|
1301
1302
|
}
|
|
1302
1303
|
}
|
|
1303
|
-
var
|
|
1304
|
+
var h = n.table.core, l = h.schema.primaryKey, m = l.outbound, c = l.extractKey, f = t.db._options.modifyChunkSize || 200, d = [], y = 0, g = [];
|
|
1304
1305
|
return t.clone().primaryKeys().then(function(p) {
|
|
1305
1306
|
function b(w) {
|
|
1306
|
-
var
|
|
1307
|
-
return
|
|
1308
|
-
for (var O = [], P = [], S =
|
|
1309
|
-
var B =
|
|
1310
|
-
a.call(R, R.value, R) !== !1 && (R.value == null ? C.push(p[w + E]) :
|
|
1307
|
+
var k = Math.min(f, p.length - w);
|
|
1308
|
+
return h.getMany({ trans: r, keys: p.slice(w, w + k), cache: "immutable" }).then(function(x) {
|
|
1309
|
+
for (var O = [], P = [], S = m ? [] : null, C = [], E = 0; E < k; ++E) {
|
|
1310
|
+
var B = x[E], R = { value: _e(B), primKey: p[w + E] };
|
|
1311
|
+
a.call(R, R.value, R) !== !1 && (R.value == null ? C.push(p[w + E]) : m || U(c(B), c(R.value)) === 0 ? (P.push(R.value), m && S.push(p[w + E])) : (C.push(p[w + E]), O.push(R.value)));
|
|
1311
1312
|
}
|
|
1312
|
-
var $ = Qe(n) && n.limit === 1 / 0 && (typeof e != "function" || e ===
|
|
1313
|
-
return Promise.resolve(0 < O.length &&
|
|
1313
|
+
var $ = Qe(n) && n.limit === 1 / 0 && (typeof e != "function" || e === ln) && { index: n.index, range: n.range };
|
|
1314
|
+
return Promise.resolve(0 < O.length && h.mutate({ trans: r, type: "add", values: O }).then(function(z) {
|
|
1314
1315
|
for (var G in z.failures)
|
|
1315
1316
|
C.splice(parseInt(G), 1);
|
|
1316
1317
|
u(O.length, z);
|
|
1317
1318
|
})).then(function() {
|
|
1318
|
-
return (0 < P.length || $ && typeof e == "object") &&
|
|
1319
|
+
return (0 < P.length || $ && typeof e == "object") && h.mutate({ trans: r, type: "put", keys: S, values: P, criteria: $, changeSpec: typeof e != "function" && e }).then(function(z) {
|
|
1319
1320
|
return u(P.length, z);
|
|
1320
1321
|
});
|
|
1321
1322
|
}).then(function() {
|
|
1322
|
-
return (0 < C.length || $ && e ===
|
|
1323
|
+
return (0 < C.length || $ && e === ln) && h.mutate({ trans: r, type: "delete", keys: C, criteria: $ }).then(function(z) {
|
|
1323
1324
|
return u(C.length, z);
|
|
1324
1325
|
});
|
|
1325
1326
|
}).then(function() {
|
|
1326
|
-
return p.length > w +
|
|
1327
|
+
return p.length > w + k && b(w + f);
|
|
1327
1328
|
});
|
|
1328
1329
|
});
|
|
1329
1330
|
}
|
|
1330
1331
|
return b(0).then(function() {
|
|
1331
|
-
if (0 <
|
|
1332
|
-
throw new
|
|
1332
|
+
if (0 < d.length)
|
|
1333
|
+
throw new vt("Error modifying one or more objects", d, y, g);
|
|
1333
1334
|
return p.length;
|
|
1334
1335
|
});
|
|
1335
1336
|
});
|
|
@@ -1342,39 +1343,39 @@ var Er = { exports: {} };
|
|
|
1342
1343
|
return e.table.core.mutate({ trans: n, type: "deleteRange", range: i }).then(function(a) {
|
|
1343
1344
|
var u = a.failures;
|
|
1344
1345
|
if (a.lastResult, a.results, a = a.numFailures, a)
|
|
1345
|
-
throw new
|
|
1346
|
-
return u[
|
|
1346
|
+
throw new vt("Could not delete some values", Object.keys(u).map(function(h) {
|
|
1347
|
+
return u[h];
|
|
1347
1348
|
}), o - a);
|
|
1348
1349
|
return o - a;
|
|
1349
1350
|
});
|
|
1350
1351
|
});
|
|
1351
|
-
}) : this.modify(
|
|
1352
|
+
}) : this.modify(ln);
|
|
1352
1353
|
}, L);
|
|
1353
1354
|
function L() {
|
|
1354
1355
|
}
|
|
1355
|
-
var
|
|
1356
|
+
var ln = function(e, t) {
|
|
1356
1357
|
return t.value = null;
|
|
1357
1358
|
};
|
|
1358
|
-
function
|
|
1359
|
+
function Xr(e, t) {
|
|
1359
1360
|
return e < t ? -1 : e === t ? 0 : 1;
|
|
1360
1361
|
}
|
|
1361
|
-
function
|
|
1362
|
+
function Jr(e, t) {
|
|
1362
1363
|
return t < e ? -1 : e === t ? 0 : 1;
|
|
1363
1364
|
}
|
|
1364
1365
|
function se(e, t, n) {
|
|
1365
|
-
return e = e instanceof
|
|
1366
|
+
return e = e instanceof fr ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
|
|
1366
1367
|
}
|
|
1367
1368
|
function Xe(e) {
|
|
1368
1369
|
return new e.Collection(e, function() {
|
|
1369
|
-
return
|
|
1370
|
+
return lr("");
|
|
1370
1371
|
}).limit(0);
|
|
1371
1372
|
}
|
|
1372
|
-
function
|
|
1373
|
-
var i, o, a, u,
|
|
1373
|
+
function Dt(e, t, n, r) {
|
|
1374
|
+
var i, o, a, u, h, l, m, c = n.length;
|
|
1374
1375
|
if (!n.every(function(y) {
|
|
1375
1376
|
return typeof y == "string";
|
|
1376
1377
|
}))
|
|
1377
|
-
return se(e,
|
|
1378
|
+
return se(e, nr);
|
|
1378
1379
|
function f(y) {
|
|
1379
1380
|
i = y === "next" ? function(p) {
|
|
1380
1381
|
return p.toUpperCase();
|
|
@@ -1384,32 +1385,32 @@ var Er = { exports: {} };
|
|
|
1384
1385
|
return p.toLowerCase();
|
|
1385
1386
|
} : function(p) {
|
|
1386
1387
|
return p.toUpperCase();
|
|
1387
|
-
}, a = y === "next" ?
|
|
1388
|
-
var
|
|
1388
|
+
}, a = y === "next" ? Xr : Jr;
|
|
1389
|
+
var g = n.map(function(p) {
|
|
1389
1390
|
return { lower: o(p), upper: i(p) };
|
|
1390
1391
|
}).sort(function(p, b) {
|
|
1391
1392
|
return a(p.lower, b.lower);
|
|
1392
1393
|
});
|
|
1393
|
-
u =
|
|
1394
|
+
u = g.map(function(p) {
|
|
1394
1395
|
return p.upper;
|
|
1395
|
-
}),
|
|
1396
|
+
}), h = g.map(function(p) {
|
|
1396
1397
|
return p.lower;
|
|
1397
|
-
}),
|
|
1398
|
+
}), m = (l = y) === "next" ? "" : r;
|
|
1398
1399
|
}
|
|
1399
1400
|
f("next"), e = new e.Collection(e, function() {
|
|
1400
|
-
return Ee(u[0],
|
|
1401
|
+
return Ee(u[0], h[c - 1] + r);
|
|
1401
1402
|
}), e._ondirectionchange = function(y) {
|
|
1402
1403
|
f(y);
|
|
1403
1404
|
};
|
|
1404
|
-
var
|
|
1405
|
-
return e._addAlgorithm(function(y,
|
|
1405
|
+
var d = 0;
|
|
1406
|
+
return e._addAlgorithm(function(y, g, p) {
|
|
1406
1407
|
var b = y.key;
|
|
1407
1408
|
if (typeof b != "string")
|
|
1408
1409
|
return !1;
|
|
1409
1410
|
var w = o(b);
|
|
1410
|
-
if (t(w,
|
|
1411
|
+
if (t(w, h, d))
|
|
1411
1412
|
return !0;
|
|
1412
|
-
for (var
|
|
1413
|
+
for (var k = null, x = d; x < c; ++x) {
|
|
1413
1414
|
var O = function(P, S, C, E, B, R) {
|
|
1414
1415
|
for (var $ = Math.min(P.length, E.length), z = -1, G = 0; G < $; ++G) {
|
|
1415
1416
|
var ue = S[G];
|
|
@@ -1418,21 +1419,21 @@ var Er = { exports: {} };
|
|
|
1418
1419
|
B(P[G], ue) < 0 && (z = G);
|
|
1419
1420
|
}
|
|
1420
1421
|
return $ < E.length && R === "next" ? P + C.substr(P.length) : $ < P.length && R === "prev" ? P.substr(0, C.length) : z < 0 ? null : P.substr(0, z) + E[z] + C.substr(z + 1);
|
|
1421
|
-
}(b, w, u[
|
|
1422
|
-
O === null &&
|
|
1422
|
+
}(b, w, u[x], h[x], a, l);
|
|
1423
|
+
O === null && k === null ? d = x + 1 : (k === null || 0 < a(k, O)) && (k = O);
|
|
1423
1424
|
}
|
|
1424
|
-
return
|
|
1425
|
-
y.continue(
|
|
1425
|
+
return g(k !== null ? function() {
|
|
1426
|
+
y.continue(k + m);
|
|
1426
1427
|
} : p), !1;
|
|
1427
1428
|
}), e;
|
|
1428
1429
|
}
|
|
1429
1430
|
function Ee(e, t, n, r) {
|
|
1430
1431
|
return { type: 2, lower: e, upper: t, lowerOpen: n, upperOpen: r };
|
|
1431
1432
|
}
|
|
1432
|
-
function
|
|
1433
|
+
function lr(e) {
|
|
1433
1434
|
return { type: 1, lower: e, upper: e };
|
|
1434
1435
|
}
|
|
1435
|
-
var
|
|
1436
|
+
var fr = (Object.defineProperty(te.prototype, "Collection", { get: function() {
|
|
1436
1437
|
return this._ctx.table.db.Collection;
|
|
1437
1438
|
}, enumerable: !1, configurable: !0 }), te.prototype.between = function(e, t, n, r) {
|
|
1438
1439
|
n = n !== !1, r = r === !0;
|
|
@@ -1441,56 +1442,56 @@ var Er = { exports: {} };
|
|
|
1441
1442
|
return Ee(e, t, !n, !r);
|
|
1442
1443
|
});
|
|
1443
1444
|
} catch {
|
|
1444
|
-
return se(this,
|
|
1445
|
+
return se(this, ge);
|
|
1445
1446
|
}
|
|
1446
1447
|
}, te.prototype.equals = function(e) {
|
|
1447
|
-
return e == null ? se(this,
|
|
1448
|
-
return
|
|
1448
|
+
return e == null ? se(this, ge) : new this.Collection(this, function() {
|
|
1449
|
+
return lr(e);
|
|
1449
1450
|
});
|
|
1450
1451
|
}, te.prototype.above = function(e) {
|
|
1451
|
-
return e == null ? se(this,
|
|
1452
|
+
return e == null ? se(this, ge) : new this.Collection(this, function() {
|
|
1452
1453
|
return Ee(e, void 0, !0);
|
|
1453
1454
|
});
|
|
1454
1455
|
}, te.prototype.aboveOrEqual = function(e) {
|
|
1455
|
-
return e == null ? se(this,
|
|
1456
|
+
return e == null ? se(this, ge) : new this.Collection(this, function() {
|
|
1456
1457
|
return Ee(e, void 0, !1);
|
|
1457
1458
|
});
|
|
1458
1459
|
}, te.prototype.below = function(e) {
|
|
1459
|
-
return e == null ? se(this,
|
|
1460
|
+
return e == null ? se(this, ge) : new this.Collection(this, function() {
|
|
1460
1461
|
return Ee(void 0, e, !1, !0);
|
|
1461
1462
|
});
|
|
1462
1463
|
}, te.prototype.belowOrEqual = function(e) {
|
|
1463
|
-
return e == null ? se(this,
|
|
1464
|
+
return e == null ? se(this, ge) : new this.Collection(this, function() {
|
|
1464
1465
|
return Ee(void 0, e);
|
|
1465
1466
|
});
|
|
1466
1467
|
}, te.prototype.startsWith = function(e) {
|
|
1467
|
-
return typeof e != "string" ? se(this,
|
|
1468
|
+
return typeof e != "string" ? se(this, nr) : this.between(e, e + Be, !0, !0);
|
|
1468
1469
|
}, te.prototype.startsWithIgnoreCase = function(e) {
|
|
1469
|
-
return e === "" ? this.startsWith(e) :
|
|
1470
|
+
return e === "" ? this.startsWith(e) : Dt(this, function(t, n) {
|
|
1470
1471
|
return t.indexOf(n[0]) === 0;
|
|
1471
1472
|
}, [e], Be);
|
|
1472
1473
|
}, te.prototype.equalsIgnoreCase = function(e) {
|
|
1473
|
-
return
|
|
1474
|
+
return Dt(this, function(t, n) {
|
|
1474
1475
|
return t === n[0];
|
|
1475
1476
|
}, [e], "");
|
|
1476
1477
|
}, te.prototype.anyOfIgnoreCase = function() {
|
|
1477
|
-
var e =
|
|
1478
|
-
return e.length === 0 ? Xe(this) :
|
|
1478
|
+
var e = me.apply(Ue, arguments);
|
|
1479
|
+
return e.length === 0 ? Xe(this) : Dt(this, function(t, n) {
|
|
1479
1480
|
return n.indexOf(t) !== -1;
|
|
1480
1481
|
}, e, "");
|
|
1481
1482
|
}, te.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1482
|
-
var e =
|
|
1483
|
-
return e.length === 0 ? Xe(this) :
|
|
1483
|
+
var e = me.apply(Ue, arguments);
|
|
1484
|
+
return e.length === 0 ? Xe(this) : Dt(this, function(t, n) {
|
|
1484
1485
|
return n.some(function(r) {
|
|
1485
1486
|
return t.indexOf(r) === 0;
|
|
1486
1487
|
});
|
|
1487
1488
|
}, e, Be);
|
|
1488
1489
|
}, te.prototype.anyOf = function() {
|
|
1489
|
-
var e = this, t =
|
|
1490
|
+
var e = this, t = me.apply(Ue, arguments), n = this._cmp;
|
|
1490
1491
|
try {
|
|
1491
1492
|
t.sort(n);
|
|
1492
1493
|
} catch {
|
|
1493
|
-
return se(this,
|
|
1494
|
+
return se(this, ge);
|
|
1494
1495
|
}
|
|
1495
1496
|
if (t.length === 0)
|
|
1496
1497
|
return Xe(this);
|
|
@@ -1502,23 +1503,23 @@ var Er = { exports: {} };
|
|
|
1502
1503
|
};
|
|
1503
1504
|
var i = 0;
|
|
1504
1505
|
return r._addAlgorithm(function(o, a, u) {
|
|
1505
|
-
for (var
|
|
1506
|
+
for (var h = o.key; 0 < n(h, t[i]); )
|
|
1506
1507
|
if (++i === t.length)
|
|
1507
1508
|
return a(u), !1;
|
|
1508
|
-
return n(
|
|
1509
|
+
return n(h, t[i]) === 0 || (a(function() {
|
|
1509
1510
|
o.continue(t[i]);
|
|
1510
1511
|
}), !1);
|
|
1511
1512
|
}), r;
|
|
1512
1513
|
}, te.prototype.notEqual = function(e) {
|
|
1513
1514
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1514
1515
|
}, te.prototype.noneOf = function() {
|
|
1515
|
-
var e =
|
|
1516
|
+
var e = me.apply(Ue, arguments);
|
|
1516
1517
|
if (e.length === 0)
|
|
1517
1518
|
return new this.Collection(this);
|
|
1518
1519
|
try {
|
|
1519
1520
|
e.sort(this._ascending);
|
|
1520
1521
|
} catch {
|
|
1521
|
-
return se(this,
|
|
1522
|
+
return se(this, ge);
|
|
1522
1523
|
}
|
|
1523
1524
|
var t = e.reduce(function(n, r) {
|
|
1524
1525
|
return n ? n.concat([[n[n.length - 1][1], r]]) : [[-1 / 0, r]];
|
|
@@ -1532,47 +1533,47 @@ var Er = { exports: {} };
|
|
|
1532
1533
|
return w[0] !== void 0 && w[1] !== void 0 && i(w[0], w[1]) <= 0;
|
|
1533
1534
|
}))
|
|
1534
1535
|
return se(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", I.InvalidArgument);
|
|
1535
|
-
var
|
|
1536
|
-
function f(w,
|
|
1537
|
-
return c(w[0],
|
|
1536
|
+
var h = !t || t.includeLowers !== !1, l = t && t.includeUppers === !0, m, c = i;
|
|
1537
|
+
function f(w, k) {
|
|
1538
|
+
return c(w[0], k[0]);
|
|
1538
1539
|
}
|
|
1539
1540
|
try {
|
|
1540
|
-
(
|
|
1541
|
-
for (var
|
|
1542
|
-
var P = w[
|
|
1543
|
-
if (r(
|
|
1544
|
-
P[0] = a(P[0],
|
|
1541
|
+
(m = b.reduce(function(w, k) {
|
|
1542
|
+
for (var x = 0, O = w.length; x < O; ++x) {
|
|
1543
|
+
var P = w[x];
|
|
1544
|
+
if (r(k[0], P[1]) < 0 && 0 < r(k[1], P[0])) {
|
|
1545
|
+
P[0] = a(P[0], k[0]), P[1] = u(P[1], k[1]);
|
|
1545
1546
|
break;
|
|
1546
1547
|
}
|
|
1547
1548
|
}
|
|
1548
|
-
return
|
|
1549
|
+
return x === O && w.push(k), w;
|
|
1549
1550
|
}, [])).sort(f);
|
|
1550
1551
|
} catch {
|
|
1551
|
-
return se(this,
|
|
1552
|
+
return se(this, ge);
|
|
1552
1553
|
}
|
|
1553
|
-
var
|
|
1554
|
-
return 0 < i(w,
|
|
1554
|
+
var d = 0, y = l ? function(w) {
|
|
1555
|
+
return 0 < i(w, m[d][1]);
|
|
1555
1556
|
} : function(w) {
|
|
1556
|
-
return 0 <= i(w,
|
|
1557
|
-
},
|
|
1558
|
-
return 0 < o(w,
|
|
1557
|
+
return 0 <= i(w, m[d][1]);
|
|
1558
|
+
}, g = h ? function(w) {
|
|
1559
|
+
return 0 < o(w, m[d][0]);
|
|
1559
1560
|
} : function(w) {
|
|
1560
|
-
return 0 <= o(w,
|
|
1561
|
+
return 0 <= o(w, m[d][0]);
|
|
1561
1562
|
}, p = y, b = new this.Collection(this, function() {
|
|
1562
|
-
return Ee(
|
|
1563
|
+
return Ee(m[0][0], m[m.length - 1][1], !h, !l);
|
|
1563
1564
|
});
|
|
1564
1565
|
return b._ondirectionchange = function(w) {
|
|
1565
|
-
c = w === "next" ? (p = y, i) : (p =
|
|
1566
|
-
}, b._addAlgorithm(function(w,
|
|
1566
|
+
c = w === "next" ? (p = y, i) : (p = g, o), m.sort(f);
|
|
1567
|
+
}, b._addAlgorithm(function(w, k, x) {
|
|
1567
1568
|
for (var O, P = w.key; p(P); )
|
|
1568
|
-
if (++
|
|
1569
|
-
return x
|
|
1570
|
-
return !y(O = P) && !
|
|
1571
|
-
c === i ? w.continue(
|
|
1569
|
+
if (++d === m.length)
|
|
1570
|
+
return k(x), !1;
|
|
1571
|
+
return !y(O = P) && !g(O) || (n._cmp(P, m[d][1]) === 0 || n._cmp(P, m[d][0]) === 0 || k(function() {
|
|
1572
|
+
c === i ? w.continue(m[d][0]) : w.continue(m[d][1]);
|
|
1572
1573
|
}), !1);
|
|
1573
1574
|
}), b;
|
|
1574
1575
|
}, te.prototype.startsWithAnyOf = function() {
|
|
1575
|
-
var e =
|
|
1576
|
+
var e = me.apply(Ue, arguments);
|
|
1576
1577
|
return e.every(function(t) {
|
|
1577
1578
|
return typeof t == "string";
|
|
1578
1579
|
}) ? e.length === 0 ? Xe(this) : this.inAnyRange(e.map(function(t) {
|
|
@@ -1581,7 +1582,7 @@ var Er = { exports: {} };
|
|
|
1581
1582
|
}, te);
|
|
1582
1583
|
function te() {
|
|
1583
1584
|
}
|
|
1584
|
-
function
|
|
1585
|
+
function de(e) {
|
|
1585
1586
|
return H(function(t) {
|
|
1586
1587
|
return ut(t), e(t.target.error), !1;
|
|
1587
1588
|
});
|
|
@@ -1589,7 +1590,7 @@ var Er = { exports: {} };
|
|
|
1589
1590
|
function ut(e) {
|
|
1590
1591
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1591
1592
|
}
|
|
1592
|
-
var ct = "storagemutated",
|
|
1593
|
+
var ct = "storagemutated", fn = "x-storagemutated-1", Pe = at(null, ct), Zr = (pe.prototype._lock = function() {
|
|
1593
1594
|
return Ze(!D.global), ++this._reculock, this._reculock !== 1 || D.global || (D.lockOwnerFor = this), this;
|
|
1594
1595
|
}, pe.prototype._unlock = function() {
|
|
1595
1596
|
if (Ze(!D.global), --this._reculock == 0)
|
|
@@ -1629,9 +1630,9 @@ var Er = { exports: {} };
|
|
|
1629
1630
|
}, pe.prototype._promise = function(e, t, n) {
|
|
1630
1631
|
var r = this;
|
|
1631
1632
|
if (e === "readwrite" && this.mode !== "readwrite")
|
|
1632
|
-
return
|
|
1633
|
+
return J(new I.ReadOnly("Transaction is readonly"));
|
|
1633
1634
|
if (!this.active)
|
|
1634
|
-
return
|
|
1635
|
+
return J(new I.TransactionInactive());
|
|
1635
1636
|
if (this._locked())
|
|
1636
1637
|
return new K(function(o, a) {
|
|
1637
1638
|
r._blockedFuncs.push([function() {
|
|
@@ -1639,11 +1640,11 @@ var Er = { exports: {} };
|
|
|
1639
1640
|
}, D]);
|
|
1640
1641
|
});
|
|
1641
1642
|
if (n)
|
|
1642
|
-
return
|
|
1643
|
+
return xe(function() {
|
|
1643
1644
|
var o = new K(function(a, u) {
|
|
1644
1645
|
r._lock();
|
|
1645
|
-
var
|
|
1646
|
-
|
|
1646
|
+
var h = t(a, u, r);
|
|
1647
|
+
h && h.then && h.then(a, u);
|
|
1647
1648
|
});
|
|
1648
1649
|
return o.finally(function() {
|
|
1649
1650
|
return r._unlock();
|
|
@@ -1688,13 +1689,13 @@ var Er = { exports: {} };
|
|
|
1688
1689
|
}, pe);
|
|
1689
1690
|
function pe() {
|
|
1690
1691
|
}
|
|
1691
|
-
function
|
|
1692
|
-
return { name: e, keyPath: t, unique: n, multi: r, auto: i, compound: o, src: (n && !a ? "&" : "") + (r ? "*" : "") + (i ? "++" : "") +
|
|
1692
|
+
function hn(e, t, n, r, i, o, a) {
|
|
1693
|
+
return { name: e, keyPath: t, unique: n, multi: r, auto: i, compound: o, src: (n && !a ? "&" : "") + (r ? "*" : "") + (i ? "++" : "") + hr(t) };
|
|
1693
1694
|
}
|
|
1694
|
-
function
|
|
1695
|
+
function hr(e) {
|
|
1695
1696
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
1696
1697
|
}
|
|
1697
|
-
function
|
|
1698
|
+
function dn(e, t, n) {
|
|
1698
1699
|
return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (r = function(i) {
|
|
1699
1700
|
return [i.name, i];
|
|
1700
1701
|
}, n.reduce(function(i, o, a) {
|
|
@@ -1713,7 +1714,7 @@ var Er = { exports: {} };
|
|
|
1713
1714
|
}, Be;
|
|
1714
1715
|
}
|
|
1715
1716
|
};
|
|
1716
|
-
function
|
|
1717
|
+
function pn(e) {
|
|
1717
1718
|
return e == null ? function() {
|
|
1718
1719
|
} : typeof e == "string" ? (t = e).split(".").length === 1 ? function(n) {
|
|
1719
1720
|
return n[t];
|
|
@@ -1724,33 +1725,33 @@ var Er = { exports: {} };
|
|
|
1724
1725
|
};
|
|
1725
1726
|
var t;
|
|
1726
1727
|
}
|
|
1727
|
-
function
|
|
1728
|
+
function dr(e) {
|
|
1728
1729
|
return [].slice.call(e);
|
|
1729
1730
|
}
|
|
1730
|
-
var
|
|
1731
|
+
var qr = 0;
|
|
1731
1732
|
function ft(e) {
|
|
1732
1733
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1733
1734
|
}
|
|
1734
|
-
function
|
|
1735
|
+
function ei(e, t, h) {
|
|
1735
1736
|
function r(p) {
|
|
1736
1737
|
if (p.type === 3)
|
|
1737
1738
|
return null;
|
|
1738
1739
|
if (p.type === 4)
|
|
1739
1740
|
throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1740
|
-
var
|
|
1741
|
-
return
|
|
1741
|
+
var d = p.lower, y = p.upper, g = p.lowerOpen, p = p.upperOpen;
|
|
1742
|
+
return d === void 0 ? y === void 0 ? null : t.upperBound(y, !!p) : y === void 0 ? t.lowerBound(d, !!g) : t.bound(d, y, !!g, !!p);
|
|
1742
1743
|
}
|
|
1743
1744
|
function i(f) {
|
|
1744
|
-
var
|
|
1745
|
-
return { name: y, schema: f, mutate: function(
|
|
1746
|
-
var p =
|
|
1745
|
+
var d, y = f.name;
|
|
1746
|
+
return { name: y, schema: f, mutate: function(g) {
|
|
1747
|
+
var p = g.trans, b = g.type, w = g.keys, k = g.values, x = g.range;
|
|
1747
1748
|
return new Promise(function(O, P) {
|
|
1748
1749
|
O = H(O);
|
|
1749
1750
|
var S = p.objectStore(y), C = S.keyPath == null, E = b === "put" || b === "add";
|
|
1750
1751
|
if (!E && b !== "delete" && b !== "deleteRange")
|
|
1751
1752
|
throw new Error("Invalid operation type: " + b);
|
|
1752
|
-
var B, R = (w ||
|
|
1753
|
-
if (w &&
|
|
1753
|
+
var B, R = (w || k || { length: 1 }).length;
|
|
1754
|
+
if (w && k && w.length !== k.length)
|
|
1754
1755
|
throw new Error("Given keys array must have same length as given values array.");
|
|
1755
1756
|
if (R === 0)
|
|
1756
1757
|
return O({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
@@ -1759,11 +1760,11 @@ var Er = { exports: {} };
|
|
|
1759
1760
|
}
|
|
1760
1761
|
var z = [], G = [], ue = 0;
|
|
1761
1762
|
if (b === "deleteRange") {
|
|
1762
|
-
if (
|
|
1763
|
+
if (x.type === 4)
|
|
1763
1764
|
return O({ numFailures: ue, failures: G, results: [], lastResult: void 0 });
|
|
1764
|
-
|
|
1765
|
+
x.type === 3 ? z.push(B = S.clear()) : z.push(B = S.delete(r(x)));
|
|
1765
1766
|
} else {
|
|
1766
|
-
var C = E ? C ? [
|
|
1767
|
+
var C = E ? C ? [k, w] : [k, null] : [w, null], N = C[0], be = C[1];
|
|
1767
1768
|
if (E)
|
|
1768
1769
|
for (var ie = 0; ie < R; ++ie)
|
|
1769
1770
|
z.push(B = be && be[ie] !== void 0 ? S[b](N[ie], be[ie]) : S[b](N[ie])), B.onerror = $;
|
|
@@ -1771,57 +1772,57 @@ var Er = { exports: {} };
|
|
|
1771
1772
|
for (ie = 0; ie < R; ++ie)
|
|
1772
1773
|
z.push(B = S[b](N[ie])), B.onerror = $;
|
|
1773
1774
|
}
|
|
1774
|
-
function
|
|
1775
|
-
ae = ae.target.result, z.forEach(function(Fe,
|
|
1776
|
-
return Fe.error != null && (G[
|
|
1775
|
+
function Vt(ae) {
|
|
1776
|
+
ae = ae.target.result, z.forEach(function(Fe, Tn) {
|
|
1777
|
+
return Fe.error != null && (G[Tn] = Fe.error);
|
|
1777
1778
|
}), O({ numFailures: ue, failures: G, results: b === "delete" ? w : z.map(function(Fe) {
|
|
1778
1779
|
return Fe.result;
|
|
1779
1780
|
}), lastResult: ae });
|
|
1780
1781
|
}
|
|
1781
1782
|
B.onerror = function(ae) {
|
|
1782
|
-
$(ae),
|
|
1783
|
-
}, B.onsuccess =
|
|
1783
|
+
$(ae), Vt(ae);
|
|
1784
|
+
}, B.onsuccess = Vt;
|
|
1784
1785
|
});
|
|
1785
|
-
}, getMany: function(
|
|
1786
|
-
var p =
|
|
1787
|
-
return new Promise(function(w,
|
|
1786
|
+
}, getMany: function(g) {
|
|
1787
|
+
var p = g.trans, b = g.keys;
|
|
1788
|
+
return new Promise(function(w, k) {
|
|
1788
1789
|
w = H(w);
|
|
1789
|
-
for (var
|
|
1790
|
+
for (var x, O = p.objectStore(y), P = b.length, S = new Array(P), C = 0, E = 0, B = function(z) {
|
|
1790
1791
|
z = z.target, S[z._pos] = z.result, ++E === C && w(S);
|
|
1791
|
-
}, R =
|
|
1792
|
-
b[$] != null && ((
|
|
1792
|
+
}, R = de(k), $ = 0; $ < P; ++$)
|
|
1793
|
+
b[$] != null && ((x = O.get(b[$]))._pos = $, x.onsuccess = B, x.onerror = R, ++C);
|
|
1793
1794
|
C === 0 && w(S);
|
|
1794
1795
|
});
|
|
1795
|
-
}, get: function(
|
|
1796
|
-
var p =
|
|
1797
|
-
return new Promise(function(w,
|
|
1796
|
+
}, get: function(g) {
|
|
1797
|
+
var p = g.trans, b = g.key;
|
|
1798
|
+
return new Promise(function(w, k) {
|
|
1798
1799
|
w = H(w);
|
|
1799
|
-
var
|
|
1800
|
-
|
|
1800
|
+
var x = p.objectStore(y).get(b);
|
|
1801
|
+
x.onsuccess = function(O) {
|
|
1801
1802
|
return w(O.target.result);
|
|
1802
|
-
},
|
|
1803
|
+
}, x.onerror = de(k);
|
|
1803
1804
|
});
|
|
1804
|
-
}, query: (
|
|
1805
|
+
}, query: (d = l, function(g) {
|
|
1805
1806
|
return new Promise(function(p, b) {
|
|
1806
1807
|
p = H(p);
|
|
1807
|
-
var w,
|
|
1808
|
+
var w, k, x, C = g.trans, O = g.values, P = g.limit, B = g.query, S = P === 1 / 0 ? void 0 : P, E = B.index, B = B.range, C = C.objectStore(y), E = E.isPrimaryKey ? C : C.index(E.name), B = r(B);
|
|
1808
1809
|
if (P === 0)
|
|
1809
1810
|
return p({ result: [] });
|
|
1810
|
-
|
|
1811
|
+
d ? ((S = O ? E.getAll(B, S) : E.getAllKeys(B, S)).onsuccess = function(R) {
|
|
1811
1812
|
return p({ result: R.target.result });
|
|
1812
|
-
}, S.onerror =
|
|
1813
|
-
var $ =
|
|
1814
|
-
return $ ? (
|
|
1815
|
-
},
|
|
1813
|
+
}, S.onerror = de(b)) : (w = 0, k = !O && "openKeyCursor" in E ? E.openKeyCursor(B) : E.openCursor(B), x = [], k.onsuccess = function(R) {
|
|
1814
|
+
var $ = k.result;
|
|
1815
|
+
return $ ? (x.push(O ? $.value : $.primaryKey), ++w === P ? p({ result: x }) : void $.continue()) : p({ result: x });
|
|
1816
|
+
}, k.onerror = de(b));
|
|
1816
1817
|
});
|
|
1817
|
-
}), openCursor: function(
|
|
1818
|
-
var p =
|
|
1818
|
+
}), openCursor: function(g) {
|
|
1819
|
+
var p = g.trans, b = g.values, w = g.query, k = g.reverse, x = g.unique;
|
|
1819
1820
|
return new Promise(function(O, P) {
|
|
1820
1821
|
O = H(O);
|
|
1821
|
-
var E = w.index, S = w.range, C = p.objectStore(y), C = E.isPrimaryKey ? C : C.index(E.name), E =
|
|
1822
|
-
B.onerror =
|
|
1822
|
+
var E = w.index, S = w.range, C = p.objectStore(y), C = E.isPrimaryKey ? C : C.index(E.name), E = k ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", B = !b && "openKeyCursor" in C ? C.openKeyCursor(r(S), E) : C.openCursor(r(S), E);
|
|
1823
|
+
B.onerror = de(P), B.onsuccess = H(function(R) {
|
|
1823
1824
|
var $, z, G, ue, N = B.result;
|
|
1824
|
-
N ? (N.___id = ++
|
|
1825
|
+
N ? (N.___id = ++qr, N.done = !1, $ = N.continue.bind(N), z = (z = N.continuePrimaryKey) && z.bind(N), G = N.advance.bind(N), ue = function() {
|
|
1825
1826
|
throw new Error("Cursor not stopped");
|
|
1826
1827
|
}, N.trans = p, N.stop = N.continue = N.continuePrimaryKey = N.advance = function() {
|
|
1827
1828
|
throw new Error("Cursor not started");
|
|
@@ -1845,56 +1846,56 @@ var Er = { exports: {} };
|
|
|
1845
1846
|
throw new Error("Cursor behind last entry");
|
|
1846
1847
|
}, N.stop();
|
|
1847
1848
|
}
|
|
1848
|
-
var
|
|
1849
|
-
ae = H(ae), B.onerror =
|
|
1850
|
-
N.stop = N.continue = N.continuePrimaryKey = N.advance = ue, ae(
|
|
1849
|
+
var Vt = new Promise(function(ae, Fe) {
|
|
1850
|
+
ae = H(ae), B.onerror = de(Fe), N.fail = Fe, N.stop = function(Tn) {
|
|
1851
|
+
N.stop = N.continue = N.continuePrimaryKey = N.advance = ue, ae(Tn);
|
|
1851
1852
|
};
|
|
1852
1853
|
});
|
|
1853
1854
|
return B.onsuccess = H(function(ae) {
|
|
1854
1855
|
B.onsuccess = ie, ie();
|
|
1855
|
-
}), N.continue = $, N.continuePrimaryKey = z, N.advance = G, ie(),
|
|
1856
|
+
}), N.continue = $, N.continuePrimaryKey = z, N.advance = G, ie(), Vt;
|
|
1856
1857
|
}, O(N)) : O(null);
|
|
1857
1858
|
}, P);
|
|
1858
1859
|
});
|
|
1859
|
-
}, count: function(
|
|
1860
|
-
var p =
|
|
1861
|
-
return new Promise(function(
|
|
1862
|
-
var P = b.objectStore(y), S = w.isPrimaryKey ? P : P.index(w.name), P = r(
|
|
1860
|
+
}, count: function(g) {
|
|
1861
|
+
var p = g.query, b = g.trans, w = p.index, k = p.range;
|
|
1862
|
+
return new Promise(function(x, O) {
|
|
1863
|
+
var P = b.objectStore(y), S = w.isPrimaryKey ? P : P.index(w.name), P = r(k), S = P ? S.count(P) : S.count();
|
|
1863
1864
|
S.onsuccess = H(function(C) {
|
|
1864
|
-
return
|
|
1865
|
-
}), S.onerror =
|
|
1865
|
+
return x(C.target.result);
|
|
1866
|
+
}), S.onerror = de(O);
|
|
1866
1867
|
});
|
|
1867
1868
|
} };
|
|
1868
1869
|
}
|
|
1869
|
-
var o, a, u,
|
|
1870
|
+
var o, a, u, m = (a = h, u = dr((o = e).objectStoreNames), { schema: { name: o.name, tables: u.map(function(f) {
|
|
1870
1871
|
return a.objectStore(f);
|
|
1871
1872
|
}).map(function(f) {
|
|
1872
|
-
var
|
|
1873
|
+
var d = f.keyPath, p = f.autoIncrement, y = W(d), g = {}, p = { name: f.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: d == null, compound: y, keyPath: d, autoIncrement: p, unique: !0, extractKey: pn(d) }, indexes: dr(f.indexNames).map(function(b) {
|
|
1873
1874
|
return f.index(b);
|
|
1874
|
-
}).map(function(
|
|
1875
|
-
var w =
|
|
1876
|
-
return
|
|
1875
|
+
}).map(function(x) {
|
|
1876
|
+
var w = x.name, k = x.unique, O = x.multiEntry, x = x.keyPath, O = { name: w, compound: W(x), keyPath: x, unique: k, multiEntry: O, extractKey: pn(x) };
|
|
1877
|
+
return g[ft(x)] = O;
|
|
1877
1878
|
}), getIndexByKeyPath: function(b) {
|
|
1878
|
-
return
|
|
1879
|
+
return g[ft(b)];
|
|
1879
1880
|
} };
|
|
1880
|
-
return
|
|
1881
|
-
}) }, hasGetAll: 0 < u.length && "getAll" in a.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }),
|
|
1882
|
-
return
|
|
1881
|
+
return g[":id"] = p.primaryKey, d != null && (g[ft(d)] = p.primaryKey), p;
|
|
1882
|
+
}) }, hasGetAll: 0 < u.length && "getAll" in a.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = m.schema, l = m.hasGetAll, m = h.tables.map(i), c = {};
|
|
1883
|
+
return m.forEach(function(f) {
|
|
1883
1884
|
return c[f.name] = f;
|
|
1884
1885
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(f) {
|
|
1885
1886
|
if (!c[f])
|
|
1886
1887
|
throw new Error("Table '".concat(f, "' not found"));
|
|
1887
1888
|
return c[f];
|
|
1888
|
-
}, MIN_KEY: -1 / 0, MAX_KEY: lt(t), schema:
|
|
1889
|
+
}, MIN_KEY: -1 / 0, MAX_KEY: lt(t), schema: h };
|
|
1889
1890
|
}
|
|
1890
|
-
function
|
|
1891
|
+
function ti(e, t, n, r) {
|
|
1891
1892
|
var i = n.IDBKeyRange;
|
|
1892
|
-
return n.indexedDB, { dbcore: (r =
|
|
1893
|
+
return n.indexedDB, { dbcore: (r = ei(t, i, r), e.dbcore.reduce(function(o, a) {
|
|
1893
1894
|
return a = a.create, _(_({}, o), a(o));
|
|
1894
1895
|
}, r)) };
|
|
1895
1896
|
}
|
|
1896
|
-
function
|
|
1897
|
-
var n = r.db, r =
|
|
1897
|
+
function Tt(e, r) {
|
|
1898
|
+
var n = r.db, r = ti(e._middlewares, n, e._deps, r);
|
|
1898
1899
|
e.core = r.dbcore, e.tables.forEach(function(i) {
|
|
1899
1900
|
var o = i.name;
|
|
1900
1901
|
e.core.schema.tables.some(function(a) {
|
|
@@ -1902,118 +1903,118 @@ var Er = { exports: {} };
|
|
|
1902
1903
|
}) && (i.core = e.core.table(o), e[o] instanceof e.Table && (e[o].core = i.core));
|
|
1903
1904
|
});
|
|
1904
1905
|
}
|
|
1905
|
-
function
|
|
1906
|
+
function Bt(e, t, n, r) {
|
|
1906
1907
|
n.forEach(function(i) {
|
|
1907
1908
|
var o = r[i];
|
|
1908
1909
|
t.forEach(function(a) {
|
|
1909
|
-
var u = function
|
|
1910
|
-
return
|
|
1910
|
+
var u = function h(l, m) {
|
|
1911
|
+
return Dr(l, m) || (l = oe(l)) && h(l, m);
|
|
1911
1912
|
}(a, i);
|
|
1912
1913
|
(!u || "value" in u && u.value === void 0) && (a === e.Transaction.prototype || a instanceof e.Transaction ? we(a, i, { get: function() {
|
|
1913
1914
|
return this.table(i);
|
|
1914
|
-
}, set: function(
|
|
1915
|
-
|
|
1915
|
+
}, set: function(h) {
|
|
1916
|
+
Un(this, i, { value: h, writable: !0, configurable: !0, enumerable: !0 });
|
|
1916
1917
|
} }) : a[i] = new e.Table(i, o));
|
|
1917
1918
|
});
|
|
1918
1919
|
});
|
|
1919
1920
|
}
|
|
1920
|
-
function
|
|
1921
|
+
function yn(e, t) {
|
|
1921
1922
|
t.forEach(function(n) {
|
|
1922
1923
|
for (var r in n)
|
|
1923
1924
|
n[r] instanceof e.Table && delete n[r];
|
|
1924
1925
|
});
|
|
1925
1926
|
}
|
|
1926
|
-
function
|
|
1927
|
+
function ni(e, t) {
|
|
1927
1928
|
return e._cfg.version - t._cfg.version;
|
|
1928
1929
|
}
|
|
1929
|
-
function
|
|
1930
|
+
function ri(e, t, n, r) {
|
|
1930
1931
|
var i = e._dbSchema;
|
|
1931
|
-
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta =
|
|
1932
|
+
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = dn("$meta", yr("")[0], []), e._storeNames.push("$meta"));
|
|
1932
1933
|
var o = e._createTransaction("readwrite", e._storeNames, i);
|
|
1933
1934
|
o.create(n), o._completion.catch(r);
|
|
1934
1935
|
var a = o._reject.bind(o), u = D.transless || D;
|
|
1935
|
-
|
|
1936
|
-
return D.trans = o, D.transless = u, t !== 0 ? (
|
|
1937
|
-
return
|
|
1938
|
-
}) : K.resolve(l)).then(function(
|
|
1939
|
-
return f =
|
|
1936
|
+
xe(function() {
|
|
1937
|
+
return D.trans = o, D.transless = u, t !== 0 ? (Tt(e, n), l = t, ((h = o).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(m) {
|
|
1938
|
+
return m ?? l;
|
|
1939
|
+
}) : K.resolve(l)).then(function(m) {
|
|
1940
|
+
return f = m, d = o, y = n, g = [], m = (c = e)._versions, p = c._dbSchema = Rt(0, c.idbdb, y), (m = m.filter(function(b) {
|
|
1940
1941
|
return b._cfg.version >= f;
|
|
1941
|
-
})).length !== 0 ? (
|
|
1942
|
-
|
|
1943
|
-
var w = p,
|
|
1944
|
-
|
|
1945
|
-
var
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
}),
|
|
1942
|
+
})).length !== 0 ? (m.forEach(function(b) {
|
|
1943
|
+
g.push(function() {
|
|
1944
|
+
var w = p, k = b._cfg.dbschema;
|
|
1945
|
+
Mt(c, w, y), Mt(c, k, y), p = c._dbSchema = k;
|
|
1946
|
+
var x = mn(w, k);
|
|
1947
|
+
x.add.forEach(function(E) {
|
|
1948
|
+
gn(y, E[0], E[1].primKey, E[1].indexes);
|
|
1949
|
+
}), x.change.forEach(function(E) {
|
|
1949
1950
|
if (E.recreate)
|
|
1950
1951
|
throw new I.Upgrade("Not yet support for changing primary key");
|
|
1951
1952
|
var B = y.objectStore(E.name);
|
|
1952
1953
|
E.add.forEach(function(R) {
|
|
1953
|
-
return
|
|
1954
|
+
return It(B, R);
|
|
1954
1955
|
}), E.change.forEach(function(R) {
|
|
1955
|
-
B.deleteIndex(R.name),
|
|
1956
|
+
B.deleteIndex(R.name), It(B, R);
|
|
1956
1957
|
}), E.del.forEach(function(R) {
|
|
1957
1958
|
return B.deleteIndex(R);
|
|
1958
1959
|
});
|
|
1959
1960
|
});
|
|
1960
1961
|
var O = b._cfg.contentUpgrade;
|
|
1961
1962
|
if (O && b._cfg.version > f) {
|
|
1962
|
-
|
|
1963
|
-
var P =
|
|
1964
|
-
|
|
1963
|
+
Tt(c, y), d._memoizedTables = {};
|
|
1964
|
+
var P = Vn(k);
|
|
1965
|
+
x.del.forEach(function(E) {
|
|
1965
1966
|
P[E] = w[E];
|
|
1966
|
-
}),
|
|
1967
|
-
var S, C =
|
|
1968
|
-
return C && Ye(),
|
|
1967
|
+
}), yn(c, [c.Transaction.prototype]), Bt(c, [c.Transaction.prototype], T(P), P), d.schema = P;
|
|
1968
|
+
var S, C = Ht(O);
|
|
1969
|
+
return C && Ye(), x = K.follow(function() {
|
|
1969
1970
|
var E;
|
|
1970
|
-
(S = O(
|
|
1971
|
-
}), S && typeof S.then == "function" ? K.resolve(S) :
|
|
1971
|
+
(S = O(d)) && C && (E = Oe.bind(null, null), S.then(E, E));
|
|
1972
|
+
}), S && typeof S.then == "function" ? K.resolve(S) : x.then(function() {
|
|
1972
1973
|
return S;
|
|
1973
1974
|
});
|
|
1974
1975
|
}
|
|
1975
|
-
}),
|
|
1976
|
-
var
|
|
1977
|
-
|
|
1978
|
-
return
|
|
1979
|
-
}),
|
|
1980
|
-
}),
|
|
1981
|
-
c.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(c.idbdb.version / 10) === b._cfg.version ? (c.idbdb.deleteObjectStore("$meta"), delete c._dbSchema.$meta, c._storeNames = c._storeNames.filter(function(
|
|
1982
|
-
return
|
|
1976
|
+
}), g.push(function(w) {
|
|
1977
|
+
var k, x, O = b._cfg.dbschema;
|
|
1978
|
+
k = O, x = w, [].slice.call(x.db.objectStoreNames).forEach(function(P) {
|
|
1979
|
+
return k[P] == null && x.db.deleteObjectStore(P);
|
|
1980
|
+
}), yn(c, [c.Transaction.prototype]), Bt(c, [c.Transaction.prototype], c._storeNames, c._dbSchema), d.schema = c._dbSchema;
|
|
1981
|
+
}), g.push(function(w) {
|
|
1982
|
+
c.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(c.idbdb.version / 10) === b._cfg.version ? (c.idbdb.deleteObjectStore("$meta"), delete c._dbSchema.$meta, c._storeNames = c._storeNames.filter(function(k) {
|
|
1983
|
+
return k !== "$meta";
|
|
1983
1984
|
})) : w.objectStore("$meta").put(b._cfg.version, "version"));
|
|
1984
1985
|
});
|
|
1985
1986
|
}), function b() {
|
|
1986
|
-
return
|
|
1987
|
+
return g.length ? K.resolve(g.shift()(d.idbtrans)).then(b) : K.resolve();
|
|
1987
1988
|
}().then(function() {
|
|
1988
|
-
|
|
1989
|
+
pr(p, y);
|
|
1989
1990
|
})) : K.resolve();
|
|
1990
|
-
var c, f,
|
|
1991
|
-
}).catch(a)) : (T(i).forEach(function(
|
|
1992
|
-
|
|
1993
|
-
}),
|
|
1991
|
+
var c, f, d, y, g, p;
|
|
1992
|
+
}).catch(a)) : (T(i).forEach(function(m) {
|
|
1993
|
+
gn(n, m, i[m].primKey, i[m].indexes);
|
|
1994
|
+
}), Tt(e, n), void K.follow(function() {
|
|
1994
1995
|
return e.on.populate.fire(o);
|
|
1995
1996
|
}).catch(a));
|
|
1996
|
-
var
|
|
1997
|
+
var h, l;
|
|
1997
1998
|
});
|
|
1998
1999
|
}
|
|
1999
|
-
function
|
|
2000
|
-
|
|
2001
|
-
var n =
|
|
2002
|
-
|
|
2003
|
-
for (var r = 0, i =
|
|
2000
|
+
function ii(e, t) {
|
|
2001
|
+
pr(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");
|
|
2002
|
+
var n = Rt(0, e.idbdb, t);
|
|
2003
|
+
Mt(e, e._dbSchema, t);
|
|
2004
|
+
for (var r = 0, i = mn(n, e._dbSchema).change; r < i.length; r++) {
|
|
2004
2005
|
var o = function(a) {
|
|
2005
2006
|
if (a.change.length || a.recreate)
|
|
2006
2007
|
return console.warn("Unable to patch indexes of table ".concat(a.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
2007
2008
|
var u = t.objectStore(a.name);
|
|
2008
|
-
a.add.forEach(function(
|
|
2009
|
-
fe && console.debug("Dexie upgrade patch: Creating missing index ".concat(a.name, ".").concat(
|
|
2009
|
+
a.add.forEach(function(h) {
|
|
2010
|
+
fe && console.debug("Dexie upgrade patch: Creating missing index ".concat(a.name, ".").concat(h.src)), It(u, h);
|
|
2010
2011
|
});
|
|
2011
2012
|
}(i[r]);
|
|
2012
2013
|
if (typeof o == "object")
|
|
2013
2014
|
return o.value;
|
|
2014
2015
|
}
|
|
2015
2016
|
}
|
|
2016
|
-
function
|
|
2017
|
+
function mn(e, t) {
|
|
2017
2018
|
var n, r = { del: [], add: [], change: [] };
|
|
2018
2019
|
for (n in e)
|
|
2019
2020
|
t[n] || r.del.push(n);
|
|
@@ -2024,12 +2025,12 @@ var Er = { exports: {} };
|
|
|
2024
2025
|
if ("" + (i.primKey.keyPath || "") != "" + (o.primKey.keyPath || "") || i.primKey.auto !== o.primKey.auto)
|
|
2025
2026
|
a.recreate = !0, r.change.push(a);
|
|
2026
2027
|
else {
|
|
2027
|
-
var u = i.idxByName,
|
|
2028
|
+
var u = i.idxByName, h = o.idxByName, l = void 0;
|
|
2028
2029
|
for (l in u)
|
|
2029
|
-
|
|
2030
|
-
for (l in
|
|
2031
|
-
var
|
|
2032
|
-
|
|
2030
|
+
h[l] || a.del.push(l);
|
|
2031
|
+
for (l in h) {
|
|
2032
|
+
var m = u[l], c = h[l];
|
|
2033
|
+
m ? m.src !== c.src && a.change.push(c) : a.add.push(c);
|
|
2033
2034
|
}
|
|
2034
2035
|
(0 < a.del.length || 0 < a.add.length || 0 < a.change.length) && r.change.push(a);
|
|
2035
2036
|
}
|
|
@@ -2038,51 +2039,51 @@ var Er = { exports: {} };
|
|
|
2038
2039
|
}
|
|
2039
2040
|
return r;
|
|
2040
2041
|
}
|
|
2041
|
-
function
|
|
2042
|
+
function gn(e, t, n, r) {
|
|
2042
2043
|
var i = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2043
2044
|
return r.forEach(function(o) {
|
|
2044
|
-
return
|
|
2045
|
+
return It(i, o);
|
|
2045
2046
|
}), i;
|
|
2046
2047
|
}
|
|
2047
|
-
function
|
|
2048
|
+
function pr(e, t) {
|
|
2048
2049
|
T(e).forEach(function(n) {
|
|
2049
|
-
t.db.objectStoreNames.contains(n) || (fe && console.debug("Dexie: Creating missing table", n),
|
|
2050
|
+
t.db.objectStoreNames.contains(n) || (fe && console.debug("Dexie: Creating missing table", n), gn(t, n, e[n].primKey, e[n].indexes));
|
|
2050
2051
|
});
|
|
2051
2052
|
}
|
|
2052
|
-
function
|
|
2053
|
+
function It(e, t) {
|
|
2053
2054
|
e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
|
|
2054
2055
|
}
|
|
2055
|
-
function
|
|
2056
|
+
function Rt(e, t, n) {
|
|
2056
2057
|
var r = {};
|
|
2057
|
-
return
|
|
2058
|
-
for (var o = n.objectStore(i), a =
|
|
2059
|
-
var
|
|
2060
|
-
u.push(
|
|
2058
|
+
return gt(t.objectStoreNames, 0).forEach(function(i) {
|
|
2059
|
+
for (var o = n.objectStore(i), a = hn(hr(l = o.keyPath), l || "", !0, !1, !!o.autoIncrement, l && typeof l != "string", !0), u = [], h = 0; h < o.indexNames.length; ++h) {
|
|
2060
|
+
var m = o.index(o.indexNames[h]), l = m.keyPath, m = hn(m.name, l, !!m.unique, !!m.multiEntry, !1, l && typeof l != "string", !1);
|
|
2061
|
+
u.push(m);
|
|
2061
2062
|
}
|
|
2062
|
-
r[i] =
|
|
2063
|
+
r[i] = dn(i, a, u);
|
|
2063
2064
|
}), r;
|
|
2064
2065
|
}
|
|
2065
|
-
function
|
|
2066
|
+
function Mt(e, t, n) {
|
|
2066
2067
|
for (var r = n.db.objectStoreNames, i = 0; i < r.length; ++i) {
|
|
2067
2068
|
var o = r[i], a = n.objectStore(o);
|
|
2068
2069
|
e._hasGetAll = "getAll" in a;
|
|
2069
2070
|
for (var u = 0; u < a.indexNames.length; ++u) {
|
|
2070
|
-
var
|
|
2071
|
-
!t[o] || (l = t[o].idxByName[
|
|
2071
|
+
var h = a.indexNames[u], l = a.index(h).keyPath, m = typeof l == "string" ? l : "[" + gt(l).join("+") + "]";
|
|
2072
|
+
!t[o] || (l = t[o].idxByName[m]) && (l.name = h, delete t[o].idxByName[m], t[o].idxByName[h] = l);
|
|
2072
2073
|
}
|
|
2073
2074
|
}
|
|
2074
2075
|
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && F.WorkerGlobalScope && F instanceof F.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2075
2076
|
}
|
|
2076
|
-
function
|
|
2077
|
+
function yr(e) {
|
|
2077
2078
|
return e.split(",").map(function(t, n) {
|
|
2078
2079
|
var r = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), i = /^\[/.test(r) ? r.match(/^\[(.*)\]$/)[1].split("+") : r;
|
|
2079
|
-
return
|
|
2080
|
+
return hn(r, i || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), W(i), n === 0);
|
|
2080
2081
|
});
|
|
2081
2082
|
}
|
|
2082
|
-
var
|
|
2083
|
+
var oi = (Ft.prototype._parseStoresSpec = function(e, t) {
|
|
2083
2084
|
T(e).forEach(function(n) {
|
|
2084
2085
|
if (e[n] !== null) {
|
|
2085
|
-
var r =
|
|
2086
|
+
var r = yr(e[n]), i = r.shift();
|
|
2086
2087
|
if (i.unique = !0, i.multi)
|
|
2087
2088
|
throw new I.Schema("Primary key cannot be multi-valued");
|
|
2088
2089
|
r.forEach(function(o) {
|
|
@@ -2090,34 +2091,34 @@ var Er = { exports: {} };
|
|
|
2090
2091
|
throw new I.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2091
2092
|
if (!o.keyPath)
|
|
2092
2093
|
throw new I.Schema("Index must have a name and cannot be an empty string");
|
|
2093
|
-
}), t[n] =
|
|
2094
|
+
}), t[n] = dn(n, i, r);
|
|
2094
2095
|
}
|
|
2095
2096
|
});
|
|
2096
|
-
},
|
|
2097
|
+
}, Ft.prototype.stores = function(n) {
|
|
2097
2098
|
var t = this.db;
|
|
2098
2099
|
this._cfg.storesSource = this._cfg.storesSource ? q(this._cfg.storesSource, n) : n;
|
|
2099
2100
|
var n = t._versions, r = {}, i = {};
|
|
2100
2101
|
return n.forEach(function(o) {
|
|
2101
2102
|
q(r, o._cfg.storesSource), i = o._cfg.dbschema = {}, o._parseStoresSpec(r, i);
|
|
2102
|
-
}), t._dbSchema = i,
|
|
2103
|
-
},
|
|
2104
|
-
return this._cfg.contentUpgrade =
|
|
2105
|
-
},
|
|
2106
|
-
function
|
|
2103
|
+
}), t._dbSchema = i, yn(t, [t._allTables, t, t.Transaction.prototype]), Bt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], T(i), i), t._storeNames = T(i), this;
|
|
2104
|
+
}, Ft.prototype.upgrade = function(e) {
|
|
2105
|
+
return this._cfg.contentUpgrade = Xt(this._cfg.contentUpgrade || V, e), this;
|
|
2106
|
+
}, Ft);
|
|
2107
|
+
function Ft() {
|
|
2107
2108
|
}
|
|
2108
|
-
function
|
|
2109
|
+
function vn(e, t) {
|
|
2109
2110
|
var n = e._dbNamesDB;
|
|
2110
|
-
return n || (n = e._dbNamesDB = new ve(
|
|
2111
|
+
return n || (n = e._dbNamesDB = new ve(jt, { addons: [], indexedDB: e, IDBKeyRange: t })).version(1).stores({ dbnames: "name" }), n.table("dbnames");
|
|
2111
2112
|
}
|
|
2112
|
-
function
|
|
2113
|
+
function bn(e) {
|
|
2113
2114
|
return e && typeof e.databases == "function";
|
|
2114
2115
|
}
|
|
2115
|
-
function
|
|
2116
|
-
return
|
|
2116
|
+
function wn(e) {
|
|
2117
|
+
return xe(function() {
|
|
2117
2118
|
return D.letThrough = !0, e();
|
|
2118
2119
|
});
|
|
2119
2120
|
}
|
|
2120
|
-
function
|
|
2121
|
+
function _n(e) {
|
|
2121
2122
|
return !("from" in e);
|
|
2122
2123
|
}
|
|
2123
2124
|
var re = function(e, t) {
|
|
@@ -2127,40 +2128,40 @@ var Er = { exports: {} };
|
|
|
2127
2128
|
}
|
|
2128
2129
|
q(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
2129
2130
|
};
|
|
2130
|
-
function
|
|
2131
|
+
function ht(e, t, n) {
|
|
2131
2132
|
var r = U(t, n);
|
|
2132
2133
|
if (!isNaN(r)) {
|
|
2133
2134
|
if (0 < r)
|
|
2134
2135
|
throw RangeError();
|
|
2135
|
-
if (
|
|
2136
|
+
if (_n(e))
|
|
2136
2137
|
return q(e, { from: t, to: n, d: 1 });
|
|
2137
2138
|
var i = e.l, r = e.r;
|
|
2138
2139
|
if (U(n, e.from) < 0)
|
|
2139
|
-
return i ?
|
|
2140
|
+
return i ? ht(i, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, mr(e);
|
|
2140
2141
|
if (0 < U(t, e.to))
|
|
2141
|
-
return r ?
|
|
2142
|
-
U(t, e.from) < 0 && (e.from = t, e.l = null, e.d = r ? r.d + 1 : 1), 0 < U(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, i && !e.l &&
|
|
2142
|
+
return r ? ht(r, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, mr(e);
|
|
2143
|
+
U(t, e.from) < 0 && (e.from = t, e.l = null, e.d = r ? r.d + 1 : 1), 0 < U(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, i && !e.l && dt(e, i), r && n && dt(e, r);
|
|
2143
2144
|
}
|
|
2144
2145
|
}
|
|
2145
|
-
function
|
|
2146
|
-
|
|
2147
|
-
var o =
|
|
2148
|
-
|
|
2146
|
+
function dt(e, t) {
|
|
2147
|
+
_n(t) || function n(r, h) {
|
|
2148
|
+
var o = h.from, a = h.to, u = h.l, h = h.r;
|
|
2149
|
+
ht(r, o, a), u && n(r, u), h && n(r, h);
|
|
2149
2150
|
}(e, t);
|
|
2150
2151
|
}
|
|
2151
|
-
function
|
|
2152
|
-
var n =
|
|
2152
|
+
function Nt(e, t) {
|
|
2153
|
+
var n = kn(t), r = n.next();
|
|
2153
2154
|
if (r.done)
|
|
2154
2155
|
return !1;
|
|
2155
|
-
for (var i = r.value, o =
|
|
2156
|
+
for (var i = r.value, o = kn(e), a = o.next(i.from), u = a.value; !r.done && !a.done; ) {
|
|
2156
2157
|
if (U(u.from, i.to) <= 0 && 0 <= U(u.to, i.from))
|
|
2157
2158
|
return !0;
|
|
2158
2159
|
U(i.from, u.from) < 0 ? i = (r = n.next(u.from)).value : u = (a = o.next(i.from)).value;
|
|
2159
2160
|
}
|
|
2160
2161
|
return !1;
|
|
2161
2162
|
}
|
|
2162
|
-
function
|
|
2163
|
-
var t =
|
|
2163
|
+
function kn(e) {
|
|
2164
|
+
var t = _n(e) ? null : { s: 0, n: e };
|
|
2164
2165
|
return { next: function(n) {
|
|
2165
2166
|
for (var r = 0 < arguments.length; t; )
|
|
2166
2167
|
switch (t.s) {
|
|
@@ -2185,83 +2186,83 @@ var Er = { exports: {} };
|
|
|
2185
2186
|
return { done: !0 };
|
|
2186
2187
|
} };
|
|
2187
2188
|
}
|
|
2188
|
-
function
|
|
2189
|
+
function mr(e) {
|
|
2189
2190
|
var t, n, r = (((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 < r ? "r" : r < -1 ? "l" : "";
|
|
2190
|
-
i && (t = i == "r" ? "l" : "r", n = _({}, e), r = e[i], e.from = r.from, e.to = r.to, e[i] = r[i], n[i] = r[t], (e[t] = n).d =
|
|
2191
|
+
i && (t = i == "r" ? "l" : "r", n = _({}, e), r = e[i], e.from = r.from, e.to = r.to, e[i] = r[i], n[i] = r[t], (e[t] = n).d = gr(n)), e.d = gr(e);
|
|
2191
2192
|
}
|
|
2192
|
-
function
|
|
2193
|
+
function gr(n) {
|
|
2193
2194
|
var t = n.r, n = n.l;
|
|
2194
2195
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2195
2196
|
}
|
|
2196
|
-
function
|
|
2197
|
+
function zt(e, t) {
|
|
2197
2198
|
return T(t).forEach(function(n) {
|
|
2198
|
-
e[n] ?
|
|
2199
|
+
e[n] ? dt(e[n], t[n]) : e[n] = function r(i) {
|
|
2199
2200
|
var o, a, u = {};
|
|
2200
2201
|
for (o in i)
|
|
2201
|
-
ne(i, o) && (a = i[o], u[o] = !a || typeof a != "object" ||
|
|
2202
|
+
ne(i, o) && (a = i[o], u[o] = !a || typeof a != "object" || Yn.has(a.constructor) ? a : r(a));
|
|
2202
2203
|
return u;
|
|
2203
2204
|
}(t[n]);
|
|
2204
2205
|
}), e;
|
|
2205
2206
|
}
|
|
2206
|
-
function
|
|
2207
|
+
function xn(e, t) {
|
|
2207
2208
|
return e.all || t.all || Object.keys(e).some(function(n) {
|
|
2208
|
-
return t[n] &&
|
|
2209
|
+
return t[n] && Nt(t[n], e[n]);
|
|
2209
2210
|
});
|
|
2210
2211
|
}
|
|
2211
2212
|
ze(re.prototype, ((le = { add: function(e) {
|
|
2212
|
-
return
|
|
2213
|
+
return dt(this, e), this;
|
|
2213
2214
|
}, addKey: function(e) {
|
|
2214
|
-
return
|
|
2215
|
+
return ht(this, e, e), this;
|
|
2215
2216
|
}, addKeys: function(e) {
|
|
2216
2217
|
var t = this;
|
|
2217
2218
|
return e.forEach(function(n) {
|
|
2218
|
-
return
|
|
2219
|
+
return ht(t, n, n);
|
|
2219
2220
|
}), this;
|
|
2220
|
-
} })[
|
|
2221
|
-
return
|
|
2221
|
+
} })[Yt] = function() {
|
|
2222
|
+
return kn(this);
|
|
2222
2223
|
}, le));
|
|
2223
|
-
var Re = {},
|
|
2224
|
-
function
|
|
2225
|
-
|
|
2226
|
-
|
|
2224
|
+
var Re = {}, On = {}, Sn = !1;
|
|
2225
|
+
function Lt(e) {
|
|
2226
|
+
zt(On, e), Sn || (Sn = !0, setTimeout(function() {
|
|
2227
|
+
Sn = !1, En(On, !(On = {}));
|
|
2227
2228
|
}, 0));
|
|
2228
2229
|
}
|
|
2229
|
-
function
|
|
2230
|
+
function En(e, t) {
|
|
2230
2231
|
t === void 0 && (t = !1);
|
|
2231
2232
|
var n = /* @__PURE__ */ new Set();
|
|
2232
2233
|
if (e.all)
|
|
2233
2234
|
for (var r = 0, i = Object.values(Re); r < i.length; r++)
|
|
2234
|
-
|
|
2235
|
+
vr(a = i[r], e, n, t);
|
|
2235
2236
|
else
|
|
2236
2237
|
for (var o in e) {
|
|
2237
2238
|
var a, u = /^idb\:\/\/(.*)\/(.*)\//.exec(o);
|
|
2238
|
-
u && (o = u[1], u = u[2], (a = Re["idb://".concat(o, "/").concat(u)]) &&
|
|
2239
|
+
u && (o = u[1], u = u[2], (a = Re["idb://".concat(o, "/").concat(u)]) && vr(a, e, n, t));
|
|
2239
2240
|
}
|
|
2240
|
-
n.forEach(function(
|
|
2241
|
-
return
|
|
2241
|
+
n.forEach(function(h) {
|
|
2242
|
+
return h();
|
|
2242
2243
|
});
|
|
2243
2244
|
}
|
|
2244
|
-
function
|
|
2245
|
+
function vr(e, t, n, r) {
|
|
2245
2246
|
for (var i = [], o = 0, a = Object.entries(e.queries.query); o < a.length; o++) {
|
|
2246
|
-
for (var u = a[o],
|
|
2247
|
-
var f = c[
|
|
2248
|
-
|
|
2247
|
+
for (var u = a[o], h = u[0], l = [], m = 0, c = u[1]; m < c.length; m++) {
|
|
2248
|
+
var f = c[m];
|
|
2249
|
+
xn(t, f.obsSet) ? f.subscribers.forEach(function(p) {
|
|
2249
2250
|
return n.add(p);
|
|
2250
2251
|
}) : r && l.push(f);
|
|
2251
2252
|
}
|
|
2252
|
-
r && i.push([
|
|
2253
|
+
r && i.push([h, l]);
|
|
2253
2254
|
}
|
|
2254
2255
|
if (r)
|
|
2255
|
-
for (var
|
|
2256
|
-
var
|
|
2257
|
-
e.queries.query[
|
|
2256
|
+
for (var d = 0, y = i; d < y.length; d++) {
|
|
2257
|
+
var g = y[d], h = g[0], l = g[1];
|
|
2258
|
+
e.queries.query[h] = l;
|
|
2258
2259
|
}
|
|
2259
2260
|
}
|
|
2260
|
-
function
|
|
2261
|
+
function ai(e) {
|
|
2261
2262
|
var t = e._state, n = e._deps.indexedDB;
|
|
2262
2263
|
if (t.isBeingOpened || e.idbdb)
|
|
2263
2264
|
return t.dbReadyPromise.then(function() {
|
|
2264
|
-
return t.dbOpenError ?
|
|
2265
|
+
return t.dbOpenError ? J(t.dbOpenError) : e;
|
|
2265
2266
|
});
|
|
2266
2267
|
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
2267
2268
|
var r = t.openCanceller, i = Math.round(10 * e.verno), o = !1;
|
|
@@ -2270,38 +2271,38 @@ var Er = { exports: {} };
|
|
|
2270
2271
|
throw new I.DatabaseClosed("db.open() was cancelled");
|
|
2271
2272
|
}
|
|
2272
2273
|
function u() {
|
|
2273
|
-
return new K(function(f,
|
|
2274
|
+
return new K(function(f, d) {
|
|
2274
2275
|
if (a(), !n)
|
|
2275
2276
|
throw new I.MissingAPI();
|
|
2276
|
-
var y = e.name,
|
|
2277
|
-
if (!
|
|
2277
|
+
var y = e.name, g = t.autoSchema || !i ? n.open(y) : n.open(y, i);
|
|
2278
|
+
if (!g)
|
|
2278
2279
|
throw new I.MissingAPI();
|
|
2279
|
-
|
|
2280
|
+
g.onerror = de(d), g.onblocked = H(e._fireOnBlocked), g.onupgradeneeded = H(function(p) {
|
|
2280
2281
|
var b;
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
})) : (
|
|
2284
|
-
},
|
|
2285
|
-
|
|
2286
|
-
var p, b, w,
|
|
2282
|
+
m = g.transaction, t.autoSchema && !e._options.allowEmptyDB ? (g.onerror = ut, m.abort(), g.result.close(), (b = n.deleteDatabase(y)).onsuccess = b.onerror = H(function() {
|
|
2283
|
+
d(new I.NoSuchDatabase("Database ".concat(y, " doesnt exist")));
|
|
2284
|
+
})) : (m.onerror = de(d), p = p.oldVersion > Math.pow(2, 62) ? 0 : p.oldVersion, c = p < 1, e.idbdb = g.result, o && ii(e, m), ri(e, p / 10, m, d));
|
|
2285
|
+
}, d), g.onsuccess = H(function() {
|
|
2286
|
+
m = null;
|
|
2287
|
+
var p, b, w, k, x, O = e.idbdb = g.result, P = gt(O.objectStoreNames);
|
|
2287
2288
|
if (0 < P.length)
|
|
2288
2289
|
try {
|
|
2289
|
-
var S = O.transaction((
|
|
2290
|
+
var S = O.transaction((k = P).length === 1 ? k[0] : k, "readonly");
|
|
2290
2291
|
if (t.autoSchema)
|
|
2291
|
-
b = O, w = S, (p = e).verno = b.version / 10, w = p._dbSchema =
|
|
2292
|
-
else if (
|
|
2292
|
+
b = O, w = S, (p = e).verno = b.version / 10, w = p._dbSchema = Rt(0, b, w), p._storeNames = gt(b.objectStoreNames, 0), Bt(p, [p._allTables], T(w), w);
|
|
2293
|
+
else if (Mt(e, e._dbSchema, S), ((x = mn(Rt(0, (x = e).idbdb, S), x._dbSchema)).add.length || x.change.some(function(C) {
|
|
2293
2294
|
return C.add.length || C.change.length;
|
|
2294
2295
|
})) && !o)
|
|
2295
2296
|
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."), O.close(), i = O.version + 1, o = !0, f(u());
|
|
2296
|
-
|
|
2297
|
+
Tt(e, S);
|
|
2297
2298
|
} catch {
|
|
2298
2299
|
}
|
|
2299
2300
|
He.push(e), O.onversionchange = H(function(C) {
|
|
2300
2301
|
t.vcFired = !0, e.on("versionchange").fire(C);
|
|
2301
2302
|
}), O.onclose = H(function(C) {
|
|
2302
2303
|
e.on("close").fire(C);
|
|
2303
|
-
}), c && (
|
|
2304
|
-
},
|
|
2304
|
+
}), c && (x = e._deps, S = y, O = x.indexedDB, x = x.IDBKeyRange, bn(O) || S === jt || vn(O, x).put({ name: S }).catch(V)), f();
|
|
2305
|
+
}, d);
|
|
2305
2306
|
}).catch(function(f) {
|
|
2306
2307
|
switch (f == null ? void 0 : f.name) {
|
|
2307
2308
|
case "UnknownError":
|
|
@@ -2315,22 +2316,22 @@ var Er = { exports: {} };
|
|
|
2315
2316
|
return K.reject(f);
|
|
2316
2317
|
});
|
|
2317
2318
|
}
|
|
2318
|
-
var
|
|
2319
|
+
var h, l = t.dbReadyResolve, m = null, c = !1;
|
|
2319
2320
|
return K.race([r, (typeof navigator > "u" ? K.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(f) {
|
|
2320
|
-
function
|
|
2321
|
+
function d() {
|
|
2321
2322
|
return indexedDB.databases().finally(f);
|
|
2322
2323
|
}
|
|
2323
|
-
|
|
2324
|
+
h = setInterval(d, 100), d();
|
|
2324
2325
|
}).finally(function() {
|
|
2325
|
-
return clearInterval(
|
|
2326
|
+
return clearInterval(h);
|
|
2326
2327
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2327
|
-
return a(), t.onReadyBeingFired = [], K.resolve(
|
|
2328
|
+
return a(), t.onReadyBeingFired = [], K.resolve(wn(function() {
|
|
2328
2329
|
return e.on.ready.fire(e.vip);
|
|
2329
2330
|
})).then(function f() {
|
|
2330
2331
|
if (0 < t.onReadyBeingFired.length) {
|
|
2331
|
-
var
|
|
2332
|
-
return t.onReadyBeingFired = [], K.resolve(
|
|
2333
|
-
return
|
|
2332
|
+
var d = t.onReadyBeingFired.reduce(Xt, V);
|
|
2333
|
+
return t.onReadyBeingFired = [], K.resolve(wn(function() {
|
|
2334
|
+
return d(e.vip);
|
|
2334
2335
|
})).then(f);
|
|
2335
2336
|
}
|
|
2336
2337
|
});
|
|
@@ -2339,22 +2340,22 @@ var Er = { exports: {} };
|
|
|
2339
2340
|
}).catch(function(f) {
|
|
2340
2341
|
t.dbOpenError = f;
|
|
2341
2342
|
try {
|
|
2342
|
-
|
|
2343
|
+
m && m.abort();
|
|
2343
2344
|
} catch {
|
|
2344
2345
|
}
|
|
2345
|
-
return r === t.openCanceller && e._close(),
|
|
2346
|
+
return r === t.openCanceller && e._close(), J(f);
|
|
2346
2347
|
}).finally(function() {
|
|
2347
2348
|
t.openComplete = !0, l();
|
|
2348
2349
|
}).then(function() {
|
|
2349
2350
|
var f;
|
|
2350
|
-
return c && (f = {}, e.tables.forEach(function(
|
|
2351
|
-
|
|
2352
|
-
y.name && (f["idb://".concat(e.name, "/").concat(
|
|
2353
|
-
}), f["idb://".concat(e.name, "/").concat(
|
|
2354
|
-
}), Pe(ct).fire(f),
|
|
2351
|
+
return c && (f = {}, e.tables.forEach(function(d) {
|
|
2352
|
+
d.schema.indexes.forEach(function(y) {
|
|
2353
|
+
y.name && (f["idb://".concat(e.name, "/").concat(d.name, "/").concat(y.name)] = new re(-1 / 0, [[[]]]));
|
|
2354
|
+
}), f["idb://".concat(e.name, "/").concat(d.name, "/")] = f["idb://".concat(e.name, "/").concat(d.name, "/:dels")] = new re(-1 / 0, [[[]]]);
|
|
2355
|
+
}), Pe(ct).fire(f), En(f, !0)), e;
|
|
2355
2356
|
});
|
|
2356
2357
|
}
|
|
2357
|
-
function
|
|
2358
|
+
function Pn(e) {
|
|
2358
2359
|
function t(o) {
|
|
2359
2360
|
return e.next(o);
|
|
2360
2361
|
}
|
|
@@ -2362,57 +2363,57 @@ var Er = { exports: {} };
|
|
|
2362
2363
|
return e.throw(o);
|
|
2363
2364
|
});
|
|
2364
2365
|
function i(o) {
|
|
2365
|
-
return function(
|
|
2366
|
-
var u = o(
|
|
2367
|
-
return u.done ?
|
|
2366
|
+
return function(h) {
|
|
2367
|
+
var u = o(h), h = u.value;
|
|
2368
|
+
return u.done ? h : h && typeof h.then == "function" ? h.then(n, r) : W(h) ? Promise.all(h).then(n, r) : n(h);
|
|
2368
2369
|
};
|
|
2369
2370
|
}
|
|
2370
2371
|
return i(t)();
|
|
2371
2372
|
}
|
|
2372
|
-
function
|
|
2373
|
+
function Ut(e, t, n) {
|
|
2373
2374
|
for (var r = W(e) ? e.slice() : [e], i = 0; i < n; ++i)
|
|
2374
2375
|
r.push(t);
|
|
2375
2376
|
return r;
|
|
2376
2377
|
}
|
|
2377
|
-
var
|
|
2378
|
+
var si = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2378
2379
|
return _(_({}, e), { table: function(t) {
|
|
2379
2380
|
var n = e.table(t), r = n.schema, i = {}, o = [];
|
|
2380
|
-
function a(c, f,
|
|
2381
|
-
var y = ft(c),
|
|
2382
|
-
return
|
|
2383
|
-
return w.keyTail -
|
|
2381
|
+
function a(c, f, d) {
|
|
2382
|
+
var y = ft(c), g = i[y] = i[y] || [], p = c == null ? 0 : typeof c == "string" ? 1 : c.length, b = 0 < f, b = _(_({}, d), { name: b ? "".concat(y, "(virtual-from:").concat(d.name, ")") : d.name, lowLevelIndex: d, isVirtual: b, keyTail: f, keyLength: p, extractKey: pn(c), unique: !b && d.unique });
|
|
2383
|
+
return g.push(b), b.isPrimaryKey || o.push(b), 1 < p && a(p === 2 ? c[0] : c.slice(0, p - 1), f + 1, d), g.sort(function(w, k) {
|
|
2384
|
+
return w.keyTail - k.keyTail;
|
|
2384
2385
|
}), b;
|
|
2385
2386
|
}
|
|
2386
2387
|
t = a(r.primaryKey.keyPath, 0, r.primaryKey), i[":id"] = [t];
|
|
2387
|
-
for (var u = 0,
|
|
2388
|
-
var l =
|
|
2388
|
+
for (var u = 0, h = r.indexes; u < h.length; u++) {
|
|
2389
|
+
var l = h[u];
|
|
2389
2390
|
a(l.keyPath, 0, l);
|
|
2390
2391
|
}
|
|
2391
|
-
function
|
|
2392
|
-
var f,
|
|
2393
|
-
return
|
|
2392
|
+
function m(c) {
|
|
2393
|
+
var f, d = c.query.index;
|
|
2394
|
+
return d.isVirtual ? _(_({}, c), { query: { index: d.lowLevelIndex, range: (f = c.query.range, d = d.keyTail, { type: f.type === 1 ? 2 : f.type, lower: Ut(f.lower, f.lowerOpen ? e.MAX_KEY : e.MIN_KEY, d), lowerOpen: !0, upper: Ut(f.upper, f.upperOpen ? e.MIN_KEY : e.MAX_KEY, d), upperOpen: !0 }) } }) : c;
|
|
2394
2395
|
}
|
|
2395
2396
|
return _(_({}, n), { schema: _(_({}, r), { primaryKey: t, indexes: o, getIndexByKeyPath: function(c) {
|
|
2396
2397
|
return (c = i[ft(c)]) && c[0];
|
|
2397
2398
|
} }), count: function(c) {
|
|
2398
|
-
return n.count(
|
|
2399
|
+
return n.count(m(c));
|
|
2399
2400
|
}, query: function(c) {
|
|
2400
|
-
return n.query(
|
|
2401
|
+
return n.query(m(c));
|
|
2401
2402
|
}, openCursor: function(c) {
|
|
2402
|
-
var f = c.query.index,
|
|
2403
|
-
return y ? n.openCursor(
|
|
2403
|
+
var f = c.query.index, d = f.keyTail, y = f.isVirtual, g = f.keyLength;
|
|
2404
|
+
return y ? n.openCursor(m(c)).then(function(b) {
|
|
2404
2405
|
return b && p(b);
|
|
2405
2406
|
}) : n.openCursor(c);
|
|
2406
2407
|
function p(b) {
|
|
2407
2408
|
return Object.create(b, { continue: { value: function(w) {
|
|
2408
|
-
w != null ? b.continue(
|
|
2409
|
-
} }, continuePrimaryKey: { value: function(w,
|
|
2410
|
-
b.continuePrimaryKey(
|
|
2409
|
+
w != null ? b.continue(Ut(w, c.reverse ? e.MAX_KEY : e.MIN_KEY, d)) : c.unique ? b.continue(b.key.slice(0, g).concat(c.reverse ? e.MIN_KEY : e.MAX_KEY, d)) : b.continue();
|
|
2410
|
+
} }, continuePrimaryKey: { value: function(w, k) {
|
|
2411
|
+
b.continuePrimaryKey(Ut(w, e.MAX_KEY, d), k);
|
|
2411
2412
|
} }, primaryKey: { get: function() {
|
|
2412
2413
|
return b.primaryKey;
|
|
2413
2414
|
} }, key: { get: function() {
|
|
2414
2415
|
var w = b.key;
|
|
2415
|
-
return
|
|
2416
|
+
return g === 1 ? w[0] : w.slice(0, g);
|
|
2416
2417
|
} }, value: { get: function() {
|
|
2417
2418
|
return b.value;
|
|
2418
2419
|
} } });
|
|
@@ -2420,84 +2421,84 @@ var Er = { exports: {} };
|
|
|
2420
2421
|
} });
|
|
2421
2422
|
} });
|
|
2422
2423
|
} };
|
|
2423
|
-
function
|
|
2424
|
+
function jn(e, t, n, r) {
|
|
2424
2425
|
return n = n || {}, r = r || "", T(e).forEach(function(i) {
|
|
2425
2426
|
var o, a, u;
|
|
2426
|
-
ne(t, i) ? (o = e[i], a = t[i], typeof o == "object" && typeof a == "object" && o && a ? (u =
|
|
2427
|
+
ne(t, i) ? (o = e[i], a = t[i], typeof o == "object" && typeof a == "object" && o && a ? (u = Gt(o)) !== Gt(a) ? n[r + i] = t[i] : u === "Object" ? jn(o, a, n, r + i + ".") : o !== a && (n[r + i] = t[i]) : o !== a && (n[r + i] = t[i])) : n[r + i] = void 0;
|
|
2427
2428
|
}), T(t).forEach(function(i) {
|
|
2428
2429
|
ne(e, i) || (n[r + i] = t[i]);
|
|
2429
2430
|
}), n;
|
|
2430
2431
|
}
|
|
2431
|
-
function
|
|
2432
|
+
function Cn(e, t) {
|
|
2432
2433
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2433
2434
|
}
|
|
2434
|
-
var
|
|
2435
|
+
var ui = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2435
2436
|
return _(_({}, e), { table: function(t) {
|
|
2436
2437
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
2437
2438
|
return _(_({}, n), { mutate: function(i) {
|
|
2438
|
-
var o = D.trans, a = o.table(t).hook, u = a.deleting,
|
|
2439
|
+
var o = D.trans, a = o.table(t).hook, u = a.deleting, h = a.creating, l = a.updating;
|
|
2439
2440
|
switch (i.type) {
|
|
2440
2441
|
case "add":
|
|
2441
|
-
if (
|
|
2442
|
+
if (h.fire === V)
|
|
2442
2443
|
break;
|
|
2443
2444
|
return o._promise("readwrite", function() {
|
|
2444
|
-
return
|
|
2445
|
+
return m(i);
|
|
2445
2446
|
}, !0);
|
|
2446
2447
|
case "put":
|
|
2447
|
-
if (
|
|
2448
|
+
if (h.fire === V && l.fire === V)
|
|
2448
2449
|
break;
|
|
2449
2450
|
return o._promise("readwrite", function() {
|
|
2450
|
-
return
|
|
2451
|
+
return m(i);
|
|
2451
2452
|
}, !0);
|
|
2452
2453
|
case "delete":
|
|
2453
2454
|
if (u.fire === V)
|
|
2454
2455
|
break;
|
|
2455
2456
|
return o._promise("readwrite", function() {
|
|
2456
|
-
return
|
|
2457
|
+
return m(i);
|
|
2457
2458
|
}, !0);
|
|
2458
2459
|
case "deleteRange":
|
|
2459
2460
|
if (u.fire === V)
|
|
2460
2461
|
break;
|
|
2461
2462
|
return o._promise("readwrite", function() {
|
|
2462
|
-
return function c(f,
|
|
2463
|
-
return n.query({ trans: f, values: !1, query: { index: r, range:
|
|
2464
|
-
var p =
|
|
2465
|
-
return
|
|
2466
|
-
return 0 < b.numFailures ? Promise.reject(b.failures[0]) : p.length < y ? { failures: [], numFailures: 0, lastResult: void 0 } : c(f, _(_({},
|
|
2463
|
+
return function c(f, d, y) {
|
|
2464
|
+
return n.query({ trans: f, values: !1, query: { index: r, range: d }, limit: y }).then(function(g) {
|
|
2465
|
+
var p = g.result;
|
|
2466
|
+
return m({ type: "delete", keys: p, trans: f }).then(function(b) {
|
|
2467
|
+
return 0 < b.numFailures ? Promise.reject(b.failures[0]) : p.length < y ? { failures: [], numFailures: 0, lastResult: void 0 } : c(f, _(_({}, d), { lower: p[p.length - 1], lowerOpen: !0 }), y);
|
|
2467
2468
|
});
|
|
2468
2469
|
});
|
|
2469
2470
|
}(i.trans, i.range, 1e4);
|
|
2470
2471
|
}, !0);
|
|
2471
2472
|
}
|
|
2472
2473
|
return n.mutate(i);
|
|
2473
|
-
function
|
|
2474
|
-
var f,
|
|
2474
|
+
function m(c) {
|
|
2475
|
+
var f, d, y, g = D.trans, p = c.keys || Cn(r, c);
|
|
2475
2476
|
if (!p)
|
|
2476
2477
|
throw new Error("Keys missing");
|
|
2477
|
-
return (c = c.type === "add" || c.type === "put" ? _(_({}, c), { keys: p }) : _({}, c)).type !== "delete" && (c.values = j([], c.values, !0)), c.keys && (c.keys = j([], c.keys, !0)), f = n, y = p, ((
|
|
2478
|
-
var w = p.map(function(
|
|
2479
|
-
var O, P, S, C = b[
|
|
2480
|
-
return c.type === "delete" ? u.fire.call(E,
|
|
2478
|
+
return (c = c.type === "add" || c.type === "put" ? _(_({}, c), { keys: p }) : _({}, c)).type !== "delete" && (c.values = j([], c.values, !0)), c.keys && (c.keys = j([], c.keys, !0)), f = n, y = p, ((d = c).type === "add" ? Promise.resolve([]) : f.getMany({ trans: d.trans, keys: y, cache: "immutable" })).then(function(b) {
|
|
2479
|
+
var w = p.map(function(k, x) {
|
|
2480
|
+
var O, P, S, C = b[x], E = { onerror: null, onsuccess: null };
|
|
2481
|
+
return c.type === "delete" ? u.fire.call(E, k, C, g) : c.type === "add" || C === void 0 ? (O = h.fire.call(E, k, c.values[x], g), k == null && O != null && (c.keys[x] = k = O, r.outbound || ce(c.values[x], r.keyPath, k))) : (O = jn(C, c.values[x]), (P = l.fire.call(E, O, k, C, g)) && (S = c.values[x], Object.keys(P).forEach(function(B) {
|
|
2481
2482
|
ne(S, B) ? S[B] = P[B] : ce(S, B, P[B]);
|
|
2482
2483
|
}))), E;
|
|
2483
2484
|
});
|
|
2484
|
-
return n.mutate(c).then(function(
|
|
2485
|
-
for (var
|
|
2485
|
+
return n.mutate(c).then(function(k) {
|
|
2486
|
+
for (var x = k.failures, O = k.results, P = k.numFailures, k = k.lastResult, S = 0; S < p.length; ++S) {
|
|
2486
2487
|
var C = (O || p)[S], E = w[S];
|
|
2487
|
-
C == null ? E.onerror && E.onerror(
|
|
2488
|
+
C == null ? E.onerror && E.onerror(x[S]) : E.onsuccess && E.onsuccess(c.type === "put" && b[S] ? c.values[S] : C);
|
|
2488
2489
|
}
|
|
2489
|
-
return { failures:
|
|
2490
|
-
}).catch(function(
|
|
2491
|
-
return w.forEach(function(
|
|
2492
|
-
return
|
|
2493
|
-
}), Promise.reject(
|
|
2490
|
+
return { failures: x, results: O, numFailures: P, lastResult: k };
|
|
2491
|
+
}).catch(function(k) {
|
|
2492
|
+
return w.forEach(function(x) {
|
|
2493
|
+
return x.onerror && x.onerror(k);
|
|
2494
|
+
}), Promise.reject(k);
|
|
2494
2495
|
});
|
|
2495
2496
|
});
|
|
2496
2497
|
}
|
|
2497
2498
|
} });
|
|
2498
2499
|
} });
|
|
2499
2500
|
} };
|
|
2500
|
-
function
|
|
2501
|
+
function br(e, t, n) {
|
|
2501
2502
|
try {
|
|
2502
2503
|
if (!t || t.keys.length < e.length)
|
|
2503
2504
|
return null;
|
|
@@ -2508,13 +2509,13 @@ var Er = { exports: {} };
|
|
|
2508
2509
|
return null;
|
|
2509
2510
|
}
|
|
2510
2511
|
}
|
|
2511
|
-
var
|
|
2512
|
+
var ci = { stack: "dbcore", level: -1, create: function(e) {
|
|
2512
2513
|
return { table: function(t) {
|
|
2513
2514
|
var n = e.table(t);
|
|
2514
2515
|
return _(_({}, n), { getMany: function(r) {
|
|
2515
2516
|
if (!r.cache)
|
|
2516
2517
|
return n.getMany(r);
|
|
2517
|
-
var i =
|
|
2518
|
+
var i = br(r.keys, r.trans._cache, r.cache === "clone");
|
|
2518
2519
|
return i ? K.resolve(i) : n.getMany(r).then(function(o) {
|
|
2519
2520
|
return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? _e(o) : o }, o;
|
|
2520
2521
|
});
|
|
@@ -2523,10 +2524,10 @@ var Er = { exports: {} };
|
|
|
2523
2524
|
} });
|
|
2524
2525
|
} };
|
|
2525
2526
|
} };
|
|
2526
|
-
function
|
|
2527
|
+
function wr(e, t) {
|
|
2527
2528
|
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !t.schema.primaryKey.outbound;
|
|
2528
2529
|
}
|
|
2529
|
-
function
|
|
2530
|
+
function _r(e, t) {
|
|
2530
2531
|
switch (e) {
|
|
2531
2532
|
case "query":
|
|
2532
2533
|
return t.values && !t.unique;
|
|
@@ -2537,25 +2538,25 @@ var Er = { exports: {} };
|
|
|
2537
2538
|
return !1;
|
|
2538
2539
|
}
|
|
2539
2540
|
}
|
|
2540
|
-
var
|
|
2541
|
+
var li = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2541
2542
|
var t = e.schema.name, n = new re(e.MIN_KEY, e.MAX_KEY);
|
|
2542
2543
|
return _(_({}, e), { transaction: function(r, i, o) {
|
|
2543
2544
|
if (D.subscr && i !== "readonly")
|
|
2544
2545
|
throw new I.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(D.querier));
|
|
2545
2546
|
return e.transaction(r, i, o);
|
|
2546
2547
|
}, table: function(r) {
|
|
2547
|
-
function i(
|
|
2548
|
-
var
|
|
2549
|
-
return [
|
|
2548
|
+
function i(d) {
|
|
2549
|
+
var d = (y = d.query).index, y = y.range;
|
|
2550
|
+
return [d, new re((d = y.lower) !== null && d !== void 0 ? d : e.MIN_KEY, (y = y.upper) !== null && y !== void 0 ? y : e.MAX_KEY)];
|
|
2550
2551
|
}
|
|
2551
|
-
var o = e.table(r), a = o.schema, u = a.primaryKey,
|
|
2552
|
-
function
|
|
2552
|
+
var o = e.table(r), a = o.schema, u = a.primaryKey, h = u.extractKey, l = u.outbound, m = _(_({}, o), { mutate: function(f) {
|
|
2553
|
+
function d(E) {
|
|
2553
2554
|
return E = "idb://".concat(t, "/").concat(r, "/").concat(E), w[E] || (w[E] = new re());
|
|
2554
2555
|
}
|
|
2555
|
-
var y,
|
|
2556
|
+
var y, g, p, b = f.trans, w = f.mutatedParts || (f.mutatedParts = {}), k = d(""), x = d(":dels"), O = f.type, C = f.type === "deleteRange" ? [f.range] : f.type === "delete" ? [f.keys] : f.values.length < 50 ? [Cn(u, f).filter(function(E) {
|
|
2556
2557
|
return E;
|
|
2557
2558
|
}), f.values] : [], P = C[0], S = C[1], C = f.trans._cache;
|
|
2558
|
-
return W(P) ? (
|
|
2559
|
+
return W(P) ? (k.addKeys(P), (C = O === "delete" || P.length === S.length ? br(P, C) : null) || x.addKeys(P), (C || S) && (y = d, g = C, p = S, a.indexes.forEach(function(E) {
|
|
2559
2560
|
var B = y(E.name || "");
|
|
2560
2561
|
function R(z) {
|
|
2561
2562
|
return z != null ? E.extractKey(z) : null;
|
|
@@ -2565,14 +2566,14 @@ var Er = { exports: {} };
|
|
|
2565
2566
|
return B.addKey(G);
|
|
2566
2567
|
}) : B.addKey(z);
|
|
2567
2568
|
}
|
|
2568
|
-
(
|
|
2569
|
-
var ue =
|
|
2569
|
+
(g || p).forEach(function(z, N) {
|
|
2570
|
+
var ue = g && R(g[N]), N = p && R(p[N]);
|
|
2570
2571
|
U(ue, N) !== 0 && (ue != null && $(ue), N != null && $(N));
|
|
2571
2572
|
});
|
|
2572
|
-
}))) : P ? (S = { from: P.lower, to: P.upper },
|
|
2573
|
-
return
|
|
2573
|
+
}))) : P ? (S = { from: P.lower, to: P.upper }, x.add(S), k.add(S)) : (k.add(n), x.add(n), a.indexes.forEach(function(E) {
|
|
2574
|
+
return d(E.name).add(n);
|
|
2574
2575
|
})), o.mutate(f).then(function(E) {
|
|
2575
|
-
return !P || f.type !== "add" && f.type !== "put" ||
|
|
2576
|
+
return !P || f.type !== "add" && f.type !== "put" || k.addKeys(E.results), b.mutatedParts = zt(b.mutatedParts || {}, w), E;
|
|
2576
2577
|
});
|
|
2577
2578
|
} }), c = { get: function(f) {
|
|
2578
2579
|
return [u, new re(f.key)];
|
|
@@ -2580,30 +2581,30 @@ var Er = { exports: {} };
|
|
|
2580
2581
|
return [u, new re().addKeys(f.keys)];
|
|
2581
2582
|
}, count: i, query: i, openCursor: i };
|
|
2582
2583
|
return T(c).forEach(function(f) {
|
|
2583
|
-
|
|
2584
|
-
var y = D.subscr,
|
|
2585
|
-
if (
|
|
2584
|
+
m[f] = function(d) {
|
|
2585
|
+
var y = D.subscr, g = !!y, p = wr(D, o) && _r(f, d) ? d.obsSet = {} : y;
|
|
2586
|
+
if (g) {
|
|
2586
2587
|
var b = function(S) {
|
|
2587
2588
|
return S = "idb://".concat(t, "/").concat(r, "/").concat(S), p[S] || (p[S] = new re());
|
|
2588
|
-
}, w = b(""),
|
|
2589
|
-
if ((f === "query" &&
|
|
2589
|
+
}, w = b(""), k = b(":dels"), y = c[f](d), g = y[0], y = y[1];
|
|
2590
|
+
if ((f === "query" && g.isPrimaryKey && !d.values ? k : b(g.name || "")).add(y), !g.isPrimaryKey) {
|
|
2590
2591
|
if (f !== "count") {
|
|
2591
|
-
var
|
|
2592
|
+
var x = f === "query" && l && d.values && o.query(_(_({}, d), { values: !1 }));
|
|
2592
2593
|
return o[f].apply(this, arguments).then(function(S) {
|
|
2593
2594
|
if (f === "query") {
|
|
2594
|
-
if (l &&
|
|
2595
|
-
return
|
|
2595
|
+
if (l && d.values)
|
|
2596
|
+
return x.then(function(R) {
|
|
2596
2597
|
return R = R.result, w.addKeys(R), S;
|
|
2597
2598
|
});
|
|
2598
|
-
var C =
|
|
2599
|
-
(
|
|
2599
|
+
var C = d.values ? S.result.map(h) : S.result;
|
|
2600
|
+
(d.values ? w : k).addKeys(C);
|
|
2600
2601
|
} else if (f === "openCursor") {
|
|
2601
|
-
var E = S, B =
|
|
2602
|
+
var E = S, B = d.values;
|
|
2602
2603
|
return E && Object.create(E, { key: { get: function() {
|
|
2603
|
-
return
|
|
2604
|
+
return k.addKey(E.primaryKey), E.key;
|
|
2604
2605
|
} }, primaryKey: { get: function() {
|
|
2605
2606
|
var R = E.primaryKey;
|
|
2606
|
-
return
|
|
2607
|
+
return k.addKey(R), R;
|
|
2607
2608
|
} }, value: { get: function() {
|
|
2608
2609
|
return B && w.addKey(E.primaryKey), E.value;
|
|
2609
2610
|
} } });
|
|
@@ -2611,15 +2612,15 @@ var Er = { exports: {} };
|
|
|
2611
2612
|
return S;
|
|
2612
2613
|
});
|
|
2613
2614
|
}
|
|
2614
|
-
|
|
2615
|
+
k.add(n);
|
|
2615
2616
|
}
|
|
2616
2617
|
}
|
|
2617
2618
|
return o[f].apply(this, arguments);
|
|
2618
2619
|
};
|
|
2619
|
-
}),
|
|
2620
|
+
}), m;
|
|
2620
2621
|
} });
|
|
2621
2622
|
} };
|
|
2622
|
-
function
|
|
2623
|
+
function kr(e, t, n) {
|
|
2623
2624
|
if (n.numFailures === 0)
|
|
2624
2625
|
return t;
|
|
2625
2626
|
if (t.type === "deleteRange")
|
|
@@ -2631,58 +2632,58 @@ var Er = { exports: {} };
|
|
|
2631
2632
|
return !(o in n.failures);
|
|
2632
2633
|
})), t);
|
|
2633
2634
|
}
|
|
2634
|
-
function
|
|
2635
|
+
function Kn(e, t) {
|
|
2635
2636
|
return n = e, ((r = t).lower === void 0 || (r.lowerOpen ? 0 < U(n, r.lower) : 0 <= U(n, r.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? U(e, t.upper) < 0 : U(e, t.upper) <= 0));
|
|
2636
2637
|
var n, r;
|
|
2637
2638
|
}
|
|
2638
|
-
function
|
|
2639
|
+
function xr(e, t, f, r, i, o) {
|
|
2639
2640
|
if (!f || f.length === 0)
|
|
2640
2641
|
return e;
|
|
2641
|
-
var a = t.query.index, u = a.multiEntry,
|
|
2642
|
-
var
|
|
2643
|
-
return
|
|
2644
|
-
return
|
|
2645
|
-
}) :
|
|
2646
|
-
}).map(function(
|
|
2647
|
-
return
|
|
2642
|
+
var a = t.query.index, u = a.multiEntry, h = t.query.range, l = r.schema.primaryKey.extractKey, m = a.extractKey, c = (a.lowLevelIndex || a).extractKey, f = f.reduce(function(d, y) {
|
|
2643
|
+
var g = d, p = y.type === "add" || y.type === "put" ? y.values.filter(function(x) {
|
|
2644
|
+
return x = m(x), u && W(x) ? x.some(function(O) {
|
|
2645
|
+
return Kn(O, h);
|
|
2646
|
+
}) : Kn(x, h);
|
|
2647
|
+
}).map(function(x) {
|
|
2648
|
+
return x = _e(x), o && Object.freeze(x), x;
|
|
2648
2649
|
}) : [];
|
|
2649
2650
|
switch (y.type) {
|
|
2650
2651
|
case "add":
|
|
2651
|
-
|
|
2652
|
+
g = d.concat(t.values ? p : p.map(function(O) {
|
|
2652
2653
|
return l(O);
|
|
2653
2654
|
}));
|
|
2654
2655
|
break;
|
|
2655
2656
|
case "put":
|
|
2656
2657
|
var b = new re().addKeys(y.values.map(function(O) {
|
|
2657
2658
|
return l(O);
|
|
2658
|
-
})),
|
|
2659
|
-
return O = t.values ? l(O) : O, !
|
|
2659
|
+
})), g = d.filter(function(O) {
|
|
2660
|
+
return O = t.values ? l(O) : O, !Nt(new re(O), b);
|
|
2660
2661
|
}).concat(t.values ? p : p.map(function(O) {
|
|
2661
2662
|
return l(O);
|
|
2662
2663
|
}));
|
|
2663
2664
|
break;
|
|
2664
2665
|
case "delete":
|
|
2665
2666
|
var w = new re().addKeys(y.keys);
|
|
2666
|
-
|
|
2667
|
-
return O = t.values ? l(O) : O, !
|
|
2667
|
+
g = d.filter(function(O) {
|
|
2668
|
+
return O = t.values ? l(O) : O, !Nt(new re(O), w);
|
|
2668
2669
|
});
|
|
2669
2670
|
break;
|
|
2670
2671
|
case "deleteRange":
|
|
2671
|
-
var
|
|
2672
|
-
|
|
2673
|
-
return !
|
|
2672
|
+
var k = y.range;
|
|
2673
|
+
g = d.filter(function(O) {
|
|
2674
|
+
return !Kn(l(O), k);
|
|
2674
2675
|
});
|
|
2675
2676
|
}
|
|
2676
|
-
return
|
|
2677
|
+
return g;
|
|
2677
2678
|
}, e);
|
|
2678
|
-
return f === e ? e : (f.sort(function(
|
|
2679
|
-
return U(c(
|
|
2679
|
+
return f === e ? e : (f.sort(function(d, y) {
|
|
2680
|
+
return U(c(d), c(y)) || U(l(d), l(y));
|
|
2680
2681
|
}), t.limit && t.limit < 1 / 0 && (f.length > t.limit ? f.length = t.limit : e.length === t.limit && f.length < t.limit && (i.dirty = !0)), o ? Object.freeze(f) : f);
|
|
2681
2682
|
}
|
|
2682
|
-
function
|
|
2683
|
+
function Or(e, t) {
|
|
2683
2684
|
return U(e.lower, t.lower) === 0 && U(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
2684
2685
|
}
|
|
2685
|
-
function
|
|
2686
|
+
function fi(e, t) {
|
|
2686
2687
|
return function(n, r, i, o) {
|
|
2687
2688
|
if (n === void 0)
|
|
2688
2689
|
return r !== void 0 ? -1 : 0;
|
|
@@ -2713,7 +2714,7 @@ var Er = { exports: {} };
|
|
|
2713
2714
|
return r;
|
|
2714
2715
|
}(e.upper, t.upper, e.upperOpen, t.upperOpen);
|
|
2715
2716
|
}
|
|
2716
|
-
function
|
|
2717
|
+
function hi(e, t, n, r) {
|
|
2717
2718
|
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
2718
2719
|
var i, o;
|
|
2719
2720
|
e.subscribers.delete(n), e.subscribers.size === 0 && (i = e, o = t, setTimeout(function() {
|
|
@@ -2721,32 +2722,32 @@ var Er = { exports: {} };
|
|
|
2721
2722
|
}, 3e3));
|
|
2722
2723
|
});
|
|
2723
2724
|
}
|
|
2724
|
-
var
|
|
2725
|
+
var di = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2725
2726
|
var t = e.schema.name;
|
|
2726
2727
|
return _(_({}, e), { transaction: function(n, r, i) {
|
|
2727
2728
|
var o, a, u = e.transaction(n, r, i);
|
|
2728
|
-
return r === "readwrite" && (a = (o = new AbortController()).signal, i = function(
|
|
2729
|
+
return r === "readwrite" && (a = (o = new AbortController()).signal, i = function(h) {
|
|
2729
2730
|
return function() {
|
|
2730
2731
|
if (o.abort(), r === "readwrite") {
|
|
2731
|
-
for (var l = /* @__PURE__ */ new Set(),
|
|
2732
|
-
var f = c[
|
|
2733
|
-
if (
|
|
2734
|
-
var y = e.table(f),
|
|
2732
|
+
for (var l = /* @__PURE__ */ new Set(), m = 0, c = n; m < c.length; m++) {
|
|
2733
|
+
var f = c[m], d = Re["idb://".concat(t, "/").concat(f)];
|
|
2734
|
+
if (d) {
|
|
2735
|
+
var y = e.table(f), g = d.optimisticOps.filter(function(R) {
|
|
2735
2736
|
return R.trans === u;
|
|
2736
2737
|
});
|
|
2737
|
-
if (u._explicit &&
|
|
2738
|
-
for (var p = 0, b = Object.values(
|
|
2739
|
-
for (var w = 0,
|
|
2740
|
-
|
|
2738
|
+
if (u._explicit && h && u.mutatedParts)
|
|
2739
|
+
for (var p = 0, b = Object.values(d.queries.query); p < b.length; p++)
|
|
2740
|
+
for (var w = 0, k = (P = b[p]).slice(); w < k.length; w++)
|
|
2741
|
+
xn((S = k[w]).obsSet, u.mutatedParts) && (Ce(P, S), S.subscribers.forEach(function(R) {
|
|
2741
2742
|
return l.add(R);
|
|
2742
2743
|
}));
|
|
2743
|
-
else if (0 <
|
|
2744
|
-
|
|
2744
|
+
else if (0 < g.length) {
|
|
2745
|
+
d.optimisticOps = d.optimisticOps.filter(function(R) {
|
|
2745
2746
|
return R.trans !== u;
|
|
2746
2747
|
});
|
|
2747
|
-
for (var
|
|
2748
|
-
for (var P, S, C, E = 0, B = (P = O[
|
|
2749
|
-
(S = B[E]).res != null && u.mutatedParts && (
|
|
2748
|
+
for (var x = 0, O = Object.values(d.queries.query); x < O.length; x++)
|
|
2749
|
+
for (var P, S, C, E = 0, B = (P = O[x]).slice(); E < B.length; E++)
|
|
2750
|
+
(S = B[E]).res != null && u.mutatedParts && (h && !S.dirty ? (C = Object.isFrozen(S.res), C = xr(S.res, S.req, g, y, S, C), S.dirty ? (Ce(P, S), S.subscribers.forEach(function(R) {
|
|
2750
2751
|
return l.add(R);
|
|
2751
2752
|
})) : C !== S.res && (S.res = C, S.promise = K.resolve({ result: C }))) : (S.dirty && Ce(P, S), S.subscribers.forEach(function(R) {
|
|
2752
2753
|
return l.add(R);
|
|
@@ -2767,70 +2768,70 @@ var Er = { exports: {} };
|
|
|
2767
2768
|
if (i.outbound || a.db._options.cache === "disabled" || a.explicit)
|
|
2768
2769
|
return r.mutate(o);
|
|
2769
2770
|
var u = Re["idb://".concat(t, "/").concat(n)];
|
|
2770
|
-
return u ? (a = r.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length ||
|
|
2771
|
-
return
|
|
2772
|
-
})) ? (u.optimisticOps.push(o), o.mutatedParts &&
|
|
2773
|
-
0 <
|
|
2771
|
+
return u ? (a = r.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || Cn(i, o).some(function(h) {
|
|
2772
|
+
return h == null;
|
|
2773
|
+
})) ? (u.optimisticOps.push(o), o.mutatedParts && Lt(o.mutatedParts), a.then(function(h) {
|
|
2774
|
+
0 < h.numFailures && (Ce(u.optimisticOps, o), (h = kr(0, o, h)) && u.optimisticOps.push(h), o.mutatedParts && Lt(o.mutatedParts));
|
|
2774
2775
|
}), a.catch(function() {
|
|
2775
|
-
Ce(u.optimisticOps, o), o.mutatedParts &&
|
|
2776
|
-
})) : a.then(function(
|
|
2777
|
-
var l =
|
|
2778
|
-
var f,
|
|
2779
|
-
return ce(
|
|
2780
|
-
}) }),
|
|
2776
|
+
Ce(u.optimisticOps, o), o.mutatedParts && Lt(o.mutatedParts);
|
|
2777
|
+
})) : a.then(function(h) {
|
|
2778
|
+
var l = kr(0, _(_({}, o), { values: o.values.map(function(d, c) {
|
|
2779
|
+
var f, d = (f = i.keyPath) !== null && f !== void 0 && f.includes(".") ? _e(d) : _({}, d);
|
|
2780
|
+
return ce(d, i.keyPath, h.results[c]), d;
|
|
2781
|
+
}) }), h);
|
|
2781
2782
|
u.optimisticOps.push(l), queueMicrotask(function() {
|
|
2782
|
-
return o.mutatedParts &&
|
|
2783
|
+
return o.mutatedParts && Lt(o.mutatedParts);
|
|
2783
2784
|
});
|
|
2784
2785
|
}), a) : r.mutate(o);
|
|
2785
2786
|
}, query: function(o) {
|
|
2786
|
-
if (!
|
|
2787
|
+
if (!wr(D, r) || !_r("query", o))
|
|
2787
2788
|
return r.query(o);
|
|
2788
|
-
var a = ((l = D.trans) === null || l === void 0 ? void 0 : l.db._options.cache) === "immutable", c = D, u = c.requery,
|
|
2789
|
-
var w = Re["idb://".concat(y, "/").concat(
|
|
2789
|
+
var a = ((l = D.trans) === null || l === void 0 ? void 0 : l.db._options.cache) === "immutable", c = D, u = c.requery, h = c.signal, l = function(y, g, p, b) {
|
|
2790
|
+
var w = Re["idb://".concat(y, "/").concat(g)];
|
|
2790
2791
|
if (!w)
|
|
2791
2792
|
return [];
|
|
2792
|
-
if (!(
|
|
2793
|
+
if (!(g = w.queries[p]))
|
|
2793
2794
|
return [null, !1, w, null];
|
|
2794
|
-
var
|
|
2795
|
-
if (!
|
|
2795
|
+
var k = g[(b.query ? b.query.index.name : null) || ""];
|
|
2796
|
+
if (!k)
|
|
2796
2797
|
return [null, !1, w, null];
|
|
2797
2798
|
switch (p) {
|
|
2798
2799
|
case "query":
|
|
2799
|
-
var
|
|
2800
|
-
return O.req.limit === b.limit && O.req.values === b.values &&
|
|
2800
|
+
var x = k.find(function(O) {
|
|
2801
|
+
return O.req.limit === b.limit && O.req.values === b.values && Or(O.req.query.range, b.query.range);
|
|
2801
2802
|
});
|
|
2802
|
-
return
|
|
2803
|
-
return ("limit" in O.req ? O.req.limit : 1 / 0) >= b.limit && (!b.values || O.req.values) &&
|
|
2804
|
-
}), !1, w,
|
|
2803
|
+
return x ? [x, !0, w, k] : [k.find(function(O) {
|
|
2804
|
+
return ("limit" in O.req ? O.req.limit : 1 / 0) >= b.limit && (!b.values || O.req.values) && fi(O.req.query.range, b.query.range);
|
|
2805
|
+
}), !1, w, k];
|
|
2805
2806
|
case "count":
|
|
2806
|
-
return
|
|
2807
|
-
return
|
|
2808
|
-
}), [
|
|
2807
|
+
return x = k.find(function(O) {
|
|
2808
|
+
return Or(O.req.query.range, b.query.range);
|
|
2809
|
+
}), [x, !!x, w, k];
|
|
2809
2810
|
}
|
|
2810
|
-
}(t, n, "query", o),
|
|
2811
|
-
return
|
|
2812
|
-
var
|
|
2813
|
-
if (
|
|
2814
|
-
for (var p = 0, b =
|
|
2815
|
-
Object.freeze(
|
|
2816
|
-
Object.freeze(
|
|
2811
|
+
}(t, n, "query", o), m = l[0], c = l[1], f = l[2], d = l[3];
|
|
2812
|
+
return m && c ? m.obsSet = o.obsSet : (c = r.query(o).then(function(y) {
|
|
2813
|
+
var g = y.result;
|
|
2814
|
+
if (m && (m.res = g), a) {
|
|
2815
|
+
for (var p = 0, b = g.length; p < b; ++p)
|
|
2816
|
+
Object.freeze(g[p]);
|
|
2817
|
+
Object.freeze(g);
|
|
2817
2818
|
} else
|
|
2818
|
-
y.result = _e(
|
|
2819
|
+
y.result = _e(g);
|
|
2819
2820
|
return y;
|
|
2820
2821
|
}).catch(function(y) {
|
|
2821
|
-
return
|
|
2822
|
-
}),
|
|
2823
|
-
return { result:
|
|
2822
|
+
return d && m && Ce(d, m), Promise.reject(y);
|
|
2823
|
+
}), m = { obsSet: o.obsSet, promise: c, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, d ? d.push(m) : (d = [m], (f = f || (Re["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[o.query.index.name || ""] = d)), hi(m, d, u, h), m.promise.then(function(y) {
|
|
2824
|
+
return { result: xr(y.result, o, f == null ? void 0 : f.optimisticOps, r, m, a) };
|
|
2824
2825
|
});
|
|
2825
2826
|
} });
|
|
2826
2827
|
} });
|
|
2827
2828
|
} };
|
|
2828
|
-
function
|
|
2829
|
+
function Wt(e, t) {
|
|
2829
2830
|
return new Proxy(e, { get: function(n, r, i) {
|
|
2830
2831
|
return r === "db" ? t : Reflect.get(n, r, i);
|
|
2831
2832
|
} });
|
|
2832
2833
|
}
|
|
2833
|
-
var ve = (
|
|
2834
|
+
var ve = (Z.prototype.version = function(e) {
|
|
2834
2835
|
if (isNaN(e) || e < 0.1)
|
|
2835
2836
|
throw new I.Type("Given version is not a positive number");
|
|
2836
2837
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened)
|
|
@@ -2839,8 +2840,8 @@ var Er = { exports: {} };
|
|
|
2839
2840
|
var t = this._versions, n = t.filter(function(r) {
|
|
2840
2841
|
return r._cfg.version === e;
|
|
2841
2842
|
})[0];
|
|
2842
|
-
return n || (n = new this.Version(e), t.push(n), t.sort(
|
|
2843
|
-
},
|
|
2843
|
+
return n || (n = new this.Version(e), t.push(n), t.sort(ni), n.stores({}), this._state.autoSchema = !1, n);
|
|
2844
|
+
}, Z.prototype._whenReady = function(e) {
|
|
2844
2845
|
var t = this;
|
|
2845
2846
|
return this.idbdb && (this._state.openComplete || D.letThrough || this._vip) ? e() : new K(function(n, r) {
|
|
2846
2847
|
if (t._state.openComplete)
|
|
@@ -2852,22 +2853,22 @@ var Er = { exports: {} };
|
|
|
2852
2853
|
}
|
|
2853
2854
|
t._state.dbReadyPromise.then(n, r);
|
|
2854
2855
|
}).then(e);
|
|
2855
|
-
},
|
|
2856
|
+
}, Z.prototype.use = function(e) {
|
|
2856
2857
|
var t = e.stack, n = e.create, r = e.level, i = e.name;
|
|
2857
2858
|
return i && this.unuse({ stack: t, name: i }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: r ?? 10, name: i }), e.sort(function(o, a) {
|
|
2858
2859
|
return o.level - a.level;
|
|
2859
2860
|
}), this;
|
|
2860
|
-
},
|
|
2861
|
+
}, Z.prototype.unuse = function(e) {
|
|
2861
2862
|
var t = e.stack, n = e.name, r = e.create;
|
|
2862
2863
|
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(i) {
|
|
2863
2864
|
return r ? i.create !== r : !!n && i.name !== n;
|
|
2864
2865
|
})), this;
|
|
2865
|
-
},
|
|
2866
|
+
}, Z.prototype.open = function() {
|
|
2866
2867
|
var e = this;
|
|
2867
|
-
return Te(
|
|
2868
|
-
return
|
|
2868
|
+
return Te(ke, function() {
|
|
2869
|
+
return ai(e);
|
|
2869
2870
|
});
|
|
2870
|
-
},
|
|
2871
|
+
}, Z.prototype._close = function() {
|
|
2871
2872
|
var e = this._state, t = He.indexOf(this);
|
|
2872
2873
|
if (0 <= t && He.splice(t, 1), this.idbdb) {
|
|
2873
2874
|
try {
|
|
@@ -2881,10 +2882,10 @@ var Er = { exports: {} };
|
|
|
2881
2882
|
}), e.openCanceller = new K(function(n, r) {
|
|
2882
2883
|
e.cancelOpen = r;
|
|
2883
2884
|
}));
|
|
2884
|
-
},
|
|
2885
|
+
}, Z.prototype.close = function(n) {
|
|
2885
2886
|
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
2886
2887
|
t ? (n.isBeingOpened && n.cancelOpen(new I.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new I.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
2887
|
-
},
|
|
2888
|
+
}, Z.prototype.delete = function(e) {
|
|
2888
2889
|
var t = this;
|
|
2889
2890
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2890
2891
|
var n = 0 < arguments.length, r = this._state;
|
|
@@ -2893,41 +2894,41 @@ var Er = { exports: {} };
|
|
|
2893
2894
|
t.close(e);
|
|
2894
2895
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2895
2896
|
u.onsuccess = H(function() {
|
|
2896
|
-
var
|
|
2897
|
-
|
|
2898
|
-
}), u.onerror =
|
|
2897
|
+
var h, l, m;
|
|
2898
|
+
h = t._deps, l = t.name, m = h.indexedDB, h = h.IDBKeyRange, bn(m) || l === jt || vn(m, h).delete(l).catch(V), i();
|
|
2899
|
+
}), u.onerror = de(o), u.onblocked = t._fireOnBlocked;
|
|
2899
2900
|
}
|
|
2900
2901
|
if (n)
|
|
2901
2902
|
throw new I.InvalidArgument("Arguments not allowed in db.delete()");
|
|
2902
2903
|
r.isBeingOpened ? r.dbReadyPromise.then(a) : a();
|
|
2903
2904
|
});
|
|
2904
|
-
},
|
|
2905
|
+
}, Z.prototype.backendDB = function() {
|
|
2905
2906
|
return this.idbdb;
|
|
2906
|
-
},
|
|
2907
|
+
}, Z.prototype.isOpen = function() {
|
|
2907
2908
|
return this.idbdb !== null;
|
|
2908
|
-
},
|
|
2909
|
+
}, Z.prototype.hasBeenClosed = function() {
|
|
2909
2910
|
var e = this._state.dbOpenError;
|
|
2910
2911
|
return e && e.name === "DatabaseClosed";
|
|
2911
|
-
},
|
|
2912
|
+
}, Z.prototype.hasFailed = function() {
|
|
2912
2913
|
return this._state.dbOpenError !== null;
|
|
2913
|
-
},
|
|
2914
|
+
}, Z.prototype.dynamicallyOpened = function() {
|
|
2914
2915
|
return this._state.autoSchema;
|
|
2915
|
-
}, Object.defineProperty(
|
|
2916
|
+
}, Object.defineProperty(Z.prototype, "tables", { get: function() {
|
|
2916
2917
|
var e = this;
|
|
2917
2918
|
return T(this._allTables).map(function(t) {
|
|
2918
2919
|
return e._allTables[t];
|
|
2919
2920
|
});
|
|
2920
|
-
}, enumerable: !1, configurable: !0 }),
|
|
2921
|
+
}, enumerable: !1, configurable: !0 }), Z.prototype.transaction = function() {
|
|
2921
2922
|
var e = (function(t, n, r) {
|
|
2922
2923
|
var i = arguments.length;
|
|
2923
2924
|
if (i < 2)
|
|
2924
2925
|
throw new I.InvalidArgument("Too few arguments");
|
|
2925
2926
|
for (var o = new Array(i - 1); --i; )
|
|
2926
2927
|
o[i - 1] = arguments[i];
|
|
2927
|
-
return r = o.pop(), [t,
|
|
2928
|
+
return r = o.pop(), [t, Gn(o), r];
|
|
2928
2929
|
}).apply(this, arguments);
|
|
2929
2930
|
return this._transaction.apply(this, e);
|
|
2930
|
-
},
|
|
2931
|
+
}, Z.prototype._transaction = function(e, t, n) {
|
|
2931
2932
|
var r = this, i = D.trans;
|
|
2932
2933
|
i && i.db === this && e.indexOf("!") === -1 || (i = null);
|
|
2933
2934
|
var o, a, u = e.indexOf("?") !== -1;
|
|
@@ -2937,15 +2938,15 @@ var Er = { exports: {} };
|
|
|
2937
2938
|
if (l = l instanceof r.Table ? l.name : l, typeof l != "string")
|
|
2938
2939
|
throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
2939
2940
|
return l;
|
|
2940
|
-
}), e == "r" || e ===
|
|
2941
|
-
o =
|
|
2941
|
+
}), e == "r" || e === an)
|
|
2942
|
+
o = an;
|
|
2942
2943
|
else {
|
|
2943
|
-
if (e != "rw" && e !=
|
|
2944
|
+
if (e != "rw" && e != sn)
|
|
2944
2945
|
throw new I.InvalidArgument("Invalid transaction mode: " + e);
|
|
2945
|
-
o =
|
|
2946
|
+
o = sn;
|
|
2946
2947
|
}
|
|
2947
2948
|
if (i) {
|
|
2948
|
-
if (i.mode ===
|
|
2949
|
+
if (i.mode === an && o === sn) {
|
|
2949
2950
|
if (!u)
|
|
2950
2951
|
throw new I.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2951
2952
|
i = null;
|
|
@@ -2959,184 +2960,184 @@ var Er = { exports: {} };
|
|
|
2959
2960
|
}), u && i && !i.active && (i = null);
|
|
2960
2961
|
}
|
|
2961
2962
|
} catch (l) {
|
|
2962
|
-
return i ? i._promise(null, function(
|
|
2963
|
+
return i ? i._promise(null, function(m, c) {
|
|
2963
2964
|
c(l);
|
|
2964
|
-
}) :
|
|
2965
|
+
}) : J(l);
|
|
2965
2966
|
}
|
|
2966
|
-
var
|
|
2967
|
+
var h = (function l(m, c, f, d, y) {
|
|
2967
2968
|
return K.resolve().then(function() {
|
|
2968
|
-
var
|
|
2969
|
-
if (p.explicit = !0,
|
|
2970
|
-
p.idbtrans =
|
|
2969
|
+
var g = D.transless || D, p = m._createTransaction(c, f, m._dbSchema, d);
|
|
2970
|
+
if (p.explicit = !0, g = { trans: p, transless: g }, d)
|
|
2971
|
+
p.idbtrans = d.idbtrans;
|
|
2971
2972
|
else
|
|
2972
2973
|
try {
|
|
2973
|
-
p.create(), p.idbtrans._explicit = !0,
|
|
2974
|
-
} catch (
|
|
2975
|
-
return
|
|
2976
|
-
return l(
|
|
2977
|
-
})) :
|
|
2974
|
+
p.create(), p.idbtrans._explicit = !0, m._state.PR1398_maxLoop = 3;
|
|
2975
|
+
} catch (k) {
|
|
2976
|
+
return k.name === Qt.InvalidState && m.isOpen() && 0 < --m._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), m.close({ disableAutoOpen: !1 }), m.open().then(function() {
|
|
2977
|
+
return l(m, c, f, null, y);
|
|
2978
|
+
})) : J(k);
|
|
2978
2979
|
}
|
|
2979
|
-
var b, w =
|
|
2980
|
-
return w && Ye(),
|
|
2981
|
-
var
|
|
2982
|
-
(b = y.call(p, p)) && (w ? (
|
|
2983
|
-
},
|
|
2984
|
-
return p.active ?
|
|
2985
|
-
}) :
|
|
2980
|
+
var b, w = Ht(y);
|
|
2981
|
+
return w && Ye(), g = K.follow(function() {
|
|
2982
|
+
var k;
|
|
2983
|
+
(b = y.call(p, p)) && (w ? (k = Oe.bind(null, null), b.then(k, k)) : typeof b.next == "function" && typeof b.throw == "function" && (b = Pn(b)));
|
|
2984
|
+
}, g), (b && typeof b.then == "function" ? K.resolve(b).then(function(k) {
|
|
2985
|
+
return p.active ? k : J(new I.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2986
|
+
}) : g.then(function() {
|
|
2986
2987
|
return b;
|
|
2987
|
-
})).then(function(
|
|
2988
|
-
return
|
|
2989
|
-
return
|
|
2988
|
+
})).then(function(k) {
|
|
2989
|
+
return d && p._resolve(), p._completion.then(function() {
|
|
2990
|
+
return k;
|
|
2990
2991
|
});
|
|
2991
|
-
}).catch(function(
|
|
2992
|
-
return p._reject(
|
|
2992
|
+
}).catch(function(k) {
|
|
2993
|
+
return p._reject(k), J(k);
|
|
2993
2994
|
});
|
|
2994
2995
|
});
|
|
2995
2996
|
}).bind(null, this, o, a, i, n);
|
|
2996
|
-
return i ? i._promise(o,
|
|
2997
|
-
return r._whenReady(
|
|
2998
|
-
}) : this._whenReady(
|
|
2999
|
-
},
|
|
2997
|
+
return i ? i._promise(o, h, "lock") : D.trans ? Te(D.transless, function() {
|
|
2998
|
+
return r._whenReady(h);
|
|
2999
|
+
}) : this._whenReady(h);
|
|
3000
|
+
}, Z.prototype.table = function(e) {
|
|
3000
3001
|
if (!ne(this._allTables, e))
|
|
3001
3002
|
throw new I.InvalidTable("Table ".concat(e, " does not exist"));
|
|
3002
3003
|
return this._allTables[e];
|
|
3003
|
-
},
|
|
3004
|
-
function
|
|
3004
|
+
}, Z);
|
|
3005
|
+
function Z(e, t) {
|
|
3005
3006
|
var n = this;
|
|
3006
3007
|
this._middlewares = {}, this.verno = 0;
|
|
3007
|
-
var r =
|
|
3008
|
-
this._options = t = _({ addons:
|
|
3009
|
-
var i, o, a, u,
|
|
3008
|
+
var r = Z.dependencies;
|
|
3009
|
+
this._options = t = _({ addons: Z.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3010
|
+
var i, o, a, u, h, l = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: V, dbReadyPromise: null, cancelOpen: V, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
3010
3011
|
l.dbReadyPromise = new K(function(c) {
|
|
3011
3012
|
l.dbReadyResolve = c;
|
|
3012
3013
|
}), l.openCanceller = new K(function(c, f) {
|
|
3013
3014
|
l.cancelOpen = f;
|
|
3014
|
-
}), this._state = l, this.name = e, this.on = at(this, "populate", "blocked", "versionchange", "close", { ready: [
|
|
3015
|
-
return function(f,
|
|
3016
|
-
|
|
3017
|
-
var y,
|
|
3018
|
-
|
|
3015
|
+
}), this._state = l, this.name = e, this.on = at(this, "populate", "blocked", "versionchange", "close", { ready: [Xt, V] }), this.on.ready.subscribe = Wn(this.on.ready.subscribe, function(c) {
|
|
3016
|
+
return function(f, d) {
|
|
3017
|
+
Z.vip(function() {
|
|
3018
|
+
var y, g = n._state;
|
|
3019
|
+
g.openComplete ? (g.dbOpenError || K.resolve().then(f), d && c(f)) : g.onReadyBeingFired ? (g.onReadyBeingFired.push(f), d && c(f)) : (c(f), y = n, d || c(function p() {
|
|
3019
3020
|
y.on.ready.unsubscribe(f), y.on.ready.unsubscribe(p);
|
|
3020
3021
|
}));
|
|
3021
3022
|
});
|
|
3022
3023
|
};
|
|
3023
|
-
}), this.Collection = (i = this, st(
|
|
3024
|
+
}), this.Collection = (i = this, st(Qr.prototype, function(b, p) {
|
|
3024
3025
|
this.db = i;
|
|
3025
|
-
var
|
|
3026
|
+
var d = rr, y = null;
|
|
3026
3027
|
if (p)
|
|
3027
3028
|
try {
|
|
3028
|
-
|
|
3029
|
+
d = p();
|
|
3029
3030
|
} catch (w) {
|
|
3030
3031
|
y = w;
|
|
3031
3032
|
}
|
|
3032
|
-
var
|
|
3033
|
-
this._ctx = { table: p, index:
|
|
3034
|
-
})), this.Table = (o = this, st(
|
|
3035
|
-
this.db = o, this._tx =
|
|
3036
|
-
})), this.Transaction = (a = this, st(
|
|
3033
|
+
var g = b._ctx, p = g.table, b = p.hook.reading.fire;
|
|
3034
|
+
this._ctx = { table: p, index: g.index, isPrimKey: !g.index || p.schema.primKey.keyPath && g.index === p.schema.primKey.name, range: d, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: y, or: g.or, valueMapper: b !== et ? b : null };
|
|
3035
|
+
})), this.Table = (o = this, st(sr.prototype, function(c, f, d) {
|
|
3036
|
+
this.db = o, this._tx = d, this.name = c, this.schema = f, this.hook = o._allTables[c] ? o._allTables[c].hook : at(null, { creating: [zr, V], reading: [Nr, et], updating: [Ur, V], deleting: [Lr, V] });
|
|
3037
|
+
})), this.Transaction = (a = this, st(Zr.prototype, function(c, f, d, y, g) {
|
|
3037
3038
|
var p = this;
|
|
3038
|
-
this.db = a, this.mode = c, this.storeNames = f, this.schema =
|
|
3039
|
+
this.db = a, this.mode = c, this.storeNames = f, this.schema = d, this.chromeTransactionDurability = y, this.idbtrans = null, this.on = at(this, "complete", "error", "abort"), this.parent = g || 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 K(function(b, w) {
|
|
3039
3040
|
p._resolve = b, p._reject = w;
|
|
3040
3041
|
}), this._completion.then(function() {
|
|
3041
3042
|
p.active = !1, p.on.complete.fire();
|
|
3042
3043
|
}, function(b) {
|
|
3043
3044
|
var w = p.active;
|
|
3044
|
-
return p.active = !1, p.on.error.fire(b), p.parent ? p.parent._reject(b) : w && p.idbtrans && p.idbtrans.abort(),
|
|
3045
|
+
return p.active = !1, p.on.error.fire(b), p.parent ? p.parent._reject(b) : w && p.idbtrans && p.idbtrans.abort(), J(b);
|
|
3045
3046
|
});
|
|
3046
|
-
})), this.Version = (u = this, st(
|
|
3047
|
+
})), this.Version = (u = this, st(oi.prototype, function(c) {
|
|
3047
3048
|
this.db = u, this._cfg = { version: c, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3048
|
-
})), this.WhereClause = (
|
|
3049
|
-
if (this.db =
|
|
3050
|
-
return U(
|
|
3051
|
-
}, this._max = function(y,
|
|
3052
|
-
return 0 < U(y,
|
|
3053
|
-
}, this._min = function(y,
|
|
3054
|
-
return U(y,
|
|
3055
|
-
}, this._IDBKeyRange =
|
|
3049
|
+
})), this.WhereClause = (h = this, st(fr.prototype, function(c, f, d) {
|
|
3050
|
+
if (this.db = h, this._ctx = { table: c, index: f === ":id" ? null : f, or: d }, this._cmp = this._ascending = U, this._descending = function(y, g) {
|
|
3051
|
+
return U(g, y);
|
|
3052
|
+
}, this._max = function(y, g) {
|
|
3053
|
+
return 0 < U(y, g) ? y : g;
|
|
3054
|
+
}, this._min = function(y, g) {
|
|
3055
|
+
return U(y, g) < 0 ? y : g;
|
|
3056
|
+
}, this._IDBKeyRange = h._deps.IDBKeyRange, !this._IDBKeyRange)
|
|
3056
3057
|
throw new I.MissingAPI();
|
|
3057
3058
|
})), this.on("versionchange", function(c) {
|
|
3058
3059
|
0 < c.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
3059
3060
|
}), this.on("blocked", function(c) {
|
|
3060
3061
|
!c.newVersion || c.newVersion < c.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(c.oldVersion / 10));
|
|
3061
|
-
}), this._maxKey = lt(t.IDBKeyRange), this._createTransaction = function(c, f,
|
|
3062
|
-
return new n.Transaction(c, f,
|
|
3062
|
+
}), this._maxKey = lt(t.IDBKeyRange), this._createTransaction = function(c, f, d, y) {
|
|
3063
|
+
return new n.Transaction(c, f, d, n._options.chromeTransactionDurability, y);
|
|
3063
3064
|
}, this._fireOnBlocked = function(c) {
|
|
3064
3065
|
n.on("blocked").fire(c), He.filter(function(f) {
|
|
3065
3066
|
return f.name === n.name && f !== n && !f._state.vcFired;
|
|
3066
3067
|
}).map(function(f) {
|
|
3067
3068
|
return f.on("versionchange").fire(c);
|
|
3068
3069
|
});
|
|
3069
|
-
}, this.use(
|
|
3070
|
-
var
|
|
3070
|
+
}, this.use(ci), this.use(di), this.use(li), this.use(si), this.use(ui);
|
|
3071
|
+
var m = new Proxy(this, { get: function(c, f, d) {
|
|
3071
3072
|
if (f === "_vip")
|
|
3072
3073
|
return !0;
|
|
3073
3074
|
if (f === "table")
|
|
3074
|
-
return function(
|
|
3075
|
-
return
|
|
3075
|
+
return function(g) {
|
|
3076
|
+
return Wt(n.table(g), m);
|
|
3076
3077
|
};
|
|
3077
|
-
var y = Reflect.get(c, f,
|
|
3078
|
-
return y instanceof
|
|
3079
|
-
return
|
|
3078
|
+
var y = Reflect.get(c, f, d);
|
|
3079
|
+
return y instanceof sr ? Wt(y, m) : f === "tables" ? y.map(function(g) {
|
|
3080
|
+
return Wt(g, m);
|
|
3080
3081
|
}) : f === "_createTransaction" ? function() {
|
|
3081
|
-
return
|
|
3082
|
+
return Wt(y.apply(this, arguments), m);
|
|
3082
3083
|
} : y;
|
|
3083
3084
|
} });
|
|
3084
|
-
this.vip =
|
|
3085
|
+
this.vip = m, r.forEach(function(c) {
|
|
3085
3086
|
return c(n);
|
|
3086
3087
|
});
|
|
3087
3088
|
}
|
|
3088
|
-
var
|
|
3089
|
+
var $t, le = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", pi = (An.prototype.subscribe = function(e, t, n) {
|
|
3089
3090
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
|
|
3090
|
-
},
|
|
3091
|
+
}, An.prototype[le] = function() {
|
|
3091
3092
|
return this;
|
|
3092
|
-
},
|
|
3093
|
-
function
|
|
3093
|
+
}, An);
|
|
3094
|
+
function An(e) {
|
|
3094
3095
|
this._subscribe = e;
|
|
3095
3096
|
}
|
|
3096
3097
|
try {
|
|
3097
|
-
|
|
3098
|
+
$t = { indexedDB: F.indexedDB || F.mozIndexedDB || F.webkitIndexedDB || F.msIndexedDB, IDBKeyRange: F.IDBKeyRange || F.webkitIDBKeyRange };
|
|
3098
3099
|
} catch {
|
|
3099
|
-
|
|
3100
|
+
$t = { indexedDB: null, IDBKeyRange: null };
|
|
3100
3101
|
}
|
|
3101
|
-
function
|
|
3102
|
-
var t, n = !1, r = new
|
|
3103
|
-
var o =
|
|
3102
|
+
function Sr(e) {
|
|
3103
|
+
var t, n = !1, r = new pi(function(i) {
|
|
3104
|
+
var o = Ht(e), a, u = !1, h = {}, l = {}, m = { get closed() {
|
|
3104
3105
|
return u;
|
|
3105
3106
|
}, unsubscribe: function() {
|
|
3106
|
-
u || (u = !0, a && a.abort(), c && Pe.storagemutated.unsubscribe(
|
|
3107
|
+
u || (u = !0, a && a.abort(), c && Pe.storagemutated.unsubscribe(d));
|
|
3107
3108
|
} };
|
|
3108
|
-
i.start && i.start(
|
|
3109
|
+
i.start && i.start(m);
|
|
3109
3110
|
var c = !1, f = function() {
|
|
3110
|
-
return
|
|
3111
|
-
},
|
|
3112
|
-
|
|
3111
|
+
return on(y);
|
|
3112
|
+
}, d = function(g) {
|
|
3113
|
+
zt(h, g), xn(l, h) && f();
|
|
3113
3114
|
}, y = function() {
|
|
3114
|
-
var
|
|
3115
|
-
!u &&
|
|
3116
|
-
var
|
|
3115
|
+
var g, p, b;
|
|
3116
|
+
!u && $t.indexedDB && (h = {}, g = {}, a && a.abort(), a = new AbortController(), b = function(w) {
|
|
3117
|
+
var k = Ve();
|
|
3117
3118
|
try {
|
|
3118
3119
|
o && Ye();
|
|
3119
|
-
var
|
|
3120
|
-
return
|
|
3120
|
+
var x = xe(e, w);
|
|
3121
|
+
return x = o ? x.finally(Oe) : x;
|
|
3121
3122
|
} finally {
|
|
3122
|
-
|
|
3123
|
+
k && Ge();
|
|
3123
3124
|
}
|
|
3124
|
-
}(p = { subscr:
|
|
3125
|
-
n = !0, t = w, u || p.signal.aborted || (
|
|
3126
|
-
for (var
|
|
3127
|
-
if (ne(
|
|
3125
|
+
}(p = { subscr: g, signal: a.signal, requery: f, querier: e, trans: null }), Promise.resolve(b).then(function(w) {
|
|
3126
|
+
n = !0, t = w, u || p.signal.aborted || (h = {}, function(k) {
|
|
3127
|
+
for (var x in k)
|
|
3128
|
+
if (ne(k, x))
|
|
3128
3129
|
return;
|
|
3129
3130
|
return 1;
|
|
3130
|
-
}(l =
|
|
3131
|
+
}(l = g) || c || (Pe(ct, d), c = !0), on(function() {
|
|
3131
3132
|
return !u && i.next && i.next(w);
|
|
3132
3133
|
}));
|
|
3133
3134
|
}, function(w) {
|
|
3134
|
-
n = !1, ["DatabaseClosedError", "AbortError"].includes(w == null ? void 0 : w.name) || u ||
|
|
3135
|
+
n = !1, ["DatabaseClosedError", "AbortError"].includes(w == null ? void 0 : w.name) || u || on(function() {
|
|
3135
3136
|
u || i.error && i.error(w);
|
|
3136
3137
|
});
|
|
3137
3138
|
}));
|
|
3138
3139
|
};
|
|
3139
|
-
return setTimeout(f, 0),
|
|
3140
|
+
return setTimeout(f, 0), m;
|
|
3140
3141
|
});
|
|
3141
3142
|
return r.hasValue = function() {
|
|
3142
3143
|
return n;
|
|
@@ -3145,15 +3146,15 @@ var Er = { exports: {} };
|
|
|
3145
3146
|
}, r;
|
|
3146
3147
|
}
|
|
3147
3148
|
var Me = ve;
|
|
3148
|
-
function
|
|
3149
|
+
function Dn(e) {
|
|
3149
3150
|
var t = je;
|
|
3150
3151
|
try {
|
|
3151
|
-
je = !0, Pe.storagemutated.fire(e),
|
|
3152
|
+
je = !0, Pe.storagemutated.fire(e), En(e, !0);
|
|
3152
3153
|
} finally {
|
|
3153
3154
|
je = t;
|
|
3154
3155
|
}
|
|
3155
3156
|
}
|
|
3156
|
-
ze(Me, _(_({},
|
|
3157
|
+
ze(Me, _(_({}, bt), { delete: function(e) {
|
|
3157
3158
|
return new Me(e, { addons: [] }).delete();
|
|
3158
3159
|
}, exists: function(e) {
|
|
3159
3160
|
return new Me(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3163,15 +3164,15 @@ var Er = { exports: {} };
|
|
|
3163
3164
|
});
|
|
3164
3165
|
}, getDatabaseNames: function(e) {
|
|
3165
3166
|
try {
|
|
3166
|
-
return t = Me.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (
|
|
3167
|
+
return t = Me.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (bn(n) ? Promise.resolve(n.databases()).then(function(r) {
|
|
3167
3168
|
return r.map(function(i) {
|
|
3168
3169
|
return i.name;
|
|
3169
3170
|
}).filter(function(i) {
|
|
3170
|
-
return i !==
|
|
3171
|
+
return i !== jt;
|
|
3171
3172
|
});
|
|
3172
|
-
}) :
|
|
3173
|
+
}) : vn(n, t).toCollection().primaryKeys()).then(e);
|
|
3173
3174
|
} catch {
|
|
3174
|
-
return
|
|
3175
|
+
return J(new I.MissingAPI());
|
|
3175
3176
|
}
|
|
3176
3177
|
var t, n;
|
|
3177
3178
|
}, defineClass: function() {
|
|
@@ -3180,21 +3181,21 @@ var Er = { exports: {} };
|
|
|
3180
3181
|
};
|
|
3181
3182
|
}, ignoreTransaction: function(e) {
|
|
3182
3183
|
return D.trans ? Te(D.transless, e) : e();
|
|
3183
|
-
}, vip:
|
|
3184
|
+
}, vip: wn, async: function(e) {
|
|
3184
3185
|
return function() {
|
|
3185
3186
|
try {
|
|
3186
|
-
var t =
|
|
3187
|
+
var t = Pn(e.apply(this, arguments));
|
|
3187
3188
|
return t && typeof t.then == "function" ? t : K.resolve(t);
|
|
3188
3189
|
} catch (n) {
|
|
3189
|
-
return
|
|
3190
|
+
return J(n);
|
|
3190
3191
|
}
|
|
3191
3192
|
};
|
|
3192
3193
|
}, spawn: function(e, t, n) {
|
|
3193
3194
|
try {
|
|
3194
|
-
var r =
|
|
3195
|
+
var r = Pn(e.apply(n, t || []));
|
|
3195
3196
|
return r && typeof r.then == "function" ? r : K.resolve(r);
|
|
3196
3197
|
} catch (i) {
|
|
3197
|
-
return
|
|
3198
|
+
return J(i);
|
|
3198
3199
|
}
|
|
3199
3200
|
}, currentTransaction: { get: function() {
|
|
3200
3201
|
return D.trans || null;
|
|
@@ -3203,25 +3204,25 @@ var Er = { exports: {} };
|
|
|
3203
3204
|
}, Promise: K, debug: { get: function() {
|
|
3204
3205
|
return fe;
|
|
3205
3206
|
}, set: function(e) {
|
|
3206
|
-
|
|
3207
|
-
} }, derive: Le, extend: q, props: ze, override:
|
|
3207
|
+
Xn(e);
|
|
3208
|
+
} }, derive: Le, extend: q, props: ze, override: Wn, Events: at, on: Pe, liveQuery: Sr, extendObservabilitySet: zt, getByKeyPath: ye, setByKeyPath: ce, delByKeyPath: function(e, t) {
|
|
3208
3209
|
typeof t == "string" ? ce(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3209
3210
|
ce(e, n, void 0);
|
|
3210
3211
|
});
|
|
3211
|
-
}, shallowClone:
|
|
3212
|
+
}, shallowClone: Vn, deepClone: _e, getObjectDiff: jn, cmp: U, asap: $n, minKey: -1 / 0, addons: [], connections: He, errnames: Qt, dependencies: $t, cache: Re, semVer: he, version: he.split(".").map(function(e) {
|
|
3212
3213
|
return parseInt(e);
|
|
3213
3214
|
}).reduce(function(e, t, n) {
|
|
3214
3215
|
return e + t / Math.pow(10, 2 * n);
|
|
3215
3216
|
}) })), Me.maxKey = lt(Me.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Pe(ct, function(e) {
|
|
3216
|
-
je || (e = new CustomEvent(
|
|
3217
|
-
}), addEventListener(
|
|
3218
|
-
e = e.detail, je ||
|
|
3217
|
+
je || (e = new CustomEvent(fn, { detail: e }), je = !0, dispatchEvent(e), je = !1);
|
|
3218
|
+
}), addEventListener(fn, function(e) {
|
|
3219
|
+
e = e.detail, je || Dn(e);
|
|
3219
3220
|
}));
|
|
3220
|
-
var Je, je = !1,
|
|
3221
|
+
var Je, je = !1, Er = function() {
|
|
3221
3222
|
};
|
|
3222
|
-
return typeof BroadcastChannel < "u" && ((
|
|
3223
|
-
(Je = new BroadcastChannel(
|
|
3224
|
-
return e.data &&
|
|
3223
|
+
return typeof BroadcastChannel < "u" && ((Er = function() {
|
|
3224
|
+
(Je = new BroadcastChannel(fn)).onmessage = function(e) {
|
|
3225
|
+
return e.data && Dn(e.data);
|
|
3225
3226
|
};
|
|
3226
3227
|
})(), typeof Je.unref == "function" && Je.unref(), Pe(ct, function(e) {
|
|
3227
3228
|
je || Je.postMessage(e);
|
|
@@ -3232,23 +3233,23 @@ var Er = { exports: {} };
|
|
|
3232
3233
|
n[t].close({ disableAutoOpen: !1 });
|
|
3233
3234
|
}
|
|
3234
3235
|
}), addEventListener("pageshow", function(e) {
|
|
3235
|
-
!ve.disableBfCache && e.persisted && (fe && console.debug("Dexie: handling persisted pageshow"),
|
|
3236
|
+
!ve.disableBfCache && e.persisted && (fe && console.debug("Dexie: handling persisted pageshow"), Er(), Dn({ all: new re(-1 / 0, [[]]) }));
|
|
3236
3237
|
})), K.rejectionMapper = function(e, t) {
|
|
3237
|
-
return !e || e instanceof We || e instanceof TypeError || e instanceof SyntaxError || !e.name || !
|
|
3238
|
+
return !e || e instanceof We || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Qn[e.name] ? e : (t = new Qn[e.name](t || e.message, e), "stack" in e && we(t, "stack", { get: function() {
|
|
3238
3239
|
return this.inner.stack;
|
|
3239
3240
|
} }), t);
|
|
3240
|
-
},
|
|
3241
|
+
}, Xn(fe), _(ve, Object.freeze({ __proto__: null, Dexie: ve, liveQuery: Sr, Entity: ir, cmp: U, default: ve, RangeSet: re, mergeRanges: dt, rangesOverlap: Nt }), { default: ve }), ve;
|
|
3241
3242
|
});
|
|
3242
|
-
})(
|
|
3243
|
-
var
|
|
3244
|
-
const
|
|
3245
|
-
if (
|
|
3246
|
-
throw new Error(`Two different versions of Dexie loaded in the same app: ${
|
|
3243
|
+
})(Kr);
|
|
3244
|
+
var Si = Kr.exports;
|
|
3245
|
+
const Nn = /* @__PURE__ */ Oi(Si), jr = Symbol.for("Dexie"), zn = globalThis[jr] || (globalThis[jr] = Nn);
|
|
3246
|
+
if (Nn.semVer !== zn.semVer)
|
|
3247
|
+
throw new Error(`Two different versions of Dexie loaded in the same app: ${Nn.semVer} and ${zn.semVer}`);
|
|
3247
3248
|
function Q(M) {
|
|
3248
3249
|
let s = `${M.type}.${M.topics}`;
|
|
3249
3250
|
return M.order && (s += `.${M.order}`), M.period && (s += `.${M.period}`), s;
|
|
3250
3251
|
}
|
|
3251
|
-
function
|
|
3252
|
+
function mt(M, s) {
|
|
3252
3253
|
var W;
|
|
3253
3254
|
let v, _, j, F, T;
|
|
3254
3255
|
switch (M.moderation) {
|
|
@@ -3266,8 +3267,7 @@ function pt(M, s) {
|
|
|
3266
3267
|
}
|
|
3267
3268
|
return s;
|
|
3268
3269
|
}
|
|
3269
|
-
|
|
3270
|
-
class ki {
|
|
3270
|
+
class Ei {
|
|
3271
3271
|
constructor(s) {
|
|
3272
3272
|
A(this, "db");
|
|
3273
3273
|
A(this, "subscribers", []);
|
|
@@ -3278,16 +3278,16 @@ class ki {
|
|
|
3278
3278
|
data: v.data
|
|
3279
3279
|
}).then(() => 201).catch(() => 400) : 400);
|
|
3280
3280
|
A(this, "getCloud", async (s) => {
|
|
3281
|
-
const v = await this.db.table(
|
|
3281
|
+
const v = await this.db.table(Cr).where({ id: s.widget }).last();
|
|
3282
3282
|
return v ? (v.presentation = (s == null ? void 0 : s.presentation) || "not set", v.slide = (s == null ? void 0 : s.slide) || "not set", v) : { data: null };
|
|
3283
3283
|
});
|
|
3284
|
-
A(this, "setSeries", async (s, v) => v !== "" ? await this.db.table(
|
|
3284
|
+
A(this, "setSeries", async (s, v) => v !== "" ? await this.db.table(Fn).put({
|
|
3285
3285
|
id: s.widget,
|
|
3286
3286
|
dashboard_id: s.dashboard,
|
|
3287
3287
|
data: v.data
|
|
3288
3288
|
}).then(() => 201).catch(() => 400) : 400);
|
|
3289
3289
|
A(this, "getSeries", async (s) => {
|
|
3290
|
-
const v = await this.db.table(
|
|
3290
|
+
const v = await this.db.table(Fn).where({ id: s.widget }).last();
|
|
3291
3291
|
return v.presentation = (s == null ? void 0 : s.presentation) || "not set", v.slide = (s == null ? void 0 : s.slide) || "not set", v ?? { data: null };
|
|
3292
3292
|
});
|
|
3293
3293
|
A(this, "setMessages", async (s, v) => {
|
|
@@ -3295,7 +3295,7 @@ class ki {
|
|
|
3295
3295
|
try {
|
|
3296
3296
|
return v.data.messages.forEach(async (j) => {
|
|
3297
3297
|
var F, T, W;
|
|
3298
|
-
await this.db.table(Ne).put({ id: j.id, utc: j.utc, data: j }), await this.db.table(
|
|
3298
|
+
await this.db.table(Ne).put({ id: j.id, utc: j.utc, data: j }), await this.db.table(gi).put({
|
|
3299
3299
|
widget_id: s.widget,
|
|
3300
3300
|
message_id: j.id,
|
|
3301
3301
|
dashboard_id: s.dashboard,
|
|
@@ -3316,7 +3316,7 @@ class ki {
|
|
|
3316
3316
|
try {
|
|
3317
3317
|
const F = await this.db.table("topics").orderBy("utc").reverse().filter(v).filter(_).filter(j).limit((s == null ? void 0 : s.limit) ?? 25).toArray(), T = F[0] ? F[0].title : "No results", W = F.map(
|
|
3318
3318
|
(oe) => oe.message_id
|
|
3319
|
-
), q = await this.db.table("messages").where("id").anyOf(W).toArray().then((oe) => oe.sort((
|
|
3319
|
+
), q = await this.db.table("messages").where("id").anyOf(W).toArray().then((oe) => oe.sort((X, ne) => ne.utc - X.utc));
|
|
3320
3320
|
return {
|
|
3321
3321
|
data: {
|
|
3322
3322
|
presentation: (s == null ? void 0 : s.presentation) || "not set",
|
|
@@ -3345,14 +3345,14 @@ class ki {
|
|
|
3345
3345
|
}
|
|
3346
3346
|
this.subscribers.filter(
|
|
3347
3347
|
(j) => j.widget === s.widget
|
|
3348
|
-
).length > 0 || (s.type === Ne && (s =
|
|
3348
|
+
).length > 0 || (s.type === Ne && (s = mt(this.options, s)), console.info(
|
|
3349
3349
|
"%cstorage",
|
|
3350
|
-
|
|
3350
|
+
pt,
|
|
3351
3351
|
"subscribe",
|
|
3352
3352
|
s
|
|
3353
3353
|
), this.subscribers.push(s));
|
|
3354
3354
|
});
|
|
3355
|
-
this.options = s, this.db = new
|
|
3355
|
+
this.options = s, this.db = new zn(s.app), this.db.version(2).stores({
|
|
3356
3356
|
player: "id,title,name,location",
|
|
3357
3357
|
monitor: "id,player_id,cols,rows,order,width,height,physicalwidth,physicalheight,devicePixelRatio,screenLeft,screenTop,orientation,monitor",
|
|
3358
3358
|
display: "id,monitor_id,presentation_id,colstart,colend,rowstart,rowend",
|
|
@@ -3369,28 +3369,28 @@ class ki {
|
|
|
3369
3369
|
return this.subscribers;
|
|
3370
3370
|
}
|
|
3371
3371
|
}
|
|
3372
|
-
function
|
|
3372
|
+
function Ln(M) {
|
|
3373
3373
|
return new Promise((s, v) => {
|
|
3374
3374
|
M.oncomplete = M.onsuccess = () => s(M.result), M.onabort = M.onerror = () => v(M.error);
|
|
3375
3375
|
});
|
|
3376
3376
|
}
|
|
3377
|
-
function
|
|
3377
|
+
function Pi(M, s) {
|
|
3378
3378
|
const v = indexedDB.open(M);
|
|
3379
3379
|
v.onupgradeneeded = () => v.result.createObjectStore(s);
|
|
3380
|
-
const _ =
|
|
3380
|
+
const _ = Ln(v);
|
|
3381
3381
|
return (j, F) => _.then((T) => F(T.transaction(s, j).objectStore(s)));
|
|
3382
3382
|
}
|
|
3383
|
-
let
|
|
3384
|
-
function
|
|
3385
|
-
return
|
|
3383
|
+
let In;
|
|
3384
|
+
function Ar() {
|
|
3385
|
+
return In || (In = Pi("keyval-store", "keyval")), In;
|
|
3386
3386
|
}
|
|
3387
|
-
function
|
|
3388
|
-
return s("readonly", (v) =>
|
|
3387
|
+
function Rn(M, s = Ar()) {
|
|
3388
|
+
return s("readonly", (v) => Ln(v.get(M)));
|
|
3389
3389
|
}
|
|
3390
|
-
function
|
|
3391
|
-
return v("readwrite", (_) => (_.put(s, M),
|
|
3390
|
+
function Mn(M, s, v = Ar()) {
|
|
3391
|
+
return v("readwrite", (_) => (_.put(s, M), Ln(_.transaction)));
|
|
3392
3392
|
}
|
|
3393
|
-
class
|
|
3393
|
+
class ji {
|
|
3394
3394
|
constructor(s) {
|
|
3395
3395
|
A(this, "subscribers", []);
|
|
3396
3396
|
A(this, "options");
|
|
@@ -3398,31 +3398,31 @@ class Si {
|
|
|
3398
3398
|
if (!v.success)
|
|
3399
3399
|
return 400;
|
|
3400
3400
|
const _ = Q(s);
|
|
3401
|
-
return delete v.success, delete v.message, await
|
|
3401
|
+
return delete v.success, delete v.message, await Mn(_, v).then(() => 201).catch(() => 400);
|
|
3402
3402
|
});
|
|
3403
3403
|
A(this, "getCloud", async (s) => {
|
|
3404
3404
|
const v = Q(s);
|
|
3405
|
-
return await
|
|
3405
|
+
return await Rn(v);
|
|
3406
3406
|
});
|
|
3407
3407
|
A(this, "setSeries", async (s, v) => {
|
|
3408
3408
|
if (!v.success)
|
|
3409
3409
|
return 400;
|
|
3410
3410
|
const _ = Q(s);
|
|
3411
|
-
return delete v.success, delete v.message, await
|
|
3411
|
+
return delete v.success, delete v.message, await Mn(_, v).then(() => 201).catch(() => 400);
|
|
3412
3412
|
});
|
|
3413
3413
|
A(this, "getSeries", async (s) => {
|
|
3414
3414
|
const v = Q(s);
|
|
3415
|
-
return await
|
|
3415
|
+
return await Rn(v);
|
|
3416
3416
|
});
|
|
3417
3417
|
A(this, "setMessages", async (s, v) => {
|
|
3418
3418
|
if (!v.success)
|
|
3419
3419
|
return 400;
|
|
3420
3420
|
const _ = Q(s);
|
|
3421
|
-
return delete v.success, delete v.message, await
|
|
3421
|
+
return delete v.success, delete v.message, await Mn(_, v).then(() => 201).catch(() => 400);
|
|
3422
3422
|
});
|
|
3423
3423
|
A(this, "getMessages", async (s) => {
|
|
3424
3424
|
const v = Q(s);
|
|
3425
|
-
return await
|
|
3425
|
+
return await Rn(v).then((_) => _).catch(() => 400);
|
|
3426
3426
|
});
|
|
3427
3427
|
A(this, "cleanMessages", async (s) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((v) => v())));
|
|
3428
3428
|
A(this, "subscribe", (s) => {
|
|
@@ -3431,11 +3431,11 @@ class Si {
|
|
|
3431
3431
|
const j = (_ = s.topics) == null ? void 0 : _.split("-");
|
|
3432
3432
|
s.dashboard = j ? j[0] : "", s.widget = j ? j[1] : "";
|
|
3433
3433
|
}
|
|
3434
|
-
s.type === Ne && (s =
|
|
3434
|
+
s.type === Ne && (s = mt(this.options, s)), !(this.subscribers.filter(
|
|
3435
3435
|
(j) => j.widget === s.widget
|
|
3436
3436
|
).length > 0) && (console.info(
|
|
3437
3437
|
"%cstorage",
|
|
3438
|
-
|
|
3438
|
+
pt,
|
|
3439
3439
|
"subscribe",
|
|
3440
3440
|
s
|
|
3441
3441
|
), this.subscribers.push(s));
|
|
@@ -3446,7 +3446,7 @@ class Si {
|
|
|
3446
3446
|
return this.subscribers;
|
|
3447
3447
|
}
|
|
3448
3448
|
}
|
|
3449
|
-
class
|
|
3449
|
+
class Ci {
|
|
3450
3450
|
constructor(s) {
|
|
3451
3451
|
A(this, "subscribers", []);
|
|
3452
3452
|
A(this, "options");
|
|
@@ -3515,11 +3515,11 @@ class Ei {
|
|
|
3515
3515
|
const j = (_ = s.topics) == null ? void 0 : _.split("-");
|
|
3516
3516
|
s.dashboard = j ? j[0] : "", s.widget = j ? j[1] : "";
|
|
3517
3517
|
}
|
|
3518
|
-
s.type === Ne && (s =
|
|
3518
|
+
s.type === Ne && (s = mt(this.options, s)), !this.subscribers.filter(
|
|
3519
3519
|
(j) => j.widget === s.widget
|
|
3520
3520
|
).length && (console.info(
|
|
3521
3521
|
"%cstorage",
|
|
3522
|
-
|
|
3522
|
+
yt,
|
|
3523
3523
|
"subscribe",
|
|
3524
3524
|
s
|
|
3525
3525
|
), this.subscribers.push(s));
|
|
@@ -3535,7 +3535,7 @@ class Ei {
|
|
|
3535
3535
|
return this.subscribers;
|
|
3536
3536
|
}
|
|
3537
3537
|
}
|
|
3538
|
-
class
|
|
3538
|
+
class Ki {
|
|
3539
3539
|
constructor(s) {
|
|
3540
3540
|
A(this, "subscribers", []);
|
|
3541
3541
|
A(this, "options");
|
|
@@ -3604,11 +3604,11 @@ class Pi {
|
|
|
3604
3604
|
const j = (_ = s.topics) == null ? void 0 : _.split("-");
|
|
3605
3605
|
s.dashboard = j ? j[0] : "", s.widget = j ? j[1] : "";
|
|
3606
3606
|
}
|
|
3607
|
-
s.type === Ne && (s =
|
|
3607
|
+
s.type === Ne && (s = mt(this.options, s)), !this.subscribers.filter(
|
|
3608
3608
|
(j) => j.widget === s.widget
|
|
3609
3609
|
).length && (console.info(
|
|
3610
3610
|
"%cstorage",
|
|
3611
|
-
|
|
3611
|
+
yt,
|
|
3612
3612
|
"subscribe",
|
|
3613
3613
|
s
|
|
3614
3614
|
), this.subscribers.push(s));
|
|
@@ -3624,7 +3624,7 @@ class Pi {
|
|
|
3624
3624
|
return this.subscribers;
|
|
3625
3625
|
}
|
|
3626
3626
|
}
|
|
3627
|
-
class
|
|
3627
|
+
class Ai {
|
|
3628
3628
|
constructor(s) {
|
|
3629
3629
|
A(this, "subscribers", []);
|
|
3630
3630
|
A(this, "options");
|
|
@@ -3693,11 +3693,11 @@ class ji {
|
|
|
3693
3693
|
const j = (_ = s.topics) == null ? void 0 : _.split("-");
|
|
3694
3694
|
s.dashboard = j ? j[0] : "", s.widget = j ? j[1] : "";
|
|
3695
3695
|
}
|
|
3696
|
-
s.type === Ne && (s =
|
|
3696
|
+
s.type === Ne && (s = mt(this.options, s)), !this.subscribers.filter(
|
|
3697
3697
|
(j) => j.widget === s.widget
|
|
3698
3698
|
).length && (console.info(
|
|
3699
3699
|
"%cstorage",
|
|
3700
|
-
|
|
3700
|
+
yt,
|
|
3701
3701
|
"subscribe",
|
|
3702
3702
|
s
|
|
3703
3703
|
), this.subscribers.push(s));
|
|
@@ -3708,7 +3708,7 @@ class ji {
|
|
|
3708
3708
|
return this.subscribers;
|
|
3709
3709
|
}
|
|
3710
3710
|
}
|
|
3711
|
-
class
|
|
3711
|
+
class Ti {
|
|
3712
3712
|
constructor(s) {
|
|
3713
3713
|
A(this, "sm");
|
|
3714
3714
|
A(this, "api");
|
|
@@ -3727,24 +3727,24 @@ class Ki {
|
|
|
3727
3727
|
var W, q, oe;
|
|
3728
3728
|
let T = 400;
|
|
3729
3729
|
if (F.status === "fulfilled") {
|
|
3730
|
-
const
|
|
3731
|
-
if (
|
|
3732
|
-
switch (
|
|
3730
|
+
const X = F.value;
|
|
3731
|
+
if (X.success === !0)
|
|
3732
|
+
switch (X.query.type) {
|
|
3733
3733
|
case Ne:
|
|
3734
|
-
T = await ((W = this.sm) == null ? void 0 : W.setMessages(
|
|
3734
|
+
T = await ((W = this.sm) == null ? void 0 : W.setMessages(X.query, X));
|
|
3735
3735
|
break;
|
|
3736
|
-
case
|
|
3737
|
-
T = await ((q = this.sm) == null ? void 0 : q.setCloud(
|
|
3736
|
+
case Cr:
|
|
3737
|
+
T = await ((q = this.sm) == null ? void 0 : q.setCloud(X.query, X));
|
|
3738
3738
|
break;
|
|
3739
|
-
case
|
|
3740
|
-
T = await ((oe = this.sm) == null ? void 0 : oe.setSeries(
|
|
3739
|
+
case Fn:
|
|
3740
|
+
T = await ((oe = this.sm) == null ? void 0 : oe.setSeries(X.query, X));
|
|
3741
3741
|
break;
|
|
3742
3742
|
default:
|
|
3743
3743
|
console.warn(
|
|
3744
3744
|
"%cstorage",
|
|
3745
|
-
|
|
3745
|
+
pt,
|
|
3746
3746
|
"error",
|
|
3747
|
-
`data type ${
|
|
3747
|
+
`data type ${X.query.type} unknown`
|
|
3748
3748
|
);
|
|
3749
3749
|
}
|
|
3750
3750
|
else
|
|
@@ -3753,20 +3753,21 @@ class Ki {
|
|
|
3753
3753
|
case 201:
|
|
3754
3754
|
console.info(
|
|
3755
3755
|
"%cbroadcast",
|
|
3756
|
-
|
|
3756
|
+
Bn,
|
|
3757
3757
|
"send",
|
|
3758
|
-
|
|
3759
|
-
|
|
3758
|
+
X.query.slide,
|
|
3759
|
+
X.data.title ?? X.query.widget,
|
|
3760
|
+
X.query,
|
|
3760
3761
|
T
|
|
3761
|
-
), this.bc.postMessage({ event: "widget-update", data:
|
|
3762
|
+
), this.bc.postMessage({ event: "widget-update", data: X.query });
|
|
3762
3763
|
break;
|
|
3763
3764
|
case 400:
|
|
3764
3765
|
console.warn(
|
|
3765
3766
|
"%cbroadcast",
|
|
3766
|
-
|
|
3767
|
+
Bn,
|
|
3767
3768
|
"error",
|
|
3768
|
-
|
|
3769
|
-
|
|
3769
|
+
X.data.title ?? X.query.widget,
|
|
3770
|
+
X.query,
|
|
3770
3771
|
T
|
|
3771
3772
|
);
|
|
3772
3773
|
break;
|
|
@@ -3774,7 +3775,7 @@ class Ki {
|
|
|
3774
3775
|
} else
|
|
3775
3776
|
console.warn(
|
|
3776
3777
|
"%cstorage",
|
|
3777
|
-
|
|
3778
|
+
pt,
|
|
3778
3779
|
"error"
|
|
3779
3780
|
);
|
|
3780
3781
|
})
|
|
@@ -3792,7 +3793,7 @@ class Ki {
|
|
|
3792
3793
|
case "update":
|
|
3793
3794
|
console.debug(
|
|
3794
3795
|
"%cstorage",
|
|
3795
|
-
|
|
3796
|
+
pt,
|
|
3796
3797
|
"update",
|
|
3797
3798
|
s.data
|
|
3798
3799
|
), await this.update();
|
|
@@ -3824,41 +3825,44 @@ class Ki {
|
|
|
3824
3825
|
const v = (s == null ? void 0 : s.slide) || s.app;
|
|
3825
3826
|
switch (this.bc = new BroadcastChannel(v), console.info(
|
|
3826
3827
|
"%cbroadcast",
|
|
3827
|
-
|
|
3828
|
+
Bn,
|
|
3828
3829
|
"channel",
|
|
3829
3830
|
v
|
|
3830
3831
|
), this.bc.onmessage = (_) => {
|
|
3831
3832
|
this.actions(_);
|
|
3832
|
-
}, this.bc.postMessage({ event: "sm-init", data: {} }), this.api = new
|
|
3833
|
+
}, this.bc.postMessage({ event: "sm-init", data: {} }), this.api = new xi(s), s.storage) {
|
|
3833
3834
|
case _i:
|
|
3834
|
-
this.sm = new
|
|
3835
|
+
this.sm = new Ei(s);
|
|
3835
3836
|
break;
|
|
3836
3837
|
case bi:
|
|
3837
|
-
this.sm = new
|
|
3838
|
+
this.sm = new Ki(s);
|
|
3838
3839
|
break;
|
|
3839
3840
|
case wi:
|
|
3840
|
-
this.sm = new
|
|
3841
|
+
this.sm = new Ci(s);
|
|
3841
3842
|
break;
|
|
3842
3843
|
case vi:
|
|
3843
|
-
this.sm = new Si(s);
|
|
3844
|
-
break;
|
|
3845
|
-
case xi:
|
|
3846
3844
|
this.sm = new ji(s);
|
|
3847
3845
|
break;
|
|
3846
|
+
case ki:
|
|
3847
|
+
this.sm = new Ai(s);
|
|
3848
|
+
break;
|
|
3848
3849
|
default:
|
|
3849
3850
|
this.sm = null;
|
|
3850
3851
|
}
|
|
3851
3852
|
}
|
|
3852
3853
|
}
|
|
3853
3854
|
export {
|
|
3854
|
-
|
|
3855
|
+
yt as API_CSS,
|
|
3856
|
+
Bn as BROADCAST_CSS,
|
|
3857
|
+
Cr as CLOUD,
|
|
3855
3858
|
Ne as MESSAGES,
|
|
3856
|
-
|
|
3859
|
+
Fn as SERIES,
|
|
3860
|
+
pt as STORAGE_CSS,
|
|
3857
3861
|
_i as STORAGE_DEXIE,
|
|
3858
3862
|
vi as STORAGE_KEYVAL,
|
|
3859
3863
|
bi as STORAGE_LOCAL,
|
|
3860
3864
|
wi as STORAGE_SESSION,
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3865
|
+
ki as STORAGE_WINDOW,
|
|
3866
|
+
gi as TOPICS,
|
|
3867
|
+
Ti as default
|
|
3864
3868
|
};
|