@metapages/metapage 1.0.21 → 1.1.3
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.js +2409 -1362
- package/dist/index.js.map +1 -1
- package/dist/metapage/Metaframe.d.ts +14 -0
- package/dist/metapage/Metaframe.d.ts.map +1 -1
- package/dist/metapage/Metapage.d.ts +3 -3
- package/dist/metapage/Metapage.d.ts.map +1 -1
- package/dist/metapage/MetapageIFrameRpcClient.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/declarations.d.ts +1 -0
- package/src/metapage/Metaframe.ts +112 -15
- package/src/metapage/Metapage.ts +38 -19
- package/src/metapage/MetapageIFrameRpcClient.ts +0 -5
package/dist/index.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
const
|
|
2
|
-
if (typeof
|
|
1
|
+
const Et = ["0.3", "0.4", "0.5", "0.6", "1"], Mt = ["0.2", "0.3", "1"], pt = "1", Je = "1", _i = "metaframe.json", gi = "metapage/definition", bi = "metapage/state", Vt = Mt[Mt.length - 1], An = Et[Et.length - 1], Sn = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, It = (e) => {
|
|
2
|
+
if (typeof e != "string")
|
|
3
3
|
throw new TypeError("Invalid argument expected string");
|
|
4
|
-
const
|
|
5
|
-
if (!
|
|
6
|
-
throw new Error(`Invalid argument not valid semver ('${
|
|
7
|
-
return
|
|
8
|
-
},
|
|
9
|
-
const
|
|
10
|
-
return isNaN(
|
|
11
|
-
},
|
|
12
|
-
if (
|
|
4
|
+
const t = e.match(Sn);
|
|
5
|
+
if (!t)
|
|
6
|
+
throw new Error(`Invalid argument not valid semver ('${e}' received)`);
|
|
7
|
+
return t.shift(), t;
|
|
8
|
+
}, Ct = (e) => e === "*" || e === "x" || e === "X", $t = (e) => {
|
|
9
|
+
const t = parseInt(e, 10);
|
|
10
|
+
return isNaN(t) ? e : t;
|
|
11
|
+
}, En = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], Mn = (e, t) => {
|
|
12
|
+
if (Ct(e) || Ct(t))
|
|
13
13
|
return 0;
|
|
14
|
-
const [n, s] =
|
|
14
|
+
const [n, s] = En($t(e), $t(t));
|
|
15
15
|
return n > s ? 1 : n < s ? -1 : 0;
|
|
16
|
-
},
|
|
17
|
-
for (let n = 0; n < Math.max(
|
|
18
|
-
const s =
|
|
16
|
+
}, xt = (e, t) => {
|
|
17
|
+
for (let n = 0; n < Math.max(e.length, t.length); n++) {
|
|
18
|
+
const s = Mn(e[n] || "0", t[n] || "0");
|
|
19
19
|
if (s !== 0)
|
|
20
20
|
return s;
|
|
21
21
|
}
|
|
22
22
|
return 0;
|
|
23
|
-
},
|
|
24
|
-
const n =
|
|
25
|
-
return r !== 0 ? r : i &&
|
|
23
|
+
}, V = (e, t) => {
|
|
24
|
+
const n = It(e), s = It(t), i = n.pop(), o = s.pop(), r = xt(n, s);
|
|
25
|
+
return r !== 0 ? r : i && o ? xt(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
|
|
26
26
|
};
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return
|
|
27
|
+
var In = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
28
|
+
function ht(e) {
|
|
29
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
30
30
|
}
|
|
31
|
-
var
|
|
32
|
-
(function(
|
|
31
|
+
var Jt = { exports: {} };
|
|
32
|
+
(function(e, t) {
|
|
33
33
|
(function(n, s) {
|
|
34
|
-
|
|
35
|
-
})(
|
|
36
|
-
var n = function(
|
|
37
|
-
if (r = r || {}, typeof
|
|
34
|
+
e.exports = s();
|
|
35
|
+
})(In, function() {
|
|
36
|
+
var n = function(o, r) {
|
|
37
|
+
if (r = r || {}, typeof o != "function")
|
|
38
38
|
throw new i("fetch must be a function");
|
|
39
39
|
if (typeof r != "object")
|
|
40
40
|
throw new i("defaults must be an object");
|
|
@@ -44,615 +44,615 @@ var He = { exports: {} };
|
|
|
44
44
|
throw new i("retryDelay must be a positive integer or a function returning a positive integer");
|
|
45
45
|
if (r.retryOn !== void 0 && !Array.isArray(r.retryOn) && typeof r.retryOn != "function")
|
|
46
46
|
throw new i("retryOn property expects an array or function");
|
|
47
|
-
var
|
|
47
|
+
var a = {
|
|
48
48
|
retries: 3,
|
|
49
49
|
retryDelay: 1e3,
|
|
50
50
|
retryOn: []
|
|
51
51
|
};
|
|
52
|
-
return r = Object.assign(
|
|
53
|
-
var
|
|
52
|
+
return r = Object.assign(a, r), function(f, c) {
|
|
53
|
+
var d = r.retries, y = r.retryDelay, w = r.retryOn;
|
|
54
54
|
if (c && c.retries !== void 0)
|
|
55
55
|
if (s(c.retries))
|
|
56
|
-
|
|
56
|
+
d = c.retries;
|
|
57
57
|
else
|
|
58
58
|
throw new i("retries must be a positive integer");
|
|
59
59
|
if (c && c.retryDelay !== void 0)
|
|
60
60
|
if (s(c.retryDelay) || typeof c.retryDelay == "function")
|
|
61
|
-
|
|
61
|
+
y = c.retryDelay;
|
|
62
62
|
else
|
|
63
63
|
throw new i("retryDelay must be a positive integer or a function returning a positive integer");
|
|
64
64
|
if (c && c.retryOn)
|
|
65
65
|
if (Array.isArray(c.retryOn) || typeof c.retryOn == "function")
|
|
66
|
-
|
|
66
|
+
w = c.retryOn;
|
|
67
67
|
else
|
|
68
68
|
throw new i("retryOn property expects an array or function");
|
|
69
|
-
return new Promise(function(_,
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
if (Array.isArray(
|
|
74
|
-
_(
|
|
75
|
-
else if (typeof
|
|
69
|
+
return new Promise(function(_, S) {
|
|
70
|
+
var v = function(b) {
|
|
71
|
+
var A = typeof Request < "u" && f instanceof Request ? f.clone() : f;
|
|
72
|
+
o(A, c).then(function(M) {
|
|
73
|
+
if (Array.isArray(w) && w.indexOf(M.status) === -1)
|
|
74
|
+
_(M);
|
|
75
|
+
else if (typeof w == "function")
|
|
76
76
|
try {
|
|
77
|
-
return Promise.resolve(
|
|
78
|
-
|
|
79
|
-
}).catch(
|
|
80
|
-
} catch (
|
|
81
|
-
|
|
77
|
+
return Promise.resolve(w(b, null, M)).then(function(R) {
|
|
78
|
+
R ? x(b, null, M) : _(M);
|
|
79
|
+
}).catch(S);
|
|
80
|
+
} catch (R) {
|
|
81
|
+
S(R);
|
|
82
82
|
}
|
|
83
83
|
else
|
|
84
|
-
|
|
85
|
-
}).catch(function(
|
|
86
|
-
if (typeof
|
|
84
|
+
b < d ? x(b, null, M) : _(M);
|
|
85
|
+
}).catch(function(M) {
|
|
86
|
+
if (typeof w == "function")
|
|
87
87
|
try {
|
|
88
|
-
Promise.resolve(
|
|
89
|
-
|
|
90
|
-
}).catch(function(
|
|
91
|
-
|
|
88
|
+
Promise.resolve(w(b, M, null)).then(function(R) {
|
|
89
|
+
R ? x(b, M, null) : S(M);
|
|
90
|
+
}).catch(function(R) {
|
|
91
|
+
S(R);
|
|
92
92
|
});
|
|
93
|
-
} catch (
|
|
94
|
-
|
|
93
|
+
} catch (R) {
|
|
94
|
+
S(R);
|
|
95
95
|
}
|
|
96
96
|
else
|
|
97
|
-
|
|
97
|
+
b < d ? x(b, M, null) : S(M);
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
|
-
function
|
|
101
|
-
var
|
|
100
|
+
function x(b, A, M) {
|
|
101
|
+
var R = typeof y == "function" ? y(b, A, M) : y;
|
|
102
102
|
setTimeout(function() {
|
|
103
|
-
|
|
104
|
-
},
|
|
103
|
+
v(++b);
|
|
104
|
+
}, R);
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
v(0);
|
|
107
107
|
});
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
function s(
|
|
111
|
-
return Number.isInteger(
|
|
110
|
+
function s(o) {
|
|
111
|
+
return Number.isInteger(o) && o >= 0;
|
|
112
112
|
}
|
|
113
|
-
function i(
|
|
114
|
-
this.name = "ArgumentError", this.message =
|
|
113
|
+
function i(o) {
|
|
114
|
+
this.name = "ArgumentError", this.message = o;
|
|
115
115
|
}
|
|
116
116
|
return n;
|
|
117
117
|
});
|
|
118
|
-
})(
|
|
119
|
-
var
|
|
120
|
-
const
|
|
118
|
+
})(Jt);
|
|
119
|
+
var Cn = Jt.exports;
|
|
120
|
+
const dt = /* @__PURE__ */ ht(Cn), B = {
|
|
121
121
|
Remove: "remove",
|
|
122
122
|
Replace: "replace",
|
|
123
123
|
Add: "add"
|
|
124
|
-
},
|
|
124
|
+
}, Wt = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), $n = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Ue = Symbol.iterator, Y = {
|
|
125
125
|
mutable: "mutable",
|
|
126
126
|
immutable: "immutable"
|
|
127
|
-
},
|
|
128
|
-
function
|
|
129
|
-
return
|
|
127
|
+
}, mt = {};
|
|
128
|
+
function Ie(e, t) {
|
|
129
|
+
return e instanceof Map ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
let n = Reflect.getPrototypeOf(
|
|
131
|
+
function Lt(e, t) {
|
|
132
|
+
if (t in e) {
|
|
133
|
+
let n = Reflect.getPrototypeOf(e);
|
|
134
134
|
for (; n; ) {
|
|
135
|
-
const s = Reflect.getOwnPropertyDescriptor(n,
|
|
135
|
+
const s = Reflect.getOwnPropertyDescriptor(n, t);
|
|
136
136
|
if (s)
|
|
137
137
|
return s;
|
|
138
138
|
n = Reflect.getPrototypeOf(n);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
var
|
|
144
|
-
return (
|
|
142
|
+
function Q(e) {
|
|
143
|
+
var t;
|
|
144
|
+
return (t = e.copy) !== null && t !== void 0 ? t : e.original;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
return
|
|
146
|
+
function ge(e) {
|
|
147
|
+
return !!$(e);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
return typeof
|
|
149
|
+
function $(e) {
|
|
150
|
+
return typeof e != "object" ? null : e == null ? void 0 : e[Wt];
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
var
|
|
154
|
-
const n =
|
|
155
|
-
return n ? (
|
|
152
|
+
function yt(e) {
|
|
153
|
+
var t;
|
|
154
|
+
const n = $(e);
|
|
155
|
+
return n ? (t = n.copy) !== null && t !== void 0 ? t : n.original : e;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
if (!
|
|
157
|
+
function ee(e, t) {
|
|
158
|
+
if (!e || typeof e != "object")
|
|
159
159
|
return !1;
|
|
160
160
|
let n;
|
|
161
|
-
return Object.getPrototypeOf(
|
|
161
|
+
return Object.getPrototypeOf(e) === Object.prototype || Array.isArray(e) || e instanceof Map || e instanceof Set || !!(t != null && t.mark) && ((n = t.mark(e, Y)) === Y.immutable || typeof n == "function");
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
if (Object.hasOwnProperty.call(
|
|
165
|
-
const n =
|
|
166
|
-
if (s !== null && (s == null ? void 0 : s.original) !==
|
|
163
|
+
function Kt(e, t = []) {
|
|
164
|
+
if (Object.hasOwnProperty.call(e, "key")) {
|
|
165
|
+
const n = e.parent.copy, s = $(pe(n, e.key));
|
|
166
|
+
if (s !== null && (s == null ? void 0 : s.original) !== e.original)
|
|
167
167
|
return null;
|
|
168
|
-
const i =
|
|
169
|
-
if (!(i && n.size >
|
|
168
|
+
const i = e.parent.type === 3, o = i ? Array.from(e.parent.setMap.keys()).indexOf(e.key) : e.key;
|
|
169
|
+
if (!(i && n.size > o || Ie(n, o)))
|
|
170
170
|
return null;
|
|
171
|
-
|
|
171
|
+
t.push(o);
|
|
172
172
|
}
|
|
173
|
-
if (
|
|
174
|
-
return
|
|
175
|
-
|
|
173
|
+
if (e.parent)
|
|
174
|
+
return Kt(e.parent, t);
|
|
175
|
+
t.reverse();
|
|
176
176
|
try {
|
|
177
|
-
|
|
177
|
+
xn(e.copy, t);
|
|
178
178
|
} catch {
|
|
179
179
|
return null;
|
|
180
180
|
}
|
|
181
|
-
return
|
|
181
|
+
return t;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
return Array.isArray(
|
|
183
|
+
function be(e) {
|
|
184
|
+
return Array.isArray(e) ? 1 : e instanceof Map ? 2 : e instanceof Set ? 3 : 0;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
return
|
|
186
|
+
function pe(e, t) {
|
|
187
|
+
return be(e) === 2 ? e.get(t) : e[t];
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
|
|
189
|
+
function Le(e, t, n) {
|
|
190
|
+
be(e) === 2 ? e.set(t, n) : e[t] = n;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
const n =
|
|
194
|
-
return (n ?
|
|
192
|
+
function Ye(e, t) {
|
|
193
|
+
const n = $(e);
|
|
194
|
+
return (n ? Q(n) : e)[t];
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
return
|
|
196
|
+
function le(e, t) {
|
|
197
|
+
return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
if (
|
|
201
|
-
for (;
|
|
202
|
-
|
|
199
|
+
function it(e) {
|
|
200
|
+
if (e)
|
|
201
|
+
for (; e.finalities.revoke.length > 0; )
|
|
202
|
+
e.finalities.revoke.pop()();
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
return
|
|
204
|
+
function _e(e, t) {
|
|
205
|
+
return t ? e : [""].concat(e).map((n) => {
|
|
206
206
|
const s = `${n}`;
|
|
207
207
|
return s.indexOf("/") === -1 && s.indexOf("~") === -1 ? s : s.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
208
208
|
}).join("/");
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
for (let n = 0; n <
|
|
212
|
-
const s =
|
|
213
|
-
if (
|
|
214
|
-
throw new Error(`Cannot resolve patch at '${
|
|
210
|
+
function xn(e, t) {
|
|
211
|
+
for (let n = 0; n < t.length - 1; n += 1) {
|
|
212
|
+
const s = t[n];
|
|
213
|
+
if (e = pe(be(e) === 3 ? Array.from(e) : e, s), typeof e != "object")
|
|
214
|
+
throw new Error(`Cannot resolve patch at '${t.join("/")}'.`);
|
|
215
215
|
}
|
|
216
|
-
return
|
|
216
|
+
return e;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
219
|
-
const
|
|
220
|
-
return Reflect.ownKeys(
|
|
221
|
-
let s = Reflect.getOwnPropertyDescriptor(
|
|
218
|
+
function Ln(e) {
|
|
219
|
+
const t = Object.create(Object.getPrototypeOf(e));
|
|
220
|
+
return Reflect.ownKeys(e).forEach((n) => {
|
|
221
|
+
let s = Reflect.getOwnPropertyDescriptor(e, n);
|
|
222
222
|
if (s.enumerable && s.configurable && s.writable) {
|
|
223
|
-
|
|
223
|
+
t[n] = e[n];
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
226
|
s.writable || (s.writable = !0, s.configurable = !0), (s.get || s.set) && (s = {
|
|
227
227
|
configurable: !0,
|
|
228
228
|
writable: !0,
|
|
229
229
|
enumerable: s.enumerable,
|
|
230
|
-
value:
|
|
231
|
-
}), Reflect.defineProperty(
|
|
232
|
-
}),
|
|
230
|
+
value: e[n]
|
|
231
|
+
}), Reflect.defineProperty(t, n, s);
|
|
232
|
+
}), t;
|
|
233
233
|
}
|
|
234
|
-
const
|
|
235
|
-
function
|
|
234
|
+
const Pn = Object.prototype.propertyIsEnumerable;
|
|
235
|
+
function Xt(e, t) {
|
|
236
236
|
let n;
|
|
237
|
-
if (Array.isArray(
|
|
238
|
-
return Array.prototype.concat.call(
|
|
239
|
-
if (
|
|
240
|
-
return new Set(
|
|
241
|
-
if (
|
|
242
|
-
return new Map(
|
|
243
|
-
if (
|
|
244
|
-
if (n ===
|
|
245
|
-
return
|
|
237
|
+
if (Array.isArray(e))
|
|
238
|
+
return Array.prototype.concat.call(e);
|
|
239
|
+
if (e instanceof Set)
|
|
240
|
+
return new Set(e.values());
|
|
241
|
+
if (e instanceof Map)
|
|
242
|
+
return new Map(e);
|
|
243
|
+
if (t != null && t.mark && (n = t.mark(e, Y), n !== void 0) && n !== Y.mutable) {
|
|
244
|
+
if (n === Y.immutable)
|
|
245
|
+
return Ln(e);
|
|
246
246
|
if (typeof n == "function") {
|
|
247
|
-
if (
|
|
247
|
+
if (t.enablePatches || t.enableAutoFreeze)
|
|
248
248
|
throw new Error("You can't use mark and patches or auto freeze together.");
|
|
249
249
|
return n();
|
|
250
250
|
}
|
|
251
251
|
throw new Error(`Unsupported mark result: ${n}`);
|
|
252
|
-
} else if (typeof
|
|
252
|
+
} else if (typeof e == "object" && Object.getPrototypeOf(e) === Object.prototype) {
|
|
253
253
|
const s = {};
|
|
254
|
-
return Object.keys(
|
|
255
|
-
s[i] =
|
|
256
|
-
}), Object.getOwnPropertySymbols(
|
|
257
|
-
|
|
254
|
+
return Object.keys(e).forEach((i) => {
|
|
255
|
+
s[i] = e[i];
|
|
256
|
+
}), Object.getOwnPropertySymbols(e).forEach((i) => {
|
|
257
|
+
Pn.call(e, i) && (s[i] = e[i]);
|
|
258
258
|
}), s;
|
|
259
259
|
} else
|
|
260
260
|
throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
|
|
262
|
+
function K(e) {
|
|
263
|
+
e.copy || (e.copy = Xt(e.original, e.options));
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
if (!
|
|
267
|
-
return
|
|
268
|
-
if (Array.isArray(
|
|
269
|
-
return
|
|
270
|
-
if (
|
|
271
|
-
return new Map(Array.from(
|
|
272
|
-
if (
|
|
273
|
-
return new Set(Array.from(
|
|
274
|
-
const
|
|
275
|
-
for (const n in
|
|
276
|
-
|
|
277
|
-
return
|
|
265
|
+
function Se(e) {
|
|
266
|
+
if (!ee(e))
|
|
267
|
+
return yt(e);
|
|
268
|
+
if (Array.isArray(e))
|
|
269
|
+
return e.map(Se);
|
|
270
|
+
if (e instanceof Map)
|
|
271
|
+
return new Map(Array.from(e.entries()).map(([n, s]) => [n, Se(s)]));
|
|
272
|
+
if (e instanceof Set)
|
|
273
|
+
return new Set(Array.from(e).map(Se));
|
|
274
|
+
const t = Object.create(Object.getPrototypeOf(e));
|
|
275
|
+
for (const n in e)
|
|
276
|
+
t[n] = Se(e[n]);
|
|
277
|
+
return t;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
return
|
|
279
|
+
function Be(e) {
|
|
280
|
+
return ge(e) ? Se(e) : e;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
var
|
|
284
|
-
|
|
282
|
+
function oe(e) {
|
|
283
|
+
var t;
|
|
284
|
+
e.assignedMap = (t = e.assignedMap) !== null && t !== void 0 ? t : /* @__PURE__ */ new Map(), e.operated || (e.operated = !0, e.parent && oe(e.parent));
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function Pt() {
|
|
287
287
|
throw new Error("Cannot modify frozen object");
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function we(e, t, n, s, i) {
|
|
290
290
|
{
|
|
291
291
|
n = n ?? /* @__PURE__ */ new WeakMap(), s = s ?? [], i = i ?? [];
|
|
292
|
-
const r = n.has(
|
|
292
|
+
const r = n.has(e) ? n.get(e) : e;
|
|
293
293
|
if (s.length > 0) {
|
|
294
|
-
const
|
|
295
|
-
if (r && typeof r == "object" &&
|
|
296
|
-
throw s[0] === r ? new Error("Forbids circular reference") : new Error(`Forbids circular reference: ~/${i.slice(0,
|
|
297
|
-
if (typeof
|
|
298
|
-
return `[${
|
|
299
|
-
const c = s[
|
|
300
|
-
return typeof
|
|
294
|
+
const a = s.indexOf(r);
|
|
295
|
+
if (r && typeof r == "object" && a !== -1)
|
|
296
|
+
throw s[0] === r ? new Error("Forbids circular reference") : new Error(`Forbids circular reference: ~/${i.slice(0, a).map((u, f) => {
|
|
297
|
+
if (typeof u == "symbol")
|
|
298
|
+
return `[${u.toString()}]`;
|
|
299
|
+
const c = s[f];
|
|
300
|
+
return typeof u == "object" && (c instanceof Map || c instanceof Set) ? Array.from(c.keys()).indexOf(u) : u;
|
|
301
301
|
}).join("/")}`);
|
|
302
|
-
s.push(r), i.push(
|
|
302
|
+
s.push(r), i.push(t);
|
|
303
303
|
} else
|
|
304
304
|
s.push(r);
|
|
305
305
|
}
|
|
306
|
-
if (Object.isFrozen(
|
|
306
|
+
if (Object.isFrozen(e) || ge(e)) {
|
|
307
307
|
s.pop(), i.pop();
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
|
-
switch (
|
|
310
|
+
switch (be(e)) {
|
|
311
311
|
case 2:
|
|
312
|
-
for (const [
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
for (const [a, u] of e)
|
|
313
|
+
we(a, a, n, s, i), we(u, a, n, s, i);
|
|
314
|
+
e.set = e.clear = e.delete = Pt;
|
|
315
315
|
break;
|
|
316
316
|
case 3:
|
|
317
|
-
for (const
|
|
318
|
-
|
|
319
|
-
|
|
317
|
+
for (const a of e)
|
|
318
|
+
we(a, a, n, s, i);
|
|
319
|
+
e.add = e.clear = e.delete = Pt;
|
|
320
320
|
break;
|
|
321
321
|
case 1:
|
|
322
|
-
Object.freeze(
|
|
322
|
+
Object.freeze(e);
|
|
323
323
|
let r = 0;
|
|
324
|
-
for (const
|
|
325
|
-
|
|
324
|
+
for (const a of e)
|
|
325
|
+
we(a, r, n, s, i), r += 1;
|
|
326
326
|
break;
|
|
327
327
|
default:
|
|
328
|
-
Object.freeze(
|
|
329
|
-
const
|
|
330
|
-
|
|
328
|
+
Object.freeze(e), Object.keys(e).forEach((a) => {
|
|
329
|
+
const u = e[a];
|
|
330
|
+
we(u, a, n, s, i);
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
333
|
s.pop(), i.pop();
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
const n =
|
|
335
|
+
function _t(e, t) {
|
|
336
|
+
const n = be(e);
|
|
337
337
|
if (n === 0)
|
|
338
|
-
Reflect.ownKeys(
|
|
339
|
-
|
|
338
|
+
Reflect.ownKeys(e).forEach((s) => {
|
|
339
|
+
t(s, e[s], e);
|
|
340
340
|
});
|
|
341
341
|
else if (n === 1) {
|
|
342
342
|
let s = 0;
|
|
343
|
-
for (const i of
|
|
344
|
-
|
|
343
|
+
for (const i of e)
|
|
344
|
+
t(s, i, e), s += 1;
|
|
345
345
|
} else
|
|
346
|
-
|
|
346
|
+
e.forEach((s, i) => t(i, s, e));
|
|
347
347
|
}
|
|
348
|
-
function
|
|
349
|
-
if (
|
|
348
|
+
function qt(e, t, n) {
|
|
349
|
+
if (ge(e) || !ee(e, n) || t.has(e) || Object.isFrozen(e))
|
|
350
350
|
return;
|
|
351
|
-
const s =
|
|
352
|
-
if (
|
|
353
|
-
var
|
|
354
|
-
if (
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
const
|
|
358
|
-
|
|
351
|
+
const s = e instanceof Set, i = s ? /* @__PURE__ */ new Map() : void 0;
|
|
352
|
+
if (t.add(e), _t(e, (o, r) => {
|
|
353
|
+
var a;
|
|
354
|
+
if (ge(r)) {
|
|
355
|
+
const u = $(r);
|
|
356
|
+
K(u);
|
|
357
|
+
const f = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
|
|
358
|
+
Le(s ? i : e, o, f);
|
|
359
359
|
} else
|
|
360
|
-
|
|
360
|
+
qt(r, t, n);
|
|
361
361
|
}), i) {
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
|
|
362
|
+
const o = e, r = Array.from(o);
|
|
363
|
+
o.clear(), r.forEach((a) => {
|
|
364
|
+
o.add(i.has(a) ? i.get(a) : a);
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
const n =
|
|
370
|
-
|
|
368
|
+
function Tn(e, t) {
|
|
369
|
+
const n = e.type === 3 ? e.setMap : e.copy;
|
|
370
|
+
e.finalities.revoke.length > 1 && e.assignedMap.get(t) && n && qt(pe(n, t), e.finalities.handledSet, e.options);
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
|
|
374
|
-
|
|
372
|
+
function rt(e) {
|
|
373
|
+
e.type === 3 && e.copy && (e.copy.clear(), e.setMap.forEach((t) => {
|
|
374
|
+
e.copy.add(yt(t));
|
|
375
375
|
}));
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
if (
|
|
377
|
+
function ot(e, t, n, s) {
|
|
378
|
+
if (e.operated && e.assignedMap && e.assignedMap.size > 0 && !e.finalized) {
|
|
379
379
|
if (n && s) {
|
|
380
|
-
const
|
|
381
|
-
|
|
380
|
+
const o = Kt(e);
|
|
381
|
+
o && t(e, o, n, s);
|
|
382
382
|
}
|
|
383
|
-
|
|
383
|
+
e.finalized = !0;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
const i =
|
|
388
|
-
i && (i.callbacks || (i.callbacks = []), i.callbacks.push((
|
|
389
|
-
var
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
392
|
-
let
|
|
393
|
-
i.copy && (
|
|
394
|
-
}
|
|
395
|
-
}),
|
|
396
|
-
const
|
|
397
|
-
|
|
386
|
+
function gt(e, t, n, s) {
|
|
387
|
+
const i = $(n);
|
|
388
|
+
i && (i.callbacks || (i.callbacks = []), i.callbacks.push((o, r) => {
|
|
389
|
+
var a;
|
|
390
|
+
const u = e.type === 3 ? e.setMap : e.copy;
|
|
391
|
+
if (le(pe(u, t), n)) {
|
|
392
|
+
let f = i.original;
|
|
393
|
+
i.copy && (f = i.copy), rt(e), ot(e, s, o, r), e.options.enableAutoFreeze && (e.options.updatedValues = (a = e.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), e.options.updatedValues.set(f, i.original)), Le(u, t, f);
|
|
394
|
+
}
|
|
395
|
+
}), e.options.enableAutoFreeze && i.finalities !== e.finalities && (e.options.enableAutoFreeze = !1)), ee(n, e.options) && e.finalities.draft.push(() => {
|
|
396
|
+
const o = e.type === 3 ? e.setMap : e.copy;
|
|
397
|
+
le(pe(o, t), n) && Tn(e, t);
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
let { original:
|
|
402
|
-
|
|
403
|
-
for (let
|
|
404
|
-
if (r.get(
|
|
405
|
-
const c =
|
|
400
|
+
function Dn(e, t, n, s, i) {
|
|
401
|
+
let { original: o, assignedMap: r, options: a } = e, u = e.copy;
|
|
402
|
+
u.length < o.length && ([o, u] = [u, o], [n, s] = [s, n]);
|
|
403
|
+
for (let f = 0; f < o.length; f += 1)
|
|
404
|
+
if (r.get(f.toString()) && u[f] !== o[f]) {
|
|
405
|
+
const c = t.concat([f]), d = _e(c, i);
|
|
406
406
|
n.push({
|
|
407
|
-
op:
|
|
408
|
-
path:
|
|
407
|
+
op: B.Replace,
|
|
408
|
+
path: d,
|
|
409
409
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
410
|
-
value:
|
|
410
|
+
value: Be(u[f])
|
|
411
411
|
}), s.push({
|
|
412
|
-
op:
|
|
413
|
-
path:
|
|
412
|
+
op: B.Replace,
|
|
413
|
+
path: d,
|
|
414
414
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
415
|
-
value:
|
|
415
|
+
value: Be(o[f])
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
|
-
for (let
|
|
419
|
-
const c =
|
|
418
|
+
for (let f = o.length; f < u.length; f += 1) {
|
|
419
|
+
const c = t.concat([f]), d = _e(c, i);
|
|
420
420
|
n.push({
|
|
421
|
-
op:
|
|
422
|
-
path:
|
|
421
|
+
op: B.Add,
|
|
422
|
+
path: d,
|
|
423
423
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
424
|
-
value:
|
|
424
|
+
value: Be(u[f])
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
|
-
if (
|
|
428
|
-
const { arrayLengthAssignment:
|
|
429
|
-
if (
|
|
430
|
-
const c =
|
|
427
|
+
if (o.length < u.length) {
|
|
428
|
+
const { arrayLengthAssignment: f = !0 } = a.enablePatches;
|
|
429
|
+
if (f) {
|
|
430
|
+
const c = t.concat(["length"]), d = _e(c, i);
|
|
431
431
|
s.push({
|
|
432
|
-
op:
|
|
433
|
-
path:
|
|
434
|
-
value:
|
|
432
|
+
op: B.Replace,
|
|
433
|
+
path: d,
|
|
434
|
+
value: o.length
|
|
435
435
|
});
|
|
436
436
|
} else
|
|
437
|
-
for (let c =
|
|
438
|
-
const
|
|
437
|
+
for (let c = u.length; o.length < c; c -= 1) {
|
|
438
|
+
const d = t.concat([c - 1]), y = _e(d, i);
|
|
439
439
|
s.push({
|
|
440
|
-
op:
|
|
441
|
-
path:
|
|
440
|
+
op: B.Remove,
|
|
441
|
+
path: y
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
n.forEach((
|
|
448
|
-
const
|
|
449
|
-
if (
|
|
446
|
+
function Hn({ original: e, copy: t, assignedMap: n }, s, i, o, r) {
|
|
447
|
+
n.forEach((a, u) => {
|
|
448
|
+
const f = pe(e, u), c = Be(pe(t, u)), d = a ? Ie(e, u) ? B.Replace : B.Add : B.Remove;
|
|
449
|
+
if (le(f, c) && d === B.Replace)
|
|
450
450
|
return;
|
|
451
|
-
const
|
|
452
|
-
i.push(
|
|
451
|
+
const y = s.concat(u), w = _e(y, r);
|
|
452
|
+
i.push(d === B.Remove ? { op: d, path: w } : { op: d, path: w, value: c }), o.push(d === B.Add ? { op: B.Remove, path: w } : d === B.Remove ? { op: B.Add, path: w, value: f } : { op: B.Replace, path: w, value: f });
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Nn({ original: e, copy: t }, n, s, i, o) {
|
|
456
456
|
let r = 0;
|
|
457
|
-
|
|
458
|
-
if (!
|
|
459
|
-
const
|
|
457
|
+
e.forEach((a) => {
|
|
458
|
+
if (!t.has(a)) {
|
|
459
|
+
const u = n.concat([r]), f = _e(u, o);
|
|
460
460
|
s.push({
|
|
461
|
-
op:
|
|
462
|
-
path:
|
|
463
|
-
value:
|
|
461
|
+
op: B.Remove,
|
|
462
|
+
path: f,
|
|
463
|
+
value: a
|
|
464
464
|
}), i.unshift({
|
|
465
|
-
op:
|
|
466
|
-
path:
|
|
467
|
-
value:
|
|
465
|
+
op: B.Add,
|
|
466
|
+
path: f,
|
|
467
|
+
value: a
|
|
468
468
|
});
|
|
469
469
|
}
|
|
470
470
|
r += 1;
|
|
471
|
-
}), r = 0,
|
|
472
|
-
if (!
|
|
473
|
-
const
|
|
471
|
+
}), r = 0, t.forEach((a) => {
|
|
472
|
+
if (!e.has(a)) {
|
|
473
|
+
const u = n.concat([r]), f = _e(u, o);
|
|
474
474
|
s.push({
|
|
475
|
-
op:
|
|
476
|
-
path:
|
|
477
|
-
value:
|
|
475
|
+
op: B.Add,
|
|
476
|
+
path: f,
|
|
477
|
+
value: a
|
|
478
478
|
}), i.unshift({
|
|
479
|
-
op:
|
|
480
|
-
path:
|
|
481
|
-
value:
|
|
479
|
+
op: B.Remove,
|
|
480
|
+
path: f,
|
|
481
|
+
value: a
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
r += 1;
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
const { pathAsArray: i = !0 } =
|
|
489
|
-
switch (
|
|
487
|
+
function $e(e, t, n, s) {
|
|
488
|
+
const { pathAsArray: i = !0 } = e.options.enablePatches;
|
|
489
|
+
switch (e.type) {
|
|
490
490
|
case 0:
|
|
491
491
|
case 2:
|
|
492
|
-
return
|
|
492
|
+
return Hn(e, t, n, s, i);
|
|
493
493
|
case 1:
|
|
494
|
-
return
|
|
494
|
+
return Dn(e, t, n, s, i);
|
|
495
495
|
case 3:
|
|
496
|
-
return
|
|
496
|
+
return Nn(e, t, n, s, i);
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
let
|
|
500
|
-
const
|
|
501
|
-
if (typeof
|
|
499
|
+
let kn = !1;
|
|
500
|
+
const Fe = (e, t, n = !1) => {
|
|
501
|
+
if (typeof e == "object" && e !== null && (!ee(e, t) || n) && !kn)
|
|
502
502
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
503
|
-
},
|
|
503
|
+
}, at = {
|
|
504
504
|
get size() {
|
|
505
|
-
return
|
|
505
|
+
return Q($(this)).size;
|
|
506
506
|
},
|
|
507
|
-
has(
|
|
508
|
-
return
|
|
507
|
+
has(e) {
|
|
508
|
+
return Q($(this)).has(e);
|
|
509
509
|
},
|
|
510
|
-
set(
|
|
511
|
-
const n =
|
|
512
|
-
return (!s.has(
|
|
510
|
+
set(e, t) {
|
|
511
|
+
const n = $(this), s = Q(n);
|
|
512
|
+
return (!s.has(e) || !le(s.get(e), t)) && (K(n), oe(n), n.assignedMap.set(e, !0), n.copy.set(e, t), gt(n, e, t, $e)), this;
|
|
513
513
|
},
|
|
514
|
-
delete(
|
|
515
|
-
if (!this.has(
|
|
514
|
+
delete(e) {
|
|
515
|
+
if (!this.has(e))
|
|
516
516
|
return !1;
|
|
517
|
-
const
|
|
518
|
-
return
|
|
517
|
+
const t = $(this);
|
|
518
|
+
return K(t), oe(t), t.original.has(e) ? t.assignedMap.set(e, !1) : t.assignedMap.delete(e), t.copy.delete(e), !0;
|
|
519
519
|
},
|
|
520
520
|
clear() {
|
|
521
|
-
const
|
|
521
|
+
const e = $(this);
|
|
522
522
|
if (this.size) {
|
|
523
|
-
|
|
524
|
-
for (const [
|
|
525
|
-
|
|
526
|
-
|
|
523
|
+
K(e), oe(e), e.assignedMap = /* @__PURE__ */ new Map();
|
|
524
|
+
for (const [t] of e.original)
|
|
525
|
+
e.assignedMap.set(t, !1);
|
|
526
|
+
e.copy.clear();
|
|
527
527
|
}
|
|
528
528
|
},
|
|
529
|
-
forEach(
|
|
530
|
-
const n =
|
|
531
|
-
|
|
532
|
-
|
|
529
|
+
forEach(e, t) {
|
|
530
|
+
const n = $(this);
|
|
531
|
+
Q(n).forEach((s, i) => {
|
|
532
|
+
e.call(t, this.get(i), i, this);
|
|
533
533
|
});
|
|
534
534
|
},
|
|
535
|
-
get(
|
|
536
|
-
var
|
|
537
|
-
const s =
|
|
538
|
-
if (s.options.strict &&
|
|
535
|
+
get(e) {
|
|
536
|
+
var t, n;
|
|
537
|
+
const s = $(this), i = Q(s).get(e), o = ((n = (t = s.options).mark) === null || n === void 0 ? void 0 : n.call(t, i, Y)) === Y.mutable;
|
|
538
|
+
if (s.options.strict && Fe(i, s.options, o), o || s.finalized || !ee(i, s.options) || i !== s.original.get(e))
|
|
539
539
|
return i;
|
|
540
|
-
const r =
|
|
540
|
+
const r = mt.createDraft({
|
|
541
541
|
original: i,
|
|
542
542
|
parentDraft: s,
|
|
543
|
-
key:
|
|
543
|
+
key: e,
|
|
544
544
|
finalities: s.finalities,
|
|
545
545
|
options: s.options
|
|
546
546
|
});
|
|
547
|
-
return
|
|
547
|
+
return K(s), s.copy.set(e, r), r;
|
|
548
548
|
},
|
|
549
549
|
keys() {
|
|
550
|
-
return
|
|
550
|
+
return Q($(this)).keys();
|
|
551
551
|
},
|
|
552
552
|
values() {
|
|
553
|
-
const
|
|
553
|
+
const e = this.keys();
|
|
554
554
|
return {
|
|
555
|
-
[
|
|
555
|
+
[Ue]: () => this.values(),
|
|
556
556
|
next: () => {
|
|
557
|
-
const
|
|
558
|
-
return
|
|
557
|
+
const t = e.next();
|
|
558
|
+
return t.done ? t : {
|
|
559
559
|
done: !1,
|
|
560
|
-
value: this.get(
|
|
560
|
+
value: this.get(t.value)
|
|
561
561
|
};
|
|
562
562
|
}
|
|
563
563
|
};
|
|
564
564
|
},
|
|
565
565
|
entries() {
|
|
566
|
-
const
|
|
566
|
+
const e = this.keys();
|
|
567
567
|
return {
|
|
568
|
-
[
|
|
568
|
+
[Ue]: () => this.entries(),
|
|
569
569
|
next: () => {
|
|
570
|
-
const
|
|
571
|
-
if (
|
|
572
|
-
return
|
|
573
|
-
const n = this.get(
|
|
570
|
+
const t = e.next();
|
|
571
|
+
if (t.done)
|
|
572
|
+
return t;
|
|
573
|
+
const n = this.get(t.value);
|
|
574
574
|
return {
|
|
575
575
|
done: !1,
|
|
576
|
-
value: [
|
|
576
|
+
value: [t.value, n]
|
|
577
577
|
};
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
580
|
},
|
|
581
|
-
[
|
|
581
|
+
[Ue]() {
|
|
582
582
|
return this.entries();
|
|
583
583
|
}
|
|
584
|
-
},
|
|
584
|
+
}, jn = Reflect.ownKeys(at), Tt = (e, t, { isValuesIterator: n }) => () => {
|
|
585
585
|
var s, i;
|
|
586
|
-
const
|
|
587
|
-
if (
|
|
588
|
-
return
|
|
589
|
-
const r =
|
|
590
|
-
let
|
|
591
|
-
const
|
|
592
|
-
if (
|
|
593
|
-
const c =
|
|
586
|
+
const o = t.next();
|
|
587
|
+
if (o.done)
|
|
588
|
+
return o;
|
|
589
|
+
const r = o.value;
|
|
590
|
+
let a = e.setMap.get(r);
|
|
591
|
+
const u = $(a), f = ((i = (s = e.options).mark) === null || i === void 0 ? void 0 : i.call(s, a, Y)) === Y.mutable;
|
|
592
|
+
if (e.options.strict && Fe(r, e.options, f), !f && !u && ee(r, e.options) && !e.finalized && e.original.has(r)) {
|
|
593
|
+
const c = mt.createDraft({
|
|
594
594
|
original: r,
|
|
595
|
-
parentDraft:
|
|
595
|
+
parentDraft: e,
|
|
596
596
|
key: r,
|
|
597
|
-
finalities:
|
|
598
|
-
options:
|
|
597
|
+
finalities: e.finalities,
|
|
598
|
+
options: e.options
|
|
599
599
|
});
|
|
600
|
-
|
|
600
|
+
e.setMap.set(r, c), a = c;
|
|
601
601
|
} else
|
|
602
|
-
|
|
602
|
+
u && (a = u.proxy);
|
|
603
603
|
return {
|
|
604
604
|
done: !1,
|
|
605
|
-
value: n ?
|
|
605
|
+
value: n ? a : [a, a]
|
|
606
606
|
};
|
|
607
|
-
},
|
|
607
|
+
}, ut = {
|
|
608
608
|
get size() {
|
|
609
|
-
return
|
|
609
|
+
return $(this).setMap.size;
|
|
610
610
|
},
|
|
611
|
-
has(
|
|
612
|
-
const
|
|
613
|
-
if (
|
|
611
|
+
has(e) {
|
|
612
|
+
const t = $(this);
|
|
613
|
+
if (t.setMap.has(e))
|
|
614
614
|
return !0;
|
|
615
|
-
|
|
616
|
-
const n =
|
|
617
|
-
return !!(n &&
|
|
615
|
+
K(t);
|
|
616
|
+
const n = $(e);
|
|
617
|
+
return !!(n && t.setMap.has(n.original));
|
|
618
618
|
},
|
|
619
|
-
add(
|
|
620
|
-
const
|
|
621
|
-
return this.has(
|
|
619
|
+
add(e) {
|
|
620
|
+
const t = $(this);
|
|
621
|
+
return this.has(e) || (K(t), oe(t), t.assignedMap.set(e, !0), t.setMap.set(e, e), gt(t, e, e, $e)), this;
|
|
622
622
|
},
|
|
623
|
-
delete(
|
|
624
|
-
if (!this.has(
|
|
623
|
+
delete(e) {
|
|
624
|
+
if (!this.has(e))
|
|
625
625
|
return !1;
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
const n =
|
|
629
|
-
return n &&
|
|
626
|
+
const t = $(this);
|
|
627
|
+
K(t), oe(t);
|
|
628
|
+
const n = $(e);
|
|
629
|
+
return n && t.setMap.has(n.original) ? (t.assignedMap.set(n.original, !1), t.setMap.delete(n.original)) : (!n && t.setMap.has(e) ? t.assignedMap.set(e, !1) : t.assignedMap.delete(e), t.setMap.delete(e));
|
|
630
630
|
},
|
|
631
631
|
clear() {
|
|
632
632
|
if (!this.size)
|
|
633
633
|
return;
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
for (const
|
|
637
|
-
|
|
638
|
-
|
|
634
|
+
const e = $(this);
|
|
635
|
+
K(e), oe(e);
|
|
636
|
+
for (const t of e.original)
|
|
637
|
+
e.assignedMap.set(t, !1);
|
|
638
|
+
e.setMap.clear();
|
|
639
639
|
},
|
|
640
640
|
values() {
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
const
|
|
641
|
+
const e = $(this);
|
|
642
|
+
K(e);
|
|
643
|
+
const t = e.setMap.keys();
|
|
644
644
|
return {
|
|
645
645
|
[Symbol.iterator]: () => this.values(),
|
|
646
|
-
next:
|
|
646
|
+
next: Tt(e, t, { isValuesIterator: !0 })
|
|
647
647
|
};
|
|
648
648
|
},
|
|
649
649
|
entries() {
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
const
|
|
650
|
+
const e = $(this);
|
|
651
|
+
K(e);
|
|
652
|
+
const t = e.setMap.keys();
|
|
653
653
|
return {
|
|
654
654
|
[Symbol.iterator]: () => this.entries(),
|
|
655
|
-
next:
|
|
655
|
+
next: Tt(e, t, {
|
|
656
656
|
isValuesIterator: !1
|
|
657
657
|
})
|
|
658
658
|
};
|
|
@@ -660,99 +660,99 @@ const ue = (t, e, n = !1) => {
|
|
|
660
660
|
keys() {
|
|
661
661
|
return this.values();
|
|
662
662
|
},
|
|
663
|
-
[
|
|
663
|
+
[Ue]() {
|
|
664
664
|
return this.values();
|
|
665
665
|
},
|
|
666
|
-
forEach(
|
|
666
|
+
forEach(e, t) {
|
|
667
667
|
const n = this.values();
|
|
668
668
|
let s = n.next();
|
|
669
669
|
for (; !s.done; )
|
|
670
|
-
|
|
670
|
+
e.call(t, s.value, s.value, this), s = n.next();
|
|
671
671
|
}
|
|
672
|
-
},
|
|
673
|
-
get(
|
|
672
|
+
}, Un = Reflect.ownKeys(ut), Qt = /* @__PURE__ */ new WeakSet(), Yt = {
|
|
673
|
+
get(e, t, n) {
|
|
674
674
|
var s, i;
|
|
675
|
-
const
|
|
676
|
-
if (
|
|
677
|
-
return
|
|
678
|
-
if (
|
|
679
|
-
return
|
|
675
|
+
const o = (s = e.copy) === null || s === void 0 ? void 0 : s[t];
|
|
676
|
+
if (o && Qt.has(o))
|
|
677
|
+
return o;
|
|
678
|
+
if (t === Wt)
|
|
679
|
+
return e;
|
|
680
680
|
let r;
|
|
681
|
-
if (
|
|
682
|
-
const
|
|
683
|
-
if (r =
|
|
684
|
-
return
|
|
685
|
-
}
|
|
686
|
-
const
|
|
687
|
-
if (
|
|
688
|
-
if (
|
|
689
|
-
return Object.getOwnPropertyDescriptor(
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
return
|
|
693
|
-
}
|
|
694
|
-
if (
|
|
695
|
-
if (
|
|
696
|
-
return Object.getOwnPropertyDescriptor(
|
|
697
|
-
const
|
|
698
|
-
if (
|
|
699
|
-
return
|
|
700
|
-
}
|
|
701
|
-
if (!
|
|
702
|
-
const
|
|
703
|
-
return
|
|
681
|
+
if (e.options.mark) {
|
|
682
|
+
const f = t === "size" && (e.original instanceof Map || e.original instanceof Set) ? Reflect.get(e.original, t) : Reflect.get(e.original, t, n);
|
|
683
|
+
if (r = e.options.mark(f, Y), r === Y.mutable)
|
|
684
|
+
return e.options.strict && Fe(f, e.options, !0), f;
|
|
685
|
+
}
|
|
686
|
+
const a = Q(e);
|
|
687
|
+
if (a instanceof Map && jn.includes(t)) {
|
|
688
|
+
if (t === "size")
|
|
689
|
+
return Object.getOwnPropertyDescriptor(at, "size").get.call(e.proxy);
|
|
690
|
+
const f = at[t];
|
|
691
|
+
if (f)
|
|
692
|
+
return f.bind(e.proxy);
|
|
693
|
+
}
|
|
694
|
+
if (a instanceof Set && Un.includes(t)) {
|
|
695
|
+
if (t === "size")
|
|
696
|
+
return Object.getOwnPropertyDescriptor(ut, "size").get.call(e.proxy);
|
|
697
|
+
const f = ut[t];
|
|
698
|
+
if (f)
|
|
699
|
+
return f.bind(e.proxy);
|
|
700
|
+
}
|
|
701
|
+
if (!Ie(a, t)) {
|
|
702
|
+
const f = Lt(a, t);
|
|
703
|
+
return f ? "value" in f ? f.value : (
|
|
704
704
|
// !case: support for getter
|
|
705
|
-
(i =
|
|
705
|
+
(i = f.get) === null || i === void 0 ? void 0 : i.call(e.proxy)
|
|
706
706
|
) : void 0;
|
|
707
707
|
}
|
|
708
|
-
const
|
|
709
|
-
if (
|
|
710
|
-
return
|
|
711
|
-
if (
|
|
712
|
-
if (
|
|
713
|
-
original:
|
|
714
|
-
parentDraft:
|
|
715
|
-
key:
|
|
716
|
-
finalities:
|
|
717
|
-
options:
|
|
708
|
+
const u = a[t];
|
|
709
|
+
if (e.options.strict && Fe(u, e.options), e.finalized || !ee(u, e.options))
|
|
710
|
+
return u;
|
|
711
|
+
if (u === Ye(e.original, t)) {
|
|
712
|
+
if (K(e), e.copy[t] = bt({
|
|
713
|
+
original: e.original[t],
|
|
714
|
+
parentDraft: e,
|
|
715
|
+
key: e.type === 1 ? Number(t) : t,
|
|
716
|
+
finalities: e.finalities,
|
|
717
|
+
options: e.options
|
|
718
718
|
}), typeof r == "function") {
|
|
719
|
-
const
|
|
720
|
-
return
|
|
719
|
+
const f = $(e.copy[t]);
|
|
720
|
+
return K(f), oe(f), f.copy;
|
|
721
721
|
}
|
|
722
|
-
return
|
|
722
|
+
return e.copy[t];
|
|
723
723
|
}
|
|
724
|
-
return
|
|
724
|
+
return u;
|
|
725
725
|
},
|
|
726
|
-
set(
|
|
726
|
+
set(e, t, n) {
|
|
727
727
|
var s;
|
|
728
|
-
if (
|
|
728
|
+
if (e.type === 3 || e.type === 2)
|
|
729
729
|
throw new Error("Map/Set draft does not support any property assignment.");
|
|
730
730
|
let i;
|
|
731
|
-
if (
|
|
731
|
+
if (e.type === 1 && t !== "length" && !(Number.isInteger(i = Number(t)) && i >= 0 && (t === 0 || i === 0 || String(i) === String(t))))
|
|
732
732
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
733
|
-
const
|
|
734
|
-
if (
|
|
735
|
-
return
|
|
736
|
-
const r =
|
|
737
|
-
return
|
|
733
|
+
const o = Lt(Q(e), t);
|
|
734
|
+
if (o != null && o.set)
|
|
735
|
+
return o.set.call(e.proxy, n), !0;
|
|
736
|
+
const r = Ye(Q(e), t), a = $(r);
|
|
737
|
+
return a && le(a.original, n) ? (e.copy[t] = n, e.assignedMap = (s = e.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), e.assignedMap.set(t, !1), !0) : (le(n, r) && (n !== void 0 || Ie(e.original, t)) || (K(e), oe(e), Ie(e.original, t) && le(n, e.original[t]) ? e.assignedMap.delete(t) : e.assignedMap.set(t, !0), e.copy[t] = n, gt(e, t, n, $e)), !0);
|
|
738
738
|
},
|
|
739
|
-
has(
|
|
740
|
-
return
|
|
739
|
+
has(e, t) {
|
|
740
|
+
return t in Q(e);
|
|
741
741
|
},
|
|
742
|
-
ownKeys(
|
|
743
|
-
return Reflect.ownKeys(
|
|
742
|
+
ownKeys(e) {
|
|
743
|
+
return Reflect.ownKeys(Q(e));
|
|
744
744
|
},
|
|
745
|
-
getOwnPropertyDescriptor(
|
|
746
|
-
const n =
|
|
745
|
+
getOwnPropertyDescriptor(e, t) {
|
|
746
|
+
const n = Q(e), s = Reflect.getOwnPropertyDescriptor(n, t);
|
|
747
747
|
return s && {
|
|
748
748
|
writable: !0,
|
|
749
|
-
configurable:
|
|
749
|
+
configurable: e.type !== 1 || t !== "length",
|
|
750
750
|
enumerable: s.enumerable,
|
|
751
|
-
value: n[
|
|
751
|
+
value: n[t]
|
|
752
752
|
};
|
|
753
753
|
},
|
|
754
|
-
getPrototypeOf(
|
|
755
|
-
return Reflect.getPrototypeOf(
|
|
754
|
+
getPrototypeOf(e) {
|
|
755
|
+
return Reflect.getPrototypeOf(e.original);
|
|
756
756
|
},
|
|
757
757
|
setPrototypeOf() {
|
|
758
758
|
throw new Error("Cannot call 'setPrototypeOf()' on drafts");
|
|
@@ -760,702 +760,816 @@ const ue = (t, e, n = !1) => {
|
|
|
760
760
|
defineProperty() {
|
|
761
761
|
throw new Error("Cannot call 'defineProperty()' on drafts");
|
|
762
762
|
},
|
|
763
|
-
deleteProperty(
|
|
763
|
+
deleteProperty(e, t) {
|
|
764
764
|
var n;
|
|
765
|
-
return
|
|
765
|
+
return e.type === 1 ? Yt.set.call(this, e, t, void 0, e.proxy) : (Ye(e.original, t) !== void 0 || t in e.original ? (K(e), oe(e), e.assignedMap.set(t, !1)) : (e.assignedMap = (n = e.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), e.assignedMap.delete(t)), e.copy && delete e.copy[t], !0);
|
|
766
766
|
}
|
|
767
767
|
};
|
|
768
|
-
function
|
|
769
|
-
const { original:
|
|
768
|
+
function bt(e) {
|
|
769
|
+
const { original: t, parentDraft: n, key: s, finalities: i, options: o } = e, r = be(t), a = {
|
|
770
770
|
type: r,
|
|
771
771
|
finalized: !1,
|
|
772
772
|
parent: n,
|
|
773
|
-
original:
|
|
773
|
+
original: t,
|
|
774
774
|
copy: null,
|
|
775
775
|
proxy: null,
|
|
776
776
|
finalities: i,
|
|
777
|
-
options:
|
|
777
|
+
options: o,
|
|
778
778
|
// Mapping of draft Set items to their corresponding draft values.
|
|
779
|
-
setMap: r === 3 ? new Map(
|
|
779
|
+
setMap: r === 3 ? new Map(t.entries()) : void 0
|
|
780
780
|
};
|
|
781
|
-
(s || "key" in
|
|
782
|
-
const { proxy:
|
|
783
|
-
if (i.revoke.push(
|
|
781
|
+
(s || "key" in e) && (a.key = s);
|
|
782
|
+
const { proxy: u, revoke: f } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, Yt);
|
|
783
|
+
if (i.revoke.push(f), Qt.add(u), a.proxy = u, n) {
|
|
784
784
|
const c = n;
|
|
785
|
-
c.finalities.draft.push((
|
|
786
|
-
var
|
|
787
|
-
const
|
|
788
|
-
let
|
|
789
|
-
const
|
|
790
|
-
if (
|
|
791
|
-
let
|
|
792
|
-
|
|
793
|
-
}
|
|
794
|
-
(_ =
|
|
795
|
-
|
|
785
|
+
c.finalities.draft.push((d, y) => {
|
|
786
|
+
var w, _;
|
|
787
|
+
const S = $(u);
|
|
788
|
+
let v = c.type === 3 ? c.setMap : c.copy;
|
|
789
|
+
const x = pe(v, s), b = $(x);
|
|
790
|
+
if (b) {
|
|
791
|
+
let A = b.original;
|
|
792
|
+
b.operated && (A = yt(x)), rt(b), ot(b, $e, d, y), c.options.enableAutoFreeze && (c.options.updatedValues = (w = c.options.updatedValues) !== null && w !== void 0 ? w : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(A, b.original)), Le(v, s, A);
|
|
793
|
+
}
|
|
794
|
+
(_ = S.callbacks) === null || _ === void 0 || _.forEach((A) => {
|
|
795
|
+
A(d, y);
|
|
796
796
|
});
|
|
797
797
|
});
|
|
798
798
|
} else {
|
|
799
|
-
const c =
|
|
800
|
-
c.finalities.draft.push((
|
|
801
|
-
|
|
799
|
+
const c = $(u);
|
|
800
|
+
c.finalities.draft.push((d, y) => {
|
|
801
|
+
rt(c), ot(c, $e, d, y);
|
|
802
802
|
});
|
|
803
803
|
}
|
|
804
|
-
return
|
|
804
|
+
return u;
|
|
805
805
|
}
|
|
806
|
-
|
|
807
|
-
function
|
|
808
|
-
var
|
|
809
|
-
const r =
|
|
806
|
+
mt.createDraft = bt;
|
|
807
|
+
function Bn(e, t, n, s, i) {
|
|
808
|
+
var o;
|
|
809
|
+
const r = $(e), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : e, u = !!t.length;
|
|
810
810
|
if (r != null && r.operated)
|
|
811
811
|
for (; r.finalities.draft.length > 0; )
|
|
812
812
|
r.finalities.draft.pop()(n, s);
|
|
813
|
-
const
|
|
814
|
-
return r &&
|
|
815
|
-
|
|
816
|
-
n &&
|
|
817
|
-
s &&
|
|
813
|
+
const f = u ? t[0] : r ? r.operated ? r.copy : r.original : e;
|
|
814
|
+
return r && it(r), i && we(f, f, r == null ? void 0 : r.options.updatedValues), [
|
|
815
|
+
f,
|
|
816
|
+
n && u ? [{ op: B.Replace, path: [], value: t[0] }] : n,
|
|
817
|
+
s && u ? [{ op: B.Replace, path: [], value: a }] : s
|
|
818
818
|
];
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Fn(e, t) {
|
|
821
821
|
var n;
|
|
822
822
|
const s = {
|
|
823
823
|
draft: [],
|
|
824
824
|
revoke: [],
|
|
825
825
|
handledSet: /* @__PURE__ */ new WeakSet()
|
|
826
826
|
};
|
|
827
|
-
let i,
|
|
828
|
-
|
|
829
|
-
const
|
|
830
|
-
original:
|
|
827
|
+
let i, o;
|
|
828
|
+
t.enablePatches && (i = [], o = []);
|
|
829
|
+
const a = ((n = t.mark) === null || n === void 0 ? void 0 : n.call(t, e, Y)) === Y.mutable || !ee(e, t) ? e : bt({
|
|
830
|
+
original: e,
|
|
831
831
|
parentDraft: null,
|
|
832
832
|
finalities: s,
|
|
833
|
-
options:
|
|
833
|
+
options: t
|
|
834
834
|
});
|
|
835
835
|
return [
|
|
836
|
-
|
|
837
|
-
(
|
|
838
|
-
const [
|
|
839
|
-
return
|
|
836
|
+
a,
|
|
837
|
+
(u = []) => {
|
|
838
|
+
const [f, c, d] = Bn(a, u, i, o, t.enableAutoFreeze);
|
|
839
|
+
return t.enablePatches ? [f, c, d] : f;
|
|
840
840
|
}
|
|
841
841
|
];
|
|
842
842
|
}
|
|
843
|
-
function
|
|
844
|
-
const { rootDraft:
|
|
845
|
-
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
848
|
-
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
851
|
-
const c = Array.from(
|
|
852
|
-
|
|
843
|
+
function ct(e) {
|
|
844
|
+
const { rootDraft: t, value: n, useRawReturn: s = !1, isRoot: i = !0 } = e;
|
|
845
|
+
_t(n, (o, r, a) => {
|
|
846
|
+
const u = $(r);
|
|
847
|
+
if (u && t && u.finalities === t.finalities) {
|
|
848
|
+
e.isContainDraft = !0;
|
|
849
|
+
const f = u.original;
|
|
850
|
+
if (a instanceof Set) {
|
|
851
|
+
const c = Array.from(a);
|
|
852
|
+
a.clear(), c.forEach((d) => a.add(o === d ? f : d));
|
|
853
853
|
} else
|
|
854
|
-
|
|
854
|
+
Le(a, o, f);
|
|
855
855
|
} else
|
|
856
|
-
typeof r == "object" && r !== null && (
|
|
857
|
-
}), i && (
|
|
856
|
+
typeof r == "object" && r !== null && (e.value = r, e.isRoot = !1, ct(e));
|
|
857
|
+
}), i && (e.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), s && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
|
|
858
858
|
}
|
|
859
|
-
function
|
|
860
|
-
const
|
|
861
|
-
if (!
|
|
862
|
-
return
|
|
863
|
-
const n =
|
|
864
|
-
if (
|
|
865
|
-
return
|
|
859
|
+
function Zt(e) {
|
|
860
|
+
const t = $(e);
|
|
861
|
+
if (!ee(e, t == null ? void 0 : t.options))
|
|
862
|
+
return e;
|
|
863
|
+
const n = be(e);
|
|
864
|
+
if (t && !t.operated)
|
|
865
|
+
return t.original;
|
|
866
866
|
let s;
|
|
867
867
|
function i() {
|
|
868
|
-
s = n === 2 ? new Map(
|
|
868
|
+
s = n === 2 ? new Map(e) : n === 3 ? Array.from(t.setMap.values()) : Xt(e, t == null ? void 0 : t.options);
|
|
869
869
|
}
|
|
870
|
-
if (
|
|
871
|
-
|
|
870
|
+
if (t) {
|
|
871
|
+
t.finalized = !0;
|
|
872
872
|
try {
|
|
873
873
|
i();
|
|
874
874
|
} finally {
|
|
875
|
-
|
|
875
|
+
t.finalized = !1;
|
|
876
876
|
}
|
|
877
877
|
} else
|
|
878
|
-
s =
|
|
879
|
-
return
|
|
880
|
-
if (
|
|
878
|
+
s = e;
|
|
879
|
+
return _t(s, (o, r) => {
|
|
880
|
+
if (t && le(pe(t.original, o), r))
|
|
881
881
|
return;
|
|
882
|
-
const
|
|
883
|
-
|
|
882
|
+
const a = Zt(r);
|
|
883
|
+
a !== r && (s === e && i(), Le(s, o, a));
|
|
884
884
|
}), n === 3 ? new Set(s) : s;
|
|
885
885
|
}
|
|
886
|
-
function
|
|
887
|
-
if (!
|
|
888
|
-
throw new Error(`current() is only used for Draft, parameter: ${
|
|
889
|
-
return
|
|
886
|
+
function Dt(e) {
|
|
887
|
+
if (!ge(e))
|
|
888
|
+
throw new Error(`current() is only used for Draft, parameter: ${e}`);
|
|
889
|
+
return Zt(e);
|
|
890
890
|
}
|
|
891
|
-
const
|
|
892
|
-
if (
|
|
893
|
-
throw new Error(`Invalid options: ${String(
|
|
894
|
-
return function
|
|
895
|
-
var
|
|
891
|
+
const zn = (e) => {
|
|
892
|
+
if (e !== void 0 && Object.prototype.toString.call(e) !== "[object Object]")
|
|
893
|
+
throw new Error(`Invalid options: ${String(e)}, 'options' should be an object.`);
|
|
894
|
+
return function t(n, s, i) {
|
|
895
|
+
var o, r, a;
|
|
896
896
|
if (typeof n == "function" && typeof s != "function")
|
|
897
|
-
return function(
|
|
898
|
-
return
|
|
897
|
+
return function(R, ...D) {
|
|
898
|
+
return t(R, (O) => n.call(this, O, ...D), s);
|
|
899
899
|
};
|
|
900
|
-
const
|
|
900
|
+
const u = n, f = s;
|
|
901
901
|
let c = i;
|
|
902
902
|
if (typeof s != "function" && (c = s), c !== void 0 && Object.prototype.toString.call(c) !== "[object Object]")
|
|
903
903
|
throw new Error(`Invalid options: ${c}, 'options' should be an object.`);
|
|
904
|
-
c = Object.assign(Object.assign({},
|
|
905
|
-
const
|
|
906
|
-
for (const
|
|
907
|
-
if (typeof
|
|
908
|
-
throw new Error(`Invalid mark: ${
|
|
909
|
-
const
|
|
910
|
-
if (
|
|
911
|
-
return
|
|
912
|
-
}
|
|
913
|
-
} : c.mark,
|
|
914
|
-
enableAutoFreeze: (
|
|
915
|
-
mark:
|
|
904
|
+
c = Object.assign(Object.assign({}, e), c);
|
|
905
|
+
const d = ge(u) ? Dt(u) : u, y = Array.isArray(c.mark) ? (R, D) => {
|
|
906
|
+
for (const O of c.mark) {
|
|
907
|
+
if (typeof O != "function")
|
|
908
|
+
throw new Error(`Invalid mark: ${O}, 'mark' should be a function.`);
|
|
909
|
+
const L = O(R, D);
|
|
910
|
+
if (L)
|
|
911
|
+
return L;
|
|
912
|
+
}
|
|
913
|
+
} : c.mark, w = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, _ = (r = c.strict) !== null && r !== void 0 ? r : !1, v = {
|
|
914
|
+
enableAutoFreeze: (a = c.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
|
|
915
|
+
mark: y,
|
|
916
916
|
strict: _,
|
|
917
|
-
enablePatches:
|
|
917
|
+
enablePatches: w
|
|
918
918
|
};
|
|
919
|
-
if (!
|
|
919
|
+
if (!ee(d, v) && typeof d == "object" && d !== null)
|
|
920
920
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
921
|
-
const [
|
|
921
|
+
const [x, b] = Fn(d, v);
|
|
922
922
|
if (typeof s != "function") {
|
|
923
|
-
if (!
|
|
923
|
+
if (!ee(d, v))
|
|
924
924
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
925
|
-
return [
|
|
925
|
+
return [x, b];
|
|
926
926
|
}
|
|
927
|
-
let
|
|
927
|
+
let A;
|
|
928
928
|
try {
|
|
929
|
-
|
|
930
|
-
} catch (
|
|
931
|
-
throw
|
|
932
|
-
}
|
|
933
|
-
const
|
|
934
|
-
const
|
|
935
|
-
if (!
|
|
936
|
-
if (
|
|
929
|
+
A = f(x);
|
|
930
|
+
} catch (R) {
|
|
931
|
+
throw it($(x)), R;
|
|
932
|
+
}
|
|
933
|
+
const M = (R) => {
|
|
934
|
+
const D = $(x);
|
|
935
|
+
if (!ge(R)) {
|
|
936
|
+
if (R !== void 0 && !le(R, x) && (D != null && D.operated))
|
|
937
937
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
938
|
-
const
|
|
939
|
-
if (
|
|
940
|
-
const
|
|
941
|
-
return
|
|
942
|
-
rootDraft:
|
|
943
|
-
value:
|
|
938
|
+
const L = R == null ? void 0 : R[$n];
|
|
939
|
+
if (L) {
|
|
940
|
+
const z = L[0];
|
|
941
|
+
return v.strict && typeof R == "object" && R !== null && ct({
|
|
942
|
+
rootDraft: D,
|
|
943
|
+
value: R,
|
|
944
944
|
useRawReturn: !0
|
|
945
|
-
}),
|
|
945
|
+
}), b([z]);
|
|
946
946
|
}
|
|
947
|
-
if (
|
|
948
|
-
return typeof
|
|
949
|
-
}
|
|
950
|
-
if (
|
|
951
|
-
return
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
954
|
-
if (
|
|
947
|
+
if (R !== void 0)
|
|
948
|
+
return typeof R == "object" && R !== null && ct({ rootDraft: D, value: R }), b([R]);
|
|
949
|
+
}
|
|
950
|
+
if (R === x || R === void 0)
|
|
951
|
+
return b([]);
|
|
952
|
+
const O = $(R);
|
|
953
|
+
if (v === O.options) {
|
|
954
|
+
if (O.operated)
|
|
955
955
|
throw new Error("Cannot return a modified child draft.");
|
|
956
|
-
return
|
|
956
|
+
return b([Dt(R)]);
|
|
957
957
|
}
|
|
958
|
-
return
|
|
958
|
+
return b([R]);
|
|
959
959
|
};
|
|
960
|
-
return
|
|
961
|
-
throw
|
|
962
|
-
}) :
|
|
960
|
+
return A instanceof Promise ? A.then(M, (R) => {
|
|
961
|
+
throw it($(x)), R;
|
|
962
|
+
}) : M(A);
|
|
963
963
|
};
|
|
964
|
-
},
|
|
964
|
+
}, C = zn();
|
|
965
965
|
Object.prototype.constructor.toString();
|
|
966
|
-
const
|
|
967
|
-
if (!
|
|
966
|
+
const Gn = dt(fetch), en = async (e, t) => {
|
|
967
|
+
if (!e)
|
|
968
968
|
throw "Metapage definition null";
|
|
969
|
-
if (!
|
|
969
|
+
if (!e.version)
|
|
970
970
|
throw 'Missing "version" key in metapage definition';
|
|
971
|
-
if (!
|
|
971
|
+
if (!t)
|
|
972
972
|
throw 'Missing "version" argument';
|
|
973
|
-
if (
|
|
973
|
+
if (V(t, Je) > 0)
|
|
974
974
|
try {
|
|
975
|
-
return await (await
|
|
975
|
+
return await (await Gn(`https://module.metapage.io/conversion/metapage/${t}`, {
|
|
976
976
|
redirect: "follow",
|
|
977
977
|
retries: 3,
|
|
978
978
|
retryDelay: 1e3,
|
|
979
979
|
method: "POST",
|
|
980
|
-
body: JSON.stringify(
|
|
980
|
+
body: JSON.stringify(e),
|
|
981
981
|
headers: {
|
|
982
982
|
"Content-Type": "application/json"
|
|
983
983
|
}
|
|
984
984
|
})).json();
|
|
985
985
|
} catch (s) {
|
|
986
|
-
throw `Error converting metapage definition to version ${
|
|
986
|
+
throw `Error converting metapage definition to version ${t}: ${s}`;
|
|
987
987
|
}
|
|
988
|
-
return
|
|
989
|
-
},
|
|
990
|
-
if (!
|
|
988
|
+
return Jn(e, t);
|
|
989
|
+
}, Vn = async (e) => en(e, Je), Jn = (e, t) => {
|
|
990
|
+
if (!e)
|
|
991
991
|
throw "Metapage definition null";
|
|
992
|
-
if (!
|
|
992
|
+
if (!e.version)
|
|
993
993
|
throw 'Missing "version" key in metapage definition';
|
|
994
|
-
let n =
|
|
995
|
-
if (n ===
|
|
996
|
-
return
|
|
997
|
-
let s =
|
|
998
|
-
for (; n !==
|
|
994
|
+
let n = Re(e.version);
|
|
995
|
+
if (n === t)
|
|
996
|
+
return e;
|
|
997
|
+
let s = e;
|
|
998
|
+
for (; n !== t; )
|
|
999
999
|
switch (n) {
|
|
1000
1000
|
case "0.2": {
|
|
1001
|
-
if (
|
|
1002
|
-
s =
|
|
1001
|
+
if (V(t, n) > 0)
|
|
1002
|
+
s = Wn(s), n = Re(s.version);
|
|
1003
1003
|
else
|
|
1004
|
-
throw `Cannot convert from version ${n} to ${
|
|
1004
|
+
throw `Cannot convert from version ${n} to ${t}`;
|
|
1005
1005
|
break;
|
|
1006
1006
|
}
|
|
1007
1007
|
case "0.3": {
|
|
1008
|
-
|
|
1008
|
+
V(t, n) > 0 ? (s = Xn(s), n = Re(s.version)) : (s = Kn(s), n = Re(s.version));
|
|
1009
1009
|
break;
|
|
1010
1010
|
}
|
|
1011
1011
|
case "1": {
|
|
1012
|
-
if (
|
|
1013
|
-
throw `Cannot convert from version ${n} to ${
|
|
1014
|
-
s =
|
|
1012
|
+
if (V(t, n) > 0)
|
|
1013
|
+
throw `Cannot convert from version ${n} to ${t}, 1 is the latest version`;
|
|
1014
|
+
s = qn(s), n = Re(s.version);
|
|
1015
1015
|
break;
|
|
1016
1016
|
}
|
|
1017
1017
|
default:
|
|
1018
|
-
throw `Unknow version ${n} to ${
|
|
1018
|
+
throw `Unknow version ${n} to ${t}`;
|
|
1019
1019
|
}
|
|
1020
1020
|
return s;
|
|
1021
|
-
},
|
|
1022
|
-
|
|
1023
|
-
}),
|
|
1024
|
-
|
|
1025
|
-
}),
|
|
1026
|
-
const n =
|
|
1021
|
+
}, Wn = (e) => C(e, (t) => {
|
|
1022
|
+
t.version = "0.3";
|
|
1023
|
+
}), Kn = (e) => C(e, (t) => {
|
|
1024
|
+
t.version = "0.2";
|
|
1025
|
+
}), Xn = (e) => C(e, (t) => {
|
|
1026
|
+
const n = t;
|
|
1027
1027
|
delete n.plugins, n.version = "1";
|
|
1028
|
-
}),
|
|
1029
|
-
if (
|
|
1030
|
-
return
|
|
1031
|
-
if (
|
|
1032
|
-
throw `Unknown version: ${
|
|
1033
|
-
if (
|
|
1028
|
+
}), qn = (e) => C(e, (t) => (t.version = "0.3", t)), Re = (e) => {
|
|
1029
|
+
if (e === "latest")
|
|
1030
|
+
return Je;
|
|
1031
|
+
if (V(e, "0.2") < 0)
|
|
1032
|
+
throw `Unknown version: ${e}`;
|
|
1033
|
+
if (V(e, "0.2") <= 0 && V(e, "0.3") < 0)
|
|
1034
1034
|
return "0.2";
|
|
1035
|
-
if (
|
|
1035
|
+
if (V(e, "0.3") <= 0)
|
|
1036
1036
|
return "0.3";
|
|
1037
|
-
if (
|
|
1037
|
+
if (e === "1")
|
|
1038
1038
|
return "1";
|
|
1039
|
-
throw `Unknown version: ${
|
|
1040
|
-
},
|
|
1041
|
-
if (!
|
|
1039
|
+
throw `Unknown version: ${e}`;
|
|
1040
|
+
}, Qn = dt(fetch), tn = async (e, t) => {
|
|
1041
|
+
if (!e)
|
|
1042
1042
|
throw "Metapage definition null";
|
|
1043
|
-
if (!
|
|
1043
|
+
if (!e.version)
|
|
1044
1044
|
throw 'Missing "version" key in metapage definition';
|
|
1045
|
-
if (!
|
|
1045
|
+
if (!t)
|
|
1046
1046
|
throw 'Missing "version" argument';
|
|
1047
|
-
if (
|
|
1047
|
+
if (V(t, pt) > 0)
|
|
1048
1048
|
try {
|
|
1049
|
-
return await (await
|
|
1049
|
+
return await (await Qn(`https://module.metapage.io/conversion/metaframe/${t}`, {
|
|
1050
1050
|
redirect: "follow",
|
|
1051
1051
|
retries: 3,
|
|
1052
1052
|
retryDelay: 1e3,
|
|
1053
1053
|
method: "POST",
|
|
1054
|
-
body: JSON.stringify(
|
|
1054
|
+
body: JSON.stringify(e),
|
|
1055
1055
|
headers: {
|
|
1056
1056
|
"Content-Type": "application/json"
|
|
1057
1057
|
}
|
|
1058
1058
|
})).json();
|
|
1059
1059
|
} catch (s) {
|
|
1060
|
-
throw `Error converting metapage definition to version ${
|
|
1060
|
+
throw `Error converting metapage definition to version ${t}: ${s}`;
|
|
1061
1061
|
}
|
|
1062
|
-
return
|
|
1063
|
-
},
|
|
1064
|
-
if (!
|
|
1062
|
+
return Zn(e, t);
|
|
1063
|
+
}, Yn = async (e) => tn(e, pt), Zn = (e, t) => {
|
|
1064
|
+
if (!e)
|
|
1065
1065
|
throw "Metaframe definition null";
|
|
1066
|
-
if (!
|
|
1066
|
+
if (!e.version)
|
|
1067
1067
|
throw 'Missing "version" key in metaframe definition';
|
|
1068
|
-
let n =
|
|
1069
|
-
if (n ===
|
|
1070
|
-
return
|
|
1071
|
-
let s =
|
|
1072
|
-
for (; n !==
|
|
1068
|
+
let n = ue(e.version);
|
|
1069
|
+
if (n === t)
|
|
1070
|
+
return e;
|
|
1071
|
+
let s = e;
|
|
1072
|
+
for (; n !== t; )
|
|
1073
1073
|
switch (n) {
|
|
1074
1074
|
case "0.3": {
|
|
1075
|
-
if (
|
|
1076
|
-
s =
|
|
1075
|
+
if (V(t, n) > 0)
|
|
1076
|
+
s = ns(s), n = ue(s.version);
|
|
1077
1077
|
else
|
|
1078
|
-
throw `Cannot convert from version ${n} to ${
|
|
1078
|
+
throw `Cannot convert from version ${n} to ${t}`;
|
|
1079
1079
|
break;
|
|
1080
1080
|
}
|
|
1081
1081
|
case "0.4": {
|
|
1082
|
-
|
|
1082
|
+
V(t, n) > 0 ? (s = ss(s), n = ue(s.version)) : (s = ts(s), n = ue(s.version));
|
|
1083
1083
|
break;
|
|
1084
1084
|
}
|
|
1085
1085
|
case "0.5": {
|
|
1086
|
-
|
|
1086
|
+
V(t, n) > 0 ? (s = as(s), n = ue(s.version)) : (s = is(s), n = ue(s.version));
|
|
1087
1087
|
break;
|
|
1088
1088
|
}
|
|
1089
1089
|
case "0.6": {
|
|
1090
|
-
|
|
1090
|
+
V(t, n) > 0 ? (s = rs(s), n = ue(s.version)) : (s = us(s), n = ue(s.version));
|
|
1091
1091
|
break;
|
|
1092
1092
|
}
|
|
1093
1093
|
case "1": {
|
|
1094
|
-
if (
|
|
1095
|
-
throw `Cannot convert from version ${n} to ${
|
|
1096
|
-
s =
|
|
1094
|
+
if (V(t, n) > 0)
|
|
1095
|
+
throw `Cannot convert from version ${n} to ${t}, 1 is the latest version`;
|
|
1096
|
+
s = os(s), n = ue(s.version);
|
|
1097
1097
|
break;
|
|
1098
1098
|
}
|
|
1099
1099
|
default:
|
|
1100
|
-
throw `Unknow version ${n} to ${
|
|
1100
|
+
throw `Unknow version ${n} to ${t}`;
|
|
1101
1101
|
}
|
|
1102
1102
|
return s;
|
|
1103
|
-
},
|
|
1104
|
-
if (
|
|
1105
|
-
return
|
|
1106
|
-
},
|
|
1107
|
-
|
|
1108
|
-
}),
|
|
1109
|
-
|
|
1110
|
-
}),
|
|
1111
|
-
if (
|
|
1103
|
+
}, es = async (e, t) => {
|
|
1104
|
+
if (e)
|
|
1105
|
+
return Yn(e);
|
|
1106
|
+
}, ts = (e) => C(e, (t) => {
|
|
1107
|
+
t.version = "0.3", delete t.allow;
|
|
1108
|
+
}), ns = (e) => C(e, (t) => {
|
|
1109
|
+
t.version = "0.4";
|
|
1110
|
+
}), ss = (e) => C(e, (t) => {
|
|
1111
|
+
if (t.version = "0.5", !(t != null && t.metadata))
|
|
1112
1112
|
return;
|
|
1113
|
-
const n =
|
|
1114
|
-
delete
|
|
1115
|
-
const s =
|
|
1116
|
-
delete
|
|
1117
|
-
const i =
|
|
1118
|
-
delete
|
|
1119
|
-
}),
|
|
1120
|
-
if (
|
|
1113
|
+
const n = t.metadata.title;
|
|
1114
|
+
delete t.metadata.title, t.metadata.name = n;
|
|
1115
|
+
const s = t.metadata.descriptionUrl;
|
|
1116
|
+
delete t.metadata.descriptionUrl, t.metadata.description = s;
|
|
1117
|
+
const i = t.metadata.keywords;
|
|
1118
|
+
delete t.metadata.keywords, t.metadata.tags = i;
|
|
1119
|
+
}), is = (e) => C(e, (t) => {
|
|
1120
|
+
if (t.version = "0.4", !(t != null && t.metadata))
|
|
1121
1121
|
return;
|
|
1122
|
-
const n =
|
|
1123
|
-
delete
|
|
1124
|
-
const s =
|
|
1125
|
-
delete
|
|
1126
|
-
const i =
|
|
1127
|
-
delete
|
|
1128
|
-
}),
|
|
1122
|
+
const n = t.metadata.name;
|
|
1123
|
+
delete t.metadata.name, t.metadata.title = n;
|
|
1124
|
+
const s = t.metadata.description;
|
|
1125
|
+
delete t.metadata.description, t.metadata.descriptionUrl = s;
|
|
1126
|
+
const i = t.metadata.tags;
|
|
1127
|
+
delete t.metadata.tags, t.metadata.keywords = i;
|
|
1128
|
+
}), rs = (e) => C(e, (t) => {
|
|
1129
1129
|
var n;
|
|
1130
|
-
|
|
1131
|
-
}),
|
|
1130
|
+
t.version = "1", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
|
|
1131
|
+
}), os = (e) => C(e, (t) => {
|
|
1132
1132
|
var n;
|
|
1133
|
-
|
|
1134
|
-
}),
|
|
1133
|
+
t.version = "0.6", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
|
|
1134
|
+
}), as = (e) => C(e, (t) => {
|
|
1135
1135
|
var n;
|
|
1136
|
-
|
|
1137
|
-
}),
|
|
1136
|
+
t.version = "0.6", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
|
|
1137
|
+
}), us = (e) => C(e, (t) => {
|
|
1138
1138
|
var n;
|
|
1139
|
-
|
|
1140
|
-
}),
|
|
1141
|
-
if (
|
|
1142
|
-
return
|
|
1143
|
-
if (
|
|
1144
|
-
throw `Unknown version: ${
|
|
1145
|
-
if (
|
|
1139
|
+
t.version = "0.5", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
|
|
1140
|
+
}), ue = (e) => {
|
|
1141
|
+
if (e === "latest")
|
|
1142
|
+
return pt;
|
|
1143
|
+
if (V(e, "0.3") < 0)
|
|
1144
|
+
throw `Unknown version: ${e}`;
|
|
1145
|
+
if (V(e, "0.3") <= 0)
|
|
1146
1146
|
return "0.3";
|
|
1147
|
-
if (
|
|
1147
|
+
if (V(e, "0.4") <= 0)
|
|
1148
1148
|
return "0.4";
|
|
1149
|
-
if (
|
|
1149
|
+
if (V(e, "0.5") <= 0)
|
|
1150
1150
|
return "0.5";
|
|
1151
|
-
if (
|
|
1151
|
+
if (V(e, "0.6") <= 0)
|
|
1152
1152
|
return "0.6";
|
|
1153
|
-
if (
|
|
1153
|
+
if (e === "1")
|
|
1154
1154
|
return "1";
|
|
1155
|
-
throw `Unknown version: ${
|
|
1155
|
+
throw `Unknown version: ${e}`;
|
|
1156
1156
|
};
|
|
1157
|
-
var
|
|
1158
|
-
for (var
|
|
1159
|
-
|
|
1160
|
-
var
|
|
1161
|
-
var
|
|
1157
|
+
var Oe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ee = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
1158
|
+
for (var ke = 0; ke < Oe.length; ke++)
|
|
1159
|
+
Ee[Oe.charCodeAt(ke)] = ke;
|
|
1160
|
+
var je = function(e) {
|
|
1161
|
+
var t = new Uint8Array(e), n, s = t.length, i = "";
|
|
1162
1162
|
for (n = 0; n < s; n += 3)
|
|
1163
|
-
i +=
|
|
1163
|
+
i += Oe[t[n] >> 2], i += Oe[(t[n] & 3) << 4 | t[n + 1] >> 4], i += Oe[(t[n + 1] & 15) << 2 | t[n + 2] >> 6], i += Oe[t[n + 2] & 63];
|
|
1164
1164
|
return s % 3 === 2 ? i = i.substring(0, i.length - 1) + "=" : s % 3 === 1 && (i = i.substring(0, i.length - 2) + "=="), i;
|
|
1165
|
-
},
|
|
1166
|
-
var
|
|
1167
|
-
|
|
1168
|
-
var
|
|
1165
|
+
}, de = function(e) {
|
|
1166
|
+
var t = e.length * 0.75, n = e.length, s, i = 0, o, r, a, u;
|
|
1167
|
+
e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
|
|
1168
|
+
var f = new ArrayBuffer(t), c = new Uint8Array(f);
|
|
1169
1169
|
for (s = 0; s < n; s += 4)
|
|
1170
|
-
|
|
1171
|
-
return
|
|
1170
|
+
o = Ee[e.charCodeAt(s)], r = Ee[e.charCodeAt(s + 1)], a = Ee[e.charCodeAt(s + 2)], u = Ee[e.charCodeAt(s + 3)], c[i++] = o << 2 | r >> 4, c[i++] = (r & 15) << 4 | a >> 2, c[i++] = (a & 3) << 6 | u & 63;
|
|
1171
|
+
return f;
|
|
1172
1172
|
};
|
|
1173
|
-
const
|
|
1174
|
-
for (const n of Object.keys(
|
|
1175
|
-
const s = await
|
|
1176
|
-
return
|
|
1177
|
-
}
|
|
1178
|
-
}),
|
|
1179
|
-
for (const n of Object.keys(
|
|
1180
|
-
const s = await
|
|
1181
|
-
return
|
|
1182
|
-
}
|
|
1183
|
-
}),
|
|
1184
|
-
if (
|
|
1185
|
-
return new File([
|
|
1186
|
-
if (
|
|
1187
|
-
const i = await
|
|
1188
|
-
return
|
|
1189
|
-
}
|
|
1190
|
-
if (
|
|
1191
|
-
const i =
|
|
1192
|
-
return new File([i.buffer],
|
|
1193
|
-
}
|
|
1194
|
-
if (typeof
|
|
1195
|
-
var s = new Blob([
|
|
1196
|
-
n.type = "text/plain", new File([s],
|
|
1197
|
-
}
|
|
1198
|
-
if (typeof
|
|
1199
|
-
const i = new Blob([JSON.stringify(
|
|
1173
|
+
const We = async (e) => C(e, async (t) => {
|
|
1174
|
+
for (const n of Object.keys(e)) {
|
|
1175
|
+
const s = await cs(e[n]);
|
|
1176
|
+
return t[n] = s, t;
|
|
1177
|
+
}
|
|
1178
|
+
}), Ce = async (e) => C(e, async (t) => {
|
|
1179
|
+
for (const n of Object.keys(e)) {
|
|
1180
|
+
const s = await nn(e[n]);
|
|
1181
|
+
return t[n] = s, t;
|
|
1182
|
+
}
|
|
1183
|
+
}), vi = async (e, t, n) => {
|
|
1184
|
+
if (e = nn(e), n = n || {}, n.type || (n.type = "application/octet-stream"), e instanceof ArrayBuffer)
|
|
1185
|
+
return new File([e], t, n);
|
|
1186
|
+
if (e instanceof File || e instanceof Blob) {
|
|
1187
|
+
const i = await e.arrayBuffer();
|
|
1188
|
+
return e instanceof File && (n.type = e.type), new File([i], t, n);
|
|
1189
|
+
}
|
|
1190
|
+
if (e instanceof Int8Array || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Float32Array || e instanceof Float64Array) {
|
|
1191
|
+
const i = e;
|
|
1192
|
+
return new File([i.buffer], t, n);
|
|
1193
|
+
}
|
|
1194
|
+
if (typeof e == "string") {
|
|
1195
|
+
var s = new Blob([e], { type: "text/plain" });
|
|
1196
|
+
n.type = "text/plain", new File([s], t, n);
|
|
1197
|
+
}
|
|
1198
|
+
if (typeof e == "object") {
|
|
1199
|
+
const i = new Blob([JSON.stringify(e)], {
|
|
1200
1200
|
type: "application/json"
|
|
1201
1201
|
});
|
|
1202
|
-
n.type = "application/json", new File([i],
|
|
1202
|
+
n.type = "application/json", new File([i], t, n);
|
|
1203
1203
|
}
|
|
1204
|
-
var s = new Blob([
|
|
1205
|
-
return n.type = "text/plain", new File([s],
|
|
1206
|
-
},
|
|
1207
|
-
if (
|
|
1208
|
-
const
|
|
1204
|
+
var s = new Blob([e], { type: "text/plain" });
|
|
1205
|
+
return n.type = "text/plain", new File([s], t, n);
|
|
1206
|
+
}, cs = async (e) => {
|
|
1207
|
+
if (e instanceof Int8Array || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Float32Array || e instanceof Float64Array) {
|
|
1208
|
+
const t = e, n = {
|
|
1209
1209
|
_s: !0,
|
|
1210
|
-
_c:
|
|
1211
|
-
value:
|
|
1212
|
-
byteLength:
|
|
1213
|
-
byteOffset:
|
|
1214
|
-
size:
|
|
1210
|
+
_c: e.constructor.name,
|
|
1211
|
+
value: je(t.buffer),
|
|
1212
|
+
byteLength: t.byteLength,
|
|
1213
|
+
byteOffset: t.byteOffset,
|
|
1214
|
+
size: t.byteLength
|
|
1215
1215
|
};
|
|
1216
1216
|
return Promise.resolve(n);
|
|
1217
|
-
} else if (
|
|
1218
|
-
const
|
|
1217
|
+
} else if (e instanceof File) {
|
|
1218
|
+
const t = e, n = await t.arrayBuffer();
|
|
1219
1219
|
return {
|
|
1220
1220
|
_s: !0,
|
|
1221
1221
|
_c: File.name,
|
|
1222
|
-
value:
|
|
1223
|
-
name:
|
|
1224
|
-
fileType:
|
|
1225
|
-
lastModified:
|
|
1222
|
+
value: je(n),
|
|
1223
|
+
name: t.name,
|
|
1224
|
+
fileType: t.type,
|
|
1225
|
+
lastModified: t.lastModified,
|
|
1226
1226
|
size: n.byteLength
|
|
1227
1227
|
};
|
|
1228
|
-
} else if (
|
|
1229
|
-
const
|
|
1228
|
+
} else if (e instanceof Blob) {
|
|
1229
|
+
const t = e, n = await t.arrayBuffer();
|
|
1230
1230
|
return {
|
|
1231
1231
|
_s: !0,
|
|
1232
1232
|
_c: Blob.name,
|
|
1233
|
-
value:
|
|
1234
|
-
fileType:
|
|
1233
|
+
value: je(n),
|
|
1234
|
+
fileType: t.type,
|
|
1235
1235
|
size: n.byteLength
|
|
1236
1236
|
};
|
|
1237
|
-
} else if (
|
|
1238
|
-
const
|
|
1237
|
+
} else if (e instanceof ArrayBuffer) {
|
|
1238
|
+
const t = e, n = {
|
|
1239
1239
|
_s: !0,
|
|
1240
1240
|
_c: ArrayBuffer.name,
|
|
1241
|
-
value:
|
|
1242
|
-
size:
|
|
1241
|
+
value: je(t),
|
|
1242
|
+
size: t.byteLength
|
|
1243
1243
|
};
|
|
1244
1244
|
return Promise.resolve(n);
|
|
1245
1245
|
}
|
|
1246
|
-
return Promise.resolve(
|
|
1247
|
-
},
|
|
1248
|
-
if (!(
|
|
1249
|
-
return
|
|
1250
|
-
const
|
|
1246
|
+
return Promise.resolve(e);
|
|
1247
|
+
}, nn = (e) => {
|
|
1248
|
+
if (!(e && typeof e == "object" && e._s === !0))
|
|
1249
|
+
return e;
|
|
1250
|
+
const t = e, n = t._c;
|
|
1251
1251
|
if (n === Blob.name) {
|
|
1252
|
-
const r =
|
|
1253
|
-
return new Blob([
|
|
1252
|
+
const r = e;
|
|
1253
|
+
return new Blob([de(t.value)], {
|
|
1254
1254
|
type: r.fileType
|
|
1255
1255
|
});
|
|
1256
1256
|
} else if (n === File.name) {
|
|
1257
|
-
const r =
|
|
1258
|
-
return new File([
|
|
1257
|
+
const r = e;
|
|
1258
|
+
return new File([de(t.value)], r.name, {
|
|
1259
1259
|
type: r.fileType,
|
|
1260
1260
|
lastModified: r.lastModified
|
|
1261
1261
|
});
|
|
1262
1262
|
} else if (n === ArrayBuffer.name)
|
|
1263
|
-
return
|
|
1264
|
-
const s =
|
|
1263
|
+
return de(t.value);
|
|
1264
|
+
const s = e, i = de(s.value), o = s._c;
|
|
1265
1265
|
try {
|
|
1266
|
-
return new globalThis[
|
|
1266
|
+
return new globalThis[o](i);
|
|
1267
1267
|
} catch {
|
|
1268
1268
|
}
|
|
1269
|
-
return
|
|
1270
|
-
},
|
|
1271
|
-
if (!(
|
|
1269
|
+
return e;
|
|
1270
|
+
}, wi = (e) => {
|
|
1271
|
+
if (!(e && typeof e == "object" && e._s === !0))
|
|
1272
1272
|
return;
|
|
1273
|
-
const
|
|
1273
|
+
const t = e, n = t._c;
|
|
1274
1274
|
if (n === Blob.name) {
|
|
1275
|
-
const r =
|
|
1275
|
+
const r = e, a = new Blob([de(t.value)], {
|
|
1276
1276
|
type: r.fileType
|
|
1277
1277
|
});
|
|
1278
|
-
return new File([
|
|
1279
|
-
type:
|
|
1278
|
+
return new File([a], "file", {
|
|
1279
|
+
type: a.type
|
|
1280
1280
|
});
|
|
1281
1281
|
} else if (n === File.name) {
|
|
1282
|
-
const r =
|
|
1283
|
-
return new File([
|
|
1282
|
+
const r = e;
|
|
1283
|
+
return new File([de(t.value)], r.name, {
|
|
1284
1284
|
type: r.fileType,
|
|
1285
1285
|
lastModified: r.lastModified
|
|
1286
1286
|
});
|
|
1287
1287
|
} else if (n === ArrayBuffer.name) {
|
|
1288
|
-
const r =
|
|
1288
|
+
const r = de(t.value);
|
|
1289
1289
|
return new File([r], "file", {
|
|
1290
1290
|
type: "application/octet-stream"
|
|
1291
1291
|
});
|
|
1292
1292
|
}
|
|
1293
|
-
const s =
|
|
1293
|
+
const s = e, i = de(s.value), o = s._c;
|
|
1294
1294
|
try {
|
|
1295
|
-
const r = new globalThis[
|
|
1295
|
+
const r = new globalThis[o](i);
|
|
1296
1296
|
return new File([r], "file", {
|
|
1297
1297
|
type: "application/octet-stream"
|
|
1298
1298
|
});
|
|
1299
1299
|
} catch {
|
|
1300
1300
|
}
|
|
1301
1301
|
};
|
|
1302
|
-
var
|
|
1303
|
-
(function(
|
|
1304
|
-
|
|
1305
|
-
})(
|
|
1306
|
-
var
|
|
1307
|
-
(function(
|
|
1308
|
-
|
|
1309
|
-
})(
|
|
1310
|
-
var
|
|
1311
|
-
(function(
|
|
1312
|
-
|
|
1313
|
-
})(
|
|
1314
|
-
const
|
|
1315
|
-
function
|
|
1316
|
-
switch (typeof
|
|
1302
|
+
var E;
|
|
1303
|
+
(function(e) {
|
|
1304
|
+
e.Inputs = "inputs", e.Outputs = "outputs", e.State = "state", e.Definition = "definition", e.Error = "error", e.UrlHashUpdate = "urlhashupdate", e.Message = "Message";
|
|
1305
|
+
})(E || (E = {}));
|
|
1306
|
+
var X;
|
|
1307
|
+
(function(e) {
|
|
1308
|
+
e.InputsUpdate = "InputsUpdate", e.OutputsUpdate = "OutputsUpdate", e.SetupIframeClientRequest = "SetupIframeClientRequest", e.SetupIframeServerResponseAck = "SetupIframeServerResponseAck", e.HashParamsUpdate = "HashParamsUpdate";
|
|
1309
|
+
})(X || (X = {}));
|
|
1310
|
+
var fe;
|
|
1311
|
+
(function(e) {
|
|
1312
|
+
e.InputsUpdate = "InputsUpdate", e.MessageAck = "MessageAck", e.SetupIframeServerResponse = "SetupIframeServerResponse";
|
|
1313
|
+
})(fe || (fe = {}));
|
|
1314
|
+
const Ri = -32700, Oi = -32600, Ai = -32601, Si = -32602, Ei = -32603;
|
|
1315
|
+
function Mi(e) {
|
|
1316
|
+
switch (typeof e) {
|
|
1317
1317
|
case "string":
|
|
1318
1318
|
return !0;
|
|
1319
1319
|
case "number":
|
|
1320
|
-
return
|
|
1320
|
+
return e % 1 != 0;
|
|
1321
1321
|
case "object":
|
|
1322
|
-
return
|
|
1322
|
+
return e === null ? (console.warn("Use of null ID in JSONRPC 2.0 is discouraged."), !0) : !1;
|
|
1323
1323
|
default:
|
|
1324
1324
|
return !1;
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
1327
|
-
var
|
|
1328
|
-
(function(
|
|
1329
|
-
var
|
|
1327
|
+
var sn = { exports: {} };
|
|
1328
|
+
(function(e) {
|
|
1329
|
+
var t = Object.prototype.hasOwnProperty, n = "~";
|
|
1330
1330
|
function s() {
|
|
1331
1331
|
}
|
|
1332
1332
|
Object.create && (s.prototype = /* @__PURE__ */ Object.create(null), new s().__proto__ || (n = !1));
|
|
1333
|
-
function i(
|
|
1334
|
-
this.fn =
|
|
1333
|
+
function i(u, f, c) {
|
|
1334
|
+
this.fn = u, this.context = f, this.once = c || !1;
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function o(u, f, c, d, y) {
|
|
1337
1337
|
if (typeof c != "function")
|
|
1338
1338
|
throw new TypeError("The listener must be a function");
|
|
1339
|
-
var
|
|
1340
|
-
return
|
|
1339
|
+
var w = new i(c, d || u, y), _ = n ? n + f : f;
|
|
1340
|
+
return u._events[_] ? u._events[_].fn ? u._events[_] = [u._events[_], w] : u._events[_].push(w) : (u._events[_] = w, u._eventsCount++), u;
|
|
1341
1341
|
}
|
|
1342
|
-
function r(
|
|
1343
|
-
--
|
|
1342
|
+
function r(u, f) {
|
|
1343
|
+
--u._eventsCount === 0 ? u._events = new s() : delete u._events[f];
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1345
|
+
function a() {
|
|
1346
1346
|
this._events = new s(), this._eventsCount = 0;
|
|
1347
1347
|
}
|
|
1348
|
-
|
|
1349
|
-
var
|
|
1348
|
+
a.prototype.eventNames = function() {
|
|
1349
|
+
var f = [], c, d;
|
|
1350
1350
|
if (this._eventsCount === 0)
|
|
1351
|
-
return
|
|
1352
|
-
for (
|
|
1353
|
-
|
|
1354
|
-
return Object.getOwnPropertySymbols ?
|
|
1355
|
-
},
|
|
1356
|
-
var c = n ? n +
|
|
1357
|
-
if (!
|
|
1351
|
+
return f;
|
|
1352
|
+
for (d in c = this._events)
|
|
1353
|
+
t.call(c, d) && f.push(n ? d.slice(1) : d);
|
|
1354
|
+
return Object.getOwnPropertySymbols ? f.concat(Object.getOwnPropertySymbols(c)) : f;
|
|
1355
|
+
}, a.prototype.listeners = function(f) {
|
|
1356
|
+
var c = n ? n + f : f, d = this._events[c];
|
|
1357
|
+
if (!d)
|
|
1358
1358
|
return [];
|
|
1359
|
-
if (
|
|
1360
|
-
return [
|
|
1361
|
-
for (var
|
|
1362
|
-
_[
|
|
1359
|
+
if (d.fn)
|
|
1360
|
+
return [d.fn];
|
|
1361
|
+
for (var y = 0, w = d.length, _ = new Array(w); y < w; y++)
|
|
1362
|
+
_[y] = d[y].fn;
|
|
1363
1363
|
return _;
|
|
1364
|
-
},
|
|
1365
|
-
var c = n ? n +
|
|
1366
|
-
return
|
|
1367
|
-
},
|
|
1368
|
-
var
|
|
1369
|
-
if (!this._events[
|
|
1364
|
+
}, a.prototype.listenerCount = function(f) {
|
|
1365
|
+
var c = n ? n + f : f, d = this._events[c];
|
|
1366
|
+
return d ? d.fn ? 1 : d.length : 0;
|
|
1367
|
+
}, a.prototype.emit = function(f, c, d, y, w, _) {
|
|
1368
|
+
var S = n ? n + f : f;
|
|
1369
|
+
if (!this._events[S])
|
|
1370
1370
|
return !1;
|
|
1371
|
-
var
|
|
1372
|
-
if (
|
|
1373
|
-
switch (
|
|
1371
|
+
var v = this._events[S], x = arguments.length, b, A;
|
|
1372
|
+
if (v.fn) {
|
|
1373
|
+
switch (v.once && this.removeListener(f, v.fn, void 0, !0), x) {
|
|
1374
1374
|
case 1:
|
|
1375
|
-
return
|
|
1375
|
+
return v.fn.call(v.context), !0;
|
|
1376
1376
|
case 2:
|
|
1377
|
-
return
|
|
1377
|
+
return v.fn.call(v.context, c), !0;
|
|
1378
1378
|
case 3:
|
|
1379
|
-
return
|
|
1379
|
+
return v.fn.call(v.context, c, d), !0;
|
|
1380
1380
|
case 4:
|
|
1381
|
-
return
|
|
1381
|
+
return v.fn.call(v.context, c, d, y), !0;
|
|
1382
1382
|
case 5:
|
|
1383
|
-
return
|
|
1383
|
+
return v.fn.call(v.context, c, d, y, w), !0;
|
|
1384
1384
|
case 6:
|
|
1385
|
-
return
|
|
1385
|
+
return v.fn.call(v.context, c, d, y, w, _), !0;
|
|
1386
1386
|
}
|
|
1387
|
-
for (
|
|
1388
|
-
|
|
1389
|
-
|
|
1387
|
+
for (A = 1, b = new Array(x - 1); A < x; A++)
|
|
1388
|
+
b[A - 1] = arguments[A];
|
|
1389
|
+
v.fn.apply(v.context, b);
|
|
1390
1390
|
} else {
|
|
1391
|
-
var
|
|
1392
|
-
for (
|
|
1393
|
-
switch (
|
|
1391
|
+
var M = v.length, R;
|
|
1392
|
+
for (A = 0; A < M; A++)
|
|
1393
|
+
switch (v[A].once && this.removeListener(f, v[A].fn, void 0, !0), x) {
|
|
1394
1394
|
case 1:
|
|
1395
|
-
|
|
1395
|
+
v[A].fn.call(v[A].context);
|
|
1396
1396
|
break;
|
|
1397
1397
|
case 2:
|
|
1398
|
-
|
|
1398
|
+
v[A].fn.call(v[A].context, c);
|
|
1399
1399
|
break;
|
|
1400
1400
|
case 3:
|
|
1401
|
-
|
|
1401
|
+
v[A].fn.call(v[A].context, c, d);
|
|
1402
1402
|
break;
|
|
1403
1403
|
case 4:
|
|
1404
|
-
|
|
1404
|
+
v[A].fn.call(v[A].context, c, d, y);
|
|
1405
1405
|
break;
|
|
1406
1406
|
default:
|
|
1407
|
-
if (!
|
|
1408
|
-
for (
|
|
1409
|
-
|
|
1410
|
-
|
|
1407
|
+
if (!b)
|
|
1408
|
+
for (R = 1, b = new Array(x - 1); R < x; R++)
|
|
1409
|
+
b[R - 1] = arguments[R];
|
|
1410
|
+
v[A].fn.apply(v[A].context, b);
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
1413
|
return !0;
|
|
1414
|
-
},
|
|
1415
|
-
return
|
|
1416
|
-
},
|
|
1417
|
-
return
|
|
1418
|
-
},
|
|
1419
|
-
var
|
|
1420
|
-
if (!this._events[
|
|
1414
|
+
}, a.prototype.on = function(f, c, d) {
|
|
1415
|
+
return o(this, f, c, d, !1);
|
|
1416
|
+
}, a.prototype.once = function(f, c, d) {
|
|
1417
|
+
return o(this, f, c, d, !0);
|
|
1418
|
+
}, a.prototype.removeListener = function(f, c, d, y) {
|
|
1419
|
+
var w = n ? n + f : f;
|
|
1420
|
+
if (!this._events[w])
|
|
1421
1421
|
return this;
|
|
1422
1422
|
if (!c)
|
|
1423
|
-
return r(this,
|
|
1424
|
-
var _ = this._events[
|
|
1423
|
+
return r(this, w), this;
|
|
1424
|
+
var _ = this._events[w];
|
|
1425
1425
|
if (_.fn)
|
|
1426
|
-
_.fn === c && (!
|
|
1426
|
+
_.fn === c && (!y || _.once) && (!d || _.context === d) && r(this, w);
|
|
1427
1427
|
else {
|
|
1428
|
-
for (var
|
|
1429
|
-
(_[
|
|
1430
|
-
|
|
1428
|
+
for (var S = 0, v = [], x = _.length; S < x; S++)
|
|
1429
|
+
(_[S].fn !== c || y && !_[S].once || d && _[S].context !== d) && v.push(_[S]);
|
|
1430
|
+
v.length ? this._events[w] = v.length === 1 ? v[0] : v : r(this, w);
|
|
1431
1431
|
}
|
|
1432
1432
|
return this;
|
|
1433
|
-
},
|
|
1433
|
+
}, a.prototype.removeAllListeners = function(f) {
|
|
1434
1434
|
var c;
|
|
1435
|
-
return
|
|
1436
|
-
},
|
|
1437
|
-
})(
|
|
1438
|
-
var
|
|
1439
|
-
|
|
1440
|
-
|
|
1435
|
+
return f ? (c = n ? n + f : f, this._events[c] && r(this, c)) : (this._events = new s(), this._eventsCount = 0), this;
|
|
1436
|
+
}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = n, a.EventEmitter = a, e.exports = a;
|
|
1437
|
+
})(sn);
|
|
1438
|
+
var vt = sn.exports;
|
|
1439
|
+
function fs(e) {
|
|
1440
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1441
|
+
}
|
|
1442
|
+
var ls = function(e, t) {
|
|
1443
|
+
t || (t = {}), typeof t == "function" && (t = { cmp: t });
|
|
1444
|
+
var n = typeof t.cycles == "boolean" ? t.cycles : !1, s = t.cmp && /* @__PURE__ */ function(o) {
|
|
1445
|
+
return function(r) {
|
|
1446
|
+
return function(a, u) {
|
|
1447
|
+
var f = { key: a, value: r[a] }, c = { key: u, value: r[u] };
|
|
1448
|
+
return o(f, c);
|
|
1449
|
+
};
|
|
1450
|
+
};
|
|
1451
|
+
}(t.cmp), i = [];
|
|
1452
|
+
return function o(r) {
|
|
1453
|
+
if (r && r.toJSON && typeof r.toJSON == "function" && (r = r.toJSON()), r !== void 0) {
|
|
1454
|
+
if (typeof r == "number")
|
|
1455
|
+
return isFinite(r) ? "" + r : "null";
|
|
1456
|
+
if (typeof r != "object")
|
|
1457
|
+
return JSON.stringify(r);
|
|
1458
|
+
var a, u;
|
|
1459
|
+
if (Array.isArray(r)) {
|
|
1460
|
+
for (u = "[", a = 0; a < r.length; a++)
|
|
1461
|
+
a && (u += ","), u += o(r[a]) || "null";
|
|
1462
|
+
return u + "]";
|
|
1463
|
+
}
|
|
1464
|
+
if (r === null)
|
|
1465
|
+
return "null";
|
|
1466
|
+
if (i.indexOf(r) !== -1) {
|
|
1467
|
+
if (n)
|
|
1468
|
+
return JSON.stringify("__cycle__");
|
|
1469
|
+
throw new TypeError("Converting circular structure to JSON");
|
|
1470
|
+
}
|
|
1471
|
+
var f = i.push(r) - 1, c = Object.keys(r).sort(s && s(r));
|
|
1472
|
+
for (u = "", a = 0; a < c.length; a++) {
|
|
1473
|
+
var d = c[a], y = o(r[d]);
|
|
1474
|
+
y && (u && (u += ","), u += JSON.stringify(d) + ":" + y);
|
|
1475
|
+
}
|
|
1476
|
+
return i.splice(f, 1), "{" + u + "}";
|
|
1477
|
+
}
|
|
1478
|
+
}(e);
|
|
1479
|
+
};
|
|
1480
|
+
const ps = /* @__PURE__ */ fs(ls), hs = (e) => rn(ps(e)), ds = (e) => {
|
|
1481
|
+
if (e && e.length > 0)
|
|
1482
|
+
return JSON.parse(on(e));
|
|
1483
|
+
}, rn = (e) => btoa(encodeURIComponent(e)), on = (e) => decodeURIComponent(atob(e)), an = (e) => {
|
|
1484
|
+
const t = new URL(e);
|
|
1485
|
+
return un(t.hash);
|
|
1486
|
+
}, un = (e) => {
|
|
1487
|
+
let t = e;
|
|
1488
|
+
for (; t.startsWith("#"); )
|
|
1489
|
+
t = t.substring(1);
|
|
1490
|
+
const n = t.indexOf("?");
|
|
1491
|
+
if (n === -1)
|
|
1492
|
+
return [t, {}];
|
|
1493
|
+
const s = t.substring(0, n);
|
|
1494
|
+
t = t.substring(n + 1);
|
|
1495
|
+
const i = {};
|
|
1496
|
+
return t.split("&").filter((o) => o.length > 0).map((o) => {
|
|
1497
|
+
const r = o.indexOf("=");
|
|
1498
|
+
if (r === -1)
|
|
1499
|
+
return [o, ""];
|
|
1500
|
+
const a = o.substring(0, r), u = o.substring(r + 1);
|
|
1501
|
+
return [a, u];
|
|
1502
|
+
}).forEach(([o, r]) => {
|
|
1503
|
+
i[o] = r;
|
|
1504
|
+
}), Object.keys(i).forEach((o) => {
|
|
1505
|
+
try {
|
|
1506
|
+
i[o] = decodeURI(i[o]);
|
|
1507
|
+
} catch {
|
|
1508
|
+
i[o] = i[o];
|
|
1509
|
+
}
|
|
1510
|
+
}), [s, i];
|
|
1511
|
+
}, Pe = (e, t) => {
|
|
1512
|
+
const [n, s] = an(e);
|
|
1513
|
+
return s[t];
|
|
1514
|
+
}, ms = (e) => ys()[1][e], ys = () => an(window.location.href), Ae = (e, t, n) => {
|
|
1515
|
+
const s = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, i = _s(s, e, t);
|
|
1516
|
+
i !== s && (n != null && n.modifyHistory ? window.location.hash = i : (window.history.replaceState(null, document.title, `${window.location.pathname}${window.location.search}${i.startsWith("#") ? "" : "#"}${i}`), window.dispatchEvent(new HashChangeEvent("hashchange"))));
|
|
1517
|
+
}, _s = (e, t, n) => {
|
|
1518
|
+
const [s, i] = un(e);
|
|
1519
|
+
let o = !1;
|
|
1520
|
+
if (i.hasOwnProperty(t) && n === null || n === void 0 ? (delete i[t], o = !0) : i[t] !== n && (i[t] = n, o = !0), !o)
|
|
1521
|
+
return e;
|
|
1522
|
+
const r = Object.keys(i);
|
|
1523
|
+
r.sort();
|
|
1524
|
+
const a = r.map((u, f) => `${u}=${encodeURI(i[u])}`).join("&");
|
|
1525
|
+
return `${s}?${a}`;
|
|
1526
|
+
}, gs = (e, t) => {
|
|
1527
|
+
const n = Pe(e, t);
|
|
1528
|
+
if (n && n !== "")
|
|
1529
|
+
return ds(n);
|
|
1530
|
+
}, bs = (e, t, n) => {
|
|
1531
|
+
const s = t ? hs(t) : void 0;
|
|
1532
|
+
Ae(e, s, n);
|
|
1533
|
+
}, vs = (e) => gs(window.location.href, e), ws = (e, t) => {
|
|
1534
|
+
const n = Pe(e, t);
|
|
1535
|
+
return n ? parseFloat(n) : void 0;
|
|
1536
|
+
}, cn = (e, t, n) => {
|
|
1537
|
+
Ae(e, t != null ? t.toString() : void 0, n);
|
|
1538
|
+
}, Rs = (e) => ws(window.location.href, e), Os = (e, t) => {
|
|
1539
|
+
const n = Pe(e, t);
|
|
1540
|
+
return n ? parseInt(n) : void 0;
|
|
1541
|
+
}, As = (e, t, n) => {
|
|
1542
|
+
cn(e, t, n);
|
|
1543
|
+
}, Ss = (e) => Os(window.location.href, e), Es = (e, t) => Pe(e, t) === "true", Ms = (e, t, n) => {
|
|
1544
|
+
Ae(e, t ? "true" : void 0, n);
|
|
1545
|
+
}, Is = (e) => Es(window.location.href, e), Cs = (e, t) => {
|
|
1546
|
+
const n = Pe(e, t);
|
|
1547
|
+
return n && n !== "" ? on(n) : void 0;
|
|
1548
|
+
}, $s = (e, t, n) => {
|
|
1549
|
+
const s = t == null ? void 0 : rn(t);
|
|
1550
|
+
Ae(e, s, n);
|
|
1551
|
+
}, xs = (e) => Cs(window.location.href, e);
|
|
1552
|
+
var Ls = function(e, t) {
|
|
1553
|
+
t || (t = {}), typeof t == "function" && (t = { cmp: t });
|
|
1554
|
+
var n = typeof t.cycles == "boolean" ? t.cycles : !1, s = t.cmp && function(o) {
|
|
1441
1555
|
return function(r) {
|
|
1442
|
-
return function(
|
|
1443
|
-
var
|
|
1444
|
-
return
|
|
1556
|
+
return function(a, u) {
|
|
1557
|
+
var f = { key: a, value: r[a] }, c = { key: u, value: r[u] };
|
|
1558
|
+
return o(f, c);
|
|
1445
1559
|
};
|
|
1446
1560
|
};
|
|
1447
|
-
}(
|
|
1448
|
-
return function
|
|
1561
|
+
}(t.cmp), i = [];
|
|
1562
|
+
return function o(r) {
|
|
1449
1563
|
if (r && r.toJSON && typeof r.toJSON == "function" && (r = r.toJSON()), r !== void 0) {
|
|
1450
1564
|
if (typeof r == "number")
|
|
1451
1565
|
return isFinite(r) ? "" + r : "null";
|
|
1452
1566
|
if (typeof r != "object")
|
|
1453
1567
|
return JSON.stringify(r);
|
|
1454
|
-
var
|
|
1568
|
+
var a, u;
|
|
1455
1569
|
if (Array.isArray(r)) {
|
|
1456
|
-
for (
|
|
1457
|
-
|
|
1458
|
-
return
|
|
1570
|
+
for (u = "[", a = 0; a < r.length; a++)
|
|
1571
|
+
a && (u += ","), u += o(r[a]) || "null";
|
|
1572
|
+
return u + "]";
|
|
1459
1573
|
}
|
|
1460
1574
|
if (r === null)
|
|
1461
1575
|
return "null";
|
|
@@ -1464,221 +1578,227 @@ var De = st.exports, Yt = function(t, e) {
|
|
|
1464
1578
|
return JSON.stringify("__cycle__");
|
|
1465
1579
|
throw new TypeError("Converting circular structure to JSON");
|
|
1466
1580
|
}
|
|
1467
|
-
var
|
|
1468
|
-
for (
|
|
1469
|
-
var
|
|
1470
|
-
|
|
1581
|
+
var f = i.push(r) - 1, c = Object.keys(r).sort(s && s(r));
|
|
1582
|
+
for (u = "", a = 0; a < c.length; a++) {
|
|
1583
|
+
var d = c[a], y = o(r[d]);
|
|
1584
|
+
y && (u && (u += ","), u += JSON.stringify(d) + ":" + y);
|
|
1471
1585
|
}
|
|
1472
|
-
return i.splice(
|
|
1586
|
+
return i.splice(f, 1), "{" + u + "}";
|
|
1473
1587
|
}
|
|
1474
|
-
}(
|
|
1588
|
+
}(e);
|
|
1475
1589
|
};
|
|
1476
|
-
const
|
|
1477
|
-
var
|
|
1478
|
-
(function(
|
|
1479
|
-
|
|
1480
|
-
})(
|
|
1481
|
-
const
|
|
1590
|
+
const fn = /* @__PURE__ */ ht(Ls);
|
|
1591
|
+
var xe;
|
|
1592
|
+
(function(e) {
|
|
1593
|
+
e.mp_debug = "mp_debug";
|
|
1594
|
+
})(xe || (xe = {}));
|
|
1595
|
+
const Ps = () => {
|
|
1482
1596
|
try {
|
|
1483
1597
|
return window !== window.top;
|
|
1484
1598
|
} catch {
|
|
1485
1599
|
return !1;
|
|
1486
1600
|
}
|
|
1487
|
-
},
|
|
1488
|
-
version:
|
|
1601
|
+
}, ln = {
|
|
1602
|
+
version: Je,
|
|
1489
1603
|
metaframes: {}
|
|
1490
1604
|
};
|
|
1491
|
-
class
|
|
1605
|
+
class Ts extends vt.EventEmitter {
|
|
1492
1606
|
constructor() {
|
|
1493
|
-
super(), this._definition =
|
|
1607
|
+
super(), this._definition = ln, this.getDefinition = this.getDefinition.bind(this);
|
|
1494
1608
|
}
|
|
1495
|
-
error(
|
|
1609
|
+
error(t) {
|
|
1496
1610
|
throw "Subclass should implement";
|
|
1497
1611
|
}
|
|
1498
1612
|
getDefinition() {
|
|
1499
1613
|
return this._definition;
|
|
1500
1614
|
}
|
|
1501
1615
|
}
|
|
1502
|
-
const
|
|
1503
|
-
Object.keys(
|
|
1504
|
-
|
|
1616
|
+
const ze = (e, t) => t ? C(e, (n) => {
|
|
1617
|
+
Object.keys(t).forEach((s) => {
|
|
1618
|
+
t[s] === void 0 ? delete n[s] : n[s] = t[s];
|
|
1505
1619
|
});
|
|
1506
|
-
}) :
|
|
1507
|
-
const
|
|
1508
|
-
return
|
|
1509
|
-
},
|
|
1510
|
-
for (var
|
|
1511
|
-
|
|
1512
|
-
return
|
|
1513
|
-
},
|
|
1514
|
-
|
|
1620
|
+
}) : e, Ii = (e) => window.location.search ? new URLSearchParams(window.location.search).get(e) : null, Ci = () => new URLSearchParams(window.location.search).has(xe.mp_debug), ft = () => {
|
|
1621
|
+
const e = new URLSearchParams(window.location.search).get(xe.mp_debug);
|
|
1622
|
+
return e === "true" || e === "1";
|
|
1623
|
+
}, $i = (e = 8) => wt(e), Ds = (e = 8) => wt(e), xi = (e = 8) => wt(e), Ht = "abcdefghijklmnopqrstuvwxyz0123456789", wt = (e = 8) => {
|
|
1624
|
+
for (var t = "", n = Ht.length, s = 0; s < e; s++)
|
|
1625
|
+
t += Ht.charAt(Math.floor(Math.random() * n));
|
|
1626
|
+
return t;
|
|
1627
|
+
}, Rt = (e, t, n) => {
|
|
1628
|
+
t = t || "000", t && t.trim() == "" && (t = void 0);
|
|
1515
1629
|
let s;
|
|
1516
|
-
if (typeof
|
|
1517
|
-
var i = `color: #${
|
|
1630
|
+
if (typeof e == "string" ? s = e : typeof e == "number" ? s = e + "" : s = JSON.stringify(e, null, " "), t && t.trim() != "") {
|
|
1631
|
+
var i = `color: #${t}`;
|
|
1518
1632
|
n && (i = `${i}; background: #${n}`), s = `%c${s}`, window.console.log(s, i);
|
|
1519
1633
|
} else
|
|
1520
1634
|
window.console.log(s);
|
|
1521
|
-
},
|
|
1522
|
-
var
|
|
1523
|
-
for (let n = 0; n <
|
|
1524
|
-
|
|
1525
|
-
return
|
|
1526
|
-
},
|
|
1527
|
-
var
|
|
1528
|
-
return "00000".substring(0, 6 -
|
|
1529
|
-
},
|
|
1530
|
-
if (
|
|
1531
|
-
|
|
1635
|
+
}, pn = (e) => Ns(Hs(e)), Hs = (e) => {
|
|
1636
|
+
var t = 0;
|
|
1637
|
+
for (let n = 0; n < e.length; n++)
|
|
1638
|
+
t = e.charCodeAt(n) + ((t << 5) - t);
|
|
1639
|
+
return t;
|
|
1640
|
+
}, Ns = (e) => {
|
|
1641
|
+
var t = (e & 16777215).toString(16).toUpperCase();
|
|
1642
|
+
return "00000".substring(0, 6 - t.length) + t;
|
|
1643
|
+
}, Ze = () => document.readyState == "complete" || document.readyState == "interactive", Ot = async () => Ze() ? Promise.resolve() : new Promise((e) => {
|
|
1644
|
+
if (Ze()) {
|
|
1645
|
+
e();
|
|
1532
1646
|
return;
|
|
1533
1647
|
}
|
|
1534
|
-
let
|
|
1648
|
+
let t = !1;
|
|
1535
1649
|
window.addEventListener("load", () => {
|
|
1536
|
-
|
|
1650
|
+
t || (t = !0, e());
|
|
1537
1651
|
}), setTimeout(() => {
|
|
1538
|
-
!
|
|
1652
|
+
!t && Ze() && (t = !0, e());
|
|
1539
1653
|
}, 200);
|
|
1540
|
-
}),
|
|
1541
|
-
const
|
|
1542
|
-
return await
|
|
1543
|
-
},
|
|
1544
|
-
const
|
|
1545
|
-
version:
|
|
1546
|
-
metaframes:
|
|
1654
|
+
}), Li = async (e) => {
|
|
1655
|
+
const t = fn(e);
|
|
1656
|
+
return await hn(t);
|
|
1657
|
+
}, Pi = async (e) => {
|
|
1658
|
+
const t = fn({
|
|
1659
|
+
version: e.version,
|
|
1660
|
+
metaframes: e.metaframes
|
|
1547
1661
|
});
|
|
1548
|
-
return await
|
|
1662
|
+
return await hn(t);
|
|
1549
1663
|
};
|
|
1550
|
-
async function
|
|
1551
|
-
const n = new TextEncoder().encode(
|
|
1664
|
+
async function hn(e) {
|
|
1665
|
+
const n = new TextEncoder().encode(e), s = await crypto.subtle.digest("SHA-256", n);
|
|
1552
1666
|
return btoa(String.fromCharCode(...new Uint8Array(s)));
|
|
1553
1667
|
}
|
|
1554
|
-
var
|
|
1555
|
-
(function(
|
|
1556
|
-
|
|
1557
|
-
})(
|
|
1558
|
-
var
|
|
1559
|
-
(function(
|
|
1560
|
-
|
|
1561
|
-
})(
|
|
1562
|
-
class
|
|
1563
|
-
constructor(
|
|
1564
|
-
if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state =
|
|
1668
|
+
var re;
|
|
1669
|
+
(function(e) {
|
|
1670
|
+
e.WaitingForPageLoad = "WaitingForPageLoad", e.SentSetupIframeClientRequest = "SentSetupIframeClientRequest", e.Ready = "Ready";
|
|
1671
|
+
})(re || (re = {}));
|
|
1672
|
+
var U;
|
|
1673
|
+
(function(e) {
|
|
1674
|
+
e.Connected = "connected", e.Error = "error", e.Input = "input", e.Inputs = "inputs", e.Message = "message";
|
|
1675
|
+
})(U || (U = {}));
|
|
1676
|
+
class te extends vt.EventEmitter {
|
|
1677
|
+
constructor(t) {
|
|
1678
|
+
if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = re.WaitingForPageLoad, this._messageSendCount = 0, this.debug = ft(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = ft(), this._isIframe = Ps(), this.addListener = this.addListener.bind(this), this.dispose = this.dispose.bind(this), this.error = this.error.bind(this), this.getInput = this.getInput.bind(this), this.getInputs = this.getInputs.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.onInput = this.onInput.bind(this), this.onInputs = this.onInputs.bind(this), this.onMessage = this.onMessage.bind(this), this.sendRpc = this.sendRpc.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInternalInputsAndNotify = this.setInternalInputsAndNotify.bind(this), this.setOutput = this.setOutput.bind(this), this.setOutputs = this.setOutputs.bind(this), this.warn = this.warn.bind(this), this._resolveSetupIframeServerResponse = this._resolveSetupIframeServerResponse.bind(this), this.addListenerReturnDisposer = this.addListenerReturnDisposer.bind(this), this.connected = this.connected.bind(this), this.isConnected = this.isConnected.bind(this), this.disableNotifyOnHashUrlChange = this.disableNotifyOnHashUrlChange.bind(this), this._onHashUrlChange = this._onHashUrlChange.bind(this), this.setParameter = this.setParameter.bind(this), this.setParameterBoolean = this.setParameterBoolean.bind(this), this.setParameterJson = this.setParameterJson.bind(this), this.setParameterBase64 = this.setParameterBase64.bind(this), this.setParameterFloat = this.setParameterFloat.bind(this), this.setParameterInt = this.setParameterInt.bind(this), this.getParameter = this.getParameter.bind(this), this.getParameterBoolean = this.getParameterBoolean.bind(this), this.getParameterJson = this.getParameterJson.bind(this), this.getParameterBase64 = this.getParameterBase64.bind(this), this.getParameterFloat = this.getParameterFloat.bind(this), this.getParameterInt = this.getParameterInt.bind(this), this.deleteParameter = this.deleteParameter.bind(this), !this._isIframe) {
|
|
1565
1679
|
this.log("Not an iframe, metaframe code disabled");
|
|
1566
1680
|
return;
|
|
1567
1681
|
}
|
|
1568
1682
|
const n = this;
|
|
1569
|
-
|
|
1570
|
-
this.log("pageLoaded"), window.addEventListener("message", this.onMessage), n.sendRpc(
|
|
1571
|
-
version:
|
|
1572
|
-
}), n._state =
|
|
1573
|
-
}),
|
|
1574
|
-
}
|
|
1575
|
-
_resolveSetupIframeServerResponse(
|
|
1576
|
-
if (this._state ===
|
|
1683
|
+
Ot().then(() => {
|
|
1684
|
+
this.log("pageLoaded"), window.addEventListener("message", this.onMessage), n.sendRpc(X.SetupIframeClientRequest, {
|
|
1685
|
+
version: te.version
|
|
1686
|
+
}), n._state = re.SentSetupIframeClientRequest;
|
|
1687
|
+
}), t && t.disableHashChangeEvent || window.addEventListener("hashchange", this._onHashUrlChange);
|
|
1688
|
+
}
|
|
1689
|
+
_resolveSetupIframeServerResponse(t) {
|
|
1690
|
+
if (this._state === re.WaitingForPageLoad)
|
|
1577
1691
|
throw "Got message but page has not finished loading, we should never get in this state";
|
|
1578
|
-
(async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion =
|
|
1579
|
-
version:
|
|
1580
|
-
}), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(
|
|
1692
|
+
(async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = t.version, this.color = pn(this.id), this._parentId = t.parentId, this.log(`metapage[${this._parentId}](v${this._parentVersion ? this._parentVersion : "unknown"}) registered`), t.state && t.state.inputs && (this.isInputOutputBlobSerialization ? this._inputPipeValues = await Ce(t.state.inputs) : this._inputPipeValues = t.state.inputs), this._state = re.Ready, this.sendRpc(X.SetupIframeServerResponseAck, {
|
|
1693
|
+
version: te.version
|
|
1694
|
+
}), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(U.Inputs, this._inputPipeValues), this.listenerCount(U.Input) > 0 && Object.keys(this._inputPipeValues).forEach((n) => this.emit(U.Input, n, this._inputPipeValues[n]))), this.emit(U.Connected), this.sendRpc(X.OutputsUpdate, this._outputPipeValues)))();
|
|
1695
|
+
}
|
|
1696
|
+
isConnected() {
|
|
1697
|
+
return this._state === re.Ready;
|
|
1581
1698
|
}
|
|
1582
1699
|
async connected() {
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1700
|
+
return new Promise((t, n) => {
|
|
1701
|
+
if (this._state === re.Ready) {
|
|
1702
|
+
t();
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
let s;
|
|
1706
|
+
s = this.addListenerReturnDisposer(U.Connected, () => {
|
|
1707
|
+
t(), s();
|
|
1589
1708
|
});
|
|
1709
|
+
});
|
|
1590
1710
|
}
|
|
1591
|
-
addListenerReturnDisposer(
|
|
1592
|
-
return super.addListener(
|
|
1593
|
-
super.removeListener(
|
|
1711
|
+
addListenerReturnDisposer(t, n) {
|
|
1712
|
+
return super.addListener(t, n), () => {
|
|
1713
|
+
super.removeListener(t, n);
|
|
1594
1714
|
};
|
|
1595
1715
|
}
|
|
1596
|
-
log(
|
|
1597
|
-
this.debug && this.logInternal(
|
|
1716
|
+
log(t, n, s) {
|
|
1717
|
+
this.debug && this.logInternal(t, n || this.color);
|
|
1598
1718
|
}
|
|
1599
|
-
warn(
|
|
1600
|
-
this.debug && this.logInternal(
|
|
1719
|
+
warn(t) {
|
|
1720
|
+
this.debug && this.logInternal(t, "000", this.color);
|
|
1601
1721
|
}
|
|
1602
|
-
error(
|
|
1603
|
-
this.logInternal(
|
|
1722
|
+
error(t) {
|
|
1723
|
+
this.logInternal(t, this.color, "f00");
|
|
1604
1724
|
}
|
|
1605
|
-
logInternal(
|
|
1725
|
+
logInternal(t, n, s) {
|
|
1606
1726
|
let i;
|
|
1607
|
-
typeof
|
|
1727
|
+
typeof t == "string" ? i = t : typeof t == "number" ? i = t + "" : i = JSON.stringify(t), n = n && n + "", i = (this.id ? `Metaframe[${this.id}] ` : "") + `${i}`, Rt(i, n, s);
|
|
1608
1728
|
}
|
|
1609
1729
|
dispose() {
|
|
1610
1730
|
super.removeAllListeners(), window.removeEventListener("message", this.onMessage), this.disableNotifyOnHashUrlChange(), this._inputPipeValues = void 0, this._outputPipeValues = void 0;
|
|
1611
1731
|
}
|
|
1612
|
-
addListener(
|
|
1613
|
-
return super.addListener(
|
|
1732
|
+
addListener(t, n) {
|
|
1733
|
+
return super.addListener(t, n), t === U.Inputs && window.setTimeout(() => {
|
|
1614
1734
|
this._inputPipeValues && n(this._inputPipeValues);
|
|
1615
1735
|
}, 0), this;
|
|
1616
1736
|
}
|
|
1617
|
-
onInput(
|
|
1618
|
-
return this.addListenerReturnDisposer(
|
|
1619
|
-
|
|
1737
|
+
onInput(t, n) {
|
|
1738
|
+
return this.addListenerReturnDisposer(U.Input, (s, i) => {
|
|
1739
|
+
t === s && n(i);
|
|
1620
1740
|
});
|
|
1621
1741
|
}
|
|
1622
|
-
onInputs(
|
|
1623
|
-
return this.addListenerReturnDisposer(
|
|
1742
|
+
onInputs(t) {
|
|
1743
|
+
return this.addListenerReturnDisposer(U.Inputs, t);
|
|
1624
1744
|
}
|
|
1625
|
-
setInput(
|
|
1745
|
+
setInput(t, n) {
|
|
1626
1746
|
var s = {};
|
|
1627
|
-
s[
|
|
1747
|
+
s[t] = n, this.setInputs(s);
|
|
1628
1748
|
}
|
|
1629
|
-
async setInputs(
|
|
1630
|
-
this.isInputOutputBlobSerialization && (
|
|
1749
|
+
async setInputs(t) {
|
|
1750
|
+
this.isInputOutputBlobSerialization && (t = await Ce(t)), this.sendRpc(X.InputsUpdate, t);
|
|
1631
1751
|
}
|
|
1632
|
-
async setInternalInputsAndNotify(
|
|
1633
|
-
this.isInputOutputBlobSerialization && (
|
|
1634
|
-
const n =
|
|
1635
|
-
if (this._inputPipeValues =
|
|
1636
|
-
Object.keys(
|
|
1752
|
+
async setInternalInputsAndNotify(t) {
|
|
1753
|
+
this.isInputOutputBlobSerialization && (t = await Ce(t));
|
|
1754
|
+
const n = t;
|
|
1755
|
+
if (this._inputPipeValues = ze(this._inputPipeValues, t), this._inputPipeValues !== n) {
|
|
1756
|
+
Object.keys(t).forEach((s) => {
|
|
1637
1757
|
try {
|
|
1638
|
-
this.emit(
|
|
1758
|
+
this.emit(U.Input, s, t[s]);
|
|
1639
1759
|
} catch (i) {
|
|
1640
|
-
console.error(`Error emitting input ${s}: ${i}`), this.emit(
|
|
1760
|
+
console.error(`Error emitting input ${s}: ${i}`), this.emit(U.Error, `Error emitting input ${s}: ${i}`);
|
|
1641
1761
|
}
|
|
1642
1762
|
});
|
|
1643
1763
|
try {
|
|
1644
|
-
this.emit(
|
|
1764
|
+
this.emit(U.Inputs, t);
|
|
1645
1765
|
} catch (s) {
|
|
1646
|
-
console.error(`Error emitting inputs: ${s}`), this.emit(
|
|
1766
|
+
console.error(`Error emitting inputs: ${s}`), this.emit(U.Error, `Error emitting inputs: ${s}`);
|
|
1647
1767
|
}
|
|
1648
1768
|
}
|
|
1649
1769
|
}
|
|
1650
|
-
getInput(
|
|
1651
|
-
return console.assert(!!
|
|
1770
|
+
getInput(t) {
|
|
1771
|
+
return console.assert(!!t), this._inputPipeValues[t];
|
|
1652
1772
|
}
|
|
1653
1773
|
getInputs() {
|
|
1654
1774
|
return this._inputPipeValues;
|
|
1655
1775
|
}
|
|
1656
|
-
setOutput(
|
|
1657
|
-
console.assert(!!
|
|
1776
|
+
setOutput(t, n) {
|
|
1777
|
+
console.assert(!!t);
|
|
1658
1778
|
var s = {};
|
|
1659
|
-
s[
|
|
1779
|
+
s[t] = n, this.setOutputs(s);
|
|
1660
1780
|
}
|
|
1661
|
-
async setOutputs(
|
|
1662
|
-
this.isInputOutputBlobSerialization && (
|
|
1663
|
-
const n =
|
|
1664
|
-
this._outputPipeValues =
|
|
1781
|
+
async setOutputs(t) {
|
|
1782
|
+
this.isInputOutputBlobSerialization && (t = await We(t));
|
|
1783
|
+
const n = t;
|
|
1784
|
+
this._outputPipeValues = ze(this._outputPipeValues, t), this._outputPipeValues !== n && this._state === re.Ready && this.sendRpc(X.OutputsUpdate, t);
|
|
1665
1785
|
}
|
|
1666
1786
|
disableNotifyOnHashUrlChange() {
|
|
1667
1787
|
window.removeEventListener("hashchange", this._onHashUrlChange);
|
|
1668
1788
|
}
|
|
1669
|
-
_onHashUrlChange(
|
|
1789
|
+
_onHashUrlChange(t) {
|
|
1670
1790
|
const n = {
|
|
1671
1791
|
hash: window.location.hash,
|
|
1672
1792
|
metaframe: this.id
|
|
1673
1793
|
};
|
|
1674
|
-
this.sendRpc(
|
|
1794
|
+
this.sendRpc(X.HashParamsUpdate, n);
|
|
1675
1795
|
}
|
|
1676
|
-
sendRpc(
|
|
1796
|
+
sendRpc(t, n) {
|
|
1677
1797
|
if (this._isIframe) {
|
|
1678
1798
|
const s = {
|
|
1679
1799
|
jsonrpc: "2.0",
|
|
1680
1800
|
id: ++this._messageSendCount,
|
|
1681
|
-
method:
|
|
1801
|
+
method: t,
|
|
1682
1802
|
params: n,
|
|
1683
1803
|
iframeId: this.id,
|
|
1684
1804
|
parentId: this._parentId
|
|
@@ -1687,46 +1807,974 @@ class L extends De.EventEmitter {
|
|
|
1687
1807
|
} else
|
|
1688
1808
|
this.log("Cannot send JSON-RPC window message: there is no window.parent which means we are not an iframe");
|
|
1689
1809
|
}
|
|
1690
|
-
onMessage(
|
|
1691
|
-
if (typeof
|
|
1692
|
-
let s =
|
|
1810
|
+
onMessage(t) {
|
|
1811
|
+
if (typeof t.data == "object") {
|
|
1812
|
+
let s = t.data;
|
|
1693
1813
|
if (s.jsonrpc === "2.0") {
|
|
1694
1814
|
var n = s.method;
|
|
1695
|
-
if (!(n ==
|
|
1815
|
+
if (!(n == fe.SetupIframeServerResponse || s.parentId == this._parentId && s.iframeId == this.id)) {
|
|
1696
1816
|
this.log(`window.message: received message but jsonrpc.parentId=${s.parentId} _parentId=${this._parentId} jsonrpc.iframeId=${s.iframeId} id=${this.id}`);
|
|
1697
1817
|
return;
|
|
1698
1818
|
}
|
|
1699
1819
|
switch (n) {
|
|
1700
|
-
case
|
|
1820
|
+
case fe.SetupIframeServerResponse:
|
|
1701
1821
|
this._resolveSetupIframeServerResponse(s.params);
|
|
1702
1822
|
break;
|
|
1703
|
-
case
|
|
1704
|
-
if (this._state !==
|
|
1823
|
+
case fe.InputsUpdate:
|
|
1824
|
+
if (this._state !== re.Ready)
|
|
1705
1825
|
throw "Got InputsUpdate but metaframe is not MetaframeLoadingState.Ready";
|
|
1706
1826
|
this.setInternalInputsAndNotify(s.params.inputs);
|
|
1707
1827
|
break;
|
|
1708
|
-
case
|
|
1828
|
+
case fe.MessageAck:
|
|
1709
1829
|
this.debug && this.log(`ACK: ${JSON.stringify(s)}`);
|
|
1710
1830
|
break;
|
|
1711
1831
|
default:
|
|
1712
1832
|
this.debug && this.log(`window.message: unknown JSON-RPC method: ${JSON.stringify(s)}`);
|
|
1713
1833
|
break;
|
|
1714
1834
|
}
|
|
1715
|
-
this.emit(
|
|
1835
|
+
this.listenerCount(U.Message) > 0 && this.emit(U.Message, s);
|
|
1716
1836
|
}
|
|
1717
1837
|
}
|
|
1718
1838
|
}
|
|
1839
|
+
setParameter(t, n) {
|
|
1840
|
+
Ae(t, n);
|
|
1841
|
+
}
|
|
1842
|
+
getParameter(t) {
|
|
1843
|
+
return ms(t);
|
|
1844
|
+
}
|
|
1845
|
+
setParameterBoolean(t, n) {
|
|
1846
|
+
Ms(t, n);
|
|
1847
|
+
}
|
|
1848
|
+
getParameterBoolean(t) {
|
|
1849
|
+
return Is(t);
|
|
1850
|
+
}
|
|
1851
|
+
setParameterJson(t, n) {
|
|
1852
|
+
bs(t, n);
|
|
1853
|
+
}
|
|
1854
|
+
getParameterJson(t) {
|
|
1855
|
+
return vs(t);
|
|
1856
|
+
}
|
|
1857
|
+
setParameterBase64(t, n) {
|
|
1858
|
+
$s(t, n);
|
|
1859
|
+
}
|
|
1860
|
+
getParameterBase64(t) {
|
|
1861
|
+
return xs(t);
|
|
1862
|
+
}
|
|
1863
|
+
setParameterFloat(t, n) {
|
|
1864
|
+
cn(t, n);
|
|
1865
|
+
}
|
|
1866
|
+
getParameterFloat(t) {
|
|
1867
|
+
return Rs(t);
|
|
1868
|
+
}
|
|
1869
|
+
setParameterInt(t, n) {
|
|
1870
|
+
As(t, n);
|
|
1871
|
+
}
|
|
1872
|
+
getParameterInt(t) {
|
|
1873
|
+
return Ss(t);
|
|
1874
|
+
}
|
|
1875
|
+
deleteParameter(t) {
|
|
1876
|
+
Ae(t, void 0);
|
|
1877
|
+
}
|
|
1719
1878
|
}
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1879
|
+
te.version = An;
|
|
1880
|
+
te.ERROR = U.Error;
|
|
1881
|
+
te.CONNECTED = U.Connected;
|
|
1882
|
+
te.INPUT = U.Input;
|
|
1883
|
+
te.INPUTS = U.Inputs;
|
|
1884
|
+
te.MESSAGE = U.Message;
|
|
1885
|
+
te.deserializeInputs = Ce;
|
|
1886
|
+
te.serializeInputs = We;
|
|
1887
|
+
var Ke = {};
|
|
1888
|
+
const ie = "\\\\/", Nt = `[^${ie}]`, ce = "\\.", ks = "\\+", js = "\\?", Xe = "\\/", Us = "(?=.)", dn = "[^/]", At = `(?:${Xe}|$)`, mn = `(?:^|${Xe})`, St = `${ce}{1,2}${At}`, Bs = `(?!${ce})`, Fs = `(?!${mn}${St})`, zs = `(?!${ce}{0,1}${At})`, Gs = `(?!${St})`, Vs = `[^.${Xe}]`, Js = `${dn}*?`, Ws = "/", yn = {
|
|
1889
|
+
DOT_LITERAL: ce,
|
|
1890
|
+
PLUS_LITERAL: ks,
|
|
1891
|
+
QMARK_LITERAL: js,
|
|
1892
|
+
SLASH_LITERAL: Xe,
|
|
1893
|
+
ONE_CHAR: Us,
|
|
1894
|
+
QMARK: dn,
|
|
1895
|
+
END_ANCHOR: At,
|
|
1896
|
+
DOTS_SLASH: St,
|
|
1897
|
+
NO_DOT: Bs,
|
|
1898
|
+
NO_DOTS: Fs,
|
|
1899
|
+
NO_DOT_SLASH: zs,
|
|
1900
|
+
NO_DOTS_SLASH: Gs,
|
|
1901
|
+
QMARK_NO_DOT: Vs,
|
|
1902
|
+
STAR: Js,
|
|
1903
|
+
START_ANCHOR: mn,
|
|
1904
|
+
SEP: Ws
|
|
1905
|
+
}, Ks = {
|
|
1906
|
+
...yn,
|
|
1907
|
+
SLASH_LITERAL: `[${ie}]`,
|
|
1908
|
+
QMARK: Nt,
|
|
1909
|
+
STAR: `${Nt}*?`,
|
|
1910
|
+
DOTS_SLASH: `${ce}{1,2}(?:[${ie}]|$)`,
|
|
1911
|
+
NO_DOT: `(?!${ce})`,
|
|
1912
|
+
NO_DOTS: `(?!(?:^|[${ie}])${ce}{1,2}(?:[${ie}]|$))`,
|
|
1913
|
+
NO_DOT_SLASH: `(?!${ce}{0,1}(?:[${ie}]|$))`,
|
|
1914
|
+
NO_DOTS_SLASH: `(?!${ce}{1,2}(?:[${ie}]|$))`,
|
|
1915
|
+
QMARK_NO_DOT: `[^.${ie}]`,
|
|
1916
|
+
START_ANCHOR: `(?:^|[${ie}])`,
|
|
1917
|
+
END_ANCHOR: `(?:[${ie}]|$)`,
|
|
1918
|
+
SEP: "\\"
|
|
1919
|
+
}, Xs = {
|
|
1920
|
+
alnum: "a-zA-Z0-9",
|
|
1921
|
+
alpha: "a-zA-Z",
|
|
1922
|
+
ascii: "\\x00-\\x7F",
|
|
1923
|
+
blank: " \\t",
|
|
1924
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
1925
|
+
digit: "0-9",
|
|
1926
|
+
graph: "\\x21-\\x7E",
|
|
1927
|
+
lower: "a-z",
|
|
1928
|
+
print: "\\x20-\\x7E ",
|
|
1929
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
1930
|
+
space: " \\t\\r\\n\\v\\f",
|
|
1931
|
+
upper: "A-Z",
|
|
1932
|
+
word: "A-Za-z0-9_",
|
|
1933
|
+
xdigit: "A-Fa-f0-9"
|
|
1934
|
+
};
|
|
1935
|
+
var qe = {
|
|
1936
|
+
MAX_LENGTH: 1024 * 64,
|
|
1937
|
+
POSIX_REGEX_SOURCE: Xs,
|
|
1938
|
+
// regular expressions
|
|
1939
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
1940
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
1941
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
1942
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
1943
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
1944
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
1945
|
+
// Replace globs with equivalent patterns to reduce parsing time.
|
|
1946
|
+
REPLACEMENTS: {
|
|
1947
|
+
"***": "*",
|
|
1948
|
+
"**/**": "**",
|
|
1949
|
+
"**/**/**": "**"
|
|
1950
|
+
},
|
|
1951
|
+
// Digits
|
|
1952
|
+
CHAR_0: 48,
|
|
1953
|
+
/* 0 */
|
|
1954
|
+
CHAR_9: 57,
|
|
1955
|
+
/* 9 */
|
|
1956
|
+
// Alphabet chars.
|
|
1957
|
+
CHAR_UPPERCASE_A: 65,
|
|
1958
|
+
/* A */
|
|
1959
|
+
CHAR_LOWERCASE_A: 97,
|
|
1960
|
+
/* a */
|
|
1961
|
+
CHAR_UPPERCASE_Z: 90,
|
|
1962
|
+
/* Z */
|
|
1963
|
+
CHAR_LOWERCASE_Z: 122,
|
|
1964
|
+
/* z */
|
|
1965
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
1966
|
+
/* ( */
|
|
1967
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
1968
|
+
/* ) */
|
|
1969
|
+
CHAR_ASTERISK: 42,
|
|
1970
|
+
/* * */
|
|
1971
|
+
// Non-alphabetic chars.
|
|
1972
|
+
CHAR_AMPERSAND: 38,
|
|
1973
|
+
/* & */
|
|
1974
|
+
CHAR_AT: 64,
|
|
1975
|
+
/* @ */
|
|
1976
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
1977
|
+
/* \ */
|
|
1978
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
1979
|
+
/* \r */
|
|
1980
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
1981
|
+
/* ^ */
|
|
1982
|
+
CHAR_COLON: 58,
|
|
1983
|
+
/* : */
|
|
1984
|
+
CHAR_COMMA: 44,
|
|
1985
|
+
/* , */
|
|
1986
|
+
CHAR_DOT: 46,
|
|
1987
|
+
/* . */
|
|
1988
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
1989
|
+
/* " */
|
|
1990
|
+
CHAR_EQUAL: 61,
|
|
1991
|
+
/* = */
|
|
1992
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
1993
|
+
/* ! */
|
|
1994
|
+
CHAR_FORM_FEED: 12,
|
|
1995
|
+
/* \f */
|
|
1996
|
+
CHAR_FORWARD_SLASH: 47,
|
|
1997
|
+
/* / */
|
|
1998
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
1999
|
+
/* ` */
|
|
2000
|
+
CHAR_HASH: 35,
|
|
2001
|
+
/* # */
|
|
2002
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
2003
|
+
/* - */
|
|
2004
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
2005
|
+
/* < */
|
|
2006
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
2007
|
+
/* { */
|
|
2008
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
2009
|
+
/* [ */
|
|
2010
|
+
CHAR_LINE_FEED: 10,
|
|
2011
|
+
/* \n */
|
|
2012
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
2013
|
+
/* \u00A0 */
|
|
2014
|
+
CHAR_PERCENT: 37,
|
|
2015
|
+
/* % */
|
|
2016
|
+
CHAR_PLUS: 43,
|
|
2017
|
+
/* + */
|
|
2018
|
+
CHAR_QUESTION_MARK: 63,
|
|
2019
|
+
/* ? */
|
|
2020
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
2021
|
+
/* > */
|
|
2022
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
2023
|
+
/* } */
|
|
2024
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
2025
|
+
/* ] */
|
|
2026
|
+
CHAR_SEMICOLON: 59,
|
|
2027
|
+
/* ; */
|
|
2028
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
2029
|
+
/* ' */
|
|
2030
|
+
CHAR_SPACE: 32,
|
|
2031
|
+
/* */
|
|
2032
|
+
CHAR_TAB: 9,
|
|
2033
|
+
/* \t */
|
|
2034
|
+
CHAR_UNDERSCORE: 95,
|
|
2035
|
+
/* _ */
|
|
2036
|
+
CHAR_VERTICAL_LINE: 124,
|
|
2037
|
+
/* | */
|
|
2038
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
2039
|
+
/* \uFEFF */
|
|
2040
|
+
/**
|
|
2041
|
+
* Create EXTGLOB_CHARS
|
|
2042
|
+
*/
|
|
2043
|
+
extglobChars(e) {
|
|
2044
|
+
return {
|
|
2045
|
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${e.STAR})` },
|
|
2046
|
+
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
2047
|
+
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
2048
|
+
"*": { type: "star", open: "(?:", close: ")*" },
|
|
2049
|
+
"@": { type: "at", open: "(?:", close: ")" }
|
|
2050
|
+
};
|
|
2051
|
+
},
|
|
2052
|
+
/**
|
|
2053
|
+
* Create GLOB_CHARS
|
|
2054
|
+
*/
|
|
2055
|
+
globChars(e) {
|
|
2056
|
+
return e === !0 ? Ks : yn;
|
|
2057
|
+
}
|
|
2058
|
+
};
|
|
2059
|
+
(function(e) {
|
|
2060
|
+
const {
|
|
2061
|
+
REGEX_BACKSLASH: t,
|
|
2062
|
+
REGEX_REMOVE_BACKSLASH: n,
|
|
2063
|
+
REGEX_SPECIAL_CHARS: s,
|
|
2064
|
+
REGEX_SPECIAL_CHARS_GLOBAL: i
|
|
2065
|
+
} = qe;
|
|
2066
|
+
e.isObject = (o) => o !== null && typeof o == "object" && !Array.isArray(o), e.hasRegexChars = (o) => s.test(o), e.isRegexChar = (o) => o.length === 1 && e.hasRegexChars(o), e.escapeRegex = (o) => o.replace(i, "\\$1"), e.toPosixSlashes = (o) => o.replace(t, "/"), e.removeBackslashes = (o) => o.replace(n, (r) => r === "\\" ? "" : r), e.supportsLookbehinds = () => {
|
|
2067
|
+
const o = process.version.slice(1).split(".").map(Number);
|
|
2068
|
+
return o.length === 3 && o[0] >= 9 || o[0] === 8 && o[1] >= 10;
|
|
2069
|
+
}, e.escapeLast = (o, r, a) => {
|
|
2070
|
+
const u = o.lastIndexOf(r, a);
|
|
2071
|
+
return u === -1 ? o : o[u - 1] === "\\" ? e.escapeLast(o, r, u - 1) : `${o.slice(0, u)}\\${o.slice(u)}`;
|
|
2072
|
+
}, e.removePrefix = (o, r = {}) => {
|
|
2073
|
+
let a = o;
|
|
2074
|
+
return a.startsWith("./") && (a = a.slice(2), r.prefix = "./"), a;
|
|
2075
|
+
}, e.wrapOutput = (o, r = {}, a = {}) => {
|
|
2076
|
+
const u = a.contains ? "" : "^", f = a.contains ? "" : "$";
|
|
2077
|
+
let c = `${u}(?:${o})${f}`;
|
|
2078
|
+
return r.negated === !0 && (c = `(?:^(?!${c}).*$)`), c;
|
|
2079
|
+
}, e.basename = (o, { windows: r } = {}) => r ? o.replace(/[\\/]$/, "").replace(/.*[\\/]/, "") : o.replace(/\/$/, "").replace(/.*\//, "");
|
|
2080
|
+
})(Ke);
|
|
2081
|
+
const kt = Ke, {
|
|
2082
|
+
CHAR_ASTERISK: et,
|
|
2083
|
+
/* * */
|
|
2084
|
+
CHAR_AT: qs,
|
|
2085
|
+
/* @ */
|
|
2086
|
+
CHAR_BACKWARD_SLASH: Me,
|
|
2087
|
+
/* \ */
|
|
2088
|
+
CHAR_COMMA: Qs,
|
|
2089
|
+
/* , */
|
|
2090
|
+
CHAR_DOT: tt,
|
|
2091
|
+
/* . */
|
|
2092
|
+
CHAR_EXCLAMATION_MARK: jt,
|
|
2093
|
+
/* ! */
|
|
2094
|
+
CHAR_FORWARD_SLASH: _n,
|
|
2095
|
+
/* / */
|
|
2096
|
+
CHAR_LEFT_CURLY_BRACE: nt,
|
|
2097
|
+
/* { */
|
|
2098
|
+
CHAR_LEFT_PARENTHESES: st,
|
|
2099
|
+
/* ( */
|
|
2100
|
+
CHAR_LEFT_SQUARE_BRACKET: Ys,
|
|
2101
|
+
/* [ */
|
|
2102
|
+
CHAR_PLUS: Zs,
|
|
2103
|
+
/* + */
|
|
2104
|
+
CHAR_QUESTION_MARK: Ut,
|
|
2105
|
+
/* ? */
|
|
2106
|
+
CHAR_RIGHT_CURLY_BRACE: ei,
|
|
2107
|
+
/* } */
|
|
2108
|
+
CHAR_RIGHT_PARENTHESES: Bt,
|
|
2109
|
+
/* ) */
|
|
2110
|
+
CHAR_RIGHT_SQUARE_BRACKET: ti
|
|
2111
|
+
/* ] */
|
|
2112
|
+
} = qe, Ft = (e) => e === _n || e === Me, zt = (e) => {
|
|
2113
|
+
e.isPrefix !== !0 && (e.depth = e.isGlobstar ? 1 / 0 : 1);
|
|
2114
|
+
}, ni = (e, t) => {
|
|
2115
|
+
const n = t || {}, s = e.length - 1, i = n.parts === !0 || n.scanToEnd === !0, o = [], r = [], a = [];
|
|
2116
|
+
let u = e, f = -1, c = 0, d = 0, y = !1, w = !1, _ = !1, S = !1, v = !1, x = !1, b = !1, A = !1, M = !1, R = 0, D, O, L = { value: "", depth: 0, isGlob: !1 };
|
|
2117
|
+
const z = () => f >= s, h = () => u.charCodeAt(f + 1), N = () => (D = O, u.charCodeAt(++f));
|
|
2118
|
+
for (; f < s; ) {
|
|
2119
|
+
O = N();
|
|
2120
|
+
let J;
|
|
2121
|
+
if (O === Me) {
|
|
2122
|
+
b = L.backslashes = !0, O = N(), O === nt && (x = !0);
|
|
2123
|
+
continue;
|
|
2124
|
+
}
|
|
2125
|
+
if (x === !0 || O === nt) {
|
|
2126
|
+
for (R++; z() !== !0 && (O = N()); ) {
|
|
2127
|
+
if (O === Me) {
|
|
2128
|
+
b = L.backslashes = !0, N();
|
|
2129
|
+
continue;
|
|
2130
|
+
}
|
|
2131
|
+
if (O === nt) {
|
|
2132
|
+
R++;
|
|
2133
|
+
continue;
|
|
2134
|
+
}
|
|
2135
|
+
if (x !== !0 && O === tt && (O = N()) === tt) {
|
|
2136
|
+
if (y = L.isBrace = !0, _ = L.isGlob = !0, M = !0, i === !0)
|
|
2137
|
+
continue;
|
|
2138
|
+
break;
|
|
2139
|
+
}
|
|
2140
|
+
if (x !== !0 && O === Qs) {
|
|
2141
|
+
if (y = L.isBrace = !0, _ = L.isGlob = !0, M = !0, i === !0)
|
|
2142
|
+
continue;
|
|
2143
|
+
break;
|
|
2144
|
+
}
|
|
2145
|
+
if (O === ei && (R--, R === 0)) {
|
|
2146
|
+
x = !1, y = L.isBrace = !0, M = !0;
|
|
2147
|
+
break;
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
if (i === !0)
|
|
2151
|
+
continue;
|
|
2152
|
+
break;
|
|
2153
|
+
}
|
|
2154
|
+
if (O === _n) {
|
|
2155
|
+
if (o.push(f), r.push(L), L = { value: "", depth: 0, isGlob: !1 }, M === !0)
|
|
2156
|
+
continue;
|
|
2157
|
+
if (D === tt && f === c + 1) {
|
|
2158
|
+
c += 2;
|
|
2159
|
+
continue;
|
|
2160
|
+
}
|
|
2161
|
+
d = f + 1;
|
|
2162
|
+
continue;
|
|
2163
|
+
}
|
|
2164
|
+
if (n.noext !== !0 && (O === Zs || O === qs || O === et || O === Ut || O === jt) === !0 && h() === st) {
|
|
2165
|
+
if (_ = L.isGlob = !0, S = L.isExtglob = !0, M = !0, i === !0) {
|
|
2166
|
+
for (; z() !== !0 && (O = N()); ) {
|
|
2167
|
+
if (O === Me) {
|
|
2168
|
+
b = L.backslashes = !0, O = N();
|
|
2169
|
+
continue;
|
|
2170
|
+
}
|
|
2171
|
+
if (O === Bt) {
|
|
2172
|
+
_ = L.isGlob = !0, M = !0;
|
|
2173
|
+
break;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
continue;
|
|
2177
|
+
}
|
|
2178
|
+
break;
|
|
2179
|
+
}
|
|
2180
|
+
if (O === et) {
|
|
2181
|
+
if (D === et && (v = L.isGlobstar = !0), _ = L.isGlob = !0, M = !0, i === !0)
|
|
2182
|
+
continue;
|
|
2183
|
+
break;
|
|
2184
|
+
}
|
|
2185
|
+
if (O === Ut) {
|
|
2186
|
+
if (_ = L.isGlob = !0, M = !0, i === !0)
|
|
2187
|
+
continue;
|
|
2188
|
+
break;
|
|
2189
|
+
}
|
|
2190
|
+
if (O === Ys)
|
|
2191
|
+
for (; z() !== !0 && (J = N()); ) {
|
|
2192
|
+
if (J === Me) {
|
|
2193
|
+
b = L.backslashes = !0, N();
|
|
2194
|
+
continue;
|
|
2195
|
+
}
|
|
2196
|
+
if (J === ti) {
|
|
2197
|
+
if (w = L.isBracket = !0, _ = L.isGlob = !0, M = !0, i === !0)
|
|
2198
|
+
continue;
|
|
2199
|
+
break;
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
if (n.nonegate !== !0 && O === jt && f === c) {
|
|
2203
|
+
A = L.negated = !0, c++;
|
|
2204
|
+
continue;
|
|
2205
|
+
}
|
|
2206
|
+
if (n.noparen !== !0 && O === st) {
|
|
2207
|
+
if (_ = L.isGlob = !0, i === !0) {
|
|
2208
|
+
for (; z() !== !0 && (O = N()); ) {
|
|
2209
|
+
if (O === st) {
|
|
2210
|
+
b = L.backslashes = !0, O = N();
|
|
2211
|
+
continue;
|
|
2212
|
+
}
|
|
2213
|
+
if (O === Bt) {
|
|
2214
|
+
M = !0;
|
|
2215
|
+
break;
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
continue;
|
|
2219
|
+
}
|
|
2220
|
+
break;
|
|
2221
|
+
}
|
|
2222
|
+
if (_ === !0) {
|
|
2223
|
+
if (M = !0, i === !0)
|
|
2224
|
+
continue;
|
|
2225
|
+
break;
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
n.noext === !0 && (S = !1, _ = !1);
|
|
2229
|
+
let H = u, he = "", l = "";
|
|
2230
|
+
c > 0 && (he = u.slice(0, c), u = u.slice(c), d -= c), H && _ === !0 && d > 0 ? (H = u.slice(0, d), l = u.slice(d)) : _ === !0 ? (H = "", l = u) : H = u, H && H !== "" && H !== "/" && H !== u && Ft(H.charCodeAt(H.length - 1)) && (H = H.slice(0, -1)), n.unescape === !0 && (l && (l = kt.removeBackslashes(l)), H && b === !0 && (H = kt.removeBackslashes(H)));
|
|
2231
|
+
const p = {
|
|
2232
|
+
prefix: he,
|
|
2233
|
+
input: e,
|
|
2234
|
+
start: c,
|
|
2235
|
+
base: H,
|
|
2236
|
+
glob: l,
|
|
2237
|
+
isBrace: y,
|
|
2238
|
+
isBracket: w,
|
|
2239
|
+
isGlob: _,
|
|
2240
|
+
isExtglob: S,
|
|
2241
|
+
isGlobstar: v,
|
|
2242
|
+
negated: A
|
|
2243
|
+
};
|
|
2244
|
+
if (n.tokens === !0 && (p.maxDepth = 0, Ft(O) || r.push(L), p.tokens = r), n.parts === !0 || n.tokens === !0) {
|
|
2245
|
+
let J;
|
|
2246
|
+
for (let T = 0; T < o.length; T++) {
|
|
2247
|
+
const se = J ? J + 1 : c, ae = o[T], q = e.slice(se, ae);
|
|
2248
|
+
n.tokens && (T === 0 && c !== 0 ? (r[T].isPrefix = !0, r[T].value = he) : r[T].value = q, zt(r[T]), p.maxDepth += r[T].depth), (T !== 0 || q !== "") && a.push(q), J = ae;
|
|
2249
|
+
}
|
|
2250
|
+
if (J && J + 1 < e.length) {
|
|
2251
|
+
const T = e.slice(J + 1);
|
|
2252
|
+
a.push(T), n.tokens && (r[r.length - 1].value = T, zt(r[r.length - 1]), p.maxDepth += r[r.length - 1].depth);
|
|
2253
|
+
}
|
|
2254
|
+
p.slashes = o, p.parts = a;
|
|
2255
|
+
}
|
|
2256
|
+
return p;
|
|
2257
|
+
};
|
|
2258
|
+
var si = ni;
|
|
2259
|
+
const Ge = qe, Z = Ke, {
|
|
2260
|
+
MAX_LENGTH: Ve,
|
|
2261
|
+
POSIX_REGEX_SOURCE: ii,
|
|
2262
|
+
REGEX_NON_SPECIAL_CHARS: ri,
|
|
2263
|
+
REGEX_SPECIAL_CHARS_BACKREF: oi,
|
|
2264
|
+
REPLACEMENTS: gn
|
|
2265
|
+
} = Ge, ai = (e, t) => {
|
|
2266
|
+
if (typeof t.expandRange == "function")
|
|
2267
|
+
return t.expandRange(...e, t);
|
|
2268
|
+
e.sort();
|
|
2269
|
+
const n = `[${e.join("-")}]`;
|
|
2270
|
+
try {
|
|
2271
|
+
new RegExp(n);
|
|
2272
|
+
} catch {
|
|
2273
|
+
return e.map((i) => Z.escapeRegex(i)).join("..");
|
|
2274
|
+
}
|
|
2275
|
+
return n;
|
|
2276
|
+
}, ve = (e, t) => `Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`, bn = (e, t) => {
|
|
2277
|
+
if (typeof e != "string")
|
|
2278
|
+
throw new TypeError("Expected a string");
|
|
2279
|
+
e = gn[e] || e;
|
|
2280
|
+
const n = { ...t }, s = typeof n.maxLength == "number" ? Math.min(Ve, n.maxLength) : Ve;
|
|
2281
|
+
let i = e.length;
|
|
2282
|
+
if (i > s)
|
|
2283
|
+
throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${s}`);
|
|
2284
|
+
const o = { type: "bos", value: "", output: n.prepend || "" }, r = [o], a = n.capture ? "" : "?:", u = Ge.globChars(n.windows), f = Ge.extglobChars(u), {
|
|
2285
|
+
DOT_LITERAL: c,
|
|
2286
|
+
PLUS_LITERAL: d,
|
|
2287
|
+
SLASH_LITERAL: y,
|
|
2288
|
+
ONE_CHAR: w,
|
|
2289
|
+
DOTS_SLASH: _,
|
|
2290
|
+
NO_DOT: S,
|
|
2291
|
+
NO_DOT_SLASH: v,
|
|
2292
|
+
NO_DOTS_SLASH: x,
|
|
2293
|
+
QMARK: b,
|
|
2294
|
+
QMARK_NO_DOT: A,
|
|
2295
|
+
STAR: M,
|
|
2296
|
+
START_ANCHOR: R
|
|
2297
|
+
} = u, D = (g) => `(${a}(?:(?!${R}${g.dot ? _ : c}).)*?)`, O = n.dot ? "" : S, L = n.dot ? b : A;
|
|
2298
|
+
let z = n.bash === !0 ? D(n) : M;
|
|
2299
|
+
n.capture && (z = `(${z})`), typeof n.noext == "boolean" && (n.noextglob = n.noext);
|
|
2300
|
+
const h = {
|
|
2301
|
+
input: e,
|
|
2302
|
+
index: -1,
|
|
2303
|
+
start: 0,
|
|
2304
|
+
dot: n.dot === !0,
|
|
2305
|
+
consumed: "",
|
|
2306
|
+
output: "",
|
|
2307
|
+
prefix: "",
|
|
2308
|
+
backtrack: !1,
|
|
2309
|
+
negated: !1,
|
|
2310
|
+
brackets: 0,
|
|
2311
|
+
braces: 0,
|
|
2312
|
+
parens: 0,
|
|
2313
|
+
quotes: 0,
|
|
2314
|
+
globstar: !1,
|
|
2315
|
+
tokens: r
|
|
2316
|
+
};
|
|
2317
|
+
e = Z.removePrefix(e, h), i = e.length;
|
|
2318
|
+
const N = [], H = [], he = [];
|
|
2319
|
+
let l = o, p;
|
|
2320
|
+
const J = () => h.index === i - 1, T = h.peek = (g = 1) => e[h.index + g], se = h.advance = () => e[++h.index], ae = () => e.slice(h.index + 1), q = (g = "", k = 0) => {
|
|
2321
|
+
h.consumed += g, h.index += k;
|
|
2322
|
+
}, Te = (g) => {
|
|
2323
|
+
h.output += g.output != null ? g.output : g.value, q(g.value);
|
|
2324
|
+
}, Rn = () => {
|
|
2325
|
+
let g = 1;
|
|
2326
|
+
for (; T() === "!" && (T(2) !== "(" || T(3) === "?"); )
|
|
2327
|
+
se(), h.start++, g++;
|
|
2328
|
+
return g % 2 === 0 ? !1 : (h.negated = !0, h.start++, !0);
|
|
2329
|
+
}, De = (g) => {
|
|
2330
|
+
h[g]++, he.push(g);
|
|
2331
|
+
}, me = (g) => {
|
|
2332
|
+
h[g]--, he.pop();
|
|
2333
|
+
}, I = (g) => {
|
|
2334
|
+
if (l.type === "globstar") {
|
|
2335
|
+
const k = h.braces > 0 && (g.type === "comma" || g.type === "brace"), m = g.extglob === !0 || N.length && (g.type === "pipe" || g.type === "paren");
|
|
2336
|
+
g.type !== "slash" && g.type !== "paren" && !k && !m && (h.output = h.output.slice(0, -l.output.length), l.type = "star", l.value = "*", l.output = z, h.output += l.output);
|
|
2337
|
+
}
|
|
2338
|
+
if (N.length && g.type !== "paren" && !f[g.value] && (N[N.length - 1].inner += g.value), (g.value || g.output) && Te(g), l && l.type === "text" && g.type === "text") {
|
|
2339
|
+
l.value += g.value, l.output = (l.output || "") + g.value;
|
|
2340
|
+
return;
|
|
2341
|
+
}
|
|
2342
|
+
g.prev = l, r.push(g), l = g;
|
|
2343
|
+
}, He = (g, k) => {
|
|
2344
|
+
const m = { ...f[k], conditions: 1, inner: "" };
|
|
2345
|
+
m.prev = l, m.parens = h.parens, m.output = h.output;
|
|
2346
|
+
const P = (n.capture ? "(" : "") + m.open;
|
|
2347
|
+
De("parens"), I({ type: g, value: k, output: h.output ? "" : w }), I({ type: "paren", extglob: !0, value: se(), output: P }), N.push(m);
|
|
2348
|
+
}, On = (g) => {
|
|
2349
|
+
let k = g.close + (n.capture ? ")" : "");
|
|
2350
|
+
if (g.type === "negate") {
|
|
2351
|
+
let m = z;
|
|
2352
|
+
g.inner && g.inner.length > 1 && g.inner.includes("/") && (m = D(n)), (m !== z || J() || /^\)+$/.test(ae())) && (k = g.close = `)$))${m}`), g.prev.type === "bos" && J() && (h.negatedExtglob = !0);
|
|
2353
|
+
}
|
|
2354
|
+
I({ type: "paren", extglob: !0, value: p, output: k }), me("parens");
|
|
2355
|
+
};
|
|
2356
|
+
if (n.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(e)) {
|
|
2357
|
+
let g = !1, k = e.replace(oi, (m, P, j, W, G, Qe) => W === "\\" ? (g = !0, m) : W === "?" ? P ? P + W + (G ? b.repeat(G.length) : "") : Qe === 0 ? L + (G ? b.repeat(G.length) : "") : b.repeat(j.length) : W === "." ? c.repeat(j.length) : W === "*" ? P ? P + W + (G ? z : "") : z : P ? m : `\\${m}`);
|
|
2358
|
+
return g === !0 && (n.unescape === !0 ? k = k.replace(/\\/g, "") : k = k.replace(/\\+/g, (m) => m.length % 2 === 0 ? "\\\\" : m ? "\\" : "")), k === e && n.contains === !0 ? (h.output = e, h) : (h.output = Z.wrapOutput(k, h, t), h);
|
|
2359
|
+
}
|
|
2360
|
+
for (; !J(); ) {
|
|
2361
|
+
if (p = se(), p === "\0")
|
|
2362
|
+
continue;
|
|
2363
|
+
if (p === "\\") {
|
|
2364
|
+
const m = T();
|
|
2365
|
+
if (m === "/" && n.bash !== !0 || m === "." || m === ";")
|
|
2366
|
+
continue;
|
|
2367
|
+
if (!m) {
|
|
2368
|
+
p += "\\", I({ type: "text", value: p });
|
|
2369
|
+
continue;
|
|
2370
|
+
}
|
|
2371
|
+
const P = /^\\+/.exec(ae());
|
|
2372
|
+
let j = 0;
|
|
2373
|
+
if (P && P[0].length > 2 && (j = P[0].length, h.index += j, j % 2 !== 0 && (p += "\\")), n.unescape === !0 ? p = se() || "" : p += se() || "", h.brackets === 0) {
|
|
2374
|
+
I({ type: "text", value: p });
|
|
2375
|
+
continue;
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
if (h.brackets > 0 && (p !== "]" || l.value === "[" || l.value === "[^")) {
|
|
2379
|
+
if (n.posix !== !1 && p === ":") {
|
|
2380
|
+
const m = l.value.slice(1);
|
|
2381
|
+
if (m.includes("[") && (l.posix = !0, m.includes(":"))) {
|
|
2382
|
+
const P = l.value.lastIndexOf("["), j = l.value.slice(0, P), W = l.value.slice(P + 2), G = ii[W];
|
|
2383
|
+
if (G) {
|
|
2384
|
+
l.value = j + G, h.backtrack = !0, se(), !o.output && r.indexOf(l) === 1 && (o.output = w);
|
|
2385
|
+
continue;
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
(p === "[" && T() !== ":" || p === "-" && T() === "]") && (p = `\\${p}`), p === "]" && (l.value === "[" || l.value === "[^") && (p = `\\${p}`), n.posix === !0 && p === "!" && l.value === "[" && (p = "^"), l.value += p, Te({ value: p });
|
|
2390
|
+
continue;
|
|
2391
|
+
}
|
|
2392
|
+
if (h.quotes === 1 && p !== '"') {
|
|
2393
|
+
p = Z.escapeRegex(p), l.value += p, Te({ value: p });
|
|
2394
|
+
continue;
|
|
2395
|
+
}
|
|
2396
|
+
if (p === '"') {
|
|
2397
|
+
h.quotes = h.quotes === 1 ? 0 : 1, n.keepQuotes === !0 && I({ type: "text", value: p });
|
|
2398
|
+
continue;
|
|
2399
|
+
}
|
|
2400
|
+
if (p === "(") {
|
|
2401
|
+
De("parens"), I({ type: "paren", value: p });
|
|
2402
|
+
continue;
|
|
2403
|
+
}
|
|
2404
|
+
if (p === ")") {
|
|
2405
|
+
if (h.parens === 0 && n.strictBrackets === !0)
|
|
2406
|
+
throw new SyntaxError(ve("opening", "("));
|
|
2407
|
+
const m = N[N.length - 1];
|
|
2408
|
+
if (m && h.parens === m.parens + 1) {
|
|
2409
|
+
On(N.pop());
|
|
2410
|
+
continue;
|
|
2411
|
+
}
|
|
2412
|
+
I({ type: "paren", value: p, output: h.parens ? ")" : "\\)" }), me("parens");
|
|
2413
|
+
continue;
|
|
2414
|
+
}
|
|
2415
|
+
if (p === "[") {
|
|
2416
|
+
if (n.nobracket === !0 || !ae().includes("]")) {
|
|
2417
|
+
if (n.nobracket !== !0 && n.strictBrackets === !0)
|
|
2418
|
+
throw new SyntaxError(ve("closing", "]"));
|
|
2419
|
+
p = `\\${p}`;
|
|
2420
|
+
} else
|
|
2421
|
+
De("brackets");
|
|
2422
|
+
I({ type: "bracket", value: p });
|
|
2423
|
+
continue;
|
|
2424
|
+
}
|
|
2425
|
+
if (p === "]") {
|
|
2426
|
+
if (n.nobracket === !0 || l && l.type === "bracket" && l.value.length === 1) {
|
|
2427
|
+
I({ type: "text", value: p, output: `\\${p}` });
|
|
2428
|
+
continue;
|
|
2429
|
+
}
|
|
2430
|
+
if (h.brackets === 0) {
|
|
2431
|
+
if (n.strictBrackets === !0)
|
|
2432
|
+
throw new SyntaxError(ve("opening", "["));
|
|
2433
|
+
I({ type: "text", value: p, output: `\\${p}` });
|
|
2434
|
+
continue;
|
|
2435
|
+
}
|
|
2436
|
+
me("brackets");
|
|
2437
|
+
const m = l.value.slice(1);
|
|
2438
|
+
if (l.posix !== !0 && m[0] === "^" && !m.includes("/") && (p = `/${p}`), l.value += p, Te({ value: p }), n.literalBrackets === !1 || Z.hasRegexChars(m))
|
|
2439
|
+
continue;
|
|
2440
|
+
const P = Z.escapeRegex(l.value);
|
|
2441
|
+
if (h.output = h.output.slice(0, -l.value.length), n.literalBrackets === !0) {
|
|
2442
|
+
h.output += P, l.value = P;
|
|
2443
|
+
continue;
|
|
2444
|
+
}
|
|
2445
|
+
l.value = `(${a}${P}|${l.value})`, h.output += l.value;
|
|
2446
|
+
continue;
|
|
2447
|
+
}
|
|
2448
|
+
if (p === "{" && n.nobrace !== !0) {
|
|
2449
|
+
De("braces");
|
|
2450
|
+
const m = {
|
|
2451
|
+
type: "brace",
|
|
2452
|
+
value: p,
|
|
2453
|
+
output: "(",
|
|
2454
|
+
outputIndex: h.output.length,
|
|
2455
|
+
tokensIndex: h.tokens.length
|
|
2456
|
+
};
|
|
2457
|
+
H.push(m), I(m);
|
|
2458
|
+
continue;
|
|
2459
|
+
}
|
|
2460
|
+
if (p === "}") {
|
|
2461
|
+
const m = H[H.length - 1];
|
|
2462
|
+
if (n.nobrace === !0 || !m) {
|
|
2463
|
+
I({ type: "text", value: p, output: p });
|
|
2464
|
+
continue;
|
|
2465
|
+
}
|
|
2466
|
+
let P = ")";
|
|
2467
|
+
if (m.dots === !0) {
|
|
2468
|
+
const j = r.slice(), W = [];
|
|
2469
|
+
for (let G = j.length - 1; G >= 0 && (r.pop(), j[G].type !== "brace"); G--)
|
|
2470
|
+
j[G].type !== "dots" && W.unshift(j[G].value);
|
|
2471
|
+
P = ai(W, n), h.backtrack = !0;
|
|
2472
|
+
}
|
|
2473
|
+
if (m.comma !== !0 && m.dots !== !0) {
|
|
2474
|
+
const j = h.output.slice(0, m.outputIndex), W = h.tokens.slice(m.tokensIndex);
|
|
2475
|
+
m.value = m.output = "\\{", p = P = "\\}", h.output = j;
|
|
2476
|
+
for (const G of W)
|
|
2477
|
+
h.output += G.output || G.value;
|
|
2478
|
+
}
|
|
2479
|
+
I({ type: "brace", value: p, output: P }), me("braces"), H.pop();
|
|
2480
|
+
continue;
|
|
2481
|
+
}
|
|
2482
|
+
if (p === "|") {
|
|
2483
|
+
N.length > 0 && N[N.length - 1].conditions++, I({ type: "text", value: p });
|
|
2484
|
+
continue;
|
|
2485
|
+
}
|
|
2486
|
+
if (p === ",") {
|
|
2487
|
+
let m = p;
|
|
2488
|
+
const P = H[H.length - 1];
|
|
2489
|
+
P && he[he.length - 1] === "braces" && (P.comma = !0, m = "|"), I({ type: "comma", value: p, output: m });
|
|
2490
|
+
continue;
|
|
2491
|
+
}
|
|
2492
|
+
if (p === "/") {
|
|
2493
|
+
if (l.type === "dot" && h.index === h.start + 1) {
|
|
2494
|
+
h.start = h.index + 1, h.consumed = "", h.output = "", r.pop(), l = o;
|
|
2495
|
+
continue;
|
|
2496
|
+
}
|
|
2497
|
+
I({ type: "slash", value: p, output: y });
|
|
2498
|
+
continue;
|
|
2499
|
+
}
|
|
2500
|
+
if (p === ".") {
|
|
2501
|
+
if (h.braces > 0 && l.type === "dot") {
|
|
2502
|
+
l.value === "." && (l.output = c);
|
|
2503
|
+
const m = H[H.length - 1];
|
|
2504
|
+
l.type = "dots", l.output += p, l.value += p, m.dots = !0;
|
|
2505
|
+
continue;
|
|
2506
|
+
}
|
|
2507
|
+
if (h.braces + h.parens === 0 && l.type !== "bos" && l.type !== "slash") {
|
|
2508
|
+
I({ type: "text", value: p, output: c });
|
|
2509
|
+
continue;
|
|
2510
|
+
}
|
|
2511
|
+
I({ type: "dot", value: p, output: c });
|
|
2512
|
+
continue;
|
|
2513
|
+
}
|
|
2514
|
+
if (p === "?") {
|
|
2515
|
+
if (!(l && l.value === "(") && n.noextglob !== !0 && T() === "(" && T(2) !== "?") {
|
|
2516
|
+
He("qmark", p);
|
|
2517
|
+
continue;
|
|
2518
|
+
}
|
|
2519
|
+
if (l && l.type === "paren") {
|
|
2520
|
+
const P = T();
|
|
2521
|
+
let j = p;
|
|
2522
|
+
if (P === "<" && !Z.supportsLookbehinds())
|
|
2523
|
+
throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
2524
|
+
(l.value === "(" && !/[!=<:]/.test(P) || P === "<" && !/<([!=]|\w+>)/.test(ae())) && (j = `\\${p}`), I({ type: "text", value: p, output: j });
|
|
2525
|
+
continue;
|
|
2526
|
+
}
|
|
2527
|
+
if (n.dot !== !0 && (l.type === "slash" || l.type === "bos")) {
|
|
2528
|
+
I({ type: "qmark", value: p, output: A });
|
|
2529
|
+
continue;
|
|
2530
|
+
}
|
|
2531
|
+
I({ type: "qmark", value: p, output: b });
|
|
2532
|
+
continue;
|
|
2533
|
+
}
|
|
2534
|
+
if (p === "!") {
|
|
2535
|
+
if (n.noextglob !== !0 && T() === "(" && (T(2) !== "?" || !/[!=<:]/.test(T(3)))) {
|
|
2536
|
+
He("negate", p);
|
|
2537
|
+
continue;
|
|
2538
|
+
}
|
|
2539
|
+
if (n.nonegate !== !0 && h.index === 0) {
|
|
2540
|
+
Rn();
|
|
2541
|
+
continue;
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
if (p === "+") {
|
|
2545
|
+
if (n.noextglob !== !0 && T() === "(" && T(2) !== "?") {
|
|
2546
|
+
He("plus", p);
|
|
2547
|
+
continue;
|
|
2548
|
+
}
|
|
2549
|
+
if (l && l.value === "(" || n.regex === !1) {
|
|
2550
|
+
I({ type: "plus", value: p, output: d });
|
|
2551
|
+
continue;
|
|
2552
|
+
}
|
|
2553
|
+
if (l && (l.type === "bracket" || l.type === "paren" || l.type === "brace") || h.parens > 0) {
|
|
2554
|
+
I({ type: "plus", value: p });
|
|
2555
|
+
continue;
|
|
2556
|
+
}
|
|
2557
|
+
I({ type: "plus", value: d });
|
|
2558
|
+
continue;
|
|
2559
|
+
}
|
|
2560
|
+
if (p === "@") {
|
|
2561
|
+
if (n.noextglob !== !0 && T() === "(" && T(2) !== "?") {
|
|
2562
|
+
I({ type: "at", extglob: !0, value: p, output: "" });
|
|
2563
|
+
continue;
|
|
2564
|
+
}
|
|
2565
|
+
I({ type: "text", value: p });
|
|
2566
|
+
continue;
|
|
2567
|
+
}
|
|
2568
|
+
if (p !== "*") {
|
|
2569
|
+
(p === "$" || p === "^") && (p = `\\${p}`);
|
|
2570
|
+
const m = ri.exec(ae());
|
|
2571
|
+
m && (p += m[0], h.index += m[0].length), I({ type: "text", value: p });
|
|
2572
|
+
continue;
|
|
2573
|
+
}
|
|
2574
|
+
if (l && (l.type === "globstar" || l.star === !0)) {
|
|
2575
|
+
l.type = "star", l.star = !0, l.value += p, l.output = z, h.backtrack = !0, h.globstar = !0, q(p);
|
|
2576
|
+
continue;
|
|
2577
|
+
}
|
|
2578
|
+
let g = ae();
|
|
2579
|
+
if (n.noextglob !== !0 && /^\([^?]/.test(g)) {
|
|
2580
|
+
He("star", p);
|
|
2581
|
+
continue;
|
|
2582
|
+
}
|
|
2583
|
+
if (l.type === "star") {
|
|
2584
|
+
if (n.noglobstar === !0) {
|
|
2585
|
+
q(p);
|
|
2586
|
+
continue;
|
|
2587
|
+
}
|
|
2588
|
+
const m = l.prev, P = m.prev, j = m.type === "slash" || m.type === "bos", W = P && (P.type === "star" || P.type === "globstar");
|
|
2589
|
+
if (n.bash === !0 && (!j || g[0] && g[0] !== "/")) {
|
|
2590
|
+
I({ type: "star", value: p, output: "" });
|
|
2591
|
+
continue;
|
|
2592
|
+
}
|
|
2593
|
+
const G = h.braces > 0 && (m.type === "comma" || m.type === "brace"), Qe = N.length && (m.type === "pipe" || m.type === "paren");
|
|
2594
|
+
if (!j && m.type !== "paren" && !G && !Qe) {
|
|
2595
|
+
I({ type: "star", value: p, output: "" });
|
|
2596
|
+
continue;
|
|
2597
|
+
}
|
|
2598
|
+
for (; g.slice(0, 3) === "/**"; ) {
|
|
2599
|
+
const Ne = e[h.index + 4];
|
|
2600
|
+
if (Ne && Ne !== "/")
|
|
2601
|
+
break;
|
|
2602
|
+
g = g.slice(3), q("/**", 3);
|
|
2603
|
+
}
|
|
2604
|
+
if (m.type === "bos" && J()) {
|
|
2605
|
+
l.type = "globstar", l.value += p, l.output = D(n), h.output = l.output, h.globstar = !0, q(p);
|
|
2606
|
+
continue;
|
|
2607
|
+
}
|
|
2608
|
+
if (m.type === "slash" && m.prev.type !== "bos" && !W && J()) {
|
|
2609
|
+
h.output = h.output.slice(0, -(m.output + l.output).length), m.output = `(?:${m.output}`, l.type = "globstar", l.output = D(n) + (n.strictSlashes ? ")" : "|$)"), l.value += p, h.globstar = !0, h.output += m.output + l.output, q(p);
|
|
2610
|
+
continue;
|
|
2611
|
+
}
|
|
2612
|
+
if (m.type === "slash" && m.prev.type !== "bos" && g[0] === "/") {
|
|
2613
|
+
const Ne = g[1] !== void 0 ? "|$" : "";
|
|
2614
|
+
h.output = h.output.slice(0, -(m.output + l.output).length), m.output = `(?:${m.output}`, l.type = "globstar", l.output = `${D(n)}${y}|${y}${Ne})`, l.value += p, h.output += m.output + l.output, h.globstar = !0, q(p + se()), I({ type: "slash", value: "/", output: "" });
|
|
2615
|
+
continue;
|
|
2616
|
+
}
|
|
2617
|
+
if (m.type === "bos" && g[0] === "/") {
|
|
2618
|
+
l.type = "globstar", l.value += p, l.output = `(?:^|${y}|${D(n)}${y})`, h.output = l.output, h.globstar = !0, q(p + se()), I({ type: "slash", value: "/", output: "" });
|
|
2619
|
+
continue;
|
|
2620
|
+
}
|
|
2621
|
+
h.output = h.output.slice(0, -l.output.length), l.type = "globstar", l.output = D(n), l.value += p, h.output += l.output, h.globstar = !0, q(p);
|
|
2622
|
+
continue;
|
|
2623
|
+
}
|
|
2624
|
+
const k = { type: "star", value: p, output: z };
|
|
2625
|
+
if (n.bash === !0) {
|
|
2626
|
+
k.output = ".*?", (l.type === "bos" || l.type === "slash") && (k.output = O + k.output), I(k);
|
|
2627
|
+
continue;
|
|
2628
|
+
}
|
|
2629
|
+
if (l && (l.type === "bracket" || l.type === "paren") && n.regex === !0) {
|
|
2630
|
+
k.output = p, I(k);
|
|
2631
|
+
continue;
|
|
2632
|
+
}
|
|
2633
|
+
(h.index === h.start || l.type === "slash" || l.type === "dot") && (l.type === "dot" ? (h.output += v, l.output += v) : n.dot === !0 ? (h.output += x, l.output += x) : (h.output += O, l.output += O), T() !== "*" && (h.output += w, l.output += w)), I(k);
|
|
2634
|
+
}
|
|
2635
|
+
for (; h.brackets > 0; ) {
|
|
2636
|
+
if (n.strictBrackets === !0)
|
|
2637
|
+
throw new SyntaxError(ve("closing", "]"));
|
|
2638
|
+
h.output = Z.escapeLast(h.output, "["), me("brackets");
|
|
2639
|
+
}
|
|
2640
|
+
for (; h.parens > 0; ) {
|
|
2641
|
+
if (n.strictBrackets === !0)
|
|
2642
|
+
throw new SyntaxError(ve("closing", ")"));
|
|
2643
|
+
h.output = Z.escapeLast(h.output, "("), me("parens");
|
|
2644
|
+
}
|
|
2645
|
+
for (; h.braces > 0; ) {
|
|
2646
|
+
if (n.strictBrackets === !0)
|
|
2647
|
+
throw new SyntaxError(ve("closing", "}"));
|
|
2648
|
+
h.output = Z.escapeLast(h.output, "{"), me("braces");
|
|
2649
|
+
}
|
|
2650
|
+
if (n.strictSlashes !== !0 && (l.type === "star" || l.type === "bracket") && I({ type: "maybe_slash", value: "", output: `${y}?` }), h.backtrack === !0) {
|
|
2651
|
+
h.output = "";
|
|
2652
|
+
for (const g of h.tokens)
|
|
2653
|
+
h.output += g.output != null ? g.output : g.value, g.suffix && (h.output += g.suffix);
|
|
2654
|
+
}
|
|
2655
|
+
return h;
|
|
2656
|
+
};
|
|
2657
|
+
bn.fastpaths = (e, t) => {
|
|
2658
|
+
const n = { ...t }, s = typeof n.maxLength == "number" ? Math.min(Ve, n.maxLength) : Ve, i = e.length;
|
|
2659
|
+
if (i > s)
|
|
2660
|
+
throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${s}`);
|
|
2661
|
+
e = gn[e] || e;
|
|
2662
|
+
const {
|
|
2663
|
+
DOT_LITERAL: o,
|
|
2664
|
+
SLASH_LITERAL: r,
|
|
2665
|
+
ONE_CHAR: a,
|
|
2666
|
+
DOTS_SLASH: u,
|
|
2667
|
+
NO_DOT: f,
|
|
2668
|
+
NO_DOTS: c,
|
|
2669
|
+
NO_DOTS_SLASH: d,
|
|
2670
|
+
STAR: y,
|
|
2671
|
+
START_ANCHOR: w
|
|
2672
|
+
} = Ge.globChars(n.windows), _ = n.dot ? c : f, S = n.dot ? d : f, v = n.capture ? "" : "?:", x = { negated: !1, prefix: "" };
|
|
2673
|
+
let b = n.bash === !0 ? ".*?" : y;
|
|
2674
|
+
n.capture && (b = `(${b})`);
|
|
2675
|
+
const A = (O) => O.noglobstar === !0 ? b : `(${v}(?:(?!${w}${O.dot ? u : o}).)*?)`, M = (O) => {
|
|
2676
|
+
switch (O) {
|
|
2677
|
+
case "*":
|
|
2678
|
+
return `${_}${a}${b}`;
|
|
2679
|
+
case ".*":
|
|
2680
|
+
return `${o}${a}${b}`;
|
|
2681
|
+
case "*.*":
|
|
2682
|
+
return `${_}${b}${o}${a}${b}`;
|
|
2683
|
+
case "*/*":
|
|
2684
|
+
return `${_}${b}${r}${a}${S}${b}`;
|
|
2685
|
+
case "**":
|
|
2686
|
+
return _ + A(n);
|
|
2687
|
+
case "**/*":
|
|
2688
|
+
return `(?:${_}${A(n)}${r})?${S}${a}${b}`;
|
|
2689
|
+
case "**/*.*":
|
|
2690
|
+
return `(?:${_}${A(n)}${r})?${S}${b}${o}${a}${b}`;
|
|
2691
|
+
case "**/.*":
|
|
2692
|
+
return `(?:${_}${A(n)}${r})?${o}${a}${b}`;
|
|
2693
|
+
default: {
|
|
2694
|
+
const L = /^(.*?)\.(\w+)$/.exec(O);
|
|
2695
|
+
if (!L)
|
|
2696
|
+
return;
|
|
2697
|
+
const z = M(L[1]);
|
|
2698
|
+
return z ? z + o + L[2] : void 0;
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
}, R = Z.removePrefix(e, x);
|
|
2702
|
+
let D = M(R);
|
|
2703
|
+
return D && n.strictSlashes !== !0 && (D += `${r}?`), D;
|
|
2704
|
+
};
|
|
2705
|
+
var ui = bn;
|
|
2706
|
+
const ci = si, lt = ui, vn = Ke, fi = qe, li = (e) => e && typeof e == "object" && !Array.isArray(e), F = (e, t, n = !1) => {
|
|
2707
|
+
if (Array.isArray(e)) {
|
|
2708
|
+
const c = e.map((y) => F(y, t, n));
|
|
2709
|
+
return (y) => {
|
|
2710
|
+
for (const w of c) {
|
|
2711
|
+
const _ = w(y);
|
|
2712
|
+
if (_)
|
|
2713
|
+
return _;
|
|
2714
|
+
}
|
|
2715
|
+
return !1;
|
|
2716
|
+
};
|
|
2717
|
+
}
|
|
2718
|
+
const s = li(e) && e.tokens && e.input;
|
|
2719
|
+
if (e === "" || typeof e != "string" && !s)
|
|
2720
|
+
throw new TypeError("Expected pattern to be a non-empty string");
|
|
2721
|
+
const i = t || {}, o = i.windows, r = s ? F.compileRe(e, t) : F.makeRe(e, t, !1, !0), a = r.state;
|
|
2722
|
+
delete r.state;
|
|
2723
|
+
let u = () => !1;
|
|
2724
|
+
if (i.ignore) {
|
|
2725
|
+
const c = { ...t, ignore: null, onMatch: null, onResult: null };
|
|
2726
|
+
u = F(i.ignore, c, n);
|
|
2727
|
+
}
|
|
2728
|
+
const f = (c, d = !1) => {
|
|
2729
|
+
const { isMatch: y, match: w, output: _ } = F.test(c, r, t, { glob: e, posix: o }), S = { glob: e, state: a, regex: r, posix: o, input: c, output: _, match: w, isMatch: y };
|
|
2730
|
+
return typeof i.onResult == "function" && i.onResult(S), y === !1 ? (S.isMatch = !1, d ? S : !1) : u(c) ? (typeof i.onIgnore == "function" && i.onIgnore(S), S.isMatch = !1, d ? S : !1) : (typeof i.onMatch == "function" && i.onMatch(S), d ? S : !0);
|
|
2731
|
+
};
|
|
2732
|
+
return n && (f.state = a), f;
|
|
2733
|
+
};
|
|
2734
|
+
F.test = (e, t, n, { glob: s, posix: i } = {}) => {
|
|
2735
|
+
if (typeof e != "string")
|
|
2736
|
+
throw new TypeError("Expected input to be a string");
|
|
2737
|
+
if (e === "")
|
|
2738
|
+
return { isMatch: !1, output: "" };
|
|
2739
|
+
const o = n || {}, r = o.format || (i ? vn.toPosixSlashes : null);
|
|
2740
|
+
let a = e === s, u = a && r ? r(e) : e;
|
|
2741
|
+
return a === !1 && (u = r ? r(e) : e, a = u === s), (a === !1 || o.capture === !0) && (o.matchBase === !0 || o.basename === !0 ? a = F.matchBase(e, t, n, i) : a = t.exec(u)), { isMatch: !!a, match: a, output: u };
|
|
2742
|
+
};
|
|
2743
|
+
F.matchBase = (e, t, n) => (t instanceof RegExp ? t : F.makeRe(t, n)).test(vn.basename(e));
|
|
2744
|
+
F.isMatch = (e, t, n) => F(t, n)(e);
|
|
2745
|
+
F.parse = (e, t) => Array.isArray(e) ? e.map((n) => F.parse(n, t)) : lt(e, { ...t, fastpaths: !1 });
|
|
2746
|
+
F.scan = (e, t) => ci(e, t);
|
|
2747
|
+
F.compileRe = (e, t, n = !1, s = !1) => {
|
|
2748
|
+
if (n === !0)
|
|
2749
|
+
return e.output;
|
|
2750
|
+
const i = t || {}, o = i.contains ? "" : "^", r = i.contains ? "" : "$";
|
|
2751
|
+
let a = `${o}(?:${e.output})${r}`;
|
|
2752
|
+
e && e.negated === !0 && (a = `^(?!${a}).*$`);
|
|
2753
|
+
const u = F.toRegex(a, t);
|
|
2754
|
+
return s === !0 && (u.state = e), u;
|
|
2755
|
+
};
|
|
2756
|
+
F.makeRe = (e, t, n = !1, s = !1) => {
|
|
2757
|
+
if (!e || typeof e != "string")
|
|
2758
|
+
throw new TypeError("Expected a non-empty string");
|
|
2759
|
+
const i = t || {};
|
|
2760
|
+
let o = { negated: !1, fastpaths: !0 }, r = "", a;
|
|
2761
|
+
return e.startsWith("./") && (e = e.slice(2), r = o.prefix = "./"), i.fastpaths !== !1 && (e[0] === "." || e[0] === "*") && (a = lt.fastpaths(e, t)), a === void 0 ? (o = lt(e, t), o.prefix = r + (o.prefix || "")) : o.output = a, F.compileRe(o, t, n, s);
|
|
2762
|
+
};
|
|
2763
|
+
F.toRegex = (e, t) => {
|
|
2764
|
+
try {
|
|
2765
|
+
const n = t || {};
|
|
2766
|
+
return new RegExp(e, n.flags || (n.nocase ? "i" : ""));
|
|
2767
|
+
} catch (n) {
|
|
2768
|
+
if (t && t.debug === !0)
|
|
2769
|
+
throw n;
|
|
2770
|
+
return /$^/;
|
|
2771
|
+
}
|
|
2772
|
+
};
|
|
2773
|
+
F.constants = fi;
|
|
2774
|
+
var pi = F, hi = pi;
|
|
2775
|
+
const Gt = /* @__PURE__ */ ht(hi);
|
|
2776
|
+
class di extends vt.EventEmitter {
|
|
2777
|
+
constructor(t, n, s, i, o, r = !1) {
|
|
1730
2778
|
if (super(), this.inputs = {}, this.outputs = {}, this._disposables = [], this._rpcListeners = [], this._loaded = !1, this._onLoaded = [], this._sendInputsAfterRegistration = !1, this._cachedEventInputsUpdate = {
|
|
1731
2779
|
iframeId: void 0,
|
|
1732
2780
|
inputs: void 0
|
|
@@ -1738,192 +2786,191 @@ class nn extends De.EventEmitter {
|
|
|
1738
2786
|
n = n.substring(1);
|
|
1739
2787
|
n = window.location.protocol + "//" + window.location.hostname + (window.location.port && window.location.port != "" ? ":" + window.location.port : "") + "/" + n;
|
|
1740
2788
|
}
|
|
1741
|
-
if (this.url = n, this._metapage =
|
|
1742
|
-
var
|
|
1743
|
-
|
|
1744
|
-
}
|
|
1745
|
-
this.id = s, this._parentId = i, this._color =
|
|
1746
|
-
const
|
|
1747
|
-
this.iframe = new Promise((
|
|
1748
|
-
|
|
1749
|
-
var c,
|
|
1750
|
-
if (
|
|
1751
|
-
if ((
|
|
1752
|
-
|
|
2789
|
+
if (this.url = n, this._metapage = t, this._debug = r, r) {
|
|
2790
|
+
var a = new URL(this.url);
|
|
2791
|
+
a.searchParams.set(xe.mp_debug, "true"), this.url = a.href;
|
|
2792
|
+
}
|
|
2793
|
+
this.id = s, this._parentId = i, this._color = pn(this.id), this._consoleBackgroundColor = o, this._iframe = document.createElement("iframe"), this._iframe.name = this.id;
|
|
2794
|
+
const u = this;
|
|
2795
|
+
this.iframe = new Promise((f) => {
|
|
2796
|
+
Ot().then(async () => {
|
|
2797
|
+
var c, d, y, w;
|
|
2798
|
+
if (u._iframe) {
|
|
2799
|
+
if ((w = (y = (d = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : d.metaframes) == null ? void 0 : y[this.id]) != null && w.allow)
|
|
2800
|
+
u._iframe.allow = this._metapage._definition.metaframes[this.id].allow;
|
|
1753
2801
|
else {
|
|
1754
|
-
const _ = await
|
|
1755
|
-
if (!
|
|
2802
|
+
const _ = await u.getDefinition();
|
|
2803
|
+
if (!u._iframe)
|
|
1756
2804
|
return;
|
|
1757
|
-
_ && _.allow && (
|
|
2805
|
+
_ && _.allow && (u._iframe.allow = _.allow);
|
|
1758
2806
|
}
|
|
1759
|
-
|
|
2807
|
+
u._iframe.src = this.url, f(u._iframe);
|
|
1760
2808
|
}
|
|
1761
2809
|
});
|
|
1762
2810
|
}), this.ack = this.ack.bind(this), this.dispose = this.dispose.bind(this), this.getDefinition = this.getDefinition.bind(this), this.getDefinitionUrl = this.getDefinitionUrl.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.onInput = this.onInput.bind(this), this.onInputs = this.onInputs.bind(this), this.onOutput = this.onOutput.bind(this), this.onOutputs = this.onOutputs.bind(this), this.register = this.register.bind(this), this.registered = this.registered.bind(this), this.sendInputs = this.sendInputs.bind(this), this.sendOrBufferPostMessage = this.sendOrBufferPostMessage.bind(this), this.sendRpc = this.sendRpc.bind(this), this.sendRpcInternal = this.sendRpcInternal.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setMetapage = this.setMetapage.bind(this), this.setOutput = this.setOutput.bind(this), this.setOutputs = this.setOutputs.bind(this), this.addListenerReturnDisposer = this.addListenerReturnDisposer.bind(this), this.isDisposed = this.isDisposed.bind(this);
|
|
1763
2811
|
}
|
|
1764
|
-
addListenerReturnDisposer(
|
|
1765
|
-
return super.addListener(
|
|
1766
|
-
super.removeListener(
|
|
2812
|
+
addListenerReturnDisposer(t, n) {
|
|
2813
|
+
return super.addListener(t, n), () => {
|
|
2814
|
+
super.removeListener(t, n);
|
|
1767
2815
|
};
|
|
1768
2816
|
}
|
|
1769
|
-
setMetapage(
|
|
1770
|
-
return this._metapage =
|
|
2817
|
+
setMetapage(t) {
|
|
2818
|
+
return this._metapage = t, this;
|
|
1771
2819
|
}
|
|
1772
2820
|
getDefinitionUrl() {
|
|
1773
|
-
var
|
|
1774
|
-
return
|
|
2821
|
+
var t = new URL(this.url);
|
|
2822
|
+
return t.pathname = t.pathname + (t.pathname.endsWith("/") ? "metaframe.json" : "/metaframe.json"), t.href;
|
|
1775
2823
|
}
|
|
1776
2824
|
async getDefinition() {
|
|
1777
2825
|
if (this._definition)
|
|
1778
2826
|
return this._definition;
|
|
1779
|
-
var
|
|
2827
|
+
var t = this.getDefinitionUrl();
|
|
1780
2828
|
try {
|
|
1781
|
-
const n = await window.fetch(
|
|
2829
|
+
const n = await window.fetch(t, {
|
|
1782
2830
|
signal: AbortSignal.timeout(6e3)
|
|
1783
2831
|
});
|
|
1784
2832
|
if (n.ok) {
|
|
1785
|
-
const s = await n.json(), i = await
|
|
2833
|
+
const s = await n.json(), i = await es(s);
|
|
1786
2834
|
return this._definition = i, this._definition;
|
|
1787
2835
|
} else
|
|
1788
|
-
this.emit(
|
|
2836
|
+
this.emit(E.Error, `Failed to fetch: ${t}
|
|
1789
2837
|
Status: ${n.status}
|
|
1790
2838
|
Status text: ${n.statusText}`);
|
|
1791
2839
|
} catch (n) {
|
|
1792
|
-
this.emit(
|
|
2840
|
+
this.emit(E.Error, `Failed to fetch or convert: ${t}
|
|
1793
2841
|
Error: ${n}`);
|
|
1794
2842
|
}
|
|
1795
2843
|
}
|
|
1796
|
-
setInput(
|
|
1797
|
-
console.assert(!!
|
|
2844
|
+
setInput(t, n) {
|
|
2845
|
+
console.assert(!!t);
|
|
1798
2846
|
var s = {};
|
|
1799
|
-
s[
|
|
2847
|
+
s[t] = n, this.setInputs(s);
|
|
1800
2848
|
}
|
|
1801
|
-
setInputs(
|
|
1802
|
-
this.log({ m: "MetapageIFrameRpcClient", inputs:
|
|
1803
|
-
const n =
|
|
1804
|
-
if (this.inputs =
|
|
2849
|
+
setInputs(t) {
|
|
2850
|
+
this.log({ m: "MetapageIFrameRpcClient", inputs: t });
|
|
2851
|
+
const n = t;
|
|
2852
|
+
if (this.inputs = ze(this.inputs, t), this.inputs === n)
|
|
1805
2853
|
return this;
|
|
1806
|
-
if (this._loaded || (this._sendInputsAfterRegistration = !0), this._iframe.parentNode && this._loaded && this.sendInputs(
|
|
2854
|
+
if (this._loaded || (this._sendInputsAfterRegistration = !0), this._iframe.parentNode && this._loaded && this.sendInputs(t), this.emit(E.Inputs, this.inputs), this._metapage.listenerCount(E.Inputs) > 0) {
|
|
1807
2855
|
var s = {};
|
|
1808
|
-
s[this.id] =
|
|
2856
|
+
s[this.id] = t, this._metapage.emit(E.Inputs, s);
|
|
1809
2857
|
}
|
|
1810
2858
|
return this;
|
|
1811
2859
|
}
|
|
1812
|
-
setOutput(
|
|
1813
|
-
console.assert(!!
|
|
2860
|
+
setOutput(t, n) {
|
|
2861
|
+
console.assert(!!t);
|
|
1814
2862
|
var s = {};
|
|
1815
|
-
s[
|
|
2863
|
+
s[t] = n, this.setOutputs(s);
|
|
1816
2864
|
}
|
|
1817
|
-
setOutputs(
|
|
1818
|
-
const n =
|
|
1819
|
-
if (this.outputs =
|
|
2865
|
+
setOutputs(t) {
|
|
2866
|
+
const n = t;
|
|
2867
|
+
if (this.outputs = ze(this.outputs, t), this.outputs === n)
|
|
1820
2868
|
return this;
|
|
1821
|
-
if (this.emit(
|
|
2869
|
+
if (this.emit(E.Outputs, t), this._metapage.listenerCount(E.Outputs) > 0) {
|
|
1822
2870
|
var s = {};
|
|
1823
|
-
s[this.id] = this.outputs, this._metapage.emit(
|
|
2871
|
+
s[this.id] = this.outputs, this._metapage.emit(E.Outputs, s);
|
|
1824
2872
|
}
|
|
1825
2873
|
}
|
|
1826
|
-
onInputs(
|
|
1827
|
-
return this.addListenerReturnDisposer(
|
|
2874
|
+
onInputs(t) {
|
|
2875
|
+
return this.addListenerReturnDisposer(E.Inputs, t);
|
|
1828
2876
|
}
|
|
1829
|
-
onInput(
|
|
2877
|
+
onInput(t, n) {
|
|
1830
2878
|
var s = function(i) {
|
|
1831
|
-
i.hasOwnProperty(
|
|
2879
|
+
i.hasOwnProperty(t) && n(i[t]);
|
|
1832
2880
|
};
|
|
1833
|
-
return this.addListenerReturnDisposer(
|
|
2881
|
+
return this.addListenerReturnDisposer(E.Inputs, s);
|
|
1834
2882
|
}
|
|
1835
|
-
onOutputs(
|
|
1836
|
-
return this.addListenerReturnDisposer(
|
|
2883
|
+
onOutputs(t) {
|
|
2884
|
+
return this.addListenerReturnDisposer(E.Outputs, t);
|
|
1837
2885
|
}
|
|
1838
|
-
onOutput(
|
|
2886
|
+
onOutput(t, n) {
|
|
1839
2887
|
var s = function(i) {
|
|
1840
|
-
i.hasOwnProperty(
|
|
2888
|
+
i.hasOwnProperty(t) && n(i[t]);
|
|
1841
2889
|
};
|
|
1842
|
-
return this.addListenerReturnDisposer(
|
|
2890
|
+
return this.addListenerReturnDisposer(E.Outputs, s);
|
|
1843
2891
|
}
|
|
1844
2892
|
isDisposed() {
|
|
1845
2893
|
return this.inputs === void 0;
|
|
1846
2894
|
}
|
|
1847
2895
|
dispose() {
|
|
1848
2896
|
for (super.removeAllListeners(); this._disposables && this._disposables.length > 0; ) {
|
|
1849
|
-
const
|
|
1850
|
-
|
|
2897
|
+
const t = this._disposables.pop();
|
|
2898
|
+
t && t();
|
|
1851
2899
|
}
|
|
1852
2900
|
this._rpcListeners = void 0, this.inputs = void 0, this.outputs = void 0, this._iframe && this._iframe.parentNode && this._iframe.parentNode.removeChild(this._iframe), this._iframe = void 0, this._bufferMessages = void 0, this._bufferTimeout && (window.clearInterval(this._bufferTimeout), this._bufferTimeout = void 0), this._metapage = void 0;
|
|
1853
2901
|
}
|
|
1854
2902
|
register() {
|
|
1855
|
-
var
|
|
2903
|
+
var t = {
|
|
1856
2904
|
iframeId: this.id,
|
|
1857
2905
|
parentId: this._parentId,
|
|
1858
2906
|
state: {
|
|
1859
2907
|
inputs: this.inputs
|
|
1860
2908
|
},
|
|
1861
|
-
version:
|
|
2909
|
+
version: Vt
|
|
1862
2910
|
};
|
|
1863
|
-
this.sendRpcInternal(
|
|
2911
|
+
this.sendRpcInternal(fe.SetupIframeServerResponse, t);
|
|
1864
2912
|
}
|
|
1865
|
-
registered(
|
|
2913
|
+
registered(t) {
|
|
1866
2914
|
if (this.log({ m: "MetapageIFrameRpcClient.registered", inputs: this.inputs }), !this._loaded) {
|
|
1867
|
-
if (!
|
|
2915
|
+
if (!t)
|
|
1868
2916
|
throw "Cannot register without a version";
|
|
1869
|
-
for (this.version =
|
|
2917
|
+
for (this.version = t, this._loaded = !0; this._onLoaded && this._onLoaded.length > 0; )
|
|
1870
2918
|
this._onLoaded.pop()();
|
|
1871
2919
|
this._sendInputsAfterRegistration && this.sendInputs(this.inputs);
|
|
1872
2920
|
}
|
|
1873
2921
|
}
|
|
1874
|
-
async sendInputs(
|
|
1875
|
-
|
|
1876
|
-
inputs:
|
|
2922
|
+
async sendInputs(t) {
|
|
2923
|
+
t && (t = await We(t), !this.isDisposed() && this.sendRpc(fe.InputsUpdate, {
|
|
2924
|
+
inputs: t,
|
|
1877
2925
|
parentId: this._parentId
|
|
1878
2926
|
}));
|
|
1879
2927
|
}
|
|
1880
|
-
sendRpc(
|
|
2928
|
+
sendRpc(t, n) {
|
|
1881
2929
|
var s, i;
|
|
1882
2930
|
if ((s = this == null ? void 0 : this._iframe) != null && s.parentNode && this._loaded)
|
|
1883
|
-
this.sendRpcInternal(
|
|
2931
|
+
this.sendRpcInternal(t, n);
|
|
1884
2932
|
else {
|
|
1885
2933
|
(i = this == null ? void 0 : this._metapage) == null || i.error("sending rpc later");
|
|
1886
|
-
const
|
|
2934
|
+
const o = this;
|
|
1887
2935
|
this == null || this._onLoaded.push(() => {
|
|
1888
|
-
|
|
2936
|
+
o.sendRpcInternal(t, n);
|
|
1889
2937
|
});
|
|
1890
2938
|
}
|
|
1891
2939
|
}
|
|
1892
|
-
ack(
|
|
1893
|
-
if (this.
|
|
2940
|
+
ack(t) {
|
|
2941
|
+
if (this._debug) {
|
|
1894
2942
|
this.log("⚒ ⚒ ⚒ sending ack from client to frame");
|
|
1895
2943
|
var n = {
|
|
1896
|
-
message:
|
|
2944
|
+
message: t
|
|
1897
2945
|
};
|
|
1898
|
-
this.sendRpc(
|
|
1899
|
-
}
|
|
1900
|
-
this.log("⚒ ⚒ ⚒ NOT sending ack from client to frame since not debug mode");
|
|
2946
|
+
this.sendRpc(fe.MessageAck, n);
|
|
2947
|
+
}
|
|
1901
2948
|
}
|
|
1902
|
-
log(
|
|
1903
|
-
this._debug && this.logInternal(
|
|
2949
|
+
log(t) {
|
|
2950
|
+
this._debug && this.logInternal(t);
|
|
1904
2951
|
}
|
|
1905
|
-
logInternal(
|
|
2952
|
+
logInternal(t) {
|
|
1906
2953
|
let n;
|
|
1907
|
-
typeof
|
|
2954
|
+
typeof t == "string" ? n = t : typeof t == "string" ? n = t + "" : n = JSON.stringify(t), Rt(`Metapage[${this._parentId}] Metaframe[${this.id}] ${n}`, this._color, this._consoleBackgroundColor);
|
|
1908
2955
|
}
|
|
1909
|
-
sendRpcInternal(
|
|
2956
|
+
sendRpcInternal(t, n) {
|
|
1910
2957
|
const s = {
|
|
1911
2958
|
id: "_",
|
|
1912
2959
|
iframeId: this.id,
|
|
1913
2960
|
jsonrpc: "2.0",
|
|
1914
|
-
method:
|
|
2961
|
+
method: t,
|
|
1915
2962
|
params: n,
|
|
1916
2963
|
parentId: this._parentId
|
|
1917
2964
|
};
|
|
1918
2965
|
this._iframe ? this.sendOrBufferPostMessage(s) : this._metapage ? this._metapage.error(`Cannot send to child iframe messageJSON=${JSON.stringify(s).substring(0, 200)}`) : console.error(`Cannot send to child iframe messageJSON=${JSON.stringify(s).substring(0, 200)}`);
|
|
1919
2966
|
}
|
|
1920
|
-
sendOrBufferPostMessage(
|
|
2967
|
+
sendOrBufferPostMessage(t) {
|
|
1921
2968
|
if (this._iframe && this._iframe.contentWindow)
|
|
1922
|
-
this._iframe.contentWindow.postMessage(
|
|
2969
|
+
this._iframe.contentWindow.postMessage(t, this.url);
|
|
1923
2970
|
else if (this._bufferMessages)
|
|
1924
|
-
this._bufferMessages.push(
|
|
2971
|
+
this._bufferMessages.push(t);
|
|
1925
2972
|
else {
|
|
1926
|
-
this._bufferMessages = [
|
|
2973
|
+
this._bufferMessages = [t];
|
|
1927
2974
|
const n = this;
|
|
1928
2975
|
this._bufferTimeout = window.setInterval(function() {
|
|
1929
2976
|
n._iframe && n._iframe.contentWindow && (n._bufferMessages.forEach((s) => n._iframe.contentWindow.postMessage(s, n.url)), window.clearInterval(n._bufferTimeout), n._bufferTimeout = void 0, n._bufferMessages = void 0);
|
|
@@ -1931,49 +2978,49 @@ Error: ${n}`);
|
|
|
1931
2978
|
}
|
|
1932
2979
|
}
|
|
1933
2980
|
}
|
|
1934
|
-
const
|
|
2981
|
+
const ye = C({
|
|
1935
2982
|
metaframes: {
|
|
1936
2983
|
inputs: {},
|
|
1937
2984
|
outputs: {}
|
|
1938
2985
|
}
|
|
1939
|
-
}, (
|
|
1940
|
-
class
|
|
1941
|
-
static async from(
|
|
1942
|
-
if (
|
|
2986
|
+
}, (e) => e), Ti = (e) => Re(e), mi = (e, t, n) => (!t || t === "*") && (!n || n === "*") || e === t ? !0 : Gt.isMatch(e, t) ? !!(!n || n === "*" || n.endsWith("/") || Gt.isMatch(e, n)) : !1, yi = "bcbcbc";
|
|
2987
|
+
class ne extends Ts {
|
|
2988
|
+
static async from(t, n) {
|
|
2989
|
+
if (t == null)
|
|
1943
2990
|
throw "Metapage definition cannot be null";
|
|
1944
|
-
if (typeof
|
|
2991
|
+
if (typeof t == "string")
|
|
1945
2992
|
try {
|
|
1946
|
-
|
|
2993
|
+
t = JSON.parse(t);
|
|
1947
2994
|
} catch {
|
|
1948
2995
|
throw "Cannot parse into JSON:\n${metaPageDef}";
|
|
1949
2996
|
}
|
|
1950
|
-
var s = new
|
|
1951
|
-
return s.setDefinition(
|
|
2997
|
+
var s = new ne();
|
|
2998
|
+
return s.setDefinition(t);
|
|
1952
2999
|
}
|
|
1953
|
-
constructor(
|
|
1954
|
-
super(), this._state =
|
|
3000
|
+
constructor(t) {
|
|
3001
|
+
super(), this._state = ye, this._metaframes = C({}, (n) => n), this.debug = ft(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = C({}, (n) => n), this._inputMap = {}, this._id = t && t.id ? t.id : Ds(), this._consoleBackgroundColor = t && t.color ? t.color : yi, this.addPipe = this.addPipe.bind(this), this.dispose = this.dispose.bind(this), this.addMetaframe = this.addMetaframe.bind(this), this.getInputsFromOutput = this.getInputsFromOutput.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframeIds = this.getMetaframeIds.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframes = this.getMetaframes.bind(this), this.getState = this.getState.bind(this), this.getStateMetaframes = this.getStateMetaframes.bind(this), this.isValidJSONRpcMessage = this.isValidJSONRpcMessage.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.metaframeIds = this.metaframeIds.bind(this), this.metaframes = this.metaframes.bind(this), this.onMessage = this.onMessage.bind(this), this.removeAll = this.removeAll.bind(this), this.removeMetaframe = this.removeMetaframe.bind(this), this.setDebugFromUrlParams = this.setDebugFromUrlParams.bind(this), this.setDefinition = this.setDefinition.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInputStateOnlyMetaframeInputValue = this.setInputStateOnlyMetaframeInputValue.bind(this), this.setInputStateOnlyMetaframeInputMap = this.setInputStateOnlyMetaframeInputMap.bind(this), this.setInputStateOnlyMetapageInstanceInputs = this.setInputStateOnlyMetapageInstanceInputs.bind(this), this.setOutputStateOnlyMetaframeInputValue = this.setOutputStateOnlyMetaframeInputValue.bind(this), this.setOutputStateOnlyMetaframeInputMap = this.setOutputStateOnlyMetaframeInputMap.bind(this), this.setOutputStateOnlyMetapageInstanceInputs = this.setOutputStateOnlyMetapageInstanceInputs.bind(this), this.setMetaframeClientInputAndSentClientEvent = this.setMetaframeClientInputAndSentClientEvent.bind(this), this.setState = this.setState.bind(this), this.isDisposed = this.isDisposed.bind(this), this._emitDefinitionEvent = this._emitDefinitionEvent.bind(this), Ot().then(() => {
|
|
1955
3002
|
this.isDisposed() || (window.addEventListener("message", this.onMessage), this.log("Initialized"));
|
|
1956
3003
|
});
|
|
1957
3004
|
}
|
|
1958
3005
|
isDisposed() {
|
|
1959
3006
|
return this._metaframes === void 0;
|
|
1960
3007
|
}
|
|
1961
|
-
addListenerReturnDisposer(
|
|
1962
|
-
return super.addListener(
|
|
1963
|
-
super.removeListener(
|
|
3008
|
+
addListenerReturnDisposer(t, n) {
|
|
3009
|
+
return super.addListener(t, n), () => {
|
|
3010
|
+
super.removeListener(t, n);
|
|
1964
3011
|
};
|
|
1965
3012
|
}
|
|
1966
3013
|
setDebugFromUrlParams() {
|
|
1967
|
-
const
|
|
1968
|
-
return this.debug = ["debug", "mp_debug"].reduce((n, s) => n ||
|
|
3014
|
+
const t = new URL(window.location.href);
|
|
3015
|
+
return this.debug = ["debug", "mp_debug"].reduce((n, s) => n || t.searchParams.get(s) === "true" || t.searchParams.get(s) === "1", !1), this;
|
|
1969
3016
|
}
|
|
1970
3017
|
getState() {
|
|
1971
3018
|
return this._state;
|
|
1972
3019
|
}
|
|
1973
|
-
setState(
|
|
1974
|
-
this._state =
|
|
3020
|
+
setState(t) {
|
|
3021
|
+
this._state = C(t, (n) => n), this.getMetaframeIds().forEach((n) => {
|
|
1975
3022
|
this.getMetaframe(n).setInputs(this._state.metaframes.inputs[n]), this.getMetaframe(n).setOutputs(this._state.metaframes.outputs[n]);
|
|
1976
|
-
}), this.listenerCount(
|
|
3023
|
+
}), this.listenerCount(E.State) > 0 && ye !== this._state && this.emit(E.State, this._state);
|
|
1977
3024
|
}
|
|
1978
3025
|
getStateMetaframes() {
|
|
1979
3026
|
return this._state.metaframes;
|
|
@@ -1981,61 +3028,61 @@ class U extends Qt {
|
|
|
1981
3028
|
getDefinition() {
|
|
1982
3029
|
return this._definition;
|
|
1983
3030
|
}
|
|
1984
|
-
async setDefinition(
|
|
1985
|
-
if (!
|
|
3031
|
+
async setDefinition(t, n) {
|
|
3032
|
+
if (!t.version)
|
|
1986
3033
|
throw "Metapage definition must have a version";
|
|
1987
|
-
const s = await
|
|
3034
|
+
const s = await Vn(t);
|
|
1988
3035
|
if (this.isDisposed())
|
|
1989
3036
|
return this;
|
|
1990
|
-
s.metaframes && Object.keys(s.metaframes).forEach((
|
|
1991
|
-
var r = s.metaframes[
|
|
3037
|
+
s.metaframes && Object.keys(s.metaframes).forEach((o) => {
|
|
3038
|
+
var r = s.metaframes[o];
|
|
1992
3039
|
if (typeof r != "object")
|
|
1993
|
-
throw this.emitErrorMessage(`Metaframe "${
|
|
3040
|
+
throw this.emitErrorMessage(`Metaframe "${o}" is not an object`), `Metaframe "${o}" is not an object`;
|
|
1994
3041
|
if (!r.url)
|
|
1995
|
-
throw this.emitErrorMessage(`Metaframe "${
|
|
3042
|
+
throw this.emitErrorMessage(`Metaframe "${o}" missing field: url`), `Metaframe "${o}" missing field: url`;
|
|
1996
3043
|
});
|
|
1997
3044
|
const i = this._definition;
|
|
1998
|
-
return this._definition = s, Object.keys(this._metaframes).forEach((
|
|
1999
|
-
(!s.metaframes || !s.metaframes[
|
|
2000
|
-
}), n && (this._state =
|
|
2001
|
-
if (!this._metaframes.hasOwnProperty(
|
|
2002
|
-
const r = s.metaframes[
|
|
2003
|
-
this.addMetaframe(
|
|
2004
|
-
}
|
|
2005
|
-
}), i !==
|
|
2006
|
-
!this.isDisposed() && s === this._definition && (this._emitDefinitionEvent(), n && this.listenerCount(
|
|
3045
|
+
return this._definition = s, Object.keys(this._metaframes).forEach((o) => {
|
|
3046
|
+
(!s.metaframes || !s.metaframes[o]) && this.removeMetaframe(o);
|
|
3047
|
+
}), n && (this._state = C(n, (o) => o)), s.metaframes && Object.keys(s.metaframes).forEach((o) => {
|
|
3048
|
+
if (!this._metaframes.hasOwnProperty(o)) {
|
|
3049
|
+
const r = s.metaframes[o];
|
|
3050
|
+
this.addMetaframe(o, r);
|
|
3051
|
+
}
|
|
3052
|
+
}), i !== ln && window.setTimeout(() => {
|
|
3053
|
+
!this.isDisposed() && s === this._definition && (this._emitDefinitionEvent(), n && this.listenerCount(E.State) > 0 && ye !== this._state && this.emit(E.State, this._state));
|
|
2007
3054
|
}, 0), this;
|
|
2008
3055
|
}
|
|
2009
3056
|
_emitDefinitionEvent() {
|
|
2010
|
-
if (this.listenerCount(
|
|
2011
|
-
const
|
|
3057
|
+
if (this.listenerCount(E.Definition) > 0) {
|
|
3058
|
+
const t = {
|
|
2012
3059
|
definition: this._definition,
|
|
2013
3060
|
metaframes: this._metaframes
|
|
2014
3061
|
};
|
|
2015
|
-
this.emit(
|
|
3062
|
+
this.emit(E.Definition, t);
|
|
2016
3063
|
}
|
|
2017
3064
|
}
|
|
2018
|
-
addPipe(
|
|
2019
|
-
this._inputMap =
|
|
2020
|
-
s[
|
|
3065
|
+
addPipe(t, n) {
|
|
3066
|
+
this._inputMap = C(this._inputMap, (s) => {
|
|
3067
|
+
s[t] || (s[t] = []), s[t].push(n);
|
|
2021
3068
|
});
|
|
2022
3069
|
}
|
|
2023
|
-
removeMetaframe(
|
|
2024
|
-
this._metaframes[
|
|
2025
|
-
delete n[
|
|
2026
|
-
}), this._state =
|
|
2027
|
-
delete n.metaframes.inputs[
|
|
2028
|
-
}), this._inputMap =
|
|
2029
|
-
delete n[
|
|
3070
|
+
removeMetaframe(t) {
|
|
3071
|
+
this._metaframes[t] && (this._metaframes[t].dispose(), this._metaframes = C(this._metaframes, (n) => {
|
|
3072
|
+
delete n[t];
|
|
3073
|
+
}), this._state = C(this._state, (n) => {
|
|
3074
|
+
delete n.metaframes.inputs[t], delete n.metaframes.outputs[t];
|
|
3075
|
+
}), this._inputMap = C(this._inputMap, (n) => {
|
|
3076
|
+
delete n[t], Object.keys(n).forEach((s) => {
|
|
2030
3077
|
const i = n[s];
|
|
2031
|
-
let
|
|
2032
|
-
for (;
|
|
2033
|
-
i[
|
|
3078
|
+
let o = 0;
|
|
3079
|
+
for (; o <= i.length; )
|
|
3080
|
+
i[o] && i[o].metaframe === t ? i.splice(o, 1) : o++;
|
|
2034
3081
|
});
|
|
2035
|
-
}), this._cachedInputLookupMap =
|
|
3082
|
+
}), this._cachedInputLookupMap = C({}, (n) => n));
|
|
2036
3083
|
}
|
|
2037
3084
|
removeAll() {
|
|
2038
|
-
Object.keys(this._metaframes).forEach((
|
|
3085
|
+
Object.keys(this._metaframes).forEach((t) => this._metaframes[t].dispose()), this._metaframes = C({}, (t) => t), this._state = ye, this._inputMap = C({}, (t) => t), this._cachedInputLookupMap = C({}, (t) => t);
|
|
2039
3086
|
}
|
|
2040
3087
|
metaframes() {
|
|
2041
3088
|
return this.getMetaframes();
|
|
@@ -2049,86 +3096,86 @@ class U extends Qt {
|
|
|
2049
3096
|
getMetaframes() {
|
|
2050
3097
|
return this._metaframes;
|
|
2051
3098
|
}
|
|
2052
|
-
getMetaframe(
|
|
2053
|
-
return this == null ? void 0 : this._metaframes[
|
|
3099
|
+
getMetaframe(t) {
|
|
3100
|
+
return this == null ? void 0 : this._metaframes[t];
|
|
2054
3101
|
}
|
|
2055
|
-
addMetaframe(
|
|
2056
|
-
if (!
|
|
3102
|
+
addMetaframe(t, n) {
|
|
3103
|
+
if (!t)
|
|
2057
3104
|
throw "addMetaframe missing metaframeId";
|
|
2058
3105
|
if (!n)
|
|
2059
3106
|
throw "addMetaframe missing definition";
|
|
2060
|
-
if (this._metaframes[
|
|
2061
|
-
throw this.emitErrorMessage(`Existing metaframe for id=${
|
|
3107
|
+
if (this._metaframes[t])
|
|
3108
|
+
throw this.emitErrorMessage(`Existing metaframe for id=${t}`), `Existing metaframe for id=${t}`;
|
|
2062
3109
|
if (!n.url)
|
|
2063
|
-
throw this.emitErrorMessage(`Metaframe definition missing url id=${
|
|
2064
|
-
var s = new
|
|
2065
|
-
return this._metaframes =
|
|
2066
|
-
i[
|
|
2067
|
-
}), s.addListener(
|
|
2068
|
-
this.emit(
|
|
3110
|
+
throw this.emitErrorMessage(`Metaframe definition missing url id=${t}`), `Metaframe definition missing url id=${t}`;
|
|
3111
|
+
var s = new di(this, n.url, t, this._id, this._consoleBackgroundColor, this.debug).setMetapage(this);
|
|
3112
|
+
return this._metaframes = C(this._metaframes, (i) => {
|
|
3113
|
+
i[t] = s;
|
|
3114
|
+
}), s.addListener(E.Error, (i) => {
|
|
3115
|
+
this.emit(E.Error, {
|
|
2069
3116
|
metaframeId: s.id,
|
|
2070
3117
|
metaframeUrl: s.url,
|
|
2071
3118
|
error: i
|
|
2072
3119
|
});
|
|
2073
|
-
}), n.inputs && n.inputs.forEach((i) => this.addPipe(
|
|
3120
|
+
}), n.inputs && n.inputs.forEach((i) => this.addPipe(t, i)), s.setInputs(this._state.metaframes.inputs[t]), s;
|
|
2074
3121
|
}
|
|
2075
3122
|
dispose() {
|
|
2076
|
-
this.log("disposing"), super.removeAllListeners(), window.removeEventListener("message", this.onMessage), this._metaframes && Object.keys(this._metaframes).forEach((
|
|
3123
|
+
this.log("disposing"), super.removeAllListeners(), window.removeEventListener("message", this.onMessage), this._metaframes && Object.keys(this._metaframes).forEach((t) => this._metaframes[t].dispose()), this._id = void 0, this._metaframes = void 0, this._state = void 0, this._cachedInputLookupMap = void 0, this._inputMap = void 0;
|
|
2077
3124
|
}
|
|
2078
|
-
log(
|
|
2079
|
-
this.debug && this.logInternal(
|
|
3125
|
+
log(t, n, s) {
|
|
3126
|
+
this.debug && this.logInternal(t, n, s);
|
|
2080
3127
|
}
|
|
2081
|
-
error(
|
|
2082
|
-
this.logInternal(
|
|
3128
|
+
error(t) {
|
|
3129
|
+
this.logInternal(t, "f00", this._consoleBackgroundColor), this.emitErrorMessage(`${t}`);
|
|
2083
3130
|
}
|
|
2084
|
-
emitErrorMessage(
|
|
2085
|
-
this.emit(
|
|
3131
|
+
emitErrorMessage(t) {
|
|
3132
|
+
this.emit(E.Error, t);
|
|
2086
3133
|
}
|
|
2087
|
-
getInputsFromOutput(
|
|
2088
|
-
return this._cachedInputLookupMap[
|
|
2089
|
-
s[
|
|
2090
|
-
})), this._cachedInputLookupMap[
|
|
3134
|
+
getInputsFromOutput(t, n) {
|
|
3135
|
+
return this._cachedInputLookupMap[t] || (this._cachedInputLookupMap = C(this._cachedInputLookupMap, (s) => {
|
|
3136
|
+
s[t] = C({}, (i) => i);
|
|
3137
|
+
})), this._cachedInputLookupMap[t][n] || (this._cachedInputLookupMap = C(this._cachedInputLookupMap, (s) => {
|
|
2091
3138
|
var i = [];
|
|
2092
|
-
s[
|
|
2093
|
-
|
|
2094
|
-
if (r.metaframe ===
|
|
2095
|
-
var
|
|
2096
|
-
|
|
3139
|
+
s[t][n] = i, Object.keys(this._inputMap).forEach((o) => {
|
|
3140
|
+
o !== t && this._inputMap[o].forEach((r) => {
|
|
3141
|
+
if (r.metaframe === t && mi(n, r.source || "*", r.target || "*")) {
|
|
3142
|
+
var a = r.target;
|
|
3143
|
+
!r.target || r.target.startsWith("*") || r.target === "" ? a = n : a.endsWith("/") && (a = a + n), i.push({ metaframe: o, pipe: a });
|
|
2097
3144
|
}
|
|
2098
3145
|
});
|
|
2099
3146
|
});
|
|
2100
|
-
})), this._cachedInputLookupMap[
|
|
3147
|
+
})), this._cachedInputLookupMap[t][n];
|
|
2101
3148
|
}
|
|
2102
|
-
isValidJSONRpcMessage(
|
|
2103
|
-
if (
|
|
3149
|
+
isValidJSONRpcMessage(t) {
|
|
3150
|
+
if (t.jsonrpc !== "2.0")
|
|
2104
3151
|
return !1;
|
|
2105
|
-
switch (
|
|
2106
|
-
case
|
|
3152
|
+
switch (t.method) {
|
|
3153
|
+
case X.SetupIframeClientRequest:
|
|
2107
3154
|
return !0;
|
|
2108
3155
|
default:
|
|
2109
|
-
var s =
|
|
2110
|
-
return !(s && !(
|
|
3156
|
+
var s = t.iframeId;
|
|
3157
|
+
return !(s && !(t.parentId === this._id && this._metaframes[s]));
|
|
2111
3158
|
}
|
|
2112
3159
|
}
|
|
2113
|
-
setInput(
|
|
2114
|
-
var i,
|
|
2115
|
-
typeof
|
|
3160
|
+
setInput(t, n, s) {
|
|
3161
|
+
var i, o;
|
|
3162
|
+
typeof t == "object" ? this.setInputStateOnlyMetapageInstanceInputs(t) : typeof n == "string" ? this.setInputStateOnlyMetaframeInputValue(t, n, s) : this.setInputStateOnlyMetaframeInputMap(t, n || {}), this.setMetaframeClientInputAndSentClientEvent(t, n, s), (this.listenerCount(E.State) > 0 || this.listenerCount(E.Inputs) > 0) && ye !== this._state && (this.emit(E.State, this._state), this.emit(E.Inputs, (o = (i = this._state) == null ? void 0 : i.metaframes) == null ? void 0 : o.inputs));
|
|
2116
3163
|
}
|
|
2117
|
-
setMetaframeClientInputAndSentClientEvent(
|
|
2118
|
-
if (typeof
|
|
3164
|
+
setMetaframeClientInputAndSentClientEvent(t, n, s) {
|
|
3165
|
+
if (typeof t == "object") {
|
|
2119
3166
|
if (n || s)
|
|
2120
3167
|
throw "bad arguments, see API docs";
|
|
2121
|
-
const i =
|
|
2122
|
-
Object.keys(i).forEach((
|
|
2123
|
-
var r =
|
|
2124
|
-
if (typeof
|
|
3168
|
+
const i = t;
|
|
3169
|
+
Object.keys(i).forEach((o) => {
|
|
3170
|
+
var r = o, a = i[r];
|
|
3171
|
+
if (typeof a != "object")
|
|
2125
3172
|
throw "bad arguments, see API docs";
|
|
2126
|
-
var
|
|
2127
|
-
|
|
3173
|
+
var u = this._metaframes[r];
|
|
3174
|
+
u ? u.setInputs(a) : this.error("No iframe id=$metaframeId");
|
|
2128
3175
|
});
|
|
2129
|
-
} else if (typeof
|
|
2130
|
-
const i = this._metaframes[
|
|
2131
|
-
if (i == null && this.error(`No iframe id=${
|
|
3176
|
+
} else if (typeof t == "string") {
|
|
3177
|
+
const i = this._metaframes[t];
|
|
3178
|
+
if (i == null && this.error(`No iframe id=${t}`), typeof n == "string")
|
|
2132
3179
|
i.setInput(n, s);
|
|
2133
3180
|
else if (typeof n == "object")
|
|
2134
3181
|
i.setInputs(n);
|
|
@@ -2137,218 +3184,218 @@ class U extends Qt {
|
|
|
2137
3184
|
} else
|
|
2138
3185
|
throw "bad arguments, see API docs";
|
|
2139
3186
|
}
|
|
2140
|
-
setInputs(
|
|
2141
|
-
this.setInput(
|
|
3187
|
+
setInputs(t, n, s) {
|
|
3188
|
+
this.setInput(t, n, s);
|
|
2142
3189
|
}
|
|
2143
|
-
setOutputStateOnlyMetapageInstanceInputs(
|
|
2144
|
-
this._setStateOnlyMetaframes(!1,
|
|
3190
|
+
setOutputStateOnlyMetapageInstanceInputs(t) {
|
|
3191
|
+
this._setStateOnlyMetaframes(!1, t);
|
|
2145
3192
|
}
|
|
2146
|
-
setOutputStateOnlyMetaframeInputValue(
|
|
2147
|
-
this._setStateOnlyMetaframeInputValue(!1,
|
|
3193
|
+
setOutputStateOnlyMetaframeInputValue(t, n, s) {
|
|
3194
|
+
this._setStateOnlyMetaframeInputValue(!1, t, n, s);
|
|
2148
3195
|
}
|
|
2149
|
-
setOutputStateOnlyMetaframeInputMap(
|
|
2150
|
-
this._setStateOnlyMetaframeInputMap(!1,
|
|
3196
|
+
setOutputStateOnlyMetaframeInputMap(t, n) {
|
|
3197
|
+
this._setStateOnlyMetaframeInputMap(!1, t, n);
|
|
2151
3198
|
}
|
|
2152
|
-
setInputStateOnlyMetapageInstanceInputs(
|
|
2153
|
-
this._setStateOnlyMetaframes(!0,
|
|
3199
|
+
setInputStateOnlyMetapageInstanceInputs(t) {
|
|
3200
|
+
this._setStateOnlyMetaframes(!0, t);
|
|
2154
3201
|
}
|
|
2155
|
-
setInputStateOnlyMetaframeInputValue(
|
|
2156
|
-
this._setStateOnlyMetaframeInputValue(!0,
|
|
3202
|
+
setInputStateOnlyMetaframeInputValue(t, n, s) {
|
|
3203
|
+
this._setStateOnlyMetaframeInputValue(!0, t, n, s);
|
|
2157
3204
|
}
|
|
2158
|
-
setInputStateOnlyMetaframeInputMap(
|
|
2159
|
-
this._setStateOnlyMetaframeInputMap(!0,
|
|
3205
|
+
setInputStateOnlyMetaframeInputMap(t, n) {
|
|
3206
|
+
this._setStateOnlyMetaframeInputMap(!0, t, n);
|
|
2160
3207
|
}
|
|
2161
|
-
_setStateOnlyMetaframeInputValue(
|
|
2162
|
-
this._state =
|
|
3208
|
+
_setStateOnlyMetaframeInputValue(t, n, s, i) {
|
|
3209
|
+
this._state = C(this._state, (o) => {
|
|
2163
3210
|
if (!this._metaframes.hasOwnProperty(n))
|
|
2164
3211
|
throw `No metaframe: ${n}`;
|
|
2165
|
-
|
|
2166
|
-
let
|
|
2167
|
-
|
|
3212
|
+
o.metaframes || (o.metaframes = { inputs: {}, outputs: {} }), t ? o.metaframes.inputs || (o.metaframes.inputs = {}) : o.metaframes.outputs || (o.metaframes.outputs = {});
|
|
3213
|
+
let a = t ? o.metaframes.inputs : o.metaframes.outputs;
|
|
3214
|
+
a = a || {}, a[n] = a[n] ? a[n] : {}, i === void 0 ? delete a[n][s] : a[n][s] = i;
|
|
2168
3215
|
});
|
|
2169
3216
|
}
|
|
2170
|
-
_setStateOnlyMetaframeInputMap(
|
|
2171
|
-
!s || Object.keys(s).length === 0 || (this._state =
|
|
3217
|
+
_setStateOnlyMetaframeInputMap(t, n, s) {
|
|
3218
|
+
!s || Object.keys(s).length === 0 || (this._state = C(this._state, (i) => {
|
|
2172
3219
|
if (!this._metaframes.hasOwnProperty(n))
|
|
2173
3220
|
throw `No metaframe: ${n}`;
|
|
2174
|
-
let r =
|
|
2175
|
-
r[n] = r[n] ? r[n] : {}, Object.keys(s).forEach((
|
|
2176
|
-
s[
|
|
3221
|
+
let r = t ? i.metaframes.inputs : i.metaframes.outputs;
|
|
3222
|
+
r[n] = r[n] ? r[n] : {}, Object.keys(s).forEach((a) => {
|
|
3223
|
+
s[a] === void 0 ? delete r[n][a] : r[n][a] = s[a];
|
|
2177
3224
|
});
|
|
2178
3225
|
}));
|
|
2179
3226
|
}
|
|
2180
|
-
_setStateOnlyMetaframes(
|
|
2181
|
-
!n || Object.keys(n).length === 0 || (this._state =
|
|
3227
|
+
_setStateOnlyMetaframes(t, n) {
|
|
3228
|
+
!n || Object.keys(n).length === 0 || (this._state = C(this._state, (s) => {
|
|
2182
3229
|
Object.keys(n).forEach((i) => {
|
|
2183
|
-
var
|
|
2184
|
-
if (typeof
|
|
3230
|
+
var o = n[i];
|
|
3231
|
+
if (typeof o != "object")
|
|
2185
3232
|
throw "Object values must be objects";
|
|
2186
3233
|
if (!this._metaframes.hasOwnProperty(i))
|
|
2187
3234
|
throw "No metaframe: ${metaframeId}";
|
|
2188
|
-
const
|
|
2189
|
-
|
|
2190
|
-
|
|
3235
|
+
const a = t ? s.metaframes.inputs : s.metaframes.outputs;
|
|
3236
|
+
a[i] = a[i] ? a[i] : {}, Object.keys(o).forEach((u) => {
|
|
3237
|
+
o[u] === void 0 ? delete a[i][u] : a[i][u] = o[u];
|
|
2191
3238
|
});
|
|
2192
3239
|
});
|
|
2193
3240
|
}));
|
|
2194
3241
|
}
|
|
2195
|
-
onMessage(
|
|
2196
|
-
if (typeof
|
|
2197
|
-
const r =
|
|
3242
|
+
onMessage(t) {
|
|
3243
|
+
if (typeof t.data == "object") {
|
|
3244
|
+
const r = t.data;
|
|
2198
3245
|
if (!this.isValidJSONRpcMessage(r))
|
|
2199
3246
|
return;
|
|
2200
3247
|
var n = r.method;
|
|
2201
|
-
const
|
|
2202
|
-
if (!
|
|
3248
|
+
const a = r.iframeId;
|
|
3249
|
+
if (!a)
|
|
2203
3250
|
return;
|
|
2204
|
-
const
|
|
2205
|
-
if (!
|
|
2206
|
-
this.error(`💥 onMessage no metaframe id=${
|
|
3251
|
+
const u = this.getMetaframe(a);
|
|
3252
|
+
if (!u) {
|
|
3253
|
+
this.error(`💥 onMessage no metaframe id=${a}`);
|
|
2207
3254
|
return;
|
|
2208
3255
|
}
|
|
2209
3256
|
switch (r._messageCount = ++this._internalReceivedMessageCounter, this.debug && this.log(`processing ${JSON.stringify(r, null, " ").substring(0, 500)}`), n) {
|
|
2210
|
-
case
|
|
2211
|
-
|
|
3257
|
+
case X.SetupIframeClientRequest:
|
|
3258
|
+
u.register();
|
|
2212
3259
|
break;
|
|
2213
|
-
case
|
|
2214
|
-
if (
|
|
3260
|
+
case X.SetupIframeServerResponseAck:
|
|
3261
|
+
if (u) {
|
|
2215
3262
|
const c = r.params;
|
|
2216
|
-
|
|
3263
|
+
u.registered(c.version);
|
|
2217
3264
|
}
|
|
2218
3265
|
break;
|
|
2219
|
-
case
|
|
2220
|
-
const
|
|
2221
|
-
if (this._metaframes[
|
|
2222
|
-
var s = this._metaframes[
|
|
2223
|
-
this.setOutputStateOnlyMetaframeInputMap(
|
|
3266
|
+
case X.OutputsUpdate:
|
|
3267
|
+
const f = r.params;
|
|
3268
|
+
if (this._metaframes[a]) {
|
|
3269
|
+
var s = this._metaframes[a];
|
|
3270
|
+
this.setOutputStateOnlyMetaframeInputMap(a, f), s.setOutputs(f);
|
|
2224
3271
|
var i = !1;
|
|
2225
|
-
const c = Object.keys(
|
|
2226
|
-
c.forEach((
|
|
2227
|
-
const _ = this.getInputsFromOutput(
|
|
2228
|
-
_.length > 0 && _.forEach((
|
|
2229
|
-
|
|
3272
|
+
const c = Object.keys(f), d = {};
|
|
3273
|
+
c.forEach((y, w) => {
|
|
3274
|
+
const _ = this.getInputsFromOutput(a, y);
|
|
3275
|
+
_.length > 0 && _.forEach((S) => {
|
|
3276
|
+
d[S.metaframe] || (d[S.metaframe] = {}), d[S.metaframe][S.pipe] = f[y], i = !0;
|
|
2230
3277
|
});
|
|
2231
|
-
}), i && (this.setInputStateOnlyMetapageInstanceInputs(
|
|
2232
|
-
this._metaframes[
|
|
2233
|
-
})), this.listenerCount(
|
|
3278
|
+
}), i && (this.setInputStateOnlyMetapageInstanceInputs(d), Object.keys(d).forEach((y) => {
|
|
3279
|
+
this._metaframes[y].setInputs(d[y]);
|
|
3280
|
+
})), this.listenerCount(E.State) > 0 && ye !== this._state && this.emit(E.State, this._state), this.debug && s.ack({ jsonrpc: r, state: this._state });
|
|
2234
3281
|
} else
|
|
2235
|
-
this.error(`missing metaframe=${
|
|
3282
|
+
this.error(`missing metaframe=${a}`);
|
|
2236
3283
|
break;
|
|
2237
|
-
case
|
|
2238
|
-
var
|
|
2239
|
-
this.debug && this.log(`inputs ${JSON.stringify(
|
|
3284
|
+
case X.InputsUpdate:
|
|
3285
|
+
var o = r.params;
|
|
3286
|
+
this.debug && this.log(`inputs ${JSON.stringify(o)} from ${a}`), this._metaframes[a] ? (this.setInputStateOnlyMetaframeInputMap(a, o), this._metaframes[a].setInputs(o), this.listenerCount(E.State) > 0 && ye !== this._state && this.emit(E.State, this._state), this.debug && this._metaframes[a].ack({
|
|
2240
3287
|
jsonrpc: r,
|
|
2241
3288
|
state: this._state
|
|
2242
|
-
})) : (console.error(`InputsUpdate failed no metaframe id: "${
|
|
3289
|
+
})) : (console.error(`InputsUpdate failed no metaframe id: "${a}"`), this.error(`InputsUpdate failed no metaframe id: "${a}"`));
|
|
2243
3290
|
break;
|
|
2244
|
-
case
|
|
2245
|
-
if (
|
|
2246
|
-
const c = r.params,
|
|
2247
|
-
|
|
2248
|
-
|
|
3291
|
+
case X.HashParamsUpdate:
|
|
3292
|
+
if (u) {
|
|
3293
|
+
const c = r.params, d = new URL(u.url);
|
|
3294
|
+
d.hash = c.hash, u.url = d.href, this._definition = C(this._definition, (y) => {
|
|
3295
|
+
y.metaframes[c.metaframe].url = d.href;
|
|
2249
3296
|
}), this._emitDefinitionEvent();
|
|
2250
3297
|
}
|
|
2251
3298
|
break;
|
|
2252
3299
|
default:
|
|
2253
3300
|
this.debug && this.log(`Unknown RPC method: "${n}"`);
|
|
2254
3301
|
}
|
|
2255
|
-
this.listenerCount(
|
|
3302
|
+
this.listenerCount(E.Message) > 0 && this.emit(E.Message, r);
|
|
2256
3303
|
}
|
|
2257
3304
|
}
|
|
2258
|
-
logInternal(
|
|
3305
|
+
logInternal(t, n, s) {
|
|
2259
3306
|
s = s || this._consoleBackgroundColor;
|
|
2260
3307
|
let i;
|
|
2261
|
-
typeof
|
|
3308
|
+
typeof t == "string" ? i = t : typeof t == "number" ? i = t + "" : i = JSON.stringify(t), i = this._id ? `Metapage[${this._id}] ${i}` : i, Rt(i, n, s);
|
|
2262
3309
|
}
|
|
2263
3310
|
}
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
const
|
|
2274
|
-
const n = new URL(
|
|
3311
|
+
ne.version = Vt;
|
|
3312
|
+
ne.DEFINITION = E.Definition;
|
|
3313
|
+
ne.ERROR = E.Error;
|
|
3314
|
+
ne.INPUTS = E.Inputs;
|
|
3315
|
+
ne.MESSAGE = E.Message;
|
|
3316
|
+
ne.OUTPUTS = E.Outputs;
|
|
3317
|
+
ne.STATE = E.State;
|
|
3318
|
+
ne.deserializeInputs = Ce;
|
|
3319
|
+
ne.serializeInputs = We;
|
|
3320
|
+
const wn = dt(fetch), Di = async (e, t) => {
|
|
3321
|
+
const n = new URL(e);
|
|
2275
3322
|
n.pathname = n.pathname + (n.pathname.endsWith("/") ? "metapage.json" : "/metapage.json");
|
|
2276
|
-
const i = await (await
|
|
3323
|
+
const i = await (await wn(n.href, {
|
|
2277
3324
|
redirect: "follow",
|
|
2278
3325
|
retries: 3,
|
|
2279
3326
|
retryDelay: 1e3
|
|
2280
3327
|
})).json();
|
|
2281
|
-
return await
|
|
2282
|
-
},
|
|
2283
|
-
const n = new URL(
|
|
3328
|
+
return await en(i, t || "1");
|
|
3329
|
+
}, Hi = async (e, t) => {
|
|
3330
|
+
const n = new URL(e);
|
|
2284
3331
|
n.pathname = n.pathname + (n.pathname.endsWith("/") ? "metaframe.json" : "/metaframe.json");
|
|
2285
|
-
const i = await (await
|
|
3332
|
+
const i = await (await wn(n.href, {
|
|
2286
3333
|
redirect: "follow",
|
|
2287
3334
|
retries: 3,
|
|
2288
3335
|
retryDelay: 1e3
|
|
2289
3336
|
})).json();
|
|
2290
|
-
return await
|
|
3337
|
+
return await tn(i, t || "1");
|
|
2291
3338
|
};
|
|
2292
3339
|
export {
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
3340
|
+
ln as INITIAL_NULL_METAPAGE_DEFINITION,
|
|
3341
|
+
Ei as INTERNAL_ERROR,
|
|
3342
|
+
Si as INVALID_PARAMS,
|
|
3343
|
+
Oi as INVALID_REQUEST,
|
|
3344
|
+
X as JsonRpcMethodsFromChild,
|
|
3345
|
+
fe as JsonRpcMethodsFromParent,
|
|
3346
|
+
_i as METAFRAME_JSON_FILE,
|
|
3347
|
+
gi as METAPAGE_KEY_DEFINITION,
|
|
3348
|
+
bi as METAPAGE_KEY_STATE,
|
|
3349
|
+
Ai as METHOD_NOT_FOUND,
|
|
3350
|
+
te as Metaframe,
|
|
3351
|
+
U as MetaframeEvents,
|
|
3352
|
+
re as MetaframeLoadingState,
|
|
3353
|
+
pt as MetaframeVersionCurrent,
|
|
3354
|
+
Et as MetaframeVersionsAll,
|
|
3355
|
+
ne as Metapage,
|
|
3356
|
+
E as MetapageEvents,
|
|
3357
|
+
xe as MetapageHashParams,
|
|
3358
|
+
di as MetapageIFrameRpcClient,
|
|
3359
|
+
Ts as MetapageShared,
|
|
3360
|
+
Je as MetapageVersionCurrent,
|
|
3361
|
+
Mt as MetapageVersionsAll,
|
|
3362
|
+
Ri as PARSE_ERROR,
|
|
3363
|
+
An as VERSION_METAFRAME,
|
|
3364
|
+
Vt as VERSION_METAPAGE,
|
|
3365
|
+
Yn as convertMetaframeDefinitionToCurrentVersion,
|
|
3366
|
+
tn as convertMetaframeDefinitionToVersion,
|
|
3367
|
+
es as convertMetaframeJsonToCurrentVersion,
|
|
3368
|
+
Vn as convertMetapageDefinitionToCurrentVersion,
|
|
3369
|
+
en as convertMetapageDefinitionToVersion,
|
|
3370
|
+
Ce as deserializeInputs,
|
|
3371
|
+
wt as generateId,
|
|
3372
|
+
$i as generateMetaframeId,
|
|
3373
|
+
Ds as generateMetapageId,
|
|
3374
|
+
xi as generateNonce,
|
|
3375
|
+
Ti as getLibraryVersionMatching,
|
|
3376
|
+
ue as getMatchingMetaframeVersion,
|
|
3377
|
+
Re as getMatchingMetapageVersion,
|
|
3378
|
+
Hi as getMetaframeDefinitionFromUrl,
|
|
3379
|
+
Di as getMetapageDefinitionFromUrl,
|
|
3380
|
+
Ii as getUrlParam,
|
|
3381
|
+
Ci as getUrlParamDebug,
|
|
3382
|
+
Hs as hashCode,
|
|
3383
|
+
Ns as intToRGB,
|
|
3384
|
+
ft as isDebugFromUrlsParams,
|
|
3385
|
+
Ps as isIframe,
|
|
3386
|
+
Mi as isJsonRpcId,
|
|
3387
|
+
Ze as isPageLoaded,
|
|
3388
|
+
Rt as log,
|
|
3389
|
+
mi as matchPipe,
|
|
3390
|
+
ze as merge,
|
|
3391
|
+
Li as metapageAllSha256Hash,
|
|
3392
|
+
Pi as metapageOnlyEssentailSha256Hash,
|
|
3393
|
+
Ot as pageLoaded,
|
|
3394
|
+
wi as possiblyDeserializeDatarefToFile,
|
|
3395
|
+
nn as possiblyDeserializeDatarefToValue,
|
|
3396
|
+
cs as possiblySerializeValueToDataref,
|
|
3397
|
+
We as serializeInputs,
|
|
3398
|
+
pn as stringToRgb,
|
|
3399
|
+
vi as valueToFile
|
|
2353
3400
|
};
|
|
2354
3401
|
//# sourceMappingURL=index.js.map
|