@dialecte/core 0.1.14 → 0.1.15
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/{index-C0cfg2Wc.js → index-CTxx1Jfv.js} +168 -168
- package/dist/index.js +1 -1
- package/dist/test.js +1 -1
- package/package.json +1 -1
|
@@ -88,11 +88,11 @@ async function xe(m) {
|
|
|
88
88
|
}
|
|
89
89
|
let i;
|
|
90
90
|
if (l.id === void 0) {
|
|
91
|
-
const d = `__singleton_${l.tagName}`, h =
|
|
92
|
-
h ? i = h : (i = (await s.store.getByTagName(l.tagName))[0], i &&
|
|
91
|
+
const d = `__singleton_${l.tagName}`, h = $t(s) ? s.recordCache.get(d) : void 0;
|
|
92
|
+
h ? i = h : (i = (await s.store.getByTagName(l.tagName))[0], i && $t(s) && (s.recordCache.set(i.id, i), s.recordCache.set(d, i)));
|
|
93
93
|
} else {
|
|
94
|
-
const d =
|
|
95
|
-
d ? i = d : (i = await s.store.get(l.id), i &&
|
|
94
|
+
const d = $t(s) ? s.recordCache.get(l.id) : void 0;
|
|
95
|
+
d ? i = d : (i = await s.store.get(l.id), i && $t(s) && s.recordCache.set(l.id, i));
|
|
96
96
|
}
|
|
97
97
|
if (i)
|
|
98
98
|
return { ...i, status: "unchanged" };
|
|
@@ -104,7 +104,7 @@ async function ha(m) {
|
|
|
104
104
|
async function pa(m) {
|
|
105
105
|
const { context: s, tagName: l } = m, i = await s.store.getByTagName(l);
|
|
106
106
|
for (const d of i)
|
|
107
|
-
|
|
107
|
+
$t(s) && s.recordCache.set(d.id, d);
|
|
108
108
|
return oi({ rawRecords: i, stagedOperations: s.stagedOperations, tagName: l });
|
|
109
109
|
}
|
|
110
110
|
async function si(m) {
|
|
@@ -126,9 +126,9 @@ async function ci(m) {
|
|
|
126
126
|
const { context: s, ref: l, options: i } = m, d = i?.depth ?? 1 / 0, h = i?.stopAtTagName, y = i?.order ?? "bottom-up", _ = [];
|
|
127
127
|
let D = await xe({ context: s, ref: l });
|
|
128
128
|
for (; D?.parent && _.length < d; ) {
|
|
129
|
-
const F = D.parent,
|
|
130
|
-
if (
|
|
131
|
-
D =
|
|
129
|
+
const F = D.parent, X = await xe({ context: s, ref: F });
|
|
130
|
+
if (!X || (_.push(X), h && X.tagName === h)) break;
|
|
131
|
+
D = X;
|
|
132
132
|
}
|
|
133
133
|
return y === "top-down" ? _.reverse() : _;
|
|
134
134
|
}
|
|
@@ -188,13 +188,13 @@ async function di(m) {
|
|
|
188
188
|
tagName: y.tagName
|
|
189
189
|
}), D = /* @__PURE__ */ new Map();
|
|
190
190
|
for (const F of _) {
|
|
191
|
-
const
|
|
191
|
+
const X = await pi({
|
|
192
192
|
context: s,
|
|
193
193
|
record: F,
|
|
194
194
|
targetRef: l
|
|
195
195
|
});
|
|
196
|
-
if (
|
|
197
|
-
for (const G of
|
|
196
|
+
if (X.length !== 0 && mi({ ancestry: X, conditions: d }))
|
|
197
|
+
for (const G of X)
|
|
198
198
|
h.has(G.tagName) && (D.has(G.tagName) || D.set(G.tagName, /* @__PURE__ */ new Map()), D.get(G.tagName).set(G.id, G));
|
|
199
199
|
}
|
|
200
200
|
return gi({ collected: D, collectTags: h });
|
|
@@ -640,7 +640,7 @@ function yr(m) {
|
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
async function vr(m) {
|
|
643
|
-
const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, params: y } = m, { id: _, tagName: D, attributes: F, namespace:
|
|
643
|
+
const { dialecteConfig: s, hooks: l, context: i, query: d, parentRef: h, params: y } = m, { id: _, tagName: D, attributes: F, namespace: X, value: G } = y, Q = await xe({ context: i, ref: h });
|
|
644
644
|
Ge(Q, {
|
|
645
645
|
detail: "Parent record not found",
|
|
646
646
|
key: "ELEMENT_NOT_FOUND",
|
|
@@ -653,7 +653,7 @@ async function vr(m) {
|
|
|
653
653
|
id: _ ?? crypto.randomUUID(),
|
|
654
654
|
tagName: D,
|
|
655
655
|
attributes: F,
|
|
656
|
-
namespace:
|
|
656
|
+
namespace: X,
|
|
657
657
|
value: G,
|
|
658
658
|
parent: { id: Q.id, tagName: Q.tagName },
|
|
659
659
|
children: []
|
|
@@ -694,11 +694,11 @@ async function xi(m) {
|
|
|
694
694
|
mappings: D
|
|
695
695
|
});
|
|
696
696
|
if (_.push(...D), l?.afterDeepClone) {
|
|
697
|
-
const
|
|
697
|
+
const X = await l.afterDeepClone({
|
|
698
698
|
cumulativeCloneMappings: _,
|
|
699
699
|
query: d
|
|
700
700
|
});
|
|
701
|
-
i.stagedOperations.push(
|
|
701
|
+
i.stagedOperations.push(...X);
|
|
702
702
|
}
|
|
703
703
|
return {
|
|
704
704
|
record: F,
|
|
@@ -713,7 +713,7 @@ async function wa(m) {
|
|
|
713
713
|
D = Q.shouldBeCloned, F = Q.transformedRecord;
|
|
714
714
|
}
|
|
715
715
|
if (!D) return F;
|
|
716
|
-
const
|
|
716
|
+
const X = await vr({
|
|
717
717
|
dialecteConfig: s,
|
|
718
718
|
hooks: l,
|
|
719
719
|
context: i,
|
|
@@ -730,7 +730,7 @@ async function wa(m) {
|
|
|
730
730
|
source: Object.assign(G, {
|
|
731
731
|
attributes: [...y.attributes]
|
|
732
732
|
}),
|
|
733
|
-
target: ye(
|
|
733
|
+
target: ye(X)
|
|
734
734
|
});
|
|
735
735
|
for (const Q of F.tree)
|
|
736
736
|
await wa({
|
|
@@ -738,11 +738,11 @@ async function wa(m) {
|
|
|
738
738
|
hooks: l,
|
|
739
739
|
context: i,
|
|
740
740
|
query: d,
|
|
741
|
-
parentRef: ye(
|
|
741
|
+
parentRef: ye(X),
|
|
742
742
|
record: Q,
|
|
743
743
|
mappings: _
|
|
744
744
|
});
|
|
745
|
-
return
|
|
745
|
+
return X;
|
|
746
746
|
}
|
|
747
747
|
function Ti(m) {
|
|
748
748
|
const s = /* @__PURE__ */ new Map();
|
|
@@ -855,14 +855,14 @@ async function Di(m) {
|
|
|
855
855
|
key: "ELEMENT_NOT_FOUND",
|
|
856
856
|
ref: h
|
|
857
857
|
});
|
|
858
|
-
let
|
|
858
|
+
let X = F.attributes;
|
|
859
859
|
if (_) {
|
|
860
860
|
const Q = ai({
|
|
861
861
|
dialecteConfig: s,
|
|
862
862
|
tagName: F.tagName,
|
|
863
863
|
attributes: _
|
|
864
864
|
});
|
|
865
|
-
|
|
865
|
+
X = [...F.attributes.filter(
|
|
866
866
|
(M) => !Q.some((B) => B.name === M.name)
|
|
867
867
|
), ...Q].filter(
|
|
868
868
|
(M) => M.value !== void 0 && M.value !== null
|
|
@@ -870,7 +870,7 @@ async function Di(m) {
|
|
|
870
870
|
}
|
|
871
871
|
const G = {
|
|
872
872
|
...F,
|
|
873
|
-
attributes:
|
|
873
|
+
attributes: X,
|
|
874
874
|
value: D !== void 0 ? D : F.value
|
|
875
875
|
};
|
|
876
876
|
if (Ze({ context: i, status: "updated", oldRecord: F, newRecord: G }), l?.afterUpdated) {
|
|
@@ -1062,7 +1062,7 @@ class Ii extends ba {
|
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function $t(m) {
|
|
1066
1066
|
return m.recordCache !== void 0;
|
|
1067
1067
|
}
|
|
1068
1068
|
class Ea {
|
|
@@ -1282,9 +1282,9 @@ function Pi() {
|
|
|
1282
1282
|
}), e;
|
|
1283
1283
|
}
|
|
1284
1284
|
typeof Promise > "u" || h.Promise || (h.Promise = Promise);
|
|
1285
|
-
var F = Object.getPrototypeOf,
|
|
1285
|
+
var F = Object.getPrototypeOf, X = {}.hasOwnProperty;
|
|
1286
1286
|
function G(e, t) {
|
|
1287
|
-
return
|
|
1287
|
+
return X.call(e, t);
|
|
1288
1288
|
}
|
|
1289
1289
|
function Q(e, t) {
|
|
1290
1290
|
typeof t == "function" && (t = t(F(e))), (typeof Reflect > "u" ? y : Reflect.ownKeys)(t).forEach(function(n) {
|
|
@@ -1513,10 +1513,10 @@ function Pi() {
|
|
|
1513
1513
|
if (typeof crypto > "u" || !crypto.subtle) return [e, F(e), e];
|
|
1514
1514
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
1515
1515
|
return [t, F(t), e];
|
|
1516
|
-
})(), nt = Ve[0], Le = Ve[1], Ve = Ve[2], Le = Le && Le.then,
|
|
1516
|
+
})(), nt = Ve[0], Le = Ve[1], Ve = Ve[2], Le = Le && Le.then, $e = nt && nt.constructor, Cn = !!Ve, Pt = function(e, t) {
|
|
1517
1517
|
Ft.push([e, t]), Qt && (queueMicrotask(ka), Qt = !1);
|
|
1518
1518
|
}, Dn = !0, Qt = !0, ft = [], Ht = [], In = o, rt = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: c, pgp: !1, env: {}, finalize: c }, Y = rt, Ft = [], dt = 0, Zt = [];
|
|
1519
|
-
function
|
|
1519
|
+
function $(e) {
|
|
1520
1520
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
1521
1521
|
this._listeners = [], this._lib = !1;
|
|
1522
1522
|
var t = this._PSD = Y;
|
|
@@ -1531,7 +1531,7 @@ function Pi() {
|
|
|
1531
1531
|
if (u === r) throw new TypeError("A promise cannot be resolved with itself.");
|
|
1532
1532
|
var f = r._lib && xt();
|
|
1533
1533
|
u && typeof u.then == "function" ? n(r, function(p, v) {
|
|
1534
|
-
u instanceof
|
|
1534
|
+
u instanceof $ ? u._then(p, v) : u.then(p, v);
|
|
1535
1535
|
}) : (r._state = !0, r._value = u, wr(r)), f && Tt();
|
|
1536
1536
|
}
|
|
1537
1537
|
}, Sn.bind(null, r));
|
|
@@ -1543,7 +1543,7 @@ function Pi() {
|
|
|
1543
1543
|
var Rn = { get: function() {
|
|
1544
1544
|
var e = Y, t = nn;
|
|
1545
1545
|
function n(r, a) {
|
|
1546
|
-
var u = this, f = !e.global && (e !== Y || t !== nn), p = f && !it(), v = new
|
|
1546
|
+
var u = this, f = !e.global && (e !== Y || t !== nn), p = f && !it(), v = new $(function(w, T) {
|
|
1547
1547
|
kn(u, new br(Er(r, e, f, p), Er(a, e, f, p), w, T, e));
|
|
1548
1548
|
});
|
|
1549
1549
|
return this._consoleTask && (v._consoleTask = this._consoleTask), v;
|
|
@@ -1620,7 +1620,7 @@ function Pi() {
|
|
|
1620
1620
|
for (var t = Zt.slice(0), n = t.length; n; ) t[--n]();
|
|
1621
1621
|
}
|
|
1622
1622
|
function Jt(e) {
|
|
1623
|
-
return new
|
|
1623
|
+
return new $(Fe, !1, e);
|
|
1624
1624
|
}
|
|
1625
1625
|
function pe(e, t) {
|
|
1626
1626
|
var n = Y;
|
|
@@ -1635,7 +1635,7 @@ function Pi() {
|
|
|
1635
1635
|
}
|
|
1636
1636
|
};
|
|
1637
1637
|
}
|
|
1638
|
-
Q(
|
|
1638
|
+
Q($.prototype, { then: Rn, _then: function(e, t) {
|
|
1639
1639
|
kn(this, new br(null, null, e, t, Y));
|
|
1640
1640
|
}, catch: function(e) {
|
|
1641
1641
|
if (arguments.length === 1) return this.then(null, e);
|
|
@@ -1647,42 +1647,42 @@ function Pi() {
|
|
|
1647
1647
|
});
|
|
1648
1648
|
}, finally: function(e) {
|
|
1649
1649
|
return this.then(function(t) {
|
|
1650
|
-
return
|
|
1650
|
+
return $.resolve(e()).then(function() {
|
|
1651
1651
|
return t;
|
|
1652
1652
|
});
|
|
1653
1653
|
}, function(t) {
|
|
1654
|
-
return
|
|
1654
|
+
return $.resolve(e()).then(function() {
|
|
1655
1655
|
return Jt(t);
|
|
1656
1656
|
});
|
|
1657
1657
|
});
|
|
1658
1658
|
}, timeout: function(e, t) {
|
|
1659
1659
|
var n = this;
|
|
1660
|
-
return e < 1 / 0 ? new
|
|
1660
|
+
return e < 1 / 0 ? new $(function(r, a) {
|
|
1661
1661
|
var u = setTimeout(function() {
|
|
1662
1662
|
return a(new z.Timeout(t));
|
|
1663
1663
|
}, e);
|
|
1664
1664
|
n.then(r, a).finally(clearTimeout.bind(null, u));
|
|
1665
1665
|
}) : this;
|
|
1666
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && M(
|
|
1666
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && M($.prototype, Symbol.toStringTag, "Dexie.Promise"), rt.env = _r(), Q($, { all: function() {
|
|
1667
1667
|
var e = Ie.apply(null, arguments).map(rn);
|
|
1668
|
-
return new
|
|
1668
|
+
return new $(function(t, n) {
|
|
1669
1669
|
e.length === 0 && t([]);
|
|
1670
1670
|
var r = e.length;
|
|
1671
1671
|
e.forEach(function(a, u) {
|
|
1672
|
-
return
|
|
1672
|
+
return $.resolve(a).then(function(f) {
|
|
1673
1673
|
e[u] = f, --r || t(e);
|
|
1674
1674
|
}, n);
|
|
1675
1675
|
});
|
|
1676
1676
|
});
|
|
1677
1677
|
}, resolve: function(e) {
|
|
1678
|
-
return e instanceof
|
|
1678
|
+
return e instanceof $ ? e : e && typeof e.then == "function" ? new $(function(t, n) {
|
|
1679
1679
|
e.then(t, n);
|
|
1680
|
-
}) : new
|
|
1680
|
+
}) : new $(Fe, !0, e);
|
|
1681
1681
|
}, reject: Jt, race: function() {
|
|
1682
1682
|
var e = Ie.apply(null, arguments).map(rn);
|
|
1683
|
-
return new
|
|
1683
|
+
return new $(function(t, n) {
|
|
1684
1684
|
e.map(function(r) {
|
|
1685
|
-
return
|
|
1685
|
+
return $.resolve(r).then(t, n);
|
|
1686
1686
|
});
|
|
1687
1687
|
});
|
|
1688
1688
|
}, PSD: { get: function() {
|
|
@@ -1700,7 +1700,7 @@ function Pi() {
|
|
|
1700
1700
|
}, set: function(e) {
|
|
1701
1701
|
In = e;
|
|
1702
1702
|
} }, follow: function(e, t) {
|
|
1703
|
-
return new
|
|
1703
|
+
return new $(function(n, r) {
|
|
1704
1704
|
return at(function(a, u) {
|
|
1705
1705
|
var f = Y;
|
|
1706
1706
|
f.unhandleds = [], f.onunhandled = u, f.finalize = E(function() {
|
|
@@ -1715,13 +1715,13 @@ function Pi() {
|
|
|
1715
1715
|
}, f.finalize), e();
|
|
1716
1716
|
}, t, n, r);
|
|
1717
1717
|
});
|
|
1718
|
-
} }),
|
|
1718
|
+
} }), $e && ($e.allSettled && M($, "allSettled", function() {
|
|
1719
1719
|
var e = Ie.apply(null, arguments).map(rn);
|
|
1720
|
-
return new
|
|
1720
|
+
return new $(function(t) {
|
|
1721
1721
|
e.length === 0 && t([]);
|
|
1722
1722
|
var n = e.length, r = new Array(n);
|
|
1723
1723
|
e.forEach(function(a, u) {
|
|
1724
|
-
return
|
|
1724
|
+
return $.resolve(a).then(function(f) {
|
|
1725
1725
|
return r[u] = { status: "fulfilled", value: f };
|
|
1726
1726
|
}, function(f) {
|
|
1727
1727
|
return r[u] = { status: "rejected", reason: f };
|
|
@@ -1730,24 +1730,24 @@ function Pi() {
|
|
|
1730
1730
|
});
|
|
1731
1731
|
});
|
|
1732
1732
|
});
|
|
1733
|
-
}),
|
|
1733
|
+
}), $e.any && typeof AggregateError < "u" && M($, "any", function() {
|
|
1734
1734
|
var e = Ie.apply(null, arguments).map(rn);
|
|
1735
|
-
return new
|
|
1735
|
+
return new $(function(t, n) {
|
|
1736
1736
|
e.length === 0 && n(new AggregateError([]));
|
|
1737
1737
|
var r = e.length, a = new Array(r);
|
|
1738
1738
|
e.forEach(function(u, f) {
|
|
1739
|
-
return
|
|
1739
|
+
return $.resolve(u).then(function(p) {
|
|
1740
1740
|
return t(p);
|
|
1741
1741
|
}, function(p) {
|
|
1742
1742
|
a[f] = p, --r || n(new AggregateError(a));
|
|
1743
1743
|
});
|
|
1744
1744
|
});
|
|
1745
1745
|
});
|
|
1746
|
-
}),
|
|
1746
|
+
}), $e.withResolvers && ($.withResolvers = $e.withResolvers));
|
|
1747
1747
|
var Ce = { awaits: 0, echoes: 0, id: 0 }, Pa = 0, en = [], tn = 0, nn = 0, Fa = 0;
|
|
1748
1748
|
function at(e, t, n, r) {
|
|
1749
1749
|
var a = Y, u = Object.create(a);
|
|
1750
|
-
return u.parent = a, u.ref = 0, u.global = !1, u.id = ++Fa, rt.env, u.env = Cn ? { Promise:
|
|
1750
|
+
return u.parent = a, u.ref = 0, u.global = !1, u.id = ++Fa, rt.env, u.env = Cn ? { Promise: $, PromiseProp: { value: $, configurable: !0, writable: !0 }, all: $.all, race: $.race, allSettled: $.allSettled, any: $.any, resolve: $.resolve, reject: $.reject } : {}, t && D(u, t), ++a.ref, u.finalize = function() {
|
|
1751
1751
|
--this.parent.ref || this.parent.finalize();
|
|
1752
1752
|
}, r = ht(u, e, n, r), u.ref === 0 && u.finalize(), r;
|
|
1753
1753
|
}
|
|
@@ -1758,7 +1758,7 @@ function Pi() {
|
|
|
1758
1758
|
return !!Ce.awaits && (--Ce.awaits == 0 && (Ce.id = 0), Ce.echoes = Ce.awaits * zt, !0);
|
|
1759
1759
|
}
|
|
1760
1760
|
function rn(e) {
|
|
1761
|
-
return Ce.echoes && e && e.constructor ===
|
|
1761
|
+
return Ce.echoes && e && e.constructor === $e ? (Nt(), e.then(function(t) {
|
|
1762
1762
|
return it(), t;
|
|
1763
1763
|
}, function(t) {
|
|
1764
1764
|
return it(), _e(t);
|
|
@@ -1798,10 +1798,10 @@ function Pi() {
|
|
|
1798
1798
|
};
|
|
1799
1799
|
}
|
|
1800
1800
|
function Fn(e) {
|
|
1801
|
-
Promise ===
|
|
1801
|
+
Promise === $e && Ce.echoes === 0 ? tn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
1802
1802
|
}
|
|
1803
1803
|
("" + Le).indexOf("[native code]") === -1 && (Nt = it = c);
|
|
1804
|
-
var _e =
|
|
1804
|
+
var _e = $.reject, pt = "", Qe = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", xr = "String expected.", At = [], an = "__dbnames", Bn = "readonly", Mn = "readwrite";
|
|
1805
1805
|
function mt(e, t) {
|
|
1806
1806
|
return e ? t ? function() {
|
|
1807
1807
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -2012,7 +2012,7 @@ function Pi() {
|
|
|
2012
2012
|
return u && a && (f = on(u)(e)), this._trans("readwrite", function(p) {
|
|
2013
2013
|
return n.core.mutate({ trans: p, type: "add", keys: t != null ? [t] : null, values: [f] });
|
|
2014
2014
|
}).then(function(p) {
|
|
2015
|
-
return p.numFailures ?
|
|
2015
|
+
return p.numFailures ? $.reject(p.failures[0]) : p.lastResult;
|
|
2016
2016
|
}).then(function(p) {
|
|
2017
2017
|
if (u) try {
|
|
2018
2018
|
le(e, u, p);
|
|
@@ -2027,7 +2027,7 @@ function Pi() {
|
|
|
2027
2027
|
return u && a && (f = on(u)(e)), this._trans("readwrite", function(p) {
|
|
2028
2028
|
return n.core.mutate({ trans: p, type: "put", values: [f], keys: t != null ? [t] : null });
|
|
2029
2029
|
}).then(function(p) {
|
|
2030
|
-
return p.numFailures ?
|
|
2030
|
+
return p.numFailures ? $.reject(p.failures[0]) : p.lastResult;
|
|
2031
2031
|
}).then(function(p) {
|
|
2032
2032
|
if (u) try {
|
|
2033
2033
|
le(e, u, p);
|
|
@@ -2041,7 +2041,7 @@ function Pi() {
|
|
|
2041
2041
|
return t.core.mutate({ trans: n, type: "delete", keys: [e] }).then(function(r) {
|
|
2042
2042
|
return sn(t, [e], r);
|
|
2043
2043
|
}).then(function(r) {
|
|
2044
|
-
return r.numFailures ?
|
|
2044
|
+
return r.numFailures ? $.reject(r.failures[0]) : void 0;
|
|
2045
2045
|
});
|
|
2046
2046
|
});
|
|
2047
2047
|
}, he.prototype.clear = function() {
|
|
@@ -2051,7 +2051,7 @@ function Pi() {
|
|
|
2051
2051
|
return sn(e, null, n);
|
|
2052
2052
|
});
|
|
2053
2053
|
}).then(function(t) {
|
|
2054
|
-
return t.numFailures ?
|
|
2054
|
+
return t.numFailures ? $.reject(t.failures[0]) : void 0;
|
|
2055
2055
|
});
|
|
2056
2056
|
}, he.prototype.bulkGet = function(e) {
|
|
2057
2057
|
var t = this;
|
|
@@ -2720,7 +2720,7 @@ function Pi() {
|
|
|
2720
2720
|
}, De);
|
|
2721
2721
|
function De() {
|
|
2722
2722
|
}
|
|
2723
|
-
function
|
|
2723
|
+
function Xe(e) {
|
|
2724
2724
|
return pe(function(t) {
|
|
2725
2725
|
return Kt(t), e(t.target.error), !1;
|
|
2726
2726
|
});
|
|
@@ -2765,13 +2765,13 @@ function Pi() {
|
|
|
2765
2765
|
var r = this;
|
|
2766
2766
|
if (e === "readwrite" && this.mode !== "readwrite") return _e(new z.ReadOnly("Transaction is readonly"));
|
|
2767
2767
|
if (!this.active) return _e(new z.TransactionInactive());
|
|
2768
|
-
if (this._locked()) return new
|
|
2768
|
+
if (this._locked()) return new $(function(u, f) {
|
|
2769
2769
|
r._blockedFuncs.push([function() {
|
|
2770
2770
|
r._promise(e, t, n).then(u, f);
|
|
2771
2771
|
}, Y]);
|
|
2772
2772
|
});
|
|
2773
2773
|
if (n) return at(function() {
|
|
2774
|
-
var u = new
|
|
2774
|
+
var u = new $(function(f, p) {
|
|
2775
2775
|
r._lock();
|
|
2776
2776
|
var v = t(f, p, r);
|
|
2777
2777
|
v && v.then && v.then(f, p);
|
|
@@ -2780,7 +2780,7 @@ function Pi() {
|
|
|
2780
2780
|
return r._unlock();
|
|
2781
2781
|
}), u._lib = !0, u;
|
|
2782
2782
|
});
|
|
2783
|
-
var a = new
|
|
2783
|
+
var a = new $(function(u, f) {
|
|
2784
2784
|
var p = t(u, f, r);
|
|
2785
2785
|
p && p.then && p.then(u, f);
|
|
2786
2786
|
});
|
|
@@ -2788,7 +2788,7 @@ function Pi() {
|
|
|
2788
2788
|
}, We.prototype._root = function() {
|
|
2789
2789
|
return this.parent ? this.parent._root() : this;
|
|
2790
2790
|
}, We.prototype.waitFor = function(e) {
|
|
2791
|
-
var t, n = this._root(), r =
|
|
2791
|
+
var t, n = this._root(), r = $.resolve(e);
|
|
2792
2792
|
n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
|
|
2793
2793
|
return r;
|
|
2794
2794
|
}) : (n._waitingFor = r, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), (function u() {
|
|
@@ -2796,7 +2796,7 @@ function Pi() {
|
|
|
2796
2796
|
n._waitingFor && (t.get(-1 / 0).onsuccess = u);
|
|
2797
2797
|
})());
|
|
2798
2798
|
var a = n._waitingFor;
|
|
2799
|
-
return new
|
|
2799
|
+
return new $(function(u, f) {
|
|
2800
2800
|
r.then(function(p) {
|
|
2801
2801
|
return n._waitingQueue.push(pe(u.bind(null, p)));
|
|
2802
2802
|
}, function(p) {
|
|
@@ -2906,7 +2906,7 @@ function Pi() {
|
|
|
2906
2906
|
R = pe(R);
|
|
2907
2907
|
for (var P, j = N.objectStore(x), L = C.length, K = new Array(L), q = 0, V = 0, U = function(ae) {
|
|
2908
2908
|
ae = ae.target, K[ae._pos] = ae.result, ++V === q && R(K);
|
|
2909
|
-
}, W =
|
|
2909
|
+
}, W = Xe(k), ne = 0; ne < L; ++ne) C[ne] != null && ((P = j.get(C[ne]))._pos = ne, P.onsuccess = U, P.onerror = W, ++q);
|
|
2910
2910
|
q === 0 && R(K);
|
|
2911
2911
|
});
|
|
2912
2912
|
}, get: function(A) {
|
|
@@ -2916,7 +2916,7 @@ function Pi() {
|
|
|
2916
2916
|
var P = N.objectStore(x).get(C);
|
|
2917
2917
|
P.onsuccess = function(j) {
|
|
2918
2918
|
return R(j.target.result);
|
|
2919
|
-
}, P.onerror =
|
|
2919
|
+
}, P.onerror = Xe(k);
|
|
2920
2920
|
});
|
|
2921
2921
|
}, query: (b = w, function(A) {
|
|
2922
2922
|
return new Promise(function(N, C) {
|
|
@@ -2925,17 +2925,17 @@ function Pi() {
|
|
|
2925
2925
|
if (L === 0) return N({ result: [] });
|
|
2926
2926
|
b ? ((K = j ? V.getAll(U, K) : V.getAllKeys(U, K)).onsuccess = function(W) {
|
|
2927
2927
|
return N({ result: W.target.result });
|
|
2928
|
-
}, K.onerror =
|
|
2928
|
+
}, K.onerror = Xe(C)) : (R = 0, k = !j && "openKeyCursor" in V ? V.openKeyCursor(U) : V.openCursor(U), P = [], k.onsuccess = function(W) {
|
|
2929
2929
|
var ne = k.result;
|
|
2930
2930
|
return ne ? (P.push(j ? ne.value : ne.primaryKey), ++R === L ? N({ result: P }) : void ne.continue()) : N({ result: P });
|
|
2931
|
-
}, k.onerror =
|
|
2931
|
+
}, k.onerror = Xe(C));
|
|
2932
2932
|
});
|
|
2933
2933
|
}), openCursor: function(A) {
|
|
2934
2934
|
var N = A.trans, C = A.values, R = A.query, k = A.reverse, P = A.unique;
|
|
2935
2935
|
return new Promise(function(j, L) {
|
|
2936
2936
|
j = pe(j);
|
|
2937
2937
|
var V = R.index, K = R.range, q = N.objectStore(x), q = V.isPrimaryKey ? q : q.index(V.name), V = k ? P ? "prevunique" : "prev" : P ? "nextunique" : "next", U = !C && "openKeyCursor" in q ? q.openKeyCursor(r(K), V) : q.openCursor(r(K), V);
|
|
2938
|
-
U.onerror =
|
|
2938
|
+
U.onerror = Xe(L), U.onsuccess = pe(function(W) {
|
|
2939
2939
|
var ne, ae, ee, be, J = U.result;
|
|
2940
2940
|
J ? (J.___id = ++La, J.done = !1, ne = J.continue.bind(J), ae = (ae = J.continuePrimaryKey) && ae.bind(J), ee = J.advance.bind(J), be = function() {
|
|
2941
2941
|
throw new Error("Cursor not stopped");
|
|
@@ -2960,7 +2960,7 @@ function Pi() {
|
|
|
2960
2960
|
}, J.stop();
|
|
2961
2961
|
}
|
|
2962
2962
|
var En = new Promise(function(Be, vt) {
|
|
2963
|
-
Be = pe(Be), U.onerror =
|
|
2963
|
+
Be = pe(Be), U.onerror = Xe(vt), J.fail = vt, J.stop = function(sr) {
|
|
2964
2964
|
J.stop = J.continue = J.continuePrimaryKey = J.advance = be, Be(sr);
|
|
2965
2965
|
};
|
|
2966
2966
|
});
|
|
@@ -2976,7 +2976,7 @@ function Pi() {
|
|
|
2976
2976
|
var L = C.objectStore(x), K = R.isPrimaryKey ? L : L.index(R.name), L = r(k), K = L ? K.count(L) : K.count();
|
|
2977
2977
|
K.onsuccess = pe(function(q) {
|
|
2978
2978
|
return P(q.target.result);
|
|
2979
|
-
}), K.onerror =
|
|
2979
|
+
}), K.onerror = Xe(j);
|
|
2980
2980
|
});
|
|
2981
2981
|
} };
|
|
2982
2982
|
}
|
|
@@ -3038,7 +3038,7 @@ function Pi() {
|
|
|
3038
3038
|
function Ga(e, t) {
|
|
3039
3039
|
return e._cfg.version - t._cfg.version;
|
|
3040
3040
|
}
|
|
3041
|
-
function
|
|
3041
|
+
function $a(e, t, n, r) {
|
|
3042
3042
|
var a = e._dbSchema;
|
|
3043
3043
|
n.objectStoreNames.contains("$meta") && !a.$meta && (a.$meta = Un("$meta", jr("")[0], []), e._storeNames.push("$meta"));
|
|
3044
3044
|
var u = e._createTransaction("readwrite", e._storeNames, a);
|
|
@@ -3047,16 +3047,16 @@ function Pi() {
|
|
|
3047
3047
|
at(function() {
|
|
3048
3048
|
return Y.trans = u, Y.transless = p, t !== 0 ? (fn(e, n), w = t, ((v = u).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(T) {
|
|
3049
3049
|
return T ?? w;
|
|
3050
|
-
}) :
|
|
3050
|
+
}) : $.resolve(w)).then(function(T) {
|
|
3051
3051
|
return O = T, b = u, x = n, A = [], T = (g = e)._versions, N = g._dbSchema = pn(0, g.idbdb, x), (T = T.filter(function(C) {
|
|
3052
3052
|
return C._cfg.version >= O;
|
|
3053
3053
|
})).length !== 0 ? (T.forEach(function(C) {
|
|
3054
3054
|
A.push(function() {
|
|
3055
3055
|
var R = N, k = C._cfg.dbschema;
|
|
3056
3056
|
mn(g, R, x), mn(g, k, x), N = g._dbSchema = k;
|
|
3057
|
-
var P =
|
|
3057
|
+
var P = $n(R, k);
|
|
3058
3058
|
P.add.forEach(function(V) {
|
|
3059
|
-
|
|
3059
|
+
Xn(x, V[0], V[1].primKey, V[1].indexes);
|
|
3060
3060
|
}), P.change.forEach(function(V) {
|
|
3061
3061
|
if (V.recreate) throw new z.Upgrade("Not yet support for changing primary key");
|
|
3062
3062
|
var U = x.objectStore(V.name);
|
|
@@ -3076,10 +3076,10 @@ function Pi() {
|
|
|
3076
3076
|
L[V] = R[V];
|
|
3077
3077
|
}), Gn(g, [g.Transaction.prototype]), dn(g, [g.Transaction.prototype], y(L), L), b.schema = L;
|
|
3078
3078
|
var K, q = bt(j);
|
|
3079
|
-
return q && Nt(), P =
|
|
3079
|
+
return q && Nt(), P = $.follow(function() {
|
|
3080
3080
|
var V;
|
|
3081
3081
|
(K = j(b)) && q && (V = it.bind(null, null), K.then(V, V));
|
|
3082
|
-
}), K && typeof K.then == "function" ?
|
|
3082
|
+
}), K && typeof K.then == "function" ? $.resolve(K) : P.then(function() {
|
|
3083
3083
|
return K;
|
|
3084
3084
|
});
|
|
3085
3085
|
}
|
|
@@ -3094,24 +3094,24 @@ function Pi() {
|
|
|
3094
3094
|
})) : R.objectStore("$meta").put(C._cfg.version, "version"));
|
|
3095
3095
|
});
|
|
3096
3096
|
}), (function C() {
|
|
3097
|
-
return A.length ?
|
|
3097
|
+
return A.length ? $.resolve(A.shift()(b.idbtrans)).then(C) : $.resolve();
|
|
3098
3098
|
})().then(function() {
|
|
3099
3099
|
Mr(N, x);
|
|
3100
|
-
})) :
|
|
3100
|
+
})) : $.resolve();
|
|
3101
3101
|
var g, O, b, x, A, N;
|
|
3102
3102
|
}).catch(f)) : (y(a).forEach(function(T) {
|
|
3103
|
-
|
|
3104
|
-
}), fn(e, n), void
|
|
3103
|
+
Xn(n, T, a[T].primKey, a[T].indexes);
|
|
3104
|
+
}), fn(e, n), void $.follow(function() {
|
|
3105
3105
|
return e.on.populate.fire(u);
|
|
3106
3106
|
}).catch(f));
|
|
3107
3107
|
var v, w;
|
|
3108
3108
|
});
|
|
3109
3109
|
}
|
|
3110
|
-
function
|
|
3110
|
+
function Xa(e, t) {
|
|
3111
3111
|
Mr(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
3112
3112
|
var n = pn(0, e.idbdb, t);
|
|
3113
3113
|
mn(e, e._dbSchema, t);
|
|
3114
|
-
for (var r = 0, a =
|
|
3114
|
+
for (var r = 0, a = $n(n, e._dbSchema).change; r < a.length; r++) {
|
|
3115
3115
|
var u = (function(f) {
|
|
3116
3116
|
if (f.change.length || f.recreate) return console.warn("Unable to patch indexes of table ".concat(f.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
3117
3117
|
var p = t.objectStore(f.name);
|
|
@@ -3122,7 +3122,7 @@ function Pi() {
|
|
|
3122
3122
|
if (typeof u == "object") return u.value;
|
|
3123
3123
|
}
|
|
3124
3124
|
}
|
|
3125
|
-
function
|
|
3125
|
+
function $n(e, t) {
|
|
3126
3126
|
var n, r = { del: [], add: [], change: [] };
|
|
3127
3127
|
for (n in e) t[n] || r.del.push(n);
|
|
3128
3128
|
for (n in t) {
|
|
@@ -3143,7 +3143,7 @@ function Pi() {
|
|
|
3143
3143
|
}
|
|
3144
3144
|
return r;
|
|
3145
3145
|
}
|
|
3146
|
-
function
|
|
3146
|
+
function Xn(e, t, n, r) {
|
|
3147
3147
|
var a = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
3148
3148
|
return r.forEach(function(u) {
|
|
3149
3149
|
return hn(a, u);
|
|
@@ -3151,7 +3151,7 @@ function Pi() {
|
|
|
3151
3151
|
}
|
|
3152
3152
|
function Mr(e, t) {
|
|
3153
3153
|
y(e).forEach(function(n) {
|
|
3154
|
-
t.db.objectStoreNames.contains(n) || (Ne && console.debug("Dexie: Creating missing table", n),
|
|
3154
|
+
t.db.objectStoreNames.contains(n) || (Ne && console.debug("Dexie: Creating missing table", n), Xn(t, n, e[n].primKey, e[n].indexes));
|
|
3155
3155
|
});
|
|
3156
3156
|
}
|
|
3157
3157
|
function hn(e, t) {
|
|
@@ -3358,22 +3358,22 @@ function Pi() {
|
|
|
3358
3358
|
if (t.openCanceller !== r) throw new z.DatabaseClosed("db.open() was cancelled");
|
|
3359
3359
|
}
|
|
3360
3360
|
function p() {
|
|
3361
|
-
return new
|
|
3361
|
+
return new $(function(O, b) {
|
|
3362
3362
|
if (f(), !n) throw new z.MissingAPI();
|
|
3363
3363
|
var x = e.name, A = t.autoSchema || !a ? n.open(x) : n.open(x, a);
|
|
3364
3364
|
if (!A) throw new z.MissingAPI();
|
|
3365
|
-
A.onerror =
|
|
3365
|
+
A.onerror = Xe(b), A.onblocked = pe(e._fireOnBlocked), A.onupgradeneeded = pe(function(N) {
|
|
3366
3366
|
var C;
|
|
3367
3367
|
T = A.transaction, t.autoSchema && !e._options.allowEmptyDB ? (A.onerror = Kt, T.abort(), A.result.close(), (C = n.deleteDatabase(x)).onsuccess = C.onerror = pe(function() {
|
|
3368
3368
|
b(new z.NoSuchDatabase("Database ".concat(x, " doesnt exist")));
|
|
3369
|
-
})) : (T.onerror =
|
|
3369
|
+
})) : (T.onerror = Xe(b), N = N.oldVersion > Math.pow(2, 62) ? 0 : N.oldVersion, g = N < 1, e.idbdb = A.result, u && Xa(e, T), $a(e, N / 10, T, b));
|
|
3370
3370
|
}, b), A.onsuccess = pe(function() {
|
|
3371
3371
|
T = null;
|
|
3372
3372
|
var N, C, R, k, P, j = e.idbdb = A.result, L = Te(j.objectStoreNames);
|
|
3373
3373
|
if (0 < L.length) try {
|
|
3374
3374
|
var K = j.transaction((k = L).length === 1 ? k[0] : k, "readonly");
|
|
3375
3375
|
if (t.autoSchema) C = j, R = K, (N = e).verno = C.version / 10, R = N._dbSchema = pn(0, C, R), N._storeNames = Te(C.objectStoreNames, 0), dn(N, [N._allTables], y(R), R);
|
|
3376
|
-
else if (mn(e, e._dbSchema, K), ((P =
|
|
3376
|
+
else if (mn(e, e._dbSchema, K), ((P = $n(pn(0, (P = e).idbdb, K), P._dbSchema)).add.length || P.change.some(function(q) {
|
|
3377
3377
|
return q.add.length || q.change.length;
|
|
3378
3378
|
})) && !u) 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, u = !0, O(p());
|
|
3379
3379
|
fn(e, K);
|
|
@@ -3393,11 +3393,11 @@ function Pi() {
|
|
|
3393
3393
|
case "VersionError":
|
|
3394
3394
|
if (0 < a) return a = 0, p();
|
|
3395
3395
|
}
|
|
3396
|
-
return
|
|
3396
|
+
return $.reject(O);
|
|
3397
3397
|
});
|
|
3398
3398
|
}
|
|
3399
3399
|
var v, w = t.dbReadyResolve, T = null, g = !1;
|
|
3400
|
-
return
|
|
3400
|
+
return $.race([r, (typeof navigator > "u" ? $.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(O) {
|
|
3401
3401
|
function b() {
|
|
3402
3402
|
return indexedDB.databases().finally(O);
|
|
3403
3403
|
}
|
|
@@ -3405,12 +3405,12 @@ function Pi() {
|
|
|
3405
3405
|
}).finally(function() {
|
|
3406
3406
|
return clearInterval(v);
|
|
3407
3407
|
}) : Promise.resolve()).then(p)]).then(function() {
|
|
3408
|
-
return f(), t.onReadyBeingFired = [],
|
|
3408
|
+
return f(), t.onReadyBeingFired = [], $.resolve(zn(function() {
|
|
3409
3409
|
return e.on.ready.fire(e.vip);
|
|
3410
3410
|
})).then(function O() {
|
|
3411
3411
|
if (0 < t.onReadyBeingFired.length) {
|
|
3412
3412
|
var b = t.onReadyBeingFired.reduce(Oe, c);
|
|
3413
|
-
return t.onReadyBeingFired = [],
|
|
3413
|
+
return t.onReadyBeingFired = [], $.resolve(zn(function() {
|
|
3414
3414
|
return b(e.vip);
|
|
3415
3415
|
})).then(O);
|
|
3416
3416
|
}
|
|
@@ -3587,7 +3587,7 @@ function Pi() {
|
|
|
3587
3587
|
return i(i({}, n), { getMany: function(r) {
|
|
3588
3588
|
if (!r.cache) return n.getMany(r);
|
|
3589
3589
|
var a = Vr(r.keys, r.trans._cache, r.cache === "clone");
|
|
3590
|
-
return a ?
|
|
3590
|
+
return a ? $.resolve(a) : n.getMany(r).then(function(u) {
|
|
3591
3591
|
return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? Ye(u) : u }, u;
|
|
3592
3592
|
});
|
|
3593
3593
|
}, mutate: function(r) {
|
|
@@ -3598,7 +3598,7 @@ function Pi() {
|
|
|
3598
3598
|
function Gr(e, t) {
|
|
3599
3599
|
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !t.schema.primaryKey.outbound;
|
|
3600
3600
|
}
|
|
3601
|
-
function
|
|
3601
|
+
function $r(e, t) {
|
|
3602
3602
|
switch (e) {
|
|
3603
3603
|
case "query":
|
|
3604
3604
|
return t.values && !t.unique;
|
|
@@ -3660,7 +3660,7 @@ function Pi() {
|
|
|
3660
3660
|
}, count: g, query: g, openCursor: g };
|
|
3661
3661
|
return y(O).forEach(function(b) {
|
|
3662
3662
|
T[b] = function(x) {
|
|
3663
|
-
var A = Y.subscr, N = !!A, C = Gr(Y, a) &&
|
|
3663
|
+
var A = Y.subscr, N = !!A, C = Gr(Y, a) && $r(b, x) ? x.obsSet = {} : A;
|
|
3664
3664
|
if (N) {
|
|
3665
3665
|
var R = function(q) {
|
|
3666
3666
|
return q = "idb://".concat(t, "/").concat(r, "/").concat(q), C[q] || (C[q] = new Se());
|
|
@@ -3697,7 +3697,7 @@ function Pi() {
|
|
|
3697
3697
|
}), T;
|
|
3698
3698
|
} });
|
|
3699
3699
|
} };
|
|
3700
|
-
function
|
|
3700
|
+
function Xr(e, t, n) {
|
|
3701
3701
|
if (n.numFailures === 0) return t;
|
|
3702
3702
|
if (t.type === "deleteRange") return null;
|
|
3703
3703
|
var r = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
@@ -3815,7 +3815,7 @@ function Pi() {
|
|
|
3815
3815
|
});
|
|
3816
3816
|
for (var P = 0, j = Object.values(b.queries.query); P < j.length; P++) for (var L, K, q, V = 0, U = (L = j[P]).slice(); V < U.length; V++) (K = U[V]).res != null && p.mutatedParts && (v && !K.dirty ? (q = Object.isFrozen(K.res), q = Wr(K.res, K.req, A, x, K, q), K.dirty ? (je(L, K), K.subscribers.forEach(function(W) {
|
|
3817
3817
|
return w.add(W);
|
|
3818
|
-
})) : q !== K.res && (K.res = q, K.promise =
|
|
3818
|
+
})) : q !== K.res && (K.res = q, K.promise = $.resolve({ result: q }))) : (K.dirty && je(L, K), K.subscribers.forEach(function(W) {
|
|
3819
3819
|
return w.add(W);
|
|
3820
3820
|
})));
|
|
3821
3821
|
}
|
|
@@ -3836,11 +3836,11 @@ function Pi() {
|
|
|
3836
3836
|
return p ? (f = r.mutate(u), u.type !== "add" && u.type !== "put" || !(50 <= u.values.length || rr(a, u).some(function(v) {
|
|
3837
3837
|
return v == null;
|
|
3838
3838
|
})) ? (p.optimisticOps.push(u), u.mutatedParts && vn(u.mutatedParts), f.then(function(v) {
|
|
3839
|
-
0 < v.numFailures && (je(p.optimisticOps, u), (v =
|
|
3839
|
+
0 < v.numFailures && (je(p.optimisticOps, u), (v = Xr(0, u, v)) && p.optimisticOps.push(v), u.mutatedParts && vn(u.mutatedParts));
|
|
3840
3840
|
}), f.catch(function() {
|
|
3841
3841
|
je(p.optimisticOps, u), u.mutatedParts && vn(u.mutatedParts);
|
|
3842
3842
|
})) : f.then(function(v) {
|
|
3843
|
-
var w =
|
|
3843
|
+
var w = Xr(0, i(i({}, u), { values: u.values.map(function(T, g) {
|
|
3844
3844
|
var O;
|
|
3845
3845
|
return v.failures[g] ? T : (T = (O = a.keyPath) !== null && O !== void 0 && O.includes(".") ? Ye(T) : i({}, T), le(T, a.keyPath, v.results[g]), T);
|
|
3846
3846
|
}) }), v);
|
|
@@ -3849,7 +3849,7 @@ function Pi() {
|
|
|
3849
3849
|
});
|
|
3850
3850
|
}), f) : r.mutate(u);
|
|
3851
3851
|
}, query: function(u) {
|
|
3852
|
-
if (!Gr(Y, r) ||
|
|
3852
|
+
if (!Gr(Y, r) || !$r("query", u)) return r.query(u);
|
|
3853
3853
|
var f = ((w = Y.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", g = Y, p = g.requery, v = g.signal, w = (function(x, A, N, C) {
|
|
3854
3854
|
var R = gt["idb://".concat(x, "/").concat(A)];
|
|
3855
3855
|
if (!R) return [];
|
|
@@ -3900,7 +3900,7 @@ function Pi() {
|
|
|
3900
3900
|
return n || (n = new this.Version(e), t.push(n), t.sort(Ga), n.stores({}), this._state.autoSchema = !1, n);
|
|
3901
3901
|
}, Ee.prototype._whenReady = function(e) {
|
|
3902
3902
|
var t = this;
|
|
3903
|
-
return this.idbdb && (this._state.openComplete || Y.letThrough || this._vip) ? e() : new
|
|
3903
|
+
return this.idbdb && (this._state.openComplete || Y.letThrough || this._vip) ? e() : new $(function(n, r) {
|
|
3904
3904
|
if (t._state.openComplete) return r(new z.DatabaseClosed(t._state.dbOpenError));
|
|
3905
3905
|
if (!t._state.isBeingOpened) {
|
|
3906
3906
|
if (!t._state.autoOpen) return void r(new z.DatabaseClosed());
|
|
@@ -3933,9 +3933,9 @@ function Pi() {
|
|
|
3933
3933
|
}
|
|
3934
3934
|
this.idbdb = null;
|
|
3935
3935
|
}
|
|
3936
|
-
e.isBeingOpened || (e.dbReadyPromise = new
|
|
3936
|
+
e.isBeingOpened || (e.dbReadyPromise = new $(function(n) {
|
|
3937
3937
|
e.dbReadyResolve = n;
|
|
3938
|
-
}), e.openCanceller = new
|
|
3938
|
+
}), e.openCanceller = new $(function(n, r) {
|
|
3939
3939
|
e.cancelOpen = r;
|
|
3940
3940
|
}));
|
|
3941
3941
|
}, Ee.prototype.close = function(n) {
|
|
@@ -3945,14 +3945,14 @@ function Pi() {
|
|
|
3945
3945
|
var t = this;
|
|
3946
3946
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
3947
3947
|
var n = 0 < arguments.length && typeof arguments[0] != "object", r = this._state;
|
|
3948
|
-
return new
|
|
3948
|
+
return new $(function(a, u) {
|
|
3949
3949
|
function f() {
|
|
3950
3950
|
t.close(e);
|
|
3951
3951
|
var p = t._deps.indexedDB.deleteDatabase(t.name);
|
|
3952
3952
|
p.onsuccess = pe(function() {
|
|
3953
3953
|
var v, w, T;
|
|
3954
3954
|
v = t._deps, w = t.name, T = v.indexedDB, v = v.IDBKeyRange, Yn(T) || w === an || Wn(T, v).delete(w).catch(c), a();
|
|
3955
|
-
}), p.onerror =
|
|
3955
|
+
}), p.onerror = Xe(u), p.onblocked = t._fireOnBlocked;
|
|
3956
3956
|
}
|
|
3957
3957
|
if (n) throw new z.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
3958
3958
|
r.isBeingOpened ? r.dbReadyPromise.then(f) : f();
|
|
@@ -4013,7 +4013,7 @@ function Pi() {
|
|
|
4013
4013
|
}) : _e(w);
|
|
4014
4014
|
}
|
|
4015
4015
|
var v = (function w(T, g, O, b, x) {
|
|
4016
|
-
return
|
|
4016
|
+
return $.resolve().then(function() {
|
|
4017
4017
|
var A = Y.transless || Y, N = T._createTransaction(g, O, T._dbSchema, b);
|
|
4018
4018
|
if (N.explicit = !0, A = { trans: N, transless: A }, b) N.idbtrans = b.idbtrans;
|
|
4019
4019
|
else try {
|
|
@@ -4024,10 +4024,10 @@ function Pi() {
|
|
|
4024
4024
|
})) : _e(k);
|
|
4025
4025
|
}
|
|
4026
4026
|
var C, R = bt(x);
|
|
4027
|
-
return R && Nt(), A =
|
|
4027
|
+
return R && Nt(), A = $.follow(function() {
|
|
4028
4028
|
var k;
|
|
4029
4029
|
(C = x.call(N, N)) && (R ? (k = it.bind(null, null), C.then(k, k)) : typeof C.next == "function" && typeof C.throw == "function" && (C = tr(C)));
|
|
4030
|
-
}, A), (C && typeof C.then == "function" ?
|
|
4030
|
+
}, A), (C && typeof C.then == "function" ? $.resolve(C).then(function(k) {
|
|
4031
4031
|
return N.active ? k : _e(new z.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
4032
4032
|
}) : A.then(function() {
|
|
4033
4033
|
return C;
|
|
@@ -4053,9 +4053,9 @@ function Pi() {
|
|
|
4053
4053
|
var r = Ee.dependencies;
|
|
4054
4054
|
this._options = t = i({ addons: Ee.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
4055
4055
|
var a, u, f, p, v, w = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: c, dbReadyPromise: null, cancelOpen: c, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
4056
|
-
w.dbReadyPromise = new
|
|
4056
|
+
w.dbReadyPromise = new $(function(g) {
|
|
4057
4057
|
w.dbReadyResolve = g;
|
|
4058
|
-
}), w.openCanceller = new
|
|
4058
|
+
}), w.openCanceller = new $(function(g, O) {
|
|
4059
4059
|
w.cancelOpen = O;
|
|
4060
4060
|
}), this._state = w, this.name = e, this.on = Bt(this, "populate", "blocked", "versionchange", "close", { ready: [Oe, c] }), this.once = function(g, O) {
|
|
4061
4061
|
var b = function() {
|
|
@@ -4067,7 +4067,7 @@ function Pi() {
|
|
|
4067
4067
|
return function(O, b) {
|
|
4068
4068
|
Ee.vip(function() {
|
|
4069
4069
|
var x, A = n._state;
|
|
4070
|
-
A.openComplete ? (A.dbOpenError ||
|
|
4070
|
+
A.openComplete ? (A.dbOpenError || $.resolve().then(O), b && g(O)) : A.onReadyBeingFired ? (A.onReadyBeingFired.push(O), b && g(O)) : (g(O), x = n, b || g(function N() {
|
|
4071
4071
|
x.on.ready.unsubscribe(O), x.on.ready.unsubscribe(N);
|
|
4072
4072
|
}));
|
|
4073
4073
|
});
|
|
@@ -4090,7 +4090,7 @@ function Pi() {
|
|
|
4090
4090
|
C = (C = b[C]) === null || C === void 0 ? void 0 : C.yProps, C && (O = O.concat(C.map(function(R) {
|
|
4091
4091
|
return R.updatesTable;
|
|
4092
4092
|
})));
|
|
4093
|
-
}), this.db = f, this.mode = g, this.storeNames = O, this.schema = b, this.chromeTransactionDurability = x, this.idbtrans = null, this.on = Bt(this, "complete", "error", "abort"), this.parent = A || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new
|
|
4093
|
+
}), this.db = f, this.mode = g, this.storeNames = O, this.schema = b, this.chromeTransactionDurability = x, this.idbtrans = null, this.on = Bt(this, "complete", "error", "abort"), this.parent = A || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new $(function(C, R) {
|
|
4094
4094
|
N._resolve = C, N._reject = R;
|
|
4095
4095
|
}), this._completion.then(function() {
|
|
4096
4096
|
N.active = !1, N.on.complete.fire();
|
|
@@ -4234,7 +4234,7 @@ function Pi() {
|
|
|
4234
4234
|
return function() {
|
|
4235
4235
|
try {
|
|
4236
4236
|
var t = tr(e.apply(this, arguments));
|
|
4237
|
-
return t && typeof t.then == "function" ? t :
|
|
4237
|
+
return t && typeof t.then == "function" ? t : $.resolve(t);
|
|
4238
4238
|
} catch (n) {
|
|
4239
4239
|
return _e(n);
|
|
4240
4240
|
}
|
|
@@ -4242,15 +4242,15 @@ function Pi() {
|
|
|
4242
4242
|
}, spawn: function(e, t, n) {
|
|
4243
4243
|
try {
|
|
4244
4244
|
var r = tr(e.apply(n, t || []));
|
|
4245
|
-
return r && typeof r.then == "function" ? r :
|
|
4245
|
+
return r && typeof r.then == "function" ? r : $.resolve(r);
|
|
4246
4246
|
} catch (a) {
|
|
4247
4247
|
return _e(a);
|
|
4248
4248
|
}
|
|
4249
4249
|
}, currentTransaction: { get: function() {
|
|
4250
4250
|
return Y.trans || null;
|
|
4251
4251
|
} }, waitFor: function(e, t) {
|
|
4252
|
-
return t =
|
|
4253
|
-
}, Promise:
|
|
4252
|
+
return t = $.resolve(typeof e == "function" ? yt.ignoreTransaction(e) : e).timeout(t || 6e4), Y.trans ? Y.trans.waitFor(t) : t;
|
|
4253
|
+
}, Promise: $, debug: { get: function() {
|
|
4254
4254
|
return Ne;
|
|
4255
4255
|
}, set: function(e) {
|
|
4256
4256
|
Ae(e);
|
|
@@ -4282,7 +4282,7 @@ function Pi() {
|
|
|
4282
4282
|
}
|
|
4283
4283
|
}), addEventListener("pageshow", function(e) {
|
|
4284
4284
|
!He.disableBfCache && e.persisted && (Ne && console.debug("Dexie: handling persisted pageshow"), Qr(), or({ all: new Se(-1 / 0, [[]]) }));
|
|
4285
|
-
})),
|
|
4285
|
+
})), $.rejectionMapper = function(e, t) {
|
|
4286
4286
|
return !e || e instanceof et || e instanceof TypeError || e instanceof SyntaxError || !e.name || !_t[e.name] ? e : (t = new _t[e.name](t || e.message, e), "stack" in e && M(t, "stack", { get: function() {
|
|
4287
4287
|
return this.inner.stack;
|
|
4288
4288
|
} }), t);
|
|
@@ -4354,7 +4354,7 @@ class Bi {
|
|
|
4354
4354
|
this.changeLogTable,
|
|
4355
4355
|
this.metaTable,
|
|
4356
4356
|
async () => {
|
|
4357
|
-
const F = i.length > 0 ? await y.bulkGet(i.map((M) => M.id)) : [],
|
|
4357
|
+
const F = i.length > 0 ? await y.bulkGet(i.map((M) => M.id)) : [], X = d.length > 0 ? await y.bulkGet(d) : [];
|
|
4358
4358
|
if (l.length > 0)
|
|
4359
4359
|
try {
|
|
4360
4360
|
await y.bulkAdd(l), D += l.length, h(D, _);
|
|
@@ -4402,7 +4402,7 @@ class Bi {
|
|
|
4402
4402
|
before: F[B],
|
|
4403
4403
|
after: M
|
|
4404
4404
|
})),
|
|
4405
|
-
deletes:
|
|
4405
|
+
deletes: X.filter(Boolean)
|
|
4406
4406
|
}
|
|
4407
4407
|
};
|
|
4408
4408
|
await this.changeLogTable.add(fe), await this.setHead(Q);
|
|
@@ -4490,17 +4490,17 @@ async function ji(m) {
|
|
|
4490
4490
|
const D = { ...y };
|
|
4491
4491
|
if (y.attributes) {
|
|
4492
4492
|
const F = [..._.attributes];
|
|
4493
|
-
for (const
|
|
4494
|
-
const G = F.findIndex((Q) => Q.name ===
|
|
4495
|
-
G >= 0 ? F[G] =
|
|
4493
|
+
for (const X of y.attributes) {
|
|
4494
|
+
const G = F.findIndex((Q) => Q.name === X.name);
|
|
4495
|
+
G >= 0 ? F[G] = X : F.push(X);
|
|
4496
4496
|
}
|
|
4497
4497
|
D.attributes = F;
|
|
4498
4498
|
}
|
|
4499
4499
|
if (y.children) {
|
|
4500
4500
|
const F = [..._.children];
|
|
4501
|
-
for (const
|
|
4502
|
-
const G = F.findIndex((Q) => Q.id ===
|
|
4503
|
-
G >= 0 ? F[G] =
|
|
4501
|
+
for (const X of y.children) {
|
|
4502
|
+
const G = F.findIndex((Q) => Q.id === X.id);
|
|
4503
|
+
G >= 0 ? F[G] = X : F.push(X);
|
|
4504
4504
|
}
|
|
4505
4505
|
D.children = F;
|
|
4506
4506
|
}
|
|
@@ -4518,8 +4518,8 @@ async function Mo(m) {
|
|
|
4518
4518
|
if (!_) continue;
|
|
4519
4519
|
const D = [..._.attributes];
|
|
4520
4520
|
for (const F of y) {
|
|
4521
|
-
const
|
|
4522
|
-
|
|
4521
|
+
const X = D.findIndex((G) => G.name === F.name);
|
|
4522
|
+
X >= 0 ? D[X] = F : D.push(F);
|
|
4523
4523
|
}
|
|
4524
4524
|
await d.update(h, { attributes: D });
|
|
4525
4525
|
}
|
|
@@ -4563,10 +4563,10 @@ function Vi(m) {
|
|
|
4563
4563
|
delete Wt[s];
|
|
4564
4564
|
}
|
|
4565
4565
|
var lr = {};
|
|
4566
|
-
const Gi = {},
|
|
4566
|
+
const Gi = {}, $i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4567
4567
|
__proto__: null,
|
|
4568
4568
|
default: Gi
|
|
4569
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4569
|
+
}, Symbol.toStringTag, { value: "Module" })), Xi = /* @__PURE__ */ Si($i);
|
|
4570
4570
|
var ia;
|
|
4571
4571
|
function Wi() {
|
|
4572
4572
|
return ia || (ia = 1, (function(m) {
|
|
@@ -4671,7 +4671,7 @@ function Wi() {
|
|
|
4671
4671
|
};
|
|
4672
4672
|
var _;
|
|
4673
4673
|
try {
|
|
4674
|
-
_ =
|
|
4674
|
+
_ = Xi.Stream;
|
|
4675
4675
|
} catch {
|
|
4676
4676
|
_ = function() {
|
|
4677
4677
|
};
|
|
@@ -4684,7 +4684,7 @@ function Wi() {
|
|
|
4684
4684
|
function F(c, o) {
|
|
4685
4685
|
return new G(c, o);
|
|
4686
4686
|
}
|
|
4687
|
-
function
|
|
4687
|
+
function X(c, o) {
|
|
4688
4688
|
if (c.length >= 2) {
|
|
4689
4689
|
if (c[0] === 255 && c[1] === 254)
|
|
4690
4690
|
return "utf-16le";
|
|
@@ -4723,7 +4723,7 @@ function Wi() {
|
|
|
4723
4723
|
}
|
|
4724
4724
|
}), G.prototype._decodeBuffer = function(c, o) {
|
|
4725
4725
|
if (this._decoderBuffer && (c = Buffer.concat([this._decoderBuffer, c]), this._decoderBuffer = null), !this._decoder) {
|
|
4726
|
-
var S =
|
|
4726
|
+
var S = X(c, o);
|
|
4727
4727
|
if (!S)
|
|
4728
4728
|
return this._decoderBuffer = c, "";
|
|
4729
4729
|
this._parser.encoding = S, this._decoder = new TextDecoder(S);
|
|
@@ -5206,10 +5206,10 @@ Actual: ` + c.attribValue
|
|
|
5206
5206
|
"Unbound namespace prefix: " + JSON.stringify(c.tagName)
|
|
5207
5207
|
), S.uri = E.prefix);
|
|
5208
5208
|
var se = c.tags[c.tags.length - 1] || c;
|
|
5209
|
-
S.ns && se.ns !== S.ns && Object.keys(S.ns).forEach(function(
|
|
5209
|
+
S.ns && se.ns !== S.ns && Object.keys(S.ns).forEach(function($e) {
|
|
5210
5210
|
ve(c, "onopennamespace", {
|
|
5211
|
-
prefix:
|
|
5212
|
-
uri: S.ns[
|
|
5211
|
+
prefix: $e,
|
|
5212
|
+
uri: S.ns[$e]
|
|
5213
5213
|
});
|
|
5214
5214
|
});
|
|
5215
5215
|
for (var ge = 0, we = c.attribList.length; ge < we; ge++) {
|
|
@@ -5576,11 +5576,11 @@ function Qi(m) {
|
|
|
5576
5576
|
const _ = no(s, h.defaultNamespace), D = io({ attributes: s.attributes, useCustomRecordsIds: d }), F = oo({
|
|
5577
5577
|
attributes: s.attributes,
|
|
5578
5578
|
useCustomRecordsIds: d
|
|
5579
|
-
}),
|
|
5579
|
+
}), X = ro(F), G = ao(l.stack), Q = {
|
|
5580
5580
|
id: D,
|
|
5581
5581
|
tagName: y,
|
|
5582
5582
|
namespace: _,
|
|
5583
|
-
attributes:
|
|
5583
|
+
attributes: X,
|
|
5584
5584
|
value: "",
|
|
5585
5585
|
parent: G,
|
|
5586
5586
|
children: []
|
|
@@ -5722,8 +5722,8 @@ async function co(m) {
|
|
|
5722
5722
|
batchSize: i.batchSize
|
|
5723
5723
|
}
|
|
5724
5724
|
}), l.io.hooks?.afterImport) {
|
|
5725
|
-
const { creates: D, updates: F, deletes:
|
|
5726
|
-
D?.length && await Ta({ databaseInstance: y, elementsTableName: _, records: D }), F?.length && await ji({ databaseInstance: y, elementsTableName: _, updates: F }),
|
|
5725
|
+
const { creates: D, updates: F, deletes: X } = await l.io.hooks.afterImport();
|
|
5726
|
+
D?.length && await Ta({ databaseInstance: y, elementsTableName: _, records: D }), F?.length && await ji({ databaseInstance: y, elementsTableName: _, updates: F }), X?.length && await Ki({ databaseInstance: y, elementsTableName: _, ids: X });
|
|
5727
5727
|
}
|
|
5728
5728
|
return h;
|
|
5729
5729
|
} catch (_) {
|
|
@@ -5748,8 +5748,8 @@ async function lo(m) {
|
|
|
5748
5748
|
});
|
|
5749
5749
|
}
|
|
5750
5750
|
async function pr(m) {
|
|
5751
|
-
const { databaseInstance: s, elementsTableName: l, reader: i, sax: d, textDecoder: h, buffer: y, options: _ } = m, { chunkSize: D, batchSize: F } = _, { done:
|
|
5752
|
-
if (
|
|
5751
|
+
const { databaseInstance: s, elementsTableName: l, reader: i, sax: d, textDecoder: h, buffer: y, options: _ } = m, { chunkSize: D, batchSize: F } = _, { done: X, value: G } = await i.read();
|
|
5752
|
+
if (X) {
|
|
5753
5753
|
if (y.length > 0) {
|
|
5754
5754
|
const fe = h.decode(y);
|
|
5755
5755
|
d.parser.write(fe);
|
|
@@ -5791,7 +5791,7 @@ async function sa(m) {
|
|
|
5791
5791
|
}
|
|
5792
5792
|
}
|
|
5793
5793
|
const Na = "_temp-idb-id";
|
|
5794
|
-
var
|
|
5794
|
+
var Xt = { exports: {} }, xn = { exports: {} }, ua;
|
|
5795
5795
|
function fo() {
|
|
5796
5796
|
return ua || (ua = 1, (function(m, s) {
|
|
5797
5797
|
Object.defineProperty(s, "__esModule", { value: !0 }), s.ParsingError = void 0;
|
|
@@ -5803,7 +5803,7 @@ function fo() {
|
|
|
5803
5803
|
s.ParsingError = l;
|
|
5804
5804
|
let i;
|
|
5805
5805
|
function d() {
|
|
5806
|
-
return D(!1) || Q() || G() ||
|
|
5806
|
+
return D(!1) || Q() || G() || X() || _();
|
|
5807
5807
|
}
|
|
5808
5808
|
function h() {
|
|
5809
5809
|
return B(/\s*/), D(!0) || G() || F() || _();
|
|
@@ -5899,7 +5899,7 @@ function fo() {
|
|
|
5899
5899
|
};
|
|
5900
5900
|
}
|
|
5901
5901
|
}
|
|
5902
|
-
function
|
|
5902
|
+
function X() {
|
|
5903
5903
|
if (i.xml.startsWith("<![CDATA[")) {
|
|
5904
5904
|
const te = i.xml.indexOf("]]>");
|
|
5905
5905
|
if (te > -1) {
|
|
@@ -5973,7 +5973,7 @@ function fo() {
|
|
|
5973
5973
|
m.exports = Te, s.default = Te;
|
|
5974
5974
|
})(xn, xn.exports)), xn.exports;
|
|
5975
5975
|
}
|
|
5976
|
-
var ca =
|
|
5976
|
+
var ca = Xt.exports, la;
|
|
5977
5977
|
function ho() {
|
|
5978
5978
|
return la || (la = 1, (function(m, s) {
|
|
5979
5979
|
var l = ca && ca.__importDefault || function(M) {
|
|
@@ -6000,7 +6000,7 @@ function ho() {
|
|
|
6000
6000
|
}
|
|
6001
6001
|
function _(M, B, ue) {
|
|
6002
6002
|
if (M.type === "Element")
|
|
6003
|
-
|
|
6003
|
+
X(M, B, ue);
|
|
6004
6004
|
else if (M.type === "ProcessingInstruction")
|
|
6005
6005
|
Q(M, B);
|
|
6006
6006
|
else if (typeof M.content == "string")
|
|
@@ -6019,7 +6019,7 @@ function ho() {
|
|
|
6019
6019
|
const ue = "/" + M.join("/"), ie = M[M.length - 1];
|
|
6020
6020
|
return B.includes(ie) || B.includes(ue);
|
|
6021
6021
|
}
|
|
6022
|
-
function
|
|
6022
|
+
function X(M, B, ue) {
|
|
6023
6023
|
if (B.path.push(M.name), !ue && B.content.length > 0 && d(B), y(B, "<" + M.name), G(B, M.attributes), M.children === null || B.options.forceSelfClosingEmptyTag && M.children.length === 0) {
|
|
6024
6024
|
const ie = B.options.whiteSpaceAtEndOfSelfclosingTag ? " />" : "/>";
|
|
6025
6025
|
y(B, ie);
|
|
@@ -6072,7 +6072,7 @@ function ho() {
|
|
|
6072
6072
|
}
|
|
6073
6073
|
}
|
|
6074
6074
|
fe.minify = (M, B = {}) => fe(M, Object.assign(Object.assign({}, B), { indentation: "", lineSeparator: "" })), m.exports = fe, s.default = fe;
|
|
6075
|
-
})(
|
|
6075
|
+
})(Xt, Xt.exports)), Xt.exports;
|
|
6076
6076
|
}
|
|
6077
6077
|
var po = /* @__PURE__ */ ho();
|
|
6078
6078
|
const mo = /* @__PURE__ */ xa(po);
|
|
@@ -6088,18 +6088,18 @@ async function yo(m) {
|
|
|
6088
6088
|
suggestedName: i,
|
|
6089
6089
|
types: [
|
|
6090
6090
|
{
|
|
6091
|
-
description: "
|
|
6091
|
+
description: `${s.replace(/^\./, "").toUpperCase()} Files`,
|
|
6092
6092
|
accept: { "application/xml": [s] }
|
|
6093
6093
|
}
|
|
6094
6094
|
]
|
|
6095
6095
|
})).createWritable();
|
|
6096
6096
|
await G.write(F), await G.close();
|
|
6097
|
-
} catch (
|
|
6098
|
-
|
|
6097
|
+
} catch (X) {
|
|
6098
|
+
X.name !== "AbortError" && console.error("Save failed:", X);
|
|
6099
6099
|
}
|
|
6100
6100
|
else {
|
|
6101
|
-
const
|
|
6102
|
-
G.href =
|
|
6101
|
+
const X = URL.createObjectURL(F), G = document.createElement("a");
|
|
6102
|
+
G.href = X, G.download = i, document.body.appendChild(G), G.click(), G.remove(), URL.revokeObjectURL(X);
|
|
6103
6103
|
}
|
|
6104
6104
|
}
|
|
6105
6105
|
async function qo(m) {
|
|
@@ -6149,24 +6149,24 @@ async function bo(m) {
|
|
|
6149
6149
|
null
|
|
6150
6150
|
), F = await s.table(_).where({ tagName: h }).first();
|
|
6151
6151
|
if (!F) throw new Error(`No ${h} root element found in DB`);
|
|
6152
|
-
const
|
|
6152
|
+
const X = D.createElementNS(
|
|
6153
6153
|
F.namespace.uri,
|
|
6154
6154
|
F.tagName
|
|
6155
6155
|
);
|
|
6156
|
-
return
|
|
6156
|
+
return X.setAttribute("xmlns", F.namespace.uri), F.attributes && Oa({
|
|
6157
6157
|
dialecteConfig: l,
|
|
6158
6158
|
document: D,
|
|
6159
|
-
element:
|
|
6159
|
+
element: X,
|
|
6160
6160
|
attributes: F.attributes,
|
|
6161
6161
|
isRoot: !0
|
|
6162
|
-
}), Da({ dialecteConfig: l, rootElement:
|
|
6162
|
+
}), Da({ dialecteConfig: l, rootElement: X, namespace: F.namespace }), F.value && (X.textContent = F.value.trim()), i && X.setAttribute(Na, F.id), D.appendChild(X), await Aa({
|
|
6163
6163
|
databaseInstance: s,
|
|
6164
6164
|
dialecteConfig: l,
|
|
6165
6165
|
elementsTableName: _,
|
|
6166
6166
|
withDatabaseIds: i,
|
|
6167
6167
|
xmlDocument: D,
|
|
6168
6168
|
databaseRecord: F,
|
|
6169
|
-
parentDomElement:
|
|
6169
|
+
parentDomElement: X
|
|
6170
6170
|
});
|
|
6171
6171
|
}
|
|
6172
6172
|
}
|
|
@@ -6181,15 +6181,15 @@ async function Aa(m) {
|
|
|
6181
6181
|
parentDomElement: _
|
|
6182
6182
|
} = m;
|
|
6183
6183
|
if (!y.children) return;
|
|
6184
|
-
const D = y.children.map((Q) => Q.id),
|
|
6184
|
+
const D = y.children.map((Q) => Q.id), X = await s.table(i).bulkGet(D);
|
|
6185
6185
|
Eo({
|
|
6186
|
-
childrenRecords:
|
|
6186
|
+
childrenRecords: X,
|
|
6187
6187
|
parentRecord: y
|
|
6188
6188
|
});
|
|
6189
6189
|
const G = _o({
|
|
6190
6190
|
parentTagName: y.tagName,
|
|
6191
6191
|
availableChildren: l.children,
|
|
6192
|
-
childrenRecords:
|
|
6192
|
+
childrenRecords: X
|
|
6193
6193
|
});
|
|
6194
6194
|
for (const Q of G) {
|
|
6195
6195
|
const fe = wo({
|
|
@@ -6263,8 +6263,8 @@ function Da(m) {
|
|
|
6263
6263
|
const D = y.includes(":") && y.split(":").pop() || y;
|
|
6264
6264
|
if (!(_.namespace ? l.hasAttributeNS(_.namespace.uri, D) : l.hasAttribute(D)))
|
|
6265
6265
|
if (_.namespace) {
|
|
6266
|
-
const
|
|
6267
|
-
l.setAttributeNS(_.namespace.uri,
|
|
6266
|
+
const X = `${_.namespace.prefix}:${D}`;
|
|
6267
|
+
l.setAttributeNS(_.namespace.uri, X, _.default || "");
|
|
6268
6268
|
} else
|
|
6269
6269
|
l.setAttribute(D, _.default || "");
|
|
6270
6270
|
}
|
|
@@ -6306,10 +6306,10 @@ function Lo(m) {
|
|
|
6306
6306
|
return new Ea(y, s, h, d);
|
|
6307
6307
|
}
|
|
6308
6308
|
async function Uo(m) {
|
|
6309
|
-
const { config: s, storage: l, extensions: i, hooks: d } = m, h = da({ base: i?.base, custom: i?.custom }), y = Ra(l, s), _ = s.definition[s.rootElementName], D = Object.entries(_?.attributes.details ?? {}).filter(([, F]) => F.required).map(([F,
|
|
6309
|
+
const { config: s, storage: l, extensions: i, hooks: d } = m, h = da({ base: i?.base, custom: i?.custom }), y = Ra(l, s), _ = s.definition[s.rootElementName], D = Object.entries(_?.attributes.details ?? {}).filter(([, F]) => F.required).map(([F, X]) => ({
|
|
6310
6310
|
name: F,
|
|
6311
|
-
value:
|
|
6312
|
-
|
|
6311
|
+
value: X.fixed ?? X.default ?? "",
|
|
6312
|
+
...X.namespace ? { namespace: X.namespace } : {}
|
|
6313
6313
|
}));
|
|
6314
6314
|
return await y.commit({
|
|
6315
6315
|
creates: [
|
|
@@ -6335,7 +6335,7 @@ function Ra(m, s) {
|
|
|
6335
6335
|
export {
|
|
6336
6336
|
ya as A,
|
|
6337
6337
|
so as B,
|
|
6338
|
-
|
|
6338
|
+
$t as C,
|
|
6339
6339
|
Bi as D,
|
|
6340
6340
|
mr as E,
|
|
6341
6341
|
ba as Q,
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as s, a, Q as r, T as i, b as o, c as l, d as c, f as d, g as u, h as n, j as b, e as m, k as A, l as D, m as g, n as R, p, q as T, r as f, s as E, t as x, u as F, v as h, w as k, y as B, z as C, A as _, i as y, B as I, C as O, E as j, o as N } from "./index-
|
|
1
|
+
import { D as s, a, Q as r, T as i, b as o, c as l, d as c, f as d, g as u, h as n, j as b, e as m, k as A, l as D, m as g, n as R, p, q as T, r as f, s as E, t as x, u as F, v as h, w as k, y as B, z as C, A as _, i as y, B as I, C as O, E as j, o as N } from "./index-CTxx1Jfv.js";
|
|
2
2
|
import { E as X, t as w } from "./index-B1qiHOqL.js";
|
|
3
3
|
export {
|
|
4
4
|
s as DexieStore,
|
package/dist/test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect as f, it as p } from "vitest";
|
|
2
|
-
import { x as q, D as S, i as D, o as T, e as v } from "./index-
|
|
2
|
+
import { x as q, D as S, i as D, o as T, e as v } from "./index-CTxx1Jfv.js";
|
|
3
3
|
import { D as L, s as w, o as g, n as O } from "./merge-extensions-BWXwiKx1.js";
|
|
4
4
|
function E(a) {
|
|
5
5
|
const t = M(a);
|