@viji-dev/core 0.11.6 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artist-dts-p5.js +1 -1
- package/dist/artist-dts.js +1 -1
- package/dist/artist-global-p5.d.ts +11 -1
- package/dist/artist-global.d.ts +11 -1
- package/dist/assets/{viji.worker-Bu5UOGpW.js → viji.worker-BKg5vsqf.js} +380 -364
- package/dist/docs-api.js +2 -2
- package/dist/{essentia-wasm.web-B5WvSGTX.js → essentia-wasm.web-QxZd-8n4.js} +2 -2
- package/dist/{index-BKvsDqj0.js → index-zKfpXJhf.js} +13 -6
- package/dist/index.d.ts +17 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -2877,12 +2877,12 @@ ${c}`);
|
|
|
2877
2877
|
this.setUniform("u_face0Neutral", "float", _.neutral || 0), this.setUniform("u_face0Happy", "float", _.happy || 0), this.setUniform("u_face0Sad", "float", _.sad || 0), this.setUniform("u_face0Angry", "float", _.angry || 0), this.setUniform("u_face0Surprised", "float", _.surprised || 0), this.setUniform("u_face0Disgusted", "float", _.disgusted || 0), this.setUniform("u_face0Fearful", "float", _.fearful || 0), this.setUniform("u_face0BrowDownLeft", "float", b.browDownLeft || 0), this.setUniform("u_face0BrowDownRight", "float", b.browDownRight || 0), this.setUniform("u_face0BrowInnerUp", "float", b.browInnerUp || 0), this.setUniform("u_face0BrowOuterUpLeft", "float", b.browOuterUpLeft || 0), this.setUniform("u_face0BrowOuterUpRight", "float", b.browOuterUpRight || 0), this.setUniform("u_face0CheekPuff", "float", b.cheekPuff || 0), this.setUniform("u_face0CheekSquintLeft", "float", b.cheekSquintLeft || 0), this.setUniform("u_face0CheekSquintRight", "float", b.cheekSquintRight || 0), this.setUniform("u_face0EyeBlinkLeft", "float", b.eyeBlinkLeft || 0), this.setUniform("u_face0EyeBlinkRight", "float", b.eyeBlinkRight || 0), this.setUniform("u_face0EyeLookDownLeft", "float", b.eyeLookDownLeft || 0), this.setUniform("u_face0EyeLookDownRight", "float", b.eyeLookDownRight || 0), this.setUniform("u_face0EyeLookInLeft", "float", b.eyeLookInLeft || 0), this.setUniform("u_face0EyeLookInRight", "float", b.eyeLookInRight || 0), this.setUniform("u_face0EyeLookOutLeft", "float", b.eyeLookOutLeft || 0), this.setUniform("u_face0EyeLookOutRight", "float", b.eyeLookOutRight || 0), this.setUniform("u_face0EyeLookUpLeft", "float", b.eyeLookUpLeft || 0), this.setUniform("u_face0EyeLookUpRight", "float", b.eyeLookUpRight || 0), this.setUniform("u_face0EyeSquintLeft", "float", b.eyeSquintLeft || 0), this.setUniform("u_face0EyeSquintRight", "float", b.eyeSquintRight || 0), this.setUniform("u_face0EyeWideLeft", "float", b.eyeWideLeft || 0), this.setUniform("u_face0EyeWideRight", "float", b.eyeWideRight || 0), this.setUniform("u_face0JawForward", "float", b.jawForward || 0), this.setUniform("u_face0JawLeft", "float", b.jawLeft || 0), this.setUniform("u_face0JawOpen", "float", b.jawOpen || 0), this.setUniform("u_face0JawRight", "float", b.jawRight || 0), this.setUniform("u_face0MouthClose", "float", b.mouthClose || 0), this.setUniform("u_face0MouthDimpleLeft", "float", b.mouthDimpleLeft || 0), this.setUniform("u_face0MouthDimpleRight", "float", b.mouthDimpleRight || 0), this.setUniform("u_face0MouthFrownLeft", "float", b.mouthFrownLeft || 0), this.setUniform("u_face0MouthFrownRight", "float", b.mouthFrownRight || 0), this.setUniform("u_face0MouthFunnel", "float", b.mouthFunnel || 0), this.setUniform("u_face0MouthLeft", "float", b.mouthLeft || 0), this.setUniform("u_face0MouthLowerDownLeft", "float", b.mouthLowerDownLeft || 0), this.setUniform("u_face0MouthLowerDownRight", "float", b.mouthLowerDownRight || 0), this.setUniform("u_face0MouthPressLeft", "float", b.mouthPressLeft || 0), this.setUniform("u_face0MouthPressRight", "float", b.mouthPressRight || 0), this.setUniform("u_face0MouthPucker", "float", b.mouthPucker || 0), this.setUniform("u_face0MouthRight", "float", b.mouthRight || 0), this.setUniform("u_face0MouthRollLower", "float", b.mouthRollLower || 0), this.setUniform("u_face0MouthRollUpper", "float", b.mouthRollUpper || 0), this.setUniform("u_face0MouthShrugLower", "float", b.mouthShrugLower || 0), this.setUniform("u_face0MouthShrugUpper", "float", b.mouthShrugUpper || 0), this.setUniform("u_face0MouthSmileLeft", "float", b.mouthSmileLeft || 0), this.setUniform("u_face0MouthSmileRight", "float", b.mouthSmileRight || 0), this.setUniform("u_face0MouthStretchLeft", "float", b.mouthStretchLeft || 0), this.setUniform("u_face0MouthStretchRight", "float", b.mouthStretchRight || 0), this.setUniform("u_face0MouthUpperUpLeft", "float", b.mouthUpperUpLeft || 0), this.setUniform("u_face0MouthUpperUpRight", "float", b.mouthUpperUpRight || 0), this.setUniform("u_face0NoseSneerLeft", "float", b.noseSneerLeft || 0), this.setUniform("u_face0NoseSneerRight", "float", b.noseSneerRight || 0), this.setUniform("u_face0TongueOut", "float", b.tongueOut || 0);
|
|
2878
2878
|
} else
|
|
2879
2879
|
this.setUniform("u_face0Neutral", "float", 0), this.setUniform("u_face0Happy", "float", 0), this.setUniform("u_face0Sad", "float", 0), this.setUniform("u_face0Angry", "float", 0), this.setUniform("u_face0Surprised", "float", 0), this.setUniform("u_face0Disgusted", "float", 0), this.setUniform("u_face0Fearful", "float", 0), this.setUniform("u_face0BrowDownLeft", "float", 0), this.setUniform("u_face0BrowDownRight", "float", 0), this.setUniform("u_face0BrowInnerUp", "float", 0), this.setUniform("u_face0BrowOuterUpLeft", "float", 0), this.setUniform("u_face0BrowOuterUpRight", "float", 0), this.setUniform("u_face0CheekPuff", "float", 0), this.setUniform("u_face0CheekSquintLeft", "float", 0), this.setUniform("u_face0CheekSquintRight", "float", 0), this.setUniform("u_face0EyeBlinkLeft", "float", 0), this.setUniform("u_face0EyeBlinkRight", "float", 0), this.setUniform("u_face0EyeLookDownLeft", "float", 0), this.setUniform("u_face0EyeLookDownRight", "float", 0), this.setUniform("u_face0EyeLookInLeft", "float", 0), this.setUniform("u_face0EyeLookInRight", "float", 0), this.setUniform("u_face0EyeLookOutLeft", "float", 0), this.setUniform("u_face0EyeLookOutRight", "float", 0), this.setUniform("u_face0EyeLookUpLeft", "float", 0), this.setUniform("u_face0EyeLookUpRight", "float", 0), this.setUniform("u_face0EyeSquintLeft", "float", 0), this.setUniform("u_face0EyeSquintRight", "float", 0), this.setUniform("u_face0EyeWideLeft", "float", 0), this.setUniform("u_face0EyeWideRight", "float", 0), this.setUniform("u_face0JawForward", "float", 0), this.setUniform("u_face0JawLeft", "float", 0), this.setUniform("u_face0JawOpen", "float", 0), this.setUniform("u_face0JawRight", "float", 0), this.setUniform("u_face0MouthClose", "float", 0), this.setUniform("u_face0MouthDimpleLeft", "float", 0), this.setUniform("u_face0MouthDimpleRight", "float", 0), this.setUniform("u_face0MouthFrownLeft", "float", 0), this.setUniform("u_face0MouthFrownRight", "float", 0), this.setUniform("u_face0MouthFunnel", "float", 0), this.setUniform("u_face0MouthLeft", "float", 0), this.setUniform("u_face0MouthLowerDownLeft", "float", 0), this.setUniform("u_face0MouthLowerDownRight", "float", 0), this.setUniform("u_face0MouthPressLeft", "float", 0), this.setUniform("u_face0MouthPressRight", "float", 0), this.setUniform("u_face0MouthPucker", "float", 0), this.setUniform("u_face0MouthRight", "float", 0), this.setUniform("u_face0MouthRollLower", "float", 0), this.setUniform("u_face0MouthRollUpper", "float", 0), this.setUniform("u_face0MouthShrugLower", "float", 0), this.setUniform("u_face0MouthShrugUpper", "float", 0), this.setUniform("u_face0MouthSmileLeft", "float", 0), this.setUniform("u_face0MouthSmileRight", "float", 0), this.setUniform("u_face0MouthStretchLeft", "float", 0), this.setUniform("u_face0MouthStretchRight", "float", 0), this.setUniform("u_face0MouthUpperUpLeft", "float", 0), this.setUniform("u_face0MouthUpperUpRight", "float", 0), this.setUniform("u_face0NoseSneerLeft", "float", 0), this.setUniform("u_face0NoseSneerRight", "float", 0), this.setUniform("u_face0TongueOut", "float", 0);
|
|
2880
|
-
const
|
|
2881
|
-
this.setUniform("u_handCount", "int", q ?
|
|
2882
|
-
const
|
|
2883
|
-
if (
|
|
2884
|
-
const _ =
|
|
2885
|
-
this.setUniform("u_leftHandPalm", "vec3", [_?.x || 0, 1 - (_?.y || 0), _?.z || 0]), this.setUniform("u_leftHandConfidence", "float",
|
|
2880
|
+
const N = s.cv?.hands || [], q = this.visibleFeatures.has("handTracking");
|
|
2881
|
+
this.setUniform("u_handCount", "int", q ? N.length : 0);
|
|
2882
|
+
const K = q ? N.find((_) => _.handedness === "left") : void 0, C = q ? N.find((_) => _.handedness === "right") : void 0;
|
|
2883
|
+
if (K) {
|
|
2884
|
+
const _ = K.palm || K.landmarks?.[9], b = K.gestures || {}, v = K.bounds;
|
|
2885
|
+
this.setUniform("u_leftHandPalm", "vec3", [_?.x || 0, 1 - (_?.y || 0), _?.z || 0]), this.setUniform("u_leftHandConfidence", "float", K.confidence || 0), this.setUniform("u_leftHandBounds", "vec4", [v?.x || 0, 1 - (v?.y || 0) - (v?.height || 0), v?.width || 0, v?.height || 0]), this.setUniform("u_leftHandFist", "float", b.fist || 0), this.setUniform("u_leftHandOpen", "float", b.openPalm || 0), this.setUniform("u_leftHandPeace", "float", b.peace || 0), this.setUniform("u_leftHandThumbsUp", "float", b.thumbsUp || 0), this.setUniform("u_leftHandThumbsDown", "float", b.thumbsDown || 0), this.setUniform("u_leftHandPointing", "float", b.pointing || 0), this.setUniform("u_leftHandILoveYou", "float", b.iLoveYou || 0);
|
|
2886
2886
|
} else
|
|
2887
2887
|
this.setUniform("u_leftHandPalm", "vec3", [0, 0, 0]), this.setUniform("u_leftHandConfidence", "float", 0), this.setUniform("u_leftHandBounds", "vec4", [0, 0, 0, 0]), this.setUniform("u_leftHandFist", "float", 0), this.setUniform("u_leftHandOpen", "float", 0), this.setUniform("u_leftHandPeace", "float", 0), this.setUniform("u_leftHandThumbsUp", "float", 0), this.setUniform("u_leftHandThumbsDown", "float", 0), this.setUniform("u_leftHandPointing", "float", 0), this.setUniform("u_leftHandILoveYou", "float", 0);
|
|
2888
2888
|
if (C) {
|
|
@@ -2890,10 +2890,10 @@ ${c}`);
|
|
|
2890
2890
|
this.setUniform("u_rightHandPalm", "vec3", [_?.x || 0, 1 - (_?.y || 0), _?.z || 0]), this.setUniform("u_rightHandConfidence", "float", C.confidence || 0), this.setUniform("u_rightHandBounds", "vec4", [v?.x || 0, 1 - (v?.y || 0) - (v?.height || 0), v?.width || 0, v?.height || 0]), this.setUniform("u_rightHandFist", "float", b.fist || 0), this.setUniform("u_rightHandOpen", "float", b.openPalm || 0), this.setUniform("u_rightHandPeace", "float", b.peace || 0), this.setUniform("u_rightHandThumbsUp", "float", b.thumbsUp || 0), this.setUniform("u_rightHandThumbsDown", "float", b.thumbsDown || 0), this.setUniform("u_rightHandPointing", "float", b.pointing || 0), this.setUniform("u_rightHandILoveYou", "float", b.iLoveYou || 0);
|
|
2891
2891
|
} else
|
|
2892
2892
|
this.setUniform("u_rightHandPalm", "vec3", [0, 0, 0]), this.setUniform("u_rightHandConfidence", "float", 0), this.setUniform("u_rightHandBounds", "vec4", [0, 0, 0, 0]), this.setUniform("u_rightHandFist", "float", 0), this.setUniform("u_rightHandOpen", "float", 0), this.setUniform("u_rightHandPeace", "float", 0), this.setUniform("u_rightHandThumbsUp", "float", 0), this.setUniform("u_rightHandThumbsDown", "float", 0), this.setUniform("u_rightHandPointing", "float", 0), this.setUniform("u_rightHandILoveYou", "float", 0);
|
|
2893
|
-
const
|
|
2894
|
-
if (this.setUniform("u_poseDetected", "bool",
|
|
2895
|
-
const _ =
|
|
2896
|
-
this.setUniform("u_poseConfidence", "float",
|
|
2893
|
+
const B = this.visibleFeatures.has("poseDetection") ? s.cv?.pose ?? null : null;
|
|
2894
|
+
if (this.setUniform("u_poseDetected", "bool", B !== null), B && B.landmarks) {
|
|
2895
|
+
const _ = B.landmarks, b = (v) => 1 - (_[v]?.y || 0);
|
|
2896
|
+
this.setUniform("u_poseConfidence", "float", B.confidence || 0), this.setUniform("u_nosePosition", "vec2", [_[0]?.x || 0, b(0)]), this.setUniform("u_leftShoulderPosition", "vec2", [_[11]?.x || 0, b(11)]), this.setUniform("u_rightShoulderPosition", "vec2", [_[12]?.x || 0, b(12)]), this.setUniform("u_leftElbowPosition", "vec2", [_[13]?.x || 0, b(13)]), this.setUniform("u_rightElbowPosition", "vec2", [_[14]?.x || 0, b(14)]), this.setUniform("u_leftWristPosition", "vec2", [_[15]?.x || 0, b(15)]), this.setUniform("u_rightWristPosition", "vec2", [_[16]?.x || 0, b(16)]), this.setUniform("u_leftHipPosition", "vec2", [_[23]?.x || 0, b(23)]), this.setUniform("u_rightHipPosition", "vec2", [_[24]?.x || 0, b(24)]), this.setUniform("u_leftKneePosition", "vec2", [_[25]?.x || 0, b(25)]), this.setUniform("u_rightKneePosition", "vec2", [_[26]?.x || 0, b(26)]), this.setUniform("u_leftAnklePosition", "vec2", [_[27]?.x || 0, b(27)]), this.setUniform("u_rightAnklePosition", "vec2", [_[28]?.x || 0, b(28)]);
|
|
2897
2897
|
} else
|
|
2898
2898
|
this.setUniform("u_poseConfidence", "float", 0), this.setUniform("u_nosePosition", "vec2", [0, 0]), this.setUniform("u_leftShoulderPosition", "vec2", [0, 0]), this.setUniform("u_rightShoulderPosition", "vec2", [0, 0]), this.setUniform("u_leftElbowPosition", "vec2", [0, 0]), this.setUniform("u_rightElbowPosition", "vec2", [0, 0]), this.setUniform("u_leftWristPosition", "vec2", [0, 0]), this.setUniform("u_rightWristPosition", "vec2", [0, 0]), this.setUniform("u_leftHipPosition", "vec2", [0, 0]), this.setUniform("u_rightHipPosition", "vec2", [0, 0]), this.setUniform("u_leftKneePosition", "vec2", [0, 0]), this.setUniform("u_rightKneePosition", "vec2", [0, 0]), this.setUniform("u_leftAnklePosition", "vec2", [0, 0]), this.setUniform("u_rightAnklePosition", "vec2", [0, 0]);
|
|
2899
2899
|
const oe = this.visibleFeatures.has("bodySegmentation") ? s.cv?.segmentation ?? null : null;
|
|
@@ -2922,11 +2922,11 @@ ${c}`);
|
|
|
2922
2922
|
]), this.setUniform("u_deviceOrientationAbsolute", "bool", b.absolute)) : (this.setUniform("u_deviceOrientation", "vec3", [0, 0, 0]), this.setUniform("u_deviceOrientationAbsolute", "bool", !1));
|
|
2923
2923
|
} else
|
|
2924
2924
|
this.setUniform("u_deviceAcceleration", "vec3", [0, 0, 0]), this.setUniform("u_deviceAccelerationGravity", "vec3", [0, 0, 0]), this.setUniform("u_deviceRotationRate", "vec3", [0, 0, 0]), this.setUniform("u_deviceOrientation", "vec3", [0, 0, 0]), this.setUniform("u_deviceOrientationAbsolute", "bool", !1);
|
|
2925
|
-
const
|
|
2926
|
-
this.setUniform("u_externalDeviceCount", "int",
|
|
2925
|
+
const Y = e.devices || [], de = Math.min(Y.length, Fe.MAX_EXTERNAL_DEVICES);
|
|
2926
|
+
this.setUniform("u_externalDeviceCount", "int", de);
|
|
2927
2927
|
for (let _ = 0; _ < Fe.MAX_EXTERNAL_DEVICES; _++)
|
|
2928
|
-
if (_ <
|
|
2929
|
-
const b =
|
|
2928
|
+
if (_ < de) {
|
|
2929
|
+
const b = Y[_], v = b.motion;
|
|
2930
2930
|
v?.acceleration ? this.setUniform(`u_device${_}Acceleration`, "vec3", [
|
|
2931
2931
|
v.acceleration.x ?? 0,
|
|
2932
2932
|
v.acceleration.y ?? 0,
|
|
@@ -3580,13 +3580,13 @@ class Jc extends Kc {
|
|
|
3580
3580
|
for (let g = 0; g < 16; g++, n += 4)
|
|
3581
3581
|
ut[g] = e.getUint32(n, !1);
|
|
3582
3582
|
for (let g = 16; g < 64; g++) {
|
|
3583
|
-
const x = ut[g - 15], T = ut[g - 2], L = Ze(x, 7) ^ Ze(x, 18) ^ x >>> 3,
|
|
3584
|
-
ut[g] =
|
|
3583
|
+
const x = ut[g - 15], T = ut[g - 2], L = Ze(x, 7) ^ Ze(x, 18) ^ x >>> 3, N = Ze(T, 17) ^ Ze(T, 19) ^ T >>> 10;
|
|
3584
|
+
ut[g] = N + ut[g - 7] + L + ut[g - 16] | 0;
|
|
3585
3585
|
}
|
|
3586
3586
|
let { A: s, B: i, C: o, D: c, E: u, F: h, G: f, H: m } = this;
|
|
3587
3587
|
for (let g = 0; g < 64; g++) {
|
|
3588
|
-
const x = Ze(u, 6) ^ Ze(u, 11) ^ Ze(u, 25), T = m + x + Yc(u, h, f) + Zc[g] + ut[g] | 0,
|
|
3589
|
-
m = f, f = h, h = u, u = c + T | 0, c = o, o = i, i = s, s = T +
|
|
3588
|
+
const x = Ze(u, 6) ^ Ze(u, 11) ^ Ze(u, 25), T = m + x + Yc(u, h, f) + Zc[g] + ut[g] | 0, N = (Ze(s, 2) ^ Ze(s, 13) ^ Ze(s, 22)) + zc(s, i, o) | 0;
|
|
3589
|
+
m = f, f = h, h = u, u = c + T | 0, c = o, o = i, i = s, s = T + N | 0;
|
|
3590
3590
|
}
|
|
3591
3591
|
s = s + this.A | 0, i = i + this.B | 0, o = o + this.C | 0, c = c + this.D | 0, u = u + this.E | 0, h = h + this.F | 0, f = f + this.G | 0, m = m + this.H | 0, this.set(s, i, o, c, u, h, f, m);
|
|
3592
3592
|
}
|
|
@@ -3703,18 +3703,18 @@ function s1(t, e, n) {
|
|
|
3703
3703
|
if (m++ >= u)
|
|
3704
3704
|
throw new Error("drbg: tried max amount of iterations");
|
|
3705
3705
|
let q = 0;
|
|
3706
|
-
const
|
|
3706
|
+
const K = [];
|
|
3707
3707
|
for (; q < e; ) {
|
|
3708
3708
|
h = x();
|
|
3709
3709
|
const C = h.slice();
|
|
3710
|
-
|
|
3710
|
+
K.push(C), q += h.length;
|
|
3711
3711
|
}
|
|
3712
|
-
return ft(...
|
|
3712
|
+
return ft(...K);
|
|
3713
3713
|
};
|
|
3714
|
-
return (q,
|
|
3714
|
+
return (q, K) => {
|
|
3715
3715
|
g(), T(q);
|
|
3716
3716
|
let C;
|
|
3717
|
-
for (; (C =
|
|
3717
|
+
for (; (C = K(L())) === void 0; )
|
|
3718
3718
|
T();
|
|
3719
3719
|
return g(), C;
|
|
3720
3720
|
};
|
|
@@ -3775,10 +3775,10 @@ function a1(t) {
|
|
|
3775
3775
|
return (u, h) => {
|
|
3776
3776
|
const f = u;
|
|
3777
3777
|
let m = f.pow(h, c), g = f.mul(m, s);
|
|
3778
|
-
const x = f.mul(m, i), T = f.mul(m, o), L = f.eql(f.sqr(g), h),
|
|
3779
|
-
m = f.cmov(m, g, L), g = f.cmov(T, x,
|
|
3780
|
-
const q = f.eql(f.sqr(g), h),
|
|
3781
|
-
return Cr(f,
|
|
3778
|
+
const x = f.mul(m, i), T = f.mul(m, o), L = f.eql(f.sqr(g), h), N = f.eql(f.sqr(x), h);
|
|
3779
|
+
m = f.cmov(m, g, L), g = f.cmov(T, x, N);
|
|
3780
|
+
const q = f.eql(f.sqr(g), h), K = f.cmov(m, g, q);
|
|
3781
|
+
return Cr(f, K, h), K;
|
|
3782
3782
|
};
|
|
3783
3783
|
}
|
|
3784
3784
|
function Do(t) {
|
|
@@ -3806,12 +3806,12 @@ function Do(t) {
|
|
|
3806
3806
|
for (; !m.eql(T, m.ONE); ) {
|
|
3807
3807
|
if (m.is0(T))
|
|
3808
3808
|
return m.ZERO;
|
|
3809
|
-
let
|
|
3809
|
+
let N = 1, q = m.sqr(T);
|
|
3810
3810
|
for (; !m.eql(q, m.ONE); )
|
|
3811
|
-
if (
|
|
3811
|
+
if (N++, q = m.sqr(q), N === g)
|
|
3812
3812
|
throw new Error("Cannot find square root");
|
|
3813
|
-
const
|
|
3814
|
-
g =
|
|
3813
|
+
const K = Ee << BigInt(g - N - 1), C = m.pow(x, K);
|
|
3814
|
+
g = N, x = m.sqr(C), T = m.mul(T, x), L = m.mul(L, C);
|
|
3815
3815
|
}
|
|
3816
3816
|
return L;
|
|
3817
3817
|
};
|
|
@@ -4384,8 +4384,8 @@ function w1(t, e = {}) {
|
|
|
4384
4384
|
const { x: X, y: U } = v.toAffine(), R = s.toBytes(X);
|
|
4385
4385
|
if (Qt($, "isCompressed"), $) {
|
|
4386
4386
|
g();
|
|
4387
|
-
const
|
|
4388
|
-
return ft($o(
|
|
4387
|
+
const M = !s.isOdd(U);
|
|
4388
|
+
return ft($o(M), R);
|
|
4389
4389
|
} else
|
|
4390
4390
|
return ft(Uint8Array.of(4), R, s.toBytes(U));
|
|
4391
4391
|
}
|
|
@@ -4395,49 +4395,49 @@ function w1(t, e = {}) {
|
|
|
4395
4395
|
if (f && X === 1 && U === 0)
|
|
4396
4396
|
return { x: s.ZERO, y: s.ZERO };
|
|
4397
4397
|
if (X === v && (U === 2 || U === 3)) {
|
|
4398
|
-
const
|
|
4399
|
-
if (!s.isValid(
|
|
4398
|
+
const M = s.fromBytes(R);
|
|
4399
|
+
if (!s.isValid(M))
|
|
4400
4400
|
throw new Error("bad point: is not on curve, wrong x");
|
|
4401
|
-
const F = q(
|
|
4402
|
-
let
|
|
4401
|
+
const F = q(M);
|
|
4402
|
+
let O;
|
|
4403
4403
|
try {
|
|
4404
|
-
|
|
4404
|
+
O = s.sqrt(F);
|
|
4405
4405
|
} catch (ue) {
|
|
4406
4406
|
const ae = ue instanceof Error ? ": " + ue.message : "";
|
|
4407
4407
|
throw new Error("bad point: is not on curve, sqrt error" + ae);
|
|
4408
4408
|
}
|
|
4409
4409
|
g();
|
|
4410
|
-
const j = s.isOdd(
|
|
4411
|
-
return (U & 1) === 1 !== j && (
|
|
4410
|
+
const j = s.isOdd(O);
|
|
4411
|
+
return (U & 1) === 1 !== j && (O = s.neg(O)), { x: M, y: O };
|
|
4412
4412
|
} else if (X === $ && U === 4) {
|
|
4413
|
-
const
|
|
4414
|
-
if (!
|
|
4413
|
+
const M = s.BYTES, F = s.fromBytes(R.subarray(0, M)), O = s.fromBytes(R.subarray(M, M * 2));
|
|
4414
|
+
if (!K(F, O))
|
|
4415
4415
|
throw new Error("bad point: is not on curve");
|
|
4416
|
-
return { x: F, y:
|
|
4416
|
+
return { x: F, y: O };
|
|
4417
4417
|
} else
|
|
4418
4418
|
throw new Error(`bad point: got length ${X}, expected compressed=${v} or uncompressed=${$}`);
|
|
4419
4419
|
}
|
|
4420
|
-
const L = e.toBytes === void 0 ? x : e.toBytes,
|
|
4420
|
+
const L = e.toBytes === void 0 ? x : e.toBytes, N = e.fromBytes === void 0 ? T : e.fromBytes;
|
|
4421
4421
|
function q(b) {
|
|
4422
4422
|
const v = s.sqr(b), $ = s.mul(v, b);
|
|
4423
4423
|
return s.add(s.add($, s.mul(b, o.a)), o.b);
|
|
4424
4424
|
}
|
|
4425
|
-
function
|
|
4425
|
+
function K(b, v) {
|
|
4426
4426
|
const $ = s.sqr(v), X = q(b);
|
|
4427
4427
|
return s.eql($, X);
|
|
4428
4428
|
}
|
|
4429
|
-
if (!
|
|
4429
|
+
if (!K(o.Gx, o.Gy))
|
|
4430
4430
|
throw new Error("bad curve params: generator point");
|
|
4431
4431
|
const C = s.mul(s.pow(o.a, bn), v1), H = s.mul(s.sqr(o.b), BigInt(27));
|
|
4432
4432
|
if (s.is0(s.add(C, H)))
|
|
4433
4433
|
throw new Error("bad curve params: a or b");
|
|
4434
|
-
function
|
|
4434
|
+
function B(b, v, $ = !1) {
|
|
4435
4435
|
if (!s.isValid(v) || $ && s.is0(v))
|
|
4436
4436
|
throw new Error(`bad point coordinate ${b}`);
|
|
4437
4437
|
return v;
|
|
4438
4438
|
}
|
|
4439
4439
|
function J(b) {
|
|
4440
|
-
if (!(b instanceof
|
|
4440
|
+
if (!(b instanceof Y))
|
|
4441
4441
|
throw new Error("Weierstrass Point expected");
|
|
4442
4442
|
}
|
|
4443
4443
|
function oe(b) {
|
|
@@ -4446,13 +4446,13 @@ function w1(t, e = {}) {
|
|
|
4446
4446
|
return y1(b, h.basises, i.ORDER);
|
|
4447
4447
|
}
|
|
4448
4448
|
function se(b, v, $, X, U) {
|
|
4449
|
-
return $ = new
|
|
4449
|
+
return $ = new Y(s.mul($.X, b), $.Y, $.Z), v = Rn(X, v), $ = Rn(U, $), v.add($);
|
|
4450
4450
|
}
|
|
4451
|
-
class
|
|
4451
|
+
class Y {
|
|
4452
4452
|
// base / generator point
|
|
4453
|
-
static BASE = new
|
|
4453
|
+
static BASE = new Y(o.Gx, o.Gy, s.ONE);
|
|
4454
4454
|
// zero / infinity / identity point
|
|
4455
|
-
static ZERO = new
|
|
4455
|
+
static ZERO = new Y(s.ZERO, s.ONE, s.ZERO);
|
|
4456
4456
|
// 0, 1, 0
|
|
4457
4457
|
// math field
|
|
4458
4458
|
static Fp = s;
|
|
@@ -4463,7 +4463,7 @@ function w1(t, e = {}) {
|
|
|
4463
4463
|
Z;
|
|
4464
4464
|
/** Does NOT validate if the point is valid. Use `.assertValidity()`. */
|
|
4465
4465
|
constructor(v, $, X) {
|
|
4466
|
-
this.X =
|
|
4466
|
+
this.X = B("x", v), this.Y = B("y", $, !0), this.Z = B("z", X), Object.freeze(this);
|
|
4467
4467
|
}
|
|
4468
4468
|
static CURVE() {
|
|
4469
4469
|
return o;
|
|
@@ -4473,16 +4473,16 @@ function w1(t, e = {}) {
|
|
|
4473
4473
|
const { x: $, y: X } = v || {};
|
|
4474
4474
|
if (!v || !s.isValid($) || !s.isValid(X))
|
|
4475
4475
|
throw new Error("invalid affine point");
|
|
4476
|
-
if (v instanceof
|
|
4476
|
+
if (v instanceof Y)
|
|
4477
4477
|
throw new Error("projective point not allowed");
|
|
4478
|
-
return s.is0($) && s.is0(X) ?
|
|
4478
|
+
return s.is0($) && s.is0(X) ? Y.ZERO : new Y($, X, s.ONE);
|
|
4479
4479
|
}
|
|
4480
4480
|
static fromBytes(v) {
|
|
4481
|
-
const $ =
|
|
4481
|
+
const $ = Y.fromAffine(N(Ce(v, void 0, "point")));
|
|
4482
4482
|
return $.assertValidity(), $;
|
|
4483
4483
|
}
|
|
4484
4484
|
static fromHex(v) {
|
|
4485
|
-
return
|
|
4485
|
+
return Y.fromBytes(ur(v));
|
|
4486
4486
|
}
|
|
4487
4487
|
get x() {
|
|
4488
4488
|
return this.toAffine().x;
|
|
@@ -4511,7 +4511,7 @@ function w1(t, e = {}) {
|
|
|
4511
4511
|
const { x: $, y: X } = v.toAffine();
|
|
4512
4512
|
if (!s.isValid($) || !s.isValid(X))
|
|
4513
4513
|
throw new Error("bad point: x or y not field elements");
|
|
4514
|
-
if (!
|
|
4514
|
+
if (!K($, X))
|
|
4515
4515
|
throw new Error("bad point: equation left != right");
|
|
4516
4516
|
if (!v.isTorsionFree())
|
|
4517
4517
|
throw new Error("bad point: not in prime-order subgroup");
|
|
@@ -4525,21 +4525,21 @@ function w1(t, e = {}) {
|
|
|
4525
4525
|
/** Compare one point to another. */
|
|
4526
4526
|
equals(v) {
|
|
4527
4527
|
J(v);
|
|
4528
|
-
const { X: $, Y: X, Z: U } = this, { X: R, Y:
|
|
4529
|
-
return
|
|
4528
|
+
const { X: $, Y: X, Z: U } = this, { X: R, Y: M, Z: F } = v, O = s.eql(s.mul($, F), s.mul(R, U)), j = s.eql(s.mul(X, F), s.mul(M, U));
|
|
4529
|
+
return O && j;
|
|
4530
4530
|
}
|
|
4531
4531
|
/** Flips point to one corresponding to (x, -y) in Affine coordinates. */
|
|
4532
4532
|
negate() {
|
|
4533
|
-
return new
|
|
4533
|
+
return new Y(this.X, s.neg(this.Y), this.Z);
|
|
4534
4534
|
}
|
|
4535
4535
|
// Renes-Costello-Batina exception-free doubling formula.
|
|
4536
4536
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
4537
4537
|
// https://eprint.iacr.org/2015/1060, algorithm 3
|
|
4538
4538
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
4539
4539
|
double() {
|
|
4540
|
-
const { a: v, b: $ } = o, X = s.mul($, bn), { X: U, Y: R, Z:
|
|
4541
|
-
let F = s.ZERO,
|
|
4542
|
-
return ie = s.add(ie, ie), j = s.mul(U,
|
|
4540
|
+
const { a: v, b: $ } = o, X = s.mul($, bn), { X: U, Y: R, Z: M } = this;
|
|
4541
|
+
let F = s.ZERO, O = s.ZERO, j = s.ZERO, z = s.mul(U, U), ue = s.mul(R, R), ae = s.mul(M, M), ie = s.mul(U, R);
|
|
4542
|
+
return ie = s.add(ie, ie), j = s.mul(U, M), j = s.add(j, j), F = s.mul(v, j), O = s.mul(X, ae), O = s.add(F, O), F = s.sub(ue, O), O = s.add(ue, O), O = s.mul(F, O), F = s.mul(ie, F), j = s.mul(X, j), ae = s.mul(v, ae), ie = s.sub(z, ae), ie = s.mul(v, ie), ie = s.add(ie, j), j = s.add(z, z), z = s.add(j, z), z = s.add(z, ae), z = s.mul(z, ie), O = s.add(O, z), ae = s.mul(R, M), ae = s.add(ae, ae), z = s.mul(ae, ie), F = s.sub(F, z), j = s.mul(ae, ue), j = s.add(j, j), j = s.add(j, j), new Y(F, O, j);
|
|
4543
4543
|
}
|
|
4544
4544
|
// Renes-Costello-Batina exception-free addition formula.
|
|
4545
4545
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -4547,19 +4547,19 @@ function w1(t, e = {}) {
|
|
|
4547
4547
|
// Cost: 12M + 0S + 3*a + 3*b3 + 23add.
|
|
4548
4548
|
add(v) {
|
|
4549
4549
|
J(v);
|
|
4550
|
-
const { X: $, Y: X, Z: U } = this, { X: R, Y:
|
|
4551
|
-
let
|
|
4550
|
+
const { X: $, Y: X, Z: U } = this, { X: R, Y: M, Z: F } = v;
|
|
4551
|
+
let O = s.ZERO, j = s.ZERO, z = s.ZERO;
|
|
4552
4552
|
const ue = o.a, ae = s.mul(o.b, bn);
|
|
4553
|
-
let ie = s.mul($, R), k = s.mul(X,
|
|
4553
|
+
let ie = s.mul($, R), k = s.mul(X, M), S = s.mul(U, F), A = s.add($, X), I = s.add(R, M);
|
|
4554
4554
|
A = s.mul(A, I), I = s.add(ie, k), A = s.sub(A, I), I = s.add($, U);
|
|
4555
4555
|
let D = s.add(R, F);
|
|
4556
|
-
return I = s.mul(I, D), D = s.add(ie, S), I = s.sub(I, D), D = s.add(X, U),
|
|
4556
|
+
return I = s.mul(I, D), D = s.add(ie, S), I = s.sub(I, D), D = s.add(X, U), O = s.add(M, F), D = s.mul(D, O), O = s.add(k, S), D = s.sub(D, O), z = s.mul(ue, I), O = s.mul(ae, S), z = s.add(O, z), O = s.sub(k, z), z = s.add(k, z), j = s.mul(O, z), k = s.add(ie, ie), k = s.add(k, ie), S = s.mul(ue, S), I = s.mul(ae, I), k = s.add(k, S), S = s.sub(ie, S), S = s.mul(ue, S), I = s.add(I, S), ie = s.mul(k, I), j = s.add(j, ie), ie = s.mul(D, I), O = s.mul(A, O), O = s.sub(O, ie), ie = s.mul(A, k), z = s.mul(D, z), z = s.add(z, ie), new Y(O, j, z);
|
|
4557
4557
|
}
|
|
4558
4558
|
subtract(v) {
|
|
4559
4559
|
return J(v), this.add(v.negate());
|
|
4560
4560
|
}
|
|
4561
4561
|
is0() {
|
|
4562
|
-
return this.equals(
|
|
4562
|
+
return this.equals(Y.ZERO);
|
|
4563
4563
|
}
|
|
4564
4564
|
/**
|
|
4565
4565
|
* Constant time multiplication.
|
|
@@ -4575,15 +4575,15 @@ function w1(t, e = {}) {
|
|
|
4575
4575
|
if (!i.isValidNot0(v))
|
|
4576
4576
|
throw new RangeError("invalid scalar: out of range");
|
|
4577
4577
|
let X, U;
|
|
4578
|
-
const R = (
|
|
4578
|
+
const R = (M) => _.cached(this, M, (F) => xi(Y, F));
|
|
4579
4579
|
if ($) {
|
|
4580
|
-
const { k1neg:
|
|
4581
|
-
U = ue.add(ie), X = se($.beta,
|
|
4580
|
+
const { k1neg: M, k1: F, k2neg: O, k2: j } = oe(v), { p: z, f: ue } = R(F), { p: ae, f: ie } = R(j);
|
|
4581
|
+
U = ue.add(ie), X = se($.beta, z, ae, M, O);
|
|
4582
4582
|
} else {
|
|
4583
|
-
const { p:
|
|
4584
|
-
X =
|
|
4583
|
+
const { p: M, f: F } = R(v);
|
|
4584
|
+
X = M, U = F;
|
|
4585
4585
|
}
|
|
4586
|
-
return xi(
|
|
4586
|
+
return xi(Y, [X, U])[0];
|
|
4587
4587
|
}
|
|
4588
4588
|
/**
|
|
4589
4589
|
* Non-constant-time multiplication. Uses double-and-add algorithm.
|
|
@@ -4595,14 +4595,14 @@ function w1(t, e = {}) {
|
|
|
4595
4595
|
if (!i.isValid(U))
|
|
4596
4596
|
throw new RangeError("invalid scalar: out of range");
|
|
4597
4597
|
if (U === Je || X.is0())
|
|
4598
|
-
return
|
|
4598
|
+
return Y.ZERO;
|
|
4599
4599
|
if (U === ht)
|
|
4600
4600
|
return X;
|
|
4601
4601
|
if (_.hasCache(this))
|
|
4602
4602
|
return this.multiply(U);
|
|
4603
4603
|
if ($) {
|
|
4604
|
-
const { k1neg: R, k1:
|
|
4605
|
-
return se($.beta, j,
|
|
4604
|
+
const { k1neg: R, k1: M, k2neg: F, k2: O } = oe(U), { p1: j, p2: z } = p1(Y, X, M, O);
|
|
4605
|
+
return se($.beta, j, z, R, F);
|
|
4606
4606
|
} else
|
|
4607
4607
|
return _.unsafe(X, U);
|
|
4608
4608
|
}
|
|
@@ -4614,17 +4614,17 @@ function w1(t, e = {}) {
|
|
|
4614
4614
|
toAffine(v) {
|
|
4615
4615
|
const $ = this;
|
|
4616
4616
|
let X = v;
|
|
4617
|
-
const { X: U, Y: R, Z:
|
|
4618
|
-
if (s.eql(
|
|
4617
|
+
const { X: U, Y: R, Z: M } = $;
|
|
4618
|
+
if (s.eql(M, s.ONE))
|
|
4619
4619
|
return { x: U, y: R };
|
|
4620
4620
|
const F = $.is0();
|
|
4621
|
-
X == null && (X = F ? s.ONE : s.inv(
|
|
4622
|
-
const
|
|
4621
|
+
X == null && (X = F ? s.ONE : s.inv(M));
|
|
4622
|
+
const O = s.mul(U, X), j = s.mul(R, X), z = s.mul(M, X);
|
|
4623
4623
|
if (F)
|
|
4624
4624
|
return { x: s.ZERO, y: s.ZERO };
|
|
4625
|
-
if (!s.eql(
|
|
4625
|
+
if (!s.eql(z, s.ONE))
|
|
4626
4626
|
throw new Error("invZ was invalid");
|
|
4627
|
-
return { x:
|
|
4627
|
+
return { x: O, y: j };
|
|
4628
4628
|
}
|
|
4629
4629
|
/**
|
|
4630
4630
|
* Checks whether Point is free of torsion elements (is in prime subgroup).
|
|
@@ -4632,17 +4632,17 @@ function w1(t, e = {}) {
|
|
|
4632
4632
|
*/
|
|
4633
4633
|
isTorsionFree() {
|
|
4634
4634
|
const { isTorsionFree: v } = e;
|
|
4635
|
-
return c === ht ? !0 : v ? v(
|
|
4635
|
+
return c === ht ? !0 : v ? v(Y, this) : _.unsafe(this, u).is0();
|
|
4636
4636
|
}
|
|
4637
4637
|
clearCofactor() {
|
|
4638
4638
|
const { clearCofactor: v } = e;
|
|
4639
|
-
return c === ht ? this : v ? v(
|
|
4639
|
+
return c === ht ? this : v ? v(Y, this) : this.multiplyUnsafe(c);
|
|
4640
4640
|
}
|
|
4641
4641
|
isSmallOrder() {
|
|
4642
4642
|
return c === ht ? this.is0() : this.clearCofactor().is0();
|
|
4643
4643
|
}
|
|
4644
4644
|
toBytes(v = !0) {
|
|
4645
|
-
return Qt(v, "isCompressed"), this.assertValidity(), L(
|
|
4645
|
+
return Qt(v, "isCompressed"), this.assertValidity(), L(Y, this, v);
|
|
4646
4646
|
}
|
|
4647
4647
|
toHex(v = !0) {
|
|
4648
4648
|
return yo(this.toBytes(v));
|
|
@@ -4651,8 +4651,8 @@ function w1(t, e = {}) {
|
|
|
4651
4651
|
return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
|
|
4652
4652
|
}
|
|
4653
4653
|
}
|
|
4654
|
-
const
|
|
4655
|
-
return
|
|
4654
|
+
const de = i.BITS, _ = new m1(Y, e.endo ? Math.ceil(de / 2) : de);
|
|
4655
|
+
return de >= 8 && Y.BASE.precompute(8), Object.freeze(Y.prototype), Object.freeze(Y), Y;
|
|
4656
4656
|
}
|
|
4657
4657
|
function $o(t) {
|
|
4658
4658
|
return Uint8Array.of(t ? 2 : 3);
|
|
@@ -4681,10 +4681,10 @@ function x1(t, e = {}) {
|
|
|
4681
4681
|
}
|
|
4682
4682
|
}
|
|
4683
4683
|
function c(T, L) {
|
|
4684
|
-
const { publicKey:
|
|
4684
|
+
const { publicKey: N, publicKeyUncompressed: q } = i;
|
|
4685
4685
|
try {
|
|
4686
|
-
const
|
|
4687
|
-
return L === !0 &&
|
|
4686
|
+
const K = T.length;
|
|
4687
|
+
return L === !0 && K !== N || L === !1 && K !== q ? !1 : !!t.fromBytes(T);
|
|
4688
4688
|
} catch {
|
|
4689
4689
|
return !1;
|
|
4690
4690
|
}
|
|
@@ -4696,20 +4696,20 @@ function x1(t, e = {}) {
|
|
|
4696
4696
|
return t.BASE.multiply(n.fromBytes(T)).toBytes(L);
|
|
4697
4697
|
}
|
|
4698
4698
|
function f(T) {
|
|
4699
|
-
const { secretKey: L, publicKey:
|
|
4699
|
+
const { secretKey: L, publicKey: N, publicKeyUncompressed: q } = i, K = n._lengths;
|
|
4700
4700
|
if (!ko(T))
|
|
4701
4701
|
return;
|
|
4702
|
-
const C = Ce(T, void 0, "key").length, H = C ===
|
|
4703
|
-
if (!(H &&
|
|
4702
|
+
const C = Ce(T, void 0, "key").length, H = C === N || C === q, B = C === L || !!K?.includes(C);
|
|
4703
|
+
if (!(H && B))
|
|
4704
4704
|
return H;
|
|
4705
4705
|
}
|
|
4706
|
-
function m(T, L,
|
|
4706
|
+
function m(T, L, N = !0) {
|
|
4707
4707
|
if (f(T) === !0)
|
|
4708
4708
|
throw new Error("first arg must be private key");
|
|
4709
4709
|
if (f(L) === !1)
|
|
4710
4710
|
throw new Error("second arg must be public key");
|
|
4711
4711
|
const q = n.fromBytes(T);
|
|
4712
|
-
return t.fromBytes(L).multiply(q).toBytes(
|
|
4712
|
+
return t.fromBytes(L).multiply(q).toBytes(N);
|
|
4713
4713
|
}
|
|
4714
4714
|
const g = {
|
|
4715
4715
|
isValidSecretKey: o,
|
|
@@ -4727,13 +4727,13 @@ function E1(t, e, n = {}) {
|
|
|
4727
4727
|
bits2int: "function",
|
|
4728
4728
|
bits2int_modN: "function"
|
|
4729
4729
|
}), n = Object.assign({}, n);
|
|
4730
|
-
const i = n.randomBytes === void 0 ? vo : n.randomBytes, o = n.hmac === void 0 ? (U, R) => _1(s, U, R) : n.hmac, { Fp: c, Fn: u } = t, { ORDER: h, BITS: f } = u, { keygen: m, getPublicKey: g, getSharedSecret: x, utils: T, lengths: L } = x1(t, n),
|
|
4730
|
+
const i = n.randomBytes === void 0 ? vo : n.randomBytes, o = n.hmac === void 0 ? (U, R) => _1(s, U, R) : n.hmac, { Fp: c, Fn: u } = t, { ORDER: h, BITS: f } = u, { keygen: m, getPublicKey: g, getSharedSecret: x, utils: T, lengths: L } = x1(t, n), N = {
|
|
4731
4731
|
prehash: !0,
|
|
4732
4732
|
lowS: typeof n.lowS == "boolean" ? n.lowS : !0,
|
|
4733
4733
|
format: "compact",
|
|
4734
4734
|
extraEntropy: !1
|
|
4735
4735
|
}, q = h * Oo + ht < c.ORDER;
|
|
4736
|
-
function
|
|
4736
|
+
function K(U) {
|
|
4737
4737
|
const R = h >> ht;
|
|
4738
4738
|
return U > R;
|
|
4739
4739
|
}
|
|
@@ -4746,36 +4746,36 @@ function E1(t, e, n = {}) {
|
|
|
4746
4746
|
if (q)
|
|
4747
4747
|
throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
|
|
4748
4748
|
}
|
|
4749
|
-
function
|
|
4749
|
+
function B(U, R) {
|
|
4750
4750
|
hr(R);
|
|
4751
|
-
const
|
|
4751
|
+
const M = L.signature, F = R === "compact" ? M : R === "recovered" ? M + 1 : void 0;
|
|
4752
4752
|
return Ce(U, F);
|
|
4753
4753
|
}
|
|
4754
4754
|
class J {
|
|
4755
4755
|
r;
|
|
4756
4756
|
s;
|
|
4757
4757
|
recovery;
|
|
4758
|
-
constructor(R,
|
|
4759
|
-
if (this.r = C("r", R), this.s = C("s",
|
|
4758
|
+
constructor(R, M, F) {
|
|
4759
|
+
if (this.r = C("r", R), this.s = C("s", M), F != null) {
|
|
4760
4760
|
if (H(), ![0, 1, 2, 3].includes(F))
|
|
4761
4761
|
throw new Error("invalid recovery id");
|
|
4762
4762
|
this.recovery = F;
|
|
4763
4763
|
}
|
|
4764
4764
|
Object.freeze(this);
|
|
4765
4765
|
}
|
|
4766
|
-
static fromBytes(R,
|
|
4767
|
-
|
|
4766
|
+
static fromBytes(R, M = N.format) {
|
|
4767
|
+
B(R, M);
|
|
4768
4768
|
let F;
|
|
4769
|
-
if (
|
|
4769
|
+
if (M === "der") {
|
|
4770
4770
|
const { r: ue, s: ae } = He.toSig(Ce(R));
|
|
4771
4771
|
return new J(ue, ae);
|
|
4772
4772
|
}
|
|
4773
|
-
|
|
4774
|
-
const
|
|
4775
|
-
return new J(u.fromBytes(j), u.fromBytes(
|
|
4773
|
+
M === "recovered" && (F = R[0], M = "compact", R = R.subarray(1));
|
|
4774
|
+
const O = L.signature / 2, j = R.subarray(0, O), z = R.subarray(O, O * 2);
|
|
4775
|
+
return new J(u.fromBytes(j), u.fromBytes(z), F);
|
|
4776
4776
|
}
|
|
4777
|
-
static fromHex(R,
|
|
4778
|
-
return this.fromBytes(ur(R),
|
|
4777
|
+
static fromHex(R, M) {
|
|
4778
|
+
return this.fromBytes(ur(R), M);
|
|
4779
4779
|
}
|
|
4780
4780
|
assertRecovery() {
|
|
4781
4781
|
const { recovery: R } = this;
|
|
@@ -4789,23 +4789,23 @@ function E1(t, e, n = {}) {
|
|
|
4789
4789
|
// Unlike the top-level helper below, this method expects a digest that has
|
|
4790
4790
|
// already been hashed to the curve's message representative.
|
|
4791
4791
|
recoverPublicKey(R) {
|
|
4792
|
-
const { r:
|
|
4792
|
+
const { r: M, s: F } = this, O = this.assertRecovery(), j = O === 2 || O === 3 ? M + h : M;
|
|
4793
4793
|
if (!c.isValid(j))
|
|
4794
4794
|
throw new Error("invalid recovery id: sig.r+curve.n != R.x");
|
|
4795
|
-
const
|
|
4795
|
+
const z = c.toBytes(j), ue = t.fromBytes(ft($o((O & 1) === 0), z)), ae = u.inv(j), ie = se(Ce(R, void 0, "msgHash")), k = u.create(-ie * ae), S = u.create(F * ae), A = t.BASE.multiplyUnsafe(k).add(ue.multiplyUnsafe(S));
|
|
4796
4796
|
if (A.is0())
|
|
4797
4797
|
throw new Error("invalid recovery: point at infinify");
|
|
4798
4798
|
return A.assertValidity(), A;
|
|
4799
4799
|
}
|
|
4800
4800
|
// Signatures should be low-s, to prevent malleability.
|
|
4801
4801
|
hasHighS() {
|
|
4802
|
-
return
|
|
4802
|
+
return K(this.s);
|
|
4803
4803
|
}
|
|
4804
|
-
toBytes(R =
|
|
4804
|
+
toBytes(R = N.format) {
|
|
4805
4805
|
if (hr(R), R === "der")
|
|
4806
4806
|
return ur(He.hexFromSig(this));
|
|
4807
|
-
const { r:
|
|
4808
|
-
return R === "recovered" ? (H(), ft(Uint8Array.of(this.assertRecovery()),
|
|
4807
|
+
const { r: M, s: F } = this, O = u.toBytes(M), j = u.toBytes(F);
|
|
4808
|
+
return R === "recovered" ? (H(), ft(Uint8Array.of(this.assertRecovery()), O, j)) : ft(O, j);
|
|
4809
4809
|
}
|
|
4810
4810
|
toHex(R) {
|
|
4811
4811
|
return yo(this.toBytes(R));
|
|
@@ -4815,29 +4815,29 @@ function E1(t, e, n = {}) {
|
|
|
4815
4815
|
const oe = n.bits2int === void 0 ? function(R) {
|
|
4816
4816
|
if (R.length > 8192)
|
|
4817
4817
|
throw new Error("input is too large");
|
|
4818
|
-
const
|
|
4819
|
-
return F > 0 ?
|
|
4818
|
+
const M = Vn(R), F = R.length * 8 - f;
|
|
4819
|
+
return F > 0 ? M >> BigInt(F) : M;
|
|
4820
4820
|
} : n.bits2int, se = n.bits2int_modN === void 0 ? function(R) {
|
|
4821
4821
|
return u.create(oe(R));
|
|
4822
|
-
} : n.bits2int_modN,
|
|
4823
|
-
function
|
|
4824
|
-
return So("num < 2^" + f, U, Je,
|
|
4822
|
+
} : n.bits2int_modN, Y = Rr(f);
|
|
4823
|
+
function de(U) {
|
|
4824
|
+
return So("num < 2^" + f, U, Je, Y), u.toBytes(U);
|
|
4825
4825
|
}
|
|
4826
4826
|
function _(U, R) {
|
|
4827
4827
|
return Ce(U, void 0, "message"), R ? Ce(s(U), void 0, "prehashed message") : U;
|
|
4828
4828
|
}
|
|
4829
|
-
function b(U, R,
|
|
4830
|
-
const { lowS: F, prehash:
|
|
4831
|
-
U = _(U,
|
|
4832
|
-
const
|
|
4829
|
+
function b(U, R, M) {
|
|
4830
|
+
const { lowS: F, prehash: O, extraEntropy: j } = Js(M, N);
|
|
4831
|
+
U = _(U, O);
|
|
4832
|
+
const z = se(U), ue = u.fromBytes(R);
|
|
4833
4833
|
if (!u.isValidNot0(ue))
|
|
4834
4834
|
throw new Error("invalid private key");
|
|
4835
|
-
const ae = [
|
|
4835
|
+
const ae = [de(ue), de(z)];
|
|
4836
4836
|
if (j != null && j !== !1) {
|
|
4837
4837
|
const A = j === !0 ? i(L.secretKey) : j;
|
|
4838
4838
|
ae.push(Ce(A, void 0, "extraEntropy"));
|
|
4839
4839
|
}
|
|
4840
|
-
const ie = ft(...ae), k =
|
|
4840
|
+
const ie = ft(...ae), k = z;
|
|
4841
4841
|
function S(A) {
|
|
4842
4842
|
const I = oe(A);
|
|
4843
4843
|
if (!u.isValidNot0(I))
|
|
@@ -4849,24 +4849,24 @@ function E1(t, e, n = {}) {
|
|
|
4849
4849
|
if (ce === Je)
|
|
4850
4850
|
return;
|
|
4851
4851
|
let ge = (W.x === Z ? 0 : 2) | Number(W.y & ht), me = ce;
|
|
4852
|
-
return F &&
|
|
4852
|
+
return F && K(ce) && (me = u.neg(ce), ge ^= 1), new J(Z, me, q ? void 0 : ge);
|
|
4853
4853
|
}
|
|
4854
4854
|
return { seed: ie, k2sig: S };
|
|
4855
4855
|
}
|
|
4856
|
-
function v(U, R,
|
|
4857
|
-
const { seed: F, k2sig:
|
|
4858
|
-
return s1(s.outputLen, u.BYTES, o)(F,
|
|
4856
|
+
function v(U, R, M = {}) {
|
|
4857
|
+
const { seed: F, k2sig: O } = b(U, R, M);
|
|
4858
|
+
return s1(s.outputLen, u.BYTES, o)(F, O).toBytes(M.format);
|
|
4859
4859
|
}
|
|
4860
|
-
function $(U, R,
|
|
4861
|
-
const { lowS:
|
|
4862
|
-
if (
|
|
4860
|
+
function $(U, R, M, F = {}) {
|
|
4861
|
+
const { lowS: O, prehash: j, format: z } = Js(F, N);
|
|
4862
|
+
if (M = Ce(M, void 0, "publicKey"), R = _(R, j), !ko(U)) {
|
|
4863
4863
|
const ue = U instanceof J ? ", use sig.toBytes()" : "";
|
|
4864
4864
|
throw new Error("verify expects Uint8Array signature" + ue);
|
|
4865
4865
|
}
|
|
4866
|
-
|
|
4866
|
+
B(U, z);
|
|
4867
4867
|
try {
|
|
4868
|
-
const ue = J.fromBytes(U,
|
|
4869
|
-
if (
|
|
4868
|
+
const ue = J.fromBytes(U, z), ae = t.fromBytes(M);
|
|
4869
|
+
if (O && ue.hasHighS())
|
|
4870
4870
|
return !1;
|
|
4871
4871
|
const { r: ie, s: k } = ue, S = se(R), A = u.inv(k), I = u.create(S * A), D = u.create(ie * A), W = t.BASE.multiplyUnsafe(I).add(ae.multiplyUnsafe(D));
|
|
4872
4872
|
return W.is0() ? !1 : u.create(W.x) === ie;
|
|
@@ -4874,8 +4874,8 @@ function E1(t, e, n = {}) {
|
|
|
4874
4874
|
return !1;
|
|
4875
4875
|
}
|
|
4876
4876
|
}
|
|
4877
|
-
function X(U, R,
|
|
4878
|
-
const { prehash: F } = Js(
|
|
4877
|
+
function X(U, R, M = {}) {
|
|
4878
|
+
const { prehash: F } = Js(M, N);
|
|
4879
4879
|
return R = _(R, F), J.fromBytes(U, "recovered").recoverPublicKey(R).toBytes();
|
|
4880
4880
|
}
|
|
4881
4881
|
return Object.freeze({
|
|
@@ -5109,11 +5109,11 @@ function q1(t, e, n) {
|
|
|
5109
5109
|
if (j1(t), !Ue || !Kt) return;
|
|
5110
5110
|
const s = n.vertical ? qo : Vo;
|
|
5111
5111
|
if (!s) return;
|
|
5112
|
-
const i = e.width, o = e.height, c = n.px, u = n.py, h = n.w, f = n.h, m = c / i * 2 - 1, g = 1 - (u + f) / o * 2, x = (c + h) / i * 2 - 1, T = 1 - u / o * 2, L = !!(lt && Pn),
|
|
5112
|
+
const i = e.width, o = e.height, c = n.px, u = n.py, h = n.w, f = n.h, m = c / i * 2 - 1, g = 1 - (u + f) / o * 2, x = (c + h) / i * 2 - 1, T = 1 - u / o * 2, L = !!(lt && Pn), N = t.getParameter(t.CURRENT_PROGRAM), q = t.getParameter(t.ACTIVE_TEXTURE);
|
|
5113
5113
|
t.activeTexture(t.TEXTURE0);
|
|
5114
|
-
const
|
|
5114
|
+
const K = t.getParameter(t.TEXTURE_BINDING_2D), C = t.getParameter(t.ARRAY_BUFFER_BINDING), H = t.getParameter(t.FRAMEBUFFER_BINDING), B = t.getParameter(t.VIEWPORT), J = t.isEnabled(t.BLEND), oe = t.getParameter(t.BLEND_SRC_RGB), se = t.getParameter(t.BLEND_DST_RGB), Y = t.getParameter(t.BLEND_SRC_ALPHA), de = t.getParameter(t.BLEND_DST_ALPHA), _ = t.getParameter(t.BLEND_EQUATION_RGB), b = t.getParameter(t.BLEND_EQUATION_ALPHA), v = t.isEnabled(t.DEPTH_TEST), $ = t.isEnabled(t.SCISSOR_TEST), X = t.isEnabled(t.STENCIL_TEST), U = t.isEnabled(t.CULL_FACE), R = t.getParameter(t.COLOR_WRITEMASK), M = t.getParameter(t.UNPACK_FLIP_Y_WEBGL), F = L ? t.getParameter(Xo) : null, O = !L && it >= 0 ? Ni(t, it) : null, j = !L && ot >= 0 ? Ni(t, ot) : null;
|
|
5115
5115
|
t.bindFramebuffer(t.FRAMEBUFFER, null), t.viewport(0, 0, i, o), t.useProgram(Ue), t.enable(t.BLEND), t.blendEquation(t.FUNC_ADD), t.blendFunc(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA), t.disable(t.DEPTH_TEST), t.disable(t.SCISSOR_TEST), t.disable(t.STENCIL_TEST), t.disable(t.CULL_FACE), t.colorMask(!0, !0, !0, !0), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, 0), t.bindTexture(t.TEXTURE_2D, s), t.uniform1i(t.getUniformLocation(Ue, "u_tex"), 0), t.uniform1f(t.getUniformLocation(Ue, "u_alpha"), 1);
|
|
5116
|
-
const
|
|
5116
|
+
const z = new Float32Array([
|
|
5117
5117
|
m,
|
|
5118
5118
|
g,
|
|
5119
5119
|
0,
|
|
@@ -5139,7 +5139,7 @@ function q1(t, e, n) {
|
|
|
5139
5139
|
1,
|
|
5140
5140
|
1
|
|
5141
5141
|
]);
|
|
5142
|
-
L ? (lt.bind(Pn), t.bindBuffer(t.ARRAY_BUFFER, Kt), t.bufferData(t.ARRAY_BUFFER,
|
|
5142
|
+
L ? (lt.bind(Pn), t.bindBuffer(t.ARRAY_BUFFER, Kt), t.bufferData(t.ARRAY_BUFFER, z, t.DYNAMIC_DRAW)) : (t.bindBuffer(t.ARRAY_BUFFER, Kt), t.bufferData(t.ARRAY_BUFFER, z, t.DYNAMIC_DRAW), it >= 0 && (t.enableVertexAttribArray(it), t.vertexAttribPointer(it, 2, t.FLOAT, !1, 16, 0)), ot >= 0 && (t.enableVertexAttribArray(ot), t.vertexAttribPointer(ot, 2, t.FLOAT, !1, 16, 8))), t.drawArrays(t.TRIANGLES, 0, 6), L ? lt.bind(F) : (j && Mi(t, j), O && Mi(t, O)), t.bindFramebuffer(t.FRAMEBUFFER, H), t.viewport(B[0], B[1], B[2], B[3]), t.bindBuffer(t.ARRAY_BUFFER, C), t.colorMask(R[0], R[1], R[2], R[3]), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, M ? 1 : 0), $ ? t.enable(t.SCISSOR_TEST) : t.disable(t.SCISSOR_TEST), X ? t.enable(t.STENCIL_TEST) : t.disable(t.STENCIL_TEST), U ? t.enable(t.CULL_FACE) : t.disable(t.CULL_FACE), v ? t.enable(t.DEPTH_TEST) : t.disable(t.DEPTH_TEST), J ? t.enable(t.BLEND) : t.disable(t.BLEND), t.blendFuncSeparate(oe, se, Y, de), t.blendEquationSeparate(_, b), t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, K), t.activeTexture(q), t.useProgram(N);
|
|
5143
5143
|
}
|
|
5144
5144
|
class H1 {
|
|
5145
5145
|
canvas = null;
|
|
@@ -5237,8 +5237,8 @@ class H1 {
|
|
|
5237
5237
|
videoSystems = [];
|
|
5238
5238
|
// Auto-capture for frame sources
|
|
5239
5239
|
autoCaptureEnabled = !1;
|
|
5240
|
-
|
|
5241
|
-
|
|
5240
|
+
// Default: flip for WebGL compatibility; plate = pre-overlay frame (VJ/thumbnail role)
|
|
5241
|
+
autoCaptureFormat = { flipY: !0, frame: "plate" };
|
|
5242
5242
|
// Audio raw data buffers (referenced by closures in viji.audio)
|
|
5243
5243
|
audioFrequencyData = new Uint8Array(0);
|
|
5244
5244
|
audioWaveformData = new Float32Array(0);
|
|
@@ -5744,7 +5744,7 @@ class H1 {
|
|
|
5744
5744
|
this.handleVideoFrameDirect(e);
|
|
5745
5745
|
break;
|
|
5746
5746
|
case "enable-auto-capture":
|
|
5747
|
-
this.autoCaptureEnabled = e.data.enabled, e.data.flipY !== void 0
|
|
5747
|
+
this.autoCaptureEnabled = e.data.enabled, e.data.flipY !== void 0 && (this.autoCaptureFormat.flipY = e.data.flipY), e.data.frame !== void 0 && (this.autoCaptureFormat.frame = e.data.frame === "display" ? "display" : "plate"), this.debugLog(`[AutoCapture] ${e.data.enabled ? "ENABLED" : "DISABLED"} (flipY=${this.autoCaptureFormat.flipY}, frame=${this.autoCaptureFormat.frame})`);
|
|
5748
5748
|
break;
|
|
5749
5749
|
case "enable-capability-reporting":
|
|
5750
5750
|
this.capabilityMonitor.setEnabled(e.data.enabled);
|
|
@@ -6086,29 +6086,31 @@ class H1 {
|
|
|
6086
6086
|
let m = 0, g = 0, x = i, T = o;
|
|
6087
6087
|
Math.abs(h - f) > 1e-6 && (f > h ? (T = Math.floor(i / f), g = Math.floor((o - T) / 2)) : (x = Math.floor(o * f), m = Math.floor((i - x) / 2)));
|
|
6088
6088
|
let L;
|
|
6089
|
-
const
|
|
6090
|
-
if (
|
|
6091
|
-
const J =
|
|
6092
|
-
|
|
6093
|
-
const
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6089
|
+
const N = this.getContextAndFinish();
|
|
6090
|
+
if (N) {
|
|
6091
|
+
const J = e.data.frame === "display", oe = J ? N.getParameter(N.FRAMEBUFFER_BINDING) : null;
|
|
6092
|
+
J && N.bindFramebuffer(N.FRAMEBUFFER, null);
|
|
6093
|
+
const se = new Uint8Array(i * o * 4);
|
|
6094
|
+
N.readPixels(0, 0, i, o, N.RGBA, N.UNSIGNED_BYTE, se), J && N.bindFramebuffer(N.FRAMEBUFFER, oe);
|
|
6095
|
+
const Y = new Uint8ClampedArray(i * o * 4);
|
|
6096
|
+
for (let b = 0; b < o; b++) {
|
|
6097
|
+
const v = (o - 1 - b) * i * 4, $ = b * i * 4;
|
|
6098
|
+
Y.set(se.subarray(v, v + i * 4), $);
|
|
6097
6099
|
}
|
|
6098
6100
|
L = new OffscreenCanvas(i, o);
|
|
6099
|
-
const
|
|
6100
|
-
if (!
|
|
6101
|
-
const
|
|
6102
|
-
|
|
6101
|
+
const de = L.getContext("2d");
|
|
6102
|
+
if (!de) throw new Error("Failed to create source context");
|
|
6103
|
+
const _ = new ImageData(Y, i, o);
|
|
6104
|
+
de.putImageData(_, 0, 0), this.debugLog("Captured frame from WebGL using readPixels (post-render)");
|
|
6103
6105
|
} else
|
|
6104
6106
|
L = this.canvas, this.debugLog("Captured frame from 2D canvas (post-render)");
|
|
6105
|
-
const q = new OffscreenCanvas(c, u),
|
|
6106
|
-
if (!
|
|
6107
|
-
|
|
6108
|
-
const C = e.data.quality, H = typeof C == "number" && Number.isFinite(C) ? Math.min(1, Math.max(0, C)) : void 0,
|
|
6107
|
+
const q = new OffscreenCanvas(c, u), K = q.getContext("2d");
|
|
6108
|
+
if (!K) throw new Error("Failed to get 2D context");
|
|
6109
|
+
K.drawImage(L, m, g, x, T, 0, 0, c, u);
|
|
6110
|
+
const C = e.data.quality, H = typeof C == "number" && Number.isFinite(C) ? Math.min(1, Math.max(0, C)) : void 0, B = await q.convertToBlob(
|
|
6109
6111
|
H !== void 0 ? { type: s, quality: H } : { type: s }
|
|
6110
6112
|
);
|
|
6111
|
-
this.postMessage("capture-frame-result", { id: e.id, blob:
|
|
6113
|
+
this.postMessage("capture-frame-result", { id: e.id, blob: B });
|
|
6112
6114
|
} catch (n) {
|
|
6113
6115
|
this.postMessage("error", {
|
|
6114
6116
|
id: e.id,
|
|
@@ -6123,6 +6125,41 @@ class H1 {
|
|
|
6123
6125
|
startRenderLoop() {
|
|
6124
6126
|
this.isRunning = !0, this.startTime = performance.now(), this.lastTime = this.startTime, this.renderFrame();
|
|
6125
6127
|
}
|
|
6128
|
+
/**
|
|
6129
|
+
* Execute a batch of drained capture requests (fire-and-forget; each
|
|
6130
|
+
* capture snapshots its pixels synchronously before its first await).
|
|
6131
|
+
*/
|
|
6132
|
+
runCaptures(e) {
|
|
6133
|
+
for (const n of e)
|
|
6134
|
+
this.executeCaptureFrame(n).catch((s) => {
|
|
6135
|
+
console.error("Capture execution error:", s);
|
|
6136
|
+
});
|
|
6137
|
+
}
|
|
6138
|
+
/**
|
|
6139
|
+
* Auto-capture for frame sources. Called from exactly one frame-tail slot
|
|
6140
|
+
* per frame, chosen by `autoCaptureFormat.frame` (plate = pre-overlay,
|
|
6141
|
+
* display = post-overlay).
|
|
6142
|
+
*/
|
|
6143
|
+
runAutoCapture() {
|
|
6144
|
+
if (!(!this.autoCaptureEnabled || !this.canvas))
|
|
6145
|
+
try {
|
|
6146
|
+
if (this.gl ?? this.ctx) {
|
|
6147
|
+
const n = this.autoCaptureFormat.flipY ? { imageOrientation: "flipY" } : {};
|
|
6148
|
+
createImageBitmap(this.canvas, n).then((s) => {
|
|
6149
|
+
this.postMessage(
|
|
6150
|
+
"auto-capture-result",
|
|
6151
|
+
{ bitmap: s, timestamp: performance.now() },
|
|
6152
|
+
[s]
|
|
6153
|
+
);
|
|
6154
|
+
}).catch((s) => {
|
|
6155
|
+
console.warn("[AutoCapture] ImageBitmap creation failed:", s);
|
|
6156
|
+
});
|
|
6157
|
+
} else
|
|
6158
|
+
this.debugMode && this.frameCount % 60 === 0 && this.debugLog("[AutoCapture] No context yet, skipping capture");
|
|
6159
|
+
} catch (e) {
|
|
6160
|
+
console.warn("[AutoCapture] Failed:", e);
|
|
6161
|
+
}
|
|
6162
|
+
}
|
|
6126
6163
|
renderFrame() {
|
|
6127
6164
|
if (!this.isRunning) return;
|
|
6128
6165
|
const e = performance.now();
|
|
@@ -6137,65 +6174,44 @@ class H1 {
|
|
|
6137
6174
|
let c = !1;
|
|
6138
6175
|
try {
|
|
6139
6176
|
if (this.shaderAdapter && this.rendererType === "shader") {
|
|
6140
|
-
const
|
|
6141
|
-
this.shaderAdapter.render(this.viji,
|
|
6177
|
+
const m = this.parameterSystem.getAllParameterObjects();
|
|
6178
|
+
this.shaderAdapter.render(this.viji, m);
|
|
6142
6179
|
} else if (this.p5Adapter && this.rendererType === "p5") {
|
|
6143
|
-
const
|
|
6144
|
-
this.p5Adapter.tick(this.viji,
|
|
6180
|
+
const m = this.parameterSystem.getAllParameterObjects();
|
|
6181
|
+
this.p5Adapter.tick(this.viji, m);
|
|
6145
6182
|
} else {
|
|
6146
|
-
const
|
|
6147
|
-
|
|
6183
|
+
const m = self.renderFunction;
|
|
6184
|
+
m && typeof m == "function" && m(this.viji);
|
|
6148
6185
|
}
|
|
6149
6186
|
c = !0;
|
|
6150
|
-
} catch (
|
|
6151
|
-
const
|
|
6152
|
-
console.error("Render error:",
|
|
6153
|
-
message:
|
|
6154
|
-
...
|
|
6187
|
+
} catch (m) {
|
|
6188
|
+
const g = m;
|
|
6189
|
+
console.error("Render error:", g), this.sceneErrorReporter ? this.sceneErrorReporter.reportSceneError({
|
|
6190
|
+
message: g.message,
|
|
6191
|
+
...g.stack !== void 0 && { stack: g.stack },
|
|
6155
6192
|
code: "RENDER_ERROR"
|
|
6156
6193
|
}) : this.postMessage("error", {
|
|
6157
|
-
message:
|
|
6194
|
+
message: g.message,
|
|
6158
6195
|
code: "RENDER_ERROR",
|
|
6159
|
-
stack:
|
|
6196
|
+
stack: g.stack
|
|
6160
6197
|
});
|
|
6161
6198
|
}
|
|
6162
6199
|
if (c && this.sceneErrorReporter && this.sceneErrorReporter.markFirstFrameProduced(), this.benchmark) {
|
|
6163
|
-
const
|
|
6164
|
-
this.recordBenchmarkFrame(e,
|
|
6200
|
+
const m = performance.now() - o;
|
|
6201
|
+
this.recordBenchmarkFrame(e, m);
|
|
6165
6202
|
} else if (this.capabilityMonitor.isEnabled()) {
|
|
6166
|
-
const
|
|
6167
|
-
this.recordCapabilityFrame(e,
|
|
6203
|
+
const m = performance.now() - o;
|
|
6204
|
+
this.recordCapabilityFrame(e, m, i);
|
|
6168
6205
|
}
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
}
|
|
6177
|
-
if (this.autoCaptureEnabled && this.canvas)
|
|
6178
|
-
try {
|
|
6179
|
-
if (this.gl ?? this.ctx) {
|
|
6180
|
-
const h = this.autoCaptureFormat.flipY ? { imageOrientation: "flipY" } : {};
|
|
6181
|
-
createImageBitmap(this.canvas, h).then((f) => {
|
|
6182
|
-
this.postMessage(
|
|
6183
|
-
"auto-capture-result",
|
|
6184
|
-
{ bitmap: f, timestamp: performance.now() },
|
|
6185
|
-
[f]
|
|
6186
|
-
);
|
|
6187
|
-
}).catch((f) => {
|
|
6188
|
-
console.warn("[AutoCapture] ImageBitmap creation failed:", f);
|
|
6189
|
-
});
|
|
6190
|
-
} else
|
|
6191
|
-
this.debugMode && this.frameCount % 60 === 0 && this.debugLog("[AutoCapture] No context yet, skipping capture");
|
|
6192
|
-
} catch (u) {
|
|
6193
|
-
console.warn("[AutoCapture] Failed:", u);
|
|
6194
|
-
}
|
|
6195
|
-
if (!this._isHeadless && this.canvas) {
|
|
6196
|
-
const u = C1("b", 0);
|
|
6197
|
-
O1(this.canvas, this.ctx, this.gl, u, this._displayScale);
|
|
6206
|
+
this.parameterSystem.resetButtonParameters();
|
|
6207
|
+
const u = this.pendingCaptures;
|
|
6208
|
+
this.pendingCaptures = [];
|
|
6209
|
+
const h = u.filter((m) => m.data.frame === "display"), f = u.filter((m) => m.data.frame !== "display");
|
|
6210
|
+
if (this.runCaptures(f), this.autoCaptureFormat.frame !== "display" && this.runAutoCapture(), !this._isHeadless && this.canvas) {
|
|
6211
|
+
const m = C1("b", 0);
|
|
6212
|
+
O1(this.canvas, this.ctx, this.gl, m, this._displayScale);
|
|
6198
6213
|
}
|
|
6214
|
+
this.runCaptures(h), this.autoCaptureFormat.frame === "display" && this.runAutoCapture();
|
|
6199
6215
|
}
|
|
6200
6216
|
this.benchmark || this.reportPerformanceStats(e), this.interactionSystem.frameStart(), this.resetAudioFrameEvents(), this.scheduleNextFrame();
|
|
6201
6217
|
}
|
|
@@ -6831,29 +6847,29 @@ var d;
|
|
|
6831
6847
|
t[t._exports = T] = "_exports";
|
|
6832
6848
|
const L = T + 1;
|
|
6833
6849
|
t[t._from = L] = "_from";
|
|
6834
|
-
const
|
|
6835
|
-
t[t._get =
|
|
6836
|
-
const q =
|
|
6850
|
+
const N = L + 1;
|
|
6851
|
+
t[t._get = N] = "_get";
|
|
6852
|
+
const q = N + 1;
|
|
6837
6853
|
t[t._global = q] = "_global";
|
|
6838
|
-
const
|
|
6839
|
-
t[t._implements =
|
|
6840
|
-
const C =
|
|
6854
|
+
const K = q + 1;
|
|
6855
|
+
t[t._implements = K] = "_implements";
|
|
6856
|
+
const C = K + 1;
|
|
6841
6857
|
t[t._infer = C] = "_infer";
|
|
6842
6858
|
const H = C + 1;
|
|
6843
6859
|
t[t._interface = H] = "_interface";
|
|
6844
|
-
const
|
|
6845
|
-
t[t._is =
|
|
6846
|
-
const J =
|
|
6860
|
+
const B = H + 1;
|
|
6861
|
+
t[t._is = B] = "_is";
|
|
6862
|
+
const J = B + 1;
|
|
6847
6863
|
t[t._keyof = J] = "_keyof";
|
|
6848
6864
|
const oe = J + 1;
|
|
6849
6865
|
t[t._mixins = oe] = "_mixins";
|
|
6850
6866
|
const se = oe + 1;
|
|
6851
6867
|
t[t._module = se] = "_module";
|
|
6852
|
-
const
|
|
6853
|
-
t[t._namespace =
|
|
6854
|
-
const
|
|
6855
|
-
t[t._of =
|
|
6856
|
-
const _ =
|
|
6868
|
+
const Y = se + 1;
|
|
6869
|
+
t[t._namespace = Y] = "_namespace";
|
|
6870
|
+
const de = Y + 1;
|
|
6871
|
+
t[t._of = de] = "_of";
|
|
6872
|
+
const _ = de + 1;
|
|
6857
6873
|
t[t._opaque = _] = "_opaque";
|
|
6858
6874
|
const b = _ + 1;
|
|
6859
6875
|
t[t._out = b] = "_out";
|
|
@@ -6867,17 +6883,17 @@ var d;
|
|
|
6867
6883
|
t[t._proto = U] = "_proto";
|
|
6868
6884
|
const R = U + 1;
|
|
6869
6885
|
t[t._public = R] = "_public";
|
|
6870
|
-
const
|
|
6871
|
-
t[t._readonly =
|
|
6872
|
-
const F =
|
|
6886
|
+
const M = R + 1;
|
|
6887
|
+
t[t._readonly = M] = "_readonly";
|
|
6888
|
+
const F = M + 1;
|
|
6873
6889
|
t[t._require = F] = "_require";
|
|
6874
|
-
const
|
|
6875
|
-
t[t._satisfies =
|
|
6876
|
-
const j =
|
|
6890
|
+
const O = F + 1;
|
|
6891
|
+
t[t._satisfies = O] = "_satisfies";
|
|
6892
|
+
const j = O + 1;
|
|
6877
6893
|
t[t._set = j] = "_set";
|
|
6878
|
-
const
|
|
6879
|
-
t[t._static =
|
|
6880
|
-
const ue =
|
|
6894
|
+
const z = j + 1;
|
|
6895
|
+
t[t._static = z] = "_static";
|
|
6896
|
+
const ue = z + 1;
|
|
6881
6897
|
t[t._symbol = ue] = "_symbol";
|
|
6882
6898
|
const ae = ue + 1;
|
|
6883
6899
|
t[t._type = ae] = "_type";
|
|
@@ -6915,28 +6931,28 @@ var r;
|
|
|
6915
6931
|
t[t.name = T] = "name";
|
|
6916
6932
|
const L = 6144;
|
|
6917
6933
|
t[t.eof = L] = "eof";
|
|
6918
|
-
const
|
|
6919
|
-
t[t.bracketL =
|
|
6934
|
+
const N = 7680;
|
|
6935
|
+
t[t.bracketL = N] = "bracketL";
|
|
6920
6936
|
const q = 8192;
|
|
6921
6937
|
t[t.bracketR = q] = "bracketR";
|
|
6922
|
-
const
|
|
6923
|
-
t[t.braceL =
|
|
6938
|
+
const K = 9728;
|
|
6939
|
+
t[t.braceL = K] = "braceL";
|
|
6924
6940
|
const C = 10752;
|
|
6925
6941
|
t[t.braceBarL = C] = "braceBarL";
|
|
6926
6942
|
const H = 11264;
|
|
6927
6943
|
t[t.braceR = H] = "braceR";
|
|
6928
|
-
const
|
|
6929
|
-
t[t.braceBarR =
|
|
6944
|
+
const B = 12288;
|
|
6945
|
+
t[t.braceBarR = B] = "braceBarR";
|
|
6930
6946
|
const J = 13824;
|
|
6931
6947
|
t[t.parenL = J] = "parenL";
|
|
6932
6948
|
const oe = 14336;
|
|
6933
6949
|
t[t.parenR = oe] = "parenR";
|
|
6934
6950
|
const se = 15360;
|
|
6935
6951
|
t[t.comma = se] = "comma";
|
|
6936
|
-
const
|
|
6937
|
-
t[t.semi =
|
|
6938
|
-
const
|
|
6939
|
-
t[t.colon =
|
|
6952
|
+
const Y = 16384;
|
|
6953
|
+
t[t.semi = Y] = "semi";
|
|
6954
|
+
const de = 17408;
|
|
6955
|
+
t[t.colon = de] = "colon";
|
|
6940
6956
|
const _ = 18432;
|
|
6941
6957
|
t[t.doubleColon = _] = "doubleColon";
|
|
6942
6958
|
const b = 19456;
|
|
@@ -6951,16 +6967,16 @@ var r;
|
|
|
6951
6967
|
t[t.template = U] = "template";
|
|
6952
6968
|
const R = 24576;
|
|
6953
6969
|
t[t.ellipsis = R] = "ellipsis";
|
|
6954
|
-
const
|
|
6955
|
-
t[t.backQuote =
|
|
6970
|
+
const M = 25600;
|
|
6971
|
+
t[t.backQuote = M] = "backQuote";
|
|
6956
6972
|
const F = 27136;
|
|
6957
6973
|
t[t.dollarBraceL = F] = "dollarBraceL";
|
|
6958
|
-
const
|
|
6959
|
-
t[t.at =
|
|
6974
|
+
const O = 27648;
|
|
6975
|
+
t[t.at = O] = "at";
|
|
6960
6976
|
const j = 29184;
|
|
6961
6977
|
t[t.hash = j] = "hash";
|
|
6962
|
-
const
|
|
6963
|
-
t[t.eq =
|
|
6978
|
+
const z = 29728;
|
|
6979
|
+
t[t.eq = z] = "eq";
|
|
6964
6980
|
const ue = 30752;
|
|
6965
6981
|
t[t.assign = ue] = "assign";
|
|
6966
6982
|
const ae = 32640;
|
|
@@ -7478,28 +7494,28 @@ var p;
|
|
|
7478
7494
|
t[t.apostrophe = T] = "apostrophe";
|
|
7479
7495
|
const L = 40;
|
|
7480
7496
|
t[t.leftParenthesis = L] = "leftParenthesis";
|
|
7481
|
-
const
|
|
7482
|
-
t[t.rightParenthesis =
|
|
7497
|
+
const N = 41;
|
|
7498
|
+
t[t.rightParenthesis = N] = "rightParenthesis";
|
|
7483
7499
|
const q = 42;
|
|
7484
7500
|
t[t.asterisk = q] = "asterisk";
|
|
7485
|
-
const
|
|
7486
|
-
t[t.plusSign =
|
|
7501
|
+
const K = 43;
|
|
7502
|
+
t[t.plusSign = K] = "plusSign";
|
|
7487
7503
|
const C = 44;
|
|
7488
7504
|
t[t.comma = C] = "comma";
|
|
7489
7505
|
const H = 45;
|
|
7490
7506
|
t[t.dash = H] = "dash";
|
|
7491
|
-
const
|
|
7492
|
-
t[t.dot =
|
|
7507
|
+
const B = 46;
|
|
7508
|
+
t[t.dot = B] = "dot";
|
|
7493
7509
|
const J = 47;
|
|
7494
7510
|
t[t.slash = J] = "slash";
|
|
7495
7511
|
const oe = 48;
|
|
7496
7512
|
t[t.digit0 = oe] = "digit0";
|
|
7497
7513
|
const se = 49;
|
|
7498
7514
|
t[t.digit1 = se] = "digit1";
|
|
7499
|
-
const
|
|
7500
|
-
t[t.digit2 =
|
|
7501
|
-
const
|
|
7502
|
-
t[t.digit3 =
|
|
7515
|
+
const Y = 50;
|
|
7516
|
+
t[t.digit2 = Y] = "digit2";
|
|
7517
|
+
const de = 51;
|
|
7518
|
+
t[t.digit3 = de] = "digit3";
|
|
7503
7519
|
const _ = 52;
|
|
7504
7520
|
t[t.digit4 = _] = "digit4";
|
|
7505
7521
|
const b = 53;
|
|
@@ -7514,16 +7530,16 @@ var p;
|
|
|
7514
7530
|
t[t.digit9 = U] = "digit9";
|
|
7515
7531
|
const R = 58;
|
|
7516
7532
|
t[t.colon = R] = "colon";
|
|
7517
|
-
const
|
|
7518
|
-
t[t.semicolon =
|
|
7533
|
+
const M = 59;
|
|
7534
|
+
t[t.semicolon = M] = "semicolon";
|
|
7519
7535
|
const F = 60;
|
|
7520
7536
|
t[t.lessThan = F] = "lessThan";
|
|
7521
|
-
const
|
|
7522
|
-
t[t.equalsTo =
|
|
7537
|
+
const O = 61;
|
|
7538
|
+
t[t.equalsTo = O] = "equalsTo";
|
|
7523
7539
|
const j = 62;
|
|
7524
7540
|
t[t.greaterThan = j] = "greaterThan";
|
|
7525
|
-
const
|
|
7526
|
-
t[t.questionMark =
|
|
7541
|
+
const z = 63;
|
|
7542
|
+
t[t.questionMark = z] = "questionMark";
|
|
7527
7543
|
const ue = 64;
|
|
7528
7544
|
t[t.atSign = ue] = "atSign";
|
|
7529
7545
|
const ae = 65;
|
|
@@ -17324,72 +17340,72 @@ function bu() {
|
|
|
17324
17340
|
t === p.dot && P.charCodeAt(a.pos + 2) === p.dot ? (a.pos += 3, ee(r.ellipsis)) : (++a.pos, ee(r.dot));
|
|
17325
17341
|
}
|
|
17326
17342
|
function _u() {
|
|
17327
|
-
P.charCodeAt(a.pos + 1) === p.equalsTo ?
|
|
17343
|
+
P.charCodeAt(a.pos + 1) === p.equalsTo ? he(r.assign, 2) : he(r.slash, 1);
|
|
17328
17344
|
}
|
|
17329
17345
|
function yu(t) {
|
|
17330
17346
|
let e = t === p.asterisk ? r.star : r.modulo, n = 1, s = P.charCodeAt(a.pos + 1);
|
|
17331
|
-
t === p.asterisk && s === p.asterisk && (n++, s = P.charCodeAt(a.pos + 2), e = r.exponent), s === p.equalsTo && P.charCodeAt(a.pos + 2) !== p.greaterThan && (n++, e = r.assign),
|
|
17347
|
+
t === p.asterisk && s === p.asterisk && (n++, s = P.charCodeAt(a.pos + 2), e = r.exponent), s === p.equalsTo && P.charCodeAt(a.pos + 2) !== p.greaterThan && (n++, e = r.assign), he(e, n);
|
|
17332
17348
|
}
|
|
17333
17349
|
function ku(t) {
|
|
17334
17350
|
const e = P.charCodeAt(a.pos + 1);
|
|
17335
17351
|
if (e === t) {
|
|
17336
|
-
P.charCodeAt(a.pos + 2) === p.equalsTo ?
|
|
17352
|
+
P.charCodeAt(a.pos + 2) === p.equalsTo ? he(r.assign, 3) : he(t === p.verticalBar ? r.logicalOR : r.logicalAND, 2);
|
|
17337
17353
|
return;
|
|
17338
17354
|
}
|
|
17339
17355
|
if (t === p.verticalBar) {
|
|
17340
17356
|
if (e === p.greaterThan) {
|
|
17341
|
-
|
|
17357
|
+
he(r.pipeline, 2);
|
|
17342
17358
|
return;
|
|
17343
17359
|
} else if (e === p.rightCurlyBrace && fe) {
|
|
17344
|
-
|
|
17360
|
+
he(r.braceBarR, 2);
|
|
17345
17361
|
return;
|
|
17346
17362
|
}
|
|
17347
17363
|
}
|
|
17348
17364
|
if (e === p.equalsTo) {
|
|
17349
|
-
|
|
17365
|
+
he(r.assign, 2);
|
|
17350
17366
|
return;
|
|
17351
17367
|
}
|
|
17352
|
-
|
|
17368
|
+
he(t === p.verticalBar ? r.bitwiseOR : r.bitwiseAND, 1);
|
|
17353
17369
|
}
|
|
17354
17370
|
function vu() {
|
|
17355
|
-
P.charCodeAt(a.pos + 1) === p.equalsTo ?
|
|
17371
|
+
P.charCodeAt(a.pos + 1) === p.equalsTo ? he(r.assign, 2) : he(r.bitwiseXOR, 1);
|
|
17356
17372
|
}
|
|
17357
17373
|
function wu(t) {
|
|
17358
17374
|
const e = P.charCodeAt(a.pos + 1);
|
|
17359
17375
|
if (e === t) {
|
|
17360
|
-
|
|
17376
|
+
he(r.preIncDec, 2);
|
|
17361
17377
|
return;
|
|
17362
17378
|
}
|
|
17363
|
-
e === p.equalsTo ?
|
|
17379
|
+
e === p.equalsTo ? he(r.assign, 2) : t === p.plusSign ? he(r.plus, 1) : he(r.minus, 1);
|
|
17364
17380
|
}
|
|
17365
17381
|
function xu() {
|
|
17366
17382
|
const t = P.charCodeAt(a.pos + 1);
|
|
17367
17383
|
if (t === p.lessThan) {
|
|
17368
17384
|
if (P.charCodeAt(a.pos + 2) === p.equalsTo) {
|
|
17369
|
-
|
|
17385
|
+
he(r.assign, 3);
|
|
17370
17386
|
return;
|
|
17371
17387
|
}
|
|
17372
|
-
a.isType ?
|
|
17388
|
+
a.isType ? he(r.lessThan, 1) : he(r.bitShiftL, 2);
|
|
17373
17389
|
return;
|
|
17374
17390
|
}
|
|
17375
|
-
t === p.equalsTo ?
|
|
17391
|
+
t === p.equalsTo ? he(r.relationalOrEqual, 2) : he(r.lessThan, 1);
|
|
17376
17392
|
}
|
|
17377
17393
|
function ra() {
|
|
17378
17394
|
if (a.isType) {
|
|
17379
|
-
|
|
17395
|
+
he(r.greaterThan, 1);
|
|
17380
17396
|
return;
|
|
17381
17397
|
}
|
|
17382
17398
|
const t = P.charCodeAt(a.pos + 1);
|
|
17383
17399
|
if (t === p.greaterThan) {
|
|
17384
17400
|
const e = P.charCodeAt(a.pos + 2) === p.greaterThan ? 3 : 2;
|
|
17385
17401
|
if (P.charCodeAt(a.pos + e) === p.equalsTo) {
|
|
17386
|
-
|
|
17402
|
+
he(r.assign, e + 1);
|
|
17387
17403
|
return;
|
|
17388
17404
|
}
|
|
17389
|
-
|
|
17405
|
+
he(r.bitShiftR, e);
|
|
17390
17406
|
return;
|
|
17391
17407
|
}
|
|
17392
|
-
t === p.equalsTo ?
|
|
17408
|
+
t === p.equalsTo ? he(r.relationalOrEqual, 2) : he(r.greaterThan, 1);
|
|
17393
17409
|
}
|
|
17394
17410
|
function ia() {
|
|
17395
17411
|
a.type === r.greaterThan && (a.pos -= 1, ra());
|
|
@@ -17397,20 +17413,20 @@ function ia() {
|
|
|
17397
17413
|
function Eu(t) {
|
|
17398
17414
|
const e = P.charCodeAt(a.pos + 1);
|
|
17399
17415
|
if (e === p.equalsTo) {
|
|
17400
|
-
|
|
17416
|
+
he(r.equality, P.charCodeAt(a.pos + 2) === p.equalsTo ? 3 : 2);
|
|
17401
17417
|
return;
|
|
17402
17418
|
}
|
|
17403
17419
|
if (t === p.equalsTo && e === p.greaterThan) {
|
|
17404
17420
|
a.pos += 2, ee(r.arrow);
|
|
17405
17421
|
return;
|
|
17406
17422
|
}
|
|
17407
|
-
|
|
17423
|
+
he(t === p.equalsTo ? r.eq : r.bang, 1);
|
|
17408
17424
|
}
|
|
17409
17425
|
function Su() {
|
|
17410
17426
|
const t = P.charCodeAt(a.pos + 1), e = P.charCodeAt(a.pos + 2);
|
|
17411
17427
|
t === p.questionMark && // In Flow (but not TypeScript), ??string is a valid type that should be
|
|
17412
17428
|
// tokenized as two individual ? tokens.
|
|
17413
|
-
!(fe && a.isType) ? e === p.equalsTo ?
|
|
17429
|
+
!(fe && a.isType) ? e === p.equalsTo ? he(r.assign, 3) : he(r.nullishCoalescing, 2) : t === p.dot && !(e >= p.digit0 && e <= p.digit9) ? (a.pos += 2, ee(r.questionDot)) : (++a.pos, ee(r.question));
|
|
17414
17430
|
}
|
|
17415
17431
|
function oa(t) {
|
|
17416
17432
|
switch (t) {
|
|
@@ -17439,13 +17455,13 @@ function oa(t) {
|
|
|
17439
17455
|
++a.pos, ee(r.bracketR);
|
|
17440
17456
|
return;
|
|
17441
17457
|
case p.leftCurlyBrace:
|
|
17442
|
-
fe && P.charCodeAt(a.pos + 1) === p.verticalBar ?
|
|
17458
|
+
fe && P.charCodeAt(a.pos + 1) === p.verticalBar ? he(r.braceBarL, 2) : (++a.pos, ee(r.braceL));
|
|
17443
17459
|
return;
|
|
17444
17460
|
case p.rightCurlyBrace:
|
|
17445
17461
|
++a.pos, ee(r.braceR);
|
|
17446
17462
|
return;
|
|
17447
17463
|
case p.colon:
|
|
17448
|
-
P.charCodeAt(a.pos + 1) === p.colon ?
|
|
17464
|
+
P.charCodeAt(a.pos + 1) === p.colon ? he(r.doubleColon, 2) : (++a.pos, ee(r.colon));
|
|
17449
17465
|
return;
|
|
17450
17466
|
case p.questionMark:
|
|
17451
17467
|
Su();
|
|
@@ -17507,12 +17523,12 @@ function oa(t) {
|
|
|
17507
17523
|
Eu(t);
|
|
17508
17524
|
return;
|
|
17509
17525
|
case p.tilde:
|
|
17510
|
-
|
|
17526
|
+
he(r.tilde, 1);
|
|
17511
17527
|
return;
|
|
17512
17528
|
}
|
|
17513
17529
|
te(`Unexpected character '${String.fromCharCode(t)}'`, a.pos);
|
|
17514
17530
|
}
|
|
17515
|
-
function
|
|
17531
|
+
function he(t, e) {
|
|
17516
17532
|
a.pos += e, ee(t);
|
|
17517
17533
|
}
|
|
17518
17534
|
function Tu() {
|
|
@@ -18646,29 +18662,29 @@ var Tt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
18646
18662
|
return x(H[1], H[2] || "", H[3], H[4] || "", H[5] || "/", H[6] || "", H[7] || "");
|
|
18647
18663
|
}
|
|
18648
18664
|
function g(C) {
|
|
18649
|
-
const H = i.exec(C),
|
|
18650
|
-
return x("file:", "", H[1] || "", "", u(
|
|
18665
|
+
const H = i.exec(C), B = H[2];
|
|
18666
|
+
return x("file:", "", H[1] || "", "", u(B) ? B : "/" + B, H[3] || "", H[4] || "");
|
|
18651
18667
|
}
|
|
18652
|
-
function x(C, H,
|
|
18668
|
+
function x(C, H, B, J, oe, se, Y) {
|
|
18653
18669
|
return {
|
|
18654
18670
|
scheme: C,
|
|
18655
18671
|
user: H,
|
|
18656
|
-
host:
|
|
18672
|
+
host: B,
|
|
18657
18673
|
port: J,
|
|
18658
18674
|
path: oe,
|
|
18659
18675
|
query: se,
|
|
18660
|
-
hash:
|
|
18676
|
+
hash: Y,
|
|
18661
18677
|
type: 7
|
|
18662
18678
|
};
|
|
18663
18679
|
}
|
|
18664
18680
|
function T(C) {
|
|
18665
18681
|
if (c(C)) {
|
|
18666
|
-
const
|
|
18667
|
-
return
|
|
18682
|
+
const B = m("http:" + C);
|
|
18683
|
+
return B.scheme = "", B.type = 6, B;
|
|
18668
18684
|
}
|
|
18669
18685
|
if (u(C)) {
|
|
18670
|
-
const
|
|
18671
|
-
return
|
|
18686
|
+
const B = m("http://foo.com" + C);
|
|
18687
|
+
return B.scheme = "", B.host = "", B.type = 5, B;
|
|
18672
18688
|
}
|
|
18673
18689
|
if (h(C))
|
|
18674
18690
|
return g(C);
|
|
@@ -18683,70 +18699,70 @@ var Tt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
18683
18699
|
const H = C.lastIndexOf("/");
|
|
18684
18700
|
return C.slice(0, H + 1);
|
|
18685
18701
|
}
|
|
18686
|
-
function
|
|
18702
|
+
function N(C, H) {
|
|
18687
18703
|
q(H, H.type), C.path === "/" ? C.path = H.path : C.path = L(H.path) + C.path;
|
|
18688
18704
|
}
|
|
18689
18705
|
function q(C, H) {
|
|
18690
|
-
const
|
|
18691
|
-
let oe = 1, se = 0,
|
|
18706
|
+
const B = H <= 4, J = C.path.split("/");
|
|
18707
|
+
let oe = 1, se = 0, Y = !1;
|
|
18692
18708
|
for (let _ = 1; _ < J.length; _++) {
|
|
18693
18709
|
const b = J[_];
|
|
18694
18710
|
if (!b) {
|
|
18695
|
-
|
|
18711
|
+
Y = !0;
|
|
18696
18712
|
continue;
|
|
18697
18713
|
}
|
|
18698
|
-
if (
|
|
18714
|
+
if (Y = !1, b !== ".") {
|
|
18699
18715
|
if (b === "..") {
|
|
18700
|
-
se ? (
|
|
18716
|
+
se ? (Y = !0, se--, oe--) : B && (J[oe++] = b);
|
|
18701
18717
|
continue;
|
|
18702
18718
|
}
|
|
18703
18719
|
J[oe++] = b, se++;
|
|
18704
18720
|
}
|
|
18705
18721
|
}
|
|
18706
|
-
let
|
|
18722
|
+
let de = "";
|
|
18707
18723
|
for (let _ = 1; _ < oe; _++)
|
|
18708
|
-
|
|
18709
|
-
(!
|
|
18724
|
+
de += "/" + J[_];
|
|
18725
|
+
(!de || Y && !de.endsWith("/..")) && (de += "/"), C.path = de;
|
|
18710
18726
|
}
|
|
18711
|
-
function
|
|
18727
|
+
function K(C, H) {
|
|
18712
18728
|
if (!C && !H)
|
|
18713
18729
|
return "";
|
|
18714
|
-
const
|
|
18715
|
-
let J =
|
|
18730
|
+
const B = T(C);
|
|
18731
|
+
let J = B.type;
|
|
18716
18732
|
if (H && J !== 7) {
|
|
18717
|
-
const se = T(H),
|
|
18733
|
+
const se = T(H), Y = se.type;
|
|
18718
18734
|
switch (J) {
|
|
18719
18735
|
case 1:
|
|
18720
|
-
|
|
18736
|
+
B.hash = se.hash;
|
|
18721
18737
|
case 2:
|
|
18722
|
-
|
|
18738
|
+
B.query = se.query;
|
|
18723
18739
|
case 3:
|
|
18724
18740
|
case 4:
|
|
18725
|
-
|
|
18741
|
+
N(B, se);
|
|
18726
18742
|
case 5:
|
|
18727
|
-
|
|
18743
|
+
B.user = se.user, B.host = se.host, B.port = se.port;
|
|
18728
18744
|
case 6:
|
|
18729
|
-
|
|
18745
|
+
B.scheme = se.scheme;
|
|
18730
18746
|
}
|
|
18731
|
-
|
|
18747
|
+
Y > J && (J = Y);
|
|
18732
18748
|
}
|
|
18733
|
-
q(
|
|
18734
|
-
const oe =
|
|
18749
|
+
q(B, J);
|
|
18750
|
+
const oe = B.query + B.hash;
|
|
18735
18751
|
switch (J) {
|
|
18736
18752
|
case 2:
|
|
18737
18753
|
case 3:
|
|
18738
18754
|
return oe;
|
|
18739
18755
|
case 4: {
|
|
18740
|
-
const se =
|
|
18756
|
+
const se = B.path.slice(1);
|
|
18741
18757
|
return se ? f(H || C) && !f(se) ? "./" + se + oe : se + oe : oe || ".";
|
|
18742
18758
|
}
|
|
18743
18759
|
case 5:
|
|
18744
|
-
return
|
|
18760
|
+
return B.path + oe;
|
|
18745
18761
|
default:
|
|
18746
|
-
return
|
|
18762
|
+
return B.scheme + "//" + B.user + B.host + B.port + B.path + oe;
|
|
18747
18763
|
}
|
|
18748
18764
|
}
|
|
18749
|
-
return
|
|
18765
|
+
return K;
|
|
18750
18766
|
});
|
|
18751
18767
|
})(ju);
|
|
18752
18768
|
var nr = class {
|
|
@@ -18818,12 +18834,12 @@ function Ju(t, e, n, s, i, o, c, u, h) {
|
|
|
18818
18834
|
} = e, T = Qu(f, n), L = el(T, s);
|
|
18819
18835
|
if (!i)
|
|
18820
18836
|
return nl(T, L) ? void 0 : Gi(T, L, [s]);
|
|
18821
|
-
const
|
|
18822
|
-
if (
|
|
18837
|
+
const N = qu(m, i), q = da;
|
|
18838
|
+
if (N === g.length && (g[N] = null), !sl(T, L, N, o, c, q))
|
|
18823
18839
|
return Gi(
|
|
18824
18840
|
T,
|
|
18825
18841
|
L,
|
|
18826
|
-
[s,
|
|
18842
|
+
[s, N, o, c]
|
|
18827
18843
|
);
|
|
18828
18844
|
}
|
|
18829
18845
|
function Qu(t, e) {
|
|
@@ -18866,13 +18882,13 @@ function rl({ code: t, mappings: e }, n, s, i, o) {
|
|
|
18866
18882
|
h++, f = e[h];
|
|
18867
18883
|
let m = 0, g = 0;
|
|
18868
18884
|
f !== g && sr(u, m, 0, n, m, 0);
|
|
18869
|
-
for (let
|
|
18870
|
-
if (
|
|
18871
|
-
const q = f - g,
|
|
18872
|
-
for (sr(u, m, q, n, m,
|
|
18885
|
+
for (let N = 0; N < t.length; N++) {
|
|
18886
|
+
if (N === f) {
|
|
18887
|
+
const q = f - g, K = c[h];
|
|
18888
|
+
for (sr(u, m, q, n, m, K); (f === N || f === void 0) && h < e.length - 1; )
|
|
18873
18889
|
h++, f = e[h];
|
|
18874
18890
|
}
|
|
18875
|
-
t.charCodeAt(
|
|
18891
|
+
t.charCodeAt(N) === p.lineFeed && (m++, g = N + 1, f !== g && sr(u, m, 0, n, m, 0));
|
|
18876
18892
|
}
|
|
18877
18893
|
const { sourceRoot: x, sourcesContent: T, ...L } = Zu(u);
|
|
18878
18894
|
return L;
|
|
@@ -19347,12 +19363,12 @@ var hl = (
|
|
|
19347
19363
|
function L() {
|
|
19348
19364
|
for (var k = [], S = 0; S < arguments.length; S++)
|
|
19349
19365
|
k[S] = arguments[S];
|
|
19350
|
-
return new
|
|
19366
|
+
return new N(k.map(function(A) {
|
|
19351
19367
|
return i(A);
|
|
19352
19368
|
}));
|
|
19353
19369
|
}
|
|
19354
19370
|
t.union = L;
|
|
19355
|
-
var
|
|
19371
|
+
var N = (
|
|
19356
19372
|
/** @class */
|
|
19357
19373
|
function(k) {
|
|
19358
19374
|
e(S, k);
|
|
@@ -19381,16 +19397,16 @@ var hl = (
|
|
|
19381
19397
|
}, S;
|
|
19382
19398
|
}(s)
|
|
19383
19399
|
);
|
|
19384
|
-
t.TUnion =
|
|
19400
|
+
t.TUnion = N;
|
|
19385
19401
|
function q() {
|
|
19386
19402
|
for (var k = [], S = 0; S < arguments.length; S++)
|
|
19387
19403
|
k[S] = arguments[S];
|
|
19388
|
-
return new
|
|
19404
|
+
return new K(k.map(function(A) {
|
|
19389
19405
|
return i(A);
|
|
19390
19406
|
}));
|
|
19391
19407
|
}
|
|
19392
19408
|
t.intersection = q;
|
|
19393
|
-
var
|
|
19409
|
+
var K = (
|
|
19394
19410
|
/** @class */
|
|
19395
19411
|
function(k) {
|
|
19396
19412
|
e(S, k);
|
|
@@ -19411,7 +19427,7 @@ var hl = (
|
|
|
19411
19427
|
}, S;
|
|
19412
19428
|
}(s)
|
|
19413
19429
|
);
|
|
19414
|
-
t.TIntersection =
|
|
19430
|
+
t.TIntersection = K;
|
|
19415
19431
|
function C(k) {
|
|
19416
19432
|
return new H(k);
|
|
19417
19433
|
}
|
|
@@ -19435,10 +19451,10 @@ var hl = (
|
|
|
19435
19451
|
}(s)
|
|
19436
19452
|
);
|
|
19437
19453
|
t.TEnumType = H;
|
|
19438
|
-
function
|
|
19454
|
+
function B(k, S) {
|
|
19439
19455
|
return new J(k, S);
|
|
19440
19456
|
}
|
|
19441
|
-
t.enumlit =
|
|
19457
|
+
t.enumlit = B;
|
|
19442
19458
|
var J = (
|
|
19443
19459
|
/** @class */
|
|
19444
19460
|
function(k) {
|
|
@@ -19469,11 +19485,11 @@ var hl = (
|
|
|
19469
19485
|
function se(k, S) {
|
|
19470
19486
|
return S instanceof b ? new v(k, S.ttype, !0) : new v(k, i(S), !1);
|
|
19471
19487
|
}
|
|
19472
|
-
function
|
|
19473
|
-
return new
|
|
19488
|
+
function Y(k, S) {
|
|
19489
|
+
return new de(k, oe(S));
|
|
19474
19490
|
}
|
|
19475
|
-
t.iface =
|
|
19476
|
-
var
|
|
19491
|
+
t.iface = Y;
|
|
19492
|
+
var de = (
|
|
19477
19493
|
/** @class */
|
|
19478
19494
|
function(k) {
|
|
19479
19495
|
e(S, k);
|
|
@@ -19525,7 +19541,7 @@ var hl = (
|
|
|
19525
19541
|
}, S;
|
|
19526
19542
|
}(s)
|
|
19527
19543
|
);
|
|
19528
|
-
t.TIface =
|
|
19544
|
+
t.TIface = de;
|
|
19529
19545
|
function _(k) {
|
|
19530
19546
|
return new b(i(k));
|
|
19531
19547
|
}
|
|
@@ -19560,7 +19576,7 @@ var hl = (
|
|
|
19560
19576
|
function $(k) {
|
|
19561
19577
|
for (var S = [], A = 1; A < arguments.length; A++)
|
|
19562
19578
|
S[A - 1] = arguments[A];
|
|
19563
|
-
return new X(new
|
|
19579
|
+
return new X(new M(S), i(k));
|
|
19564
19580
|
}
|
|
19565
19581
|
t.func = $;
|
|
19566
19582
|
var X = (
|
|
@@ -19593,7 +19609,7 @@ var hl = (
|
|
|
19593
19609
|
}()
|
|
19594
19610
|
);
|
|
19595
19611
|
t.TParam = R;
|
|
19596
|
-
var
|
|
19612
|
+
var M = (
|
|
19597
19613
|
/** @class */
|
|
19598
19614
|
function(k) {
|
|
19599
19615
|
e(S, k);
|
|
@@ -19628,7 +19644,7 @@ var hl = (
|
|
|
19628
19644
|
}, S;
|
|
19629
19645
|
}(s)
|
|
19630
19646
|
);
|
|
19631
|
-
t.TParamList =
|
|
19647
|
+
t.TParamList = M;
|
|
19632
19648
|
var F = (
|
|
19633
19649
|
/** @class */
|
|
19634
19650
|
function(k) {
|
|
@@ -19679,16 +19695,16 @@ var hl = (
|
|
|
19679
19695
|
Date: new F(j("[object Date]"), "is not a Date"),
|
|
19680
19696
|
RegExp: new F(j("[object RegExp]"), "is not a RegExp")
|
|
19681
19697
|
};
|
|
19682
|
-
var
|
|
19698
|
+
var O = Object.prototype.toString;
|
|
19683
19699
|
function j(k) {
|
|
19684
19700
|
return function(S) {
|
|
19685
|
-
return typeof S == "object" && S &&
|
|
19701
|
+
return typeof S == "object" && S && O.call(S) === k;
|
|
19686
19702
|
};
|
|
19687
19703
|
}
|
|
19688
19704
|
typeof Buffer < "u" && (t.basicTypes.Buffer = new F(function(k) {
|
|
19689
19705
|
return Buffer.isBuffer(k);
|
|
19690
19706
|
}, "is not a Buffer"));
|
|
19691
|
-
for (var
|
|
19707
|
+
for (var z = function(k) {
|
|
19692
19708
|
t.basicTypes[k.name] = new F(function(S) {
|
|
19693
19709
|
return S instanceof k;
|
|
19694
19710
|
}, "is not a " + k.name);
|
|
@@ -19705,14 +19721,14 @@ var hl = (
|
|
|
19705
19721
|
ArrayBuffer
|
|
19706
19722
|
]; ue < ae.length; ue++) {
|
|
19707
19723
|
var ie = ae[ue];
|
|
19708
|
-
|
|
19724
|
+
z(ie);
|
|
19709
19725
|
}
|
|
19710
19726
|
})(mr);
|
|
19711
19727
|
(function(t) {
|
|
19712
19728
|
var e = Tt && Tt.__spreadArrays || function() {
|
|
19713
19729
|
for (var h = 0, f = 0, m = arguments.length; f < m; f++) h += arguments[f].length;
|
|
19714
19730
|
for (var g = Array(h), x = 0, f = 0; f < m; f++)
|
|
19715
|
-
for (var T = arguments[f], L = 0,
|
|
19731
|
+
for (var T = arguments[f], L = 0, N = T.length; L < N; L++, x++)
|
|
19716
19732
|
g[x] = T[L];
|
|
19717
19733
|
return g;
|
|
19718
19734
|
};
|
|
@@ -19783,9 +19799,9 @@ var hl = (
|
|
|
19783
19799
|
for (var h = [], f = 0; f < arguments.length; f++)
|
|
19784
19800
|
h[f] = arguments[f];
|
|
19785
19801
|
for (var m = Object.assign.apply(Object, e([{}, n.basicTypes], h)), g = {}, x = 0, T = h; x < T.length; x++)
|
|
19786
|
-
for (var L = T[x],
|
|
19787
|
-
var
|
|
19788
|
-
g[
|
|
19802
|
+
for (var L = T[x], N = 0, q = Object.keys(L); N < q.length; N++) {
|
|
19803
|
+
var K = q[N];
|
|
19804
|
+
g[K] = new u(m, L[K]);
|
|
19789
19805
|
}
|
|
19790
19806
|
return g;
|
|
19791
19807
|
}
|
|
@@ -22439,14 +22455,14 @@ function $d(t, e, n, s) {
|
|
|
22439
22455
|
e.nextToken();
|
|
22440
22456
|
else {
|
|
22441
22457
|
const T = e.currentIndex();
|
|
22442
|
-
let L = !1,
|
|
22458
|
+
let L = !1, N = !1, q = !1;
|
|
22443
22459
|
for (; On(e.currentToken()); )
|
|
22444
|
-
e.matches1(r._static) && (L = !0), e.matches1(r.hash) && (
|
|
22460
|
+
e.matches1(r._static) && (L = !0), e.matches1(r.hash) && (N = !0), (e.matches1(r._declare) || e.matches1(r._abstract)) && (q = !0), e.nextToken();
|
|
22445
22461
|
if (L && e.matches1(r.braceL)) {
|
|
22446
22462
|
or(e, x);
|
|
22447
22463
|
continue;
|
|
22448
22464
|
}
|
|
22449
|
-
if (
|
|
22465
|
+
if (N) {
|
|
22450
22466
|
or(e, x);
|
|
22451
22467
|
continue;
|
|
22452
22468
|
}
|
|
@@ -22454,7 +22470,7 @@ function $d(t, e, n, s) {
|
|
|
22454
22470
|
({ constructorInitializerStatements: c, constructorInsertPos: f } = ao(e));
|
|
22455
22471
|
continue;
|
|
22456
22472
|
}
|
|
22457
|
-
const
|
|
22473
|
+
const K = e.currentIndex();
|
|
22458
22474
|
if (Vd(e), e.matches1(r.lessThan) || e.matches1(r.parenL)) {
|
|
22459
22475
|
or(e, x);
|
|
22460
22476
|
continue;
|
|
@@ -22467,11 +22483,11 @@ function $d(t, e, n, s) {
|
|
|
22467
22483
|
throw new Error("Expected rhsEndIndex on class field assignment.");
|
|
22468
22484
|
for (e.nextToken(); e.currentIndex() < H; )
|
|
22469
22485
|
t.processToken();
|
|
22470
|
-
let
|
|
22471
|
-
L ? (
|
|
22472
|
-
initializerName:
|
|
22486
|
+
let B;
|
|
22487
|
+
L ? (B = n.claimFreeName("__initStatic"), h.push(B)) : (B = n.claimFreeName("__init"), u.push(B)), m.push({
|
|
22488
|
+
initializerName: B,
|
|
22473
22489
|
equalsIndex: C,
|
|
22474
|
-
start:
|
|
22490
|
+
start: K,
|
|
22475
22491
|
end: e.currentIndex()
|
|
22476
22492
|
});
|
|
22477
22493
|
} else (!s || q) && g.push({ start: T, end: e.currentIndex() });
|
|
@@ -24268,4 +24284,4 @@ throw new Error("Scene code must define a render function");`, c = Object.getPro
|
|
|
24268
24284
|
}
|
|
24269
24285
|
}
|
|
24270
24286
|
self.setSceneCode = im;
|
|
24271
|
-
//# sourceMappingURL=viji.worker-
|
|
24287
|
+
//# sourceMappingURL=viji.worker-BKg5vsqf.js.map
|