@metapages/metapage 1.2.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
- const Et = ["0.3", "0.4", "0.5", "0.6", "1"], Mt = ["0.2", "0.3", "1"], pt = "1", Je = "1", _i = "metaframe.json", gi = "metapage/definition", bi = "metapage/state", Vt = Mt[Mt.length - 1], An = Et[Et.length - 1], Sn = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, It = (e) => {
1
+ const Et = ["0.3", "0.4", "0.5", "0.6", "1"], Mt = ["0.2", "0.3", "1"], pt = "1", Je = "1", _i = "metaframe.json", gi = "metapage/definition", bi = "metapage/state", Gt = Mt[Mt.length - 1], On = Et[Et.length - 1], An = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, It = (e) => {
2
2
  if (typeof e != "string")
3
3
  throw new TypeError("Invalid argument expected string");
4
- const t = e.match(Sn);
4
+ const t = e.match(An);
5
5
  if (!t)
6
6
  throw new Error(`Invalid argument not valid semver ('${e}' received)`);
7
7
  return t.shift(), t;
8
8
  }, Ct = (e) => e === "*" || e === "x" || e === "X", $t = (e) => {
9
9
  const t = parseInt(e, 10);
10
10
  return isNaN(t) ? e : t;
11
- }, En = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], Mn = (e, t) => {
11
+ }, Sn = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], En = (e, t) => {
12
12
  if (Ct(e) || Ct(t))
13
13
  return 0;
14
- const [n, s] = En($t(e), $t(t));
14
+ const [n, s] = Sn($t(e), $t(t));
15
15
  return n > s ? 1 : n < s ? -1 : 0;
16
16
  }, xt = (e, t) => {
17
17
  for (let n = 0; n < Math.max(e.length, t.length); n++) {
18
- const s = Mn(e[n] || "0", t[n] || "0");
18
+ const s = En(e[n] || "0", t[n] || "0");
19
19
  if (s !== 0)
20
20
  return s;
21
21
  }
@@ -24,15 +24,15 @@ const Et = ["0.3", "0.4", "0.5", "0.6", "1"], Mt = ["0.2", "0.3", "1"], pt = "1"
24
24
  const n = It(e), s = It(t), i = n.pop(), o = s.pop(), r = xt(n, s);
25
25
  return r !== 0 ? r : i && o ? xt(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
26
26
  };
27
- var In = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
27
+ var Mn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
28
28
  function ht(e) {
29
29
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
30
30
  }
31
- var Jt = { exports: {} };
31
+ var Vt = { exports: {} };
32
32
  (function(e, t) {
33
33
  (function(n, s) {
34
34
  e.exports = s();
35
- })(In, function() {
35
+ })(Mn, function() {
36
36
  var n = function(o, r) {
37
37
  if (r = r || {}, typeof o != "function")
38
38
  throw new i("fetch must be a function");
@@ -115,13 +115,13 @@ var Jt = { exports: {} };
115
115
  }
116
116
  return n;
117
117
  });
118
- })(Jt);
119
- var Cn = Jt.exports;
120
- const dt = /* @__PURE__ */ ht(Cn), B = {
118
+ })(Vt);
119
+ var In = Vt.exports;
120
+ const dt = /* @__PURE__ */ ht(In), B = {
121
121
  Remove: "remove",
122
122
  Replace: "replace",
123
123
  Add: "add"
124
- }, Wt = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), $n = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Ue = Symbol.iterator, Y = {
124
+ }, Jt = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Cn = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), Ue = Symbol.iterator, Y = {
125
125
  mutable: "mutable",
126
126
  immutable: "immutable"
127
127
  }, mt = {};
@@ -147,7 +147,7 @@ function ge(e) {
147
147
  return !!$(e);
148
148
  }
149
149
  function $(e) {
150
- return typeof e != "object" ? null : e == null ? void 0 : e[Wt];
150
+ return typeof e != "object" ? null : e == null ? void 0 : e[Jt];
151
151
  }
152
152
  function yt(e) {
153
153
  var t;
@@ -160,7 +160,7 @@ function ee(e, t) {
160
160
  let n;
161
161
  return Object.getPrototypeOf(e) === Object.prototype || Array.isArray(e) || e instanceof Map || e instanceof Set || !!(t != null && t.mark) && ((n = t.mark(e, Y)) === Y.immutable || typeof n == "function");
162
162
  }
163
- function Kt(e, t = []) {
163
+ function Wt(e, t = []) {
164
164
  if (Object.hasOwnProperty.call(e, "key")) {
165
165
  const n = e.parent.copy, s = $(pe(n, e.key));
166
166
  if (s !== null && (s == null ? void 0 : s.original) !== e.original)
@@ -171,10 +171,10 @@ function Kt(e, t = []) {
171
171
  t.push(o);
172
172
  }
173
173
  if (e.parent)
174
- return Kt(e.parent, t);
174
+ return Wt(e.parent, t);
175
175
  t.reverse();
176
176
  try {
177
- xn(e.copy, t);
177
+ $n(e.copy, t);
178
178
  } catch {
179
179
  return null;
180
180
  }
@@ -207,7 +207,7 @@ function _e(e, t) {
207
207
  return s.indexOf("/") === -1 && s.indexOf("~") === -1 ? s : s.replace(/~/g, "~0").replace(/\//g, "~1");
208
208
  }).join("/");
209
209
  }
210
- function xn(e, t) {
210
+ function $n(e, t) {
211
211
  for (let n = 0; n < t.length - 1; n += 1) {
212
212
  const s = t[n];
213
213
  if (e = pe(be(e) === 3 ? Array.from(e) : e, s), typeof e != "object")
@@ -215,7 +215,7 @@ function xn(e, t) {
215
215
  }
216
216
  return e;
217
217
  }
218
- function Ln(e) {
218
+ function xn(e) {
219
219
  const t = Object.create(Object.getPrototypeOf(e));
220
220
  return Reflect.ownKeys(e).forEach((n) => {
221
221
  let s = Reflect.getOwnPropertyDescriptor(e, n);
@@ -231,8 +231,8 @@ function Ln(e) {
231
231
  }), Reflect.defineProperty(t, n, s);
232
232
  }), t;
233
233
  }
234
- const Pn = Object.prototype.propertyIsEnumerable;
235
- function Xt(e, t) {
234
+ const Ln = Object.prototype.propertyIsEnumerable;
235
+ function Kt(e, t) {
236
236
  let n;
237
237
  if (Array.isArray(e))
238
238
  return Array.prototype.concat.call(e);
@@ -242,7 +242,7 @@ function Xt(e, t) {
242
242
  return new Map(e);
243
243
  if (t != null && t.mark && (n = t.mark(e, Y), n !== void 0) && n !== Y.mutable) {
244
244
  if (n === Y.immutable)
245
- return Ln(e);
245
+ return xn(e);
246
246
  if (typeof n == "function") {
247
247
  if (t.enablePatches || t.enableAutoFreeze)
248
248
  throw new Error("You can't use mark and patches or auto freeze together.");
@@ -254,13 +254,13 @@ function Xt(e, t) {
254
254
  return Object.keys(e).forEach((i) => {
255
255
  s[i] = e[i];
256
256
  }), Object.getOwnPropertySymbols(e).forEach((i) => {
257
- Pn.call(e, i) && (s[i] = e[i]);
257
+ Ln.call(e, i) && (s[i] = e[i]);
258
258
  }), s;
259
259
  } else
260
260
  throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
261
261
  }
262
262
  function K(e) {
263
- e.copy || (e.copy = Xt(e.original, e.options));
263
+ e.copy || (e.copy = Kt(e.original, e.options));
264
264
  }
265
265
  function Se(e) {
266
266
  if (!ee(e))
@@ -345,7 +345,7 @@ function _t(e, t) {
345
345
  } else
346
346
  e.forEach((s, i) => t(i, s, e));
347
347
  }
348
- function qt(e, t, n) {
348
+ function Xt(e, t, n) {
349
349
  if (ge(e) || !ee(e, n) || t.has(e) || Object.isFrozen(e))
350
350
  return;
351
351
  const s = e instanceof Set, i = s ? /* @__PURE__ */ new Map() : void 0;
@@ -357,7 +357,7 @@ function qt(e, t, n) {
357
357
  const f = !((a = u.assignedMap) === null || a === void 0) && a.size || u.operated ? u.copy : u.original;
358
358
  Le(s ? i : e, o, f);
359
359
  } else
360
- qt(r, t, n);
360
+ Xt(r, t, n);
361
361
  }), i) {
362
362
  const o = e, r = Array.from(o);
363
363
  o.clear(), r.forEach((a) => {
@@ -365,9 +365,9 @@ function qt(e, t, n) {
365
365
  });
366
366
  }
367
367
  }
368
- function Tn(e, t) {
368
+ function Pn(e, t) {
369
369
  const n = e.type === 3 ? e.setMap : e.copy;
370
- e.finalities.revoke.length > 1 && e.assignedMap.get(t) && n && qt(pe(n, t), e.finalities.handledSet, e.options);
370
+ e.finalities.revoke.length > 1 && e.assignedMap.get(t) && n && Xt(pe(n, t), e.finalities.handledSet, e.options);
371
371
  }
372
372
  function rt(e) {
373
373
  e.type === 3 && e.copy && (e.copy.clear(), e.setMap.forEach((t) => {
@@ -377,7 +377,7 @@ function rt(e) {
377
377
  function ot(e, t, n, s) {
378
378
  if (e.operated && e.assignedMap && e.assignedMap.size > 0 && !e.finalized) {
379
379
  if (n && s) {
380
- const o = Kt(e);
380
+ const o = Wt(e);
381
381
  o && t(e, o, n, s);
382
382
  }
383
383
  e.finalized = !0;
@@ -394,10 +394,10 @@ function gt(e, t, n, s) {
394
394
  }
395
395
  }), e.options.enableAutoFreeze && i.finalities !== e.finalities && (e.options.enableAutoFreeze = !1)), ee(n, e.options) && e.finalities.draft.push(() => {
396
396
  const o = e.type === 3 ? e.setMap : e.copy;
397
- le(pe(o, t), n) && Tn(e, t);
397
+ le(pe(o, t), n) && Pn(e, t);
398
398
  });
399
399
  }
400
- function Dn(e, t, n, s, i) {
400
+ function Tn(e, t, n, s, i) {
401
401
  let { original: o, assignedMap: r, options: a } = e, u = e.copy;
402
402
  u.length < o.length && ([o, u] = [u, o], [n, s] = [s, n]);
403
403
  for (let f = 0; f < o.length; f += 1)
@@ -443,7 +443,7 @@ function Dn(e, t, n, s, i) {
443
443
  }
444
444
  }
445
445
  }
446
- function Hn({ original: e, copy: t, assignedMap: n }, s, i, o, r) {
446
+ function Dn({ original: e, copy: t, assignedMap: n }, s, i, o, r) {
447
447
  n.forEach((a, u) => {
448
448
  const f = pe(e, u), c = Be(pe(t, u)), d = a ? Ie(e, u) ? B.Replace : B.Add : B.Remove;
449
449
  if (le(f, c) && d === B.Replace)
@@ -452,7 +452,7 @@ function Hn({ original: e, copy: t, assignedMap: n }, s, i, o, r) {
452
452
  i.push(d === B.Remove ? { op: d, path: w } : { op: d, path: w, value: c }), o.push(d === B.Add ? { op: B.Remove, path: w } : d === B.Remove ? { op: B.Add, path: w, value: f } : { op: B.Replace, path: w, value: f });
453
453
  });
454
454
  }
455
- function kn({ original: e, copy: t }, n, s, i, o) {
455
+ function Hn({ original: e, copy: t }, n, s, i, o) {
456
456
  let r = 0;
457
457
  e.forEach((a) => {
458
458
  if (!t.has(a)) {
@@ -489,16 +489,16 @@ function $e(e, t, n, s) {
489
489
  switch (e.type) {
490
490
  case 0:
491
491
  case 2:
492
- return Hn(e, t, n, s, i);
493
- case 1:
494
492
  return Dn(e, t, n, s, i);
493
+ case 1:
494
+ return Tn(e, t, n, s, i);
495
495
  case 3:
496
- return kn(e, t, n, s, i);
496
+ return Hn(e, t, n, s, i);
497
497
  }
498
498
  }
499
- let Nn = !1;
499
+ let kn = !1;
500
500
  const Fe = (e, t, n = !1) => {
501
- if (typeof e == "object" && e !== null && (!ee(e, t) || n) && !Nn)
501
+ if (typeof e == "object" && e !== null && (!ee(e, t) || n) && !kn)
502
502
  throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
503
503
  }, at = {
504
504
  get size() {
@@ -581,7 +581,7 @@ const Fe = (e, t, n = !1) => {
581
581
  [Ue]() {
582
582
  return this.entries();
583
583
  }
584
- }, jn = Reflect.ownKeys(at), Tt = (e, t, { isValuesIterator: n }) => () => {
584
+ }, Nn = Reflect.ownKeys(at), Tt = (e, t, { isValuesIterator: n }) => () => {
585
585
  var s, i;
586
586
  const o = t.next();
587
587
  if (o.done)
@@ -669,13 +669,13 @@ const Fe = (e, t, n = !1) => {
669
669
  for (; !s.done; )
670
670
  e.call(t, s.value, s.value, this), s = n.next();
671
671
  }
672
- }, Un = Reflect.ownKeys(ut), Qt = /* @__PURE__ */ new WeakSet(), Yt = {
672
+ }, jn = Reflect.ownKeys(ut), qt = /* @__PURE__ */ new WeakSet(), Qt = {
673
673
  get(e, t, n) {
674
674
  var s, i;
675
675
  const o = (s = e.copy) === null || s === void 0 ? void 0 : s[t];
676
- if (o && Qt.has(o))
676
+ if (o && qt.has(o))
677
677
  return o;
678
- if (t === Wt)
678
+ if (t === Jt)
679
679
  return e;
680
680
  let r;
681
681
  if (e.options.mark) {
@@ -684,14 +684,14 @@ const Fe = (e, t, n = !1) => {
684
684
  return e.options.strict && Fe(f, e.options, !0), f;
685
685
  }
686
686
  const a = Q(e);
687
- if (a instanceof Map && jn.includes(t)) {
687
+ if (a instanceof Map && Nn.includes(t)) {
688
688
  if (t === "size")
689
689
  return Object.getOwnPropertyDescriptor(at, "size").get.call(e.proxy);
690
690
  const f = at[t];
691
691
  if (f)
692
692
  return f.bind(e.proxy);
693
693
  }
694
- if (a instanceof Set && Un.includes(t)) {
694
+ if (a instanceof Set && jn.includes(t)) {
695
695
  if (t === "size")
696
696
  return Object.getOwnPropertyDescriptor(ut, "size").get.call(e.proxy);
697
697
  const f = ut[t];
@@ -762,7 +762,7 @@ const Fe = (e, t, n = !1) => {
762
762
  },
763
763
  deleteProperty(e, t) {
764
764
  var n;
765
- return e.type === 1 ? Yt.set.call(this, e, t, void 0, e.proxy) : (Ye(e.original, t) !== void 0 || t in e.original ? (K(e), oe(e), e.assignedMap.set(t, !1)) : (e.assignedMap = (n = e.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), e.assignedMap.delete(t)), e.copy && delete e.copy[t], !0);
765
+ return e.type === 1 ? Qt.set.call(this, e, t, void 0, e.proxy) : (Ye(e.original, t) !== void 0 || t in e.original ? (K(e), oe(e), e.assignedMap.set(t, !1)) : (e.assignedMap = (n = e.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), e.assignedMap.delete(t)), e.copy && delete e.copy[t], !0);
766
766
  }
767
767
  };
768
768
  function bt(e) {
@@ -779,8 +779,8 @@ function bt(e) {
779
779
  setMap: r === 3 ? new Map(t.entries()) : void 0
780
780
  };
781
781
  (s || "key" in e) && (a.key = s);
782
- const { proxy: u, revoke: f } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, Yt);
783
- if (i.revoke.push(f), Qt.add(u), a.proxy = u, n) {
782
+ const { proxy: u, revoke: f } = Proxy.revocable(r === 1 ? Object.assign([], a) : a, Qt);
783
+ if (i.revoke.push(f), qt.add(u), a.proxy = u, n) {
784
784
  const c = n;
785
785
  c.finalities.draft.push((d, y) => {
786
786
  var w, _;
@@ -804,7 +804,7 @@ function bt(e) {
804
804
  return u;
805
805
  }
806
806
  mt.createDraft = bt;
807
- function Bn(e, t, n, s, i) {
807
+ function Un(e, t, n, s, i) {
808
808
  var o;
809
809
  const r = $(e), a = (o = r == null ? void 0 : r.original) !== null && o !== void 0 ? o : e, u = !!t.length;
810
810
  if (r != null && r.operated)
@@ -817,7 +817,7 @@ function Bn(e, t, n, s, i) {
817
817
  s && u ? [{ op: B.Replace, path: [], value: a }] : s
818
818
  ];
819
819
  }
820
- function Fn(e, t) {
820
+ function Bn(e, t) {
821
821
  var n;
822
822
  const s = {
823
823
  draft: [],
@@ -835,7 +835,7 @@ function Fn(e, t) {
835
835
  return [
836
836
  a,
837
837
  (u = []) => {
838
- const [f, c, d] = Bn(a, u, i, o, t.enableAutoFreeze);
838
+ const [f, c, d] = Un(a, u, i, o, t.enableAutoFreeze);
839
839
  return t.enablePatches ? [f, c, d] : f;
840
840
  }
841
841
  ];
@@ -856,7 +856,7 @@ function ct(e) {
856
856
  typeof r == "object" && r !== null && (e.value = r, e.isRoot = !1, ct(e));
857
857
  }), i && (e.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), s && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
858
858
  }
859
- function Zt(e) {
859
+ function Yt(e) {
860
860
  const t = $(e);
861
861
  if (!ee(e, t == null ? void 0 : t.options))
862
862
  return e;
@@ -865,7 +865,7 @@ function Zt(e) {
865
865
  return t.original;
866
866
  let s;
867
867
  function i() {
868
- s = n === 2 ? new Map(e) : n === 3 ? Array.from(t.setMap.values()) : Xt(e, t == null ? void 0 : t.options);
868
+ s = n === 2 ? new Map(e) : n === 3 ? Array.from(t.setMap.values()) : Kt(e, t == null ? void 0 : t.options);
869
869
  }
870
870
  if (t) {
871
871
  t.finalized = !0;
@@ -879,16 +879,16 @@ function Zt(e) {
879
879
  return _t(s, (o, r) => {
880
880
  if (t && le(pe(t.original, o), r))
881
881
  return;
882
- const a = Zt(r);
882
+ const a = Yt(r);
883
883
  a !== r && (s === e && i(), Le(s, o, a));
884
884
  }), n === 3 ? new Set(s) : s;
885
885
  }
886
886
  function Dt(e) {
887
887
  if (!ge(e))
888
888
  throw new Error(`current() is only used for Draft, parameter: ${e}`);
889
- return Zt(e);
889
+ return Yt(e);
890
890
  }
891
- const zn = (e) => {
891
+ const Fn = (e) => {
892
892
  if (e !== void 0 && Object.prototype.toString.call(e) !== "[object Object]")
893
893
  throw new Error(`Invalid options: ${String(e)}, 'options' should be an object.`);
894
894
  return function t(n, s, i) {
@@ -918,7 +918,7 @@ const zn = (e) => {
918
918
  };
919
919
  if (!ee(d, v) && typeof d == "object" && d !== null)
920
920
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
921
- const [x, b] = Fn(d, v);
921
+ const [x, b] = Bn(d, v);
922
922
  if (typeof s != "function") {
923
923
  if (!ee(d, v))
924
924
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
@@ -935,7 +935,7 @@ const zn = (e) => {
935
935
  if (!ge(R)) {
936
936
  if (R !== void 0 && !le(R, x) && (D != null && D.operated))
937
937
  throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
938
- const L = R == null ? void 0 : R[$n];
938
+ const L = R == null ? void 0 : R[Cn];
939
939
  if (L) {
940
940
  const z = L[0];
941
941
  return v.strict && typeof R == "object" && R !== null && ct({
@@ -961,9 +961,9 @@ const zn = (e) => {
961
961
  throw it($(x)), R;
962
962
  }) : M(A);
963
963
  };
964
- }, C = zn();
964
+ }, C = Fn();
965
965
  Object.prototype.constructor.toString();
966
- const Gn = dt(fetch), en = async (e, t) => {
966
+ const zn = dt(fetch), Zt = async (e, t) => {
967
967
  if (!e)
968
968
  throw "Metapage definition null";
969
969
  if (!e.version)
@@ -972,7 +972,7 @@ const Gn = dt(fetch), en = async (e, t) => {
972
972
  throw 'Missing "version" argument';
973
973
  if (V(t, Je) > 0)
974
974
  try {
975
- return await (await Gn(`https://module.metapage.io/conversion/metapage/${t}`, {
975
+ return await (await zn(`https://module.metapage.io/conversion/metapage/${t}`, {
976
976
  redirect: "follow",
977
977
  retries: 3,
978
978
  retryDelay: 1e3,
@@ -985,8 +985,8 @@ const Gn = dt(fetch), en = async (e, t) => {
985
985
  } catch (s) {
986
986
  throw `Error converting metapage definition to version ${t}: ${s}`;
987
987
  }
988
- return Jn(e, t);
989
- }, Vn = async (e) => en(e, Je), Jn = (e, t) => {
988
+ return Vn(e, t);
989
+ }, Gn = async (e) => Zt(e, Je), Vn = (e, t) => {
990
990
  if (!e)
991
991
  throw "Metapage definition null";
992
992
  if (!e.version)
@@ -999,33 +999,33 @@ const Gn = dt(fetch), en = async (e, t) => {
999
999
  switch (n) {
1000
1000
  case "0.2": {
1001
1001
  if (V(t, n) > 0)
1002
- s = Wn(s), n = Re(s.version);
1002
+ s = Jn(s), n = Re(s.version);
1003
1003
  else
1004
1004
  throw `Cannot convert from version ${n} to ${t}`;
1005
1005
  break;
1006
1006
  }
1007
1007
  case "0.3": {
1008
- V(t, n) > 0 ? (s = Xn(s), n = Re(s.version)) : (s = Kn(s), n = Re(s.version));
1008
+ V(t, n) > 0 ? (s = Kn(s), n = Re(s.version)) : (s = Wn(s), n = Re(s.version));
1009
1009
  break;
1010
1010
  }
1011
1011
  case "1": {
1012
1012
  if (V(t, n) > 0)
1013
1013
  throw `Cannot convert from version ${n} to ${t}, 1 is the latest version`;
1014
- s = qn(s), n = Re(s.version);
1014
+ s = Xn(s), n = Re(s.version);
1015
1015
  break;
1016
1016
  }
1017
1017
  default:
1018
1018
  throw `Unknow version ${n} to ${t}`;
1019
1019
  }
1020
1020
  return s;
1021
- }, Wn = (e) => C(e, (t) => {
1021
+ }, Jn = (e) => C(e, (t) => {
1022
1022
  t.version = "0.3";
1023
- }), Kn = (e) => C(e, (t) => {
1023
+ }), Wn = (e) => C(e, (t) => {
1024
1024
  t.version = "0.2";
1025
- }), Xn = (e) => C(e, (t) => {
1025
+ }), Kn = (e) => C(e, (t) => {
1026
1026
  const n = t;
1027
1027
  delete n.plugins, n.version = "1";
1028
- }), qn = (e) => C(e, (t) => (t.version = "0.3", t)), Re = (e) => {
1028
+ }), Xn = (e) => C(e, (t) => (t.version = "0.3", t)), Re = (e) => {
1029
1029
  if (e === "latest")
1030
1030
  return Je;
1031
1031
  if (V(e, "0.2") < 0)
@@ -1037,7 +1037,7 @@ const Gn = dt(fetch), en = async (e, t) => {
1037
1037
  if (e === "1")
1038
1038
  return "1";
1039
1039
  throw `Unknown version: ${e}`;
1040
- }, Qn = dt(fetch), tn = async (e, t) => {
1040
+ }, qn = dt(fetch), en = async (e, t) => {
1041
1041
  if (!e)
1042
1042
  throw "Metapage definition null";
1043
1043
  if (!e.version)
@@ -1046,7 +1046,7 @@ const Gn = dt(fetch), en = async (e, t) => {
1046
1046
  throw 'Missing "version" argument';
1047
1047
  if (V(t, pt) > 0)
1048
1048
  try {
1049
- return await (await Qn(`https://module.metapage.io/conversion/metaframe/${t}`, {
1049
+ return await (await qn(`https://module.metapage.io/conversion/metaframe/${t}`, {
1050
1050
  redirect: "follow",
1051
1051
  retries: 3,
1052
1052
  retryDelay: 1e3,
@@ -1059,8 +1059,8 @@ const Gn = dt(fetch), en = async (e, t) => {
1059
1059
  } catch (s) {
1060
1060
  throw `Error converting metapage definition to version ${t}: ${s}`;
1061
1061
  }
1062
- return Zn(e, t);
1063
- }, Yn = async (e) => tn(e, pt), Zn = (e, t) => {
1062
+ return Yn(e, t);
1063
+ }, Qn = async (e) => en(e, pt), Yn = (e, t) => {
1064
1064
  if (!e)
1065
1065
  throw "Metaframe definition null";
1066
1066
  if (!e.version)
@@ -1073,41 +1073,41 @@ const Gn = dt(fetch), en = async (e, t) => {
1073
1073
  switch (n) {
1074
1074
  case "0.3": {
1075
1075
  if (V(t, n) > 0)
1076
- s = ns(s), n = ue(s.version);
1076
+ s = ts(s), n = ue(s.version);
1077
1077
  else
1078
1078
  throw `Cannot convert from version ${n} to ${t}`;
1079
1079
  break;
1080
1080
  }
1081
1081
  case "0.4": {
1082
- V(t, n) > 0 ? (s = ss(s), n = ue(s.version)) : (s = ts(s), n = ue(s.version));
1082
+ V(t, n) > 0 ? (s = ns(s), n = ue(s.version)) : (s = es(s), n = ue(s.version));
1083
1083
  break;
1084
1084
  }
1085
1085
  case "0.5": {
1086
- V(t, n) > 0 ? (s = as(s), n = ue(s.version)) : (s = is(s), n = ue(s.version));
1086
+ V(t, n) > 0 ? (s = os(s), n = ue(s.version)) : (s = ss(s), n = ue(s.version));
1087
1087
  break;
1088
1088
  }
1089
1089
  case "0.6": {
1090
- V(t, n) > 0 ? (s = rs(s), n = ue(s.version)) : (s = us(s), n = ue(s.version));
1090
+ V(t, n) > 0 ? (s = is(s), n = ue(s.version)) : (s = as(s), n = ue(s.version));
1091
1091
  break;
1092
1092
  }
1093
1093
  case "1": {
1094
1094
  if (V(t, n) > 0)
1095
1095
  throw `Cannot convert from version ${n} to ${t}, 1 is the latest version`;
1096
- s = os(s), n = ue(s.version);
1096
+ s = rs(s), n = ue(s.version);
1097
1097
  break;
1098
1098
  }
1099
1099
  default:
1100
1100
  throw `Unknow version ${n} to ${t}`;
1101
1101
  }
1102
1102
  return s;
1103
- }, es = async (e, t) => {
1103
+ }, Zn = async (e, t) => {
1104
1104
  if (e)
1105
- return Yn(e);
1106
- }, ts = (e) => C(e, (t) => {
1105
+ return Qn(e);
1106
+ }, es = (e) => C(e, (t) => {
1107
1107
  t.version = "0.3", delete t.allow;
1108
- }), ns = (e) => C(e, (t) => {
1108
+ }), ts = (e) => C(e, (t) => {
1109
1109
  t.version = "0.4";
1110
- }), ss = (e) => C(e, (t) => {
1110
+ }), ns = (e) => C(e, (t) => {
1111
1111
  if (t.version = "0.5", !(t != null && t.metadata))
1112
1112
  return;
1113
1113
  const n = t.metadata.title;
@@ -1116,7 +1116,7 @@ const Gn = dt(fetch), en = async (e, t) => {
1116
1116
  delete t.metadata.descriptionUrl, t.metadata.description = s;
1117
1117
  const i = t.metadata.keywords;
1118
1118
  delete t.metadata.keywords, t.metadata.tags = i;
1119
- }), is = (e) => C(e, (t) => {
1119
+ }), ss = (e) => C(e, (t) => {
1120
1120
  if (t.version = "0.4", !(t != null && t.metadata))
1121
1121
  return;
1122
1122
  const n = t.metadata.name;
@@ -1125,16 +1125,16 @@ const Gn = dt(fetch), en = async (e, t) => {
1125
1125
  delete t.metadata.description, t.metadata.descriptionUrl = s;
1126
1126
  const i = t.metadata.tags;
1127
1127
  delete t.metadata.tags, t.metadata.keywords = i;
1128
- }), rs = (e) => C(e, (t) => {
1128
+ }), is = (e) => C(e, (t) => {
1129
1129
  var n;
1130
1130
  t.version = "1", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
1131
- }), os = (e) => C(e, (t) => {
1131
+ }), rs = (e) => C(e, (t) => {
1132
1132
  var n;
1133
1133
  t.version = "0.6", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
1134
- }), as = (e) => C(e, (t) => {
1134
+ }), os = (e) => C(e, (t) => {
1135
1135
  var n;
1136
1136
  t.version = "0.6", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
1137
- }), us = (e) => C(e, (t) => {
1137
+ }), as = (e) => C(e, (t) => {
1138
1138
  var n;
1139
1139
  t.version = "0.5", (n = t == null ? void 0 : t.metadata) != null && n.operations && delete t.metadata.operations;
1140
1140
  }), ue = (e) => {
@@ -1172,16 +1172,16 @@ var je = function(e) {
1172
1172
  };
1173
1173
  const We = async (e) => C(e, async (t) => {
1174
1174
  for (const n of Object.keys(e)) {
1175
- const s = await cs(e[n]);
1175
+ const s = await us(e[n]);
1176
1176
  return t[n] = s, t;
1177
1177
  }
1178
1178
  }), Ce = async (e) => C(e, async (t) => {
1179
1179
  for (const n of Object.keys(e)) {
1180
- const s = await nn(e[n]);
1180
+ const s = await tn(e[n]);
1181
1181
  return t[n] = s, t;
1182
1182
  }
1183
1183
  }), vi = async (e, t, n) => {
1184
- if (e = nn(e), n = n || {}, n.type || (n.type = "application/octet-stream"), e instanceof ArrayBuffer)
1184
+ if (e = tn(e), n = n || {}, n.type || (n.type = "application/octet-stream"), e instanceof ArrayBuffer)
1185
1185
  return new File([e], t, n);
1186
1186
  if (e instanceof File || e instanceof Blob) {
1187
1187
  const i = await e.arrayBuffer();
@@ -1203,7 +1203,7 @@ const We = async (e) => C(e, async (t) => {
1203
1203
  }
1204
1204
  var s = new Blob([e], { type: "text/plain" });
1205
1205
  return n.type = "text/plain", new File([s], t, n);
1206
- }, cs = async (e) => {
1206
+ }, us = async (e) => {
1207
1207
  if (e instanceof Int8Array || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Float32Array || e instanceof Float64Array) {
1208
1208
  const t = e, n = {
1209
1209
  _s: !0,
@@ -1244,7 +1244,7 @@ const We = async (e) => C(e, async (t) => {
1244
1244
  return Promise.resolve(n);
1245
1245
  }
1246
1246
  return Promise.resolve(e);
1247
- }, nn = (e) => {
1247
+ }, tn = (e) => {
1248
1248
  if (!(e && typeof e == "object" && e._s === !0))
1249
1249
  return e;
1250
1250
  const t = e, n = t._c;
@@ -1324,7 +1324,7 @@ function Mi(e) {
1324
1324
  return !1;
1325
1325
  }
1326
1326
  }
1327
- var sn = { exports: {} };
1327
+ var nn = { exports: {} };
1328
1328
  (function(e) {
1329
1329
  var t = Object.prototype.hasOwnProperty, n = "~";
1330
1330
  function s() {
@@ -1434,12 +1434,12 @@ var sn = { exports: {} };
1434
1434
  var c;
1435
1435
  return f ? (c = n ? n + f : f, this._events[c] && r(this, c)) : (this._events = new s(), this._eventsCount = 0), this;
1436
1436
  }, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = n, a.EventEmitter = a, e.exports = a;
1437
- })(sn);
1438
- var vt = sn.exports;
1439
- function fs(e) {
1437
+ })(nn);
1438
+ var vt = nn.exports;
1439
+ function cs(e) {
1440
1440
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1441
1441
  }
1442
- var ls = function(e, t) {
1442
+ var fs = function(e, t) {
1443
1443
  t || (t = {}), typeof t == "function" && (t = { cmp: t });
1444
1444
  var n = typeof t.cycles == "boolean" ? t.cycles : !1, s = t.cmp && /* @__PURE__ */ function(o) {
1445
1445
  return function(r) {
@@ -1477,13 +1477,13 @@ var ls = function(e, t) {
1477
1477
  }
1478
1478
  }(e);
1479
1479
  };
1480
- const ps = /* @__PURE__ */ fs(ls), hs = (e) => rn(ps(e)), ds = (e) => {
1480
+ const ls = /* @__PURE__ */ cs(fs), ps = (e) => sn(ls(e)), hs = (e) => {
1481
1481
  if (e && e.length > 0)
1482
- return JSON.parse(on(e));
1483
- }, rn = (e) => btoa(encodeURIComponent(e)), on = (e) => decodeURIComponent(atob(e)), an = (e) => {
1482
+ return JSON.parse(rn(e));
1483
+ }, sn = (e) => btoa(encodeURIComponent(e)), rn = (e) => decodeURIComponent(atob(e)), on = (e) => {
1484
1484
  const t = new URL(e);
1485
- return un(t.hash);
1486
- }, un = (e) => {
1485
+ return an(t.hash);
1486
+ }, an = (e) => {
1487
1487
  let t = e;
1488
1488
  for (; t.startsWith("#"); )
1489
1489
  t = t.substring(1);
@@ -1509,13 +1509,13 @@ const ps = /* @__PURE__ */ fs(ls), hs = (e) => rn(ps(e)), ds = (e) => {
1509
1509
  }
1510
1510
  }), [s, i];
1511
1511
  }, Pe = (e, t) => {
1512
- const [n, s] = an(e);
1512
+ const [n, s] = on(e);
1513
1513
  return s[t];
1514
- }, ms = (e) => ys()[1][e], ys = () => an(window.location.href), Ae = (e, t, n) => {
1515
- const s = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, i = _s(s, e, t);
1514
+ }, ds = (e) => ms()[1][e], ms = () => on(window.location.href), Ae = (e, t, n) => {
1515
+ const s = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, i = ys(s, e, t);
1516
1516
  i !== s && (n != null && n.modifyHistory ? window.location.hash = i : (window.history.replaceState(null, document.title, `${window.location.pathname}${window.location.search}${i.startsWith("#") ? "" : "#"}${i}`), window.dispatchEvent(new HashChangeEvent("hashchange"))));
1517
- }, _s = (e, t, n) => {
1518
- const [s, i] = un(e);
1517
+ }, ys = (e, t, n) => {
1518
+ const [s, i] = an(e);
1519
1519
  let o = !1;
1520
1520
  if (i.hasOwnProperty(t) && n === null || n === void 0 ? (delete i[t], o = !0) : i[t] !== n && (i[t] = n, o = !0), !o)
1521
1521
  return e;
@@ -1523,33 +1523,33 @@ const ps = /* @__PURE__ */ fs(ls), hs = (e) => rn(ps(e)), ds = (e) => {
1523
1523
  r.sort();
1524
1524
  const a = r.map((u, f) => `${u}=${encodeURI(i[u])}`).join("&");
1525
1525
  return `${s}?${a}`;
1526
- }, gs = (e, t) => {
1526
+ }, _s = (e, t) => {
1527
1527
  const n = Pe(e, t);
1528
1528
  if (n && n !== "")
1529
- return ds(n);
1530
- }, bs = (e, t, n) => {
1531
- const s = t ? hs(t) : void 0;
1529
+ return hs(n);
1530
+ }, gs = (e, t, n) => {
1531
+ const s = t ? ps(t) : void 0;
1532
1532
  Ae(e, s, n);
1533
- }, vs = (e) => gs(window.location.href, e), ws = (e, t) => {
1533
+ }, bs = (e) => _s(window.location.href, e), vs = (e, t) => {
1534
1534
  const n = Pe(e, t);
1535
1535
  return n ? parseFloat(n) : void 0;
1536
- }, cn = (e, t, n) => {
1536
+ }, un = (e, t, n) => {
1537
1537
  Ae(e, t != null ? t.toString() : void 0, n);
1538
- }, Rs = (e) => ws(window.location.href, e), Os = (e, t) => {
1538
+ }, ws = (e) => vs(window.location.href, e), Rs = (e, t) => {
1539
1539
  const n = Pe(e, t);
1540
1540
  return n ? parseInt(n) : void 0;
1541
- }, As = (e, t, n) => {
1542
- cn(e, t, n);
1543
- }, Ss = (e) => Os(window.location.href, e), Es = (e, t) => Pe(e, t) === "true", Ms = (e, t, n) => {
1541
+ }, Os = (e, t, n) => {
1542
+ un(e, t, n);
1543
+ }, As = (e) => Rs(window.location.href, e), Ss = (e, t) => Pe(e, t) === "true", Es = (e, t, n) => {
1544
1544
  Ae(e, t ? "true" : void 0, n);
1545
- }, Is = (e) => Es(window.location.href, e), Cs = (e, t) => {
1545
+ }, Ms = (e) => Ss(window.location.href, e), Is = (e, t) => {
1546
1546
  const n = Pe(e, t);
1547
- return n && n !== "" ? on(n) : void 0;
1548
- }, $s = (e, t, n) => {
1549
- const s = t == null ? void 0 : rn(t);
1547
+ return n && n !== "" ? rn(n) : void 0;
1548
+ }, Cs = (e, t, n) => {
1549
+ const s = t == null ? void 0 : sn(t);
1550
1550
  Ae(e, s, n);
1551
- }, xs = (e) => Cs(window.location.href, e);
1552
- var Ls = function(e, t) {
1551
+ }, $s = (e) => Is(window.location.href, e);
1552
+ var xs = function(e, t) {
1553
1553
  t || (t = {}), typeof t == "function" && (t = { cmp: t });
1554
1554
  var n = typeof t.cycles == "boolean" ? t.cycles : !1, s = t.cmp && function(o) {
1555
1555
  return function(r) {
@@ -1587,24 +1587,24 @@ var Ls = function(e, t) {
1587
1587
  }
1588
1588
  }(e);
1589
1589
  };
1590
- const fn = /* @__PURE__ */ ht(Ls);
1590
+ const cn = /* @__PURE__ */ ht(xs);
1591
1591
  var xe;
1592
1592
  (function(e) {
1593
1593
  e.mp_debug = "mp_debug";
1594
1594
  })(xe || (xe = {}));
1595
- const Ps = () => {
1595
+ const Ls = () => {
1596
1596
  try {
1597
1597
  return window !== window.top;
1598
1598
  } catch {
1599
1599
  return !1;
1600
1600
  }
1601
- }, ln = {
1601
+ }, fn = {
1602
1602
  version: Je,
1603
1603
  metaframes: {}
1604
1604
  };
1605
- class Ts extends vt.EventEmitter {
1605
+ class Ps extends vt.EventEmitter {
1606
1606
  constructor() {
1607
- super(), this._definition = ln, this.getDefinition = this.getDefinition.bind(this);
1607
+ super(), this._definition = fn, this.getDefinition = this.getDefinition.bind(this);
1608
1608
  }
1609
1609
  error(t) {
1610
1610
  throw "Subclass should implement";
@@ -1620,7 +1620,7 @@ const ze = (e, t) => t ? C(e, (n) => {
1620
1620
  }) : e, Ii = (e) => window.location.search ? new URLSearchParams(window.location.search).get(e) : null, Ci = () => new URLSearchParams(window.location.search).has(xe.mp_debug), ft = () => {
1621
1621
  const e = new URLSearchParams(window.location.search).get(xe.mp_debug);
1622
1622
  return e === "true" || e === "1";
1623
- }, $i = (e = 8) => wt(e), Ds = (e = 8) => wt(e), xi = (e = 8) => wt(e), Ht = "abcdefghijklmnopqrstuvwxyz0123456789", wt = (e = 8) => {
1623
+ }, $i = (e = 8) => wt(e), Ts = (e = 8) => wt(e), xi = (e = 8) => wt(e), Ht = "abcdefghijklmnopqrstuvwxyz0123456789", wt = (e = 8) => {
1624
1624
  for (var t = "", n = Ht.length, s = 0; s < e; s++)
1625
1625
  t += Ht.charAt(Math.floor(Math.random() * n));
1626
1626
  return t;
@@ -1632,12 +1632,12 @@ const ze = (e, t) => t ? C(e, (n) => {
1632
1632
  n && (i = `${i}; background: #${n}`), s = `%c${s}`, window.console.log(s, i);
1633
1633
  } else
1634
1634
  window.console.log(s);
1635
- }, pn = (e) => ks(Hs(e)), Hs = (e) => {
1635
+ }, ln = (e) => Hs(Ds(e)), Ds = (e) => {
1636
1636
  var t = 0;
1637
1637
  for (let n = 0; n < e.length; n++)
1638
1638
  t = e.charCodeAt(n) + ((t << 5) - t);
1639
1639
  return t;
1640
- }, ks = (e) => {
1640
+ }, Hs = (e) => {
1641
1641
  var t = (e & 16777215).toString(16).toUpperCase();
1642
1642
  return "00000".substring(0, 6 - t.length) + t;
1643
1643
  }, Ze = () => document.readyState == "complete" || document.readyState == "interactive", Ot = async () => Ze() ? Promise.resolve() : new Promise((e) => {
@@ -1652,16 +1652,16 @@ const ze = (e, t) => t ? C(e, (n) => {
1652
1652
  !t && Ze() && (t = !0, e());
1653
1653
  }, 200);
1654
1654
  }), Li = async (e) => {
1655
- const t = fn(e);
1656
- return await hn(t);
1655
+ const t = cn(e);
1656
+ return await pn(t);
1657
1657
  }, Pi = async (e) => {
1658
- const t = fn({
1658
+ const t = cn({
1659
1659
  version: e.version,
1660
1660
  metaframes: e.metaframes
1661
1661
  });
1662
- return await hn(t);
1662
+ return await pn(t);
1663
1663
  };
1664
- async function hn(e) {
1664
+ async function pn(e) {
1665
1665
  const n = new TextEncoder().encode(e), s = await crypto.subtle.digest("SHA-256", n);
1666
1666
  return btoa(String.fromCharCode(...new Uint8Array(s)));
1667
1667
  }
@@ -1675,7 +1675,7 @@ var U;
1675
1675
  })(U || (U = {}));
1676
1676
  class te extends vt.EventEmitter {
1677
1677
  constructor(t) {
1678
- if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = re.WaitingForPageLoad, this._messageSendCount = 0, this.debug = ft(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = ft(), this._isIframe = Ps(), this.addListener = this.addListener.bind(this), this.dispose = this.dispose.bind(this), this.error = this.error.bind(this), this.getInput = this.getInput.bind(this), this.getInputs = this.getInputs.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.onInput = this.onInput.bind(this), this.onInputs = this.onInputs.bind(this), this.onMessage = this.onMessage.bind(this), this.sendRpc = this.sendRpc.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInternalInputsAndNotify = this.setInternalInputsAndNotify.bind(this), this.setOutput = this.setOutput.bind(this), this.setOutputs = this.setOutputs.bind(this), this.warn = this.warn.bind(this), this._resolveSetupIframeServerResponse = this._resolveSetupIframeServerResponse.bind(this), this.addListenerReturnDisposer = this.addListenerReturnDisposer.bind(this), this.connected = this.connected.bind(this), this.isConnected = this.isConnected.bind(this), this.disableNotifyOnHashUrlChange = this.disableNotifyOnHashUrlChange.bind(this), this._onHashUrlChange = this._onHashUrlChange.bind(this), this.setParameter = this.setParameter.bind(this), this.setParameterBoolean = this.setParameterBoolean.bind(this), this.setParameterJson = this.setParameterJson.bind(this), this.setParameterBase64 = this.setParameterBase64.bind(this), this.setParameterFloat = this.setParameterFloat.bind(this), this.setParameterInt = this.setParameterInt.bind(this), this.getParameter = this.getParameter.bind(this), this.getParameterBoolean = this.getParameterBoolean.bind(this), this.getParameterJson = this.getParameterJson.bind(this), this.getParameterBase64 = this.getParameterBase64.bind(this), this.getParameterFloat = this.getParameterFloat.bind(this), this.getParameterInt = this.getParameterInt.bind(this), this.deleteParameter = this.deleteParameter.bind(this), !this._isIframe) {
1678
+ if (super(), this._inputPipeValues = {}, this._outputPipeValues = {}, this._state = re.WaitingForPageLoad, this._messageSendCount = 0, this.debug = ft(), this.isInputOutputBlobSerialization = !0, this.id = window.name, this.debug = ft(), this._isIframe = Ls(), this.addListener = this.addListener.bind(this), this.dispose = this.dispose.bind(this), this.error = this.error.bind(this), this.getInput = this.getInput.bind(this), this.getInputs = this.getInputs.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.onInput = this.onInput.bind(this), this.onInputs = this.onInputs.bind(this), this.onMessage = this.onMessage.bind(this), this.sendRpc = this.sendRpc.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInternalInputsAndNotify = this.setInternalInputsAndNotify.bind(this), this.setOutput = this.setOutput.bind(this), this.setOutputs = this.setOutputs.bind(this), this.warn = this.warn.bind(this), this._resolveSetupIframeServerResponse = this._resolveSetupIframeServerResponse.bind(this), this.addListenerReturnDisposer = this.addListenerReturnDisposer.bind(this), this.connected = this.connected.bind(this), this.isConnected = this.isConnected.bind(this), this.disableNotifyOnHashUrlChange = this.disableNotifyOnHashUrlChange.bind(this), this._onHashUrlChange = this._onHashUrlChange.bind(this), this.setParameter = this.setParameter.bind(this), this.setParameterBoolean = this.setParameterBoolean.bind(this), this.setParameterJson = this.setParameterJson.bind(this), this.setParameterBase64 = this.setParameterBase64.bind(this), this.setParameterFloat = this.setParameterFloat.bind(this), this.setParameterInt = this.setParameterInt.bind(this), this.getParameter = this.getParameter.bind(this), this.getParameterBoolean = this.getParameterBoolean.bind(this), this.getParameterJson = this.getParameterJson.bind(this), this.getParameterBase64 = this.getParameterBase64.bind(this), this.getParameterFloat = this.getParameterFloat.bind(this), this.getParameterInt = this.getParameterInt.bind(this), this.deleteParameter = this.deleteParameter.bind(this), !this._isIframe) {
1679
1679
  this.log("Not an iframe, metaframe code disabled");
1680
1680
  return;
1681
1681
  }
@@ -1689,7 +1689,7 @@ class te extends vt.EventEmitter {
1689
1689
  _resolveSetupIframeServerResponse(t) {
1690
1690
  if (this._state === re.WaitingForPageLoad)
1691
1691
  throw "Got message but page has not finished loading, we should never get in this state";
1692
- (async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = t.version, this.color = pn(this.id), this._parentId = t.parentId, this.log(`metapage[${this._parentId}](v${this._parentVersion ? this._parentVersion : "unknown"}) registered`), t.state && t.state.inputs && (this.isInputOutputBlobSerialization ? this._inputPipeValues = await Ce(t.state.inputs) : this._inputPipeValues = t.state.inputs), this._state = re.Ready, this.sendRpc(X.SetupIframeServerResponseAck, {
1692
+ (async () => this._parentId ? this.log("Got JsonRpcMethods.SetupIframeServerResponse but already resolved") : (this._parentVersion = t.version, this.color = ln(this.id), this._parentId = t.parentId, this.log(`metapage[${this._parentId}](v${this._parentVersion ? this._parentVersion : "unknown"}) registered`), t.state && t.state.inputs && (this.isInputOutputBlobSerialization ? this._inputPipeValues = await Ce(t.state.inputs) : this._inputPipeValues = t.state.inputs), this._state = re.Ready, this.sendRpc(X.SetupIframeServerResponseAck, {
1693
1693
  version: te.version
1694
1694
  }), this._inputPipeValues && Object.keys(this._inputPipeValues).length > 0 && (this.emit(U.Inputs, this._inputPipeValues), this.listenerCount(U.Input) > 0 && Object.keys(this._inputPipeValues).forEach((n) => this.emit(U.Input, n, this._inputPipeValues[n]))), this.emit(U.Connected), this.sendRpc(X.OutputsUpdate, this._outputPipeValues)))();
1695
1695
  }
@@ -1840,43 +1840,43 @@ class te extends vt.EventEmitter {
1840
1840
  Ae(t, n);
1841
1841
  }
1842
1842
  getParameter(t) {
1843
- return ms(t);
1843
+ return ds(t);
1844
1844
  }
1845
1845
  setParameterBoolean(t, n) {
1846
- Ms(t, n);
1846
+ Es(t, n);
1847
1847
  }
1848
1848
  getParameterBoolean(t) {
1849
- return Is(t);
1849
+ return Ms(t);
1850
1850
  }
1851
1851
  setParameterJson(t, n) {
1852
- bs(t, n);
1852
+ gs(t, n);
1853
1853
  }
1854
1854
  getParameterJson(t) {
1855
- return vs(t);
1855
+ return bs(t);
1856
1856
  }
1857
1857
  setParameterBase64(t, n) {
1858
- $s(t, n);
1858
+ Cs(t, n);
1859
1859
  }
1860
1860
  getParameterBase64(t) {
1861
- return xs(t);
1861
+ return $s(t);
1862
1862
  }
1863
1863
  setParameterFloat(t, n) {
1864
- cn(t, n);
1864
+ un(t, n);
1865
1865
  }
1866
1866
  getParameterFloat(t) {
1867
- return Rs(t);
1867
+ return ws(t);
1868
1868
  }
1869
1869
  setParameterInt(t, n) {
1870
- As(t, n);
1870
+ Os(t, n);
1871
1871
  }
1872
1872
  getParameterInt(t) {
1873
- return Ss(t);
1873
+ return As(t);
1874
1874
  }
1875
1875
  deleteParameter(t) {
1876
1876
  Ae(t, void 0);
1877
1877
  }
1878
1878
  }
1879
- te.version = An;
1879
+ te.version = On;
1880
1880
  te.ERROR = U.Error;
1881
1881
  te.CONNECTED = U.Connected;
1882
1882
  te.INPUT = U.Input;
@@ -1885,25 +1885,25 @@ te.MESSAGE = U.Message;
1885
1885
  te.deserializeInputs = Ce;
1886
1886
  te.serializeInputs = We;
1887
1887
  var Ke = {};
1888
- const ie = "\\\\/", kt = `[^${ie}]`, ce = "\\.", Ns = "\\+", js = "\\?", Xe = "\\/", Us = "(?=.)", dn = "[^/]", At = `(?:${Xe}|$)`, mn = `(?:^|${Xe})`, St = `${ce}{1,2}${At}`, Bs = `(?!${ce})`, Fs = `(?!${mn}${St})`, zs = `(?!${ce}{0,1}${At})`, Gs = `(?!${St})`, Vs = `[^.${Xe}]`, Js = `${dn}*?`, Ws = "/", yn = {
1888
+ const ie = "\\\\/", kt = `[^${ie}]`, ce = "\\.", ks = "\\+", Ns = "\\?", Xe = "\\/", js = "(?=.)", hn = "[^/]", At = `(?:${Xe}|$)`, dn = `(?:^|${Xe})`, St = `${ce}{1,2}${At}`, Us = `(?!${ce})`, Bs = `(?!${dn}${St})`, Fs = `(?!${ce}{0,1}${At})`, zs = `(?!${St})`, Gs = `[^.${Xe}]`, Vs = `${hn}*?`, Js = "/", mn = {
1889
1889
  DOT_LITERAL: ce,
1890
- PLUS_LITERAL: Ns,
1891
- QMARK_LITERAL: js,
1890
+ PLUS_LITERAL: ks,
1891
+ QMARK_LITERAL: Ns,
1892
1892
  SLASH_LITERAL: Xe,
1893
- ONE_CHAR: Us,
1894
- QMARK: dn,
1893
+ ONE_CHAR: js,
1894
+ QMARK: hn,
1895
1895
  END_ANCHOR: At,
1896
1896
  DOTS_SLASH: St,
1897
- NO_DOT: Bs,
1898
- NO_DOTS: Fs,
1899
- NO_DOT_SLASH: zs,
1900
- NO_DOTS_SLASH: Gs,
1901
- QMARK_NO_DOT: Vs,
1902
- STAR: Js,
1903
- START_ANCHOR: mn,
1904
- SEP: Ws
1905
- }, Ks = {
1906
- ...yn,
1897
+ NO_DOT: Us,
1898
+ NO_DOTS: Bs,
1899
+ NO_DOT_SLASH: Fs,
1900
+ NO_DOTS_SLASH: zs,
1901
+ QMARK_NO_DOT: Gs,
1902
+ STAR: Vs,
1903
+ START_ANCHOR: dn,
1904
+ SEP: Js
1905
+ }, Ws = {
1906
+ ...mn,
1907
1907
  SLASH_LITERAL: `[${ie}]`,
1908
1908
  QMARK: kt,
1909
1909
  STAR: `${kt}*?`,
@@ -1916,7 +1916,7 @@ const ie = "\\\\/", kt = `[^${ie}]`, ce = "\\.", Ns = "\\+", js = "\\?", Xe = "\
1916
1916
  START_ANCHOR: `(?:^|[${ie}])`,
1917
1917
  END_ANCHOR: `(?:[${ie}]|$)`,
1918
1918
  SEP: "\\"
1919
- }, Xs = {
1919
+ }, Ks = {
1920
1920
  alnum: "a-zA-Z0-9",
1921
1921
  alpha: "a-zA-Z",
1922
1922
  ascii: "\\x00-\\x7F",
@@ -1934,7 +1934,7 @@ const ie = "\\\\/", kt = `[^${ie}]`, ce = "\\.", Ns = "\\+", js = "\\?", Xe = "\
1934
1934
  };
1935
1935
  var qe = {
1936
1936
  MAX_LENGTH: 1024 * 64,
1937
- POSIX_REGEX_SOURCE: Xs,
1937
+ POSIX_REGEX_SOURCE: Ks,
1938
1938
  // regular expressions
1939
1939
  REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
1940
1940
  REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
@@ -2053,7 +2053,7 @@ var qe = {
2053
2053
  * Create GLOB_CHARS
2054
2054
  */
2055
2055
  globChars(e) {
2056
- return e === !0 ? Ks : yn;
2056
+ return e === !0 ? Ws : mn;
2057
2057
  }
2058
2058
  };
2059
2059
  (function(e) {
@@ -2081,37 +2081,37 @@ var qe = {
2081
2081
  const Nt = Ke, {
2082
2082
  CHAR_ASTERISK: et,
2083
2083
  /* * */
2084
- CHAR_AT: qs,
2084
+ CHAR_AT: Xs,
2085
2085
  /* @ */
2086
2086
  CHAR_BACKWARD_SLASH: Me,
2087
2087
  /* \ */
2088
- CHAR_COMMA: Qs,
2088
+ CHAR_COMMA: qs,
2089
2089
  /* , */
2090
2090
  CHAR_DOT: tt,
2091
2091
  /* . */
2092
2092
  CHAR_EXCLAMATION_MARK: jt,
2093
2093
  /* ! */
2094
- CHAR_FORWARD_SLASH: _n,
2094
+ CHAR_FORWARD_SLASH: yn,
2095
2095
  /* / */
2096
2096
  CHAR_LEFT_CURLY_BRACE: nt,
2097
2097
  /* { */
2098
2098
  CHAR_LEFT_PARENTHESES: st,
2099
2099
  /* ( */
2100
- CHAR_LEFT_SQUARE_BRACKET: Ys,
2100
+ CHAR_LEFT_SQUARE_BRACKET: Qs,
2101
2101
  /* [ */
2102
- CHAR_PLUS: Zs,
2102
+ CHAR_PLUS: Ys,
2103
2103
  /* + */
2104
2104
  CHAR_QUESTION_MARK: Ut,
2105
2105
  /* ? */
2106
- CHAR_RIGHT_CURLY_BRACE: ei,
2106
+ CHAR_RIGHT_CURLY_BRACE: Zs,
2107
2107
  /* } */
2108
2108
  CHAR_RIGHT_PARENTHESES: Bt,
2109
2109
  /* ) */
2110
- CHAR_RIGHT_SQUARE_BRACKET: ti
2110
+ CHAR_RIGHT_SQUARE_BRACKET: ei
2111
2111
  /* ] */
2112
- } = qe, Ft = (e) => e === _n || e === Me, zt = (e) => {
2112
+ } = qe, Ft = (e) => e === yn || e === Me, zt = (e) => {
2113
2113
  e.isPrefix !== !0 && (e.depth = e.isGlobstar ? 1 / 0 : 1);
2114
- }, ni = (e, t) => {
2114
+ }, ti = (e, t) => {
2115
2115
  const n = t || {}, s = e.length - 1, i = n.parts === !0 || n.scanToEnd === !0, o = [], r = [], a = [];
2116
2116
  let u = e, f = -1, c = 0, d = 0, y = !1, w = !1, _ = !1, S = !1, v = !1, x = !1, b = !1, A = !1, M = !1, R = 0, D, O, L = { value: "", depth: 0, isGlob: !1 };
2117
2117
  const z = () => f >= s, h = () => u.charCodeAt(f + 1), k = () => (D = O, u.charCodeAt(++f));
@@ -2137,12 +2137,12 @@ const Nt = Ke, {
2137
2137
  continue;
2138
2138
  break;
2139
2139
  }
2140
- if (x !== !0 && O === Qs) {
2140
+ if (x !== !0 && O === qs) {
2141
2141
  if (y = L.isBrace = !0, _ = L.isGlob = !0, M = !0, i === !0)
2142
2142
  continue;
2143
2143
  break;
2144
2144
  }
2145
- if (O === ei && (R--, R === 0)) {
2145
+ if (O === Zs && (R--, R === 0)) {
2146
2146
  x = !1, y = L.isBrace = !0, M = !0;
2147
2147
  break;
2148
2148
  }
@@ -2151,7 +2151,7 @@ const Nt = Ke, {
2151
2151
  continue;
2152
2152
  break;
2153
2153
  }
2154
- if (O === _n) {
2154
+ if (O === yn) {
2155
2155
  if (o.push(f), r.push(L), L = { value: "", depth: 0, isGlob: !1 }, M === !0)
2156
2156
  continue;
2157
2157
  if (D === tt && f === c + 1) {
@@ -2161,7 +2161,7 @@ const Nt = Ke, {
2161
2161
  d = f + 1;
2162
2162
  continue;
2163
2163
  }
2164
- if (n.noext !== !0 && (O === Zs || O === qs || O === et || O === Ut || O === jt) === !0 && h() === st) {
2164
+ if (n.noext !== !0 && (O === Ys || O === Xs || O === et || O === Ut || O === jt) === !0 && h() === st) {
2165
2165
  if (_ = L.isGlob = !0, S = L.isExtglob = !0, M = !0, i === !0) {
2166
2166
  for (; z() !== !0 && (O = k()); ) {
2167
2167
  if (O === Me) {
@@ -2187,13 +2187,13 @@ const Nt = Ke, {
2187
2187
  continue;
2188
2188
  break;
2189
2189
  }
2190
- if (O === Ys)
2190
+ if (O === Qs)
2191
2191
  for (; z() !== !0 && (J = k()); ) {
2192
2192
  if (J === Me) {
2193
2193
  b = L.backslashes = !0, k();
2194
2194
  continue;
2195
2195
  }
2196
- if (J === ti) {
2196
+ if (J === ei) {
2197
2197
  if (w = L.isBracket = !0, _ = L.isGlob = !0, M = !0, i === !0)
2198
2198
  continue;
2199
2199
  break;
@@ -2255,14 +2255,14 @@ const Nt = Ke, {
2255
2255
  }
2256
2256
  return p;
2257
2257
  };
2258
- var si = ni;
2258
+ var ni = ti;
2259
2259
  const Ge = qe, Z = Ke, {
2260
2260
  MAX_LENGTH: Ve,
2261
- POSIX_REGEX_SOURCE: ii,
2262
- REGEX_NON_SPECIAL_CHARS: ri,
2263
- REGEX_SPECIAL_CHARS_BACKREF: oi,
2264
- REPLACEMENTS: gn
2265
- } = Ge, ai = (e, t) => {
2261
+ POSIX_REGEX_SOURCE: si,
2262
+ REGEX_NON_SPECIAL_CHARS: ii,
2263
+ REGEX_SPECIAL_CHARS_BACKREF: ri,
2264
+ REPLACEMENTS: _n
2265
+ } = Ge, oi = (e, t) => {
2266
2266
  if (typeof t.expandRange == "function")
2267
2267
  return t.expandRange(...e, t);
2268
2268
  e.sort();
@@ -2273,10 +2273,10 @@ const Ge = qe, Z = Ke, {
2273
2273
  return e.map((i) => Z.escapeRegex(i)).join("..");
2274
2274
  }
2275
2275
  return n;
2276
- }, ve = (e, t) => `Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`, bn = (e, t) => {
2276
+ }, ve = (e, t) => `Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`, gn = (e, t) => {
2277
2277
  if (typeof e != "string")
2278
2278
  throw new TypeError("Expected a string");
2279
- e = gn[e] || e;
2279
+ e = _n[e] || e;
2280
2280
  const n = { ...t }, s = typeof n.maxLength == "number" ? Math.min(Ve, n.maxLength) : Ve;
2281
2281
  let i = e.length;
2282
2282
  if (i > s)
@@ -2321,7 +2321,7 @@ const Ge = qe, Z = Ke, {
2321
2321
  h.consumed += g, h.index += N;
2322
2322
  }, Te = (g) => {
2323
2323
  h.output += g.output != null ? g.output : g.value, q(g.value);
2324
- }, Rn = () => {
2324
+ }, wn = () => {
2325
2325
  let g = 1;
2326
2326
  for (; T() === "!" && (T(2) !== "(" || T(3) === "?"); )
2327
2327
  se(), h.start++, g++;
@@ -2345,7 +2345,7 @@ const Ge = qe, Z = Ke, {
2345
2345
  m.prev = l, m.parens = h.parens, m.output = h.output;
2346
2346
  const P = (n.capture ? "(" : "") + m.open;
2347
2347
  De("parens"), I({ type: g, value: N, output: h.output ? "" : w }), I({ type: "paren", extglob: !0, value: se(), output: P }), k.push(m);
2348
- }, On = (g) => {
2348
+ }, Rn = (g) => {
2349
2349
  let N = g.close + (n.capture ? ")" : "");
2350
2350
  if (g.type === "negate") {
2351
2351
  let m = z;
@@ -2354,7 +2354,7 @@ const Ge = qe, Z = Ke, {
2354
2354
  I({ type: "paren", extglob: !0, value: p, output: N }), me("parens");
2355
2355
  };
2356
2356
  if (n.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(e)) {
2357
- let g = !1, N = e.replace(oi, (m, P, j, W, G, Qe) => W === "\\" ? (g = !0, m) : W === "?" ? P ? P + W + (G ? b.repeat(G.length) : "") : Qe === 0 ? L + (G ? b.repeat(G.length) : "") : b.repeat(j.length) : W === "." ? c.repeat(j.length) : W === "*" ? P ? P + W + (G ? z : "") : z : P ? m : `\\${m}`);
2357
+ let g = !1, N = e.replace(ri, (m, P, j, W, G, Qe) => W === "\\" ? (g = !0, m) : W === "?" ? P ? P + W + (G ? b.repeat(G.length) : "") : Qe === 0 ? L + (G ? b.repeat(G.length) : "") : b.repeat(j.length) : W === "." ? c.repeat(j.length) : W === "*" ? P ? P + W + (G ? z : "") : z : P ? m : `\\${m}`);
2358
2358
  return g === !0 && (n.unescape === !0 ? N = N.replace(/\\/g, "") : N = N.replace(/\\+/g, (m) => m.length % 2 === 0 ? "\\\\" : m ? "\\" : "")), N === e && n.contains === !0 ? (h.output = e, h) : (h.output = Z.wrapOutput(N, h, t), h);
2359
2359
  }
2360
2360
  for (; !J(); ) {
@@ -2379,7 +2379,7 @@ const Ge = qe, Z = Ke, {
2379
2379
  if (n.posix !== !1 && p === ":") {
2380
2380
  const m = l.value.slice(1);
2381
2381
  if (m.includes("[") && (l.posix = !0, m.includes(":"))) {
2382
- const P = l.value.lastIndexOf("["), j = l.value.slice(0, P), W = l.value.slice(P + 2), G = ii[W];
2382
+ const P = l.value.lastIndexOf("["), j = l.value.slice(0, P), W = l.value.slice(P + 2), G = si[W];
2383
2383
  if (G) {
2384
2384
  l.value = j + G, h.backtrack = !0, se(), !o.output && r.indexOf(l) === 1 && (o.output = w);
2385
2385
  continue;
@@ -2406,7 +2406,7 @@ const Ge = qe, Z = Ke, {
2406
2406
  throw new SyntaxError(ve("opening", "("));
2407
2407
  const m = k[k.length - 1];
2408
2408
  if (m && h.parens === m.parens + 1) {
2409
- On(k.pop());
2409
+ Rn(k.pop());
2410
2410
  continue;
2411
2411
  }
2412
2412
  I({ type: "paren", value: p, output: h.parens ? ")" : "\\)" }), me("parens");
@@ -2468,7 +2468,7 @@ const Ge = qe, Z = Ke, {
2468
2468
  const j = r.slice(), W = [];
2469
2469
  for (let G = j.length - 1; G >= 0 && (r.pop(), j[G].type !== "brace"); G--)
2470
2470
  j[G].type !== "dots" && W.unshift(j[G].value);
2471
- P = ai(W, n), h.backtrack = !0;
2471
+ P = oi(W, n), h.backtrack = !0;
2472
2472
  }
2473
2473
  if (m.comma !== !0 && m.dots !== !0) {
2474
2474
  const j = h.output.slice(0, m.outputIndex), W = h.tokens.slice(m.tokensIndex);
@@ -2537,7 +2537,7 @@ const Ge = qe, Z = Ke, {
2537
2537
  continue;
2538
2538
  }
2539
2539
  if (n.nonegate !== !0 && h.index === 0) {
2540
- Rn();
2540
+ wn();
2541
2541
  continue;
2542
2542
  }
2543
2543
  }
@@ -2567,7 +2567,7 @@ const Ge = qe, Z = Ke, {
2567
2567
  }
2568
2568
  if (p !== "*") {
2569
2569
  (p === "$" || p === "^") && (p = `\\${p}`);
2570
- const m = ri.exec(ae());
2570
+ const m = ii.exec(ae());
2571
2571
  m && (p += m[0], h.index += m[0].length), I({ type: "text", value: p });
2572
2572
  continue;
2573
2573
  }
@@ -2654,11 +2654,11 @@ const Ge = qe, Z = Ke, {
2654
2654
  }
2655
2655
  return h;
2656
2656
  };
2657
- bn.fastpaths = (e, t) => {
2657
+ gn.fastpaths = (e, t) => {
2658
2658
  const n = { ...t }, s = typeof n.maxLength == "number" ? Math.min(Ve, n.maxLength) : Ve, i = e.length;
2659
2659
  if (i > s)
2660
2660
  throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${s}`);
2661
- e = gn[e] || e;
2661
+ e = _n[e] || e;
2662
2662
  const {
2663
2663
  DOT_LITERAL: o,
2664
2664
  SLASH_LITERAL: r,
@@ -2702,8 +2702,8 @@ bn.fastpaths = (e, t) => {
2702
2702
  let D = M(R);
2703
2703
  return D && n.strictSlashes !== !0 && (D += `${r}?`), D;
2704
2704
  };
2705
- var ui = bn;
2706
- const ci = si, lt = ui, vn = Ke, fi = qe, li = (e) => e && typeof e == "object" && !Array.isArray(e), F = (e, t, n = !1) => {
2705
+ var ai = gn;
2706
+ const ui = ni, lt = ai, bn = Ke, ci = qe, fi = (e) => e && typeof e == "object" && !Array.isArray(e), F = (e, t, n = !1) => {
2707
2707
  if (Array.isArray(e)) {
2708
2708
  const c = e.map((y) => F(y, t, n));
2709
2709
  return (y) => {
@@ -2715,7 +2715,7 @@ const ci = si, lt = ui, vn = Ke, fi = qe, li = (e) => e && typeof e == "object"
2715
2715
  return !1;
2716
2716
  };
2717
2717
  }
2718
- const s = li(e) && e.tokens && e.input;
2718
+ const s = fi(e) && e.tokens && e.input;
2719
2719
  if (e === "" || typeof e != "string" && !s)
2720
2720
  throw new TypeError("Expected pattern to be a non-empty string");
2721
2721
  const i = t || {}, o = i.windows, r = s ? F.compileRe(e, t) : F.makeRe(e, t, !1, !0), a = r.state;
@@ -2736,14 +2736,14 @@ F.test = (e, t, n, { glob: s, posix: i } = {}) => {
2736
2736
  throw new TypeError("Expected input to be a string");
2737
2737
  if (e === "")
2738
2738
  return { isMatch: !1, output: "" };
2739
- const o = n || {}, r = o.format || (i ? vn.toPosixSlashes : null);
2739
+ const o = n || {}, r = o.format || (i ? bn.toPosixSlashes : null);
2740
2740
  let a = e === s, u = a && r ? r(e) : e;
2741
2741
  return a === !1 && (u = r ? r(e) : e, a = u === s), (a === !1 || o.capture === !0) && (o.matchBase === !0 || o.basename === !0 ? a = F.matchBase(e, t, n, i) : a = t.exec(u)), { isMatch: !!a, match: a, output: u };
2742
2742
  };
2743
- F.matchBase = (e, t, n) => (t instanceof RegExp ? t : F.makeRe(t, n)).test(vn.basename(e));
2743
+ F.matchBase = (e, t, n) => (t instanceof RegExp ? t : F.makeRe(t, n)).test(bn.basename(e));
2744
2744
  F.isMatch = (e, t, n) => F(t, n)(e);
2745
2745
  F.parse = (e, t) => Array.isArray(e) ? e.map((n) => F.parse(n, t)) : lt(e, { ...t, fastpaths: !1 });
2746
- F.scan = (e, t) => ci(e, t);
2746
+ F.scan = (e, t) => ui(e, t);
2747
2747
  F.compileRe = (e, t, n = !1, s = !1) => {
2748
2748
  if (n === !0)
2749
2749
  return e.output;
@@ -2770,9 +2770,9 @@ F.toRegex = (e, t) => {
2770
2770
  return /$^/;
2771
2771
  }
2772
2772
  };
2773
- F.constants = fi;
2774
- var pi = F, hi = pi;
2775
- const Gt = /* @__PURE__ */ ht(hi);
2773
+ F.constants = ci;
2774
+ var li = F, pi = li;
2775
+ const hi = /* @__PURE__ */ ht(pi);
2776
2776
  class di extends vt.EventEmitter {
2777
2777
  constructor(t, n, s, i, o, r = !1) {
2778
2778
  if (super(), this.inputs = {}, this.outputs = {}, this._disposables = [], this._rpcListeners = [], this._loaded = !1, this._onLoaded = [], this._sendInputsAfterRegistration = !1, this._cachedEventInputsUpdate = {
@@ -2790,7 +2790,7 @@ class di extends vt.EventEmitter {
2790
2790
  var a = new URL(this.url);
2791
2791
  a.searchParams.set(xe.mp_debug, "true"), this.url = a.href;
2792
2792
  }
2793
- this.id = s, this._parentId = i, this._color = pn(this.id), this._consoleBackgroundColor = o, this._iframe = document.createElement("iframe"), this._iframe.name = this.id;
2793
+ this.id = s, this._parentId = i, this._color = ln(this.id), this._consoleBackgroundColor = o, this._iframe = document.createElement("iframe"), this._iframe.name = this.id;
2794
2794
  const u = this;
2795
2795
  this.iframe = new Promise((f) => {
2796
2796
  Ot().then(async () => {
@@ -2830,7 +2830,7 @@ class di extends vt.EventEmitter {
2830
2830
  signal: AbortSignal.timeout(6e3)
2831
2831
  });
2832
2832
  if (n.ok) {
2833
- const s = await n.json(), i = await es(s);
2833
+ const s = await n.json(), i = await Zn(s);
2834
2834
  return this._definition = i, this._definition;
2835
2835
  } else
2836
2836
  this.emit(E.Error, `Failed to fetch: ${t}
@@ -2906,7 +2906,7 @@ Error: ${n}`);
2906
2906
  state: {
2907
2907
  inputs: this.inputs
2908
2908
  },
2909
- version: Vt
2909
+ version: Gt
2910
2910
  };
2911
2911
  this.sendRpcInternal(fe.SetupIframeServerResponse, t);
2912
2912
  }
@@ -2983,8 +2983,8 @@ const ye = C({
2983
2983
  inputs: {},
2984
2984
  outputs: {}
2985
2985
  }
2986
- }, (e) => e), Ti = (e) => Re(e), mi = (e, t, n) => (!t || t === "*") && (!n || n === "*") || e === t ? !0 : Gt.isMatch(e, t) ? !!(!n || n === "*" || n.endsWith("/") || Gt.isMatch(e, n)) : !1, yi = "bcbcbc";
2987
- class ne extends Ts {
2986
+ }, (e) => e), Ti = (e) => Re(e), mi = (e, t) => !!(!t || t === "**" || e === t || hi.isMatch(e, t)), yi = "bcbcbc";
2987
+ class ne extends Ps {
2988
2988
  static async from(t, n) {
2989
2989
  if (t == null)
2990
2990
  throw "Metapage definition cannot be null";
@@ -2998,7 +2998,7 @@ class ne extends Ts {
2998
2998
  return s.setDefinition(t);
2999
2999
  }
3000
3000
  constructor(t) {
3001
- super(), this._state = ye, this._metaframes = C({}, (n) => n), this.debug = ft(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = C({}, (n) => n), this._inputMap = {}, this._id = t && t.id ? t.id : Ds(), this._consoleBackgroundColor = t && t.color ? t.color : yi, this.addPipe = this.addPipe.bind(this), this.dispose = this.dispose.bind(this), this.addMetaframe = this.addMetaframe.bind(this), this.getInputsFromOutput = this.getInputsFromOutput.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframeIds = this.getMetaframeIds.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframes = this.getMetaframes.bind(this), this.getState = this.getState.bind(this), this.getStateMetaframes = this.getStateMetaframes.bind(this), this.isValidJSONRpcMessage = this.isValidJSONRpcMessage.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.metaframeIds = this.metaframeIds.bind(this), this.metaframes = this.metaframes.bind(this), this.onMessage = this.onMessage.bind(this), this.removeAll = this.removeAll.bind(this), this.removeMetaframe = this.removeMetaframe.bind(this), this.setDebugFromUrlParams = this.setDebugFromUrlParams.bind(this), this.setDefinition = this.setDefinition.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInputStateOnlyMetaframeInputValue = this.setInputStateOnlyMetaframeInputValue.bind(this), this.setInputStateOnlyMetaframeInputMap = this.setInputStateOnlyMetaframeInputMap.bind(this), this.setInputStateOnlyMetapageInstanceInputs = this.setInputStateOnlyMetapageInstanceInputs.bind(this), this.setOutputStateOnlyMetaframeInputValue = this.setOutputStateOnlyMetaframeInputValue.bind(this), this.setOutputStateOnlyMetaframeInputMap = this.setOutputStateOnlyMetaframeInputMap.bind(this), this.setOutputStateOnlyMetapageInstanceInputs = this.setOutputStateOnlyMetapageInstanceInputs.bind(this), this.setMetaframeClientInputAndSentClientEvent = this.setMetaframeClientInputAndSentClientEvent.bind(this), this.setState = this.setState.bind(this), this.isDisposed = this.isDisposed.bind(this), this._emitDefinitionEvent = this._emitDefinitionEvent.bind(this), Ot().then(() => {
3001
+ super(), this._state = ye, this._metaframes = C({}, (n) => n), this.debug = ft(), this._internalReceivedMessageCounter = 0, this._cachedInputLookupMap = C({}, (n) => n), this._inputMap = {}, this._id = t && t.id ? t.id : Ts(), this._consoleBackgroundColor = t && t.color ? t.color : yi, this.addPipe = this.addPipe.bind(this), this.dispose = this.dispose.bind(this), this.addMetaframe = this.addMetaframe.bind(this), this.getInputsFromOutput = this.getInputsFromOutput.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframeIds = this.getMetaframeIds.bind(this), this.getMetaframe = this.getMetaframe.bind(this), this.getMetaframes = this.getMetaframes.bind(this), this.getState = this.getState.bind(this), this.getStateMetaframes = this.getStateMetaframes.bind(this), this.isValidJSONRpcMessage = this.isValidJSONRpcMessage.bind(this), this.log = this.log.bind(this), this.logInternal = this.logInternal.bind(this), this.metaframeIds = this.metaframeIds.bind(this), this.metaframes = this.metaframes.bind(this), this.onMessage = this.onMessage.bind(this), this.removeAll = this.removeAll.bind(this), this.removeMetaframe = this.removeMetaframe.bind(this), this.setDebugFromUrlParams = this.setDebugFromUrlParams.bind(this), this.setDefinition = this.setDefinition.bind(this), this.setInput = this.setInput.bind(this), this.setInputs = this.setInputs.bind(this), this.setInputStateOnlyMetaframeInputValue = this.setInputStateOnlyMetaframeInputValue.bind(this), this.setInputStateOnlyMetaframeInputMap = this.setInputStateOnlyMetaframeInputMap.bind(this), this.setInputStateOnlyMetapageInstanceInputs = this.setInputStateOnlyMetapageInstanceInputs.bind(this), this.setOutputStateOnlyMetaframeInputValue = this.setOutputStateOnlyMetaframeInputValue.bind(this), this.setOutputStateOnlyMetaframeInputMap = this.setOutputStateOnlyMetaframeInputMap.bind(this), this.setOutputStateOnlyMetapageInstanceInputs = this.setOutputStateOnlyMetapageInstanceInputs.bind(this), this.setMetaframeClientInputAndSentClientEvent = this.setMetaframeClientInputAndSentClientEvent.bind(this), this.setState = this.setState.bind(this), this.isDisposed = this.isDisposed.bind(this), this._emitDefinitionEvent = this._emitDefinitionEvent.bind(this), Ot().then(() => {
3002
3002
  this.isDisposed() || (window.addEventListener("message", this.onMessage), this.log("Initialized"));
3003
3003
  });
3004
3004
  }
@@ -3031,7 +3031,7 @@ class ne extends Ts {
3031
3031
  async setDefinition(t, n) {
3032
3032
  if (!t.version)
3033
3033
  throw "Metapage definition must have a version";
3034
- const s = await Vn(t);
3034
+ const s = await Gn(t);
3035
3035
  if (this.isDisposed())
3036
3036
  return this;
3037
3037
  s.metaframes && Object.keys(s.metaframes).forEach((o) => {
@@ -3049,7 +3049,7 @@ class ne extends Ts {
3049
3049
  const r = s.metaframes[o];
3050
3050
  this.addMetaframe(o, r);
3051
3051
  }
3052
- }), i !== ln && window.setTimeout(() => {
3052
+ }), i !== fn && window.setTimeout(() => {
3053
3053
  !this.isDisposed() && s === this._definition && (this._emitDefinitionEvent(), n && this.listenerCount(E.State) > 0 && ye !== this._state && this.emit(E.State, this._state));
3054
3054
  }, 0), this;
3055
3055
  }
@@ -3138,9 +3138,9 @@ class ne extends Ts {
3138
3138
  var i = [];
3139
3139
  s[t][n] = i, Object.keys(this._inputMap).forEach((o) => {
3140
3140
  o !== t && this._inputMap[o].forEach((r) => {
3141
- if (r.metaframe === t && mi(n, r.source || "*", r.target || "*")) {
3142
- var a = r.target;
3143
- !r.target || r.target.startsWith("*") || r.target === "" ? a = n : a.endsWith("/") && (a = a + n), i.push({ metaframe: o, pipe: a });
3141
+ if (r.metaframe === t && mi(n, r.source)) {
3142
+ var a = r.target || "";
3143
+ !r.target || r.target.startsWith("*") || r.target === "" ? a = n : a && a.endsWith("/") && (a = a + n), i.push({ metaframe: o, pipe: a });
3144
3144
  }
3145
3145
  });
3146
3146
  });
@@ -3310,7 +3310,7 @@ class ne extends Ts {
3310
3310
  typeof t == "string" ? i = t : typeof t == "number" ? i = t + "" : i = JSON.stringify(t), i = this._id ? `Metapage[${this._id}] ${i}` : i, Rt(i, n, s);
3311
3311
  }
3312
3312
  }
3313
- ne.version = Vt;
3313
+ ne.version = Gt;
3314
3314
  ne.DEFINITION = E.Definition;
3315
3315
  ne.ERROR = E.Error;
3316
3316
  ne.INPUTS = E.Inputs;
@@ -3319,27 +3319,27 @@ ne.OUTPUTS = E.Outputs;
3319
3319
  ne.STATE = E.State;
3320
3320
  ne.deserializeInputs = Ce;
3321
3321
  ne.serializeInputs = We;
3322
- const wn = dt(fetch), Di = async (e, t) => {
3322
+ const vn = dt(fetch), Di = async (e, t) => {
3323
3323
  const n = new URL(e);
3324
3324
  n.pathname = n.pathname + (n.pathname.endsWith("/") ? "metapage.json" : "/metapage.json");
3325
- const i = await (await wn(n.href, {
3325
+ const i = await (await vn(n.href, {
3326
3326
  redirect: "follow",
3327
3327
  retries: 3,
3328
3328
  retryDelay: 1e3
3329
3329
  })).json();
3330
- return await en(i, t || "1");
3330
+ return await Zt(i, t || "1");
3331
3331
  }, Hi = async (e, t) => {
3332
3332
  const n = new URL(e);
3333
3333
  n.pathname = n.pathname + (n.pathname.endsWith("/") ? "metaframe.json" : "/metaframe.json");
3334
- const i = await (await wn(n.href, {
3334
+ const i = await (await vn(n.href, {
3335
3335
  redirect: "follow",
3336
3336
  retries: 3,
3337
3337
  retryDelay: 1e3
3338
3338
  })).json();
3339
- return await tn(i, t || "1");
3339
+ return await en(i, t || "1");
3340
3340
  };
3341
3341
  export {
3342
- ln as INITIAL_NULL_METAPAGE_DEFINITION,
3342
+ fn as INITIAL_NULL_METAPAGE_DEFINITION,
3343
3343
  Ei as INTERNAL_ERROR,
3344
3344
  Si as INVALID_PARAMS,
3345
3345
  Oi as INVALID_REQUEST,
@@ -3358,21 +3358,21 @@ export {
3358
3358
  E as MetapageEvents,
3359
3359
  xe as MetapageHashParams,
3360
3360
  di as MetapageIFrameRpcClient,
3361
- Ts as MetapageShared,
3361
+ Ps as MetapageShared,
3362
3362
  Je as MetapageVersionCurrent,
3363
3363
  Mt as MetapageVersionsAll,
3364
3364
  Ri as PARSE_ERROR,
3365
- An as VERSION_METAFRAME,
3366
- Vt as VERSION_METAPAGE,
3367
- Yn as convertMetaframeDefinitionToCurrentVersion,
3368
- tn as convertMetaframeDefinitionToVersion,
3369
- es as convertMetaframeJsonToCurrentVersion,
3370
- Vn as convertMetapageDefinitionToCurrentVersion,
3371
- en as convertMetapageDefinitionToVersion,
3365
+ On as VERSION_METAFRAME,
3366
+ Gt as VERSION_METAPAGE,
3367
+ Qn as convertMetaframeDefinitionToCurrentVersion,
3368
+ en as convertMetaframeDefinitionToVersion,
3369
+ Zn as convertMetaframeJsonToCurrentVersion,
3370
+ Gn as convertMetapageDefinitionToCurrentVersion,
3371
+ Zt as convertMetapageDefinitionToVersion,
3372
3372
  Ce as deserializeInputs,
3373
3373
  wt as generateId,
3374
3374
  $i as generateMetaframeId,
3375
- Ds as generateMetapageId,
3375
+ Ts as generateMetapageId,
3376
3376
  xi as generateNonce,
3377
3377
  Ti as getLibraryVersionMatching,
3378
3378
  ue as getMatchingMetaframeVersion,
@@ -3381,10 +3381,10 @@ export {
3381
3381
  Di as getMetapageDefinitionFromUrl,
3382
3382
  Ii as getUrlParam,
3383
3383
  Ci as getUrlParamDebug,
3384
- Hs as hashCode,
3385
- ks as intToRGB,
3384
+ Ds as hashCode,
3385
+ Hs as intToRGB,
3386
3386
  ft as isDebugFromUrlsParams,
3387
- Ps as isIframe,
3387
+ Ls as isIframe,
3388
3388
  Mi as isJsonRpcId,
3389
3389
  Ze as isPageLoaded,
3390
3390
  Rt as log,
@@ -3394,10 +3394,10 @@ export {
3394
3394
  Pi as metapageOnlyEssentailSha256Hash,
3395
3395
  Ot as pageLoaded,
3396
3396
  wi as possiblyDeserializeDatarefToFile,
3397
- nn as possiblyDeserializeDatarefToValue,
3398
- cs as possiblySerializeValueToDataref,
3397
+ tn as possiblyDeserializeDatarefToValue,
3398
+ us as possiblySerializeValueToDataref,
3399
3399
  We as serializeInputs,
3400
- pn as stringToRgb,
3400
+ ln as stringToRgb,
3401
3401
  vi as valueToFile
3402
3402
  };
3403
3403
  //# sourceMappingURL=index.js.map