@metapages/metapage 1.8.25 → 1.8.27

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 (72) hide show
  1. package/README.md +13 -12
  2. package/dist/index.js +859 -841
  3. package/dist/index.js.map +1 -1
  4. package/dist/metapage/Constants.d.ts.map +1 -1
  5. package/dist/metapage/Metaframe.d.ts +8 -8
  6. package/dist/metapage/Metaframe.d.ts.map +1 -1
  7. package/dist/metapage/Metapage.d.ts +5 -5
  8. package/dist/metapage/Metapage.d.ts.map +1 -1
  9. package/dist/metapage/MetapageIFrameRpcClient.d.ts +8 -8
  10. package/dist/metapage/MetapageIFrameRpcClient.d.ts.map +1 -1
  11. package/dist/metapage/MetapageTools.d.ts +4 -4
  12. package/dist/metapage/MetapageTools.d.ts.map +1 -1
  13. package/dist/metapage/Shared.d.ts +4 -4
  14. package/dist/metapage/core.d.ts +2 -1
  15. package/dist/metapage/core.d.ts.map +1 -1
  16. package/dist/metapage/data.d.ts.map +1 -1
  17. package/dist/metapage/errors/MissingMetaframeJson.d.ts.map +1 -1
  18. package/dist/metapage/errors/RootMetapageError.d.ts.map +1 -1
  19. package/dist/metapage/jsonrpc.d.ts +4 -4
  20. package/dist/metapage/jsonrpc.d.ts.map +1 -1
  21. package/dist/metapage/metapageRenderer.d.ts +16 -2
  22. package/dist/metapage/metapageRenderer.d.ts.map +1 -1
  23. package/dist/metapage/v0_1_0/all.d.ts +1 -1
  24. package/dist/metapage/v0_1_0/all.d.ts.map +1 -1
  25. package/dist/metapage/v0_2/all.d.ts +1 -1
  26. package/dist/metapage/v0_2/all.d.ts.map +1 -1
  27. package/dist/metapage/v0_3/JsonRpcMethods.d.ts +3 -3
  28. package/dist/metapage/v0_3/JsonRpcMethods.d.ts.map +1 -1
  29. package/dist/metapage/v0_3/all.d.ts +2 -2
  30. package/dist/metapage/v0_3/all.d.ts.map +1 -1
  31. package/dist/metapage/v0_4/metaframe.d.ts +3 -3
  32. package/dist/metapage/v0_4/metaframe.d.ts.map +1 -1
  33. package/dist/metapage/v0_4/metapage.d.ts +3 -3
  34. package/dist/metapage/v0_4/metapage.d.ts.map +1 -1
  35. package/dist/metapage/v1/metaframe.d.ts +3 -3
  36. package/dist/metapage/v1/metapage.d.ts +3 -3
  37. package/dist/metapage/v2/metaframe.d.ts +3 -3
  38. package/dist/metapage/v2/metapage.d.ts +3 -3
  39. package/dist/metapage/versions.d.ts.map +1 -1
  40. package/package.json +2 -1
  41. package/src/metapage/Constants.ts +5 -6
  42. package/src/metapage/Metaframe.ts +54 -62
  43. package/src/metapage/Metapage.ts +41 -41
  44. package/src/metapage/MetapageIFrameRpcClient.ts +20 -20
  45. package/src/metapage/MetapageTools.ts +15 -18
  46. package/src/metapage/README.md +5 -5
  47. package/src/metapage/Shared.ts +5 -5
  48. package/src/metapage/conversions-metaframe.ts +35 -35
  49. package/src/metapage/conversions-metapage.ts +25 -25
  50. package/src/metapage/core.ts +2 -1
  51. package/src/metapage/data.ts +38 -48
  52. package/src/metapage/errors/MissingMetaframeJson.ts +11 -12
  53. package/src/metapage/errors/RootMetapageError.ts +11 -12
  54. package/src/metapage/jsonrpc.ts +6 -12
  55. package/src/metapage/metapageRenderer.ts +110 -66
  56. package/src/metapage/metapageRendererExample.ts +1 -1
  57. package/src/metapage/util.ts +6 -6
  58. package/src/metapage/v0_1_0/all.ts +6 -6
  59. package/src/metapage/v0_2/all.ts +15 -13
  60. package/src/metapage/v0_3/JsonRpcMethods.ts +6 -10
  61. package/src/metapage/v0_3/all.ts +7 -10
  62. package/src/metapage/v0_4/README.md +1 -0
  63. package/src/metapage/v0_4/index.ts +0 -1
  64. package/src/metapage/v0_4/metaframe.ts +3 -6
  65. package/src/metapage/v0_4/metapage.ts +3 -6
  66. package/src/metapage/v1/index.ts +0 -1
  67. package/src/metapage/v1/metaframe.ts +3 -4
  68. package/src/metapage/v1/metapage.ts +3 -3
  69. package/src/metapage/v2/index.ts +0 -1
  70. package/src/metapage/v2/metaframe.ts +3 -4
  71. package/src/metapage/v2/metapage.ts +3 -3
  72. package/src/metapage/versions.ts +11 -4
package/dist/index.js CHANGED
@@ -1,4 +1,11 @@
1
- const Ct = ["0.3", "0.4", "0.5", "0.6", "1", "2"], $t = ["0.2", "0.3", "1", "2"], We = "2", Le = "2", Mi = "metaframe.json", Ii = "metapage/definition", Ci = "metapage/state", Wt = $t[$t.length - 1], As = Ct[Ct.length - 1], Es = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, xt = (t) => {
1
+ const Ct = [
2
+ "0.3",
3
+ "0.4",
4
+ "0.5",
5
+ "0.6",
6
+ "1",
7
+ "2"
8
+ ], $t = ["0.2", "0.3", "1", "2"], We = "2", Le = "2", Ii = "metaframe.json", Ci = "metapage/definition", $i = "metapage/state", Wt = $t[$t.length - 1], As = Ct[Ct.length - 1], Es = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, xt = (t) => {
2
9
  if (typeof t != "string")
3
10
  throw new TypeError("Invalid argument expected string");
4
11
  const e = t.match(Es);
@@ -20,7 +27,7 @@ const Ct = ["0.3", "0.4", "0.5", "0.6", "1", "2"], $t = ["0.2", "0.3", "1", "2"]
20
27
  return n;
21
28
  }
22
29
  return 0;
23
- }, j = (t, e) => {
30
+ }, U = (t, e) => {
24
31
  const s = xt(t), n = xt(e), i = s.pop(), o = n.pop(), r = Tt(s, n);
25
32
  return r !== 0 ? r : i && o ? Tt(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
26
33
  };
@@ -50,60 +57,60 @@ var Kt = { exports: {} };
50
57
  retryOn: []
51
58
  };
52
59
  return r = Object.assign(a, r), function(l, c) {
53
- var d = r.retries, g = r.retryDelay, v = r.retryOn;
60
+ var p = r.retries, m = r.retryDelay, _ = r.retryOn;
54
61
  if (c && c.retries !== void 0)
55
62
  if (n(c.retries))
56
- d = c.retries;
63
+ p = c.retries;
57
64
  else
58
65
  throw new i("retries must be a positive integer");
59
66
  if (c && c.retryDelay !== void 0)
60
67
  if (n(c.retryDelay) || typeof c.retryDelay == "function")
61
- g = c.retryDelay;
68
+ m = c.retryDelay;
62
69
  else
63
70
  throw new i("retryDelay must be a positive integer or a function returning a positive integer");
64
71
  if (c && c.retryOn)
65
72
  if (Array.isArray(c.retryOn) || typeof c.retryOn == "function")
66
- v = c.retryOn;
73
+ _ = c.retryOn;
67
74
  else
68
75
  throw new i("retryOn property expects an array or function");
69
- return new Promise(function(m, S) {
70
- var b = function(w) {
76
+ return new Promise(function(y, O) {
77
+ var R = function(w) {
71
78
  var A = typeof Request < "u" && l instanceof Request ? l.clone() : l;
72
- o(A, c).then(function(E) {
73
- if (Array.isArray(v) && v.indexOf(E.status) === -1)
74
- m(E);
75
- else if (typeof v == "function")
79
+ o(A, c).then(function(C) {
80
+ if (Array.isArray(_) && _.indexOf(C.status) === -1)
81
+ y(C);
82
+ else if (typeof _ == "function")
76
83
  try {
77
- return Promise.resolve(v(w, null, E)).then(function(O) {
78
- O ? x(w, null, E) : m(E);
79
- }).catch(S);
80
- } catch (O) {
81
- S(O);
84
+ return Promise.resolve(_(w, null, C)).then(function(S) {
85
+ S ? $(w, null, C) : y(C);
86
+ }).catch(O);
87
+ } catch (S) {
88
+ O(S);
82
89
  }
83
90
  else
84
- w < d ? x(w, null, E) : m(E);
85
- }).catch(function(E) {
86
- if (typeof v == "function")
91
+ w < p ? $(w, null, C) : y(C);
92
+ }).catch(function(C) {
93
+ if (typeof _ == "function")
87
94
  try {
88
- Promise.resolve(v(w, E, null)).then(function(O) {
89
- O ? x(w, E, null) : S(E);
90
- }).catch(function(O) {
91
- S(O);
95
+ Promise.resolve(_(w, C, null)).then(function(S) {
96
+ S ? $(w, C, null) : O(C);
97
+ }).catch(function(S) {
98
+ O(S);
92
99
  });
93
- } catch (O) {
94
- S(O);
100
+ } catch (S) {
101
+ O(S);
95
102
  }
96
103
  else
97
- w < d ? x(w, E, null) : S(E);
104
+ w < p ? $(w, C, null) : O(C);
98
105
  });
99
106
  };
100
- function x(w, A, E) {
101
- var O = typeof g == "function" ? g(w, A, E) : g;
107
+ function $(w, A, C) {
108
+ var S = typeof m == "function" ? m(w, A, C) : m;
102
109
  setTimeout(function() {
103
- b(++w);
104
- }, O);
110
+ R(++w);
111
+ }, S);
105
112
  }
106
- b(0);
113
+ R(0);
107
114
  });
108
115
  };
109
116
  };
@@ -117,11 +124,11 @@ var Kt = { exports: {} };
117
124
  });
118
125
  })(Kt);
119
126
  var $s = Kt.exports;
120
- const yt = /* @__PURE__ */ mt($s), J = {
127
+ const yt = /* @__PURE__ */ mt($s), z = {
121
128
  Remove: "remove",
122
129
  Replace: "replace",
123
130
  Add: "add"
124
- }, Xt = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), xs = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Be = Symbol.iterator, Z = {
131
+ }, Xt = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), xs = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Be = Symbol.iterator, Y = {
125
132
  mutable: "mutable",
126
133
  immutable: "immutable"
127
134
  }, gt = {};
@@ -139,30 +146,30 @@ function Dt(t, e) {
139
146
  }
140
147
  }
141
148
  }
142
- function Y(t) {
149
+ function Q(t) {
143
150
  var e;
144
151
  return (e = t.copy) !== null && e !== void 0 ? e : t.original;
145
152
  }
146
153
  function be(t) {
147
- return !!T(t);
154
+ return !!P(t);
148
155
  }
149
- function T(t) {
156
+ function P(t) {
150
157
  return typeof t != "object" ? null : t == null ? void 0 : t[Xt];
151
158
  }
152
159
  function _t(t) {
153
160
  var e;
154
- const s = T(t);
161
+ const s = P(t);
155
162
  return s ? (e = s.copy) !== null && e !== void 0 ? e : s.original : t;
156
163
  }
157
164
  function ne(t, e) {
158
165
  if (!t || typeof t != "object")
159
166
  return !1;
160
167
  let s;
161
- return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((s = e.mark(t, Z)) === Z.immutable || typeof s == "function");
168
+ return Object.getPrototypeOf(t) === Object.prototype || Array.isArray(t) || t instanceof Map || t instanceof Set || !!(e != null && e.mark) && ((s = e.mark(t, Y)) === Y.immutable || typeof s == "function");
162
169
  }
163
170
  function qt(t, e = []) {
164
171
  if (Object.hasOwnProperty.call(t, "key")) {
165
- const s = t.parent.copy, n = T(pe(s, t.key));
172
+ const s = t.parent.copy, n = P(pe(s, t.key));
166
173
  if (n !== null && (n == null ? void 0 : n.original) !== t.original)
167
174
  return null;
168
175
  const i = t.parent.type === 3, o = i ? Array.from(t.parent.setMap.keys()).indexOf(t.key) : t.key;
@@ -180,18 +187,18 @@ function qt(t, e = []) {
180
187
  }
181
188
  return e;
182
189
  }
183
- function we(t) {
190
+ function ve(t) {
184
191
  return Array.isArray(t) ? 1 : t instanceof Map ? 2 : t instanceof Set ? 3 : 0;
185
192
  }
186
193
  function pe(t, e) {
187
- return we(t) === 2 ? t.get(e) : t[e];
194
+ return ve(t) === 2 ? t.get(e) : t[e];
188
195
  }
189
196
  function Pe(t, e, s) {
190
- we(t) === 2 ? t.set(e, s) : t[e] = s;
197
+ ve(t) === 2 ? t.set(e, s) : t[e] = s;
191
198
  }
192
199
  function et(t, e) {
193
- const s = T(t);
194
- return (s ? Y(s) : t)[e];
200
+ const s = P(t);
201
+ return (s ? Q(s) : t)[e];
195
202
  }
196
203
  function fe(t, e) {
197
204
  return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
@@ -210,7 +217,7 @@ function _e(t, e) {
210
217
  function Ls(t, e) {
211
218
  for (let s = 0; s < e.length - 1; s += 1) {
212
219
  const n = e[s];
213
- if (t = pe(we(t) === 3 ? Array.from(t) : t, n), typeof t != "object")
220
+ if (t = pe(ve(t) === 3 ? Array.from(t) : t, n), typeof t != "object")
214
221
  throw new Error(`Cannot resolve patch at '${e.join("/")}'.`);
215
222
  }
216
223
  return t;
@@ -240,8 +247,8 @@ function Qt(t, e) {
240
247
  return new Set(t.values());
241
248
  if (t instanceof Map)
242
249
  return new Map(t);
243
- if (e != null && e.mark && (s = e.mark(t, Z), s !== void 0) && s !== Z.mutable) {
244
- if (s === Z.immutable)
250
+ if (e != null && e.mark && (s = e.mark(t, Y), s !== void 0) && s !== Y.mutable) {
251
+ if (s === Y.immutable)
245
252
  return Ps(t);
246
253
  if (typeof s == "function") {
247
254
  if (e.enablePatches || e.enableAutoFreeze)
@@ -259,7 +266,7 @@ function Qt(t, e) {
259
266
  } else
260
267
  throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
261
268
  }
262
- function q(t) {
269
+ function X(t) {
263
270
  t.copy || (t.copy = Qt(t.original, t.options));
264
271
  }
265
272
  function Ae(t) {
@@ -307,7 +314,7 @@ function Oe(t, e, s, n, i) {
307
314
  n.pop(), i.pop();
308
315
  return;
309
316
  }
310
- switch (we(t)) {
317
+ switch (ve(t)) {
311
318
  case 2:
312
319
  for (const [a, u] of t)
313
320
  Oe(a, a, s, n, i), Oe(u, a, s, n, i);
@@ -333,7 +340,7 @@ function Oe(t, e, s, n, i) {
333
340
  n.pop(), i.pop();
334
341
  }
335
342
  function bt(t, e) {
336
- const s = we(t);
343
+ const s = ve(t);
337
344
  if (s === 0)
338
345
  Reflect.ownKeys(t).forEach((n) => {
339
346
  e(n, t[n], t);
@@ -352,8 +359,8 @@ function Yt(t, e, s) {
352
359
  if (e.add(t), bt(t, (o, r) => {
353
360
  var a;
354
361
  if (be(r)) {
355
- const u = T(r);
356
- q(u);
362
+ const u = P(r);
363
+ X(u);
357
364
  const l = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
358
365
  Pe(n ? i : t, o, l);
359
366
  } else
@@ -383,8 +390,8 @@ function ut(t, e, s, n) {
383
390
  t.finalized = !0;
384
391
  }
385
392
  }
386
- function wt(t, e, s, n) {
387
- const i = T(s);
393
+ function vt(t, e, s, n) {
394
+ const i = P(s);
388
395
  i && (i.callbacks || (i.callbacks = []), i.callbacks.push((o, r) => {
389
396
  var a;
390
397
  const u = t.type === 3 ? t.setMap : t.copy;
@@ -402,24 +409,24 @@ function Ns(t, e, s, n, i) {
402
409
  u.length < o.length && ([o, u] = [u, o], [s, n] = [n, s]);
403
410
  for (let l = 0; l < o.length; l += 1)
404
411
  if (r.get(l.toString()) && u[l] !== o[l]) {
405
- const c = e.concat([l]), d = _e(c, i);
412
+ const c = e.concat([l]), p = _e(c, i);
406
413
  s.push({
407
- op: J.Replace,
408
- path: d,
414
+ op: z.Replace,
415
+ path: p,
409
416
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
410
417
  value: Fe(u[l])
411
418
  }), n.push({
412
- op: J.Replace,
413
- path: d,
419
+ op: z.Replace,
420
+ path: p,
414
421
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
415
422
  value: Fe(o[l])
416
423
  });
417
424
  }
418
425
  for (let l = o.length; l < u.length; l += 1) {
419
- const c = e.concat([l]), d = _e(c, i);
426
+ const c = e.concat([l]), p = _e(c, i);
420
427
  s.push({
421
- op: J.Add,
422
- path: d,
428
+ op: z.Add,
429
+ path: p,
423
430
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
424
431
  value: Fe(u[l])
425
432
  });
@@ -427,29 +434,29 @@ function Ns(t, e, s, n, i) {
427
434
  if (o.length < u.length) {
428
435
  const { arrayLengthAssignment: l = !0 } = a.enablePatches;
429
436
  if (l) {
430
- const c = e.concat(["length"]), d = _e(c, i);
437
+ const c = e.concat(["length"]), p = _e(c, i);
431
438
  n.push({
432
- op: J.Replace,
433
- path: d,
439
+ op: z.Replace,
440
+ path: p,
434
441
  value: o.length
435
442
  });
436
443
  } else
437
444
  for (let c = u.length; o.length < c; c -= 1) {
438
- const d = e.concat([c - 1]), g = _e(d, i);
445
+ const p = e.concat([c - 1]), m = _e(p, i);
439
446
  n.push({
440
- op: J.Remove,
441
- path: g
447
+ op: z.Remove,
448
+ path: m
442
449
  });
443
450
  }
444
451
  }
445
452
  }
446
453
  function ks({ original: t, copy: e, assignedMap: s }, n, i, o, r) {
447
454
  s.forEach((a, u) => {
448
- const l = pe(t, u), c = Fe(pe(e, u)), d = a ? Ie(t, u) ? J.Replace : J.Add : J.Remove;
449
- if (fe(l, c) && d === J.Replace)
455
+ const l = pe(t, u), c = Fe(pe(e, u)), p = a ? Ie(t, u) ? z.Replace : z.Add : z.Remove;
456
+ if (fe(l, c) && p === z.Replace)
450
457
  return;
451
- const g = n.concat(u), v = _e(g, r);
452
- i.push(d === J.Remove ? { op: d, path: v } : { op: d, path: v, value: c }), o.push(d === J.Add ? { op: J.Remove, path: v } : d === J.Remove ? { op: J.Add, path: v, value: l } : { op: J.Replace, path: v, value: l });
458
+ const m = n.concat(u), _ = _e(m, r);
459
+ i.push(p === z.Remove ? { op: p, path: _ } : { op: p, path: _, value: c }), o.push(p === z.Add ? { op: z.Remove, path: _ } : p === z.Remove ? { op: z.Add, path: _, value: l } : { op: z.Replace, path: _, value: l });
453
460
  });
454
461
  }
455
462
  function Hs({ original: t, copy: e }, s, n, i, o) {
@@ -458,11 +465,11 @@ function Hs({ original: t, copy: e }, s, n, i, o) {
458
465
  if (!e.has(a)) {
459
466
  const u = s.concat([r]), l = _e(u, o);
460
467
  n.push({
461
- op: J.Remove,
468
+ op: z.Remove,
462
469
  path: l,
463
470
  value: a
464
471
  }), i.unshift({
465
- op: J.Add,
472
+ op: z.Add,
466
473
  path: l,
467
474
  value: a
468
475
  });
@@ -472,11 +479,11 @@ function Hs({ original: t, copy: e }, s, n, i, o) {
472
479
  if (!t.has(a)) {
473
480
  const u = s.concat([r]), l = _e(u, o);
474
481
  n.push({
475
- op: J.Add,
482
+ op: z.Add,
476
483
  path: l,
477
484
  value: a
478
485
  }), i.unshift({
479
- op: J.Remove,
486
+ op: z.Remove,
480
487
  path: l,
481
488
  value: a
482
489
  });
@@ -502,39 +509,39 @@ const ze = (t, e, s = !1) => {
502
509
  throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
503
510
  }, ct = {
504
511
  get size() {
505
- return Y(T(this)).size;
512
+ return Q(P(this)).size;
506
513
  },
507
514
  has(t) {
508
- return Y(T(this)).has(t);
515
+ return Q(P(this)).has(t);
509
516
  },
510
517
  set(t, e) {
511
- const s = T(this), n = Y(s);
512
- return (!n.has(t) || !fe(n.get(t), e)) && (q(s), ue(s), s.assignedMap.set(t, !0), s.copy.set(t, e), wt(s, t, e, $e)), this;
518
+ const s = P(this), n = Q(s);
519
+ return (!n.has(t) || !fe(n.get(t), e)) && (X(s), ue(s), s.assignedMap.set(t, !0), s.copy.set(t, e), vt(s, t, e, $e)), this;
513
520
  },
514
521
  delete(t) {
515
522
  if (!this.has(t))
516
523
  return !1;
517
- const e = T(this);
518
- return q(e), ue(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
524
+ const e = P(this);
525
+ return X(e), ue(e), e.original.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.copy.delete(t), !0;
519
526
  },
520
527
  clear() {
521
- const t = T(this);
528
+ const t = P(this);
522
529
  if (this.size) {
523
- q(t), ue(t), t.assignedMap = /* @__PURE__ */ new Map();
530
+ X(t), ue(t), t.assignedMap = /* @__PURE__ */ new Map();
524
531
  for (const [e] of t.original)
525
532
  t.assignedMap.set(e, !1);
526
533
  t.copy.clear();
527
534
  }
528
535
  },
529
536
  forEach(t, e) {
530
- const s = T(this);
531
- Y(s).forEach((n, i) => {
537
+ const s = P(this);
538
+ Q(s).forEach((n, i) => {
532
539
  t.call(e, this.get(i), i, this);
533
540
  });
534
541
  },
535
542
  get(t) {
536
543
  var e, s;
537
- const n = T(this), i = Y(n).get(t), o = ((s = (e = n.options).mark) === null || s === void 0 ? void 0 : s.call(e, i, Z)) === Z.mutable;
544
+ const n = P(this), i = Q(n).get(t), o = ((s = (e = n.options).mark) === null || s === void 0 ? void 0 : s.call(e, i, Y)) === Y.mutable;
538
545
  if (n.options.strict && ze(i, n.options, o), o || n.finalized || !ne(i, n.options) || i !== n.original.get(t))
539
546
  return i;
540
547
  const r = gt.createDraft({
@@ -544,10 +551,10 @@ const ze = (t, e, s = !1) => {
544
551
  finalities: n.finalities,
545
552
  options: n.options
546
553
  });
547
- return q(n), n.copy.set(t, r), r;
554
+ return X(n), n.copy.set(t, r), r;
548
555
  },
549
556
  keys() {
550
- return Y(T(this)).keys();
557
+ return Q(P(this)).keys();
551
558
  },
552
559
  values() {
553
560
  const t = this.keys();
@@ -588,7 +595,7 @@ const ze = (t, e, s = !1) => {
588
595
  return o;
589
596
  const r = o.value;
590
597
  let a = t.setMap.get(r);
591
- const u = T(a), l = ((i = (n = t.options).mark) === null || i === void 0 ? void 0 : i.call(n, a, Z)) === Z.mutable;
598
+ const u = P(a), l = ((i = (n = t.options).mark) === null || i === void 0 ? void 0 : i.call(n, a, Y)) === Y.mutable;
592
599
  if (t.options.strict && ze(r, t.options, l), !l && !u && ne(r, t.options) && !t.finalized && t.original.has(r)) {
593
600
  const c = gt.createDraft({
594
601
  original: r,
@@ -606,40 +613,40 @@ const ze = (t, e, s = !1) => {
606
613
  };
607
614
  }, lt = {
608
615
  get size() {
609
- return T(this).setMap.size;
616
+ return P(this).setMap.size;
610
617
  },
611
618
  has(t) {
612
- const e = T(this);
619
+ const e = P(this);
613
620
  if (e.setMap.has(t))
614
621
  return !0;
615
- q(e);
616
- const s = T(t);
622
+ X(e);
623
+ const s = P(t);
617
624
  return !!(s && e.setMap.has(s.original));
618
625
  },
619
626
  add(t) {
620
- const e = T(this);
621
- return this.has(t) || (q(e), ue(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), wt(e, t, t, $e)), this;
627
+ const e = P(this);
628
+ return this.has(t) || (X(e), ue(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), vt(e, t, t, $e)), this;
622
629
  },
623
630
  delete(t) {
624
631
  if (!this.has(t))
625
632
  return !1;
626
- const e = T(this);
627
- q(e), ue(e);
628
- const s = T(t);
633
+ const e = P(this);
634
+ X(e), ue(e);
635
+ const s = P(t);
629
636
  return s && e.setMap.has(s.original) ? (e.assignedMap.set(s.original, !1), e.setMap.delete(s.original)) : (!s && e.setMap.has(t) ? e.assignedMap.set(t, !1) : e.assignedMap.delete(t), e.setMap.delete(t));
630
637
  },
631
638
  clear() {
632
639
  if (!this.size)
633
640
  return;
634
- const t = T(this);
635
- q(t), ue(t);
641
+ const t = P(this);
642
+ X(t), ue(t);
636
643
  for (const e of t.original)
637
644
  t.assignedMap.set(e, !1);
638
645
  t.setMap.clear();
639
646
  },
640
647
  values() {
641
- const t = T(this);
642
- q(t);
648
+ const t = P(this);
649
+ X(t);
643
650
  const e = t.setMap.keys();
644
651
  return {
645
652
  [Symbol.iterator]: () => this.values(),
@@ -647,8 +654,8 @@ const ze = (t, e, s = !1) => {
647
654
  };
648
655
  },
649
656
  entries() {
650
- const t = T(this);
651
- q(t);
657
+ const t = P(this);
658
+ X(t);
652
659
  const e = t.setMap.keys();
653
660
  return {
654
661
  [Symbol.iterator]: () => this.entries(),
@@ -680,10 +687,10 @@ const ze = (t, e, s = !1) => {
680
687
  let r;
681
688
  if (t.options.mark) {
682
689
  const l = e === "size" && (t.original instanceof Map || t.original instanceof Set) ? Reflect.get(t.original, e) : Reflect.get(t.original, e, s);
683
- if (r = t.options.mark(l, Z), r === Z.mutable)
690
+ if (r = t.options.mark(l, Y), r === Y.mutable)
684
691
  return t.options.strict && ze(l, t.options, !0), l;
685
692
  }
686
- const a = Y(t);
693
+ const a = Q(t);
687
694
  if (a instanceof Map && Us.includes(e)) {
688
695
  if (e === "size")
689
696
  return Object.getOwnPropertyDescriptor(ct, "size").get.call(t.proxy);
@@ -709,15 +716,15 @@ const ze = (t, e, s = !1) => {
709
716
  if (t.options.strict && ze(u, t.options), t.finalized || !ne(u, t.options))
710
717
  return u;
711
718
  if (u === et(t.original, e)) {
712
- if (q(t), t.copy[e] = vt({
719
+ if (X(t), t.copy[e] = wt({
713
720
  original: t.original[e],
714
721
  parentDraft: t,
715
722
  key: t.type === 1 ? Number(e) : e,
716
723
  finalities: t.finalities,
717
724
  options: t.options
718
725
  }), typeof r == "function") {
719
- const l = T(t.copy[e]);
720
- return q(l), ue(l), l.copy;
726
+ const l = P(t.copy[e]);
727
+ return X(l), ue(l), l.copy;
721
728
  }
722
729
  return t.copy[e];
723
730
  }
@@ -730,20 +737,20 @@ const ze = (t, e, s = !1) => {
730
737
  let i;
731
738
  if (t.type === 1 && e !== "length" && !(Number.isInteger(i = Number(e)) && i >= 0 && (e === 0 || i === 0 || String(i) === String(e))))
732
739
  throw new Error("Only supports setting array indices and the 'length' property.");
733
- const o = Dt(Y(t), e);
740
+ const o = Dt(Q(t), e);
734
741
  if (o != null && o.set)
735
742
  return o.set.call(t.proxy, s), !0;
736
- const r = et(Y(t), e), a = T(r);
737
- return a && fe(a.original, s) ? (t.copy[e] = s, t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (fe(s, r) && (s !== void 0 || Ie(t.original, e)) || (q(t), ue(t), Ie(t.original, e) && fe(s, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = s, wt(t, e, s, $e)), !0);
743
+ const r = et(Q(t), e), a = P(r);
744
+ return a && fe(a.original, s) ? (t.copy[e] = s, t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (fe(s, r) && (s !== void 0 || Ie(t.original, e)) || (X(t), ue(t), Ie(t.original, e) && fe(s, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = s, vt(t, e, s, $e)), !0);
738
745
  },
739
746
  has(t, e) {
740
- return e in Y(t);
747
+ return e in Q(t);
741
748
  },
742
749
  ownKeys(t) {
743
- return Reflect.ownKeys(Y(t));
750
+ return Reflect.ownKeys(Q(t));
744
751
  },
745
752
  getOwnPropertyDescriptor(t, e) {
746
- const s = Y(t), n = Reflect.getOwnPropertyDescriptor(s, e);
753
+ const s = Q(t), n = Reflect.getOwnPropertyDescriptor(s, e);
747
754
  return n && {
748
755
  writable: !0,
749
756
  configurable: t.type !== 1 || e !== "length",
@@ -762,11 +769,11 @@ const ze = (t, e, s = !1) => {
762
769
  },
763
770
  deleteProperty(t, e) {
764
771
  var s;
765
- return t.type === 1 ? es.set.call(this, t, e, void 0, t.proxy) : (et(t.original, e) !== void 0 || e in t.original ? (q(t), ue(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
772
+ return t.type === 1 ? es.set.call(this, t, e, void 0, t.proxy) : (et(t.original, e) !== void 0 || e in t.original ? (X(t), ue(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (s = t.assignedMap) !== null && s !== void 0 ? s : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
766
773
  }
767
774
  };
768
- function vt(t) {
769
- const { original: e, parentDraft: s, key: n, finalities: i, options: o } = t, r = we(e), a = {
775
+ function wt(t) {
776
+ const { original: e, parentDraft: s, key: n, finalities: i, options: o } = t, r = ve(e), a = {
770
777
  type: r,
771
778
  finalized: !1,
772
779
  parent: s,
@@ -782,39 +789,39 @@ function vt(t) {
782
789
  const { proxy: u, revoke: l } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, es);
783
790
  if (i.revoke.push(l), Zt.add(u), a.proxy = u, s) {
784
791
  const c = s;
785
- c.finalities.draft.push((d, g) => {
786
- var v, m;
787
- const S = T(u);
788
- let b = c.type === 3 ? c.setMap : c.copy;
789
- const x = pe(b, n), w = T(x);
792
+ c.finalities.draft.push((p, m) => {
793
+ var _, y;
794
+ const O = P(u);
795
+ let R = c.type === 3 ? c.setMap : c.copy;
796
+ const $ = pe(R, n), w = P($);
790
797
  if (w) {
791
798
  let A = w.original;
792
- w.operated && (A = _t(x)), at(w), ut(w, $e, d, g), c.options.enableAutoFreeze && (c.options.updatedValues = (v = c.options.updatedValues) !== null && v !== void 0 ? v : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(A, w.original)), Pe(b, n, A);
799
+ w.operated && (A = _t($)), at(w), ut(w, $e, p, m), c.options.enableAutoFreeze && (c.options.updatedValues = (_ = c.options.updatedValues) !== null && _ !== void 0 ? _ : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(A, w.original)), Pe(R, n, A);
793
800
  }
794
- (m = S.callbacks) === null || m === void 0 || m.forEach((A) => {
795
- A(d, g);
801
+ (y = O.callbacks) === null || y === void 0 || y.forEach((A) => {
802
+ A(p, m);
796
803
  });
797
804
  });
798
805
  } else {
799
- const c = T(u);
800
- c.finalities.draft.push((d, g) => {
801
- at(c), ut(c, $e, d, g);
806
+ const c = P(u);
807
+ c.finalities.draft.push((p, m) => {
808
+ at(c), ut(c, $e, p, m);
802
809
  });
803
810
  }
804
811
  return u;
805
812
  }
806
- gt.createDraft = vt;
813
+ gt.createDraft = wt;
807
814
  function Fs(t, e, s, n, i) {
808
815
  var o;
809
- const r = T(t), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : t, u = !!e.length;
816
+ const r = P(t), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : t, u = !!e.length;
810
817
  if (r != null && r.operated)
811
818
  for (; r.finalities.draft.length > 0; )
812
819
  r.finalities.draft.pop()(s, n);
813
820
  const l = u ? e[0] : r ? r.operated ? r.copy : r.original : t;
814
821
  return r && ot(r), i && Oe(l, l, r == null ? void 0 : r.options.updatedValues), [
815
822
  l,
816
- s && u ? [{ op: J.Replace, path: [], value: e[0] }] : s,
817
- n && u ? [{ op: J.Replace, path: [], value: a }] : n
823
+ s && u ? [{ op: z.Replace, path: [], value: e[0] }] : s,
824
+ n && u ? [{ op: z.Replace, path: [], value: a }] : n
818
825
  ];
819
826
  }
820
827
  function zs(t, e) {
@@ -826,7 +833,7 @@ function zs(t, e) {
826
833
  };
827
834
  let i, o;
828
835
  e.enablePatches && (i = [], o = []);
829
- const a = ((s = e.mark) === null || s === void 0 ? void 0 : s.call(e, t, Z)) === Z.mutable || !ne(t, e) ? t : vt({
836
+ const a = ((s = e.mark) === null || s === void 0 ? void 0 : s.call(e, t, Y)) === Y.mutable || !ne(t, e) ? t : wt({
830
837
  original: t,
831
838
  parentDraft: null,
832
839
  finalities: n,
@@ -835,21 +842,21 @@ function zs(t, e) {
835
842
  return [
836
843
  a,
837
844
  (u = []) => {
838
- const [l, c, d] = Fs(a, u, i, o, e.enableAutoFreeze);
839
- return e.enablePatches ? [l, c, d] : l;
845
+ const [l, c, p] = Fs(a, u, i, o, e.enableAutoFreeze);
846
+ return e.enablePatches ? [l, c, p] : l;
840
847
  }
841
848
  ];
842
849
  }
843
850
  function ft(t) {
844
851
  const { rootDraft: e, value: s, useRawReturn: n = !1, isRoot: i = !0 } = t;
845
852
  bt(s, (o, r, a) => {
846
- const u = T(r);
853
+ const u = P(r);
847
854
  if (u && e && u.finalities === e.finalities) {
848
855
  t.isContainDraft = !0;
849
856
  const l = u.original;
850
857
  if (a instanceof Set) {
851
858
  const c = Array.from(a);
852
- a.clear(), c.forEach((d) => a.add(o === d ? l : d));
859
+ a.clear(), c.forEach((p) => a.add(o === p ? l : p));
853
860
  } else
854
861
  Pe(a, o, l);
855
862
  } else
@@ -857,10 +864,10 @@ function ft(t) {
857
864
  }), i && (t.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), n && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
858
865
  }
859
866
  function ts(t) {
860
- const e = T(t);
867
+ const e = P(t);
861
868
  if (!ne(t, e == null ? void 0 : e.options))
862
869
  return t;
863
- const s = we(t);
870
+ const s = ve(t);
864
871
  if (e && !e.operated)
865
872
  return e.original;
866
873
  let n;
@@ -888,91 +895,91 @@ function Ht(t) {
888
895
  throw new Error(`current() is only used for Draft, parameter: ${t}`);
889
896
  return ts(t);
890
897
  }
891
- const Js = (t) => {
898
+ const Gs = (t) => {
892
899
  if (t !== void 0 && Object.prototype.toString.call(t) !== "[object Object]")
893
900
  throw new Error(`Invalid options: ${String(t)}, 'options' should be an object.`);
894
901
  return function e(s, n, i) {
895
902
  var o, r, a;
896
903
  if (typeof s == "function" && typeof n != "function")
897
- return function(O, ...k) {
898
- return e(O, (R) => s.call(this, R, ...k), n);
904
+ return function(S, ...k) {
905
+ return e(S, (E) => s.call(this, E, ...k), n);
899
906
  };
900
907
  const u = s, l = n;
901
908
  let c = i;
902
909
  if (typeof n != "function" && (c = n), c !== void 0 && Object.prototype.toString.call(c) !== "[object Object]")
903
910
  throw new Error(`Invalid options: ${c}, 'options' should be an object.`);
904
911
  c = Object.assign(Object.assign({}, t), c);
905
- const d = be(u) ? Ht(u) : u, g = Array.isArray(c.mark) ? (O, k) => {
906
- for (const R of c.mark) {
907
- if (typeof R != "function")
908
- throw new Error(`Invalid mark: ${R}, 'mark' should be a function.`);
909
- const L = R(O, k);
910
- if (L)
911
- return L;
912
- }
913
- } : c.mark, v = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, m = (r = c.strict) !== null && r !== void 0 ? r : !1, b = {
912
+ const p = be(u) ? Ht(u) : u, m = Array.isArray(c.mark) ? (S, k) => {
913
+ for (const E of c.mark) {
914
+ if (typeof E != "function")
915
+ throw new Error(`Invalid mark: ${E}, 'mark' should be a function.`);
916
+ const v = E(S, k);
917
+ if (v)
918
+ return v;
919
+ }
920
+ } : c.mark, _ = (o = c.enablePatches) !== null && o !== void 0 ? o : !1, y = (r = c.strict) !== null && r !== void 0 ? r : !1, R = {
914
921
  enableAutoFreeze: (a = c.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
915
- mark: g,
916
- strict: m,
917
- enablePatches: v
922
+ mark: m,
923
+ strict: y,
924
+ enablePatches: _
918
925
  };
919
- if (!ne(d, b) && typeof d == "object" && d !== null)
926
+ if (!ne(p, R) && typeof p == "object" && p !== null)
920
927
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
921
- const [x, w] = zs(d, b);
928
+ const [$, w] = zs(p, R);
922
929
  if (typeof n != "function") {
923
- if (!ne(d, b))
930
+ if (!ne(p, R))
924
931
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
925
- return [x, w];
932
+ return [$, w];
926
933
  }
927
934
  let A;
928
935
  try {
929
- A = l(x);
930
- } catch (O) {
931
- throw ot(T(x)), O;
932
- }
933
- const E = (O) => {
934
- const k = T(x);
935
- if (!be(O)) {
936
- if (O !== void 0 && !fe(O, x) && (k != null && k.operated))
936
+ A = l($);
937
+ } catch (S) {
938
+ throw ot(P($)), S;
939
+ }
940
+ const C = (S) => {
941
+ const k = P($);
942
+ if (!be(S)) {
943
+ if (S !== void 0 && !fe(S, $) && (k != null && k.operated))
937
944
  throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
938
- const L = O == null ? void 0 : O[xs];
939
- if (L) {
940
- const U = L[0];
941
- return b.strict && typeof O == "object" && O !== null && ft({
945
+ const v = S == null ? void 0 : S[xs];
946
+ if (v) {
947
+ const x = v[0];
948
+ return R.strict && typeof S == "object" && S !== null && ft({
942
949
  rootDraft: k,
943
- value: O,
950
+ value: S,
944
951
  useRawReturn: !0
945
- }), w([U]);
952
+ }), w([x]);
946
953
  }
947
- if (O !== void 0)
948
- return typeof O == "object" && O !== null && ft({ rootDraft: k, value: O }), w([O]);
954
+ if (S !== void 0)
955
+ return typeof S == "object" && S !== null && ft({ rootDraft: k, value: S }), w([S]);
949
956
  }
950
- if (O === x || O === void 0)
957
+ if (S === $ || S === void 0)
951
958
  return w([]);
952
- const R = T(O);
953
- if (b === R.options) {
954
- if (R.operated)
959
+ const E = P(S);
960
+ if (R === E.options) {
961
+ if (E.operated)
955
962
  throw new Error("Cannot return a modified child draft.");
956
- return w([Ht(O)]);
963
+ return w([Ht(S)]);
957
964
  }
958
- return w([O]);
965
+ return w([S]);
959
966
  };
960
- return A instanceof Promise ? A.then(E, (O) => {
961
- throw ot(T(x)), O;
962
- }) : E(A);
967
+ return A instanceof Promise ? A.then(C, (S) => {
968
+ throw ot(P($)), S;
969
+ }) : C(A);
963
970
  };
964
- }, C = Js();
971
+ }, M = Gs();
965
972
  Object.prototype.constructor.toString();
966
- const Gs = yt(fetch), ss = async (t, e) => {
973
+ const Js = yt(fetch), ss = async (t, e) => {
967
974
  if (!t)
968
975
  throw "Metapage definition null";
969
- if (t.version || (t = C(t, (n) => {
976
+ if (t.version || (t = M(t, (n) => {
970
977
  n.version = "0.3";
971
978
  })), !e)
972
979
  throw 'Missing "version" argument';
973
- if (j(e, Le) > 0)
980
+ if (U(e, Le) > 0)
974
981
  try {
975
- return await (await Gs(`https://module.metapage.io/conversion/metapage/v${e}`, {
982
+ return await (await Js(`https://module.metapage.io/conversion/metapage/v${e}`, {
976
983
  redirect: "follow",
977
984
  retries: 3,
978
985
  retryDelay: 1e3,
@@ -998,22 +1005,22 @@ const Gs = yt(fetch), ss = async (t, e) => {
998
1005
  for (; s !== e; )
999
1006
  switch (s) {
1000
1007
  case "0.2": {
1001
- if (j(e, s) > 0)
1008
+ if (U(e, s) > 0)
1002
1009
  n = Ks(n), s = he(n.version);
1003
1010
  else
1004
1011
  throw `Cannot convert from version ${s} to ${e}`;
1005
1012
  break;
1006
1013
  }
1007
1014
  case "0.3": {
1008
- j(e, s) > 0 ? (n = qs(n), s = he(n.version)) : (n = Xs(n), s = he(n.version));
1015
+ U(e, s) > 0 ? (n = qs(n), s = he(n.version)) : (n = Xs(n), s = he(n.version));
1009
1016
  break;
1010
1017
  }
1011
1018
  case "1": {
1012
- j(e, s) > 0 ? (n = Zs(n), s = he(n.version)) : (n = Qs(n), s = he(n.version));
1019
+ U(e, s) > 0 ? (n = Zs(n), s = he(n.version)) : (n = Qs(n), s = he(n.version));
1013
1020
  break;
1014
1021
  }
1015
1022
  case "2": {
1016
- if (j(e, s) > 0)
1023
+ if (U(e, s) > 0)
1017
1024
  throw `Cannot convert from version ${s} to ${e}, 1 is the latest version`;
1018
1025
  n = Ys(n), s = he(n.version);
1019
1026
  break;
@@ -1022,29 +1029,29 @@ const Gs = yt(fetch), ss = async (t, e) => {
1022
1029
  throw `Unknow version ${s} to ${e}`;
1023
1030
  }
1024
1031
  return n;
1025
- }, Ks = (t) => C(t, (e) => {
1032
+ }, Ks = (t) => M(t, (e) => {
1026
1033
  e.version = "0.3";
1027
- }), Xs = (t) => C(t, (e) => {
1034
+ }), Xs = (t) => M(t, (e) => {
1028
1035
  e.version = "0.2";
1029
- }), qs = (t) => C(t, (e) => {
1036
+ }), qs = (t) => M(t, (e) => {
1030
1037
  const s = e;
1031
1038
  delete s.plugins, s.version = "1";
1032
- }), Qs = (t) => C(t, (e) => (e.version = "0.3", e)), Ys = (t) => C(t, (e) => {
1039
+ }), Qs = (t) => M(t, (e) => (e.version = "0.3", e)), Ys = (t) => M(t, (e) => {
1033
1040
  var s, n;
1034
1041
  return e.version = "1", (s = e == null ? void 0 : e.meta) != null && s.tags && (e.meta.keywords = e.meta.tags, delete e.meta.tags), (n = e == null ? void 0 : e.meta) != null && n.authors && (e.meta.author = e.meta.authors[0], delete e.meta.authors), e;
1035
- }), Zs = (t) => C(t, (e) => {
1042
+ }), Zs = (t) => M(t, (e) => {
1036
1043
  var s, n;
1037
1044
  return e.version = "2", (s = e == null ? void 0 : e.meta) != null && s.keywords && (e.meta.tags = e.meta.keywords, delete e.meta.keywords), (n = e == null ? void 0 : e.meta) != null && n.author && (e.meta.authors = [e.meta.author], delete e.meta.author), e;
1038
1045
  }), he = (t) => {
1039
1046
  if (t === "latest")
1040
1047
  return Le;
1041
- if (j(t, "0.2") < 0)
1048
+ if (U(t, "0.2") < 0)
1042
1049
  throw `Unknown version: ${t}`;
1043
- if (j(t, "0.2") <= 0 && j(t, "0.3") < 0)
1050
+ if (U(t, "0.2") <= 0 && U(t, "0.3") < 0)
1044
1051
  return "0.2";
1045
- if (j(t, "0.3") <= 0)
1052
+ if (U(t, "0.3") <= 0)
1046
1053
  return "0.3";
1047
- if (j(t, "1") <= 0)
1054
+ if (U(t, "1") <= 0)
1048
1055
  return "1";
1049
1056
  if (t === "2")
1050
1057
  return "2";
@@ -1056,7 +1063,7 @@ const Gs = yt(fetch), ss = async (t, e) => {
1056
1063
  throw `Missing "version" key in metaframe definition: ${JSON.stringify(t)}`;
1057
1064
  if (!e)
1058
1065
  throw 'Missing "version" argument';
1059
- if (j(e, We) > 0)
1066
+ if (U(e, We) > 0)
1060
1067
  try {
1061
1068
  return await (await en(`https://module.metapage.io/conversion/metaframe/v${e}`, {
1062
1069
  redirect: "follow",
@@ -1075,7 +1082,7 @@ const Gs = yt(fetch), ss = async (t, e) => {
1075
1082
  }, tn = async (t) => ns(t, We), sn = (t, e) => {
1076
1083
  if (!t)
1077
1084
  throw "Metaframe definition null";
1078
- t.version || (t = C(t, (i) => {
1085
+ t.version || (t = M(t, (i) => {
1079
1086
  i.version = "0.3";
1080
1087
  }));
1081
1088
  let s = te(t.version);
@@ -1085,30 +1092,30 @@ const Gs = yt(fetch), ss = async (t, e) => {
1085
1092
  for (; s !== e; )
1086
1093
  switch (s) {
1087
1094
  case "0.3": {
1088
- if (j(e, s) > 0)
1095
+ if (U(e, s) > 0)
1089
1096
  n = rn(n), s = te(n.version);
1090
1097
  else
1091
1098
  throw `Cannot convert from version ${s} to ${e}`;
1092
1099
  break;
1093
1100
  }
1094
1101
  case "0.4": {
1095
- j(e, s) > 0 ? (n = on(n), s = te(n.version)) : (n = nn(n), s = te(n.version));
1102
+ U(e, s) > 0 ? (n = on(n), s = te(n.version)) : (n = nn(n), s = te(n.version));
1096
1103
  break;
1097
1104
  }
1098
1105
  case "0.5": {
1099
- j(e, s) > 0 ? (n = pn(n), s = te(n.version)) : (n = an(n), s = te(n.version));
1106
+ U(e, s) > 0 ? (n = pn(n), s = te(n.version)) : (n = an(n), s = te(n.version));
1100
1107
  break;
1101
1108
  }
1102
1109
  case "0.6": {
1103
- j(e, s) > 0 ? (n = un(n), s = te(n.version)) : (n = hn(n), s = te(n.version));
1110
+ U(e, s) > 0 ? (n = un(n), s = te(n.version)) : (n = hn(n), s = te(n.version));
1104
1111
  break;
1105
1112
  }
1106
1113
  case "1": {
1107
- j(e, s) > 0 ? (n = fn(n), s = te(n.version)) : (n = cn(n), s = te(n.version));
1114
+ U(e, s) > 0 ? (n = fn(n), s = te(n.version)) : (n = cn(n), s = te(n.version));
1108
1115
  break;
1109
1116
  }
1110
1117
  case "2": {
1111
- if (j(e, s) > 0)
1118
+ if (U(e, s) > 0)
1112
1119
  throw `Cannot convert from version ${s} to ${e}`;
1113
1120
  n = ln(n), s = te(n.version);
1114
1121
  break;
@@ -1120,11 +1127,11 @@ const Gs = yt(fetch), ss = async (t, e) => {
1120
1127
  }, pt = async (t, e) => {
1121
1128
  if (t)
1122
1129
  return tn(t);
1123
- }, nn = (t) => C(t, (e) => {
1130
+ }, nn = (t) => M(t, (e) => {
1124
1131
  e.version = "0.3", delete e.allow;
1125
- }), rn = (t) => C(t, (e) => {
1132
+ }), rn = (t) => M(t, (e) => {
1126
1133
  e.version = "0.4";
1127
- }), on = (t) => C(t, (e) => {
1134
+ }), on = (t) => M(t, (e) => {
1128
1135
  if (e.version = "0.5", !(e != null && e.metadata))
1129
1136
  return;
1130
1137
  const s = e.metadata.title;
@@ -1133,7 +1140,7 @@ const Gs = yt(fetch), ss = async (t, e) => {
1133
1140
  delete e.metadata.descriptionUrl, e.metadata.description = n;
1134
1141
  const i = e.metadata.keywords;
1135
1142
  delete e.metadata.keywords, e.metadata.tags = i;
1136
- }), an = (t) => C(t, (e) => {
1143
+ }), an = (t) => M(t, (e) => {
1137
1144
  if (e.version = "0.4", !(e != null && e.metadata))
1138
1145
  return;
1139
1146
  const s = e.metadata.name;
@@ -1142,40 +1149,40 @@ const Gs = yt(fetch), ss = async (t, e) => {
1142
1149
  delete e.metadata.description, e.metadata.descriptionUrl = n;
1143
1150
  const i = e.metadata.tags;
1144
1151
  delete e.metadata.tags, e.metadata.keywords = i;
1145
- }), un = (t) => C(t, (e) => {
1152
+ }), un = (t) => M(t, (e) => {
1146
1153
  var s;
1147
1154
  e.version = "1", (s = e == null ? void 0 : e.metadata) != null && s.operations && delete e.metadata.operations;
1148
- }), cn = (t) => C(t, (e) => {
1155
+ }), cn = (t) => M(t, (e) => {
1149
1156
  var s;
1150
1157
  e.version = "0.6", (s = e == null ? void 0 : e.metadata) != null && s.operations && delete e.metadata.operations;
1151
- }), ln = (t) => C(t, (e) => {
1158
+ }), ln = (t) => M(t, (e) => {
1152
1159
  var s, n;
1153
1160
  return e.version = "1", (s = e == null ? void 0 : e.metadata) != null && s.authors && (e.metadata.author = (n = e == null ? void 0 : e.metadata) == null ? void 0 : n.authors[0], delete e.metadata.authors), e;
1154
- }), fn = (t) => C(t, (e) => {
1161
+ }), fn = (t) => M(t, (e) => {
1155
1162
  var s;
1156
1163
  return e.version = "2", (s = e == null ? void 0 : e.metadata) != null && s.author && (e.metadata.authors = [
1157
1164
  e.metadata.author
1158
1165
  ], delete e.metadata.author), e;
1159
- }), pn = (t) => C(t, (e) => {
1166
+ }), pn = (t) => M(t, (e) => {
1160
1167
  var s;
1161
1168
  e.version = "0.6", (s = e == null ? void 0 : e.metadata) != null && s.operations && delete e.metadata.operations;
1162
- }), hn = (t) => C(t, (e) => {
1169
+ }), hn = (t) => M(t, (e) => {
1163
1170
  var s;
1164
1171
  e.version = "0.5", (s = e == null ? void 0 : e.metadata) != null && s.operations && delete e.metadata.operations;
1165
1172
  }), te = (t) => {
1166
1173
  if (t === "latest")
1167
1174
  return We;
1168
- if (j(t, "0.3") < 0)
1175
+ if (U(t, "0.3") < 0)
1169
1176
  throw `Unknown version: ${t}`;
1170
- if (j(t, "0.3") <= 0)
1177
+ if (U(t, "0.3") <= 0)
1171
1178
  return "0.3";
1172
- if (j(t, "0.4") <= 0)
1179
+ if (U(t, "0.4") <= 0)
1173
1180
  return "0.4";
1174
- if (j(t, "0.5") <= 0)
1181
+ if (U(t, "0.5") <= 0)
1175
1182
  return "0.5";
1176
- if (j(t, "0.6") <= 0)
1183
+ if (U(t, "0.6") <= 0)
1177
1184
  return "0.6";
1178
- if (j(t, "1") <= 0)
1185
+ if (U(t, "1") <= 0)
1179
1186
  return "1";
1180
1187
  if (t === "2")
1181
1188
  return "2";
@@ -1197,17 +1204,17 @@ var Ue = function(t) {
1197
1204
  o = Ee[t.charCodeAt(n)], r = Ee[t.charCodeAt(n + 1)], a = Ee[t.charCodeAt(n + 2)], u = Ee[t.charCodeAt(n + 3)], c[i++] = o << 2 | r >> 4, c[i++] = (r & 15) << 4 | a >> 2, c[i++] = (a & 3) << 6 | u & 63;
1198
1205
  return l;
1199
1206
  };
1200
- const Ke = async (t) => C(t, async (e) => {
1207
+ const Ke = async (t) => M(t, async (e) => {
1201
1208
  for (const s of Object.keys(t)) {
1202
1209
  const n = await dn(t[s]);
1203
1210
  return e[s] = n, e;
1204
1211
  }
1205
- }), Ce = async (t) => C(t, async (e) => {
1212
+ }), Ce = async (t) => M(t, async (e) => {
1206
1213
  for (const s of Object.keys(t)) {
1207
1214
  const n = await is(t[s]);
1208
1215
  return e[s] = n, e;
1209
1216
  }
1210
- }), $i = async (t, e, s) => {
1217
+ }), xi = async (t, e, s) => {
1211
1218
  if (t = is(t), s = s || {}, s.type || (s.type = "application/octet-stream"), t instanceof ArrayBuffer)
1212
1219
  return new File([t], e, s);
1213
1220
  if (t instanceof File || t instanceof Blob) {
@@ -1294,7 +1301,7 @@ const Ke = async (t) => C(t, async (e) => {
1294
1301
  } catch {
1295
1302
  }
1296
1303
  return t;
1297
- }, xi = (t) => {
1304
+ }, Li = (t) => {
1298
1305
  if (!(t && typeof t == "object" && t._s === !0))
1299
1306
  return;
1300
1307
  const e = t, s = e._c;
@@ -1326,20 +1333,20 @@ const Ke = async (t) => C(t, async (e) => {
1326
1333
  } catch {
1327
1334
  }
1328
1335
  };
1329
- var $;
1336
+ var I;
1330
1337
  (function(t) {
1331
1338
  t.Inputs = "inputs", t.Outputs = "outputs", t.State = "state", t.Definition = "definition", t.Error = "error", t.Warning = "warning", t.UrlHashUpdate = "urlhashupdate", t.Message = "Message";
1332
- })($ || ($ = {}));
1333
- var X;
1339
+ })(I || (I = {}));
1340
+ var K;
1334
1341
  (function(t) {
1335
1342
  t.InputsUpdate = "InputsUpdate", t.OutputsUpdate = "OutputsUpdate", t.SetupIframeClientRequest = "SetupIframeClientRequest", t.SetupIframeServerResponseAck = "SetupIframeServerResponseAck", t.HashParamsUpdate = "HashParamsUpdate";
1336
- })(X || (X = {}));
1343
+ })(K || (K = {}));
1337
1344
  var me;
1338
1345
  (function(t) {
1339
1346
  t.InputsUpdate = "InputsUpdate", t.MessageAck = "MessageAck", t.SetupIframeServerResponse = "SetupIframeServerResponse";
1340
1347
  })(me || (me = {}));
1341
- const Li = -32700, Pi = -32600, Ti = -32601, Di = -32602, Ni = -32603;
1342
- function ki(t) {
1348
+ const Pi = -32700, Ti = -32600, Di = -32601, Ni = -32602, ki = -32603;
1349
+ function Hi(t) {
1343
1350
  switch (typeof t) {
1344
1351
  case "string":
1345
1352
  return !0;
@@ -1360,11 +1367,11 @@ var rs = { exports: {} };
1360
1367
  function i(u, l, c) {
1361
1368
  this.fn = u, this.context = l, this.once = c || !1;
1362
1369
  }
1363
- function o(u, l, c, d, g) {
1370
+ function o(u, l, c, p, m) {
1364
1371
  if (typeof c != "function")
1365
1372
  throw new TypeError("The listener must be a function");
1366
- var v = new i(c, d || u, g), m = s ? s + l : l;
1367
- return u._events[m] ? u._events[m].fn ? u._events[m] = [u._events[m], v] : u._events[m].push(v) : (u._events[m] = v, u._eventsCount++), u;
1373
+ var _ = new i(c, p || u, m), y = s ? s + l : l;
1374
+ return u._events[y] ? u._events[y].fn ? u._events[y] = [u._events[y], _] : u._events[y].push(_) : (u._events[y] = _, u._eventsCount++), u;
1368
1375
  }
1369
1376
  function r(u, l) {
1370
1377
  --u._eventsCount === 0 ? u._events = new n() : delete u._events[l];
@@ -1373,88 +1380,88 @@ var rs = { exports: {} };
1373
1380
  this._events = new n(), this._eventsCount = 0;
1374
1381
  }
1375
1382
  a.prototype.eventNames = function() {
1376
- var l = [], c, d;
1383
+ var l = [], c, p;
1377
1384
  if (this._eventsCount === 0)
1378
1385
  return l;
1379
- for (d in c = this._events)
1380
- e.call(c, d) && l.push(s ? d.slice(1) : d);
1386
+ for (p in c = this._events)
1387
+ e.call(c, p) && l.push(s ? p.slice(1) : p);
1381
1388
  return Object.getOwnPropertySymbols ? l.concat(Object.getOwnPropertySymbols(c)) : l;
1382
1389
  }, a.prototype.listeners = function(l) {
1383
- var c = s ? s + l : l, d = this._events[c];
1384
- if (!d)
1390
+ var c = s ? s + l : l, p = this._events[c];
1391
+ if (!p)
1385
1392
  return [];
1386
- if (d.fn)
1387
- return [d.fn];
1388
- for (var g = 0, v = d.length, m = new Array(v); g < v; g++)
1389
- m[g] = d[g].fn;
1390
- return m;
1393
+ if (p.fn)
1394
+ return [p.fn];
1395
+ for (var m = 0, _ = p.length, y = new Array(_); m < _; m++)
1396
+ y[m] = p[m].fn;
1397
+ return y;
1391
1398
  }, a.prototype.listenerCount = function(l) {
1392
- var c = s ? s + l : l, d = this._events[c];
1393
- return d ? d.fn ? 1 : d.length : 0;
1394
- }, a.prototype.emit = function(l, c, d, g, v, m) {
1395
- var S = s ? s + l : l;
1396
- if (!this._events[S])
1399
+ var c = s ? s + l : l, p = this._events[c];
1400
+ return p ? p.fn ? 1 : p.length : 0;
1401
+ }, a.prototype.emit = function(l, c, p, m, _, y) {
1402
+ var O = s ? s + l : l;
1403
+ if (!this._events[O])
1397
1404
  return !1;
1398
- var b = this._events[S], x = arguments.length, w, A;
1399
- if (b.fn) {
1400
- switch (b.once && this.removeListener(l, b.fn, void 0, !0), x) {
1405
+ var R = this._events[O], $ = arguments.length, w, A;
1406
+ if (R.fn) {
1407
+ switch (R.once && this.removeListener(l, R.fn, void 0, !0), $) {
1401
1408
  case 1:
1402
- return b.fn.call(b.context), !0;
1409
+ return R.fn.call(R.context), !0;
1403
1410
  case 2:
1404
- return b.fn.call(b.context, c), !0;
1411
+ return R.fn.call(R.context, c), !0;
1405
1412
  case 3:
1406
- return b.fn.call(b.context, c, d), !0;
1413
+ return R.fn.call(R.context, c, p), !0;
1407
1414
  case 4:
1408
- return b.fn.call(b.context, c, d, g), !0;
1415
+ return R.fn.call(R.context, c, p, m), !0;
1409
1416
  case 5:
1410
- return b.fn.call(b.context, c, d, g, v), !0;
1417
+ return R.fn.call(R.context, c, p, m, _), !0;
1411
1418
  case 6:
1412
- return b.fn.call(b.context, c, d, g, v, m), !0;
1419
+ return R.fn.call(R.context, c, p, m, _, y), !0;
1413
1420
  }
1414
- for (A = 1, w = new Array(x - 1); A < x; A++)
1421
+ for (A = 1, w = new Array($ - 1); A < $; A++)
1415
1422
  w[A - 1] = arguments[A];
1416
- b.fn.apply(b.context, w);
1423
+ R.fn.apply(R.context, w);
1417
1424
  } else {
1418
- var E = b.length, O;
1419
- for (A = 0; A < E; A++)
1420
- switch (b[A].once && this.removeListener(l, b[A].fn, void 0, !0), x) {
1425
+ var C = R.length, S;
1426
+ for (A = 0; A < C; A++)
1427
+ switch (R[A].once && this.removeListener(l, R[A].fn, void 0, !0), $) {
1421
1428
  case 1:
1422
- b[A].fn.call(b[A].context);
1429
+ R[A].fn.call(R[A].context);
1423
1430
  break;
1424
1431
  case 2:
1425
- b[A].fn.call(b[A].context, c);
1432
+ R[A].fn.call(R[A].context, c);
1426
1433
  break;
1427
1434
  case 3:
1428
- b[A].fn.call(b[A].context, c, d);
1435
+ R[A].fn.call(R[A].context, c, p);
1429
1436
  break;
1430
1437
  case 4:
1431
- b[A].fn.call(b[A].context, c, d, g);
1438
+ R[A].fn.call(R[A].context, c, p, m);
1432
1439
  break;
1433
1440
  default:
1434
1441
  if (!w)
1435
- for (O = 1, w = new Array(x - 1); O < x; O++)
1436
- w[O - 1] = arguments[O];
1437
- b[A].fn.apply(b[A].context, w);
1442
+ for (S = 1, w = new Array($ - 1); S < $; S++)
1443
+ w[S - 1] = arguments[S];
1444
+ R[A].fn.apply(R[A].context, w);
1438
1445
  }
1439
1446
  }
1440
1447
  return !0;
1441
- }, a.prototype.on = function(l, c, d) {
1442
- return o(this, l, c, d, !1);
1443
- }, a.prototype.once = function(l, c, d) {
1444
- return o(this, l, c, d, !0);
1445
- }, a.prototype.removeListener = function(l, c, d, g) {
1446
- var v = s ? s + l : l;
1447
- if (!this._events[v])
1448
+ }, a.prototype.on = function(l, c, p) {
1449
+ return o(this, l, c, p, !1);
1450
+ }, a.prototype.once = function(l, c, p) {
1451
+ return o(this, l, c, p, !0);
1452
+ }, a.prototype.removeListener = function(l, c, p, m) {
1453
+ var _ = s ? s + l : l;
1454
+ if (!this._events[_])
1448
1455
  return this;
1449
1456
  if (!c)
1450
- return r(this, v), this;
1451
- var m = this._events[v];
1452
- if (m.fn)
1453
- m.fn === c && (!g || m.once) && (!d || m.context === d) && r(this, v);
1457
+ return r(this, _), this;
1458
+ var y = this._events[_];
1459
+ if (y.fn)
1460
+ y.fn === c && (!m || y.once) && (!p || y.context === p) && r(this, _);
1454
1461
  else {
1455
- for (var S = 0, b = [], x = m.length; S < x; S++)
1456
- (m[S].fn !== c || g && !m[S].once || d && m[S].context !== d) && b.push(m[S]);
1457
- b.length ? this._events[v] = b.length === 1 ? b[0] : b : r(this, v);
1462
+ for (var O = 0, R = [], $ = y.length; O < $; O++)
1463
+ (y[O].fn !== c || m && !y[O].once || p && y[O].context !== p) && R.push(y[O]);
1464
+ R.length ? this._events[_] = R.length === 1 ? R[0] : R : r(this, _);
1458
1465
  }
1459
1466
  return this;
1460
1467
  }, a.prototype.removeAllListeners = function(l) {
@@ -1497,8 +1504,8 @@ var yn = function(t, e) {
1497
1504
  }
1498
1505
  var l = i.push(r) - 1, c = Object.keys(r).sort(n && n(r));
1499
1506
  for (u = "", a = 0; a < c.length; a++) {
1500
- var d = c[a], g = o(r[d]);
1501
- g && (u && (u += ","), u += JSON.stringify(d) + ":" + g);
1507
+ var p = c[a], m = o(r[p]);
1508
+ m && (u && (u += ","), u += JSON.stringify(p) + ":" + m);
1502
1509
  }
1503
1510
  return i.splice(l, 1), "{" + u + "}";
1504
1511
  }
@@ -1506,19 +1513,13 @@ var yn = function(t, e) {
1506
1513
  };
1507
1514
  const gn = /* @__PURE__ */ mn(yn), _n = (t) => os(gn(t)), bn = (t) => {
1508
1515
  if (t && t.length > 0)
1509
- try {
1510
- return JSON.parse(as(t));
1511
- } catch {
1512
- return JSON.parse(decodeURIComponent(atob(decodeURIComponent(t))));
1513
- }
1516
+ return JSON.parse(as(t));
1514
1517
  }, os = (t) => btoa(encodeURIComponent(t)), as = (t) => {
1515
- try {
1516
- return decodeURIComponent(atob(t));
1517
- } catch {
1518
- return decodeURIComponent(atob(decodeURIComponent(t)));
1519
- }
1518
+ for (; t.endsWith("%3D"); )
1519
+ t = t.slice(0, -3);
1520
+ return decodeURIComponent(atob(t));
1520
1521
  }, us = (t) => {
1521
- const e = t instanceof URL ? t : new URL(t);
1522
+ const e = new URL(t);
1522
1523
  return cs(e.hash);
1523
1524
  }, cs = (t) => {
1524
1525
  let e = t;
@@ -1539,12 +1540,16 @@ const gn = /* @__PURE__ */ mn(yn), _n = (t) => os(gn(t)), bn = (t) => {
1539
1540
  }).forEach(([o, r]) => {
1540
1541
  i[o] = r;
1541
1542
  }), Object.keys(i).forEach((o) => {
1542
- i[o] = i[o];
1543
+ try {
1544
+ i[o] = decodeURIComponent(i[o]);
1545
+ } catch {
1546
+ i[o] = i[o];
1547
+ }
1543
1548
  }), [n, i];
1544
1549
  }, Te = (t, e) => {
1545
1550
  const [s, n] = us(t);
1546
1551
  return n[e];
1547
- }, wn = (t) => vn()[1][t], vn = () => us(window.location.href), Se = (t, e, s) => {
1552
+ }, vn = (t) => wn()[1][t], wn = () => us(window.location.href), Se = (t, e, s) => {
1548
1553
  const n = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, i = On(n, t, e);
1549
1554
  i !== n && (s != null && s.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"))));
1550
1555
  }, On = (t, e, s) => {
@@ -1554,11 +1559,8 @@ const gn = /* @__PURE__ */ mn(yn), _n = (t) => os(gn(t)), bn = (t) => {
1554
1559
  return t;
1555
1560
  const r = Object.keys(i);
1556
1561
  r.sort();
1557
- const a = r.map((u, l) => {
1558
- const c = i[u];
1559
- return /^[A-Za-z0-9+/]+={0,2}$/.test(c) && c.length % 4, `${u}=${c}`;
1560
- }).join("&");
1561
- return !n && !a ? "" : `${n || ""}${a ? "?" + a : ""}`;
1562
+ const a = r.map((u, l) => `${u}=${encodeURIComponent(i[u])}`).join("&");
1563
+ return `${n}?${a}`;
1562
1564
  }, Rt = (t, e) => {
1563
1565
  const s = Te(t, e);
1564
1566
  if (s && s !== "")
@@ -1616,8 +1618,8 @@ var Nn = function(t, e) {
1616
1618
  }
1617
1619
  var l = i.push(r) - 1, c = Object.keys(r).sort(n && n(r));
1618
1620
  for (u = "", a = 0; a < c.length; a++) {
1619
- var d = c[a], g = o(r[d]);
1620
- g && (u && (u += ","), u += JSON.stringify(d) + ":" + g);
1621
+ var p = c[a], m = o(r[p]);
1622
+ m && (u && (u += ","), u += JSON.stringify(p) + ":" + m);
1621
1623
  }
1622
1624
  return i.splice(l, 1), "{" + u + "}";
1623
1625
  }
@@ -1649,14 +1651,14 @@ class Hn extends Ot.EventEmitter {
1649
1651
  return this._definition;
1650
1652
  }
1651
1653
  }
1652
- const Je = (t, e) => e ? C(t, (s) => {
1654
+ const Ge = (t, e) => e ? M(t, (s) => {
1653
1655
  Object.keys(e).forEach((n) => {
1654
1656
  e[n] === void 0 ? delete s[n] : s[n] = e[n];
1655
1657
  });
1656
- }) : t, Hi = (t) => window.location.search ? new URLSearchParams(window.location.search).get(t) : null, ji = () => new URLSearchParams(window.location.search).has(xe.mp_debug), ht = () => {
1658
+ }) : t, ji = (t) => window.location.search ? new URLSearchParams(window.location.search).get(t) : null, Ui = () => new URLSearchParams(window.location.search).has(xe.mp_debug), ht = () => {
1657
1659
  const t = new URLSearchParams(window.location.search).get(xe.mp_debug);
1658
1660
  return t === "true" || t === "1";
1659
- }, Ui = (t = 8) => St(t), jn = (t = 8) => St(t), Bi = (t = 8) => St(t), jt = "abcdefghijklmnopqrstuvwxyz0123456789", St = (t = 8) => {
1661
+ }, Bi = (t = 8) => St(t), jn = (t = 8) => St(t), Fi = (t = 8) => St(t), jt = "abcdefghijklmnopqrstuvwxyz0123456789", St = (t = 8) => {
1660
1662
  for (var e = "", s = jt.length, n = 0; n < t; n++)
1661
1663
  e += jt.charAt(Math.floor(Math.random() * s));
1662
1664
  return e;
@@ -1687,10 +1689,10 @@ const Je = (t, e) => e ? C(t, (s) => {
1687
1689
  }), setTimeout(() => {
1688
1690
  !e && tt() && (e = !0, t());
1689
1691
  }, 200);
1690
- }), Fi = async (t) => {
1692
+ }), zi = async (t) => {
1691
1693
  const e = fs(t);
1692
1694
  return await ds(e);
1693
- }, zi = async (t) => {
1695
+ }, Gi = async (t) => {
1694
1696
  const e = fs({
1695
1697
  version: t.version,
1696
1698
  metaframes: t.metaframes
@@ -1705,10 +1707,10 @@ var ae;
1705
1707
  (function(t) {
1706
1708
  t.WaitingForPageLoad = "WaitingForPageLoad", t.SentSetupIframeClientRequest = "SentSetupIframeClientRequest", t.Ready = "Ready";
1707
1709
  })(ae || (ae = {}));
1708
- var z;
1710
+ var F;
1709
1711
  (function(t) {
1710
1712
  t.Connected = "connected", t.Error = "error", t.Input = "input", t.Inputs = "inputs", t.Message = "message";
1711
- })(z || (z = {}));
1713
+ })(F || (F = {}));
1712
1714
  class ie extends Ot.EventEmitter {
1713
1715
  constructor(e) {
1714
1716
  if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = ae.WaitingForPageLoad, this._messageSendCount = 0, this.debug = ht(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = ht(), this._isIframe = kn(), 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) {
@@ -1717,7 +1719,7 @@ class ie extends Ot.EventEmitter {
1717
1719
  }
1718
1720
  const s = this;
1719
1721
  Xe().then(() => {
1720
- this.log("pageLoaded"), window.addEventListener("message", this.onMessage), s.sendRpc(X.SetupIframeClientRequest, {
1722
+ this.log("pageLoaded"), window.addEventListener("message", this.onMessage), s.sendRpc(K.SetupIframeClientRequest, {
1721
1723
  version: ie.version
1722
1724
  }), s._state = ae.SentSetupIframeClientRequest;
1723
1725
  }), e && e.disableHashChangeEvent || window.addEventListener("hashchange", this._onHashUrlChange);
@@ -1725,9 +1727,9 @@ class ie extends Ot.EventEmitter {
1725
1727
  _resolveSetupIframeServerResponse(e) {
1726
1728
  if (this._state === ae.WaitingForPageLoad)
1727
1729
  throw "Got message but page has not finished loading, we should never get in this state";
1728
- (async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = e.version, this.color = hs(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 = ae.Ready, this.sendRpc(X.SetupIframeServerResponseAck, {
1730
+ (async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = e.version, this.color = hs(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 = ae.Ready, this.sendRpc(K.SetupIframeServerResponseAck, {
1729
1731
  version: ie.version
1730
- }), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(z.Inputs, this._inputPipeValues), this.listenerCount(z.Input) > 0 && Object.keys(this._inputPipeValues).forEach((s) => this.emit(z.Input, s, this._inputPipeValues[s]))), this.emit(z.Connected), this.sendRpc(X.OutputsUpdate, this._outputPipeValues)))();
1732
+ }), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(F.Inputs, this._inputPipeValues), this.listenerCount(F.Input) > 0 && Object.keys(this._inputPipeValues).forEach((s) => this.emit(F.Input, s, this._inputPipeValues[s]))), this.emit(F.Connected), this.sendRpc(K.OutputsUpdate, this._outputPipeValues)))();
1731
1733
  }
1732
1734
  isConnected() {
1733
1735
  return this._state === ae.Ready;
@@ -1739,7 +1741,7 @@ class ie extends Ot.EventEmitter {
1739
1741
  return;
1740
1742
  }
1741
1743
  let n;
1742
- n = this.addListenerReturnDisposer(z.Connected, () => {
1744
+ n = this.addListenerReturnDisposer(F.Connected, () => {
1743
1745
  e(), n();
1744
1746
  });
1745
1747
  });
@@ -1766,40 +1768,40 @@ class ie extends Ot.EventEmitter {
1766
1768
  super.removeAllListeners(), window.removeEventListener("message", this.onMessage), this.disableNotifyOnHashUrlChange(), this._inputPipeValues = void 0, this._outputPipeValues = void 0;
1767
1769
  }
1768
1770
  addListener(e, s) {
1769
- return super.addListener(e, s), e === z.Inputs && window.setTimeout(() => {
1771
+ return super.addListener(e, s), e === F.Inputs && window.setTimeout(() => {
1770
1772
  this._inputPipeValues && s(this._inputPipeValues);
1771
1773
  }, 0), this;
1772
1774
  }
1773
1775
  onInput(e, s) {
1774
- return this.addListenerReturnDisposer(z.Input, (n, i) => {
1776
+ return this.addListenerReturnDisposer(F.Input, (n, i) => {
1775
1777
  e === n && s(i);
1776
1778
  });
1777
1779
  }
1778
1780
  onInputs(e) {
1779
- return this.addListenerReturnDisposer(z.Inputs, e);
1781
+ return this.addListenerReturnDisposer(F.Inputs, e);
1780
1782
  }
1781
1783
  setInput(e, s) {
1782
1784
  var n = {};
1783
1785
  n[e] = s, this.setInputs(n);
1784
1786
  }
1785
1787
  async setInputs(e) {
1786
- this.isInputOutputBlobSerialization && (e = await Ce(e)), this.sendRpc(X.InputsUpdate, e);
1788
+ this.isInputOutputBlobSerialization && (e = await Ce(e)), this.sendRpc(K.InputsUpdate, e);
1787
1789
  }
1788
1790
  async setInternalInputsAndNotify(e) {
1789
1791
  this.isInputOutputBlobSerialization && (e = await Ce(e));
1790
1792
  const s = e;
1791
- if (this._inputPipeValues = Je(this._inputPipeValues, e), this._inputPipeValues !== s) {
1793
+ if (this._inputPipeValues = Ge(this._inputPipeValues, e), this._inputPipeValues !== s) {
1792
1794
  Object.keys(e).forEach((n) => {
1793
1795
  try {
1794
- this.emit(z.Input, n, e[n]);
1796
+ this.emit(F.Input, n, e[n]);
1795
1797
  } catch (i) {
1796
- console.error(`Error emitting input ${n}: ${i}`), this.emit(z.Error, `Error emitting input ${n}: ${i}`);
1798
+ console.error(`Error emitting input ${n}: ${i}`), this.emit(F.Error, `Error emitting input ${n}: ${i}`);
1797
1799
  }
1798
1800
  });
1799
1801
  try {
1800
- this.emit(z.Inputs, e);
1802
+ this.emit(F.Inputs, e);
1801
1803
  } catch (n) {
1802
- console.error(`Error emitting inputs: ${n}`), this.emit(z.Error, `Error emitting inputs: ${n}`);
1804
+ console.error(`Error emitting inputs: ${n}`), this.emit(F.Error, `Error emitting inputs: ${n}`);
1803
1805
  }
1804
1806
  }
1805
1807
  }
@@ -1817,7 +1819,7 @@ class ie extends Ot.EventEmitter {
1817
1819
  async setOutputs(e) {
1818
1820
  this.isInputOutputBlobSerialization && (e = await Ke(e));
1819
1821
  const s = e;
1820
- this._outputPipeValues = Je(this._outputPipeValues, e), this._outputPipeValues !== s && this._state === ae.Ready && this.sendRpc(X.OutputsUpdate, e);
1822
+ this._outputPipeValues = Ge(this._outputPipeValues, e), this._outputPipeValues !== s && this._state === ae.Ready && this.sendRpc(K.OutputsUpdate, e);
1821
1823
  }
1822
1824
  disableNotifyOnHashUrlChange() {
1823
1825
  window.removeEventListener("hashchange", this._onHashUrlChange);
@@ -1827,7 +1829,7 @@ class ie extends Ot.EventEmitter {
1827
1829
  hash: window.location.hash,
1828
1830
  metaframe: this.id
1829
1831
  };
1830
- this.sendRpc(X.HashParamsUpdate, s);
1832
+ this.sendRpc(K.HashParamsUpdate, s);
1831
1833
  }
1832
1834
  sendRpc(e, s) {
1833
1835
  if (this._isIframe) {
@@ -1868,7 +1870,7 @@ class ie extends Ot.EventEmitter {
1868
1870
  this.debug && this.log(`window.message: unknown JSON-RPC method: ${JSON.stringify(n)}`);
1869
1871
  break;
1870
1872
  }
1871
- this.listenerCount(z.Message) > 0 && this.emit(z.Message, n);
1873
+ this.listenerCount(F.Message) > 0 && this.emit(F.Message, n);
1872
1874
  }
1873
1875
  }
1874
1876
  }
@@ -1876,7 +1878,7 @@ class ie extends Ot.EventEmitter {
1876
1878
  Se(e, s);
1877
1879
  }
1878
1880
  getParameter(e) {
1879
- return wn(e);
1881
+ return vn(e);
1880
1882
  }
1881
1883
  setParameterBoolean(e, s) {
1882
1884
  xn(e, s);
@@ -1913,24 +1915,24 @@ class ie extends Ot.EventEmitter {
1913
1915
  }
1914
1916
  }
1915
1917
  ie.version = As;
1916
- ie.ERROR = z.Error;
1917
- ie.CONNECTED = z.Connected;
1918
- ie.INPUT = z.Input;
1919
- ie.INPUTS = z.Inputs;
1920
- ie.MESSAGE = z.Message;
1918
+ ie.ERROR = F.Error;
1919
+ ie.CONNECTED = F.Connected;
1920
+ ie.INPUT = F.Input;
1921
+ ie.INPUTS = F.Inputs;
1922
+ ie.MESSAGE = F.Message;
1921
1923
  ie.deserializeInputs = Ce;
1922
1924
  ie.serializeInputs = Ke;
1923
1925
  var qe = {};
1924
- const oe = "\\\\/", Ut = `[^${oe}]`, le = "\\.", Fn = "\\+", zn = "\\?", Qe = "\\/", Jn = "(?=.)", ms = "[^/]", Et = `(?:${Qe}|$)`, ys = `(?:^|${Qe})`, Mt = `${le}{1,2}${Et}`, Gn = `(?!${le})`, Vn = `(?!${ys}${Mt})`, Wn = `(?!${le}{0,1}${Et})`, Kn = `(?!${Mt})`, Xn = `[^.${Qe}]`, qn = `${ms}*?`, Qn = "/", gs = {
1926
+ const oe = "\\\\/", Ut = `[^${oe}]`, le = "\\.", Fn = "\\+", zn = "\\?", Qe = "\\/", Gn = "(?=.)", ms = "[^/]", Et = `(?:${Qe}|$)`, ys = `(?:^|${Qe})`, Mt = `${le}{1,2}${Et}`, Jn = `(?!${le})`, Vn = `(?!${ys}${Mt})`, Wn = `(?!${le}{0,1}${Et})`, Kn = `(?!${Mt})`, Xn = `[^.${Qe}]`, qn = `${ms}*?`, Qn = "/", gs = {
1925
1927
  DOT_LITERAL: le,
1926
1928
  PLUS_LITERAL: Fn,
1927
1929
  QMARK_LITERAL: zn,
1928
1930
  SLASH_LITERAL: Qe,
1929
- ONE_CHAR: Jn,
1931
+ ONE_CHAR: Gn,
1930
1932
  QMARK: ms,
1931
1933
  END_ANCHOR: Et,
1932
1934
  DOTS_SLASH: Mt,
1933
- NO_DOT: Gn,
1935
+ NO_DOT: Jn,
1934
1936
  NO_DOTS: Vn,
1935
1937
  NO_DOT_SLASH: Wn,
1936
1938
  NO_DOTS_SLASH: Kn,
@@ -2141,45 +2143,45 @@ const Bt = qe, {
2141
2143
  /* ? */
2142
2144
  CHAR_RIGHT_CURLY_BRACE: ii,
2143
2145
  /* } */
2144
- CHAR_RIGHT_PARENTHESES: Jt,
2146
+ CHAR_RIGHT_PARENTHESES: Gt,
2145
2147
  /* ) */
2146
2148
  CHAR_RIGHT_SQUARE_BRACKET: ri
2147
2149
  /* ] */
2148
- } = Ye, Gt = (t) => t === _s || t === Me, Vt = (t) => {
2150
+ } = Ye, Jt = (t) => t === _s || t === Me, Vt = (t) => {
2149
2151
  t.isPrefix !== !0 && (t.depth = t.isGlobstar ? 1 / 0 : 1);
2150
2152
  }, oi = (t, e) => {
2151
2153
  const s = e || {}, n = t.length - 1, i = s.parts === !0 || s.scanToEnd === !0, o = [], r = [], a = [];
2152
- let u = t, l = -1, c = 0, d = 0, g = !1, v = !1, m = !1, S = !1, b = !1, x = !1, w = !1, A = !1, E = !1, O = 0, k, R, L = { value: "", depth: 0, isGlob: !1 };
2153
- const U = () => l >= n, f = () => u.charCodeAt(l + 1), M = () => (k = R, u.charCodeAt(++l));
2154
+ let u = t, l = -1, c = 0, p = 0, m = !1, _ = !1, y = !1, O = !1, R = !1, $ = !1, w = !1, A = !1, C = !1, S = 0, k, E, v = { value: "", depth: 0, isGlob: !1 };
2155
+ const x = () => l >= n, d = () => u.charCodeAt(l + 1), T = () => (k = E, u.charCodeAt(++l));
2154
2156
  for (; l < n; ) {
2155
- R = M();
2156
- let W;
2157
- if (R === Me) {
2158
- w = L.backslashes = !0, R = M(), R === it && (x = !0);
2157
+ E = T();
2158
+ let V;
2159
+ if (E === Me) {
2160
+ w = v.backslashes = !0, E = T(), E === it && ($ = !0);
2159
2161
  continue;
2160
2162
  }
2161
- if (x === !0 || R === it) {
2162
- for (O++; U() !== !0 && (R = M()); ) {
2163
- if (R === Me) {
2164
- w = L.backslashes = !0, M();
2163
+ if ($ === !0 || E === it) {
2164
+ for (S++; x() !== !0 && (E = T()); ) {
2165
+ if (E === Me) {
2166
+ w = v.backslashes = !0, T();
2165
2167
  continue;
2166
2168
  }
2167
- if (R === it) {
2168
- O++;
2169
+ if (E === it) {
2170
+ S++;
2169
2171
  continue;
2170
2172
  }
2171
- if (x !== !0 && R === nt && (R = M()) === nt) {
2172
- if (g = L.isBrace = !0, m = L.isGlob = !0, E = !0, i === !0)
2173
+ if ($ !== !0 && E === nt && (E = T()) === nt) {
2174
+ if (m = v.isBrace = !0, y = v.isGlob = !0, C = !0, i === !0)
2173
2175
  continue;
2174
2176
  break;
2175
2177
  }
2176
- if (x !== !0 && R === ti) {
2177
- if (g = L.isBrace = !0, m = L.isGlob = !0, E = !0, i === !0)
2178
+ if ($ !== !0 && E === ti) {
2179
+ if (m = v.isBrace = !0, y = v.isGlob = !0, C = !0, i === !0)
2178
2180
  continue;
2179
2181
  break;
2180
2182
  }
2181
- if (R === ii && (O--, O === 0)) {
2182
- x = !1, g = L.isBrace = !0, E = !0;
2183
+ if (E === ii && (S--, S === 0)) {
2184
+ $ = !1, m = v.isBrace = !0, C = !0;
2183
2185
  break;
2184
2186
  }
2185
2187
  }
@@ -2187,25 +2189,25 @@ const Bt = qe, {
2187
2189
  continue;
2188
2190
  break;
2189
2191
  }
2190
- if (R === _s) {
2191
- if (o.push(l), r.push(L), L = { value: "", depth: 0, isGlob: !1 }, E === !0)
2192
+ if (E === _s) {
2193
+ if (o.push(l), r.push(v), v = { value: "", depth: 0, isGlob: !1 }, C === !0)
2192
2194
  continue;
2193
2195
  if (k === nt && l === c + 1) {
2194
2196
  c += 2;
2195
2197
  continue;
2196
2198
  }
2197
- d = l + 1;
2199
+ p = l + 1;
2198
2200
  continue;
2199
2201
  }
2200
- if (s.noext !== !0 && (R === ni || R === ei || R === st || R === zt || R === Ft) === !0 && f() === rt) {
2201
- if (m = L.isGlob = !0, S = L.isExtglob = !0, E = !0, i === !0) {
2202
- for (; U() !== !0 && (R = M()); ) {
2203
- if (R === Me) {
2204
- w = L.backslashes = !0, R = M();
2202
+ if (s.noext !== !0 && (E === ni || E === ei || E === st || E === zt || E === Ft) === !0 && d() === rt) {
2203
+ if (y = v.isGlob = !0, O = v.isExtglob = !0, C = !0, i === !0) {
2204
+ for (; x() !== !0 && (E = T()); ) {
2205
+ if (E === Me) {
2206
+ w = v.backslashes = !0, E = T();
2205
2207
  continue;
2206
2208
  }
2207
- if (R === Jt) {
2208
- m = L.isGlob = !0, E = !0;
2209
+ if (E === Gt) {
2210
+ y = v.isGlob = !0, C = !0;
2209
2211
  break;
2210
2212
  }
2211
2213
  }
@@ -2213,41 +2215,41 @@ const Bt = qe, {
2213
2215
  }
2214
2216
  break;
2215
2217
  }
2216
- if (R === st) {
2217
- if (k === st && (b = L.isGlobstar = !0), m = L.isGlob = !0, E = !0, i === !0)
2218
+ if (E === st) {
2219
+ if (k === st && (R = v.isGlobstar = !0), y = v.isGlob = !0, C = !0, i === !0)
2218
2220
  continue;
2219
2221
  break;
2220
2222
  }
2221
- if (R === zt) {
2222
- if (m = L.isGlob = !0, E = !0, i === !0)
2223
+ if (E === zt) {
2224
+ if (y = v.isGlob = !0, C = !0, i === !0)
2223
2225
  continue;
2224
2226
  break;
2225
2227
  }
2226
- if (R === si)
2227
- for (; U() !== !0 && (W = M()); ) {
2228
- if (W === Me) {
2229
- w = L.backslashes = !0, M();
2228
+ if (E === si)
2229
+ for (; x() !== !0 && (V = T()); ) {
2230
+ if (V === Me) {
2231
+ w = v.backslashes = !0, T();
2230
2232
  continue;
2231
2233
  }
2232
- if (W === ri) {
2233
- if (v = L.isBracket = !0, m = L.isGlob = !0, E = !0, i === !0)
2234
+ if (V === ri) {
2235
+ if (_ = v.isBracket = !0, y = v.isGlob = !0, C = !0, i === !0)
2234
2236
  continue;
2235
2237
  break;
2236
2238
  }
2237
2239
  }
2238
- if (s.nonegate !== !0 && R === Ft && l === c) {
2239
- A = L.negated = !0, c++;
2240
+ if (s.nonegate !== !0 && E === Ft && l === c) {
2241
+ A = v.negated = !0, c++;
2240
2242
  continue;
2241
2243
  }
2242
- if (s.noparen !== !0 && R === rt) {
2243
- if (m = L.isGlob = !0, i === !0) {
2244
- for (; U() !== !0 && (R = M()); ) {
2245
- if (R === rt) {
2246
- w = L.backslashes = !0, R = M();
2244
+ if (s.noparen !== !0 && E === rt) {
2245
+ if (y = v.isGlob = !0, i === !0) {
2246
+ for (; x() !== !0 && (E = T()); ) {
2247
+ if (E === rt) {
2248
+ w = v.backslashes = !0, E = T();
2247
2249
  continue;
2248
2250
  }
2249
- if (R === Jt) {
2250
- E = !0;
2251
+ if (E === Gt) {
2252
+ C = !0;
2251
2253
  break;
2252
2254
  }
2253
2255
  }
@@ -2255,50 +2257,50 @@ const Bt = qe, {
2255
2257
  }
2256
2258
  break;
2257
2259
  }
2258
- if (m === !0) {
2259
- if (E = !0, i === !0)
2260
+ if (y === !0) {
2261
+ if (C = !0, i === !0)
2260
2262
  continue;
2261
2263
  break;
2262
2264
  }
2263
2265
  }
2264
- s.noext === !0 && (S = !1, m = !1);
2265
- let I = u, B = "", h = "";
2266
- c > 0 && (B = u.slice(0, c), u = u.slice(c), d -= c), I && m === !0 && d > 0 ? (I = u.slice(0, d), h = u.slice(d)) : m === !0 ? (I = "", h = u) : I = u, I && I !== "" && I !== "/" && I !== u && Gt(I.charCodeAt(I.length - 1)) && (I = I.slice(0, -1)), s.unescape === !0 && (h && (h = Bt.removeBackslashes(h)), I && w === !0 && (I = Bt.removeBackslashes(I)));
2267
- const p = {
2268
- prefix: B,
2266
+ s.noext === !0 && (O = !1, y = !1);
2267
+ let H = u, Z = "", f = "";
2268
+ c > 0 && (Z = u.slice(0, c), u = u.slice(c), p -= c), H && y === !0 && p > 0 ? (H = u.slice(0, p), f = u.slice(p)) : y === !0 ? (H = "", f = u) : H = u, H && H !== "" && H !== "/" && H !== u && Jt(H.charCodeAt(H.length - 1)) && (H = H.slice(0, -1)), s.unescape === !0 && (f && (f = Bt.removeBackslashes(f)), H && w === !0 && (H = Bt.removeBackslashes(H)));
2269
+ const h = {
2270
+ prefix: Z,
2269
2271
  input: t,
2270
2272
  start: c,
2271
- base: I,
2272
- glob: h,
2273
- isBrace: g,
2274
- isBracket: v,
2275
- isGlob: m,
2276
- isExtglob: S,
2277
- isGlobstar: b,
2273
+ base: H,
2274
+ glob: f,
2275
+ isBrace: m,
2276
+ isBracket: _,
2277
+ isGlob: y,
2278
+ isExtglob: O,
2279
+ isGlobstar: R,
2278
2280
  negated: A
2279
2281
  };
2280
- if (s.tokens === !0 && (p.maxDepth = 0, Gt(R) || r.push(L), p.tokens = r), s.parts === !0 || s.tokens === !0) {
2281
- let W;
2282
+ if (s.tokens === !0 && (h.maxDepth = 0, Jt(E) || r.push(v), h.tokens = r), s.parts === !0 || s.tokens === !0) {
2283
+ let V;
2282
2284
  for (let N = 0; N < o.length; N++) {
2283
- const re = W ? W + 1 : c, ce = o[N], Q = t.slice(re, ce);
2284
- s.tokens && (N === 0 && c !== 0 ? (r[N].isPrefix = !0, r[N].value = B) : r[N].value = Q, Vt(r[N]), p.maxDepth += r[N].depth), (N !== 0 || Q !== "") && a.push(Q), W = ce;
2285
+ const re = V ? V + 1 : c, ce = o[N], q = t.slice(re, ce);
2286
+ s.tokens && (N === 0 && c !== 0 ? (r[N].isPrefix = !0, r[N].value = Z) : r[N].value = q, Vt(r[N]), h.maxDepth += r[N].depth), (N !== 0 || q !== "") && a.push(q), V = ce;
2285
2287
  }
2286
- if (W && W + 1 < t.length) {
2287
- const N = t.slice(W + 1);
2288
- a.push(N), s.tokens && (r[r.length - 1].value = N, Vt(r[r.length - 1]), p.maxDepth += r[r.length - 1].depth);
2288
+ if (V && V + 1 < t.length) {
2289
+ const N = t.slice(V + 1);
2290
+ a.push(N), s.tokens && (r[r.length - 1].value = N, Vt(r[r.length - 1]), h.maxDepth += r[r.length - 1].depth);
2289
2291
  }
2290
- p.slashes = o, p.parts = a;
2292
+ h.slashes = o, h.parts = a;
2291
2293
  }
2292
- return p;
2294
+ return h;
2293
2295
  };
2294
2296
  var ai = oi;
2295
- const Ge = Ye, se = qe, {
2297
+ const Je = Ye, se = qe, {
2296
2298
  MAX_LENGTH: Ve,
2297
2299
  POSIX_REGEX_SOURCE: ui,
2298
2300
  REGEX_NON_SPECIAL_CHARS: ci,
2299
2301
  REGEX_SPECIAL_CHARS_BACKREF: li,
2300
2302
  REPLACEMENTS: bs
2301
- } = Ge, fi = (t, e) => {
2303
+ } = Je, fi = (t, e) => {
2302
2304
  if (typeof e.expandRange == "function")
2303
2305
  return e.expandRange(...t, e);
2304
2306
  t.sort();
@@ -2309,7 +2311,7 @@ const Ge = Ye, se = qe, {
2309
2311
  return t.map((i) => se.escapeRegex(i)).join("..");
2310
2312
  }
2311
2313
  return s;
2312
- }, ve = (t, e) => `Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`, ws = (t, e) => {
2314
+ }, we = (t, e) => `Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`, vs = (t, e) => {
2313
2315
  if (typeof t != "string")
2314
2316
  throw new TypeError("Expected a string");
2315
2317
  t = bs[t] || t;
@@ -2317,23 +2319,23 @@ const Ge = Ye, se = qe, {
2317
2319
  let i = t.length;
2318
2320
  if (i > n)
2319
2321
  throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);
2320
- const o = { type: "bos", value: "", output: s.prepend || "" }, r = [o], a = s.capture ? "" : "?:", u = Ge.globChars(s.windows), l = Ge.extglobChars(u), {
2322
+ const o = { type: "bos", value: "", output: s.prepend || "" }, r = [o], a = s.capture ? "" : "?:", u = Je.globChars(s.windows), l = Je.extglobChars(u), {
2321
2323
  DOT_LITERAL: c,
2322
- PLUS_LITERAL: d,
2323
- SLASH_LITERAL: g,
2324
- ONE_CHAR: v,
2325
- DOTS_SLASH: m,
2326
- NO_DOT: S,
2327
- NO_DOT_SLASH: b,
2328
- NO_DOTS_SLASH: x,
2324
+ PLUS_LITERAL: p,
2325
+ SLASH_LITERAL: m,
2326
+ ONE_CHAR: _,
2327
+ DOTS_SLASH: y,
2328
+ NO_DOT: O,
2329
+ NO_DOT_SLASH: R,
2330
+ NO_DOTS_SLASH: $,
2329
2331
  QMARK: w,
2330
2332
  QMARK_NO_DOT: A,
2331
- STAR: E,
2332
- START_ANCHOR: O
2333
- } = u, k = (_) => `(${a}(?:(?!${O}${_.dot ? m : c}).)*?)`, R = s.dot ? "" : S, L = s.dot ? w : A;
2334
- let U = s.bash === !0 ? k(s) : E;
2335
- s.capture && (U = `(${U})`), typeof s.noext == "boolean" && (s.noextglob = s.noext);
2336
- const f = {
2333
+ STAR: C,
2334
+ START_ANCHOR: S
2335
+ } = u, k = (b) => `(${a}(?:(?!${S}${b.dot ? y : c}).)*?)`, E = s.dot ? "" : O, v = s.dot ? w : A;
2336
+ let x = s.bash === !0 ? k(s) : C;
2337
+ s.capture && (x = `(${x})`), typeof s.noext == "boolean" && (s.noextglob = s.noext);
2338
+ const d = {
2337
2339
  input: t,
2338
2340
  index: -1,
2339
2341
  start: 0,
@@ -2350,347 +2352,347 @@ const Ge = Ye, se = qe, {
2350
2352
  globstar: !1,
2351
2353
  tokens: r
2352
2354
  };
2353
- t = se.removePrefix(t, f), i = t.length;
2354
- const M = [], I = [], B = [];
2355
- let h = o, p;
2356
- const W = () => f.index === i - 1, N = f.peek = (_ = 1) => t[f.index + _], re = f.advance = () => t[++f.index], ce = () => t.slice(f.index + 1), Q = (_ = "", H = 0) => {
2357
- f.consumed += _, f.index += H;
2358
- }, De = (_) => {
2359
- f.output += _.output != null ? _.output : _.value, Q(_.value);
2355
+ t = se.removePrefix(t, d), i = t.length;
2356
+ const T = [], H = [], Z = [];
2357
+ let f = o, h;
2358
+ const V = () => d.index === i - 1, N = d.peek = (b = 1) => t[d.index + b], re = d.advance = () => t[++d.index], ce = () => t.slice(d.index + 1), q = (b = "", j = 0) => {
2359
+ d.consumed += b, d.index += j;
2360
+ }, De = (b) => {
2361
+ d.output += b.output != null ? b.output : b.value, q(b.value);
2360
2362
  }, Rs = () => {
2361
- let _ = 1;
2363
+ let b = 1;
2362
2364
  for (; N() === "!" && (N(2) !== "(" || N(3) === "?"); )
2363
- re(), f.start++, _++;
2364
- return _ % 2 === 0 ? !1 : (f.negated = !0, f.start++, !0);
2365
- }, Ne = (_) => {
2366
- f[_]++, B.push(_);
2367
- }, ye = (_) => {
2368
- f[_]--, B.pop();
2369
- }, P = (_) => {
2370
- if (h.type === "globstar") {
2371
- const H = f.braces > 0 && (_.type === "comma" || _.type === "brace"), y = _.extglob === !0 || M.length && (_.type === "pipe" || _.type === "paren");
2372
- _.type !== "slash" && _.type !== "paren" && !H && !y && (f.output = f.output.slice(0, -h.output.length), h.type = "star", h.value = "*", h.output = U, f.output += h.output);
2373
- }
2374
- if (M.length && _.type !== "paren" && !l[_.value] && (M[M.length - 1].inner += _.value), (_.value || _.output) && De(_), h && h.type === "text" && _.type === "text") {
2375
- h.value += _.value, h.output = (h.output || "") + _.value;
2365
+ re(), d.start++, b++;
2366
+ return b % 2 === 0 ? !1 : (d.negated = !0, d.start++, !0);
2367
+ }, Ne = (b) => {
2368
+ d[b]++, Z.push(b);
2369
+ }, ye = (b) => {
2370
+ d[b]--, Z.pop();
2371
+ }, L = (b) => {
2372
+ if (f.type === "globstar") {
2373
+ const j = d.braces > 0 && (b.type === "comma" || b.type === "brace"), g = b.extglob === !0 || T.length && (b.type === "pipe" || b.type === "paren");
2374
+ b.type !== "slash" && b.type !== "paren" && !j && !g && (d.output = d.output.slice(0, -f.output.length), f.type = "star", f.value = "*", f.output = x, d.output += f.output);
2375
+ }
2376
+ if (T.length && b.type !== "paren" && !l[b.value] && (T[T.length - 1].inner += b.value), (b.value || b.output) && De(b), f && f.type === "text" && b.type === "text") {
2377
+ f.value += b.value, f.output = (f.output || "") + b.value;
2376
2378
  return;
2377
2379
  }
2378
- _.prev = h, r.push(_), h = _;
2379
- }, ke = (_, H) => {
2380
- const y = { ...l[H], conditions: 1, inner: "" };
2381
- y.prev = h, y.parens = f.parens, y.output = f.output;
2382
- const D = (s.capture ? "(" : "") + y.open;
2383
- Ne("parens"), P({ type: _, value: H, output: f.output ? "" : v }), P({ type: "paren", extglob: !0, value: re(), output: D }), M.push(y);
2384
- }, Ss = (_) => {
2385
- let H = _.close + (s.capture ? ")" : "");
2386
- if (_.type === "negate") {
2387
- let y = U;
2388
- _.inner && _.inner.length > 1 && _.inner.includes("/") && (y = k(s)), (y !== U || W() || /^\)+$/.test(ce())) && (H = _.close = `)$))${y}`), _.prev.type === "bos" && W() && (f.negatedExtglob = !0);
2389
- }
2390
- P({ type: "paren", extglob: !0, value: p, output: H }), ye("parens");
2380
+ b.prev = f, r.push(b), f = b;
2381
+ }, ke = (b, j) => {
2382
+ const g = { ...l[j], conditions: 1, inner: "" };
2383
+ g.prev = f, g.parens = d.parens, g.output = d.output;
2384
+ const D = (s.capture ? "(" : "") + g.open;
2385
+ Ne("parens"), L({ type: b, value: j, output: d.output ? "" : _ }), L({ type: "paren", extglob: !0, value: re(), output: D }), T.push(g);
2386
+ }, Ss = (b) => {
2387
+ let j = b.close + (s.capture ? ")" : "");
2388
+ if (b.type === "negate") {
2389
+ let g = x;
2390
+ b.inner && b.inner.length > 1 && b.inner.includes("/") && (g = k(s)), (g !== x || V() || /^\)+$/.test(ce())) && (j = b.close = `)$))${g}`), b.prev.type === "bos" && V() && (d.negatedExtglob = !0);
2391
+ }
2392
+ L({ type: "paren", extglob: !0, value: h, output: j }), ye("parens");
2391
2393
  };
2392
2394
  if (s.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(t)) {
2393
- let _ = !1, H = t.replace(li, (y, D, F, K, V, Ze) => K === "\\" ? (_ = !0, y) : K === "?" ? D ? D + K + (V ? w.repeat(V.length) : "") : Ze === 0 ? L + (V ? w.repeat(V.length) : "") : w.repeat(F.length) : K === "." ? c.repeat(F.length) : K === "*" ? D ? D + K + (V ? U : "") : U : D ? y : `\\${y}`);
2394
- return _ === !0 && (s.unescape === !0 ? H = H.replace(/\\/g, "") : H = H.replace(/\\+/g, (y) => y.length % 2 === 0 ? "\\\\" : y ? "\\" : "")), H === t && s.contains === !0 ? (f.output = t, f) : (f.output = se.wrapOutput(H, f, e), f);
2395
+ let b = !1, j = t.replace(li, (g, D, B, W, J, Ze) => W === "\\" ? (b = !0, g) : W === "?" ? D ? D + W + (J ? w.repeat(J.length) : "") : Ze === 0 ? v + (J ? w.repeat(J.length) : "") : w.repeat(B.length) : W === "." ? c.repeat(B.length) : W === "*" ? D ? D + W + (J ? x : "") : x : D ? g : `\\${g}`);
2396
+ return b === !0 && (s.unescape === !0 ? j = j.replace(/\\/g, "") : j = j.replace(/\\+/g, (g) => g.length % 2 === 0 ? "\\\\" : g ? "\\" : "")), j === t && s.contains === !0 ? (d.output = t, d) : (d.output = se.wrapOutput(j, d, e), d);
2395
2397
  }
2396
- for (; !W(); ) {
2397
- if (p = re(), p === "\0")
2398
+ for (; !V(); ) {
2399
+ if (h = re(), h === "\0")
2398
2400
  continue;
2399
- if (p === "\\") {
2400
- const y = N();
2401
- if (y === "/" && s.bash !== !0 || y === "." || y === ";")
2401
+ if (h === "\\") {
2402
+ const g = N();
2403
+ if (g === "/" && s.bash !== !0 || g === "." || g === ";")
2402
2404
  continue;
2403
- if (!y) {
2404
- p += "\\", P({ type: "text", value: p });
2405
+ if (!g) {
2406
+ h += "\\", L({ type: "text", value: h });
2405
2407
  continue;
2406
2408
  }
2407
2409
  const D = /^\\+/.exec(ce());
2408
- let F = 0;
2409
- if (D && D[0].length > 2 && (F = D[0].length, f.index += F, F % 2 !== 0 && (p += "\\")), s.unescape === !0 ? p = re() || "" : p += re() || "", f.brackets === 0) {
2410
- P({ type: "text", value: p });
2410
+ let B = 0;
2411
+ if (D && D[0].length > 2 && (B = D[0].length, d.index += B, B % 2 !== 0 && (h += "\\")), s.unescape === !0 ? h = re() || "" : h += re() || "", d.brackets === 0) {
2412
+ L({ type: "text", value: h });
2411
2413
  continue;
2412
2414
  }
2413
2415
  }
2414
- if (f.brackets > 0 && (p !== "]" || h.value === "[" || h.value === "[^")) {
2415
- if (s.posix !== !1 && p === ":") {
2416
- const y = h.value.slice(1);
2417
- if (y.includes("[") && (h.posix = !0, y.includes(":"))) {
2418
- const D = h.value.lastIndexOf("["), F = h.value.slice(0, D), K = h.value.slice(D + 2), V = ui[K];
2419
- if (V) {
2420
- h.value = F + V, f.backtrack = !0, re(), !o.output && r.indexOf(h) === 1 && (o.output = v);
2416
+ if (d.brackets > 0 && (h !== "]" || f.value === "[" || f.value === "[^")) {
2417
+ if (s.posix !== !1 && h === ":") {
2418
+ const g = f.value.slice(1);
2419
+ if (g.includes("[") && (f.posix = !0, g.includes(":"))) {
2420
+ const D = f.value.lastIndexOf("["), B = f.value.slice(0, D), W = f.value.slice(D + 2), J = ui[W];
2421
+ if (J) {
2422
+ f.value = B + J, d.backtrack = !0, re(), !o.output && r.indexOf(f) === 1 && (o.output = _);
2421
2423
  continue;
2422
2424
  }
2423
2425
  }
2424
2426
  }
2425
- (p === "[" && N() !== ":" || p === "-" && N() === "]") && (p = `\\${p}`), p === "]" && (h.value === "[" || h.value === "[^") && (p = `\\${p}`), s.posix === !0 && p === "!" && h.value === "[" && (p = "^"), h.value += p, De({ value: p });
2427
+ (h === "[" && N() !== ":" || h === "-" && N() === "]") && (h = `\\${h}`), h === "]" && (f.value === "[" || f.value === "[^") && (h = `\\${h}`), s.posix === !0 && h === "!" && f.value === "[" && (h = "^"), f.value += h, De({ value: h });
2426
2428
  continue;
2427
2429
  }
2428
- if (f.quotes === 1 && p !== '"') {
2429
- p = se.escapeRegex(p), h.value += p, De({ value: p });
2430
+ if (d.quotes === 1 && h !== '"') {
2431
+ h = se.escapeRegex(h), f.value += h, De({ value: h });
2430
2432
  continue;
2431
2433
  }
2432
- if (p === '"') {
2433
- f.quotes = f.quotes === 1 ? 0 : 1, s.keepQuotes === !0 && P({ type: "text", value: p });
2434
+ if (h === '"') {
2435
+ d.quotes = d.quotes === 1 ? 0 : 1, s.keepQuotes === !0 && L({ type: "text", value: h });
2434
2436
  continue;
2435
2437
  }
2436
- if (p === "(") {
2437
- Ne("parens"), P({ type: "paren", value: p });
2438
+ if (h === "(") {
2439
+ Ne("parens"), L({ type: "paren", value: h });
2438
2440
  continue;
2439
2441
  }
2440
- if (p === ")") {
2441
- if (f.parens === 0 && s.strictBrackets === !0)
2442
- throw new SyntaxError(ve("opening", "("));
2443
- const y = M[M.length - 1];
2444
- if (y && f.parens === y.parens + 1) {
2445
- Ss(M.pop());
2442
+ if (h === ")") {
2443
+ if (d.parens === 0 && s.strictBrackets === !0)
2444
+ throw new SyntaxError(we("opening", "("));
2445
+ const g = T[T.length - 1];
2446
+ if (g && d.parens === g.parens + 1) {
2447
+ Ss(T.pop());
2446
2448
  continue;
2447
2449
  }
2448
- P({ type: "paren", value: p, output: f.parens ? ")" : "\\)" }), ye("parens");
2450
+ L({ type: "paren", value: h, output: d.parens ? ")" : "\\)" }), ye("parens");
2449
2451
  continue;
2450
2452
  }
2451
- if (p === "[") {
2453
+ if (h === "[") {
2452
2454
  if (s.nobracket === !0 || !ce().includes("]")) {
2453
2455
  if (s.nobracket !== !0 && s.strictBrackets === !0)
2454
- throw new SyntaxError(ve("closing", "]"));
2455
- p = `\\${p}`;
2456
+ throw new SyntaxError(we("closing", "]"));
2457
+ h = `\\${h}`;
2456
2458
  } else
2457
2459
  Ne("brackets");
2458
- P({ type: "bracket", value: p });
2460
+ L({ type: "bracket", value: h });
2459
2461
  continue;
2460
2462
  }
2461
- if (p === "]") {
2462
- if (s.nobracket === !0 || h && h.type === "bracket" && h.value.length === 1) {
2463
- P({ type: "text", value: p, output: `\\${p}` });
2463
+ if (h === "]") {
2464
+ if (s.nobracket === !0 || f && f.type === "bracket" && f.value.length === 1) {
2465
+ L({ type: "text", value: h, output: `\\${h}` });
2464
2466
  continue;
2465
2467
  }
2466
- if (f.brackets === 0) {
2468
+ if (d.brackets === 0) {
2467
2469
  if (s.strictBrackets === !0)
2468
- throw new SyntaxError(ve("opening", "["));
2469
- P({ type: "text", value: p, output: `\\${p}` });
2470
+ throw new SyntaxError(we("opening", "["));
2471
+ L({ type: "text", value: h, output: `\\${h}` });
2470
2472
  continue;
2471
2473
  }
2472
2474
  ye("brackets");
2473
- const y = h.value.slice(1);
2474
- if (h.posix !== !0 && y[0] === "^" && !y.includes("/") && (p = `/${p}`), h.value += p, De({ value: p }), s.literalBrackets === !1 || se.hasRegexChars(y))
2475
+ const g = f.value.slice(1);
2476
+ if (f.posix !== !0 && g[0] === "^" && !g.includes("/") && (h = `/${h}`), f.value += h, De({ value: h }), s.literalBrackets === !1 || se.hasRegexChars(g))
2475
2477
  continue;
2476
- const D = se.escapeRegex(h.value);
2477
- if (f.output = f.output.slice(0, -h.value.length), s.literalBrackets === !0) {
2478
- f.output += D, h.value = D;
2478
+ const D = se.escapeRegex(f.value);
2479
+ if (d.output = d.output.slice(0, -f.value.length), s.literalBrackets === !0) {
2480
+ d.output += D, f.value = D;
2479
2481
  continue;
2480
2482
  }
2481
- h.value = `(${a}${D}|${h.value})`, f.output += h.value;
2483
+ f.value = `(${a}${D}|${f.value})`, d.output += f.value;
2482
2484
  continue;
2483
2485
  }
2484
- if (p === "{" && s.nobrace !== !0) {
2486
+ if (h === "{" && s.nobrace !== !0) {
2485
2487
  Ne("braces");
2486
- const y = {
2488
+ const g = {
2487
2489
  type: "brace",
2488
- value: p,
2490
+ value: h,
2489
2491
  output: "(",
2490
- outputIndex: f.output.length,
2491
- tokensIndex: f.tokens.length
2492
+ outputIndex: d.output.length,
2493
+ tokensIndex: d.tokens.length
2492
2494
  };
2493
- I.push(y), P(y);
2495
+ H.push(g), L(g);
2494
2496
  continue;
2495
2497
  }
2496
- if (p === "}") {
2497
- const y = I[I.length - 1];
2498
- if (s.nobrace === !0 || !y) {
2499
- P({ type: "text", value: p, output: p });
2498
+ if (h === "}") {
2499
+ const g = H[H.length - 1];
2500
+ if (s.nobrace === !0 || !g) {
2501
+ L({ type: "text", value: h, output: h });
2500
2502
  continue;
2501
2503
  }
2502
2504
  let D = ")";
2503
- if (y.dots === !0) {
2504
- const F = r.slice(), K = [];
2505
- for (let V = F.length - 1; V >= 0 && (r.pop(), F[V].type !== "brace"); V--)
2506
- F[V].type !== "dots" && K.unshift(F[V].value);
2507
- D = fi(K, s), f.backtrack = !0;
2508
- }
2509
- if (y.comma !== !0 && y.dots !== !0) {
2510
- const F = f.output.slice(0, y.outputIndex), K = f.tokens.slice(y.tokensIndex);
2511
- y.value = y.output = "\\{", p = D = "\\}", f.output = F;
2512
- for (const V of K)
2513
- f.output += V.output || V.value;
2514
- }
2515
- P({ type: "brace", value: p, output: D }), ye("braces"), I.pop();
2505
+ if (g.dots === !0) {
2506
+ const B = r.slice(), W = [];
2507
+ for (let J = B.length - 1; J >= 0 && (r.pop(), B[J].type !== "brace"); J--)
2508
+ B[J].type !== "dots" && W.unshift(B[J].value);
2509
+ D = fi(W, s), d.backtrack = !0;
2510
+ }
2511
+ if (g.comma !== !0 && g.dots !== !0) {
2512
+ const B = d.output.slice(0, g.outputIndex), W = d.tokens.slice(g.tokensIndex);
2513
+ g.value = g.output = "\\{", h = D = "\\}", d.output = B;
2514
+ for (const J of W)
2515
+ d.output += J.output || J.value;
2516
+ }
2517
+ L({ type: "brace", value: h, output: D }), ye("braces"), H.pop();
2516
2518
  continue;
2517
2519
  }
2518
- if (p === "|") {
2519
- M.length > 0 && M[M.length - 1].conditions++, P({ type: "text", value: p });
2520
+ if (h === "|") {
2521
+ T.length > 0 && T[T.length - 1].conditions++, L({ type: "text", value: h });
2520
2522
  continue;
2521
2523
  }
2522
- if (p === ",") {
2523
- let y = p;
2524
- const D = I[I.length - 1];
2525
- D && B[B.length - 1] === "braces" && (D.comma = !0, y = "|"), P({ type: "comma", value: p, output: y });
2524
+ if (h === ",") {
2525
+ let g = h;
2526
+ const D = H[H.length - 1];
2527
+ D && Z[Z.length - 1] === "braces" && (D.comma = !0, g = "|"), L({ type: "comma", value: h, output: g });
2526
2528
  continue;
2527
2529
  }
2528
- if (p === "/") {
2529
- if (h.type === "dot" && f.index === f.start + 1) {
2530
- f.start = f.index + 1, f.consumed = "", f.output = "", r.pop(), h = o;
2530
+ if (h === "/") {
2531
+ if (f.type === "dot" && d.index === d.start + 1) {
2532
+ d.start = d.index + 1, d.consumed = "", d.output = "", r.pop(), f = o;
2531
2533
  continue;
2532
2534
  }
2533
- P({ type: "slash", value: p, output: g });
2535
+ L({ type: "slash", value: h, output: m });
2534
2536
  continue;
2535
2537
  }
2536
- if (p === ".") {
2537
- if (f.braces > 0 && h.type === "dot") {
2538
- h.value === "." && (h.output = c);
2539
- const y = I[I.length - 1];
2540
- h.type = "dots", h.output += p, h.value += p, y.dots = !0;
2538
+ if (h === ".") {
2539
+ if (d.braces > 0 && f.type === "dot") {
2540
+ f.value === "." && (f.output = c);
2541
+ const g = H[H.length - 1];
2542
+ f.type = "dots", f.output += h, f.value += h, g.dots = !0;
2541
2543
  continue;
2542
2544
  }
2543
- if (f.braces + f.parens === 0 && h.type !== "bos" && h.type !== "slash") {
2544
- P({ type: "text", value: p, output: c });
2545
+ if (d.braces + d.parens === 0 && f.type !== "bos" && f.type !== "slash") {
2546
+ L({ type: "text", value: h, output: c });
2545
2547
  continue;
2546
2548
  }
2547
- P({ type: "dot", value: p, output: c });
2549
+ L({ type: "dot", value: h, output: c });
2548
2550
  continue;
2549
2551
  }
2550
- if (p === "?") {
2551
- if (!(h && h.value === "(") && s.noextglob !== !0 && N() === "(" && N(2) !== "?") {
2552
- ke("qmark", p);
2552
+ if (h === "?") {
2553
+ if (!(f && f.value === "(") && s.noextglob !== !0 && N() === "(" && N(2) !== "?") {
2554
+ ke("qmark", h);
2553
2555
  continue;
2554
2556
  }
2555
- if (h && h.type === "paren") {
2557
+ if (f && f.type === "paren") {
2556
2558
  const D = N();
2557
- let F = p;
2559
+ let B = h;
2558
2560
  if (D === "<" && !se.supportsLookbehinds())
2559
2561
  throw new Error("Node.js v10 or higher is required for regex lookbehinds");
2560
- (h.value === "(" && !/[!=<:]/.test(D) || D === "<" && !/<([!=]|\w+>)/.test(ce())) && (F = `\\${p}`), P({ type: "text", value: p, output: F });
2562
+ (f.value === "(" && !/[!=<:]/.test(D) || D === "<" && !/<([!=]|\w+>)/.test(ce())) && (B = `\\${h}`), L({ type: "text", value: h, output: B });
2561
2563
  continue;
2562
2564
  }
2563
- if (s.dot !== !0 && (h.type === "slash" || h.type === "bos")) {
2564
- P({ type: "qmark", value: p, output: A });
2565
+ if (s.dot !== !0 && (f.type === "slash" || f.type === "bos")) {
2566
+ L({ type: "qmark", value: h, output: A });
2565
2567
  continue;
2566
2568
  }
2567
- P({ type: "qmark", value: p, output: w });
2569
+ L({ type: "qmark", value: h, output: w });
2568
2570
  continue;
2569
2571
  }
2570
- if (p === "!") {
2572
+ if (h === "!") {
2571
2573
  if (s.noextglob !== !0 && N() === "(" && (N(2) !== "?" || !/[!=<:]/.test(N(3)))) {
2572
- ke("negate", p);
2574
+ ke("negate", h);
2573
2575
  continue;
2574
2576
  }
2575
- if (s.nonegate !== !0 && f.index === 0) {
2577
+ if (s.nonegate !== !0 && d.index === 0) {
2576
2578
  Rs();
2577
2579
  continue;
2578
2580
  }
2579
2581
  }
2580
- if (p === "+") {
2582
+ if (h === "+") {
2581
2583
  if (s.noextglob !== !0 && N() === "(" && N(2) !== "?") {
2582
- ke("plus", p);
2584
+ ke("plus", h);
2583
2585
  continue;
2584
2586
  }
2585
- if (h && h.value === "(" || s.regex === !1) {
2586
- P({ type: "plus", value: p, output: d });
2587
+ if (f && f.value === "(" || s.regex === !1) {
2588
+ L({ type: "plus", value: h, output: p });
2587
2589
  continue;
2588
2590
  }
2589
- if (h && (h.type === "bracket" || h.type === "paren" || h.type === "brace") || f.parens > 0) {
2590
- P({ type: "plus", value: p });
2591
+ if (f && (f.type === "bracket" || f.type === "paren" || f.type === "brace") || d.parens > 0) {
2592
+ L({ type: "plus", value: h });
2591
2593
  continue;
2592
2594
  }
2593
- P({ type: "plus", value: d });
2595
+ L({ type: "plus", value: p });
2594
2596
  continue;
2595
2597
  }
2596
- if (p === "@") {
2598
+ if (h === "@") {
2597
2599
  if (s.noextglob !== !0 && N() === "(" && N(2) !== "?") {
2598
- P({ type: "at", extglob: !0, value: p, output: "" });
2600
+ L({ type: "at", extglob: !0, value: h, output: "" });
2599
2601
  continue;
2600
2602
  }
2601
- P({ type: "text", value: p });
2603
+ L({ type: "text", value: h });
2602
2604
  continue;
2603
2605
  }
2604
- if (p !== "*") {
2605
- (p === "$" || p === "^") && (p = `\\${p}`);
2606
- const y = ci.exec(ce());
2607
- y && (p += y[0], f.index += y[0].length), P({ type: "text", value: p });
2606
+ if (h !== "*") {
2607
+ (h === "$" || h === "^") && (h = `\\${h}`);
2608
+ const g = ci.exec(ce());
2609
+ g && (h += g[0], d.index += g[0].length), L({ type: "text", value: h });
2608
2610
  continue;
2609
2611
  }
2610
- if (h && (h.type === "globstar" || h.star === !0)) {
2611
- h.type = "star", h.star = !0, h.value += p, h.output = U, f.backtrack = !0, f.globstar = !0, Q(p);
2612
+ if (f && (f.type === "globstar" || f.star === !0)) {
2613
+ f.type = "star", f.star = !0, f.value += h, f.output = x, d.backtrack = !0, d.globstar = !0, q(h);
2612
2614
  continue;
2613
2615
  }
2614
- let _ = ce();
2615
- if (s.noextglob !== !0 && /^\([^?]/.test(_)) {
2616
- ke("star", p);
2616
+ let b = ce();
2617
+ if (s.noextglob !== !0 && /^\([^?]/.test(b)) {
2618
+ ke("star", h);
2617
2619
  continue;
2618
2620
  }
2619
- if (h.type === "star") {
2621
+ if (f.type === "star") {
2620
2622
  if (s.noglobstar === !0) {
2621
- Q(p);
2623
+ q(h);
2622
2624
  continue;
2623
2625
  }
2624
- const y = h.prev, D = y.prev, F = y.type === "slash" || y.type === "bos", K = D && (D.type === "star" || D.type === "globstar");
2625
- if (s.bash === !0 && (!F || _[0] && _[0] !== "/")) {
2626
- P({ type: "star", value: p, output: "" });
2626
+ const g = f.prev, D = g.prev, B = g.type === "slash" || g.type === "bos", W = D && (D.type === "star" || D.type === "globstar");
2627
+ if (s.bash === !0 && (!B || b[0] && b[0] !== "/")) {
2628
+ L({ type: "star", value: h, output: "" });
2627
2629
  continue;
2628
2630
  }
2629
- const V = f.braces > 0 && (y.type === "comma" || y.type === "brace"), Ze = M.length && (y.type === "pipe" || y.type === "paren");
2630
- if (!F && y.type !== "paren" && !V && !Ze) {
2631
- P({ type: "star", value: p, output: "" });
2631
+ const J = d.braces > 0 && (g.type === "comma" || g.type === "brace"), Ze = T.length && (g.type === "pipe" || g.type === "paren");
2632
+ if (!B && g.type !== "paren" && !J && !Ze) {
2633
+ L({ type: "star", value: h, output: "" });
2632
2634
  continue;
2633
2635
  }
2634
- for (; _.slice(0, 3) === "/**"; ) {
2635
- const He = t[f.index + 4];
2636
+ for (; b.slice(0, 3) === "/**"; ) {
2637
+ const He = t[d.index + 4];
2636
2638
  if (He && He !== "/")
2637
2639
  break;
2638
- _ = _.slice(3), Q("/**", 3);
2640
+ b = b.slice(3), q("/**", 3);
2639
2641
  }
2640
- if (y.type === "bos" && W()) {
2641
- h.type = "globstar", h.value += p, h.output = k(s), f.output = h.output, f.globstar = !0, Q(p);
2642
+ if (g.type === "bos" && V()) {
2643
+ f.type = "globstar", f.value += h, f.output = k(s), d.output = f.output, d.globstar = !0, q(h);
2642
2644
  continue;
2643
2645
  }
2644
- if (y.type === "slash" && y.prev.type !== "bos" && !K && W()) {
2645
- f.output = f.output.slice(0, -(y.output + h.output).length), y.output = `(?:${y.output}`, h.type = "globstar", h.output = k(s) + (s.strictSlashes ? ")" : "|$)"), h.value += p, f.globstar = !0, f.output += y.output + h.output, Q(p);
2646
+ if (g.type === "slash" && g.prev.type !== "bos" && !W && V()) {
2647
+ d.output = d.output.slice(0, -(g.output + f.output).length), g.output = `(?:${g.output}`, f.type = "globstar", f.output = k(s) + (s.strictSlashes ? ")" : "|$)"), f.value += h, d.globstar = !0, d.output += g.output + f.output, q(h);
2646
2648
  continue;
2647
2649
  }
2648
- if (y.type === "slash" && y.prev.type !== "bos" && _[0] === "/") {
2649
- const He = _[1] !== void 0 ? "|$" : "";
2650
- f.output = f.output.slice(0, -(y.output + h.output).length), y.output = `(?:${y.output}`, h.type = "globstar", h.output = `${k(s)}${g}|${g}${He})`, h.value += p, f.output += y.output + h.output, f.globstar = !0, Q(p + re()), P({ type: "slash", value: "/", output: "" });
2650
+ if (g.type === "slash" && g.prev.type !== "bos" && b[0] === "/") {
2651
+ const He = b[1] !== void 0 ? "|$" : "";
2652
+ d.output = d.output.slice(0, -(g.output + f.output).length), g.output = `(?:${g.output}`, f.type = "globstar", f.output = `${k(s)}${m}|${m}${He})`, f.value += h, d.output += g.output + f.output, d.globstar = !0, q(h + re()), L({ type: "slash", value: "/", output: "" });
2651
2653
  continue;
2652
2654
  }
2653
- if (y.type === "bos" && _[0] === "/") {
2654
- h.type = "globstar", h.value += p, h.output = `(?:^|${g}|${k(s)}${g})`, f.output = h.output, f.globstar = !0, Q(p + re()), P({ type: "slash", value: "/", output: "" });
2655
+ if (g.type === "bos" && b[0] === "/") {
2656
+ f.type = "globstar", f.value += h, f.output = `(?:^|${m}|${k(s)}${m})`, d.output = f.output, d.globstar = !0, q(h + re()), L({ type: "slash", value: "/", output: "" });
2655
2657
  continue;
2656
2658
  }
2657
- f.output = f.output.slice(0, -h.output.length), h.type = "globstar", h.output = k(s), h.value += p, f.output += h.output, f.globstar = !0, Q(p);
2659
+ d.output = d.output.slice(0, -f.output.length), f.type = "globstar", f.output = k(s), f.value += h, d.output += f.output, d.globstar = !0, q(h);
2658
2660
  continue;
2659
2661
  }
2660
- const H = { type: "star", value: p, output: U };
2662
+ const j = { type: "star", value: h, output: x };
2661
2663
  if (s.bash === !0) {
2662
- H.output = ".*?", (h.type === "bos" || h.type === "slash") && (H.output = R + H.output), P(H);
2664
+ j.output = ".*?", (f.type === "bos" || f.type === "slash") && (j.output = E + j.output), L(j);
2663
2665
  continue;
2664
2666
  }
2665
- if (h && (h.type === "bracket" || h.type === "paren") && s.regex === !0) {
2666
- H.output = p, P(H);
2667
+ if (f && (f.type === "bracket" || f.type === "paren") && s.regex === !0) {
2668
+ j.output = h, L(j);
2667
2669
  continue;
2668
2670
  }
2669
- (f.index === f.start || h.type === "slash" || h.type === "dot") && (h.type === "dot" ? (f.output += b, h.output += b) : s.dot === !0 ? (f.output += x, h.output += x) : (f.output += R, h.output += R), N() !== "*" && (f.output += v, h.output += v)), P(H);
2671
+ (d.index === d.start || f.type === "slash" || f.type === "dot") && (f.type === "dot" ? (d.output += R, f.output += R) : s.dot === !0 ? (d.output += $, f.output += $) : (d.output += E, f.output += E), N() !== "*" && (d.output += _, f.output += _)), L(j);
2670
2672
  }
2671
- for (; f.brackets > 0; ) {
2673
+ for (; d.brackets > 0; ) {
2672
2674
  if (s.strictBrackets === !0)
2673
- throw new SyntaxError(ve("closing", "]"));
2674
- f.output = se.escapeLast(f.output, "["), ye("brackets");
2675
+ throw new SyntaxError(we("closing", "]"));
2676
+ d.output = se.escapeLast(d.output, "["), ye("brackets");
2675
2677
  }
2676
- for (; f.parens > 0; ) {
2678
+ for (; d.parens > 0; ) {
2677
2679
  if (s.strictBrackets === !0)
2678
- throw new SyntaxError(ve("closing", ")"));
2679
- f.output = se.escapeLast(f.output, "("), ye("parens");
2680
+ throw new SyntaxError(we("closing", ")"));
2681
+ d.output = se.escapeLast(d.output, "("), ye("parens");
2680
2682
  }
2681
- for (; f.braces > 0; ) {
2683
+ for (; d.braces > 0; ) {
2682
2684
  if (s.strictBrackets === !0)
2683
- throw new SyntaxError(ve("closing", "}"));
2684
- f.output = se.escapeLast(f.output, "{"), ye("braces");
2685
+ throw new SyntaxError(we("closing", "}"));
2686
+ d.output = se.escapeLast(d.output, "{"), ye("braces");
2685
2687
  }
2686
- if (s.strictSlashes !== !0 && (h.type === "star" || h.type === "bracket") && P({ type: "maybe_slash", value: "", output: `${g}?` }), f.backtrack === !0) {
2687
- f.output = "";
2688
- for (const _ of f.tokens)
2689
- f.output += _.output != null ? _.output : _.value, _.suffix && (f.output += _.suffix);
2688
+ if (s.strictSlashes !== !0 && (f.type === "star" || f.type === "bracket") && L({ type: "maybe_slash", value: "", output: `${m}?` }), d.backtrack === !0) {
2689
+ d.output = "";
2690
+ for (const b of d.tokens)
2691
+ d.output += b.output != null ? b.output : b.value, b.suffix && (d.output += b.suffix);
2690
2692
  }
2691
- return f;
2693
+ return d;
2692
2694
  };
2693
- ws.fastpaths = (t, e) => {
2695
+ vs.fastpaths = (t, e) => {
2694
2696
  const s = { ...e }, n = typeof s.maxLength == "number" ? Math.min(Ve, s.maxLength) : Ve, i = t.length;
2695
2697
  if (i > n)
2696
2698
  throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);
@@ -2702,51 +2704,51 @@ ws.fastpaths = (t, e) => {
2702
2704
  DOTS_SLASH: u,
2703
2705
  NO_DOT: l,
2704
2706
  NO_DOTS: c,
2705
- NO_DOTS_SLASH: d,
2706
- STAR: g,
2707
- START_ANCHOR: v
2708
- } = Ge.globChars(s.windows), m = s.dot ? c : l, S = s.dot ? d : l, b = s.capture ? "" : "?:", x = { negated: !1, prefix: "" };
2709
- let w = s.bash === !0 ? ".*?" : g;
2707
+ NO_DOTS_SLASH: p,
2708
+ STAR: m,
2709
+ START_ANCHOR: _
2710
+ } = Je.globChars(s.windows), y = s.dot ? c : l, O = s.dot ? p : l, R = s.capture ? "" : "?:", $ = { negated: !1, prefix: "" };
2711
+ let w = s.bash === !0 ? ".*?" : m;
2710
2712
  s.capture && (w = `(${w})`);
2711
- const A = (R) => R.noglobstar === !0 ? w : `(${b}(?:(?!${v}${R.dot ? u : o}).)*?)`, E = (R) => {
2712
- switch (R) {
2713
+ const A = (E) => E.noglobstar === !0 ? w : `(${R}(?:(?!${_}${E.dot ? u : o}).)*?)`, C = (E) => {
2714
+ switch (E) {
2713
2715
  case "*":
2714
- return `${m}${a}${w}`;
2716
+ return `${y}${a}${w}`;
2715
2717
  case ".*":
2716
2718
  return `${o}${a}${w}`;
2717
2719
  case "*.*":
2718
- return `${m}${w}${o}${a}${w}`;
2720
+ return `${y}${w}${o}${a}${w}`;
2719
2721
  case "*/*":
2720
- return `${m}${w}${r}${a}${S}${w}`;
2722
+ return `${y}${w}${r}${a}${O}${w}`;
2721
2723
  case "**":
2722
- return m + A(s);
2724
+ return y + A(s);
2723
2725
  case "**/*":
2724
- return `(?:${m}${A(s)}${r})?${S}${a}${w}`;
2726
+ return `(?:${y}${A(s)}${r})?${O}${a}${w}`;
2725
2727
  case "**/*.*":
2726
- return `(?:${m}${A(s)}${r})?${S}${w}${o}${a}${w}`;
2728
+ return `(?:${y}${A(s)}${r})?${O}${w}${o}${a}${w}`;
2727
2729
  case "**/.*":
2728
- return `(?:${m}${A(s)}${r})?${o}${a}${w}`;
2730
+ return `(?:${y}${A(s)}${r})?${o}${a}${w}`;
2729
2731
  default: {
2730
- const L = /^(.*?)\.(\w+)$/.exec(R);
2731
- if (!L)
2732
+ const v = /^(.*?)\.(\w+)$/.exec(E);
2733
+ if (!v)
2732
2734
  return;
2733
- const U = E(L[1]);
2734
- return U ? U + o + L[2] : void 0;
2735
+ const x = C(v[1]);
2736
+ return x ? x + o + v[2] : void 0;
2735
2737
  }
2736
2738
  }
2737
- }, O = se.removePrefix(t, x);
2738
- let k = E(O);
2739
+ }, S = se.removePrefix(t, $);
2740
+ let k = C(S);
2739
2741
  return k && s.strictSlashes !== !0 && (k += `${r}?`), k;
2740
2742
  };
2741
- var pi = ws;
2742
- const hi = ai, dt = pi, vs = qe, di = Ye, mi = (t) => t && typeof t == "object" && !Array.isArray(t), G = (t, e, s = !1) => {
2743
+ var pi = vs;
2744
+ const hi = ai, dt = pi, ws = qe, di = Ye, mi = (t) => t && typeof t == "object" && !Array.isArray(t), G = (t, e, s = !1) => {
2743
2745
  if (Array.isArray(t)) {
2744
- const c = t.map((g) => G(g, e, s));
2745
- return (g) => {
2746
- for (const v of c) {
2747
- const m = v(g);
2748
- if (m)
2749
- return m;
2746
+ const c = t.map((m) => G(m, e, s));
2747
+ return (m) => {
2748
+ for (const _ of c) {
2749
+ const y = _(m);
2750
+ if (y)
2751
+ return y;
2750
2752
  }
2751
2753
  return !1;
2752
2754
  };
@@ -2761,9 +2763,9 @@ const hi = ai, dt = pi, vs = qe, di = Ye, mi = (t) => t && typeof t == "object"
2761
2763
  const c = { ...e, ignore: null, onMatch: null, onResult: null };
2762
2764
  u = G(i.ignore, c, s);
2763
2765
  }
2764
- const l = (c, d = !1) => {
2765
- const { isMatch: g, match: v, output: m } = G.test(c, r, e, { glob: t, posix: o }), S = { glob: t, state: a, regex: r, posix: o, input: c, output: m, match: v, isMatch: g };
2766
- return typeof i.onResult == "function" && i.onResult(S), g === !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);
2766
+ const l = (c, p = !1) => {
2767
+ const { isMatch: m, match: _, output: y } = G.test(c, r, e, { glob: t, posix: o }), O = { glob: t, state: a, regex: r, posix: o, input: c, output: y, match: _, isMatch: m };
2768
+ return typeof i.onResult == "function" && i.onResult(O), m === !1 ? (O.isMatch = !1, p ? O : !1) : u(c) ? (typeof i.onIgnore == "function" && i.onIgnore(O), O.isMatch = !1, p ? O : !1) : (typeof i.onMatch == "function" && i.onMatch(O), p ? O : !0);
2767
2769
  };
2768
2770
  return s && (l.state = a), l;
2769
2771
  };
@@ -2772,11 +2774,11 @@ G.test = (t, e, s, { glob: n, posix: i } = {}) => {
2772
2774
  throw new TypeError("Expected input to be a string");
2773
2775
  if (t === "")
2774
2776
  return { isMatch: !1, output: "" };
2775
- const o = s || {}, r = o.format || (i ? vs.toPosixSlashes : null);
2777
+ const o = s || {}, r = o.format || (i ? ws.toPosixSlashes : null);
2776
2778
  let a = t === n, u = a && r ? r(t) : t;
2777
2779
  return a === !1 && (u = r ? r(t) : t, a = u === n), (a === !1 || o.capture === !0) && (o.matchBase === !0 || o.basename === !0 ? a = G.matchBase(t, e, s, i) : a = e.exec(u)), { isMatch: !!a, match: a, output: u };
2778
2780
  };
2779
- G.matchBase = (t, e, s) => (e instanceof RegExp ? e : G.makeRe(e, s)).test(vs.basename(t));
2781
+ G.matchBase = (t, e, s) => (e instanceof RegExp ? e : G.makeRe(e, s)).test(ws.basename(t));
2780
2782
  G.isMatch = (t, e, s) => G(e, s)(t);
2781
2783
  G.parse = (t, e) => Array.isArray(t) ? t.map((s) => G.parse(s, e)) : dt(t, { ...e, fastpaths: !1 });
2782
2784
  G.scan = (t, e) => hi(t, e);
@@ -2817,7 +2819,7 @@ const _i = /* @__PURE__ */ mt(gi), Os = yt(fetch), bi = async (t, e) => {
2817
2819
  retryDelay: 1e3
2818
2820
  })).json();
2819
2821
  return await ss(i, e || Le);
2820
- }, wi = async (t, e) => {
2822
+ }, vi = async (t, e) => {
2821
2823
  if (t.startsWith("data:") || t.startsWith("https://docs.google.com"))
2822
2824
  return;
2823
2825
  const s = new URL(t);
@@ -2842,7 +2844,7 @@ const _i = /* @__PURE__ */ mt(gi), Os = yt(fetch), bi = async (t, e) => {
2842
2844
  return;
2843
2845
  }
2844
2846
  }, Ji = (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;
2845
- class vi extends Ot.EventEmitter {
2847
+ class wi extends Ot.EventEmitter {
2846
2848
  constructor(e, s, n, i, o, r = !1) {
2847
2849
  if (super(), this.inputs = {}, this.outputs = {}, this._disposables = [], this._rpcListeners = [], this._loaded = !1, this._onLoaded = [], this._sendInputsAfterRegistration = !1, this._cachedEventInputsUpdate = {
2848
2850
  iframeId: void 0,
@@ -2863,21 +2865,21 @@ class vi extends Ot.EventEmitter {
2863
2865
  const u = this;
2864
2866
  this.iframe = new Promise((l) => {
2865
2867
  Xe().then(async () => {
2866
- var c, d, g, v;
2868
+ var c, p, m, _;
2867
2869
  if (u._iframe) {
2868
- if ((v = (g = (d = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : d.metaframes) == null ? void 0 : g[this.id]) != null && v.allow)
2870
+ if ((_ = (m = (p = (c = this._metapage) == null ? void 0 : c._definition) == null ? void 0 : p.metaframes) == null ? void 0 : m[this.id]) != null && _.allow)
2869
2871
  u._iframe.allow = this._metapage._definition.metaframes[this.id].allow, this._debug && this.log(`mf allow=${u._iframe.allow} from this._metapage?._definition`);
2870
2872
  else {
2871
- let m = Rt(this.url, "definition");
2872
- if (m = m && (m != null && m.version) ? await pt(m) : void 0, !u._iframe)
2873
+ let y = Rt(this.url, "definition");
2874
+ if (y = y && (y != null && y.version) ? await pt(y) : void 0, !u._iframe)
2873
2875
  return;
2874
- if (m != null && m.allow)
2875
- u._iframe.allow = m.allow;
2876
+ if (y != null && y.allow)
2877
+ u._iframe.allow = y.allow;
2876
2878
  else {
2877
- let S = await u.getDefinition();
2878
- if (this._debug && this.log(`mf metaframeDef=${JSON.stringify(S)}`), S = S && (S != null && S.version) ? await pt(S) : void 0, this._debug && this.log(`mf metaframeDef=${JSON.stringify(S)}`), !u._iframe)
2879
+ let O = await u.getDefinition();
2880
+ if (this._debug && this.log(`mf metaframeDef=${JSON.stringify(O)}`), O = O && (O != null && O.version) ? await pt(O) : void 0, this._debug && this.log(`mf metaframeDef=${JSON.stringify(O)}`), !u._iframe)
2879
2881
  return;
2880
- S && S.allow && (u._iframe.allow = S.allow);
2882
+ O && O.allow && (u._iframe.allow = O.allow);
2881
2883
  }
2882
2884
  }
2883
2885
  this._debug && this.log(`mf allow=${u._iframe.allow} from ${this.url}`), u._iframe.src = this.url, l(u._iframe);
@@ -2901,12 +2903,12 @@ class vi extends Ot.EventEmitter {
2901
2903
  if (this._definition)
2902
2904
  return this._definition;
2903
2905
  try {
2904
- const s = await wi(this.url);
2906
+ const s = await vi(this.url);
2905
2907
  if (s)
2906
2908
  return this._definition = s, this._definition;
2907
2909
  } catch (s) {
2908
2910
  var e = this.getDefinitionUrl();
2909
- this.emit($.Warning, `Failed to fetch or convert: ${e}
2911
+ this.emit(I.Warning, `Failed to fetch or convert: ${e}
2910
2912
  Error: ${s != null && s.message ? s == null ? void 0 : s.message : s == null ? void 0 : s.toString()}`);
2911
2913
  }
2912
2914
  }
@@ -2918,11 +2920,11 @@ Error: ${s != null && s.message ? s == null ? void 0 : s.message : s == null ? v
2918
2920
  setInputs(e) {
2919
2921
  this.log({ m: "MetapageIFrameRpcClient", inputs: e });
2920
2922
  const s = e;
2921
- if (this.inputs = Je(this.inputs, e), this.inputs === s)
2923
+ if (this.inputs = Ge(this.inputs, e), this.inputs === s)
2922
2924
  return this;
2923
- if (this._loaded || (this._sendInputsAfterRegistration = !0), this._iframe.parentNode && this._loaded && this.sendInputs(e), this.emit($.Inputs, this.inputs), this._metapage.listenerCount($.Inputs) > 0) {
2925
+ if (this._loaded || (this._sendInputsAfterRegistration = !0), this._iframe.parentNode && this._loaded && this.sendInputs(e), this.emit(I.Inputs, this.inputs), this._metapage.listenerCount(I.Inputs) > 0) {
2924
2926
  var n = {};
2925
- n[this.id] = e, this._metapage.emit($.Inputs, n);
2927
+ n[this.id] = e, this._metapage.emit(I.Inputs, n);
2926
2928
  }
2927
2929
  return this;
2928
2930
  }
@@ -2933,30 +2935,30 @@ Error: ${s != null && s.message ? s == null ? void 0 : s.message : s == null ? v
2933
2935
  }
2934
2936
  setOutputs(e) {
2935
2937
  const s = e;
2936
- if (this.outputs = Je(this.outputs, e), this.outputs === s)
2938
+ if (this.outputs = Ge(this.outputs, e), this.outputs === s)
2937
2939
  return this;
2938
- if (this.emit($.Outputs, e), this._metapage.listenerCount($.Outputs) > 0) {
2940
+ if (this.emit(I.Outputs, e), this._metapage.listenerCount(I.Outputs) > 0) {
2939
2941
  var n = {};
2940
- n[this.id] = this.outputs, this._metapage.emit($.Outputs, n);
2942
+ n[this.id] = this.outputs, this._metapage.emit(I.Outputs, n);
2941
2943
  }
2942
2944
  }
2943
2945
  onInputs(e) {
2944
- return this.addListenerReturnDisposer($.Inputs, e);
2946
+ return this.addListenerReturnDisposer(I.Inputs, e);
2945
2947
  }
2946
2948
  onInput(e, s) {
2947
2949
  var n = function(i) {
2948
2950
  i.hasOwnProperty(e) && s(i[e]);
2949
2951
  };
2950
- return this.addListenerReturnDisposer($.Inputs, n);
2952
+ return this.addListenerReturnDisposer(I.Inputs, n);
2951
2953
  }
2952
2954
  onOutputs(e) {
2953
- return this.addListenerReturnDisposer($.Outputs, e);
2955
+ return this.addListenerReturnDisposer(I.Outputs, e);
2954
2956
  }
2955
2957
  onOutput(e, s) {
2956
2958
  var n = function(i) {
2957
2959
  i.hasOwnProperty(e) && s(i[e]);
2958
2960
  };
2959
- return this.addListenerReturnDisposer($.Outputs, n);
2961
+ return this.addListenerReturnDisposer(I.Outputs, n);
2960
2962
  }
2961
2963
  isDisposed() {
2962
2964
  return this.inputs === void 0;
@@ -3047,12 +3049,12 @@ Error: ${s != null && s.message ? s == null ? void 0 : s.message : s == null ? v
3047
3049
  }
3048
3050
  }
3049
3051
  }
3050
- const ge = C({
3052
+ const ge = M({
3051
3053
  metaframes: {
3052
3054
  inputs: {},
3053
3055
  outputs: {}
3054
3056
  }
3055
- }, (t) => t), Gi = (t) => he(t), Oi = (t, e) => !!(!e || e === "**" || t === e || _i.isMatch(t, e)), Ri = "bcbcbc";
3057
+ }, (t) => t), Vi = (t) => he(t), Oi = (t, e) => !!(!e || e === "**" || t === e || _i.isMatch(t, e)), Ri = "bcbcbc";
3056
3058
  class ee extends Hn {
3057
3059
  static async from(e, s) {
3058
3060
  if (e == null)
@@ -3067,7 +3069,7 @@ class ee extends Hn {
3067
3069
  return n.setDefinition(e);
3068
3070
  }
3069
3071
  constructor(e) {
3070
- super(), this._state = ge, this._metaframes = C({}, (s) => s), this.debug = ht(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = C({}, (s) => s), this._inputMap = {}, this._id = e && e.id ? e.id : jn(), this._consoleBackgroundColor = e && e.color ? e.color : Ri, 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.onMessageJsonRpc = this.onMessageJsonRpc.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.setOutputs = this.setOutputs.bind(this), this.onInputs = this.onInputs.bind(this), this.onOutputs = this.onOutputs.bind(this), this.onState = this.onState.bind(this), this.setMetaframeOutputs = this.setMetaframeOutputs.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), Xe().then(() => {
3072
+ super(), this._state = ge, this._metaframes = M({}, (s) => s), this.debug = ht(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = M({}, (s) => s), this._inputMap = {}, this._id = e && e.id ? e.id : jn(), this._consoleBackgroundColor = e && e.color ? e.color : Ri, 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.onMessageJsonRpc = this.onMessageJsonRpc.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.setOutputs = this.setOutputs.bind(this), this.onInputs = this.onInputs.bind(this), this.onOutputs = this.onOutputs.bind(this), this.onState = this.onState.bind(this), this.setMetaframeOutputs = this.setMetaframeOutputs.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), Xe().then(() => {
3071
3073
  this.isDisposed() || (window.addEventListener("message", this.onMessage), this.log("Initialized"));
3072
3074
  });
3073
3075
  }
@@ -3080,13 +3082,13 @@ class ee extends Hn {
3080
3082
  };
3081
3083
  }
3082
3084
  onInputs(e) {
3083
- return this.addListenerReturnDisposer($.Inputs, e);
3085
+ return this.addListenerReturnDisposer(I.Inputs, e);
3084
3086
  }
3085
3087
  onOutputs(e) {
3086
- return this.addListenerReturnDisposer($.Outputs, e);
3088
+ return this.addListenerReturnDisposer(I.Outputs, e);
3087
3089
  }
3088
3090
  onState(e) {
3089
- return this.addListenerReturnDisposer($.State, e);
3091
+ return this.addListenerReturnDisposer(I.State, e);
3090
3092
  }
3091
3093
  setDebugFromUrlParams() {
3092
3094
  const e = new URL(window.location.href);
@@ -3096,10 +3098,10 @@ class ee extends Hn {
3096
3098
  return this._state;
3097
3099
  }
3098
3100
  setState(e) {
3099
- this._state = C(e, (s) => s), this.getMetaframeIds().forEach((s) => {
3101
+ this._state = M(e, (s) => s), this.getMetaframeIds().forEach((s) => {
3100
3102
  var n, i;
3101
3103
  (n = this.getMetaframe(s)) == null || n.setInputs(this._state.metaframes.inputs[s]), (i = this.getMetaframe(s)) == null || i.setOutputs(this._state.metaframes.outputs[s]);
3102
- }), this.listenerCount($.State) > 0 && ge !== this._state && this.emit($.State, this._state);
3104
+ }), this.listenerCount(I.State) > 0 && ge !== this._state && this.emit(I.State, this._state);
3103
3105
  }
3104
3106
  getStateMetaframes() {
3105
3107
  return this._state.metaframes;
@@ -3123,50 +3125,50 @@ class ee extends Hn {
3123
3125
  const i = this._definition;
3124
3126
  return this._definition = n, Object.keys(this._metaframes).forEach((o) => {
3125
3127
  (!n.metaframes || !n.metaframes[o]) && this.removeMetaframe(o);
3126
- }), s && (this._state = C(s, (o) => o)), n.metaframes && Object.keys(n.metaframes).forEach((o) => {
3128
+ }), s && (this._state = M(s, (o) => o)), n.metaframes && Object.keys(n.metaframes).forEach((o) => {
3127
3129
  if (!this._metaframes.hasOwnProperty(o)) {
3128
3130
  const r = n.metaframes[o];
3129
3131
  this.addMetaframe(o, r);
3130
3132
  }
3131
3133
  }), i !== ps && window.setTimeout(() => {
3132
- !this.isDisposed() && n === this._definition && (this._emitDefinitionEvent(), s && this.listenerCount($.State) > 0 && ge !== this._state && this.emit($.State, this._state));
3134
+ !this.isDisposed() && n === this._definition && (this._emitDefinitionEvent(), s && this.listenerCount(I.State) > 0 && ge !== this._state && this.emit(I.State, this._state));
3133
3135
  }, 0), this;
3134
3136
  }
3135
3137
  setMetadata(e) {
3136
- this._definition = C(this._definition, (s) => {
3138
+ this._definition = M(this._definition, (s) => {
3137
3139
  s.meta = e;
3138
3140
  }), this._emitDefinitionEvent();
3139
3141
  }
3140
3142
  _emitDefinitionEvent() {
3141
- if (this.listenerCount($.Definition) > 0) {
3143
+ if (this.listenerCount(I.Definition) > 0) {
3142
3144
  const e = {
3143
3145
  definition: this._definition,
3144
3146
  metaframes: this._metaframes
3145
3147
  };
3146
- this.emit($.Definition, e);
3148
+ this.emit(I.Definition, e);
3147
3149
  }
3148
3150
  }
3149
3151
  addPipe(e, s) {
3150
- this._inputMap = C(this._inputMap, (n) => {
3152
+ this._inputMap = M(this._inputMap, (n) => {
3151
3153
  n[e] || (n[e] = []), n[e].push(s);
3152
3154
  });
3153
3155
  }
3154
3156
  removeMetaframe(e) {
3155
- this._metaframes[e] && (this._metaframes[e].dispose(), this._metaframes = C(this._metaframes, (s) => {
3157
+ this._metaframes[e] && (this._metaframes[e].dispose(), this._metaframes = M(this._metaframes, (s) => {
3156
3158
  delete s[e];
3157
- }), this._state = C(this._state, (s) => {
3159
+ }), this._state = M(this._state, (s) => {
3158
3160
  delete s.metaframes.inputs[e], delete s.metaframes.outputs[e];
3159
- }), this._inputMap = C(this._inputMap, (s) => {
3161
+ }), this._inputMap = M(this._inputMap, (s) => {
3160
3162
  delete s[e], Object.keys(s).forEach((n) => {
3161
3163
  const i = s[n];
3162
3164
  let o = 0;
3163
3165
  for (; o <= i.length; )
3164
3166
  i[o] && i[o].metaframe === e ? i.splice(o, 1) : o++;
3165
3167
  });
3166
- }), this._cachedInputLookupMap = C({}, (s) => s));
3168
+ }), this._cachedInputLookupMap = M({}, (s) => s));
3167
3169
  }
3168
3170
  removeAll() {
3169
- Object.keys(this._metaframes).forEach((e) => this._metaframes[e].dispose()), this._metaframes = C({}, (e) => e), this._state = ge, this._inputMap = C({}, (e) => e), this._cachedInputLookupMap = C({}, (e) => e);
3171
+ Object.keys(this._metaframes).forEach((e) => this._metaframes[e].dispose()), this._metaframes = M({}, (e) => e), this._state = ge, this._inputMap = M({}, (e) => e), this._cachedInputLookupMap = M({}, (e) => e);
3170
3172
  }
3171
3173
  metaframes() {
3172
3174
  return this.getMetaframes();
@@ -3193,11 +3195,11 @@ class ee extends Hn {
3193
3195
  throw this.emitErrorMessage(`Existing metaframe for id=${e}`), `Existing metaframe for id=${e}`;
3194
3196
  if (!s.url)
3195
3197
  throw this.emitErrorMessage(`Metaframe definition missing url id=${e}`), `Metaframe definition missing url id=${e}`;
3196
- var n = new vi(this, s.url, e, this._id, this._consoleBackgroundColor, this.debug).setMetapage(this);
3197
- return this._metaframes = C(this._metaframes, (i) => {
3198
+ var n = new wi(this, s.url, e, this._id, this._consoleBackgroundColor, this.debug).setMetapage(this);
3199
+ return this._metaframes = M(this._metaframes, (i) => {
3198
3200
  i[e] = n;
3199
- }), n.addListener($.Error, (i) => {
3200
- this.emit($.Error, {
3201
+ }), n.addListener(I.Error, (i) => {
3202
+ this.emit(I.Error, {
3201
3203
  metaframeId: n.id,
3202
3204
  metaframeUrl: n.url,
3203
3205
  error: i
@@ -3214,12 +3216,12 @@ class ee extends Hn {
3214
3216
  this.logInternal(e, "f00", this._consoleBackgroundColor), this.emitErrorMessage(`${e}`);
3215
3217
  }
3216
3218
  emitErrorMessage(e) {
3217
- this.emit($.Error, e);
3219
+ this.emit(I.Error, e);
3218
3220
  }
3219
3221
  getInputsFromOutput(e, s) {
3220
- return this._cachedInputLookupMap[e] || (this._cachedInputLookupMap = C(this._cachedInputLookupMap, (n) => {
3221
- n[e] = C({}, (i) => i);
3222
- })), this._cachedInputLookupMap[e][s] || (this._cachedInputLookupMap = C(this._cachedInputLookupMap, (n) => {
3222
+ return this._cachedInputLookupMap[e] || (this._cachedInputLookupMap = M(this._cachedInputLookupMap, (n) => {
3223
+ n[e] = M({}, (i) => i);
3224
+ })), this._cachedInputLookupMap[e][s] || (this._cachedInputLookupMap = M(this._cachedInputLookupMap, (n) => {
3223
3225
  var i = [];
3224
3226
  n[e][s] = i, Object.keys(this._inputMap).forEach((o) => {
3225
3227
  o !== e && this._inputMap[o].forEach((r) => {
@@ -3235,7 +3237,7 @@ class ee extends Hn {
3235
3237
  if (e.jsonrpc !== "2.0")
3236
3238
  return !1;
3237
3239
  switch (e.method) {
3238
- case X.SetupIframeClientRequest:
3240
+ case K.SetupIframeClientRequest:
3239
3241
  return !0;
3240
3242
  default:
3241
3243
  var n = e.iframeId;
@@ -3244,7 +3246,7 @@ class ee extends Hn {
3244
3246
  }
3245
3247
  setInput(e, s, n) {
3246
3248
  var i, o;
3247
- typeof e == "object" ? this.setInputStateOnlyMetapageInstanceInputs(e) : typeof s == "string" ? this.setInputStateOnlyMetaframeInputValue(e, s, n) : this.setInputStateOnlyMetaframeInputMap(e, s || {}), this.setMetaframeClientInputAndSentClientEvent(e, s, n), (this.listenerCount($.State) > 0 || this.listenerCount($.Inputs) > 0) && ge !== this._state && (this.emit($.State, this._state), this.emit($.Inputs, (o = (i = this._state) == null ? void 0 : i.metaframes) == null ? void 0 : o.inputs));
3249
+ typeof e == "object" ? this.setInputStateOnlyMetapageInstanceInputs(e) : typeof s == "string" ? this.setInputStateOnlyMetaframeInputValue(e, s, n) : this.setInputStateOnlyMetaframeInputMap(e, s || {}), this.setMetaframeClientInputAndSentClientEvent(e, s, n), (this.listenerCount(I.State) > 0 || this.listenerCount(I.Inputs) > 0) && ge !== this._state && (this.emit(I.State, this._state), this.emit(I.Inputs, (o = (i = this._state) == null ? void 0 : i.metaframes) == null ? void 0 : o.inputs));
3248
3250
  }
3249
3251
  setMetaframeClientInputAndSentClientEvent(e, s, n) {
3250
3252
  if (typeof e == "object") {
@@ -3291,7 +3293,7 @@ class ee extends Hn {
3291
3293
  this._setStateOnlyMetaframeInputMap(!0, e, s);
3292
3294
  }
3293
3295
  _setStateOnlyMetaframeInputValue(e, s, n, i) {
3294
- this._state = C(this._state, (o) => {
3296
+ this._state = M(this._state, (o) => {
3295
3297
  if (!this._metaframes.hasOwnProperty(s))
3296
3298
  throw `No metaframe: ${s}`;
3297
3299
  o.metaframes || (o.metaframes = { inputs: {}, outputs: {} }), e ? o.metaframes.inputs || (o.metaframes.inputs = {}) : o.metaframes.outputs || (o.metaframes.outputs = {});
@@ -3300,7 +3302,7 @@ class ee extends Hn {
3300
3302
  });
3301
3303
  }
3302
3304
  _setStateOnlyMetaframeInputMap(e, s, n) {
3303
- !n || Object.keys(n).length === 0 || (this._state = C(this._state, (i) => {
3305
+ !n || Object.keys(n).length === 0 || (this._state = M(this._state, (i) => {
3304
3306
  if (!this._metaframes.hasOwnProperty(s))
3305
3307
  throw `No metaframe: ${s}`;
3306
3308
  let r = e ? i.metaframes.inputs : i.metaframes.outputs;
@@ -3310,7 +3312,7 @@ class ee extends Hn {
3310
3312
  }));
3311
3313
  }
3312
3314
  _setStateOnlyMetaframes(e, s) {
3313
- !s || Object.keys(s).length === 0 || (this._state = C(this._state, (n) => {
3315
+ !s || Object.keys(s).length === 0 || (this._state = M(this._state, (n) => {
3314
3316
  Object.keys(s).forEach((i) => {
3315
3317
  var o = s[i];
3316
3318
  if (typeof o != "object")
@@ -3329,7 +3331,7 @@ class ee extends Hn {
3329
3331
  iframeId: e,
3330
3332
  parentId: this._id,
3331
3333
  jsonrpc: "2.0",
3332
- method: X.OutputsUpdate,
3334
+ method: K.OutputsUpdate,
3333
3335
  id: "_",
3334
3336
  params: s
3335
3337
  });
@@ -3355,16 +3357,16 @@ class ee extends Hn {
3355
3357
  const i = this.getMetaframe(n);
3356
3358
  if (i) {
3357
3359
  switch (e._messageCount = ++this._internalReceivedMessageCounter, this.debug && this.log(`processing ${JSON.stringify(e, null, " ").substring(0, 500)}`), s) {
3358
- case X.SetupIframeClientRequest:
3360
+ case K.SetupIframeClientRequest:
3359
3361
  i.register();
3360
3362
  break;
3361
- case X.SetupIframeServerResponseAck:
3363
+ case K.SetupIframeServerResponseAck:
3362
3364
  if (i) {
3363
3365
  const l = e.params;
3364
3366
  i.registered(l.version);
3365
3367
  }
3366
3368
  break;
3367
- case X.OutputsUpdate:
3369
+ case K.OutputsUpdate:
3368
3370
  const u = e.params;
3369
3371
  if (!u || Object.keys(u).length === 0)
3370
3372
  break;
@@ -3373,36 +3375,36 @@ class ee extends Hn {
3373
3375
  this.setOutputStateOnlyMetaframeInputMap(n, u), o.setOutputs(u);
3374
3376
  var r = !1;
3375
3377
  const l = Object.keys(u), c = {};
3376
- l.forEach((d, g) => {
3377
- const v = this.getInputsFromOutput(n, d);
3378
- v.length > 0 && v.forEach((m) => {
3379
- c[m.metaframe] || (c[m.metaframe] = {}), c[m.metaframe][m.pipe] = u[d], r = !0;
3378
+ l.forEach((p, m) => {
3379
+ const _ = this.getInputsFromOutput(n, p);
3380
+ _.length > 0 && _.forEach((y) => {
3381
+ c[y.metaframe] || (c[y.metaframe] = {}), c[y.metaframe][y.pipe] = u[p], r = !0;
3380
3382
  });
3381
- }), r && (this.setInputStateOnlyMetapageInstanceInputs(c), Object.keys(c).forEach((d) => {
3382
- this._metaframes[d].setInputs(c[d]);
3383
- })), this.listenerCount($.State) > 0 && ge !== this._state && this.emit($.State, this._state), this.debug && o.ack({ jsonrpc: e, state: this._state });
3383
+ }), r && (this.setInputStateOnlyMetapageInstanceInputs(c), Object.keys(c).forEach((p) => {
3384
+ this._metaframes[p].setInputs(c[p]);
3385
+ })), this.listenerCount(I.State) > 0 && ge !== this._state && this.emit(I.State, this._state), this.debug && o.ack({ jsonrpc: e, state: this._state });
3384
3386
  } else
3385
3387
  this.error(`missing metaframe=${n}`);
3386
3388
  break;
3387
- case X.InputsUpdate:
3389
+ case K.InputsUpdate:
3388
3390
  var a = e.params;
3389
- this.debug && this.log(`inputs ${JSON.stringify(a)} from ${n}`), this._metaframes[n] ? (this.setInputStateOnlyMetaframeInputMap(n, a), this._metaframes[n].setInputs(a), this.listenerCount($.State) > 0 && ge !== this._state && this.emit($.State, this._state), this.debug && this._metaframes[n].ack({
3391
+ this.debug && this.log(`inputs ${JSON.stringify(a)} from ${n}`), this._metaframes[n] ? (this.setInputStateOnlyMetaframeInputMap(n, a), this._metaframes[n].setInputs(a), this.listenerCount(I.State) > 0 && ge !== this._state && this.emit(I.State, this._state), this.debug && this._metaframes[n].ack({
3390
3392
  jsonrpc: e,
3391
3393
  state: this._state
3392
3394
  })) : (console.error(`InputsUpdate failed no metaframe id: "${n}"`), this.error(`InputsUpdate failed no metaframe id: "${n}"`));
3393
3395
  break;
3394
- case X.HashParamsUpdate:
3396
+ case K.HashParamsUpdate:
3395
3397
  if (i) {
3396
3398
  const l = e.params, c = new URL(i.url);
3397
- c.hash = l.hash, i.url = c.href, this._definition = C(this._definition, (d) => {
3398
- d.metaframes[l.metaframe].url = c.href;
3399
+ c.hash = l.hash, i.url = c.href, this._definition = M(this._definition, (p) => {
3400
+ p.metaframes[l.metaframe].url = c.href;
3399
3401
  }), this._emitDefinitionEvent();
3400
3402
  }
3401
3403
  break;
3402
3404
  default:
3403
3405
  this.debug && this.log(`Unknown RPC method: "${s}"`);
3404
3406
  }
3405
- this.listenerCount($.Message) > 0 && this.emit($.Message, e);
3407
+ this.listenerCount(I.Message) > 0 && this.emit(I.Message, e);
3406
3408
  }
3407
3409
  }
3408
3410
  logInternal(e, s, n) {
@@ -3412,12 +3414,12 @@ class ee extends Hn {
3412
3414
  }
3413
3415
  }
3414
3416
  ee.version = Wt;
3415
- ee.DEFINITION = $.Definition;
3416
- ee.ERROR = $.Error;
3417
- ee.INPUTS = $.Inputs;
3418
- ee.MESSAGE = $.Message;
3419
- ee.OUTPUTS = $.Outputs;
3420
- ee.STATE = $.State;
3417
+ ee.DEFINITION = I.Definition;
3418
+ ee.ERROR = I.Error;
3419
+ ee.INPUTS = I.Inputs;
3420
+ ee.MESSAGE = I.Message;
3421
+ ee.OUTPUTS = I.Outputs;
3422
+ ee.STATE = I.State;
3421
3423
  ee.deserializeInputs = Ce;
3422
3424
  ee.serializeInputs = Ke;
3423
3425
  function It(t) {
@@ -3456,8 +3458,34 @@ function Si(t) {
3456
3458
  }
3457
3459
  return e;
3458
3460
  }
3459
- async function Vi(t) {
3460
- var O, k, R, L, U;
3461
+ const Ai = (t) => {
3462
+ var l, c, p;
3463
+ const e = (c = (l = t == null ? void 0 : t.meta) == null ? void 0 : l.layouts) == null ? void 0 : c["react-grid-layout"], s = e == null ? void 0 : e.layout;
3464
+ if (!e || !s)
3465
+ throw new Error("No valid layout found in metapage definition");
3466
+ const n = /* @__PURE__ */ new Set(), i = s.map((m, _) => {
3467
+ const y = t.metaframes[m.i];
3468
+ return y && It(y.url) ? { index: _, y: m.y, id: m.i } : null;
3469
+ }).filter((m) => m !== null);
3470
+ if (i.length > 0) {
3471
+ const m = i.reduce((y, O) => O.y < y.y ? O : y), _ = ((p = s.find((y) => y.i === m.id)) == null ? void 0 : p.y) ?? 0;
3472
+ s.forEach((y) => {
3473
+ y.y >= _ && n.add(y.i);
3474
+ });
3475
+ }
3476
+ const o = Object.keys(t.metaframes).filter((m) => !n.has(m)), r = Object.keys(t.metaframes).filter((m) => n.has(m));
3477
+ let a = s.filter((m) => o.includes(m.i));
3478
+ a.sort((m, _) => m.y !== _.y ? m.y - _.y : m.x - _.x);
3479
+ const u = a.reduce((m, _) => Math.max(m, _.y + _.h), 0);
3480
+ return {
3481
+ visibleLayoutItems: a,
3482
+ hiddenMetaframeIds: new Set(r),
3483
+ visibleMetaframeIds: new Set(o),
3484
+ totalVisibleGridHeight: u
3485
+ };
3486
+ };
3487
+ async function Wi(t) {
3488
+ var C, S, k, E;
3461
3489
  let { url: e, definition: s, onOutputs: n, rootDiv: i, options: o = {} } = t;
3462
3490
  if (!e && !s)
3463
3491
  throw new Error("Either url or definition must be provided");
@@ -3465,80 +3493,69 @@ async function Vi(t) {
3465
3493
  throw new Error("Either url or definition must be provided, not both");
3466
3494
  if (e && (s = await bi(e)), !s)
3467
3495
  throw new Error("Failed to fetch metapage definition");
3468
- s = Si(s), s = await Ei(s), await Xe();
3496
+ s = Si(s), s = await Mi(s), await Xe();
3469
3497
  const r = new ee();
3470
3498
  r.debug = o.debug || !1;
3471
3499
  try {
3472
3500
  await r.setDefinition(JSON.parse(JSON.stringify(s)));
3473
- } catch (f) {
3474
- throw r.dispose(), new Error(`Failed to set metapage definition: ${f}`);
3501
+ } catch (v) {
3502
+ throw r.dispose(), new Error(`Failed to set metapage definition: ${v}`);
3475
3503
  }
3476
3504
  const a = [];
3477
- n && a.push(r.addListenerReturnDisposer($.Outputs, n));
3478
- const u = (k = (O = s == null ? void 0 : s.meta) == null ? void 0 : O.layouts) == null ? void 0 : k["react-grid-layout"], l = u == null ? void 0 : u.layout;
3505
+ n && a.push(r.addListenerReturnDisposer(I.Outputs, n));
3506
+ const u = (S = (C = s == null ? void 0 : s.meta) == null ? void 0 : C.layouts) == null ? void 0 : S["react-grid-layout"], l = u == null ? void 0 : u.layout;
3479
3507
  if (!u || !l)
3480
3508
  throw new Error("No valid layout found in metapage definition");
3481
- const c = /* @__PURE__ */ new Set(), d = l.map((f, M) => {
3482
- const I = r.getMetaframes()[f.i];
3483
- return I && It(I.url) ? { index: M, y: f.y, id: f.i } : null;
3484
- }).filter((f) => f !== null);
3485
- if (d.length > 0) {
3486
- const f = d.reduce((I, B) => B.y < I.y ? B : I), M = ((R = l.find((I) => I.i === f.id)) == null ? void 0 : R.y) ?? 0;
3487
- l.forEach((I) => {
3488
- I.y >= M && c.add(I.i);
3489
- });
3490
- }
3491
- const g = r.getMetaframeIds().filter((f) => !c.has(f));
3492
- let v = l.filter((f) => g.includes(f.i));
3493
- if (v.length === 0)
3509
+ let { visibleLayoutItems: c, hiddenMetaframeIds: p, visibleMetaframeIds: m } = Ai(r.getDefinition());
3510
+ if (c.length === 0)
3494
3511
  return {
3495
3512
  metapage: r,
3496
- setInputs: (f) => {
3497
- r.isDisposed() || r.setInputs(f);
3513
+ setInputs: (v) => {
3514
+ r.isDisposed() || r.setInputs(v);
3498
3515
  },
3499
- setOutputs: (f) => {
3500
- r.isDisposed() || r.setOutputs(f);
3516
+ setOutputs: (v) => {
3517
+ r.isDisposed() || r.setOutputs(v);
3501
3518
  },
3502
3519
  dispose: () => {
3503
- a.forEach((f) => f()), r.dispose();
3520
+ a.forEach((v) => v()), r.dispose();
3504
3521
  }
3505
3522
  };
3506
- v.sort((f, M) => f.y !== M.y ? f.y - M.y : f.x - M.x);
3507
- const m = {
3523
+ c.sort((v, x) => v.y !== x.y ? v.y - x.y : v.x - x.x);
3524
+ const _ = {
3508
3525
  display: "grid",
3509
3526
  gridTemplateColumns: "repeat(1, 1fr)",
3510
3527
  gridAutoRows: "1fr",
3511
- gap: `${((L = u.props.margin) == null ? void 0 : L[0]) || 10}px`,
3528
+ gap: `${((k = u.props.margin) == null ? void 0 : k[0]) || 10}px`,
3512
3529
  width: "100%",
3513
3530
  height: "100%",
3514
3531
  maxHeight: "100%",
3515
- padding: ((U = u.props.containerPadding) == null ? void 0 : U[0]) || 0,
3532
+ padding: ((E = u.props.containerPadding) == null ? void 0 : E[0]) || 0,
3516
3533
  minHeight: 0,
3517
3534
  alignContent: "start",
3518
3535
  alignItems: "start",
3519
3536
  overflow: "hidden"
3520
- }, S = {
3537
+ }, y = {
3521
3538
  width: "100%",
3522
3539
  height: "100%",
3523
3540
  overflow: "hidden",
3524
3541
  display: "flex",
3525
3542
  flexDirection: "column"
3526
- }, b = document.createElement("div");
3527
- Object.assign(b.style, S);
3528
- const x = document.createElement("div");
3529
- Object.assign(x.style, m);
3530
- const w = [];
3531
- for (const f of g) {
3532
- const M = l.find((W) => W.i === f);
3533
- if (!M)
3543
+ }, O = document.createElement("div");
3544
+ Object.assign(O.style, y);
3545
+ const R = document.createElement("div");
3546
+ Object.assign(R.style, _);
3547
+ const $ = [];
3548
+ for (const v of m) {
3549
+ const x = l.find((f) => f.i === v);
3550
+ if (!x)
3534
3551
  continue;
3535
- const I = r.getMetaframes()[f], B = await I.iframe;
3536
- if (!I)
3552
+ const d = r.getMetaframes()[v], T = await d.iframe;
3553
+ if (!d)
3537
3554
  continue;
3538
- w.push(M);
3539
- const h = {
3540
- gridColumn: `${M.x + 1} / span ${M.w}`,
3541
- gridRow: `${M.y + 1} / span ${M.h}`,
3555
+ $.push(x);
3556
+ const H = {
3557
+ gridColumn: `${x.x + 1} / span ${x.w}`,
3558
+ gridRow: `${x.y + 1} / span ${x.h}`,
3542
3559
  overflow: "hidden",
3543
3560
  width: "100%",
3544
3561
  height: "100%",
@@ -3546,66 +3563,66 @@ async function Vi(t) {
3546
3563
  position: "relative",
3547
3564
  alignSelf: "stretch",
3548
3565
  justifySelf: "stretch"
3549
- }, p = document.createElement("div");
3550
- Object.assign(p.style, h), p.appendChild(B), x.appendChild(p);
3551
- }
3552
- const A = Math.max(...w.map((f) => f.x + f.w));
3553
- Math.max(...w.map((f) => f.y + f.h)), x.style.gridTemplateColumns = `repeat(${Math.max(1, A)}, 1fr)`;
3554
- const E = document.createElement("div");
3555
- E.style.position = "absolute", E.style.top = "-9999px", E.style.left = "-9999px", E.style.width = "1px", E.style.height = "1px", E.style.overflow = "hidden", E.style.pointerEvents = "none";
3556
- for (const f of Object.keys(r.getMetaframes()).filter((M) => c.has(M))) {
3557
- const M = r.getMetaframes()[f];
3558
- if (!M)
3566
+ }, Z = document.createElement("div");
3567
+ Object.assign(Z.style, H), Z.appendChild(T), R.appendChild(Z);
3568
+ }
3569
+ const w = Math.max(...$.map((v) => v.x + v.w));
3570
+ Math.max(...$.map((v) => v.y + v.h)), R.style.gridTemplateColumns = `repeat(${Math.max(1, w)}, 1fr)`;
3571
+ const A = document.createElement("div");
3572
+ A.style.position = "absolute", A.style.top = "-9999px", A.style.left = "-9999px", A.style.width = "1px", A.style.height = "1px", A.style.overflow = "hidden", A.style.pointerEvents = "none";
3573
+ for (const v of Object.keys(r.getMetaframes()).filter((x) => p.has(x))) {
3574
+ const x = r.getMetaframes()[v];
3575
+ if (!x)
3559
3576
  continue;
3560
- const I = document.createElement("div");
3561
- I.setAttribute("data-metaframe-id", f), I.style.width = "100px", I.style.height = "100px";
3562
- let B;
3563
- M.iframe ? B = await M.iframe : (B = document.createElement("iframe"), B.src = M.url, B.style.border = "none", B.style.width = "100%", B.style.height = "100%"), I.appendChild(B), E.appendChild(I);
3577
+ const d = document.createElement("div");
3578
+ d.setAttribute("data-metaframe-id", v), d.style.width = "100px", d.style.height = "100px";
3579
+ let T;
3580
+ x.iframe ? T = await x.iframe : (T = document.createElement("iframe"), T.src = x.url, T.style.border = "none", T.style.width = "100%", T.style.height = "100%"), d.appendChild(T), A.appendChild(d);
3564
3581
  }
3565
- return b.appendChild(x), b.appendChild(E), i.appendChild(b), {
3582
+ return O.appendChild(R), O.appendChild(A), i.appendChild(O), {
3566
3583
  metapage: r,
3567
- setInputs: (f) => {
3568
- r.isDisposed() || r.setInputs(f);
3584
+ setInputs: (v) => {
3585
+ r.isDisposed() || r.setInputs(v);
3569
3586
  },
3570
- setOutputs: (f) => {
3571
- r.isDisposed() || r.setOutputs(f);
3587
+ setOutputs: (v) => {
3588
+ r.isDisposed() || r.setOutputs(v);
3572
3589
  },
3573
3590
  dispose: () => {
3574
- a.forEach((f) => f()), r.dispose(), b.parentNode && b.parentNode.removeChild(b);
3591
+ a.forEach((v) => v()), r.dispose(), O.parentNode && O.parentNode.removeChild(O);
3575
3592
  }
3576
3593
  };
3577
3594
  }
3578
- const Wi = (t, e) => {
3595
+ const Ki = (t, e) => {
3579
3596
  var r, a, u;
3580
3597
  const s = (a = (r = t == null ? void 0 : t.meta) == null ? void 0 : r.layouts) == null ? void 0 : a["react-grid-layout"], n = s == null ? void 0 : s.layout;
3581
3598
  if (!s || !n)
3582
3599
  throw new Error("No valid layout found in metapage definition");
3583
3600
  const i = /* @__PURE__ */ new Set(), o = n.map((l, c) => {
3584
- var g;
3585
- const d = (g = t == null ? void 0 : t.metaframes) == null ? void 0 : g[l.i];
3586
- return d && It(d.url) ? { index: c, y: l.y, id: l.i } : null;
3601
+ var m;
3602
+ const p = (m = t == null ? void 0 : t.metaframes) == null ? void 0 : m[l.i];
3603
+ return p && It(p.url) ? { index: c, y: l.y, id: l.i } : null;
3587
3604
  }).filter((l) => l !== null);
3588
3605
  if (o.length > 0) {
3589
- const l = o.reduce((d, g) => g.y < d.y ? g : d), c = ((u = n.find((d) => d.i === l.id)) == null ? void 0 : u.y) ?? 0;
3590
- n.forEach((d) => {
3591
- d.y >= c && i.add(d.i);
3606
+ const l = o.reduce((p, m) => m.y < p.y ? m : p), c = ((u = n.find((p) => p.i === l.id)) == null ? void 0 : u.y) ?? 0;
3607
+ n.forEach((p) => {
3608
+ p.y >= c && i.add(p.i);
3592
3609
  });
3593
3610
  }
3594
3611
  return i.has(e);
3595
- }, Ai = (t) => {
3612
+ }, Ei = (t) => {
3596
3613
  var s;
3597
3614
  if (!t)
3598
3615
  return;
3599
3616
  typeof t == "string" && (t.startsWith("/") && (t = "https://metapage.io" + t), t = new URL(t));
3600
3617
  let e = (s = /\/m?f\/([0-9a-zA-Z-]{3,})\/?(metaframe\.json)?.*$/g.exec(t.pathname)) == null ? void 0 : s[1];
3601
3618
  return e || (t.searchParams.get("mfk") ?? void 0);
3602
- }, Ei = async (t) => {
3619
+ }, Mi = async (t) => {
3603
3620
  if (!(t != null && t.metaframes))
3604
3621
  return t;
3605
3622
  for (const [e, s] of Object.entries(t.metaframes)) {
3606
3623
  if (!(s.url.startsWith("https://metapage.io/mf/") || s.url.startsWith("https://metapage.io/f/")))
3607
3624
  continue;
3608
- const n = Ai(s.url);
3625
+ const n = Ei(s.url);
3609
3626
  if (!n)
3610
3627
  continue;
3611
3628
  const i = await fetch(`https://metapage.io/f/${n}/definition.json`).then((o) => o.json());
@@ -3615,28 +3632,28 @@ const Wi = (t, e) => {
3615
3632
  };
3616
3633
  export {
3617
3634
  ps as INITIAL_NULL_METAPAGE_DEFINITION,
3618
- Ni as INTERNAL_ERROR,
3619
- Di as INVALID_PARAMS,
3620
- Pi as INVALID_REQUEST,
3621
- X as JsonRpcMethodsFromChild,
3635
+ ki as INTERNAL_ERROR,
3636
+ Ni as INVALID_PARAMS,
3637
+ Ti as INVALID_REQUEST,
3638
+ K as JsonRpcMethodsFromChild,
3622
3639
  me as JsonRpcMethodsFromParent,
3623
- Mi as METAFRAME_JSON_FILE,
3624
- Ii as METAPAGE_KEY_DEFINITION,
3625
- Ci as METAPAGE_KEY_STATE,
3626
- Ti as METHOD_NOT_FOUND,
3640
+ Ii as METAFRAME_JSON_FILE,
3641
+ Ci as METAPAGE_KEY_DEFINITION,
3642
+ $i as METAPAGE_KEY_STATE,
3643
+ Di as METHOD_NOT_FOUND,
3627
3644
  ie as Metaframe,
3628
- z as MetaframeEvents,
3645
+ F as MetaframeEvents,
3629
3646
  ae as MetaframeLoadingState,
3630
3647
  We as MetaframeVersionCurrent,
3631
3648
  Ct as MetaframeVersionsAll,
3632
3649
  ee as Metapage,
3633
- $ as MetapageEvents,
3650
+ I as MetapageEvents,
3634
3651
  xe as MetapageHashParams,
3635
- vi as MetapageIFrameRpcClient,
3652
+ wi as MetapageIFrameRpcClient,
3636
3653
  Hn as MetapageShared,
3637
3654
  Le as MetapageVersionCurrent,
3638
3655
  $t as MetapageVersionsAll,
3639
- Li as PARSE_ERROR,
3656
+ Pi as PARSE_ERROR,
3640
3657
  As as VERSION_METAFRAME,
3641
3658
  Wt as VERSION_METAPAGE,
3642
3659
  tn as convertMetaframeDefinitionToCurrentVersion,
@@ -3646,37 +3663,38 @@ export {
3646
3663
  ss as convertMetapageDefinitionToVersion,
3647
3664
  Ce as deserializeInputs,
3648
3665
  St as generateId,
3649
- Ui as generateMetaframeId,
3666
+ Bi as generateMetaframeId,
3650
3667
  jn as generateMetapageId,
3651
- Bi as generateNonce,
3652
- Gi as getLibraryVersionMatching,
3668
+ Fi as generateNonce,
3669
+ Vi as getLibraryVersionMatching,
3653
3670
  te as getMatchingMetaframeVersion,
3654
3671
  he as getMatchingMetapageVersion,
3655
- wi as getMetaframeDefinitionFromUrl,
3672
+ vi as getMetaframeDefinitionFromUrl,
3656
3673
  bi as getMetapageDefinitionFromUrl,
3657
- Hi as getUrlParam,
3658
- ji as getUrlParamDebug,
3674
+ ji as getUrlParam,
3675
+ Ui as getUrlParamDebug,
3676
+ Ai as getVisibleGridLayoutData,
3659
3677
  Un as hashCode,
3660
3678
  Bn as intToRGB,
3661
3679
  ht as isDebugFromUrlsParams,
3662
3680
  Ji as isEmptyMetaframeDefinition,
3663
3681
  kn as isIframe,
3664
- ki as isJsonRpcId,
3682
+ Hi as isJsonRpcId,
3665
3683
  It as isMetaframeDivider,
3666
- Wi as isMetaframeHidden,
3684
+ Ki as isMetaframeHidden,
3667
3685
  tt as isPageLoaded,
3668
3686
  At as log,
3669
3687
  Oi as matchPipe,
3670
- Je as merge,
3671
- Fi as metapageAllSha256Hash,
3672
- zi as metapageOnlyEssentailSha256Hash,
3688
+ Ge as merge,
3689
+ zi as metapageAllSha256Hash,
3690
+ Gi as metapageOnlyEssentailSha256Hash,
3673
3691
  Xe as pageLoaded,
3674
- xi as possiblyDeserializeDatarefToFile,
3692
+ Li as possiblyDeserializeDatarefToFile,
3675
3693
  is as possiblyDeserializeDatarefToValue,
3676
3694
  dn as possiblySerializeValueToDataref,
3677
- Vi as renderMetapage,
3695
+ Wi as renderMetapage,
3678
3696
  Ke as serializeInputs,
3679
3697
  hs as stringToRgb,
3680
- $i as valueToFile
3698
+ xi as valueToFile
3681
3699
  };
3682
3700
  //# sourceMappingURL=index.js.map