@dialecte/core 0.0.8 → 0.0.9
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/chain-methods/chain-creator.d.ts.map +1 -1
- package/dist/chain-methods/mutations/clone.d.ts +1 -0
- package/dist/chain-methods/mutations/clone.d.ts.map +1 -1
- package/dist/index.js +457 -451
- package/dist/types/dialecte-config.d.ts +6 -3
- package/dist/types/dialecte-config.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -87,7 +87,7 @@ function la(l) {
|
|
|
87
87
|
};
|
|
88
88
|
if (!u.elements.includes(h)) return q;
|
|
89
89
|
const z = u.definition[h].attributes.sequence, H = u.definition[h].attributes.details, M = z.flatMap((J) => {
|
|
90
|
-
const
|
|
90
|
+
const re = H[J].required, ye = H[J]?.namespace || void 0, Y = P.find((ie) => ie.name === J)?.value || (re ? H[J]?.default || "" : void 0);
|
|
91
91
|
return Y === void 0 ? [] : [
|
|
92
92
|
{
|
|
93
93
|
name: J,
|
|
@@ -96,14 +96,14 @@ function la(l) {
|
|
|
96
96
|
}
|
|
97
97
|
];
|
|
98
98
|
});
|
|
99
|
-
let
|
|
99
|
+
let F = {
|
|
100
100
|
...q,
|
|
101
101
|
namespace: u.definition[h].namespace,
|
|
102
102
|
attributes: M
|
|
103
103
|
};
|
|
104
|
-
return u.hooks?.afterStandardizedRecord && (
|
|
105
|
-
record:
|
|
106
|
-
})),
|
|
104
|
+
return u.hooks?.afterStandardizedRecord && (F = u.hooks.afterStandardizedRecord({
|
|
105
|
+
record: F
|
|
106
|
+
})), F;
|
|
107
107
|
}
|
|
108
108
|
function ro(l) {
|
|
109
109
|
const { attributes: c, name: u } = l;
|
|
@@ -565,7 +565,7 @@ function po() {
|
|
|
565
565
|
function go(l, c, u) {
|
|
566
566
|
const o = yo(l, c);
|
|
567
567
|
for (const h of o) {
|
|
568
|
-
const m = ha(h), y = vo(h), b = _o(h, c), P = h.endsWith("_3") ? qe.ext : qe.default, q = mo(h),
|
|
568
|
+
const m = ha(h), y = vo(h), b = _o(h, c), P = h.endsWith("_3") ? qe.ext : qe.default, q = mo(h), V = [...q.required, ...q.optional], z = Zr(h), M = {
|
|
569
569
|
...Ct,
|
|
570
570
|
minOccurrence: z === 1 ? 1 : null,
|
|
571
571
|
maxOccurrence: z
|
|
@@ -583,12 +583,12 @@ function go(l, c, u) {
|
|
|
583
583
|
namespace: P,
|
|
584
584
|
attributes: {
|
|
585
585
|
any: !1,
|
|
586
|
-
sequence:
|
|
586
|
+
sequence: V,
|
|
587
587
|
details: Object.fromEntries(
|
|
588
|
-
|
|
589
|
-
const J = q.required.includes(
|
|
588
|
+
V.map((F) => {
|
|
589
|
+
const J = q.required.includes(F), ye = F.startsWith("c") ? qe.ext : P;
|
|
590
590
|
return [
|
|
591
|
-
|
|
591
|
+
F,
|
|
592
592
|
{
|
|
593
593
|
namespace: ye,
|
|
594
594
|
required: J,
|
|
@@ -603,15 +603,15 @@ function go(l, c, u) {
|
|
|
603
603
|
any: !1,
|
|
604
604
|
sequence: b,
|
|
605
605
|
details: Object.fromEntries(
|
|
606
|
-
b.map((
|
|
607
|
-
const J = Zr(
|
|
606
|
+
b.map((F) => {
|
|
607
|
+
const J = Zr(F), re = J === 1;
|
|
608
608
|
return [
|
|
609
|
-
|
|
609
|
+
F,
|
|
610
610
|
{
|
|
611
|
-
required:
|
|
611
|
+
required: re,
|
|
612
612
|
validation: {
|
|
613
613
|
...Ct,
|
|
614
|
-
minOccurrence:
|
|
614
|
+
minOccurrence: re ? 1 : null,
|
|
615
615
|
maxOccurrence: J
|
|
616
616
|
},
|
|
617
617
|
constraints: []
|
|
@@ -760,7 +760,7 @@ function xo() {
|
|
|
760
760
|
}
|
|
761
761
|
typeof Promise > "u" || m.Promise || (m.Promise = Promise);
|
|
762
762
|
var P = Object.getPrototypeOf, q = {}.hasOwnProperty;
|
|
763
|
-
function
|
|
763
|
+
function V(e, t) {
|
|
764
764
|
return q.call(e, t);
|
|
765
765
|
}
|
|
766
766
|
function z(e, t) {
|
|
@@ -770,28 +770,28 @@ function xo() {
|
|
|
770
770
|
}
|
|
771
771
|
var H = Object.defineProperty;
|
|
772
772
|
function M(e, t, n, r) {
|
|
773
|
-
H(e, t, R(n &&
|
|
773
|
+
H(e, t, R(n && V(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function F(e) {
|
|
776
776
|
return { from: function(t) {
|
|
777
777
|
return e.prototype = Object.create(t.prototype), M(e.prototype, "constructor", e), { extend: z.bind(null, e.prototype) };
|
|
778
778
|
} };
|
|
779
779
|
}
|
|
780
|
-
var J = Object.getOwnPropertyDescriptor,
|
|
780
|
+
var J = Object.getOwnPropertyDescriptor, re = [].slice;
|
|
781
781
|
function ye(e, t, n) {
|
|
782
|
-
return
|
|
782
|
+
return re.call(e, t, n);
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function ee(e, t) {
|
|
785
785
|
return t(e);
|
|
786
786
|
}
|
|
787
787
|
function Y(e) {
|
|
788
788
|
if (!e) throw new Error("Assertion Failed");
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function ie(e) {
|
|
791
791
|
m.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
792
792
|
}
|
|
793
793
|
function pe(e, t) {
|
|
794
|
-
if (typeof t == "string" &&
|
|
794
|
+
if (typeof t == "string" && V(e, t)) return e[t];
|
|
795
795
|
if (!t) return e;
|
|
796
796
|
if (typeof t != "string") {
|
|
797
797
|
for (var n = [], r = 0, a = t.length; r < a; ++r) {
|
|
@@ -806,18 +806,18 @@ function xo() {
|
|
|
806
806
|
return p == null ? void 0 : pe(p, t.substr(d + 1));
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function oe(e, t, n) {
|
|
810
810
|
if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof t != "string" && "length" in t) {
|
|
811
811
|
Y(typeof n != "string" && "length" in n);
|
|
812
|
-
for (var r = 0, a = t.length; r < a; ++r)
|
|
812
|
+
for (var r = 0, a = t.length; r < a; ++r) oe(e, t[r], n[r]);
|
|
813
813
|
} else {
|
|
814
814
|
var i, d, p = t.indexOf(".");
|
|
815
|
-
p !== -1 ? (i = t.substr(0, p), (d = t.substr(p + 1)) === "" ? n === void 0 ? b(e) && !isNaN(parseInt(i)) ? e.splice(i, 1) : delete e[i] : e[i] = n :
|
|
815
|
+
p !== -1 ? (i = t.substr(0, p), (d = t.substr(p + 1)) === "" ? n === void 0 ? b(e) && !isNaN(parseInt(i)) ? e.splice(i, 1) : delete e[i] : e[i] = n : oe(p = !(p = e[i]) || !V(e, i) ? e[i] = {} : p, d, n)) : n === void 0 ? b(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
818
|
function Re(e) {
|
|
819
819
|
var t, n = {};
|
|
820
|
-
for (t in e)
|
|
820
|
+
for (t in e) V(e, t) && (n[t] = e[t]);
|
|
821
821
|
return n;
|
|
822
822
|
}
|
|
823
823
|
var I = [].concat;
|
|
@@ -844,7 +844,7 @@ function xo() {
|
|
|
844
844
|
} else if (ze.has(n.constructor)) r = n;
|
|
845
845
|
else {
|
|
846
846
|
var d, p = P(n);
|
|
847
|
-
for (d in r = p === Object.prototype ? {} : Object.create(p), de.set(n, r), n)
|
|
847
|
+
for (d in r = p === Object.prototype ? {} : Object.create(p), de.set(n, r), n) V(n, d) && (r[d] = t(n[d]));
|
|
848
848
|
}
|
|
849
849
|
return r;
|
|
850
850
|
})(e), de = null, e;
|
|
@@ -863,7 +863,7 @@ function xo() {
|
|
|
863
863
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
864
864
|
}
|
|
865
865
|
var Le = {};
|
|
866
|
-
function
|
|
866
|
+
function ke(e) {
|
|
867
867
|
var t, n, r, a;
|
|
868
868
|
if (arguments.length === 1) {
|
|
869
869
|
if (b(e)) return e.slice();
|
|
@@ -904,9 +904,9 @@ function xo() {
|
|
|
904
904
|
return t[n];
|
|
905
905
|
}), this.failuresByPos = t, this.message = St(e, this.failures);
|
|
906
906
|
}
|
|
907
|
-
|
|
907
|
+
F(Qe).from(Error).extend({ toString: function() {
|
|
908
908
|
return this.name + ": " + this.message;
|
|
909
|
-
} }),
|
|
909
|
+
} }), F(He).from(Qe), F(Ze).from(Qe);
|
|
910
910
|
var f = Me.reduce(function(e, t) {
|
|
911
911
|
return e[t] = t + "Error", e;
|
|
912
912
|
}, {}), s = Qe, O = Me.reduce(function(e, t) {
|
|
@@ -915,7 +915,7 @@ function xo() {
|
|
|
915
915
|
this.name = n, a ? typeof a == "string" ? (this.message = "".concat(a).concat(i ? `
|
|
916
916
|
` + i : ""), this.inner = i || null) : typeof a == "object" && (this.message = "".concat(a.name, " ").concat(a.message), this.inner = a) : (this.message = Pt[t] || n, this.inner = null);
|
|
917
917
|
}
|
|
918
|
-
return
|
|
918
|
+
return F(r).from(s), e[t] = r, e;
|
|
919
919
|
}, {});
|
|
920
920
|
O.Syntax = SyntaxError, O.Type = TypeError, O.Range = RangeError;
|
|
921
921
|
var B = Mt.reduce(function(e, t) {
|
|
@@ -982,10 +982,10 @@ function xo() {
|
|
|
982
982
|
}
|
|
983
983
|
ue.ModifyError = He, ue.DexieError = Qe, ue.BulkError = Ze;
|
|
984
984
|
var De = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
985
|
-
function
|
|
985
|
+
function kt(e) {
|
|
986
986
|
De = e;
|
|
987
987
|
}
|
|
988
|
-
var
|
|
988
|
+
var Ft = {}, _r = 100, ft = typeof Promise > "u" ? [] : (function() {
|
|
989
989
|
var e = Promise.resolve();
|
|
990
990
|
if (typeof crypto > "u" || !crypto.subtle) return [e, P(e), e];
|
|
991
991
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
@@ -998,8 +998,8 @@ function xo() {
|
|
|
998
998
|
this._listeners = [], this._lib = !1;
|
|
999
999
|
var t = this._PSD = Q;
|
|
1000
1000
|
if (typeof e != "function") {
|
|
1001
|
-
if (e !==
|
|
1002
|
-
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 &&
|
|
1001
|
+
if (e !== Ft) throw new TypeError("Not a function");
|
|
1002
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Fn(this, this._value));
|
|
1003
1003
|
}
|
|
1004
1004
|
this._state = null, this._value = null, ++t.ref, (function n(r, a) {
|
|
1005
1005
|
try {
|
|
@@ -1011,13 +1011,13 @@ function xo() {
|
|
|
1011
1011
|
i instanceof X ? i._then(p, v) : i.then(p, v);
|
|
1012
1012
|
}) : (r._state = !0, r._value = i, Cr(r)), d && Et();
|
|
1013
1013
|
}
|
|
1014
|
-
},
|
|
1014
|
+
}, Fn.bind(null, r));
|
|
1015
1015
|
} catch (i) {
|
|
1016
|
-
|
|
1016
|
+
Fn(r, i);
|
|
1017
1017
|
}
|
|
1018
1018
|
})(this, e);
|
|
1019
1019
|
}
|
|
1020
|
-
var
|
|
1020
|
+
var kn = { get: function() {
|
|
1021
1021
|
var e = Q, t = an;
|
|
1022
1022
|
function n(r, a) {
|
|
1023
1023
|
var i = this, d = !e.global && (e !== Q || t !== an), p = d && !nt(), v = new X(function(C, w) {
|
|
@@ -1025,16 +1025,16 @@ function xo() {
|
|
|
1025
1025
|
});
|
|
1026
1026
|
return this._consoleTask && (v._consoleTask = this._consoleTask), v;
|
|
1027
1027
|
}
|
|
1028
|
-
return n.prototype =
|
|
1028
|
+
return n.prototype = Ft, n;
|
|
1029
1029
|
}, set: function(e) {
|
|
1030
|
-
M(this, "then", e && e.prototype ===
|
|
1030
|
+
M(this, "then", e && e.prototype === Ft ? kn : { get: function() {
|
|
1031
1031
|
return e;
|
|
1032
|
-
}, set:
|
|
1032
|
+
}, set: kn.set });
|
|
1033
1033
|
} };
|
|
1034
1034
|
function br(e, t, n, r, a) {
|
|
1035
1035
|
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = a;
|
|
1036
1036
|
}
|
|
1037
|
-
function
|
|
1037
|
+
function Fn(e, t) {
|
|
1038
1038
|
var n, r;
|
|
1039
1039
|
Jt.push(t), e._state === null && (n = e._lib && Bt(), t = Sn(t), e._state = !1, e._value = t, r = e, ht.some(function(a) {
|
|
1040
1040
|
return a._value === r._value;
|
|
@@ -1097,7 +1097,7 @@ function xo() {
|
|
|
1097
1097
|
for (var t = en.slice(0), n = t.length; n; ) t[--n]();
|
|
1098
1098
|
}
|
|
1099
1099
|
function tn(e) {
|
|
1100
|
-
return new X(
|
|
1100
|
+
return new X(Ft, !1, e);
|
|
1101
1101
|
}
|
|
1102
1102
|
function ge(e, t) {
|
|
1103
1103
|
var n = Q;
|
|
@@ -1112,7 +1112,7 @@ function xo() {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
};
|
|
1114
1114
|
}
|
|
1115
|
-
z(X.prototype, { then:
|
|
1115
|
+
z(X.prototype, { then: kn, _then: function(e, t) {
|
|
1116
1116
|
Mn(this, new br(null, null, e, t, Q));
|
|
1117
1117
|
}, catch: function(e) {
|
|
1118
1118
|
if (arguments.length === 1) return this.then(null, e);
|
|
@@ -1141,7 +1141,7 @@ function xo() {
|
|
|
1141
1141
|
n.then(r, a).finally(clearTimeout.bind(null, i));
|
|
1142
1142
|
}) : this;
|
|
1143
1143
|
} }), typeof Symbol < "u" && Symbol.toStringTag && M(X.prototype, Symbol.toStringTag, "Dexie.Promise"), et.env = Ar(), z(X, { all: function() {
|
|
1144
|
-
var e =
|
|
1144
|
+
var e = ke.apply(null, arguments).map(on);
|
|
1145
1145
|
return new X(function(t, n) {
|
|
1146
1146
|
e.length === 0 && t([]);
|
|
1147
1147
|
var r = e.length;
|
|
@@ -1154,9 +1154,9 @@ function xo() {
|
|
|
1154
1154
|
}, resolve: function(e) {
|
|
1155
1155
|
return e instanceof X ? e : e && typeof e.then == "function" ? new X(function(t, n) {
|
|
1156
1156
|
e.then(t, n);
|
|
1157
|
-
}) : new X(
|
|
1157
|
+
}) : new X(Ft, !0, e);
|
|
1158
1158
|
}, reject: tn, race: function() {
|
|
1159
|
-
var e =
|
|
1159
|
+
var e = ke.apply(null, arguments).map(on);
|
|
1160
1160
|
return new X(function(t, n) {
|
|
1161
1161
|
e.map(function(r) {
|
|
1162
1162
|
return X.resolve(r).then(t, n);
|
|
@@ -1193,7 +1193,7 @@ function xo() {
|
|
|
1193
1193
|
}, t, n, r);
|
|
1194
1194
|
});
|
|
1195
1195
|
} }), dt && (dt.allSettled && M(X, "allSettled", function() {
|
|
1196
|
-
var e =
|
|
1196
|
+
var e = ke.apply(null, arguments).map(on);
|
|
1197
1197
|
return new X(function(t) {
|
|
1198
1198
|
e.length === 0 && t([]);
|
|
1199
1199
|
var n = e.length, r = new Array(n);
|
|
@@ -1208,7 +1208,7 @@ function xo() {
|
|
|
1208
1208
|
});
|
|
1209
1209
|
});
|
|
1210
1210
|
}), dt.any && typeof AggregateError < "u" && M(X, "any", function() {
|
|
1211
|
-
var e =
|
|
1211
|
+
var e = ke.apply(null, arguments).map(on);
|
|
1212
1212
|
return new X(function(t, n) {
|
|
1213
1213
|
e.length === 0 && n(new AggregateError([]));
|
|
1214
1214
|
var r = e.length, a = new Array(r);
|
|
@@ -1492,7 +1492,7 @@ function xo() {
|
|
|
1492
1492
|
return p.numFailures ? X.reject(p.failures[0]) : p.lastResult;
|
|
1493
1493
|
}).then(function(p) {
|
|
1494
1494
|
if (i) try {
|
|
1495
|
-
|
|
1495
|
+
oe(e, i, p);
|
|
1496
1496
|
} catch {
|
|
1497
1497
|
}
|
|
1498
1498
|
return p;
|
|
@@ -1507,7 +1507,7 @@ function xo() {
|
|
|
1507
1507
|
return p.numFailures ? X.reject(p.failures[0]) : p.lastResult;
|
|
1508
1508
|
}).then(function(p) {
|
|
1509
1509
|
if (i) try {
|
|
1510
|
-
|
|
1510
|
+
oe(e, i, p);
|
|
1511
1511
|
} catch {
|
|
1512
1512
|
}
|
|
1513
1513
|
return p;
|
|
@@ -1581,7 +1581,7 @@ function xo() {
|
|
|
1581
1581
|
var D = N[E], S = A[D];
|
|
1582
1582
|
if (D === t.schema.primKey.keyPath) {
|
|
1583
1583
|
if (se(S, _) !== 0) throw new O.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1584
|
-
} else
|
|
1584
|
+
} else oe(x, D, S);
|
|
1585
1585
|
}
|
|
1586
1586
|
i.push(T), v.push(_), C.push(x);
|
|
1587
1587
|
}
|
|
@@ -1645,7 +1645,7 @@ function xo() {
|
|
|
1645
1645
|
var _ = i(g, he, function() {
|
|
1646
1646
|
for (var A = arguments.length, x = new Array(A); A--; ) x[A] = arguments[A];
|
|
1647
1647
|
_.subscribers.forEach(function(E) {
|
|
1648
|
-
|
|
1648
|
+
ie(function() {
|
|
1649
1649
|
E.apply(null, x);
|
|
1650
1650
|
});
|
|
1651
1651
|
});
|
|
@@ -1655,7 +1655,7 @@ function xo() {
|
|
|
1655
1655
|
}
|
|
1656
1656
|
}
|
|
1657
1657
|
function Lt(e, t) {
|
|
1658
|
-
return
|
|
1658
|
+
return F(t).from({ prototype: e }), t;
|
|
1659
1659
|
}
|
|
1660
1660
|
function Nt(e, t) {
|
|
1661
1661
|
return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
|
|
@@ -1688,7 +1688,7 @@ function xo() {
|
|
|
1688
1688
|
return v.stop(T);
|
|
1689
1689
|
}, function(T) {
|
|
1690
1690
|
return v.fail(T);
|
|
1691
|
-
}) || ((g = "" + (w = v.primaryKey)) == "[object ArrayBuffer]" && (g = "" + new Uint8Array(w)),
|
|
1691
|
+
}) || ((g = "" + (w = v.primaryKey)) == "[object ArrayBuffer]" && (g = "" + new Uint8Array(w)), V(i, g) || (i[g] = !0, t(p, v, C)));
|
|
1692
1692
|
};
|
|
1693
1693
|
return Promise.all([e.or._iterate(d, n), Ir(Rr(e, r, n), e.algorithm, d, !e.keysOnly && e.valueMapper)]);
|
|
1694
1694
|
}
|
|
@@ -1904,7 +1904,7 @@ function xo() {
|
|
|
1904
1904
|
if (!e || !e.multi) return this;
|
|
1905
1905
|
var t = {};
|
|
1906
1906
|
return Un(this._ctx, function(a) {
|
|
1907
|
-
var r = a.primaryKey.toString(), a =
|
|
1907
|
+
var r = a.primaryKey.toString(), a = V(t, r);
|
|
1908
1908
|
return t[r] = !0, !a;
|
|
1909
1909
|
}), this;
|
|
1910
1910
|
}, le.prototype.modify = function(e) {
|
|
@@ -1913,16 +1913,16 @@ function xo() {
|
|
|
1913
1913
|
var a, i, d;
|
|
1914
1914
|
d = typeof e == "function" ? e : (a = y(e), i = a.length, function(N) {
|
|
1915
1915
|
for (var D = !1, S = 0; S < i; ++S) {
|
|
1916
|
-
var
|
|
1917
|
-
j instanceof Ut ? (
|
|
1916
|
+
var k = a[S], j = e[k], U = pe(N, k);
|
|
1917
|
+
j instanceof Ut ? (oe(N, k, j.execute(U)), D = !0) : U !== j && (oe(N, k, j), D = !0);
|
|
1918
1918
|
}
|
|
1919
1919
|
return D;
|
|
1920
1920
|
});
|
|
1921
1921
|
var p = n.table.core, g = p.schema.primaryKey, v = g.outbound, C = g.extractKey, w = 200, g = t.db._options.modifyChunkSize;
|
|
1922
1922
|
g && (w = typeof g == "object" ? g[p.name] || g["*"] || 200 : g);
|
|
1923
|
-
function T(N,
|
|
1924
|
-
var S =
|
|
1925
|
-
A += N -
|
|
1923
|
+
function T(N, k) {
|
|
1924
|
+
var S = k.failures, k = k.numFailures;
|
|
1925
|
+
A += N - k;
|
|
1926
1926
|
for (var j = 0, U = y(S); j < U.length; j++) {
|
|
1927
1927
|
var K = U[j];
|
|
1928
1928
|
_.push(S[K]);
|
|
@@ -1930,29 +1930,29 @@ function xo() {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
var _ = [], A = 0, x = [], E = e === Pr;
|
|
1932
1932
|
return t.clone().primaryKeys().then(function(N) {
|
|
1933
|
-
function D(
|
|
1934
|
-
var j = Math.min(w, N.length -
|
|
1933
|
+
function D(k) {
|
|
1934
|
+
var j = Math.min(w, N.length - k), U = N.slice(k, k + j);
|
|
1935
1935
|
return (E ? Promise.resolve([]) : p.getMany({ trans: r, keys: U, cache: "immutable" })).then(function(K) {
|
|
1936
|
-
var L = [],
|
|
1937
|
-
if (!E) for (var
|
|
1938
|
-
var ce = K[
|
|
1939
|
-
d.call(ne, ne.value, ne) !== !1 && (ne.value == null ? W.push(N[
|
|
1936
|
+
var L = [], G = [], $ = v ? [] : null, W = E ? U : [];
|
|
1937
|
+
if (!E) for (var ae = 0; ae < j; ++ae) {
|
|
1938
|
+
var ce = K[ae], ne = { value: Se(ce), primKey: N[k + ae] };
|
|
1939
|
+
d.call(ne, ne.value, ne) !== !1 && (ne.value == null ? W.push(N[k + ae]) : v || se(C(ce), C(ne.value)) === 0 ? (G.push(ne.value), v && $.push(N[k + ae])) : (W.push(N[k + ae]), L.push(ne.value)));
|
|
1940
1940
|
}
|
|
1941
1941
|
return Promise.resolve(0 < L.length && p.mutate({ trans: r, type: "add", values: L }).then(function(_e) {
|
|
1942
|
-
for (var
|
|
1942
|
+
for (var te in _e.failures) W.splice(parseInt(te), 1);
|
|
1943
1943
|
T(L.length, _e);
|
|
1944
1944
|
})).then(function() {
|
|
1945
|
-
return (0 <
|
|
1946
|
-
return T(
|
|
1945
|
+
return (0 < G.length || S && typeof e == "object") && p.mutate({ trans: r, type: "put", keys: $, values: G, criteria: S, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < k }).then(function(_e) {
|
|
1946
|
+
return T(G.length, _e);
|
|
1947
1947
|
});
|
|
1948
1948
|
}).then(function() {
|
|
1949
|
-
return (0 < W.length || S && E) && p.mutate({ trans: r, type: "delete", keys: W, criteria: S, isAdditionalChunk: 0 <
|
|
1949
|
+
return (0 < W.length || S && E) && p.mutate({ trans: r, type: "delete", keys: W, criteria: S, isAdditionalChunk: 0 < k }).then(function(_e) {
|
|
1950
1950
|
return cn(n.table, W, _e);
|
|
1951
1951
|
}).then(function(_e) {
|
|
1952
1952
|
return T(W.length, _e);
|
|
1953
1953
|
});
|
|
1954
1954
|
}).then(function() {
|
|
1955
|
-
return N.length >
|
|
1955
|
+
return N.length > k + j && D(k + w);
|
|
1956
1956
|
});
|
|
1957
1957
|
});
|
|
1958
1958
|
}
|
|
@@ -1983,14 +1983,14 @@ function xo() {
|
|
|
1983
1983
|
var Pr = function(e, t) {
|
|
1984
1984
|
return t.value = null;
|
|
1985
1985
|
};
|
|
1986
|
-
function
|
|
1986
|
+
function ka(e, t) {
|
|
1987
1987
|
return e < t ? -1 : e === t ? 0 : 1;
|
|
1988
1988
|
}
|
|
1989
|
-
function
|
|
1989
|
+
function Fa(e, t) {
|
|
1990
1990
|
return t < e ? -1 : e === t ? 0 : 1;
|
|
1991
1991
|
}
|
|
1992
|
-
function
|
|
1993
|
-
return e = e instanceof
|
|
1992
|
+
function Fe(e, t, n) {
|
|
1993
|
+
return e = e instanceof kr ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
|
|
1994
1994
|
}
|
|
1995
1995
|
function Ot(e) {
|
|
1996
1996
|
return new e.Collection(e, function() {
|
|
@@ -2001,7 +2001,7 @@ function xo() {
|
|
|
2001
2001
|
var a, i, d, p, v, C, w, g = n.length;
|
|
2002
2002
|
if (!n.every(function(A) {
|
|
2003
2003
|
return typeof A == "string";
|
|
2004
|
-
})) return
|
|
2004
|
+
})) return Fe(e, Br);
|
|
2005
2005
|
function T(A) {
|
|
2006
2006
|
a = A === "next" ? function(E) {
|
|
2007
2007
|
return E.toUpperCase();
|
|
@@ -2011,7 +2011,7 @@ function xo() {
|
|
|
2011
2011
|
return E.toLowerCase();
|
|
2012
2012
|
} : function(E) {
|
|
2013
2013
|
return E.toUpperCase();
|
|
2014
|
-
}, d = A === "next" ?
|
|
2014
|
+
}, d = A === "next" ? ka : Fa;
|
|
2015
2015
|
var x = n.map(function(E) {
|
|
2016
2016
|
return { lower: i(E), upper: a(E) };
|
|
2017
2017
|
}).sort(function(E, N) {
|
|
@@ -2034,16 +2034,16 @@ function xo() {
|
|
|
2034
2034
|
if (typeof N != "string") return !1;
|
|
2035
2035
|
var D = i(N);
|
|
2036
2036
|
if (t(D, v, _)) return !0;
|
|
2037
|
-
for (var S = null,
|
|
2038
|
-
var j = (function(U, K, L,
|
|
2039
|
-
for (var
|
|
2037
|
+
for (var S = null, k = _; k < g; ++k) {
|
|
2038
|
+
var j = (function(U, K, L, G, $, W) {
|
|
2039
|
+
for (var ae = Math.min(U.length, G.length), ce = -1, ne = 0; ne < ae; ++ne) {
|
|
2040
2040
|
var _e = K[ne];
|
|
2041
|
-
if (_e !==
|
|
2041
|
+
if (_e !== G[ne]) return $(U[ne], L[ne]) < 0 ? U.substr(0, ne) + L[ne] + L.substr(ne + 1) : $(U[ne], G[ne]) < 0 ? U.substr(0, ne) + G[ne] + L.substr(ne + 1) : 0 <= ce ? U.substr(0, ce) + K[ce] + L.substr(ce + 1) : null;
|
|
2042
2042
|
$(U[ne], _e) < 0 && (ce = ne);
|
|
2043
2043
|
}
|
|
2044
|
-
return
|
|
2045
|
-
})(N, D, p[
|
|
2046
|
-
j === null && S === null ? _ =
|
|
2044
|
+
return ae < G.length && W === "next" ? U + L.substr(U.length) : ae < U.length && W === "prev" ? U.substr(0, L.length) : ce < 0 ? null : U.substr(0, ce) + G[ce] + L.substr(ce + 1);
|
|
2045
|
+
})(N, D, p[k], v[k], d, C);
|
|
2046
|
+
j === null && S === null ? _ = k + 1 : (S === null || 0 < d(S, j)) && (S = j);
|
|
2047
2047
|
}
|
|
2048
2048
|
return x(S !== null ? function() {
|
|
2049
2049
|
A.continue(S + w);
|
|
@@ -2056,7 +2056,7 @@ function xo() {
|
|
|
2056
2056
|
function Sr(e) {
|
|
2057
2057
|
return { type: 1, lower: e, upper: e };
|
|
2058
2058
|
}
|
|
2059
|
-
var
|
|
2059
|
+
var kr = (Object.defineProperty(Be.prototype, "Collection", { get: function() {
|
|
2060
2060
|
return this._ctx.table.db.Collection;
|
|
2061
2061
|
}, enumerable: !1, configurable: !0 }), Be.prototype.between = function(e, t, n, r) {
|
|
2062
2062
|
n = n !== !1, r = r === !0;
|
|
@@ -2065,30 +2065,30 @@ function xo() {
|
|
|
2065
2065
|
return at(e, t, !n, !r);
|
|
2066
2066
|
});
|
|
2067
2067
|
} catch {
|
|
2068
|
-
return
|
|
2068
|
+
return Fe(this, Xe);
|
|
2069
2069
|
}
|
|
2070
2070
|
}, Be.prototype.equals = function(e) {
|
|
2071
|
-
return e == null ?
|
|
2071
|
+
return e == null ? Fe(this, Xe) : new this.Collection(this, function() {
|
|
2072
2072
|
return Sr(e);
|
|
2073
2073
|
});
|
|
2074
2074
|
}, Be.prototype.above = function(e) {
|
|
2075
|
-
return e == null ?
|
|
2075
|
+
return e == null ? Fe(this, Xe) : new this.Collection(this, function() {
|
|
2076
2076
|
return at(e, void 0, !0);
|
|
2077
2077
|
});
|
|
2078
2078
|
}, Be.prototype.aboveOrEqual = function(e) {
|
|
2079
|
-
return e == null ?
|
|
2079
|
+
return e == null ? Fe(this, Xe) : new this.Collection(this, function() {
|
|
2080
2080
|
return at(e, void 0, !1);
|
|
2081
2081
|
});
|
|
2082
2082
|
}, Be.prototype.below = function(e) {
|
|
2083
|
-
return e == null ?
|
|
2083
|
+
return e == null ? Fe(this, Xe) : new this.Collection(this, function() {
|
|
2084
2084
|
return at(void 0, e, !1, !0);
|
|
2085
2085
|
});
|
|
2086
2086
|
}, Be.prototype.belowOrEqual = function(e) {
|
|
2087
|
-
return e == null ?
|
|
2087
|
+
return e == null ? Fe(this, Xe) : new this.Collection(this, function() {
|
|
2088
2088
|
return at(void 0, e);
|
|
2089
2089
|
});
|
|
2090
2090
|
}, Be.prototype.startsWith = function(e) {
|
|
2091
|
-
return typeof e != "string" ?
|
|
2091
|
+
return typeof e != "string" ? Fe(this, Br) : this.between(e, e + gt, !0, !0);
|
|
2092
2092
|
}, Be.prototype.startsWithIgnoreCase = function(e) {
|
|
2093
2093
|
return e === "" ? this.startsWith(e) : dn(this, function(t, n) {
|
|
2094
2094
|
return t.indexOf(n[0]) === 0;
|
|
@@ -2098,23 +2098,23 @@ function xo() {
|
|
|
2098
2098
|
return t === n[0];
|
|
2099
2099
|
}, [e], "");
|
|
2100
2100
|
}, Be.prototype.anyOfIgnoreCase = function() {
|
|
2101
|
-
var e =
|
|
2101
|
+
var e = ke.apply(Le, arguments);
|
|
2102
2102
|
return e.length === 0 ? Ot(this) : dn(this, function(t, n) {
|
|
2103
2103
|
return n.indexOf(t) !== -1;
|
|
2104
2104
|
}, e, "");
|
|
2105
2105
|
}, Be.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
2106
|
-
var e =
|
|
2106
|
+
var e = ke.apply(Le, arguments);
|
|
2107
2107
|
return e.length === 0 ? Ot(this) : dn(this, function(t, n) {
|
|
2108
2108
|
return n.some(function(r) {
|
|
2109
2109
|
return t.indexOf(r) === 0;
|
|
2110
2110
|
});
|
|
2111
2111
|
}, e, gt);
|
|
2112
2112
|
}, Be.prototype.anyOf = function() {
|
|
2113
|
-
var e = this, t =
|
|
2113
|
+
var e = this, t = ke.apply(Le, arguments), n = this._cmp;
|
|
2114
2114
|
try {
|
|
2115
2115
|
t.sort(n);
|
|
2116
2116
|
} catch {
|
|
2117
|
-
return
|
|
2117
|
+
return Fe(this, Xe);
|
|
2118
2118
|
}
|
|
2119
2119
|
if (t.length === 0) return Ot(this);
|
|
2120
2120
|
var r = new this.Collection(this, function() {
|
|
@@ -2133,12 +2133,12 @@ function xo() {
|
|
|
2133
2133
|
}, Be.prototype.notEqual = function(e) {
|
|
2134
2134
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
2135
2135
|
}, Be.prototype.noneOf = function() {
|
|
2136
|
-
var e =
|
|
2136
|
+
var e = ke.apply(Le, arguments);
|
|
2137
2137
|
if (e.length === 0) return new this.Collection(this);
|
|
2138
2138
|
try {
|
|
2139
2139
|
e.sort(this._ascending);
|
|
2140
2140
|
} catch {
|
|
2141
|
-
return
|
|
2141
|
+
return Fe(this, Xe);
|
|
2142
2142
|
}
|
|
2143
2143
|
var t = e.reduce(function(n, r) {
|
|
2144
2144
|
return n ? n.concat([[n[n.length - 1][1], r]]) : [[-1 / 0, r]];
|
|
@@ -2149,24 +2149,24 @@ function xo() {
|
|
|
2149
2149
|
if (N.length === 0) return Ot(this);
|
|
2150
2150
|
if (!N.every(function(D) {
|
|
2151
2151
|
return D[0] !== void 0 && D[1] !== void 0 && a(D[0], D[1]) <= 0;
|
|
2152
|
-
})) return
|
|
2152
|
+
})) return Fe(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", O.InvalidArgument);
|
|
2153
2153
|
var v = !t || t.includeLowers !== !1, C = t && t.includeUppers === !0, w, g = a;
|
|
2154
2154
|
function T(D, S) {
|
|
2155
2155
|
return g(D[0], S[0]);
|
|
2156
2156
|
}
|
|
2157
2157
|
try {
|
|
2158
2158
|
(w = N.reduce(function(D, S) {
|
|
2159
|
-
for (var
|
|
2160
|
-
var U = D[
|
|
2159
|
+
for (var k = 0, j = D.length; k < j; ++k) {
|
|
2160
|
+
var U = D[k];
|
|
2161
2161
|
if (r(S[0], U[1]) < 0 && 0 < r(S[1], U[0])) {
|
|
2162
2162
|
U[0] = d(U[0], S[0]), U[1] = p(U[1], S[1]);
|
|
2163
2163
|
break;
|
|
2164
2164
|
}
|
|
2165
2165
|
}
|
|
2166
|
-
return
|
|
2166
|
+
return k === j && D.push(S), D;
|
|
2167
2167
|
}, [])).sort(T);
|
|
2168
2168
|
} catch {
|
|
2169
|
-
return
|
|
2169
|
+
return Fe(this, Xe);
|
|
2170
2170
|
}
|
|
2171
2171
|
var _ = 0, A = C ? function(D) {
|
|
2172
2172
|
return 0 < a(D, w[_][1]);
|
|
@@ -2181,19 +2181,19 @@ function xo() {
|
|
|
2181
2181
|
});
|
|
2182
2182
|
return N._ondirectionchange = function(D) {
|
|
2183
2183
|
g = D === "next" ? (E = A, a) : (E = x, i), w.sort(T);
|
|
2184
|
-
}, N._addAlgorithm(function(D, S,
|
|
2185
|
-
for (var j, U = D.key; E(U); ) if (++_ === w.length) return S(
|
|
2184
|
+
}, N._addAlgorithm(function(D, S, k) {
|
|
2185
|
+
for (var j, U = D.key; E(U); ) if (++_ === w.length) return S(k), !1;
|
|
2186
2186
|
return !A(j = U) && !x(j) || (n._cmp(U, w[_][1]) === 0 || n._cmp(U, w[_][0]) === 0 || S(function() {
|
|
2187
2187
|
g === a ? D.continue(w[_][0]) : D.continue(w[_][1]);
|
|
2188
2188
|
}), !1);
|
|
2189
2189
|
}), N;
|
|
2190
2190
|
}, Be.prototype.startsWithAnyOf = function() {
|
|
2191
|
-
var e =
|
|
2191
|
+
var e = ke.apply(Le, arguments);
|
|
2192
2192
|
return e.every(function(t) {
|
|
2193
2193
|
return typeof t == "string";
|
|
2194
2194
|
}) ? e.length === 0 ? Ot(this) : this.inAnyRange(e.map(function(t) {
|
|
2195
2195
|
return [t, t + gt];
|
|
2196
|
-
})) :
|
|
2196
|
+
})) : Fe(this, "startsWithAnyOf() only works with strings");
|
|
2197
2197
|
}, Be);
|
|
2198
2198
|
function Be() {
|
|
2199
2199
|
}
|
|
@@ -2286,7 +2286,7 @@ function xo() {
|
|
|
2286
2286
|
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new O.Abort()));
|
|
2287
2287
|
}, $e.prototype.table = function(e) {
|
|
2288
2288
|
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
2289
|
-
if (
|
|
2289
|
+
if (V(t, e)) return t[e];
|
|
2290
2290
|
var n = this.schema[e];
|
|
2291
2291
|
if (!n) throw new O.NotFound("Table " + e + " not part of transaction");
|
|
2292
2292
|
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
|
|
@@ -2294,9 +2294,9 @@ function xo() {
|
|
|
2294
2294
|
function $e() {
|
|
2295
2295
|
}
|
|
2296
2296
|
function Gn(e, t, n, r, a, i, d, p) {
|
|
2297
|
-
return { name: e, keyPath: t, unique: n, multi: r, auto: a, compound: i, src: (n && !d ? "&" : "") + (r ? "*" : "") + (a ? "++" : "") +
|
|
2297
|
+
return { name: e, keyPath: t, unique: n, multi: r, auto: a, compound: i, src: (n && !d ? "&" : "") + (r ? "*" : "") + (a ? "++" : "") + Fr(t), type: p };
|
|
2298
2298
|
}
|
|
2299
|
-
function
|
|
2299
|
+
function Fr(e) {
|
|
2300
2300
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
2301
2301
|
}
|
|
2302
2302
|
function Xn(e, t, n) {
|
|
@@ -2346,25 +2346,25 @@ function xo() {
|
|
|
2346
2346
|
function a(T) {
|
|
2347
2347
|
var _, A = T.name;
|
|
2348
2348
|
return { name: A, schema: T, mutate: function(x) {
|
|
2349
|
-
var E = x.trans, N = x.type, D = x.keys, S = x.values,
|
|
2349
|
+
var E = x.trans, N = x.type, D = x.keys, S = x.values, k = x.range;
|
|
2350
2350
|
return new Promise(function(j, U) {
|
|
2351
2351
|
j = ge(j);
|
|
2352
|
-
var K = E.objectStore(A), L = K.keyPath == null,
|
|
2353
|
-
if (!
|
|
2352
|
+
var K = E.objectStore(A), L = K.keyPath == null, G = N === "put" || N === "add";
|
|
2353
|
+
if (!G && N !== "delete" && N !== "deleteRange") throw new Error("Invalid operation type: " + N);
|
|
2354
2354
|
var $, W = (D || S || { length: 1 }).length;
|
|
2355
2355
|
if (D && S && D.length !== S.length) throw new Error("Given keys array must have same length as given values array.");
|
|
2356
2356
|
if (W === 0) return j({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
2357
|
-
function
|
|
2357
|
+
function ae(Ie) {
|
|
2358
2358
|
++_e, $t(Ie);
|
|
2359
2359
|
}
|
|
2360
2360
|
var ce = [], ne = [], _e = 0;
|
|
2361
2361
|
if (N === "deleteRange") {
|
|
2362
|
-
if (
|
|
2363
|
-
|
|
2362
|
+
if (k.type === 4) return j({ numFailures: _e, failures: ne, results: [], lastResult: void 0 });
|
|
2363
|
+
k.type === 3 ? ce.push($ = K.clear()) : ce.push($ = K.delete(r(k)));
|
|
2364
2364
|
} else {
|
|
2365
|
-
var L =
|
|
2366
|
-
if (
|
|
2367
|
-
else for (Oe = 0; Oe < W; ++Oe) ce.push($ = K[N](
|
|
2365
|
+
var L = G ? L ? [S, D] : [S, null] : [D, null], te = L[0], Ne = L[1];
|
|
2366
|
+
if (G) for (var Oe = 0; Oe < W; ++Oe) ce.push($ = Ne && Ne[Oe] !== void 0 ? K[N](te[Oe], Ne[Oe]) : K[N](te[Oe])), $.onerror = ae;
|
|
2367
|
+
else for (Oe = 0; Oe < W; ++Oe) ce.push($ = K[N](te[Oe])), $.onerror = ae;
|
|
2368
2368
|
}
|
|
2369
2369
|
function Bn(Ie) {
|
|
2370
2370
|
Ie = Ie.target.result, ce.forEach(function(bt, fr) {
|
|
@@ -2374,85 +2374,85 @@ function xo() {
|
|
|
2374
2374
|
}), lastResult: Ie });
|
|
2375
2375
|
}
|
|
2376
2376
|
$.onerror = function(Ie) {
|
|
2377
|
-
|
|
2377
|
+
ae(Ie), Bn(Ie);
|
|
2378
2378
|
}, $.onsuccess = Bn;
|
|
2379
2379
|
});
|
|
2380
2380
|
}, getMany: function(x) {
|
|
2381
2381
|
var E = x.trans, N = x.keys;
|
|
2382
2382
|
return new Promise(function(D, S) {
|
|
2383
2383
|
D = ge(D);
|
|
2384
|
-
for (var
|
|
2385
|
-
ce = ce.target, K[ce._pos] = ce.result, ++
|
|
2386
|
-
}, W = Ue(S),
|
|
2384
|
+
for (var k, j = E.objectStore(A), U = N.length, K = new Array(U), L = 0, G = 0, $ = function(ce) {
|
|
2385
|
+
ce = ce.target, K[ce._pos] = ce.result, ++G === L && D(K);
|
|
2386
|
+
}, W = Ue(S), ae = 0; ae < U; ++ae) N[ae] != null && ((k = j.get(N[ae]))._pos = ae, k.onsuccess = $, k.onerror = W, ++L);
|
|
2387
2387
|
L === 0 && D(K);
|
|
2388
2388
|
});
|
|
2389
2389
|
}, get: function(x) {
|
|
2390
2390
|
var E = x.trans, N = x.key;
|
|
2391
2391
|
return new Promise(function(D, S) {
|
|
2392
2392
|
D = ge(D);
|
|
2393
|
-
var
|
|
2394
|
-
|
|
2393
|
+
var k = E.objectStore(A).get(N);
|
|
2394
|
+
k.onsuccess = function(j) {
|
|
2395
2395
|
return D(j.target.result);
|
|
2396
|
-
},
|
|
2396
|
+
}, k.onerror = Ue(S);
|
|
2397
2397
|
});
|
|
2398
2398
|
}, query: (_ = C, function(x) {
|
|
2399
2399
|
return new Promise(function(E, N) {
|
|
2400
2400
|
E = ge(E);
|
|
2401
|
-
var D, S,
|
|
2401
|
+
var D, S, k, L = x.trans, j = x.values, U = x.limit, $ = x.query, K = U === 1 / 0 ? void 0 : U, G = $.index, $ = $.range, L = L.objectStore(A), G = G.isPrimaryKey ? L : L.index(G.name), $ = r($);
|
|
2402
2402
|
if (U === 0) return E({ result: [] });
|
|
2403
|
-
_ ? ((K = j ?
|
|
2403
|
+
_ ? ((K = j ? G.getAll($, K) : G.getAllKeys($, K)).onsuccess = function(W) {
|
|
2404
2404
|
return E({ result: W.target.result });
|
|
2405
|
-
}, K.onerror = Ue(N)) : (D = 0, S = !j && "openKeyCursor" in
|
|
2406
|
-
var
|
|
2407
|
-
return
|
|
2405
|
+
}, K.onerror = Ue(N)) : (D = 0, S = !j && "openKeyCursor" in G ? G.openKeyCursor($) : G.openCursor($), k = [], S.onsuccess = function(W) {
|
|
2406
|
+
var ae = S.result;
|
|
2407
|
+
return ae ? (k.push(j ? ae.value : ae.primaryKey), ++D === U ? E({ result: k }) : void ae.continue()) : E({ result: k });
|
|
2408
2408
|
}, S.onerror = Ue(N));
|
|
2409
2409
|
});
|
|
2410
2410
|
}), openCursor: function(x) {
|
|
2411
|
-
var E = x.trans, N = x.values, D = x.query, S = x.reverse,
|
|
2411
|
+
var E = x.trans, N = x.values, D = x.query, S = x.reverse, k = x.unique;
|
|
2412
2412
|
return new Promise(function(j, U) {
|
|
2413
2413
|
j = ge(j);
|
|
2414
|
-
var
|
|
2414
|
+
var G = D.index, K = D.range, L = E.objectStore(A), L = G.isPrimaryKey ? L : L.index(G.name), G = S ? k ? "prevunique" : "prev" : k ? "nextunique" : "next", $ = !N && "openKeyCursor" in L ? L.openKeyCursor(r(K), G) : L.openCursor(r(K), G);
|
|
2415
2415
|
$.onerror = Ue(U), $.onsuccess = ge(function(W) {
|
|
2416
|
-
var
|
|
2417
|
-
|
|
2416
|
+
var ae, ce, ne, _e, te = $.result;
|
|
2417
|
+
te ? (te.___id = ++ja, te.done = !1, ae = te.continue.bind(te), ce = (ce = te.continuePrimaryKey) && ce.bind(te), ne = te.advance.bind(te), _e = function() {
|
|
2418
2418
|
throw new Error("Cursor not stopped");
|
|
2419
|
-
},
|
|
2419
|
+
}, te.trans = E, te.stop = te.continue = te.continuePrimaryKey = te.advance = function() {
|
|
2420
2420
|
throw new Error("Cursor not started");
|
|
2421
|
-
},
|
|
2421
|
+
}, te.fail = ge(U), te.next = function() {
|
|
2422
2422
|
var Ne = this, Oe = 1;
|
|
2423
2423
|
return this.start(function() {
|
|
2424
2424
|
return Oe-- ? Ne.continue() : Ne.stop();
|
|
2425
2425
|
}).then(function() {
|
|
2426
2426
|
return Ne;
|
|
2427
2427
|
});
|
|
2428
|
-
},
|
|
2428
|
+
}, te.start = function(Ne) {
|
|
2429
2429
|
function Oe() {
|
|
2430
2430
|
if ($.result) try {
|
|
2431
2431
|
Ne();
|
|
2432
2432
|
} catch (Ie) {
|
|
2433
|
-
|
|
2433
|
+
te.fail(Ie);
|
|
2434
2434
|
}
|
|
2435
|
-
else
|
|
2435
|
+
else te.done = !0, te.start = function() {
|
|
2436
2436
|
throw new Error("Cursor behind last entry");
|
|
2437
|
-
},
|
|
2437
|
+
}, te.stop();
|
|
2438
2438
|
}
|
|
2439
2439
|
var Bn = new Promise(function(Ie, bt) {
|
|
2440
|
-
Ie = ge(Ie), $.onerror = Ue(bt),
|
|
2441
|
-
|
|
2440
|
+
Ie = ge(Ie), $.onerror = Ue(bt), te.fail = bt, te.stop = function(fr) {
|
|
2441
|
+
te.stop = te.continue = te.continuePrimaryKey = te.advance = _e, Ie(fr);
|
|
2442
2442
|
};
|
|
2443
2443
|
});
|
|
2444
2444
|
return $.onsuccess = ge(function(Ie) {
|
|
2445
2445
|
$.onsuccess = Oe, Oe();
|
|
2446
|
-
}),
|
|
2447
|
-
}, j(
|
|
2446
|
+
}), te.continue = ae, te.continuePrimaryKey = ce, te.advance = ne, Oe(), Bn;
|
|
2447
|
+
}, j(te)) : j(null);
|
|
2448
2448
|
}, U);
|
|
2449
2449
|
});
|
|
2450
2450
|
}, count: function(x) {
|
|
2451
2451
|
var E = x.query, N = x.trans, D = E.index, S = E.range;
|
|
2452
|
-
return new Promise(function(
|
|
2452
|
+
return new Promise(function(k, j) {
|
|
2453
2453
|
var U = N.objectStore(A), K = D.isPrimaryKey ? U : U.index(D.name), U = r(S), K = U ? K.count(U) : K.count();
|
|
2454
2454
|
K.onsuccess = ge(function(L) {
|
|
2455
|
-
return
|
|
2455
|
+
return k(L.target.result);
|
|
2456
2456
|
}), K.onerror = Ue(j);
|
|
2457
2457
|
});
|
|
2458
2458
|
} };
|
|
@@ -2462,9 +2462,9 @@ function xo() {
|
|
|
2462
2462
|
}).map(function(T) {
|
|
2463
2463
|
var _ = T.keyPath, E = T.autoIncrement, A = b(_), x = {}, E = { name: T.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: _ == null, compound: A, keyPath: _, autoIncrement: E, unique: !0, extractKey: Wn(_) }, indexes: Mr(T.indexNames).map(function(N) {
|
|
2464
2464
|
return T.index(N);
|
|
2465
|
-
}).map(function(
|
|
2466
|
-
var D =
|
|
2467
|
-
return x[Xt(
|
|
2465
|
+
}).map(function(k) {
|
|
2466
|
+
var D = k.name, S = k.unique, j = k.multiEntry, k = k.keyPath, j = { name: D, compound: b(k), keyPath: k, unique: S, multiEntry: j, extractKey: Wn(k) };
|
|
2467
|
+
return x[Xt(k)] = j;
|
|
2468
2468
|
}), getIndexByKeyPath: function(N) {
|
|
2469
2469
|
return x[Xt(N)];
|
|
2470
2470
|
} };
|
|
@@ -2531,17 +2531,17 @@ function xo() {
|
|
|
2531
2531
|
x.push(function() {
|
|
2532
2532
|
var D = E, S = N._cfg.dbschema;
|
|
2533
2533
|
yn(g, D, A), yn(g, S, A), E = g._dbSchema = S;
|
|
2534
|
-
var
|
|
2535
|
-
|
|
2536
|
-
Qn(A,
|
|
2537
|
-
}),
|
|
2538
|
-
if (
|
|
2539
|
-
var $ = A.objectStore(
|
|
2540
|
-
|
|
2534
|
+
var k = zn(D, S);
|
|
2535
|
+
k.add.forEach(function(G) {
|
|
2536
|
+
Qn(A, G[0], G[1].primKey, G[1].indexes);
|
|
2537
|
+
}), k.change.forEach(function(G) {
|
|
2538
|
+
if (G.recreate) throw new O.Upgrade("Not yet support for changing primary key");
|
|
2539
|
+
var $ = A.objectStore(G.name);
|
|
2540
|
+
G.add.forEach(function(W) {
|
|
2541
2541
|
return pn($, W);
|
|
2542
|
-
}),
|
|
2542
|
+
}), G.change.forEach(function(W) {
|
|
2543
2543
|
$.deleteIndex(W.name), pn($, W);
|
|
2544
|
-
}),
|
|
2544
|
+
}), G.del.forEach(function(W) {
|
|
2545
2545
|
return $.deleteIndex(W);
|
|
2546
2546
|
});
|
|
2547
2547
|
});
|
|
@@ -2549,21 +2549,21 @@ function xo() {
|
|
|
2549
2549
|
if (j && N._cfg.version > T) {
|
|
2550
2550
|
hn(g, A), _._memoizedTables = {};
|
|
2551
2551
|
var U = Re(S);
|
|
2552
|
-
|
|
2553
|
-
U[
|
|
2552
|
+
k.del.forEach(function(G) {
|
|
2553
|
+
U[G] = D[G];
|
|
2554
2554
|
}), Yn(g, [g.Transaction.prototype]), mn(g, [g.Transaction.prototype], y(U), U), _.schema = U;
|
|
2555
2555
|
var K, L = je(j);
|
|
2556
|
-
return L && xt(),
|
|
2557
|
-
var
|
|
2558
|
-
(K = j(_)) && L && (
|
|
2559
|
-
}), K && typeof K.then == "function" ? X.resolve(K) :
|
|
2556
|
+
return L && xt(), k = X.follow(function() {
|
|
2557
|
+
var G;
|
|
2558
|
+
(K = j(_)) && L && (G = nt.bind(null, null), K.then(G, G));
|
|
2559
|
+
}), K && typeof K.then == "function" ? X.resolve(K) : k.then(function() {
|
|
2560
2560
|
return K;
|
|
2561
2561
|
});
|
|
2562
2562
|
}
|
|
2563
2563
|
}), x.push(function(D) {
|
|
2564
|
-
var S,
|
|
2565
|
-
S = j,
|
|
2566
|
-
return S[U] == null &&
|
|
2564
|
+
var S, k, j = N._cfg.dbschema;
|
|
2565
|
+
S = j, k = D, [].slice.call(k.db.objectStoreNames).forEach(function(U) {
|
|
2566
|
+
return S[U] == null && k.db.deleteObjectStore(U);
|
|
2567
2567
|
}), Yn(g, [g.Transaction.prototype]), mn(g, [g.Transaction.prototype], g._storeNames, g._dbSchema), _.schema = g._dbSchema;
|
|
2568
2568
|
}), x.push(function(D) {
|
|
2569
2569
|
g.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(g.idbdb.version / 10) === N._cfg.version ? (g.idbdb.deleteObjectStore("$meta"), delete g._dbSchema.$meta, g._storeNames = g._storeNames.filter(function(S) {
|
|
@@ -2637,7 +2637,7 @@ function xo() {
|
|
|
2637
2637
|
function gn(e, t, n) {
|
|
2638
2638
|
var r = {};
|
|
2639
2639
|
return ye(t.objectStoreNames, 0).forEach(function(a) {
|
|
2640
|
-
for (var i = n.objectStore(a), d = Gn(
|
|
2640
|
+
for (var i = n.objectStore(a), d = Gn(Fr(C = i.keyPath), C || "", !0, !1, !!i.autoIncrement, C && typeof C != "string", !0), p = [], v = 0; v < i.indexNames.length; ++v) {
|
|
2641
2641
|
var w = i.index(i.indexNames[v]), C = w.keyPath, w = Gn(w.name, C, !!w.unique, !!w.multiEntry, !1, C && typeof C != "string", !1);
|
|
2642
2642
|
p.push(w);
|
|
2643
2643
|
}
|
|
@@ -2766,7 +2766,7 @@ function xo() {
|
|
|
2766
2766
|
return y(t).forEach(function(n) {
|
|
2767
2767
|
e[n] ? Yt(e[n], t[n]) : e[n] = (function r(a) {
|
|
2768
2768
|
var i, d, p = {};
|
|
2769
|
-
for (i in a)
|
|
2769
|
+
for (i in a) V(a, i) && (d = a[i], p[i] = !d || typeof d != "object" || ze.has(d.constructor) ? d : r(d));
|
|
2770
2770
|
return p;
|
|
2771
2771
|
})(t[n]);
|
|
2772
2772
|
}), e;
|
|
@@ -2846,11 +2846,11 @@ function xo() {
|
|
|
2846
2846
|
})) : (w.onerror = Ue(_), E = E.oldVersion > Math.pow(2, 62) ? 0 : E.oldVersion, g = E < 1, e.idbdb = x.result, i && $a(e, w), Ua(e, E / 10, w, _));
|
|
2847
2847
|
}, _), x.onsuccess = ge(function() {
|
|
2848
2848
|
w = null;
|
|
2849
|
-
var E, N, D, S,
|
|
2849
|
+
var E, N, D, S, k, j = e.idbdb = x.result, U = ye(j.objectStoreNames);
|
|
2850
2850
|
if (0 < U.length) try {
|
|
2851
2851
|
var K = j.transaction((S = U).length === 1 ? S[0] : S, "readonly");
|
|
2852
2852
|
if (t.autoSchema) N = j, D = K, (E = e).verno = N.version / 10, D = E._dbSchema = gn(0, N, D), E._storeNames = ye(N.objectStoreNames, 0), mn(E, [E._allTables], y(D), D);
|
|
2853
|
-
else if (yn(e, e._dbSchema, K), ((
|
|
2853
|
+
else if (yn(e, e._dbSchema, K), ((k = zn(gn(0, (k = e).idbdb, K), k._dbSchema)).add.length || k.change.some(function(L) {
|
|
2854
2854
|
return L.add.length || L.change.length;
|
|
2855
2855
|
})) && !i) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), j.close(), a = j.version + 1, i = !0, T(p());
|
|
2856
2856
|
hn(e, K);
|
|
@@ -2860,7 +2860,7 @@ function xo() {
|
|
|
2860
2860
|
t.vcFired = !0, e.on("versionchange").fire(L);
|
|
2861
2861
|
}), j.onclose = ge(function(L) {
|
|
2862
2862
|
e.on("close").fire(L);
|
|
2863
|
-
}), g && (
|
|
2863
|
+
}), g && (k = e._deps, K = A, j = k.indexedDB, k = k.IDBKeyRange, Zn(j) || K === sn || Hn(j, k).put({ name: K }).catch(Z)), T();
|
|
2864
2864
|
}, _);
|
|
2865
2865
|
}).catch(function(T) {
|
|
2866
2866
|
switch (T?.name) {
|
|
@@ -2980,9 +2980,9 @@ function xo() {
|
|
|
2980
2980
|
function ir(e, t, n, r) {
|
|
2981
2981
|
return n = n || {}, r = r || "", y(e).forEach(function(a) {
|
|
2982
2982
|
var i, d, p;
|
|
2983
|
-
|
|
2983
|
+
V(t, a) ? (i = e[a], d = t[a], typeof i == "object" && typeof d == "object" && i && d ? (p = Ve(i)) !== Ve(d) ? n[r + a] = t[a] : p === "Object" ? ir(i, d, n, r + a + ".") : i !== d && (n[r + a] = t[a]) : i !== d && (n[r + a] = t[a])) : n[r + a] = void 0;
|
|
2984
2984
|
}), y(t).forEach(function(a) {
|
|
2985
|
-
|
|
2985
|
+
V(e, a) || (n[r + a] = t[a]);
|
|
2986
2986
|
}), n;
|
|
2987
2987
|
}
|
|
2988
2988
|
function sr(e, t) {
|
|
@@ -3027,21 +3027,21 @@ function xo() {
|
|
|
3027
3027
|
var T, _, A, x = Q.trans, E = g.keys || sr(r, g);
|
|
3028
3028
|
if (!E) throw new Error("Keys missing");
|
|
3029
3029
|
return (g = g.type === "add" || g.type === "put" ? o(o({}, g), { keys: E }) : o({}, g)).type !== "delete" && (g.values = h([], g.values)), g.keys && (g.keys = h([], g.keys)), T = n, A = E, ((_ = g).type === "add" ? Promise.resolve([]) : T.getMany({ trans: _.trans, keys: A, cache: "immutable" })).then(function(N) {
|
|
3030
|
-
var D = E.map(function(S,
|
|
3031
|
-
var j, U, K, L = N[
|
|
3032
|
-
return g.type === "delete" ? p.fire.call(
|
|
3033
|
-
|
|
3034
|
-
}))),
|
|
3030
|
+
var D = E.map(function(S, k) {
|
|
3031
|
+
var j, U, K, L = N[k], G = { onerror: null, onsuccess: null };
|
|
3032
|
+
return g.type === "delete" ? p.fire.call(G, S, L, x) : g.type === "add" || L === void 0 ? (j = v.fire.call(G, S, g.values[k], x), S == null && j != null && (g.keys[k] = S = j, r.outbound || oe(g.values[k], r.keyPath, S))) : (j = ir(L, g.values[k]), (U = C.fire.call(G, j, S, L, x)) && (K = g.values[k], Object.keys(U).forEach(function($) {
|
|
3033
|
+
V(K, $) ? K[$] = U[$] : oe(K, $, U[$]);
|
|
3034
|
+
}))), G;
|
|
3035
3035
|
});
|
|
3036
3036
|
return n.mutate(g).then(function(S) {
|
|
3037
|
-
for (var
|
|
3038
|
-
var L = (j || E)[K],
|
|
3039
|
-
L == null ?
|
|
3037
|
+
for (var k = S.failures, j = S.results, U = S.numFailures, S = S.lastResult, K = 0; K < E.length; ++K) {
|
|
3038
|
+
var L = (j || E)[K], G = D[K];
|
|
3039
|
+
L == null ? G.onerror && G.onerror(k[K]) : G.onsuccess && G.onsuccess(g.type === "put" && N[K] ? g.values[K] : L);
|
|
3040
3040
|
}
|
|
3041
|
-
return { failures:
|
|
3041
|
+
return { failures: k, results: j, numFailures: U, lastResult: S };
|
|
3042
3042
|
}).catch(function(S) {
|
|
3043
|
-
return D.forEach(function(
|
|
3044
|
-
return
|
|
3043
|
+
return D.forEach(function(k) {
|
|
3044
|
+
return k.onerror && k.onerror(S);
|
|
3045
3045
|
}), Promise.reject(S);
|
|
3046
3046
|
});
|
|
3047
3047
|
});
|
|
@@ -3098,12 +3098,12 @@ function xo() {
|
|
|
3098
3098
|
function A($) {
|
|
3099
3099
|
return $ = "idb://".concat(t, "/").concat(r, "/").concat($), S[$] || (S[$] = new Te());
|
|
3100
3100
|
}
|
|
3101
|
-
var x, E, N, D = _.trans, S = _.mutatedParts || (_.mutatedParts = {}),
|
|
3101
|
+
var x, E, N, D = _.trans, S = _.mutatedParts || (_.mutatedParts = {}), k = A(""), j = A(":dels"), U = _.type, G = _.type === "deleteRange" ? [_.range] : _.type === "delete" ? [_.keys] : _.values.length < 50 ? [sr(d, _).filter(function($) {
|
|
3102
3102
|
return $;
|
|
3103
|
-
}), _.values] : [], K =
|
|
3104
|
-
return b(K) ? (
|
|
3103
|
+
}), _.values] : [], K = G[0], L = G[1], G = _.trans._cache;
|
|
3104
|
+
return b(K) ? (k.addKeys(K), (G = U === "delete" || K.length === L.length ? Vr(K, G) : null) || j.addKeys(K), (G || L) && (x = A, E = G, N = L, i.indexes.forEach(function($) {
|
|
3105
3105
|
var W = x($.name || "");
|
|
3106
|
-
function
|
|
3106
|
+
function ae(ne) {
|
|
3107
3107
|
return ne != null ? $.extractKey(ne) : null;
|
|
3108
3108
|
}
|
|
3109
3109
|
function ce(ne) {
|
|
@@ -3112,19 +3112,19 @@ function xo() {
|
|
|
3112
3112
|
}) : W.addKey(ne);
|
|
3113
3113
|
}
|
|
3114
3114
|
(E || N).forEach(function(ne, Ne) {
|
|
3115
|
-
var
|
|
3116
|
-
se(
|
|
3115
|
+
var te = E && ae(E[Ne]), Ne = N && ae(N[Ne]);
|
|
3116
|
+
se(te, Ne) !== 0 && (te != null && ce(te), Ne != null && ce(Ne));
|
|
3117
3117
|
});
|
|
3118
|
-
}))) : K ? (L = { from: (L = K.lower) !== null && L !== void 0 ? L : e.MIN_KEY, to: (L = K.upper) !== null && L !== void 0 ? L : e.MAX_KEY }, j.add(L),
|
|
3118
|
+
}))) : K ? (L = { from: (L = K.lower) !== null && L !== void 0 ? L : e.MIN_KEY, to: (L = K.upper) !== null && L !== void 0 ? L : e.MAX_KEY }, j.add(L), k.add(L)) : (k.add(n), j.add(n), i.indexes.forEach(function($) {
|
|
3119
3119
|
return A($.name).add(n);
|
|
3120
3120
|
})), a.mutate(_).then(function($) {
|
|
3121
|
-
return !K || _.type !== "add" && _.type !== "put" || (
|
|
3122
|
-
for (var
|
|
3123
|
-
return W.extractKey(
|
|
3124
|
-
}), ce = W.keyPath.findIndex(function(
|
|
3125
|
-
return
|
|
3126
|
-
}), ne = 0, _e = $.results.length; ne < _e; ++ne)
|
|
3127
|
-
A(W.name).addKeys(
|
|
3121
|
+
return !K || _.type !== "add" && _.type !== "put" || (k.addKeys($.results), C && C.forEach(function(W) {
|
|
3122
|
+
for (var ae = _.values.map(function(te) {
|
|
3123
|
+
return W.extractKey(te);
|
|
3124
|
+
}), ce = W.keyPath.findIndex(function(te) {
|
|
3125
|
+
return te === d.keyPath;
|
|
3126
|
+
}), ne = 0, _e = $.results.length; ne < _e; ++ne) ae[ne][ce] = $.results[ne];
|
|
3127
|
+
A(W.name).addKeys(ae);
|
|
3128
3128
|
})), D.mutatedParts = _n(D.mutatedParts || {}, S), $;
|
|
3129
3129
|
});
|
|
3130
3130
|
} }), g = function(A) {
|
|
@@ -3141,24 +3141,24 @@ function xo() {
|
|
|
3141
3141
|
if (E) {
|
|
3142
3142
|
var D = function(L) {
|
|
3143
3143
|
return L = "idb://".concat(t, "/").concat(r, "/").concat(L), N[L] || (N[L] = new Te());
|
|
3144
|
-
}, S = D(""),
|
|
3145
|
-
if ((_ === "query" && E.isPrimaryKey && !A.values ?
|
|
3144
|
+
}, S = D(""), k = D(":dels"), x = T[_](A), E = x[0], x = x[1];
|
|
3145
|
+
if ((_ === "query" && E.isPrimaryKey && !A.values ? k : D(E.name || "")).add(x), !E.isPrimaryKey) {
|
|
3146
3146
|
if (_ !== "count") {
|
|
3147
3147
|
var j = _ === "query" && v && A.values && a.query(o(o({}, A), { values: !1 }));
|
|
3148
3148
|
return a[_].apply(this, arguments).then(function(L) {
|
|
3149
3149
|
if (_ === "query") {
|
|
3150
|
-
if (v && A.values) return j.then(function(
|
|
3151
|
-
return
|
|
3150
|
+
if (v && A.values) return j.then(function(ae) {
|
|
3151
|
+
return ae = ae.result, S.addKeys(ae), L;
|
|
3152
3152
|
});
|
|
3153
|
-
var
|
|
3154
|
-
(A.values ? S :
|
|
3153
|
+
var G = A.values ? L.result.map(p) : L.result;
|
|
3154
|
+
(A.values ? S : k).addKeys(G);
|
|
3155
3155
|
} else if (_ === "openCursor") {
|
|
3156
3156
|
var $ = L, W = A.values;
|
|
3157
3157
|
return $ && Object.create($, { key: { get: function() {
|
|
3158
|
-
return
|
|
3158
|
+
return k.addKey($.primaryKey), $.key;
|
|
3159
3159
|
} }, primaryKey: { get: function() {
|
|
3160
|
-
var
|
|
3161
|
-
return
|
|
3160
|
+
var ae = $.primaryKey;
|
|
3161
|
+
return k.addKey(ae), ae;
|
|
3162
3162
|
} }, value: { get: function() {
|
|
3163
3163
|
return W && S.addKey($.primaryKey), $.value;
|
|
3164
3164
|
} } });
|
|
@@ -3166,7 +3166,7 @@ function xo() {
|
|
|
3166
3166
|
return L;
|
|
3167
3167
|
});
|
|
3168
3168
|
}
|
|
3169
|
-
|
|
3169
|
+
k.add(n);
|
|
3170
3170
|
}
|
|
3171
3171
|
}
|
|
3172
3172
|
return a[_].apply(this, arguments);
|
|
@@ -3193,10 +3193,10 @@ function xo() {
|
|
|
3193
3193
|
var d = t.query.index, p = d.multiEntry, v = t.query.range, C = r.schema.primaryKey.extractKey, w = d.extractKey, g = (d.lowLevelIndex || d).extractKey, T = T.reduce(function(_, A) {
|
|
3194
3194
|
var x = _, E = [];
|
|
3195
3195
|
if (A.type === "add" || A.type === "put") for (var N = new Te(), D = A.values.length - 1; 0 <= D; --D) {
|
|
3196
|
-
var S,
|
|
3197
|
-
N.hasKey(j) || (S = w(
|
|
3196
|
+
var S, k = A.values[D], j = C(k);
|
|
3197
|
+
N.hasKey(j) || (S = w(k), (p && b(S) ? S.some(function($) {
|
|
3198
3198
|
return ur($, v);
|
|
3199
|
-
}) : ur(S, v)) && (N.addKey(j), E.push(
|
|
3199
|
+
}) : ur(S, v)) && (N.addKey(j), E.push(k)));
|
|
3200
3200
|
}
|
|
3201
3201
|
switch (A.type) {
|
|
3202
3202
|
case "add":
|
|
@@ -3227,9 +3227,9 @@ function xo() {
|
|
|
3227
3227
|
});
|
|
3228
3228
|
break;
|
|
3229
3229
|
case "deleteRange":
|
|
3230
|
-
var
|
|
3230
|
+
var G = A.range;
|
|
3231
3231
|
x = _.filter(function(W) {
|
|
3232
|
-
return !ur(C(W),
|
|
3232
|
+
return !ur(C(W), G);
|
|
3233
3233
|
});
|
|
3234
3234
|
}
|
|
3235
3235
|
return x;
|
|
@@ -3290,7 +3290,7 @@ function xo() {
|
|
|
3290
3290
|
_.optimisticOps = _.optimisticOps.filter(function(W) {
|
|
3291
3291
|
return W.trans !== p;
|
|
3292
3292
|
});
|
|
3293
|
-
for (var
|
|
3293
|
+
for (var k = 0, j = Object.values(_.queries.query); k < j.length; k++) for (var U, K, L, G = 0, $ = (U = j[k]).slice(); G < $.length; G++) (K = $[G]).res != null && p.mutatedParts && (v && !K.dirty ? (L = Object.isFrozen(K.res), L = Yr(K.res, K.req, x, A, K, L), K.dirty ? (Ge(U, K), K.subscribers.forEach(function(W) {
|
|
3294
3294
|
return C.add(W);
|
|
3295
3295
|
})) : L !== K.res && (K.res = L, K.promise = X.resolve({ result: L }))) : (K.dirty && Ge(U, K), K.subscribers.forEach(function(W) {
|
|
3296
3296
|
return C.add(W);
|
|
@@ -3319,7 +3319,7 @@ function xo() {
|
|
|
3319
3319
|
})) : d.then(function(v) {
|
|
3320
3320
|
var C = Wr(0, o(o({}, i), { values: i.values.map(function(w, g) {
|
|
3321
3321
|
var T;
|
|
3322
|
-
return v.failures[g] ? w : (w = (T = a.keyPath) !== null && T !== void 0 && T.includes(".") ? Se(w) : o({}, w),
|
|
3322
|
+
return v.failures[g] ? w : (w = (T = a.keyPath) !== null && T !== void 0 && T.includes(".") ? Se(w) : o({}, w), oe(w, a.keyPath, v.results[g]), w);
|
|
3323
3323
|
}) }), v);
|
|
3324
3324
|
p.optimisticOps.push(C), queueMicrotask(function() {
|
|
3325
3325
|
return i.mutatedParts && bn(i.mutatedParts);
|
|
@@ -3335,16 +3335,16 @@ function xo() {
|
|
|
3335
3335
|
if (!S) return [null, !1, D, null];
|
|
3336
3336
|
switch (E) {
|
|
3337
3337
|
case "query":
|
|
3338
|
-
var
|
|
3338
|
+
var k = S.find(function(j) {
|
|
3339
3339
|
return j.req.limit === N.limit && j.req.values === N.values && zr(j.req.query.range, N.query.range);
|
|
3340
3340
|
});
|
|
3341
|
-
return
|
|
3341
|
+
return k ? [k, !0, D, S] : [S.find(function(j) {
|
|
3342
3342
|
return ("limit" in j.req ? j.req.limit : 1 / 0) >= N.limit && (!N.values || j.req.values) && Qa(j.req.query.range, N.query.range);
|
|
3343
3343
|
}), !1, D, S];
|
|
3344
3344
|
case "count":
|
|
3345
|
-
return
|
|
3345
|
+
return k = S.find(function(j) {
|
|
3346
3346
|
return zr(j.req.query.range, N.query.range);
|
|
3347
|
-
}), [
|
|
3347
|
+
}), [k, !!k, D, S];
|
|
3348
3348
|
}
|
|
3349
3349
|
})(t, n, "query", i), w = C[0], g = C[1], T = C[2], _ = C[3];
|
|
3350
3350
|
return w && g ? w.obsSet = i.obsSet : (g = r.query(i).then(function(A) {
|
|
@@ -3521,7 +3521,7 @@ function xo() {
|
|
|
3521
3521
|
return r._whenReady(v);
|
|
3522
3522
|
}) : this._whenReady(v);
|
|
3523
3523
|
}, Ce.prototype.table = function(e) {
|
|
3524
|
-
if (!
|
|
3524
|
+
if (!V(this._allTables, e)) throw new O.InvalidTable("Table ".concat(e, " does not exist"));
|
|
3525
3525
|
return this._allTables[e];
|
|
3526
3526
|
}, Ce);
|
|
3527
3527
|
function Ce(e, t) {
|
|
@@ -3540,7 +3540,7 @@ function xo() {
|
|
|
3540
3540
|
n.on(g).unsubscribe(_), T.apply(n, A);
|
|
3541
3541
|
};
|
|
3542
3542
|
return n.on(g, _);
|
|
3543
|
-
}, this.on.ready.subscribe =
|
|
3543
|
+
}, this.on.ready.subscribe = ee(this.on.ready.subscribe, function(g) {
|
|
3544
3544
|
return function(T, _) {
|
|
3545
3545
|
Ce.vip(function() {
|
|
3546
3546
|
var A, x = n._state;
|
|
@@ -3577,7 +3577,7 @@ function xo() {
|
|
|
3577
3577
|
});
|
|
3578
3578
|
})), this.Version = (p = this, Lt(Va.prototype, function(g) {
|
|
3579
3579
|
this.db = p, this._cfg = { version: g, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3580
|
-
})), this.WhereClause = (v = this, Lt(
|
|
3580
|
+
})), this.WhereClause = (v = this, Lt(kr.prototype, function(g, T, _) {
|
|
3581
3581
|
if (this.db = v, this._ctx = { table: g, index: T === ":id" ? null : T, or: _ }, this._cmp = this._ascending = se, this._descending = function(A, x) {
|
|
3582
3582
|
return se(x, A);
|
|
3583
3583
|
}, this._max = function(A, x) {
|
|
@@ -3645,14 +3645,14 @@ function xo() {
|
|
|
3645
3645
|
var S = Bt();
|
|
3646
3646
|
try {
|
|
3647
3647
|
i && xt();
|
|
3648
|
-
var
|
|
3649
|
-
return
|
|
3648
|
+
var k = tt(e, D);
|
|
3649
|
+
return k = i ? k.finally(nt) : k;
|
|
3650
3650
|
} finally {
|
|
3651
3651
|
S && Et();
|
|
3652
3652
|
}
|
|
3653
3653
|
})(E = { subscr: x, signal: d.signal, requery: T, querier: e, trans: null }), Promise.resolve(N).then(function(D) {
|
|
3654
3654
|
n = !0, t = D, p || E.signal.aborted || (v = {}, (function(S) {
|
|
3655
|
-
for (var
|
|
3655
|
+
for (var k in S) if (V(S, k)) return;
|
|
3656
3656
|
return 1;
|
|
3657
3657
|
})(C = x) || g || (ot(Vt, _), g = !0), Kn(function() {
|
|
3658
3658
|
return !p && a.next && a.next(D);
|
|
@@ -3730,12 +3730,12 @@ function xo() {
|
|
|
3730
3730
|
}, Promise: X, debug: { get: function() {
|
|
3731
3731
|
return De;
|
|
3732
3732
|
}, set: function(e) {
|
|
3733
|
-
|
|
3734
|
-
} }, derive:
|
|
3735
|
-
typeof t == "string" ?
|
|
3736
|
-
|
|
3733
|
+
kt(e);
|
|
3734
|
+
} }, derive: F, extend: R, props: z, override: ee, Events: qt, on: ot, liveQuery: Qr, extendObservabilitySet: _n, getByKeyPath: pe, setByKeyPath: oe, delByKeyPath: function(e, t) {
|
|
3735
|
+
typeof t == "string" ? oe(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3736
|
+
oe(e, n, void 0);
|
|
3737
3737
|
});
|
|
3738
|
-
}, shallowClone: Re, deepClone: Se, getObjectDiff: ir, cmp: se, asap:
|
|
3738
|
+
}, shallowClone: Re, deepClone: Se, getObjectDiff: ir, cmp: se, asap: ie, minKey: -1 / 0, addons: [], connections: Tt, errnames: f, dependencies: wn, cache: vt, semVer: "4.2.0", version: "4.2.0".split(".").map(function(e) {
|
|
3739
3739
|
return parseInt(e);
|
|
3740
3740
|
}).reduce(function(e, t, n) {
|
|
3741
3741
|
return e + t / Math.pow(10, 2 * n);
|
|
@@ -3763,7 +3763,7 @@ function xo() {
|
|
|
3763
3763
|
return !e || e instanceof Qe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !B[e.name] ? e : (t = new B[e.name](t || e.message, e), "stack" in e && M(t, "stack", { get: function() {
|
|
3764
3764
|
return this.inner.stack;
|
|
3765
3765
|
} }), t);
|
|
3766
|
-
},
|
|
3766
|
+
}, kt(De), o(We, Object.freeze({ __proto__: null, Dexie: We, liveQuery: Qr, Entity: xr, cmp: se, PropModification: Ut, replacePrefix: function(e, t) {
|
|
3767
3767
|
return new Ut({ replacePrefix: [e, t] });
|
|
3768
3768
|
}, add: function(e) {
|
|
3769
3769
|
return new Ut({ add: e });
|
|
@@ -3892,7 +3892,7 @@ const st = {
|
|
|
3892
3892
|
updateEndingProgress: Po,
|
|
3893
3893
|
setComplete: So
|
|
3894
3894
|
};
|
|
3895
|
-
function
|
|
3895
|
+
function ko() {
|
|
3896
3896
|
return On;
|
|
3897
3897
|
}
|
|
3898
3898
|
function ya() {
|
|
@@ -3902,7 +3902,7 @@ function ya() {
|
|
|
3902
3902
|
progress: null
|
|
3903
3903
|
});
|
|
3904
3904
|
}
|
|
3905
|
-
function
|
|
3905
|
+
function Fo(l) {
|
|
3906
3906
|
ya();
|
|
3907
3907
|
const { dialecteConfig: c, databaseInstance: u } = l, o = c.database.tables.xmlElements.name, h = c.rootElementName, m = Promise.resolve().then(
|
|
3908
3908
|
async () => {
|
|
@@ -3962,9 +3962,9 @@ async function jo(l) {
|
|
|
3962
3962
|
createRootIfEmpty: !0
|
|
3963
3963
|
});
|
|
3964
3964
|
return {
|
|
3965
|
-
getState:
|
|
3965
|
+
getState: ko,
|
|
3966
3966
|
getDatabaseInstance: () => o,
|
|
3967
|
-
fromRoot: () =>
|
|
3967
|
+
fromRoot: () => Fo({ dialecteConfig: u, databaseInstance: o }),
|
|
3968
3968
|
fromElement: (h) => Mo({
|
|
3969
3969
|
dialecteConfig: u,
|
|
3970
3970
|
databaseInstance: o,
|
|
@@ -4057,7 +4057,7 @@ function Wo() {
|
|
|
4057
4057
|
if (!(this instanceof o))
|
|
4058
4058
|
return new o(f, s);
|
|
4059
4059
|
var O = this;
|
|
4060
|
-
m(O), O.q = O.c = "", O.bufferCheckPosition = c.MAX_BUFFER_LENGTH, O.opt = s || {}, O.opt.lowercase = O.opt.lowercase || O.opt.lowercasetags, O.looseCase = O.opt.lowercase ? "toLowerCase" : "toUpperCase", O.tags = [], O.closed = O.closedRoot = O.sawRoot = !1, O.tag = O.error = null, O.strict = !!f, O.noscript = !!(f || O.opt.noscript), O.state = I.BEGIN, O.strictEntities = O.opt.strictEntities, O.ENTITIES = O.strictEntities ? Object.create(c.XML_ENTITIES) : Object.create(c.ENTITIES), O.attribList = [], O.opt.xmlns && (O.ns = Object.create(
|
|
4060
|
+
m(O), O.q = O.c = "", O.bufferCheckPosition = c.MAX_BUFFER_LENGTH, O.opt = s || {}, O.opt.lowercase = O.opt.lowercase || O.opt.lowercasetags, O.looseCase = O.opt.lowercase ? "toLowerCase" : "toUpperCase", O.tags = [], O.closed = O.closedRoot = O.sawRoot = !1, O.tag = O.error = null, O.strict = !!f, O.noscript = !!(f || O.opt.noscript), O.state = I.BEGIN, O.strictEntities = O.opt.strictEntities, O.ENTITIES = O.strictEntities ? Object.create(c.XML_ENTITIES) : Object.create(c.ENTITIES), O.attribList = [], O.opt.xmlns && (O.ns = Object.create(F)), O.opt.unquotedAttributeValues === void 0 && (O.opt.unquotedAttributeValues = !f), O.trackPosition = O.opt.position !== !1, O.trackPosition && (O.position = O.line = O.column = 0), ze(O, "onready");
|
|
4061
4061
|
}
|
|
4062
4062
|
Object.create || (Object.create = function(f) {
|
|
4063
4063
|
function s() {
|
|
@@ -4172,22 +4172,22 @@ function Wo() {
|
|
|
4172
4172
|
B.splice(0, 0, f), O.emit.apply(O, B);
|
|
4173
4173
|
}), b.prototype.on.call(O, f, s);
|
|
4174
4174
|
};
|
|
4175
|
-
var
|
|
4175
|
+
var V = "[CDATA[", z = "DOCTYPE", H = "http://www.w3.org/XML/1998/namespace", M = "http://www.w3.org/2000/xmlns/", F = { xml: H, xmlns: M }, J = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, re = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, ye = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, ee = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
|
|
4176
4176
|
function Y(f) {
|
|
4177
4177
|
return f === " " || f === `
|
|
4178
4178
|
` || f === "\r" || f === " ";
|
|
4179
4179
|
}
|
|
4180
|
-
function
|
|
4180
|
+
function ie(f) {
|
|
4181
4181
|
return f === '"' || f === "'";
|
|
4182
4182
|
}
|
|
4183
4183
|
function pe(f) {
|
|
4184
4184
|
return f === ">" || Y(f);
|
|
4185
4185
|
}
|
|
4186
|
-
function
|
|
4186
|
+
function oe(f, s) {
|
|
4187
4187
|
return f.test(s);
|
|
4188
4188
|
}
|
|
4189
4189
|
function Re(f, s) {
|
|
4190
|
-
return !
|
|
4190
|
+
return !oe(f, s);
|
|
4191
4191
|
}
|
|
4192
4192
|
var I = 0;
|
|
4193
4193
|
c.STATE = {
|
|
@@ -4565,7 +4565,7 @@ Char: ` + f.c), s = new Error(s), f.error = s, ze(f, "onerror", s), f;
|
|
|
4565
4565
|
var O = f.indexOf(":"), B = O < 0 ? ["", f] : f.split(":"), ue = B[0], Z = B[1];
|
|
4566
4566
|
return s && f === "xmlns" && (ue = "xmlns", Z = ""), { prefix: ue, local: Z };
|
|
4567
4567
|
}
|
|
4568
|
-
function
|
|
4568
|
+
function ke(f) {
|
|
4569
4569
|
if (f.strict || (f.attribName = f.attribName[f.looseCase]()), f.attribList.indexOf(f.attribName) !== -1 || f.tag.attributes.hasOwnProperty(f.attribName)) {
|
|
4570
4570
|
f.attribName = f.attribValue = "";
|
|
4571
4571
|
return;
|
|
@@ -4605,10 +4605,10 @@ Actual: ` + f.attribValue
|
|
|
4605
4605
|
"Unbound namespace prefix: " + JSON.stringify(f.tagName)
|
|
4606
4606
|
), O.uri = B.prefix);
|
|
4607
4607
|
var ue = f.tags[f.tags.length - 1] || f;
|
|
4608
|
-
O.ns && ue.ns !== O.ns && Object.keys(O.ns).forEach(function(
|
|
4608
|
+
O.ns && ue.ns !== O.ns && Object.keys(O.ns).forEach(function(kt) {
|
|
4609
4609
|
de(f, "onopennamespace", {
|
|
4610
|
-
prefix:
|
|
4611
|
-
uri: O.ns[
|
|
4610
|
+
prefix: kt,
|
|
4611
|
+
uri: O.ns[kt]
|
|
4612
4612
|
});
|
|
4613
4613
|
});
|
|
4614
4614
|
for (var Z = 0, he = f.attribList.length; Z < he; Z++) {
|
|
@@ -4720,7 +4720,7 @@ Actual: ` + f.attribValue
|
|
|
4720
4720
|
case I.OPEN_WAKA:
|
|
4721
4721
|
if (B === "!")
|
|
4722
4722
|
s.state = I.SGML_DECL, s.sgmlDecl = "";
|
|
4723
|
-
else if (!Y(B)) if (
|
|
4723
|
+
else if (!Y(B)) if (oe(J, B))
|
|
4724
4724
|
s.state = I.OPEN_TAG, s.tagName = B;
|
|
4725
4725
|
else if (B === "/")
|
|
4726
4726
|
s.state = I.CLOSE_TAG, s.tagName = "";
|
|
@@ -4739,22 +4739,22 @@ Actual: ` + f.attribValue
|
|
|
4739
4739
|
s.state = I.COMMENT, s.comment = "", s.sgmlDecl = "";
|
|
4740
4740
|
continue;
|
|
4741
4741
|
}
|
|
4742
|
-
s.doctype && s.doctype !== !0 && s.sgmlDecl ? (s.state = I.DOCTYPE_DTD, s.doctype += "<!" + s.sgmlDecl + B, s.sgmlDecl = "") : (s.sgmlDecl + B).toUpperCase() ===
|
|
4742
|
+
s.doctype && s.doctype !== !0 && s.sgmlDecl ? (s.state = I.DOCTYPE_DTD, s.doctype += "<!" + s.sgmlDecl + B, s.sgmlDecl = "") : (s.sgmlDecl + B).toUpperCase() === V ? (de(s, "onopencdata"), s.state = I.CDATA, s.sgmlDecl = "", s.cdata = "") : (s.sgmlDecl + B).toUpperCase() === z ? (s.state = I.DOCTYPE, (s.doctype || s.sawRoot) && fe(
|
|
4743
4743
|
s,
|
|
4744
4744
|
"Inappropriately located doctype declaration"
|
|
4745
|
-
), s.doctype = "", s.sgmlDecl = "") : B === ">" ? (de(s, "onsgmldeclaration", s.sgmlDecl), s.sgmlDecl = "", s.state = I.TEXT) : (
|
|
4745
|
+
), s.doctype = "", s.sgmlDecl = "") : B === ">" ? (de(s, "onsgmldeclaration", s.sgmlDecl), s.sgmlDecl = "", s.state = I.TEXT) : (ie(B) && (s.state = I.SGML_DECL_QUOTED), s.sgmlDecl += B);
|
|
4746
4746
|
continue;
|
|
4747
4747
|
case I.SGML_DECL_QUOTED:
|
|
4748
4748
|
B === s.q && (s.state = I.SGML_DECL, s.q = ""), s.sgmlDecl += B;
|
|
4749
4749
|
continue;
|
|
4750
4750
|
case I.DOCTYPE:
|
|
4751
|
-
B === ">" ? (s.state = I.TEXT, de(s, "ondoctype", s.doctype), s.doctype = !0) : (s.doctype += B, B === "[" ? s.state = I.DOCTYPE_DTD :
|
|
4751
|
+
B === ">" ? (s.state = I.TEXT, de(s, "ondoctype", s.doctype), s.doctype = !0) : (s.doctype += B, B === "[" ? s.state = I.DOCTYPE_DTD : ie(B) && (s.state = I.DOCTYPE_QUOTED, s.q = B));
|
|
4752
4752
|
continue;
|
|
4753
4753
|
case I.DOCTYPE_QUOTED:
|
|
4754
4754
|
s.doctype += B, B === s.q && (s.q = "", s.state = I.DOCTYPE);
|
|
4755
4755
|
continue;
|
|
4756
4756
|
case I.DOCTYPE_DTD:
|
|
4757
|
-
B === "]" ? (s.doctype += B, s.state = I.DOCTYPE) : B === "<" ? (s.state = I.OPEN_WAKA, s.startTagPosition = s.position) :
|
|
4757
|
+
B === "]" ? (s.doctype += B, s.state = I.DOCTYPE) : B === "<" ? (s.state = I.OPEN_WAKA, s.startTagPosition = s.position) : ie(B) ? (s.doctype += B, s.state = I.DOCTYPE_DTD_QUOTED, s.q = B) : s.doctype += B;
|
|
4758
4758
|
continue;
|
|
4759
4759
|
case I.DOCTYPE_DTD_QUOTED:
|
|
4760
4760
|
s.doctype += B, B === s.q && (s.state = I.DOCTYPE_DTD, s.q = "");
|
|
@@ -4795,7 +4795,7 @@ Actual: ` + f.attribValue
|
|
|
4795
4795
|
}), s.procInstName = s.procInstBody = "", s.state = I.TEXT) : (s.procInstBody += "?" + B, s.state = I.PROC_INST_BODY);
|
|
4796
4796
|
continue;
|
|
4797
4797
|
case I.OPEN_TAG:
|
|
4798
|
-
|
|
4798
|
+
oe(re, B) ? s.tagName += B : (Ge(s), B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : (Y(B) || fe(s, "Invalid character in tag name"), s.state = I.ATTRIB));
|
|
4799
4799
|
continue;
|
|
4800
4800
|
case I.OPEN_TAG_SLASH:
|
|
4801
4801
|
B === ">" ? (je(s, !0), Pt(s)) : (fe(
|
|
@@ -4806,10 +4806,10 @@ Actual: ` + f.attribValue
|
|
|
4806
4806
|
case I.ATTRIB:
|
|
4807
4807
|
if (Y(B))
|
|
4808
4808
|
continue;
|
|
4809
|
-
B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH :
|
|
4809
|
+
B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : oe(J, B) ? (s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
|
|
4810
4810
|
continue;
|
|
4811
4811
|
case I.ATTRIB_NAME:
|
|
4812
|
-
B === "=" ? s.state = I.ATTRIB_VALUE : B === ">" ? (fe(s, "Attribute without value"), s.attribValue = s.attribName,
|
|
4812
|
+
B === "=" ? s.state = I.ATTRIB_VALUE : B === ">" ? (fe(s, "Attribute without value"), s.attribValue = s.attribName, ke(s), je(s)) : Y(B) ? s.state = I.ATTRIB_NAME_SAW_WHITE : oe(re, B) ? s.attribName += B : fe(s, "Invalid attribute name");
|
|
4813
4813
|
continue;
|
|
4814
4814
|
case I.ATTRIB_NAME_SAW_WHITE:
|
|
4815
4815
|
if (B === "=")
|
|
@@ -4820,34 +4820,34 @@ Actual: ` + f.attribValue
|
|
|
4820
4820
|
fe(s, "Attribute without value"), s.tag.attributes[s.attribName] = "", s.attribValue = "", de(s, "onattribute", {
|
|
4821
4821
|
name: s.attribName,
|
|
4822
4822
|
value: ""
|
|
4823
|
-
}), s.attribName = "", B === ">" ? je(s) :
|
|
4823
|
+
}), s.attribName = "", B === ">" ? je(s) : oe(J, B) ? (s.attribName = B, s.state = I.ATTRIB_NAME) : (fe(s, "Invalid attribute name"), s.state = I.ATTRIB);
|
|
4824
4824
|
}
|
|
4825
4825
|
continue;
|
|
4826
4826
|
case I.ATTRIB_VALUE:
|
|
4827
4827
|
if (Y(B))
|
|
4828
4828
|
continue;
|
|
4829
|
-
|
|
4829
|
+
ie(B) ? (s.q = B, s.state = I.ATTRIB_VALUE_QUOTED) : (s.opt.unquotedAttributeValues || Ve(s, "Unquoted attribute value"), s.state = I.ATTRIB_VALUE_UNQUOTED, s.attribValue = B);
|
|
4830
4830
|
continue;
|
|
4831
4831
|
case I.ATTRIB_VALUE_QUOTED:
|
|
4832
4832
|
if (B !== s.q) {
|
|
4833
4833
|
B === "&" ? s.state = I.ATTRIB_VALUE_ENTITY_Q : s.attribValue += B;
|
|
4834
4834
|
continue;
|
|
4835
4835
|
}
|
|
4836
|
-
|
|
4836
|
+
ke(s), s.q = "", s.state = I.ATTRIB_VALUE_CLOSED;
|
|
4837
4837
|
continue;
|
|
4838
4838
|
case I.ATTRIB_VALUE_CLOSED:
|
|
4839
|
-
Y(B) ? s.state = I.ATTRIB : B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH :
|
|
4839
|
+
Y(B) ? s.state = I.ATTRIB : B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : oe(J, B) ? (fe(s, "No whitespace between attributes"), s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
|
|
4840
4840
|
continue;
|
|
4841
4841
|
case I.ATTRIB_VALUE_UNQUOTED:
|
|
4842
4842
|
if (!pe(B)) {
|
|
4843
4843
|
B === "&" ? s.state = I.ATTRIB_VALUE_ENTITY_U : s.attribValue += B;
|
|
4844
4844
|
continue;
|
|
4845
4845
|
}
|
|
4846
|
-
|
|
4846
|
+
ke(s), B === ">" ? je(s) : s.state = I.ATTRIB;
|
|
4847
4847
|
continue;
|
|
4848
4848
|
case I.CLOSE_TAG:
|
|
4849
4849
|
if (s.tagName)
|
|
4850
|
-
B === ">" ? Pt(s) :
|
|
4850
|
+
B === ">" ? Pt(s) : oe(re, B) ? s.tagName += B : s.script ? (s.script += "</" + s.tagName + B, s.tagName = "", s.state = I.SCRIPT) : (Y(B) || fe(s, "Invalid tagname in closing tag"), s.state = I.CLOSE_TAG_SAW_WHITE);
|
|
4851
4851
|
else {
|
|
4852
4852
|
if (Y(B))
|
|
4853
4853
|
continue;
|
|
@@ -4877,7 +4877,7 @@ Actual: ` + f.attribValue
|
|
|
4877
4877
|
if (B === ";") {
|
|
4878
4878
|
var ve = Qe(s);
|
|
4879
4879
|
s.opt.unparsedEntities && !Object.values(c.XML_ENTITIES).includes(ve) ? (s.entity = "", s.state = he, s.write(ve)) : (s[xe] += ve, s.entity = "", s.state = he);
|
|
4880
|
-
} else
|
|
4880
|
+
} else oe(s.entity.length ? ee : ye, B) ? s.entity += B : (fe(s, "Invalid character in entity name"), s[xe] += "&" + s.entity + B, s.entity = "", s.state = he);
|
|
4881
4881
|
continue;
|
|
4882
4882
|
default:
|
|
4883
4883
|
throw new Error(s, "Unknown state: " + s.state);
|
|
@@ -4964,13 +4964,13 @@ function Qo(l) {
|
|
|
4964
4964
|
const b = ni(c, m.defaultNamespace), R = oi({ attributes: c.attributes, useCustomRecordsIds: h }), P = ii({
|
|
4965
4965
|
attributes: c.attributes,
|
|
4966
4966
|
useCustomRecordsIds: h
|
|
4967
|
-
}), q = ri(P),
|
|
4967
|
+
}), q = ri(P), V = ai(u.stack), z = {
|
|
4968
4968
|
id: R,
|
|
4969
4969
|
tagName: y,
|
|
4970
4970
|
namespace: b,
|
|
4971
4971
|
attributes: q,
|
|
4972
4972
|
value: "",
|
|
4973
|
-
parent:
|
|
4973
|
+
parent: V,
|
|
4974
4974
|
children: []
|
|
4975
4975
|
};
|
|
4976
4976
|
return m.stack.push(z), m;
|
|
@@ -5130,7 +5130,7 @@ async function fi(l) {
|
|
|
5130
5130
|
});
|
|
5131
5131
|
}
|
|
5132
5132
|
async function mr(l) {
|
|
5133
|
-
const { databaseInstance: c, elementsTableName: u, reader: o, sax: h, textDecoder: m, buffer: y, options: b } = l, { chunkSize: R, batchSize: P } = b, { done: q, value:
|
|
5133
|
+
const { databaseInstance: c, elementsTableName: u, reader: o, sax: h, textDecoder: m, buffer: y, options: b } = l, { chunkSize: R, batchSize: P } = b, { done: q, value: V } = await o.read();
|
|
5134
5134
|
if (q) {
|
|
5135
5135
|
if (y.length > 0) {
|
|
5136
5136
|
const H = m.decode(y);
|
|
@@ -5143,10 +5143,10 @@ async function mr(l) {
|
|
|
5143
5143
|
batchSize: 0
|
|
5144
5144
|
});
|
|
5145
5145
|
}
|
|
5146
|
-
if (!
|
|
5146
|
+
if (!V)
|
|
5147
5147
|
return await mr(l);
|
|
5148
|
-
let z = new Uint8Array(y.length +
|
|
5149
|
-
for (z.set(y), z.set(
|
|
5148
|
+
let z = new Uint8Array(y.length + V.length);
|
|
5149
|
+
for (z.set(y), z.set(V, y.length); z.length >= R; ) {
|
|
5150
5150
|
const H = z.slice(0, R);
|
|
5151
5151
|
z = z.slice(R);
|
|
5152
5152
|
const M = m.decode(H, { stream: !0 });
|
|
@@ -5178,102 +5178,102 @@ function di() {
|
|
|
5178
5178
|
return aa || (aa = 1, (function(l, c) {
|
|
5179
5179
|
Object.defineProperty(c, "__esModule", { value: !0 }), c.ParsingError = void 0;
|
|
5180
5180
|
class u extends Error {
|
|
5181
|
-
constructor(Y,
|
|
5182
|
-
super(Y), this.cause =
|
|
5181
|
+
constructor(Y, ie) {
|
|
5182
|
+
super(Y), this.cause = ie;
|
|
5183
5183
|
}
|
|
5184
5184
|
}
|
|
5185
5185
|
c.ParsingError = u;
|
|
5186
5186
|
let o;
|
|
5187
5187
|
function h() {
|
|
5188
|
-
return R(!1) || z() ||
|
|
5188
|
+
return R(!1) || z() || V() || q() || b();
|
|
5189
5189
|
}
|
|
5190
5190
|
function m() {
|
|
5191
|
-
return
|
|
5191
|
+
return F(/\s*/), R(!0) || V() || P() || b();
|
|
5192
5192
|
}
|
|
5193
5193
|
function y() {
|
|
5194
|
-
const
|
|
5195
|
-
let
|
|
5194
|
+
const ee = b(), Y = [];
|
|
5195
|
+
let ie, pe = m();
|
|
5196
5196
|
for (; pe; ) {
|
|
5197
5197
|
if (pe.node.type === "Element") {
|
|
5198
|
-
if (
|
|
5198
|
+
if (ie)
|
|
5199
5199
|
throw new Error("Found multiple root nodes");
|
|
5200
|
-
|
|
5200
|
+
ie = pe.node;
|
|
5201
5201
|
}
|
|
5202
5202
|
pe.excluded || Y.push(pe.node), pe = m();
|
|
5203
5203
|
}
|
|
5204
|
-
if (!
|
|
5204
|
+
if (!ie)
|
|
5205
5205
|
throw new u("Failed to parse XML", "Root Element not found");
|
|
5206
5206
|
if (o.xml.length !== 0)
|
|
5207
5207
|
throw new u("Failed to parse XML", "Not Well-Formed XML");
|
|
5208
5208
|
return {
|
|
5209
|
-
declaration:
|
|
5210
|
-
root:
|
|
5209
|
+
declaration: ee ? ee.node : null,
|
|
5210
|
+
root: ie,
|
|
5211
5211
|
children: Y
|
|
5212
5212
|
};
|
|
5213
5213
|
}
|
|
5214
5214
|
function b() {
|
|
5215
|
-
const
|
|
5216
|
-
if (!
|
|
5215
|
+
const ee = F(/^<\?([\w-:.]+)\s*/);
|
|
5216
|
+
if (!ee)
|
|
5217
5217
|
return;
|
|
5218
5218
|
const Y = {
|
|
5219
|
-
name:
|
|
5219
|
+
name: ee[1],
|
|
5220
5220
|
type: "ProcessingInstruction",
|
|
5221
5221
|
content: ""
|
|
5222
|
-
},
|
|
5223
|
-
if (
|
|
5224
|
-
Y.content = o.xml.substring(0,
|
|
5222
|
+
}, ie = o.xml.indexOf("?>");
|
|
5223
|
+
if (ie > -1)
|
|
5224
|
+
Y.content = o.xml.substring(0, ie).trim(), o.xml = o.xml.slice(ie);
|
|
5225
5225
|
else
|
|
5226
5226
|
throw new u("Failed to parse XML", "ProcessingInstruction closing tag not found");
|
|
5227
|
-
return
|
|
5227
|
+
return F(/\?>/), {
|
|
5228
5228
|
excluded: o.options.filter(Y) === !1,
|
|
5229
5229
|
node: Y
|
|
5230
5230
|
};
|
|
5231
5231
|
}
|
|
5232
|
-
function R(
|
|
5233
|
-
const Y =
|
|
5232
|
+
function R(ee) {
|
|
5233
|
+
const Y = F(/^<([^?!</>\s]+)\s*/);
|
|
5234
5234
|
if (!Y)
|
|
5235
5235
|
return;
|
|
5236
|
-
const
|
|
5236
|
+
const ie = {
|
|
5237
5237
|
type: "Element",
|
|
5238
5238
|
name: Y[1],
|
|
5239
5239
|
attributes: {},
|
|
5240
5240
|
children: []
|
|
5241
|
-
}, pe =
|
|
5242
|
-
for (; !(J() ||
|
|
5241
|
+
}, pe = ee ? !1 : o.options.filter(ie) === !1;
|
|
5242
|
+
for (; !(J() || re(">") || re("?>") || re("/>")); ) {
|
|
5243
5243
|
const Re = H();
|
|
5244
5244
|
if (Re)
|
|
5245
|
-
|
|
5245
|
+
ie.attributes[Re.name] = Re.value;
|
|
5246
5246
|
else
|
|
5247
5247
|
return;
|
|
5248
5248
|
}
|
|
5249
|
-
if (
|
|
5250
|
-
return
|
|
5249
|
+
if (F(/^\s*\/>/))
|
|
5250
|
+
return ie.children = null, {
|
|
5251
5251
|
excluded: pe,
|
|
5252
|
-
node:
|
|
5252
|
+
node: ie
|
|
5253
5253
|
};
|
|
5254
|
-
|
|
5255
|
-
let
|
|
5256
|
-
for (;
|
|
5257
|
-
|
|
5254
|
+
F(/\??>/);
|
|
5255
|
+
let oe = h();
|
|
5256
|
+
for (; oe; )
|
|
5257
|
+
oe.excluded || ie.children.push(oe.node), oe = h();
|
|
5258
5258
|
if (o.options.strictMode) {
|
|
5259
|
-
const Re = `</${
|
|
5259
|
+
const Re = `</${ie.name}>`;
|
|
5260
5260
|
if (o.xml.startsWith(Re))
|
|
5261
5261
|
o.xml = o.xml.slice(Re.length);
|
|
5262
5262
|
else
|
|
5263
5263
|
throw new u("Failed to parse XML", `Closing tag not matching "${Re}"`);
|
|
5264
5264
|
} else
|
|
5265
|
-
|
|
5265
|
+
F(/^<\/[\w-:.\u00C0-\u00FF]+\s*>/);
|
|
5266
5266
|
return {
|
|
5267
5267
|
excluded: pe,
|
|
5268
|
-
node:
|
|
5268
|
+
node: ie
|
|
5269
5269
|
};
|
|
5270
5270
|
}
|
|
5271
5271
|
function P() {
|
|
5272
|
-
const
|
|
5273
|
-
if (
|
|
5272
|
+
const ee = F(/^<!DOCTYPE\s+\S+\s+SYSTEM[^>]*>/) || F(/^<!DOCTYPE\s+\S+\s+PUBLIC[^>]*>/) || F(/^<!DOCTYPE\s+\S+\s*\[[^\]]*]>/) || F(/^<!DOCTYPE\s+\S+\s*>/);
|
|
5273
|
+
if (ee) {
|
|
5274
5274
|
const Y = {
|
|
5275
5275
|
type: "DocumentType",
|
|
5276
|
-
content:
|
|
5276
|
+
content: ee[0]
|
|
5277
5277
|
};
|
|
5278
5278
|
return {
|
|
5279
5279
|
excluded: o.options.filter(Y) === !1,
|
|
@@ -5283,25 +5283,25 @@ function di() {
|
|
|
5283
5283
|
}
|
|
5284
5284
|
function q() {
|
|
5285
5285
|
if (o.xml.startsWith("<![CDATA[")) {
|
|
5286
|
-
const
|
|
5287
|
-
if (
|
|
5288
|
-
const Y =
|
|
5286
|
+
const ee = o.xml.indexOf("]]>");
|
|
5287
|
+
if (ee > -1) {
|
|
5288
|
+
const Y = ee + 3, ie = {
|
|
5289
5289
|
type: "CDATA",
|
|
5290
5290
|
content: o.xml.substring(0, Y)
|
|
5291
5291
|
};
|
|
5292
5292
|
return o.xml = o.xml.slice(Y), {
|
|
5293
|
-
excluded: o.options.filter(
|
|
5294
|
-
node:
|
|
5293
|
+
excluded: o.options.filter(ie) === !1,
|
|
5294
|
+
node: ie
|
|
5295
5295
|
};
|
|
5296
5296
|
}
|
|
5297
5297
|
}
|
|
5298
5298
|
}
|
|
5299
|
-
function
|
|
5300
|
-
const
|
|
5301
|
-
if (
|
|
5299
|
+
function V() {
|
|
5300
|
+
const ee = F(/^<!--[\s\S]*?-->/);
|
|
5301
|
+
if (ee) {
|
|
5302
5302
|
const Y = {
|
|
5303
5303
|
type: "Comment",
|
|
5304
|
-
content:
|
|
5304
|
+
content: ee[0]
|
|
5305
5305
|
};
|
|
5306
5306
|
return {
|
|
5307
5307
|
excluded: o.options.filter(Y) === !1,
|
|
@@ -5310,11 +5310,11 @@ function di() {
|
|
|
5310
5310
|
}
|
|
5311
5311
|
}
|
|
5312
5312
|
function z() {
|
|
5313
|
-
const
|
|
5314
|
-
if (
|
|
5313
|
+
const ee = F(/^([^<]+)/);
|
|
5314
|
+
if (ee) {
|
|
5315
5315
|
const Y = {
|
|
5316
5316
|
type: "Text",
|
|
5317
|
-
content:
|
|
5317
|
+
content: ee[1]
|
|
5318
5318
|
};
|
|
5319
5319
|
return {
|
|
5320
5320
|
excluded: o.options.filter(Y) === !1,
|
|
@@ -5323,33 +5323,33 @@ function di() {
|
|
|
5323
5323
|
}
|
|
5324
5324
|
}
|
|
5325
5325
|
function H() {
|
|
5326
|
-
const
|
|
5327
|
-
if (
|
|
5326
|
+
const ee = F(/([^=]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)\s*/);
|
|
5327
|
+
if (ee)
|
|
5328
5328
|
return {
|
|
5329
|
-
name:
|
|
5330
|
-
value: M(
|
|
5329
|
+
name: ee[1].trim(),
|
|
5330
|
+
value: M(ee[2].trim())
|
|
5331
5331
|
};
|
|
5332
5332
|
}
|
|
5333
|
-
function M(
|
|
5334
|
-
return
|
|
5333
|
+
function M(ee) {
|
|
5334
|
+
return ee.replace(/^['"]|['"]$/g, "");
|
|
5335
5335
|
}
|
|
5336
|
-
function
|
|
5337
|
-
const Y = o.xml.match(
|
|
5336
|
+
function F(ee) {
|
|
5337
|
+
const Y = o.xml.match(ee);
|
|
5338
5338
|
if (Y)
|
|
5339
5339
|
return o.xml = o.xml.slice(Y[0].length), Y;
|
|
5340
5340
|
}
|
|
5341
5341
|
function J() {
|
|
5342
5342
|
return o.xml.length === 0;
|
|
5343
5343
|
}
|
|
5344
|
-
function
|
|
5345
|
-
return o.xml.indexOf(
|
|
5344
|
+
function re(ee) {
|
|
5345
|
+
return o.xml.indexOf(ee) === 0;
|
|
5346
5346
|
}
|
|
5347
|
-
function ye(
|
|
5348
|
-
|
|
5349
|
-
const
|
|
5347
|
+
function ye(ee, Y = {}) {
|
|
5348
|
+
ee = ee.trim();
|
|
5349
|
+
const ie = Y.filter || (() => !0);
|
|
5350
5350
|
return o = {
|
|
5351
|
-
xml:
|
|
5352
|
-
options: Object.assign(Object.assign({}, Y), { filter:
|
|
5351
|
+
xml: ee,
|
|
5352
|
+
options: Object.assign(Object.assign({}, Y), { filter: ie, strictMode: Y.strictMode === !0 })
|
|
5353
5353
|
}, y();
|
|
5354
5354
|
}
|
|
5355
5355
|
l.exports = ye, c.default = ye;
|
|
@@ -5367,88 +5367,88 @@ function hi() {
|
|
|
5367
5367
|
if (!M.options.indentation && !M.options.lineSeparator)
|
|
5368
5368
|
return;
|
|
5369
5369
|
M.content += M.options.lineSeparator;
|
|
5370
|
-
let
|
|
5371
|
-
for (
|
|
5370
|
+
let F;
|
|
5371
|
+
for (F = 0; F < M.level; F++)
|
|
5372
5372
|
M.content += M.options.indentation;
|
|
5373
5373
|
}
|
|
5374
5374
|
function m(M) {
|
|
5375
5375
|
M.content = M.content.replace(/ +$/, "");
|
|
5376
|
-
let
|
|
5377
|
-
for (
|
|
5376
|
+
let F;
|
|
5377
|
+
for (F = 0; F < M.level; F++)
|
|
5378
5378
|
M.content += M.options.indentation;
|
|
5379
5379
|
}
|
|
5380
|
-
function y(M,
|
|
5381
|
-
M.content +=
|
|
5380
|
+
function y(M, F) {
|
|
5381
|
+
M.content += F;
|
|
5382
5382
|
}
|
|
5383
|
-
function b(M,
|
|
5383
|
+
function b(M, F, J) {
|
|
5384
5384
|
if (M.type === "Element")
|
|
5385
|
-
q(M,
|
|
5385
|
+
q(M, F, J);
|
|
5386
5386
|
else if (M.type === "ProcessingInstruction")
|
|
5387
|
-
z(M,
|
|
5387
|
+
z(M, F);
|
|
5388
5388
|
else if (typeof M.content == "string")
|
|
5389
|
-
R(M.content,
|
|
5389
|
+
R(M.content, F, J);
|
|
5390
5390
|
else
|
|
5391
5391
|
throw new Error("Unknown node type: " + M.type);
|
|
5392
5392
|
}
|
|
5393
|
-
function R(M,
|
|
5393
|
+
function R(M, F, J) {
|
|
5394
5394
|
if (!J) {
|
|
5395
|
-
const
|
|
5396
|
-
(
|
|
5395
|
+
const re = M.trim();
|
|
5396
|
+
(F.options.lineSeparator || re.length === 0) && (M = re);
|
|
5397
5397
|
}
|
|
5398
|
-
M.length > 0 && (!J &&
|
|
5398
|
+
M.length > 0 && (!J && F.content.length > 0 && h(F), y(F, M));
|
|
5399
5399
|
}
|
|
5400
|
-
function P(M,
|
|
5401
|
-
const J = "/" + M.join("/"),
|
|
5402
|
-
return
|
|
5400
|
+
function P(M, F) {
|
|
5401
|
+
const J = "/" + M.join("/"), re = M[M.length - 1];
|
|
5402
|
+
return F.includes(re) || F.includes(J);
|
|
5403
5403
|
}
|
|
5404
|
-
function q(M,
|
|
5405
|
-
if (
|
|
5406
|
-
const
|
|
5407
|
-
y(
|
|
5404
|
+
function q(M, F, J) {
|
|
5405
|
+
if (F.path.push(M.name), !J && F.content.length > 0 && h(F), y(F, "<" + M.name), V(F, M.attributes), M.children === null || F.options.forceSelfClosingEmptyTag && M.children.length === 0) {
|
|
5406
|
+
const re = F.options.whiteSpaceAtEndOfSelfclosingTag ? " />" : "/>";
|
|
5407
|
+
y(F, re);
|
|
5408
5408
|
} else if (M.children.length === 0)
|
|
5409
|
-
y(
|
|
5409
|
+
y(F, "></" + M.name + ">");
|
|
5410
5410
|
else {
|
|
5411
|
-
const
|
|
5412
|
-
y(
|
|
5413
|
-
let ye = M.attributes["xml:space"] === "preserve" || J,
|
|
5414
|
-
if (!ye &&
|
|
5415
|
-
let Y = !1,
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
`) ? (
|
|
5419
|
-
}), Y && (!pe || !
|
|
5411
|
+
const re = M.children;
|
|
5412
|
+
y(F, ">"), F.level++;
|
|
5413
|
+
let ye = M.attributes["xml:space"] === "preserve" || J, ee = !1;
|
|
5414
|
+
if (!ye && F.options.ignoredPaths && (ee = P(F.path, F.options.ignoredPaths), ye = ee), !ye && F.options.collapseContent) {
|
|
5415
|
+
let Y = !1, ie = !1, pe = !1;
|
|
5416
|
+
re.forEach(function(oe, Re) {
|
|
5417
|
+
oe.type === "Text" ? (oe.content.includes(`
|
|
5418
|
+
`) ? (ie = !0, oe.content = oe.content.trim()) : (Re === 0 || Re === re.length - 1) && !J && oe.content.trim().length === 0 && (oe.content = ""), (oe.content.trim().length > 0 || re.length === 1) && (Y = !0)) : oe.type === "CDATA" ? Y = !0 : pe = !0;
|
|
5419
|
+
}), Y && (!pe || !ie) && (ye = !0);
|
|
5420
5420
|
}
|
|
5421
|
-
|
|
5422
|
-
b(Y,
|
|
5423
|
-
}),
|
|
5421
|
+
re.forEach(function(Y) {
|
|
5422
|
+
b(Y, F, J || ye);
|
|
5423
|
+
}), F.level--, !J && !ye && h(F), ee && m(F), y(F, "</" + M.name + ">");
|
|
5424
5424
|
}
|
|
5425
|
-
|
|
5425
|
+
F.path.pop();
|
|
5426
5426
|
}
|
|
5427
|
-
function
|
|
5428
|
-
Object.keys(
|
|
5429
|
-
const
|
|
5430
|
-
y(M, " " + J + '="' +
|
|
5427
|
+
function V(M, F) {
|
|
5428
|
+
Object.keys(F).forEach(function(J) {
|
|
5429
|
+
const re = F[J].replace(/"/g, """);
|
|
5430
|
+
y(M, " " + J + '="' + re + '"');
|
|
5431
5431
|
});
|
|
5432
5432
|
}
|
|
5433
|
-
function z(M,
|
|
5434
|
-
|
|
5433
|
+
function z(M, F) {
|
|
5434
|
+
F.content.length > 0 && h(F), y(F, "<?" + M.name), y(F, " " + M.content.trim()), y(F, "?>");
|
|
5435
5435
|
}
|
|
5436
|
-
function H(M,
|
|
5437
|
-
|
|
5438
|
-
`,
|
|
5436
|
+
function H(M, F = {}) {
|
|
5437
|
+
F.indentation = "indentation" in F ? F.indentation : " ", F.collapseContent = F.collapseContent === !0, F.lineSeparator = "lineSeparator" in F ? F.lineSeparator : `\r
|
|
5438
|
+
`, F.whiteSpaceAtEndOfSelfclosingTag = F.whiteSpaceAtEndOfSelfclosingTag === !0, F.throwOnFailure = F.throwOnFailure !== !1;
|
|
5439
5439
|
try {
|
|
5440
|
-
const J = (0, o.default)(M, { filter:
|
|
5441
|
-
return J.declaration && z(J.declaration,
|
|
5442
|
-
b(ye,
|
|
5443
|
-
}),
|
|
5444
|
-
`).replace(/\n/g,
|
|
5440
|
+
const J = (0, o.default)(M, { filter: F.filter, strictMode: F.strictMode }), re = { content: "", level: 0, options: F, path: [] };
|
|
5441
|
+
return J.declaration && z(J.declaration, re), J.children.forEach(function(ye) {
|
|
5442
|
+
b(ye, re, !1);
|
|
5443
|
+
}), F.lineSeparator ? re.content.replace(/\r\n/g, `
|
|
5444
|
+
`).replace(/\n/g, F.lineSeparator) : re.content;
|
|
5445
5445
|
} catch (J) {
|
|
5446
|
-
if (
|
|
5446
|
+
if (F.throwOnFailure)
|
|
5447
5447
|
throw J;
|
|
5448
5448
|
return M;
|
|
5449
5449
|
}
|
|
5450
5450
|
}
|
|
5451
|
-
H.minify = (M,
|
|
5451
|
+
H.minify = (M, F = {}) => H(M, Object.assign(Object.assign({}, F), { indentation: "", lineSeparator: "" })), l.exports = H, c.default = H;
|
|
5452
5452
|
})(zt, zt.exports)), zt.exports;
|
|
5453
5453
|
}
|
|
5454
5454
|
var mi = /* @__PURE__ */ hi();
|
|
@@ -5461,7 +5461,7 @@ async function yi(l) {
|
|
|
5461
5461
|
` + new XMLSerializer().serializeToString(u), R = gi(b), P = new Blob([R], { type: "application/xml" });
|
|
5462
5462
|
if ("showSaveFilePicker" in window)
|
|
5463
5463
|
try {
|
|
5464
|
-
const
|
|
5464
|
+
const V = await (await window.showSaveFilePicker({
|
|
5465
5465
|
suggestedName: o,
|
|
5466
5466
|
types: [
|
|
5467
5467
|
{
|
|
@@ -5470,13 +5470,13 @@ async function yi(l) {
|
|
|
5470
5470
|
}
|
|
5471
5471
|
]
|
|
5472
5472
|
})).createWritable();
|
|
5473
|
-
await
|
|
5473
|
+
await V.write(P), await V.close();
|
|
5474
5474
|
} catch (q) {
|
|
5475
5475
|
q.name !== "AbortError" && console.error("Save failed:", q);
|
|
5476
5476
|
}
|
|
5477
5477
|
else {
|
|
5478
|
-
const q = URL.createObjectURL(P),
|
|
5479
|
-
|
|
5478
|
+
const q = URL.createObjectURL(P), V = document.createElement("a");
|
|
5479
|
+
V.href = q, V.download = o, document.body.appendChild(V), V.click(), V.remove(), URL.revokeObjectURL(q);
|
|
5480
5480
|
}
|
|
5481
5481
|
}
|
|
5482
5482
|
async function Es(l) {
|
|
@@ -5564,12 +5564,12 @@ async function ba(l) {
|
|
|
5564
5564
|
childrenRecords: q,
|
|
5565
5565
|
parentRecord: y
|
|
5566
5566
|
});
|
|
5567
|
-
const
|
|
5567
|
+
const V = bi({
|
|
5568
5568
|
parentTagName: y.tagName,
|
|
5569
5569
|
availableChildren: u.children,
|
|
5570
5570
|
childrenRecords: q
|
|
5571
5571
|
});
|
|
5572
|
-
for (const z of
|
|
5572
|
+
for (const z of V) {
|
|
5573
5573
|
const H = _i({
|
|
5574
5574
|
document: m,
|
|
5575
5575
|
record: z,
|
|
@@ -5677,8 +5677,8 @@ async function Ns(l) {
|
|
|
5677
5677
|
break;
|
|
5678
5678
|
case "addChild":
|
|
5679
5679
|
m.goTo && (o = o.goToElement(m.goTo));
|
|
5680
|
-
const { id: y, tagName: b, attributes: R, namespace: P, value: q, setFocus:
|
|
5681
|
-
|
|
5680
|
+
const { id: y, tagName: b, attributes: R, namespace: P, value: q, setFocus: V } = m;
|
|
5681
|
+
V ? o = o.addChild({
|
|
5682
5682
|
id: y,
|
|
5683
5683
|
tagName: b,
|
|
5684
5684
|
attributes: R,
|
|
@@ -5725,7 +5725,7 @@ function Bi(l) {
|
|
|
5725
5725
|
databaseInstance: o,
|
|
5726
5726
|
tagName: b,
|
|
5727
5727
|
attributes: R
|
|
5728
|
-
})).filter((
|
|
5728
|
+
})).filter((V) => V.parent?.tagName === m.currentFocus.tagName && V.parent?.id === m.currentFocus.id);
|
|
5729
5729
|
y[b] || (y[b] = []), y[b].push(...q);
|
|
5730
5730
|
}
|
|
5731
5731
|
return y;
|
|
@@ -5751,7 +5751,7 @@ async function Ei(l) {
|
|
|
5751
5751
|
const { record: P, includeFilter: q } = R;
|
|
5752
5752
|
if (xi({ record: P, excludeFilters: y }))
|
|
5753
5753
|
return Nn({ record: P });
|
|
5754
|
-
const
|
|
5754
|
+
const V = await Ni({
|
|
5755
5755
|
record: P,
|
|
5756
5756
|
context: u,
|
|
5757
5757
|
dialecteConfig: o,
|
|
@@ -5759,8 +5759,8 @@ async function Ei(l) {
|
|
|
5759
5759
|
currentIncludeFilter: q,
|
|
5760
5760
|
excludeFilters: y
|
|
5761
5761
|
}), H = (await Promise.all(
|
|
5762
|
-
|
|
5763
|
-
({ record: M, includeFilter:
|
|
5762
|
+
V.map(
|
|
5763
|
+
({ record: M, includeFilter: F }) => b({ record: M, includeFilter: F })
|
|
5764
5764
|
)
|
|
5765
5765
|
)).filter(
|
|
5766
5766
|
(M) => M !== null
|
|
@@ -5887,16 +5887,16 @@ function Si(l) {
|
|
|
5887
5887
|
}
|
|
5888
5888
|
return c;
|
|
5889
5889
|
}
|
|
5890
|
-
function
|
|
5890
|
+
function ki(l, c) {
|
|
5891
5891
|
const u = {};
|
|
5892
5892
|
for (const o of c)
|
|
5893
5893
|
u[o] = l.get(o) || [];
|
|
5894
5894
|
return u;
|
|
5895
5895
|
}
|
|
5896
|
-
async function
|
|
5896
|
+
async function Fi(l) {
|
|
5897
5897
|
const { context: c, dialecteConfig: u, databaseInstance: o, candidates: h, focus: m, path: y, collectTags: b } = l, R = /* @__PURE__ */ new Map();
|
|
5898
5898
|
for (const q of h) {
|
|
5899
|
-
const
|
|
5899
|
+
const V = await Mi({
|
|
5900
5900
|
candidate: q,
|
|
5901
5901
|
focus: m,
|
|
5902
5902
|
context: c,
|
|
@@ -5905,10 +5905,10 @@ async function ki(l) {
|
|
|
5905
5905
|
path: y,
|
|
5906
5906
|
shouldCollect: !0
|
|
5907
5907
|
});
|
|
5908
|
-
|
|
5908
|
+
V.valid && V.ancestors && Ui(V.ancestors, b, R);
|
|
5909
5909
|
}
|
|
5910
5910
|
const P = Si(R);
|
|
5911
|
-
return
|
|
5911
|
+
return ki(P, b);
|
|
5912
5912
|
}
|
|
5913
5913
|
async function Mi(l) {
|
|
5914
5914
|
const { candidate: c, focus: u, context: o, dialecteConfig: h, databaseInstance: m, path: y, shouldCollect: b } = l;
|
|
@@ -5956,8 +5956,8 @@ async function ji(l) {
|
|
|
5956
5956
|
async function Ki(l) {
|
|
5957
5957
|
const { candidate: c, focus: u, context: o, dialecteConfig: h, databaseInstance: m, path: y, shouldCollect: b } = l, R = b ? [c] : [];
|
|
5958
5958
|
let P = c.parent;
|
|
5959
|
-
for (let
|
|
5960
|
-
const z = y[
|
|
5959
|
+
for (let V = y.length - 1; V >= 0; V--) {
|
|
5960
|
+
const z = y[V], H = await qi({
|
|
5961
5961
|
current: P,
|
|
5962
5962
|
expected: z,
|
|
5963
5963
|
context: o,
|
|
@@ -6064,7 +6064,7 @@ async function Gi(l) {
|
|
|
6064
6064
|
tagName: b.tagName,
|
|
6065
6065
|
attributes: b.attributes
|
|
6066
6066
|
});
|
|
6067
|
-
return await
|
|
6067
|
+
return await Fi({
|
|
6068
6068
|
context: c,
|
|
6069
6069
|
dialecteConfig: u,
|
|
6070
6070
|
databaseInstance: o,
|
|
@@ -6160,10 +6160,10 @@ function Ta(l) {
|
|
|
6160
6160
|
}
|
|
6161
6161
|
function zi(l) {
|
|
6162
6162
|
return async function() {
|
|
6163
|
-
const { contextPromise: u, dialecteConfig: o, databaseInstance: h } = l, m = o.database.tables.xmlElements.name, y = h.table(m), b = structuredClone(await u), { creates: R, updates: P, deletes: q } = Wi(b.stagedOperations),
|
|
6163
|
+
const { contextPromise: u, dialecteConfig: o, databaseInstance: h } = l, m = o.database.tables.xmlElements.name, y = h.table(m), b = structuredClone(await u), { creates: R, updates: P, deletes: q } = Wi(b.stagedOperations), V = R.length + P.length + q.length;
|
|
6164
6164
|
st.updateEndingProgress({
|
|
6165
6165
|
current: 0,
|
|
6166
|
-
total:
|
|
6166
|
+
total: V,
|
|
6167
6167
|
operation: "Committing changes"
|
|
6168
6168
|
});
|
|
6169
6169
|
try {
|
|
@@ -6171,15 +6171,15 @@ function zi(l) {
|
|
|
6171
6171
|
let z = 0;
|
|
6172
6172
|
R.length > 0 && (await y.bulkAdd(R.map((H) => H.newRecord)), z += R.length, st.updateEndingProgress({
|
|
6173
6173
|
current: z,
|
|
6174
|
-
total:
|
|
6174
|
+
total: V,
|
|
6175
6175
|
operation: `Created ${R.length} elements`
|
|
6176
6176
|
})), P.length > 0 && (await y.bulkPut(P.map((H) => H.newRecord)), z += P.length, st.updateEndingProgress({
|
|
6177
6177
|
current: z,
|
|
6178
|
-
total:
|
|
6178
|
+
total: V,
|
|
6179
6179
|
operation: `Updated ${P.length} elements`
|
|
6180
6180
|
})), q.length > 0 && (await y.bulkDelete(q.map((H) => H.oldRecord.id)), z += q.length, st.updateEndingProgress({
|
|
6181
6181
|
current: z,
|
|
6182
|
-
total:
|
|
6182
|
+
total: V,
|
|
6183
6183
|
operation: `Deleted ${q.length} elements`
|
|
6184
6184
|
}));
|
|
6185
6185
|
}), b.stagedOperations = [], st.setComplete();
|
|
@@ -6200,32 +6200,32 @@ function zi(l) {
|
|
|
6200
6200
|
function Qi(l) {
|
|
6201
6201
|
const { chain: c, contextPromise: u, dialecteConfig: o } = l;
|
|
6202
6202
|
return function(h) {
|
|
6203
|
-
const { id: m, tagName: y, attributes: b, namespace: R, value: P, setFocus: q = !1 } = h,
|
|
6203
|
+
const { id: m, tagName: y, attributes: b, namespace: R, value: P, setFocus: q = !1 } = h, V = m ?? crypto.randomUUID(), z = u.then((H) => {
|
|
6204
6204
|
try {
|
|
6205
6205
|
st.setOperation(`Creating ${y}`);
|
|
6206
6206
|
const M = la({
|
|
6207
6207
|
record: {
|
|
6208
|
-
id:
|
|
6208
|
+
id: V,
|
|
6209
6209
|
tagName: y,
|
|
6210
6210
|
attributes: b,
|
|
6211
6211
|
namespace: R,
|
|
6212
6212
|
value: P
|
|
6213
6213
|
},
|
|
6214
6214
|
dialecteConfig: o
|
|
6215
|
-
}), { childRecord:
|
|
6215
|
+
}), { childRecord: F, updatedParent: J } = Hi({
|
|
6216
6216
|
record: M,
|
|
6217
6217
|
context: H,
|
|
6218
6218
|
dialecteConfig: o
|
|
6219
6219
|
});
|
|
6220
6220
|
return q ? {
|
|
6221
6221
|
...H,
|
|
6222
|
-
currentFocus:
|
|
6222
|
+
currentFocus: F
|
|
6223
6223
|
} : {
|
|
6224
6224
|
...H,
|
|
6225
6225
|
currentFocus: J
|
|
6226
6226
|
};
|
|
6227
6227
|
} catch (M) {
|
|
6228
|
-
const
|
|
6228
|
+
const F = Ta({
|
|
6229
6229
|
errorKey: "CREATE_CHILD_ERROR",
|
|
6230
6230
|
context: {
|
|
6231
6231
|
method: "addChild",
|
|
@@ -6235,7 +6235,7 @@ function Qi(l) {
|
|
|
6235
6235
|
originalError: M
|
|
6236
6236
|
}
|
|
6237
6237
|
});
|
|
6238
|
-
throw st.setError(
|
|
6238
|
+
throw st.setError(F), F;
|
|
6239
6239
|
}
|
|
6240
6240
|
});
|
|
6241
6241
|
return c(q ? {
|
|
@@ -6287,35 +6287,40 @@ function Hi(l) {
|
|
|
6287
6287
|
};
|
|
6288
6288
|
}
|
|
6289
6289
|
function Zi(l) {
|
|
6290
|
-
const { chain: c, contextPromise: u } = l;
|
|
6291
|
-
return function(
|
|
6292
|
-
const { record:
|
|
6293
|
-
const
|
|
6294
|
-
contextPromise: Promise.resolve(
|
|
6290
|
+
const { chain: c, contextPromise: u, dialecteConfig: o } = l;
|
|
6291
|
+
return function(h) {
|
|
6292
|
+
const { record: m, setFocus: y } = h, b = u.then(async (R) => {
|
|
6293
|
+
const P = c({
|
|
6294
|
+
contextPromise: Promise.resolve(R)
|
|
6295
6295
|
});
|
|
6296
|
-
let
|
|
6297
|
-
chain:
|
|
6298
|
-
childRecord:
|
|
6296
|
+
let q = await V({
|
|
6297
|
+
chain: P,
|
|
6298
|
+
childRecord: m
|
|
6299
6299
|
});
|
|
6300
|
-
async function
|
|
6301
|
-
const { chain:
|
|
6302
|
-
let
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6300
|
+
async function V(z) {
|
|
6301
|
+
const { chain: H, childRecord: M } = z;
|
|
6302
|
+
let F = !0, J = M, re = H;
|
|
6303
|
+
if (o.hooks?.beforeClone && ({ shouldBeCloned: F, transformedRecord: J } = o.hooks.beforeClone({
|
|
6304
|
+
record: J
|
|
6305
|
+
})), F) {
|
|
6306
|
+
re = H.addChild({
|
|
6307
|
+
tagName: M.tagName,
|
|
6308
|
+
namespace: M.namespace,
|
|
6309
|
+
attributes: M.attributes,
|
|
6310
|
+
value: M.value,
|
|
6311
|
+
setFocus: !0
|
|
6312
|
+
});
|
|
6313
|
+
for (const ee of M.tree)
|
|
6314
|
+
re = await V({ chain: re, childRecord: ee }), re = re.goToParent();
|
|
6315
|
+
}
|
|
6316
|
+
return re;
|
|
6312
6317
|
}
|
|
6313
|
-
return
|
|
6318
|
+
return y || (q = q.goToParent()), await q.getContext();
|
|
6314
6319
|
});
|
|
6315
|
-
return c(
|
|
6316
|
-
contextPromise:
|
|
6320
|
+
return c(y ? {
|
|
6321
|
+
contextPromise: b
|
|
6317
6322
|
} : {
|
|
6318
|
-
contextPromise:
|
|
6323
|
+
contextPromise: b
|
|
6319
6324
|
});
|
|
6320
6325
|
};
|
|
6321
6326
|
}
|
|
@@ -6332,10 +6337,10 @@ function Ji(l) {
|
|
|
6332
6337
|
dialecteConfig: o
|
|
6333
6338
|
});
|
|
6334
6339
|
q = [...P.attributes.filter(
|
|
6335
|
-
(M) => !z.some((
|
|
6340
|
+
(M) => !z.some((F) => F.name === M.name)
|
|
6336
6341
|
), ...z];
|
|
6337
6342
|
}
|
|
6338
|
-
const
|
|
6343
|
+
const V = {
|
|
6339
6344
|
...P,
|
|
6340
6345
|
attributes: q,
|
|
6341
6346
|
value: y !== void 0 ? y : P.value
|
|
@@ -6344,10 +6349,10 @@ function Ji(l) {
|
|
|
6344
6349
|
context: R,
|
|
6345
6350
|
status: "updated",
|
|
6346
6351
|
oldRecord: P,
|
|
6347
|
-
newRecord:
|
|
6352
|
+
newRecord: V
|
|
6348
6353
|
}), {
|
|
6349
6354
|
...R,
|
|
6350
|
-
currentFocus: Pe({ record:
|
|
6355
|
+
currentFocus: Pe({ record: V, status: "updated" })
|
|
6351
6356
|
};
|
|
6352
6357
|
});
|
|
6353
6358
|
return c({ contextPromise: b });
|
|
@@ -6430,18 +6435,18 @@ async function ts(l) {
|
|
|
6430
6435
|
function ns(l) {
|
|
6431
6436
|
const { chain: c, contextPromise: u, dialecteConfig: o, databaseInstance: h } = l;
|
|
6432
6437
|
return function(y) {
|
|
6433
|
-
const { tagName: b, id: R } = y, P = o.database.tables.xmlElements.name, q = u.then(async (
|
|
6438
|
+
const { tagName: b, id: R } = y, P = o.database.tables.xmlElements.name, q = u.then(async (V) => {
|
|
6434
6439
|
const z = o.singletonElements?.includes(b), H = R ? yr({
|
|
6435
|
-
stagedOperations:
|
|
6440
|
+
stagedOperations: V.stagedOperations,
|
|
6436
6441
|
id: R,
|
|
6437
6442
|
tagName: b
|
|
6438
6443
|
}) : null;
|
|
6439
6444
|
let M = H?.status !== "deleted" ? H?.record : void 0;
|
|
6440
6445
|
if (!M) {
|
|
6441
|
-
const
|
|
6446
|
+
const F = h.table(P);
|
|
6442
6447
|
if (!R && !z)
|
|
6443
6448
|
throw new Error(`Element ${b} requires an id parameter`);
|
|
6444
|
-
M = await (z && !R ?
|
|
6449
|
+
M = await (z && !R ? F.where("tagName").equals(b).first() : F.get({ id: R, tagName: b }));
|
|
6445
6450
|
}
|
|
6446
6451
|
return Ee(
|
|
6447
6452
|
M,
|
|
@@ -6450,7 +6455,7 @@ function ns(l) {
|
|
|
6450
6455
|
M.tagName === b,
|
|
6451
6456
|
`Element tagName mismatch: expected "${b}", got "${M.tagName}"`
|
|
6452
6457
|
), {
|
|
6453
|
-
...
|
|
6458
|
+
...V,
|
|
6454
6459
|
currentFocus: Pe({ record: M })
|
|
6455
6460
|
};
|
|
6456
6461
|
});
|
|
@@ -6474,7 +6479,7 @@ function rs(l) {
|
|
|
6474
6479
|
if (P)
|
|
6475
6480
|
q = P.record;
|
|
6476
6481
|
else {
|
|
6477
|
-
const
|
|
6482
|
+
const V = o.database.tables.xmlElements.name, z = await h.table(V).get({
|
|
6478
6483
|
id: R.id,
|
|
6479
6484
|
tagName: R.tagName
|
|
6480
6485
|
});
|
|
@@ -6526,7 +6531,8 @@ function as(l) {
|
|
|
6526
6531
|
}),
|
|
6527
6532
|
deepCloneChild: Zi({
|
|
6528
6533
|
chain: c,
|
|
6529
|
-
contextPromise: u
|
|
6534
|
+
contextPromise: u,
|
|
6535
|
+
dialecteConfig: o
|
|
6530
6536
|
}),
|
|
6531
6537
|
update: Ji({
|
|
6532
6538
|
chain: c,
|
|
@@ -6622,7 +6628,7 @@ export {
|
|
|
6622
6628
|
ci as getDatabaseName,
|
|
6623
6629
|
yr as getLatestStagedRecord,
|
|
6624
6630
|
Ye as getRecord,
|
|
6625
|
-
|
|
6631
|
+
ko as getState,
|
|
6626
6632
|
si as importXmlFiles,
|
|
6627
6633
|
ss as isChainRecord,
|
|
6628
6634
|
ui as isFileSupported,
|