@ridp/threejs 1.0.1 → 1.1.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.
@@ -2,10 +2,10 @@ import * as bt from "three";
2
2
  import { TrianglesDrawMode as Ei, TriangleFanDrawMode as kr, TriangleStripDrawMode as Ds, Loader as Ns, FileLoader as Dn, SRGBColorSpace as at, LinearSRGBColorSpace as qe, BufferGeometry as Fs, BufferAttribute as en, Color as Qe, ColorManagement as Or, LoaderUtils as tn, MeshPhysicalMaterial as Ge, Vector2 as Nr, SpotLight as Si, PointLight as Ri, DirectionalLight as ki, Matrix4 as Nt, Vector3 as le, Quaternion as js, InstancedMesh as Oi, InstancedBufferAttribute as Mi, Object3D as Ks, TextureLoader as Pi, ImageBitmapLoader as Ci, InterleavedBuffer as Ii, InterleavedBufferAttribute as Li, LinearMipmapLinearFilter as Bs, NearestMipmapLinearFilter as Di, LinearMipmapNearestFilter as Ni, NearestMipmapNearestFilter as Fi, LinearFilter as Mr, NearestFilter as Us, RepeatWrapping as Pr, MirroredRepeatWrapping as ji, ClampToEdgeWrapping as Ki, PointsMaterial as Bi, Material as _r, LineBasicMaterial as Ui, MeshStandardMaterial as qs, DoubleSide as qi, MeshBasicMaterial as Zt, PropertyBinding as Gi, SkinnedMesh as Hi, Mesh as zi, LineSegments as Vi, Line as Xi, LineLoop as Wi, Points as Yi, Group as Ar, PerspectiveCamera as Gs, MathUtils as Lt, OrthographicCamera as Qi, Skeleton as $i, AnimationClip as Ji, Bone as Zi, InterpolateDiscrete as eo, InterpolateLinear as Hs, Texture as vs, VectorKeyframeTrack as bs, NumberKeyframeTrack as ws, QuaternionKeyframeTrack as _s, FrontSide as to, Interpolant as no, Box3 as Fn, Sphere as ro, Matrix3 as zs, Ray as so, WebGLRenderer as io, Scene as oo, Raycaster as ao } from "three";
3
3
  import { ref as xr, shallowRef as uo, onMounted as co, onUnmounted as lo, nextTick as As } from "vue";
4
4
  import { d as fo, j as ho, S as po, l as mo } from "./ImageLoader-CB_URfeZ.js";
5
- function xs(C, s) {
6
- if (s === Ei)
5
+ function xs(C, r) {
6
+ if (r === Ei)
7
7
  return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), C;
8
- if (s === kr || s === Ds) {
8
+ if (r === kr || r === Ds) {
9
9
  let i = C.getIndex();
10
10
  if (i === null) {
11
11
  const l = [], p = C.getAttribute("position");
@@ -17,7 +17,7 @@ function xs(C, s) {
17
17
  return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), C;
18
18
  }
19
19
  const a = i.count - 2, u = [];
20
- if (s === kr)
20
+ if (r === kr)
21
21
  for (let l = 1; l <= a; l++)
22
22
  u.push(i.getX(0)), u.push(i.getX(l)), u.push(i.getX(l + 1));
23
23
  else
@@ -27,7 +27,7 @@ function xs(C, s) {
27
27
  const c = C.clone();
28
28
  return c.setIndex(u), c.clearGroups(), c;
29
29
  } else
30
- return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", s), C;
30
+ return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", r), C;
31
31
  }
32
32
  const Tr = /* @__PURE__ */ new WeakMap();
33
33
  class yo extends Ns {
@@ -36,8 +36,8 @@ class yo extends Ns {
36
36
  *
37
37
  * @param {LoadingManager} [manager] - The loading manager.
38
38
  */
39
- constructor(s) {
40
- super(s), this.decoderPath = "", this.decoderConfig = {}, this.decoderBinary = null, this.decoderPending = null, this.workerLimit = 4, this.workerPool = [], this.workerNextTaskID = 1, this.workerSourceURL = "", this.defaultAttributeIDs = {
39
+ constructor(r) {
40
+ super(r), this.decoderPath = "", this.decoderConfig = {}, this.decoderBinary = null, this.decoderPending = null, this.workerLimit = 4, this.workerPool = [], this.workerNextTaskID = 1, this.workerSourceURL = "", this.defaultAttributeIDs = {
41
41
  position: "POSITION",
42
42
  normal: "NORMAL",
43
43
  color: "COLOR",
@@ -55,8 +55,8 @@ class yo extends Ns {
55
55
  * @param {string} path - The decoder path.
56
56
  * @return {DRACOLoader} A reference to this loader.
57
57
  */
58
- setDecoderPath(s) {
59
- return this.decoderPath = s, this;
58
+ setDecoderPath(r) {
59
+ return this.decoderPath = r, this;
60
60
  }
61
61
  /**
62
62
  * Provides configuration for the decoder libraries. Configuration cannot be changed after decoding begins.
@@ -64,8 +64,8 @@ class yo extends Ns {
64
64
  * @param {{type:('js'|'wasm')}} config - The decoder config.
65
65
  * @return {DRACOLoader} A reference to this loader.
66
66
  */
67
- setDecoderConfig(s) {
68
- return this.decoderConfig = s, this;
67
+ setDecoderConfig(r) {
68
+ return this.decoderConfig = r, this;
69
69
  }
70
70
  /**
71
71
  * Sets the maximum number of Web Workers to be used during decoding.
@@ -74,8 +74,8 @@ class yo extends Ns {
74
74
  * @param {number} workerLimit - The worker limit.
75
75
  * @return {DRACOLoader} A reference to this loader.
76
76
  */
77
- setWorkerLimit(s) {
78
- return this.workerLimit = s, this;
77
+ setWorkerLimit(r) {
78
+ return this.workerLimit = r, this;
79
79
  }
80
80
  /**
81
81
  * Starts loading from the given URL and passes the loaded Draco asset
@@ -86,9 +86,9 @@ class yo extends Ns {
86
86
  * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
87
87
  * @param {onErrorCallback} onError - Executed when errors occur.
88
88
  */
89
- load(s, i, a, u) {
89
+ load(r, i, a, u) {
90
90
  const c = new Dn(this.manager);
91
- c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(s, (l) => {
91
+ c.setPath(this.path), c.setResponseType("arraybuffer"), c.setRequestHeader(this.requestHeader), c.setWithCredentials(this.withCredentials), c.load(r, (l) => {
92
92
  this.parse(l, i, u);
93
93
  }, a, u);
94
94
  }
@@ -99,12 +99,12 @@ class yo extends Ns {
99
99
  * @param {function(BufferGeometry)} onLoad - Executed when the loading/parsing process has been finished.
100
100
  * @param {onErrorCallback} onError - Executed when errors occur.
101
101
  */
102
- parse(s, i, a = () => {
102
+ parse(r, i, a = () => {
103
103
  }) {
104
- this.decodeDracoFile(s, i, null, null, at, a).catch(a);
104
+ this.decodeDracoFile(r, i, null, null, at, a).catch(a);
105
105
  }
106
106
  //
107
- decodeDracoFile(s, i, a, u, c = qe, l = () => {
107
+ decodeDracoFile(r, i, a, u, c = qe, l = () => {
108
108
  }) {
109
109
  const p = {
110
110
  attributeIDs: a || this.defaultAttributeIDs,
@@ -112,49 +112,49 @@ class yo extends Ns {
112
112
  useUniqueIDs: !!a,
113
113
  vertexColorSpace: c
114
114
  };
115
- return this.decodeGeometry(s, p).then(i).catch(l);
115
+ return this.decodeGeometry(r, p).then(i).catch(l);
116
116
  }
117
- decodeGeometry(s, i) {
117
+ decodeGeometry(r, i) {
118
118
  const a = JSON.stringify(i);
119
- if (Tr.has(s)) {
120
- const h = Tr.get(s);
119
+ if (Tr.has(r)) {
120
+ const h = Tr.get(r);
121
121
  if (h.key === a)
122
122
  return h.promise;
123
- if (s.byteLength === 0)
123
+ if (r.byteLength === 0)
124
124
  throw new Error(
125
125
  "THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred."
126
126
  );
127
127
  }
128
128
  let u;
129
- const c = this.workerNextTaskID++, l = s.byteLength, p = this._getWorker(c, l).then((h) => (u = h, new Promise((y, E) => {
130
- u._callbacks[c] = { resolve: y, reject: E }, u.postMessage({ type: "decode", id: c, taskConfig: i, buffer: s }, [s]);
129
+ const c = this.workerNextTaskID++, l = r.byteLength, p = this._getWorker(c, l).then((h) => (u = h, new Promise((y, E) => {
130
+ u._callbacks[c] = { resolve: y, reject: E }, u.postMessage({ type: "decode", id: c, taskConfig: i, buffer: r }, [r]);
131
131
  }))).then((h) => this._createGeometry(h.geometry));
132
132
  return p.catch(() => !0).then(() => {
133
133
  u && c && this._releaseTask(u, c);
134
- }), Tr.set(s, {
134
+ }), Tr.set(r, {
135
135
  key: a,
136
136
  promise: p
137
137
  }), p;
138
138
  }
139
- _createGeometry(s) {
139
+ _createGeometry(r) {
140
140
  const i = new Fs();
141
- s.index && i.setIndex(new en(s.index.array, 1));
142
- for (let a = 0; a < s.attributes.length; a++) {
143
- const u = s.attributes[a], c = u.name, l = u.array, p = u.itemSize, h = new en(l, p);
141
+ r.index && i.setIndex(new en(r.index.array, 1));
142
+ for (let a = 0; a < r.attributes.length; a++) {
143
+ const u = r.attributes[a], c = u.name, l = u.array, p = u.itemSize, h = new en(l, p);
144
144
  c === "color" && (this._assignVertexColorSpace(h, u.vertexColorSpace), h.normalized = !(l instanceof Float32Array)), i.setAttribute(c, h);
145
145
  }
146
146
  return i;
147
147
  }
148
- _assignVertexColorSpace(s, i) {
148
+ _assignVertexColorSpace(r, i) {
149
149
  if (i !== at) return;
150
150
  const a = new Qe();
151
- for (let u = 0, c = s.count; u < c; u++)
152
- a.fromBufferAttribute(s, u), Or.toWorkingColorSpace(a, at), s.setXYZ(u, a.r, a.g, a.b);
151
+ for (let u = 0, c = r.count; u < c; u++)
152
+ a.fromBufferAttribute(r, u), Or.toWorkingColorSpace(a, at), r.setXYZ(u, a.r, a.g, a.b);
153
153
  }
154
- _loadLibrary(s, i) {
154
+ _loadLibrary(r, i) {
155
155
  const a = new Dn(this.manager);
156
156
  return a.setPath(this.decoderPath), a.setResponseType(i), a.setWithCredentials(this.withCredentials), new Promise((u, c) => {
157
- a.load(s, u, void 0, c);
157
+ a.load(r, u, void 0, c);
158
158
  });
159
159
  }
160
160
  preload() {
@@ -162,10 +162,10 @@ class yo extends Ns {
162
162
  }
163
163
  _initDecoder() {
164
164
  if (this.decoderPending) return this.decoderPending;
165
- const s = typeof WebAssembly != "object" || this.decoderConfig.type === "js", i = [];
166
- return s ? i.push(this._loadLibrary("draco_decoder.js", "text")) : (i.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), i.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(i).then((a) => {
165
+ const r = typeof WebAssembly != "object" || this.decoderConfig.type === "js", i = [];
166
+ return r ? i.push(this._loadLibrary("draco_decoder.js", "text")) : (i.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), i.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(i).then((a) => {
167
167
  const u = a[0];
168
- s || (this.decoderConfig.wasmBinary = a[1]);
168
+ r || (this.decoderConfig.wasmBinary = a[1]);
169
169
  const c = go.toString(), l = [
170
170
  "/* draco decoder */",
171
171
  u,
@@ -177,7 +177,7 @@ class yo extends Ns {
177
177
  this.workerSourceURL = URL.createObjectURL(new Blob([l]));
178
178
  }), this.decoderPending;
179
179
  }
180
- _getWorker(s, i) {
180
+ _getWorker(r, i) {
181
181
  return this._initDecoder().then(() => {
182
182
  if (this.workerPool.length < this.workerLimit) {
183
183
  const u = new Worker(this.workerSourceURL);
@@ -199,28 +199,28 @@ class yo extends Ns {
199
199
  return u._taskLoad > c._taskLoad ? -1 : 1;
200
200
  });
201
201
  const a = this.workerPool[this.workerPool.length - 1];
202
- return a._taskCosts[s] = i, a._taskLoad += i, a;
202
+ return a._taskCosts[r] = i, a._taskLoad += i, a;
203
203
  });
204
204
  }
205
- _releaseTask(s, i) {
206
- s._taskLoad -= s._taskCosts[i], delete s._callbacks[i], delete s._taskCosts[i];
205
+ _releaseTask(r, i) {
206
+ r._taskLoad -= r._taskCosts[i], delete r._callbacks[i], delete r._taskCosts[i];
207
207
  }
208
208
  debug() {
209
- console.log("Task load: ", this.workerPool.map((s) => s._taskLoad));
209
+ console.log("Task load: ", this.workerPool.map((r) => r._taskLoad));
210
210
  }
211
211
  dispose() {
212
- for (let s = 0; s < this.workerPool.length; ++s)
213
- this.workerPool[s].terminate();
212
+ for (let r = 0; r < this.workerPool.length; ++r)
213
+ this.workerPool[r].terminate();
214
214
  return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
215
215
  }
216
216
  }
217
217
  function go() {
218
- let C, s;
218
+ let C, r;
219
219
  onmessage = function(l) {
220
220
  const p = l.data;
221
221
  switch (p.type) {
222
222
  case "init":
223
- C = p.decoderConfig, s = new Promise(function(E) {
223
+ C = p.decoderConfig, r = new Promise(function(E) {
224
224
  C.onModuleLoaded = function(_) {
225
225
  E({ draco: _ });
226
226
  }, DracoDecoderModule(C);
@@ -228,7 +228,7 @@ function go() {
228
228
  break;
229
229
  case "decode":
230
230
  const h = p.buffer, y = p.taskConfig;
231
- s.then((E) => {
231
+ r.then((E) => {
232
232
  const _ = E.draco, P = new _.Decoder();
233
233
  try {
234
234
  const L = i(_, P, new Int8Array(h), y), q = L.attributes.map((X) => X.array.buffer);
@@ -310,8 +310,8 @@ class vo extends Ns {
310
310
  *
311
311
  * @param {LoadingManager} [manager] - The loading manager.
312
312
  */
313
- constructor(s) {
314
- super(s), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(i) {
313
+ constructor(r) {
314
+ super(r), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(i) {
315
315
  return new xo(i);
316
316
  }), this.register(function(i) {
317
317
  return new To(i);
@@ -356,24 +356,24 @@ class vo extends Ns {
356
356
  * @param {onProgressCallback} onProgress - Executed while the loading is in progress.
357
357
  * @param {onErrorCallback} onError - Executed when errors occur.
358
358
  */
359
- load(s, i, a, u) {
359
+ load(r, i, a, u) {
360
360
  const c = this;
361
361
  let l;
362
362
  if (this.resourcePath !== "")
363
363
  l = this.resourcePath;
364
364
  else if (this.path !== "") {
365
- const y = tn.extractUrlBase(s);
365
+ const y = tn.extractUrlBase(r);
366
366
  l = tn.resolveURL(y, this.path);
367
367
  } else
368
- l = tn.extractUrlBase(s);
369
- this.manager.itemStart(s);
368
+ l = tn.extractUrlBase(r);
369
+ this.manager.itemStart(r);
370
370
  const p = function(y) {
371
- u ? u(y) : console.error(y), c.manager.itemError(s), c.manager.itemEnd(s);
371
+ u ? u(y) : console.error(y), c.manager.itemError(r), c.manager.itemEnd(r);
372
372
  }, h = new Dn(this.manager);
373
- h.setPath(this.path), h.setResponseType("arraybuffer"), h.setRequestHeader(this.requestHeader), h.setWithCredentials(this.withCredentials), h.load(s, function(y) {
373
+ h.setPath(this.path), h.setResponseType("arraybuffer"), h.setRequestHeader(this.requestHeader), h.setWithCredentials(this.withCredentials), h.load(r, function(y) {
374
374
  try {
375
375
  c.parse(y, l, function(E) {
376
- i(E), c.manager.itemEnd(s);
376
+ i(E), c.manager.itemEnd(r);
377
377
  }, p);
378
378
  } catch (E) {
379
379
  p(E);
@@ -387,8 +387,8 @@ class vo extends Ns {
387
387
  * @param {DRACOLoader} dracoLoader - The Draco loader to set.
388
388
  * @return {GLTFLoader} A reference to this loader.
389
389
  */
390
- setDRACOLoader(s) {
391
- return this.dracoLoader = s, this;
390
+ setDRACOLoader(r) {
391
+ return this.dracoLoader = r, this;
392
392
  }
393
393
  /**
394
394
  * Sets the given KTX2 loader to this loader. Required for loading KTX2
@@ -397,8 +397,8 @@ class vo extends Ns {
397
397
  * @param {KTX2Loader} ktx2Loader - The KTX2 loader to set.
398
398
  * @return {GLTFLoader} A reference to this loader.
399
399
  */
400
- setKTX2Loader(s) {
401
- return this.ktx2Loader = s, this;
400
+ setKTX2Loader(r) {
401
+ return this.ktx2Loader = r, this;
402
402
  }
403
403
  /**
404
404
  * Sets the given meshopt decoder. Required for decoding assets
@@ -407,8 +407,8 @@ class vo extends Ns {
407
407
  * @param {Object} meshoptDecoder - The meshopt decoder to set.
408
408
  * @return {GLTFLoader} A reference to this loader.
409
409
  */
410
- setMeshoptDecoder(s) {
411
- return this.meshoptDecoder = s, this;
410
+ setMeshoptDecoder(r) {
411
+ return this.meshoptDecoder = r, this;
412
412
  }
413
413
  /**
414
414
  * Registers a plugin callback. This API is internally used to implement the various
@@ -418,8 +418,8 @@ class vo extends Ns {
418
418
  * @param {function(parser:GLTFParser)} callback - The callback function to register.
419
419
  * @return {GLTFLoader} A reference to this loader.
420
420
  */
421
- register(s) {
422
- return this.pluginCallbacks.indexOf(s) === -1 && this.pluginCallbacks.push(s), this;
421
+ register(r) {
422
+ return this.pluginCallbacks.indexOf(r) === -1 && this.pluginCallbacks.push(r), this;
423
423
  }
424
424
  /**
425
425
  * Unregisters a plugin callback.
@@ -427,8 +427,8 @@ class vo extends Ns {
427
427
  * @param {Function} callback - The callback function to unregister.
428
428
  * @return {GLTFLoader} A reference to this loader.
429
429
  */
430
- unregister(s) {
431
- return this.pluginCallbacks.indexOf(s) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(s), 1), this;
430
+ unregister(r) {
431
+ return this.pluginCallbacks.indexOf(r) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(r), 1), this;
432
432
  }
433
433
  /**
434
434
  * Parses the given FBX data and returns the resulting group.
@@ -438,24 +438,24 @@ class vo extends Ns {
438
438
  * @param {function(GLTFLoader~LoadObject)} onLoad - Executed when the loading process has been finished.
439
439
  * @param {onErrorCallback} onError - Executed when errors occur.
440
440
  */
441
- parse(s, i, a, u) {
441
+ parse(r, i, a, u) {
442
442
  let c;
443
443
  const l = {}, p = {}, h = new TextDecoder();
444
- if (typeof s == "string")
445
- c = JSON.parse(s);
446
- else if (s instanceof ArrayBuffer)
447
- if (h.decode(new Uint8Array(s, 0, 4)) === Vs) {
444
+ if (typeof r == "string")
445
+ c = JSON.parse(r);
446
+ else if (r instanceof ArrayBuffer)
447
+ if (h.decode(new Uint8Array(r, 0, 4)) === Vs) {
448
448
  try {
449
- l[ne.KHR_BINARY_GLTF] = new jo(s);
449
+ l[ne.KHR_BINARY_GLTF] = new jo(r);
450
450
  } catch (_) {
451
451
  u && u(_);
452
452
  return;
453
453
  }
454
454
  c = JSON.parse(l[ne.KHR_BINARY_GLTF].content);
455
455
  } else
456
- c = JSON.parse(h.decode(s));
456
+ c = JSON.parse(h.decode(r));
457
457
  else
458
- c = s;
458
+ c = r;
459
459
  if (c.asset === void 0 || c.asset.version[0] < 2) {
460
460
  u && u(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
461
461
  return;
@@ -503,24 +503,24 @@ class vo extends Ns {
503
503
  * @param {string} path - The URL base path.
504
504
  * @return {Promise<GLTFLoader~LoadObject>} A Promise that resolves with the loaded glTF when the parsing has been finished.
505
505
  */
506
- parseAsync(s, i) {
506
+ parseAsync(r, i) {
507
507
  const a = this;
508
508
  return new Promise(function(u, c) {
509
- a.parse(s, i, u, c);
509
+ a.parse(r, i, u, c);
510
510
  });
511
511
  }
512
512
  }
513
513
  function bo() {
514
514
  let C = {};
515
515
  return {
516
- get: function(s) {
517
- return C[s];
516
+ get: function(r) {
517
+ return C[r];
518
518
  },
519
- add: function(s, i) {
520
- C[s] = i;
519
+ add: function(r, i) {
520
+ C[r] = i;
521
521
  },
522
- remove: function(s) {
523
- delete C[s];
522
+ remove: function(r) {
523
+ delete C[r];
524
524
  },
525
525
  removeAll: function() {
526
526
  C = {};
@@ -552,21 +552,21 @@ const ne = {
552
552
  EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
553
553
  };
554
554
  class wo {
555
- constructor(s) {
556
- this.parser = s, this.name = ne.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
555
+ constructor(r) {
556
+ this.parser = r, this.name = ne.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
557
557
  }
558
558
  _markDefs() {
559
- const s = this.parser, i = this.parser.json.nodes || [];
559
+ const r = this.parser, i = this.parser.json.nodes || [];
560
560
  for (let a = 0, u = i.length; a < u; a++) {
561
561
  const c = i[a];
562
- c.extensions && c.extensions[this.name] && c.extensions[this.name].light !== void 0 && s._addNodeRef(this.cache, c.extensions[this.name].light);
562
+ c.extensions && c.extensions[this.name] && c.extensions[this.name].light !== void 0 && r._addNodeRef(this.cache, c.extensions[this.name].light);
563
563
  }
564
564
  }
565
- _loadLight(s) {
566
- const i = this.parser, a = "light:" + s;
565
+ _loadLight(r) {
566
+ const i = this.parser, a = "light:" + r;
567
567
  let u = i.cache.get(a);
568
568
  if (u) return u;
569
- const c = i.json, h = ((c.extensions && c.extensions[this.name] || {}).lights || [])[s];
569
+ const c = i.json, h = ((c.extensions && c.extensions[this.name] || {}).lights || [])[r];
570
570
  let y;
571
571
  const E = new Qe(16777215);
572
572
  h.color !== void 0 && E.setRGB(h.color[0], h.color[1], h.color[2], qe);
@@ -584,14 +584,14 @@ class wo {
584
584
  default:
585
585
  throw new Error("THREE.GLTFLoader: Unexpected light type: " + h.type);
586
586
  }
587
- return y.position.set(0, 0, 0), Ye(y, h), h.intensity !== void 0 && (y.intensity = h.intensity), y.name = i.createUniqueName(h.name || "light_" + s), u = Promise.resolve(y), i.cache.add(a, u), u;
587
+ return y.position.set(0, 0, 0), Ye(y, h), h.intensity !== void 0 && (y.intensity = h.intensity), y.name = i.createUniqueName(h.name || "light_" + r), u = Promise.resolve(y), i.cache.add(a, u), u;
588
588
  }
589
- getDependency(s, i) {
590
- if (s === "light")
589
+ getDependency(r, i) {
590
+ if (r === "light")
591
591
  return this._loadLight(i);
592
592
  }
593
- createNodeAttachment(s) {
594
- const i = this, a = this.parser, c = a.json.nodes[s], p = (c.extensions && c.extensions[this.name] || {}).light;
593
+ createNodeAttachment(r) {
594
+ const i = this, a = this.parser, c = a.json.nodes[r], p = (c.extensions && c.extensions[this.name] || {}).light;
595
595
  return p === void 0 ? null : this._loadLight(p).then(function(h) {
596
596
  return a._getNodeRef(i.cache, p, h);
597
597
  });
@@ -604,26 +604,26 @@ class _o {
604
604
  getMaterialType() {
605
605
  return Zt;
606
606
  }
607
- extendParams(s, i, a) {
607
+ extendParams(r, i, a) {
608
608
  const u = [];
609
- s.color = new Qe(1, 1, 1), s.opacity = 1;
609
+ r.color = new Qe(1, 1, 1), r.opacity = 1;
610
610
  const c = i.pbrMetallicRoughness;
611
611
  if (c) {
612
612
  if (Array.isArray(c.baseColorFactor)) {
613
613
  const l = c.baseColorFactor;
614
- s.color.setRGB(l[0], l[1], l[2], qe), s.opacity = l[3];
614
+ r.color.setRGB(l[0], l[1], l[2], qe), r.opacity = l[3];
615
615
  }
616
- c.baseColorTexture !== void 0 && u.push(a.assignTexture(s, "map", c.baseColorTexture, at));
616
+ c.baseColorTexture !== void 0 && u.push(a.assignTexture(r, "map", c.baseColorTexture, at));
617
617
  }
618
618
  return Promise.all(u);
619
619
  }
620
620
  }
621
621
  class Ao {
622
- constructor(s) {
623
- this.parser = s, this.name = ne.KHR_MATERIALS_EMISSIVE_STRENGTH;
622
+ constructor(r) {
623
+ this.parser = r, this.name = ne.KHR_MATERIALS_EMISSIVE_STRENGTH;
624
624
  }
625
- extendMaterialParams(s, i) {
626
- const u = this.parser.json.materials[s];
625
+ extendMaterialParams(r, i) {
626
+ const u = this.parser.json.materials[r];
627
627
  if (!u.extensions || !u.extensions[this.name])
628
628
  return Promise.resolve();
629
629
  const c = u.extensions[this.name].emissiveStrength;
@@ -631,15 +631,15 @@ class Ao {
631
631
  }
632
632
  }
633
633
  class xo {
634
- constructor(s) {
635
- this.parser = s, this.name = ne.KHR_MATERIALS_CLEARCOAT;
634
+ constructor(r) {
635
+ this.parser = r, this.name = ne.KHR_MATERIALS_CLEARCOAT;
636
636
  }
637
- getMaterialType(s) {
638
- const a = this.parser.json.materials[s];
637
+ getMaterialType(r) {
638
+ const a = this.parser.json.materials[r];
639
639
  return !a.extensions || !a.extensions[this.name] ? null : Ge;
640
640
  }
641
- extendMaterialParams(s, i) {
642
- const a = this.parser, u = a.json.materials[s];
641
+ extendMaterialParams(r, i) {
642
+ const a = this.parser, u = a.json.materials[r];
643
643
  if (!u.extensions || !u.extensions[this.name])
644
644
  return Promise.resolve();
645
645
  const c = [], l = u.extensions[this.name];
@@ -651,15 +651,15 @@ class xo {
651
651
  }
652
652
  }
653
653
  class To {
654
- constructor(s) {
655
- this.parser = s, this.name = ne.KHR_MATERIALS_DISPERSION;
654
+ constructor(r) {
655
+ this.parser = r, this.name = ne.KHR_MATERIALS_DISPERSION;
656
656
  }
657
- getMaterialType(s) {
658
- const a = this.parser.json.materials[s];
657
+ getMaterialType(r) {
658
+ const a = this.parser.json.materials[r];
659
659
  return !a.extensions || !a.extensions[this.name] ? null : Ge;
660
660
  }
661
- extendMaterialParams(s, i) {
662
- const u = this.parser.json.materials[s];
661
+ extendMaterialParams(r, i) {
662
+ const u = this.parser.json.materials[r];
663
663
  if (!u.extensions || !u.extensions[this.name])
664
664
  return Promise.resolve();
665
665
  const c = u.extensions[this.name];
@@ -667,15 +667,15 @@ class To {
667
667
  }
668
668
  }
669
669
  class Eo {
670
- constructor(s) {
671
- this.parser = s, this.name = ne.KHR_MATERIALS_IRIDESCENCE;
670
+ constructor(r) {
671
+ this.parser = r, this.name = ne.KHR_MATERIALS_IRIDESCENCE;
672
672
  }
673
- getMaterialType(s) {
674
- const a = this.parser.json.materials[s];
673
+ getMaterialType(r) {
674
+ const a = this.parser.json.materials[r];
675
675
  return !a.extensions || !a.extensions[this.name] ? null : Ge;
676
676
  }
677
- extendMaterialParams(s, i) {
678
- const a = this.parser, u = a.json.materials[s];
677
+ extendMaterialParams(r, i) {
678
+ const a = this.parser, u = a.json.materials[r];
679
679
  if (!u.extensions || !u.extensions[this.name])
680
680
  return Promise.resolve();
681
681
  const c = [], l = u.extensions[this.name];
@@ -683,15 +683,15 @@ class Eo {
683
683
  }
684
684
  }
685
685
  class So {
686
- constructor(s) {
687
- this.parser = s, this.name = ne.KHR_MATERIALS_SHEEN;
686
+ constructor(r) {
687
+ this.parser = r, this.name = ne.KHR_MATERIALS_SHEEN;
688
688
  }
689
- getMaterialType(s) {
690
- const a = this.parser.json.materials[s];
689
+ getMaterialType(r) {
690
+ const a = this.parser.json.materials[r];
691
691
  return !a.extensions || !a.extensions[this.name] ? null : Ge;
692
692
  }
693
- extendMaterialParams(s, i) {
694
- const a = this.parser, u = a.json.materials[s];
693
+ extendMaterialParams(r, i) {
694
+ const a = this.parser, u = a.json.materials[r];
695
695
  if (!u.extensions || !u.extensions[this.name])
696
696
  return Promise.resolve();
697
697
  const c = [];
@@ -705,15 +705,15 @@ class So {
705
705
  }
706
706
  }
707
707
  class Ro {
708
- constructor(s) {
709
- this.parser = s, this.name = ne.KHR_MATERIALS_TRANSMISSION;
708
+ constructor(r) {
709
+ this.parser = r, this.name = ne.KHR_MATERIALS_TRANSMISSION;
710
710
  }
711
- getMaterialType(s) {
712
- const a = this.parser.json.materials[s];
711
+ getMaterialType(r) {
712
+ const a = this.parser.json.materials[r];
713
713
  return !a.extensions || !a.extensions[this.name] ? null : Ge;
714
714
  }
715
- extendMaterialParams(s, i) {
716
- const a = this.parser, u = a.json.materials[s];
715
+ extendMaterialParams(r, i) {
716
+ const a = this.parser, u = a.json.materials[r];
717
717
  if (!u.extensions || !u.extensions[this.name])
718
718
  return Promise.resolve();
719
719
  const c = [], l = u.extensions[this.name];
@@ -721,15 +721,15 @@ class Ro {
721
721
  }
722
722
  }
723
723
  class ko {
724
- constructor(s) {
725
- this.parser = s, this.name = ne.KHR_MATERIALS_VOLUME;
724
+ constructor(r) {
725
+ this.parser = r, this.name = ne.KHR_MATERIALS_VOLUME;
726
726
  }
727
- getMaterialType(s) {
728
- const a = this.parser.json.materials[s];
727
+ getMaterialType(r) {
728
+ const a = this.parser.json.materials[r];
729
729
  return !a.extensions || !a.extensions[this.name] ? null : Ge;
730
730
  }
731
- extendMaterialParams(s, i) {
732
- const a = this.parser, u = a.json.materials[s];
731
+ extendMaterialParams(r, i) {
732
+ const a = this.parser, u = a.json.materials[r];
733
733
  if (!u.extensions || !u.extensions[this.name])
734
734
  return Promise.resolve();
735
735
  const c = [], l = u.extensions[this.name];
@@ -739,15 +739,15 @@ class ko {
739
739
  }
740
740
  }
741
741
  class Oo {
742
- constructor(s) {
743
- this.parser = s, this.name = ne.KHR_MATERIALS_IOR;
742
+ constructor(r) {
743
+ this.parser = r, this.name = ne.KHR_MATERIALS_IOR;
744
744
  }
745
- getMaterialType(s) {
746
- const a = this.parser.json.materials[s];
745
+ getMaterialType(r) {
746
+ const a = this.parser.json.materials[r];
747
747
  return !a.extensions || !a.extensions[this.name] ? null : Ge;
748
748
  }
749
- extendMaterialParams(s, i) {
750
- const u = this.parser.json.materials[s];
749
+ extendMaterialParams(r, i) {
750
+ const u = this.parser.json.materials[r];
751
751
  if (!u.extensions || !u.extensions[this.name])
752
752
  return Promise.resolve();
753
753
  const c = u.extensions[this.name];
@@ -755,15 +755,15 @@ class Oo {
755
755
  }
756
756
  }
757
757
  class Mo {
758
- constructor(s) {
759
- this.parser = s, this.name = ne.KHR_MATERIALS_SPECULAR;
758
+ constructor(r) {
759
+ this.parser = r, this.name = ne.KHR_MATERIALS_SPECULAR;
760
760
  }
761
- getMaterialType(s) {
762
- const a = this.parser.json.materials[s];
761
+ getMaterialType(r) {
762
+ const a = this.parser.json.materials[r];
763
763
  return !a.extensions || !a.extensions[this.name] ? null : Ge;
764
764
  }
765
- extendMaterialParams(s, i) {
766
- const a = this.parser, u = a.json.materials[s];
765
+ extendMaterialParams(r, i) {
766
+ const a = this.parser, u = a.json.materials[r];
767
767
  if (!u.extensions || !u.extensions[this.name])
768
768
  return Promise.resolve();
769
769
  const c = [], l = u.extensions[this.name];
@@ -773,15 +773,15 @@ class Mo {
773
773
  }
774
774
  }
775
775
  class Po {
776
- constructor(s) {
777
- this.parser = s, this.name = ne.EXT_MATERIALS_BUMP;
776
+ constructor(r) {
777
+ this.parser = r, this.name = ne.EXT_MATERIALS_BUMP;
778
778
  }
779
- getMaterialType(s) {
780
- const a = this.parser.json.materials[s];
779
+ getMaterialType(r) {
780
+ const a = this.parser.json.materials[r];
781
781
  return !a.extensions || !a.extensions[this.name] ? null : Ge;
782
782
  }
783
- extendMaterialParams(s, i) {
784
- const a = this.parser, u = a.json.materials[s];
783
+ extendMaterialParams(r, i) {
784
+ const a = this.parser, u = a.json.materials[r];
785
785
  if (!u.extensions || !u.extensions[this.name])
786
786
  return Promise.resolve();
787
787
  const c = [], l = u.extensions[this.name];
@@ -789,15 +789,15 @@ class Po {
789
789
  }
790
790
  }
791
791
  class Co {
792
- constructor(s) {
793
- this.parser = s, this.name = ne.KHR_MATERIALS_ANISOTROPY;
792
+ constructor(r) {
793
+ this.parser = r, this.name = ne.KHR_MATERIALS_ANISOTROPY;
794
794
  }
795
- getMaterialType(s) {
796
- const a = this.parser.json.materials[s];
795
+ getMaterialType(r) {
796
+ const a = this.parser.json.materials[r];
797
797
  return !a.extensions || !a.extensions[this.name] ? null : Ge;
798
798
  }
799
- extendMaterialParams(s, i) {
800
- const a = this.parser, u = a.json.materials[s];
799
+ extendMaterialParams(r, i) {
800
+ const a = this.parser, u = a.json.materials[r];
801
801
  if (!u.extensions || !u.extensions[this.name])
802
802
  return Promise.resolve();
803
803
  const c = [], l = u.extensions[this.name];
@@ -805,11 +805,11 @@ class Co {
805
805
  }
806
806
  }
807
807
  class Io {
808
- constructor(s) {
809
- this.parser = s, this.name = ne.KHR_TEXTURE_BASISU;
808
+ constructor(r) {
809
+ this.parser = r, this.name = ne.KHR_TEXTURE_BASISU;
810
810
  }
811
- loadTexture(s) {
812
- const i = this.parser, a = i.json, u = a.textures[s];
811
+ loadTexture(r) {
812
+ const i = this.parser, a = i.json, u = a.textures[r];
813
813
  if (!u.extensions || !u.extensions[this.name])
814
814
  return null;
815
815
  const c = u.extensions[this.name], l = i.options.ktx2Loader;
@@ -818,15 +818,15 @@ class Io {
818
818
  throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
819
819
  return null;
820
820
  }
821
- return i.loadTextureImage(s, c.source, l);
821
+ return i.loadTextureImage(r, c.source, l);
822
822
  }
823
823
  }
824
824
  class Lo {
825
- constructor(s) {
826
- this.parser = s, this.name = ne.EXT_TEXTURE_WEBP, this.isSupported = null;
825
+ constructor(r) {
826
+ this.parser = r, this.name = ne.EXT_TEXTURE_WEBP, this.isSupported = null;
827
827
  }
828
- loadTexture(s) {
829
- const i = this.name, a = this.parser, u = a.json, c = u.textures[s];
828
+ loadTexture(r) {
829
+ const i = this.name, a = this.parser, u = a.json, c = u.textures[r];
830
830
  if (!c.extensions || !c.extensions[i])
831
831
  return null;
832
832
  const l = c.extensions[i], p = u.images[l.source];
@@ -836,27 +836,27 @@ class Lo {
836
836
  y !== null && (h = y);
837
837
  }
838
838
  return this.detectSupport().then(function(y) {
839
- if (y) return a.loadTextureImage(s, l.source, h);
839
+ if (y) return a.loadTextureImage(r, l.source, h);
840
840
  if (u.extensionsRequired && u.extensionsRequired.indexOf(i) >= 0)
841
841
  throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
842
- return a.loadTexture(s);
842
+ return a.loadTexture(r);
843
843
  });
844
844
  }
845
845
  detectSupport() {
846
- return this.isSupported || (this.isSupported = new Promise(function(s) {
846
+ return this.isSupported || (this.isSupported = new Promise(function(r) {
847
847
  const i = new Image();
848
848
  i.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", i.onload = i.onerror = function() {
849
- s(i.height === 1);
849
+ r(i.height === 1);
850
850
  };
851
851
  })), this.isSupported;
852
852
  }
853
853
  }
854
854
  class Do {
855
- constructor(s) {
856
- this.parser = s, this.name = ne.EXT_TEXTURE_AVIF, this.isSupported = null;
855
+ constructor(r) {
856
+ this.parser = r, this.name = ne.EXT_TEXTURE_AVIF, this.isSupported = null;
857
857
  }
858
- loadTexture(s) {
859
- const i = this.name, a = this.parser, u = a.json, c = u.textures[s];
858
+ loadTexture(r) {
859
+ const i = this.name, a = this.parser, u = a.json, c = u.textures[r];
860
860
  if (!c.extensions || !c.extensions[i])
861
861
  return null;
862
862
  const l = c.extensions[i], p = u.images[l.source];
@@ -866,27 +866,27 @@ class Do {
866
866
  y !== null && (h = y);
867
867
  }
868
868
  return this.detectSupport().then(function(y) {
869
- if (y) return a.loadTextureImage(s, l.source, h);
869
+ if (y) return a.loadTextureImage(r, l.source, h);
870
870
  if (u.extensionsRequired && u.extensionsRequired.indexOf(i) >= 0)
871
871
  throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
872
- return a.loadTexture(s);
872
+ return a.loadTexture(r);
873
873
  });
874
874
  }
875
875
  detectSupport() {
876
- return this.isSupported || (this.isSupported = new Promise(function(s) {
876
+ return this.isSupported || (this.isSupported = new Promise(function(r) {
877
877
  const i = new Image();
878
878
  i.src = "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=", i.onload = i.onerror = function() {
879
- s(i.height === 1);
879
+ r(i.height === 1);
880
880
  };
881
881
  })), this.isSupported;
882
882
  }
883
883
  }
884
884
  class No {
885
- constructor(s) {
886
- this.name = ne.EXT_MESHOPT_COMPRESSION, this.parser = s;
885
+ constructor(r) {
886
+ this.name = ne.EXT_MESHOPT_COMPRESSION, this.parser = r;
887
887
  }
888
- loadBufferView(s) {
889
- const i = this.parser.json, a = i.bufferViews[s];
888
+ loadBufferView(r) {
889
+ const i = this.parser.json, a = i.bufferViews[r];
890
890
  if (a.extensions && a.extensions[this.name]) {
891
891
  const u = a.extensions[this.name], c = this.parser.getDependency("buffer", u.buffer), l = this.parser.options.meshoptDecoder;
892
892
  if (!l || !l.supported) {
@@ -908,11 +908,11 @@ class No {
908
908
  }
909
909
  }
910
910
  class Fo {
911
- constructor(s) {
912
- this.name = ne.EXT_MESH_GPU_INSTANCING, this.parser = s;
911
+ constructor(r) {
912
+ this.name = ne.EXT_MESH_GPU_INSTANCING, this.parser = r;
913
913
  }
914
- createNodeMesh(s) {
915
- const i = this.parser.json, a = i.nodes[s];
914
+ createNodeMesh(r) {
915
+ const i = this.parser.json, a = i.nodes[r];
916
916
  if (!a.extensions || !a.extensions[this.name] || a.mesh === void 0)
917
917
  return null;
918
918
  const u = i.meshes[a.mesh];
@@ -922,7 +922,7 @@ class Fo {
922
922
  const l = a.extensions[this.name].attributes, p = [], h = {};
923
923
  for (const y in l)
924
924
  p.push(this.parser.getDependency("accessor", l[y]).then((E) => (h[y] = E, h[y])));
925
- return p.length < 1 ? null : (p.push(this.parser.createNodeMesh(s)), Promise.all(p).then((y) => {
925
+ return p.length < 1 ? null : (p.push(this.parser.createNodeMesh(r)), Promise.all(p).then((y) => {
926
926
  const E = y.pop(), _ = E.isGroup ? E.children : [E], P = y[0].count, L = [];
927
927
  for (const q of _) {
928
928
  const X = new Nt(), H = new le(), W = new js(), Z = new le(1, 1, 1), oe = new Oi(q.geometry, q.material, P);
@@ -941,29 +941,29 @@ class Fo {
941
941
  }
942
942
  const Vs = "glTF", Jt = 12, Ts = { JSON: 1313821514, BIN: 5130562 };
943
943
  class jo {
944
- constructor(s) {
944
+ constructor(r) {
945
945
  this.name = ne.KHR_BINARY_GLTF, this.content = null, this.body = null;
946
- const i = new DataView(s, 0, Jt), a = new TextDecoder();
946
+ const i = new DataView(r, 0, Jt), a = new TextDecoder();
947
947
  if (this.header = {
948
- magic: a.decode(new Uint8Array(s.slice(0, 4))),
948
+ magic: a.decode(new Uint8Array(r.slice(0, 4))),
949
949
  version: i.getUint32(4, !0),
950
950
  length: i.getUint32(8, !0)
951
951
  }, this.header.magic !== Vs)
952
952
  throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
953
953
  if (this.header.version < 2)
954
954
  throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
955
- const u = this.header.length - Jt, c = new DataView(s, Jt);
955
+ const u = this.header.length - Jt, c = new DataView(r, Jt);
956
956
  let l = 0;
957
957
  for (; l < u; ) {
958
958
  const p = c.getUint32(l, !0);
959
959
  l += 4;
960
960
  const h = c.getUint32(l, !0);
961
961
  if (l += 4, h === Ts.JSON) {
962
- const y = new Uint8Array(s, Jt + l, p);
962
+ const y = new Uint8Array(r, Jt + l, p);
963
963
  this.content = a.decode(y);
964
964
  } else if (h === Ts.BIN) {
965
965
  const y = Jt + l;
966
- this.body = s.slice(y, y + p);
966
+ this.body = r.slice(y, y + p);
967
967
  }
968
968
  l += p;
969
969
  }
@@ -972,21 +972,21 @@ class jo {
972
972
  }
973
973
  }
974
974
  class Ko {
975
- constructor(s, i) {
975
+ constructor(r, i) {
976
976
  if (!i)
977
977
  throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
978
- this.name = ne.KHR_DRACO_MESH_COMPRESSION, this.json = s, this.dracoLoader = i, this.dracoLoader.preload();
978
+ this.name = ne.KHR_DRACO_MESH_COMPRESSION, this.json = r, this.dracoLoader = i, this.dracoLoader.preload();
979
979
  }
980
- decodePrimitive(s, i) {
981
- const a = this.json, u = this.dracoLoader, c = s.extensions[this.name].bufferView, l = s.extensions[this.name].attributes, p = {}, h = {}, y = {};
980
+ decodePrimitive(r, i) {
981
+ const a = this.json, u = this.dracoLoader, c = r.extensions[this.name].bufferView, l = r.extensions[this.name].attributes, p = {}, h = {}, y = {};
982
982
  for (const E in l) {
983
983
  const _ = Cr[E] || E.toLowerCase();
984
984
  p[_] = l[E];
985
985
  }
986
- for (const E in s.attributes) {
986
+ for (const E in r.attributes) {
987
987
  const _ = Cr[E] || E.toLowerCase();
988
988
  if (l[E] !== void 0) {
989
- const P = a.accessors[s.attributes[E]], L = Dt[P.componentType];
989
+ const P = a.accessors[r.attributes[E]], L = Dt[P.componentType];
990
990
  y[_] = L.name, h[_] = P.normalized === !0;
991
991
  }
992
992
  }
@@ -1007,8 +1007,8 @@ class Bo {
1007
1007
  constructor() {
1008
1008
  this.name = ne.KHR_TEXTURE_TRANSFORM;
1009
1009
  }
1010
- extendTexture(s, i) {
1011
- return (i.texCoord === void 0 || i.texCoord === s.channel) && i.offset === void 0 && i.rotation === void 0 && i.scale === void 0 || (s = s.clone(), i.texCoord !== void 0 && (s.channel = i.texCoord), i.offset !== void 0 && s.offset.fromArray(i.offset), i.rotation !== void 0 && (s.rotation = i.rotation), i.scale !== void 0 && s.repeat.fromArray(i.scale), s.needsUpdate = !0), s;
1010
+ extendTexture(r, i) {
1011
+ return (i.texCoord === void 0 || i.texCoord === r.channel) && i.offset === void 0 && i.rotation === void 0 && i.scale === void 0 || (r = r.clone(), i.texCoord !== void 0 && (r.channel = i.texCoord), i.offset !== void 0 && r.offset.fromArray(i.offset), i.rotation !== void 0 && (r.rotation = i.rotation), i.scale !== void 0 && r.repeat.fromArray(i.scale), r.needsUpdate = !0), r;
1012
1012
  }
1013
1013
  }
1014
1014
  class Uo {
@@ -1017,17 +1017,17 @@ class Uo {
1017
1017
  }
1018
1018
  }
1019
1019
  class Xs extends no {
1020
- constructor(s, i, a, u) {
1021
- super(s, i, a, u);
1020
+ constructor(r, i, a, u) {
1021
+ super(r, i, a, u);
1022
1022
  }
1023
- copySampleValue_(s) {
1024
- const i = this.resultBuffer, a = this.sampleValues, u = this.valueSize, c = s * u * 3 + u;
1023
+ copySampleValue_(r) {
1024
+ const i = this.resultBuffer, a = this.sampleValues, u = this.valueSize, c = r * u * 3 + u;
1025
1025
  for (let l = 0; l !== u; l++)
1026
1026
  i[l] = a[c + l];
1027
1027
  return i;
1028
1028
  }
1029
- interpolate_(s, i, a, u) {
1030
- const c = this.resultBuffer, l = this.sampleValues, p = this.valueSize, h = p * 2, y = p * 3, E = u - i, _ = (a - i) / E, P = _ * _, L = P * _, q = s * y, X = q - y, H = -2 * L + 3 * P, W = L - P, Z = 1 - H, oe = W - P + _;
1029
+ interpolate_(r, i, a, u) {
1030
+ const c = this.resultBuffer, l = this.sampleValues, p = this.valueSize, h = p * 2, y = p * 3, E = u - i, _ = (a - i) / E, P = _ * _, L = P * _, q = r * y, X = q - y, H = -2 * L + 3 * P, W = L - P, Z = 1 - H, oe = W - P + _;
1031
1031
  for (let J = 0; J !== p; J++) {
1032
1032
  const Ae = l[X + J + p], ve = l[X + J + h] * E, ce = l[q + J + p], Fe = l[q + J] * E;
1033
1033
  c[J] = Z * Ae + oe * ve + H * ce + W * Fe;
@@ -1037,8 +1037,8 @@ class Xs extends no {
1037
1037
  }
1038
1038
  const qo = new js();
1039
1039
  class Go extends Xs {
1040
- interpolate_(s, i, a, u) {
1041
- const c = super.interpolate_(s, i, a, u);
1040
+ interpolate_(r, i, a, u) {
1041
+ const c = super.interpolate_(r, i, a, u);
1042
1042
  return qo.fromArray(c).normalize().toArray(c), c;
1043
1043
  }
1044
1044
  }
@@ -1114,23 +1114,23 @@ function zo(C) {
1114
1114
  side: to
1115
1115
  })), C.DefaultMaterial;
1116
1116
  }
1117
- function wt(C, s, i) {
1117
+ function wt(C, r, i) {
1118
1118
  for (const a in i.extensions)
1119
- C[a] === void 0 && (s.userData.gltfExtensions = s.userData.gltfExtensions || {}, s.userData.gltfExtensions[a] = i.extensions[a]);
1119
+ C[a] === void 0 && (r.userData.gltfExtensions = r.userData.gltfExtensions || {}, r.userData.gltfExtensions[a] = i.extensions[a]);
1120
1120
  }
1121
- function Ye(C, s) {
1122
- s.extras !== void 0 && (typeof s.extras == "object" ? Object.assign(C.userData, s.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + s.extras));
1121
+ function Ye(C, r) {
1122
+ r.extras !== void 0 && (typeof r.extras == "object" ? Object.assign(C.userData, r.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + r.extras));
1123
1123
  }
1124
- function Vo(C, s, i) {
1124
+ function Vo(C, r, i) {
1125
1125
  let a = !1, u = !1, c = !1;
1126
- for (let y = 0, E = s.length; y < E; y++) {
1127
- const _ = s[y];
1126
+ for (let y = 0, E = r.length; y < E; y++) {
1127
+ const _ = r[y];
1128
1128
  if (_.POSITION !== void 0 && (a = !0), _.NORMAL !== void 0 && (u = !0), _.COLOR_0 !== void 0 && (c = !0), a && u && c) break;
1129
1129
  }
1130
1130
  if (!a && !u && !c) return Promise.resolve(C);
1131
1131
  const l = [], p = [], h = [];
1132
- for (let y = 0, E = s.length; y < E; y++) {
1133
- const _ = s[y];
1132
+ for (let y = 0, E = r.length; y < E; y++) {
1133
+ const _ = r[y];
1134
1134
  if (a) {
1135
1135
  const P = _.POSITION !== void 0 ? i.getDependency("accessor", _.POSITION) : C.attributes.position;
1136
1136
  l.push(P);
@@ -1153,12 +1153,12 @@ function Vo(C, s, i) {
1153
1153
  return a && (C.morphAttributes.position = E), u && (C.morphAttributes.normal = _), c && (C.morphAttributes.color = P), C.morphTargetsRelative = !0, C;
1154
1154
  });
1155
1155
  }
1156
- function Xo(C, s) {
1157
- if (C.updateMorphTargets(), s.weights !== void 0)
1158
- for (let i = 0, a = s.weights.length; i < a; i++)
1159
- C.morphTargetInfluences[i] = s.weights[i];
1160
- if (s.extras && Array.isArray(s.extras.targetNames)) {
1161
- const i = s.extras.targetNames;
1156
+ function Xo(C, r) {
1157
+ if (C.updateMorphTargets(), r.weights !== void 0)
1158
+ for (let i = 0, a = r.weights.length; i < a; i++)
1159
+ C.morphTargetInfluences[i] = r.weights[i];
1160
+ if (r.extras && Array.isArray(r.extras.targetNames)) {
1161
+ const i = r.extras.targetNames;
1162
1162
  if (C.morphTargetInfluences.length === i.length) {
1163
1163
  C.morphTargetDictionary = {};
1164
1164
  for (let a = 0, u = i.length; a < u; a++)
@@ -1168,19 +1168,19 @@ function Xo(C, s) {
1168
1168
  }
1169
1169
  }
1170
1170
  function Wo(C) {
1171
- let s;
1171
+ let r;
1172
1172
  const i = C.extensions && C.extensions[ne.KHR_DRACO_MESH_COMPRESSION];
1173
- if (i ? s = "draco:" + i.bufferView + ":" + i.indices + ":" + Rr(i.attributes) : s = C.indices + ":" + Rr(C.attributes) + ":" + C.mode, C.targets !== void 0)
1173
+ if (i ? r = "draco:" + i.bufferView + ":" + i.indices + ":" + Rr(i.attributes) : r = C.indices + ":" + Rr(C.attributes) + ":" + C.mode, C.targets !== void 0)
1174
1174
  for (let a = 0, u = C.targets.length; a < u; a++)
1175
- s += ":" + Rr(C.targets[a]);
1176
- return s;
1175
+ r += ":" + Rr(C.targets[a]);
1176
+ return r;
1177
1177
  }
1178
1178
  function Rr(C) {
1179
- let s = "";
1179
+ let r = "";
1180
1180
  const i = Object.keys(C).sort();
1181
1181
  for (let a = 0, u = i.length; a < u; a++)
1182
- s += i[a] + ":" + C[i[a]] + ";";
1183
- return s;
1182
+ r += i[a] + ":" + C[i[a]] + ";";
1183
+ return r;
1184
1184
  }
1185
1185
  function Ir(C) {
1186
1186
  switch (C) {
@@ -1201,8 +1201,8 @@ function Yo(C) {
1201
1201
  }
1202
1202
  const Qo = new Nt();
1203
1203
  class $o {
1204
- constructor(s = {}, i = {}) {
1205
- this.json = s, this.extensions = {}, this.plugins = {}, this.options = i, this.cache = new bo(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
1204
+ constructor(r = {}, i = {}) {
1205
+ this.json = r, this.extensions = {}, this.plugins = {}, this.options = i, this.cache = new bo(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
1206
1206
  let a = !1, u = -1, c = !1, l = -1;
1207
1207
  if (typeof navigator < "u") {
1208
1208
  const p = navigator.userAgent;
@@ -1212,13 +1212,13 @@ class $o {
1212
1212
  }
1213
1213
  typeof createImageBitmap > "u" || a && u < 17 || c && l < 98 ? this.textureLoader = new Pi(this.options.manager) : this.textureLoader = new Ci(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Dn(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
1214
1214
  }
1215
- setExtensions(s) {
1216
- this.extensions = s;
1215
+ setExtensions(r) {
1216
+ this.extensions = r;
1217
1217
  }
1218
- setPlugins(s) {
1219
- this.plugins = s;
1218
+ setPlugins(r) {
1219
+ this.plugins = r;
1220
1220
  }
1221
- parse(s, i) {
1221
+ parse(r, i) {
1222
1222
  const a = this, u = this.json, c = this.extensions;
1223
1223
  this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(l) {
1224
1224
  return l._markDefs && l._markDefs();
@@ -1245,7 +1245,7 @@ class $o {
1245
1245
  })).then(function() {
1246
1246
  for (const h of p.scenes)
1247
1247
  h.updateMatrixWorld();
1248
- s(p);
1248
+ r(p);
1249
1249
  });
1250
1250
  }).catch(i);
1251
1251
  }
@@ -1255,14 +1255,14 @@ class $o {
1255
1255
  * @private
1256
1256
  */
1257
1257
  _markDefs() {
1258
- const s = this.json.nodes || [], i = this.json.skins || [], a = this.json.meshes || [];
1258
+ const r = this.json.nodes || [], i = this.json.skins || [], a = this.json.meshes || [];
1259
1259
  for (let u = 0, c = i.length; u < c; u++) {
1260
1260
  const l = i[u].joints;
1261
1261
  for (let p = 0, h = l.length; p < h; p++)
1262
- s[l[p]].isBone = !0;
1262
+ r[l[p]].isBone = !0;
1263
1263
  }
1264
- for (let u = 0, c = s.length; u < c; u++) {
1265
- const l = s[u];
1264
+ for (let u = 0, c = r.length; u < c; u++) {
1265
+ const l = r[u];
1266
1266
  l.mesh !== void 0 && (this._addNodeRef(this.meshCache, l.mesh), l.skin !== void 0 && (a[l.mesh].isSkinnedMesh = !0)), l.camera !== void 0 && this._addNodeRef(this.cameraCache, l.camera);
1267
1267
  }
1268
1268
  }
@@ -1279,8 +1279,8 @@ class $o {
1279
1279
  * @param {Object} cache
1280
1280
  * @param {Object3D} index
1281
1281
  */
1282
- _addNodeRef(s, i) {
1283
- i !== void 0 && (s.refs[i] === void 0 && (s.refs[i] = s.uses[i] = 0), s.refs[i]++);
1282
+ _addNodeRef(r, i) {
1283
+ i !== void 0 && (r.refs[i] === void 0 && (r.refs[i] = r.uses[i] = 0), r.refs[i]++);
1284
1284
  }
1285
1285
  /**
1286
1286
  * Returns a reference to a shared resource, cloning it if necessary.
@@ -1291,31 +1291,31 @@ class $o {
1291
1291
  * @param {Object} object
1292
1292
  * @return {Object}
1293
1293
  */
1294
- _getNodeRef(s, i, a) {
1295
- if (s.refs[i] <= 1) return a;
1294
+ _getNodeRef(r, i, a) {
1295
+ if (r.refs[i] <= 1) return a;
1296
1296
  const u = a.clone(), c = (l, p) => {
1297
1297
  const h = this.associations.get(l);
1298
1298
  h != null && this.associations.set(p, h);
1299
1299
  for (const [y, E] of l.children.entries())
1300
1300
  c(E, p.children[y]);
1301
1301
  };
1302
- return c(a, u), u.name += "_instance_" + s.uses[i]++, u;
1302
+ return c(a, u), u.name += "_instance_" + r.uses[i]++, u;
1303
1303
  }
1304
- _invokeOne(s) {
1304
+ _invokeOne(r) {
1305
1305
  const i = Object.values(this.plugins);
1306
1306
  i.push(this);
1307
1307
  for (let a = 0; a < i.length; a++) {
1308
- const u = s(i[a]);
1308
+ const u = r(i[a]);
1309
1309
  if (u) return u;
1310
1310
  }
1311
1311
  return null;
1312
1312
  }
1313
- _invokeAll(s) {
1313
+ _invokeAll(r) {
1314
1314
  const i = Object.values(this.plugins);
1315
1315
  i.unshift(this);
1316
1316
  const a = [];
1317
1317
  for (let u = 0; u < i.length; u++) {
1318
- const c = s(i[u]);
1318
+ const c = r(i[u]);
1319
1319
  c && a.push(c);
1320
1320
  }
1321
1321
  return a;
@@ -1328,11 +1328,11 @@ class $o {
1328
1328
  * @param {number} index
1329
1329
  * @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
1330
1330
  */
1331
- getDependency(s, i) {
1332
- const a = s + ":" + i;
1331
+ getDependency(r, i) {
1332
+ const a = r + ":" + i;
1333
1333
  let u = this.cache.get(a);
1334
1334
  if (!u) {
1335
- switch (s) {
1335
+ switch (r) {
1336
1336
  case "scene":
1337
1337
  u = this.loadScene(i);
1338
1338
  break;
@@ -1380,9 +1380,9 @@ class $o {
1380
1380
  break;
1381
1381
  default:
1382
1382
  if (u = this._invokeOne(function(c) {
1383
- return c != this && c.getDependency && c.getDependency(s, i);
1383
+ return c != this && c.getDependency && c.getDependency(r, i);
1384
1384
  }), !u)
1385
- throw new Error("Unknown type: " + s);
1385
+ throw new Error("Unknown type: " + r);
1386
1386
  break;
1387
1387
  }
1388
1388
  this.cache.add(a, u);
@@ -1396,13 +1396,13 @@ class $o {
1396
1396
  * @param {string} type
1397
1397
  * @return {Promise<Array<Object>>}
1398
1398
  */
1399
- getDependencies(s) {
1400
- let i = this.cache.get(s);
1399
+ getDependencies(r) {
1400
+ let i = this.cache.get(r);
1401
1401
  if (!i) {
1402
- const a = this, u = this.json[s + (s === "mesh" ? "es" : "s")] || [];
1402
+ const a = this, u = this.json[r + (r === "mesh" ? "es" : "s")] || [];
1403
1403
  i = Promise.all(u.map(function(c, l) {
1404
- return a.getDependency(s, l);
1405
- })), this.cache.add(s, i);
1404
+ return a.getDependency(r, l);
1405
+ })), this.cache.add(r, i);
1406
1406
  }
1407
1407
  return i;
1408
1408
  }
@@ -1413,11 +1413,11 @@ class $o {
1413
1413
  * @param {number} bufferIndex
1414
1414
  * @return {Promise<ArrayBuffer>}
1415
1415
  */
1416
- loadBuffer(s) {
1417
- const i = this.json.buffers[s], a = this.fileLoader;
1416
+ loadBuffer(r) {
1417
+ const i = this.json.buffers[r], a = this.fileLoader;
1418
1418
  if (i.type && i.type !== "arraybuffer")
1419
1419
  throw new Error("THREE.GLTFLoader: " + i.type + " buffer type is not supported.");
1420
- if (i.uri === void 0 && s === 0)
1420
+ if (i.uri === void 0 && r === 0)
1421
1421
  return Promise.resolve(this.extensions[ne.KHR_BINARY_GLTF].body);
1422
1422
  const u = this.options;
1423
1423
  return new Promise(function(c, l) {
@@ -1433,8 +1433,8 @@ class $o {
1433
1433
  * @param {number} bufferViewIndex
1434
1434
  * @return {Promise<ArrayBuffer>}
1435
1435
  */
1436
- loadBufferView(s) {
1437
- const i = this.json.bufferViews[s];
1436
+ loadBufferView(r) {
1437
+ const i = this.json.bufferViews[r];
1438
1438
  return this.getDependency("buffer", i.buffer).then(function(a) {
1439
1439
  const u = i.byteLength || 0, c = i.byteOffset || 0;
1440
1440
  return a.slice(c, c + u);
@@ -1447,8 +1447,8 @@ class $o {
1447
1447
  * @param {number} accessorIndex
1448
1448
  * @return {Promise<BufferAttribute|InterleavedBufferAttribute>}
1449
1449
  */
1450
- loadAccessor(s) {
1451
- const i = this, a = this.json, u = this.json.accessors[s];
1450
+ loadAccessor(r) {
1451
+ const i = this, a = this.json, u = this.json.accessors[r];
1452
1452
  if (u.bufferView === void 0 && u.sparse === void 0) {
1453
1453
  const l = Er[u.type], p = Dt[u.componentType], h = u.normalized === !0, y = new p(u.count * l);
1454
1454
  return Promise.resolve(new en(y, l, h));
@@ -1482,33 +1482,33 @@ class $o {
1482
1482
  * @param {number} textureIndex
1483
1483
  * @return {Promise<THREE.Texture|null>}
1484
1484
  */
1485
- loadTexture(s) {
1486
- const i = this.json, a = this.options, c = i.textures[s].source, l = i.images[c];
1485
+ loadTexture(r) {
1486
+ const i = this.json, a = this.options, c = i.textures[r].source, l = i.images[c];
1487
1487
  let p = this.textureLoader;
1488
1488
  if (l.uri) {
1489
1489
  const h = a.manager.getHandler(l.uri);
1490
1490
  h !== null && (p = h);
1491
1491
  }
1492
- return this.loadTextureImage(s, c, p);
1492
+ return this.loadTextureImage(r, c, p);
1493
1493
  }
1494
- loadTextureImage(s, i, a) {
1495
- const u = this, c = this.json, l = c.textures[s], p = c.images[i], h = (p.uri || p.bufferView) + ":" + l.sampler;
1494
+ loadTextureImage(r, i, a) {
1495
+ const u = this, c = this.json, l = c.textures[r], p = c.images[i], h = (p.uri || p.bufferView) + ":" + l.sampler;
1496
1496
  if (this.textureCache[h])
1497
1497
  return this.textureCache[h];
1498
1498
  const y = this.loadImageSource(i, a).then(function(E) {
1499
1499
  E.flipY = !1, E.name = l.name || p.name || "", E.name === "" && typeof p.uri == "string" && p.uri.startsWith("data:image/") === !1 && (E.name = p.uri);
1500
1500
  const P = (c.samplers || {})[l.sampler] || {};
1501
- return E.magFilter = Es[P.magFilter] || Mr, E.minFilter = Es[P.minFilter] || Bs, E.wrapS = Ss[P.wrapS] || Pr, E.wrapT = Ss[P.wrapT] || Pr, E.generateMipmaps = !E.isCompressedTexture && E.minFilter !== Us && E.minFilter !== Mr, u.associations.set(E, { textures: s }), E;
1501
+ return E.magFilter = Es[P.magFilter] || Mr, E.minFilter = Es[P.minFilter] || Bs, E.wrapS = Ss[P.wrapS] || Pr, E.wrapT = Ss[P.wrapT] || Pr, E.generateMipmaps = !E.isCompressedTexture && E.minFilter !== Us && E.minFilter !== Mr, u.associations.set(E, { textures: r }), E;
1502
1502
  }).catch(function() {
1503
1503
  return null;
1504
1504
  });
1505
1505
  return this.textureCache[h] = y, y;
1506
1506
  }
1507
- loadImageSource(s, i) {
1507
+ loadImageSource(r, i) {
1508
1508
  const a = this, u = this.json, c = this.options;
1509
- if (this.sourceCache[s] !== void 0)
1510
- return this.sourceCache[s].then((_) => _.clone());
1511
- const l = u.images[s], p = self.URL || self.webkitURL;
1509
+ if (this.sourceCache[r] !== void 0)
1510
+ return this.sourceCache[r].then((_) => _.clone());
1511
+ const l = u.images[r], p = self.URL || self.webkitURL;
1512
1512
  let h = l.uri || "", y = !1;
1513
1513
  if (l.bufferView !== void 0)
1514
1514
  h = a.getDependency("bufferView", l.bufferView).then(function(_) {
@@ -1517,7 +1517,7 @@ class $o {
1517
1517
  return h = p.createObjectURL(P), h;
1518
1518
  });
1519
1519
  else if (l.uri === void 0)
1520
- throw new Error("THREE.GLTFLoader: Image " + s + " is missing URI and bufferView");
1520
+ throw new Error("THREE.GLTFLoader: Image " + r + " is missing URI and bufferView");
1521
1521
  const E = Promise.resolve(h).then(function(_) {
1522
1522
  return new Promise(function(P, L) {
1523
1523
  let q = P;
@@ -1531,7 +1531,7 @@ class $o {
1531
1531
  }).catch(function(_) {
1532
1532
  throw console.error("THREE.GLTFLoader: Couldn't load texture", h), _;
1533
1533
  });
1534
- return this.sourceCache[s] = E, E;
1534
+ return this.sourceCache[r] = E, E;
1535
1535
  }
1536
1536
  /**
1537
1537
  * Asynchronously assigns a texture to the given material parameters.
@@ -1543,7 +1543,7 @@ class $o {
1543
1543
  * @param {string} [colorSpace]
1544
1544
  * @return {Promise<Texture>}
1545
1545
  */
1546
- assignTexture(s, i, a, u) {
1546
+ assignTexture(r, i, a, u) {
1547
1547
  const c = this;
1548
1548
  return this.getDependency("texture", a.index).then(function(l) {
1549
1549
  if (!l) return null;
@@ -1554,7 +1554,7 @@ class $o {
1554
1554
  l = c.extensions[ne.KHR_TEXTURE_TRANSFORM].extendTexture(l, p), c.associations.set(l, h);
1555
1555
  }
1556
1556
  }
1557
- return u !== void 0 && (l.colorSpace = u), s[i] = l, l;
1557
+ return u !== void 0 && (l.colorSpace = u), r[i] = l, l;
1558
1558
  });
1559
1559
  }
1560
1560
  /**
@@ -1567,15 +1567,15 @@ class $o {
1567
1567
  * @private
1568
1568
  * @param {Object3D} mesh Mesh, Line, or Points instance.
1569
1569
  */
1570
- assignFinalMaterial(s) {
1571
- const i = s.geometry;
1572
- let a = s.material;
1570
+ assignFinalMaterial(r) {
1571
+ const i = r.geometry;
1572
+ let a = r.material;
1573
1573
  const u = i.attributes.tangent === void 0, c = i.attributes.color !== void 0, l = i.attributes.normal === void 0;
1574
- if (s.isPoints) {
1574
+ if (r.isPoints) {
1575
1575
  const p = "PointsMaterial:" + a.uuid;
1576
1576
  let h = this.cache.get(p);
1577
1577
  h || (h = new Bi(), _r.prototype.copy.call(h, a), h.color.copy(a.color), h.map = a.map, h.sizeAttenuation = !1, this.cache.add(p, h)), a = h;
1578
- } else if (s.isLine) {
1578
+ } else if (r.isLine) {
1579
1579
  const p = "LineBasicMaterial:" + a.uuid;
1580
1580
  let h = this.cache.get(p);
1581
1581
  h || (h = new Ui(), _r.prototype.copy.call(h, a), h.color.copy(a.color), h.map = a.map, this.cache.add(p, h)), a = h;
@@ -1586,7 +1586,7 @@ class $o {
1586
1586
  let h = this.cache.get(p);
1587
1587
  h || (h = a.clone(), c && (h.vertexColors = !0), l && (h.flatShading = !0), u && (h.normalScale && (h.normalScale.y *= -1), h.clearcoatNormalScale && (h.clearcoatNormalScale.y *= -1)), this.cache.add(p, h), this.associations.set(h, this.associations.get(a))), a = h;
1588
1588
  }
1589
- s.material = a;
1589
+ r.material = a;
1590
1590
  }
1591
1591
  getMaterialType() {
1592
1592
  return qs;
@@ -1598,8 +1598,8 @@ class $o {
1598
1598
  * @param {number} materialIndex
1599
1599
  * @return {Promise<Material>}
1600
1600
  */
1601
- loadMaterial(s) {
1602
- const i = this, a = this.json, u = this.extensions, c = a.materials[s];
1601
+ loadMaterial(r) {
1602
+ const i = this, a = this.json, u = this.extensions, c = a.materials[r];
1603
1603
  let l;
1604
1604
  const p = {}, h = c.extensions || {}, y = [];
1605
1605
  if (h[ne.KHR_MATERIALS_UNLIT]) {
@@ -1612,9 +1612,9 @@ class $o {
1612
1612
  p.color.setRGB(P[0], P[1], P[2], qe), p.opacity = P[3];
1613
1613
  }
1614
1614
  _.baseColorTexture !== void 0 && y.push(i.assignTexture(p, "map", _.baseColorTexture, at)), p.metalness = _.metallicFactor !== void 0 ? _.metallicFactor : 1, p.roughness = _.roughnessFactor !== void 0 ? _.roughnessFactor : 1, _.metallicRoughnessTexture !== void 0 && (y.push(i.assignTexture(p, "metalnessMap", _.metallicRoughnessTexture)), y.push(i.assignTexture(p, "roughnessMap", _.metallicRoughnessTexture))), l = this._invokeOne(function(P) {
1615
- return P.getMaterialType && P.getMaterialType(s);
1615
+ return P.getMaterialType && P.getMaterialType(r);
1616
1616
  }), y.push(Promise.all(this._invokeAll(function(P) {
1617
- return P.extendMaterialParams && P.extendMaterialParams(s, p);
1617
+ return P.extendMaterialParams && P.extendMaterialParams(r, p);
1618
1618
  })));
1619
1619
  }
1620
1620
  c.doubleSided === !0 && (p.side = qi);
@@ -1629,7 +1629,7 @@ class $o {
1629
1629
  }
1630
1630
  return c.emissiveTexture !== void 0 && l !== Zt && y.push(i.assignTexture(p, "emissiveMap", c.emissiveTexture, at)), Promise.all(y).then(function() {
1631
1631
  const _ = new l(p);
1632
- return c.name && (_.name = c.name), Ye(_, c), i.associations.set(_, { materials: s }), c.extensions && wt(u, _, c), _;
1632
+ return c.name && (_.name = c.name), Ye(_, c), i.associations.set(_, { materials: r }), c.extensions && wt(u, _, c), _;
1633
1633
  });
1634
1634
  }
1635
1635
  /**
@@ -1639,8 +1639,8 @@ class $o {
1639
1639
  * @param {string} originalName
1640
1640
  * @return {string}
1641
1641
  */
1642
- createUniqueName(s) {
1643
- const i = Gi.sanitizeNodeName(s || "");
1642
+ createUniqueName(r) {
1643
+ const i = Gi.sanitizeNodeName(r || "");
1644
1644
  return i in this.nodeNamesUsed ? i + "_" + ++this.nodeNamesUsed[i] : (this.nodeNamesUsed[i] = 0, i);
1645
1645
  }
1646
1646
  /**
@@ -1652,7 +1652,7 @@ class $o {
1652
1652
  * @param {Array<GLTF.Primitive>} primitives
1653
1653
  * @return {Promise<Array<BufferGeometry>>}
1654
1654
  */
1655
- loadGeometries(s) {
1655
+ loadGeometries(r) {
1656
1656
  const i = this, a = this.extensions, u = this.primitiveCache;
1657
1657
  function c(p) {
1658
1658
  return a[ne.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(p, i).then(function(h) {
@@ -1660,8 +1660,8 @@ class $o {
1660
1660
  });
1661
1661
  }
1662
1662
  const l = [];
1663
- for (let p = 0, h = s.length; p < h; p++) {
1664
- const y = s[p], E = Wo(y), _ = u[E];
1663
+ for (let p = 0, h = r.length; p < h; p++) {
1664
+ const y = r[p], E = Wo(y), _ = u[E];
1665
1665
  if (_)
1666
1666
  l.push(_.promise);
1667
1667
  else {
@@ -1678,8 +1678,8 @@ class $o {
1678
1678
  * @param {number} meshIndex
1679
1679
  * @return {Promise<Group|Mesh|SkinnedMesh|Line|Points>}
1680
1680
  */
1681
- loadMesh(s) {
1682
- const i = this, a = this.json, u = this.extensions, c = a.meshes[s], l = c.primitives, p = [];
1681
+ loadMesh(r) {
1682
+ const i = this, a = this.json, u = this.extensions, c = a.meshes[r], l = c.primitives, p = [];
1683
1683
  for (let h = 0, y = l.length; h < y; h++) {
1684
1684
  const E = l[h].material === void 0 ? zo(this.cache) : this.getDependency("material", l[h].material);
1685
1685
  p.push(E);
@@ -1702,17 +1702,17 @@ class $o {
1702
1702
  W = new Yi(X, Z);
1703
1703
  else
1704
1704
  throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + H.mode);
1705
- Object.keys(W.geometry.morphAttributes).length > 0 && Xo(W, c), W.name = i.createUniqueName(c.name || "mesh_" + s), Ye(W, c), H.extensions && wt(u, W, H), i.assignFinalMaterial(W), _.push(W);
1705
+ Object.keys(W.geometry.morphAttributes).length > 0 && Xo(W, c), W.name = i.createUniqueName(c.name || "mesh_" + r), Ye(W, c), H.extensions && wt(u, W, H), i.assignFinalMaterial(W), _.push(W);
1706
1706
  }
1707
1707
  for (let L = 0, q = _.length; L < q; L++)
1708
1708
  i.associations.set(_[L], {
1709
- meshes: s,
1709
+ meshes: r,
1710
1710
  primitives: L
1711
1711
  });
1712
1712
  if (_.length === 1)
1713
1713
  return c.extensions && wt(u, _[0], c), _[0];
1714
1714
  const P = new Ar();
1715
- c.extensions && wt(u, P, c), i.associations.set(P, { meshes: s });
1715
+ c.extensions && wt(u, P, c), i.associations.set(P, { meshes: r });
1716
1716
  for (let L = 0, q = _.length; L < q; L++)
1717
1717
  P.add(_[L]);
1718
1718
  return P;
@@ -1725,9 +1725,9 @@ class $o {
1725
1725
  * @param {number} cameraIndex
1726
1726
  * @return {Promise<THREE.Camera>}
1727
1727
  */
1728
- loadCamera(s) {
1728
+ loadCamera(r) {
1729
1729
  let i;
1730
- const a = this.json.cameras[s], u = a[a.type];
1730
+ const a = this.json.cameras[r], u = a[a.type];
1731
1731
  if (!u) {
1732
1732
  console.warn("THREE.GLTFLoader: Missing camera parameters.");
1733
1733
  return;
@@ -1741,8 +1741,8 @@ class $o {
1741
1741
  * @param {number} skinIndex
1742
1742
  * @return {Promise<Skeleton>}
1743
1743
  */
1744
- loadSkin(s) {
1745
- const i = this.json.skins[s], a = [];
1744
+ loadSkin(r) {
1745
+ const i = this.json.skins[r], a = [];
1746
1746
  for (let u = 0, c = i.joints.length; u < c; u++)
1747
1747
  a.push(this._loadNodeShallow(i.joints[u]));
1748
1748
  return i.inverseBindMatrices !== void 0 ? a.push(this.getDependency("accessor", i.inverseBindMatrices)) : a.push(null), Promise.all(a).then(function(u) {
@@ -1766,8 +1766,8 @@ class $o {
1766
1766
  * @param {number} animationIndex
1767
1767
  * @return {Promise<AnimationClip>}
1768
1768
  */
1769
- loadAnimation(s) {
1770
- const i = this.json, a = this, u = i.animations[s], c = u.name ? u.name : "animation_" + s, l = [], p = [], h = [], y = [], E = [];
1769
+ loadAnimation(r) {
1770
+ const i = this.json, a = this, u = i.animations[r], c = u.name ? u.name : "animation_" + r, l = [], p = [], h = [], y = [], E = [];
1771
1771
  for (let _ = 0, P = u.channels.length; _ < P; _++) {
1772
1772
  const L = u.channels[_], q = u.samplers[L.sampler], X = L.target, H = X.node, W = u.parameters !== void 0 ? u.parameters[q.input] : q.input, Z = u.parameters !== void 0 ? u.parameters[q.output] : q.output;
1773
1773
  X.node !== void 0 && (l.push(this.getDependency("node", H)), p.push(this.getDependency("accessor", W)), h.push(this.getDependency("accessor", Z)), y.push(q), E.push(X));
@@ -1792,8 +1792,8 @@ class $o {
1792
1792
  return new Ji(c, void 0, W);
1793
1793
  });
1794
1794
  }
1795
- createNodeMesh(s) {
1796
- const i = this.json, a = this, u = i.nodes[s];
1795
+ createNodeMesh(r) {
1796
+ const i = this.json, a = this, u = i.nodes[r];
1797
1797
  return u.mesh === void 0 ? null : a.getDependency("mesh", u.mesh).then(function(c) {
1798
1798
  const l = a._getNodeRef(a.meshCache, u.mesh, c);
1799
1799
  return u.weights !== void 0 && l.traverse(function(p) {
@@ -1810,8 +1810,8 @@ class $o {
1810
1810
  * @param {number} nodeIndex
1811
1811
  * @return {Promise<Object3D>}
1812
1812
  */
1813
- loadNode(s) {
1814
- const i = this.json, a = this, u = i.nodes[s], c = a._loadNodeShallow(s), l = [], p = u.children || [];
1813
+ loadNode(r) {
1814
+ const i = this.json, a = this, u = i.nodes[r], c = a._loadNodeShallow(r), l = [], p = u.children || [];
1815
1815
  for (let y = 0, E = p.length; y < E; y++)
1816
1816
  l.push(a.getDependency("node", p[y]));
1817
1817
  const h = u.skin === void 0 ? Promise.resolve(null) : a.getDependency("skin", u.skin);
@@ -1831,20 +1831,20 @@ class $o {
1831
1831
  }
1832
1832
  // ._loadNodeShallow() parses a single node.
1833
1833
  // skin and child nodes are created and added in .loadNode() (no '_' prefix).
1834
- _loadNodeShallow(s) {
1834
+ _loadNodeShallow(r) {
1835
1835
  const i = this.json, a = this.extensions, u = this;
1836
- if (this.nodeCache[s] !== void 0)
1837
- return this.nodeCache[s];
1838
- const c = i.nodes[s], l = c.name ? u.createUniqueName(c.name) : "", p = [], h = u._invokeOne(function(y) {
1839
- return y.createNodeMesh && y.createNodeMesh(s);
1836
+ if (this.nodeCache[r] !== void 0)
1837
+ return this.nodeCache[r];
1838
+ const c = i.nodes[r], l = c.name ? u.createUniqueName(c.name) : "", p = [], h = u._invokeOne(function(y) {
1839
+ return y.createNodeMesh && y.createNodeMesh(r);
1840
1840
  });
1841
1841
  return h && p.push(h), c.camera !== void 0 && p.push(u.getDependency("camera", c.camera).then(function(y) {
1842
1842
  return u._getNodeRef(u.cameraCache, c.camera, y);
1843
1843
  })), u._invokeAll(function(y) {
1844
- return y.createNodeAttachment && y.createNodeAttachment(s);
1844
+ return y.createNodeAttachment && y.createNodeAttachment(r);
1845
1845
  }).forEach(function(y) {
1846
1846
  p.push(y);
1847
- }), this.nodeCache[s] = Promise.all(p).then(function(y) {
1847
+ }), this.nodeCache[r] = Promise.all(p).then(function(y) {
1848
1848
  let E;
1849
1849
  if (c.isBone === !0 ? E = new Zi() : y.length > 1 ? E = new Ar() : y.length === 1 ? E = y[0] : E = new Ks(), E !== y[0])
1850
1850
  for (let _ = 0, P = y.length; _ < P; _++)
@@ -1854,8 +1854,8 @@ class $o {
1854
1854
  _.fromArray(c.matrix), E.applyMatrix4(_);
1855
1855
  } else
1856
1856
  c.translation !== void 0 && E.position.fromArray(c.translation), c.rotation !== void 0 && E.quaternion.fromArray(c.rotation), c.scale !== void 0 && E.scale.fromArray(c.scale);
1857
- return u.associations.has(E) || u.associations.set(E, {}), u.associations.get(E).nodes = s, E;
1858
- }), this.nodeCache[s];
1857
+ return u.associations.has(E) || u.associations.set(E, {}), u.associations.get(E).nodes = r, E;
1858
+ }), this.nodeCache[r];
1859
1859
  }
1860
1860
  /**
1861
1861
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes
@@ -1864,8 +1864,8 @@ class $o {
1864
1864
  * @param {number} sceneIndex
1865
1865
  * @return {Promise<Group>}
1866
1866
  */
1867
- loadScene(s) {
1868
- const i = this.extensions, a = this.json.scenes[s], u = this, c = new Ar();
1867
+ loadScene(r) {
1868
+ const i = this.extensions, a = this.json.scenes[r], u = this, c = new Ar();
1869
1869
  a.name && (c.name = u.createUniqueName(a.name)), Ye(c, a), a.extensions && wt(i, c, a);
1870
1870
  const l = a.nodes || [], p = [];
1871
1871
  for (let h = 0, y = l.length; h < y; h++)
@@ -1885,9 +1885,9 @@ class $o {
1885
1885
  return u.associations = y(c), c;
1886
1886
  });
1887
1887
  }
1888
- _createAnimationTracks(s, i, a, u, c) {
1889
- const l = [], p = s.name ? s.name : s.uuid, h = [];
1890
- ot[c.path] === ot.weights ? s.traverse(function(P) {
1888
+ _createAnimationTracks(r, i, a, u, c) {
1889
+ const l = [], p = r.name ? r.name : r.uuid, h = [];
1890
+ ot[c.path] === ot.weights ? r.traverse(function(P) {
1891
1891
  P.morphTargetInfluences && h.push(P.name ? P.name : P.uuid);
1892
1892
  }) : h.push(p);
1893
1893
  let y;
@@ -1927,9 +1927,9 @@ class $o {
1927
1927
  }
1928
1928
  return l;
1929
1929
  }
1930
- _getArrayFromAccessor(s) {
1931
- let i = s.array;
1932
- if (s.normalized) {
1930
+ _getArrayFromAccessor(r) {
1931
+ let i = r.array;
1932
+ if (r.normalized) {
1933
1933
  const a = Ir(i.constructor), u = new Float32Array(i.length);
1934
1934
  for (let c = 0, l = i.length; c < l; c++)
1935
1935
  u[c] = i[c] * a;
@@ -1937,15 +1937,15 @@ class $o {
1937
1937
  }
1938
1938
  return i;
1939
1939
  }
1940
- _createCubicSplineTrackInterpolant(s) {
1941
- s.createInterpolant = function(a) {
1940
+ _createCubicSplineTrackInterpolant(r) {
1941
+ r.createInterpolant = function(a) {
1942
1942
  const u = this instanceof _s ? Go : Xs;
1943
1943
  return new u(this.times, this.values, this.getValueSize() / 3, a);
1944
- }, s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
1944
+ }, r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
1945
1945
  }
1946
1946
  }
1947
- function Jo(C, s, i) {
1948
- const a = s.attributes, u = new Fn();
1947
+ function Jo(C, r, i) {
1948
+ const a = r.attributes, u = new Fn();
1949
1949
  if (a.POSITION !== void 0) {
1950
1950
  const p = i.json.accessors[a.POSITION], h = p.min, y = p.max;
1951
1951
  if (h !== void 0 && y !== void 0) {
@@ -1962,7 +1962,7 @@ function Jo(C, s, i) {
1962
1962
  }
1963
1963
  } else
1964
1964
  return;
1965
- const c = s.targets;
1965
+ const c = r.targets;
1966
1966
  if (c !== void 0) {
1967
1967
  const p = new le(), h = new le();
1968
1968
  for (let y = 0, E = c.length; y < E; y++) {
@@ -1985,8 +1985,8 @@ function Jo(C, s, i) {
1985
1985
  const l = new ro();
1986
1986
  u.getCenter(l.center), l.radius = u.min.distanceTo(u.max) / 2, C.boundingSphere = l;
1987
1987
  }
1988
- function Rs(C, s, i) {
1989
- const a = s.attributes, u = [];
1988
+ function Rs(C, r, i) {
1989
+ const a = r.attributes, u = [];
1990
1990
  function c(l, p) {
1991
1991
  return i.getDependency("accessor", l).then(function(h) {
1992
1992
  C.setAttribute(p, h);
@@ -1996,14 +1996,14 @@ function Rs(C, s, i) {
1996
1996
  const p = Cr[l] || l.toLowerCase();
1997
1997
  p in C.attributes || u.push(c(a[l], p));
1998
1998
  }
1999
- if (s.indices !== void 0 && !C.index) {
2000
- const l = i.getDependency("accessor", s.indices).then(function(p) {
1999
+ if (r.indices !== void 0 && !C.index) {
2000
+ const l = i.getDependency("accessor", r.indices).then(function(p) {
2001
2001
  C.setIndex(p);
2002
2002
  });
2003
2003
  u.push(l);
2004
2004
  }
2005
- return Or.workingColorSpace !== qe && "COLOR_0" in a && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Or.workingColorSpace}" not supported.`), Ye(C, s), Jo(C, s, i), Promise.all(u).then(function() {
2006
- return s.targets !== void 0 ? Vo(C, s.targets, i) : C;
2005
+ return Or.workingColorSpace !== qe && "COLOR_0" in a && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Or.workingColorSpace}" not supported.`), Ye(C, r), Jo(C, r, i), Promise.all(u).then(function() {
2006
+ return r.targets !== void 0 ? Vo(C, r.targets, i) : C;
2007
2007
  });
2008
2008
  }
2009
2009
  const se = {
@@ -2029,8 +2029,8 @@ class Lr {
2029
2029
  * @param {Vector3} [halfSize] - Positive halfwidth extents of the OBB along each axis.
2030
2030
  * @param {Matrix3} [rotation] - The rotation of the OBB.
2031
2031
  */
2032
- constructor(s = new le(), i = new le(), a = new zs()) {
2033
- this.center = s, this.halfSize = i, this.rotation = a;
2032
+ constructor(r = new le(), i = new le(), a = new zs()) {
2033
+ this.center = r, this.halfSize = i, this.rotation = a;
2034
2034
  }
2035
2035
  /**
2036
2036
  * Sets the OBBs components to the given values.
@@ -2040,8 +2040,8 @@ class Lr {
2040
2040
  * @param {Matrix3} [rotation] - The rotation of the OBB.
2041
2041
  * @return {OBB} A reference to this OBB.
2042
2042
  */
2043
- set(s, i, a) {
2044
- return this.center = s, this.halfSize = i, this.rotation = a, this;
2043
+ set(r, i, a) {
2044
+ return this.center = r, this.halfSize = i, this.rotation = a, this;
2045
2045
  }
2046
2046
  /**
2047
2047
  * Copies the values of the given OBB to this instance.
@@ -2049,8 +2049,8 @@ class Lr {
2049
2049
  * @param {OBB} obb - The OBB to copy.
2050
2050
  * @return {OBB} A reference to this OBB.
2051
2051
  */
2052
- copy(s) {
2053
- return this.center.copy(s.center), this.halfSize.copy(s.halfSize), this.rotation.copy(s.rotation), this;
2052
+ copy(r) {
2053
+ return this.center.copy(r.center), this.halfSize.copy(r.halfSize), this.rotation.copy(r.rotation), this;
2054
2054
  }
2055
2055
  /**
2056
2056
  * Returns a new OBB with copied values from this instance.
@@ -2066,8 +2066,8 @@ class Lr {
2066
2066
  * @param {Vector3} target - The target vector that is used to store the method's result.
2067
2067
  * @return {Vector3} The size.
2068
2068
  */
2069
- getSize(s) {
2070
- return s.copy(this.halfSize).multiplyScalar(2);
2069
+ getSize(r) {
2070
+ return r.copy(this.halfSize).multiplyScalar(2);
2071
2071
  }
2072
2072
  /**
2073
2073
  * Clamps the given point within the bounds of this OBB.
@@ -2076,9 +2076,9 @@ class Lr {
2076
2076
  * @param {Vector3} target - The target vector that is used to store the method's result.
2077
2077
  * @returns {Vector3} - The clamped point.
2078
2078
  */
2079
- clampPoint(s, i) {
2079
+ clampPoint(r, i) {
2080
2080
  const a = this.halfSize;
2081
- be.subVectors(s, this.center), this.rotation.extractBasis(_t, At, xt), i.copy(this.center);
2081
+ be.subVectors(r, this.center), this.rotation.extractBasis(_t, At, xt), i.copy(this.center);
2082
2082
  const u = Lt.clamp(be.dot(_t), -a.x, a.x);
2083
2083
  i.add(_t.multiplyScalar(u));
2084
2084
  const c = Lt.clamp(be.dot(At), -a.y, a.y);
@@ -2092,8 +2092,8 @@ class Lr {
2092
2092
  * @param {Vector3} point - The point to test.
2093
2093
  * @returns {boolean} - Whether the given point lies within this OBB or not.
2094
2094
  */
2095
- containsPoint(s) {
2096
- return be.subVectors(s, this.center), this.rotation.extractBasis(_t, At, xt), Math.abs(be.dot(_t)) <= this.halfSize.x && Math.abs(be.dot(At)) <= this.halfSize.y && Math.abs(be.dot(xt)) <= this.halfSize.z;
2095
+ containsPoint(r) {
2096
+ return be.subVectors(r, this.center), this.rotation.extractBasis(_t, At, xt), Math.abs(be.dot(_t)) <= this.halfSize.x && Math.abs(be.dot(At)) <= this.halfSize.y && Math.abs(be.dot(xt)) <= this.halfSize.z;
2097
2097
  }
2098
2098
  /**
2099
2099
  * Returns `true` if the given AABB intersects this OBB.
@@ -2101,8 +2101,8 @@ class Lr {
2101
2101
  * @param {Box3} box3 - The AABB to test.
2102
2102
  * @returns {boolean} - Whether the given AABB intersects this OBB or not.
2103
2103
  */
2104
- intersectsBox3(s) {
2105
- return this.intersectsOBB(Zo.fromBox3(s));
2104
+ intersectsBox3(r) {
2105
+ return this.intersectsOBB(Zo.fromBox3(r));
2106
2106
  }
2107
2107
  /**
2108
2108
  * Returns `true` if the given bounding sphere intersects this OBB.
@@ -2110,8 +2110,8 @@ class Lr {
2110
2110
  * @param {Sphere} sphere - The bounding sphere to test.
2111
2111
  * @returns {boolean} - Whether the given bounding sphere intersects this OBB or not.
2112
2112
  */
2113
- intersectsSphere(s) {
2114
- return this.clampPoint(s.center, Os), Os.distanceToSquared(s.center) <= s.radius * s.radius;
2113
+ intersectsSphere(r) {
2114
+ return this.clampPoint(r.center, Os), Os.distanceToSquared(r.center) <= r.radius * r.radius;
2115
2115
  }
2116
2116
  /**
2117
2117
  * Returns `true` if the given OBB intersects this OBB.
@@ -2120,8 +2120,8 @@ class Lr {
2120
2120
  * @param {number} [epsilon=Number.EPSILON] - A small value to prevent arithmetic errors.
2121
2121
  * @returns {boolean} - Whether the given OBB intersects this OBB or not.
2122
2122
  */
2123
- intersectsOBB(s, i = Number.EPSILON) {
2124
- se.c = this.center, se.e[0] = this.halfSize.x, se.e[1] = this.halfSize.y, se.e[2] = this.halfSize.z, this.rotation.extractBasis(se.u[0], se.u[1], se.u[2]), ae.c = s.center, ae.e[0] = s.halfSize.x, ae.e[1] = s.halfSize.y, ae.e[2] = s.halfSize.z, s.rotation.extractBasis(ae.u[0], ae.u[1], ae.u[2]);
2123
+ intersectsOBB(r, i = Number.EPSILON) {
2124
+ se.c = this.center, se.e[0] = this.halfSize.x, se.e[1] = this.halfSize.y, se.e[2] = this.halfSize.z, this.rotation.extractBasis(se.u[0], se.u[1], se.u[2]), ae.c = r.center, ae.e[0] = r.halfSize.x, ae.e[1] = r.halfSize.y, ae.e[2] = r.halfSize.z, r.rotation.extractBasis(ae.u[0], ae.u[1], ae.u[2]);
2125
2125
  for (let c = 0; c < 3; c++)
2126
2126
  for (let l = 0; l < 3; l++)
2127
2127
  pe[c][l] = se.u[c].dot(ae.u[l]);
@@ -2142,9 +2142,9 @@ class Lr {
2142
2142
  * @param {Plane} plane - The plane to test.
2143
2143
  * @returns {boolean} Whether the given plane intersects this OBB or not.
2144
2144
  */
2145
- intersectsPlane(s) {
2145
+ intersectsPlane(r) {
2146
2146
  this.rotation.extractBasis(_t, At, xt);
2147
- const i = this.halfSize.x * Math.abs(s.normal.dot(_t)) + this.halfSize.y * Math.abs(s.normal.dot(At)) + this.halfSize.z * Math.abs(s.normal.dot(xt)), a = s.normal.dot(this.center) - s.constant;
2147
+ const i = this.halfSize.x * Math.abs(r.normal.dot(_t)) + this.halfSize.y * Math.abs(r.normal.dot(At)) + this.halfSize.z * Math.abs(r.normal.dot(xt)), a = r.normal.dot(this.center) - r.constant;
2148
2148
  return Math.abs(a) <= i;
2149
2149
  }
2150
2150
  /**
@@ -2155,8 +2155,8 @@ class Lr {
2155
2155
  * @param {Vector3} target - The target vector that is used to store the method's result.
2156
2156
  * @return {?Vector3} The intersection point. If no intersection is detected, `null` is returned.
2157
2157
  */
2158
- intersectRay(s, i) {
2159
- return this.getSize(ks), Ms.setFromCenterAndSize(be.set(0, 0, 0), ks), Cn.setFromMatrix3(this.rotation), Cn.setPosition(this.center), Ps.copy(Cn).invert(), Cs.copy(s).applyMatrix4(Ps), Cs.intersectBox(Ms, i) ? i.applyMatrix4(Cn) : null;
2158
+ intersectRay(r, i) {
2159
+ return this.getSize(ks), Ms.setFromCenterAndSize(be.set(0, 0, 0), ks), Cn.setFromMatrix3(this.rotation), Cn.setPosition(this.center), Ps.copy(Cn).invert(), Cs.copy(r).applyMatrix4(Ps), Cs.intersectBox(Ms, i) ? i.applyMatrix4(Cn) : null;
2160
2160
  }
2161
2161
  /**
2162
2162
  * Returns `true` if the given ray intersects this OBB.
@@ -2164,8 +2164,8 @@ class Lr {
2164
2164
  * @param {Ray} ray - The ray to test.
2165
2165
  * @returns {boolean} Whether the given ray intersects this OBB or not.
2166
2166
  */
2167
- intersectsRay(s) {
2168
- return this.intersectRay(s, be) !== null;
2167
+ intersectsRay(r) {
2168
+ return this.intersectRay(r, be) !== null;
2169
2169
  }
2170
2170
  /**
2171
2171
  * Defines an OBB based on the given AABB.
@@ -2173,8 +2173,8 @@ class Lr {
2173
2173
  * @param {Box3} box3 - The AABB to setup the OBB from.
2174
2174
  * @return {OBB} A reference of this OBB.
2175
2175
  */
2176
- fromBox3(s) {
2177
- return s.getCenter(this.center), s.getSize(this.halfSize).multiplyScalar(0.5), this.rotation.identity(), this;
2176
+ fromBox3(r) {
2177
+ return r.getCenter(this.center), r.getSize(this.halfSize).multiplyScalar(0.5), this.rotation.identity(), this;
2178
2178
  }
2179
2179
  /**
2180
2180
  * Returns `true` if the given OBB is equal to this OBB.
@@ -2182,8 +2182,8 @@ class Lr {
2182
2182
  * @param {OBB} obb - The OBB to test.
2183
2183
  * @returns {boolean} Whether the given OBB is equal to this OBB or not.
2184
2184
  */
2185
- equals(s) {
2186
- return s.center.equals(this.center) && s.halfSize.equals(this.halfSize) && s.rotation.equals(this.rotation);
2185
+ equals(r) {
2186
+ return r.center.equals(this.center) && r.halfSize.equals(this.halfSize) && r.rotation.equals(this.rotation);
2187
2187
  }
2188
2188
  /**
2189
2189
  * Applies the given transformation matrix to this OBB. This method can be
@@ -2193,13 +2193,13 @@ class Lr {
2193
2193
  * @param {Matrix4} matrix - The matrix to apply.
2194
2194
  * @return {OBB} A reference of this OBB.
2195
2195
  */
2196
- applyMatrix4(s) {
2197
- const i = s.elements;
2196
+ applyMatrix4(r) {
2197
+ const i = r.elements;
2198
2198
  let a = be.set(i[0], i[1], i[2]).length();
2199
2199
  const u = be.set(i[4], i[5], i[6]).length(), c = be.set(i[8], i[9], i[10]).length();
2200
- s.determinant() < 0 && (a = -a), Ne.setFromMatrix4(s);
2200
+ r.determinant() < 0 && (a = -a), Ne.setFromMatrix4(r);
2201
2201
  const p = 1 / a, h = 1 / u, y = 1 / c;
2202
- return Ne.elements[0] *= p, Ne.elements[1] *= p, Ne.elements[2] *= p, Ne.elements[3] *= h, Ne.elements[4] *= h, Ne.elements[5] *= h, Ne.elements[6] *= y, Ne.elements[7] *= y, Ne.elements[8] *= y, this.rotation.multiply(Ne), this.halfSize.x *= a, this.halfSize.y *= u, this.halfSize.z *= c, be.setFromMatrixPosition(s), this.center.add(be), this;
2202
+ return Ne.elements[0] *= p, Ne.elements[1] *= p, Ne.elements[2] *= p, Ne.elements[3] *= h, Ne.elements[4] *= h, Ne.elements[5] *= h, Ne.elements[6] *= y, Ne.elements[7] *= y, Ne.elements[8] *= y, this.rotation.multiply(Ne), this.halfSize.x *= a, this.halfSize.y *= u, this.halfSize.z *= c, be.setFromMatrixPosition(r), this.center.add(be), this;
2203
2203
  }
2204
2204
  }
2205
2205
  const Zo = new Lr(), ea = {
@@ -2210,7 +2210,7 @@ const Zo = new Lr(), ea = {
2210
2210
  maxDistance: 1e3,
2211
2211
  maxPolarAngle: Lt.degToRad(60)
2212
2212
  };
2213
- function la(C, s) {
2213
+ function la(C, r) {
2214
2214
  const i = Object.assign(
2215
2215
  {
2216
2216
  css3d: !1,
@@ -2220,7 +2220,7 @@ function la(C, s) {
2220
2220
  options: {}
2221
2221
  }
2222
2222
  },
2223
- s || {}
2223
+ r || {}
2224
2224
  );
2225
2225
  let a, u, c, l = [];
2226
2226
  const p = xr(!1), h = uo(), y = xr(0), E = xr(0), _ = new io({
@@ -2329,8 +2329,8 @@ function la(C, s) {
2329
2329
  };
2330
2330
  }
2331
2331
  const fa = (C = "app") => {
2332
- const s = new ao();
2333
- s.params.Line.threshold = 8;
2332
+ const r = new ao();
2333
+ r.params.Line.threshold = 8;
2334
2334
  const i = new Nr(), a = document.getElementById(C);
2335
2335
  function u(p, h) {
2336
2336
  const { scaleX: y, scaleY: E } = l(a), { clientWidth: _, clientHeight: P } = h, L = h.getBoundingClientRect(), q = _ * y, X = P * E, H = p.clientX - L.left, W = p.clientY - L.top;
@@ -2338,7 +2338,7 @@ const fa = (C = "app") => {
2338
2338
  }
2339
2339
  function c(p, h, y, E) {
2340
2340
  const { pointer: _, x: P, y: L } = u(p, h);
2341
- return s.setFromCamera(_, y), { intersects: s.intersectObjects(E), pointer: _, x: P, y: L };
2341
+ return r.setFromCamera(_, y), { intersects: r.intersectObjects(E), pointer: _, x: P, y: L };
2342
2342
  }
2343
2343
  function l(p) {
2344
2344
  const h = window.getComputedStyle(p), y = h.transform || h.webkitTransform || h.mozTransform;
@@ -2352,7 +2352,7 @@ const fa = (C = "app") => {
2352
2352
  return { scaleX: 1, scaleY: 1 };
2353
2353
  }
2354
2354
  return {
2355
- raycaster: s,
2355
+ raycaster: r,
2356
2356
  pointer: i,
2357
2357
  getPointer: u,
2358
2358
  getScale: l,
@@ -2361,7 +2361,7 @@ const fa = (C = "app") => {
2361
2361
  }, We = [], ha = new Qe(16711680), da = () => {
2362
2362
  const C = () => {
2363
2363
  We.splice(0);
2364
- }, s = (p, h) => {
2364
+ }, r = (p, h) => {
2365
2365
  h.traverse((y) => {
2366
2366
  y && i(p, y);
2367
2367
  });
@@ -2376,7 +2376,7 @@ const fa = (C = "app") => {
2376
2376
  };
2377
2377
  return {
2378
2378
  resetObbs: C,
2379
- initObb: s,
2379
+ initObb: r,
2380
2380
  getObbObjectByParentUid: (p) => We.filter((h) => h.parentUid === p),
2381
2381
  addObbFromArray: (p, h) => {
2382
2382
  for (let y = 0, E = h.length; y < E; y++)
@@ -2398,25 +2398,25 @@ function na(C) {
2398
2398
  }
2399
2399
  var Ln = { exports: {} }, ra = Ln.exports, Is;
2400
2400
  function sa() {
2401
- return Is || (Is = 1, function(C, s) {
2401
+ return Is || (Is = 1, function(C, r) {
2402
2402
  (function(i, a) {
2403
2403
  C.exports = a();
2404
2404
  })(ra, function() {
2405
2405
  var i = function(e, t) {
2406
- return (i = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
2407
- n.__proto__ = r;
2408
- } || function(n, r) {
2409
- for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (n[o] = r[o]);
2406
+ return (i = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, s) {
2407
+ n.__proto__ = s;
2408
+ } || function(n, s) {
2409
+ for (var o in s) Object.prototype.hasOwnProperty.call(s, o) && (n[o] = s[o]);
2410
2410
  })(e, t);
2411
2411
  }, a = function() {
2412
2412
  return (a = Object.assign || function(e) {
2413
- for (var t, n = 1, r = arguments.length; n < r; n++) for (var o in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
2413
+ for (var t, n = 1, s = arguments.length; n < s; n++) for (var o in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
2414
2414
  return e;
2415
2415
  }).apply(this, arguments);
2416
2416
  };
2417
2417
  function u(e, t, n) {
2418
- for (var r, o = 0, f = t.length; o < f; o++) !r && o in t || ((r = r || Array.prototype.slice.call(t, 0, o))[o] = t[o]);
2419
- return e.concat(r || Array.prototype.slice.call(t));
2418
+ for (var s, o = 0, f = t.length; o < f; o++) !s && o in t || ((s = s || Array.prototype.slice.call(t, 0, o))[o] = t[o]);
2419
+ return e.concat(s || Array.prototype.slice.call(t));
2420
2420
  }
2421
2421
  var c = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : ta, l = Object.keys, p = Array.isArray;
2422
2422
  function h(e, t) {
@@ -2435,8 +2435,8 @@ function sa() {
2435
2435
  });
2436
2436
  }
2437
2437
  var L = Object.defineProperty;
2438
- function q(e, t, n, r) {
2439
- L(e, t, h(n && _(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, r));
2438
+ function q(e, t, n, s) {
2439
+ L(e, t, h(n && _(n, "get") && typeof n.get == "function" ? { get: n.get, set: n.set, configurable: !0 } : { value: n, configurable: !0, writable: !0 }, s));
2440
2440
  }
2441
2441
  function X(e) {
2442
2442
  return { from: function(t) {
@@ -2460,8 +2460,8 @@ function sa() {
2460
2460
  if (typeof t == "string" && _(e, t)) return e[t];
2461
2461
  if (!t) return e;
2462
2462
  if (typeof t != "string") {
2463
- for (var n = [], r = 0, o = t.length; r < o; ++r) {
2464
- var f = ve(e, t[r]);
2463
+ for (var n = [], s = 0, o = t.length; s < o; ++s) {
2464
+ var f = ve(e, t[s]);
2465
2465
  n.push(f);
2466
2466
  }
2467
2467
  return n;
@@ -2475,7 +2475,7 @@ function sa() {
2475
2475
  function ce(e, t, n) {
2476
2476
  if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) if (typeof t != "string" && "length" in t) {
2477
2477
  J(typeof n != "string" && "length" in n);
2478
- for (var r = 0, o = t.length; r < o; ++r) ce(e, t[r], n[r]);
2478
+ for (var s = 0, o = t.length; s < o; ++s) ce(e, t[s], n[s]);
2479
2479
  } else {
2480
2480
  var f, d, m = t.indexOf(".");
2481
2481
  m !== -1 ? (f = t.substr(0, m), (d = t.substr(m + 1)) === "" ? n === void 0 ? p(e) && !isNaN(parseInt(f)) ? e.splice(f, 1) : delete e[f] : e[f] = n : ce(m = !(m = e[f]) || !_(e, f) ? e[f] = {} : m, d, n)) : n === void 0 ? p(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
@@ -2502,17 +2502,17 @@ function sa() {
2502
2502
  function ke(e) {
2503
2503
  return Re = /* @__PURE__ */ new WeakMap(), e = function t(n) {
2504
2504
  if (!n || typeof n != "object") return n;
2505
- var r = Re.get(n);
2506
- if (r) return r;
2505
+ var s = Re.get(n);
2506
+ if (s) return s;
2507
2507
  if (p(n)) {
2508
- r = [], Re.set(n, r);
2509
- for (var o = 0, f = n.length; o < f; ++o) r.push(t(n[o]));
2510
- } else if (Le.has(n.constructor)) r = n;
2508
+ s = [], Re.set(n, s);
2509
+ for (var o = 0, f = n.length; o < f; ++o) s.push(t(n[o]));
2510
+ } else if (Le.has(n.constructor)) s = n;
2511
2511
  else {
2512
2512
  var d, m = y(n);
2513
- for (d in r = m === Object.prototype ? {} : Object.create(m), Re.set(n, r), n) _(n, d) && (r[d] = t(n[d]));
2513
+ for (d in s = m === Object.prototype ? {} : Object.create(m), Re.set(n, s), n) _(n, d) && (s[d] = t(n[d]));
2514
2514
  }
2515
- return r;
2515
+ return s;
2516
2516
  }(e), Re = null, e;
2517
2517
  }
2518
2518
  var nn = {}.toString;
@@ -2530,12 +2530,12 @@ function sa() {
2530
2530
  }
2531
2531
  var Je = {};
2532
2532
  function De(e) {
2533
- var t, n, r, o;
2533
+ var t, n, s, o;
2534
2534
  if (arguments.length === 1) {
2535
2535
  if (p(e)) return e.slice();
2536
2536
  if (this === Je && typeof e == "string") return [e];
2537
2537
  if (o = He(e)) {
2538
- for (n = []; !(r = o.next()).done; ) n.push(r.value);
2538
+ for (n = []; !(s = o.next()).done; ) n.push(s.value);
2539
2539
  return n;
2540
2540
  }
2541
2541
  if (e == null) return [e];
@@ -2557,13 +2557,13 @@ function sa() {
2557
2557
  function ze(e, t) {
2558
2558
  return e + ". Errors: " + Object.keys(t).map(function(n) {
2559
2559
  return t[n].toString();
2560
- }).filter(function(n, r, o) {
2561
- return o.indexOf(n) === r;
2560
+ }).filter(function(n, s, o) {
2561
+ return o.indexOf(n) === s;
2562
2562
  }).join(`
2563
2563
  `);
2564
2564
  }
2565
- function rn(e, t, n, r) {
2566
- this.failures = t, this.failedKeys = r, this.successCount = n, this.message = ze(e, t);
2565
+ function rn(e, t, n, s) {
2566
+ this.failures = t, this.failedKeys = s, this.successCount = n, this.message = ze(e, t);
2567
2567
  }
2568
2568
  function St(e, t) {
2569
2569
  this.name = "BulkError", this.failures = Object.keys(t).map(function(n) {
@@ -2577,11 +2577,11 @@ function sa() {
2577
2577
  return e[t] = t + "Error", e;
2578
2578
  }, {}), Ws = je, V = Ce.reduce(function(e, t) {
2579
2579
  var n = t + "Error";
2580
- function r(o, f) {
2580
+ function s(o, f) {
2581
2581
  this.name = n, o ? typeof o == "string" ? (this.message = "".concat(o).concat(f ? `
2582
2582
  ` + f : ""), this.inner = f || null) : typeof o == "object" && (this.message = "".concat(o.name, " ").concat(o.message), this.inner = o) : (this.message = Fr[t] || n, this.inner = null);
2583
2583
  }
2584
- return X(r).from(Ws), e[t] = r, e;
2584
+ return X(s).from(Ws), e[t] = s, e;
2585
2585
  }, {});
2586
2586
  V.Syntax = SyntaxError, V.Type = TypeError, V.Range = RangeError;
2587
2587
  var jr = Bt.reduce(function(e, t) {
@@ -2608,25 +2608,25 @@ function sa() {
2608
2608
  return e === ue ? t : function() {
2609
2609
  var n = e.apply(this, arguments);
2610
2610
  n !== void 0 && (arguments[0] = n);
2611
- var r = this.onsuccess, o = this.onerror;
2611
+ var s = this.onsuccess, o = this.onerror;
2612
2612
  this.onsuccess = null, this.onerror = null;
2613
2613
  var f = t.apply(this, arguments);
2614
- return r && (this.onsuccess = this.onsuccess ? ut(r, this.onsuccess) : r), o && (this.onerror = this.onerror ? ut(o, this.onerror) : o), f !== void 0 ? f : n;
2614
+ return s && (this.onsuccess = this.onsuccess ? ut(s, this.onsuccess) : s), o && (this.onerror = this.onerror ? ut(o, this.onerror) : o), f !== void 0 ? f : n;
2615
2615
  };
2616
2616
  }
2617
2617
  function $s(e, t) {
2618
2618
  return e === ue ? t : function() {
2619
2619
  e.apply(this, arguments);
2620
- var n = this.onsuccess, r = this.onerror;
2621
- this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? ut(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? ut(r, this.onerror) : r);
2620
+ var n = this.onsuccess, s = this.onerror;
2621
+ this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? ut(n, this.onsuccess) : n), s && (this.onerror = this.onerror ? ut(s, this.onerror) : s);
2622
2622
  };
2623
2623
  }
2624
2624
  function Js(e, t) {
2625
2625
  return e === ue ? t : function(n) {
2626
- var r = e.apply(this, arguments);
2627
- h(n, r);
2626
+ var s = e.apply(this, arguments);
2627
+ h(n, s);
2628
2628
  var o = this.onsuccess, f = this.onerror;
2629
- return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), o && (this.onsuccess = this.onsuccess ? ut(o, this.onsuccess) : o), f && (this.onerror = this.onerror ? ut(f, this.onerror) : f), r === void 0 ? n === void 0 ? void 0 : n : h(r, n);
2629
+ return this.onsuccess = null, this.onerror = null, n = t.apply(this, arguments), o && (this.onsuccess = this.onsuccess ? ut(o, this.onsuccess) : o), f && (this.onerror = this.onerror ? ut(f, this.onerror) : f), s === void 0 ? n === void 0 ? void 0 : n : h(s, n);
2630
2630
  };
2631
2631
  }
2632
2632
  function Zs(e, t) {
@@ -2638,9 +2638,9 @@ function sa() {
2638
2638
  return e === ue ? t : function() {
2639
2639
  var n = e.apply(this, arguments);
2640
2640
  if (n && typeof n.then == "function") {
2641
- for (var r = this, o = arguments.length, f = new Array(o); o--; ) f[o] = arguments[o];
2641
+ for (var s = this, o = arguments.length, f = new Array(o); o--; ) f[o] = arguments[o];
2642
2642
  return n.then(function() {
2643
- return t.apply(r, f);
2643
+ return t.apply(s, f);
2644
2644
  });
2645
2645
  }
2646
2646
  return t.apply(this, arguments);
@@ -2667,27 +2667,27 @@ function sa() {
2667
2667
  if (e !== Kt) throw new TypeError("Not a function");
2668
2668
  return this._state = arguments[1], this._value = arguments[2], void (this._state === !1 && Hn(this, this._value));
2669
2669
  }
2670
- this._state = null, this._value = null, ++t.ref, function n(r, o) {
2670
+ this._state = null, this._value = null, ++t.ref, function n(s, o) {
2671
2671
  try {
2672
2672
  o(function(f) {
2673
- if (r._state === null) {
2674
- if (f === r) throw new TypeError("A promise cannot be resolved with itself.");
2675
- var d = r._lib && Rt();
2676
- f && typeof f.then == "function" ? n(r, function(m, v) {
2673
+ if (s._state === null) {
2674
+ if (f === s) throw new TypeError("A promise cannot be resolved with itself.");
2675
+ var d = s._lib && Rt();
2676
+ f && typeof f.then == "function" ? n(s, function(m, v) {
2677
2677
  f instanceof U ? f._then(m, v) : f.then(m, v);
2678
- }) : (r._state = !0, r._value = f, qr(r)), d && kt();
2678
+ }) : (s._state = !0, s._value = f, qr(s)), d && kt();
2679
2679
  }
2680
- }, Hn.bind(null, r));
2680
+ }, Hn.bind(null, s));
2681
2681
  } catch (f) {
2682
- Hn(r, f);
2682
+ Hn(s, f);
2683
2683
  }
2684
2684
  }(this, e);
2685
2685
  }
2686
2686
  var Gn = { get: function() {
2687
2687
  var e = z, t = hn;
2688
- function n(r, o) {
2688
+ function n(s, o) {
2689
2689
  var f = this, d = !e.global && (e !== z || t !== hn), m = d && !tt(), v = new U(function(w, T) {
2690
- zn(f, new Ur(Hr(r, e, d, m), Hr(o, e, d, m), w, T, e));
2690
+ zn(f, new Ur(Hr(s, e, d, m), Hr(o, e, d, m), w, T, e));
2691
2691
  });
2692
2692
  return this._consoleTask && (v._consoleTask = this._consoleTask), v;
2693
2693
  }
@@ -2697,19 +2697,19 @@ function sa() {
2697
2697
  return e;
2698
2698
  }, set: Gn.set });
2699
2699
  } };
2700
- function Ur(e, t, n, r, o) {
2701
- this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = o;
2700
+ function Ur(e, t, n, s, o) {
2701
+ this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = s, this.psd = o;
2702
2702
  }
2703
2703
  function Hn(e, t) {
2704
- var n, r;
2705
- an.push(t), e._state === null && (n = e._lib && Rt(), t = qn(t), e._state = !1, e._value = t, r = e, ft.some(function(o) {
2706
- return o._value === r._value;
2707
- }) || ft.push(r), qr(e), n && kt());
2704
+ var n, s;
2705
+ an.push(t), e._state === null && (n = e._lib && Rt(), t = qn(t), e._state = !1, e._value = t, s = e, ft.some(function(o) {
2706
+ return o._value === s._value;
2707
+ }) || ft.push(s), qr(e), n && kt());
2708
2708
  }
2709
2709
  function qr(e) {
2710
2710
  var t = e._listeners;
2711
2711
  e._listeners = [];
2712
- for (var n = 0, r = t.length; n < r; ++n) zn(e, t[n]);
2712
+ for (var n = 0, s = t.length; n < s; ++n) zn(e, t[n]);
2713
2713
  var o = e._PSD;
2714
2714
  --o.ref || o.finalize(), ht === 0 && (++ht, Ut(function() {
2715
2715
  --ht == 0 && Vn();
@@ -2724,12 +2724,12 @@ function sa() {
2724
2724
  }
2725
2725
  function ei(e, t, n) {
2726
2726
  try {
2727
- var r, o = t._value;
2728
- !t._state && an.length && (an = []), r = Ke && t._consoleTask ? t._consoleTask.run(function() {
2727
+ var s, o = t._value;
2728
+ !t._state && an.length && (an = []), s = Ke && t._consoleTask ? t._consoleTask.run(function() {
2729
2729
  return e(o);
2730
2730
  }) : e(o), t._state || an.indexOf(o) !== -1 || function(f) {
2731
2731
  for (var d = ft.length; d; ) if (ft[--d]._value === f._value) return ft.splice(d, 1);
2732
- }(t), n.resolve(r);
2732
+ }(t), n.resolve(s);
2733
2733
  } catch (f) {
2734
2734
  n.reject(f);
2735
2735
  } finally {
@@ -2749,16 +2749,16 @@ function sa() {
2749
2749
  var e, t, n;
2750
2750
  do
2751
2751
  for (; 0 < qt.length; ) for (e = qt, qt = [], n = e.length, t = 0; t < n; ++t) {
2752
- var r = e[t];
2753
- r[0].apply(null, r[1]);
2752
+ var s = e[t];
2753
+ s[0].apply(null, s[1]);
2754
2754
  }
2755
2755
  while (0 < qt.length);
2756
2756
  on = Un = !0;
2757
2757
  }
2758
2758
  function Vn() {
2759
2759
  var e = ft;
2760
- ft = [], e.forEach(function(r) {
2761
- r._PSD.onunhandled.call(null, r._value, r);
2760
+ ft = [], e.forEach(function(s) {
2761
+ s._PSD.onunhandled.call(null, s._value, s);
2762
2762
  });
2763
2763
  for (var t = un.slice(0), n = t.length; n; ) t[--n]();
2764
2764
  }
@@ -2768,13 +2768,13 @@ function sa() {
2768
2768
  function de(e, t) {
2769
2769
  var n = z;
2770
2770
  return function() {
2771
- var r = Rt(), o = z;
2771
+ var s = Rt(), o = z;
2772
2772
  try {
2773
2773
  return nt(n, !0), e.apply(this, arguments);
2774
2774
  } catch (f) {
2775
2775
  t && t(f);
2776
2776
  } finally {
2777
- nt(o, !1), r && kt();
2777
+ nt(o, !1), s && kt();
2778
2778
  }
2779
2779
  };
2780
2780
  }
@@ -2783,10 +2783,10 @@ function sa() {
2783
2783
  }, catch: function(e) {
2784
2784
  if (arguments.length === 1) return this.then(null, e);
2785
2785
  var t = e, n = arguments[1];
2786
- return typeof t == "function" ? this.then(null, function(r) {
2787
- return (r instanceof t ? n : cn)(r);
2788
- }) : this.then(null, function(r) {
2789
- return (r && r.name === t ? n : cn)(r);
2786
+ return typeof t == "function" ? this.then(null, function(s) {
2787
+ return (s instanceof t ? n : cn)(s);
2788
+ }) : this.then(null, function(s) {
2789
+ return (s && s.name === t ? n : cn)(s);
2790
2790
  });
2791
2791
  }, finally: function(e) {
2792
2792
  return this.then(function(t) {
@@ -2800,20 +2800,20 @@ function sa() {
2800
2800
  });
2801
2801
  }, timeout: function(e, t) {
2802
2802
  var n = this;
2803
- return e < 1 / 0 ? new U(function(r, o) {
2803
+ return e < 1 / 0 ? new U(function(s, o) {
2804
2804
  var f = setTimeout(function() {
2805
2805
  return o(new V.Timeout(t));
2806
2806
  }, e);
2807
- n.then(r, o).finally(clearTimeout.bind(null, f));
2807
+ n.then(s, o).finally(clearTimeout.bind(null, f));
2808
2808
  }) : this;
2809
2809
  } }), typeof Symbol < "u" && Symbol.toStringTag && q(U.prototype, Symbol.toStringTag, "Dexie.Promise"), Ze.env = Gr(), P(U, { all: function() {
2810
2810
  var e = De.apply(null, arguments).map(dn);
2811
2811
  return new U(function(t, n) {
2812
2812
  e.length === 0 && t([]);
2813
- var r = e.length;
2813
+ var s = e.length;
2814
2814
  e.forEach(function(o, f) {
2815
2815
  return U.resolve(o).then(function(d) {
2816
- e[f] = d, --r || t(e);
2816
+ e[f] = d, --s || t(e);
2817
2817
  }, n);
2818
2818
  });
2819
2819
  });
@@ -2824,8 +2824,8 @@ function sa() {
2824
2824
  }, reject: cn, race: function() {
2825
2825
  var e = De.apply(null, arguments).map(dn);
2826
2826
  return new U(function(t, n) {
2827
- e.map(function(r) {
2828
- return U.resolve(r).then(t, n);
2827
+ e.map(function(s) {
2828
+ return U.resolve(s).then(t, n);
2829
2829
  });
2830
2830
  });
2831
2831
  }, PSD: { get: function() {
@@ -2843,7 +2843,7 @@ function sa() {
2843
2843
  }, set: function(e) {
2844
2844
  qn = e;
2845
2845
  } }, follow: function(e, t) {
2846
- return new U(function(n, r) {
2846
+ return new U(function(n, s) {
2847
2847
  return et(function(o, f) {
2848
2848
  var d = z;
2849
2849
  d.unhandleds = [], d.onunhandled = f, d.finalize = ut(function() {
@@ -2856,20 +2856,20 @@ function sa() {
2856
2856
  --ht == 0 && Vn();
2857
2857
  }, []);
2858
2858
  }, d.finalize), e();
2859
- }, t, n, r);
2859
+ }, t, n, s);
2860
2860
  });
2861
2861
  } }), lt && (lt.allSettled && q(U, "allSettled", function() {
2862
2862
  var e = De.apply(null, arguments).map(dn);
2863
2863
  return new U(function(t) {
2864
2864
  e.length === 0 && t([]);
2865
- var n = e.length, r = new Array(n);
2865
+ var n = e.length, s = new Array(n);
2866
2866
  e.forEach(function(o, f) {
2867
2867
  return U.resolve(o).then(function(d) {
2868
- return r[f] = { status: "fulfilled", value: d };
2868
+ return s[f] = { status: "fulfilled", value: d };
2869
2869
  }, function(d) {
2870
- return r[f] = { status: "rejected", reason: d };
2870
+ return s[f] = { status: "rejected", reason: d };
2871
2871
  }).then(function() {
2872
- return --n || t(r);
2872
+ return --n || t(s);
2873
2873
  });
2874
2874
  });
2875
2875
  });
@@ -2877,22 +2877,22 @@ function sa() {
2877
2877
  var e = De.apply(null, arguments).map(dn);
2878
2878
  return new U(function(t, n) {
2879
2879
  e.length === 0 && n(new AggregateError([]));
2880
- var r = e.length, o = new Array(r);
2880
+ var s = e.length, o = new Array(s);
2881
2881
  e.forEach(function(f, d) {
2882
2882
  return U.resolve(f).then(function(m) {
2883
2883
  return t(m);
2884
2884
  }, function(m) {
2885
- o[d] = m, --r || n(new AggregateError(o));
2885
+ o[d] = m, --s || n(new AggregateError(o));
2886
2886
  });
2887
2887
  });
2888
2888
  });
2889
2889
  }), lt.withResolvers && (U.withResolvers = lt.withResolvers));
2890
2890
  var we = { awaits: 0, echoes: 0, id: 0 }, ni = 0, ln = [], fn = 0, hn = 0, ri = 0;
2891
- function et(e, t, n, r) {
2891
+ function et(e, t, n, s) {
2892
2892
  var o = z, f = Object.create(o);
2893
2893
  return f.parent = o, f.ref = 0, f.global = !1, f.id = ++ri, Ze.env, f.env = Bn ? { Promise: U, PromiseProp: { value: U, configurable: !0, writable: !0 }, all: U.all, race: U.race, allSettled: U.allSettled, any: U.any, resolve: U.resolve, reject: U.reject } : {}, t && h(f, t), ++o.ref, f.finalize = function() {
2894
2894
  --this.parent.ref || this.parent.finalize();
2895
- }, r = dt(f, e, n, r), f.ref === 0 && f.finalize(), r;
2895
+ }, s = dt(f, e, n, s), f.ref === 0 && f.finalize(), s;
2896
2896
  }
2897
2897
  function Ot() {
2898
2898
  return we.id || (we.id = ++ni), ++we.awaits, we.echoes += Br, we.id;
@@ -2912,31 +2912,31 @@ function sa() {
2912
2912
  ln.pop(), nt(e, !1);
2913
2913
  }
2914
2914
  function nt(e, t) {
2915
- var n, r = z;
2915
+ var n, s = z;
2916
2916
  (t ? !we.echoes || fn++ && e === z : !fn || --fn && e === z) || queueMicrotask(t ? (function(o) {
2917
2917
  ++hn, we.echoes && --we.echoes != 0 || (we.echoes = we.awaits = we.id = 0), ln.push(z), nt(o, !0);
2918
- }).bind(null, e) : si), e !== z && (z = e, r === Ze && (Ze.env = Gr()), Bn && (n = Ze.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(c, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
2918
+ }).bind(null, e) : si), e !== z && (z = e, s === Ze && (Ze.env = Gr()), Bn && (n = Ze.env.Promise, t = e.env, (s.global || e.global) && (Object.defineProperty(c, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
2919
2919
  }
2920
2920
  function Gr() {
2921
2921
  var e = c.Promise;
2922
2922
  return Bn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(c, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
2923
2923
  }
2924
- function dt(e, t, n, r, o) {
2924
+ function dt(e, t, n, s, o) {
2925
2925
  var f = z;
2926
2926
  try {
2927
- return nt(e, !0), t(n, r, o);
2927
+ return nt(e, !0), t(n, s, o);
2928
2928
  } finally {
2929
2929
  nt(f, !1);
2930
2930
  }
2931
2931
  }
2932
- function Hr(e, t, n, r) {
2932
+ function Hr(e, t, n, s) {
2933
2933
  return typeof e != "function" ? e : function() {
2934
2934
  var o = z;
2935
2935
  n && Ot(), nt(t, !0);
2936
2936
  try {
2937
2937
  return e.apply(this, arguments);
2938
2938
  } finally {
2939
- nt(o, !1), r && queueMicrotask(tt);
2939
+ nt(o, !1), s && queueMicrotask(tt);
2940
2940
  }
2941
2941
  };
2942
2942
  }
@@ -2963,8 +2963,8 @@ function sa() {
2963
2963
  }
2964
2964
  function re(e, t) {
2965
2965
  try {
2966
- var n = Wr(e), r = Wr(t);
2967
- if (n !== r) return n === "Array" ? 1 : r === "Array" ? -1 : n === "binary" ? 1 : r === "binary" ? -1 : n === "string" ? 1 : r === "string" ? -1 : n === "Date" ? 1 : r !== "Date" ? NaN : -1;
2966
+ var n = Wr(e), s = Wr(t);
2967
+ if (n !== s) return n === "Array" ? 1 : s === "Array" ? -1 : n === "binary" ? 1 : s === "binary" ? -1 : n === "string" ? 1 : s === "string" ? -1 : n === "Date" ? 1 : s !== "Date" ? NaN : -1;
2968
2968
  switch (n) {
2969
2969
  case "number":
2970
2970
  case "Date":
@@ -2996,16 +2996,16 @@ function sa() {
2996
2996
  return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
2997
2997
  }
2998
2998
  var Qr = (fe.prototype._trans = function(e, t, n) {
2999
- var r = this._tx || z.trans, o = this.name, f = Ke && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
2999
+ var s = this._tx || z.trans, o = this.name, f = Ke && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
3000
3000
  function d(w, T, g) {
3001
3001
  if (!g.schema[o]) throw new V.NotFound("Table " + o + " not part of transaction");
3002
3002
  return t(g.idbtrans, g);
3003
3003
  }
3004
3004
  var m = Rt();
3005
3005
  try {
3006
- var v = r && r.db._novip === this.db._novip ? r === z.trans ? r._promise(e, d, n) : et(function() {
3007
- return r._promise(e, d, n);
3008
- }, { trans: r, transless: z.transless || z }) : function w(T, g, R, b) {
3006
+ var v = s && s.db._novip === this.db._novip ? s === z.trans ? s._promise(e, d, n) : et(function() {
3007
+ return s._promise(e, d, n);
3008
+ }, { trans: s, transless: z.transless || z }) : function w(T, g, R, b) {
3009
3009
  if (T.idbdb && (T._state.openComplete || z.letThrough || T._vip)) {
3010
3010
  var x = T._createTransaction(g, R, T._dbSchema);
3011
3011
  try {
@@ -3046,8 +3046,8 @@ function sa() {
3046
3046
  }
3047
3047
  }, fe.prototype.get = function(e, t) {
3048
3048
  var n = this;
3049
- return e && e.constructor === Object ? this.where(e).first(t) : e == null ? ye(new V.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(r) {
3050
- return n.core.get({ trans: r, key: e }).then(function(o) {
3049
+ return e && e.constructor === Object ? this.where(e).first(t) : e == null ? ye(new V.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(s) {
3050
+ return n.core.get({ trans: s, key: e }).then(function(o) {
3051
3051
  return n.hook.reading.fire(o);
3052
3052
  });
3053
3053
  }).then(t);
@@ -3074,12 +3074,12 @@ function sa() {
3074
3074
  }));
3075
3075
  }
3076
3076
  !n && Ke && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
3077
- var r = this.schema.idxByName;
3077
+ var s = this.schema.idxByName;
3078
3078
  function o(m, v) {
3079
3079
  return re(m, v) === 0;
3080
3080
  }
3081
3081
  var d = t.reduce(function(g, v) {
3082
- var w = g[0], T = g[1], g = r[v], R = e[v];
3082
+ var w = g[0], T = g[1], g = s[v], R = e[v];
3083
3083
  return [w || g, w || !g ? mt(T, g && g.multi ? function(b) {
3084
3084
  return b = ve(b, v), p(b) && b.some(function(x) {
3085
3085
  return o(R, x);
@@ -3108,7 +3108,7 @@ function sa() {
3108
3108
  }, fe.prototype.reverse = function() {
3109
3109
  return this.toCollection().reverse();
3110
3110
  }, fe.prototype.mapToClass = function(e) {
3111
- var t, n = this.db, r = this.name;
3111
+ var t, n = this.db, s = this.name;
3112
3112
  function o() {
3113
3113
  return t !== null && t.apply(this, arguments) || this;
3114
3114
  }
@@ -3121,7 +3121,7 @@ function sa() {
3121
3121
  }(o, t = e), Object.defineProperty(o.prototype, "db", { get: function() {
3122
3122
  return n;
3123
3123
  }, enumerable: !1, configurable: !0 }), o.prototype.table = function() {
3124
- return r;
3124
+ return s;
3125
3125
  }, e = o);
3126
3126
  for (var f = /* @__PURE__ */ new Set(), d = e.prototype; d; d = y(d)) Object.getOwnPropertyNames(d).forEach(function(v) {
3127
3127
  return f.add(v);
@@ -3141,7 +3141,7 @@ function sa() {
3141
3141
  h(this, e);
3142
3142
  });
3143
3143
  }, fe.prototype.add = function(e, t) {
3144
- var n = this, r = this.schema.primKey, o = r.auto, f = r.keyPath, d = e;
3144
+ var n = this, s = this.schema.primKey, o = s.auto, f = s.keyPath, d = e;
3145
3145
  return f && o && (d = mn(f)(e)), this._trans("readwrite", function(m) {
3146
3146
  return n.core.mutate({ trans: m, type: "add", keys: t != null ? [t] : null, values: [d] });
3147
3147
  }).then(function(m) {
@@ -3156,7 +3156,7 @@ function sa() {
3156
3156
  }, fe.prototype.update = function(e, t) {
3157
3157
  return typeof e != "object" || p(e) ? this.where(":id").equals(e).modify(t) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? ye(new V.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
3158
3158
  }, fe.prototype.put = function(e, t) {
3159
- var n = this, r = this.schema.primKey, o = r.auto, f = r.keyPath, d = e;
3159
+ var n = this, s = this.schema.primKey, o = s.auto, f = s.keyPath, d = e;
3160
3160
  return f && o && (d = mn(f)(e)), this._trans("readwrite", function(m) {
3161
3161
  return n.core.mutate({ trans: m, type: "put", values: [d], keys: t != null ? [t] : null });
3162
3162
  }).then(function(m) {
@@ -3185,46 +3185,46 @@ function sa() {
3185
3185
  }, fe.prototype.bulkGet = function(e) {
3186
3186
  var t = this;
3187
3187
  return this._trans("readonly", function(n) {
3188
- return t.core.getMany({ keys: e, trans: n }).then(function(r) {
3189
- return r.map(function(o) {
3188
+ return t.core.getMany({ keys: e, trans: n }).then(function(s) {
3189
+ return s.map(function(o) {
3190
3190
  return t.hook.reading.fire(o);
3191
3191
  });
3192
3192
  });
3193
3193
  });
3194
3194
  }, fe.prototype.bulkAdd = function(e, t, n) {
3195
- var r = this, o = Array.isArray(t) ? t : void 0, f = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
3195
+ var s = this, o = Array.isArray(t) ? t : void 0, f = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
3196
3196
  return this._trans("readwrite", function(d) {
3197
- var w = r.schema.primKey, m = w.auto, w = w.keyPath;
3197
+ var w = s.schema.primKey, m = w.auto, w = w.keyPath;
3198
3198
  if (w && o) throw new V.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
3199
3199
  if (o && o.length !== e.length) throw new V.InvalidArgument("Arguments objects and keys must have the same length");
3200
3200
  var v = e.length, w = w && m ? e.map(mn(w)) : e;
3201
- return r.core.mutate({ trans: d, type: "add", keys: o, values: w, wantResults: f }).then(function(x) {
3201
+ return s.core.mutate({ trans: d, type: "add", keys: o, values: w, wantResults: f }).then(function(x) {
3202
3202
  var g = x.numFailures, R = x.results, b = x.lastResult, x = x.failures;
3203
3203
  if (g === 0) return f ? R : b;
3204
- throw new St("".concat(r.name, ".bulkAdd(): ").concat(g, " of ").concat(v, " operations failed"), x);
3204
+ throw new St("".concat(s.name, ".bulkAdd(): ").concat(g, " of ").concat(v, " operations failed"), x);
3205
3205
  });
3206
3206
  });
3207
3207
  }, fe.prototype.bulkPut = function(e, t, n) {
3208
- var r = this, o = Array.isArray(t) ? t : void 0, f = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
3208
+ var s = this, o = Array.isArray(t) ? t : void 0, f = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
3209
3209
  return this._trans("readwrite", function(d) {
3210
- var w = r.schema.primKey, m = w.auto, w = w.keyPath;
3210
+ var w = s.schema.primKey, m = w.auto, w = w.keyPath;
3211
3211
  if (w && o) throw new V.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
3212
3212
  if (o && o.length !== e.length) throw new V.InvalidArgument("Arguments objects and keys must have the same length");
3213
3213
  var v = e.length, w = w && m ? e.map(mn(w)) : e;
3214
- return r.core.mutate({ trans: d, type: "put", keys: o, values: w, wantResults: f }).then(function(x) {
3214
+ return s.core.mutate({ trans: d, type: "put", keys: o, values: w, wantResults: f }).then(function(x) {
3215
3215
  var g = x.numFailures, R = x.results, b = x.lastResult, x = x.failures;
3216
3216
  if (g === 0) return f ? R : b;
3217
- throw new St("".concat(r.name, ".bulkPut(): ").concat(g, " of ").concat(v, " operations failed"), x);
3217
+ throw new St("".concat(s.name, ".bulkPut(): ").concat(g, " of ").concat(v, " operations failed"), x);
3218
3218
  });
3219
3219
  });
3220
3220
  }, fe.prototype.bulkUpdate = function(e) {
3221
- var t = this, n = this.core, r = e.map(function(d) {
3221
+ var t = this, n = this.core, s = e.map(function(d) {
3222
3222
  return d.key;
3223
3223
  }), o = e.map(function(d) {
3224
3224
  return d.changes;
3225
3225
  }), f = [];
3226
3226
  return this._trans("readwrite", function(d) {
3227
- return n.getMany({ trans: d, keys: r, cache: "clone" }).then(function(m) {
3227
+ return n.getMany({ trans: d, keys: s, cache: "clone" }).then(function(m) {
3228
3228
  var v = [], w = [];
3229
3229
  e.forEach(function(g, R) {
3230
3230
  var b = g.key, x = g.changes, S = m[R];
@@ -3239,7 +3239,7 @@ function sa() {
3239
3239
  }
3240
3240
  });
3241
3241
  var T = v.length;
3242
- return n.mutate({ trans: d, type: "put", keys: v, values: w, updates: { keys: r, changeSpecs: o } }).then(function(g) {
3242
+ return n.mutate({ trans: d, type: "put", keys: v, values: w, updates: { keys: s, changeSpecs: o } }).then(function(g) {
3243
3243
  var R = g.numFailures, b = g.failures;
3244
3244
  if (R === 0) return T;
3245
3245
  for (var x = 0, S = Object.keys(b); x < S.length; x++) {
@@ -3252,8 +3252,8 @@ function sa() {
3252
3252
  });
3253
3253
  }, fe.prototype.bulkDelete = function(e) {
3254
3254
  var t = this, n = e.length;
3255
- return this._trans("readwrite", function(r) {
3256
- return t.core.mutate({ trans: r, type: "delete", keys: e });
3255
+ return this._trans("readwrite", function(s) {
3256
+ return t.core.mutate({ trans: s, type: "delete", keys: e });
3257
3257
  }).then(function(d) {
3258
3258
  var o = d.numFailures, f = d.lastResult, d = d.failures;
3259
3259
  if (o === 0) return f;
@@ -3272,7 +3272,7 @@ function sa() {
3272
3272
  }
3273
3273
  var n = {};
3274
3274
  t.addEventType = f;
3275
- for (var r = 1, o = arguments.length; r < o; ++r) f(arguments[r]);
3275
+ for (var s = 1, o = arguments.length; s < o; ++s) f(arguments[s]);
3276
3276
  return t;
3277
3277
  function f(d, m, v) {
3278
3278
  if (typeof d != "object") {
@@ -3314,10 +3314,10 @@ function sa() {
3314
3314
  e.filter = mt(e.filter, t);
3315
3315
  }
3316
3316
  function $n(e, t, n) {
3317
- var r = e.replayFilter;
3318
- e.replayFilter = r ? function() {
3319
- return mt(r(), t());
3320
- } : t, e.justLimit = n && !r;
3317
+ var s = e.replayFilter;
3318
+ e.replayFilter = s ? function() {
3319
+ return mt(s(), t());
3320
+ } : t, e.justLimit = n && !s;
3321
3321
  }
3322
3322
  function yn(e, t) {
3323
3323
  if (e.isPrimKey) return t.primaryKey;
@@ -3326,10 +3326,10 @@ function sa() {
3326
3326
  return n;
3327
3327
  }
3328
3328
  function $r(e, t, n) {
3329
- var r = yn(e, t.schema);
3330
- return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: r, range: e.range } });
3329
+ var s = yn(e, t.schema);
3330
+ return t.openCursor({ trans: n, values: !e.keysOnly, reverse: e.dir === "prev", unique: !!e.unique, query: { index: s, range: e.range } });
3331
3331
  }
3332
- function gn(e, t, n, r) {
3332
+ function gn(e, t, n, s) {
3333
3333
  var o = e.replayFilter ? mt(e.filter, e.replayFilter()) : e.filter;
3334
3334
  if (e.or) {
3335
3335
  var f = {}, d = function(m, v, w) {
@@ -3340,13 +3340,13 @@ function sa() {
3340
3340
  return v.fail(R);
3341
3341
  }) || ((g = "" + (T = v.primaryKey)) == "[object ArrayBuffer]" && (g = "" + new Uint8Array(T)), _(f, g) || (f[g] = !0, t(m, v, w)));
3342
3342
  };
3343
- return Promise.all([e.or._iterate(d, n), Jr($r(e, r, n), e.algorithm, d, !e.keysOnly && e.valueMapper)]);
3343
+ return Promise.all([e.or._iterate(d, n), Jr($r(e, s, n), e.algorithm, d, !e.keysOnly && e.valueMapper)]);
3344
3344
  }
3345
- return Jr($r(e, r, n), mt(e.algorithm, o), t, !e.keysOnly && e.valueMapper);
3345
+ return Jr($r(e, s, n), mt(e.algorithm, o), t, !e.keysOnly && e.valueMapper);
3346
3346
  }
3347
- function Jr(e, t, n, r) {
3348
- var o = de(r ? function(f, d, m) {
3349
- return n(r(f), d, m);
3347
+ function Jr(e, t, n, s) {
3348
+ var o = de(s ? function(f, d, m) {
3349
+ return n(s(f), d, m);
3350
3350
  } : n);
3351
3351
  return e.then(function(f) {
3352
3352
  if (f) return f.start(function() {
@@ -3379,17 +3379,17 @@ function sa() {
3379
3379
  throw new TypeError("Invalid term ".concat(n));
3380
3380
  }
3381
3381
  if (t.remove !== void 0) {
3382
- var r = t.remove;
3383
- if (p(r)) return p(e) ? e.filter(function(o) {
3384
- return !r.includes(o);
3382
+ var s = t.remove;
3383
+ if (p(s)) return p(e) ? e.filter(function(o) {
3384
+ return !s.includes(o);
3385
3385
  }).sort() : [];
3386
- if (typeof r == "number") return Number(e) - r;
3387
- if (typeof r == "bigint") try {
3388
- return BigInt(e) - r;
3386
+ if (typeof s == "number") return Number(e) - s;
3387
+ if (typeof s == "bigint") try {
3388
+ return BigInt(e) - s;
3389
3389
  } catch {
3390
- return BigInt(0) - r;
3390
+ return BigInt(0) - s;
3391
3391
  }
3392
- throw new TypeError("Invalid subtrahend ".concat(r));
3392
+ throw new TypeError("Invalid subtrahend ".concat(s));
3393
3393
  }
3394
3394
  return n = (n = t.replacePrefix) === null || n === void 0 ? void 0 : n[0], n && typeof e == "string" && e.startsWith(n) ? t.replacePrefix[1] + e.substring(n.length) : e;
3395
3395
  }, Zr);
@@ -3420,21 +3420,21 @@ function sa() {
3420
3420
  }, ie.prototype.count = function(e) {
3421
3421
  var t = this;
3422
3422
  return this._read(function(n) {
3423
- var r = t._ctx, o = r.table.core;
3424
- if (Pt(r, !0)) return o.count({ trans: n, query: { index: yn(r, o.schema), range: r.range } }).then(function(d) {
3425
- return Math.min(d, r.limit);
3423
+ var s = t._ctx, o = s.table.core;
3424
+ if (Pt(s, !0)) return o.count({ trans: n, query: { index: yn(s, o.schema), range: s.range } }).then(function(d) {
3425
+ return Math.min(d, s.limit);
3426
3426
  });
3427
3427
  var f = 0;
3428
- return gn(r, function() {
3428
+ return gn(s, function() {
3429
3429
  return ++f, !1;
3430
3430
  }, n, o).then(function() {
3431
3431
  return f;
3432
3432
  });
3433
3433
  }).then(e);
3434
3434
  }, ie.prototype.sortBy = function(e, t) {
3435
- var n = e.split(".").reverse(), r = n[0], o = n.length - 1;
3435
+ var n = e.split(".").reverse(), s = n[0], o = n.length - 1;
3436
3436
  function f(v, w) {
3437
- return w ? f(v[n[w]], w - 1) : v[r];
3437
+ return w ? f(v[n[w]], w - 1) : v[s];
3438
3438
  }
3439
3439
  var d = this._ctx.dir === "next" ? 1 : -1;
3440
3440
  function m(v, w) {
@@ -3446,17 +3446,17 @@ function sa() {
3446
3446
  }, ie.prototype.toArray = function(e) {
3447
3447
  var t = this;
3448
3448
  return this._read(function(n) {
3449
- var r = t._ctx;
3450
- if (r.dir === "next" && Pt(r, !0) && 0 < r.limit) {
3451
- var o = r.valueMapper, f = yn(r, r.table.core.schema);
3452
- return r.table.core.query({ trans: n, limit: r.limit, values: !0, query: { index: f, range: r.range } }).then(function(m) {
3449
+ var s = t._ctx;
3450
+ if (s.dir === "next" && Pt(s, !0) && 0 < s.limit) {
3451
+ var o = s.valueMapper, f = yn(s, s.table.core.schema);
3452
+ return s.table.core.query({ trans: n, limit: s.limit, values: !0, query: { index: f, range: s.range } }).then(function(m) {
3453
3453
  return m = m.result, o ? m.map(o) : m;
3454
3454
  });
3455
3455
  }
3456
3456
  var d = [];
3457
- return gn(r, function(m) {
3457
+ return gn(s, function(m) {
3458
3458
  return d.push(m);
3459
- }, n, r.table.core).then(function() {
3459
+ }, n, s.table.core).then(function() {
3460
3460
  return d;
3461
3461
  });
3462
3462
  }, e);
@@ -3464,9 +3464,9 @@ function sa() {
3464
3464
  var t = this._ctx;
3465
3465
  return e <= 0 || (t.offset += e, Pt(t) ? $n(t, function() {
3466
3466
  var n = e;
3467
- return function(r, o) {
3467
+ return function(s, o) {
3468
3468
  return n === 0 || (n === 1 ? --n : o(function() {
3469
- r.advance(n), n = 0;
3469
+ s.advance(n), n = 0;
3470
3470
  }), !1);
3471
3471
  };
3472
3472
  }) : $n(t, function() {
@@ -3478,13 +3478,13 @@ function sa() {
3478
3478
  }, ie.prototype.limit = function(e) {
3479
3479
  return this._ctx.limit = Math.min(this._ctx.limit, e), $n(this._ctx, function() {
3480
3480
  var t = e;
3481
- return function(n, r, o) {
3482
- return --t <= 0 && r(o), 0 <= t;
3481
+ return function(n, s, o) {
3482
+ return --t <= 0 && s(o), 0 <= t;
3483
3483
  };
3484
3484
  }, !0), this;
3485
3485
  }, ie.prototype.until = function(e, t) {
3486
- return Qn(this._ctx, function(n, r, o) {
3487
- return !e(n.value) || (r(o), t);
3486
+ return Qn(this._ctx, function(n, s, o) {
3487
+ return !e(n.value) || (s(o), t);
3488
3488
  }), this;
3489
3489
  }, ie.prototype.first = function(e) {
3490
3490
  return this.limit(1).toArray(function(t) {
@@ -3507,36 +3507,36 @@ function sa() {
3507
3507
  return this.reverse();
3508
3508
  }, ie.prototype.eachKey = function(e) {
3509
3509
  var t = this._ctx;
3510
- return t.keysOnly = !t.isMatch, this.each(function(n, r) {
3511
- e(r.key, r);
3510
+ return t.keysOnly = !t.isMatch, this.each(function(n, s) {
3511
+ e(s.key, s);
3512
3512
  });
3513
3513
  }, ie.prototype.eachUniqueKey = function(e) {
3514
3514
  return this._ctx.unique = "unique", this.eachKey(e);
3515
3515
  }, ie.prototype.eachPrimaryKey = function(e) {
3516
3516
  var t = this._ctx;
3517
- return t.keysOnly = !t.isMatch, this.each(function(n, r) {
3518
- e(r.primaryKey, r);
3517
+ return t.keysOnly = !t.isMatch, this.each(function(n, s) {
3518
+ e(s.primaryKey, s);
3519
3519
  });
3520
3520
  }, ie.prototype.keys = function(e) {
3521
3521
  var t = this._ctx;
3522
3522
  t.keysOnly = !t.isMatch;
3523
3523
  var n = [];
3524
- return this.each(function(r, o) {
3524
+ return this.each(function(s, o) {
3525
3525
  n.push(o.key);
3526
3526
  }).then(function() {
3527
3527
  return n;
3528
3528
  }).then(e);
3529
3529
  }, ie.prototype.primaryKeys = function(e) {
3530
3530
  var t = this._ctx;
3531
- if (t.dir === "next" && Pt(t, !0) && 0 < t.limit) return this._read(function(r) {
3531
+ if (t.dir === "next" && Pt(t, !0) && 0 < t.limit) return this._read(function(s) {
3532
3532
  var o = yn(t, t.table.core.schema);
3533
- return t.table.core.query({ trans: r, values: !1, limit: t.limit, query: { index: o, range: t.range } });
3534
- }).then(function(r) {
3535
- return r.result;
3533
+ return t.table.core.query({ trans: s, values: !1, limit: t.limit, query: { index: o, range: t.range } });
3534
+ }).then(function(s) {
3535
+ return s.result;
3536
3536
  }).then(e);
3537
3537
  t.keysOnly = !t.isMatch;
3538
3538
  var n = [];
3539
- return this.each(function(r, o) {
3539
+ return this.each(function(s, o) {
3540
3540
  n.push(o.primaryKey);
3541
3541
  }).then(function() {
3542
3542
  return n;
@@ -3554,12 +3554,12 @@ function sa() {
3554
3554
  if (!e || !e.multi) return this;
3555
3555
  var t = {};
3556
3556
  return Qn(this._ctx, function(o) {
3557
- var r = o.primaryKey.toString(), o = _(t, r);
3558
- return t[r] = !0, !o;
3557
+ var s = o.primaryKey.toString(), o = _(t, s);
3558
+ return t[s] = !0, !o;
3559
3559
  }), this;
3560
3560
  }, ie.prototype.modify = function(e) {
3561
3561
  var t = this, n = this._ctx;
3562
- return this._write(function(r) {
3562
+ return this._write(function(s) {
3563
3563
  var o, f, d;
3564
3564
  d = typeof e == "function" ? e : (o = l(e), f = o.length, function(A) {
3565
3565
  for (var k = !1, O = 0; O < f; ++O) {
@@ -3582,20 +3582,20 @@ function sa() {
3582
3582
  return t.clone().primaryKeys().then(function(A) {
3583
3583
  function k(M) {
3584
3584
  var I = Math.min(T, A.length - M);
3585
- return m.getMany({ trans: r, keys: A.slice(M, M + I), cache: "immutable" }).then(function(D) {
3585
+ return m.getMany({ trans: s, keys: A.slice(M, M + I), cache: "immutable" }).then(function(D) {
3586
3586
  for (var K = [], N = [], F = v ? [] : null, B = [], j = 0; j < I; ++j) {
3587
3587
  var G = D[j], $ = { value: ke(G), primKey: A[M + j] };
3588
3588
  d.call($, $.value, $) !== !1 && ($.value == null ? B.push(A[M + j]) : v || re(w(G), w($.value)) === 0 ? (N.push($.value), v && F.push(A[M + j])) : (B.push(A[M + j]), K.push($.value)));
3589
3589
  }
3590
- return Promise.resolve(0 < K.length && m.mutate({ trans: r, type: "add", values: K }).then(function(ee) {
3590
+ return Promise.resolve(0 < K.length && m.mutate({ trans: s, type: "add", values: K }).then(function(ee) {
3591
3591
  for (var te in ee.failures) B.splice(parseInt(te), 1);
3592
3592
  R(K.length, ee);
3593
3593
  })).then(function() {
3594
- return (0 < N.length || O && typeof e == "object") && m.mutate({ trans: r, type: "put", keys: F, values: N, criteria: O, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < M }).then(function(ee) {
3594
+ return (0 < N.length || O && typeof e == "object") && m.mutate({ trans: s, type: "put", keys: F, values: N, criteria: O, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < M }).then(function(ee) {
3595
3595
  return R(N.length, ee);
3596
3596
  });
3597
3597
  }).then(function() {
3598
- return (0 < B.length || O && e === Jn) && m.mutate({ trans: r, type: "delete", keys: B, criteria: O, isAdditionalChunk: 0 < M }).then(function(ee) {
3598
+ return (0 < B.length || O && e === Jn) && m.mutate({ trans: s, type: "delete", keys: B, criteria: O, isAdditionalChunk: 0 < M }).then(function(ee) {
3599
3599
  return R(B.length, ee);
3600
3600
  });
3601
3601
  }).then(function() {
@@ -3613,8 +3613,8 @@ function sa() {
3613
3613
  }, ie.prototype.delete = function() {
3614
3614
  var e = this._ctx, t = e.range;
3615
3615
  return Pt(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
3616
- var r = e.table.core.schema.primaryKey, o = t;
3617
- return e.table.core.count({ trans: n, query: { index: r, range: o } }).then(function(f) {
3616
+ var s = e.table.core.schema.primaryKey, o = t;
3617
+ return e.table.core.count({ trans: n, query: { index: s, range: o } }).then(function(f) {
3618
3618
  return e.table.core.mutate({ trans: n, type: "deleteRange", range: o }).then(function(d) {
3619
3619
  var m = d.failures;
3620
3620
  if (d.lastResult, d.results, d = d.numFailures, d) throw new rn("Could not delete some values", Object.keys(m).map(function(v) {
@@ -3644,7 +3644,7 @@ function sa() {
3644
3644
  return es("");
3645
3645
  }).limit(0);
3646
3646
  }
3647
- function vn(e, t, n, r) {
3647
+ function vn(e, t, n, s) {
3648
3648
  var o, f, d, m, v, w, T, g = n.length;
3649
3649
  if (!n.every(function(x) {
3650
3650
  return typeof x == "string";
@@ -3668,10 +3668,10 @@ function sa() {
3668
3668
  return A.upper;
3669
3669
  }), v = S.map(function(A) {
3670
3670
  return A.lower;
3671
- }), T = (w = x) === "next" ? "" : r;
3671
+ }), T = (w = x) === "next" ? "" : s;
3672
3672
  }
3673
3673
  R("next"), e = new e.Collection(e, function() {
3674
- return rt(m[0], v[g - 1] + r);
3674
+ return rt(m[0], v[g - 1] + s);
3675
3675
  }), e._ondirectionchange = function(x) {
3676
3676
  R(x);
3677
3677
  };
@@ -3697,19 +3697,19 @@ function sa() {
3697
3697
  } : A), !1;
3698
3698
  }), e;
3699
3699
  }
3700
- function rt(e, t, n, r) {
3701
- return { type: 2, lower: e, upper: t, lowerOpen: n, upperOpen: r };
3700
+ function rt(e, t, n, s) {
3701
+ return { type: 2, lower: e, upper: t, lowerOpen: n, upperOpen: s };
3702
3702
  }
3703
3703
  function es(e) {
3704
3704
  return { type: 1, lower: e, upper: e };
3705
3705
  }
3706
3706
  var ts = (Object.defineProperty(_e.prototype, "Collection", { get: function() {
3707
3707
  return this._ctx.table.db.Collection;
3708
- }, enumerable: !1, configurable: !0 }), _e.prototype.between = function(e, t, n, r) {
3709
- n = n !== !1, r = r === !0;
3708
+ }, enumerable: !1, configurable: !0 }), _e.prototype.between = function(e, t, n, s) {
3709
+ n = n !== !1, s = s === !0;
3710
3710
  try {
3711
- return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || r) && (!n || !r) ? Ct(this) : new this.Collection(this, function() {
3712
- return rt(e, t, !n, !r);
3711
+ return 0 < this._cmp(e, t) || this._cmp(e, t) === 0 && (n || s) && (!n || !s) ? Ct(this) : new this.Collection(this, function() {
3712
+ return rt(e, t, !n, !s);
3713
3713
  });
3714
3714
  } catch {
3715
3715
  return Oe(this, Ve);
@@ -3752,8 +3752,8 @@ function sa() {
3752
3752
  }, _e.prototype.startsWithAnyOfIgnoreCase = function() {
3753
3753
  var e = De.apply(Je, arguments);
3754
3754
  return e.length === 0 ? Ct(this) : vn(this, function(t, n) {
3755
- return n.some(function(r) {
3756
- return t.indexOf(r) === 0;
3755
+ return n.some(function(s) {
3756
+ return t.indexOf(s) === 0;
3757
3757
  });
3758
3758
  }, e, pt);
3759
3759
  }, _e.prototype.anyOf = function() {
@@ -3764,19 +3764,19 @@ function sa() {
3764
3764
  return Oe(this, Ve);
3765
3765
  }
3766
3766
  if (t.length === 0) return Ct(this);
3767
- var r = new this.Collection(this, function() {
3767
+ var s = new this.Collection(this, function() {
3768
3768
  return rt(t[0], t[t.length - 1]);
3769
3769
  });
3770
- r._ondirectionchange = function(f) {
3770
+ s._ondirectionchange = function(f) {
3771
3771
  n = f === "next" ? e._ascending : e._descending, t.sort(n);
3772
3772
  };
3773
3773
  var o = 0;
3774
- return r._addAlgorithm(function(f, d, m) {
3774
+ return s._addAlgorithm(function(f, d, m) {
3775
3775
  for (var v = f.key; 0 < n(v, t[o]); ) if (++o === t.length) return d(m), !1;
3776
3776
  return n(v, t[o]) === 0 || (d(function() {
3777
3777
  f.continue(t[o]);
3778
3778
  }), !1);
3779
- }), r;
3779
+ }), s;
3780
3780
  }, _e.prototype.notEqual = function(e) {
3781
3781
  return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
3782
3782
  }, _e.prototype.noneOf = function() {
@@ -3787,12 +3787,12 @@ function sa() {
3787
3787
  } catch {
3788
3788
  return Oe(this, Ve);
3789
3789
  }
3790
- var t = e.reduce(function(n, r) {
3791
- return n ? n.concat([[n[n.length - 1][1], r]]) : [[-1 / 0, r]];
3790
+ var t = e.reduce(function(n, s) {
3791
+ return n ? n.concat([[n[n.length - 1][1], s]]) : [[-1 / 0, s]];
3792
3792
  }, null);
3793
3793
  return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, { includeLowers: !1, includeUppers: !1 });
3794
3794
  }, _e.prototype.inAnyRange = function(k, t) {
3795
- var n = this, r = this._cmp, o = this._ascending, f = this._descending, d = this._min, m = this._max;
3795
+ var n = this, s = this._cmp, o = this._ascending, f = this._descending, d = this._min, m = this._max;
3796
3796
  if (k.length === 0) return Ct(this);
3797
3797
  if (!k.every(function(O) {
3798
3798
  return O[0] !== void 0 && O[1] !== void 0 && o(O[0], O[1]) <= 0;
@@ -3805,7 +3805,7 @@ function sa() {
3805
3805
  (T = k.reduce(function(O, M) {
3806
3806
  for (var I = 0, D = O.length; I < D; ++I) {
3807
3807
  var K = O[I];
3808
- if (r(M[0], K[1]) < 0 && 0 < r(M[1], K[0])) {
3808
+ if (s(M[0], K[1]) < 0 && 0 < s(M[1], K[0])) {
3809
3809
  K[0] = d(K[0], M[0]), K[1] = m(K[1], M[1]);
3810
3810
  break;
3811
3811
  }
@@ -3868,14 +3868,14 @@ function sa() {
3868
3868
  }, Ue.prototype.create = function(e) {
3869
3869
  var t = this;
3870
3870
  if (!this.mode) return this;
3871
- var n = this.db.idbdb, r = this.db._state.dbOpenError;
3872
- if (J(!this.idbtrans), !e && !n) switch (r && r.name) {
3871
+ var n = this.db.idbdb, s = this.db._state.dbOpenError;
3872
+ if (J(!this.idbtrans), !e && !n) switch (s && s.name) {
3873
3873
  case "DatabaseClosedError":
3874
- throw new V.DatabaseClosed(r);
3874
+ throw new V.DatabaseClosed(s);
3875
3875
  case "MissingAPIError":
3876
- throw new V.MissingAPI(r.message, r);
3876
+ throw new V.MissingAPI(s.message, s);
3877
3877
  default:
3878
- throw new V.OpenFailed(r);
3878
+ throw new V.OpenFailed(s);
3879
3879
  }
3880
3880
  if (!this.active) throw new V.TransactionInactive();
3881
3881
  return J(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = de(function(o) {
@@ -3886,42 +3886,42 @@ function sa() {
3886
3886
  t.active = !1, t._resolve(), "mutatedParts" in e && st.storagemutated.fire(e.mutatedParts);
3887
3887
  }), this;
3888
3888
  }, Ue.prototype._promise = function(e, t, n) {
3889
- var r = this;
3889
+ var s = this;
3890
3890
  if (e === "readwrite" && this.mode !== "readwrite") return ye(new V.ReadOnly("Transaction is readonly"));
3891
3891
  if (!this.active) return ye(new V.TransactionInactive());
3892
3892
  if (this._locked()) return new U(function(f, d) {
3893
- r._blockedFuncs.push([function() {
3894
- r._promise(e, t, n).then(f, d);
3893
+ s._blockedFuncs.push([function() {
3894
+ s._promise(e, t, n).then(f, d);
3895
3895
  }, z]);
3896
3896
  });
3897
3897
  if (n) return et(function() {
3898
3898
  var f = new U(function(d, m) {
3899
- r._lock();
3900
- var v = t(d, m, r);
3899
+ s._lock();
3900
+ var v = t(d, m, s);
3901
3901
  v && v.then && v.then(d, m);
3902
3902
  });
3903
3903
  return f.finally(function() {
3904
- return r._unlock();
3904
+ return s._unlock();
3905
3905
  }), f._lib = !0, f;
3906
3906
  });
3907
3907
  var o = new U(function(f, d) {
3908
- var m = t(f, d, r);
3908
+ var m = t(f, d, s);
3909
3909
  m && m.then && m.then(f, d);
3910
3910
  });
3911
3911
  return o._lib = !0, o;
3912
3912
  }, Ue.prototype._root = function() {
3913
3913
  return this.parent ? this.parent._root() : this;
3914
3914
  }, Ue.prototype.waitFor = function(e) {
3915
- var t, n = this._root(), r = U.resolve(e);
3915
+ var t, n = this._root(), s = U.resolve(e);
3916
3916
  n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
3917
- return r;
3918
- }) : (n._waitingFor = r, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function f() {
3917
+ return s;
3918
+ }) : (n._waitingFor = s, n._waitingQueue = [], t = n.idbtrans.objectStore(n.storeNames[0]), function f() {
3919
3919
  for (++n._spinCount; n._waitingQueue.length; ) n._waitingQueue.shift()();
3920
3920
  n._waitingFor && (t.get(-1 / 0).onsuccess = f);
3921
3921
  }());
3922
3922
  var o = n._waitingFor;
3923
3923
  return new U(function(f, d) {
3924
- r.then(function(m) {
3924
+ s.then(function(m) {
3925
3925
  return n._waitingQueue.push(de(f.bind(null, m)));
3926
3926
  }, function(m) {
3927
3927
  return n._waitingQueue.push(de(d.bind(null, m)));
@@ -3940,19 +3940,19 @@ function sa() {
3940
3940
  }, Ue);
3941
3941
  function Ue() {
3942
3942
  }
3943
- function er(e, t, n, r, o, f, d) {
3944
- return { name: e, keyPath: t, unique: n, multi: r, auto: o, compound: f, src: (n && !d ? "&" : "") + (r ? "*" : "") + (o ? "++" : "") + ns(t) };
3943
+ function er(e, t, n, s, o, f, d) {
3944
+ return { name: e, keyPath: t, unique: n, multi: s, auto: o, compound: f, src: (n && !d ? "&" : "") + (s ? "*" : "") + (o ? "++" : "") + ns(t) };
3945
3945
  }
3946
3946
  function ns(e) {
3947
3947
  return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
3948
3948
  }
3949
3949
  function tr(e, t, n) {
3950
- return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (r = function(o) {
3950
+ return { name: e, primKey: t, indexes: n, mappedClass: null, idxByName: (s = function(o) {
3951
3951
  return [o.name, o];
3952
3952
  }, n.reduce(function(o, f, d) {
3953
- return d = r(f, d), d && (o[d[0]] = d[1]), o;
3953
+ return d = s(f, d), d && (o[d[0]] = d[1]), o;
3954
3954
  }, {})) };
3955
- var r;
3955
+ var s;
3956
3956
  }
3957
3957
  var Wt = function(e) {
3958
3958
  try {
@@ -3984,7 +3984,7 @@ function sa() {
3984
3984
  return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
3985
3985
  }
3986
3986
  function li(e, t, v) {
3987
- function r(A) {
3987
+ function s(A) {
3988
3988
  if (A.type === 3) return null;
3989
3989
  if (A.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
3990
3990
  var b = A.lower, x = A.upper, S = A.lowerOpen, A = A.upperOpen;
@@ -4007,7 +4007,7 @@ function sa() {
4007
4007
  var ee = [], te = [], Me = 0;
4008
4008
  if (k === "deleteRange") {
4009
4009
  if (I.type === 4) return D({ numFailures: Me, failures: te, results: [], lastResult: void 0 });
4010
- I.type === 3 ? ee.push(j = N.clear()) : ee.push(j = N.delete(r(I)));
4010
+ I.type === 3 ? ee.push(j = N.clear()) : ee.push(j = N.delete(s(I)));
4011
4011
  } else {
4012
4012
  var F = B ? F ? [M, O] : [M, null] : [O, null], Y = F[0], Te = F[1];
4013
4013
  if (B) for (var Ee = 0; Ee < G; ++Ee) ee.push(j = Te && Te[Ee] !== void 0 ? N[k](Y[Ee], Te[Ee]) : N[k](Y[Ee])), j.onerror = $;
@@ -4045,7 +4045,7 @@ function sa() {
4045
4045
  }, query: (b = w, function(S) {
4046
4046
  return new Promise(function(A, k) {
4047
4047
  A = de(A);
4048
- var O, M, I, F = S.trans, D = S.values, K = S.limit, j = S.query, N = K === 1 / 0 ? void 0 : K, B = j.index, j = j.range, F = F.objectStore(x), B = B.isPrimaryKey ? F : F.index(B.name), j = r(j);
4048
+ var O, M, I, F = S.trans, D = S.values, K = S.limit, j = S.query, N = K === 1 / 0 ? void 0 : K, B = j.index, j = j.range, F = F.objectStore(x), B = B.isPrimaryKey ? F : F.index(B.name), j = s(j);
4049
4049
  if (K === 0) return A({ result: [] });
4050
4050
  b ? ((N = D ? B.getAll(j, N) : B.getAllKeys(j, N)).onsuccess = function(G) {
4051
4051
  return A({ result: G.target.result });
@@ -4058,7 +4058,7 @@ function sa() {
4058
4058
  var A = S.trans, k = S.values, O = S.query, M = S.reverse, I = S.unique;
4059
4059
  return new Promise(function(D, K) {
4060
4060
  D = de(D);
4061
- var B = O.index, N = O.range, F = A.objectStore(x), F = B.isPrimaryKey ? F : F.index(B.name), B = M ? I ? "prevunique" : "prev" : I ? "nextunique" : "next", j = !k && "openKeyCursor" in F ? F.openKeyCursor(r(N), B) : F.openCursor(r(N), B);
4061
+ var B = O.index, N = O.range, F = A.objectStore(x), F = B.isPrimaryKey ? F : F.index(B.name), B = M ? I ? "prevunique" : "prev" : I ? "nextunique" : "next", j = !k && "openKeyCursor" in F ? F.openKeyCursor(s(N), B) : F.openCursor(s(N), B);
4062
4062
  j.onerror = Be(K), j.onsuccess = de(function(G) {
4063
4063
  var $, ee, te, Me, Y = j.result;
4064
4064
  Y ? (Y.___id = ++ci, Y.done = !1, $ = Y.continue.bind(Y), ee = (ee = Y.continuePrimaryKey) && ee.bind(Y), te = Y.advance.bind(Y), Me = function() {
@@ -4097,7 +4097,7 @@ function sa() {
4097
4097
  }, count: function(S) {
4098
4098
  var A = S.query, k = S.trans, O = A.index, M = A.range;
4099
4099
  return new Promise(function(I, D) {
4100
- var K = k.objectStore(x), N = O.isPrimaryKey ? K : K.index(O.name), K = r(M), N = K ? N.count(K) : N.count();
4100
+ var K = k.objectStore(x), N = O.isPrimaryKey ? K : K.index(O.name), K = s(M), N = K ? N.count(K) : N.count();
4101
4101
  N.onsuccess = de(function(F) {
4102
4102
  return I(F.target.result);
4103
4103
  }), N.onerror = Be(D);
@@ -4124,24 +4124,24 @@ function sa() {
4124
4124
  return g[R];
4125
4125
  }, MIN_KEY: -1 / 0, MAX_KEY: Wt(t), schema: v };
4126
4126
  }
4127
- function fi(e, t, n, r) {
4127
+ function fi(e, t, n, s) {
4128
4128
  var o = n.IDBKeyRange;
4129
- return n.indexedDB, { dbcore: (r = li(t, o, r), e.dbcore.reduce(function(f, d) {
4129
+ return n.indexedDB, { dbcore: (s = li(t, o, s), e.dbcore.reduce(function(f, d) {
4130
4130
  return d = d.create, a(a({}, f), d(f));
4131
- }, r)) };
4131
+ }, s)) };
4132
4132
  }
4133
- function bn(e, r) {
4134
- var n = r.db, r = fi(e._middlewares, n, e._deps, r);
4135
- e.core = r.dbcore, e.tables.forEach(function(o) {
4133
+ function bn(e, s) {
4134
+ var n = s.db, s = fi(e._middlewares, n, e._deps, s);
4135
+ e.core = s.dbcore, e.tables.forEach(function(o) {
4136
4136
  var f = o.name;
4137
4137
  e.core.schema.tables.some(function(d) {
4138
4138
  return d.name === f;
4139
4139
  }) && (o.core = e.core.table(f), e[f] instanceof e.Table && (e[f].core = o.core));
4140
4140
  });
4141
4141
  }
4142
- function wn(e, t, n, r) {
4142
+ function wn(e, t, n, s) {
4143
4143
  n.forEach(function(o) {
4144
- var f = r[o];
4144
+ var f = s[o];
4145
4145
  t.forEach(function(d) {
4146
4146
  var m = function v(w, T) {
4147
4147
  return H(w, T) || (w = y(w)) && v(w, T);
@@ -4156,17 +4156,17 @@ function sa() {
4156
4156
  }
4157
4157
  function rr(e, t) {
4158
4158
  t.forEach(function(n) {
4159
- for (var r in n) n[r] instanceof e.Table && delete n[r];
4159
+ for (var s in n) n[s] instanceof e.Table && delete n[s];
4160
4160
  });
4161
4161
  }
4162
4162
  function hi(e, t) {
4163
4163
  return e._cfg.version - t._cfg.version;
4164
4164
  }
4165
- function di(e, t, n, r) {
4165
+ function di(e, t, n, s) {
4166
4166
  var o = e._dbSchema;
4167
4167
  n.objectStoreNames.contains("$meta") && !o.$meta && (o.$meta = tr("$meta", is("")[0], []), e._storeNames.push("$meta"));
4168
4168
  var f = e._createTransaction("readwrite", e._storeNames, o);
4169
- f.create(n), f._completion.catch(r);
4169
+ f.create(n), f._completion.catch(s);
4170
4170
  var d = f._reject.bind(f), m = z.transless || z;
4171
4171
  et(function() {
4172
4172
  return z.trans = f, z.transless = m, t !== 0 ? (bn(e, n), w = t, ((v = f).storeNames.includes("$meta") ? v.table("$meta").get("version").then(function(T) {
@@ -4235,25 +4235,25 @@ function sa() {
4235
4235
  ss(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
4236
4236
  var n = An(0, e.idbdb, t);
4237
4237
  xn(e, e._dbSchema, t);
4238
- for (var r = 0, o = sr(n, e._dbSchema).change; r < o.length; r++) {
4238
+ for (var s = 0, o = sr(n, e._dbSchema).change; s < o.length; s++) {
4239
4239
  var f = function(d) {
4240
4240
  if (d.change.length || d.recreate) return console.warn("Unable to patch indexes of table ".concat(d.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
4241
4241
  var m = t.objectStore(d.name);
4242
4242
  d.add.forEach(function(v) {
4243
4243
  Ke && console.debug("Dexie upgrade patch: Creating missing index ".concat(d.name, ".").concat(v.src)), _n(m, v);
4244
4244
  });
4245
- }(o[r]);
4245
+ }(o[s]);
4246
4246
  if (typeof f == "object") return f.value;
4247
4247
  }
4248
4248
  }
4249
4249
  function sr(e, t) {
4250
- var n, r = { del: [], add: [], change: [] };
4251
- for (n in e) t[n] || r.del.push(n);
4250
+ var n, s = { del: [], add: [], change: [] };
4251
+ for (n in e) t[n] || s.del.push(n);
4252
4252
  for (n in t) {
4253
4253
  var o = e[n], f = t[n];
4254
4254
  if (o) {
4255
4255
  var d = { name: n, def: f, recreate: !1, del: [], add: [], change: [] };
4256
- if ("" + (o.primKey.keyPath || "") != "" + (f.primKey.keyPath || "") || o.primKey.auto !== f.primKey.auto) d.recreate = !0, r.change.push(d);
4256
+ if ("" + (o.primKey.keyPath || "") != "" + (f.primKey.keyPath || "") || o.primKey.auto !== f.primKey.auto) d.recreate = !0, s.change.push(d);
4257
4257
  else {
4258
4258
  var m = o.idxByName, v = f.idxByName, w = void 0;
4259
4259
  for (w in m) v[w] || d.del.push(w);
@@ -4261,15 +4261,15 @@ function sa() {
4261
4261
  var T = m[w], g = v[w];
4262
4262
  T ? T.src !== g.src && d.change.push(g) : d.add.push(g);
4263
4263
  }
4264
- (0 < d.del.length || 0 < d.add.length || 0 < d.change.length) && r.change.push(d);
4264
+ (0 < d.del.length || 0 < d.add.length || 0 < d.change.length) && s.change.push(d);
4265
4265
  }
4266
- } else r.add.push([n, f]);
4266
+ } else s.add.push([n, f]);
4267
4267
  }
4268
- return r;
4268
+ return s;
4269
4269
  }
4270
- function ir(e, t, n, r) {
4270
+ function ir(e, t, n, s) {
4271
4271
  var o = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
4272
- return r.forEach(function(f) {
4272
+ return s.forEach(function(f) {
4273
4273
  return _n(o, f);
4274
4274
  }), o;
4275
4275
  }
@@ -4282,18 +4282,18 @@ function sa() {
4282
4282
  e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
4283
4283
  }
4284
4284
  function An(e, t, n) {
4285
- var r = {};
4285
+ var s = {};
4286
4286
  return Z(t.objectStoreNames, 0).forEach(function(o) {
4287
4287
  for (var f = n.objectStore(o), d = er(ns(w = f.keyPath), w || "", !0, !1, !!f.autoIncrement, w && typeof w != "string", !0), m = [], v = 0; v < f.indexNames.length; ++v) {
4288
4288
  var T = f.index(f.indexNames[v]), w = T.keyPath, T = er(T.name, w, !!T.unique, !!T.multiEntry, !1, w && typeof w != "string", !1);
4289
4289
  m.push(T);
4290
4290
  }
4291
- r[o] = tr(o, d, m);
4292
- }), r;
4291
+ s[o] = tr(o, d, m);
4292
+ }), s;
4293
4293
  }
4294
4294
  function xn(e, t, n) {
4295
- for (var r = n.db.objectStoreNames, o = 0; o < r.length; ++o) {
4296
- var f = r[o], d = n.objectStore(f);
4295
+ for (var s = n.db.objectStoreNames, o = 0; o < s.length; ++o) {
4296
+ var f = s[o], d = n.objectStore(f);
4297
4297
  e._hasGetAll = "getAll" in d;
4298
4298
  for (var m = 0; m < d.indexNames.length; ++m) {
4299
4299
  var v = d.indexNames[m], w = d.index(v).keyPath, T = typeof w == "string" ? w : "[" + Z(w).join("+") + "]";
@@ -4304,27 +4304,27 @@ function sa() {
4304
4304
  }
4305
4305
  function is(e) {
4306
4306
  return e.split(",").map(function(t, n) {
4307
- var r = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), o = /^\[/.test(r) ? r.match(/^\[(.*)\]$/)[1].split("+") : r;
4308
- return er(r, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), p(o), n === 0);
4307
+ var s = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), o = /^\[/.test(s) ? s.match(/^\[(.*)\]$/)[1].split("+") : s;
4308
+ return er(s, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), p(o), n === 0);
4309
4309
  });
4310
4310
  }
4311
4311
  var mi = (Tn.prototype._parseStoresSpec = function(e, t) {
4312
4312
  l(e).forEach(function(n) {
4313
4313
  if (e[n] !== null) {
4314
- var r = is(e[n]), o = r.shift();
4314
+ var s = is(e[n]), o = s.shift();
4315
4315
  if (o.unique = !0, o.multi) throw new V.Schema("Primary key cannot be multi-valued");
4316
- r.forEach(function(f) {
4316
+ s.forEach(function(f) {
4317
4317
  if (f.auto) throw new V.Schema("Only primary key can be marked as autoIncrement (++)");
4318
4318
  if (!f.keyPath) throw new V.Schema("Index must have a name and cannot be an empty string");
4319
- }), t[n] = tr(n, o, r);
4319
+ }), t[n] = tr(n, o, s);
4320
4320
  }
4321
4321
  });
4322
4322
  }, Tn.prototype.stores = function(n) {
4323
4323
  var t = this.db;
4324
4324
  this._cfg.storesSource = this._cfg.storesSource ? h(this._cfg.storesSource, n) : n;
4325
- var n = t._versions, r = {}, o = {};
4325
+ var n = t._versions, s = {}, o = {};
4326
4326
  return n.forEach(function(f) {
4327
- h(r, f._cfg.storesSource), o = f._cfg.dbschema = {}, f._parseStoresSpec(r, o);
4327
+ h(s, f._cfg.storesSource), o = f._cfg.dbschema = {}, f._parseStoresSpec(s, o);
4328
4328
  }), t._dbSchema = o, rr(t, [t._allTables, t, t.Transaction.prototype]), wn(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], l(o), o), t._storeNames = l(o), this;
4329
4329
  }, Tn.prototype.upgrade = function(e) {
4330
4330
  return this._cfg.contentUpgrade = Kn(this._cfg.contentUpgrade || ue, e), this;
@@ -4354,40 +4354,40 @@ function sa() {
4354
4354
  h(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
4355
4355
  };
4356
4356
  function Qt(e, t, n) {
4357
- var r = re(t, n);
4358
- if (!isNaN(r)) {
4359
- if (0 < r) throw RangeError();
4357
+ var s = re(t, n);
4358
+ if (!isNaN(s)) {
4359
+ if (0 < s) throw RangeError();
4360
4360
  if (cr(e)) return h(e, { from: t, to: n, d: 1 });
4361
- var o = e.l, r = e.r;
4361
+ var o = e.l, s = e.r;
4362
4362
  if (re(n, e.from) < 0) return o ? Qt(o, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, as(e);
4363
- if (0 < re(t, e.to)) return r ? Qt(r, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, as(e);
4364
- re(t, e.from) < 0 && (e.from = t, e.l = null, e.d = r ? r.d + 1 : 1), 0 < re(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, o && !e.l && $t(e, o), r && n && $t(e, r);
4363
+ if (0 < re(t, e.to)) return s ? Qt(s, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, as(e);
4364
+ re(t, e.from) < 0 && (e.from = t, e.l = null, e.d = s ? s.d + 1 : 1), 0 < re(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, o && !e.l && $t(e, o), s && n && $t(e, s);
4365
4365
  }
4366
4366
  }
4367
4367
  function $t(e, t) {
4368
- cr(t) || function n(r, v) {
4368
+ cr(t) || function n(s, v) {
4369
4369
  var f = v.from, d = v.to, m = v.l, v = v.r;
4370
- Qt(r, f, d), m && n(r, m), v && n(r, v);
4370
+ Qt(s, f, d), m && n(s, m), v && n(s, v);
4371
4371
  }(e, t);
4372
4372
  }
4373
4373
  function os(e, t) {
4374
- var n = En(t), r = n.next();
4375
- if (r.done) return !1;
4376
- for (var o = r.value, f = En(e), d = f.next(o.from), m = d.value; !r.done && !d.done; ) {
4374
+ var n = En(t), s = n.next();
4375
+ if (s.done) return !1;
4376
+ for (var o = s.value, f = En(e), d = f.next(o.from), m = d.value; !s.done && !d.done; ) {
4377
4377
  if (re(m.from, o.to) <= 0 && 0 <= re(m.to, o.from)) return !0;
4378
- re(o.from, m.from) < 0 ? o = (r = n.next(m.from)).value : m = (d = f.next(o.from)).value;
4378
+ re(o.from, m.from) < 0 ? o = (s = n.next(m.from)).value : m = (d = f.next(o.from)).value;
4379
4379
  }
4380
4380
  return !1;
4381
4381
  }
4382
4382
  function En(e) {
4383
4383
  var t = cr(e) ? null : { s: 0, n: e };
4384
4384
  return { next: function(n) {
4385
- for (var r = 0 < arguments.length; t; ) switch (t.s) {
4385
+ for (var s = 0 < arguments.length; t; ) switch (t.s) {
4386
4386
  case 0:
4387
- if (t.s = 1, r) for (; t.n.l && re(n, t.n.from) < 0; ) t = { up: t, n: t.n.l, s: 1 };
4387
+ if (t.s = 1, s) for (; t.n.l && re(n, t.n.from) < 0; ) t = { up: t, n: t.n.l, s: 1 };
4388
4388
  else for (; t.n.l; ) t = { up: t, n: t.n.l, s: 1 };
4389
4389
  case 1:
4390
- if (t.s = 2, !r || re(n, t.n.to) <= 0) return { value: t.n, done: !1 };
4390
+ if (t.s = 2, !s || re(n, t.n.to) <= 0) return { value: t.n, done: !1 };
4391
4391
  case 2:
4392
4392
  if (t.n.r) {
4393
4393
  t.s = 3, t = { up: t, n: t.n.r, s: 0 };
@@ -4400,8 +4400,8 @@ function sa() {
4400
4400
  } };
4401
4401
  }
4402
4402
  function as(e) {
4403
- var t, n, r = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), o = 1 < r ? "r" : r < -1 ? "l" : "";
4404
- o && (t = o == "r" ? "l" : "r", n = a({}, e), r = e[o], e.from = r.from, e.to = r.to, e[o] = r[o], n[o] = r[t], (e[t] = n).d = us(n)), e.d = us(e);
4403
+ var t, n, s = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), o = 1 < s ? "r" : s < -1 ? "l" : "";
4404
+ o && (t = o == "r" ? "l" : "r", n = a({}, e), s = e[o], e.from = s.from, e.to = s.to, e[o] = s[o], n[o] = s[t], (e[t] = n).d = us(n)), e.d = us(e);
4405
4405
  }
4406
4406
  function us(n) {
4407
4407
  var t = n.r, n = n.l;
@@ -4409,9 +4409,9 @@ function sa() {
4409
4409
  }
4410
4410
  function Sn(e, t) {
4411
4411
  return l(t).forEach(function(n) {
4412
- e[n] ? $t(e[n], t[n]) : e[n] = function r(o) {
4412
+ e[n] ? $t(e[n], t[n]) : e[n] = function s(o) {
4413
4413
  var f, d, m = {};
4414
- for (f in o) _(o, f) && (d = o[f], m[f] = !d || typeof d != "object" || Le.has(d.constructor) ? d : r(d));
4414
+ for (f in o) _(o, f) && (d = o[f], m[f] = !d || typeof d != "object" || Le.has(d.constructor) ? d : s(d));
4415
4415
  return m;
4416
4416
  }(t[n]);
4417
4417
  }), e;
@@ -4445,7 +4445,7 @@ function sa() {
4445
4445
  function dr(e, t) {
4446
4446
  t === void 0 && (t = !1);
4447
4447
  var n = /* @__PURE__ */ new Set();
4448
- if (e.all) for (var r = 0, o = Object.values(yt); r < o.length; r++) cs(d = o[r], e, n, t);
4448
+ if (e.all) for (var s = 0, o = Object.values(yt); s < o.length; s++) cs(d = o[s], e, n, t);
4449
4449
  else for (var f in e) {
4450
4450
  var d, m = /^idb\:\/\/(.*)\/(.*)\//.exec(f);
4451
4451
  m && (f = m[1], m = m[2], (d = yt["idb://".concat(f, "/").concat(m)]) && cs(d, e, n, t));
@@ -4454,17 +4454,17 @@ function sa() {
4454
4454
  return v();
4455
4455
  });
4456
4456
  }
4457
- function cs(e, t, n, r) {
4457
+ function cs(e, t, n, s) {
4458
4458
  for (var o = [], f = 0, d = Object.entries(e.queries.query); f < d.length; f++) {
4459
4459
  for (var m = d[f], v = m[0], w = [], T = 0, g = m[1]; T < g.length; T++) {
4460
4460
  var R = g[T];
4461
4461
  lr(t, R.obsSet) ? R.subscribers.forEach(function(A) {
4462
4462
  return n.add(A);
4463
- }) : r && w.push(R);
4463
+ }) : s && w.push(R);
4464
4464
  }
4465
- r && o.push([v, w]);
4465
+ s && o.push([v, w]);
4466
4466
  }
4467
- if (r) for (var b = 0, x = o; b < x.length; b++) {
4467
+ if (s) for (var b = 0, x = o; b < x.length; b++) {
4468
4468
  var S = x[b], v = S[0], w = S[1];
4469
4469
  e.queries.query[v] = w;
4470
4470
  }
@@ -4475,9 +4475,9 @@ function sa() {
4475
4475
  return t.dbOpenError ? ye(t.dbOpenError) : e;
4476
4476
  });
4477
4477
  t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
4478
- var r = t.openCanceller, o = Math.round(10 * e.verno), f = !1;
4478
+ var s = t.openCanceller, o = Math.round(10 * e.verno), f = !1;
4479
4479
  function d() {
4480
- if (t.openCanceller !== r) throw new V.DatabaseClosed("db.open() was cancelled");
4480
+ if (t.openCanceller !== s) throw new V.DatabaseClosed("db.open() was cancelled");
4481
4481
  }
4482
4482
  function m() {
4483
4483
  return new U(function(R, b) {
@@ -4519,7 +4519,7 @@ function sa() {
4519
4519
  });
4520
4520
  }
4521
4521
  var v, w = t.dbReadyResolve, T = null, g = !1;
4522
- return U.race([r, (typeof navigator > "u" ? U.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(R) {
4522
+ return U.race([s, (typeof navigator > "u" ? U.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(R) {
4523
4523
  function b() {
4524
4524
  return indexedDB.databases().finally(R);
4525
4525
  }
@@ -4538,14 +4538,14 @@ function sa() {
4538
4538
  }
4539
4539
  });
4540
4540
  }).finally(function() {
4541
- t.openCanceller === r && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
4541
+ t.openCanceller === s && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
4542
4542
  }).catch(function(R) {
4543
4543
  t.dbOpenError = R;
4544
4544
  try {
4545
4545
  T && T.abort();
4546
4546
  } catch {
4547
4547
  }
4548
- return r === t.openCanceller && e._close(), ye(R);
4548
+ return s === t.openCanceller && e._close(), ye(R);
4549
4549
  }).finally(function() {
4550
4550
  t.openComplete = !0, w();
4551
4551
  }).then(function() {
@@ -4561,32 +4561,32 @@ function sa() {
4561
4561
  function t(f) {
4562
4562
  return e.next(f);
4563
4563
  }
4564
- var n = o(t), r = o(function(f) {
4564
+ var n = o(t), s = o(function(f) {
4565
4565
  return e.throw(f);
4566
4566
  });
4567
4567
  function o(f) {
4568
4568
  return function(v) {
4569
4569
  var m = f(v), v = m.value;
4570
- return m.done ? v : v && typeof v.then == "function" ? v.then(n, r) : p(v) ? Promise.all(v).then(n, r) : n(v);
4570
+ return m.done ? v : v && typeof v.then == "function" ? v.then(n, s) : p(v) ? Promise.all(v).then(n, s) : n(v);
4571
4571
  };
4572
4572
  }
4573
4573
  return o(t)();
4574
4574
  }
4575
4575
  function kn(e, t, n) {
4576
- for (var r = p(e) ? e.slice() : [e], o = 0; o < n; ++o) r.push(t);
4577
- return r;
4576
+ for (var s = p(e) ? e.slice() : [e], o = 0; o < n; ++o) s.push(t);
4577
+ return s;
4578
4578
  }
4579
4579
  var gi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
4580
4580
  return a(a({}, e), { table: function(t) {
4581
- var n = e.table(t), r = n.schema, o = {}, f = [];
4581
+ var n = e.table(t), s = n.schema, o = {}, f = [];
4582
4582
  function d(g, R, b) {
4583
4583
  var x = Yt(g), S = o[x] = o[x] || [], A = g == null ? 0 : typeof g == "string" ? 1 : g.length, k = 0 < R, k = a(a({}, b), { name: k ? "".concat(x, "(virtual-from:").concat(b.name, ")") : b.name, lowLevelIndex: b, isVirtual: k, keyTail: R, keyLength: A, extractKey: nr(g), unique: !k && b.unique });
4584
4584
  return S.push(k), k.isPrimaryKey || f.push(k), 1 < A && d(A === 2 ? g[0] : g.slice(0, A - 1), R + 1, b), S.sort(function(O, M) {
4585
4585
  return O.keyTail - M.keyTail;
4586
4586
  }), k;
4587
4587
  }
4588
- t = d(r.primaryKey.keyPath, 0, r.primaryKey), o[":id"] = [t];
4589
- for (var m = 0, v = r.indexes; m < v.length; m++) {
4588
+ t = d(s.primaryKey.keyPath, 0, s.primaryKey), o[":id"] = [t];
4589
+ for (var m = 0, v = s.indexes; m < v.length; m++) {
4590
4590
  var w = v[m];
4591
4591
  d(w.keyPath, 0, w);
4592
4592
  }
@@ -4594,7 +4594,7 @@ function sa() {
4594
4594
  var R, b = g.query.index;
4595
4595
  return b.isVirtual ? a(a({}, g), { query: { index: b.lowLevelIndex, range: (R = g.query.range, b = b.keyTail, { type: R.type === 1 ? 2 : R.type, lower: kn(R.lower, R.lowerOpen ? e.MAX_KEY : e.MIN_KEY, b), lowerOpen: !0, upper: kn(R.upper, R.upperOpen ? e.MIN_KEY : e.MAX_KEY, b), upperOpen: !0 }) } }) : g;
4596
4596
  }
4597
- return a(a({}, n), { schema: a(a({}, r), { primaryKey: t, indexes: f, getIndexByKeyPath: function(g) {
4597
+ return a(a({}, n), { schema: a(a({}, s), { primaryKey: t, indexes: f, getIndexByKeyPath: function(g) {
4598
4598
  return (g = o[Yt(g)]) && g[0];
4599
4599
  } }), count: function(g) {
4600
4600
  return n.count(T(g));
@@ -4622,12 +4622,12 @@ function sa() {
4622
4622
  } });
4623
4623
  } });
4624
4624
  } };
4625
- function mr(e, t, n, r) {
4626
- return n = n || {}, r = r || "", l(e).forEach(function(o) {
4625
+ function mr(e, t, n, s) {
4626
+ return n = n || {}, s = s || "", l(e).forEach(function(o) {
4627
4627
  var f, d, m;
4628
- _(t, o) ? (f = e[o], d = t[o], typeof f == "object" && typeof d == "object" && f && d ? (m = Tt(f)) !== Tt(d) ? n[r + o] = t[o] : m === "Object" ? mr(f, d, n, r + o + ".") : f !== d && (n[r + o] = t[o]) : f !== d && (n[r + o] = t[o])) : n[r + o] = void 0;
4628
+ _(t, o) ? (f = e[o], d = t[o], typeof f == "object" && typeof d == "object" && f && d ? (m = Tt(f)) !== Tt(d) ? n[s + o] = t[o] : m === "Object" ? mr(f, d, n, s + o + ".") : f !== d && (n[s + o] = t[o]) : f !== d && (n[s + o] = t[o])) : n[s + o] = void 0;
4629
4629
  }), l(t).forEach(function(o) {
4630
- _(e, o) || (n[r + o] = t[o]);
4630
+ _(e, o) || (n[s + o] = t[o]);
4631
4631
  }), n;
4632
4632
  }
4633
4633
  function yr(e, t) {
@@ -4635,7 +4635,7 @@ function sa() {
4635
4635
  }
4636
4636
  var vi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
4637
4637
  return a(a({}, e), { table: function(t) {
4638
- var n = e.table(t), r = n.schema.primaryKey;
4638
+ var n = e.table(t), s = n.schema.primaryKey;
4639
4639
  return a(a({}, n), { mutate: function(o) {
4640
4640
  var f = z.trans, d = f.table(t).hook, m = d.deleting, v = d.creating, w = d.updating;
4641
4641
  switch (o.type) {
@@ -4658,7 +4658,7 @@ function sa() {
4658
4658
  if (m.fire === ue) break;
4659
4659
  return f._promise("readwrite", function() {
4660
4660
  return function g(R, b, x) {
4661
- return n.query({ trans: R, values: !1, query: { index: r, range: b }, limit: x }).then(function(S) {
4661
+ return n.query({ trans: R, values: !1, query: { index: s, range: b }, limit: x }).then(function(S) {
4662
4662
  var A = S.result;
4663
4663
  return T({ type: "delete", keys: A, trans: R }).then(function(k) {
4664
4664
  return 0 < k.numFailures ? Promise.reject(k.failures[0]) : A.length < x ? { failures: [], numFailures: 0, lastResult: void 0 } : g(R, a(a({}, b), { lower: A[A.length - 1], lowerOpen: !0 }), x);
@@ -4669,12 +4669,12 @@ function sa() {
4669
4669
  }
4670
4670
  return n.mutate(o);
4671
4671
  function T(g) {
4672
- var R, b, x, S = z.trans, A = g.keys || yr(r, g);
4672
+ var R, b, x, S = z.trans, A = g.keys || yr(s, g);
4673
4673
  if (!A) throw new Error("Keys missing");
4674
4674
  return (g = g.type === "add" || g.type === "put" ? a(a({}, g), { keys: A }) : a({}, g)).type !== "delete" && (g.values = u([], g.values)), g.keys && (g.keys = u([], g.keys)), R = n, x = A, ((b = g).type === "add" ? Promise.resolve([]) : R.getMany({ trans: b.trans, keys: x, cache: "immutable" })).then(function(k) {
4675
4675
  var O = A.map(function(M, I) {
4676
4676
  var D, K, N, F = k[I], B = { onerror: null, onsuccess: null };
4677
- return g.type === "delete" ? m.fire.call(B, M, F, S) : g.type === "add" || F === void 0 ? (D = v.fire.call(B, M, g.values[I], S), M == null && D != null && (g.keys[I] = M = D, r.outbound || ce(g.values[I], r.keyPath, M))) : (D = mr(F, g.values[I]), (K = w.fire.call(B, D, M, F, S)) && (N = g.values[I], Object.keys(K).forEach(function(j) {
4677
+ return g.type === "delete" ? m.fire.call(B, M, F, S) : g.type === "add" || F === void 0 ? (D = v.fire.call(B, M, g.values[I], S), M == null && D != null && (g.keys[I] = M = D, s.outbound || ce(g.values[I], s.keyPath, M))) : (D = mr(F, g.values[I]), (K = w.fire.call(B, D, M, F, S)) && (N = g.values[I], Object.keys(K).forEach(function(j) {
4678
4678
  _(N, j) ? N[j] = K[j] : ce(N, j, K[j]);
4679
4679
  }))), B;
4680
4680
  });
@@ -4697,8 +4697,8 @@ function sa() {
4697
4697
  function ls(e, t, n) {
4698
4698
  try {
4699
4699
  if (!t || t.keys.length < e.length) return null;
4700
- for (var r = [], o = 0, f = 0; o < t.keys.length && f < e.length; ++o) re(t.keys[o], e[f]) === 0 && (r.push(n ? ke(t.values[o]) : t.values[o]), ++f);
4701
- return r.length === e.length ? r : null;
4700
+ for (var s = [], o = 0, f = 0; o < t.keys.length && f < e.length; ++o) re(t.keys[o], e[f]) === 0 && (s.push(n ? ke(t.values[o]) : t.values[o]), ++f);
4701
+ return s.length === e.length ? s : null;
4702
4702
  } catch {
4703
4703
  return null;
4704
4704
  }
@@ -4706,14 +4706,14 @@ function sa() {
4706
4706
  var bi = { stack: "dbcore", level: -1, create: function(e) {
4707
4707
  return { table: function(t) {
4708
4708
  var n = e.table(t);
4709
- return a(a({}, n), { getMany: function(r) {
4710
- if (!r.cache) return n.getMany(r);
4711
- var o = ls(r.keys, r.trans._cache, r.cache === "clone");
4712
- return o ? U.resolve(o) : n.getMany(r).then(function(f) {
4713
- return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? ke(f) : f }, f;
4709
+ return a(a({}, n), { getMany: function(s) {
4710
+ if (!s.cache) return n.getMany(s);
4711
+ var o = ls(s.keys, s.trans._cache, s.cache === "clone");
4712
+ return o ? U.resolve(o) : n.getMany(s).then(function(f) {
4713
+ return s.trans._cache = { keys: s.keys, values: s.cache === "clone" ? ke(f) : f }, f;
4714
4714
  });
4715
- }, mutate: function(r) {
4716
- return r.type !== "add" && (r.trans._cache = null), n.mutate(r);
4715
+ }, mutate: function(s) {
4716
+ return s.type !== "add" && (s.trans._cache = null), n.mutate(s);
4717
4717
  } });
4718
4718
  } };
4719
4719
  } };
@@ -4733,15 +4733,15 @@ function sa() {
4733
4733
  }
4734
4734
  var wi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
4735
4735
  var t = e.schema.name, n = new xe(e.MIN_KEY, e.MAX_KEY);
4736
- return a(a({}, e), { transaction: function(r, o, f) {
4736
+ return a(a({}, e), { transaction: function(s, o, f) {
4737
4737
  if (z.subscr && o !== "readonly") throw new V.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(z.querier));
4738
- return e.transaction(r, o, f);
4739
- }, table: function(r) {
4740
- var o = e.table(r), f = o.schema, d = f.primaryKey, g = f.indexes, m = d.extractKey, v = d.outbound, w = d.autoIncrement && g.filter(function(b) {
4738
+ return e.transaction(s, o, f);
4739
+ }, table: function(s) {
4740
+ var o = e.table(s), f = o.schema, d = f.primaryKey, g = f.indexes, m = d.extractKey, v = d.outbound, w = d.autoIncrement && g.filter(function(b) {
4741
4741
  return b.compound && b.keyPath.includes(d.keyPath);
4742
4742
  }), T = a(a({}, o), { mutate: function(b) {
4743
4743
  function x(j) {
4744
- return j = "idb://".concat(t, "/").concat(r, "/").concat(j), M[j] || (M[j] = new xe());
4744
+ return j = "idb://".concat(t, "/").concat(s, "/").concat(j), M[j] || (M[j] = new xe());
4745
4745
  }
4746
4746
  var S, A, k, O = b.trans, M = b.mutatedParts || (b.mutatedParts = {}), I = x(""), D = x(":dels"), K = b.type, B = b.type === "deleteRange" ? [b.range] : b.type === "delete" ? [b.keys] : b.values.length < 50 ? [yr(d, b).filter(function(j) {
4747
4747
  return j;
@@ -4785,7 +4785,7 @@ function sa() {
4785
4785
  var S = z.subscr, A = !!S, k = fs(z, o) && hs(b, x) ? x.obsSet = {} : S;
4786
4786
  if (A) {
4787
4787
  var O = function(F) {
4788
- return F = "idb://".concat(t, "/").concat(r, "/").concat(F), k[F] || (k[F] = new xe());
4788
+ return F = "idb://".concat(t, "/").concat(s, "/").concat(F), k[F] || (k[F] = new xe());
4789
4789
  }, M = O(""), I = O(":dels"), S = R[b](x), A = S[0], S = S[1];
4790
4790
  if ((b === "query" && A.isPrimaryKey && !x.values ? I : O(A.name || "")).add(S), !A.isPrimaryKey) {
4791
4791
  if (b !== "count") {
@@ -4822,20 +4822,20 @@ function sa() {
4822
4822
  function ds(e, t, n) {
4823
4823
  if (n.numFailures === 0) return t;
4824
4824
  if (t.type === "deleteRange") return null;
4825
- var r = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
4826
- return n.numFailures === r ? null : (t = a({}, t), p(t.keys) && (t.keys = t.keys.filter(function(o, f) {
4825
+ var s = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
4826
+ return n.numFailures === s ? null : (t = a({}, t), p(t.keys) && (t.keys = t.keys.filter(function(o, f) {
4827
4827
  return !(f in n.failures);
4828
4828
  })), "values" in t && p(t.values) && (t.values = t.values.filter(function(o, f) {
4829
4829
  return !(f in n.failures);
4830
4830
  })), t);
4831
4831
  }
4832
4832
  function gr(e, t) {
4833
- return n = e, ((r = t).lower === void 0 || (r.lowerOpen ? 0 < re(n, r.lower) : 0 <= re(n, r.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? re(e, t.upper) < 0 : re(e, t.upper) <= 0));
4834
- var n, r;
4833
+ return n = e, ((s = t).lower === void 0 || (s.lowerOpen ? 0 < re(n, s.lower) : 0 <= re(n, s.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? re(e, t.upper) < 0 : re(e, t.upper) <= 0));
4834
+ var n, s;
4835
4835
  }
4836
- function ps(e, t, R, r, o, f) {
4836
+ function ps(e, t, R, s, o, f) {
4837
4837
  if (!R || R.length === 0) return e;
4838
- var d = t.query.index, m = d.multiEntry, v = t.query.range, w = r.schema.primaryKey.extractKey, T = d.extractKey, g = (d.lowLevelIndex || d).extractKey, R = R.reduce(function(b, x) {
4838
+ var d = t.query.index, m = d.multiEntry, v = t.query.range, w = s.schema.primaryKey.extractKey, T = d.extractKey, g = (d.lowLevelIndex || d).extractKey, R = R.reduce(function(b, x) {
4839
4839
  var S = b, A = [];
4840
4840
  if (x.type === "add" || x.type === "put") for (var k = new xe(), O = x.values.length - 1; 0 <= O; --O) {
4841
4841
  var M, I = x.values[O], D = w(I);
@@ -4887,28 +4887,28 @@ function sa() {
4887
4887
  return re(e.lower, t.lower) === 0 && re(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
4888
4888
  }
4889
4889
  function _i(e, t) {
4890
- return function(n, r, o, f) {
4891
- if (n === void 0) return r !== void 0 ? -1 : 0;
4892
- if (r === void 0) return 1;
4893
- if ((r = re(n, r)) === 0) {
4890
+ return function(n, s, o, f) {
4891
+ if (n === void 0) return s !== void 0 ? -1 : 0;
4892
+ if (s === void 0) return 1;
4893
+ if ((s = re(n, s)) === 0) {
4894
4894
  if (o && f) return 0;
4895
4895
  if (o) return 1;
4896
4896
  if (f) return -1;
4897
4897
  }
4898
- return r;
4899
- }(e.lower, t.lower, e.lowerOpen, t.lowerOpen) <= 0 && 0 <= function(n, r, o, f) {
4900
- if (n === void 0) return r !== void 0 ? 1 : 0;
4901
- if (r === void 0) return -1;
4902
- if ((r = re(n, r)) === 0) {
4898
+ return s;
4899
+ }(e.lower, t.lower, e.lowerOpen, t.lowerOpen) <= 0 && 0 <= function(n, s, o, f) {
4900
+ if (n === void 0) return s !== void 0 ? 1 : 0;
4901
+ if (s === void 0) return -1;
4902
+ if ((s = re(n, s)) === 0) {
4903
4903
  if (o && f) return 0;
4904
4904
  if (o) return -1;
4905
4905
  if (f) return 1;
4906
4906
  }
4907
- return r;
4907
+ return s;
4908
4908
  }(e.upper, t.upper, e.upperOpen, t.upperOpen);
4909
4909
  }
4910
- function Ai(e, t, n, r) {
4911
- e.subscribers.add(n), r.addEventListener("abort", function() {
4910
+ function Ai(e, t, n, s) {
4911
+ e.subscribers.add(n), s.addEventListener("abort", function() {
4912
4912
  var o, f;
4913
4913
  e.subscribers.delete(n), e.subscribers.size === 0 && (o = e, f = t, setTimeout(function() {
4914
4914
  o.subscribers.size === 0 && $e(f, o);
@@ -4917,11 +4917,11 @@ function sa() {
4917
4917
  }
4918
4918
  var xi = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
4919
4919
  var t = e.schema.name;
4920
- return a(a({}, e), { transaction: function(n, r, o) {
4921
- var f, d, m = e.transaction(n, r, o);
4922
- return r === "readwrite" && (d = (f = new AbortController()).signal, o = function(v) {
4920
+ return a(a({}, e), { transaction: function(n, s, o) {
4921
+ var f, d, m = e.transaction(n, s, o);
4922
+ return s === "readwrite" && (d = (f = new AbortController()).signal, o = function(v) {
4923
4923
  return function() {
4924
- if (f.abort(), r === "readwrite") {
4924
+ if (f.abort(), s === "readwrite") {
4925
4925
  for (var w = /* @__PURE__ */ new Set(), T = 0, g = n; T < g.length; T++) {
4926
4926
  var R = g[T], b = yt["idb://".concat(t, "/").concat(R)];
4927
4927
  if (b) {
@@ -4950,12 +4950,12 @@ function sa() {
4950
4950
  };
4951
4951
  }, m.addEventListener("abort", o(!1), { signal: d }), m.addEventListener("error", o(!1), { signal: d }), m.addEventListener("complete", o(!0), { signal: d })), m;
4952
4952
  }, table: function(n) {
4953
- var r = e.table(n), o = r.schema.primaryKey;
4954
- return a(a({}, r), { mutate: function(f) {
4953
+ var s = e.table(n), o = s.schema.primaryKey;
4954
+ return a(a({}, s), { mutate: function(f) {
4955
4955
  var d = z.trans;
4956
- if (o.outbound || d.db._options.cache === "disabled" || d.explicit || d.idbtrans.mode !== "readwrite") return r.mutate(f);
4956
+ if (o.outbound || d.db._options.cache === "disabled" || d.explicit || d.idbtrans.mode !== "readwrite") return s.mutate(f);
4957
4957
  var m = yt["idb://".concat(t, "/").concat(n)];
4958
- return m ? (d = r.mutate(f), f.type !== "add" && f.type !== "put" || !(50 <= f.values.length || yr(o, f).some(function(v) {
4958
+ return m ? (d = s.mutate(f), f.type !== "add" && f.type !== "put" || !(50 <= f.values.length || yr(o, f).some(function(v) {
4959
4959
  return v == null;
4960
4960
  })) ? (m.optimisticOps.push(f), f.mutatedParts && Rn(f.mutatedParts), d.then(function(v) {
4961
4961
  0 < v.numFailures && ($e(m.optimisticOps, f), (v = ds(0, f, v)) && m.optimisticOps.push(v), f.mutatedParts && Rn(f.mutatedParts));
@@ -4969,9 +4969,9 @@ function sa() {
4969
4969
  m.optimisticOps.push(w), queueMicrotask(function() {
4970
4970
  return f.mutatedParts && Rn(f.mutatedParts);
4971
4971
  });
4972
- }), d) : r.mutate(f);
4972
+ }), d) : s.mutate(f);
4973
4973
  }, query: function(f) {
4974
- if (!fs(z, r) || !hs("query", f)) return r.query(f);
4974
+ if (!fs(z, s) || !hs("query", f)) return s.query(f);
4975
4975
  var d = ((w = z.trans) === null || w === void 0 ? void 0 : w.db._options.cache) === "immutable", g = z, m = g.requery, v = g.signal, w = function(x, S, A, k) {
4976
4976
  var O = yt["idb://".concat(x, "/").concat(S)];
4977
4977
  if (!O) return [];
@@ -4992,7 +4992,7 @@ function sa() {
4992
4992
  }), [I, !!I, O, M];
4993
4993
  }
4994
4994
  }(t, n, "query", f), T = w[0], g = w[1], R = w[2], b = w[3];
4995
- return T && g ? T.obsSet = f.obsSet : (g = r.query(f).then(function(x) {
4995
+ return T && g ? T.obsSet = f.obsSet : (g = s.query(f).then(function(x) {
4996
4996
  var S = x.result;
4997
4997
  if (T && (T.res = S), d) {
4998
4998
  for (var A = 0, k = S.length; A < k; ++A) Object.freeze(S[A]);
@@ -5002,43 +5002,43 @@ function sa() {
5002
5002
  }).catch(function(x) {
5003
5003
  return b && T && $e(b, T), Promise.reject(x);
5004
5004
  }), T = { obsSet: f.obsSet, promise: g, subscribers: /* @__PURE__ */ new Set(), type: "query", req: f, dirty: !1 }, b ? b.push(T) : (b = [T], (R = R || (yt["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[f.query.index.name || ""] = b)), Ai(T, b, m, v), T.promise.then(function(x) {
5005
- return { result: ps(x.result, f, R == null ? void 0 : R.optimisticOps, r, T, d) };
5005
+ return { result: ps(x.result, f, R == null ? void 0 : R.optimisticOps, s, T, d) };
5006
5006
  });
5007
5007
  } });
5008
5008
  } });
5009
5009
  } };
5010
5010
  function On(e, t) {
5011
- return new Proxy(e, { get: function(n, r, o) {
5012
- return r === "db" ? t : Reflect.get(n, r, o);
5011
+ return new Proxy(e, { get: function(n, s, o) {
5012
+ return s === "db" ? t : Reflect.get(n, s, o);
5013
5013
  } });
5014
5014
  }
5015
5015
  var Xe = (ge.prototype.version = function(e) {
5016
5016
  if (isNaN(e) || e < 0.1) throw new V.Type("Given version is not a positive number");
5017
5017
  if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new V.Schema("Cannot add version when database is open");
5018
5018
  this.verno = Math.max(this.verno, e);
5019
- var t = this._versions, n = t.filter(function(r) {
5020
- return r._cfg.version === e;
5019
+ var t = this._versions, n = t.filter(function(s) {
5020
+ return s._cfg.version === e;
5021
5021
  })[0];
5022
5022
  return n || (n = new this.Version(e), t.push(n), t.sort(hi), n.stores({}), this._state.autoSchema = !1, n);
5023
5023
  }, ge.prototype._whenReady = function(e) {
5024
5024
  var t = this;
5025
- return this.idbdb && (this._state.openComplete || z.letThrough || this._vip) ? e() : new U(function(n, r) {
5026
- if (t._state.openComplete) return r(new V.DatabaseClosed(t._state.dbOpenError));
5025
+ return this.idbdb && (this._state.openComplete || z.letThrough || this._vip) ? e() : new U(function(n, s) {
5026
+ if (t._state.openComplete) return s(new V.DatabaseClosed(t._state.dbOpenError));
5027
5027
  if (!t._state.isBeingOpened) {
5028
- if (!t._state.autoOpen) return void r(new V.DatabaseClosed());
5028
+ if (!t._state.autoOpen) return void s(new V.DatabaseClosed());
5029
5029
  t.open().catch(ue);
5030
5030
  }
5031
- t._state.dbReadyPromise.then(n, r);
5031
+ t._state.dbReadyPromise.then(n, s);
5032
5032
  }).then(e);
5033
5033
  }, ge.prototype.use = function(e) {
5034
- var t = e.stack, n = e.create, r = e.level, o = e.name;
5035
- return o && this.unuse({ stack: t, name: o }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: r ?? 10, name: o }), e.sort(function(f, d) {
5034
+ var t = e.stack, n = e.create, s = e.level, o = e.name;
5035
+ return o && this.unuse({ stack: t, name: o }), e = this._middlewares[t] || (this._middlewares[t] = []), e.push({ stack: t, create: n, level: s ?? 10, name: o }), e.sort(function(f, d) {
5036
5036
  return f.level - d.level;
5037
5037
  }), this;
5038
5038
  }, ge.prototype.unuse = function(e) {
5039
- var t = e.stack, n = e.name, r = e.create;
5039
+ var t = e.stack, n = e.name, s = e.create;
5040
5040
  return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(o) {
5041
- return r ? o.create !== r : !!n && o.name !== n;
5041
+ return s ? o.create !== s : !!n && o.name !== n;
5042
5042
  })), this;
5043
5043
  }, ge.prototype.open = function() {
5044
5044
  var e = this;
@@ -5056,8 +5056,8 @@ function sa() {
5056
5056
  }
5057
5057
  e.isBeingOpened || (e.dbReadyPromise = new U(function(n) {
5058
5058
  e.dbReadyResolve = n;
5059
- }), e.openCanceller = new U(function(n, r) {
5060
- e.cancelOpen = r;
5059
+ }), e.openCanceller = new U(function(n, s) {
5060
+ e.cancelOpen = s;
5061
5061
  }));
5062
5062
  }, ge.prototype.close = function(n) {
5063
5063
  var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
@@ -5065,7 +5065,7 @@ function sa() {
5065
5065
  }, ge.prototype.delete = function(e) {
5066
5066
  var t = this;
5067
5067
  e === void 0 && (e = { disableAutoOpen: !0 });
5068
- var n = 0 < arguments.length && typeof arguments[0] != "object", r = this._state;
5068
+ var n = 0 < arguments.length && typeof arguments[0] != "object", s = this._state;
5069
5069
  return new U(function(o, f) {
5070
5070
  function d() {
5071
5071
  t.close(e);
@@ -5076,7 +5076,7 @@ function sa() {
5076
5076
  }), m.onerror = Be(f), m.onblocked = t._fireOnBlocked;
5077
5077
  }
5078
5078
  if (n) throw new V.InvalidArgument("Invalid closeOptions argument to db.delete()");
5079
- r.isBeingOpened ? r.dbReadyPromise.then(d) : d();
5079
+ s.isBeingOpened ? s.dbReadyPromise.then(d) : d();
5080
5080
  });
5081
5081
  }, ge.prototype.backendDB = function() {
5082
5082
  return this.idbdb;
@@ -5095,21 +5095,21 @@ function sa() {
5095
5095
  return e._allTables[t];
5096
5096
  });
5097
5097
  }, enumerable: !1, configurable: !0 }), ge.prototype.transaction = function() {
5098
- var e = (function(t, n, r) {
5098
+ var e = (function(t, n, s) {
5099
5099
  var o = arguments.length;
5100
5100
  if (o < 2) throw new V.InvalidArgument("Too few arguments");
5101
5101
  for (var f = new Array(o - 1); --o; ) f[o - 1] = arguments[o];
5102
- return r = f.pop(), [t, me(f), r];
5102
+ return s = f.pop(), [t, me(f), s];
5103
5103
  }).apply(this, arguments);
5104
5104
  return this._transaction.apply(this, e);
5105
5105
  }, ge.prototype._transaction = function(e, t, n) {
5106
- var r = this, o = z.trans;
5106
+ var s = this, o = z.trans;
5107
5107
  o && o.db === this && e.indexOf("!") === -1 || (o = null);
5108
5108
  var f, d, m = e.indexOf("?") !== -1;
5109
5109
  e = e.replace("!", "").replace("?", "");
5110
5110
  try {
5111
5111
  if (d = t.map(function(w) {
5112
- if (w = w instanceof r.Table ? w.name : w, typeof w != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
5112
+ if (w = w instanceof s.Table ? w.name : w, typeof w != "string") throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
5113
5113
  return w;
5114
5114
  }), e == "r" || e === Wn) f = Wn;
5115
5115
  else {
@@ -5162,7 +5162,7 @@ function sa() {
5162
5162
  });
5163
5163
  }).bind(null, this, f, d, o, n);
5164
5164
  return o ? o._promise(f, v, "lock") : z.trans ? dt(z.transless, function() {
5165
- return r._whenReady(v);
5165
+ return s._whenReady(v);
5166
5166
  }) : this._whenReady(v);
5167
5167
  }, ge.prototype.table = function(e) {
5168
5168
  if (!_(this._allTables, e)) throw new V.InvalidTable("Table ".concat(e, " does not exist"));
@@ -5171,8 +5171,8 @@ function sa() {
5171
5171
  function ge(e, t) {
5172
5172
  var n = this;
5173
5173
  this._middlewares = {}, this.verno = 0;
5174
- var r = ge.dependencies;
5175
- this._options = t = a({ addons: ge.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
5174
+ var s = ge.dependencies;
5175
+ this._options = t = a({ addons: ge.addons, autoOpen: !0, indexedDB: s.indexedDB, IDBKeyRange: s.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, s = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
5176
5176
  var o, f, d, m, v, w = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: ue, dbReadyPromise: null, cancelOpen: ue, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
5177
5177
  w.dbReadyPromise = new U(function(g) {
5178
5178
  w.dbReadyResolve = g;
@@ -5244,7 +5244,7 @@ function sa() {
5244
5244
  return On(x.apply(this, arguments), T);
5245
5245
  } : x;
5246
5246
  } });
5247
- this.vip = T, r.forEach(function(g) {
5247
+ this.vip = T, s.forEach(function(g) {
5248
5248
  return g(n);
5249
5249
  });
5250
5250
  }
@@ -5262,7 +5262,7 @@ function sa() {
5262
5262
  Mn = { indexedDB: null, IDBKeyRange: null };
5263
5263
  }
5264
5264
  function ys(e) {
5265
- var t, n = !1, r = new Ti(function(o) {
5265
+ var t, n = !1, s = new Ti(function(o) {
5266
5266
  var f = Ft(e), d, m = !1, v = {}, w = {}, T = { get closed() {
5267
5267
  return m;
5268
5268
  }, unsubscribe: function() {
@@ -5299,11 +5299,11 @@ function sa() {
5299
5299
  };
5300
5300
  return setTimeout(R, 0), T;
5301
5301
  });
5302
- return r.hasValue = function() {
5302
+ return s.hasValue = function() {
5303
5303
  return n;
5304
- }, r.getValue = function() {
5304
+ }, s.getValue = function() {
5305
5305
  return t;
5306
- }, r;
5306
+ }, s;
5307
5307
  }
5308
5308
  var gt = Xe;
5309
5309
  function br(e) {
@@ -5324,8 +5324,8 @@ function sa() {
5324
5324
  });
5325
5325
  }, getDatabaseNames: function(e) {
5326
5326
  try {
5327
- return t = gt.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (ar(n) ? Promise.resolve(n.databases()).then(function(r) {
5328
- return r.map(function(o) {
5327
+ return t = gt.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (ar(n) ? Promise.resolve(n.databases()).then(function(s) {
5328
+ return s.map(function(o) {
5329
5329
  return o.name;
5330
5330
  }).filter(function(o) {
5331
5331
  return o !== pn;
@@ -5352,8 +5352,8 @@ function sa() {
5352
5352
  };
5353
5353
  }, spawn: function(e, t, n) {
5354
5354
  try {
5355
- var r = pr(e.apply(n, t || []));
5356
- return r && typeof r.then == "function" ? r : U.resolve(r);
5355
+ var s = pr(e.apply(n, t || []));
5356
+ return s && typeof s.then == "function" ? s : U.resolve(s);
5357
5357
  } catch (o) {
5358
5358
  return ye(o);
5359
5359
  }
@@ -5430,8 +5430,8 @@ class oa {
5430
5430
  * @param {Object} tableDefinitions - 表定义对象,例如 { models: "&path, data" }
5431
5431
  * @param {number} version - 数据库版本号
5432
5432
  */
5433
- constructor(s = "threeJsIDBCache", i = 1) {
5434
- this.db = new Nn(s), this.materialMap = {}, this.db.version(i).stores({ models: "&path, data" });
5433
+ constructor(r = "threeJsIDBCache", i = 1) {
5434
+ this.db = new Nn(r), this.materialMap = {}, this.db.version(i).stores({ models: "&path, data" });
5435
5435
  }
5436
5436
  /**
5437
5437
  * 获取 Dexie 数据库实例
@@ -5445,20 +5445,21 @@ class oa {
5445
5445
  * @param {THREE.Object3D} object - 要序列化的对象
5446
5446
  * @returns {Object} 序列化后的数据
5447
5447
  */
5448
- serObject3D(s) {
5448
+ serObject3D(r) {
5449
5449
  const i = {
5450
- type: s.type,
5451
- name: s.name,
5452
- position: s.position.toArray(),
5453
- rotation: s.rotation.toArray(),
5454
- scale: s.scale.toArray(),
5455
- visible: s.visible,
5450
+ type: r.type,
5451
+ name: r.name,
5452
+ position: r.position.toArray(),
5453
+ rotation: r.rotation.toArray(),
5454
+ scale: r.scale.toArray(),
5455
+ visible: r.visible,
5456
5456
  children: [],
5457
5457
  geometry: null,
5458
- material: null
5458
+ material: null,
5459
+ userData: r.userData
5459
5460
  };
5460
- s.isMesh && (i.geometry = this.serGeometry(s.geometry), i.material = this.serMaterial(s.material));
5461
- for (const a of s.children)
5461
+ r.isMesh && (i.geometry = this.serGeometry(r.geometry), i.material = this.serMaterial(r.material));
5462
+ for (const a of r.children)
5462
5463
  i.children.push(this.serObject3D(a));
5463
5464
  return i;
5464
5465
  }
@@ -5467,8 +5468,8 @@ class oa {
5467
5468
  * @param {THREE.BufferGeometry} geometry - 几何体
5468
5469
  * @returns {Object} 序列化后的几何体数据
5469
5470
  */
5470
- serGeometry(s) {
5471
- const i = [], { attributes: a, index: u, type: c } = s;
5471
+ serGeometry(r) {
5472
+ const i = [], { attributes: a, index: u, type: c } = r;
5472
5473
  a.position && (i.position = {
5473
5474
  type: "Float32Array",
5474
5475
  array: Array.from(a.position.array),
@@ -5497,8 +5498,8 @@ class oa {
5497
5498
  * @param {Object} data - 序列化后的几何体数据
5498
5499
  * @returns {THREE.BufferGeometry} 反序列化后的几何体
5499
5500
  */
5500
- reSerGeometry(s) {
5501
- const { type: i, attributes: a, index: u } = s, c = new bt.BufferGeometry();
5501
+ reSerGeometry(r) {
5502
+ const { type: i, attributes: a, index: u } = r, c = new bt.BufferGeometry();
5502
5503
  return Object.keys(a).forEach((l) => {
5503
5504
  const { type: p, array: h, itemSize: y } = a[l];
5504
5505
  c.setAttribute(
@@ -5512,20 +5513,20 @@ class oa {
5512
5513
  * @param {THREE.Material} material - 材质
5513
5514
  * @returns {Object} 序列化后的材质数据
5514
5515
  */
5515
- serMaterial(s) {
5516
+ serMaterial(r) {
5516
5517
  return {
5517
- type: s.type,
5518
- color: s.color.getHex(),
5519
- map: s.map ? s.map.image.src : null,
5520
- opacity: s.opacity,
5521
- name: s.name,
5522
- depthTest: s.depthTest,
5523
- depthWrite: s.depthWrite,
5524
- transparent: s.transparent,
5525
- side: s.side,
5526
- roughness: s.roughness,
5527
- metalness: s.metalness,
5528
- emissive: s.emissive.getHex()
5518
+ type: r.type,
5519
+ color: r.color.getHex(),
5520
+ map: r.map ? r.map.image.src : null,
5521
+ opacity: r.opacity,
5522
+ name: r.name,
5523
+ depthTest: r.depthTest,
5524
+ depthWrite: r.depthWrite,
5525
+ transparent: r.transparent,
5526
+ side: r.side,
5527
+ roughness: r.roughness,
5528
+ metalness: r.metalness,
5529
+ emissive: r.emissive.getHex()
5529
5530
  };
5530
5531
  }
5531
5532
  /**
@@ -5533,25 +5534,25 @@ class oa {
5533
5534
  * @param {Object} data - 序列化后的材质数据
5534
5535
  * @returns {THREE.Material} 反序列化后的材质
5535
5536
  */
5536
- reSerMaterial(s) {
5537
- if (this.materialMap[s.name]) return this.materialMap[s.name];
5538
- const { type: i, ...a } = s, u = i || "MeshStandardMaterial", c = new bt[u]({ ...a });
5539
- if (s.map) {
5540
- const l = new bt.TextureLoader().load(s.map);
5537
+ reSerMaterial(r) {
5538
+ if (this.materialMap[r.name]) return this.materialMap[r.name];
5539
+ const { type: i, ...a } = r, u = i || "MeshStandardMaterial", c = new bt[u]({ ...a });
5540
+ if (r.map) {
5541
+ const l = new bt.TextureLoader().load(r.map);
5541
5542
  c.map = l;
5542
5543
  }
5543
- return c.needsUpdate = !0, this.materialMap[s.name] = c, c;
5544
+ return c.needsUpdate = !0, this.materialMap[r.name] = c, c;
5544
5545
  }
5545
5546
  /**
5546
5547
  * 反序列化 Three.js 对象
5547
5548
  * @param {Object} data - 序列化后的数据
5548
5549
  * @returns {THREE.Object3D} 反序列化后的对象
5549
5550
  */
5550
- reSerObject3D(s) {
5551
+ reSerObject3D(r) {
5551
5552
  let i;
5552
- switch (s.type) {
5553
+ switch (r.type) {
5553
5554
  case "Mesh":
5554
- const a = this.reSerGeometry(s.geometry), u = this.reSerMaterial(s.material);
5555
+ const a = this.reSerGeometry(r.geometry), u = this.reSerMaterial(r.material);
5555
5556
  i = new bt.Mesh(a, u);
5556
5557
  break;
5557
5558
  case "Group":
@@ -5561,10 +5562,10 @@ class oa {
5561
5562
  i = new bt.Object3D();
5562
5563
  break;
5563
5564
  default:
5564
- return console.warn(`Unsupported object type: ${s.type}`), null;
5565
+ return console.warn(`Unsupported object type: ${r.type}`), null;
5565
5566
  }
5566
- i.name = s.name, i.position.fromArray(s.position), i.rotation.fromArray(s.rotation), i.scale.fromArray(s.scale), i.visible = s.visible;
5567
- for (const a of s.children) {
5567
+ i.name = r.name, i.position.fromArray(r.position), i.rotation.fromArray(r.rotation), i.scale.fromArray(r.scale), i.visible = r.visible, i.userData = r.userData;
5568
+ for (const a of r.children) {
5568
5569
  const u = this.reSerObject3D(a);
5569
5570
  u && i.add(u);
5570
5571
  }
@@ -5575,27 +5576,27 @@ class oa {
5575
5576
  * @param {string} path - 主键值
5576
5577
  * @param {THREE.Object3D} model - 要缓存的模型
5577
5578
  */
5578
- async cacheModel(s, i) {
5579
+ async cacheModel(r, i) {
5579
5580
  const a = this.serObject3D(i);
5580
- await this.db.table("models").put({ path: s, data: a }), console.log(`Model "${s}" cached successfully in table models`);
5581
+ await this.db.table("models").put({ path: r, data: a }), console.log(`Model "${r}" cached successfully in table models`);
5581
5582
  }
5582
5583
  /**
5583
5584
  * 从 IndexedDB 加载缓存的模型
5584
5585
  * @param {string} path - 主键值
5585
5586
  * @returns {THREE.Object3D | null} 加载的模型
5586
5587
  */
5587
- async loadCachedModel(s) {
5588
- const i = await this.db.table("models").get(s);
5588
+ async loadCachedModel(r) {
5589
+ const i = await this.db.table("models").get(r);
5589
5590
  if (!i)
5590
- return console.warn(`Model "${s}" not found in table models`), null;
5591
+ return console.warn(`Model "${r}" not found in table models`), null;
5591
5592
  const a = this.reSerObject3D(i.data);
5592
- return console.log(`Model "${s}" loaded from table models`), a;
5593
+ return console.log(`Model "${r}" loaded from table models`), a;
5593
5594
  }
5594
5595
  }
5595
5596
  let In;
5596
5597
  const Ta = () => {
5597
- const C = new vo(), s = new yo();
5598
- s.setDecoderPath("/draco/"), C.setDRACOLoader(s);
5598
+ const C = new vo(), r = new yo();
5599
+ r.setDecoderPath("/draco/"), C.setDRACOLoader(r);
5599
5600
  function i(c, l, p, h) {
5600
5601
  return C.load(c, l, p, h);
5601
5602
  }