@metapages/metapage 1.5.1 → 1.6.0

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