@maucwerk/glimmer 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/vite/glimmer.mjs +378 -377
- package/dist/vite/glimmer.umd.js +9 -9
- package/package.json +1 -1
package/dist/vite/glimmer.mjs
CHANGED
|
@@ -89,7 +89,7 @@ const C = q.arrayToEnum([
|
|
|
89
89
|
default:
|
|
90
90
|
return C.unknown;
|
|
91
91
|
}
|
|
92
|
-
},
|
|
92
|
+
}, E = q.arrayToEnum([
|
|
93
93
|
"invalid_type",
|
|
94
94
|
"invalid_literal",
|
|
95
95
|
"custom",
|
|
@@ -170,52 +170,52 @@ De.create = (r) => new De(r);
|
|
|
170
170
|
const Xt = (r, e) => {
|
|
171
171
|
let t;
|
|
172
172
|
switch (r.code) {
|
|
173
|
-
case
|
|
173
|
+
case E.invalid_type:
|
|
174
174
|
r.received === C.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
175
175
|
break;
|
|
176
|
-
case
|
|
176
|
+
case E.invalid_literal:
|
|
177
177
|
t = `Invalid literal value, expected ${JSON.stringify(r.expected, q.jsonStringifyReplacer)}`;
|
|
178
178
|
break;
|
|
179
|
-
case
|
|
179
|
+
case E.unrecognized_keys:
|
|
180
180
|
t = `Unrecognized key(s) in object: ${q.joinValues(r.keys, ", ")}`;
|
|
181
181
|
break;
|
|
182
|
-
case
|
|
182
|
+
case E.invalid_union:
|
|
183
183
|
t = "Invalid input";
|
|
184
184
|
break;
|
|
185
|
-
case
|
|
185
|
+
case E.invalid_union_discriminator:
|
|
186
186
|
t = `Invalid discriminator value. Expected ${q.joinValues(r.options)}`;
|
|
187
187
|
break;
|
|
188
|
-
case
|
|
188
|
+
case E.invalid_enum_value:
|
|
189
189
|
t = `Invalid enum value. Expected ${q.joinValues(r.options)}, received '${r.received}'`;
|
|
190
190
|
break;
|
|
191
|
-
case
|
|
191
|
+
case E.invalid_arguments:
|
|
192
192
|
t = "Invalid function arguments";
|
|
193
193
|
break;
|
|
194
|
-
case
|
|
194
|
+
case E.invalid_return_type:
|
|
195
195
|
t = "Invalid function return type";
|
|
196
196
|
break;
|
|
197
|
-
case
|
|
197
|
+
case E.invalid_date:
|
|
198
198
|
t = "Invalid date";
|
|
199
199
|
break;
|
|
200
|
-
case
|
|
200
|
+
case E.invalid_string:
|
|
201
201
|
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : q.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
|
|
202
202
|
break;
|
|
203
|
-
case
|
|
203
|
+
case E.too_small:
|
|
204
204
|
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
205
205
|
break;
|
|
206
|
-
case
|
|
206
|
+
case E.too_big:
|
|
207
207
|
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
|
|
208
208
|
break;
|
|
209
|
-
case
|
|
209
|
+
case E.custom:
|
|
210
210
|
t = "Invalid input";
|
|
211
211
|
break;
|
|
212
|
-
case
|
|
212
|
+
case E.invalid_intersection_types:
|
|
213
213
|
t = "Intersection results could not be merged";
|
|
214
214
|
break;
|
|
215
|
-
case
|
|
215
|
+
case E.not_multiple_of:
|
|
216
216
|
t = `Number must be a multiple of ${r.multipleOf}`;
|
|
217
217
|
break;
|
|
218
|
-
case
|
|
218
|
+
case E.not_finite:
|
|
219
219
|
t = "Number must be finite";
|
|
220
220
|
break;
|
|
221
221
|
default:
|
|
@@ -481,7 +481,7 @@ class X {
|
|
|
481
481
|
const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
482
482
|
return this._refinement((s, i) => {
|
|
483
483
|
const o = e(s), a = () => i.addIssue({
|
|
484
|
-
code:
|
|
484
|
+
code: E.custom,
|
|
485
485
|
...n(s)
|
|
486
486
|
});
|
|
487
487
|
return typeof Promise < "u" && o instanceof Promise ? o.then((c) => c ? !0 : (a(), !1)) : o ? !0 : (a(), !1);
|
|
@@ -617,7 +617,7 @@ class Fe extends X {
|
|
|
617
617
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== C.string) {
|
|
618
618
|
const i = this._getOrReturnCtx(e);
|
|
619
619
|
return M(i, {
|
|
620
|
-
code:
|
|
620
|
+
code: E.invalid_type,
|
|
621
621
|
expected: C.string,
|
|
622
622
|
received: i.parsedType
|
|
623
623
|
}), B;
|
|
@@ -627,7 +627,7 @@ class Fe extends X {
|
|
|
627
627
|
for (const i of this._def.checks)
|
|
628
628
|
if (i.kind === "min")
|
|
629
629
|
e.data.length < i.value && (s = this._getOrReturnCtx(e, s), M(s, {
|
|
630
|
-
code:
|
|
630
|
+
code: E.too_small,
|
|
631
631
|
minimum: i.value,
|
|
632
632
|
type: "string",
|
|
633
633
|
inclusive: !0,
|
|
@@ -636,7 +636,7 @@ class Fe extends X {
|
|
|
636
636
|
}), n.dirty());
|
|
637
637
|
else if (i.kind === "max")
|
|
638
638
|
e.data.length > i.value && (s = this._getOrReturnCtx(e, s), M(s, {
|
|
639
|
-
code:
|
|
639
|
+
code: E.too_big,
|
|
640
640
|
maximum: i.value,
|
|
641
641
|
type: "string",
|
|
642
642
|
inclusive: !0,
|
|
@@ -646,14 +646,14 @@ class Fe extends X {
|
|
|
646
646
|
else if (i.kind === "length") {
|
|
647
647
|
const o = e.data.length > i.value, a = e.data.length < i.value;
|
|
648
648
|
(o || a) && (s = this._getOrReturnCtx(e, s), o ? M(s, {
|
|
649
|
-
code:
|
|
649
|
+
code: E.too_big,
|
|
650
650
|
maximum: i.value,
|
|
651
651
|
type: "string",
|
|
652
652
|
inclusive: !0,
|
|
653
653
|
exact: !0,
|
|
654
654
|
message: i.message
|
|
655
655
|
}) : a && M(s, {
|
|
656
|
-
code:
|
|
656
|
+
code: E.too_small,
|
|
657
657
|
minimum: i.value,
|
|
658
658
|
type: "string",
|
|
659
659
|
inclusive: !0,
|
|
@@ -663,43 +663,43 @@ class Fe extends X {
|
|
|
663
663
|
} else if (i.kind === "email")
|
|
664
664
|
ga.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
665
665
|
validation: "email",
|
|
666
|
-
code:
|
|
666
|
+
code: E.invalid_string,
|
|
667
667
|
message: i.message
|
|
668
668
|
}), n.dirty());
|
|
669
669
|
else if (i.kind === "emoji")
|
|
670
670
|
Ms || (Ms = new RegExp(ya, "u")), Ms.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
671
671
|
validation: "emoji",
|
|
672
|
-
code:
|
|
672
|
+
code: E.invalid_string,
|
|
673
673
|
message: i.message
|
|
674
674
|
}), n.dirty());
|
|
675
675
|
else if (i.kind === "uuid")
|
|
676
676
|
fa.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
677
677
|
validation: "uuid",
|
|
678
|
-
code:
|
|
678
|
+
code: E.invalid_string,
|
|
679
679
|
message: i.message
|
|
680
680
|
}), n.dirty());
|
|
681
681
|
else if (i.kind === "nanoid")
|
|
682
682
|
pa.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
683
683
|
validation: "nanoid",
|
|
684
|
-
code:
|
|
684
|
+
code: E.invalid_string,
|
|
685
685
|
message: i.message
|
|
686
686
|
}), n.dirty());
|
|
687
687
|
else if (i.kind === "cuid")
|
|
688
688
|
da.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
689
689
|
validation: "cuid",
|
|
690
|
-
code:
|
|
690
|
+
code: E.invalid_string,
|
|
691
691
|
message: i.message
|
|
692
692
|
}), n.dirty());
|
|
693
693
|
else if (i.kind === "cuid2")
|
|
694
694
|
ua.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
695
695
|
validation: "cuid2",
|
|
696
|
-
code:
|
|
696
|
+
code: E.invalid_string,
|
|
697
697
|
message: i.message
|
|
698
698
|
}), n.dirty());
|
|
699
699
|
else if (i.kind === "ulid")
|
|
700
700
|
ha.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
701
701
|
validation: "ulid",
|
|
702
|
-
code:
|
|
702
|
+
code: E.invalid_string,
|
|
703
703
|
message: i.message
|
|
704
704
|
}), n.dirty());
|
|
705
705
|
else if (i.kind === "url")
|
|
@@ -708,61 +708,61 @@ class Fe extends X {
|
|
|
708
708
|
} catch {
|
|
709
709
|
s = this._getOrReturnCtx(e, s), M(s, {
|
|
710
710
|
validation: "url",
|
|
711
|
-
code:
|
|
711
|
+
code: E.invalid_string,
|
|
712
712
|
message: i.message
|
|
713
713
|
}), n.dirty();
|
|
714
714
|
}
|
|
715
715
|
else i.kind === "regex" ? (i.regex.lastIndex = 0, i.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
716
716
|
validation: "regex",
|
|
717
|
-
code:
|
|
717
|
+
code: E.invalid_string,
|
|
718
718
|
message: i.message
|
|
719
719
|
}), n.dirty())) : i.kind === "trim" ? e.data = e.data.trim() : i.kind === "includes" ? e.data.includes(i.value, i.position) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
720
|
-
code:
|
|
720
|
+
code: E.invalid_string,
|
|
721
721
|
validation: { includes: i.value, position: i.position },
|
|
722
722
|
message: i.message
|
|
723
723
|
}), n.dirty()) : i.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : i.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : i.kind === "startsWith" ? e.data.startsWith(i.value) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
724
|
-
code:
|
|
724
|
+
code: E.invalid_string,
|
|
725
725
|
validation: { startsWith: i.value },
|
|
726
726
|
message: i.message
|
|
727
727
|
}), n.dirty()) : i.kind === "endsWith" ? e.data.endsWith(i.value) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
728
|
-
code:
|
|
728
|
+
code: E.invalid_string,
|
|
729
729
|
validation: { endsWith: i.value },
|
|
730
730
|
message: i.message
|
|
731
731
|
}), n.dirty()) : i.kind === "datetime" ? Wr(i).test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
732
|
-
code:
|
|
732
|
+
code: E.invalid_string,
|
|
733
733
|
validation: "datetime",
|
|
734
734
|
message: i.message
|
|
735
735
|
}), n.dirty()) : i.kind === "date" ? Ta.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
736
|
-
code:
|
|
736
|
+
code: E.invalid_string,
|
|
737
737
|
validation: "date",
|
|
738
738
|
message: i.message
|
|
739
739
|
}), n.dirty()) : i.kind === "time" ? Sa(i).test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
740
|
-
code:
|
|
740
|
+
code: E.invalid_string,
|
|
741
741
|
validation: "time",
|
|
742
742
|
message: i.message
|
|
743
743
|
}), n.dirty()) : i.kind === "duration" ? _a.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
744
744
|
validation: "duration",
|
|
745
|
-
code:
|
|
745
|
+
code: E.invalid_string,
|
|
746
746
|
message: i.message
|
|
747
747
|
}), n.dirty()) : i.kind === "ip" ? Ra(e.data, i.version) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
748
748
|
validation: "ip",
|
|
749
|
-
code:
|
|
749
|
+
code: E.invalid_string,
|
|
750
750
|
message: i.message
|
|
751
751
|
}), n.dirty()) : i.kind === "jwt" ? Ma(e.data, i.alg) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
752
752
|
validation: "jwt",
|
|
753
|
-
code:
|
|
753
|
+
code: E.invalid_string,
|
|
754
754
|
message: i.message
|
|
755
755
|
}), n.dirty()) : i.kind === "cidr" ? La(e.data, i.version) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
756
756
|
validation: "cidr",
|
|
757
|
-
code:
|
|
757
|
+
code: E.invalid_string,
|
|
758
758
|
message: i.message
|
|
759
759
|
}), n.dirty()) : i.kind === "base64" ? Ea.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
760
760
|
validation: "base64",
|
|
761
|
-
code:
|
|
761
|
+
code: E.invalid_string,
|
|
762
762
|
message: i.message
|
|
763
763
|
}), n.dirty()) : i.kind === "base64url" ? Aa.test(e.data) || (s = this._getOrReturnCtx(e, s), M(s, {
|
|
764
764
|
validation: "base64url",
|
|
765
|
-
code:
|
|
765
|
+
code: E.invalid_string,
|
|
766
766
|
message: i.message
|
|
767
767
|
}), n.dirty()) : q.assertNever(i);
|
|
768
768
|
return { status: n.value, value: e.data };
|
|
@@ -770,7 +770,7 @@ class Fe extends X {
|
|
|
770
770
|
_regex(e, t, n) {
|
|
771
771
|
return this.refinement((s) => e.test(s), {
|
|
772
772
|
validation: t,
|
|
773
|
-
code:
|
|
773
|
+
code: E.invalid_string,
|
|
774
774
|
...I.errToObj(n)
|
|
775
775
|
});
|
|
776
776
|
}
|
|
@@ -1011,7 +1011,7 @@ class ht extends X {
|
|
|
1011
1011
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== C.number) {
|
|
1012
1012
|
const i = this._getOrReturnCtx(e);
|
|
1013
1013
|
return M(i, {
|
|
1014
|
-
code:
|
|
1014
|
+
code: E.invalid_type,
|
|
1015
1015
|
expected: C.number,
|
|
1016
1016
|
received: i.parsedType
|
|
1017
1017
|
}), B;
|
|
@@ -1020,30 +1020,30 @@ class ht extends X {
|
|
|
1020
1020
|
const s = new xe();
|
|
1021
1021
|
for (const i of this._def.checks)
|
|
1022
1022
|
i.kind === "int" ? q.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
1023
|
-
code:
|
|
1023
|
+
code: E.invalid_type,
|
|
1024
1024
|
expected: "integer",
|
|
1025
1025
|
received: "float",
|
|
1026
1026
|
message: i.message
|
|
1027
1027
|
}), s.dirty()) : i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), M(n, {
|
|
1028
|
-
code:
|
|
1028
|
+
code: E.too_small,
|
|
1029
1029
|
minimum: i.value,
|
|
1030
1030
|
type: "number",
|
|
1031
1031
|
inclusive: i.inclusive,
|
|
1032
1032
|
exact: !1,
|
|
1033
1033
|
message: i.message
|
|
1034
1034
|
}), s.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), M(n, {
|
|
1035
|
-
code:
|
|
1035
|
+
code: E.too_big,
|
|
1036
1036
|
maximum: i.value,
|
|
1037
1037
|
type: "number",
|
|
1038
1038
|
inclusive: i.inclusive,
|
|
1039
1039
|
exact: !1,
|
|
1040
1040
|
message: i.message
|
|
1041
1041
|
}), s.dirty()) : i.kind === "multipleOf" ? Ca(e.data, i.value) !== 0 && (n = this._getOrReturnCtx(e, n), M(n, {
|
|
1042
|
-
code:
|
|
1042
|
+
code: E.not_multiple_of,
|
|
1043
1043
|
multipleOf: i.value,
|
|
1044
1044
|
message: i.message
|
|
1045
1045
|
}), s.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), M(n, {
|
|
1046
|
-
code:
|
|
1046
|
+
code: E.not_finite,
|
|
1047
1047
|
message: i.message
|
|
1048
1048
|
}), s.dirty()) : q.assertNever(i);
|
|
1049
1049
|
return { status: s.value, value: e.data };
|
|
@@ -1192,19 +1192,19 @@ class ft extends X {
|
|
|
1192
1192
|
const s = new xe();
|
|
1193
1193
|
for (const i of this._def.checks)
|
|
1194
1194
|
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), M(n, {
|
|
1195
|
-
code:
|
|
1195
|
+
code: E.too_small,
|
|
1196
1196
|
type: "bigint",
|
|
1197
1197
|
minimum: i.value,
|
|
1198
1198
|
inclusive: i.inclusive,
|
|
1199
1199
|
message: i.message
|
|
1200
1200
|
}), s.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), M(n, {
|
|
1201
|
-
code:
|
|
1201
|
+
code: E.too_big,
|
|
1202
1202
|
type: "bigint",
|
|
1203
1203
|
maximum: i.value,
|
|
1204
1204
|
inclusive: i.inclusive,
|
|
1205
1205
|
message: i.message
|
|
1206
1206
|
}), s.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), M(n, {
|
|
1207
|
-
code:
|
|
1207
|
+
code: E.not_multiple_of,
|
|
1208
1208
|
multipleOf: i.value,
|
|
1209
1209
|
message: i.message
|
|
1210
1210
|
}), s.dirty()) : q.assertNever(i);
|
|
@@ -1213,7 +1213,7 @@ class ft extends X {
|
|
|
1213
1213
|
_getInvalidInput(e) {
|
|
1214
1214
|
const t = this._getOrReturnCtx(e);
|
|
1215
1215
|
return M(t, {
|
|
1216
|
-
code:
|
|
1216
|
+
code: E.invalid_type,
|
|
1217
1217
|
expected: C.bigint,
|
|
1218
1218
|
received: t.parsedType
|
|
1219
1219
|
}), B;
|
|
@@ -1316,7 +1316,7 @@ class pn extends X {
|
|
|
1316
1316
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== C.boolean) {
|
|
1317
1317
|
const n = this._getOrReturnCtx(e);
|
|
1318
1318
|
return M(n, {
|
|
1319
|
-
code:
|
|
1319
|
+
code: E.invalid_type,
|
|
1320
1320
|
expected: C.boolean,
|
|
1321
1321
|
received: n.parsedType
|
|
1322
1322
|
}), B;
|
|
@@ -1334,7 +1334,7 @@ class At extends X {
|
|
|
1334
1334
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== C.date) {
|
|
1335
1335
|
const i = this._getOrReturnCtx(e);
|
|
1336
1336
|
return M(i, {
|
|
1337
|
-
code:
|
|
1337
|
+
code: E.invalid_type,
|
|
1338
1338
|
expected: C.date,
|
|
1339
1339
|
received: i.parsedType
|
|
1340
1340
|
}), B;
|
|
@@ -1342,21 +1342,21 @@ class At extends X {
|
|
|
1342
1342
|
if (isNaN(e.data.getTime())) {
|
|
1343
1343
|
const i = this._getOrReturnCtx(e);
|
|
1344
1344
|
return M(i, {
|
|
1345
|
-
code:
|
|
1345
|
+
code: E.invalid_date
|
|
1346
1346
|
}), B;
|
|
1347
1347
|
}
|
|
1348
1348
|
const n = new xe();
|
|
1349
1349
|
let s;
|
|
1350
1350
|
for (const i of this._def.checks)
|
|
1351
1351
|
i.kind === "min" ? e.data.getTime() < i.value && (s = this._getOrReturnCtx(e, s), M(s, {
|
|
1352
|
-
code:
|
|
1352
|
+
code: E.too_small,
|
|
1353
1353
|
message: i.message,
|
|
1354
1354
|
inclusive: !0,
|
|
1355
1355
|
exact: !1,
|
|
1356
1356
|
minimum: i.value,
|
|
1357
1357
|
type: "date"
|
|
1358
1358
|
}), n.dirty()) : i.kind === "max" ? e.data.getTime() > i.value && (s = this._getOrReturnCtx(e, s), M(s, {
|
|
1359
|
-
code:
|
|
1359
|
+
code: E.too_big,
|
|
1360
1360
|
message: i.message,
|
|
1361
1361
|
inclusive: !0,
|
|
1362
1362
|
exact: !1,
|
|
@@ -1412,7 +1412,7 @@ class rs extends X {
|
|
|
1412
1412
|
if (this._getType(e) !== C.symbol) {
|
|
1413
1413
|
const n = this._getOrReturnCtx(e);
|
|
1414
1414
|
return M(n, {
|
|
1415
|
-
code:
|
|
1415
|
+
code: E.invalid_type,
|
|
1416
1416
|
expected: C.symbol,
|
|
1417
1417
|
received: n.parsedType
|
|
1418
1418
|
}), B;
|
|
@@ -1429,7 +1429,7 @@ class mn extends X {
|
|
|
1429
1429
|
if (this._getType(e) !== C.undefined) {
|
|
1430
1430
|
const n = this._getOrReturnCtx(e);
|
|
1431
1431
|
return M(n, {
|
|
1432
|
-
code:
|
|
1432
|
+
code: E.invalid_type,
|
|
1433
1433
|
expected: C.undefined,
|
|
1434
1434
|
received: n.parsedType
|
|
1435
1435
|
}), B;
|
|
@@ -1446,7 +1446,7 @@ class _n extends X {
|
|
|
1446
1446
|
if (this._getType(e) !== C.null) {
|
|
1447
1447
|
const n = this._getOrReturnCtx(e);
|
|
1448
1448
|
return M(n, {
|
|
1449
|
-
code:
|
|
1449
|
+
code: E.invalid_type,
|
|
1450
1450
|
expected: C.null,
|
|
1451
1451
|
received: n.parsedType
|
|
1452
1452
|
}), B;
|
|
@@ -1486,7 +1486,7 @@ class at extends X {
|
|
|
1486
1486
|
_parse(e) {
|
|
1487
1487
|
const t = this._getOrReturnCtx(e);
|
|
1488
1488
|
return M(t, {
|
|
1489
|
-
code:
|
|
1489
|
+
code: E.invalid_type,
|
|
1490
1490
|
expected: C.never,
|
|
1491
1491
|
received: t.parsedType
|
|
1492
1492
|
}), B;
|
|
@@ -1501,7 +1501,7 @@ class os extends X {
|
|
|
1501
1501
|
if (this._getType(e) !== C.undefined) {
|
|
1502
1502
|
const n = this._getOrReturnCtx(e);
|
|
1503
1503
|
return M(n, {
|
|
1504
|
-
code:
|
|
1504
|
+
code: E.invalid_type,
|
|
1505
1505
|
expected: C.void,
|
|
1506
1506
|
received: n.parsedType
|
|
1507
1507
|
}), B;
|
|
@@ -1518,14 +1518,14 @@ class je extends X {
|
|
|
1518
1518
|
const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
|
|
1519
1519
|
if (t.parsedType !== C.array)
|
|
1520
1520
|
return M(t, {
|
|
1521
|
-
code:
|
|
1521
|
+
code: E.invalid_type,
|
|
1522
1522
|
expected: C.array,
|
|
1523
1523
|
received: t.parsedType
|
|
1524
1524
|
}), B;
|
|
1525
1525
|
if (s.exactLength !== null) {
|
|
1526
1526
|
const o = t.data.length > s.exactLength.value, a = t.data.length < s.exactLength.value;
|
|
1527
1527
|
(o || a) && (M(t, {
|
|
1528
|
-
code: o ?
|
|
1528
|
+
code: o ? E.too_big : E.too_small,
|
|
1529
1529
|
minimum: a ? s.exactLength.value : void 0,
|
|
1530
1530
|
maximum: o ? s.exactLength.value : void 0,
|
|
1531
1531
|
type: "array",
|
|
@@ -1535,14 +1535,14 @@ class je extends X {
|
|
|
1535
1535
|
}), n.dirty());
|
|
1536
1536
|
}
|
|
1537
1537
|
if (s.minLength !== null && t.data.length < s.minLength.value && (M(t, {
|
|
1538
|
-
code:
|
|
1538
|
+
code: E.too_small,
|
|
1539
1539
|
minimum: s.minLength.value,
|
|
1540
1540
|
type: "array",
|
|
1541
1541
|
inclusive: !0,
|
|
1542
1542
|
exact: !1,
|
|
1543
1543
|
message: s.minLength.message
|
|
1544
1544
|
}), n.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (M(t, {
|
|
1545
|
-
code:
|
|
1545
|
+
code: E.too_big,
|
|
1546
1546
|
maximum: s.maxLength.value,
|
|
1547
1547
|
type: "array",
|
|
1548
1548
|
inclusive: !0,
|
|
@@ -1616,7 +1616,7 @@ class ie extends X {
|
|
|
1616
1616
|
if (this._getType(e) !== C.object) {
|
|
1617
1617
|
const l = this._getOrReturnCtx(e);
|
|
1618
1618
|
return M(l, {
|
|
1619
|
-
code:
|
|
1619
|
+
code: E.invalid_type,
|
|
1620
1620
|
expected: C.object,
|
|
1621
1621
|
received: l.parsedType
|
|
1622
1622
|
}), B;
|
|
@@ -1644,7 +1644,7 @@ class ie extends X {
|
|
|
1644
1644
|
});
|
|
1645
1645
|
else if (l === "strict")
|
|
1646
1646
|
a.length > 0 && (M(s, {
|
|
1647
|
-
code:
|
|
1647
|
+
code: E.unrecognized_keys,
|
|
1648
1648
|
keys: a
|
|
1649
1649
|
}), n.dirty());
|
|
1650
1650
|
else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
@@ -1901,7 +1901,7 @@ class gn extends X {
|
|
|
1901
1901
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1902
1902
|
const o = i.map((a) => new De(a.ctx.common.issues));
|
|
1903
1903
|
return M(t, {
|
|
1904
|
-
code:
|
|
1904
|
+
code: E.invalid_union,
|
|
1905
1905
|
unionErrors: o
|
|
1906
1906
|
}), B;
|
|
1907
1907
|
}
|
|
@@ -1948,7 +1948,7 @@ class gn extends X {
|
|
|
1948
1948
|
return t.common.issues.push(...i.ctx.common.issues), i.result;
|
|
1949
1949
|
const a = o.map((c) => new De(c));
|
|
1950
1950
|
return M(t, {
|
|
1951
|
-
code:
|
|
1951
|
+
code: E.invalid_union,
|
|
1952
1952
|
unionErrors: a
|
|
1953
1953
|
}), B;
|
|
1954
1954
|
}
|
|
@@ -1968,7 +1968,7 @@ class hs extends X {
|
|
|
1968
1968
|
const { ctx: t } = this._processInputParams(e);
|
|
1969
1969
|
if (t.parsedType !== C.object)
|
|
1970
1970
|
return M(t, {
|
|
1971
|
-
code:
|
|
1971
|
+
code: E.invalid_type,
|
|
1972
1972
|
expected: C.object,
|
|
1973
1973
|
received: t.parsedType
|
|
1974
1974
|
}), B;
|
|
@@ -1982,7 +1982,7 @@ class hs extends X {
|
|
|
1982
1982
|
path: t.path,
|
|
1983
1983
|
parent: t
|
|
1984
1984
|
}) : (M(t, {
|
|
1985
|
-
code:
|
|
1985
|
+
code: E.invalid_union_discriminator,
|
|
1986
1986
|
options: Array.from(this.optionsMap.keys()),
|
|
1987
1987
|
path: [n]
|
|
1988
1988
|
}), B);
|
|
@@ -2058,7 +2058,7 @@ class yn extends X {
|
|
|
2058
2058
|
return B;
|
|
2059
2059
|
const a = ti(i.value, o.value);
|
|
2060
2060
|
return a.valid ? ((ei(i) || ei(o)) && t.dirty(), { status: t.value, value: a.data }) : (M(n, {
|
|
2061
|
-
code:
|
|
2061
|
+
code: E.invalid_intersection_types
|
|
2062
2062
|
}), B);
|
|
2063
2063
|
};
|
|
2064
2064
|
return n.common.async ? Promise.all([
|
|
@@ -2094,20 +2094,20 @@ class Ye extends X {
|
|
|
2094
2094
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2095
2095
|
if (n.parsedType !== C.array)
|
|
2096
2096
|
return M(n, {
|
|
2097
|
-
code:
|
|
2097
|
+
code: E.invalid_type,
|
|
2098
2098
|
expected: C.array,
|
|
2099
2099
|
received: n.parsedType
|
|
2100
2100
|
}), B;
|
|
2101
2101
|
if (n.data.length < this._def.items.length)
|
|
2102
2102
|
return M(n, {
|
|
2103
|
-
code:
|
|
2103
|
+
code: E.too_small,
|
|
2104
2104
|
minimum: this._def.items.length,
|
|
2105
2105
|
inclusive: !0,
|
|
2106
2106
|
exact: !1,
|
|
2107
2107
|
type: "array"
|
|
2108
2108
|
}), B;
|
|
2109
2109
|
!this._def.rest && n.data.length > this._def.items.length && (M(n, {
|
|
2110
|
-
code:
|
|
2110
|
+
code: E.too_big,
|
|
2111
2111
|
maximum: this._def.items.length,
|
|
2112
2112
|
inclusive: !0,
|
|
2113
2113
|
exact: !1,
|
|
@@ -2150,7 +2150,7 @@ class vn extends X {
|
|
|
2150
2150
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2151
2151
|
if (n.parsedType !== C.object)
|
|
2152
2152
|
return M(n, {
|
|
2153
|
-
code:
|
|
2153
|
+
code: E.invalid_type,
|
|
2154
2154
|
expected: C.object,
|
|
2155
2155
|
received: n.parsedType
|
|
2156
2156
|
}), B;
|
|
@@ -2191,7 +2191,7 @@ class as extends X {
|
|
|
2191
2191
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2192
2192
|
if (n.parsedType !== C.map)
|
|
2193
2193
|
return M(n, {
|
|
2194
|
-
code:
|
|
2194
|
+
code: E.invalid_type,
|
|
2195
2195
|
expected: C.map,
|
|
2196
2196
|
received: n.parsedType
|
|
2197
2197
|
}), B;
|
|
@@ -2233,20 +2233,20 @@ class Tt extends X {
|
|
|
2233
2233
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2234
2234
|
if (n.parsedType !== C.set)
|
|
2235
2235
|
return M(n, {
|
|
2236
|
-
code:
|
|
2236
|
+
code: E.invalid_type,
|
|
2237
2237
|
expected: C.set,
|
|
2238
2238
|
received: n.parsedType
|
|
2239
2239
|
}), B;
|
|
2240
2240
|
const s = this._def;
|
|
2241
2241
|
s.minSize !== null && n.data.size < s.minSize.value && (M(n, {
|
|
2242
|
-
code:
|
|
2242
|
+
code: E.too_small,
|
|
2243
2243
|
minimum: s.minSize.value,
|
|
2244
2244
|
type: "set",
|
|
2245
2245
|
inclusive: !0,
|
|
2246
2246
|
exact: !1,
|
|
2247
2247
|
message: s.minSize.message
|
|
2248
2248
|
}), t.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (M(n, {
|
|
2249
|
-
code:
|
|
2249
|
+
code: E.too_big,
|
|
2250
2250
|
maximum: s.maxSize.value,
|
|
2251
2251
|
type: "set",
|
|
2252
2252
|
inclusive: !0,
|
|
@@ -2300,7 +2300,7 @@ class Gt extends X {
|
|
|
2300
2300
|
const { ctx: t } = this._processInputParams(e);
|
|
2301
2301
|
if (t.parsedType !== C.function)
|
|
2302
2302
|
return M(t, {
|
|
2303
|
-
code:
|
|
2303
|
+
code: E.invalid_type,
|
|
2304
2304
|
expected: C.function,
|
|
2305
2305
|
received: t.parsedType
|
|
2306
2306
|
}), B;
|
|
@@ -2315,7 +2315,7 @@ class Gt extends X {
|
|
|
2315
2315
|
Xt
|
|
2316
2316
|
].filter((l) => !!l),
|
|
2317
2317
|
issueData: {
|
|
2318
|
-
code:
|
|
2318
|
+
code: E.invalid_arguments,
|
|
2319
2319
|
argumentsError: c
|
|
2320
2320
|
}
|
|
2321
2321
|
});
|
|
@@ -2331,7 +2331,7 @@ class Gt extends X {
|
|
|
2331
2331
|
Xt
|
|
2332
2332
|
].filter((l) => !!l),
|
|
2333
2333
|
issueData: {
|
|
2334
|
-
code:
|
|
2334
|
+
code: E.invalid_return_type,
|
|
2335
2335
|
returnTypeError: c
|
|
2336
2336
|
}
|
|
2337
2337
|
});
|
|
@@ -2340,11 +2340,11 @@ class Gt extends X {
|
|
|
2340
2340
|
if (this._def.returns instanceof Yt) {
|
|
2341
2341
|
const a = this;
|
|
2342
2342
|
return Ee(async function(...c) {
|
|
2343
|
-
const l = new De([]), d = await a._def.args.parseAsync(c, i).catch((
|
|
2344
|
-
throw l.addIssue(n(c,
|
|
2343
|
+
const l = new De([]), d = await a._def.args.parseAsync(c, i).catch((f) => {
|
|
2344
|
+
throw l.addIssue(n(c, f)), l;
|
|
2345
2345
|
}), u = await Reflect.apply(o, this, d);
|
|
2346
|
-
return await a._def.returns._def.type.parseAsync(u, i).catch((
|
|
2347
|
-
throw l.addIssue(s(u,
|
|
2346
|
+
return await a._def.returns._def.type.parseAsync(u, i).catch((f) => {
|
|
2347
|
+
throw l.addIssue(s(u, f)), l;
|
|
2348
2348
|
});
|
|
2349
2349
|
});
|
|
2350
2350
|
} else {
|
|
@@ -2413,7 +2413,7 @@ class bn extends X {
|
|
|
2413
2413
|
const t = this._getOrReturnCtx(e);
|
|
2414
2414
|
return M(t, {
|
|
2415
2415
|
received: t.data,
|
|
2416
|
-
code:
|
|
2416
|
+
code: E.invalid_literal,
|
|
2417
2417
|
expected: this._def.value
|
|
2418
2418
|
}), B;
|
|
2419
2419
|
}
|
|
@@ -2445,14 +2445,14 @@ class pt extends X {
|
|
|
2445
2445
|
return M(t, {
|
|
2446
2446
|
expected: q.joinValues(n),
|
|
2447
2447
|
received: t.parsedType,
|
|
2448
|
-
code:
|
|
2448
|
+
code: E.invalid_type
|
|
2449
2449
|
}), B;
|
|
2450
2450
|
}
|
|
2451
2451
|
if (is(this, cn) || Vr(this, cn, new Set(this._def.values)), !is(this, cn).has(e.data)) {
|
|
2452
2452
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2453
2453
|
return M(t, {
|
|
2454
2454
|
received: t.data,
|
|
2455
|
-
code:
|
|
2455
|
+
code: E.invalid_enum_value,
|
|
2456
2456
|
options: n
|
|
2457
2457
|
}), B;
|
|
2458
2458
|
}
|
|
@@ -2505,14 +2505,14 @@ class wn extends X {
|
|
|
2505
2505
|
return M(n, {
|
|
2506
2506
|
expected: q.joinValues(s),
|
|
2507
2507
|
received: n.parsedType,
|
|
2508
|
-
code:
|
|
2508
|
+
code: E.invalid_type
|
|
2509
2509
|
}), B;
|
|
2510
2510
|
}
|
|
2511
2511
|
if (is(this, ln) || Vr(this, ln, new Set(q.getValidEnumValues(this._def.values))), !is(this, ln).has(e.data)) {
|
|
2512
2512
|
const s = q.objectValues(t);
|
|
2513
2513
|
return M(n, {
|
|
2514
2514
|
received: n.data,
|
|
2515
|
-
code:
|
|
2515
|
+
code: E.invalid_enum_value,
|
|
2516
2516
|
options: s
|
|
2517
2517
|
}), B;
|
|
2518
2518
|
}
|
|
@@ -2536,7 +2536,7 @@ class Yt extends X {
|
|
|
2536
2536
|
const { ctx: t } = this._processInputParams(e);
|
|
2537
2537
|
if (t.parsedType !== C.promise && t.common.async === !1)
|
|
2538
2538
|
return M(t, {
|
|
2539
|
-
code:
|
|
2539
|
+
code: E.invalid_type,
|
|
2540
2540
|
expected: C.promise,
|
|
2541
2541
|
received: t.parsedType
|
|
2542
2542
|
}), B;
|
|
@@ -2735,7 +2735,7 @@ class cs extends X {
|
|
|
2735
2735
|
if (this._getType(e) !== C.nan) {
|
|
2736
2736
|
const n = this._getOrReturnCtx(e);
|
|
2737
2737
|
return M(n, {
|
|
2738
|
-
code:
|
|
2738
|
+
code: E.invalid_type,
|
|
2739
2739
|
expected: C.nan,
|
|
2740
2740
|
received: n.parsedType
|
|
2741
2741
|
}), B;
|
|
@@ -2968,7 +2968,7 @@ var A = /* @__PURE__ */ Object.freeze({
|
|
|
2968
2968
|
unknown: Ba,
|
|
2969
2969
|
void: Va,
|
|
2970
2970
|
NEVER: pc,
|
|
2971
|
-
ZodIssueCode:
|
|
2971
|
+
ZodIssueCode: E,
|
|
2972
2972
|
quotelessJson: aa,
|
|
2973
2973
|
ZodError: De
|
|
2974
2974
|
});
|
|
@@ -3651,8 +3651,8 @@ class Dc extends EventTarget {
|
|
|
3651
3651
|
t || (t = 30), this._orbit_duration_seconds = t, n === void 0 && (n = !0), this._orbit_clockwise = n, this.stop_animation();
|
|
3652
3652
|
const i = t ?? this._orbit_duration_seconds, o = n ?? this._orbit_clockwise, a = this.camera.position.clone(), c = this.controls.target.clone(), l = c.clone();
|
|
3653
3653
|
l.y = a.y;
|
|
3654
|
-
const d = a.distanceTo(l), u = Math.PI * 2, h = performance.now(),
|
|
3655
|
-
const T = (
|
|
3654
|
+
const d = a.distanceTo(l), u = Math.PI * 2, h = performance.now(), f = a.x - l.x, g = a.z - l.z, y = Math.atan2(g, f), x = (w) => 1 - Math.cos(w * Math.PI / 2), b = (w) => {
|
|
3655
|
+
const T = (w - h) / 1e3;
|
|
3656
3656
|
let v = 0;
|
|
3657
3657
|
T < s ? v = x(T / s) * s : v = T - s + x(1) * s;
|
|
3658
3658
|
const P = v % i / i, V = y + (o ? -1 : 1) * P * u, F = l.x + Math.cos(V) * d, L = l.z + Math.sin(V) * d, R = new m.Vector3(F, a.y, L);
|
|
@@ -4016,7 +4016,7 @@ class Pc extends To {
|
|
|
4016
4016
|
if (($ = ee.match(O)) && (k.gamma = parseFloat($[1])), ($ = ee.match(N)) && (k.exposure = parseFloat($[1])), ($ = ee.match(G)) && (k.valid |= 2, k.format = $[1]), ($ = ee.match(Z)) && (k.valid |= 4, k.height = parseInt($[1], 10), k.width = parseInt($[2], 10)), k.valid & 2 && k.valid & 4) break;
|
|
4017
4017
|
}
|
|
4018
4018
|
return k.valid & 2 || o(3, "missing format specifier"), k.valid & 4 || o(3, "missing image size specifier"), k;
|
|
4019
|
-
},
|
|
4019
|
+
}, f = function(L, R, O) {
|
|
4020
4020
|
const N = R;
|
|
4021
4021
|
if (
|
|
4022
4022
|
// run length encoding is not allowed so read flat
|
|
@@ -4059,7 +4059,7 @@ class Pc extends To {
|
|
|
4059
4059
|
O[N + 0] = an.toHalfFloat(Math.min(L[R + 0] * Z, 65504)), O[N + 1] = an.toHalfFloat(Math.min(L[R + 1] * Z, 65504)), O[N + 2] = an.toHalfFloat(Math.min(L[R + 2] * Z, 65504)), O[N + 3] = an.toHalfFloat(1);
|
|
4060
4060
|
}, x = new Uint8Array(e);
|
|
4061
4061
|
x.pos = 0;
|
|
4062
|
-
const b = h(x),
|
|
4062
|
+
const b = h(x), w = b.width, T = b.height, v = f(x.subarray(x.pos), w, T);
|
|
4063
4063
|
let P, V, F;
|
|
4064
4064
|
switch (this.type) {
|
|
4065
4065
|
case Ts:
|
|
@@ -4080,7 +4080,7 @@ class Pc extends To {
|
|
|
4080
4080
|
throw new Error("THREE.RGBELoader: Unsupported type: " + this.type);
|
|
4081
4081
|
}
|
|
4082
4082
|
return {
|
|
4083
|
-
width:
|
|
4083
|
+
width: w,
|
|
4084
4084
|
height: T,
|
|
4085
4085
|
data: P,
|
|
4086
4086
|
header: b.string,
|
|
@@ -4176,7 +4176,7 @@ class Uc extends gi {
|
|
|
4176
4176
|
}
|
|
4177
4177
|
let c, l;
|
|
4178
4178
|
for (let d = 0; d < a.length; d++) {
|
|
4179
|
-
const { sectionType: u, section: h, sectionOffset:
|
|
4179
|
+
const { sectionType: u, section: h, sectionOffset: f } = a[d];
|
|
4180
4180
|
if (u !== 224) {
|
|
4181
4181
|
if (u === 225)
|
|
4182
4182
|
this._parseXMPMetadata(
|
|
@@ -4188,7 +4188,7 @@ class Uc extends gi {
|
|
|
4188
4188
|
new Uint8Array(h.slice(2)).buffer
|
|
4189
4189
|
);
|
|
4190
4190
|
if (g.getUint32(2, !1) === 1297106432) {
|
|
4191
|
-
const x = g.getUint32(6) === 1229531648, b = 60,
|
|
4191
|
+
const x = g.getUint32(6) === 1229531648, b = 60, w = g.getUint32(
|
|
4192
4192
|
b,
|
|
4193
4193
|
x
|
|
4194
4194
|
), T = g.getUint32(
|
|
@@ -4197,11 +4197,11 @@ class Uc extends gi {
|
|
|
4197
4197
|
), v = g.getUint32(
|
|
4198
4198
|
b + 16,
|
|
4199
4199
|
x
|
|
4200
|
-
), P = g.getUint32(b + 20, x) +
|
|
4200
|
+
), P = g.getUint32(b + 20, x) + f + 6;
|
|
4201
4201
|
c = new Uint8Array(
|
|
4202
4202
|
i.buffer,
|
|
4203
4203
|
T,
|
|
4204
|
-
|
|
4204
|
+
w
|
|
4205
4205
|
), l = new Uint8Array(
|
|
4206
4206
|
i.buffer,
|
|
4207
4207
|
P,
|
|
@@ -4352,7 +4352,7 @@ class Uc extends gi {
|
|
|
4352
4352
|
a.width,
|
|
4353
4353
|
a.height
|
|
4354
4354
|
);
|
|
4355
|
-
const
|
|
4355
|
+
const f = h.getImageData(
|
|
4356
4356
|
0,
|
|
4357
4357
|
0,
|
|
4358
4358
|
a.width,
|
|
@@ -4375,14 +4375,14 @@ class Uc extends gi {
|
|
|
4375
4375
|
1.8,
|
|
4376
4376
|
e.hdrCapacityMax
|
|
4377
4377
|
)
|
|
4378
|
-
), b = (Math.log2(x) - e.hdrCapacityMin) / (e.hdrCapacityMax - e.hdrCapacityMin),
|
|
4378
|
+
), b = (Math.log2(x) - e.hdrCapacityMin) / (e.hdrCapacityMax - e.hdrCapacityMin), w = Math.min(
|
|
4379
4379
|
Math.max(b, 0),
|
|
4380
4380
|
1
|
|
4381
4381
|
), T = e.gamma === 1;
|
|
4382
4382
|
for (let v = 0; v < g.data.length; v += 4) {
|
|
4383
4383
|
const P = v / 4 % a.width, V = Math.floor(v / 4 / a.width);
|
|
4384
4384
|
for (let F = 0; F < 3; F++) {
|
|
4385
|
-
const L = g.data[v + F], R = (V * a.width + P) * 4 + F, O =
|
|
4385
|
+
const L = g.data[v + F], R = (V * a.width + P) * 4 + F, O = f.data[R] / 255, N = T ? O : Math.pow(O, 1 / e.gamma), G = e.gainMapMin * (1 - N) + e.gainMapMax * N, Z = (L + e.offsetSDR) * (G * w === 0 ? 1 : Math.pow(2, G * w)) - e.offsetHDR, k = Math.min(
|
|
4386
4386
|
Math.max(this._srgbToLinear(Z), 0),
|
|
4387
4387
|
65504
|
|
4388
4388
|
);
|
|
@@ -4608,8 +4608,8 @@ class Fc extends Lo {
|
|
|
4608
4608
|
u.position.set(-2.193, -0.369, -5.547), u.rotation.set(0, 0.516, 0), u.scale.set(3.875, 3.487, 2.986), this.add(u);
|
|
4609
4609
|
const h = new ye(e, Nt(50));
|
|
4610
4610
|
h.position.set(-16.116, 14.37, 8.208), h.scale.set(0.1, 2.428, 2.739), this.add(h);
|
|
4611
|
-
const
|
|
4612
|
-
|
|
4611
|
+
const f = new ye(e, Nt(50));
|
|
4612
|
+
f.position.set(-16.109, 18.021, -8.207), f.scale.set(0.1, 2.425, 2.751), this.add(f);
|
|
4613
4613
|
const g = new ye(e, Nt(17));
|
|
4614
4614
|
g.position.set(14.904, 12.198, -1.832), g.scale.set(0.15, 4.265, 6.331), this.add(g);
|
|
4615
4615
|
const y = new ye(e, Nt(43));
|
|
@@ -4805,7 +4805,7 @@ class Xc {
|
|
|
4805
4805
|
const o = i.detail.texture;
|
|
4806
4806
|
if (this.environment.texture = o, this.sun && this.sun_settings) {
|
|
4807
4807
|
const a = this._infer_sun_position_from_env_map();
|
|
4808
|
-
H.debug("Texture loaded event call; inferred Sun position from env map:", a), this.sun_settings.position = [a.x, a.y, a.z], this.update();
|
|
4808
|
+
a && (H.debug("Texture loaded event call; inferred Sun position from env map:", a), this.sun_settings.position = [a.x, a.y, a.z], this.update());
|
|
4809
4809
|
}
|
|
4810
4810
|
}), this.update();
|
|
4811
4811
|
}
|
|
@@ -4817,7 +4817,7 @@ class Xc {
|
|
|
4817
4817
|
this.model_manager.ready.then(() => {
|
|
4818
4818
|
if (this.sun_settings) {
|
|
4819
4819
|
const e = this._infer_sun_position_from_env_map();
|
|
4820
|
-
H.debug("Inferred Sun position from env map:", e), this.sun_settings.position = [e.x, e.y, e.z], this.sun_create();
|
|
4820
|
+
e && (H.debug("Inferred Sun position from env map:", e), this.sun_settings.position = [e.x, e.y, e.z]), this.sun_create();
|
|
4821
4821
|
}
|
|
4822
4822
|
});
|
|
4823
4823
|
}
|
|
@@ -4854,44 +4854,45 @@ class Xc {
|
|
|
4854
4854
|
}
|
|
4855
4855
|
_infer_sun_position_from_env_map() {
|
|
4856
4856
|
if (!this.environment)
|
|
4857
|
-
return H.warn("No environment map available."),
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4857
|
+
return H.warn("No environment map available."), null;
|
|
4858
|
+
const e = this.environment.texture, t = e == null ? void 0 : e.image;
|
|
4859
|
+
if (!t || !t.width || !t.height || !t.data)
|
|
4860
|
+
return H.warn("No environment map texture found."), null;
|
|
4861
|
+
const n = t.width, s = t.height, i = t.data;
|
|
4862
|
+
let o = 0;
|
|
4863
|
+
const a = [];
|
|
4864
|
+
for (let f = 0; f < i.length; f += 4) {
|
|
4865
|
+
const g = i[f], y = i[f + 1], x = i[f + 2], b = 0.2126 * g + 0.7152 * y + 0.0722 * x;
|
|
4866
|
+
if (b > o) {
|
|
4867
|
+
o = b, a.length = 0;
|
|
4868
|
+
const w = f / 4;
|
|
4869
|
+
a.push({
|
|
4870
|
+
x: w % n,
|
|
4871
|
+
y: Math.floor(w / n)
|
|
4871
4872
|
});
|
|
4872
|
-
} else if (
|
|
4873
|
-
const
|
|
4874
|
-
|
|
4875
|
-
x:
|
|
4876
|
-
y: Math.floor(
|
|
4873
|
+
} else if (b === o) {
|
|
4874
|
+
const w = f / 4;
|
|
4875
|
+
a.push({
|
|
4876
|
+
x: w % n,
|
|
4877
|
+
y: Math.floor(w / n)
|
|
4877
4878
|
});
|
|
4878
4879
|
}
|
|
4879
4880
|
}
|
|
4880
|
-
let
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
}),
|
|
4884
|
-
let
|
|
4885
|
-
|
|
4886
|
-
const
|
|
4887
|
-
Math.sin(
|
|
4881
|
+
let c = 0, l = 0;
|
|
4882
|
+
a.forEach((f) => {
|
|
4883
|
+
c += f.x, l += f.y;
|
|
4884
|
+
}), c /= a.length, l /= a.length;
|
|
4885
|
+
let d = c / n * 2 * Math.PI;
|
|
4886
|
+
d = (d + Math.PI) % (2 * Math.PI);
|
|
4887
|
+
const u = l / s * Math.PI, h = new m.Vector3(
|
|
4888
|
+
Math.sin(u) * Math.cos(d),
|
|
4888
4889
|
// x
|
|
4889
|
-
Math.cos(
|
|
4890
|
+
Math.cos(u),
|
|
4890
4891
|
// y (up)
|
|
4891
|
-
Math.sin(
|
|
4892
|
+
Math.sin(u) * Math.sin(d)
|
|
4892
4893
|
// z
|
|
4893
4894
|
);
|
|
4894
|
-
return
|
|
4895
|
+
return h.normalize(), h.multiplyScalar(100);
|
|
4895
4896
|
}
|
|
4896
4897
|
dispose() {
|
|
4897
4898
|
var e, t;
|
|
@@ -4930,8 +4931,8 @@ function Qc(r, e = 1e-4) {
|
|
|
4930
4931
|
const t = {}, n = r.getIndex(), s = r.getAttribute("position"), i = n ? n.count : s.count;
|
|
4931
4932
|
let o = 0;
|
|
4932
4933
|
const a = Object.keys(r.attributes), c = {}, l = {}, d = [], u = ["getX", "getY", "getZ", "getW"], h = ["setX", "setY", "setZ", "setW"];
|
|
4933
|
-
for (let
|
|
4934
|
-
const v = a[
|
|
4934
|
+
for (let w = 0, T = a.length; w < T; w++) {
|
|
4935
|
+
const v = a[w], P = r.attributes[v];
|
|
4935
4936
|
c[v] = new P.constructor(
|
|
4936
4937
|
new P.array.constructor(P.count * P.itemSize),
|
|
4937
4938
|
P.itemSize,
|
|
@@ -4943,9 +4944,9 @@ function Qc(r, e = 1e-4) {
|
|
|
4943
4944
|
l[v][L] = new F.constructor(R, F.itemSize, F.normalized);
|
|
4944
4945
|
}));
|
|
4945
4946
|
}
|
|
4946
|
-
const
|
|
4947
|
-
for (let
|
|
4948
|
-
const T = n ? n.getX(
|
|
4947
|
+
const f = e * 0.5, g = Math.log10(1 / e), y = Math.pow(10, g), x = f * y;
|
|
4948
|
+
for (let w = 0; w < i; w++) {
|
|
4949
|
+
const T = n ? n.getX(w) : w;
|
|
4949
4950
|
let v = "";
|
|
4950
4951
|
for (let P = 0, V = a.length; P < V; P++) {
|
|
4951
4952
|
const F = a[P], L = r.getAttribute(F), R = L.itemSize;
|
|
@@ -4968,16 +4969,16 @@ function Qc(r, e = 1e-4) {
|
|
|
4968
4969
|
}
|
|
4969
4970
|
}
|
|
4970
4971
|
const b = r.clone();
|
|
4971
|
-
for (const
|
|
4972
|
-
const T = c[
|
|
4973
|
-
if (b.setAttribute(
|
|
4972
|
+
for (const w in r.attributes) {
|
|
4973
|
+
const T = c[w];
|
|
4974
|
+
if (b.setAttribute(w, new T.constructor(
|
|
4974
4975
|
T.array.slice(0, o * T.itemSize),
|
|
4975
4976
|
T.itemSize,
|
|
4976
4977
|
T.normalized
|
|
4977
|
-
)),
|
|
4978
|
-
for (let v = 0; v < l[
|
|
4979
|
-
const P = l[
|
|
4980
|
-
b.morphAttributes[
|
|
4978
|
+
)), w in l)
|
|
4979
|
+
for (let v = 0; v < l[w].length; v++) {
|
|
4980
|
+
const P = l[w][v];
|
|
4981
|
+
b.morphAttributes[w][v] = new P.constructor(
|
|
4981
4982
|
P.array.slice(0, o * P.itemSize),
|
|
4982
4983
|
P.itemSize,
|
|
4983
4984
|
P.normalized
|
|
@@ -5692,7 +5693,7 @@ function el(r, e) {
|
|
|
5692
5693
|
function tl(r, e, t) {
|
|
5693
5694
|
const n = e.projectionMatrix, i = r.material.resolution, o = r.matrixWorld, a = r.geometry, c = a.attributes.instanceStart, l = a.attributes.instanceEnd, d = Math.min(a.instanceCount, c.count), u = -e.near;
|
|
5694
5695
|
We.at(1, Ve), Ve.w = 1, Ve.applyMatrix4(e.matrixWorldInverse), Ve.applyMatrix4(n), Ve.multiplyScalar(1 / Ve.w), Ve.x *= i.x / 2, Ve.y *= i.y / 2, Ve.z = 0, ks.copy(Ve), Ds.multiplyMatrices(e.matrixWorldInverse, o);
|
|
5695
|
-
for (let h = 0,
|
|
5696
|
+
for (let h = 0, f = d; h < f; h++) {
|
|
5696
5697
|
if (fe.fromBufferAttribute(c, h), pe.fromBufferAttribute(l, h), fe.w = 1, pe.w = 1, fe.applyMatrix4(Ds), pe.applyMatrix4(Ds), fe.z > u && pe.z > u)
|
|
5697
5698
|
continue;
|
|
5698
5699
|
if (fe.z > u) {
|
|
@@ -5705,8 +5706,8 @@ function tl(r, e, t) {
|
|
|
5705
5706
|
fe.applyMatrix4(n), pe.applyMatrix4(n), fe.multiplyScalar(1 / fe.w), pe.multiplyScalar(1 / pe.w), fe.x *= i.x / 2, fe.y *= i.y / 2, pe.x *= i.x / 2, pe.y *= i.y / 2, _e.start.copy(fe), _e.start.z = 0, _e.end.copy(pe), _e.end.z = 0;
|
|
5706
5707
|
const y = _e.closestPointToPointParameter(ks, !0);
|
|
5707
5708
|
_e.at(y, ur);
|
|
5708
|
-
const x = _i.lerp(fe.z, pe.z, y), b = x >= -1 && x <= 1,
|
|
5709
|
-
if (b &&
|
|
5709
|
+
const x = _i.lerp(fe.z, pe.z, y), b = x >= -1 && x <= 1, w = ks.distanceTo(ur) < wt * 0.5;
|
|
5710
|
+
if (b && w) {
|
|
5710
5711
|
_e.start.fromBufferAttribute(c, h), _e.end.fromBufferAttribute(l, h), _e.start.applyMatrix4(o), _e.end.applyMatrix4(o);
|
|
5711
5712
|
const T = new J(), v = new J();
|
|
5712
5713
|
We.distanceSqToSegment(_e.start, _e.end, v, T), t.push({
|
|
@@ -5808,13 +5809,13 @@ class pr extends m.BufferGeometry {
|
|
|
5808
5809
|
};
|
|
5809
5810
|
}
|
|
5810
5811
|
}
|
|
5811
|
-
const o = [], a = [], c = [], l = [], d = new m.Triangle(), u = new m.Triangle(), h = new m.Vector3(),
|
|
5812
|
+
const o = [], a = [], c = [], l = [], d = new m.Triangle(), u = new m.Triangle(), h = new m.Vector3(), f = new m.Vector3(), g = new m.Vector3(), y = new m.Vector3(), x = new m.Vector3(), b = new m.Vector3(), w = new m.Vector3();
|
|
5812
5813
|
for (const T in n) {
|
|
5813
5814
|
const { index0: v, index1: P, controlIndex0: V, controlIndex1: F, tri0: L, tri1: R } = n[T];
|
|
5814
5815
|
if (F === null) continue;
|
|
5815
|
-
d.a.fromBufferAttribute(s, i.getX(L * 3 + 0)), d.b.fromBufferAttribute(s, i.getX(L * 3 + 1)), d.c.fromBufferAttribute(s, i.getX(L * 3 + 2)), u.a.fromBufferAttribute(s, i.getX(R * 3 + 0)), u.b.fromBufferAttribute(s, i.getX(R * 3 + 1)), u.c.fromBufferAttribute(s, i.getX(R * 3 + 2)), d.getNormal(h).normalize(), u.getNormal(
|
|
5816
|
+
d.a.fromBufferAttribute(s, i.getX(L * 3 + 0)), d.b.fromBufferAttribute(s, i.getX(L * 3 + 1)), d.c.fromBufferAttribute(s, i.getX(L * 3 + 2)), u.a.fromBufferAttribute(s, i.getX(R * 3 + 0)), u.b.fromBufferAttribute(s, i.getX(R * 3 + 1)), u.c.fromBufferAttribute(s, i.getX(R * 3 + 2)), d.getNormal(h).normalize(), u.getNormal(f).normalize();
|
|
5816
5817
|
const O = Math.cos(m.MathUtils.degToRad(t));
|
|
5817
|
-
h.dot(
|
|
5818
|
+
h.dot(f) > O || (g.fromBufferAttribute(s, v), y.fromBufferAttribute(s, P), x.subVectors(g, y), b.fromBufferAttribute(s, V), w.fromBufferAttribute(s, F), o.push(g.x, g.y, g.z), a.push(x.x, x.y, x.z), c.push(b.x, b.y, b.z), l.push(w.x, w.y, w.z), o.push(y.x, y.y, y.z), a.push(x.x, x.y, x.z), c.push(b.x, b.y, b.z), l.push(w.x, w.y, w.z));
|
|
5818
5819
|
}
|
|
5819
5820
|
this.setAttribute("position", new m.BufferAttribute(new Float32Array(o), 3, !1)), this.setAttribute("direction", new m.BufferAttribute(new Float32Array(a), 3, !1)), this.setAttribute("control0", new m.BufferAttribute(new Float32Array(c), 3, !1)), this.setAttribute("control1", new m.BufferAttribute(new Float32Array(l), 3, !1));
|
|
5820
5821
|
}
|
|
@@ -7129,11 +7130,11 @@ class Ll {
|
|
|
7129
7130
|
}
|
|
7130
7131
|
return i.then(function(a) {
|
|
7131
7132
|
const c = s.byteOffset || 0, l = s.byteLength || 0, d = s.count, u = s.byteStride, h = new Uint8Array(a, c, l);
|
|
7132
|
-
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, h, s.mode, s.filter).then(function(
|
|
7133
|
-
return
|
|
7133
|
+
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, h, s.mode, s.filter).then(function(f) {
|
|
7134
|
+
return f.buffer;
|
|
7134
7135
|
}) : o.ready.then(function() {
|
|
7135
|
-
const
|
|
7136
|
-
return o.decodeGltfBuffer(new Uint8Array(
|
|
7136
|
+
const f = new ArrayBuffer(d * u);
|
|
7137
|
+
return o.decodeGltfBuffer(new Uint8Array(f), d, u, h, s.mode, s.filter), f;
|
|
7137
7138
|
});
|
|
7138
7139
|
});
|
|
7139
7140
|
} else
|
|
@@ -7156,19 +7157,19 @@ class Cl {
|
|
|
7156
7157
|
for (const l in o)
|
|
7157
7158
|
a.push(this.parser.getDependency("accessor", o[l]).then((d) => (c[l] = d, c[l])));
|
|
7158
7159
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((l) => {
|
|
7159
|
-
const d = l.pop(), u = d.isGroup ? d.children : [d], h = l[0].count,
|
|
7160
|
+
const d = l.pop(), u = d.isGroup ? d.children : [d], h = l[0].count, f = [];
|
|
7160
7161
|
for (const g of u) {
|
|
7161
|
-
const y = new hn(), x = new J(), b = new es(),
|
|
7162
|
+
const y = new hn(), x = new J(), b = new es(), w = new J(1, 1, 1), T = new Po(g.geometry, g.material, h);
|
|
7162
7163
|
for (let v = 0; v < h; v++)
|
|
7163
|
-
c.TRANSLATION && x.fromBufferAttribute(c.TRANSLATION, v), c.ROTATION && b.fromBufferAttribute(c.ROTATION, v), c.SCALE &&
|
|
7164
|
+
c.TRANSLATION && x.fromBufferAttribute(c.TRANSLATION, v), c.ROTATION && b.fromBufferAttribute(c.ROTATION, v), c.SCALE && w.fromBufferAttribute(c.SCALE, v), T.setMatrixAt(v, y.compose(x, b, w));
|
|
7164
7165
|
for (const v in c)
|
|
7165
7166
|
if (v === "_COLOR_0") {
|
|
7166
7167
|
const P = c[v];
|
|
7167
7168
|
T.instanceColor = new zo(P.array, P.itemSize, P.normalized);
|
|
7168
7169
|
} else v !== "TRANSLATION" && v !== "ROTATION" && v !== "SCALE" && g.geometry.setAttribute(v, c[v]);
|
|
7169
|
-
zr.prototype.copy.call(T, g), this.parser.assignFinalMaterial(T),
|
|
7170
|
+
zr.prototype.copy.call(T, g), this.parser.assignFinalMaterial(T), f.push(T);
|
|
7170
7171
|
}
|
|
7171
|
-
return d.isGroup ? (d.clear(), d.add(...
|
|
7172
|
+
return d.isGroup ? (d.clear(), d.add(...f), d) : f[0];
|
|
7172
7173
|
}));
|
|
7173
7174
|
}
|
|
7174
7175
|
}
|
|
@@ -7219,18 +7220,18 @@ class kl {
|
|
|
7219
7220
|
for (const d in e.attributes) {
|
|
7220
7221
|
const u = si[d] || d.toLowerCase();
|
|
7221
7222
|
if (o[d] !== void 0) {
|
|
7222
|
-
const h = n.accessors[e.attributes[d]],
|
|
7223
|
-
l[u] =
|
|
7223
|
+
const h = n.accessors[e.attributes[d]], f = Zt[h.componentType];
|
|
7224
|
+
l[u] = f.name, c[u] = h.normalized === !0;
|
|
7224
7225
|
}
|
|
7225
7226
|
}
|
|
7226
7227
|
return t.getDependency("bufferView", i).then(function(d) {
|
|
7227
7228
|
return new Promise(function(u, h) {
|
|
7228
|
-
s.decodeDracoFile(d, function(
|
|
7229
|
-
for (const g in
|
|
7230
|
-
const y =
|
|
7229
|
+
s.decodeDracoFile(d, function(f) {
|
|
7230
|
+
for (const g in f.attributes) {
|
|
7231
|
+
const y = f.attributes[g], x = c[g];
|
|
7231
7232
|
x !== void 0 && (y.normalized = x);
|
|
7232
7233
|
}
|
|
7233
|
-
u(
|
|
7234
|
+
u(f);
|
|
7234
7235
|
}, a, l, Ne, h);
|
|
7235
7236
|
});
|
|
7236
7237
|
});
|
|
@@ -7260,10 +7261,10 @@ class to extends oa {
|
|
|
7260
7261
|
return t;
|
|
7261
7262
|
}
|
|
7262
7263
|
interpolate_(e, t, n, s) {
|
|
7263
|
-
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = a * 2, l = a * 3, d = s - t, u = (n - t) / d, h = u * u,
|
|
7264
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = a * 2, l = a * 3, d = s - t, u = (n - t) / d, h = u * u, f = h * u, g = e * l, y = g - l, x = -2 * f + 3 * h, b = f - h, w = 1 - x, T = b - h + u;
|
|
7264
7265
|
for (let v = 0; v !== a; v++) {
|
|
7265
7266
|
const P = o[y + v + a], V = o[y + v + c] * d, F = o[g + v + a], L = o[g + v] * d;
|
|
7266
|
-
i[v] =
|
|
7267
|
+
i[v] = w * P + T * V + x * F + b * L;
|
|
7267
7268
|
}
|
|
7268
7269
|
return i;
|
|
7269
7270
|
}
|
|
@@ -7688,16 +7689,16 @@ class Gl {
|
|
|
7688
7689
|
}
|
|
7689
7690
|
const i = [];
|
|
7690
7691
|
return s.bufferView !== void 0 ? i.push(this.getDependency("bufferView", s.bufferView)) : i.push(null), s.sparse !== void 0 && (i.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(i).then(function(o) {
|
|
7691
|
-
const a = o[0], c = Ns[s.type], l = Zt[s.componentType], d = l.BYTES_PER_ELEMENT, u = d * c, h = s.byteOffset || 0,
|
|
7692
|
+
const a = o[0], c = Ns[s.type], l = Zt[s.componentType], d = l.BYTES_PER_ELEMENT, u = d * c, h = s.byteOffset || 0, f = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, g = s.normalized === !0;
|
|
7692
7693
|
let y, x;
|
|
7693
|
-
if (
|
|
7694
|
-
const b = Math.floor(h /
|
|
7695
|
-
let T = t.cache.get(
|
|
7696
|
-
T || (y = new l(a, b *
|
|
7694
|
+
if (f && f !== u) {
|
|
7695
|
+
const b = Math.floor(h / f), w = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + b + ":" + s.count;
|
|
7696
|
+
let T = t.cache.get(w);
|
|
7697
|
+
T || (y = new l(a, b * f, s.count * f / d), T = new jo(y, f / d), t.cache.add(w, T)), x = new xt(T, c, h % f / d, g);
|
|
7697
7698
|
} else
|
|
7698
7699
|
a === null ? y = new l(s.count * c) : y = new l(a, h, s.count * c), x = new rt(y, c, g);
|
|
7699
7700
|
if (s.sparse !== void 0) {
|
|
7700
|
-
const b = Ns.SCALAR,
|
|
7701
|
+
const b = Ns.SCALAR, w = Zt[s.sparse.indices.componentType], T = s.sparse.indices.byteOffset || 0, v = s.sparse.values.byteOffset || 0, P = new w(o[1], T, s.sparse.count * b), V = new l(o[2], v, s.sparse.count * c);
|
|
7701
7702
|
a !== null && (x = new rt(x.array.slice(), x.itemSize, x.normalized)), x.normalized = !1;
|
|
7702
7703
|
for (let F = 0, L = P.length; F < L; F++) {
|
|
7703
7704
|
const R = P[F];
|
|
@@ -7752,12 +7753,12 @@ class Gl {
|
|
|
7752
7753
|
else if (o.uri === void 0)
|
|
7753
7754
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
7754
7755
|
const d = Promise.resolve(c).then(function(u) {
|
|
7755
|
-
return new Promise(function(h,
|
|
7756
|
+
return new Promise(function(h, f) {
|
|
7756
7757
|
let g = h;
|
|
7757
7758
|
t.isImageBitmapLoader === !0 && (g = function(y) {
|
|
7758
7759
|
const x = new $i(y);
|
|
7759
7760
|
x.needsUpdate = !0, h(x);
|
|
7760
|
-
}), t.load(dn.resolveURL(u, i.path), g, void 0,
|
|
7761
|
+
}), t.load(dn.resolveURL(u, i.path), g, void 0, f);
|
|
7761
7762
|
});
|
|
7762
7763
|
}).then(function(u) {
|
|
7763
7764
|
return l === !0 && a.revokeObjectURL(c), st(u, o), u.userData.mimeType = o.mimeType || Hl(o.uri), u;
|
|
@@ -7919,35 +7920,35 @@ class Gl {
|
|
|
7919
7920
|
}
|
|
7920
7921
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(c) {
|
|
7921
7922
|
const l = c.slice(0, c.length - 1), d = c[c.length - 1], u = [];
|
|
7922
|
-
for (let
|
|
7923
|
-
const y = d[
|
|
7923
|
+
for (let f = 0, g = d.length; f < g; f++) {
|
|
7924
|
+
const y = d[f], x = o[f];
|
|
7924
7925
|
let b;
|
|
7925
|
-
const
|
|
7926
|
+
const w = l[f];
|
|
7926
7927
|
if (x.mode === Ie.TRIANGLES || x.mode === Ie.TRIANGLE_STRIP || x.mode === Ie.TRIANGLE_FAN || x.mode === void 0)
|
|
7927
|
-
b = i.isSkinnedMesh === !0 ? new Yo(y,
|
|
7928
|
+
b = i.isSkinnedMesh === !0 ? new Yo(y, w) : new ye(y, w), b.isSkinnedMesh === !0 && b.normalizeSkinWeights(), x.mode === Ie.TRIANGLE_STRIP ? b.geometry = ar(b.geometry, Pr) : x.mode === Ie.TRIANGLE_FAN && (b.geometry = ar(b.geometry, $s));
|
|
7928
7929
|
else if (x.mode === Ie.LINES)
|
|
7929
|
-
b = new jr(y,
|
|
7930
|
+
b = new jr(y, w);
|
|
7930
7931
|
else if (x.mode === Ie.LINE_STRIP)
|
|
7931
|
-
b = new Ko(y,
|
|
7932
|
+
b = new Ko(y, w);
|
|
7932
7933
|
else if (x.mode === Ie.LINE_LOOP)
|
|
7933
|
-
b = new qo(y,
|
|
7934
|
+
b = new qo(y, w);
|
|
7934
7935
|
else if (x.mode === Ie.POINTS)
|
|
7935
|
-
b = new Jo(y,
|
|
7936
|
+
b = new Jo(y, w);
|
|
7936
7937
|
else
|
|
7937
7938
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + x.mode);
|
|
7938
7939
|
Object.keys(b.geometry.morphAttributes).length > 0 && jl(b, i), b.name = t.createUniqueName(i.name || "mesh_" + e), st(b, i), x.extensions && yt(s, b, x), t.assignFinalMaterial(b), u.push(b);
|
|
7939
7940
|
}
|
|
7940
|
-
for (let
|
|
7941
|
-
t.associations.set(u[
|
|
7941
|
+
for (let f = 0, g = u.length; f < g; f++)
|
|
7942
|
+
t.associations.set(u[f], {
|
|
7942
7943
|
meshes: e,
|
|
7943
|
-
primitives:
|
|
7944
|
+
primitives: f
|
|
7944
7945
|
});
|
|
7945
7946
|
if (u.length === 1)
|
|
7946
7947
|
return i.extensions && yt(s, u[0], i), u[0];
|
|
7947
7948
|
const h = new Rs();
|
|
7948
7949
|
i.extensions && yt(s, h, i), t.associations.set(h, { meshes: e });
|
|
7949
|
-
for (let
|
|
7950
|
-
h.add(u[
|
|
7950
|
+
for (let f = 0, g = u.length; f < g; f++)
|
|
7951
|
+
h.add(u[f]);
|
|
7951
7952
|
return h;
|
|
7952
7953
|
});
|
|
7953
7954
|
}
|
|
@@ -8002,8 +8003,8 @@ class Gl {
|
|
|
8002
8003
|
loadAnimation(e) {
|
|
8003
8004
|
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, o = [], a = [], c = [], l = [], d = [];
|
|
8004
8005
|
for (let u = 0, h = s.channels.length; u < h; u++) {
|
|
8005
|
-
const
|
|
8006
|
-
y.node !== void 0 && (o.push(this.getDependency("node", x)), a.push(this.getDependency("accessor", b)), c.push(this.getDependency("accessor",
|
|
8006
|
+
const f = s.channels[u], g = s.samplers[f.sampler], y = f.target, x = y.node, b = s.parameters !== void 0 ? s.parameters[g.input] : g.input, w = s.parameters !== void 0 ? s.parameters[g.output] : g.output;
|
|
8007
|
+
y.node !== void 0 && (o.push(this.getDependency("node", x)), a.push(this.getDependency("accessor", b)), c.push(this.getDependency("accessor", w)), l.push(g), d.push(y));
|
|
8007
8008
|
}
|
|
8008
8009
|
return Promise.all([
|
|
8009
8010
|
Promise.all(o),
|
|
@@ -8012,9 +8013,9 @@ class Gl {
|
|
|
8012
8013
|
Promise.all(l),
|
|
8013
8014
|
Promise.all(d)
|
|
8014
8015
|
]).then(function(u) {
|
|
8015
|
-
const h = u[0],
|
|
8016
|
-
for (let
|
|
8017
|
-
const v = h[
|
|
8016
|
+
const h = u[0], f = u[1], g = u[2], y = u[3], x = u[4], b = [];
|
|
8017
|
+
for (let w = 0, T = h.length; w < T; w++) {
|
|
8018
|
+
const v = h[w], P = f[w], V = g[w], F = y[w], L = x[w];
|
|
8018
8019
|
if (v === void 0) continue;
|
|
8019
8020
|
v.updateMatrix && v.updateMatrix();
|
|
8020
8021
|
const R = n._createAnimationTracks(v, P, V, F, L);
|
|
@@ -8054,11 +8055,11 @@ class Gl {
|
|
|
8054
8055
|
c
|
|
8055
8056
|
]).then(function(l) {
|
|
8056
8057
|
const d = l[0], u = l[1], h = l[2];
|
|
8057
|
-
h !== null && d.traverse(function(
|
|
8058
|
-
|
|
8058
|
+
h !== null && d.traverse(function(f) {
|
|
8059
|
+
f.isSkinnedMesh && f.bind(h, Vl);
|
|
8059
8060
|
});
|
|
8060
|
-
for (let
|
|
8061
|
-
d.add(u[
|
|
8061
|
+
for (let f = 0, g = u.length; f < g; f++)
|
|
8062
|
+
d.add(u[f]);
|
|
8062
8063
|
return d;
|
|
8063
8064
|
});
|
|
8064
8065
|
}
|
|
@@ -8108,11 +8109,11 @@ class Gl {
|
|
|
8108
8109
|
i.add(c[d]);
|
|
8109
8110
|
const l = (d) => {
|
|
8110
8111
|
const u = /* @__PURE__ */ new Map();
|
|
8111
|
-
for (const [h,
|
|
8112
|
-
(h instanceof Ss || h instanceof $i) && u.set(h,
|
|
8112
|
+
for (const [h, f] of s.associations)
|
|
8113
|
+
(h instanceof Ss || h instanceof $i) && u.set(h, f);
|
|
8113
8114
|
return d.traverse((h) => {
|
|
8114
|
-
const
|
|
8115
|
-
|
|
8115
|
+
const f = s.associations.get(h);
|
|
8116
|
+
f != null && u.set(h, f);
|
|
8116
8117
|
}), u;
|
|
8117
8118
|
};
|
|
8118
8119
|
return s.associations = l(i), i;
|
|
@@ -8149,7 +8150,7 @@ class Gl {
|
|
|
8149
8150
|
break;
|
|
8150
8151
|
}
|
|
8151
8152
|
const d = s.interpolation !== void 0 ? zl[s.interpolation] : Br, u = this._getArrayFromAccessor(n);
|
|
8152
|
-
for (let h = 0,
|
|
8153
|
+
for (let h = 0, f = c.length; h < f; h++) {
|
|
8153
8154
|
const g = new l(
|
|
8154
8155
|
c[h] + "." + lt[i.path],
|
|
8155
8156
|
t.array,
|
|
@@ -8201,9 +8202,9 @@ function Zl(r, e, t) {
|
|
|
8201
8202
|
for (let l = 0, d = i.length; l < d; l++) {
|
|
8202
8203
|
const u = i[l];
|
|
8203
8204
|
if (u.POSITION !== void 0) {
|
|
8204
|
-
const h = t.json.accessors[u.POSITION],
|
|
8205
|
-
if (
|
|
8206
|
-
if (c.setX(Math.max(Math.abs(
|
|
8205
|
+
const h = t.json.accessors[u.POSITION], f = h.min, g = h.max;
|
|
8206
|
+
if (f !== void 0 && g !== void 0) {
|
|
8207
|
+
if (c.setX(Math.max(Math.abs(f[0]), Math.abs(g[0]))), c.setY(Math.max(Math.abs(f[1]), Math.abs(g[1]))), c.setZ(Math.max(Math.abs(f[2]), Math.abs(g[2]))), h.normalized) {
|
|
8207
8208
|
const y = ii(Zt[h.componentType]);
|
|
8208
8209
|
c.multiplyScalar(y);
|
|
8209
8210
|
}
|
|
@@ -8441,10 +8442,10 @@ function Xl() {
|
|
|
8441
8442
|
e.then((d) => {
|
|
8442
8443
|
const u = d.draco, h = new u.Decoder();
|
|
8443
8444
|
try {
|
|
8444
|
-
const
|
|
8445
|
-
|
|
8446
|
-
} catch (
|
|
8447
|
-
console.error(
|
|
8445
|
+
const f = t(u, h, new Int8Array(c), l), g = f.attributes.map((y) => y.array.buffer);
|
|
8446
|
+
f.index && g.push(f.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: f }, g);
|
|
8447
|
+
} catch (f) {
|
|
8448
|
+
console.error(f), self.postMessage({ type: "error", id: a.id, error: f.message });
|
|
8448
8449
|
} finally {
|
|
8449
8450
|
u.destroy(h);
|
|
8450
8451
|
}
|
|
@@ -8454,27 +8455,27 @@ function Xl() {
|
|
|
8454
8455
|
};
|
|
8455
8456
|
function t(o, a, c, l) {
|
|
8456
8457
|
const d = l.attributeIDs, u = l.attributeTypes;
|
|
8457
|
-
let h,
|
|
8458
|
+
let h, f;
|
|
8458
8459
|
const g = a.GetEncodedGeometryType(c);
|
|
8459
8460
|
if (g === o.TRIANGULAR_MESH)
|
|
8460
|
-
h = new o.Mesh(),
|
|
8461
|
+
h = new o.Mesh(), f = a.DecodeArrayToMesh(c, c.byteLength, h);
|
|
8461
8462
|
else if (g === o.POINT_CLOUD)
|
|
8462
|
-
h = new o.PointCloud(),
|
|
8463
|
+
h = new o.PointCloud(), f = a.DecodeArrayToPointCloud(c, c.byteLength, h);
|
|
8463
8464
|
else
|
|
8464
8465
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
8465
|
-
if (!
|
|
8466
|
-
throw new Error("THREE.DRACOLoader: Decoding failed: " +
|
|
8466
|
+
if (!f.ok() || h.ptr === 0)
|
|
8467
|
+
throw new Error("THREE.DRACOLoader: Decoding failed: " + f.error_msg());
|
|
8467
8468
|
const y = { index: null, attributes: [] };
|
|
8468
8469
|
for (const x in d) {
|
|
8469
8470
|
const b = self[u[x]];
|
|
8470
|
-
let
|
|
8471
|
+
let w, T;
|
|
8471
8472
|
if (l.useUniqueIDs)
|
|
8472
|
-
T = d[x],
|
|
8473
|
+
T = d[x], w = a.GetAttributeByUniqueId(h, T);
|
|
8473
8474
|
else {
|
|
8474
8475
|
if (T = a.GetAttributeId(h, o[d[x]]), T === -1) continue;
|
|
8475
|
-
|
|
8476
|
+
w = a.GetAttribute(h, T);
|
|
8476
8477
|
}
|
|
8477
|
-
const v = s(o, a, h, x, b,
|
|
8478
|
+
const v = s(o, a, h, x, b, w);
|
|
8478
8479
|
x === "color" && (v.vertexColorSpace = l.vertexColorSpace), y.attributes.push(v);
|
|
8479
8480
|
}
|
|
8480
8481
|
return g === o.TRIANGULAR_MESH && (y.index = n(o, a, h)), o.destroy(h), y;
|
|
@@ -8482,16 +8483,16 @@ function Xl() {
|
|
|
8482
8483
|
function n(o, a, c) {
|
|
8483
8484
|
const d = c.num_faces() * 3, u = d * 4, h = o._malloc(u);
|
|
8484
8485
|
a.GetTrianglesUInt32Array(c, u, h);
|
|
8485
|
-
const
|
|
8486
|
-
return o._free(h), { array:
|
|
8486
|
+
const f = new Uint32Array(o.HEAPF32.buffer, h, d).slice();
|
|
8487
|
+
return o._free(h), { array: f, itemSize: 1 };
|
|
8487
8488
|
}
|
|
8488
8489
|
function s(o, a, c, l, d, u) {
|
|
8489
8490
|
const h = u.num_components(), g = c.num_points() * h, y = g * d.BYTES_PER_ELEMENT, x = i(o, d), b = o._malloc(y);
|
|
8490
8491
|
a.GetAttributeDataArrayForAllPoints(c, u, x, y, b);
|
|
8491
|
-
const
|
|
8492
|
+
const w = new d(o.HEAPF32.buffer, b, g).slice();
|
|
8492
8493
|
return o._free(b), {
|
|
8493
8494
|
name: l,
|
|
8494
|
-
array:
|
|
8495
|
+
array: w,
|
|
8495
8496
|
itemSize: h
|
|
8496
8497
|
};
|
|
8497
8498
|
}
|
|
@@ -8913,8 +8914,8 @@ function ro() {
|
|
|
8913
8914
|
NamedNodeMap: d = r.NamedNodeMap || r.MozNamedAttrMap,
|
|
8914
8915
|
HTMLFormElement: u,
|
|
8915
8916
|
DOMParser: h,
|
|
8916
|
-
trustedTypes:
|
|
8917
|
-
} = r, g = c.prototype, y = nn(g, "cloneNode"), x = nn(g, "remove"), b = nn(g, "nextSibling"),
|
|
8917
|
+
trustedTypes: f
|
|
8918
|
+
} = r, g = c.prototype, y = nn(g, "cloneNode"), x = nn(g, "remove"), b = nn(g, "nextSibling"), w = nn(g, "childNodes"), T = nn(g, "parentNode");
|
|
8918
8919
|
if (typeof o == "function") {
|
|
8919
8920
|
const U = t.createElement("template");
|
|
8920
8921
|
U.content && U.content.ownerDocument && (t = U.content.ownerDocument);
|
|
@@ -8995,43 +8996,43 @@ function ro() {
|
|
|
8995
8996
|
let qt = null;
|
|
8996
8997
|
const mo = ["application/xhtml+xml", "text/html"], _o = "text/html";
|
|
8997
8998
|
let de = null, Dt = null;
|
|
8998
|
-
const go = t.createElement("form"), Di = function(
|
|
8999
|
-
return
|
|
8999
|
+
const go = t.createElement("form"), Di = function(p) {
|
|
9000
|
+
return p instanceof RegExp || p instanceof Function;
|
|
9000
9001
|
}, ws = function() {
|
|
9001
|
-
let
|
|
9002
|
-
if (!(Dt && Dt ===
|
|
9003
|
-
if ((!
|
|
9004
|
-
mo.indexOf(
|
|
9005
|
-
if (typeof
|
|
9002
|
+
let p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
9003
|
+
if (!(Dt && Dt === p)) {
|
|
9004
|
+
if ((!p || typeof p != "object") && (p = {}), p = nt(p), qt = // eslint-disable-next-line unicorn/prefer-includes
|
|
9005
|
+
mo.indexOf(p.PARSER_MEDIA_TYPE) === -1 ? _o : p.PARSER_MEDIA_TYPE, de = qt === "application/xhtml+xml" ? Fs : Qn, ne = Ue(p, "ALLOWED_TAGS") ? Y({}, p.ALLOWED_TAGS, de) : ue, Q = Ue(p, "ALLOWED_ATTR") ? Y({}, p.ALLOWED_ATTR, de) : ct, bs = Ue(p, "ALLOWED_NAMESPACES") ? Y({}, p.ALLOWED_NAMESPACES, Fs) : fo, vs = Ue(p, "ADD_URI_SAFE_ATTR") ? Y(nt(ki), p.ADD_URI_SAFE_ATTR, de) : ki, Ci = Ue(p, "ADD_DATA_URI_TAGS") ? Y(nt(Oi), p.ADD_DATA_URI_TAGS, de) : Oi, Ot = Ue(p, "FORBID_CONTENTS") ? Y({}, p.FORBID_CONTENTS, de) : Li, Re = Ue(p, "FORBID_TAGS") ? Y({}, p.FORBID_TAGS, de) : nt({}), Rt = Ue(p, "FORBID_ATTR") ? Y({}, p.FORBID_ATTR, de) : nt({}), Ct = Ue(p, "USE_PROFILES") ? p.USE_PROFILES : !1, ps = p.ALLOW_ARIA_ATTR !== !1, ms = p.ALLOW_DATA_ATTR !== !1, Ti = p.ALLOW_UNKNOWN_PROTOCOLS || !1, Si = p.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Mt = p.SAFE_FOR_TEMPLATES || !1, kn = p.SAFE_FOR_XML !== !1, _t = p.WHOLE_DOCUMENT || !1, Lt = p.RETURN_DOM || !1, Dn = p.RETURN_DOM_FRAGMENT || !1, In = p.RETURN_TRUSTED_TYPE || !1, gs = p.FORCE_BODY || !1, Ri = p.SANITIZE_DOM !== !1, Mi = p.SANITIZE_NAMED_PROPS || !1, ys = p.KEEP_CONTENT !== !1, Kt = p.IN_PLACE || !1, Se = p.ALLOWED_URI_REGEXP || so, kt = p.NAMESPACE || Je, zn = p.MATHML_TEXT_INTEGRATION_POINTS || zn, Un = p.HTML_INTEGRATION_POINTS || Un, z = p.CUSTOM_ELEMENT_HANDLING || {}, p.CUSTOM_ELEMENT_HANDLING && Di(p.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (z.tagNameCheck = p.CUSTOM_ELEMENT_HANDLING.tagNameCheck), p.CUSTOM_ELEMENT_HANDLING && Di(p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (z.attributeNameCheck = p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), p.CUSTOM_ELEMENT_HANDLING && typeof p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (z.allowCustomizedBuiltInElements = p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Mt && (ms = !1), Dn && (Lt = !0), Ct && (ne = Y({}, wr), Q = [], Ct.html === !0 && (Y(ne, br), Y(Q, Er)), Ct.svg === !0 && (Y(ne, Bs), Y(Q, Gs), Y(Q, Wn)), Ct.svgFilters === !0 && (Y(ne, Hs), Y(Q, Gs), Y(Q, Wn)), Ct.mathMl === !0 && (Y(ne, Vs), Y(Q, Ar), Y(Q, Wn))), p.ADD_TAGS && (typeof p.ADD_TAGS == "function" ? qe.tagCheck = p.ADD_TAGS : (ne === ue && (ne = nt(ne)), Y(ne, p.ADD_TAGS, de))), p.ADD_ATTR && (typeof p.ADD_ATTR == "function" ? qe.attributeCheck = p.ADD_ATTR : (Q === ct && (Q = nt(Q)), Y(Q, p.ADD_ATTR, de))), p.ADD_URI_SAFE_ATTR && Y(vs, p.ADD_URI_SAFE_ATTR, de), p.FORBID_CONTENTS && (Ot === Li && (Ot = nt(Ot)), Y(Ot, p.FORBID_CONTENTS, de)), ys && (ne["#text"] = !0), _t && Y(ne, ["html", "head", "body"]), ne.table && (Y(ne, ["tbody"]), delete Re.tbody), p.TRUSTED_TYPES_POLICY) {
|
|
9006
|
+
if (typeof p.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
9006
9007
|
throw tn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
9007
|
-
if (typeof
|
|
9008
|
+
if (typeof p.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
9008
9009
|
throw tn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
9009
|
-
v =
|
|
9010
|
+
v = p.TRUSTED_TYPES_POLICY, P = v.createHTML("");
|
|
9010
9011
|
} else
|
|
9011
|
-
v === void 0 && (v = vd(
|
|
9012
|
-
Ae && Ae(
|
|
9012
|
+
v === void 0 && (v = vd(f, s)), v !== null && typeof P == "string" && (P = v.createHTML(""));
|
|
9013
|
+
Ae && Ae(p), Dt = p;
|
|
9013
9014
|
}
|
|
9014
|
-
}, Ii = Y({}, [...Bs, ...Hs, ...cd]), Ni = Y({}, [...Vs, ...ld]), yo = function(
|
|
9015
|
-
let S = T(
|
|
9015
|
+
}, Ii = Y({}, [...Bs, ...Hs, ...cd]), Ni = Y({}, [...Vs, ...ld]), yo = function(p) {
|
|
9016
|
+
let S = T(p);
|
|
9016
9017
|
(!S || !S.tagName) && (S = {
|
|
9017
9018
|
namespaceURI: kt,
|
|
9018
9019
|
tagName: "template"
|
|
9019
9020
|
});
|
|
9020
|
-
const D = Qn(
|
|
9021
|
-
return bs[
|
|
9022
|
-
}, He = function(
|
|
9021
|
+
const D = Qn(p.tagName), se = Qn(S.tagName);
|
|
9022
|
+
return bs[p.namespaceURI] ? p.namespaceURI === Pn ? S.namespaceURI === Je ? D === "svg" : S.namespaceURI === Nn ? D === "svg" && (se === "annotation-xml" || zn[se]) : !!Ii[D] : p.namespaceURI === Nn ? S.namespaceURI === Je ? D === "math" : S.namespaceURI === Pn ? D === "math" && Un[se] : !!Ni[D] : p.namespaceURI === Je ? S.namespaceURI === Pn && !Un[se] || S.namespaceURI === Nn && !zn[se] ? !1 : !Ni[D] && (po[D] || !Ii[D]) : !!(qt === "application/xhtml+xml" && bs[p.namespaceURI]) : !1;
|
|
9023
|
+
}, He = function(p) {
|
|
9023
9024
|
Qt(e.removed, {
|
|
9024
|
-
element:
|
|
9025
|
+
element: p
|
|
9025
9026
|
});
|
|
9026
9027
|
try {
|
|
9027
|
-
T(
|
|
9028
|
+
T(p).removeChild(p);
|
|
9028
9029
|
} catch {
|
|
9029
|
-
x(
|
|
9030
|
+
x(p);
|
|
9030
9031
|
}
|
|
9031
|
-
}, gt = function(
|
|
9032
|
+
}, gt = function(p, S) {
|
|
9032
9033
|
try {
|
|
9033
9034
|
Qt(e.removed, {
|
|
9034
|
-
attribute: S.getAttributeNode(
|
|
9035
|
+
attribute: S.getAttributeNode(p),
|
|
9035
9036
|
from: S
|
|
9036
9037
|
});
|
|
9037
9038
|
} catch {
|
|
@@ -9040,7 +9041,7 @@ function ro() {
|
|
|
9040
9041
|
from: S
|
|
9041
9042
|
});
|
|
9042
9043
|
}
|
|
9043
|
-
if (S.removeAttribute(
|
|
9044
|
+
if (S.removeAttribute(p), p === "is")
|
|
9044
9045
|
if (Lt || Dn)
|
|
9045
9046
|
try {
|
|
9046
9047
|
He(S);
|
|
@@ -9048,19 +9049,19 @@ function ro() {
|
|
|
9048
9049
|
}
|
|
9049
9050
|
else
|
|
9050
9051
|
try {
|
|
9051
|
-
S.setAttribute(
|
|
9052
|
+
S.setAttribute(p, "");
|
|
9052
9053
|
} catch {
|
|
9053
9054
|
}
|
|
9054
|
-
}, Pi = function(
|
|
9055
|
+
}, Pi = function(p) {
|
|
9055
9056
|
let S = null, D = null;
|
|
9056
9057
|
if (gs)
|
|
9057
|
-
|
|
9058
|
+
p = "<remove></remove>" + p;
|
|
9058
9059
|
else {
|
|
9059
|
-
const oe = js(
|
|
9060
|
+
const oe = js(p, /^[\r\n\t ]+/);
|
|
9060
9061
|
D = oe && oe[0];
|
|
9061
9062
|
}
|
|
9062
|
-
qt === "application/xhtml+xml" && kt === Je && (
|
|
9063
|
-
const se = v ? v.createHTML(
|
|
9063
|
+
qt === "application/xhtml+xml" && kt === Je && (p = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + p + "</body></html>");
|
|
9064
|
+
const se = v ? v.createHTML(p) : p;
|
|
9064
9065
|
if (kt === Je)
|
|
9065
9066
|
try {
|
|
9066
9067
|
S = new h().parseFromString(se, qt);
|
|
@@ -9074,73 +9075,73 @@ function ro() {
|
|
|
9074
9075
|
}
|
|
9075
9076
|
}
|
|
9076
9077
|
const ge = S.body || S.documentElement;
|
|
9077
|
-
return
|
|
9078
|
-
}, zi = function(
|
|
9078
|
+
return p && D && ge.insertBefore(t.createTextNode(D), ge.childNodes[0] || null), kt === Je ? R.call(S, _t ? "html" : "body")[0] : _t ? S.documentElement : ge;
|
|
9079
|
+
}, zi = function(p) {
|
|
9079
9080
|
return F.call(
|
|
9080
|
-
|
|
9081
|
-
|
|
9081
|
+
p.ownerDocument || p,
|
|
9082
|
+
p,
|
|
9082
9083
|
// eslint-disable-next-line no-bitwise
|
|
9083
9084
|
l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION,
|
|
9084
9085
|
null
|
|
9085
9086
|
);
|
|
9086
|
-
}, Es = function(
|
|
9087
|
-
return
|
|
9088
|
-
}, Ui = function(
|
|
9089
|
-
return typeof a == "function" &&
|
|
9087
|
+
}, Es = function(p) {
|
|
9088
|
+
return p instanceof u && (typeof p.nodeName != "string" || typeof p.textContent != "string" || typeof p.removeChild != "function" || !(p.attributes instanceof d) || typeof p.removeAttribute != "function" || typeof p.setAttribute != "function" || typeof p.namespaceURI != "string" || typeof p.insertBefore != "function" || typeof p.hasChildNodes != "function");
|
|
9089
|
+
}, Ui = function(p) {
|
|
9090
|
+
return typeof a == "function" && p instanceof a;
|
|
9090
9091
|
};
|
|
9091
|
-
function Qe(U,
|
|
9092
|
+
function Qe(U, p, S) {
|
|
9092
9093
|
Zn(U, (D) => {
|
|
9093
|
-
D.call(e,
|
|
9094
|
+
D.call(e, p, S, Dt);
|
|
9094
9095
|
});
|
|
9095
9096
|
}
|
|
9096
|
-
const Fi = function(
|
|
9097
|
+
const Fi = function(p) {
|
|
9097
9098
|
let S = null;
|
|
9098
|
-
if (Qe(N.beforeSanitizeElements,
|
|
9099
|
-
return He(
|
|
9100
|
-
const D = de(
|
|
9101
|
-
if (Qe(N.uponSanitizeElement,
|
|
9099
|
+
if (Qe(N.beforeSanitizeElements, p, null), Es(p))
|
|
9100
|
+
return He(p), !0;
|
|
9101
|
+
const D = de(p.nodeName);
|
|
9102
|
+
if (Qe(N.uponSanitizeElement, p, {
|
|
9102
9103
|
tagName: D,
|
|
9103
9104
|
allowedTags: ne
|
|
9104
|
-
}), kn &&
|
|
9105
|
-
return He(
|
|
9105
|
+
}), kn && p.hasChildNodes() && !Ui(p.firstElementChild) && we(/<[/\w!]/g, p.innerHTML) && we(/<[/\w!]/g, p.textContent) || p.nodeType === sn.progressingInstruction || kn && p.nodeType === sn.comment && we(/<[/\w]/g, p.data))
|
|
9106
|
+
return He(p), !0;
|
|
9106
9107
|
if (!(qe.tagCheck instanceof Function && qe.tagCheck(D)) && (!ne[D] || Re[D])) {
|
|
9107
9108
|
if (!Re[D] && Bi(D) && (z.tagNameCheck instanceof RegExp && we(z.tagNameCheck, D) || z.tagNameCheck instanceof Function && z.tagNameCheck(D)))
|
|
9108
9109
|
return !1;
|
|
9109
9110
|
if (ys && !Ot[D]) {
|
|
9110
|
-
const se = T(
|
|
9111
|
+
const se = T(p) || p.parentNode, ge = w(p) || p.childNodes;
|
|
9111
9112
|
if (ge && se) {
|
|
9112
9113
|
const oe = ge.length;
|
|
9113
9114
|
for (let Me = oe - 1; Me >= 0; --Me) {
|
|
9114
9115
|
const et = y(ge[Me], !0);
|
|
9115
|
-
et.__removalCount = (
|
|
9116
|
+
et.__removalCount = (p.__removalCount || 0) + 1, se.insertBefore(et, b(p));
|
|
9116
9117
|
}
|
|
9117
9118
|
}
|
|
9118
9119
|
}
|
|
9119
|
-
return He(
|
|
9120
|
+
return He(p), !0;
|
|
9120
9121
|
}
|
|
9121
|
-
return
|
|
9122
|
+
return p instanceof c && !yo(p) || (D === "noscript" || D === "noembed" || D === "noframes") && we(/<\/no(script|embed|frames)/i, p.innerHTML) ? (He(p), !0) : (Mt && p.nodeType === sn.text && (S = p.textContent, Zn([G, Z, k], (se) => {
|
|
9122
9123
|
S = en(S, se, " ");
|
|
9123
|
-
}),
|
|
9124
|
-
element:
|
|
9125
|
-
}),
|
|
9126
|
-
}, ji = function(
|
|
9124
|
+
}), p.textContent !== S && (Qt(e.removed, {
|
|
9125
|
+
element: p.cloneNode()
|
|
9126
|
+
}), p.textContent = S)), Qe(N.afterSanitizeElements, p, null), !1);
|
|
9127
|
+
}, ji = function(p, S, D) {
|
|
9127
9128
|
if (Ri && (S === "id" || S === "name") && (D in t || D in go))
|
|
9128
9129
|
return !1;
|
|
9129
9130
|
if (!(ms && !Rt[S] && we(ee, S))) {
|
|
9130
9131
|
if (!(ps && we($, S))) {
|
|
9131
|
-
if (!(qe.attributeCheck instanceof Function && qe.attributeCheck(S,
|
|
9132
|
+
if (!(qe.attributeCheck instanceof Function && qe.attributeCheck(S, p))) {
|
|
9132
9133
|
if (!Q[S] || Rt[S]) {
|
|
9133
9134
|
if (
|
|
9134
9135
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
9135
9136
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
9136
9137
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
9137
|
-
!(Bi(
|
|
9138
|
+
!(Bi(p) && (z.tagNameCheck instanceof RegExp && we(z.tagNameCheck, p) || z.tagNameCheck instanceof Function && z.tagNameCheck(p)) && (z.attributeNameCheck instanceof RegExp && we(z.attributeNameCheck, S) || z.attributeNameCheck instanceof Function && z.attributeNameCheck(S, p)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
9138
9139
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
9139
9140
|
S === "is" && z.allowCustomizedBuiltInElements && (z.tagNameCheck instanceof RegExp && we(z.tagNameCheck, D) || z.tagNameCheck instanceof Function && z.tagNameCheck(D)))
|
|
9140
9141
|
) return !1;
|
|
9141
9142
|
} else if (!vs[S]) {
|
|
9142
9143
|
if (!we(Se, en(D, le, ""))) {
|
|
9143
|
-
if (!((S === "src" || S === "xlink:href" || S === "href") &&
|
|
9144
|
+
if (!((S === "src" || S === "xlink:href" || S === "href") && p !== "script" && id(D, "data:") === 0 && Ci[p])) {
|
|
9144
9145
|
if (!(Ti && !we(be, en(D, le, "")))) {
|
|
9145
9146
|
if (D)
|
|
9146
9147
|
return !1;
|
|
@@ -9152,14 +9153,14 @@ function ro() {
|
|
|
9152
9153
|
}
|
|
9153
9154
|
}
|
|
9154
9155
|
return !0;
|
|
9155
|
-
}, Bi = function(
|
|
9156
|
-
return
|
|
9157
|
-
}, Hi = function(
|
|
9158
|
-
Qe(N.beforeSanitizeAttributes,
|
|
9156
|
+
}, Bi = function(p) {
|
|
9157
|
+
return p !== "annotation-xml" && js(p, ze);
|
|
9158
|
+
}, Hi = function(p) {
|
|
9159
|
+
Qe(N.beforeSanitizeAttributes, p, null);
|
|
9159
9160
|
const {
|
|
9160
9161
|
attributes: S
|
|
9161
|
-
} =
|
|
9162
|
-
if (!S || Es(
|
|
9162
|
+
} = p;
|
|
9163
|
+
if (!S || Es(p))
|
|
9163
9164
|
return;
|
|
9164
9165
|
const D = {
|
|
9165
9166
|
attrName: "",
|
|
@@ -9176,34 +9177,34 @@ function ro() {
|
|
|
9176
9177
|
value: et
|
|
9177
9178
|
} = ge, It = de(oe), As = et;
|
|
9178
9179
|
let he = oe === "value" ? As : rd(As);
|
|
9179
|
-
if (D.attrName = It, D.attrValue = he, D.keepAttr = !0, D.forceKeepAttr = void 0, Qe(N.uponSanitizeAttribute,
|
|
9180
|
-
gt(oe,
|
|
9180
|
+
if (D.attrName = It, D.attrValue = he, D.keepAttr = !0, D.forceKeepAttr = void 0, Qe(N.uponSanitizeAttribute, p, D), he = D.attrValue, Mi && (It === "id" || It === "name") && (gt(oe, p), he = ho + he), kn && we(/((--!?|])>)|<\/(style|title|textarea)/i, he)) {
|
|
9181
|
+
gt(oe, p);
|
|
9181
9182
|
continue;
|
|
9182
9183
|
}
|
|
9183
9184
|
if (It === "attributename" && js(he, "href")) {
|
|
9184
|
-
gt(oe,
|
|
9185
|
+
gt(oe, p);
|
|
9185
9186
|
continue;
|
|
9186
9187
|
}
|
|
9187
9188
|
if (D.forceKeepAttr)
|
|
9188
9189
|
continue;
|
|
9189
9190
|
if (!D.keepAttr) {
|
|
9190
|
-
gt(oe,
|
|
9191
|
+
gt(oe, p);
|
|
9191
9192
|
continue;
|
|
9192
9193
|
}
|
|
9193
9194
|
if (!Si && we(/\/>/i, he)) {
|
|
9194
|
-
gt(oe,
|
|
9195
|
+
gt(oe, p);
|
|
9195
9196
|
continue;
|
|
9196
9197
|
}
|
|
9197
9198
|
Mt && Zn([G, Z, k], (Gi) => {
|
|
9198
9199
|
he = en(he, Gi, " ");
|
|
9199
9200
|
});
|
|
9200
|
-
const Vi = de(
|
|
9201
|
+
const Vi = de(p.nodeName);
|
|
9201
9202
|
if (!ji(Vi, It, he)) {
|
|
9202
|
-
gt(oe,
|
|
9203
|
+
gt(oe, p);
|
|
9203
9204
|
continue;
|
|
9204
9205
|
}
|
|
9205
|
-
if (v && typeof
|
|
9206
|
-
switch (
|
|
9206
|
+
if (v && typeof f == "object" && typeof f.getAttributeType == "function" && !Me)
|
|
9207
|
+
switch (f.getAttributeType(Vi, It)) {
|
|
9207
9208
|
case "TrustedHTML": {
|
|
9208
9209
|
he = v.createHTML(he);
|
|
9209
9210
|
break;
|
|
@@ -9215,21 +9216,21 @@ function ro() {
|
|
|
9215
9216
|
}
|
|
9216
9217
|
if (he !== As)
|
|
9217
9218
|
try {
|
|
9218
|
-
Me ?
|
|
9219
|
+
Me ? p.setAttributeNS(Me, oe, he) : p.setAttribute(oe, he), Es(p) ? He(p) : xr(e.removed);
|
|
9219
9220
|
} catch {
|
|
9220
|
-
gt(oe,
|
|
9221
|
+
gt(oe, p);
|
|
9221
9222
|
}
|
|
9222
9223
|
}
|
|
9223
|
-
Qe(N.afterSanitizeAttributes,
|
|
9224
|
-
}, vo = function U(
|
|
9224
|
+
Qe(N.afterSanitizeAttributes, p, null);
|
|
9225
|
+
}, vo = function U(p) {
|
|
9225
9226
|
let S = null;
|
|
9226
|
-
const D = zi(
|
|
9227
|
-
for (Qe(N.beforeSanitizeShadowDOM,
|
|
9227
|
+
const D = zi(p);
|
|
9228
|
+
for (Qe(N.beforeSanitizeShadowDOM, p, null); S = D.nextNode(); )
|
|
9228
9229
|
Qe(N.uponSanitizeShadowNode, S, null), Fi(S), Hi(S), S.content instanceof i && U(S.content);
|
|
9229
|
-
Qe(N.afterSanitizeShadowDOM,
|
|
9230
|
+
Qe(N.afterSanitizeShadowDOM, p, null);
|
|
9230
9231
|
};
|
|
9231
9232
|
return e.sanitize = function(U) {
|
|
9232
|
-
let
|
|
9233
|
+
let p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, S = null, D = null, se = null, ge = null;
|
|
9233
9234
|
if (xs = !U, xs && (U = "<!-->"), typeof U != "string" && !Ui(U))
|
|
9234
9235
|
if (typeof U.toString == "function") {
|
|
9235
9236
|
if (U = U.toString(), typeof U != "string")
|
|
@@ -9238,7 +9239,7 @@ function ro() {
|
|
|
9238
9239
|
throw tn("toString is not a function");
|
|
9239
9240
|
if (!e.isSupported)
|
|
9240
9241
|
return U;
|
|
9241
|
-
if (_s || ws(
|
|
9242
|
+
if (_s || ws(p), e.removed = [], typeof U == "string" && (Kt = !1), Kt) {
|
|
9242
9243
|
if (U.nodeName) {
|
|
9243
9244
|
const et = de(U.nodeName);
|
|
9244
9245
|
if (!ne[et] || Re[et])
|
|
@@ -9277,15 +9278,15 @@ function ro() {
|
|
|
9277
9278
|
ws(U), _s = !0;
|
|
9278
9279
|
}, e.clearConfig = function() {
|
|
9279
9280
|
Dt = null, _s = !1;
|
|
9280
|
-
}, e.isValidAttribute = function(U,
|
|
9281
|
+
}, e.isValidAttribute = function(U, p, S) {
|
|
9281
9282
|
Dt || ws({});
|
|
9282
|
-
const D = de(U), se = de(
|
|
9283
|
+
const D = de(U), se = de(p);
|
|
9283
9284
|
return ji(D, se, S);
|
|
9284
|
-
}, e.addHook = function(U,
|
|
9285
|
-
typeof
|
|
9286
|
-
}, e.removeHook = function(U,
|
|
9287
|
-
if (
|
|
9288
|
-
const S = nd(N[U],
|
|
9285
|
+
}, e.addHook = function(U, p) {
|
|
9286
|
+
typeof p == "function" && Qt(N[U], p);
|
|
9287
|
+
}, e.removeHook = function(U, p) {
|
|
9288
|
+
if (p !== void 0) {
|
|
9289
|
+
const S = nd(N[U], p);
|
|
9289
9290
|
return S === -1 ? void 0 : sd(N[U], S, 1)[0];
|
|
9290
9291
|
}
|
|
9291
9292
|
return xr(N[U]);
|
|
@@ -9648,10 +9649,10 @@ class Sd extends EventTarget {
|
|
|
9648
9649
|
if (!this.edit_mode) return;
|
|
9649
9650
|
const d = n.getBoundingClientRect();
|
|
9650
9651
|
i.x = (l.clientX - d.left) / d.width * 2 - 1, i.y = -((l.clientY - d.top) / d.height) * 2 + 1, s.setFromCamera(i, t);
|
|
9651
|
-
const u = this.plane_handles.map((
|
|
9652
|
-
if (h.length > 0 && (this.active_handle = this.plane_handles.find((
|
|
9653
|
-
const
|
|
9654
|
-
this.drag_start_value = this.bounds[g][
|
|
9652
|
+
const u = this.plane_handles.map((f) => f.mesh), h = s.intersectObjects(u);
|
|
9653
|
+
if (h.length > 0 && (this.active_handle = this.plane_handles.find((f) => f.mesh === h[0].object), this.active_handle)) {
|
|
9654
|
+
const f = this.active_handle.axis, g = this.active_handle.side;
|
|
9655
|
+
this.drag_start_value = this.bounds[g][f], this.drag_start_mouse.copy(i), n.style.cursor = "grabbing", this.orbit_controls && (this.orbit_controls.enabled = !1);
|
|
9655
9656
|
}
|
|
9656
9657
|
}, a = (l) => {
|
|
9657
9658
|
if (!this.edit_mode) return;
|
|
@@ -9659,14 +9660,14 @@ class Sd extends EventTarget {
|
|
|
9659
9660
|
if (i.x = (l.clientX - d.left) / d.width * 2 - 1, i.y = -((l.clientY - d.top) / d.height) * 2 + 1, this.active_handle) {
|
|
9660
9661
|
const u = new m.Vector2();
|
|
9661
9662
|
u.subVectors(i, this.drag_start_mouse);
|
|
9662
|
-
const h = this.active_handle.axis,
|
|
9663
|
-
this.bounds[
|
|
9663
|
+
const h = this.active_handle.axis, f = this.active_handle.side, g = 10, y = h === "x" ? u.x * g : h === "y" ? u.y * g : -u.y * g, x = this.drag_start_value + y;
|
|
9664
|
+
this.bounds[f][h] = x, f === "min" && this.bounds.min[h] > this.bounds.max[h] ? this.bounds.min[h] = this.bounds.max[h] - 0.1 : f === "max" && this.bounds.max[h] < this.bounds.min[h] && (this.bounds.max[h] = this.bounds.min[h] + 0.1), this.update_helpers(), this.emit_bounds_changed();
|
|
9664
9665
|
} else {
|
|
9665
9666
|
s.setFromCamera(i, t);
|
|
9666
|
-
const u = this.plane_handles.map((
|
|
9667
|
-
this.plane_handles.forEach((
|
|
9668
|
-
const g = h.length > 0 &&
|
|
9669
|
-
|
|
9667
|
+
const u = this.plane_handles.map((f) => f.mesh), h = s.intersectObjects(u);
|
|
9668
|
+
this.plane_handles.forEach((f) => {
|
|
9669
|
+
const g = h.length > 0 && f.mesh === h[0].object;
|
|
9670
|
+
f.set_hover(g);
|
|
9670
9671
|
}), n.style.cursor = h.length > 0 ? "grab" : "default";
|
|
9671
9672
|
}
|
|
9672
9673
|
}, c = () => {
|
|
@@ -9829,11 +9830,11 @@ class Ld extends jr {
|
|
|
9829
9830
|
e.attributes.position
|
|
9830
9831
|
), s = this.extract_edges_from_index(t, n), i = [], o = [], a = [], c = [];
|
|
9831
9832
|
for (const { a: l, b: d, n0: u, n1: h } of s) {
|
|
9832
|
-
const
|
|
9833
|
+
const f = (g) => {
|
|
9833
9834
|
const y = g * 3;
|
|
9834
9835
|
o.push(u.x, u.y, u.z), a.push(h.x, h.y, h.z), i.push(n[y], n[y + 1], n[y + 2]);
|
|
9835
9836
|
};
|
|
9836
|
-
|
|
9837
|
+
f(l), f(d), c.push(n[d * 3], n[d * 3 + 1], n[d * 3 + 2], 0), c.push(n[l * 3], n[l * 3 + 1], n[l * 3 + 2], 1);
|
|
9837
9838
|
}
|
|
9838
9839
|
return { v_array: i, n0_array: o, n1_array: a, other_vert_array: c };
|
|
9839
9840
|
}
|
|
@@ -9861,23 +9862,23 @@ class Ld extends jr {
|
|
|
9861
9862
|
extract_edges_from_index(e, t) {
|
|
9862
9863
|
var u, h;
|
|
9863
9864
|
const n = [], s = new J(), i = new J(), o = new J();
|
|
9864
|
-
for (let
|
|
9865
|
+
for (let f = 0; f < e.length; f += 3) {
|
|
9865
9866
|
const g = new J();
|
|
9866
|
-
s.fromArray(t, e[
|
|
9867
|
+
s.fromArray(t, e[f] * 3), i.fromArray(t, e[f + 1] * 3), o.fromArray(t, e[f + 2] * 3), g.crossVectors(i.clone().sub(s), o.clone().sub(s)), n.push(g.normalize());
|
|
9867
9868
|
}
|
|
9868
9869
|
const a = {}, c = [];
|
|
9869
|
-
for (let
|
|
9870
|
-
const g =
|
|
9870
|
+
for (let f = 0; f < e.length / 3; f++) {
|
|
9871
|
+
const g = f * 3;
|
|
9871
9872
|
for (let y = 0; y < 3; y++) {
|
|
9872
|
-
const x = (y + 1) % 3, b = e[g + y],
|
|
9873
|
-
a[b] || (a[b] = {}), a[b][
|
|
9873
|
+
const x = (y + 1) % 3, b = e[g + y], w = e[g + x];
|
|
9874
|
+
a[b] || (a[b] = {}), a[b][w] = f, c.push([b, w]);
|
|
9874
9875
|
}
|
|
9875
9876
|
}
|
|
9876
9877
|
const l = [], d = {};
|
|
9877
|
-
for (const [
|
|
9878
|
-
if (d[
|
|
9879
|
-
const y = (u = a[
|
|
9880
|
-
l.push({ a:
|
|
9878
|
+
for (const [f, g] of c) {
|
|
9879
|
+
if (d[f] || (d[f] = {}), d[g] || (d[g] = {}), d[f][g]) continue;
|
|
9880
|
+
const y = (u = a[f]) == null ? void 0 : u[g], x = (h = a[g]) == null ? void 0 : h[f], b = y !== void 0 ? n[y] : new J(), w = x !== void 0 ? n[x] : new J();
|
|
9881
|
+
l.push({ a: f, b: g, n0: b, n1: w }), d[f][g] = !0, d[g][f] = !0;
|
|
9881
9882
|
}
|
|
9882
9883
|
return l;
|
|
9883
9884
|
}
|
|
@@ -9898,8 +9899,8 @@ function Cd(r, e, t = 2) {
|
|
|
9898
9899
|
a = r[0], c = r[1];
|
|
9899
9900
|
let d = a, u = c;
|
|
9900
9901
|
for (let h = t; h < s; h += t) {
|
|
9901
|
-
const
|
|
9902
|
-
|
|
9902
|
+
const f = r[h], g = r[h + 1];
|
|
9903
|
+
f < a && (a = f), g < c && (c = g), f > d && (d = f), g > u && (u = g);
|
|
9903
9904
|
}
|
|
9904
9905
|
l = Math.max(d - a, u - c), l = l !== 0 ? 32767 / l : 0;
|
|
9905
9906
|
}
|
|
@@ -9945,24 +9946,24 @@ function di(r, e, t, n, s) {
|
|
|
9945
9946
|
}
|
|
9946
9947
|
}
|
|
9947
9948
|
function Od(r) {
|
|
9948
|
-
const e = r.prev, t = r, n = r.next, s = e.x, i = t.x, o = n.x, a = e.y, c = t.y, l = n.y, d = Math.min(s, i, o), u = Math.min(a, c, l), h = Math.max(s, i, o),
|
|
9949
|
+
const e = r.prev, t = r, n = r.next, s = e.x, i = t.x, o = n.x, a = e.y, c = t.y, l = n.y, d = Math.min(s, i, o), u = Math.min(a, c, l), h = Math.max(s, i, o), f = Math.max(a, c, l);
|
|
9949
9950
|
let g = n.next;
|
|
9950
9951
|
for (; g !== e; ) {
|
|
9951
|
-
if (g.x >= d && g.x <= h && g.y >= u && g.y <=
|
|
9952
|
+
if (g.x >= d && g.x <= h && g.y >= u && g.y <= f && !(s === g.x && a === g.y) && ds(s, a, i, c, o, l, g.x, g.y) && ae(g.prev, g, g.next) >= 0) return !1;
|
|
9952
9953
|
g = g.next;
|
|
9953
9954
|
}
|
|
9954
9955
|
return !0;
|
|
9955
9956
|
}
|
|
9956
9957
|
function kd(r, e, t, n) {
|
|
9957
|
-
const s = r.prev, i = r, o = r.next, a = s.x, c = i.x, l = o.x, d = s.y, u = i.y, h = o.y,
|
|
9958
|
+
const s = r.prev, i = r, o = r.next, a = s.x, c = i.x, l = o.x, d = s.y, u = i.y, h = o.y, f = Math.min(a, c, l), g = Math.min(d, u, h), y = Math.max(a, c, l), x = Math.max(d, u, h), b = pi(f, g, e, t, n), w = pi(y, x, e, t, n);
|
|
9958
9959
|
let T = r.prevZ;
|
|
9959
9960
|
for (; T && T.z >= b; ) {
|
|
9960
|
-
if (T.x >=
|
|
9961
|
+
if (T.x >= f && T.x <= y && T.y >= g && T.y <= x && T !== o && !(a === T.x && d === T.y) && ds(a, d, c, u, l, h, T.x, T.y) && ae(T.prev, T, T.next) >= 0) return !1;
|
|
9961
9962
|
T = T.prevZ;
|
|
9962
9963
|
}
|
|
9963
9964
|
let v = r.nextZ;
|
|
9964
|
-
for (; v && v.z <=
|
|
9965
|
-
if (v.x >=
|
|
9965
|
+
for (; v && v.z <= w; ) {
|
|
9966
|
+
if (v.x >= f && v.x <= y && v.y >= g && v.y <= x && v !== o && !(a === v.x && d === v.y) && ds(a, d, c, u, l, h, v.x, v.y) && ae(v.prev, v, v.next) >= 0) return !1;
|
|
9966
9967
|
v = v.nextZ;
|
|
9967
9968
|
}
|
|
9968
9969
|
return !0;
|
|
@@ -10056,8 +10057,8 @@ function jd(r, e) {
|
|
|
10056
10057
|
const n = r.x, s = r.y;
|
|
10057
10058
|
let i = -1 / 0, o;
|
|
10058
10059
|
if (Rn(r, t)) return t;
|
|
10059
|
-
for (let h = 0,
|
|
10060
|
-
if (s < re[
|
|
10060
|
+
for (let h = 0, f = 0; h < ls; h++, f += 4) {
|
|
10061
|
+
if (s < re[f + 1] || s > re[f + 3] || re[f] > n || re[f + 2] <= i) continue;
|
|
10061
10062
|
const g = Mr(h);
|
|
10062
10063
|
t = Lr(h);
|
|
10063
10064
|
do {
|
|
@@ -10075,8 +10076,8 @@ function jd(r, e) {
|
|
|
10075
10076
|
if (!o) return null;
|
|
10076
10077
|
const a = o.x, c = o.y, l = Math.min(s, c), d = Math.max(s, c);
|
|
10077
10078
|
let u = 1 / 0;
|
|
10078
|
-
for (let h = 0,
|
|
10079
|
-
if (re[
|
|
10079
|
+
for (let h = 0, f = 0; h < ls; h++, f += 4) {
|
|
10080
|
+
if (re[f + 2] < a || re[f] > n || re[f + 3] < l || re[f + 1] > d) continue;
|
|
10080
10081
|
const g = Mr(h);
|
|
10081
10082
|
t = Lr(h);
|
|
10082
10083
|
do {
|
|
@@ -10288,8 +10289,8 @@ function Jd(r, e) {
|
|
|
10288
10289
|
for (const [l, d] of n) {
|
|
10289
10290
|
const u = t.indexOf(l), h = t.indexOf(d);
|
|
10290
10291
|
if (u === -1 || h === -1 || u === h) continue;
|
|
10291
|
-
const
|
|
10292
|
-
o.has(
|
|
10292
|
+
const f = i(u, h);
|
|
10293
|
+
o.has(f) || (o.add(f), s[u].push(h), s[h].push(u));
|
|
10293
10294
|
}
|
|
10294
10295
|
const a = /* @__PURE__ */ new Set(), c = [];
|
|
10295
10296
|
for (let l = 0; l < t.length; l++)
|
|
@@ -10304,19 +10305,19 @@ function Jd(r, e) {
|
|
|
10304
10305
|
}
|
|
10305
10306
|
if (d === -1) break;
|
|
10306
10307
|
const u = [l];
|
|
10307
|
-
let h = l,
|
|
10308
|
+
let h = l, f = -1, g = d;
|
|
10308
10309
|
for (; ; ) {
|
|
10309
10310
|
const y = i(h, g);
|
|
10310
10311
|
if (a.add(y), g === l) {
|
|
10311
10312
|
u.length >= 3 && c.push(u);
|
|
10312
10313
|
break;
|
|
10313
10314
|
}
|
|
10314
|
-
u.push(g),
|
|
10315
|
+
u.push(g), f = h, h = g;
|
|
10315
10316
|
let x = !1;
|
|
10316
10317
|
for (const b of s[h]) {
|
|
10317
|
-
if (b ===
|
|
10318
|
-
const
|
|
10319
|
-
if (!a.has(
|
|
10318
|
+
if (b === f) continue;
|
|
10319
|
+
const w = i(h, b);
|
|
10320
|
+
if (!a.has(w)) {
|
|
10320
10321
|
g = b, x = !0;
|
|
10321
10322
|
break;
|
|
10322
10323
|
}
|
|
@@ -10330,8 +10331,8 @@ function Qd(r, e, t, n) {
|
|
|
10330
10331
|
let s = r.distanceToPoint(e), i = r.distanceToPoint(t), o = r.distanceToPoint(n);
|
|
10331
10332
|
const a = 1e-10;
|
|
10332
10333
|
if (Math.abs(s) < a && (s = 0), Math.abs(i) < a && (i = 0), Math.abs(o) < a && (o = 0), s >= 0 == i >= 0 && s >= 0 == o >= 0) return null;
|
|
10333
|
-
const c = [], l = (u, h,
|
|
10334
|
-
if (
|
|
10334
|
+
const c = [], l = (u, h, f, g) => {
|
|
10335
|
+
if (f === 0) {
|
|
10335
10336
|
c.push(u.clone());
|
|
10336
10337
|
return;
|
|
10337
10338
|
}
|
|
@@ -10339,8 +10340,8 @@ function Qd(r, e, t, n) {
|
|
|
10339
10340
|
c.push(h.clone());
|
|
10340
10341
|
return;
|
|
10341
10342
|
}
|
|
10342
|
-
if (
|
|
10343
|
-
const y =
|
|
10343
|
+
if (f > 0 != g > 0) {
|
|
10344
|
+
const y = f / (f - g);
|
|
10344
10345
|
c.push(new m.Vector3().copy(u).addScaledVector(new m.Vector3().copy(h).sub(u), y));
|
|
10345
10346
|
}
|
|
10346
10347
|
};
|
|
@@ -10386,12 +10387,12 @@ function tu(r, e, t) {
|
|
|
10386
10387
|
});
|
|
10387
10388
|
const d = Jd(l, n);
|
|
10388
10389
|
if (d.length === 0) return null;
|
|
10389
|
-
const u = new m.Vector3(0, 1, 0), h = new m.Vector3(1, 0, 0),
|
|
10390
|
-
for (let R = 0; R <
|
|
10390
|
+
const u = new m.Vector3(0, 1, 0), h = new m.Vector3(1, 0, 0), f = new m.Vector3().crossVectors(e.normal, Math.abs(e.normal.dot(u)) < 0.9 ? u : h).normalize(), g = new m.Vector3().crossVectors(e.normal, f).normalize(), y = (R) => R.map((O) => new m.Vector2(O.dot(f), O.dot(g))), x = d.map(y), b = x.map((R, O) => ({ i: O, area: Math.abs(Ws(R)) })).sort((R, O) => O.area - R.area).map((R) => R.i), w = b.map((R) => d[R]), T = b.map((R) => x[R]), v = (t == null ? void 0 : t.plane_offset) ?? 1e-4, P = e.normal.clone().multiplyScalar(v), V = [], F = new Array(w.length).fill(!1);
|
|
10391
|
+
for (let R = 0; R < w.length; R++) {
|
|
10391
10392
|
if (F[R]) continue;
|
|
10392
|
-
const O =
|
|
10393
|
-
for (let z = R + 1; z <
|
|
10394
|
-
!F[z] && qd(T[z], N) && (G.push(
|
|
10393
|
+
const O = w[R], N = T[R], G = [], Z = [];
|
|
10394
|
+
for (let z = R + 1; z < w.length; z++)
|
|
10395
|
+
!F[z] && qd(T[z], N) && (G.push(w[z]), Z.push(T[z]), F[z] = !0);
|
|
10395
10396
|
F[R] = !0, Ws(N) < 0 && (N.reverse(), O.reverse());
|
|
10396
10397
|
for (let z = 0; z < Z.length; z++)
|
|
10397
10398
|
Ws(Z[z]) > 0 && (Z[z].reverse(), G[z].reverse());
|
|
@@ -10660,8 +10661,8 @@ class nu extends EventTarget {
|
|
|
10660
10661
|
o(d), s.setFromCamera(i, t);
|
|
10661
10662
|
const u = new m.Vector3();
|
|
10662
10663
|
if (!s.ray.intersectPlane(this.drag_plane, u)) return;
|
|
10663
|
-
const h = new m.Vector3().copy(u).sub(this.drag_start),
|
|
10664
|
-
g === -1 ? b.setComponent(y, Math.min(b.getComponent(y) + x,
|
|
10664
|
+
const h = new m.Vector3().copy(u).sub(this.drag_start), f = this.drag_face.userData.axis, g = this.drag_face.userData.sign, y = f === "x" ? 0 : f === "y" ? 1 : 2, x = h.getComponent(y), b = this.bounds.min, w = this.bounds.max;
|
|
10665
|
+
g === -1 ? b.setComponent(y, Math.min(b.getComponent(y) + x, w.getComponent(y))) : w.setComponent(y, Math.max(w.getComponent(y) + x, b.getComponent(y))), this.drag_start.copy(u), this.rebuild();
|
|
10665
10666
|
}, l = () => {
|
|
10666
10667
|
this.drag_face && (this.drag_face = null, n.style.cursor = "default", this.orbit_controls && (this.orbit_controls.enabled = !0));
|
|
10667
10668
|
};
|
|
@@ -11184,7 +11185,7 @@ const Bt = class Bt extends EventTarget {
|
|
|
11184
11185
|
l.name = `axis_${a}`;
|
|
11185
11186
|
const d = new m.CylinderGeometry(0.02, 0.02, 1, 8), u = new m.MeshBasicMaterial({ color: c, toneMapped: !1, depthTest: !1, depthWrite: !1 }), h = new m.Mesh(d, u);
|
|
11186
11187
|
h.renderOrder = 999;
|
|
11187
|
-
const
|
|
11188
|
+
const f = new m.ConeGeometry(0.05, 0.2, 8), g = new m.MeshBasicMaterial({ color: c, toneMapped: !1, depthTest: !1, depthWrite: !1 }), y = new m.Mesh(f, g);
|
|
11188
11189
|
y.renderOrder = 999, a === "x" ? (h.rotation.z = -Math.PI / 2, h.position.x = 1 / 2, y.rotation.z = -Math.PI / 2, y.position.x = 1 + 0.2 / 2) : a === "y" ? (h.position.y = 1 / 2, y.position.y = 1 + 0.2 / 2) : a === "z" && (h.rotation.x = Math.PI / 2, h.position.z = 1 / 2, y.rotation.x = Math.PI / 2, y.position.z = 1 + 0.2 / 2), l.add(h), l.add(y), l.userData.axis = a, this.axis_arrows.set(a, l), this.gizmo_group.add(l);
|
|
11189
11190
|
});
|
|
11190
11191
|
}
|