@dialecte/core 0.0.6 → 0.0.8
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/ending/queries/get-attributes-values.d.ts +5 -0
- package/dist/chain-methods/ending/queries/get-attributes-values.d.ts.map +1 -0
- package/dist/chain-methods/ending/queries/index.d.ts +1 -0
- package/dist/chain-methods/ending/queries/index.d.ts.map +1 -1
- package/dist/chain-methods/mutations/update.d.ts +1 -1
- package/dist/chain-methods/mutations/update.d.ts.map +1 -1
- package/dist/chain-methods/types.d.ts +2 -1
- package/dist/chain-methods/types.d.ts.map +1 -1
- package/dist/helpers/record/converter.d.ts +1 -1
- package/dist/helpers/record/converter.d.ts.map +1 -1
- package/dist/index.js +461 -451
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28,13 +28,13 @@ function pr(l, c) {
|
|
|
28
28
|
function no(l) {
|
|
29
29
|
return Array.isArray(l);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function is(l) {
|
|
32
32
|
return pr(l, sa);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function ss(l) {
|
|
35
35
|
return pr(l, ua);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function us(l) {
|
|
38
38
|
return pr(l, to);
|
|
39
39
|
}
|
|
40
40
|
function xn(l) {
|
|
@@ -96,20 +96,20 @@ function la(l) {
|
|
|
96
96
|
}
|
|
97
97
|
];
|
|
98
98
|
});
|
|
99
|
-
let
|
|
99
|
+
let k = {
|
|
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 && (k = u.hooks.afterStandardizedRecord({
|
|
105
|
+
record: k
|
|
106
|
+
})), k;
|
|
107
107
|
}
|
|
108
108
|
function ro(l) {
|
|
109
109
|
const { attributes: c, name: u } = l;
|
|
110
110
|
return c.find((m) => m.name === u)?.value || "";
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function ao(l) {
|
|
113
113
|
const { attributes: c } = l;
|
|
114
114
|
return c.reduce(
|
|
115
115
|
(u, o) => {
|
|
@@ -121,7 +121,7 @@ function ss(l) {
|
|
|
121
121
|
}
|
|
122
122
|
async function fa(l) {
|
|
123
123
|
const { context: c, dialecteConfig: u, databaseInstance: o, tagName: h, attributes: m } = l;
|
|
124
|
-
return (await
|
|
124
|
+
return (await oo({
|
|
125
125
|
tagName: h,
|
|
126
126
|
stagedOperations: c.stagedOperations,
|
|
127
127
|
dialecteConfig: u,
|
|
@@ -163,7 +163,7 @@ async function Ye(l) {
|
|
|
163
163
|
if (P)
|
|
164
164
|
return Ee(P.tagName === u, "Element tagName mismatch"), y === "raw" ? P : Pe({ record: P });
|
|
165
165
|
}
|
|
166
|
-
async function
|
|
166
|
+
async function oo(l) {
|
|
167
167
|
const { stagedOperations: c, tagName: u, dialecteConfig: o, databaseInstance: h, type: m = "raw" } = l, y = o.database.tables.xmlElements.name, b = await h.table(y).where({ tagName: u }).toArray(), R = new Map(
|
|
168
168
|
b.map((P) => [P.id, m === "raw" ? P : Pe({ record: P })])
|
|
169
169
|
);
|
|
@@ -209,7 +209,7 @@ const qe = {
|
|
|
209
209
|
uri: "http://dialecte.dev/XML/DEV-EXT",
|
|
210
210
|
prefix: "ext"
|
|
211
211
|
}
|
|
212
|
-
},
|
|
212
|
+
}, cs = `xmlns="${qe.default.uri}"`, ls = `xmlns:${qe.dev.prefix}="${qe.dev.uri}"`, fs = `xmlns:${qe.ext.prefix}="${qe.ext.uri}"`, io = "db-id", da = `${qe.dev.prefix}:${io}`, so = [
|
|
213
213
|
"A",
|
|
214
214
|
"AAAA_1",
|
|
215
215
|
"AAAA_2",
|
|
@@ -241,7 +241,7 @@ const qe = {
|
|
|
241
241
|
"CC_2",
|
|
242
242
|
"CC_3",
|
|
243
243
|
"Root"
|
|
244
|
-
],
|
|
244
|
+
], uo = {
|
|
245
245
|
A: { aA: "", bA: "", cA: "" },
|
|
246
246
|
AAAA_1: {
|
|
247
247
|
aAAAA_1: "",
|
|
@@ -345,7 +345,7 @@ const qe = {
|
|
|
345
345
|
CC_2: { aCC_2: "", bCC_2: "", cCC_2: "" },
|
|
346
346
|
CC_3: { aCC_3: "", bCC_3: "", cCC_3: "" },
|
|
347
347
|
Root: {}
|
|
348
|
-
},
|
|
348
|
+
}, co = {
|
|
349
349
|
A: ["AA_1", "AA_2", "AA_3"],
|
|
350
350
|
AAAA_1: [],
|
|
351
351
|
AAAA_2: [],
|
|
@@ -377,7 +377,7 @@ const qe = {
|
|
|
377
377
|
CC_2: ["CCC_1", "CCC_2", "CCC_3"],
|
|
378
378
|
CC_3: ["CCC_1", "CCC_2", "CCC_3"],
|
|
379
379
|
Root: ["A", "B", "C"]
|
|
380
|
-
},
|
|
380
|
+
}, lo = {
|
|
381
381
|
A: ["Root"],
|
|
382
382
|
AAAA_1: ["AAA_1"],
|
|
383
383
|
AAAA_2: ["AAA_2"],
|
|
@@ -409,7 +409,7 @@ const qe = {
|
|
|
409
409
|
CC_2: ["C"],
|
|
410
410
|
CC_3: ["C"],
|
|
411
411
|
Root: []
|
|
412
|
-
},
|
|
412
|
+
}, fo = {
|
|
413
413
|
A: ["AAAA_1", "AAAA_2", "AAAA_3", "AAA_1", "AAA_2", "AAA_3", "AA_1", "AA_2", "AA_3"],
|
|
414
414
|
AAAA_1: [],
|
|
415
415
|
AAAA_2: [],
|
|
@@ -472,7 +472,7 @@ const qe = {
|
|
|
472
472
|
"CC_2",
|
|
473
473
|
"CC_3"
|
|
474
474
|
]
|
|
475
|
-
},
|
|
475
|
+
}, ho = {
|
|
476
476
|
A: ["Root"],
|
|
477
477
|
AAAA_1: ["A", "AAA_1", "AA_1", "Root"],
|
|
478
478
|
AAAA_2: ["A", "AAA_2", "AA_2", "Root"],
|
|
@@ -518,13 +518,13 @@ const qe = {
|
|
|
518
518
|
maxOccurrence: null,
|
|
519
519
|
assertions: null
|
|
520
520
|
};
|
|
521
|
-
function
|
|
521
|
+
function mo(l) {
|
|
522
522
|
return {
|
|
523
523
|
required: [`a${l}`],
|
|
524
524
|
optional: [`b${l}`, `c${l}`]
|
|
525
525
|
};
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function po() {
|
|
528
528
|
const l = ["A", "B", "C"], u = {};
|
|
529
529
|
u.Root = {
|
|
530
530
|
tag: "Root",
|
|
@@ -559,13 +559,13 @@ function mo() {
|
|
|
559
559
|
}
|
|
560
560
|
};
|
|
561
561
|
for (const o of l)
|
|
562
|
-
|
|
562
|
+
go(o, 3, u);
|
|
563
563
|
return u;
|
|
564
564
|
}
|
|
565
|
-
function
|
|
566
|
-
const o =
|
|
565
|
+
function go(l, c, u) {
|
|
566
|
+
const o = yo(l, c);
|
|
567
567
|
for (const h of o) {
|
|
568
|
-
const m = ha(h), y =
|
|
568
|
+
const m = ha(h), y = vo(h), b = _o(h, c), P = h.endsWith("_3") ? qe.ext : qe.default, q = mo(h), G = [...q.required, ...q.optional], z = Zr(h), M = {
|
|
569
569
|
...Ct,
|
|
570
570
|
minOccurrence: z === 1 ? 1 : null,
|
|
571
571
|
maxOccurrence: z
|
|
@@ -585,10 +585,10 @@ function po(l, c, u) {
|
|
|
585
585
|
any: !1,
|
|
586
586
|
sequence: G,
|
|
587
587
|
details: Object.fromEntries(
|
|
588
|
-
G.map((
|
|
589
|
-
const J = q.required.includes(
|
|
588
|
+
G.map((k) => {
|
|
589
|
+
const J = q.required.includes(k), ye = k.startsWith("c") ? qe.ext : P;
|
|
590
590
|
return [
|
|
591
|
-
|
|
591
|
+
k,
|
|
592
592
|
{
|
|
593
593
|
namespace: ye,
|
|
594
594
|
required: J,
|
|
@@ -603,10 +603,10 @@ function po(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((k) => {
|
|
607
|
+
const J = Zr(k), ie = J === 1;
|
|
608
608
|
return [
|
|
609
|
-
|
|
609
|
+
k,
|
|
610
610
|
{
|
|
611
611
|
required: ie,
|
|
612
612
|
validation: {
|
|
@@ -624,7 +624,7 @@ function po(l, c, u) {
|
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function yo(l, c) {
|
|
628
628
|
const u = [l];
|
|
629
629
|
let o = [l];
|
|
630
630
|
for (let h = 1; h <= c; h++) {
|
|
@@ -640,14 +640,14 @@ function go(l, c) {
|
|
|
640
640
|
}
|
|
641
641
|
return u;
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function vo(l) {
|
|
644
644
|
if (l.length === 1) return null;
|
|
645
645
|
const c = l.match(/^([A-Z]+)_(\d+)$/);
|
|
646
646
|
if (!c) return null;
|
|
647
647
|
const [, u, o] = c;
|
|
648
648
|
return u.length === 2 ? u.charAt(0) : `${u.slice(0, -1)}_${o}`;
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function _o(l, c) {
|
|
651
651
|
if (ha(l) > c) return [];
|
|
652
652
|
const o = l.match(/^([A-Z]+)(?:_(\d+))?$/);
|
|
653
653
|
if (!o) return [];
|
|
@@ -661,9 +661,9 @@ function Zr(l) {
|
|
|
661
661
|
const c = l.match(/_(\d+)$/);
|
|
662
662
|
return c ? parseInt(c[1], 10) : 1;
|
|
663
663
|
}
|
|
664
|
-
const
|
|
664
|
+
const bo = po(), Co = {
|
|
665
665
|
supportedFileExtensions: [".xml"]
|
|
666
|
-
},
|
|
666
|
+
}, Ao = {
|
|
667
667
|
tables: {
|
|
668
668
|
xmlElements: {
|
|
669
669
|
name: "xmlElements",
|
|
@@ -673,20 +673,20 @@ const _o = mo(), bo = {
|
|
|
673
673
|
}, ma = {
|
|
674
674
|
rootElementName: "Root",
|
|
675
675
|
singletonElements: ["Root", "A", "B", "C", "D"],
|
|
676
|
-
elements:
|
|
676
|
+
elements: so,
|
|
677
677
|
namespaces: qe,
|
|
678
|
-
attributes:
|
|
679
|
-
children:
|
|
680
|
-
parents:
|
|
681
|
-
descendants:
|
|
682
|
-
ancestors:
|
|
683
|
-
database:
|
|
684
|
-
io:
|
|
685
|
-
definition:
|
|
678
|
+
attributes: uo,
|
|
679
|
+
children: co,
|
|
680
|
+
parents: lo,
|
|
681
|
+
descendants: fo,
|
|
682
|
+
ancestors: ho,
|
|
683
|
+
database: Ao,
|
|
684
|
+
io: Co,
|
|
685
|
+
definition: bo,
|
|
686
686
|
hooks: {},
|
|
687
687
|
extensions: {}
|
|
688
688
|
};
|
|
689
|
-
function
|
|
689
|
+
function ds(l) {
|
|
690
690
|
const { record: c, type: u = "raw" } = l, o = la({
|
|
691
691
|
record: c,
|
|
692
692
|
dialecteConfig: ma
|
|
@@ -702,11 +702,11 @@ function fs(l) {
|
|
|
702
702
|
throw new Error(`Unsupported record type: ${u}`);
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
|
-
var
|
|
705
|
+
var wo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
706
706
|
function pa(l) {
|
|
707
707
|
return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function Bo(l) {
|
|
710
710
|
if (Object.prototype.hasOwnProperty.call(l, "__esModule")) return l;
|
|
711
711
|
var c = l.default;
|
|
712
712
|
if (typeof c == "function") {
|
|
@@ -730,12 +730,12 @@ function wo(l) {
|
|
|
730
730
|
});
|
|
731
731
|
}), u;
|
|
732
732
|
}
|
|
733
|
-
var Tn = { exports: {} },
|
|
734
|
-
function
|
|
733
|
+
var Tn = { exports: {} }, Eo = Tn.exports, Jr;
|
|
734
|
+
function xo() {
|
|
735
735
|
return Jr || (Jr = 1, (function(l, c) {
|
|
736
736
|
(function(u, o) {
|
|
737
737
|
l.exports = o();
|
|
738
|
-
})(
|
|
738
|
+
})(Eo, function() {
|
|
739
739
|
var u = function(e, t) {
|
|
740
740
|
return (u = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
741
741
|
n.__proto__ = r;
|
|
@@ -752,7 +752,7 @@ function Eo() {
|
|
|
752
752
|
for (var r, a = 0, i = t.length; a < i; a++) !r && a in t || ((r = r || Array.prototype.slice.call(t, 0, a))[a] = t[a]);
|
|
753
753
|
return e.concat(r || Array.prototype.slice.call(t));
|
|
754
754
|
}
|
|
755
|
-
var m = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window :
|
|
755
|
+
var m = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : wo, y = Object.keys, b = Array.isArray;
|
|
756
756
|
function R(e, t) {
|
|
757
757
|
return typeof t != "object" || y(t).forEach(function(n) {
|
|
758
758
|
e[n] = t[n];
|
|
@@ -772,7 +772,7 @@ function Eo() {
|
|
|
772
772
|
function M(e, t, n, r) {
|
|
773
773
|
H(e, t, R(n && G(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 k(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
|
} };
|
|
@@ -863,7 +863,7 @@ function Eo() {
|
|
|
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 Fe(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 Eo() {
|
|
|
904
904
|
return t[n];
|
|
905
905
|
}), this.failuresByPos = t, this.message = St(e, this.failures);
|
|
906
906
|
}
|
|
907
|
-
|
|
907
|
+
k(Qe).from(Error).extend({ toString: function() {
|
|
908
908
|
return this.name + ": " + this.message;
|
|
909
|
-
} }),
|
|
909
|
+
} }), k(He).from(Qe), k(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 Eo() {
|
|
|
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 k(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 Eo() {
|
|
|
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 Ft(e) {
|
|
986
986
|
De = e;
|
|
987
987
|
}
|
|
988
|
-
var
|
|
988
|
+
var kt = {}, _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 Eo() {
|
|
|
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 !== kt) throw new TypeError("Not a function");
|
|
1002
|
+
return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && kn(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 Eo() {
|
|
|
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
|
+
}, kn.bind(null, r));
|
|
1015
1015
|
} catch (i) {
|
|
1016
|
-
|
|
1016
|
+
kn(r, i);
|
|
1017
1017
|
}
|
|
1018
1018
|
})(this, e);
|
|
1019
1019
|
}
|
|
1020
|
-
var
|
|
1020
|
+
var Fn = { 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 Eo() {
|
|
|
1025
1025
|
});
|
|
1026
1026
|
return this._consoleTask && (v._consoleTask = this._consoleTask), v;
|
|
1027
1027
|
}
|
|
1028
|
-
return n.prototype =
|
|
1028
|
+
return n.prototype = kt, n;
|
|
1029
1029
|
}, set: function(e) {
|
|
1030
|
-
M(this, "then", e && e.prototype ===
|
|
1030
|
+
M(this, "then", e && e.prototype === kt ? Fn : { get: function() {
|
|
1031
1031
|
return e;
|
|
1032
|
-
}, set:
|
|
1032
|
+
}, set: Fn.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 kn(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 Eo() {
|
|
|
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(kt, !1, e);
|
|
1101
1101
|
}
|
|
1102
1102
|
function ge(e, t) {
|
|
1103
1103
|
var n = Q;
|
|
@@ -1112,7 +1112,7 @@ function Eo() {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
};
|
|
1114
1114
|
}
|
|
1115
|
-
z(X.prototype, { then:
|
|
1115
|
+
z(X.prototype, { then: Fn, _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 Eo() {
|
|
|
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 = Fe.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 Eo() {
|
|
|
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(kt, !0, e);
|
|
1158
1158
|
}, reject: tn, race: function() {
|
|
1159
|
-
var e =
|
|
1159
|
+
var e = Fe.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 Eo() {
|
|
|
1193
1193
|
}, t, n, r);
|
|
1194
1194
|
});
|
|
1195
1195
|
} }), dt && (dt.allSettled && M(X, "allSettled", function() {
|
|
1196
|
-
var e =
|
|
1196
|
+
var e = Fe.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 Eo() {
|
|
|
1208
1208
|
});
|
|
1209
1209
|
});
|
|
1210
1210
|
}), dt.any && typeof AggregateError < "u" && M(X, "any", function() {
|
|
1211
|
-
var e =
|
|
1211
|
+
var e = Fe.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);
|
|
@@ -1655,7 +1655,7 @@ function Eo() {
|
|
|
1655
1655
|
}
|
|
1656
1656
|
}
|
|
1657
1657
|
function Lt(e, t) {
|
|
1658
|
-
return
|
|
1658
|
+
return k(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);
|
|
@@ -1913,16 +1913,16 @@ function Eo() {
|
|
|
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 ? (ae(N,
|
|
1916
|
+
var F = a[S], j = e[F], U = pe(N, F);
|
|
1917
|
+
j instanceof Ut ? (ae(N, F, j.execute(U)), D = !0) : U !== j && (ae(N, F, 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, F) {
|
|
1924
|
+
var S = F.failures, F = F.numFailures;
|
|
1925
|
+
A += N - F;
|
|
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 Eo() {
|
|
|
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(F) {
|
|
1934
|
+
var j = Math.min(w, N.length - F), U = N.slice(F, F + j);
|
|
1935
1935
|
return (E ? Promise.resolve([]) : p.getMany({ trans: r, keys: U, cache: "immutable" })).then(function(K) {
|
|
1936
1936
|
var L = [], V = [], $ = v ? [] : null, W = E ? U : [];
|
|
1937
1937
|
if (!E) for (var re = 0; re < j; ++re) {
|
|
1938
|
-
var ce = K[re], ne = { value: Se(ce), primKey: N[
|
|
1939
|
-
d.call(ne, ne.value, ne) !== !1 && (ne.value == null ? W.push(N[
|
|
1938
|
+
var ce = K[re], ne = { value: Se(ce), primKey: N[F + re] };
|
|
1939
|
+
d.call(ne, ne.value, ne) !== !1 && (ne.value == null ? W.push(N[F + re]) : v || se(C(ce), C(ne.value)) === 0 ? (V.push(ne.value), v && $.push(N[F + re])) : (W.push(N[F + re]), 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
1942
|
for (var ee in _e.failures) W.splice(parseInt(ee), 1);
|
|
1943
1943
|
T(L.length, _e);
|
|
1944
1944
|
})).then(function() {
|
|
1945
|
-
return (0 < V.length || S && typeof e == "object") && p.mutate({ trans: r, type: "put", keys: $, values: V, criteria: S, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 <
|
|
1945
|
+
return (0 < V.length || S && typeof e == "object") && p.mutate({ trans: r, type: "put", keys: $, values: V, criteria: S, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < F }).then(function(_e) {
|
|
1946
1946
|
return T(V.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 < F }).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 > F + j && D(F + w);
|
|
1956
1956
|
});
|
|
1957
1957
|
});
|
|
1958
1958
|
}
|
|
@@ -1983,14 +1983,14 @@ function Eo() {
|
|
|
1983
1983
|
var Pr = function(e, t) {
|
|
1984
1984
|
return t.value = null;
|
|
1985
1985
|
};
|
|
1986
|
-
function
|
|
1986
|
+
function Fa(e, t) {
|
|
1987
1987
|
return e < t ? -1 : e === t ? 0 : 1;
|
|
1988
1988
|
}
|
|
1989
|
-
function
|
|
1989
|
+
function ka(e, t) {
|
|
1990
1990
|
return t < e ? -1 : e === t ? 0 : 1;
|
|
1991
1991
|
}
|
|
1992
|
-
function
|
|
1993
|
-
return e = e instanceof
|
|
1992
|
+
function ke(e, t, n) {
|
|
1993
|
+
return e = e instanceof Fr ? 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 Eo() {
|
|
|
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 ke(e, Br);
|
|
2005
2005
|
function T(A) {
|
|
2006
2006
|
a = A === "next" ? function(E) {
|
|
2007
2007
|
return E.toUpperCase();
|
|
@@ -2011,7 +2011,7 @@ function Eo() {
|
|
|
2011
2011
|
return E.toLowerCase();
|
|
2012
2012
|
} : function(E) {
|
|
2013
2013
|
return E.toUpperCase();
|
|
2014
|
-
}, d = A === "next" ?
|
|
2014
|
+
}, d = A === "next" ? Fa : ka;
|
|
2015
2015
|
var x = n.map(function(E) {
|
|
2016
2016
|
return { lower: i(E), upper: a(E) };
|
|
2017
2017
|
}).sort(function(E, N) {
|
|
@@ -2034,7 +2034,7 @@ function Eo() {
|
|
|
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,
|
|
2037
|
+
for (var S = null, F = _; F < g; ++F) {
|
|
2038
2038
|
var j = (function(U, K, L, V, $, W) {
|
|
2039
2039
|
for (var re = Math.min(U.length, V.length), ce = -1, ne = 0; ne < re; ++ne) {
|
|
2040
2040
|
var _e = K[ne];
|
|
@@ -2042,8 +2042,8 @@ function Eo() {
|
|
|
2042
2042
|
$(U[ne], _e) < 0 && (ce = ne);
|
|
2043
2043
|
}
|
|
2044
2044
|
return re < V.length && W === "next" ? U + L.substr(U.length) : re < U.length && W === "prev" ? U.substr(0, L.length) : ce < 0 ? null : U.substr(0, ce) + V[ce] + L.substr(ce + 1);
|
|
2045
|
-
})(N, D, p[
|
|
2046
|
-
j === null && S === null ? _ =
|
|
2045
|
+
})(N, D, p[F], v[F], d, C);
|
|
2046
|
+
j === null && S === null ? _ = F + 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 Eo() {
|
|
|
2056
2056
|
function Sr(e) {
|
|
2057
2057
|
return { type: 1, lower: e, upper: e };
|
|
2058
2058
|
}
|
|
2059
|
-
var
|
|
2059
|
+
var Fr = (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 Eo() {
|
|
|
2065
2065
|
return at(e, t, !n, !r);
|
|
2066
2066
|
});
|
|
2067
2067
|
} catch {
|
|
2068
|
-
return
|
|
2068
|
+
return ke(this, Xe);
|
|
2069
2069
|
}
|
|
2070
2070
|
}, Be.prototype.equals = function(e) {
|
|
2071
|
-
return e == null ?
|
|
2071
|
+
return e == null ? ke(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 ? ke(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 ? ke(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 ? ke(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 ? ke(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" ? ke(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 Eo() {
|
|
|
2098
2098
|
return t === n[0];
|
|
2099
2099
|
}, [e], "");
|
|
2100
2100
|
}, Be.prototype.anyOfIgnoreCase = function() {
|
|
2101
|
-
var e =
|
|
2101
|
+
var e = Fe.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 = Fe.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 = Fe.apply(Le, arguments), n = this._cmp;
|
|
2114
2114
|
try {
|
|
2115
2115
|
t.sort(n);
|
|
2116
2116
|
} catch {
|
|
2117
|
-
return
|
|
2117
|
+
return ke(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 Eo() {
|
|
|
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 = Fe.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 ke(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 Eo() {
|
|
|
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 ke(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 F = 0, j = D.length; F < j; ++F) {
|
|
2160
|
+
var U = D[F];
|
|
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 F === j && D.push(S), D;
|
|
2167
2167
|
}, [])).sort(T);
|
|
2168
2168
|
} catch {
|
|
2169
|
-
return
|
|
2169
|
+
return ke(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 Eo() {
|
|
|
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, F) {
|
|
2185
|
+
for (var j, U = D.key; E(U); ) if (++_ === w.length) return S(F), !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 = Fe.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
|
+
})) : ke(this, "startsWithAnyOf() only works with strings");
|
|
2197
2197
|
}, Be);
|
|
2198
2198
|
function Be() {
|
|
2199
2199
|
}
|
|
@@ -2294,9 +2294,9 @@ function Eo() {
|
|
|
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 ? "++" : "") + kr(t), type: p };
|
|
2298
2298
|
}
|
|
2299
|
-
function
|
|
2299
|
+
function kr(e) {
|
|
2300
2300
|
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
2301
2301
|
}
|
|
2302
2302
|
function Xn(e, t, n) {
|
|
@@ -2346,7 +2346,7 @@ function Eo() {
|
|
|
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, F = x.range;
|
|
2350
2350
|
return new Promise(function(j, U) {
|
|
2351
2351
|
j = ge(j);
|
|
2352
2352
|
var K = E.objectStore(A), L = K.keyPath == null, V = N === "put" || N === "add";
|
|
@@ -2359,8 +2359,8 @@ function Eo() {
|
|
|
2359
2359
|
}
|
|
2360
2360
|
var ce = [], ne = [], _e = 0;
|
|
2361
2361
|
if (N === "deleteRange") {
|
|
2362
|
-
if (
|
|
2363
|
-
|
|
2362
|
+
if (F.type === 4) return j({ numFailures: _e, failures: ne, results: [], lastResult: void 0 });
|
|
2363
|
+
F.type === 3 ? ce.push($ = K.clear()) : ce.push($ = K.delete(r(F)));
|
|
2364
2364
|
} else {
|
|
2365
2365
|
var L = V ? L ? [S, D] : [S, null] : [D, null], ee = L[0], Ne = L[1];
|
|
2366
2366
|
if (V) for (var Oe = 0; Oe < W; ++Oe) ce.push($ = Ne && Ne[Oe] !== void 0 ? K[N](ee[Oe], Ne[Oe]) : K[N](ee[Oe])), $.onerror = re;
|
|
@@ -2381,37 +2381,37 @@ function Eo() {
|
|
|
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
|
|
2384
|
+
for (var F, j = E.objectStore(A), U = N.length, K = new Array(U), L = 0, V = 0, $ = function(ce) {
|
|
2385
2385
|
ce = ce.target, K[ce._pos] = ce.result, ++V === L && D(K);
|
|
2386
|
-
}, W = Ue(S), re = 0; re < U; ++re) N[re] != null && ((
|
|
2386
|
+
}, W = Ue(S), re = 0; re < U; ++re) N[re] != null && ((F = j.get(N[re]))._pos = re, F.onsuccess = $, F.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 F = E.objectStore(A).get(N);
|
|
2394
|
+
F.onsuccess = function(j) {
|
|
2395
2395
|
return D(j.target.result);
|
|
2396
|
-
},
|
|
2396
|
+
}, F.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, F, L = x.trans, j = x.values, U = x.limit, $ = x.query, K = U === 1 / 0 ? void 0 : U, V = $.index, $ = $.range, L = L.objectStore(A), V = V.isPrimaryKey ? L : L.index(V.name), $ = r($);
|
|
2402
2402
|
if (U === 0) return E({ result: [] });
|
|
2403
2403
|
_ ? ((K = j ? V.getAll($, K) : V.getAllKeys($, K)).onsuccess = function(W) {
|
|
2404
2404
|
return E({ result: W.target.result });
|
|
2405
|
-
}, K.onerror = Ue(N)) : (D = 0, S = !j && "openKeyCursor" in V ? V.openKeyCursor($) : V.openCursor($),
|
|
2405
|
+
}, K.onerror = Ue(N)) : (D = 0, S = !j && "openKeyCursor" in V ? V.openKeyCursor($) : V.openCursor($), F = [], S.onsuccess = function(W) {
|
|
2406
2406
|
var re = S.result;
|
|
2407
|
-
return re ? (
|
|
2407
|
+
return re ? (F.push(j ? re.value : re.primaryKey), ++D === U ? E({ result: F }) : void re.continue()) : E({ result: F });
|
|
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, F = x.unique;
|
|
2412
2412
|
return new Promise(function(j, U) {
|
|
2413
2413
|
j = ge(j);
|
|
2414
|
-
var V = D.index, K = D.range, L = E.objectStore(A), L = V.isPrimaryKey ? L : L.index(V.name), V = S ?
|
|
2414
|
+
var V = D.index, K = D.range, L = E.objectStore(A), L = V.isPrimaryKey ? L : L.index(V.name), V = S ? F ? "prevunique" : "prev" : F ? "nextunique" : "next", $ = !N && "openKeyCursor" in L ? L.openKeyCursor(r(K), V) : L.openCursor(r(K), V);
|
|
2415
2415
|
$.onerror = Ue(U), $.onsuccess = ge(function(W) {
|
|
2416
2416
|
var re, ce, ne, _e, ee = $.result;
|
|
2417
2417
|
ee ? (ee.___id = ++ja, ee.done = !1, re = ee.continue.bind(ee), ce = (ce = ee.continuePrimaryKey) && ce.bind(ee), ne = ee.advance.bind(ee), _e = function() {
|
|
@@ -2449,10 +2449,10 @@ function Eo() {
|
|
|
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(F, 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 F(L.target.result);
|
|
2456
2456
|
}), K.onerror = Ue(j);
|
|
2457
2457
|
});
|
|
2458
2458
|
} };
|
|
@@ -2462,9 +2462,9 @@ function Eo() {
|
|
|
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(F) {
|
|
2466
|
+
var D = F.name, S = F.unique, j = F.multiEntry, F = F.keyPath, j = { name: D, compound: b(F), keyPath: F, unique: S, multiEntry: j, extractKey: Wn(F) };
|
|
2467
|
+
return x[Xt(F)] = j;
|
|
2468
2468
|
}), getIndexByKeyPath: function(N) {
|
|
2469
2469
|
return x[Xt(N)];
|
|
2470
2470
|
} };
|
|
@@ -2531,10 +2531,10 @@ function Eo() {
|
|
|
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
|
-
|
|
2534
|
+
var F = zn(D, S);
|
|
2535
|
+
F.add.forEach(function(V) {
|
|
2536
2536
|
Qn(A, V[0], V[1].primKey, V[1].indexes);
|
|
2537
|
-
}),
|
|
2537
|
+
}), F.change.forEach(function(V) {
|
|
2538
2538
|
if (V.recreate) throw new O.Upgrade("Not yet support for changing primary key");
|
|
2539
2539
|
var $ = A.objectStore(V.name);
|
|
2540
2540
|
V.add.forEach(function(W) {
|
|
@@ -2549,21 +2549,21 @@ function Eo() {
|
|
|
2549
2549
|
if (j && N._cfg.version > T) {
|
|
2550
2550
|
hn(g, A), _._memoizedTables = {};
|
|
2551
2551
|
var U = Re(S);
|
|
2552
|
-
|
|
2552
|
+
F.del.forEach(function(V) {
|
|
2553
2553
|
U[V] = D[V];
|
|
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(),
|
|
2556
|
+
return L && xt(), F = X.follow(function() {
|
|
2557
2557
|
var V;
|
|
2558
2558
|
(K = j(_)) && L && (V = nt.bind(null, null), K.then(V, V));
|
|
2559
|
-
}), K && typeof K.then == "function" ? X.resolve(K) :
|
|
2559
|
+
}), K && typeof K.then == "function" ? X.resolve(K) : F.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, F, j = N._cfg.dbschema;
|
|
2565
|
+
S = j, F = D, [].slice.call(F.db.objectStoreNames).forEach(function(U) {
|
|
2566
|
+
return S[U] == null && F.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 Eo() {
|
|
|
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(kr(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
|
}
|
|
@@ -2846,11 +2846,11 @@ function Eo() {
|
|
|
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, F, 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), ((F = zn(gn(0, (F = e).idbdb, K), F._dbSchema)).add.length || F.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 Eo() {
|
|
|
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 && (F = e._deps, K = A, j = F.indexedDB, F = F.IDBKeyRange, Zn(j) || K === sn || Hn(j, F).put({ name: K }).catch(Z)), T();
|
|
2864
2864
|
}, _);
|
|
2865
2865
|
}).catch(function(T) {
|
|
2866
2866
|
switch (T?.name) {
|
|
@@ -3027,21 +3027,21 @@ function Eo() {
|
|
|
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(V, S, L, x) : g.type === "add" || L === void 0 ? (j = v.fire.call(V, S, g.values[
|
|
3030
|
+
var D = E.map(function(S, F) {
|
|
3031
|
+
var j, U, K, L = N[F], V = { onerror: null, onsuccess: null };
|
|
3032
|
+
return g.type === "delete" ? p.fire.call(V, S, L, x) : g.type === "add" || L === void 0 ? (j = v.fire.call(V, S, g.values[F], x), S == null && j != null && (g.keys[F] = S = j, r.outbound || ae(g.values[F], r.keyPath, S))) : (j = ir(L, g.values[F]), (U = C.fire.call(V, j, S, L, x)) && (K = g.values[F], Object.keys(U).forEach(function($) {
|
|
3033
3033
|
G(K, $) ? K[$] = U[$] : ae(K, $, U[$]);
|
|
3034
3034
|
}))), V;
|
|
3035
3035
|
});
|
|
3036
3036
|
return n.mutate(g).then(function(S) {
|
|
3037
|
-
for (var
|
|
3037
|
+
for (var F = S.failures, j = S.results, U = S.numFailures, S = S.lastResult, K = 0; K < E.length; ++K) {
|
|
3038
3038
|
var L = (j || E)[K], V = D[K];
|
|
3039
|
-
L == null ? V.onerror && V.onerror(
|
|
3039
|
+
L == null ? V.onerror && V.onerror(F[K]) : V.onsuccess && V.onsuccess(g.type === "put" && N[K] ? g.values[K] : L);
|
|
3040
3040
|
}
|
|
3041
|
-
return { failures:
|
|
3041
|
+
return { failures: F, results: j, numFailures: U, lastResult: S };
|
|
3042
3042
|
}).catch(function(S) {
|
|
3043
|
-
return D.forEach(function(
|
|
3044
|
-
return
|
|
3043
|
+
return D.forEach(function(F) {
|
|
3044
|
+
return F.onerror && F.onerror(S);
|
|
3045
3045
|
}), Promise.reject(S);
|
|
3046
3046
|
});
|
|
3047
3047
|
});
|
|
@@ -3098,10 +3098,10 @@ function Eo() {
|
|
|
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 = {}), F = A(""), j = A(":dels"), U = _.type, V = _.type === "deleteRange" ? [_.range] : _.type === "delete" ? [_.keys] : _.values.length < 50 ? [sr(d, _).filter(function($) {
|
|
3102
3102
|
return $;
|
|
3103
3103
|
}), _.values] : [], K = V[0], L = V[1], V = _.trans._cache;
|
|
3104
|
-
return b(K) ? (
|
|
3104
|
+
return b(K) ? (F.addKeys(K), (V = U === "delete" || K.length === L.length ? Vr(K, V) : null) || j.addKeys(K), (V || L) && (x = A, E = V, N = L, i.indexes.forEach(function($) {
|
|
3105
3105
|
var W = x($.name || "");
|
|
3106
3106
|
function re(ne) {
|
|
3107
3107
|
return ne != null ? $.extractKey(ne) : null;
|
|
@@ -3115,10 +3115,10 @@ function Eo() {
|
|
|
3115
3115
|
var ee = E && re(E[Ne]), Ne = N && re(N[Ne]);
|
|
3116
3116
|
se(ee, Ne) !== 0 && (ee != null && ce(ee), 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), F.add(L)) : (F.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" || (
|
|
3121
|
+
return !K || _.type !== "add" && _.type !== "put" || (F.addKeys($.results), C && C.forEach(function(W) {
|
|
3122
3122
|
for (var re = _.values.map(function(ee) {
|
|
3123
3123
|
return W.extractKey(ee);
|
|
3124
3124
|
}), ce = W.keyPath.findIndex(function(ee) {
|
|
@@ -3141,8 +3141,8 @@ function Eo() {
|
|
|
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(""), F = D(":dels"), x = T[_](A), E = x[0], x = x[1];
|
|
3145
|
+
if ((_ === "query" && E.isPrimaryKey && !A.values ? F : 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) {
|
|
@@ -3151,14 +3151,14 @@ function Eo() {
|
|
|
3151
3151
|
return re = re.result, S.addKeys(re), L;
|
|
3152
3152
|
});
|
|
3153
3153
|
var V = A.values ? L.result.map(p) : L.result;
|
|
3154
|
-
(A.values ? S :
|
|
3154
|
+
(A.values ? S : F).addKeys(V);
|
|
3155
3155
|
} else if (_ === "openCursor") {
|
|
3156
3156
|
var $ = L, W = A.values;
|
|
3157
3157
|
return $ && Object.create($, { key: { get: function() {
|
|
3158
|
-
return
|
|
3158
|
+
return F.addKey($.primaryKey), $.key;
|
|
3159
3159
|
} }, primaryKey: { get: function() {
|
|
3160
3160
|
var re = $.primaryKey;
|
|
3161
|
-
return
|
|
3161
|
+
return F.addKey(re), re;
|
|
3162
3162
|
} }, value: { get: function() {
|
|
3163
3163
|
return W && S.addKey($.primaryKey), $.value;
|
|
3164
3164
|
} } });
|
|
@@ -3166,7 +3166,7 @@ function Eo() {
|
|
|
3166
3166
|
return L;
|
|
3167
3167
|
});
|
|
3168
3168
|
}
|
|
3169
|
-
|
|
3169
|
+
F.add(n);
|
|
3170
3170
|
}
|
|
3171
3171
|
}
|
|
3172
3172
|
return a[_].apply(this, arguments);
|
|
@@ -3193,10 +3193,10 @@ function Eo() {
|
|
|
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, F = A.values[D], j = C(F);
|
|
3197
|
+
N.hasKey(j) || (S = w(F), (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(F)));
|
|
3200
3200
|
}
|
|
3201
3201
|
switch (A.type) {
|
|
3202
3202
|
case "add":
|
|
@@ -3290,7 +3290,7 @@ function Eo() {
|
|
|
3290
3290
|
_.optimisticOps = _.optimisticOps.filter(function(W) {
|
|
3291
3291
|
return W.trans !== p;
|
|
3292
3292
|
});
|
|
3293
|
-
for (var
|
|
3293
|
+
for (var F = 0, j = Object.values(_.queries.query); F < j.length; F++) for (var U, K, L, V = 0, $ = (U = j[F]).slice(); V < $.length; V++) (K = $[V]).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);
|
|
@@ -3335,16 +3335,16 @@ function Eo() {
|
|
|
3335
3335
|
if (!S) return [null, !1, D, null];
|
|
3336
3336
|
switch (E) {
|
|
3337
3337
|
case "query":
|
|
3338
|
-
var
|
|
3338
|
+
var F = 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 F ? [F, !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 F = S.find(function(j) {
|
|
3346
3346
|
return zr(j.req.query.range, N.query.range);
|
|
3347
|
-
}), [
|
|
3347
|
+
}), [F, !!F, 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) {
|
|
@@ -3577,7 +3577,7 @@ function Eo() {
|
|
|
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(Fr.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 Eo() {
|
|
|
3645
3645
|
var S = Bt();
|
|
3646
3646
|
try {
|
|
3647
3647
|
i && xt();
|
|
3648
|
-
var
|
|
3649
|
-
return
|
|
3648
|
+
var F = tt(e, D);
|
|
3649
|
+
return F = i ? F.finally(nt) : F;
|
|
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 F in S) if (G(S, F)) 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,8 +3730,8 @@ function Eo() {
|
|
|
3730
3730
|
}, Promise: X, debug: { get: function() {
|
|
3731
3731
|
return De;
|
|
3732
3732
|
}, set: function(e) {
|
|
3733
|
-
|
|
3734
|
-
} }, derive:
|
|
3733
|
+
Ft(e);
|
|
3734
|
+
} }, derive: k, extend: R, props: z, override: te, Events: qt, on: ot, liveQuery: Qr, extendObservabilitySet: _n, getByKeyPath: pe, setByKeyPath: ae, delByKeyPath: function(e, t) {
|
|
3735
3735
|
typeof t == "string" ? ae(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3736
3736
|
ae(e, n, void 0);
|
|
3737
3737
|
});
|
|
@@ -3763,7 +3763,7 @@ function Eo() {
|
|
|
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
|
+
}, Ft(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 });
|
|
@@ -3773,22 +3773,22 @@ function Eo() {
|
|
|
3773
3773
|
});
|
|
3774
3774
|
})(Tn)), Tn.exports;
|
|
3775
3775
|
}
|
|
3776
|
-
var
|
|
3777
|
-
const hr = /* @__PURE__ */ pa(
|
|
3776
|
+
var To = xo();
|
|
3777
|
+
const hr = /* @__PURE__ */ pa(To), ea = /* @__PURE__ */ Symbol.for("Dexie"), ct = globalThis[ea] || (globalThis[ea] = hr);
|
|
3778
3778
|
if (hr.semVer !== ct.semVer)
|
|
3779
3779
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${hr.semVer} and ${ct.semVer}`);
|
|
3780
3780
|
const {
|
|
3781
|
-
liveQuery:
|
|
3782
|
-
mergeRanges:
|
|
3783
|
-
rangesOverlap:
|
|
3784
|
-
RangeSet:
|
|
3785
|
-
cmp:
|
|
3786
|
-
Entity:
|
|
3787
|
-
PropModification:
|
|
3788
|
-
replacePrefix:
|
|
3789
|
-
add:
|
|
3790
|
-
remove:
|
|
3791
|
-
DexieYProvider:
|
|
3781
|
+
liveQuery: hs,
|
|
3782
|
+
mergeRanges: ms,
|
|
3783
|
+
rangesOverlap: ps,
|
|
3784
|
+
RangeSet: gs,
|
|
3785
|
+
cmp: ys,
|
|
3786
|
+
Entity: vs,
|
|
3787
|
+
PropModification: _s,
|
|
3788
|
+
replacePrefix: bs,
|
|
3789
|
+
add: Cs,
|
|
3790
|
+
remove: As,
|
|
3791
|
+
DexieYProvider: ws
|
|
3792
3792
|
} = ct;
|
|
3793
3793
|
async function ga(l) {
|
|
3794
3794
|
const { databaseName: c, dialecteConfig: u, createRootIfEmpty: o = !1 } = l, { xmlElements: h, additionalTables: m } = u.database.tables, y = new ct(c), b = {
|
|
@@ -3797,12 +3797,12 @@ async function ga(l) {
|
|
|
3797
3797
|
if (m)
|
|
3798
3798
|
for (const [R, P] of Object.entries(m))
|
|
3799
3799
|
b[R] = P.schema;
|
|
3800
|
-
return y.version(1).stores(b), o && await
|
|
3800
|
+
return y.version(1).stores(b), o && await No({
|
|
3801
3801
|
databaseInstance: y,
|
|
3802
3802
|
dialecteConfig: u
|
|
3803
3803
|
}), y;
|
|
3804
3804
|
}
|
|
3805
|
-
async function
|
|
3805
|
+
async function No(l) {
|
|
3806
3806
|
const { databaseInstance: c, dialecteConfig: u } = l, o = u.database.tables.xmlElements.name, h = u.rootElementName;
|
|
3807
3807
|
await c.open();
|
|
3808
3808
|
const m = c.table(o), y = await m.where({ tagName: h }).count(), b = u.definition[h].attributes.details;
|
|
@@ -3830,33 +3830,33 @@ const On = {
|
|
|
3830
3830
|
function lt(l) {
|
|
3831
3831
|
Object.assign(On, l);
|
|
3832
3832
|
}
|
|
3833
|
-
function
|
|
3833
|
+
function Oo(l) {
|
|
3834
3834
|
lt({
|
|
3835
3835
|
loading: !0,
|
|
3836
3836
|
error: null,
|
|
3837
3837
|
progress: l ? { phase: "executing", operation: l } : { phase: "starting" }
|
|
3838
3838
|
});
|
|
3839
3839
|
}
|
|
3840
|
-
function
|
|
3840
|
+
function Ro() {
|
|
3841
3841
|
lt({
|
|
3842
3842
|
loading: !1,
|
|
3843
3843
|
progress: null
|
|
3844
3844
|
});
|
|
3845
3845
|
}
|
|
3846
|
-
function
|
|
3846
|
+
function Io(l) {
|
|
3847
3847
|
lt({
|
|
3848
3848
|
loading: !1,
|
|
3849
3849
|
error: l,
|
|
3850
3850
|
progress: null
|
|
3851
3851
|
});
|
|
3852
3852
|
}
|
|
3853
|
-
function
|
|
3853
|
+
function Do(l) {
|
|
3854
3854
|
lt({
|
|
3855
3855
|
loading: !0,
|
|
3856
3856
|
progress: { phase: "executing", operation: l }
|
|
3857
3857
|
});
|
|
3858
3858
|
}
|
|
3859
|
-
function
|
|
3859
|
+
function Po(l) {
|
|
3860
3860
|
const { current: c, total: u, operation: o } = l, h = On.progress;
|
|
3861
3861
|
!h || h.phase !== "ending" ? lt({
|
|
3862
3862
|
loading: !0,
|
|
@@ -3874,7 +3874,7 @@ function Do(l) {
|
|
|
3874
3874
|
}
|
|
3875
3875
|
});
|
|
3876
3876
|
}
|
|
3877
|
-
function
|
|
3877
|
+
function So() {
|
|
3878
3878
|
const l = On.progress;
|
|
3879
3879
|
l?.phase === "ending" && lt({
|
|
3880
3880
|
loading: !1,
|
|
@@ -3885,14 +3885,14 @@ function Po() {
|
|
|
3885
3885
|
});
|
|
3886
3886
|
}
|
|
3887
3887
|
const st = {
|
|
3888
|
-
setLoading:
|
|
3889
|
-
setIdle:
|
|
3890
|
-
setError:
|
|
3891
|
-
setOperation:
|
|
3892
|
-
updateEndingProgress:
|
|
3893
|
-
setComplete:
|
|
3888
|
+
setLoading: Oo,
|
|
3889
|
+
setIdle: Ro,
|
|
3890
|
+
setError: Io,
|
|
3891
|
+
setOperation: Do,
|
|
3892
|
+
updateEndingProgress: Po,
|
|
3893
|
+
setComplete: So
|
|
3894
3894
|
};
|
|
3895
|
-
function
|
|
3895
|
+
function Fo() {
|
|
3896
3896
|
return On;
|
|
3897
3897
|
}
|
|
3898
3898
|
function ya() {
|
|
@@ -3930,7 +3930,7 @@ function ko(l) {
|
|
|
3930
3930
|
tagName: h
|
|
3931
3931
|
});
|
|
3932
3932
|
}
|
|
3933
|
-
function
|
|
3933
|
+
function Mo(l) {
|
|
3934
3934
|
ya();
|
|
3935
3935
|
const { dialecteConfig: c, databaseInstance: u, tagName: o, id: h } = l, m = c.database.tables.xmlElements.name, y = Promise.resolve().then(
|
|
3936
3936
|
async () => {
|
|
@@ -3953,7 +3953,7 @@ function Fo(l) {
|
|
|
3953
3953
|
);
|
|
3954
3954
|
return vr({ contextPromise: y, dialecteConfig: c, databaseInstance: u, tagName: o });
|
|
3955
3955
|
}
|
|
3956
|
-
async function
|
|
3956
|
+
async function jo(l) {
|
|
3957
3957
|
const { databaseName: c, dialecteConfig: u } = l;
|
|
3958
3958
|
Ee(c, "Database name is required to create SDK");
|
|
3959
3959
|
const o = await ga({
|
|
@@ -3962,29 +3962,29 @@ async function Mo(l) {
|
|
|
3962
3962
|
createRootIfEmpty: !0
|
|
3963
3963
|
});
|
|
3964
3964
|
return {
|
|
3965
|
-
getState:
|
|
3965
|
+
getState: Fo,
|
|
3966
3966
|
getDatabaseInstance: () => o,
|
|
3967
3967
|
fromRoot: () => ko({ dialecteConfig: u, databaseInstance: o }),
|
|
3968
|
-
fromElement: (h) =>
|
|
3968
|
+
fromElement: (h) => Mo({
|
|
3969
3969
|
dialecteConfig: u,
|
|
3970
3970
|
databaseInstance: o,
|
|
3971
3971
|
...h
|
|
3972
3972
|
})
|
|
3973
3973
|
};
|
|
3974
3974
|
}
|
|
3975
|
-
async function
|
|
3975
|
+
async function Ko(l) {
|
|
3976
3976
|
const { databaseInstance: c, elementsTableName: u, records: o } = l, h = c.table(u);
|
|
3977
3977
|
await c.transaction("rw", h, () => h.bulkAdd(o));
|
|
3978
3978
|
}
|
|
3979
|
-
async function
|
|
3979
|
+
async function Bs(l) {
|
|
3980
3980
|
if (await ct.exists(l))
|
|
3981
3981
|
return await ct.delete(l);
|
|
3982
3982
|
}
|
|
3983
|
-
function
|
|
3983
|
+
function qo(l) {
|
|
3984
3984
|
return "prefix" in l && "uri" in l && !!l.prefix && !!l.uri;
|
|
3985
3985
|
}
|
|
3986
3986
|
const Qt = {};
|
|
3987
|
-
function
|
|
3987
|
+
function Lo(l) {
|
|
3988
3988
|
const { parentId: c, child: u } = l;
|
|
3989
3989
|
Qt[c] || (Qt[c] = []);
|
|
3990
3990
|
const o = {
|
|
@@ -3993,27 +3993,27 @@ function qo(l) {
|
|
|
3993
3993
|
};
|
|
3994
3994
|
Qt[c].push(o);
|
|
3995
3995
|
}
|
|
3996
|
-
function
|
|
3996
|
+
function Uo(l) {
|
|
3997
3997
|
const { currentBatch: c } = l, u = [...c];
|
|
3998
3998
|
for (const [o, h] of u.entries()) {
|
|
3999
3999
|
const m = Qt[h.id] || [];
|
|
4000
|
-
m.length > 0 && (u[o].children.push(...m),
|
|
4000
|
+
m.length > 0 && (u[o].children.push(...m), $o({
|
|
4001
4001
|
parentId: h.id
|
|
4002
4002
|
}));
|
|
4003
4003
|
}
|
|
4004
4004
|
return u;
|
|
4005
4005
|
}
|
|
4006
|
-
function
|
|
4006
|
+
function $o(l) {
|
|
4007
4007
|
const { parentId: c } = l;
|
|
4008
4008
|
delete Qt[c];
|
|
4009
4009
|
}
|
|
4010
4010
|
var dr = {};
|
|
4011
|
-
const
|
|
4011
|
+
const Vo = {}, Go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4012
4012
|
__proto__: null,
|
|
4013
|
-
default:
|
|
4014
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4013
|
+
default: Vo
|
|
4014
|
+
}, Symbol.toStringTag, { value: "Module" })), Xo = /* @__PURE__ */ Bo(Go);
|
|
4015
4015
|
var ta;
|
|
4016
|
-
function
|
|
4016
|
+
function Wo() {
|
|
4017
4017
|
return ta || (ta = 1, (function(l) {
|
|
4018
4018
|
(function(c) {
|
|
4019
4019
|
c.parser = function(f, s) {
|
|
@@ -4057,7 +4057,7 @@ function Xo() {
|
|
|
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(k)), 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() {
|
|
@@ -4116,7 +4116,7 @@ function Xo() {
|
|
|
4116
4116
|
};
|
|
4117
4117
|
var b;
|
|
4118
4118
|
try {
|
|
4119
|
-
b =
|
|
4119
|
+
b = Xo.Stream;
|
|
4120
4120
|
} catch {
|
|
4121
4121
|
b = function() {
|
|
4122
4122
|
};
|
|
@@ -4172,7 +4172,7 @@ function Xo() {
|
|
|
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 G = "[CDATA[", z = "DOCTYPE", H = "http://www.w3.org/XML/1998/namespace", M = "http://www.w3.org/2000/xmlns/",
|
|
4175
|
+
var G = "[CDATA[", z = "DOCTYPE", H = "http://www.w3.org/XML/1998/namespace", M = "http://www.w3.org/2000/xmlns/", k = { 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]/, ie = /[:_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]/, te = /[#:_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 === " ";
|
|
@@ -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 Fe(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(Ft) {
|
|
4609
4609
|
de(f, "onopennamespace", {
|
|
4610
|
-
prefix:
|
|
4611
|
-
uri: O.ns[
|
|
4610
|
+
prefix: Ft,
|
|
4611
|
+
uri: O.ns[Ft]
|
|
4612
4612
|
});
|
|
4613
4613
|
});
|
|
4614
4614
|
for (var Z = 0, he = f.attribList.length; Z < he; Z++) {
|
|
@@ -4809,7 +4809,7 @@ Actual: ` + f.attribValue
|
|
|
4809
4809
|
B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : ae(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, Fe(s), je(s)) : Y(B) ? s.state = I.ATTRIB_NAME_SAW_WHITE : ae(ie, B) ? s.attribName += B : fe(s, "Invalid attribute name");
|
|
4813
4813
|
continue;
|
|
4814
4814
|
case I.ATTRIB_NAME_SAW_WHITE:
|
|
4815
4815
|
if (B === "=")
|
|
@@ -4833,7 +4833,7 @@ Actual: ` + f.attribValue
|
|
|
4833
4833
|
B === "&" ? s.state = I.ATTRIB_VALUE_ENTITY_Q : s.attribValue += B;
|
|
4834
4834
|
continue;
|
|
4835
4835
|
}
|
|
4836
|
-
|
|
4836
|
+
Fe(s), s.q = "", s.state = I.ATTRIB_VALUE_CLOSED;
|
|
4837
4837
|
continue;
|
|
4838
4838
|
case I.ATTRIB_VALUE_CLOSED:
|
|
4839
4839
|
Y(B) ? s.state = I.ATTRIB : B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : ae(J, B) ? (fe(s, "No whitespace between attributes"), s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
|
|
@@ -4843,7 +4843,7 @@ Actual: ` + f.attribValue
|
|
|
4843
4843
|
B === "&" ? s.state = I.ATTRIB_VALUE_ENTITY_U : s.attribValue += B;
|
|
4844
4844
|
continue;
|
|
4845
4845
|
}
|
|
4846
|
-
|
|
4846
|
+
Fe(s), B === ">" ? je(s) : s.state = I.ATTRIB;
|
|
4847
4847
|
continue;
|
|
4848
4848
|
case I.CLOSE_TAG:
|
|
4849
4849
|
if (s.tagName)
|
|
@@ -4909,15 +4909,15 @@ Actual: ` + f.attribValue
|
|
|
4909
4909
|
})(l);
|
|
4910
4910
|
})(dr)), dr;
|
|
4911
4911
|
}
|
|
4912
|
-
var
|
|
4913
|
-
function
|
|
4912
|
+
var Yo = Wo();
|
|
4913
|
+
function zo(l) {
|
|
4914
4914
|
const { dialecteConfig: c, useCustomRecordsIds: u } = l;
|
|
4915
4915
|
let h = {
|
|
4916
4916
|
defaultNamespace: null,
|
|
4917
4917
|
stack: [],
|
|
4918
4918
|
recordsBatch: []
|
|
4919
4919
|
};
|
|
4920
|
-
const m =
|
|
4920
|
+
const m = Yo.parser(
|
|
4921
4921
|
!0,
|
|
4922
4922
|
// strict mode
|
|
4923
4923
|
{
|
|
@@ -4933,14 +4933,14 @@ function Yo(l) {
|
|
|
4933
4933
|
// Enable namespace handling
|
|
4934
4934
|
}
|
|
4935
4935
|
);
|
|
4936
|
-
m.onopentag = (R) => h =
|
|
4936
|
+
m.onopentag = (R) => h = Qo({
|
|
4937
4937
|
node: R,
|
|
4938
4938
|
state: h,
|
|
4939
4939
|
dialecteConfig: c,
|
|
4940
4940
|
useCustomRecordsIds: u
|
|
4941
|
-
}), m.ontext = (R) => h =
|
|
4941
|
+
}), m.ontext = (R) => h = Ho({ text: R, state: h }), m.onclosetag = () => ({ updatedState: h } = Zo({
|
|
4942
4942
|
state: h
|
|
4943
|
-
})), m.onerror =
|
|
4943
|
+
})), m.onerror = Jo;
|
|
4944
4944
|
function y() {
|
|
4945
4945
|
const R = h.recordsBatch;
|
|
4946
4946
|
return h.recordsBatch = [], R;
|
|
@@ -4954,17 +4954,17 @@ function Yo(l) {
|
|
|
4954
4954
|
getSize: b
|
|
4955
4955
|
};
|
|
4956
4956
|
}
|
|
4957
|
-
function
|
|
4958
|
-
const { node: c, state: u, dialecteConfig: o, useCustomRecordsIds: h } = l, m = { ...u }, y =
|
|
4959
|
-
m.defaultNamespace || (m.defaultNamespace =
|
|
4957
|
+
function Qo(l) {
|
|
4958
|
+
const { node: c, state: u, dialecteConfig: o, useCustomRecordsIds: h } = l, m = { ...u }, y = ei(c);
|
|
4959
|
+
m.defaultNamespace || (m.defaultNamespace = ti({
|
|
4960
4960
|
element: c,
|
|
4961
4961
|
defaultNamespace: o.namespaces.default,
|
|
4962
4962
|
rootElementName: o.rootElementName
|
|
4963
4963
|
}));
|
|
4964
|
-
const b =
|
|
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 =
|
|
4967
|
+
}), q = ri(P), G = ai(u.stack), z = {
|
|
4968
4968
|
id: R,
|
|
4969
4969
|
tagName: y,
|
|
4970
4970
|
namespace: b,
|
|
@@ -4975,11 +4975,11 @@ function zo(l) {
|
|
|
4975
4975
|
};
|
|
4976
4976
|
return m.stack.push(z), m;
|
|
4977
4977
|
}
|
|
4978
|
-
function
|
|
4978
|
+
function Ho(l) {
|
|
4979
4979
|
const { text: c, state: u } = l;
|
|
4980
4980
|
return c && u.stack.length > 0 && (u.stack[u.stack.length - 1].value += c), u;
|
|
4981
4981
|
}
|
|
4982
|
-
function
|
|
4982
|
+
function Zo(l) {
|
|
4983
4983
|
const { state: c } = l, u = c.stack.at(-1);
|
|
4984
4984
|
let o = c.stack.slice(0, -1);
|
|
4985
4985
|
const h = [...c.recordsBatch];
|
|
@@ -4995,7 +4995,7 @@ function Ho(l) {
|
|
|
4995
4995
|
]
|
|
4996
4996
|
} : y
|
|
4997
4997
|
);
|
|
4998
|
-
} else u.parent &&
|
|
4998
|
+
} else u.parent && Lo({
|
|
4999
4999
|
parentId: u.parent.id,
|
|
5000
5000
|
child: { id: u.id, tagName: u.tagName }
|
|
5001
5001
|
});
|
|
@@ -5009,13 +5009,13 @@ function Ho(l) {
|
|
|
5009
5009
|
}
|
|
5010
5010
|
};
|
|
5011
5011
|
}
|
|
5012
|
-
function
|
|
5012
|
+
function Jo(l) {
|
|
5013
5013
|
return new Error(`XML parsing error: ${l}`);
|
|
5014
5014
|
}
|
|
5015
|
-
function
|
|
5015
|
+
function ei(l) {
|
|
5016
5016
|
return l.local;
|
|
5017
5017
|
}
|
|
5018
|
-
function
|
|
5018
|
+
function ti(l) {
|
|
5019
5019
|
const { element: c, defaultNamespace: u, rootElementName: o } = l;
|
|
5020
5020
|
return Ee(
|
|
5021
5021
|
c.name === o,
|
|
@@ -5025,13 +5025,13 @@ function ei(l) {
|
|
|
5025
5025
|
uri: c.attributes.xmlns.value
|
|
5026
5026
|
} : u;
|
|
5027
5027
|
}
|
|
5028
|
-
function
|
|
5029
|
-
return
|
|
5028
|
+
function ni(l, c) {
|
|
5029
|
+
return qo(l) ? {
|
|
5030
5030
|
prefix: l.prefix,
|
|
5031
5031
|
uri: l.uri
|
|
5032
5032
|
} : c;
|
|
5033
5033
|
}
|
|
5034
|
-
function
|
|
5034
|
+
function ri(l) {
|
|
5035
5035
|
return l.map((c) => {
|
|
5036
5036
|
const u = c.prefix && c.uri ? {
|
|
5037
5037
|
prefix: c.prefix,
|
|
@@ -5044,16 +5044,16 @@ function ni(l) {
|
|
|
5044
5044
|
};
|
|
5045
5045
|
});
|
|
5046
5046
|
}
|
|
5047
|
-
function
|
|
5047
|
+
function ai(l) {
|
|
5048
5048
|
if (l.length === 0) return null;
|
|
5049
5049
|
const c = l[l.length - 1];
|
|
5050
5050
|
return c ? { id: c.id, tagName: c.tagName } : null;
|
|
5051
5051
|
}
|
|
5052
|
-
function
|
|
5052
|
+
function oi(l) {
|
|
5053
5053
|
const { attributes: c, useCustomRecordsIds: u } = l, o = c[da];
|
|
5054
5054
|
return u && o && o.value ? o.value : crypto.randomUUID();
|
|
5055
5055
|
}
|
|
5056
|
-
function
|
|
5056
|
+
function ii(l) {
|
|
5057
5057
|
const { attributes: c, useCustomRecordsIds: u } = l;
|
|
5058
5058
|
return u ? Object.values(c).filter((o) => o.name !== da) : Object.values(c);
|
|
5059
5059
|
}
|
|
@@ -5063,7 +5063,7 @@ const na = {
|
|
|
5063
5063
|
// 32KB
|
|
5064
5064
|
batchSize: 2e3
|
|
5065
5065
|
};
|
|
5066
|
-
async function
|
|
5066
|
+
async function si(l) {
|
|
5067
5067
|
const { files: c, dialecteConfig: u, useCustomRecordsIds: o = !1 } = l, h = [];
|
|
5068
5068
|
if (c.length === 0) throw new Error("No files provided for import.");
|
|
5069
5069
|
const { importOptions: m = na, supportedFileExtensions: y } = u.io, b = {
|
|
@@ -5071,12 +5071,12 @@ async function ii(l) {
|
|
|
5071
5071
|
...m
|
|
5072
5072
|
};
|
|
5073
5073
|
for (const R of c) {
|
|
5074
|
-
if (!
|
|
5074
|
+
if (!ui({ file: R, supportedExtensions: y })) {
|
|
5075
5075
|
console.error(`Unsupported file type: ${R.name}`);
|
|
5076
5076
|
continue;
|
|
5077
5077
|
}
|
|
5078
5078
|
R.size === 0 && console.warn(`File is empty: ${R.name}`);
|
|
5079
|
-
const P = await
|
|
5079
|
+
const P = await li({
|
|
5080
5080
|
file: R,
|
|
5081
5081
|
dialecteConfig: u,
|
|
5082
5082
|
options: b,
|
|
@@ -5086,18 +5086,18 @@ async function ii(l) {
|
|
|
5086
5086
|
}
|
|
5087
5087
|
return h;
|
|
5088
5088
|
}
|
|
5089
|
-
function
|
|
5089
|
+
function ui(l) {
|
|
5090
5090
|
const { file: c, supportedExtensions: u } = l;
|
|
5091
5091
|
return u.some((o) => c.name.toLowerCase().endsWith(o));
|
|
5092
5092
|
}
|
|
5093
|
-
function
|
|
5093
|
+
function ci(l) {
|
|
5094
5094
|
return l.name.replace(/\.[^.]+$/, "");
|
|
5095
5095
|
}
|
|
5096
|
-
async function
|
|
5097
|
-
const { file: c, dialecteConfig: u, options: o, useCustomRecordsIds: h } = l, m =
|
|
5096
|
+
async function li(l) {
|
|
5097
|
+
const { file: c, dialecteConfig: u, options: o, useCustomRecordsIds: h } = l, m = ci(c), y = await ga({ databaseName: m, dialecteConfig: u });
|
|
5098
5098
|
try {
|
|
5099
5099
|
const b = u.database.tables.xmlElements.name;
|
|
5100
|
-
return await y.table(b).clear(), o.useBrowserApi && c.size !== 0 && await
|
|
5100
|
+
return await y.table(b).clear(), o.useBrowserApi && c.size !== 0 && await fi({
|
|
5101
5101
|
file: c,
|
|
5102
5102
|
databaseInstance: y,
|
|
5103
5103
|
elementsTableName: b,
|
|
@@ -5114,8 +5114,8 @@ async function ci(l) {
|
|
|
5114
5114
|
y.close();
|
|
5115
5115
|
}
|
|
5116
5116
|
}
|
|
5117
|
-
async function
|
|
5118
|
-
const { file: c, databaseInstance: u, elementsTableName: o, dialecteConfig: h, options: m } = l, y = c.stream().getReader(), b =
|
|
5117
|
+
async function fi(l) {
|
|
5118
|
+
const { file: c, databaseInstance: u, elementsTableName: o, dialecteConfig: h, options: m } = l, y = c.stream().getReader(), b = zo({
|
|
5119
5119
|
dialecteConfig: h,
|
|
5120
5120
|
useCustomRecordsIds: m.useCustomRecordsIds
|
|
5121
5121
|
}), R = new TextDecoder(), P = new Uint8Array(0);
|
|
@@ -5162,10 +5162,10 @@ async function mr(l) {
|
|
|
5162
5162
|
async function ra(l) {
|
|
5163
5163
|
const { databaseInstance: c, elementsTableName: u, sax: o, batchSize: h } = l;
|
|
5164
5164
|
if (o.getSize() >= h) {
|
|
5165
|
-
const y = o.drainBatch(), b =
|
|
5165
|
+
const y = o.drainBatch(), b = Uo({
|
|
5166
5166
|
currentBatch: y
|
|
5167
5167
|
});
|
|
5168
|
-
await
|
|
5168
|
+
await Ko({
|
|
5169
5169
|
databaseInstance: c,
|
|
5170
5170
|
elementsTableName: u,
|
|
5171
5171
|
records: b
|
|
@@ -5174,7 +5174,7 @@ async function ra(l) {
|
|
|
5174
5174
|
}
|
|
5175
5175
|
const va = "_temp-idb-id";
|
|
5176
5176
|
var zt = { exports: {} }, En = { exports: {} }, aa;
|
|
5177
|
-
function
|
|
5177
|
+
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 {
|
|
@@ -5188,7 +5188,7 @@ function fi() {
|
|
|
5188
5188
|
return R(!1) || z() || G() || q() || b();
|
|
5189
5189
|
}
|
|
5190
5190
|
function m() {
|
|
5191
|
-
return
|
|
5191
|
+
return k(/\s*/), R(!0) || G() || P() || b();
|
|
5192
5192
|
}
|
|
5193
5193
|
function y() {
|
|
5194
5194
|
const te = b(), Y = [];
|
|
@@ -5212,7 +5212,7 @@ function fi() {
|
|
|
5212
5212
|
};
|
|
5213
5213
|
}
|
|
5214
5214
|
function b() {
|
|
5215
|
-
const te =
|
|
5215
|
+
const te = k(/^<\?([\w-:.]+)\s*/);
|
|
5216
5216
|
if (!te)
|
|
5217
5217
|
return;
|
|
5218
5218
|
const Y = {
|
|
@@ -5224,13 +5224,13 @@ function fi() {
|
|
|
5224
5224
|
Y.content = o.xml.substring(0, oe).trim(), o.xml = o.xml.slice(oe);
|
|
5225
5225
|
else
|
|
5226
5226
|
throw new u("Failed to parse XML", "ProcessingInstruction closing tag not found");
|
|
5227
|
-
return
|
|
5227
|
+
return k(/\?>/), {
|
|
5228
5228
|
excluded: o.options.filter(Y) === !1,
|
|
5229
5229
|
node: Y
|
|
5230
5230
|
};
|
|
5231
5231
|
}
|
|
5232
5232
|
function R(te) {
|
|
5233
|
-
const Y =
|
|
5233
|
+
const Y = k(/^<([^?!</>\s]+)\s*/);
|
|
5234
5234
|
if (!Y)
|
|
5235
5235
|
return;
|
|
5236
5236
|
const oe = {
|
|
@@ -5246,12 +5246,12 @@ function fi() {
|
|
|
5246
5246
|
else
|
|
5247
5247
|
return;
|
|
5248
5248
|
}
|
|
5249
|
-
if (
|
|
5249
|
+
if (k(/^\s*\/>/))
|
|
5250
5250
|
return oe.children = null, {
|
|
5251
5251
|
excluded: pe,
|
|
5252
5252
|
node: oe
|
|
5253
5253
|
};
|
|
5254
|
-
|
|
5254
|
+
k(/\??>/);
|
|
5255
5255
|
let ae = h();
|
|
5256
5256
|
for (; ae; )
|
|
5257
5257
|
ae.excluded || oe.children.push(ae.node), ae = h();
|
|
@@ -5262,14 +5262,14 @@ function fi() {
|
|
|
5262
5262
|
else
|
|
5263
5263
|
throw new u("Failed to parse XML", `Closing tag not matching "${Re}"`);
|
|
5264
5264
|
} else
|
|
5265
|
-
|
|
5265
|
+
k(/^<\/[\w-:.\u00C0-\u00FF]+\s*>/);
|
|
5266
5266
|
return {
|
|
5267
5267
|
excluded: pe,
|
|
5268
5268
|
node: oe
|
|
5269
5269
|
};
|
|
5270
5270
|
}
|
|
5271
5271
|
function P() {
|
|
5272
|
-
const te =
|
|
5272
|
+
const te = k(/^<!DOCTYPE\s+\S+\s+SYSTEM[^>]*>/) || k(/^<!DOCTYPE\s+\S+\s+PUBLIC[^>]*>/) || k(/^<!DOCTYPE\s+\S+\s*\[[^\]]*]>/) || k(/^<!DOCTYPE\s+\S+\s*>/);
|
|
5273
5273
|
if (te) {
|
|
5274
5274
|
const Y = {
|
|
5275
5275
|
type: "DocumentType",
|
|
@@ -5297,7 +5297,7 @@ function fi() {
|
|
|
5297
5297
|
}
|
|
5298
5298
|
}
|
|
5299
5299
|
function G() {
|
|
5300
|
-
const te =
|
|
5300
|
+
const te = k(/^<!--[\s\S]*?-->/);
|
|
5301
5301
|
if (te) {
|
|
5302
5302
|
const Y = {
|
|
5303
5303
|
type: "Comment",
|
|
@@ -5310,7 +5310,7 @@ function fi() {
|
|
|
5310
5310
|
}
|
|
5311
5311
|
}
|
|
5312
5312
|
function z() {
|
|
5313
|
-
const te =
|
|
5313
|
+
const te = k(/^([^<]+)/);
|
|
5314
5314
|
if (te) {
|
|
5315
5315
|
const Y = {
|
|
5316
5316
|
type: "Text",
|
|
@@ -5323,7 +5323,7 @@ function fi() {
|
|
|
5323
5323
|
}
|
|
5324
5324
|
}
|
|
5325
5325
|
function H() {
|
|
5326
|
-
const te =
|
|
5326
|
+
const te = k(/([^=]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)\s*/);
|
|
5327
5327
|
if (te)
|
|
5328
5328
|
return {
|
|
5329
5329
|
name: te[1].trim(),
|
|
@@ -5333,7 +5333,7 @@ function fi() {
|
|
|
5333
5333
|
function M(te) {
|
|
5334
5334
|
return te.replace(/^['"]|['"]$/g, "");
|
|
5335
5335
|
}
|
|
5336
|
-
function
|
|
5336
|
+
function k(te) {
|
|
5337
5337
|
const Y = o.xml.match(te);
|
|
5338
5338
|
if (Y)
|
|
5339
5339
|
return o.xml = o.xml.slice(Y[0].length), Y;
|
|
@@ -5356,62 +5356,62 @@ function fi() {
|
|
|
5356
5356
|
})(En, En.exports)), En.exports;
|
|
5357
5357
|
}
|
|
5358
5358
|
var oa = zt.exports, ia;
|
|
5359
|
-
function
|
|
5359
|
+
function hi() {
|
|
5360
5360
|
return ia || (ia = 1, (function(l, c) {
|
|
5361
5361
|
var u = oa && oa.__importDefault || function(M) {
|
|
5362
5362
|
return M && M.__esModule ? M : { default: M };
|
|
5363
5363
|
};
|
|
5364
5364
|
Object.defineProperty(c, "__esModule", { value: !0 });
|
|
5365
|
-
const o = u(/* @__PURE__ */
|
|
5365
|
+
const o = u(/* @__PURE__ */ di());
|
|
5366
5366
|
function h(M) {
|
|
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 k;
|
|
5371
|
+
for (k = 0; k < M.level; k++)
|
|
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 k;
|
|
5377
|
+
for (k = 0; k < M.level; k++)
|
|
5378
5378
|
M.content += M.options.indentation;
|
|
5379
5379
|
}
|
|
5380
|
-
function y(M,
|
|
5381
|
-
M.content +=
|
|
5380
|
+
function y(M, k) {
|
|
5381
|
+
M.content += k;
|
|
5382
5382
|
}
|
|
5383
|
-
function b(M,
|
|
5383
|
+
function b(M, k, J) {
|
|
5384
5384
|
if (M.type === "Element")
|
|
5385
|
-
q(M,
|
|
5385
|
+
q(M, k, J);
|
|
5386
5386
|
else if (M.type === "ProcessingInstruction")
|
|
5387
|
-
z(M,
|
|
5387
|
+
z(M, k);
|
|
5388
5388
|
else if (typeof M.content == "string")
|
|
5389
|
-
R(M.content,
|
|
5389
|
+
R(M.content, k, J);
|
|
5390
5390
|
else
|
|
5391
5391
|
throw new Error("Unknown node type: " + M.type);
|
|
5392
5392
|
}
|
|
5393
|
-
function R(M,
|
|
5393
|
+
function R(M, k, J) {
|
|
5394
5394
|
if (!J) {
|
|
5395
5395
|
const ie = M.trim();
|
|
5396
|
-
(
|
|
5396
|
+
(k.options.lineSeparator || ie.length === 0) && (M = ie);
|
|
5397
5397
|
}
|
|
5398
|
-
M.length > 0 && (!J &&
|
|
5398
|
+
M.length > 0 && (!J && k.content.length > 0 && h(k), y(k, M));
|
|
5399
5399
|
}
|
|
5400
|
-
function P(M,
|
|
5400
|
+
function P(M, k) {
|
|
5401
5401
|
const J = "/" + M.join("/"), ie = M[M.length - 1];
|
|
5402
|
-
return
|
|
5402
|
+
return k.includes(ie) || k.includes(J);
|
|
5403
5403
|
}
|
|
5404
|
-
function q(M,
|
|
5405
|
-
if (
|
|
5406
|
-
const ie =
|
|
5407
|
-
y(
|
|
5404
|
+
function q(M, k, J) {
|
|
5405
|
+
if (k.path.push(M.name), !J && k.content.length > 0 && h(k), y(k, "<" + M.name), G(k, M.attributes), M.children === null || k.options.forceSelfClosingEmptyTag && M.children.length === 0) {
|
|
5406
|
+
const ie = k.options.whiteSpaceAtEndOfSelfclosingTag ? " />" : "/>";
|
|
5407
|
+
y(k, ie);
|
|
5408
5408
|
} else if (M.children.length === 0)
|
|
5409
|
-
y(
|
|
5409
|
+
y(k, "></" + M.name + ">");
|
|
5410
5410
|
else {
|
|
5411
5411
|
const ie = M.children;
|
|
5412
|
-
y(
|
|
5412
|
+
y(k, ">"), k.level++;
|
|
5413
5413
|
let ye = M.attributes["xml:space"] === "preserve" || J, te = !1;
|
|
5414
|
-
if (!ye &&
|
|
5414
|
+
if (!ye && k.options.ignoredPaths && (te = P(k.path, k.options.ignoredPaths), ye = te), !ye && k.options.collapseContent) {
|
|
5415
5415
|
let Y = !1, oe = !1, pe = !1;
|
|
5416
5416
|
ie.forEach(function(ae, Re) {
|
|
5417
5417
|
ae.type === "Text" ? (ae.content.includes(`
|
|
@@ -5419,46 +5419,46 @@ function di() {
|
|
|
5419
5419
|
}), Y && (!pe || !oe) && (ye = !0);
|
|
5420
5420
|
}
|
|
5421
5421
|
ie.forEach(function(Y) {
|
|
5422
|
-
b(Y,
|
|
5423
|
-
}),
|
|
5422
|
+
b(Y, k, J || ye);
|
|
5423
|
+
}), k.level--, !J && !ye && h(k), te && m(k), y(k, "</" + M.name + ">");
|
|
5424
5424
|
}
|
|
5425
|
-
|
|
5425
|
+
k.path.pop();
|
|
5426
5426
|
}
|
|
5427
|
-
function G(M,
|
|
5428
|
-
Object.keys(
|
|
5429
|
-
const ie =
|
|
5427
|
+
function G(M, k) {
|
|
5428
|
+
Object.keys(k).forEach(function(J) {
|
|
5429
|
+
const ie = k[J].replace(/"/g, """);
|
|
5430
5430
|
y(M, " " + J + '="' + ie + '"');
|
|
5431
5431
|
});
|
|
5432
5432
|
}
|
|
5433
|
-
function z(M,
|
|
5434
|
-
|
|
5433
|
+
function z(M, k) {
|
|
5434
|
+
k.content.length > 0 && h(k), y(k, "<?" + M.name), y(k, " " + M.content.trim()), y(k, "?>");
|
|
5435
5435
|
}
|
|
5436
|
-
function H(M,
|
|
5437
|
-
|
|
5438
|
-
`,
|
|
5436
|
+
function H(M, k = {}) {
|
|
5437
|
+
k.indentation = "indentation" in k ? k.indentation : " ", k.collapseContent = k.collapseContent === !0, k.lineSeparator = "lineSeparator" in k ? k.lineSeparator : `\r
|
|
5438
|
+
`, k.whiteSpaceAtEndOfSelfclosingTag = k.whiteSpaceAtEndOfSelfclosingTag === !0, k.throwOnFailure = k.throwOnFailure !== !1;
|
|
5439
5439
|
try {
|
|
5440
|
-
const J = (0, o.default)(M, { filter:
|
|
5440
|
+
const J = (0, o.default)(M, { filter: k.filter, strictMode: k.strictMode }), ie = { content: "", level: 0, options: k, path: [] };
|
|
5441
5441
|
return J.declaration && z(J.declaration, ie), J.children.forEach(function(ye) {
|
|
5442
5442
|
b(ye, ie, !1);
|
|
5443
|
-
}),
|
|
5444
|
-
`).replace(/\n/g,
|
|
5443
|
+
}), k.lineSeparator ? ie.content.replace(/\r\n/g, `
|
|
5444
|
+
`).replace(/\n/g, k.lineSeparator) : ie.content;
|
|
5445
5445
|
} catch (J) {
|
|
5446
|
-
if (
|
|
5446
|
+
if (k.throwOnFailure)
|
|
5447
5447
|
throw J;
|
|
5448
5448
|
return M;
|
|
5449
5449
|
}
|
|
5450
5450
|
}
|
|
5451
|
-
H.minify = (M,
|
|
5451
|
+
H.minify = (M, k = {}) => H(M, Object.assign(Object.assign({}, k), { indentation: "", lineSeparator: "" })), l.exports = H, c.default = H;
|
|
5452
5452
|
})(zt, zt.exports)), zt.exports;
|
|
5453
5453
|
}
|
|
5454
|
-
var
|
|
5455
|
-
const
|
|
5456
|
-
function
|
|
5457
|
-
return
|
|
5454
|
+
var mi = /* @__PURE__ */ hi();
|
|
5455
|
+
const pi = /* @__PURE__ */ pa(mi);
|
|
5456
|
+
function gi(l) {
|
|
5457
|
+
return pi(l);
|
|
5458
5458
|
}
|
|
5459
|
-
async function
|
|
5459
|
+
async function yi(l) {
|
|
5460
5460
|
const { extension: c, xmlDocument: u, filename: o } = l, b = `<?xml version="1.0" encoding="UTF-8"?>
|
|
5461
|
-
` + new XMLSerializer().serializeToString(u), R =
|
|
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
5464
|
const G = await (await window.showSaveFilePicker({
|
|
@@ -5479,20 +5479,20 @@ async function gi(l) {
|
|
|
5479
5479
|
G.href = q, G.download = o, document.body.appendChild(G), G.click(), G.remove(), URL.revokeObjectURL(q);
|
|
5480
5480
|
}
|
|
5481
5481
|
}
|
|
5482
|
-
async function
|
|
5482
|
+
async function Es(l) {
|
|
5483
5483
|
const { databaseName: c, extension: u, withDownload: o, dialecteConfig: h } = l, m = await _a({
|
|
5484
5484
|
databaseName: c,
|
|
5485
5485
|
extension: u,
|
|
5486
5486
|
dialecteConfig: h,
|
|
5487
5487
|
withDatabaseIds: !1
|
|
5488
5488
|
});
|
|
5489
|
-
return o && await
|
|
5489
|
+
return o && await yi({
|
|
5490
5490
|
extension: u,
|
|
5491
5491
|
xmlDocument: m.xmlDocument,
|
|
5492
5492
|
filename: m.filename
|
|
5493
5493
|
}), m;
|
|
5494
5494
|
}
|
|
5495
|
-
async function
|
|
5495
|
+
async function xs(l) {
|
|
5496
5496
|
const { databaseName: c, dialecteConfig: u } = l;
|
|
5497
5497
|
return _a({
|
|
5498
5498
|
databaseName: c,
|
|
@@ -5504,7 +5504,7 @@ async function _a(l) {
|
|
|
5504
5504
|
const { databaseName: c, extension: u = "xml", dialecteConfig: o, withDatabaseIds: h } = l, m = new ct(c);
|
|
5505
5505
|
await m.open();
|
|
5506
5506
|
try {
|
|
5507
|
-
const y = await
|
|
5507
|
+
const y = await vi({
|
|
5508
5508
|
databaseInstance: m,
|
|
5509
5509
|
dialecteConfig: o,
|
|
5510
5510
|
withDatabaseIds: h
|
|
@@ -5519,7 +5519,7 @@ async function _a(l) {
|
|
|
5519
5519
|
m.close();
|
|
5520
5520
|
}
|
|
5521
5521
|
}
|
|
5522
|
-
async function
|
|
5522
|
+
async function vi(l) {
|
|
5523
5523
|
const { databaseInstance: c, dialecteConfig: u, withDatabaseIds: o } = l, { useBrowserApi: h = !0 } = u.io.exportOptions ?? { useBrowserApi: !0 }, m = u.rootElementName, y = u.namespaces.default, b = u.database.tables.xmlElements.name;
|
|
5524
5524
|
if (h) {
|
|
5525
5525
|
const R = document.implementation.createDocument(
|
|
@@ -5560,17 +5560,17 @@ async function ba(l) {
|
|
|
5560
5560
|
} = l;
|
|
5561
5561
|
if (!y.children) return;
|
|
5562
5562
|
const R = y.children.map((z) => z.id), q = await c.table(o).bulkGet(R);
|
|
5563
|
-
|
|
5563
|
+
Ci({
|
|
5564
5564
|
childrenRecords: q,
|
|
5565
5565
|
parentRecord: y
|
|
5566
5566
|
});
|
|
5567
|
-
const G =
|
|
5567
|
+
const G = bi({
|
|
5568
5568
|
parentTagName: y.tagName,
|
|
5569
5569
|
availableChildren: u.children,
|
|
5570
5570
|
childrenRecords: q
|
|
5571
5571
|
});
|
|
5572
5572
|
for (const z of G) {
|
|
5573
|
-
const H =
|
|
5573
|
+
const H = _i({
|
|
5574
5574
|
document: m,
|
|
5575
5575
|
record: z,
|
|
5576
5576
|
defaultNamespace: u.namespaces.default,
|
|
@@ -5588,7 +5588,7 @@ async function ba(l) {
|
|
|
5588
5588
|
}
|
|
5589
5589
|
return l.xmlDocument;
|
|
5590
5590
|
}
|
|
5591
|
-
function
|
|
5591
|
+
function _i(l) {
|
|
5592
5592
|
const { document: c, record: u, defaultNamespace: o, withDatabaseIds: h } = l;
|
|
5593
5593
|
let m;
|
|
5594
5594
|
return !(u.namespace.uri === o.uri) && u.namespace.prefix && u.namespace.prefix !== "xmlns" ? (Aa({
|
|
@@ -5602,7 +5602,7 @@ function vi(l) {
|
|
|
5602
5602
|
function Ca(l) {
|
|
5603
5603
|
const { document: c, element: u, attributes: o, isRoot: h } = l;
|
|
5604
5604
|
for (const m of o)
|
|
5605
|
-
if (!
|
|
5605
|
+
if (!Ai(m))
|
|
5606
5606
|
if (wa(m)) {
|
|
5607
5607
|
const y = m.namespace?.prefix || "";
|
|
5608
5608
|
!h && y && Aa({
|
|
@@ -5619,7 +5619,7 @@ function Aa(l) {
|
|
|
5619
5619
|
const h = "http://www.w3.org/2000/xmlns/";
|
|
5620
5620
|
o.getAttributeNS(h, u.prefix) === null && o.setAttributeNS(h, `xmlns:${u.prefix}`, u.uri);
|
|
5621
5621
|
}
|
|
5622
|
-
function
|
|
5622
|
+
function bi(l) {
|
|
5623
5623
|
const { parentTagName: c, availableChildren: u, childrenRecords: o } = l, h = [], m = new Set(u[c]);
|
|
5624
5624
|
if (!m.size) return o;
|
|
5625
5625
|
const y = /* @__PURE__ */ new Map(), b = [];
|
|
@@ -5633,7 +5633,7 @@ function _i(l) {
|
|
|
5633
5633
|
}
|
|
5634
5634
|
return h.push(...b), h;
|
|
5635
5635
|
}
|
|
5636
|
-
function
|
|
5636
|
+
function Ci(l) {
|
|
5637
5637
|
const { childrenRecords: c, parentRecord: u } = l, o = c.map((h, m) => h === void 0 ? m : -1).filter((h) => h !== -1);
|
|
5638
5638
|
if (o.length > 0) {
|
|
5639
5639
|
const h = o.map((m) => {
|
|
@@ -5648,15 +5648,15 @@ function bi(l) {
|
|
|
5648
5648
|
function wa(l) {
|
|
5649
5649
|
return l !== null && typeof l == "object" && "namespace" in l && !!l.namespace;
|
|
5650
5650
|
}
|
|
5651
|
-
function
|
|
5651
|
+
function Ai(l) {
|
|
5652
5652
|
return !!(l.name === "xmlns" || l.name.startsWith("xmlns:") || wa(l) && l.namespace?.prefix === "xmlns");
|
|
5653
5653
|
}
|
|
5654
|
-
async function
|
|
5655
|
-
const { xmlString: c, dialecteConfig: u = ma } = l, o = `test-${crypto.randomUUID()}.xml`, h = new File([c], o, { type: "text/xml" }), y = (await
|
|
5654
|
+
async function Ts(l) {
|
|
5655
|
+
const { xmlString: c, dialecteConfig: u = ma } = l, o = `test-${crypto.randomUUID()}.xml`, h = new File([c], o, { type: "text/xml" }), y = (await si({
|
|
5656
5656
|
files: [h],
|
|
5657
5657
|
dialecteConfig: u,
|
|
5658
5658
|
useCustomRecordsIds: !0
|
|
5659
|
-
}))[0], b = await
|
|
5659
|
+
}))[0], b = await jo({
|
|
5660
5660
|
databaseName: y,
|
|
5661
5661
|
dialecteConfig: u
|
|
5662
5662
|
}), R = b.getDatabaseInstance();
|
|
@@ -5664,7 +5664,7 @@ async function xs(l) {
|
|
|
5664
5664
|
R?.isOpen() && (R.close(), await new Promise((q) => setTimeout(q, 20))), await ct.delete(y);
|
|
5665
5665
|
} };
|
|
5666
5666
|
}
|
|
5667
|
-
async function
|
|
5667
|
+
async function Ns(l) {
|
|
5668
5668
|
const { chain: c, operations: u } = l;
|
|
5669
5669
|
let o = c;
|
|
5670
5670
|
for (const m of u)
|
|
@@ -5698,7 +5698,7 @@ async function Ts(l) {
|
|
|
5698
5698
|
const h = await o.getContext();
|
|
5699
5699
|
return await o.commit(), h;
|
|
5700
5700
|
}
|
|
5701
|
-
function
|
|
5701
|
+
function wi(l) {
|
|
5702
5702
|
const { contextPromise: c, dialecteConfig: u, databaseInstance: o } = l;
|
|
5703
5703
|
return async function() {
|
|
5704
5704
|
const h = await c;
|
|
@@ -5714,7 +5714,7 @@ function Ai(l) {
|
|
|
5714
5714
|
return Ee(m, "Parent record not found"), m;
|
|
5715
5715
|
};
|
|
5716
5716
|
}
|
|
5717
|
-
function
|
|
5717
|
+
function Bi(l) {
|
|
5718
5718
|
const { contextPromise: c, dialecteConfig: u, databaseInstance: o } = l;
|
|
5719
5719
|
return async function(h) {
|
|
5720
5720
|
const m = await c, y = {};
|
|
@@ -5734,7 +5734,7 @@ function wi(l) {
|
|
|
5734
5734
|
function Ba(l) {
|
|
5735
5735
|
const { contextPromise: c, dialecteConfig: u, databaseInstance: o } = l;
|
|
5736
5736
|
return async function(h = {}) {
|
|
5737
|
-
const { include: m, exclude: y, unwrap: b } = h, R = await c, P = await
|
|
5737
|
+
const { include: m, exclude: y, unwrap: b } = h, R = await c, P = await Ei({
|
|
5738
5738
|
root: R.currentFocus,
|
|
5739
5739
|
context: R,
|
|
5740
5740
|
dialecteConfig: u,
|
|
@@ -5742,16 +5742,16 @@ function Ba(l) {
|
|
|
5742
5742
|
include: m,
|
|
5743
5743
|
exclude: y
|
|
5744
5744
|
});
|
|
5745
|
-
return P ? b ?
|
|
5745
|
+
return P ? b ? Di({ tree: P, unwrapTagNames: b }) : P : Nn({ record: R.currentFocus });
|
|
5746
5746
|
};
|
|
5747
5747
|
}
|
|
5748
|
-
async function
|
|
5748
|
+
async function Ei(l) {
|
|
5749
5749
|
const { root: c, context: u, dialecteConfig: o, databaseInstance: h, include: m, exclude: y } = l;
|
|
5750
5750
|
async function b(R) {
|
|
5751
5751
|
const { record: P, includeFilter: q } = R;
|
|
5752
|
-
if (
|
|
5752
|
+
if (xi({ record: P, excludeFilters: y }))
|
|
5753
5753
|
return Nn({ record: P });
|
|
5754
|
-
const G = await
|
|
5754
|
+
const G = await Ni({
|
|
5755
5755
|
record: P,
|
|
5756
5756
|
context: u,
|
|
5757
5757
|
dialecteConfig: o,
|
|
@@ -5760,7 +5760,7 @@ async function Bi(l) {
|
|
|
5760
5760
|
excludeFilters: y
|
|
5761
5761
|
}), H = (await Promise.all(
|
|
5762
5762
|
G.map(
|
|
5763
|
-
({ record: M, includeFilter:
|
|
5763
|
+
({ record: M, includeFilter: k }) => b({ record: M, includeFilter: k })
|
|
5764
5764
|
)
|
|
5765
5765
|
)).filter(
|
|
5766
5766
|
(M) => M !== null
|
|
@@ -5769,15 +5769,15 @@ async function Bi(l) {
|
|
|
5769
5769
|
}
|
|
5770
5770
|
return b({ record: c, includeFilter: m });
|
|
5771
5771
|
}
|
|
5772
|
-
function
|
|
5772
|
+
function xi(l) {
|
|
5773
5773
|
const { record: c, excludeFilters: u } = l;
|
|
5774
5774
|
return u ? u.some((o) => (o.scope ?? "self") !== "children" ? !1 : Rn({ record: c, filter: o })) : !1;
|
|
5775
5775
|
}
|
|
5776
|
-
function
|
|
5776
|
+
function Ti(l) {
|
|
5777
5777
|
const { record: c, excludeFilters: u } = l;
|
|
5778
5778
|
return u ? u.some((o) => (o.scope ?? "self") !== "self" ? !1 : Rn({ record: c, filter: o })) : !1;
|
|
5779
5779
|
}
|
|
5780
|
-
async function
|
|
5780
|
+
async function Ni(l) {
|
|
5781
5781
|
const {
|
|
5782
5782
|
record: c,
|
|
5783
5783
|
context: u,
|
|
@@ -5785,17 +5785,17 @@ async function Ti(l) {
|
|
|
5785
5785
|
databaseInstance: h,
|
|
5786
5786
|
currentIncludeFilter: m,
|
|
5787
5787
|
excludeFilters: y
|
|
5788
|
-
} = l, R = (await
|
|
5788
|
+
} = l, R = (await Oi({
|
|
5789
5789
|
record: c,
|
|
5790
5790
|
context: u,
|
|
5791
5791
|
dialecteConfig: o,
|
|
5792
5792
|
databaseInstance: h
|
|
5793
5793
|
})).filter(
|
|
5794
|
-
(P) => !
|
|
5794
|
+
(P) => !Ti({ record: P, excludeFilters: y })
|
|
5795
5795
|
);
|
|
5796
|
-
return
|
|
5796
|
+
return Ri({ children: R, currentIncludeFilter: m });
|
|
5797
5797
|
}
|
|
5798
|
-
async function
|
|
5798
|
+
async function Oi(l) {
|
|
5799
5799
|
const { record: c, context: u, dialecteConfig: o, databaseInstance: h } = l;
|
|
5800
5800
|
return c.children?.length ? (await Promise.all(
|
|
5801
5801
|
c.children.map(
|
|
@@ -5812,7 +5812,7 @@ async function Ni(l) {
|
|
|
5812
5812
|
(y) => !!y
|
|
5813
5813
|
) : [];
|
|
5814
5814
|
}
|
|
5815
|
-
function
|
|
5815
|
+
function Ri(l) {
|
|
5816
5816
|
const { children: c, currentIncludeFilter: u } = l;
|
|
5817
5817
|
if (!u)
|
|
5818
5818
|
return c.map((h) => ({ record: h, includeFilter: void 0 }));
|
|
@@ -5822,7 +5822,7 @@ function Oi(l) {
|
|
|
5822
5822
|
if (u.children && u.children.length > 0) {
|
|
5823
5823
|
const h = [];
|
|
5824
5824
|
for (const m of o) {
|
|
5825
|
-
const y =
|
|
5825
|
+
const y = Ii({
|
|
5826
5826
|
child: m,
|
|
5827
5827
|
branches: u.children
|
|
5828
5828
|
});
|
|
@@ -5832,7 +5832,7 @@ function Oi(l) {
|
|
|
5832
5832
|
}
|
|
5833
5833
|
return o.map((h) => ({ record: h, includeFilter: void 0 }));
|
|
5834
5834
|
}
|
|
5835
|
-
function
|
|
5835
|
+
function Ii(l) {
|
|
5836
5836
|
const { child: c, branches: u } = l;
|
|
5837
5837
|
return u.find((o) => Rn({ record: c, filter: o }));
|
|
5838
5838
|
}
|
|
@@ -5840,7 +5840,7 @@ function Rn(l) {
|
|
|
5840
5840
|
const { record: c, filter: u } = l;
|
|
5841
5841
|
return c.tagName !== u.tagName ? !1 : u.attributes ? gr(c, u.attributes) : !0;
|
|
5842
5842
|
}
|
|
5843
|
-
function
|
|
5843
|
+
function Di(l) {
|
|
5844
5844
|
const { tree: c, unwrapTagNames: u } = l;
|
|
5845
5845
|
function o(h) {
|
|
5846
5846
|
return h.flatMap((m) => u.includes(m.tagName) ? o(m.tree) : [
|
|
@@ -5868,7 +5868,7 @@ function xa(l) {
|
|
|
5868
5868
|
const c = [l.tagName];
|
|
5869
5869
|
return l.descendant && c.push(...xa(l.descendant)), c;
|
|
5870
5870
|
}
|
|
5871
|
-
function
|
|
5871
|
+
function Pi(l) {
|
|
5872
5872
|
const c = [];
|
|
5873
5873
|
function u(o) {
|
|
5874
5874
|
if (o.tree?.length)
|
|
@@ -5877,7 +5877,7 @@ function Di(l) {
|
|
|
5877
5877
|
}
|
|
5878
5878
|
return u(l), c;
|
|
5879
5879
|
}
|
|
5880
|
-
function
|
|
5880
|
+
function Si(l) {
|
|
5881
5881
|
const c = /* @__PURE__ */ new Map();
|
|
5882
5882
|
for (const [u, o] of l.entries()) {
|
|
5883
5883
|
const h = /* @__PURE__ */ new Map();
|
|
@@ -5887,7 +5887,7 @@ function Pi(l) {
|
|
|
5887
5887
|
}
|
|
5888
5888
|
return c;
|
|
5889
5889
|
}
|
|
5890
|
-
function
|
|
5890
|
+
function Fi(l, c) {
|
|
5891
5891
|
const u = {};
|
|
5892
5892
|
for (const o of c)
|
|
5893
5893
|
u[o] = l.get(o) || [];
|
|
@@ -5896,7 +5896,7 @@ function Si(l, c) {
|
|
|
5896
5896
|
async function ki(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 G = await
|
|
5899
|
+
const G = await Mi({
|
|
5900
5900
|
candidate: q,
|
|
5901
5901
|
focus: m,
|
|
5902
5902
|
context: c,
|
|
@@ -5905,14 +5905,14 @@ async function ki(l) {
|
|
|
5905
5905
|
path: y,
|
|
5906
5906
|
shouldCollect: !0
|
|
5907
5907
|
});
|
|
5908
|
-
G.valid && G.ancestors &&
|
|
5908
|
+
G.valid && G.ancestors && Ui(G.ancestors, b, R);
|
|
5909
5909
|
}
|
|
5910
|
-
const P =
|
|
5911
|
-
return
|
|
5910
|
+
const P = Si(R);
|
|
5911
|
+
return Fi(P, b);
|
|
5912
5912
|
}
|
|
5913
|
-
async function
|
|
5913
|
+
async function Mi(l) {
|
|
5914
5914
|
const { candidate: c, focus: u, context: o, dialecteConfig: h, databaseInstance: m, path: y, shouldCollect: b } = l;
|
|
5915
|
-
return c.id === u.id ? { valid: !1 } : y ?
|
|
5915
|
+
return c.id === u.id ? { valid: !1 } : y ? Ki({
|
|
5916
5916
|
candidate: c,
|
|
5917
5917
|
focus: u,
|
|
5918
5918
|
context: o,
|
|
@@ -5920,7 +5920,7 @@ async function Fi(l) {
|
|
|
5920
5920
|
databaseInstance: m,
|
|
5921
5921
|
path: y,
|
|
5922
5922
|
shouldCollect: b
|
|
5923
|
-
}) :
|
|
5923
|
+
}) : ji({
|
|
5924
5924
|
candidate: c,
|
|
5925
5925
|
focus: u,
|
|
5926
5926
|
context: o,
|
|
@@ -5928,12 +5928,12 @@ async function Fi(l) {
|
|
|
5928
5928
|
databaseInstance: m
|
|
5929
5929
|
});
|
|
5930
5930
|
}
|
|
5931
|
-
async function
|
|
5931
|
+
async function ji(l) {
|
|
5932
5932
|
const { candidate: c, focus: u, context: o, dialecteConfig: h, databaseInstance: m } = l;
|
|
5933
5933
|
let y = c.parent;
|
|
5934
5934
|
for (; y; ) {
|
|
5935
5935
|
if (y.id === u.id && y.tagName === u.tagName)
|
|
5936
|
-
return { valid: !0, ancestors: await
|
|
5936
|
+
return { valid: !0, ancestors: await Li({
|
|
5937
5937
|
from: c,
|
|
5938
5938
|
toFocus: u,
|
|
5939
5939
|
context: o,
|
|
@@ -5953,11 +5953,11 @@ async function Mi(l) {
|
|
|
5953
5953
|
}
|
|
5954
5954
|
return { valid: !1 };
|
|
5955
5955
|
}
|
|
5956
|
-
async function
|
|
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
5959
|
for (let G = y.length - 1; G >= 0; G--) {
|
|
5960
|
-
const z = y[G], H = await
|
|
5960
|
+
const z = y[G], H = await qi({
|
|
5961
5961
|
current: P,
|
|
5962
5962
|
expected: z,
|
|
5963
5963
|
context: o,
|
|
@@ -5969,7 +5969,7 @@ async function ji(l) {
|
|
|
5969
5969
|
}
|
|
5970
5970
|
return { valid: P?.id === u.id && P?.tagName === u.tagName, ancestors: b ? R : void 0 };
|
|
5971
5971
|
}
|
|
5972
|
-
async function
|
|
5972
|
+
async function qi(l) {
|
|
5973
5973
|
const { current: c, expected: u, context: o, dialecteConfig: h, databaseInstance: m } = l;
|
|
5974
5974
|
let y = c;
|
|
5975
5975
|
for (; y; ) {
|
|
@@ -6007,7 +6007,7 @@ async function Ki(l) {
|
|
|
6007
6007
|
}
|
|
6008
6008
|
return { found: !1 };
|
|
6009
6009
|
}
|
|
6010
|
-
async function
|
|
6010
|
+
async function Li(l) {
|
|
6011
6011
|
const { from: c, toFocus: u, context: o, dialecteConfig: h, databaseInstance: m } = l, y = [c];
|
|
6012
6012
|
let b = c.parent;
|
|
6013
6013
|
for (; b && !(b.id === u.id && b.tagName === u.tagName); ) {
|
|
@@ -6026,20 +6026,20 @@ async function qi(l) {
|
|
|
6026
6026
|
}
|
|
6027
6027
|
return y;
|
|
6028
6028
|
}
|
|
6029
|
-
function
|
|
6029
|
+
function Ui(l, c, u) {
|
|
6030
6030
|
for (const o of l)
|
|
6031
6031
|
c.has(o.tagName) && (u.has(o.tagName) || u.set(o.tagName, []), u.get(o.tagName).push(o));
|
|
6032
6032
|
}
|
|
6033
|
-
function
|
|
6033
|
+
function $i(l) {
|
|
6034
6034
|
const { contextPromise: c, dialecteConfig: u, databaseInstance: o } = l;
|
|
6035
6035
|
async function h(m) {
|
|
6036
6036
|
const y = await c;
|
|
6037
|
-
return m ?
|
|
6037
|
+
return m ? Gi({
|
|
6038
6038
|
context: y,
|
|
6039
6039
|
dialecteConfig: u,
|
|
6040
6040
|
databaseInstance: o,
|
|
6041
6041
|
filter: m
|
|
6042
|
-
}) :
|
|
6042
|
+
}) : Vi({
|
|
6043
6043
|
contextPromise: c,
|
|
6044
6044
|
dialecteConfig: u,
|
|
6045
6045
|
databaseInstance: o,
|
|
@@ -6048,15 +6048,15 @@ function Ui(l) {
|
|
|
6048
6048
|
}
|
|
6049
6049
|
return h;
|
|
6050
6050
|
}
|
|
6051
|
-
async function
|
|
6052
|
-
const { contextPromise: c, dialecteConfig: u, databaseInstance: o, currentElement: h } = l, y = await Ba({ contextPromise: c, dialecteConfig: u, databaseInstance: o })(), b =
|
|
6051
|
+
async function Vi(l) {
|
|
6052
|
+
const { contextPromise: c, dialecteConfig: u, databaseInstance: o, currentElement: h } = l, y = await Ba({ contextPromise: c, dialecteConfig: u, databaseInstance: o })(), b = Pi(y), R = [h, ...u.descendants[h]], P = {};
|
|
6053
6053
|
for (const q of R)
|
|
6054
6054
|
P[q] = [];
|
|
6055
6055
|
for (const q of b)
|
|
6056
6056
|
P[q.tagName] && P[q.tagName].push(q);
|
|
6057
6057
|
return P;
|
|
6058
6058
|
}
|
|
6059
|
-
async function
|
|
6059
|
+
async function Gi(l) {
|
|
6060
6060
|
const { context: c, dialecteConfig: u, databaseInstance: o, filter: h } = l, m = new Set(xa(h)), y = Ea(h), b = y[y.length - 1], R = y.slice(0, -1), P = await fa({
|
|
6061
6061
|
context: c,
|
|
6062
6062
|
dialecteConfig: u,
|
|
@@ -6074,7 +6074,14 @@ async function Vi(l) {
|
|
|
6074
6074
|
collectTags: m
|
|
6075
6075
|
});
|
|
6076
6076
|
}
|
|
6077
|
-
function
|
|
6077
|
+
function Xi(l) {
|
|
6078
|
+
const { contextPromise: c } = l;
|
|
6079
|
+
return async function() {
|
|
6080
|
+
const u = await c;
|
|
6081
|
+
return ao({ attributes: u.currentFocus.attributes });
|
|
6082
|
+
};
|
|
6083
|
+
}
|
|
6084
|
+
function Wi(l) {
|
|
6078
6085
|
const c = /* @__PURE__ */ new Map();
|
|
6079
6086
|
for (const o of l) {
|
|
6080
6087
|
const h = (o.status === "deleted" ? o.oldRecord : o.newRecord).id, m = c.get(h);
|
|
@@ -6103,7 +6110,7 @@ function Gi(l) {
|
|
|
6103
6110
|
deletes: u.filter((o) => o.status === "deleted")
|
|
6104
6111
|
};
|
|
6105
6112
|
}
|
|
6106
|
-
const
|
|
6113
|
+
const Yi = {
|
|
6107
6114
|
// 000-099: Generic errors
|
|
6108
6115
|
UNKNOWN_ERROR: {
|
|
6109
6116
|
code: "D001",
|
|
@@ -6148,12 +6155,12 @@ const Xi = {
|
|
|
6148
6155
|
// 500-599: Flavor configuration errors
|
|
6149
6156
|
};
|
|
6150
6157
|
function Ta(l) {
|
|
6151
|
-
const { errorKey: c, messageOverride: u, context: o } = l, { code: h, message: m } =
|
|
6158
|
+
const { errorKey: c, messageOverride: u, context: o } = l, { code: h, message: m } = Yi[c], y = new Error(u ?? m);
|
|
6152
6159
|
return y.code = h, y.errorKey = c, y.defaultMessage = m, y.context = o, y;
|
|
6153
6160
|
}
|
|
6154
|
-
function
|
|
6161
|
+
function zi(l) {
|
|
6155
6162
|
return async function() {
|
|
6156
|
-
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 } =
|
|
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), G = R.length + P.length + q.length;
|
|
6157
6164
|
st.updateEndingProgress({
|
|
6158
6165
|
current: 0,
|
|
6159
6166
|
total: G,
|
|
@@ -6190,7 +6197,7 @@ function Wi(l) {
|
|
|
6190
6197
|
}
|
|
6191
6198
|
};
|
|
6192
6199
|
}
|
|
6193
|
-
function
|
|
6200
|
+
function Qi(l) {
|
|
6194
6201
|
const { chain: c, contextPromise: u, dialecteConfig: o } = l;
|
|
6195
6202
|
return function(h) {
|
|
6196
6203
|
const { id: m, tagName: y, attributes: b, namespace: R, value: P, setFocus: q = !1 } = h, G = m ?? crypto.randomUUID(), z = u.then((H) => {
|
|
@@ -6205,20 +6212,20 @@ function Yi(l) {
|
|
|
6205
6212
|
value: P
|
|
6206
6213
|
},
|
|
6207
6214
|
dialecteConfig: o
|
|
6208
|
-
}), { childRecord:
|
|
6215
|
+
}), { childRecord: k, updatedParent: J } = Hi({
|
|
6209
6216
|
record: M,
|
|
6210
6217
|
context: H,
|
|
6211
6218
|
dialecteConfig: o
|
|
6212
6219
|
});
|
|
6213
6220
|
return q ? {
|
|
6214
6221
|
...H,
|
|
6215
|
-
currentFocus:
|
|
6222
|
+
currentFocus: k
|
|
6216
6223
|
} : {
|
|
6217
6224
|
...H,
|
|
6218
6225
|
currentFocus: J
|
|
6219
6226
|
};
|
|
6220
6227
|
} catch (M) {
|
|
6221
|
-
const
|
|
6228
|
+
const k = Ta({
|
|
6222
6229
|
errorKey: "CREATE_CHILD_ERROR",
|
|
6223
6230
|
context: {
|
|
6224
6231
|
method: "addChild",
|
|
@@ -6228,7 +6235,7 @@ function Yi(l) {
|
|
|
6228
6235
|
originalError: M
|
|
6229
6236
|
}
|
|
6230
6237
|
});
|
|
6231
|
-
throw st.setError(
|
|
6238
|
+
throw st.setError(k), k;
|
|
6232
6239
|
}
|
|
6233
6240
|
});
|
|
6234
6241
|
return c(q ? {
|
|
@@ -6238,7 +6245,7 @@ function Yi(l) {
|
|
|
6238
6245
|
});
|
|
6239
6246
|
};
|
|
6240
6247
|
}
|
|
6241
|
-
function
|
|
6248
|
+
function Hi(l) {
|
|
6242
6249
|
const { record: c, context: u, dialecteConfig: o } = l, h = {
|
|
6243
6250
|
...c,
|
|
6244
6251
|
parent: { id: u.currentFocus.id, tagName: u.currentFocus.tagName },
|
|
@@ -6279,7 +6286,7 @@ function zi(l) {
|
|
|
6279
6286
|
updatedParent: Pe({ record: m, status: "updated" })
|
|
6280
6287
|
};
|
|
6281
6288
|
}
|
|
6282
|
-
function
|
|
6289
|
+
function Zi(l) {
|
|
6283
6290
|
const { chain: c, contextPromise: u } = l;
|
|
6284
6291
|
return function(o) {
|
|
6285
6292
|
const { record: h, setFocus: m } = o, y = u.then(async (b) => {
|
|
@@ -6292,7 +6299,7 @@ function Qi(l) {
|
|
|
6292
6299
|
});
|
|
6293
6300
|
async function q(G) {
|
|
6294
6301
|
const { chain: z, childRecord: H } = G;
|
|
6295
|
-
let
|
|
6302
|
+
let k = z.addChild({
|
|
6296
6303
|
tagName: H.tagName,
|
|
6297
6304
|
namespace: H.namespace,
|
|
6298
6305
|
attributes: H.attributes,
|
|
@@ -6300,8 +6307,8 @@ function Qi(l) {
|
|
|
6300
6307
|
setFocus: !0
|
|
6301
6308
|
});
|
|
6302
6309
|
for (const J of H.tree)
|
|
6303
|
-
|
|
6304
|
-
return
|
|
6310
|
+
k = await q({ chain: k, childRecord: J }), k = k.goToParent();
|
|
6311
|
+
return k;
|
|
6305
6312
|
}
|
|
6306
6313
|
return m || (P = P.goToParent()), await P.getContext();
|
|
6307
6314
|
});
|
|
@@ -6312,7 +6319,7 @@ function Qi(l) {
|
|
|
6312
6319
|
});
|
|
6313
6320
|
};
|
|
6314
6321
|
}
|
|
6315
|
-
function
|
|
6322
|
+
function Ji(l) {
|
|
6316
6323
|
const { chain: c, contextPromise: u, dialecteConfig: o } = l;
|
|
6317
6324
|
return function(h) {
|
|
6318
6325
|
const { attributes: m, value: y } = h, b = u.then(async (R) => {
|
|
@@ -6325,7 +6332,7 @@ function Hi(l) {
|
|
|
6325
6332
|
dialecteConfig: o
|
|
6326
6333
|
});
|
|
6327
6334
|
q = [...P.attributes.filter(
|
|
6328
|
-
(M) => !z.some((
|
|
6335
|
+
(M) => !z.some((k) => k.name === M.name)
|
|
6329
6336
|
), ...z];
|
|
6330
6337
|
}
|
|
6331
6338
|
const G = {
|
|
@@ -6346,7 +6353,7 @@ function Hi(l) {
|
|
|
6346
6353
|
return c({ contextPromise: b });
|
|
6347
6354
|
};
|
|
6348
6355
|
}
|
|
6349
|
-
function
|
|
6356
|
+
function es(l) {
|
|
6350
6357
|
const { chain: c, contextPromise: u, dialecteConfig: o, databaseInstance: h } = l;
|
|
6351
6358
|
return function() {
|
|
6352
6359
|
const m = u.then(async (y) => {
|
|
@@ -6361,7 +6368,7 @@ function Zi(l) {
|
|
|
6361
6368
|
databaseInstance: h,
|
|
6362
6369
|
currentChild: b
|
|
6363
6370
|
});
|
|
6364
|
-
const R = await
|
|
6371
|
+
const R = await ts({
|
|
6365
6372
|
context: y,
|
|
6366
6373
|
dialecteConfig: o,
|
|
6367
6374
|
databaseInstance: h
|
|
@@ -6398,7 +6405,7 @@ async function Na(l) {
|
|
|
6398
6405
|
}));
|
|
6399
6406
|
}
|
|
6400
6407
|
}
|
|
6401
|
-
async function
|
|
6408
|
+
async function ts(l) {
|
|
6402
6409
|
const { context: c, dialecteConfig: u, databaseInstance: o } = l, h = c.currentFocus.parent;
|
|
6403
6410
|
Ee(h, "Cannot delete root element");
|
|
6404
6411
|
const m = await Ye({
|
|
@@ -6420,7 +6427,7 @@ async function Ji(l) {
|
|
|
6420
6427
|
newRecord: y
|
|
6421
6428
|
}), Pe({ record: y, status: "updated" });
|
|
6422
6429
|
}
|
|
6423
|
-
function
|
|
6430
|
+
function ns(l) {
|
|
6424
6431
|
const { chain: c, contextPromise: u, dialecteConfig: o, databaseInstance: h } = l;
|
|
6425
6432
|
return function(y) {
|
|
6426
6433
|
const { tagName: b, id: R } = y, P = o.database.tables.xmlElements.name, q = u.then(async (G) => {
|
|
@@ -6431,10 +6438,10 @@ function es(l) {
|
|
|
6431
6438
|
}) : null;
|
|
6432
6439
|
let M = H?.status !== "deleted" ? H?.record : void 0;
|
|
6433
6440
|
if (!M) {
|
|
6434
|
-
const
|
|
6441
|
+
const k = h.table(P);
|
|
6435
6442
|
if (!R && !z)
|
|
6436
6443
|
throw new Error(`Element ${b} requires an id parameter`);
|
|
6437
|
-
M = await (z && !R ?
|
|
6444
|
+
M = await (z && !R ? k.where("tagName").equals(b).first() : k.get({ id: R, tagName: b }));
|
|
6438
6445
|
}
|
|
6439
6446
|
return Ee(
|
|
6440
6447
|
M,
|
|
@@ -6452,7 +6459,7 @@ function es(l) {
|
|
|
6452
6459
|
});
|
|
6453
6460
|
};
|
|
6454
6461
|
}
|
|
6455
|
-
function
|
|
6462
|
+
function rs(l) {
|
|
6456
6463
|
const { chain: c, contextPromise: u, dialecteConfig: o, databaseInstance: h } = l;
|
|
6457
6464
|
return function() {
|
|
6458
6465
|
const y = u.then(async (b) => {
|
|
@@ -6481,24 +6488,24 @@ function ts(l) {
|
|
|
6481
6488
|
return c({ contextPromise: y });
|
|
6482
6489
|
};
|
|
6483
6490
|
}
|
|
6484
|
-
function
|
|
6491
|
+
function as(l) {
|
|
6485
6492
|
const { chain: c, contextPromise: u, dialecteConfig: o, databaseInstance: h } = l;
|
|
6486
6493
|
return {
|
|
6487
6494
|
//== Navigation
|
|
6488
|
-
goToElement:
|
|
6495
|
+
goToElement: ns({
|
|
6489
6496
|
chain: c,
|
|
6490
6497
|
contextPromise: u,
|
|
6491
6498
|
dialecteConfig: o,
|
|
6492
6499
|
databaseInstance: h
|
|
6493
6500
|
}),
|
|
6494
|
-
goToParent:
|
|
6501
|
+
goToParent: rs({ chain: c, contextPromise: u, dialecteConfig: o, databaseInstance: h }),
|
|
6495
6502
|
//== Queries
|
|
6496
|
-
findChildren:
|
|
6503
|
+
findChildren: Bi({
|
|
6497
6504
|
contextPromise: u,
|
|
6498
6505
|
dialecteConfig: o,
|
|
6499
6506
|
databaseInstance: h
|
|
6500
6507
|
}),
|
|
6501
|
-
findDescendants:
|
|
6508
|
+
findDescendants: $i({
|
|
6502
6509
|
contextPromise: u,
|
|
6503
6510
|
dialecteConfig: o,
|
|
6504
6511
|
databaseInstance: h
|
|
@@ -6508,22 +6515,25 @@ function ns(l) {
|
|
|
6508
6515
|
dialecteConfig: o,
|
|
6509
6516
|
databaseInstance: h
|
|
6510
6517
|
}),
|
|
6518
|
+
getAttributesValues: Xi({
|
|
6519
|
+
contextPromise: u
|
|
6520
|
+
}),
|
|
6511
6521
|
//== Mutations
|
|
6512
|
-
addChild:
|
|
6522
|
+
addChild: Qi({
|
|
6513
6523
|
chain: c,
|
|
6514
6524
|
contextPromise: u,
|
|
6515
6525
|
dialecteConfig: o
|
|
6516
6526
|
}),
|
|
6517
|
-
deepCloneChild:
|
|
6527
|
+
deepCloneChild: Zi({
|
|
6518
6528
|
chain: c,
|
|
6519
6529
|
contextPromise: u
|
|
6520
6530
|
}),
|
|
6521
|
-
update:
|
|
6531
|
+
update: Ji({
|
|
6522
6532
|
chain: c,
|
|
6523
6533
|
contextPromise: u,
|
|
6524
6534
|
dialecteConfig: o
|
|
6525
6535
|
}),
|
|
6526
|
-
delete:
|
|
6536
|
+
delete: es({
|
|
6527
6537
|
chain: c,
|
|
6528
6538
|
contextPromise: u,
|
|
6529
6539
|
dialecteConfig: o,
|
|
@@ -6533,19 +6543,19 @@ function ns(l) {
|
|
|
6533
6543
|
getContext: eo({
|
|
6534
6544
|
contextPromise: u
|
|
6535
6545
|
}),
|
|
6536
|
-
getParent:
|
|
6546
|
+
getParent: wi({
|
|
6537
6547
|
contextPromise: u,
|
|
6538
6548
|
dialecteConfig: o,
|
|
6539
6549
|
databaseInstance: h
|
|
6540
6550
|
}),
|
|
6541
|
-
commit:
|
|
6551
|
+
commit: zi({
|
|
6542
6552
|
contextPromise: u,
|
|
6543
6553
|
dialecteConfig: o,
|
|
6544
6554
|
databaseInstance: h
|
|
6545
6555
|
})
|
|
6546
6556
|
};
|
|
6547
6557
|
}
|
|
6548
|
-
function
|
|
6558
|
+
function os(l) {
|
|
6549
6559
|
const { coreChain: c, tagName: u, chain: o, dialecteConfig: h, contextPromise: m } = l, y = { ...c }, b = h.extensions[u] || {};
|
|
6550
6560
|
for (const [R, P] of Object.entries(b))
|
|
6551
6561
|
y[R] = P({
|
|
@@ -6566,13 +6576,13 @@ function vr(l) {
|
|
|
6566
6576
|
tagName: h
|
|
6567
6577
|
});
|
|
6568
6578
|
}
|
|
6569
|
-
const y =
|
|
6579
|
+
const y = as({
|
|
6570
6580
|
chain: m,
|
|
6571
6581
|
dialecteConfig: c,
|
|
6572
6582
|
databaseInstance: u,
|
|
6573
6583
|
contextPromise: o
|
|
6574
6584
|
});
|
|
6575
|
-
return
|
|
6585
|
+
return os({
|
|
6576
6586
|
coreChain: y,
|
|
6577
6587
|
tagName: h,
|
|
6578
6588
|
chain: m,
|
|
@@ -6581,44 +6591,44 @@ function vr(l) {
|
|
|
6581
6591
|
});
|
|
6582
6592
|
}
|
|
6583
6593
|
export {
|
|
6584
|
-
|
|
6585
|
-
|
|
6594
|
+
Ao as DATABASE_CONFIG,
|
|
6595
|
+
io as DEV_CUSTOM_RECORD_ID_ATTRIBUTE_NAME,
|
|
6586
6596
|
da as DEV_ID,
|
|
6587
6597
|
qe as DIALECTE_NAMESPACES,
|
|
6588
|
-
|
|
6598
|
+
Co as IO_CONFIG,
|
|
6589
6599
|
va as TEMP_IDB_ID_ATTRIBUTE_NAME,
|
|
6590
6600
|
ma as TEST_DIALECTE_CONFIG,
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6601
|
+
cs as XMLNS_DEFAULT_NAMESPACE,
|
|
6602
|
+
ls as XMLNS_DEV_NAMESPACE,
|
|
6603
|
+
fs as XMLNS_EXT_NAMESPACE,
|
|
6594
6604
|
ut as addStagedOperation,
|
|
6595
6605
|
Ee as assert,
|
|
6596
|
-
|
|
6606
|
+
Ko as bulkAddRecords,
|
|
6597
6607
|
vr as chain,
|
|
6598
6608
|
ga as createDatabaseInstance,
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6609
|
+
jo as createDialecte,
|
|
6610
|
+
Ts as createTestDialecte,
|
|
6611
|
+
ds as createTestRecord,
|
|
6612
|
+
Bs as deleteDatabaseIfExists,
|
|
6603
6613
|
st as dialecteState,
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6614
|
+
Ns as executeChainOperations,
|
|
6615
|
+
xs as exportXmlDocumentForOpenSCD,
|
|
6616
|
+
Es as exportXmlFile,
|
|
6617
|
+
oo as fetchRecords,
|
|
6608
6618
|
fa as findByAttributes,
|
|
6609
|
-
|
|
6619
|
+
gi as formatXml,
|
|
6610
6620
|
ro as getAttributeValueByName,
|
|
6611
|
-
|
|
6612
|
-
|
|
6621
|
+
ao as getAttributesValuesByName,
|
|
6622
|
+
ci as getDatabaseName,
|
|
6613
6623
|
yr as getLatestStagedRecord,
|
|
6614
6624
|
Ye as getRecord,
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6625
|
+
Fo as getState,
|
|
6626
|
+
si as importXmlFiles,
|
|
6627
|
+
ss as isChainRecord,
|
|
6628
|
+
ui as isFileSupported,
|
|
6619
6629
|
no as isFullAttributeArray,
|
|
6620
|
-
|
|
6621
|
-
|
|
6630
|
+
is as isRawRecord,
|
|
6631
|
+
us as isTreeRecord,
|
|
6622
6632
|
gr as matchesAttributeFilter,
|
|
6623
6633
|
ya as resetState,
|
|
6624
6634
|
la as standardizeRecord,
|