indexeddbshim 17.5.0 → 17.7.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.
@@ -1,4 +1,4 @@
1
- /*! indexeddbshim - v17.5.0 - 8/30/2026 */
1
+ /*! indexeddbshim - v17.7.0 - 9/2/2026 */
2
2
 
3
3
  'use strict';
4
4
 
@@ -4947,7 +4947,7 @@ const readonlyProperties$4 = ['objectStoreNames', 'mode', 'durability', 'db', 'e
4947
4947
  * __requestsFinished: boolean,
4948
4948
  * __transFinishedCb: (err: boolean, cb: ((bool?: boolean) => void)) => void,
4949
4949
  * __callTransFinishedCb: (err: boolean, cb: ((bool?: boolean) => void)) => void,
4950
- * __transactionEndCallback: () => void,
4950
+ * __transactionEndCallback: (() => void)|undefined,
4951
4951
  * __transactionFinished: boolean,
4952
4952
  * __completed: boolean,
4953
4953
  * __transFinishedCbFired: boolean,
@@ -4982,6 +4982,19 @@ const readonlyProperties$4 = ['objectStoreNames', 'mode', 'durability', 'db', 'e
4982
4982
  * }} IDBTransactionFull
4983
4983
  */
4984
4984
 
4985
+ /**
4986
+ * @param {IDBTransactionFull} tx
4987
+ * @returns {void}
4988
+ */
4989
+ function releaseFinishedTransaction(tx) {
4990
+ const pos = tx.db.__transactions.indexOf(tx);
4991
+ if (pos !== -1) {
4992
+ tx.db.__transactions.splice(pos, 1);
4993
+ }
4994
+ tx.__transactionEndCallback = undefined;
4995
+ tx.__requests = [];
4996
+ }
4997
+
4985
4998
  /**
4986
4999
  * The IndexedDB Transaction.
4987
5000
  * @see https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBTransaction
@@ -5539,6 +5552,7 @@ IDBTransaction.prototype.__executeRequests = function () {
5539
5552
  } finally {
5540
5553
  activeTransactions.delete(me);
5541
5554
  me.__storeHandles = {};
5555
+ releaseFinishedTransaction(me);
5542
5556
  }
5543
5557
  }
5544
5558
  if (me.mode === 'readwrite' || me.mode === 'readonly') {
@@ -5823,6 +5837,7 @@ IDBTransaction.prototype.__abortTransaction = function (err) {
5823
5837
  me.dispatchEvent(evt);
5824
5838
  me.__storeHandles = {};
5825
5839
  me.dispatchEvent(createEvent('__abort'));
5840
+ releaseFinishedTransaction(me);
5826
5841
  }, 0);
5827
5842
  return undefined;
5828
5843
  }).catch(err => {
@@ -6044,10 +6059,10 @@ function toStringTag(e) {
6044
6059
  }
6045
6060
  function hasConstructorOf(r, n) {
6046
6061
  if (!r || "object" != typeof r) return false;
6047
- const a = t(r);
6048
- if (!a) return null === n;
6049
- const o = e(a, "constructor") && a.constructor;
6050
- return "function" != typeof o ? null === n : n === o || null !== n && Function.prototype.toString.call(o) === Function.prototype.toString.call(n) || "function" == typeof n && "string" == typeof o.__typeson__type__ && o.__typeson__type__ === n.__typeson__type__;
6062
+ const o = t(r);
6063
+ if (!o) return null === n;
6064
+ const a = e(o, "constructor") && o.constructor;
6065
+ return "function" != typeof a ? null === n : n === a || null !== n && Function.prototype.toString.call(a) === Function.prototype.toString.call(n) || "function" == typeof n && "string" == typeof a.__typeson__type__ && a.__typeson__type__ === n.__typeson__type__;
6051
6066
  }
6052
6067
  function isPlainObject(e) {
6053
6068
  return !(!e || "Object" !== toStringTag(e)) && (!t(e) || hasConstructorOf(e, Object));
@@ -6069,28 +6084,28 @@ function unescapeKeyPathComponent(e) {
6069
6084
  function getByKeyPath(t, r, n) {
6070
6085
  if ("" === r) return t;
6071
6086
  if (null === t || "object" != typeof t) throw new TypeError("Unexpected non-object type");
6072
- const a = r.indexOf("."),
6073
- o = unescapeKeyPathComponent(-1 === a ? r : r.slice(0, a));
6074
- if (e(t, o)) {
6075
- if (-1 !== a) {
6076
- const e = t[o];
6077
- return void 0 === e ? void 0 : getByKeyPath(e, r.slice(a + 1));
6087
+ const o = r.indexOf("."),
6088
+ a = unescapeKeyPathComponent(-1 === o ? r : r.slice(0, o));
6089
+ if (e(t, a)) {
6090
+ if (-1 !== o) {
6091
+ const e = t[a];
6092
+ return void 0 === e ? void 0 : getByKeyPath(e, r.slice(o + 1));
6078
6093
  }
6079
- return t[o];
6094
+ return t[a];
6080
6095
  }
6081
6096
  }
6082
- function setAtKeyPath(t, r, n, a) {
6097
+ function setAtKeyPath(t, r, n, o) {
6083
6098
  if ("" === r) return n;
6084
- let o = t,
6099
+ let a = t,
6085
6100
  s = r;
6086
6101
  for (;;) {
6087
- if (!o || "object" != typeof o) throw new TypeError("Unexpected non-object type");
6102
+ if (!a || "object" != typeof a) throw new TypeError("Unexpected non-object type");
6088
6103
  const r = s.indexOf("."),
6089
6104
  i = unescapeKeyPathComponent(-1 === r ? s : s.slice(0, r));
6090
6105
  if ("__proto__" === i) throw new TypeError("Invalid property");
6091
- if (-1 === r) return o[i] = n, t;
6092
- if (!e(o, i)) throw new TypeError("Invalid property");
6093
- o = o[i], s = s.slice(r + 1);
6106
+ if (-1 === r) return a[i] = n, t;
6107
+ if (!e(a, i)) throw new TypeError("Invalid property");
6108
+ a = a[i], s = s.slice(r + 1);
6094
6109
  }
6095
6110
  }
6096
6111
  function getJSONType(e) {
@@ -6106,9 +6121,9 @@ const {
6106
6121
  hasOwn: n
6107
6122
  } = Object,
6108
6123
  {
6109
- isArray: a
6124
+ isArray: o
6110
6125
  } = Array,
6111
- o = ["type", "replaced", "iterateIn", "iterateUnsetNumeric", "addLength"];
6126
+ a = ["type", "replaced", "iterateIn", "iterateUnsetNumeric", "iterateSymbols", "addLength"];
6112
6127
  function setOwnEnumerable(e, t, r) {
6113
6128
  Object.defineProperty(e, t, {
6114
6129
  configurable: true,
@@ -6117,6 +6132,7 @@ function setOwnEnumerable(e, t, r) {
6117
6132
  writable: true
6118
6133
  });
6119
6134
  }
6135
+ const s = ["asyncIterator", "hasInstance", "isConcatSpreadable", "iterator", "match", "matchAll", "replace", "search", "species", "split", "toPrimitive", "toStringTag", "unscopables"];
6120
6136
  function nestedPathsFirst(e, t) {
6121
6137
  if ("" === e.keypath) return -1;
6122
6138
  let r = e.keypath.match(/\./gu) ?? 0,
@@ -6125,7 +6141,12 @@ function nestedPathsFirst(e, t) {
6125
6141
  }
6126
6142
  class Typeson {
6127
6143
  constructor(e) {
6128
- this.options = e, this.plainObjectReplacers = [], this.nonplainObjectReplacers = [], this.revivers = {}, this.types = {};
6144
+ this.options = e, this.plainObjectReplacers = [], this.nonplainObjectReplacers = [], this.revivers = {}, this.types = {}, this.symbolsByName = Object.create(null), this.symbolsByValue = new Map();
6145
+ const t = e?.symbols;
6146
+ t && Object.entries(t).forEach(([e, t]) => {
6147
+ if ("symbol" != typeof t) throw new TypeError("Non-symbol value supplied for `symbols` entry: " + e);
6148
+ this.symbolsByName[e] = t, this.symbolsByValue.set(t, e);
6149
+ });
6129
6150
  }
6130
6151
  stringify(e, t, r, n) {
6131
6152
  n = {
@@ -6133,8 +6154,8 @@ class Typeson {
6133
6154
  ...n,
6134
6155
  stringification: true
6135
6156
  };
6136
- const o = this.encapsulate(e, null, n);
6137
- return a(o) ? JSON.stringify(o[0], t, r) : o.then(e => JSON.stringify(e, t, r));
6157
+ const a = this.encapsulate(e, null, n);
6158
+ return o(a) ? JSON.stringify(a[0], t, r) : a.then(e => JSON.stringify(e, t, r));
6138
6159
  }
6139
6160
  stringifySync(e, t, r, n) {
6140
6161
  return this.stringify(e, t, r, {
@@ -6183,74 +6204,74 @@ class Typeson {
6183
6204
  iterateNone: true
6184
6205
  });
6185
6206
  }
6186
- encapsulate(e, t, s) {
6187
- const i = {
6207
+ encapsulate(e, t, i) {
6208
+ const c = {
6188
6209
  sync: true,
6189
6210
  ...this.options,
6190
- ...s
6211
+ ...i
6191
6212
  },
6192
6213
  {
6193
- sync: c
6194
- } = i,
6214
+ sync: l
6215
+ } = c,
6216
+ y = {},
6195
6217
  u = {},
6196
- y = [],
6197
- l = [],
6198
6218
  p = [],
6199
- f = !("cyclic" in i) || i.cyclic,
6219
+ f = [],
6220
+ d = [],
6221
+ m = !("cyclic" in c) || c.cyclic,
6200
6222
  {
6201
- encapsulateObserver: d,
6202
- encapsulateError: m
6203
- } = i,
6223
+ encapsulateObserver: h,
6224
+ encapsulateError: b
6225
+ } = c,
6204
6226
  finish = e => {
6205
- const t = Object.values(u);
6206
- if (i.iterateNone) return t.length ? t[0] : getJSONType(e);
6207
- if (t.length) {
6208
- if (i.returnTypeNames) return [...new Set(t)];
6209
- e && isPlainObject(e) && !n(e, "$types") ? e.$types = u : e = {
6210
- $: e,
6211
- $types: {
6212
- $: u
6213
- }
6214
- };
6215
- } else isObject(e) && n(e, "$types") && (e = {
6227
+ const t = Object.values(y);
6228
+ if (c.iterateNone) return t.length ? t[0] : getJSONType(e);
6229
+ if (c.returnTypeNames) return !!t.length && [...new Set(t)];
6230
+ const r = Object.keys(u).length > 0,
6231
+ o = isObject(e) && (n(e, "$types") || n(e, "$symbolKeys"));
6232
+ return r || t.length ? (!o && e && isPlainObject(e) ? t.length && (e.$types = y) : e = {
6233
+ $: e,
6234
+ $types: {
6235
+ $: y
6236
+ }
6237
+ }, r && (e.$symbolKeys = u)) : o && (e = {
6216
6238
  $: e,
6217
6239
  $types: true
6218
- });
6219
- return !i.returnTypeNames && e;
6240
+ }), e;
6220
6241
  },
6221
6242
  checkPromises = async (e, t) => {
6222
6243
  const r = await Promise.all(t.map(e => e[1].p));
6223
6244
  return await Promise.all(r.map(async function (r) {
6224
6245
  const n = [],
6225
- [a] = t.splice(0, 1),
6226
- [o,, s, i, c, u, y] = a,
6227
- l = _encapsulate(o, r, s, i, n, true, y),
6228
- p = hasConstructorOf(l, TypesonPromise);
6229
- return o && p ? (setOwnEnumerable(c, u, await l.p), checkPromises(e, n)) : (o ? setOwnEnumerable(c, u, l) : e = p ? l.p : l, checkPromises(e, n));
6246
+ [o] = t.splice(0, 1),
6247
+ [a,, s, i, c, l, y] = o,
6248
+ u = _encapsulate(a, r, s, i, n, true, y),
6249
+ p = hasConstructorOf(u, TypesonPromise);
6250
+ return a && p ? (setOwnEnumerable(c, l, await u.p), checkPromises(e, n)) : (a ? setOwnEnumerable(c, l, u) : e = p ? u.p : u, checkPromises(e, n));
6230
6251
  })), e;
6231
6252
  },
6232
6253
  _adaptBuiltinStateObjectProperties = (e, t, r) => {
6233
6254
  Object.assign(e, t);
6234
- const n = o.map(t => {
6255
+ const n = a.map(t => {
6235
6256
  const r = e[t];
6236
6257
  return delete e[t], r;
6237
6258
  });
6238
- r(), o.forEach((t, r) => {
6259
+ r(), a.forEach((t, r) => {
6239
6260
  e[t] = n[r];
6240
6261
  });
6241
6262
  },
6242
- _encapsulate = (e, t, o, s, c, p, f) => {
6243
- let h,
6244
- g = {};
6245
- const b = d ? function (r) {
6246
- const n = f ?? s.type ?? getJSONType(t);
6247
- d(Object.assign(r ?? g, {
6263
+ _encapsulate = (e, t, a, i, l, d, m) => {
6264
+ let g,
6265
+ v = {};
6266
+ const w = h ? function (r) {
6267
+ const n = m ?? i.type ?? getJSONType(t);
6268
+ h(Object.assign(r ?? v, {
6248
6269
  keypath: e,
6249
6270
  value: t,
6250
- cyclic: o,
6251
- stateObj: s,
6252
- promisesData: c,
6253
- resolvingTypesonPromise: p,
6271
+ cyclic: a,
6272
+ stateObj: i,
6273
+ promisesData: l,
6274
+ resolvingTypesonPromise: d,
6254
6275
  awaitingTypesonPromise: hasConstructorOf(t, TypesonPromise)
6255
6276
  }, {
6256
6277
  type: n
@@ -6259,136 +6280,175 @@ class Typeson {
6259
6280
  getEncapsulatedValue = (e, t, r) => {
6260
6281
  try {
6261
6282
  return {
6262
- value: _encapsulate(e, t[r], Boolean(o), s, c, p)
6283
+ value: _encapsulate(e, t[r], Boolean(a), i, l, d)
6263
6284
  };
6264
6285
  } catch (n) {
6265
- if (!m) throw n;
6266
- const a = f ?? s.type ?? getJSONType(t),
6267
- o = m({
6286
+ if (!b) throw n;
6287
+ const o = m ?? i.type ?? getJSONType(t),
6288
+ a = b({
6268
6289
  keypath: e,
6269
6290
  error: n,
6270
6291
  parent: t,
6271
6292
  key: r,
6272
- stateObj: s,
6273
- type: a
6293
+ stateObj: i,
6294
+ type: o
6274
6295
  });
6275
- if (!o) throw n;
6276
- if ("substitute" in o) return {
6277
- value: o.substitute,
6296
+ if (!a) throw n;
6297
+ if ("substitute" in a) return {
6298
+ value: a.substitute,
6278
6299
  substitute: true
6279
6300
  };
6280
- if (o.ignore) return;
6301
+ if (a.ignore) return;
6281
6302
  throw n;
6282
6303
  }
6283
6304
  };
6284
- if (["string", "boolean", "number", "undefined"].includes(typeof t)) return void 0 === t || t === 1 / 0 || 0 === t || t === -1 / 0 || Number.isNaN(t) ? (h = s.replaced ? t : replace(e, t, s, c, false, p, b), h !== t && (g = {
6285
- replaced: h
6286
- })) : h = t, b && b(), h;
6287
- if (null === t) return b && b(), t;
6288
- if (o && t && "object" == typeof t && !s.iterateIn && !s.iterateUnsetNumeric) {
6289
- const r = y.indexOf(t);
6290
- if (-1 !== r) return u[e] = "#", b && b({
6291
- cyclicKeypath: l[r]
6292
- }), "#" + l[r];
6293
- true === o && (y.push(t), l.push(e));
6305
+ if (["string", "boolean", "number", "undefined"].includes(typeof t)) return void 0 === t || t === 1 / 0 || 0 === t || t === -1 / 0 || Number.isNaN(t) ? (g = i.replaced ? t : replace(e, t, i, l, false, d, w), g !== t && (v = {
6306
+ replaced: g
6307
+ })) : g = t, w && w(), g;
6308
+ if (null === t) return w && w(), t;
6309
+ if (a && t && "object" == typeof t && !i.iterateIn && !i.iterateUnsetNumeric) {
6310
+ const r = p.indexOf(t);
6311
+ if (-1 !== r) return y[e] = "#", w && w({
6312
+ cyclicKeypath: f[r]
6313
+ }), "#" + f[r];
6314
+ true === a && (p.push(t), f.push(e));
6294
6315
  }
6295
- const v = isPlainObject(t),
6296
- w = a(t),
6297
- O = (v || w) && (!this.plainObjectReplacers.length || s.replaced) || s.iterateIn ? t : replace(e, t, s, c, v || w, null, b);
6298
- let A;
6299
- if (O !== t ? (h = O, g = {
6300
- replaced: O
6301
- }) : "" === e && hasConstructorOf(t, TypesonPromise) ? (c.push([e, t, o, s, void 0, void 0, s.type]), h = t) : w && "object" !== s.iterateIn || "array" === s.iterateIn ? (A = new Array(t.length), g = {
6302
- clone: A
6303
- }) : !v && ("object" != typeof t || "toJSON" in t || hasConstructorOf(t, TypesonPromise) || hasConstructorOf(t, Promise) || hasConstructorOf(t, ArrayBuffer)) && "object" !== s.iterateIn ? h = t : (A = {}, s.addLength && (A.length = t.length), g = {
6304
- clone: A
6305
- }), b && b(), i.iterateNone) return A ?? h;
6306
- if (!A) return h;
6307
- if (s.iterateIn) {
6316
+ const O = isPlainObject(t),
6317
+ A = o(t),
6318
+ T = (O || A) && (!this.plainObjectReplacers.length || i.replaced) || i.iterateIn ? t : replace(e, t, i, l, O || A, null, w);
6319
+ let S;
6320
+ if (T !== t ? (g = T, v = {
6321
+ replaced: T
6322
+ }) : "" === e && hasConstructorOf(t, TypesonPromise) ? (l.push([e, t, a, i, void 0, void 0, i.type]), g = t) : A && "object" !== i.iterateIn || "array" === i.iterateIn ? (S = new Array(t.length), v = {
6323
+ clone: S
6324
+ }) : !O && ("object" != typeof t || "toJSON" in t || hasConstructorOf(t, TypesonPromise) || hasConstructorOf(t, Promise) || hasConstructorOf(t, ArrayBuffer)) && "object" !== i.iterateIn ? g = t : (S = {}, i.addLength && (S.length = t.length), v = {
6325
+ clone: S
6326
+ }), w && w(), c.iterateNone) return S ?? g;
6327
+ if (!S) return g;
6328
+ if (i.iterateIn) {
6308
6329
  for (const r in t) {
6309
- const a = {
6330
+ const o = {
6310
6331
  ownKeys: n(t, r)
6311
6332
  };
6312
- _adaptBuiltinStateObjectProperties(s, a, () => {
6333
+ _adaptBuiltinStateObjectProperties(i, o, () => {
6313
6334
  const n = e + (e ? "." : "") + escapeKeyPathComponent(r),
6314
- a = getEncapsulatedValue(n, t, r),
6315
- i = a && a.value;
6316
- hasConstructorOf(i, TypesonPromise) ? c.push([n, i, Boolean(o), s, A, r, s.type]) : a && (void 0 !== i || "substitute" in a) && setOwnEnumerable(A, r, i);
6335
+ o = getEncapsulatedValue(n, t, r),
6336
+ s = o && o.value;
6337
+ hasConstructorOf(s, TypesonPromise) ? l.push([n, s, Boolean(a), i, S, r, i.type]) : o && (void 0 !== s || "substitute" in o) && setOwnEnumerable(S, r, s);
6317
6338
  });
6318
6339
  }
6319
- b && b({
6340
+ w && w({
6320
6341
  endIterateIn: true,
6321
6342
  end: true
6322
6343
  });
6323
6344
  } else r(t).forEach(function (r) {
6324
6345
  const n = e + (e ? "." : "") + escapeKeyPathComponent(r);
6325
- _adaptBuiltinStateObjectProperties(s, {
6346
+ _adaptBuiltinStateObjectProperties(i, {
6326
6347
  ownKeys: true
6327
6348
  }, () => {
6328
6349
  const e = getEncapsulatedValue(n, t, r),
6329
- a = e && e.value;
6330
- hasConstructorOf(a, TypesonPromise) ? c.push([n, a, Boolean(o), s, A, r, s.type]) : e && (void 0 !== a || "substitute" in e) && setOwnEnumerable(A, r, a);
6350
+ o = e && e.value;
6351
+ hasConstructorOf(o, TypesonPromise) ? l.push([n, o, Boolean(a), i, S, r, i.type]) : e && (void 0 !== o || "substitute" in e) && setOwnEnumerable(S, r, o);
6331
6352
  });
6332
- }), b && b({
6353
+ }), w && w({
6333
6354
  endIterateOwn: true,
6334
6355
  end: true
6335
- });
6336
- if (s.iterateUnsetNumeric) {
6356
+ }), (i.iterateSymbols || c.iterateSymbols) && (Object.getOwnPropertySymbols(t).filter(e => Object.prototype.propertyIsEnumerable.call(t, e)).forEach(r => {
6357
+ const n = function resolveSymbolIdentity(e, t) {
6358
+ const r = Symbol.keyFor(e);
6359
+ if (void 0 !== r) return {
6360
+ for: r
6361
+ };
6362
+ const n = s.find(t => Symbol[t] === e);
6363
+ if (n) return {
6364
+ wellKnown: n
6365
+ };
6366
+ const o = t.get(e);
6367
+ return void 0 !== o ? {
6368
+ registered: o
6369
+ } : null;
6370
+ }(r, this.symbolsByValue);
6371
+ if (!n) {
6372
+ if (c.throwOnUnregisteredSymbol) throw new TypeError("Cannot serialize a Symbol-keyed property whose Symbol has no portable identity (not global, not well-known, and not in the `symbols` option): " + String(r));
6373
+ return;
6374
+ }
6375
+ const o = u[e] ??= [],
6376
+ y = {
6377
+ key: n
6378
+ };
6379
+ o.push(y);
6380
+ const p = o.length - 1,
6381
+ f = `$symbolKeys.${escapeKeyPathComponent(e)}.${String(p)}.value`,
6382
+ d = {
6383
+ value: t[r]
6384
+ };
6385
+ _adaptBuiltinStateObjectProperties(i, {
6386
+ ownKeys: true
6387
+ }, () => {
6388
+ const e = getEncapsulatedValue(f, d, "value"),
6389
+ t = e && e.value;
6390
+ hasConstructorOf(t, TypesonPromise) ? l.push([f, t, Boolean(a), i, y, "value", i.type]) : e && (void 0 !== t || "substitute" in e) && setOwnEnumerable(y, "value", t);
6391
+ });
6392
+ }), w && w({
6393
+ endIterateSymbols: true,
6394
+ end: true
6395
+ }));
6396
+ if (i.iterateUnsetNumeric) {
6337
6397
  const r = t.length;
6338
6398
  for (let n = 0; n < r; n++) {
6339
6399
  if (n in t) continue;
6340
6400
  const r = `${e}${e ? "." : ""}${String(n)}`;
6341
- _adaptBuiltinStateObjectProperties(s, {
6401
+ _adaptBuiltinStateObjectProperties(i, {
6342
6402
  ownKeys: false
6343
6403
  }, () => {
6344
- const e = _encapsulate(r, void 0, Boolean(o), s, c, p);
6345
- hasConstructorOf(e, TypesonPromise) ? c.push([r, e, Boolean(o), s, A, n, s.type]) : void 0 !== e && setOwnEnumerable(A, n, e);
6404
+ const e = _encapsulate(r, void 0, Boolean(a), i, l, d);
6405
+ hasConstructorOf(e, TypesonPromise) ? l.push([r, e, Boolean(a), i, S, n, i.type]) : void 0 !== e && setOwnEnumerable(S, n, e);
6346
6406
  });
6347
6407
  }
6348
- b && b({
6408
+ w && w({
6349
6409
  endIterateUnsetNumeric: true,
6350
6410
  end: true
6351
6411
  });
6352
6412
  }
6353
- return A;
6413
+ return S;
6354
6414
  },
6355
- replace = (e, t, r, n, a, o, s) => {
6356
- const i = a ? this.plainObjectReplacers : this.nonplainObjectReplacers;
6357
- let y = i.length;
6358
- for (; y--;) {
6359
- const a = i[y];
6360
- if (a.test(t, r)) {
6415
+ replace = (e, t, r, n, o, a, s) => {
6416
+ const i = o ? this.plainObjectReplacers : this.nonplainObjectReplacers;
6417
+ let c = i.length;
6418
+ for (; c--;) {
6419
+ const o = i[c];
6420
+ if (o.test(t, r)) {
6361
6421
  const {
6362
6422
  type: i
6363
- } = a;
6423
+ } = o;
6364
6424
  if (Object.hasOwn(this.revivers, i)) {
6365
- const t = u[e];
6366
- u[e] = t ? [i].concat(t) : i;
6425
+ const t = y[e];
6426
+ y[e] = t ? [i].concat(t) : i;
6367
6427
  }
6368
6428
  if (Object.assign(r, {
6369
6429
  type: i,
6370
6430
  replaced: true
6371
- }), (c || !a.replaceAsync) && !a.replace) return s && s({
6431
+ }), (l || !o.replaceAsync) && !o.replace) return s && s({
6372
6432
  typeDetected: true
6373
- }), _encapsulate(e, t, f && "readonly", r, n, o, i);
6374
- let y;
6433
+ }), _encapsulate(e, t, m && "readonly", r, n, a, i);
6434
+ let c;
6375
6435
  if (s && s({
6376
6436
  replacing: true
6377
- }), c || !a.replaceAsync) {
6378
- if (void 0 === a.replace) throw new TypeError("Missing replacer");
6379
- y = a.replace(t, r);
6380
- } else y = a.replaceAsync(t, r);
6381
- return _encapsulate(e, y, f && "readonly", r, n, o, i);
6437
+ }), l || !o.replaceAsync) {
6438
+ if (void 0 === o.replace) throw new TypeError("Missing replacer");
6439
+ c = o.replace(t, r);
6440
+ } else c = o.replaceAsync(t, r);
6441
+ return _encapsulate(e, c, m && "readonly", r, n, a, i);
6382
6442
  }
6383
6443
  }
6384
6444
  return t;
6385
6445
  },
6386
- h = _encapsulate("", e, f, t ?? {}, p);
6387
- if (p.length) return c && i.throwOnBadSyncType ? (() => {
6446
+ g = _encapsulate("", e, m, t ?? {}, d);
6447
+ if (d.length) return l && c.throwOnBadSyncType ? (() => {
6388
6448
  throw new TypeError("Sync method requested but async result obtained");
6389
- })() : Promise.resolve(checkPromises(h, p)).then(finish);
6390
- if (!c && i.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
6391
- return c && i.stringification ? [finish(h)] : c ? finish(h) : Promise.resolve(finish(h));
6449
+ })() : Promise.resolve(checkPromises(g, d)).then(finish);
6450
+ if (!l && c.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
6451
+ return l && c.stringification ? [finish(g)] : l ? finish(g) : Promise.resolve(finish(g));
6392
6452
  }
6393
6453
  encapsulateSync(e, t, r) {
6394
6454
  return this.encapsulate(e, t, {
@@ -6405,111 +6465,144 @@ class Typeson {
6405
6465
  });
6406
6466
  }
6407
6467
  revive(e, t) {
6408
- const o = {
6468
+ const a = {
6409
6469
  sync: true,
6410
6470
  ...this.options,
6411
6471
  ...t
6412
6472
  },
6413
6473
  {
6414
- sync: s
6415
- } = o;
6474
+ sync: i
6475
+ } = a;
6416
6476
  function finishRevival(e) {
6417
- if (s) return e;
6418
- if (o.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
6477
+ if (i) return e;
6478
+ if (a.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
6419
6479
  return Promise.resolve(e);
6420
6480
  }
6421
6481
  if (!e || "object" != typeof e || Array.isArray(e)) return finishRevival(e);
6422
- let i = e.$types;
6423
- if (true === i) return finishRevival(e.$);
6424
- if (!i || "object" != typeof i || Array.isArray(i)) return finishRevival(e);
6425
- const c = [],
6426
- u = Object.create(null),
6427
- y = {};
6428
- let l = true;
6429
- i.$ && isPlainObject(i.$) && (e = e.$, i = i.$, l = false);
6482
+ let c = e.$types;
6483
+ if (true === c) return finishRevival(e.$);
6484
+ const l = e.$symbolKeys;
6485
+ let y = void 0 !== l;
6486
+ if (!c || "object" != typeof c || Array.isArray(c)) {
6487
+ if (!l) return finishRevival(e);
6488
+ c = {};
6489
+ }
6490
+ const u = [],
6491
+ p = Object.create(null),
6492
+ f = {};
6493
+ let d = true;
6494
+ c.$ && isPlainObject(c.$) && (e = e.$, c = c.$, d = false, y = false, void 0 !== l && isObject(e) && !n(e, "$symbolKeys") && (e.$symbolKeys = l, y = true));
6430
6495
  const executeReviver = (e, t) => {
6431
6496
  const [r] = this.revivers[e] ?? [];
6432
6497
  if (!r) throw new Error("Unregistered type: " + e);
6433
- if (s && !("revive" in r)) return t;
6434
- if (!s && r.reviveAsync) return r.reviveAsync(t, y);
6435
- if (r.revive) return r.revive(t, y);
6498
+ if (i && !("revive" in r)) return t;
6499
+ if (!i && r.reviveAsync) return r.reviveAsync(t, f);
6500
+ if (r.revive) return r.revive(t, f);
6436
6501
  throw new Error("Missing reviver");
6437
6502
  },
6438
- p = [];
6503
+ m = [];
6439
6504
  function checkUndefined(e) {
6440
6505
  return hasConstructorOf(e, Undefined) ? void 0 : e;
6441
6506
  }
6442
- const f = (() => {
6443
- if (!i) throw new Error("Found bad `types`");
6444
- const t = [];
6445
- if (Object.entries(i).forEach(([e, r]) => {
6446
- "#" !== r && [].concat(r).forEach(r => {
6447
- const [, {
6448
- plain: n
6449
- }] = this.revivers[r] ?? [null, {}];
6450
- n && (t.push({
6451
- keypath: e,
6452
- type: r
6453
- }), delete i[e]);
6454
- });
6455
- }), t.length) return t.sort(nestedPathsFirst), t.reduce(function reducer(t, {
6456
- keypath: r,
6457
- type: n
6458
- }) {
6459
- if (isThenable(t)) return t.then(e => reducer(e, {
6507
+ const reHomeSymbolKeys = e => {
6508
+ if (!isObject(e)) return;
6509
+ const t = y ? e.$symbolKeys : l;
6510
+ t && (Object.entries(t).forEach(([t, r]) => {
6511
+ const o = getByKeyPath(e, t);
6512
+ isObject(o) && r.forEach(e => {
6513
+ if (!n(e, "value")) return;
6514
+ const t = function resolveSymbolFromIdentity(e, t) {
6515
+ if ("for" in e) return Symbol.for(e.for);
6516
+ if ("wellKnown" in e) {
6517
+ const t = s.find(t => t === e.wellKnown);
6518
+ if (!t) throw new Error("Unknown well-known Symbol: " + e.wellKnown);
6519
+ return Symbol[t];
6520
+ }
6521
+ if (!n(t, e.registered)) throw new Error("Unregistered symbol: " + e.registered);
6522
+ return t[e.registered];
6523
+ }(e.key, this.symbolsByName),
6524
+ r = checkUndefined(e.value);
6525
+ e.descriptor ? Object.defineProperty(o, t, {
6526
+ configurable: true,
6527
+ enumerable: true,
6528
+ writable: true,
6529
+ ...e.descriptor,
6530
+ value: r
6531
+ }) : o[t] = r;
6532
+ });
6533
+ }), y && delete e.$symbolKeys);
6534
+ },
6535
+ h = (() => {
6536
+ if (!c) throw new Error("Found bad `types`");
6537
+ const t = [];
6538
+ if (Object.entries(c).forEach(([e, r]) => {
6539
+ "#" !== r && [].concat(r).forEach(r => {
6540
+ const [, {
6541
+ plain: n
6542
+ }] = this.revivers[r] ?? [null, {}];
6543
+ n && (t.push({
6544
+ keypath: e,
6545
+ type: r
6546
+ }), delete c[e]);
6547
+ });
6548
+ }), t.length) return t.sort(nestedPathsFirst), t.reduce(function reducer(t, {
6460
6549
  keypath: r,
6461
6550
  type: n
6462
- }));
6463
- let a = getByKeyPath(e, r);
6464
- if (a = executeReviver(n, a), hasConstructorOf(a, TypesonPromise)) return a.then(t => {
6465
- const n = setAtKeyPath(e, r, t);
6466
- n === t && (e = n);
6467
- });
6468
- const o = setAtKeyPath(e, r, a);
6469
- o === a && (e = o);
6470
- }, void 0);
6471
- })();
6472
- let d;
6473
- return hasConstructorOf(f, TypesonPromise) ? d = f.then(() => e) : (d = function _revive(e, t, o, y, f) {
6474
- if (l && "$types" === e) return;
6475
- const d = p.length,
6476
- m = n(i, e) ? i[e] : void 0,
6477
- h = a(t);
6551
+ }) {
6552
+ if (isThenable(t)) return t.then(e => reducer(e, {
6553
+ keypath: r,
6554
+ type: n
6555
+ }));
6556
+ let o = getByKeyPath(e, r);
6557
+ if (o = executeReviver(n, o), hasConstructorOf(o, TypesonPromise)) return o.then(t => {
6558
+ const n = setAtKeyPath(e, r, t);
6559
+ n === t && (e = n);
6560
+ });
6561
+ const a = setAtKeyPath(e, r, o);
6562
+ a === o && (e = a);
6563
+ }, void 0);
6564
+ })();
6565
+ let b;
6566
+ return hasConstructorOf(h, TypesonPromise) ? b = h.then(() => e) : (b = function _revive(e, t, a, s, l) {
6567
+ if (d && "$types" === e) return;
6568
+ const y = m.length,
6569
+ f = n(c, e) ? c[e] : void 0,
6570
+ h = o(t);
6478
6571
  if (h || isPlainObject(t)) {
6479
- const a = h ? new Array(t.length) : {};
6572
+ const o = h ? new Array(t.length) : {};
6480
6573
  for (r(t).forEach(r => {
6481
- const n = _revive(e + (e ? "." : "") + escapeKeyPathComponent(r), t[r], o ?? a, a, r),
6482
- set = e => (hasConstructorOf(e, Undefined) ? setOwnEnumerable(a, r, void 0) : void 0 !== e && setOwnEnumerable(a, r, e), e);
6483
- hasConstructorOf(n, TypesonPromise) ? p.push(n.then(e => set(e))) : set(n);
6484
- }), t = a; c.length;) {
6485
- const [[e, t, r, a]] = c,
6486
- o = n(u, t),
6487
- s = o ? u[t] : getByKeyPath(e, t);
6488
- if (!o && void 0 === s) break;
6489
- setOwnEnumerable(r, a, s), c.shift();
6574
+ const n = _revive(e + (e ? "." : "") + escapeKeyPathComponent(r), t[r], a ?? o, o, r),
6575
+ set = e => (hasConstructorOf(e, Undefined) ? setOwnEnumerable(o, r, void 0) : void 0 !== e && setOwnEnumerable(o, r, e), e);
6576
+ hasConstructorOf(n, TypesonPromise) ? m.push(n.then(e => set(e))) : set(n);
6577
+ }), t = o; u.length;) {
6578
+ const [[e, t, r, o]] = u,
6579
+ a = n(p, t),
6580
+ s = a ? p[t] : getByKeyPath(e, t);
6581
+ if (!a && void 0 === s) break;
6582
+ setOwnEnumerable(r, o, s), u.shift();
6490
6583
  }
6491
6584
  }
6492
- if (!m) return u[e] = t, t;
6493
- if ("#" === m) {
6585
+ if (!f) return p[e] = t, t;
6586
+ if ("#" === f) {
6494
6587
  const e = t.slice(1),
6495
- r = n(u, e),
6496
- a = r ? u[e] : getByKeyPath(o, e);
6497
- return r || void 0 !== a || c.push([o, e, y, f]), a;
6588
+ r = n(p, e),
6589
+ o = r ? p[e] : getByKeyPath(a, e);
6590
+ return r || void 0 !== o || u.push([a, e, s, l]), o;
6498
6591
  }
6499
6592
  const applyType = t => {
6500
- const r = [].concat(m).reduce(function reducer(e, t) {
6593
+ const r = [].concat(f).reduce(function reducer(e, t) {
6501
6594
  if (hasConstructorOf(e, TypesonPromise)) return e.then(e => reducer(e, t));
6502
6595
  if ("string" != typeof t) throw new TypeError("Bad type JSON");
6503
6596
  return executeReviver(t, e);
6504
6597
  }, t);
6505
- return hasConstructorOf(r, TypesonPromise) ? r.then(t => (u[e] = t, t)) : (u[e] = r, r);
6598
+ return hasConstructorOf(r, TypesonPromise) ? r.then(t => (p[e] = t, t)) : (p[e] = r, r);
6506
6599
  };
6507
- return !s && p.length > d ? TypesonPromise.all(p.slice(d)).then(() => applyType(t)) : applyType(t);
6508
- }("", e, null), p.length && (d = TypesonPromise.resolve(d).then(e => TypesonPromise.all([e, ...p])).then(([e]) => e))), isThenable(d) ? s && o.throwOnBadSyncType ? (() => {
6600
+ return !i && m.length > y ? TypesonPromise.all(m.slice(y)).then(() => applyType(t)) : applyType(t);
6601
+ }("", e, null), m.length && (b = TypesonPromise.resolve(b).then(e => TypesonPromise.all([e, ...m])).then(([e]) => e))), l && (isThenable(b) ? b = b.then(e => (reHomeSymbolKeys(e), e)) : reHomeSymbolKeys(b)), isThenable(b) ? i && a.throwOnBadSyncType ? (() => {
6509
6602
  throw new TypeError("Sync method requested but async result obtained");
6510
- })() : hasConstructorOf(d, TypesonPromise) ? d.p.then(checkUndefined) : d : !s && o.throwOnBadSyncType ? (() => {
6603
+ })() : hasConstructorOf(b, TypesonPromise) ? b.p.then(checkUndefined) : b : !i && a.throwOnBadSyncType ? (() => {
6511
6604
  throw new TypeError("Async method requested but sync result obtained");
6512
- })() : s ? checkUndefined(d) : Promise.resolve(checkUndefined(d));
6605
+ })() : i ? checkUndefined(b) : Promise.resolve(checkUndefined(b));
6513
6606
  }
6514
6607
  reviveSync(e, t) {
6515
6608
  return this.revive(e, {
@@ -6528,11 +6621,11 @@ class Typeson {
6528
6621
  register(e, t) {
6529
6622
  const n = t ?? {},
6530
6623
  reg = e => {
6531
- a(e) ? e.forEach(e => {
6624
+ o(e) ? e.forEach(e => {
6532
6625
  reg(e);
6533
6626
  }) : r(e).forEach(t => {
6534
6627
  if ("#" === t) throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");
6535
- if (s.includes(t)) throw new TypeError("Plain JSON object types are reserved as type names");
6628
+ if (i.includes(t)) throw new TypeError("Plain JSON object types are reserved as type names");
6536
6629
  let r = e[t];
6537
6630
  if ([this.plainObjectReplacers, this.nonplainObjectReplacers].forEach(e => {
6538
6631
  const r = e.findIndex(e => e.type === t);
@@ -6546,7 +6639,7 @@ class Typeson {
6546
6639
  }),
6547
6640
  revive: t => Object.assign(Object.create(e.prototype), t)
6548
6641
  };
6549
- } else if (a(r)) {
6642
+ } else if (o(r)) {
6550
6643
  const [e, t, n] = r;
6551
6644
  r = {
6552
6645
  test: e,
@@ -6555,13 +6648,13 @@ class Typeson {
6555
6648
  };
6556
6649
  }
6557
6650
  if (!r?.test) return;
6558
- const o = {
6651
+ const a = {
6559
6652
  type: t,
6560
6653
  test: r.test.bind(r)
6561
6654
  };
6562
- r.replace && (o.replace = r.replace.bind(r)), r.replaceAsync && (o.replaceAsync = r.replaceAsync.bind(r));
6563
- const i = "number" == typeof n.fallback ? n.fallback : n.fallback ? 0 : 1 / 0;
6564
- if (r.testPlainObjects ? this.plainObjectReplacers.splice(i, 0, o) : this.nonplainObjectReplacers.splice(i, 0, o), r.revive || r.reviveAsync) {
6655
+ r.replace && (a.replace = r.replace.bind(r)), r.replaceAsync && (a.replaceAsync = r.replaceAsync.bind(r));
6656
+ const s = "number" == typeof n.fallback ? n.fallback : n.fallback ? 0 : 1 / 0;
6657
+ if (r.testPlainObjects ? this.plainObjectReplacers.splice(s, 0, a) : this.nonplainObjectReplacers.splice(s, 0, a), r.revive || r.reviveAsync) {
6565
6658
  const e = {};
6566
6659
  r.revive && (e.revive = r.revive.bind(r)), r.reviveAsync && (e.reviveAsync = r.reviveAsync.bind(r)), this.revivers[t] = [e, {
6567
6660
  plain: r.testPlainObjects
@@ -6577,27 +6670,27 @@ class Typeson {
6577
6670
  }
6578
6671
  class Undefined {}
6579
6672
  Undefined.__typeson__type__ = "TypesonUndefined";
6580
- const s = ["null", "boolean", "number", "string", "array", "object"];
6581
- for (var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = new Uint8Array(256), u = 0; u < 64; u++) c[i.codePointAt(u)] = u;
6582
- var y = function encode(e, t, r) {
6673
+ const i = ["null", "boolean", "number", "string", "array", "object"];
6674
+ for (var c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = new Uint8Array(256), y = 0; y < 64; y++) l[c.codePointAt(y)] = y;
6675
+ var u = function encode(e, t, r) {
6583
6676
  null == r && (r = e.byteLength);
6584
- for (var n = new Uint8Array(e, 0, r), a = n.length, o = "", s = 0; s < a; s += 3) o += i[n[s] >> 2], o += i[(3 & n[s]) << 4 | n[s + 1] >> 4], o += i[(15 & n[s + 1]) << 2 | n[s + 2] >> 6], o += i[63 & n[s + 2]];
6585
- return a % 3 == 2 ? o = o.slice(0, -1) + "=" : a % 3 == 1 && (o = o.slice(0, -2) + "=="), o;
6677
+ for (var n = new Uint8Array(e, 0, r), o = n.length, a = "", s = 0; s < o; s += 3) a += c[n[s] >> 2], a += c[(3 & n[s]) << 4 | n[s + 1] >> 4], a += c[(15 & n[s + 1]) << 2 | n[s + 2] >> 6], a += c[63 & n[s + 2]];
6678
+ return o % 3 == 2 ? a = a.slice(0, -1) + "=" : o % 3 == 1 && (a = a.slice(0, -2) + "=="), a;
6586
6679
  },
6587
- l = function decode(e, t) {
6680
+ p = function decode(e, t) {
6588
6681
  var r = e.length;
6589
6682
  if (r % 4) throw new Error("Bad base64 length: not divisible by four");
6590
6683
  var n,
6591
- a,
6592
6684
  o,
6685
+ a,
6593
6686
  s,
6594
6687
  i = .75 * e.length,
6595
- u = 0;
6688
+ c = 0;
6596
6689
  "=" === e[e.length - 1] && (i--, "=" === e[e.length - 2] && i--);
6597
- for (var y = new ArrayBuffer(i, t), l = new Uint8Array(y), p = 0; p < r; p += 4) n = c[e.codePointAt(p)], a = c[e.codePointAt(p + 1)], o = c[e.codePointAt(p + 2)], s = c[e.codePointAt(p + 3)], l[u++] = n << 2 | a >> 4, l[u++] = (15 & a) << 4 | o >> 2, l[u++] = (3 & o) << 6 | 63 & s;
6690
+ for (var y = new ArrayBuffer(i, t), u = new Uint8Array(y), p = 0; p < r; p += 4) n = l[e.codePointAt(p)], o = l[e.codePointAt(p + 1)], a = l[e.codePointAt(p + 2)], s = l[e.codePointAt(p + 3)], u[c++] = n << 2 | o >> 4, u[c++] = (15 & o) << 4 | a >> 2, u[c++] = (3 & a) << 6 | 63 & s;
6598
6691
  return y;
6599
6692
  };
6600
- const p = {
6693
+ const f = {
6601
6694
  arraybuffer: {
6602
6695
  test: e => "ArrayBuffer" === toStringTag(e),
6603
6696
  replace(e, t) {
@@ -6606,21 +6699,21 @@ const p = {
6606
6699
  return -1 !== r ? {
6607
6700
  index: r
6608
6701
  } : (t.buffers.push(e), {
6609
- s: y(e),
6702
+ s: u(e),
6610
6703
  maxByteLength: e.maxByteLength,
6611
6704
  resizable: e.resizable
6612
6705
  });
6613
6706
  },
6614
6707
  revive(e, t) {
6615
6708
  if (t.buffers || (t.buffers = []), Object.hasOwn(e, "index")) return t.buffers[e.index];
6616
- const r = l(e.s, e.resizable ? {
6709
+ const r = p(e.s, e.resizable ? {
6617
6710
  maxByteLength: e.maxByteLength
6618
6711
  } : void 0);
6619
6712
  return t.buffers.push(r), r;
6620
6713
  }
6621
6714
  }
6622
6715
  },
6623
- f = {
6716
+ d = {
6624
6717
  audiodata: {
6625
6718
  test: e => "AudioData" === toStringTag(e),
6626
6719
  replace(e) {
@@ -6628,10 +6721,10 @@ const p = {
6628
6721
  format: t,
6629
6722
  sampleRate: r,
6630
6723
  numberOfFrames: n,
6631
- numberOfChannels: a,
6632
- timestamp: o
6724
+ numberOfChannels: o,
6725
+ timestamp: a
6633
6726
  } = e,
6634
- s = t.endsWith("-planar") ? a : 1,
6727
+ s = t.endsWith("-planar") ? o : 1,
6635
6728
  i = [];
6636
6729
  let c = 0;
6637
6730
  for (let t = 0; t < s; t++) {
@@ -6640,10 +6733,10 @@ const p = {
6640
6733
  });
6641
6734
  i.push(r), c += r;
6642
6735
  }
6643
- const u = new ArrayBuffer(c);
6736
+ const l = new ArrayBuffer(c);
6644
6737
  let y = 0;
6645
6738
  for (let t = 0; t < s; t++) {
6646
- const r = new Uint8Array(u, y, i[t]);
6739
+ const r = new Uint8Array(l, y, i[t]);
6647
6740
  e.copyTo(r, {
6648
6741
  planeIndex: t
6649
6742
  }), y += i[t];
@@ -6652,9 +6745,9 @@ const p = {
6652
6745
  format: t,
6653
6746
  sampleRate: r,
6654
6747
  numberOfFrames: n,
6655
- numberOfChannels: a,
6656
- timestamp: o,
6657
- data: u
6748
+ numberOfChannels: o,
6749
+ timestamp: a,
6750
+ data: l
6658
6751
  };
6659
6752
  },
6660
6753
  revive: ({
@@ -6662,26 +6755,26 @@ const p = {
6662
6755
  sampleRate: t,
6663
6756
  numberOfFrames: r,
6664
6757
  numberOfChannels: n,
6665
- timestamp: a,
6666
- data: o
6758
+ timestamp: o,
6759
+ data: a
6667
6760
  }) => new AudioData({
6668
6761
  format: e,
6669
6762
  sampleRate: t,
6670
6763
  numberOfFrames: r,
6671
6764
  numberOfChannels: n,
6672
- timestamp: a,
6673
- data: new Uint8Array(o)
6765
+ timestamp: o,
6766
+ data: new Uint8Array(a)
6674
6767
  })
6675
6768
  }
6676
6769
  },
6677
- d = {
6770
+ m = {
6678
6771
  bigintObject: {
6679
6772
  test: e => "object" == typeof e && hasConstructorOf(e, BigInt),
6680
6773
  replace: String,
6681
6774
  revive: e => new Object(BigInt(e))
6682
6775
  }
6683
6776
  },
6684
- m = {
6777
+ h = {
6685
6778
  bigint: {
6686
6779
  test: e => "bigint" == typeof e,
6687
6780
  replace: String,
@@ -6696,7 +6789,7 @@ function string2arraybuffer(e) {
6696
6789
  for (let r = 0; r < e.length; r++) t[r] = e.charCodeAt(r);
6697
6790
  return t.buffer;
6698
6791
  }
6699
- const h = {
6792
+ const b = {
6700
6793
  blob: {
6701
6794
  test: e => "Blob" === toStringTag(e),
6702
6795
  replace(e) {
@@ -6729,7 +6822,7 @@ const h = {
6729
6822
  })
6730
6823
  }
6731
6824
  };
6732
- const v = {
6825
+ const w = {
6733
6826
  cryptokey: {
6734
6827
  test: e => "CryptoKey" === toStringTag(e) && e.extractable,
6735
6828
  replaceAsync: e => new TypesonPromise(async (t, r) => {
@@ -6755,7 +6848,7 @@ const v = {
6755
6848
  }
6756
6849
  }
6757
6850
  },
6758
- w = {
6851
+ O = {
6759
6852
  dataview: {
6760
6853
  test: e => "DataView" === toStringTag(e),
6761
6854
  replace({
@@ -6764,13 +6857,13 @@ const v = {
6764
6857
  byteLength: r
6765
6858
  }, n) {
6766
6859
  n.buffers || (n.buffers = []);
6767
- const a = n.buffers.indexOf(e);
6768
- return -1 !== a ? {
6769
- index: a,
6860
+ const o = n.buffers.indexOf(e);
6861
+ return -1 !== o ? {
6862
+ index: o,
6770
6863
  byteOffset: t,
6771
6864
  byteLength: r
6772
6865
  } : (n.buffers.push(e), {
6773
- encoded: y(e),
6866
+ encoded: u(e),
6774
6867
  maxByteLength: e.maxByteLength,
6775
6868
  resizable: e.resizable,
6776
6869
  byteOffset: t,
@@ -6782,19 +6875,19 @@ const v = {
6782
6875
  const {
6783
6876
  byteOffset: r,
6784
6877
  byteLength: n,
6785
- encoded: a,
6786
- index: o,
6878
+ encoded: o,
6879
+ index: a,
6787
6880
  maxByteLength: s,
6788
6881
  resizable: i
6789
6882
  } = e;
6790
6883
  let c;
6791
- return "index" in e ? c = t.buffers[o] : (c = l(a, i ? {
6884
+ return "index" in e ? c = t.buffers[a] : (c = p(o, i ? {
6792
6885
  maxByteLength: s
6793
6886
  } : s), t.buffers.push(c)), new DataView(c, r, n);
6794
6887
  }
6795
6888
  }
6796
6889
  },
6797
- O = {
6890
+ A = {
6798
6891
  date: {
6799
6892
  test: e => "Date" === toStringTag(e),
6800
6893
  replace(e) {
@@ -6804,7 +6897,7 @@ const v = {
6804
6897
  revive: e => "NaN" === e ? new Date(NaN) : new Date(e)
6805
6898
  }
6806
6899
  },
6807
- A = {
6900
+ T = {
6808
6901
  domexception: {
6809
6902
  test: e => "DOMException" === toStringTag(e),
6810
6903
  replace: e => ({
@@ -6817,9 +6910,9 @@ const v = {
6817
6910
  }) => new DOMException(e, t)
6818
6911
  }
6819
6912
  },
6820
- T = {};
6913
+ S = {};
6821
6914
  function create$5(e) {
6822
- T[e.name.toLowerCase()] = {
6915
+ S[e.name.toLowerCase()] = {
6823
6916
  test: t => toStringTag(t) === e.name,
6824
6917
  replace: e => e.is2D ? {
6825
6918
  a: e.a,
@@ -6850,9 +6943,9 @@ function create$5(e) {
6850
6943
  };
6851
6944
  }
6852
6945
  "undefined" != typeof DOMMatrix && create$5(DOMMatrix), "undefined" != typeof DOMMatrixReadOnly && create$5(DOMMatrixReadOnly);
6853
- const S = {};
6946
+ const P = {};
6854
6947
  function create$4(e) {
6855
- S[e.name.toLowerCase()] = {
6948
+ P[e.name.toLowerCase()] = {
6856
6949
  test: t => toStringTag(t) === e.name,
6857
6950
  replace: e => ({
6858
6951
  x: e.x,
@@ -6864,12 +6957,12 @@ function create$4(e) {
6864
6957
  x: t,
6865
6958
  y: r,
6866
6959
  z: n,
6867
- w: a
6868
- }) => new e(t, r, n, a)
6960
+ w: o
6961
+ }) => new e(t, r, n, o)
6869
6962
  };
6870
6963
  }
6871
6964
  "undefined" != typeof DOMPoint && create$4(DOMPoint), "undefined" != typeof DOMPointReadOnly && create$4(DOMPointReadOnly);
6872
- const P = {
6965
+ const E = {
6873
6966
  domquad: {
6874
6967
  test: e => "DOMQuad" === toStringTag(e),
6875
6968
  replace: e => ({
@@ -6900,12 +6993,12 @@ function create$3(e) {
6900
6993
  x: t,
6901
6994
  y: r,
6902
6995
  width: n,
6903
- height: a
6904
- }) => new e(t, r, n, a)
6996
+ height: o
6997
+ }) => new e(t, r, n, o)
6905
6998
  };
6906
6999
  }
6907
7000
  "undefined" != typeof DOMRect && create$3(DOMRect), "undefined" != typeof DOMRectReadOnly && create$3(DOMRectReadOnly);
6908
- const E = {
7001
+ const j = {
6909
7002
  encodedaudiochunk: {
6910
7003
  test: e => "EncodedAudioChunk" === toStringTag(e),
6911
7004
  replace(e) {
@@ -6913,30 +7006,32 @@ const E = {
6913
7006
  type: t,
6914
7007
  timestamp: r,
6915
7008
  duration: n,
6916
- byteLength: a
7009
+ byteLength: o
6917
7010
  } = e,
6918
- o = new ArrayBuffer(a);
6919
- return e.copyTo(o), {
7011
+ a = new ArrayBuffer(o);
7012
+ return e.copyTo(a), {
6920
7013
  type: t,
6921
7014
  timestamp: r,
6922
7015
  duration: n,
6923
- data: o
7016
+ data: a
6924
7017
  };
6925
7018
  },
6926
- revive: ({
7019
+ revive({
6927
7020
  type: e,
6928
7021
  timestamp: t,
6929
7022
  duration: r,
6930
7023
  data: n
6931
- }) => new EncodedAudioChunk({
6932
- type: e,
6933
- timestamp: t,
6934
- duration: r,
6935
- data: new Uint8Array(n)
6936
- })
7024
+ }) {
7025
+ const o = {
7026
+ type: e,
7027
+ timestamp: t,
7028
+ data: new Uint8Array(n)
7029
+ };
7030
+ return null != r && (o.duration = r), new EncodedAudioChunk(o);
7031
+ }
6937
7032
  }
6938
7033
  },
6939
- j = {
7034
+ B = {
6940
7035
  encodedvideochunk: {
6941
7036
  test: e => "EncodedVideoChunk" === toStringTag(e),
6942
7037
  replace(e) {
@@ -6944,27 +7039,29 @@ const E = {
6944
7039
  type: t,
6945
7040
  timestamp: r,
6946
7041
  duration: n,
6947
- byteLength: a
7042
+ byteLength: o
6948
7043
  } = e,
6949
- o = new ArrayBuffer(a);
6950
- return e.copyTo(o), {
7044
+ a = new ArrayBuffer(o);
7045
+ return e.copyTo(a), {
6951
7046
  type: t,
6952
7047
  timestamp: r,
6953
7048
  duration: n,
6954
- data: o
7049
+ data: a
6955
7050
  };
6956
7051
  },
6957
- revive: ({
7052
+ revive({
6958
7053
  type: e,
6959
7054
  timestamp: t,
6960
7055
  duration: r,
6961
7056
  data: n
6962
- }) => new EncodedVideoChunk({
6963
- type: e,
6964
- timestamp: t,
6965
- duration: r,
6966
- data: new Uint8Array(n)
6967
- })
7057
+ }) {
7058
+ const o = {
7059
+ type: e,
7060
+ timestamp: t,
7061
+ data: new Uint8Array(n)
7062
+ };
7063
+ return null != r && (o.duration = r), new EncodedVideoChunk(o);
7064
+ }
6968
7065
  }
6969
7066
  },
6970
7067
  N = {
@@ -6975,16 +7072,16 @@ const E = {
6975
7072
  message: t,
6976
7073
  cause: r,
6977
7074
  stack: n,
6978
- fileName: a,
6979
- lineNumber: o,
7075
+ fileName: o,
7076
+ lineNumber: a,
6980
7077
  columnNumber: s
6981
7078
  }) => ({
6982
7079
  name: e,
6983
7080
  message: t,
6984
7081
  cause: r,
6985
7082
  stack: n,
6986
- fileName: a,
6987
- lineNumber: o,
7083
+ fileName: o,
7084
+ lineNumber: a,
6988
7085
  columnNumber: s
6989
7086
  }),
6990
7087
  revive(e) {
@@ -7002,8 +7099,8 @@ function create$2(e) {
7002
7099
  message: t,
7003
7100
  cause: r,
7004
7101
  stack: n,
7005
- fileName: a,
7006
- lineNumber: o,
7102
+ fileName: o,
7103
+ lineNumber: a,
7007
7104
  columnNumber: s,
7008
7105
  errors: i
7009
7106
  }) => ({
@@ -7011,8 +7108,8 @@ function create$2(e) {
7011
7108
  message: t,
7012
7109
  cause: r,
7013
7110
  stack: n,
7014
- fileName: a,
7015
- lineNumber: o,
7111
+ fileName: o,
7112
+ lineNumber: a,
7016
7113
  columnNumber: s,
7017
7114
  errors: i
7018
7115
  }),
@@ -7023,7 +7120,7 @@ function create$2(e) {
7023
7120
  };
7024
7121
  }
7025
7122
  [TypeError, RangeError, SyntaxError, ReferenceError, EvalError, URIError].forEach(e => create$2(e)), "undefined" != typeof AggregateError && create$2(AggregateError), "function" == typeof InternalError && create$2(InternalError);
7026
- const B = {
7123
+ const I = {
7027
7124
  file: {
7028
7125
  test: e => "File" === toStringTag(e),
7029
7126
  replace(e) {
@@ -7060,8 +7157,8 @@ const B = {
7060
7157
  })
7061
7158
  }
7062
7159
  },
7063
- I = {
7064
- file: B.file,
7160
+ U = {
7161
+ file: I.file,
7065
7162
  filelist: {
7066
7163
  test: e => "FileList" === toStringTag(e),
7067
7164
  replace(e) {
@@ -7120,15 +7217,35 @@ const B = {
7120
7217
  }
7121
7218
  }
7122
7219
  },
7123
- U = {
7220
+ k = {
7124
7221
  imagedata: {
7125
7222
  test: e => "ImageData" === toStringTag(e),
7126
- replace: e => ({
7127
- array: [...e.data],
7128
- width: e.width,
7129
- height: e.height
7130
- }),
7131
- revive: e => new ImageData(new Uint8ClampedArray(e.array), e.width, e.height)
7223
+ replace(e) {
7224
+ const t = "Float16Array" === toStringTag(e.data) ? "rgba-float16" : "rgba-unorm8";
7225
+ return {
7226
+ array: [...e.data],
7227
+ width: e.width,
7228
+ height: e.height,
7229
+ pixelFormat: t,
7230
+ colorSpace: e.colorSpace
7231
+ };
7232
+ },
7233
+ revive(e) {
7234
+ const {
7235
+ array: t,
7236
+ width: r,
7237
+ height: n,
7238
+ colorSpace: o,
7239
+ pixelFormat: a
7240
+ } = e;
7241
+ return "rgba-float16" === a ? new ImageData(new Float16Array(t), r, n, {
7242
+ colorSpace: o,
7243
+ pixelFormat: a
7244
+ }) : new ImageData(new Uint8ClampedArray(t), r, n, {
7245
+ colorSpace: o,
7246
+ pixelFormat: a
7247
+ });
7248
+ }
7132
7249
  }
7133
7250
  },
7134
7251
  M = {
@@ -7138,35 +7255,35 @@ const B = {
7138
7255
  revive: () => 1 / 0
7139
7256
  }
7140
7257
  },
7141
- D = {
7258
+ L = {
7142
7259
  map: {
7143
7260
  test: e => "Map" === toStringTag(e),
7144
7261
  replace: e => e.entries().toArray(),
7145
7262
  revive: e => new Map(e)
7146
7263
  }
7147
7264
  },
7148
- R = {
7265
+ F = {
7149
7266
  nan: {
7150
7267
  test: e => Number.isNaN(e),
7151
7268
  replace: () => "NaN",
7152
7269
  revive: () => NaN
7153
7270
  }
7154
7271
  },
7155
- L = {
7272
+ K = {
7156
7273
  negativeInfinity: {
7157
7274
  test: e => e === -1 / 0,
7158
7275
  replace: () => "-Infinity",
7159
7276
  revive: () => -1 / 0
7160
7277
  }
7161
7278
  },
7162
- F = {
7279
+ $ = {
7163
7280
  negativeZero: {
7164
7281
  test: e => Object.is(e, -0),
7165
7282
  replace: () => 0,
7166
7283
  revive: () => -0
7167
7284
  }
7168
7285
  },
7169
- K = {
7286
+ W = {
7170
7287
  StringObject: {
7171
7288
  test: e => "String" === toStringTag(e) && "object" == typeof e,
7172
7289
  replace: String,
@@ -7186,7 +7303,7 @@ const B = {
7186
7303
  revive: e => new Number("NaN" === e ? NaN : "Infinity" === e ? 1 / 0 : "-Infinity" === e ? -1 / 0 : "-0" === e ? -0 : e)
7187
7304
  }
7188
7305
  },
7189
- W = {
7306
+ V = {
7190
7307
  quotaexceedederror: {
7191
7308
  test: e => "QuotaExceededError" === toStringTag(e),
7192
7309
  replace: ({
@@ -7208,7 +7325,7 @@ const B = {
7208
7325
  }
7209
7326
  }
7210
7327
  },
7211
- z = {
7328
+ J = {
7212
7329
  regexp: {
7213
7330
  test: e => "RegExp" === toStringTag(e),
7214
7331
  replace: e => ({
@@ -7221,26 +7338,26 @@ const B = {
7221
7338
  }) => new RegExp(e, t)
7222
7339
  }
7223
7340
  },
7224
- H = {
7341
+ G = {
7225
7342
  set: {
7226
7343
  test: e => "Set" === toStringTag(e),
7227
7344
  replace: e => e.values().toArray(),
7228
7345
  revive: e => new Set(e)
7229
7346
  }
7230
7347
  },
7231
- G = {};
7348
+ Y = {};
7232
7349
  "function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, ...("function" == typeof BigInt64Array ? [BigInt64Array, BigUint64Array] : []), ...("function" == typeof Float16Array ? [Float16Array] : [])].forEach(e => function create$1(e) {
7233
7350
  const t = e.name;
7234
- G[t.toLowerCase()] = {
7351
+ Y[t.toLowerCase()] = {
7235
7352
  test: e => toStringTag(e) === t,
7236
7353
  replace: e => (0 === e.byteOffset && e.byteLength === e.buffer.byteLength ? e : e.slice(0)).buffer,
7237
7354
  revive: t => "ArrayBuffer" === toStringTag(t) ? new e(t) : t
7238
7355
  };
7239
7356
  }(e));
7240
- const X = {};
7357
+ const Z = {};
7241
7358
  "function" == typeof Int8Array && [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, ...("function" == typeof BigInt64Array ? [BigInt64Array, BigUint64Array] : []), ...("function" == typeof Float16Array ? [Float16Array] : [])].forEach(e => function create(e) {
7242
7359
  const t = e.name;
7243
- X[t.toLowerCase()] = {
7360
+ Z[t.toLowerCase()] = {
7244
7361
  test: e => toStringTag(e) === t,
7245
7362
  replace({
7246
7363
  buffer: e,
@@ -7248,15 +7365,15 @@ const X = {};
7248
7365
  length: r
7249
7366
  }, n) {
7250
7367
  n.buffers || (n.buffers = []);
7251
- const a = n.buffers.indexOf(e);
7252
- return -1 !== a ? {
7253
- index: a,
7368
+ const o = n.buffers.indexOf(e);
7369
+ return -1 !== o ? {
7370
+ index: o,
7254
7371
  byteOffset: t,
7255
7372
  length: r
7256
7373
  } : (n.buffers.push(e), {
7257
7374
  maxByteLength: e.maxByteLength,
7258
7375
  resizable: e.resizable,
7259
- encoded: y(e),
7376
+ encoded: u(e),
7260
7377
  byteOffset: t,
7261
7378
  length: r
7262
7379
  });
@@ -7265,27 +7382,27 @@ const X = {};
7265
7382
  r.buffers || (r.buffers = []);
7266
7383
  const {
7267
7384
  byteOffset: n,
7268
- length: a,
7269
- encoded: o,
7385
+ length: o,
7386
+ encoded: a,
7270
7387
  index: s,
7271
7388
  maxByteLength: i,
7272
7389
  resizable: c
7273
7390
  } = t;
7274
- let u;
7275
- return "index" in t ? u = r.buffers[s] : (u = l(o, c ? {
7391
+ let l;
7392
+ return "index" in t ? l = r.buffers[s] : (l = p(a, c ? {
7276
7393
  maxByteLength: i
7277
- } : void 0), r.buffers.push(u)), new e(u, n, a);
7394
+ } : void 0), r.buffers.push(l)), new e(l, n, o);
7278
7395
  }
7279
7396
  };
7280
7397
  }(e));
7281
- const Y = {
7398
+ const ee = {
7282
7399
  undef: {
7283
7400
  test: (e, t) => void 0 === e && (t.ownKeys || !("ownKeys" in t)),
7284
7401
  replace: () => 0,
7285
7402
  revive: () => new Undefined()
7286
7403
  }
7287
7404
  },
7288
- Z = {
7405
+ te = {
7289
7406
  userObject: {
7290
7407
  test: e => isUserObject(e),
7291
7408
  replace: e => ({
@@ -7294,7 +7411,7 @@ const Y = {
7294
7411
  revive: e => e
7295
7412
  }
7296
7413
  },
7297
- ee = {
7414
+ re = {
7298
7415
  videoframe: {
7299
7416
  test: e => "VideoFrame" === toStringTag(e),
7300
7417
  replaceAsync: e => new TypesonPromise(async (t, r) => {
@@ -7302,20 +7419,20 @@ const Y = {
7302
7419
  const {
7303
7420
  format: r,
7304
7421
  codedWidth: n,
7305
- codedHeight: a,
7306
- timestamp: o,
7422
+ codedHeight: o,
7423
+ timestamp: a,
7307
7424
  duration: s,
7308
7425
  visibleRect: i,
7309
7426
  displayWidth: c,
7310
- displayHeight: u,
7427
+ displayHeight: l,
7311
7428
  colorSpace: y
7312
7429
  } = e,
7313
- l = new ArrayBuffer(e.allocationSize());
7314
- await e.copyTo(l), t({
7430
+ u = new ArrayBuffer(e.allocationSize());
7431
+ await e.copyTo(u), t({
7315
7432
  format: r,
7316
7433
  codedWidth: n,
7317
- codedHeight: a,
7318
- timestamp: o,
7434
+ codedHeight: o,
7435
+ timestamp: a,
7319
7436
  duration: s,
7320
7437
  visibleRect: {
7321
7438
  x: i.x,
@@ -7324,44 +7441,46 @@ const Y = {
7324
7441
  height: i.height
7325
7442
  },
7326
7443
  displayWidth: c,
7327
- displayHeight: u,
7444
+ displayHeight: l,
7328
7445
  colorSpace: {
7329
7446
  primaries: y.primaries,
7330
7447
  transfer: y.transfer,
7331
7448
  matrix: y.matrix,
7332
7449
  fullRange: y.fullRange
7333
7450
  },
7334
- data: l
7451
+ data: u
7335
7452
  });
7336
7453
  } catch (e) {
7337
7454
  r(e);
7338
7455
  }
7339
7456
  }),
7340
- revive: ({
7457
+ revive({
7341
7458
  format: e,
7342
7459
  codedWidth: t,
7343
7460
  codedHeight: r,
7344
7461
  timestamp: n,
7345
- duration: a,
7346
- visibleRect: o,
7462
+ duration: o,
7463
+ visibleRect: a,
7347
7464
  displayWidth: s,
7348
7465
  displayHeight: i,
7349
7466
  colorSpace: c,
7350
- data: u
7351
- }) => new VideoFrame(new Uint8Array(u), {
7352
- format: e,
7353
- codedWidth: t,
7354
- codedHeight: r,
7355
- timestamp: n,
7356
- duration: a,
7357
- visibleRect: o,
7358
- displayWidth: s,
7359
- displayHeight: i,
7360
- colorSpace: c
7361
- })
7467
+ data: l
7468
+ }) {
7469
+ const y = {
7470
+ format: e,
7471
+ codedWidth: t,
7472
+ codedHeight: r,
7473
+ timestamp: n,
7474
+ visibleRect: a,
7475
+ displayWidth: s,
7476
+ displayHeight: i,
7477
+ colorSpace: c
7478
+ };
7479
+ return null != o && (y.duration = o), new VideoFrame(new Uint8Array(l), y);
7480
+ }
7362
7481
  }
7363
7482
  },
7364
- te = {
7483
+ ne = {
7365
7484
  webtransporterror: {
7366
7485
  test: e => "WebTransportError" === toStringTag(e),
7367
7486
  replace: ({
@@ -7380,7 +7499,7 @@ const Y = {
7380
7499
  })
7381
7500
  }
7382
7501
  },
7383
- re = [{
7502
+ oe = [{
7384
7503
  arrayNonindexKeys: {
7385
7504
  testPlainObjects: true,
7386
7505
  test: (e, t) => !!Array.isArray(e) && (Object.keys(e).some(e => String(Number(e)) !== e) && (t.iterateIn = "object", t.addLength = true), true),
@@ -7400,9 +7519,9 @@ const Y = {
7400
7519
  revive() {}
7401
7520
  }
7402
7521
  }],
7403
- ne = [R, M, L, F],
7404
- ce = [Z, Y, re, K, ne, O, z, U, _, B, I, h, N, C].concat("function" == typeof Map ? D : [], "function" == typeof Set ? H : [], "function" == typeof ArrayBuffer ? p : [], "function" == typeof Uint8Array ? X : [], "function" == typeof DataView ? w : [], "undefined" != typeof crypto ? v : [], "undefined" != typeof BigInt ? [m, d] : [], "undefined" != typeof DOMException ? A : [], "undefined" != typeof QuotaExceededError ? W : [], "undefined" != typeof WebTransportError ? te : [], "undefined" != typeof DOMRect ? x : [], "undefined" != typeof DOMPoint ? S : [], "undefined" != typeof DOMQuad ? P : [], "undefined" != typeof DOMMatrix ? T : [], "undefined" != typeof AudioData ? f : [], "undefined" != typeof EncodedAudioChunk ? E : [], "undefined" != typeof EncodedVideoChunk ? j : [], "undefined" != typeof VideoFrame ? ee : []);
7405
- const ue = ce.concat({
7522
+ ae = [F, M, K, $],
7523
+ ye = [te, ee, oe, W, ae, A, J, k, _, I, U, b, N, C].concat("function" == typeof Map ? L : [], "function" == typeof Set ? G : [], "function" == typeof ArrayBuffer ? f : [], "function" == typeof Uint8Array ? Z : [], "function" == typeof DataView ? O : [], "undefined" != typeof crypto ? w : [], "undefined" != typeof BigInt ? [h, m] : [], "undefined" != typeof DOMException ? T : [], "undefined" != typeof QuotaExceededError ? V : [], "undefined" != typeof WebTransportError ? ne : [], "undefined" != typeof DOMRect ? x : [], "undefined" != typeof DOMPoint ? P : [], "undefined" != typeof DOMQuad ? E : [], "undefined" != typeof DOMMatrix ? S : [], "undefined" != typeof AudioData ? d : [], "undefined" != typeof EncodedAudioChunk ? j : [], "undefined" != typeof EncodedVideoChunk ? B : [], "undefined" != typeof VideoFrame ? re : []);
7524
+ const ue = ye.concat({
7406
7525
  checkDataCloneException: {
7407
7526
  test(e) {
7408
7527
  const t = {}.toString.call(e).slice(8, -1);
@@ -7419,7 +7538,7 @@ const ue = ce.concat({
7419
7538
  }
7420
7539
  }
7421
7540
  }),
7422
- ye = ue.concat({
7541
+ pe = ue.concat({
7423
7542
  checkSharedArrayBufferException: {
7424
7543
  test(e) {
7425
7544
  if ("SharedArrayBuffer" === {}.toString.call(e).slice(8, -1)) throw new DOMException("The object cannot be cloned.", "DataCloneError");
@@ -7433,7 +7552,7 @@ const ue = ce.concat({
7433
7552
  // Although typeson-registry already has a FileList type in its structured cloning presets,
7434
7553
  // we need to override it so it works with our tests
7435
7554
 
7436
- const specSet = ye.flatMap(preset => Array.isArray(preset) ? preset : [preset]).find(preset => preset && !Array.isArray(preset) && 'filelist' in preset);
7555
+ const specSet = pe.flatMap(preset => Array.isArray(preset) ? preset : [preset]).find(preset => preset && !Array.isArray(preset) && 'filelist' in preset);
7437
7556
  const origFileList = specSet && !Array.isArray(specSet) && 'filelist' in specSet ? specSet.filelist : undefined;
7438
7557
  const origTest = origFileList && typeof origFileList === 'object' && 'test' in origFileList && typeof origFileList.test === 'function' ? origFileList.test : undefined;
7439
7558
  const origRevive = origFileList && typeof origFileList === 'object' && 'revive' in origFileList && typeof origFileList.revive === 'function' ? origFileList.revive : undefined;
@@ -7462,7 +7581,7 @@ const customFileList = origFileList ? {
7462
7581
  return typeof origRevive === 'function' ? origRevive(x, state) : undefined;
7463
7582
  }
7464
7583
  } : undefined;
7465
- let typeson = new Typeson().register([ye, customFileList ? {
7584
+ let typeson = new Typeson().register([pe, customFileList ? {
7466
7585
  filelist: customFileList
7467
7586
  } : {}]);
7468
7587
 
@@ -7473,7 +7592,7 @@ let typeson = new Typeson().register([ye, customFileList ? {
7473
7592
  */
7474
7593
  function register(func) {
7475
7594
  // eslint-disable-next-line unicorn/no-top-level-assignment-in-function -- Should be one-time cache
7476
- typeson = new Typeson().register(func(ye));
7595
+ typeson = new Typeson().register(func(pe));
7477
7596
  }
7478
7597
 
7479
7598
  /**