@metapages/metapage 1.10.8 → 1.10.10
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/README.md +12 -8
- package/dist/index.js +624 -613
- package/dist/index.js.map +1 -1
- package/dist/metapage/Metapage.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/metapage/Metapage.ts +36 -0
package/dist/index.js
CHANGED
|
@@ -57,7 +57,7 @@ var Us = { exports: {} };
|
|
|
57
57
|
retryOn: []
|
|
58
58
|
};
|
|
59
59
|
return r = Object.assign(a, r), function(l, c) {
|
|
60
|
-
var f = r.retries,
|
|
60
|
+
var f = r.retries, h = r.retryDelay, p = r.retryOn;
|
|
61
61
|
if (c && c.retries !== void 0)
|
|
62
62
|
if (n(c.retries))
|
|
63
63
|
f = c.retries;
|
|
@@ -65,52 +65,52 @@ var Us = { exports: {} };
|
|
|
65
65
|
throw new i("retries must be a positive integer");
|
|
66
66
|
if (c && c.retryDelay !== void 0)
|
|
67
67
|
if (n(c.retryDelay) || typeof c.retryDelay == "function")
|
|
68
|
-
|
|
68
|
+
h = c.retryDelay;
|
|
69
69
|
else
|
|
70
70
|
throw new i("retryDelay must be a positive integer or a function returning a positive integer");
|
|
71
71
|
if (c && c.retryOn)
|
|
72
72
|
if (Array.isArray(c.retryOn) || typeof c.retryOn == "function")
|
|
73
|
-
|
|
73
|
+
p = c.retryOn;
|
|
74
74
|
else
|
|
75
75
|
throw new i("retryOn property expects an array or function");
|
|
76
|
-
return new Promise(function(
|
|
77
|
-
var
|
|
78
|
-
var
|
|
79
|
-
o(
|
|
80
|
-
if (Array.isArray(
|
|
81
|
-
|
|
82
|
-
else if (typeof
|
|
76
|
+
return new Promise(function(d, b) {
|
|
77
|
+
var w = function(S) {
|
|
78
|
+
var O = typeof Request < "u" && l instanceof Request ? l.clone() : l;
|
|
79
|
+
o(O, c).then(function($) {
|
|
80
|
+
if (Array.isArray(p) && p.indexOf($.status) === -1)
|
|
81
|
+
d($);
|
|
82
|
+
else if (typeof p == "function")
|
|
83
83
|
try {
|
|
84
|
-
return Promise.resolve(
|
|
85
|
-
|
|
84
|
+
return Promise.resolve(p(S, null, $)).then(function(E) {
|
|
85
|
+
E ? A(S, null, $) : d($);
|
|
86
86
|
}).catch(b);
|
|
87
|
-
} catch (
|
|
88
|
-
b(
|
|
87
|
+
} catch (E) {
|
|
88
|
+
b(E);
|
|
89
89
|
}
|
|
90
90
|
else
|
|
91
|
-
|
|
92
|
-
}).catch(function(
|
|
93
|
-
if (typeof
|
|
91
|
+
S < f ? A(S, null, $) : d($);
|
|
92
|
+
}).catch(function($) {
|
|
93
|
+
if (typeof p == "function")
|
|
94
94
|
try {
|
|
95
|
-
Promise.resolve(
|
|
96
|
-
|
|
97
|
-
}).catch(function(
|
|
98
|
-
b(
|
|
95
|
+
Promise.resolve(p(S, $, null)).then(function(E) {
|
|
96
|
+
E ? A(S, $, null) : b($);
|
|
97
|
+
}).catch(function(E) {
|
|
98
|
+
b(E);
|
|
99
99
|
});
|
|
100
|
-
} catch (
|
|
101
|
-
b(
|
|
100
|
+
} catch (E) {
|
|
101
|
+
b(E);
|
|
102
102
|
}
|
|
103
103
|
else
|
|
104
|
-
|
|
104
|
+
S < f ? A(S, $, null) : b($);
|
|
105
105
|
});
|
|
106
106
|
};
|
|
107
|
-
function
|
|
108
|
-
var
|
|
107
|
+
function A(S, O, $) {
|
|
108
|
+
var E = typeof h == "function" ? h(S, O, $) : h;
|
|
109
109
|
setTimeout(function() {
|
|
110
|
-
|
|
111
|
-
},
|
|
110
|
+
w(++S);
|
|
111
|
+
}, E);
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
w(0);
|
|
114
114
|
});
|
|
115
115
|
};
|
|
116
116
|
};
|
|
@@ -157,14 +157,14 @@ function et(t) {
|
|
|
157
157
|
return (e = t.copy) !== null && e !== void 0 ? e : t.original;
|
|
158
158
|
}
|
|
159
159
|
function Rt(t) {
|
|
160
|
-
return !!
|
|
160
|
+
return !!D(t);
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function D(t) {
|
|
163
163
|
return typeof t != "object" ? null : t == null ? void 0 : t[Hs];
|
|
164
164
|
}
|
|
165
165
|
function Ye(t) {
|
|
166
166
|
var e;
|
|
167
|
-
const s =
|
|
167
|
+
const s = D(t);
|
|
168
168
|
return s ? (e = s.copy) !== null && e !== void 0 ? e : s.original : t;
|
|
169
169
|
}
|
|
170
170
|
function ut(t, e) {
|
|
@@ -175,7 +175,7 @@ function ut(t, e) {
|
|
|
175
175
|
}
|
|
176
176
|
function Ns(t, e = []) {
|
|
177
177
|
if (Object.hasOwnProperty.call(t, "key")) {
|
|
178
|
-
const s = t.parent.copy, n =
|
|
178
|
+
const s = t.parent.copy, n = D(bt(s, t.key));
|
|
179
179
|
if (n !== null && (n == null ? void 0 : n.original) !== t.original)
|
|
180
180
|
return null;
|
|
181
181
|
const i = t.parent.type === 3, o = i ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
|
|
@@ -203,7 +203,7 @@ function Qt(t, e, s) {
|
|
|
203
203
|
xt(t) === 2 ? t.set(e, s) : t[e] = s;
|
|
204
204
|
}
|
|
205
205
|
function Me(t, e) {
|
|
206
|
-
const s =
|
|
206
|
+
const s = D(t);
|
|
207
207
|
return (s ? et(s) : t)[e];
|
|
208
208
|
}
|
|
209
209
|
function gt(t, e) {
|
|
@@ -388,7 +388,7 @@ function Bs(t, e, s) {
|
|
|
388
388
|
if (e.add(t), qe(t, (o, r) => {
|
|
389
389
|
var a;
|
|
390
390
|
if (Rt(r)) {
|
|
391
|
-
const u =
|
|
391
|
+
const u = D(r);
|
|
392
392
|
q(u);
|
|
393
393
|
const l = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
|
|
394
394
|
Qt(n ? i : t, o, l);
|
|
@@ -420,7 +420,7 @@ function Le(t, e, s, n) {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
function Ze(t, e, s, n) {
|
|
423
|
-
const i =
|
|
423
|
+
const i = D(s);
|
|
424
424
|
i && (i.callbacks || (i.callbacks = []), i.callbacks.push((o, r) => {
|
|
425
425
|
var a;
|
|
426
426
|
const u = t.type === 3 ? t.setMap : t.copy;
|
|
@@ -471,10 +471,10 @@ function jn(t, e, s, n, i) {
|
|
|
471
471
|
});
|
|
472
472
|
} else
|
|
473
473
|
for (let c = u.length; o.length < c; c -= 1) {
|
|
474
|
-
const f = e.concat([c - 1]),
|
|
474
|
+
const f = e.concat([c - 1]), h = Ct(f, i);
|
|
475
475
|
n.push({
|
|
476
476
|
op: J.Remove,
|
|
477
|
-
path:
|
|
477
|
+
path: h
|
|
478
478
|
});
|
|
479
479
|
}
|
|
480
480
|
}
|
|
@@ -484,8 +484,8 @@ function Tn({ original: t, copy: e, assignedMap: s }, n, i, o, r) {
|
|
|
484
484
|
const l = bt(t, u), c = re(bt(e, u)), f = a ? Bt(t, u) ? J.Replace : J.Add : J.Remove;
|
|
485
485
|
if (gt(l, c) && f === J.Replace)
|
|
486
486
|
return;
|
|
487
|
-
const
|
|
488
|
-
i.push(f === J.Remove ? { op: f, path:
|
|
487
|
+
const h = n.concat(u), p = Ct(h, r);
|
|
488
|
+
i.push(f === J.Remove ? { op: f, path: p } : { op: f, path: p, value: c }), o.push(f === J.Add ? { op: J.Remove, path: p } : f === J.Remove ? { op: J.Add, path: p, value: l } : { op: J.Replace, path: p, value: l });
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
491
|
function Ln({ original: t, copy: e }, s, n, i, o) {
|
|
@@ -538,23 +538,23 @@ const ce = (t, e, s = !1) => {
|
|
|
538
538
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
539
539
|
}, ke = {
|
|
540
540
|
get size() {
|
|
541
|
-
return et(
|
|
541
|
+
return et(D(this)).size;
|
|
542
542
|
},
|
|
543
543
|
has(t) {
|
|
544
|
-
return et(
|
|
544
|
+
return et(D(this)).has(t);
|
|
545
545
|
},
|
|
546
546
|
set(t, e) {
|
|
547
|
-
const s =
|
|
547
|
+
const s = D(this), n = et(s);
|
|
548
548
|
return (!n.has(t) || !gt(n.get(t), e)) && (q(s), ht(s), s.assignedMap.set(t, !0), s.copy.set(t, e), Ze(s, t, e, Wt)), this;
|
|
549
549
|
},
|
|
550
550
|
delete(t) {
|
|
551
551
|
if (!this.has(t))
|
|
552
552
|
return !1;
|
|
553
|
-
const e =
|
|
553
|
+
const e = D(this);
|
|
554
554
|
return q(e), ht(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
|
|
555
555
|
},
|
|
556
556
|
clear() {
|
|
557
|
-
const t =
|
|
557
|
+
const t = D(this);
|
|
558
558
|
if (this.size) {
|
|
559
559
|
q(t), ht(t), t.assignedMap = /* @__PURE__ */ new Map();
|
|
560
560
|
for (const [e] of t.original)
|
|
@@ -563,14 +563,14 @@ const ce = (t, e, s = !1) => {
|
|
|
563
563
|
}
|
|
564
564
|
},
|
|
565
565
|
forEach(t, e) {
|
|
566
|
-
const s =
|
|
566
|
+
const s = D(this);
|
|
567
567
|
et(s).forEach((n, i) => {
|
|
568
568
|
t.call(e, this.get(i), i, this);
|
|
569
569
|
});
|
|
570
570
|
},
|
|
571
571
|
get(t) {
|
|
572
572
|
var e, s;
|
|
573
|
-
const n =
|
|
573
|
+
const n = D(this), i = et(n).get(t), o = ((s = (e = n.options).mark) === null || s === void 0 ? void 0 : s.call(e, i, nt)) === nt.mutable;
|
|
574
574
|
if (n.options.strict && ce(i, n.options, o), o || n.finalized || !ut(i, n.options) || i !== n.original.get(t))
|
|
575
575
|
return i;
|
|
576
576
|
const r = Qe.createDraft({
|
|
@@ -583,7 +583,7 @@ const ce = (t, e, s = !1) => {
|
|
|
583
583
|
return q(n), n.copy.set(t, r), r;
|
|
584
584
|
},
|
|
585
585
|
keys() {
|
|
586
|
-
return et(
|
|
586
|
+
return et(D(this)).keys();
|
|
587
587
|
},
|
|
588
588
|
values() {
|
|
589
589
|
const t = this.keys();
|
|
@@ -624,7 +624,7 @@ const ce = (t, e, s = !1) => {
|
|
|
624
624
|
return o;
|
|
625
625
|
const r = o.value;
|
|
626
626
|
let a = t.setMap.get(r);
|
|
627
|
-
const u =
|
|
627
|
+
const u = D(a), l = ((i = (n = t.options).mark) === null || i === void 0 ? void 0 : i.call(n, a, nt)) === nt.mutable;
|
|
628
628
|
if (t.options.strict && ce(r, t.options, l), !l && !u && ut(r, t.options) && !t.finalized && t.original.has(r)) {
|
|
629
629
|
const c = Qe.createDraft({
|
|
630
630
|
original: r,
|
|
@@ -642,39 +642,39 @@ const ce = (t, e, s = !1) => {
|
|
|
642
642
|
};
|
|
643
643
|
}, le = {
|
|
644
644
|
get size() {
|
|
645
|
-
return
|
|
645
|
+
return D(this).setMap.size;
|
|
646
646
|
},
|
|
647
647
|
has(t) {
|
|
648
|
-
const e =
|
|
648
|
+
const e = D(this);
|
|
649
649
|
if (e.setMap.has(t))
|
|
650
650
|
return !0;
|
|
651
651
|
q(e);
|
|
652
|
-
const s =
|
|
652
|
+
const s = D(t);
|
|
653
653
|
return !!(s && e.setMap.has(s.original));
|
|
654
654
|
},
|
|
655
655
|
add(t) {
|
|
656
|
-
const e =
|
|
656
|
+
const e = D(this);
|
|
657
657
|
return this.has(t) || (q(e), ht(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), Ze(e, t, t, Wt)), this;
|
|
658
658
|
},
|
|
659
659
|
delete(t) {
|
|
660
660
|
if (!this.has(t))
|
|
661
661
|
return !1;
|
|
662
|
-
const e =
|
|
662
|
+
const e = D(this);
|
|
663
663
|
q(e), ht(e);
|
|
664
|
-
const s =
|
|
664
|
+
const s = D(t);
|
|
665
665
|
return s && e.setMap.has(s.original) ? (e.assignedMap.set(s.original, !1), e.setMap.delete(s.original)) : (!s && e.setMap.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.setMap.delete(t));
|
|
666
666
|
},
|
|
667
667
|
clear() {
|
|
668
668
|
if (!this.size)
|
|
669
669
|
return;
|
|
670
|
-
const t =
|
|
670
|
+
const t = D(this);
|
|
671
671
|
q(t), ht(t);
|
|
672
672
|
for (const e of t.original)
|
|
673
673
|
t.assignedMap.set(e, !1);
|
|
674
674
|
t.setMap.clear();
|
|
675
675
|
},
|
|
676
676
|
values() {
|
|
677
|
-
const t =
|
|
677
|
+
const t = D(this);
|
|
678
678
|
q(t);
|
|
679
679
|
const e = t.setMap.keys();
|
|
680
680
|
return {
|
|
@@ -683,7 +683,7 @@ const ce = (t, e, s = !1) => {
|
|
|
683
683
|
};
|
|
684
684
|
},
|
|
685
685
|
entries() {
|
|
686
|
-
const t =
|
|
686
|
+
const t = D(this);
|
|
687
687
|
q(t);
|
|
688
688
|
const e = t.setMap.keys();
|
|
689
689
|
return {
|
|
@@ -766,7 +766,7 @@ const Hn = Reflect.ownKeys(le), zs = {
|
|
|
766
766
|
finalities: t.finalities,
|
|
767
767
|
options: t.options
|
|
768
768
|
}), typeof r == "function") {
|
|
769
|
-
const l =
|
|
769
|
+
const l = D(t.copy[e]);
|
|
770
770
|
return q(l), ht(l), l.copy;
|
|
771
771
|
}
|
|
772
772
|
return t.copy[e];
|
|
@@ -783,7 +783,7 @@ const Hn = Reflect.ownKeys(le), zs = {
|
|
|
783
783
|
const o = Ss(et(t), e);
|
|
784
784
|
if (o != null && o.set)
|
|
785
785
|
return o.set.call(t.proxy, s), !0;
|
|
786
|
-
const r = Me(et(t), e), a =
|
|
786
|
+
const r = Me(et(t), e), a = D(r);
|
|
787
787
|
return a && gt(a.original, s) ? (t.copy[e] = s, t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (gt(s, r) && (s !== void 0 || Bt(t.original, e)) || (q(t), ht(t), Bt(t.original, e) && gt(s, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = s, Ze(t, e, s, Wt)), !0);
|
|
788
788
|
},
|
|
789
789
|
has(t, e) {
|
|
@@ -832,23 +832,23 @@ function ts(t) {
|
|
|
832
832
|
const { proxy: u, revoke: l } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, zs);
|
|
833
833
|
if (i.revoke.push(l), a.proxy = u, s) {
|
|
834
834
|
const c = s;
|
|
835
|
-
c.finalities.draft.push((f,
|
|
836
|
-
var
|
|
837
|
-
const b =
|
|
838
|
-
let
|
|
839
|
-
const
|
|
840
|
-
if (
|
|
841
|
-
let
|
|
842
|
-
|
|
835
|
+
c.finalities.draft.push((f, h) => {
|
|
836
|
+
var p, d;
|
|
837
|
+
const b = D(u);
|
|
838
|
+
let w = c.type === 3 ? c.setMap : c.copy;
|
|
839
|
+
const A = bt(w, n), S = D(A);
|
|
840
|
+
if (S) {
|
|
841
|
+
let O = S.original;
|
|
842
|
+
S.operated && (O = Ye(A)), Te(S), Le(S, Wt, f, h), c.options.enableAutoFreeze && (c.options.updatedValues = (p = c.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(O, S.original)), Qt(w, n, O);
|
|
843
843
|
}
|
|
844
|
-
(
|
|
845
|
-
|
|
844
|
+
(d = b.callbacks) === null || d === void 0 || d.forEach((O) => {
|
|
845
|
+
O(f, h);
|
|
846
846
|
});
|
|
847
847
|
});
|
|
848
848
|
} else {
|
|
849
|
-
const c =
|
|
850
|
-
c.finalities.draft.push((f,
|
|
851
|
-
Te(c), Le(c, Wt, f,
|
|
849
|
+
const c = D(u);
|
|
850
|
+
c.finalities.draft.push((f, h) => {
|
|
851
|
+
Te(c), Le(c, Wt, f, h);
|
|
852
852
|
});
|
|
853
853
|
}
|
|
854
854
|
return u;
|
|
@@ -856,7 +856,7 @@ function ts(t) {
|
|
|
856
856
|
Qe.createDraft = ts;
|
|
857
857
|
function Nn(t, e, s, n, i) {
|
|
858
858
|
var o;
|
|
859
|
-
const r =
|
|
859
|
+
const r = D(t), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : t, u = !!e.length;
|
|
860
860
|
if (r != null && r.operated)
|
|
861
861
|
for (; r.finalities.draft.length > 0; )
|
|
862
862
|
r.finalities.draft.pop()(s, n);
|
|
@@ -894,7 +894,7 @@ function Fn(t, e) {
|
|
|
894
894
|
function Ue(t) {
|
|
895
895
|
const { rootDraft: e, value: s, useRawReturn: n = !1, isRoot: i = !0 } = t;
|
|
896
896
|
qe(s, (o, r, a) => {
|
|
897
|
-
const u =
|
|
897
|
+
const u = D(r);
|
|
898
898
|
if (u && e && u.finalities === e.finalities) {
|
|
899
899
|
t.isContainDraft = !0;
|
|
900
900
|
const l = u.original;
|
|
@@ -909,7 +909,7 @@ function Ue(t) {
|
|
|
909
909
|
}
|
|
910
910
|
function Vs(t) {
|
|
911
911
|
var e;
|
|
912
|
-
const s =
|
|
912
|
+
const s = D(t);
|
|
913
913
|
if (!ut(t, s == null ? void 0 : s.options))
|
|
914
914
|
return t;
|
|
915
915
|
const n = xt(t);
|
|
@@ -950,72 +950,72 @@ const Bn = (t) => {
|
|
|
950
950
|
return function e(s, n, i) {
|
|
951
951
|
var o, r, a;
|
|
952
952
|
if (typeof s == "function" && typeof n != "function")
|
|
953
|
-
return function(
|
|
954
|
-
return e(
|
|
953
|
+
return function(E, ...j) {
|
|
954
|
+
return e(E, (T) => s.call(this, T, ...j), n);
|
|
955
955
|
};
|
|
956
956
|
const u = s, l = n;
|
|
957
957
|
let c = i;
|
|
958
958
|
if (typeof n != "function" && (c = n), c !== void 0 && Object.prototype.toString.call(c) !== "[object Object]")
|
|
959
959
|
throw new Error(`Invalid options: ${c}, 'options' should be an object.`);
|
|
960
960
|
c = Object.assign(Object.assign({}, t), c);
|
|
961
|
-
const f = Rt(u) ? Es(u) : u,
|
|
961
|
+
const f = Rt(u) ? Es(u) : u, h = Array.isArray(c.mark) ? (E, j) => {
|
|
962
962
|
for (const T of c.mark) {
|
|
963
963
|
if (typeof T != "function")
|
|
964
964
|
throw new Error(`Invalid mark: ${T}, 'mark' should be a function.`);
|
|
965
|
-
const
|
|
966
|
-
if (
|
|
967
|
-
return
|
|
965
|
+
const _ = T(E, j);
|
|
966
|
+
if (_)
|
|
967
|
+
return _;
|
|
968
968
|
}
|
|
969
|
-
} : c.mark,
|
|
969
|
+
} : c.mark, p = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, d = (r = c.strict) !== null && r !== void 0 ? r : !1, w = {
|
|
970
970
|
enableAutoFreeze: (a = c.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
|
|
971
|
-
mark:
|
|
972
|
-
strict:
|
|
973
|
-
enablePatches:
|
|
971
|
+
mark: h,
|
|
972
|
+
strict: d,
|
|
973
|
+
enablePatches: p
|
|
974
974
|
};
|
|
975
|
-
if (!ut(f,
|
|
975
|
+
if (!ut(f, w) && typeof f == "object" && f !== null)
|
|
976
976
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
977
|
-
const [
|
|
977
|
+
const [A, S] = Fn(f, w);
|
|
978
978
|
if (typeof n != "function") {
|
|
979
|
-
if (!ut(f,
|
|
979
|
+
if (!ut(f, w))
|
|
980
980
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
981
|
-
return [
|
|
981
|
+
return [A, S];
|
|
982
982
|
}
|
|
983
|
-
let
|
|
983
|
+
let O;
|
|
984
984
|
try {
|
|
985
|
-
|
|
986
|
-
} catch (
|
|
987
|
-
throw je(
|
|
985
|
+
O = l(A);
|
|
986
|
+
} catch (E) {
|
|
987
|
+
throw je(D(A)), E;
|
|
988
988
|
}
|
|
989
|
-
const
|
|
990
|
-
const
|
|
991
|
-
if (!Rt(
|
|
992
|
-
if (
|
|
989
|
+
const $ = (E) => {
|
|
990
|
+
const j = D(A);
|
|
991
|
+
if (!Rt(E)) {
|
|
992
|
+
if (E !== void 0 && !gt(E, A) && (j != null && j.operated))
|
|
993
993
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
994
|
-
const
|
|
995
|
-
if (
|
|
996
|
-
const
|
|
997
|
-
return
|
|
998
|
-
rootDraft:
|
|
999
|
-
value:
|
|
994
|
+
const _ = E == null ? void 0 : E[Cn];
|
|
995
|
+
if (_) {
|
|
996
|
+
const M = _[0];
|
|
997
|
+
return w.strict && typeof E == "object" && E !== null && Ue({
|
|
998
|
+
rootDraft: j,
|
|
999
|
+
value: E,
|
|
1000
1000
|
useRawReturn: !0
|
|
1001
|
-
}),
|
|
1001
|
+
}), S([M]);
|
|
1002
1002
|
}
|
|
1003
|
-
if (
|
|
1004
|
-
return typeof
|
|
1003
|
+
if (E !== void 0)
|
|
1004
|
+
return typeof E == "object" && E !== null && Ue({ rootDraft: j, value: E }), S([E]);
|
|
1005
1005
|
}
|
|
1006
|
-
if (
|
|
1007
|
-
return
|
|
1008
|
-
const T =
|
|
1009
|
-
if (
|
|
1006
|
+
if (E === A || E === void 0)
|
|
1007
|
+
return S([]);
|
|
1008
|
+
const T = D(E);
|
|
1009
|
+
if (w === T.options) {
|
|
1010
1010
|
if (T.operated)
|
|
1011
1011
|
throw new Error("Cannot return a modified child draft.");
|
|
1012
|
-
return
|
|
1012
|
+
return S([Es(E)]);
|
|
1013
1013
|
}
|
|
1014
|
-
return
|
|
1014
|
+
return S([E]);
|
|
1015
1015
|
};
|
|
1016
|
-
return
|
|
1017
|
-
throw je(
|
|
1018
|
-
}) :
|
|
1016
|
+
return O instanceof Promise ? O.then($, (E) => {
|
|
1017
|
+
throw je(D(A)), E;
|
|
1018
|
+
}) : $(O);
|
|
1019
1019
|
};
|
|
1020
1020
|
}, C = Bn();
|
|
1021
1021
|
Object.prototype.constructor.toString();
|
|
@@ -1596,10 +1596,10 @@ function bi(t, e, s, n, i) {
|
|
|
1596
1596
|
});
|
|
1597
1597
|
} else
|
|
1598
1598
|
for (let c = u.length; o.length < c; c -= 1) {
|
|
1599
|
-
const f = e.concat([c - 1]),
|
|
1599
|
+
const f = e.concat([c - 1]), h = $t(f, i);
|
|
1600
1600
|
n.push({
|
|
1601
1601
|
op: K.Remove,
|
|
1602
|
-
path:
|
|
1602
|
+
path: h
|
|
1603
1603
|
});
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
@@ -1609,8 +1609,8 @@ function _i({ original: t, copy: e, assignedMap: s }, n, i, o, r) {
|
|
|
1609
1609
|
const l = Et(t, u), c = ae(Et(e, u)), f = a ? zt(t, u) ? K.Replace : K.Add : K.Remove;
|
|
1610
1610
|
if (Pt(l, c) && f === K.Replace)
|
|
1611
1611
|
return;
|
|
1612
|
-
const
|
|
1613
|
-
i.push(f === K.Remove ? { op: f, path:
|
|
1612
|
+
const h = n.concat(u), p = $t(h, r);
|
|
1613
|
+
i.push(f === K.Remove ? { op: f, path: p } : { op: f, path: p, value: c }), o.push(f === K.Add ? { op: K.Remove, path: p } : f === K.Remove ? { op: K.Add, path: p, value: l } : { op: K.Replace, path: p, value: l });
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
1616
|
function wi({ original: t, copy: e }, s, n, i, o) {
|
|
@@ -1957,23 +1957,23 @@ function en(t) {
|
|
|
1957
1957
|
const { proxy: u, revoke: l } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, tn);
|
|
1958
1958
|
if (i.revoke.push(l), a.proxy = u, s) {
|
|
1959
1959
|
const c = s;
|
|
1960
|
-
c.finalities.draft.push((f,
|
|
1961
|
-
var
|
|
1960
|
+
c.finalities.draft.push((f, h) => {
|
|
1961
|
+
var p, d;
|
|
1962
1962
|
const b = k(u);
|
|
1963
|
-
let
|
|
1964
|
-
const
|
|
1965
|
-
if (
|
|
1966
|
-
let
|
|
1967
|
-
|
|
1963
|
+
let w = c.type === 3 ? c.setMap : c.copy;
|
|
1964
|
+
const A = Et(w, n), S = k(A);
|
|
1965
|
+
if (S) {
|
|
1966
|
+
let O = S.original;
|
|
1967
|
+
S.operated && (O = ss(A)), Ne(S), Fe(S, Jt, f, h), c.options.enableAutoFreeze && (c.options.updatedValues = (p = c.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(O, S.original)), ns(w, n, O);
|
|
1968
1968
|
}
|
|
1969
|
-
(
|
|
1970
|
-
|
|
1969
|
+
(d = b.callbacks) === null || d === void 0 || d.forEach((O) => {
|
|
1970
|
+
O(f, h);
|
|
1971
1971
|
});
|
|
1972
1972
|
});
|
|
1973
1973
|
} else {
|
|
1974
1974
|
const c = k(u);
|
|
1975
|
-
c.finalities.draft.push((f,
|
|
1976
|
-
Ne(c), Fe(c, Jt, f,
|
|
1975
|
+
c.finalities.draft.push((f, h) => {
|
|
1976
|
+
Ne(c), Fe(c, Jt, f, h);
|
|
1977
1977
|
});
|
|
1978
1978
|
}
|
|
1979
1979
|
return u;
|
|
@@ -2209,11 +2209,11 @@ var nn = { exports: {} };
|
|
|
2209
2209
|
function i(u, l, c) {
|
|
2210
2210
|
this.fn = u, this.context = l, this.once = c || !1;
|
|
2211
2211
|
}
|
|
2212
|
-
function o(u, l, c, f,
|
|
2212
|
+
function o(u, l, c, f, h) {
|
|
2213
2213
|
if (typeof c != "function")
|
|
2214
2214
|
throw new TypeError("The listener must be a function");
|
|
2215
|
-
var
|
|
2216
|
-
return u._events[
|
|
2215
|
+
var p = new i(c, f || u, h), d = s ? s + l : l;
|
|
2216
|
+
return u._events[d] ? u._events[d].fn ? u._events[d] = [u._events[d], p] : u._events[d].push(p) : (u._events[d] = p, u._eventsCount++), u;
|
|
2217
2217
|
}
|
|
2218
2218
|
function r(u, l) {
|
|
2219
2219
|
--u._eventsCount === 0 ? u._events = new n() : delete u._events[l];
|
|
@@ -2234,56 +2234,56 @@ var nn = { exports: {} };
|
|
|
2234
2234
|
return [];
|
|
2235
2235
|
if (f.fn)
|
|
2236
2236
|
return [f.fn];
|
|
2237
|
-
for (var
|
|
2238
|
-
|
|
2239
|
-
return
|
|
2237
|
+
for (var h = 0, p = f.length, d = new Array(p); h < p; h++)
|
|
2238
|
+
d[h] = f[h].fn;
|
|
2239
|
+
return d;
|
|
2240
2240
|
}, a.prototype.listenerCount = function(l) {
|
|
2241
2241
|
var c = s ? s + l : l, f = this._events[c];
|
|
2242
2242
|
return f ? f.fn ? 1 : f.length : 0;
|
|
2243
|
-
}, a.prototype.emit = function(l, c, f,
|
|
2243
|
+
}, a.prototype.emit = function(l, c, f, h, p, d) {
|
|
2244
2244
|
var b = s ? s + l : l;
|
|
2245
2245
|
if (!this._events[b])
|
|
2246
2246
|
return !1;
|
|
2247
|
-
var
|
|
2248
|
-
if (
|
|
2249
|
-
switch (
|
|
2247
|
+
var w = this._events[b], A = arguments.length, S, O;
|
|
2248
|
+
if (w.fn) {
|
|
2249
|
+
switch (w.once && this.removeListener(l, w.fn, void 0, !0), A) {
|
|
2250
2250
|
case 1:
|
|
2251
|
-
return
|
|
2251
|
+
return w.fn.call(w.context), !0;
|
|
2252
2252
|
case 2:
|
|
2253
|
-
return
|
|
2253
|
+
return w.fn.call(w.context, c), !0;
|
|
2254
2254
|
case 3:
|
|
2255
|
-
return
|
|
2255
|
+
return w.fn.call(w.context, c, f), !0;
|
|
2256
2256
|
case 4:
|
|
2257
|
-
return
|
|
2257
|
+
return w.fn.call(w.context, c, f, h), !0;
|
|
2258
2258
|
case 5:
|
|
2259
|
-
return
|
|
2259
|
+
return w.fn.call(w.context, c, f, h, p), !0;
|
|
2260
2260
|
case 6:
|
|
2261
|
-
return
|
|
2261
|
+
return w.fn.call(w.context, c, f, h, p, d), !0;
|
|
2262
2262
|
}
|
|
2263
|
-
for (
|
|
2264
|
-
|
|
2265
|
-
|
|
2263
|
+
for (O = 1, S = new Array(A - 1); O < A; O++)
|
|
2264
|
+
S[O - 1] = arguments[O];
|
|
2265
|
+
w.fn.apply(w.context, S);
|
|
2266
2266
|
} else {
|
|
2267
|
-
var
|
|
2268
|
-
for (
|
|
2269
|
-
switch (
|
|
2267
|
+
var $ = w.length, E;
|
|
2268
|
+
for (O = 0; O < $; O++)
|
|
2269
|
+
switch (w[O].once && this.removeListener(l, w[O].fn, void 0, !0), A) {
|
|
2270
2270
|
case 1:
|
|
2271
|
-
|
|
2271
|
+
w[O].fn.call(w[O].context);
|
|
2272
2272
|
break;
|
|
2273
2273
|
case 2:
|
|
2274
|
-
|
|
2274
|
+
w[O].fn.call(w[O].context, c);
|
|
2275
2275
|
break;
|
|
2276
2276
|
case 3:
|
|
2277
|
-
|
|
2277
|
+
w[O].fn.call(w[O].context, c, f);
|
|
2278
2278
|
break;
|
|
2279
2279
|
case 4:
|
|
2280
|
-
|
|
2280
|
+
w[O].fn.call(w[O].context, c, f, h);
|
|
2281
2281
|
break;
|
|
2282
2282
|
default:
|
|
2283
|
-
if (!
|
|
2284
|
-
for (
|
|
2285
|
-
|
|
2286
|
-
|
|
2283
|
+
if (!S)
|
|
2284
|
+
for (E = 1, S = new Array(A - 1); E < A; E++)
|
|
2285
|
+
S[E - 1] = arguments[E];
|
|
2286
|
+
w[O].fn.apply(w[O].context, S);
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
2289
|
return !0;
|
|
@@ -2291,19 +2291,19 @@ var nn = { exports: {} };
|
|
|
2291
2291
|
return o(this, l, c, f, !1);
|
|
2292
2292
|
}, a.prototype.once = function(l, c, f) {
|
|
2293
2293
|
return o(this, l, c, f, !0);
|
|
2294
|
-
}, a.prototype.removeListener = function(l, c, f,
|
|
2295
|
-
var
|
|
2296
|
-
if (!this._events[
|
|
2294
|
+
}, a.prototype.removeListener = function(l, c, f, h) {
|
|
2295
|
+
var p = s ? s + l : l;
|
|
2296
|
+
if (!this._events[p])
|
|
2297
2297
|
return this;
|
|
2298
2298
|
if (!c)
|
|
2299
|
-
return r(this,
|
|
2300
|
-
var
|
|
2301
|
-
if (
|
|
2302
|
-
|
|
2299
|
+
return r(this, p), this;
|
|
2300
|
+
var d = this._events[p];
|
|
2301
|
+
if (d.fn)
|
|
2302
|
+
d.fn === c && (!h || d.once) && (!f || d.context === f) && r(this, p);
|
|
2303
2303
|
else {
|
|
2304
|
-
for (var b = 0,
|
|
2305
|
-
(
|
|
2306
|
-
|
|
2304
|
+
for (var b = 0, w = [], A = d.length; b < A; b++)
|
|
2305
|
+
(d[b].fn !== c || h && !d[b].once || f && d[b].context !== f) && w.push(d[b]);
|
|
2306
|
+
w.length ? this._events[p] = w.length === 1 ? w[0] : w : r(this, p);
|
|
2307
2307
|
}
|
|
2308
2308
|
return this;
|
|
2309
2309
|
}, a.prototype.removeAllListeners = function(l) {
|
|
@@ -2346,8 +2346,8 @@ var Hi = function(t, e) {
|
|
|
2346
2346
|
}
|
|
2347
2347
|
var l = i.push(r) - 1, c = Object.keys(r).sort(n && n(r));
|
|
2348
2348
|
for (u = "", a = 0; a < c.length; a++) {
|
|
2349
|
-
var f = c[a],
|
|
2350
|
-
|
|
2349
|
+
var f = c[a], h = o(r[f]);
|
|
2350
|
+
h && (u && (u += ","), u += JSON.stringify(f) + ":" + h);
|
|
2351
2351
|
}
|
|
2352
2352
|
return i.splice(l, 1), "{" + u + "}";
|
|
2353
2353
|
}
|
|
@@ -2488,8 +2488,8 @@ var ir = function(t, e) {
|
|
|
2488
2488
|
}
|
|
2489
2489
|
var l = i.push(r) - 1, c = Object.keys(r).sort(n && n(r));
|
|
2490
2490
|
for (u = "", a = 0; a < c.length; a++) {
|
|
2491
|
-
var f = c[a],
|
|
2492
|
-
|
|
2491
|
+
var f = c[a], h = o(r[f]);
|
|
2492
|
+
h && (u && (u += ","), u += JSON.stringify(f) + ":" + h);
|
|
2493
2493
|
}
|
|
2494
2494
|
return i.splice(l, 1), "{" + u + "}";
|
|
2495
2495
|
}
|
|
@@ -3031,37 +3031,37 @@ const xs = Se, {
|
|
|
3031
3031
|
t.isPrefix !== !0 && (t.depth = t.isGlobstar ? 1 / 0 : 1);
|
|
3032
3032
|
}, Ir = (t, e) => {
|
|
3033
3033
|
const s = e || {}, n = t.length - 1, i = s.parts === !0 || s.scanToEnd === !0, o = [], r = [], a = [];
|
|
3034
|
-
let u = t, l = -1, c = 0, f = 0,
|
|
3035
|
-
const
|
|
3034
|
+
let u = t, l = -1, c = 0, f = 0, h = !1, p = !1, d = !1, b = !1, w = !1, A = !1, S = !1, O = !1, $ = !1, E = !1, j = 0, T, _, M = { value: "", depth: 0, isGlob: !1 };
|
|
3035
|
+
const y = () => l >= n, L = () => u.charCodeAt(l + 1), V = () => (T = _, u.charCodeAt(++l));
|
|
3036
3036
|
for (; l < n; ) {
|
|
3037
|
-
|
|
3037
|
+
_ = V();
|
|
3038
3038
|
let U;
|
|
3039
|
-
if (
|
|
3040
|
-
|
|
3039
|
+
if (_ === Ft) {
|
|
3040
|
+
S = M.backslashes = !0, _ = V(), _ === xe && (A = !0);
|
|
3041
3041
|
continue;
|
|
3042
3042
|
}
|
|
3043
|
-
if (
|
|
3044
|
-
for (
|
|
3045
|
-
if (
|
|
3046
|
-
|
|
3043
|
+
if (A === !0 || _ === xe) {
|
|
3044
|
+
for (j++; y() !== !0 && (_ = V()); ) {
|
|
3045
|
+
if (_ === Ft) {
|
|
3046
|
+
S = M.backslashes = !0, V();
|
|
3047
3047
|
continue;
|
|
3048
3048
|
}
|
|
3049
|
-
if (
|
|
3050
|
-
|
|
3049
|
+
if (_ === xe) {
|
|
3050
|
+
j++;
|
|
3051
3051
|
continue;
|
|
3052
3052
|
}
|
|
3053
|
-
if (
|
|
3054
|
-
if (
|
|
3053
|
+
if (A !== !0 && _ === $e && (_ = V()) === $e) {
|
|
3054
|
+
if (h = M.isBrace = !0, d = M.isGlob = !0, E = !0, i === !0)
|
|
3055
3055
|
continue;
|
|
3056
3056
|
break;
|
|
3057
3057
|
}
|
|
3058
|
-
if (
|
|
3059
|
-
if (
|
|
3058
|
+
if (A !== !0 && _ === Or) {
|
|
3059
|
+
if (h = M.isBrace = !0, d = M.isGlob = !0, E = !0, i === !0)
|
|
3060
3060
|
continue;
|
|
3061
3061
|
break;
|
|
3062
3062
|
}
|
|
3063
|
-
if (
|
|
3064
|
-
|
|
3063
|
+
if (_ === Mr && (j--, j === 0)) {
|
|
3064
|
+
A = !1, h = M.isBrace = !0, E = !0;
|
|
3065
3065
|
break;
|
|
3066
3066
|
}
|
|
3067
3067
|
}
|
|
@@ -3069,8 +3069,8 @@ const xs = Se, {
|
|
|
3069
3069
|
continue;
|
|
3070
3070
|
break;
|
|
3071
3071
|
}
|
|
3072
|
-
if (
|
|
3073
|
-
if (o.push(l), r.push(
|
|
3072
|
+
if (_ === gn) {
|
|
3073
|
+
if (o.push(l), r.push(M), M = { value: "", depth: 0, isGlob: !1 }, E === !0)
|
|
3074
3074
|
continue;
|
|
3075
3075
|
if (T === $e && l === c + 1) {
|
|
3076
3076
|
c += 2;
|
|
@@ -3079,15 +3079,15 @@ const xs = Se, {
|
|
|
3079
3079
|
f = l + 1;
|
|
3080
3080
|
continue;
|
|
3081
3081
|
}
|
|
3082
|
-
if (s.noext !== !0 && (
|
|
3083
|
-
if (
|
|
3084
|
-
for (;
|
|
3085
|
-
if (
|
|
3086
|
-
|
|
3082
|
+
if (s.noext !== !0 && (_ === Er || _ === Sr || _ === Ce || _ === Ds || _ === Pe) === !0 && L() === De) {
|
|
3083
|
+
if (d = M.isGlob = !0, b = M.isExtglob = !0, E = !0, _ === Pe && l === c && ($ = !0), i === !0) {
|
|
3084
|
+
for (; y() !== !0 && (_ = V()); ) {
|
|
3085
|
+
if (_ === Ft) {
|
|
3086
|
+
S = M.backslashes = !0, _ = V();
|
|
3087
3087
|
continue;
|
|
3088
3088
|
}
|
|
3089
|
-
if (
|
|
3090
|
-
|
|
3089
|
+
if (_ === js) {
|
|
3090
|
+
d = M.isGlob = !0, E = !0;
|
|
3091
3091
|
break;
|
|
3092
3092
|
}
|
|
3093
3093
|
}
|
|
@@ -3095,24 +3095,24 @@ const xs = Se, {
|
|
|
3095
3095
|
}
|
|
3096
3096
|
break;
|
|
3097
3097
|
}
|
|
3098
|
-
if (
|
|
3099
|
-
if (T === Ce && (
|
|
3098
|
+
if (_ === Ce) {
|
|
3099
|
+
if (T === Ce && (w = M.isGlobstar = !0), d = M.isGlob = !0, E = !0, i === !0)
|
|
3100
3100
|
continue;
|
|
3101
3101
|
break;
|
|
3102
3102
|
}
|
|
3103
|
-
if (
|
|
3104
|
-
if (
|
|
3103
|
+
if (_ === Ds) {
|
|
3104
|
+
if (d = M.isGlob = !0, E = !0, i === !0)
|
|
3105
3105
|
continue;
|
|
3106
3106
|
break;
|
|
3107
3107
|
}
|
|
3108
|
-
if (
|
|
3109
|
-
for (;
|
|
3108
|
+
if (_ === Rr) {
|
|
3109
|
+
for (; y() !== !0 && (U = V()); ) {
|
|
3110
3110
|
if (U === Ft) {
|
|
3111
|
-
|
|
3111
|
+
S = M.backslashes = !0, V();
|
|
3112
3112
|
continue;
|
|
3113
3113
|
}
|
|
3114
3114
|
if (U === Ar) {
|
|
3115
|
-
|
|
3115
|
+
p = M.isBracket = !0, d = M.isGlob = !0, E = !0;
|
|
3116
3116
|
break;
|
|
3117
3117
|
}
|
|
3118
3118
|
}
|
|
@@ -3120,19 +3120,19 @@ const xs = Se, {
|
|
|
3120
3120
|
continue;
|
|
3121
3121
|
break;
|
|
3122
3122
|
}
|
|
3123
|
-
if (s.nonegate !== !0 &&
|
|
3124
|
-
|
|
3123
|
+
if (s.nonegate !== !0 && _ === Pe && l === c) {
|
|
3124
|
+
O = M.negated = !0, c++;
|
|
3125
3125
|
continue;
|
|
3126
3126
|
}
|
|
3127
|
-
if (s.noparen !== !0 &&
|
|
3128
|
-
if (
|
|
3129
|
-
for (;
|
|
3130
|
-
if (
|
|
3131
|
-
|
|
3127
|
+
if (s.noparen !== !0 && _ === De) {
|
|
3128
|
+
if (d = M.isGlob = !0, i === !0) {
|
|
3129
|
+
for (; y() !== !0 && (_ = V()); ) {
|
|
3130
|
+
if (_ === De) {
|
|
3131
|
+
S = M.backslashes = !0, _ = V();
|
|
3132
3132
|
continue;
|
|
3133
3133
|
}
|
|
3134
|
-
if (
|
|
3135
|
-
|
|
3134
|
+
if (_ === js) {
|
|
3135
|
+
E = !0;
|
|
3136
3136
|
break;
|
|
3137
3137
|
}
|
|
3138
3138
|
}
|
|
@@ -3140,34 +3140,34 @@ const xs = Se, {
|
|
|
3140
3140
|
}
|
|
3141
3141
|
break;
|
|
3142
3142
|
}
|
|
3143
|
-
if (
|
|
3144
|
-
if (
|
|
3143
|
+
if (d === !0) {
|
|
3144
|
+
if (E = !0, i === !0)
|
|
3145
3145
|
continue;
|
|
3146
3146
|
break;
|
|
3147
3147
|
}
|
|
3148
3148
|
}
|
|
3149
|
-
s.noext === !0 && (b = !1,
|
|
3150
|
-
let H = u,
|
|
3151
|
-
c > 0 && (
|
|
3149
|
+
s.noext === !0 && (b = !1, d = !1);
|
|
3150
|
+
let H = u, m = "", g = "";
|
|
3151
|
+
c > 0 && (m = u.slice(0, c), u = u.slice(c), f -= c), H && d === !0 && f > 0 ? (H = u.slice(0, f), g = u.slice(f)) : d === !0 ? (H = "", g = u) : H = u, H && H !== "" && H !== "/" && H !== u && Ts(H.charCodeAt(H.length - 1)) && (H = H.slice(0, -1)), s.unescape === !0 && (g && (g = xs.removeBackslashes(g)), H && S === !0 && (H = xs.removeBackslashes(H)));
|
|
3152
3152
|
const it = {
|
|
3153
|
-
prefix:
|
|
3153
|
+
prefix: m,
|
|
3154
3154
|
input: t,
|
|
3155
3155
|
start: c,
|
|
3156
3156
|
base: H,
|
|
3157
|
-
glob:
|
|
3158
|
-
isBrace:
|
|
3159
|
-
isBracket:
|
|
3160
|
-
isGlob:
|
|
3157
|
+
glob: g,
|
|
3158
|
+
isBrace: h,
|
|
3159
|
+
isBracket: p,
|
|
3160
|
+
isGlob: d,
|
|
3161
3161
|
isExtglob: b,
|
|
3162
|
-
isGlobstar:
|
|
3163
|
-
negated:
|
|
3164
|
-
negatedExtglob:
|
|
3162
|
+
isGlobstar: w,
|
|
3163
|
+
negated: O,
|
|
3164
|
+
negatedExtglob: $
|
|
3165
3165
|
};
|
|
3166
|
-
if (s.tokens === !0 && (it.maxDepth = 0, Ts(
|
|
3166
|
+
if (s.tokens === !0 && (it.maxDepth = 0, Ts(_) || r.push(M), it.tokens = r), s.parts === !0 || s.tokens === !0) {
|
|
3167
3167
|
let U;
|
|
3168
3168
|
for (let F = 0; F < o.length; F++) {
|
|
3169
3169
|
const yt = U ? U + 1 : c, rt = o[F], _t = t.slice(yt, rt);
|
|
3170
|
-
s.tokens && (F === 0 && c !== 0 ? (r[F].isPrefix = !0, r[F].value =
|
|
3170
|
+
s.tokens && (F === 0 && c !== 0 ? (r[F].isPrefix = !0, r[F].value = m) : r[F].value = _t, Ls(r[F]), it.maxDepth += r[F].depth), (F !== 0 || _t !== "") && a.push(_t), U = rt;
|
|
3171
3171
|
}
|
|
3172
3172
|
if (U && U + 1 < t.length) {
|
|
3173
3173
|
const F = t.slice(U + 1);
|
|
@@ -3206,20 +3206,20 @@ const ge = Re, pt = Se, {
|
|
|
3206
3206
|
const o = { type: "bos", value: "", output: s.prepend || "" }, r = [o], a = s.capture ? "" : "?:", u = ge.globChars(s.windows), l = ge.extglobChars(u), {
|
|
3207
3207
|
DOT_LITERAL: c,
|
|
3208
3208
|
PLUS_LITERAL: f,
|
|
3209
|
-
SLASH_LITERAL:
|
|
3210
|
-
ONE_CHAR:
|
|
3211
|
-
DOTS_SLASH:
|
|
3209
|
+
SLASH_LITERAL: h,
|
|
3210
|
+
ONE_CHAR: p,
|
|
3211
|
+
DOTS_SLASH: d,
|
|
3212
3212
|
NO_DOT: b,
|
|
3213
|
-
NO_DOT_SLASH:
|
|
3214
|
-
NO_DOTS_SLASH:
|
|
3215
|
-
QMARK:
|
|
3216
|
-
QMARK_NO_DOT:
|
|
3217
|
-
STAR:
|
|
3218
|
-
START_ANCHOR:
|
|
3219
|
-
} = u,
|
|
3220
|
-
let
|
|
3221
|
-
s.capture && (
|
|
3222
|
-
const
|
|
3213
|
+
NO_DOT_SLASH: w,
|
|
3214
|
+
NO_DOTS_SLASH: A,
|
|
3215
|
+
QMARK: S,
|
|
3216
|
+
QMARK_NO_DOT: O,
|
|
3217
|
+
STAR: $,
|
|
3218
|
+
START_ANCHOR: E
|
|
3219
|
+
} = u, j = (R) => `(${a}(?:(?!${E}${R.dot ? d : c}).)*?)`, T = s.dot ? "" : b, _ = s.dot ? S : O;
|
|
3220
|
+
let M = s.bash === !0 ? j(s) : $;
|
|
3221
|
+
s.capture && (M = `(${M})`), typeof s.noext == "boolean" && (s.noextglob = s.noext);
|
|
3222
|
+
const y = {
|
|
3223
3223
|
input: t,
|
|
3224
3224
|
index: -1,
|
|
3225
3225
|
start: 0,
|
|
@@ -3236,347 +3236,347 @@ const ge = Re, pt = Se, {
|
|
|
3236
3236
|
globstar: !1,
|
|
3237
3237
|
tokens: r
|
|
3238
3238
|
};
|
|
3239
|
-
t = pt.removePrefix(t,
|
|
3239
|
+
t = pt.removePrefix(t, y), i = t.length;
|
|
3240
3240
|
const L = [], V = [], H = [];
|
|
3241
|
-
let
|
|
3242
|
-
const it = () =>
|
|
3243
|
-
|
|
3241
|
+
let m = o, g;
|
|
3242
|
+
const it = () => y.index === i - 1, U = y.peek = (R = 1) => t[y.index + R], F = y.advance = () => t[++y.index] || "", yt = () => t.slice(y.index + 1), rt = (R = "", N = 0) => {
|
|
3243
|
+
y.consumed += R, y.index += N;
|
|
3244
3244
|
}, _t = (R) => {
|
|
3245
|
-
|
|
3245
|
+
y.output += R.output != null ? R.output : R.value, rt(R.value);
|
|
3246
3246
|
}, vn = () => {
|
|
3247
3247
|
let R = 1;
|
|
3248
3248
|
for (; U() === "!" && (U(2) !== "(" || U(3) === "?"); )
|
|
3249
|
-
F(),
|
|
3250
|
-
return R % 2 === 0 ? !1 : (
|
|
3249
|
+
F(), y.start++, R++;
|
|
3250
|
+
return R % 2 === 0 ? !1 : (y.negated = !0, y.start++, !0);
|
|
3251
3251
|
}, Zt = (R) => {
|
|
3252
|
-
|
|
3252
|
+
y[R]++, H.push(R);
|
|
3253
3253
|
}, At = (R) => {
|
|
3254
|
-
|
|
3255
|
-
},
|
|
3256
|
-
if (
|
|
3257
|
-
const N =
|
|
3258
|
-
R.type !== "slash" && R.type !== "paren" && !N && !
|
|
3254
|
+
y[R]--, H.pop();
|
|
3255
|
+
}, x = (R) => {
|
|
3256
|
+
if (m.type === "globstar") {
|
|
3257
|
+
const N = y.braces > 0 && (R.type === "comma" || R.type === "brace"), v = R.extglob === !0 || L.length && (R.type === "pipe" || R.type === "paren");
|
|
3258
|
+
R.type !== "slash" && R.type !== "paren" && !N && !v && (y.output = y.output.slice(0, -m.output.length), m.type = "star", m.value = "*", m.output = M, y.output += m.output);
|
|
3259
3259
|
}
|
|
3260
|
-
if (L.length && R.type !== "paren" && (L[L.length - 1].inner += R.value), (R.value || R.output) && _t(R),
|
|
3261
|
-
|
|
3260
|
+
if (L.length && R.type !== "paren" && (L[L.length - 1].inner += R.value), (R.value || R.output) && _t(R), m && m.type === "text" && R.type === "text") {
|
|
3261
|
+
m.output = (m.output || m.value) + R.value, m.value += R.value;
|
|
3262
3262
|
return;
|
|
3263
3263
|
}
|
|
3264
|
-
R.prev =
|
|
3264
|
+
R.prev = m, r.push(R), m = R;
|
|
3265
3265
|
}, te = (R, N) => {
|
|
3266
|
-
const
|
|
3267
|
-
|
|
3268
|
-
const
|
|
3269
|
-
Zt("parens"),
|
|
3266
|
+
const v = { ...l[N], conditions: 1, inner: "" };
|
|
3267
|
+
v.prev = m, v.parens = y.parens, v.output = y.output;
|
|
3268
|
+
const P = (s.capture ? "(" : "") + v.open;
|
|
3269
|
+
Zt("parens"), x({ type: R, value: N, output: y.output ? "" : p }), x({ type: "paren", extglob: !0, value: F(), output: P }), L.push(v);
|
|
3270
3270
|
}, Sn = (R) => {
|
|
3271
|
-
let N = R.close + (s.capture ? ")" : ""),
|
|
3271
|
+
let N = R.close + (s.capture ? ")" : ""), v;
|
|
3272
3272
|
if (R.type === "negate") {
|
|
3273
|
-
let
|
|
3274
|
-
if (R.inner && R.inner.length > 1 && R.inner.includes("/") && (
|
|
3275
|
-
const B = ds(
|
|
3276
|
-
N = R.close = `)${B})${
|
|
3273
|
+
let P = M;
|
|
3274
|
+
if (R.inner && R.inner.length > 1 && R.inner.includes("/") && (P = j(s)), (P !== M || it() || /^\)+$/.test(yt())) && (N = R.close = `)$))${P}`), R.inner.includes("*") && (v = yt()) && /^\.[^\\/.]+$/.test(v)) {
|
|
3275
|
+
const B = ds(v, { ...e, fastpaths: !1 }).output;
|
|
3276
|
+
N = R.close = `)${B})${P})`;
|
|
3277
3277
|
}
|
|
3278
|
-
R.prev.type === "bos" && (
|
|
3278
|
+
R.prev.type === "bos" && (y.negatedExtglob = !0);
|
|
3279
3279
|
}
|
|
3280
|
-
|
|
3280
|
+
x({ type: "paren", extglob: !0, value: g, output: N }), At("parens");
|
|
3281
3281
|
};
|
|
3282
3282
|
if (s.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(t)) {
|
|
3283
|
-
let R = !1, N = t.replace(xr, (
|
|
3284
|
-
return R === !0 && (s.unescape === !0 ? N = N.replace(/\\/g, "") : N = N.replace(/\\+/g, (
|
|
3283
|
+
let R = !1, N = t.replace(xr, (v, P, B, X, Q, Ee) => X === "\\" ? (R = !0, v) : X === "?" ? P ? P + X + (Q ? S.repeat(Q.length) : "") : Ee === 0 ? _ + (Q ? S.repeat(Q.length) : "") : S.repeat(B.length) : X === "." ? c.repeat(B.length) : X === "*" ? P ? P + X + (Q ? M : "") : M : P ? v : `\\${v}`);
|
|
3284
|
+
return R === !0 && (s.unescape === !0 ? N = N.replace(/\\/g, "") : N = N.replace(/\\+/g, (v) => v.length % 2 === 0 ? "\\\\" : v ? "\\" : "")), N === t && s.contains === !0 ? (y.output = t, y) : (y.output = pt.wrapOutput(N, y, e), y);
|
|
3285
3285
|
}
|
|
3286
3286
|
for (; !it(); ) {
|
|
3287
|
-
if (
|
|
3287
|
+
if (g = F(), g === "\0")
|
|
3288
3288
|
continue;
|
|
3289
|
-
if (
|
|
3290
|
-
const
|
|
3291
|
-
if (
|
|
3289
|
+
if (g === "\\") {
|
|
3290
|
+
const v = U();
|
|
3291
|
+
if (v === "/" && s.bash !== !0 || v === "." || v === ";")
|
|
3292
3292
|
continue;
|
|
3293
|
-
if (!
|
|
3294
|
-
|
|
3293
|
+
if (!v) {
|
|
3294
|
+
g += "\\", x({ type: "text", value: g });
|
|
3295
3295
|
continue;
|
|
3296
3296
|
}
|
|
3297
|
-
const
|
|
3297
|
+
const P = /^\\+/.exec(yt());
|
|
3298
3298
|
let B = 0;
|
|
3299
|
-
if (
|
|
3300
|
-
|
|
3299
|
+
if (P && P[0].length > 2 && (B = P[0].length, y.index += B, B % 2 !== 0 && (g += "\\")), s.unescape === !0 ? g = F() : g += F(), y.brackets === 0) {
|
|
3300
|
+
x({ type: "text", value: g });
|
|
3301
3301
|
continue;
|
|
3302
3302
|
}
|
|
3303
3303
|
}
|
|
3304
|
-
if (
|
|
3305
|
-
if (s.posix !== !1 &&
|
|
3306
|
-
const
|
|
3307
|
-
if (
|
|
3308
|
-
const
|
|
3304
|
+
if (y.brackets > 0 && (g !== "]" || m.value === "[" || m.value === "[^")) {
|
|
3305
|
+
if (s.posix !== !1 && g === ":") {
|
|
3306
|
+
const v = m.value.slice(1);
|
|
3307
|
+
if (v.includes("[") && (m.posix = !0, v.includes(":"))) {
|
|
3308
|
+
const P = m.value.lastIndexOf("["), B = m.value.slice(0, P), X = m.value.slice(P + 2), Q = $r[X];
|
|
3309
3309
|
if (Q) {
|
|
3310
|
-
|
|
3310
|
+
m.value = B + Q, y.backtrack = !0, F(), !o.output && r.indexOf(m) === 1 && (o.output = p);
|
|
3311
3311
|
continue;
|
|
3312
3312
|
}
|
|
3313
3313
|
}
|
|
3314
3314
|
}
|
|
3315
|
-
(
|
|
3315
|
+
(g === "[" && U() !== ":" || g === "-" && U() === "]") && (g = `\\${g}`), g === "]" && (m.value === "[" || m.value === "[^") && (g = `\\${g}`), s.posix === !0 && g === "!" && m.value === "[" && (g = "^"), m.value += g, _t({ value: g });
|
|
3316
3316
|
continue;
|
|
3317
3317
|
}
|
|
3318
|
-
if (
|
|
3319
|
-
|
|
3318
|
+
if (y.quotes === 1 && g !== '"') {
|
|
3319
|
+
g = pt.escapeRegex(g), m.value += g, _t({ value: g });
|
|
3320
3320
|
continue;
|
|
3321
3321
|
}
|
|
3322
|
-
if (
|
|
3323
|
-
|
|
3322
|
+
if (g === '"') {
|
|
3323
|
+
y.quotes = y.quotes === 1 ? 0 : 1, s.keepQuotes === !0 && x({ type: "text", value: g });
|
|
3324
3324
|
continue;
|
|
3325
3325
|
}
|
|
3326
|
-
if (
|
|
3327
|
-
Zt("parens"),
|
|
3326
|
+
if (g === "(") {
|
|
3327
|
+
Zt("parens"), x({ type: "paren", value: g });
|
|
3328
3328
|
continue;
|
|
3329
3329
|
}
|
|
3330
|
-
if (
|
|
3331
|
-
if (
|
|
3330
|
+
if (g === ")") {
|
|
3331
|
+
if (y.parens === 0 && s.strictBrackets === !0)
|
|
3332
3332
|
throw new SyntaxError(jt("opening", "("));
|
|
3333
|
-
const
|
|
3334
|
-
if (
|
|
3333
|
+
const v = L[L.length - 1];
|
|
3334
|
+
if (v && y.parens === v.parens + 1) {
|
|
3335
3335
|
Sn(L.pop());
|
|
3336
3336
|
continue;
|
|
3337
3337
|
}
|
|
3338
|
-
|
|
3338
|
+
x({ type: "paren", value: g, output: y.parens ? ")" : "\\)" }), At("parens");
|
|
3339
3339
|
continue;
|
|
3340
3340
|
}
|
|
3341
|
-
if (
|
|
3341
|
+
if (g === "[") {
|
|
3342
3342
|
if (s.nobracket === !0 || !yt().includes("]")) {
|
|
3343
3343
|
if (s.nobracket !== !0 && s.strictBrackets === !0)
|
|
3344
3344
|
throw new SyntaxError(jt("closing", "]"));
|
|
3345
|
-
|
|
3345
|
+
g = `\\${g}`;
|
|
3346
3346
|
} else
|
|
3347
3347
|
Zt("brackets");
|
|
3348
|
-
|
|
3348
|
+
x({ type: "bracket", value: g });
|
|
3349
3349
|
continue;
|
|
3350
3350
|
}
|
|
3351
|
-
if (
|
|
3352
|
-
if (s.nobracket === !0 ||
|
|
3353
|
-
|
|
3351
|
+
if (g === "]") {
|
|
3352
|
+
if (s.nobracket === !0 || m && m.type === "bracket" && m.value.length === 1) {
|
|
3353
|
+
x({ type: "text", value: g, output: `\\${g}` });
|
|
3354
3354
|
continue;
|
|
3355
3355
|
}
|
|
3356
|
-
if (
|
|
3356
|
+
if (y.brackets === 0) {
|
|
3357
3357
|
if (s.strictBrackets === !0)
|
|
3358
3358
|
throw new SyntaxError(jt("opening", "["));
|
|
3359
|
-
|
|
3359
|
+
x({ type: "text", value: g, output: `\\${g}` });
|
|
3360
3360
|
continue;
|
|
3361
3361
|
}
|
|
3362
3362
|
At("brackets");
|
|
3363
|
-
const
|
|
3364
|
-
if (
|
|
3363
|
+
const v = m.value.slice(1);
|
|
3364
|
+
if (m.posix !== !0 && v[0] === "^" && !v.includes("/") && (g = `/${g}`), m.value += g, _t({ value: g }), s.literalBrackets === !1 || pt.hasRegexChars(v))
|
|
3365
3365
|
continue;
|
|
3366
|
-
const
|
|
3367
|
-
if (
|
|
3368
|
-
|
|
3366
|
+
const P = pt.escapeRegex(m.value);
|
|
3367
|
+
if (y.output = y.output.slice(0, -m.value.length), s.literalBrackets === !0) {
|
|
3368
|
+
y.output += P, m.value = P;
|
|
3369
3369
|
continue;
|
|
3370
3370
|
}
|
|
3371
|
-
|
|
3371
|
+
m.value = `(${a}${P}|${m.value})`, y.output += m.value;
|
|
3372
3372
|
continue;
|
|
3373
3373
|
}
|
|
3374
|
-
if (
|
|
3374
|
+
if (g === "{" && s.nobrace !== !0) {
|
|
3375
3375
|
Zt("braces");
|
|
3376
|
-
const
|
|
3376
|
+
const v = {
|
|
3377
3377
|
type: "brace",
|
|
3378
|
-
value:
|
|
3378
|
+
value: g,
|
|
3379
3379
|
output: "(",
|
|
3380
|
-
outputIndex:
|
|
3381
|
-
tokensIndex:
|
|
3380
|
+
outputIndex: y.output.length,
|
|
3381
|
+
tokensIndex: y.tokens.length
|
|
3382
3382
|
};
|
|
3383
|
-
V.push(
|
|
3383
|
+
V.push(v), x(v);
|
|
3384
3384
|
continue;
|
|
3385
3385
|
}
|
|
3386
|
-
if (
|
|
3387
|
-
const
|
|
3388
|
-
if (s.nobrace === !0 || !
|
|
3389
|
-
|
|
3386
|
+
if (g === "}") {
|
|
3387
|
+
const v = V[V.length - 1];
|
|
3388
|
+
if (s.nobrace === !0 || !v) {
|
|
3389
|
+
x({ type: "text", value: g, output: g });
|
|
3390
3390
|
continue;
|
|
3391
3391
|
}
|
|
3392
|
-
let
|
|
3393
|
-
if (
|
|
3392
|
+
let P = ")";
|
|
3393
|
+
if (v.dots === !0) {
|
|
3394
3394
|
const B = r.slice(), X = [];
|
|
3395
3395
|
for (let Q = B.length - 1; Q >= 0 && (r.pop(), B[Q].type !== "brace"); Q--)
|
|
3396
3396
|
B[Q].type !== "dots" && X.unshift(B[Q].value);
|
|
3397
|
-
|
|
3397
|
+
P = Dr(X, s), y.backtrack = !0;
|
|
3398
3398
|
}
|
|
3399
|
-
if (
|
|
3400
|
-
const B =
|
|
3401
|
-
|
|
3399
|
+
if (v.comma !== !0 && v.dots !== !0) {
|
|
3400
|
+
const B = y.output.slice(0, v.outputIndex), X = y.tokens.slice(v.tokensIndex);
|
|
3401
|
+
v.value = v.output = "\\{", g = P = "\\}", y.output = B;
|
|
3402
3402
|
for (const Q of X)
|
|
3403
|
-
|
|
3403
|
+
y.output += Q.output || Q.value;
|
|
3404
3404
|
}
|
|
3405
|
-
|
|
3405
|
+
x({ type: "brace", value: g, output: P }), At("braces"), V.pop();
|
|
3406
3406
|
continue;
|
|
3407
3407
|
}
|
|
3408
|
-
if (
|
|
3409
|
-
L.length > 0 && L[L.length - 1].conditions++,
|
|
3408
|
+
if (g === "|") {
|
|
3409
|
+
L.length > 0 && L[L.length - 1].conditions++, x({ type: "text", value: g });
|
|
3410
3410
|
continue;
|
|
3411
3411
|
}
|
|
3412
|
-
if (
|
|
3413
|
-
let
|
|
3414
|
-
const
|
|
3415
|
-
|
|
3412
|
+
if (g === ",") {
|
|
3413
|
+
let v = g;
|
|
3414
|
+
const P = V[V.length - 1];
|
|
3415
|
+
P && H[H.length - 1] === "braces" && (P.comma = !0, v = "|"), x({ type: "comma", value: g, output: v });
|
|
3416
3416
|
continue;
|
|
3417
3417
|
}
|
|
3418
|
-
if (
|
|
3419
|
-
if (
|
|
3420
|
-
|
|
3418
|
+
if (g === "/") {
|
|
3419
|
+
if (m.type === "dot" && y.index === y.start + 1) {
|
|
3420
|
+
y.start = y.index + 1, y.consumed = "", y.output = "", r.pop(), m = o;
|
|
3421
3421
|
continue;
|
|
3422
3422
|
}
|
|
3423
|
-
|
|
3423
|
+
x({ type: "slash", value: g, output: h });
|
|
3424
3424
|
continue;
|
|
3425
3425
|
}
|
|
3426
|
-
if (
|
|
3427
|
-
if (
|
|
3428
|
-
|
|
3429
|
-
const
|
|
3430
|
-
|
|
3426
|
+
if (g === ".") {
|
|
3427
|
+
if (y.braces > 0 && m.type === "dot") {
|
|
3428
|
+
m.value === "." && (m.output = c);
|
|
3429
|
+
const v = V[V.length - 1];
|
|
3430
|
+
m.type = "dots", m.output += g, m.value += g, v.dots = !0;
|
|
3431
3431
|
continue;
|
|
3432
3432
|
}
|
|
3433
|
-
if (
|
|
3434
|
-
|
|
3433
|
+
if (y.braces + y.parens === 0 && m.type !== "bos" && m.type !== "slash") {
|
|
3434
|
+
x({ type: "text", value: g, output: c });
|
|
3435
3435
|
continue;
|
|
3436
3436
|
}
|
|
3437
|
-
|
|
3437
|
+
x({ type: "dot", value: g, output: c });
|
|
3438
3438
|
continue;
|
|
3439
3439
|
}
|
|
3440
|
-
if (
|
|
3441
|
-
if (!(
|
|
3442
|
-
te("qmark",
|
|
3440
|
+
if (g === "?") {
|
|
3441
|
+
if (!(m && m.value === "(") && s.noextglob !== !0 && U() === "(" && U(2) !== "?") {
|
|
3442
|
+
te("qmark", g);
|
|
3443
3443
|
continue;
|
|
3444
3444
|
}
|
|
3445
|
-
if (
|
|
3446
|
-
const
|
|
3447
|
-
let B =
|
|
3448
|
-
(
|
|
3445
|
+
if (m && m.type === "paren") {
|
|
3446
|
+
const P = U();
|
|
3447
|
+
let B = g;
|
|
3448
|
+
(m.value === "(" && !/[!=<:]/.test(P) || P === "<" && !/<([!=]|\w+>)/.test(yt())) && (B = `\\${g}`), x({ type: "text", value: g, output: B });
|
|
3449
3449
|
continue;
|
|
3450
3450
|
}
|
|
3451
|
-
if (s.dot !== !0 && (
|
|
3452
|
-
|
|
3451
|
+
if (s.dot !== !0 && (m.type === "slash" || m.type === "bos")) {
|
|
3452
|
+
x({ type: "qmark", value: g, output: O });
|
|
3453
3453
|
continue;
|
|
3454
3454
|
}
|
|
3455
|
-
|
|
3455
|
+
x({ type: "qmark", value: g, output: S });
|
|
3456
3456
|
continue;
|
|
3457
3457
|
}
|
|
3458
|
-
if (
|
|
3458
|
+
if (g === "!") {
|
|
3459
3459
|
if (s.noextglob !== !0 && U() === "(" && (U(2) !== "?" || !/[!=<:]/.test(U(3)))) {
|
|
3460
|
-
te("negate",
|
|
3460
|
+
te("negate", g);
|
|
3461
3461
|
continue;
|
|
3462
3462
|
}
|
|
3463
|
-
if (s.nonegate !== !0 &&
|
|
3463
|
+
if (s.nonegate !== !0 && y.index === 0) {
|
|
3464
3464
|
vn();
|
|
3465
3465
|
continue;
|
|
3466
3466
|
}
|
|
3467
3467
|
}
|
|
3468
|
-
if (
|
|
3468
|
+
if (g === "+") {
|
|
3469
3469
|
if (s.noextglob !== !0 && U() === "(" && U(2) !== "?") {
|
|
3470
|
-
te("plus",
|
|
3470
|
+
te("plus", g);
|
|
3471
3471
|
continue;
|
|
3472
3472
|
}
|
|
3473
|
-
if (
|
|
3474
|
-
|
|
3473
|
+
if (m && m.value === "(" || s.regex === !1) {
|
|
3474
|
+
x({ type: "plus", value: g, output: f });
|
|
3475
3475
|
continue;
|
|
3476
3476
|
}
|
|
3477
|
-
if (
|
|
3478
|
-
|
|
3477
|
+
if (m && (m.type === "bracket" || m.type === "paren" || m.type === "brace") || y.parens > 0) {
|
|
3478
|
+
x({ type: "plus", value: g });
|
|
3479
3479
|
continue;
|
|
3480
3480
|
}
|
|
3481
|
-
|
|
3481
|
+
x({ type: "plus", value: f });
|
|
3482
3482
|
continue;
|
|
3483
3483
|
}
|
|
3484
|
-
if (
|
|
3484
|
+
if (g === "@") {
|
|
3485
3485
|
if (s.noextglob !== !0 && U() === "(" && U(2) !== "?") {
|
|
3486
|
-
|
|
3486
|
+
x({ type: "at", extglob: !0, value: g, output: "" });
|
|
3487
3487
|
continue;
|
|
3488
3488
|
}
|
|
3489
|
-
|
|
3489
|
+
x({ type: "text", value: g });
|
|
3490
3490
|
continue;
|
|
3491
3491
|
}
|
|
3492
|
-
if (
|
|
3493
|
-
(
|
|
3494
|
-
const
|
|
3495
|
-
|
|
3492
|
+
if (g !== "*") {
|
|
3493
|
+
(g === "$" || g === "^") && (g = `\\${g}`);
|
|
3494
|
+
const v = Pr.exec(yt());
|
|
3495
|
+
v && (g += v[0], y.index += v[0].length), x({ type: "text", value: g });
|
|
3496
3496
|
continue;
|
|
3497
3497
|
}
|
|
3498
|
-
if (
|
|
3499
|
-
|
|
3498
|
+
if (m && (m.type === "globstar" || m.star === !0)) {
|
|
3499
|
+
m.type = "star", m.star = !0, m.value += g, m.output = M, y.backtrack = !0, y.globstar = !0, rt(g);
|
|
3500
3500
|
continue;
|
|
3501
3501
|
}
|
|
3502
3502
|
let R = yt();
|
|
3503
3503
|
if (s.noextglob !== !0 && /^\([^?]/.test(R)) {
|
|
3504
|
-
te("star",
|
|
3504
|
+
te("star", g);
|
|
3505
3505
|
continue;
|
|
3506
3506
|
}
|
|
3507
|
-
if (
|
|
3507
|
+
if (m.type === "star") {
|
|
3508
3508
|
if (s.noglobstar === !0) {
|
|
3509
|
-
rt(
|
|
3509
|
+
rt(g);
|
|
3510
3510
|
continue;
|
|
3511
3511
|
}
|
|
3512
|
-
const
|
|
3512
|
+
const v = m.prev, P = v.prev, B = v.type === "slash" || v.type === "bos", X = P && (P.type === "star" || P.type === "globstar");
|
|
3513
3513
|
if (s.bash === !0 && (!B || R[0] && R[0] !== "/")) {
|
|
3514
|
-
|
|
3514
|
+
x({ type: "star", value: g, output: "" });
|
|
3515
3515
|
continue;
|
|
3516
3516
|
}
|
|
3517
|
-
const Q =
|
|
3518
|
-
if (!B &&
|
|
3519
|
-
|
|
3517
|
+
const Q = y.braces > 0 && (v.type === "comma" || v.type === "brace"), Ee = L.length && (v.type === "pipe" || v.type === "paren");
|
|
3518
|
+
if (!B && v.type !== "paren" && !Q && !Ee) {
|
|
3519
|
+
x({ type: "star", value: g, output: "" });
|
|
3520
3520
|
continue;
|
|
3521
3521
|
}
|
|
3522
3522
|
for (; R.slice(0, 3) === "/**"; ) {
|
|
3523
|
-
const ee = t[
|
|
3523
|
+
const ee = t[y.index + 4];
|
|
3524
3524
|
if (ee && ee !== "/")
|
|
3525
3525
|
break;
|
|
3526
3526
|
R = R.slice(3), rt("/**", 3);
|
|
3527
3527
|
}
|
|
3528
|
-
if (
|
|
3529
|
-
|
|
3528
|
+
if (v.type === "bos" && it()) {
|
|
3529
|
+
m.type = "globstar", m.value += g, m.output = j(s), y.output = m.output, y.globstar = !0, rt(g);
|
|
3530
3530
|
continue;
|
|
3531
3531
|
}
|
|
3532
|
-
if (
|
|
3533
|
-
|
|
3532
|
+
if (v.type === "slash" && v.prev.type !== "bos" && !X && it()) {
|
|
3533
|
+
y.output = y.output.slice(0, -(v.output + m.output).length), v.output = `(?:${v.output}`, m.type = "globstar", m.output = j(s) + (s.strictSlashes ? ")" : "|$)"), m.value += g, y.globstar = !0, y.output += v.output + m.output, rt(g);
|
|
3534
3534
|
continue;
|
|
3535
3535
|
}
|
|
3536
|
-
if (
|
|
3536
|
+
if (v.type === "slash" && v.prev.type !== "bos" && R[0] === "/") {
|
|
3537
3537
|
const ee = R[1] !== void 0 ? "|$" : "";
|
|
3538
|
-
|
|
3538
|
+
y.output = y.output.slice(0, -(v.output + m.output).length), v.output = `(?:${v.output}`, m.type = "globstar", m.output = `${j(s)}${h}|${h}${ee})`, m.value += g, y.output += v.output + m.output, y.globstar = !0, rt(g + F()), x({ type: "slash", value: "/", output: "" });
|
|
3539
3539
|
continue;
|
|
3540
3540
|
}
|
|
3541
|
-
if (
|
|
3542
|
-
|
|
3541
|
+
if (v.type === "bos" && R[0] === "/") {
|
|
3542
|
+
m.type = "globstar", m.value += g, m.output = `(?:^|${h}|${j(s)}${h})`, y.output = m.output, y.globstar = !0, rt(g + F()), x({ type: "slash", value: "/", output: "" });
|
|
3543
3543
|
continue;
|
|
3544
3544
|
}
|
|
3545
|
-
|
|
3545
|
+
y.output = y.output.slice(0, -m.output.length), m.type = "globstar", m.output = j(s), m.value += g, y.output += m.output, y.globstar = !0, rt(g);
|
|
3546
3546
|
continue;
|
|
3547
3547
|
}
|
|
3548
|
-
const N = { type: "star", value:
|
|
3548
|
+
const N = { type: "star", value: g, output: M };
|
|
3549
3549
|
if (s.bash === !0) {
|
|
3550
|
-
N.output = ".*?", (
|
|
3550
|
+
N.output = ".*?", (m.type === "bos" || m.type === "slash") && (N.output = T + N.output), x(N);
|
|
3551
3551
|
continue;
|
|
3552
3552
|
}
|
|
3553
|
-
if (
|
|
3554
|
-
N.output =
|
|
3553
|
+
if (m && (m.type === "bracket" || m.type === "paren") && s.regex === !0) {
|
|
3554
|
+
N.output = g, x(N);
|
|
3555
3555
|
continue;
|
|
3556
3556
|
}
|
|
3557
|
-
(
|
|
3557
|
+
(y.index === y.start || m.type === "slash" || m.type === "dot") && (m.type === "dot" ? (y.output += w, m.output += w) : s.dot === !0 ? (y.output += A, m.output += A) : (y.output += T, m.output += T), U() !== "*" && (y.output += p, m.output += p)), x(N);
|
|
3558
3558
|
}
|
|
3559
|
-
for (;
|
|
3559
|
+
for (; y.brackets > 0; ) {
|
|
3560
3560
|
if (s.strictBrackets === !0)
|
|
3561
3561
|
throw new SyntaxError(jt("closing", "]"));
|
|
3562
|
-
|
|
3562
|
+
y.output = pt.escapeLast(y.output, "["), At("brackets");
|
|
3563
3563
|
}
|
|
3564
|
-
for (;
|
|
3564
|
+
for (; y.parens > 0; ) {
|
|
3565
3565
|
if (s.strictBrackets === !0)
|
|
3566
3566
|
throw new SyntaxError(jt("closing", ")"));
|
|
3567
|
-
|
|
3567
|
+
y.output = pt.escapeLast(y.output, "("), At("parens");
|
|
3568
3568
|
}
|
|
3569
|
-
for (;
|
|
3569
|
+
for (; y.braces > 0; ) {
|
|
3570
3570
|
if (s.strictBrackets === !0)
|
|
3571
3571
|
throw new SyntaxError(jt("closing", "}"));
|
|
3572
|
-
|
|
3572
|
+
y.output = pt.escapeLast(y.output, "{"), At("braces");
|
|
3573
3573
|
}
|
|
3574
|
-
if (s.strictSlashes !== !0 && (
|
|
3575
|
-
|
|
3576
|
-
for (const R of
|
|
3577
|
-
|
|
3574
|
+
if (s.strictSlashes !== !0 && (m.type === "star" || m.type === "bracket") && x({ type: "maybe_slash", value: "", output: `${h}?` }), y.backtrack === !0) {
|
|
3575
|
+
y.output = "";
|
|
3576
|
+
for (const R of y.tokens)
|
|
3577
|
+
y.output += R.output != null ? R.output : R.value, R.suffix && (y.output += R.suffix);
|
|
3578
3578
|
}
|
|
3579
|
-
return
|
|
3579
|
+
return y;
|
|
3580
3580
|
};
|
|
3581
3581
|
ds.fastpaths = (t, e) => {
|
|
3582
3582
|
const s = { ...e }, n = typeof s.maxLength == "number" ? Math.min(be, s.maxLength) : be, i = t.length;
|
|
@@ -3591,50 +3591,50 @@ ds.fastpaths = (t, e) => {
|
|
|
3591
3591
|
NO_DOT: l,
|
|
3592
3592
|
NO_DOTS: c,
|
|
3593
3593
|
NO_DOTS_SLASH: f,
|
|
3594
|
-
STAR:
|
|
3595
|
-
START_ANCHOR:
|
|
3596
|
-
} = ge.globChars(s.windows),
|
|
3597
|
-
let
|
|
3598
|
-
s.capture && (
|
|
3599
|
-
const
|
|
3594
|
+
STAR: h,
|
|
3595
|
+
START_ANCHOR: p
|
|
3596
|
+
} = ge.globChars(s.windows), d = s.dot ? c : l, b = s.dot ? f : l, w = s.capture ? "" : "?:", A = { negated: !1, prefix: "" };
|
|
3597
|
+
let S = s.bash === !0 ? ".*?" : h;
|
|
3598
|
+
s.capture && (S = `(${S})`);
|
|
3599
|
+
const O = (T) => T.noglobstar === !0 ? S : `(${w}(?:(?!${p}${T.dot ? u : o}).)*?)`, $ = (T) => {
|
|
3600
3600
|
switch (T) {
|
|
3601
3601
|
case "*":
|
|
3602
|
-
return `${
|
|
3602
|
+
return `${d}${a}${S}`;
|
|
3603
3603
|
case ".*":
|
|
3604
|
-
return `${o}${a}${
|
|
3604
|
+
return `${o}${a}${S}`;
|
|
3605
3605
|
case "*.*":
|
|
3606
|
-
return `${
|
|
3606
|
+
return `${d}${S}${o}${a}${S}`;
|
|
3607
3607
|
case "*/*":
|
|
3608
|
-
return `${
|
|
3608
|
+
return `${d}${S}${r}${a}${b}${S}`;
|
|
3609
3609
|
case "**":
|
|
3610
|
-
return
|
|
3610
|
+
return d + O(s);
|
|
3611
3611
|
case "**/*":
|
|
3612
|
-
return `(?:${
|
|
3612
|
+
return `(?:${d}${O(s)}${r})?${b}${a}${S}`;
|
|
3613
3613
|
case "**/*.*":
|
|
3614
|
-
return `(?:${
|
|
3614
|
+
return `(?:${d}${O(s)}${r})?${b}${S}${o}${a}${S}`;
|
|
3615
3615
|
case "**/.*":
|
|
3616
|
-
return `(?:${
|
|
3616
|
+
return `(?:${d}${O(s)}${r})?${o}${a}${S}`;
|
|
3617
3617
|
default: {
|
|
3618
|
-
const
|
|
3619
|
-
if (!
|
|
3618
|
+
const _ = /^(.*?)\.(\w+)$/.exec(T);
|
|
3619
|
+
if (!_)
|
|
3620
3620
|
return;
|
|
3621
|
-
const
|
|
3622
|
-
return
|
|
3621
|
+
const M = $(_[1]);
|
|
3622
|
+
return M ? M + o + _[2] : void 0;
|
|
3623
3623
|
}
|
|
3624
3624
|
}
|
|
3625
|
-
},
|
|
3626
|
-
let
|
|
3627
|
-
return
|
|
3625
|
+
}, E = pt.removePrefix(t, A);
|
|
3626
|
+
let j = $(E);
|
|
3627
|
+
return j && s.strictSlashes !== !0 && (j += `${r}?`), j;
|
|
3628
3628
|
};
|
|
3629
3629
|
var jr = ds;
|
|
3630
3630
|
const Tr = Cr, We = jr, _n = Se, Lr = Re, kr = (t) => t && typeof t == "object" && !Array.isArray(t), G = (t, e, s = !1) => {
|
|
3631
3631
|
if (Array.isArray(t)) {
|
|
3632
|
-
const c = t.map((
|
|
3633
|
-
return (
|
|
3634
|
-
for (const
|
|
3635
|
-
const
|
|
3636
|
-
if (
|
|
3637
|
-
return
|
|
3632
|
+
const c = t.map((h) => G(h, e, s));
|
|
3633
|
+
return (h) => {
|
|
3634
|
+
for (const p of c) {
|
|
3635
|
+
const d = p(h);
|
|
3636
|
+
if (d)
|
|
3637
|
+
return d;
|
|
3638
3638
|
}
|
|
3639
3639
|
return !1;
|
|
3640
3640
|
};
|
|
@@ -3650,8 +3650,8 @@ const Tr = Cr, We = jr, _n = Se, Lr = Re, kr = (t) => t && typeof t == "object"
|
|
|
3650
3650
|
u = G(i.ignore, c, s);
|
|
3651
3651
|
}
|
|
3652
3652
|
const l = (c, f = !1) => {
|
|
3653
|
-
const { isMatch:
|
|
3654
|
-
return typeof i.onResult == "function" && i.onResult(b),
|
|
3653
|
+
const { isMatch: h, match: p, output: d } = G.test(c, r, e, { glob: t, posix: o }), b = { glob: t, state: a, regex: r, posix: o, input: c, output: d, match: p, isMatch: h };
|
|
3654
|
+
return typeof i.onResult == "function" && i.onResult(b), h === !1 ? (b.isMatch = !1, f ? b : !1) : u(c) ? (typeof i.onIgnore == "function" && i.onIgnore(b), b.isMatch = !1, f ? b : !1) : (typeof i.onMatch == "function" && i.onMatch(b), f ? b : !0);
|
|
3655
3655
|
};
|
|
3656
3656
|
return s && (l.state = a), l;
|
|
3657
3657
|
};
|
|
@@ -3750,16 +3750,16 @@ class zr extends as.EventEmitter {
|
|
|
3750
3750
|
const u = this;
|
|
3751
3751
|
this.iframe = new Promise((l) => {
|
|
3752
3752
|
qt().then(async () => {
|
|
3753
|
-
var c, f,
|
|
3753
|
+
var c, f, h, p;
|
|
3754
3754
|
if (u._iframe) {
|
|
3755
|
-
if ((
|
|
3755
|
+
if ((p = (h = (f = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : f.metaframes) == null ? void 0 : h[this.id]) != null && p.allow)
|
|
3756
3756
|
u._iframe.allow = this._metapage._definition.metaframes[this.id].allow, this._debug && this.log(`mf allow=${u._iframe.allow} from this._metapage?._definition`);
|
|
3757
3757
|
else {
|
|
3758
|
-
let
|
|
3759
|
-
if (
|
|
3758
|
+
let d = cs(this.url, "definition");
|
|
3759
|
+
if (d = d && (d != null && d.version) ? await He(d) : void 0, !u._iframe)
|
|
3760
3760
|
return;
|
|
3761
|
-
if (
|
|
3762
|
-
u._iframe.allow =
|
|
3761
|
+
if (d != null && d.allow)
|
|
3762
|
+
u._iframe.allow = d.allow;
|
|
3763
3763
|
else {
|
|
3764
3764
|
let b = await u.getDefinition();
|
|
3765
3765
|
if (this._debug && this.log(`mf metaframeDef=${JSON.stringify(b)}`), b = b && (b != null && b.version) ? await He(b) : void 0, this._debug && this.log(`mf metaframeDef=${JSON.stringify(b)}`), !u._iframe)
|
|
@@ -4045,95 +4045,106 @@ class tt extends or {
|
|
|
4045
4045
|
let o = i.url;
|
|
4046
4046
|
const r = this._injectedSecrets[n] || {}, a = this._originalSecretHashParams[n] || {};
|
|
4047
4047
|
Object.keys(r).forEach((f) => {
|
|
4048
|
-
const
|
|
4049
|
-
if (
|
|
4050
|
-
const
|
|
4051
|
-
let
|
|
4052
|
-
|
|
4053
|
-
const b = new URLSearchParams(
|
|
4048
|
+
const h = a[f];
|
|
4049
|
+
if (h === void 0) {
|
|
4050
|
+
const p = new URL(o);
|
|
4051
|
+
let d = p.hash.startsWith("#?") ? p.hash.slice(2) : p.hash.slice(1);
|
|
4052
|
+
d = d.replace(/\?/g, "&");
|
|
4053
|
+
const b = new URLSearchParams(d);
|
|
4054
4054
|
b.delete(f);
|
|
4055
|
-
const
|
|
4056
|
-
|
|
4055
|
+
const w = b.toString();
|
|
4056
|
+
p.hash = w ? p.hash.startsWith("#?") ? `?${w}` : w : "", o = p.href;
|
|
4057
4057
|
} else {
|
|
4058
|
-
const
|
|
4059
|
-
o = typeof
|
|
4058
|
+
const p = kt(o, f, h);
|
|
4059
|
+
o = typeof p == "string" ? p : p.href;
|
|
4060
4060
|
}
|
|
4061
4061
|
});
|
|
4062
4062
|
const u = this._injectedQuerySecrets[n] || {}, l = this._originalSecretQueryParams[n] || {};
|
|
4063
4063
|
Object.keys(u).forEach((f) => {
|
|
4064
|
-
const
|
|
4065
|
-
|
|
4064
|
+
const h = l[f], p = new URL(o);
|
|
4065
|
+
h === void 0 ? p.searchParams.delete(f) : p.searchParams.set(f, h), o = p.href;
|
|
4066
4066
|
}), e.metaframes[n].url = o;
|
|
4067
4067
|
});
|
|
4068
4068
|
});
|
|
4069
4069
|
}
|
|
4070
4070
|
async _applyDefinition(e, s) {
|
|
4071
|
+
var h;
|
|
4071
4072
|
const n = await Vn(e);
|
|
4072
4073
|
if (this.isDisposed())
|
|
4073
4074
|
return { newDefinition: n, added: {}, removed: {} };
|
|
4074
|
-
n.metaframes && Object.keys(n.metaframes).forEach((
|
|
4075
|
-
var
|
|
4076
|
-
if (typeof
|
|
4077
|
-
throw this.emitErrorMessage(`Metaframe "${
|
|
4078
|
-
if (!
|
|
4079
|
-
throw this.emitErrorMessage(`Metaframe "${
|
|
4075
|
+
n.metaframes && Object.keys(n.metaframes).forEach((p) => {
|
|
4076
|
+
var d = n.metaframes[p];
|
|
4077
|
+
if (typeof d != "object")
|
|
4078
|
+
throw this.emitErrorMessage(`Metaframe "${p}" is not an object`), `Metaframe "${p}" is not an object`;
|
|
4079
|
+
if (!d.url)
|
|
4080
|
+
throw this.emitErrorMessage(`Metaframe "${p}" missing field: url`), `Metaframe "${p}" missing field: url`;
|
|
4080
4081
|
});
|
|
4081
|
-
const i = { ...this._injectedSecrets }, o = { ...this._injectedQuerySecrets }, r = { ...this._originalSecretHashParams }, a = { ...this._originalSecretQueryParams };
|
|
4082
|
-
this._definition
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
(!n.metaframes || !n.metaframes[f]) && (u[f] = this._metaframes[f]);
|
|
4086
|
-
}), Object.keys(u).forEach((f) => {
|
|
4087
|
-
this.removeMetaframe(f);
|
|
4088
|
-
}), s && (this._state = C(s, (f) => f));
|
|
4082
|
+
const i = { ...this._injectedSecrets }, o = { ...this._injectedQuerySecrets }, r = { ...this._originalSecretHashParams }, a = { ...this._originalSecretQueryParams }, u = {};
|
|
4083
|
+
(h = this._definition) != null && h.metaframes && Object.keys(this._definition.metaframes).forEach((p) => {
|
|
4084
|
+
u[p] = this._definition.metaframes[p].url;
|
|
4085
|
+
}), this._definition = n;
|
|
4089
4086
|
const l = {};
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4087
|
+
Object.keys(this._metaframes).forEach((p) => {
|
|
4088
|
+
(!n.metaframes || !n.metaframes[p]) && (l[p] = this._metaframes[p]);
|
|
4089
|
+
}), Object.keys(l).forEach((p) => {
|
|
4090
|
+
this.removeMetaframe(p);
|
|
4091
|
+
}), s && (this._state = C(s, (p) => p));
|
|
4092
|
+
const c = {};
|
|
4093
|
+
return n.metaframes && Object.keys(n.metaframes).forEach((p) => {
|
|
4094
|
+
if (!this._metaframes.hasOwnProperty(p)) {
|
|
4095
|
+
const d = n.metaframes[p], b = this.addMetaframe(p, d);
|
|
4096
|
+
c[p] = b;
|
|
4094
4097
|
}
|
|
4095
|
-
}), n.metaframes &&
|
|
4096
|
-
if (
|
|
4098
|
+
}), n.metaframes && Object.keys(n.metaframes).forEach((p) => {
|
|
4099
|
+
if (c[p])
|
|
4097
4100
|
return;
|
|
4098
|
-
|
|
4099
|
-
|
|
4101
|
+
const d = this._metaframes[p];
|
|
4102
|
+
if (!d)
|
|
4103
|
+
return;
|
|
4104
|
+
const b = n.metaframes[p].url, w = u[p];
|
|
4105
|
+
b && w !== b && (d.url = b, d._iframe && (d._iframe.src = b));
|
|
4106
|
+
}), n.metaframes && (Object.keys(n.metaframes).forEach((p) => {
|
|
4107
|
+
if (c[p])
|
|
4108
|
+
return;
|
|
4109
|
+
this._inputMap = C(this._inputMap, (b) => {
|
|
4110
|
+
delete b[p];
|
|
4100
4111
|
});
|
|
4101
|
-
const
|
|
4102
|
-
|
|
4103
|
-
}), this._cachedInputLookupMap = C({}, (
|
|
4112
|
+
const d = n.metaframes[p];
|
|
4113
|
+
d.inputs && d.inputs.forEach((b) => this.addPipe(p, b));
|
|
4114
|
+
}), this._cachedInputLookupMap = C({}, (p) => p)), (/* @__PURE__ */ new Set([
|
|
4104
4115
|
...Object.keys(i),
|
|
4105
4116
|
...Object.keys(o)
|
|
4106
|
-
])).forEach((
|
|
4107
|
-
var
|
|
4108
|
-
if (this._metaframes[
|
|
4109
|
-
const
|
|
4110
|
-
if (!
|
|
4117
|
+
])).forEach((p) => {
|
|
4118
|
+
var d, b, w, A, S;
|
|
4119
|
+
if (this._metaframes[p]) {
|
|
4120
|
+
const O = i[p] || {}, $ = o[p] || {}, E = this._metaframes[p], j = (w = (b = (d = this._definition) == null ? void 0 : d.metaframes) == null ? void 0 : b[p]) == null ? void 0 : w.url;
|
|
4121
|
+
if (!j || j.startsWith("data:"))
|
|
4111
4122
|
return;
|
|
4112
|
-
let
|
|
4113
|
-
if (Object.keys(
|
|
4114
|
-
const
|
|
4115
|
-
Object.keys(
|
|
4116
|
-
const
|
|
4117
|
-
|
|
4118
|
-
}), this._injectedSecrets[
|
|
4123
|
+
let T = new URL(j);
|
|
4124
|
+
if (Object.keys(O).length > 0) {
|
|
4125
|
+
const _ = r[p] || {};
|
|
4126
|
+
Object.keys(O).forEach((M) => {
|
|
4127
|
+
const y = ze(T.href, M);
|
|
4128
|
+
_[M] = y;
|
|
4129
|
+
}), this._injectedSecrets[p] = O, this._originalSecretHashParams[p] = _;
|
|
4119
4130
|
}
|
|
4120
|
-
if (Object.keys(
|
|
4121
|
-
const
|
|
4122
|
-
Object.keys(
|
|
4123
|
-
const
|
|
4124
|
-
|
|
4125
|
-
}), this._injectedQuerySecrets[
|
|
4131
|
+
if (Object.keys($).length > 0) {
|
|
4132
|
+
const _ = a[p] || {};
|
|
4133
|
+
Object.keys($).forEach((M) => {
|
|
4134
|
+
const y = T.searchParams.get(M);
|
|
4135
|
+
_[M] = y || void 0;
|
|
4136
|
+
}), this._injectedQuerySecrets[p] = $, this._originalSecretQueryParams[p] = _;
|
|
4126
4137
|
}
|
|
4127
|
-
Object.entries(
|
|
4128
|
-
|
|
4129
|
-
}), Object.entries(
|
|
4130
|
-
const
|
|
4131
|
-
|
|
4132
|
-
}), E.url =
|
|
4133
|
-
|
|
4138
|
+
Object.entries(O).forEach(([_, M]) => {
|
|
4139
|
+
T = new URL(kt(T.href, _, M));
|
|
4140
|
+
}), Object.entries($).forEach(([_, M]) => {
|
|
4141
|
+
const y = btoa(encodeURIComponent(M));
|
|
4142
|
+
T.searchParams.set(_, y);
|
|
4143
|
+
}), E.url = T.href, (S = (A = this._definition) == null ? void 0 : A.metaframes) != null && S[p] && (this._definition = C(this._definition, (_) => {
|
|
4144
|
+
_.metaframes[p].url = T.href;
|
|
4134
4145
|
}));
|
|
4135
4146
|
}
|
|
4136
|
-
}), { newDefinition: n, added:
|
|
4147
|
+
}), { newDefinition: n, added: c, removed: l };
|
|
4137
4148
|
}
|
|
4138
4149
|
async setDefinition(e, s) {
|
|
4139
4150
|
const n = this._definition, { newDefinition: i } = await this._applyDefinition(e, s);
|
|
@@ -4405,10 +4416,10 @@ class tt extends or {
|
|
|
4405
4416
|
this.setOutputStateOnlyMetaframeInputMap(n, u), o.setOutputs(u);
|
|
4406
4417
|
var r = !1;
|
|
4407
4418
|
const l = Object.keys(u), c = {};
|
|
4408
|
-
l.forEach((f,
|
|
4409
|
-
const
|
|
4410
|
-
|
|
4411
|
-
c[
|
|
4419
|
+
l.forEach((f, h) => {
|
|
4420
|
+
const p = this.getInputsFromOutput(n, f);
|
|
4421
|
+
p.length > 0 && p.forEach((d) => {
|
|
4422
|
+
c[d.metaframe] || (c[d.metaframe] = {}), c[d.metaframe][d.pipe] = u[f], r = !0;
|
|
4412
4423
|
});
|
|
4413
4424
|
}), r && (this.setInputStateOnlyMetapageInstanceInputs(c), Object.keys(c).forEach((f) => {
|
|
4414
4425
|
this._metaframes[f].setInputs(c[f]);
|
|
@@ -4429,41 +4440,41 @@ class tt extends or {
|
|
|
4429
4440
|
break;
|
|
4430
4441
|
const l = e.params, c = l.metaframe;
|
|
4431
4442
|
let f = new URL(i.url);
|
|
4432
|
-
f.hash = l.hash, this._injectedSecrets[c] && Object.entries(this._injectedSecrets[c]).forEach(([
|
|
4433
|
-
f = new URL(kt(f.href,
|
|
4434
|
-
}), this._injectedQuerySecrets[c] && Object.entries(this._injectedQuerySecrets[c]).forEach(([
|
|
4435
|
-
const
|
|
4436
|
-
f.searchParams.set(
|
|
4443
|
+
f.hash = l.hash, this._injectedSecrets[c] && Object.entries(this._injectedSecrets[c]).forEach(([d, b]) => {
|
|
4444
|
+
f = new URL(kt(f.href, d, b));
|
|
4445
|
+
}), this._injectedQuerySecrets[c] && Object.entries(this._injectedQuerySecrets[c]).forEach(([d, b]) => {
|
|
4446
|
+
const w = btoa(encodeURIComponent(b));
|
|
4447
|
+
f.searchParams.set(d, w);
|
|
4437
4448
|
}), i.url = f.href;
|
|
4438
|
-
let
|
|
4449
|
+
let h = f.href;
|
|
4439
4450
|
if (this._injectedSecrets[c]) {
|
|
4440
|
-
const
|
|
4451
|
+
const d = this._originalSecretHashParams[c] || {};
|
|
4441
4452
|
Object.keys(this._injectedSecrets[c]).forEach((b) => {
|
|
4442
|
-
const
|
|
4443
|
-
if (
|
|
4444
|
-
const
|
|
4445
|
-
let
|
|
4446
|
-
|
|
4447
|
-
const
|
|
4448
|
-
|
|
4449
|
-
const
|
|
4450
|
-
|
|
4453
|
+
const w = d[b];
|
|
4454
|
+
if (w === void 0) {
|
|
4455
|
+
const A = new URL(h);
|
|
4456
|
+
let S = A.hash.startsWith("#?") ? A.hash.slice(2) : A.hash.slice(1);
|
|
4457
|
+
S = S.replace(/\?/g, "&");
|
|
4458
|
+
const O = new URLSearchParams(S);
|
|
4459
|
+
O.delete(b);
|
|
4460
|
+
const $ = O.toString();
|
|
4461
|
+
A.hash = $ ? A.hash.startsWith("#?") ? `?${$}` : $ : "", h = A.href;
|
|
4451
4462
|
} else {
|
|
4452
|
-
const
|
|
4453
|
-
|
|
4463
|
+
const A = kt(h, b, w);
|
|
4464
|
+
h = typeof A == "string" ? A : A.href;
|
|
4454
4465
|
}
|
|
4455
4466
|
});
|
|
4456
4467
|
}
|
|
4457
4468
|
if (this._injectedQuerySecrets[c]) {
|
|
4458
|
-
const
|
|
4469
|
+
const d = this._originalSecretQueryParams[c] || {};
|
|
4459
4470
|
Object.keys(this._injectedQuerySecrets[c]).forEach((b) => {
|
|
4460
|
-
const
|
|
4461
|
-
|
|
4471
|
+
const w = d[b], A = new URL(h);
|
|
4472
|
+
w === void 0 ? A.searchParams.delete(b) : A.searchParams.set(b, w), h = A.href;
|
|
4462
4473
|
});
|
|
4463
4474
|
}
|
|
4464
|
-
const
|
|
4465
|
-
this._definition = C(this._definition, (
|
|
4466
|
-
|
|
4475
|
+
const p = new URL(h);
|
|
4476
|
+
this._definition = C(this._definition, (d) => {
|
|
4477
|
+
d.metaframes[c].url = p.href;
|
|
4467
4478
|
}), this._emitDefinitionEvent();
|
|
4468
4479
|
}
|
|
4469
4480
|
break;
|
|
@@ -4530,20 +4541,20 @@ const Gr = (t) => {
|
|
|
4530
4541
|
const e = (c = (l = t == null ? void 0 : t.meta) == null ? void 0 : l.layouts) == null ? void 0 : c["react-grid-layout"], s = e == null ? void 0 : e.layout;
|
|
4531
4542
|
if (!e || !s)
|
|
4532
4543
|
throw new Error("No valid layout found in metapage definition");
|
|
4533
|
-
const n = /* @__PURE__ */ new Set(), i = s.map((
|
|
4534
|
-
const
|
|
4535
|
-
return
|
|
4536
|
-
}).filter((
|
|
4544
|
+
const n = /* @__PURE__ */ new Set(), i = s.map((h, p) => {
|
|
4545
|
+
const d = t.metaframes[h.i];
|
|
4546
|
+
return d && ys(d.url) ? { index: p, y: h.y, id: h.i } : null;
|
|
4547
|
+
}).filter((h) => h !== null);
|
|
4537
4548
|
if (i.length > 0) {
|
|
4538
|
-
const
|
|
4539
|
-
s.forEach((
|
|
4540
|
-
|
|
4549
|
+
const h = i.reduce((d, b) => b.y < d.y ? b : d), p = ((f = s.find((d) => d.i === h.id)) == null ? void 0 : f.y) ?? 0;
|
|
4550
|
+
s.forEach((d) => {
|
|
4551
|
+
d.y >= p && n.add(d.i);
|
|
4541
4552
|
});
|
|
4542
4553
|
}
|
|
4543
|
-
const o = Object.keys(t.metaframes).filter((
|
|
4544
|
-
let a = s.filter((
|
|
4545
|
-
a.sort((
|
|
4546
|
-
const u = a.reduce((
|
|
4554
|
+
const o = Object.keys(t.metaframes).filter((h) => !n.has(h)), r = Object.keys(t.metaframes).filter((h) => n.has(h));
|
|
4555
|
+
let a = s.filter((h) => o.includes(h.i));
|
|
4556
|
+
a.sort((h, p) => h.y !== p.y ? h.y - p.y : h.x - p.x);
|
|
4557
|
+
const u = a.reduce((h, p) => Math.max(h, p.y + p.h), 0);
|
|
4547
4558
|
return {
|
|
4548
4559
|
visibleLayoutItems: a,
|
|
4549
4560
|
hiddenMetaframeIds: new Set(r),
|
|
@@ -4552,7 +4563,7 @@ const Gr = (t) => {
|
|
|
4552
4563
|
};
|
|
4553
4564
|
};
|
|
4554
4565
|
async function mo(t) {
|
|
4555
|
-
var
|
|
4566
|
+
var $, E, j, T;
|
|
4556
4567
|
let { url: e, definition: s, onOutputs: n, rootDiv: i, options: o = {} } = t;
|
|
4557
4568
|
if (!e && !s)
|
|
4558
4569
|
throw new Error("Either url or definition must be provided");
|
|
@@ -4565,34 +4576,34 @@ async function mo(t) {
|
|
|
4565
4576
|
r.debug = o.debug || !1;
|
|
4566
4577
|
try {
|
|
4567
4578
|
await r.setDefinition(JSON.parse(JSON.stringify(s)));
|
|
4568
|
-
} catch (
|
|
4569
|
-
throw r.dispose(), new Error(`Failed to set metapage definition: ${
|
|
4579
|
+
} catch (_) {
|
|
4580
|
+
throw r.dispose(), new Error(`Failed to set metapage definition: ${_}`);
|
|
4570
4581
|
}
|
|
4571
4582
|
const a = [];
|
|
4572
4583
|
n && a.push(r.addListenerReturnDisposer(I.Outputs, n));
|
|
4573
|
-
const u = (
|
|
4584
|
+
const u = (E = ($ = s == null ? void 0 : s.meta) == null ? void 0 : $.layouts) == null ? void 0 : E["react-grid-layout"], l = u == null ? void 0 : u.layout;
|
|
4574
4585
|
if (!u || !l)
|
|
4575
4586
|
throw new Error("No valid layout found in metapage definition");
|
|
4576
|
-
let { visibleLayoutItems: c, hiddenMetaframeIds: f, visibleMetaframeIds:
|
|
4587
|
+
let { visibleLayoutItems: c, hiddenMetaframeIds: f, visibleMetaframeIds: h } = Gr(r.getDefinition());
|
|
4577
4588
|
if (c.length === 0)
|
|
4578
4589
|
return {
|
|
4579
4590
|
metapage: r,
|
|
4580
|
-
setInputs: (
|
|
4581
|
-
r.isDisposed() || r.setInputs(
|
|
4591
|
+
setInputs: (_) => {
|
|
4592
|
+
r.isDisposed() || r.setInputs(_);
|
|
4582
4593
|
},
|
|
4583
|
-
setOutputs: (
|
|
4584
|
-
r.isDisposed() || r.setOutputs(
|
|
4594
|
+
setOutputs: (_) => {
|
|
4595
|
+
r.isDisposed() || r.setOutputs(_);
|
|
4585
4596
|
},
|
|
4586
4597
|
dispose: () => {
|
|
4587
|
-
a.forEach((
|
|
4598
|
+
a.forEach((_) => _()), r.dispose();
|
|
4588
4599
|
}
|
|
4589
4600
|
};
|
|
4590
|
-
c.sort((
|
|
4591
|
-
const
|
|
4601
|
+
c.sort((_, M) => _.y !== M.y ? _.y - M.y : _.x - M.x);
|
|
4602
|
+
const p = {
|
|
4592
4603
|
display: "grid",
|
|
4593
4604
|
gridTemplateColumns: "repeat(1, 1fr)",
|
|
4594
4605
|
gridAutoRows: "1fr",
|
|
4595
|
-
gap: `${((
|
|
4606
|
+
gap: `${((j = u.props.margin) == null ? void 0 : j[0]) || 10}px`,
|
|
4596
4607
|
width: "100%",
|
|
4597
4608
|
height: "100%",
|
|
4598
4609
|
maxHeight: "100%",
|
|
@@ -4601,28 +4612,28 @@ async function mo(t) {
|
|
|
4601
4612
|
alignContent: "start",
|
|
4602
4613
|
alignItems: "start",
|
|
4603
4614
|
overflow: "hidden"
|
|
4604
|
-
},
|
|
4615
|
+
}, d = {
|
|
4605
4616
|
width: "100%",
|
|
4606
4617
|
height: "100%",
|
|
4607
4618
|
overflow: "hidden",
|
|
4608
4619
|
display: "flex",
|
|
4609
4620
|
flexDirection: "column"
|
|
4610
4621
|
}, b = document.createElement("div");
|
|
4611
|
-
Object.assign(b.style,
|
|
4612
|
-
const
|
|
4613
|
-
Object.assign(
|
|
4614
|
-
const
|
|
4615
|
-
for (const
|
|
4616
|
-
const
|
|
4617
|
-
if (!
|
|
4622
|
+
Object.assign(b.style, d);
|
|
4623
|
+
const w = document.createElement("div");
|
|
4624
|
+
Object.assign(w.style, p);
|
|
4625
|
+
const A = [];
|
|
4626
|
+
for (const _ of h) {
|
|
4627
|
+
const M = l.find((m) => m.i === _);
|
|
4628
|
+
if (!M)
|
|
4618
4629
|
continue;
|
|
4619
|
-
const
|
|
4620
|
-
if (!
|
|
4630
|
+
const y = r.getMetaframes()[_], L = await y.iframe;
|
|
4631
|
+
if (!y)
|
|
4621
4632
|
continue;
|
|
4622
|
-
|
|
4633
|
+
A.push(M);
|
|
4623
4634
|
const V = {
|
|
4624
|
-
gridColumn: `${
|
|
4625
|
-
gridRow: `${
|
|
4635
|
+
gridColumn: `${M.x + 1} / span ${M.w}`,
|
|
4636
|
+
gridRow: `${M.y + 1} / span ${M.h}`,
|
|
4626
4637
|
position: "relative",
|
|
4627
4638
|
overflowY: "hidden",
|
|
4628
4639
|
width: "100%",
|
|
@@ -4631,31 +4642,31 @@ async function mo(t) {
|
|
|
4631
4642
|
alignSelf: "stretch",
|
|
4632
4643
|
justifySelf: "stretch"
|
|
4633
4644
|
}, H = document.createElement("div");
|
|
4634
|
-
H.classList.add("metaframe-container"), Object.assign(H.style, V), L.classList.add("metaframe"), L.style.position = "absolute", L.style.top = "0", L.style.left = "0", L.style.width = "100%", L.style.height = "100%", L.style.border = "0", L.style.overflow = "hidden", H.appendChild(L),
|
|
4635
|
-
}
|
|
4636
|
-
const
|
|
4637
|
-
Math.max(...
|
|
4638
|
-
const
|
|
4639
|
-
|
|
4640
|
-
for (const
|
|
4641
|
-
const
|
|
4642
|
-
if (!
|
|
4645
|
+
H.classList.add("metaframe-container"), Object.assign(H.style, V), L.classList.add("metaframe"), L.style.position = "absolute", L.style.top = "0", L.style.left = "0", L.style.width = "100%", L.style.height = "100%", L.style.border = "0", L.style.overflow = "hidden", H.appendChild(L), w.appendChild(H);
|
|
4646
|
+
}
|
|
4647
|
+
const S = Math.max(...A.map((_) => _.x + _.w));
|
|
4648
|
+
Math.max(...A.map((_) => _.y + _.h)), w.style.gridTemplateColumns = `repeat(${Math.max(1, S)}, 1fr)`;
|
|
4649
|
+
const O = document.createElement("div");
|
|
4650
|
+
O.style.position = "absolute", O.style.top = "-9999px", O.style.left = "-9999px", O.style.width = "1px", O.style.height = "1px", O.style.overflow = "hidden", O.style.pointerEvents = "none";
|
|
4651
|
+
for (const _ of Object.keys(r.getMetaframes()).filter((M) => f.has(M))) {
|
|
4652
|
+
const M = r.getMetaframes()[_];
|
|
4653
|
+
if (!M)
|
|
4643
4654
|
continue;
|
|
4644
|
-
const
|
|
4645
|
-
|
|
4655
|
+
const y = document.createElement("div");
|
|
4656
|
+
y.setAttribute("data-metaframe-id", _), y.style.width = "100px", y.style.height = "100px";
|
|
4646
4657
|
let L;
|
|
4647
|
-
|
|
4658
|
+
M.iframe ? L = await M.iframe : (L = document.createElement("iframe"), L.src = M.url, L.style.border = "none", L.style.width = "100%", L.style.height = "100%"), y.appendChild(L), O.appendChild(y);
|
|
4648
4659
|
}
|
|
4649
|
-
return b.appendChild(
|
|
4660
|
+
return b.appendChild(w), b.appendChild(O), i.appendChild(b), {
|
|
4650
4661
|
metapage: r,
|
|
4651
|
-
setInputs: (
|
|
4652
|
-
r.isDisposed() || r.setInputs(
|
|
4662
|
+
setInputs: (_) => {
|
|
4663
|
+
r.isDisposed() || r.setInputs(_);
|
|
4653
4664
|
},
|
|
4654
|
-
setOutputs: (
|
|
4655
|
-
r.isDisposed() || r.setOutputs(
|
|
4665
|
+
setOutputs: (_) => {
|
|
4666
|
+
r.isDisposed() || r.setOutputs(_);
|
|
4656
4667
|
},
|
|
4657
4668
|
dispose: () => {
|
|
4658
|
-
a.forEach((
|
|
4669
|
+
a.forEach((_) => _()), r.dispose(), b.parentNode && b.parentNode.removeChild(b);
|
|
4659
4670
|
}
|
|
4660
4671
|
};
|
|
4661
4672
|
}
|
|
@@ -4665,12 +4676,12 @@ const go = (t, e) => {
|
|
|
4665
4676
|
if (!s || !n)
|
|
4666
4677
|
throw new Error("No valid layout found in metapage definition");
|
|
4667
4678
|
const i = /* @__PURE__ */ new Set(), o = n.map((l, c) => {
|
|
4668
|
-
var
|
|
4669
|
-
const f = (
|
|
4679
|
+
var h;
|
|
4680
|
+
const f = (h = t == null ? void 0 : t.metaframes) == null ? void 0 : h[l.i];
|
|
4670
4681
|
return f && ys(f.url) ? { index: c, y: l.y, id: l.i } : null;
|
|
4671
4682
|
}).filter((l) => l !== null);
|
|
4672
4683
|
if (o.length > 0) {
|
|
4673
|
-
const l = o.reduce((f,
|
|
4684
|
+
const l = o.reduce((f, h) => h.y < f.y ? h : f), c = ((u = n.find((f) => f.i === l.id)) == null ? void 0 : u.y) ?? 0;
|
|
4674
4685
|
n.forEach((f) => {
|
|
4675
4686
|
f.y >= c && i.add(f.i);
|
|
4676
4687
|
});
|
|
@@ -4726,18 +4737,18 @@ async function bo(t) {
|
|
|
4726
4737
|
a.debug = o;
|
|
4727
4738
|
try {
|
|
4728
4739
|
await a.setDefinition(JSON.parse(JSON.stringify(r)));
|
|
4729
|
-
} catch (
|
|
4730
|
-
throw a.dispose(), new Error(`Failed to set metapage definition: ${
|
|
4740
|
+
} catch (h) {
|
|
4741
|
+
throw a.dispose(), new Error(`Failed to set metapage definition: ${h}`);
|
|
4731
4742
|
}
|
|
4732
4743
|
const u = [];
|
|
4733
|
-
if (s && u.push(a.addListenerReturnDisposer(I.Outputs, (
|
|
4734
|
-
s(
|
|
4744
|
+
if (s && u.push(a.addListenerReturnDisposer(I.Outputs, (h) => {
|
|
4745
|
+
s(h[It] || {});
|
|
4735
4746
|
})), n) {
|
|
4736
|
-
let
|
|
4737
|
-
u.push(a.addListenerReturnDisposer(I.DefinitionUpdate, (
|
|
4738
|
-
var b,
|
|
4739
|
-
const
|
|
4740
|
-
|
|
4747
|
+
let h = e;
|
|
4748
|
+
u.push(a.addListenerReturnDisposer(I.DefinitionUpdate, (p) => {
|
|
4749
|
+
var b, w, A;
|
|
4750
|
+
const d = (A = (w = (b = p.definition) == null ? void 0 : b.metaframes) == null ? void 0 : w[It]) == null ? void 0 : A.url;
|
|
4751
|
+
d && d !== h && (h = d, n(d));
|
|
4741
4752
|
}));
|
|
4742
4753
|
}
|
|
4743
4754
|
const l = a.getMetaframes()[It];
|
|
@@ -4746,14 +4757,14 @@ async function bo(t) {
|
|
|
4746
4757
|
const c = await l.iframe, f = document.createElement("div");
|
|
4747
4758
|
return f.style.width = "100%", f.style.height = "100%", f.style.margin = "0", f.style.padding = "0", f.style.overflow = "hidden", f.style.position = "relative", c.style.position = "absolute", c.style.top = "0", c.style.left = "0", c.style.width = "100%", c.style.height = "100%", c.style.border = "none", c.style.margin = "0", c.style.padding = "0", f.appendChild(c), i.appendChild(f), {
|
|
4748
4759
|
metapage: a,
|
|
4749
|
-
setInputs: (
|
|
4750
|
-
a.isDisposed() || a.setInputs({ [It]:
|
|
4760
|
+
setInputs: (h) => {
|
|
4761
|
+
a.isDisposed() || a.setInputs({ [It]: h });
|
|
4751
4762
|
},
|
|
4752
|
-
setOutputs: (
|
|
4753
|
-
a.isDisposed() || a.setOutputs({ [It]:
|
|
4763
|
+
setOutputs: (h) => {
|
|
4764
|
+
a.isDisposed() || a.setOutputs({ [It]: h });
|
|
4754
4765
|
},
|
|
4755
4766
|
dispose: () => {
|
|
4756
|
-
u.forEach((
|
|
4767
|
+
u.forEach((h) => h()), a.dispose(), f.parentNode && f.parentNode.removeChild(f);
|
|
4757
4768
|
}
|
|
4758
4769
|
};
|
|
4759
4770
|
}
|