@uptimizr/replay 0.2.6 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /* @uptimizr/replay standalone bundle (global) — Apache-2.0. Inject via a <script> tag into any page (e.g. playground.babylonjs.com); exposes window.UptimizrReplay. Bundles the Babylon Vector3 it constructs; the host page owns the scene (and its asset loader). */
2
- "use strict";var UptimizrReplay=(()=>{var _o=Object.defineProperty;var Jh=Object.getOwnPropertyDescriptor;var Kh=Object.getOwnPropertyNames;var qh=Object.prototype.hasOwnProperty;var Fe=(n,e)=>{for(var r in e)_o(n,r,{get:e[r],enumerable:!0})},Gh=(n,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of Kh(e))!qh.call(n,t)&&t!==r&&_o(n,t,{get:()=>e[t],enumerable:!(i=Jh(e,t))||i.enumerable});return n};var Wh=n=>Gh(_o({},"__esModule",{value:!0}),n);var V$={};Fe(V$,{ReplayPlayer:()=>sr,createBabylonReplayDriver:()=>xo,fetchSessionEvents:()=>Rh,fetchSessionEventsStream:()=>ud,replayInScene:()=>F$});var J$=(1+Math.sqrt(5))/2,ce=.001;function Hh(n,e){let r=[];for(let i=0;i<n;++i)r.push(e());return r}function Ge(n,e){return Hh(n,e)}var ke=class n{static SetMatrixPrecision(e){if(n.MatrixTrackPrecisionChange=!1,e&&!n.MatrixUse64Bits&&n.MatrixTrackedMatrices)for(let r=0;r<n.MatrixTrackedMatrices.length;++r){let i=n.MatrixTrackedMatrices[r],t=i._m;i._m=new Array(16);for(let o=0;o<16;++o)i._m[o]=t[o]}n.MatrixUse64Bits=e,n.MatrixCurrentType=n.MatrixUse64Bits?Array:Float32Array,n.MatrixTrackedMatrices=null}};ke.MatrixUse64Bits=!1;ke.MatrixTrackPrecisionChange=!0;ke.MatrixCurrentType=Float32Array;ke.MatrixTrackedMatrices=[];var Xh=typeof WeakRef<"u",yo=class{constructor(e,r=!1,i,t){this.initialize(e,r,i,t)}initialize(e,r=!1,i,t){return this.mask=e,this.skipNextObservers=r,this.target=i,this.currentTarget=t,this}},$o=class{constructor(e,r,i=null){this.callback=e,this.mask=r,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(e=!1){this._remove&&this._remove(e)}},cr=class n{static FromPromise(e,r){let i=new n;return e.then(t=>{i.notifyObservers(t)}).catch(t=>{if(r)r.notifyObservers(t);else throw t}),i}get observers(){return this._observers}constructor(e,r=!1){this.notifyIfTriggered=r,this._observers=new Array,this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new yo(0),e&&(this._onObserverAdded=e)}add(e,r=-1,i=!1,t=null,o=!1){if(!e)return null;let a=new $o(e,r,t);a.unregisterOnNextCall=o,i?this._observers.unshift(a):this._observers.push(a),this._onObserverAdded&&this._onObserverAdded(a),this._hasNotified&&this.notifyIfTriggered&&this._lastNotifiedValue!==void 0&&this.notifyObserver(a,this._lastNotifiedValue);let s=Xh?new WeakRef(this):{deref:()=>this};return a._remove=(c=!1)=>{let u=s.deref();u&&(c?u.remove(a):u._remove(a))},a}addOnce(e){return this.add(e,void 0,void 0,void 0,!0)}remove(e){return e?(e._remove=null,this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1):!1}removeCallback(e,r){for(let i=0;i<this._observers.length;i++){let t=this._observers[i];if(!t._willBeUnregistered&&t.callback===e&&(!r||r===t.scope))return this._deferUnregister(t),!0}return!1}_deferUnregister(e){e._willBeUnregistered||(this._numObserversMarkedAsDeleted++,e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{this._remove(e)},0))}_remove(e,r=!0){if(!e)return!1;let i=this._observers.indexOf(e);return i!==-1?(r&&this._numObserversMarkedAsDeleted--,this._observers.splice(i,1),!0):!1}makeObserverTopPriority(e){this._remove(e,!1),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e,!1),this._observers.push(e)}notifyObservers(e,r=-1,i,t,o){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;let a=this._eventState;a.mask=r,a.target=i,a.currentTarget=t,a.skipNextObservers=!1,a.lastReturnValue=e,a.userInfo=o;for(let s of this._observers)if(!s._willBeUnregistered&&(s.mask&r&&(s.unregisterOnNextCall&&this._deferUnregister(s),s.scope?a.lastReturnValue=s.callback.apply(s.scope,[e,a]):a.lastReturnValue=s.callback(e,a)),a.skipNextObservers))return!1;return!0}notifyObserver(e,r,i=-1){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=r),e._willBeUnregistered)return;let t=this._eventState;t.mask=i,t.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(r,t)}hasObservers(){return this._observers.length-this._numObserversMarkedAsDeleted>0}clear(){for(;this._observers.length;){let e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){let e=new n;return e._observers=this._observers.slice(0),e}hasSpecificMask(e=-1){for(let r of this._observers)if(r.mask&e||r.mask===e)return!0;return!1}};var Le=class{static get LastCreatedEngine(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}};Le.Instances=[];Le.OnEnginesDisposedObservable=new cr;Le._LastCreatedScene=null;Le.UseFallbackTexture=!0;Le.FallbackTexture="";function X(n,e,r=1401298e-51){return Math.abs(n-e)<=r}function G(n,e){return n===e?n:Math.random()*(e-n)+n}function fd(n,e,r){return n+(e-n)*r}function oe(n,e=0,r=1){return Math.min(r,Math.max(e,n))}function pd(n){return n-=Math.PI*2*Math.floor((n+Math.PI)/(Math.PI*2)),n}var gn=class{};gn._UpdateFlagSeed=0;function hd(n,e,r,i=0){let t=n.asArray(),o=e.asArray(),a=t[0],s=t[1],c=t[2],u=t[3],l=t[4],d=t[5],m=t[6],f=t[7],h=t[8],_=t[9],z=t[10],P=t[11],x=t[12],T=t[13],D=t[14],A=t[15],S=o[0],Z=o[1],K=o[2],ge=o[3],le=o[4],ve=o[5],re=o[6],te=o[7],H=o[8],Ce=o[9],Ue=o[10],Ye=o[11],De=o[12],Oe=o[13],Ne=o[14],qe=o[15];r[i]=a*S+s*le+c*H+u*De,r[i+1]=a*Z+s*ve+c*Ce+u*Oe,r[i+2]=a*K+s*re+c*Ue+u*Ne,r[i+3]=a*ge+s*te+c*Ye+u*qe,r[i+4]=l*S+d*le+m*H+f*De,r[i+5]=l*Z+d*ve+m*Ce+f*Oe,r[i+6]=l*K+d*re+m*Ue+f*Ne,r[i+7]=l*ge+d*te+m*Ye+f*qe,r[i+8]=h*S+_*le+z*H+P*De,r[i+9]=h*Z+_*ve+z*Ce+P*Oe,r[i+10]=h*K+_*re+z*Ue+P*Ne,r[i+11]=h*ge+_*te+z*Ye+P*qe,r[i+12]=x*S+T*le+D*H+A*De,r[i+13]=x*Z+T*ve+D*Ce+A*Oe,r[i+14]=x*K+T*re+D*Ue+A*Ne,r[i+15]=x*ge+T*te+D*Ye+A*qe}function gd(n,e,r=0){let i=n.asArray();e[r]=i[0],e[r+1]=i[1],e[r+2]=i[2],e[r+3]=i[3],e[r+4]=i[4],e[r+5]=i[5],e[r+6]=i[6],e[r+7]=i[7],e[r+8]=i[8],e[r+9]=i[9],e[r+10]=i[10],e[r+11]=i[11],e[r+12]=i[12],e[r+13]=i[13],e[r+14]=i[14],e[r+15]=i[15]}function vd(n,e){let r=n.asArray(),i=r[0],t=r[1],o=r[2],a=r[3],s=r[4],c=r[5],u=r[6],l=r[7],d=r[8],m=r[9],f=r[10],h=r[11],_=r[12],z=r[13],P=r[14],x=r[15],T=f*x-P*h,D=m*x-z*h,A=m*P-z*f,S=d*x-_*h,Z=d*P-f*_,K=d*z-_*m,ge=+(c*T-u*D+l*A),le=-(s*T-u*S+l*Z),ve=+(s*D-c*S+l*K),re=-(s*A-c*Z+u*K),te=i*ge+t*le+o*ve+a*re;if(te===0)return!1;let H=1/te,Ce=u*x-P*l,Ue=c*x-z*l,Ye=c*P-z*u,De=s*x-_*l,Oe=s*P-_*u,Ne=s*z-_*c,qe=u*h-f*l,Qe=c*h-m*l,Ot=c*f-m*u,ld=s*h-d*l,dd=s*f-d*u,md=s*m-d*c,jh=-(t*T-o*D+a*A),Uh=+(i*T-o*S+a*Z),Nh=-(i*D-t*S+a*K),Ah=+(i*A-t*Z+o*K),Eh=+(t*Ce-o*Ue+a*Ye),Zh=-(i*Ce-o*De+a*Oe),Ch=+(i*Ue-t*De+a*Ne),Fh=-(i*Ye-t*Oe+o*Ne),Lh=-(t*qe-o*Qe+a*Ot),Mh=+(i*qe-o*ld+a*dd),Vh=-(i*Qe-t*ld+a*md),Bh=+(i*Ot-t*dd+o*md);return e[0]=ge*H,e[1]=jh*H,e[2]=Eh*H,e[3]=Lh*H,e[4]=le*H,e[5]=Uh*H,e[6]=Zh*H,e[7]=Mh*H,e[8]=ve*H,e[9]=Nh*H,e[10]=Ch*H,e[11]=Vh*H,e[12]=re*H,e[13]=Ah*H,e[14]=Fh*H,e[15]=Bh*H,!0}var Yh={};function vn(n,e){Yh[n]=e}var de=n=>parseInt(n.toString().replace(/\W/g,"")),We=class n{constructor(e=0,r=0){this.x=e,this.y=r}toString(){return`{X: ${this.x} Y: ${this.y}}`}getClassName(){return"Vector2"}getHashCode(){let e=de(this.x),r=de(this.y),i=e;return i=i*397^r,i}toArray(e,r=0){return e[r]=this.x,e[r+1]=this.y,this}fromArray(e,r=0){return n.FromArrayToRef(e,r,this),this}asArray(){return[this.x,this.y]}copyFrom(e){return this.x=e.x,this.y=e.y,this}copyFromFloats(e,r){return this.x=e,this.y=r,this}set(e,r){return this.copyFromFloats(e,r)}setAll(e){return this.copyFromFloats(e,e)}add(e){return new n(this.x+e.x,this.y+e.y)}addToRef(e,r){return r.x=this.x+e.x,r.y=this.y+e.y,r}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}addInPlaceFromFloats(e,r){return this.x+=e,this.y+=r,this}addVector3(e){return new n(this.x+e.x,this.y+e.y)}subtract(e){return new n(this.x-e.x,this.y-e.y)}subtractToRef(e,r){return r.x=this.x-e.x,r.y=this.y-e.y,r}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this}multiply(e){return new n(this.x*e.x,this.y*e.y)}multiplyToRef(e,r){return r.x=this.x*e.x,r.y=this.y*e.y,r}multiplyByFloats(e,r){return new n(this.x*e,this.y*r)}divide(e){return new n(this.x/e.x,this.y/e.y)}divideToRef(e,r){return r.x=this.x/e.x,r.y=this.y/e.y,r}divideInPlace(e){return this.x=this.x/e.x,this.y=this.y/e.y,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.x,e.y)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.x,e.y)}minimizeInPlaceFromFloats(e,r){return this.x=Math.min(e,this.x),this.y=Math.min(r,this.y),this}maximizeInPlaceFromFloats(e,r){return this.x=Math.max(e,this.x),this.y=Math.max(r,this.y),this}subtractFromFloats(e,r){return new n(this.x-e,this.y-r)}subtractFromFloatsToRef(e,r,i){return i.x=this.x-e,i.y=this.y-r,i}negate(){return new n(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(e){return e.x=-this.x,e.y=-this.y,e}scaleInPlace(e){return this.x*=e,this.y*=e,this}scale(e){return new n(this.x*e,this.y*e)}scaleToRef(e,r){return r.x=this.x*e,r.y=this.y*e,r}scaleAndAddToRef(e,r){return r.x+=this.x*e,r.y+=this.y*e,r}equals(e){return e&&this.x===e.x&&this.y===e.y}equalsWithEpsilon(e,r=ce){return e&&X(this.x,e.x,r)&&X(this.y,e.y,r)}equalsToFloats(e,r){return this.x===e&&this.y===r}floor(){return new n(Math.floor(this.x),Math.floor(this.y))}floorToRef(e){return e.x=Math.floor(this.x),e.y=Math.floor(this.y),e}fract(){return new n(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}fractToRef(e){return e.x=this.x-Math.floor(this.x),e.y=this.y-Math.floor(this.y),e}rotate(e){return this.rotateToRef(e,new n)}rotateToRef(e,r){let i=Math.cos(e),t=Math.sin(e);return r.x=i*this.x-t*this.y,r.y=t*this.x+i*this.y,r}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){let e=new n;return this.normalizeToRef(e),e}normalizeToRef(e){let r=this.length();return r===0||r===1?(e.x=this.x,e.y=this.y,e):this.scaleToRef(1/r,e)}clone(){return new n(this.x,this.y)}dot(e){return this.x*e.x+this.y*e.y}static Zero(){return new n(0,0)}static One(){return new n(1,1)}static Random(e=0,r=1){return new n(G(e,r),G(e,r))}static RandomToRef(e=0,r=1,i){return i.copyFromFloats(G(e,r),G(e,r))}static get ZeroReadOnly(){return n._ZeroReadOnly}static FromArray(e,r=0){return new n(e[r],e[r+1])}static FromArrayToRef(e,r,i){return i.x=e[r],i.y=e[r+1],i}static FromFloatsToRef(e,r,i){return i.copyFromFloats(e,r),i}static CatmullRom(e,r,i,t,o){let a=o*o,s=o*a,c=.5*(2*r.x+(-e.x+i.x)*o+(2*e.x-5*r.x+4*i.x-t.x)*a+(-e.x+3*r.x-3*i.x+t.x)*s),u=.5*(2*r.y+(-e.y+i.y)*o+(2*e.y-5*r.y+4*i.y-t.y)*a+(-e.y+3*r.y-3*i.y+t.y)*s);return new n(c,u)}static ClampToRef(e,r,i,t){return t.x=oe(e.x,r.x,i.x),t.y=oe(e.y,r.y,i.y),t}static Clamp(e,r,i){let t=oe(e.x,r.x,i.x),o=oe(e.y,r.y,i.y);return new n(t,o)}static Hermite(e,r,i,t,o){let a=o*o,s=o*a,c=2*s-3*a+1,u=-2*s+3*a,l=s-2*a+o,d=s-a,m=e.x*c+i.x*u+r.x*l+t.x*d,f=e.y*c+i.y*u+r.y*l+t.y*d;return new n(m,f)}static Hermite1stDerivative(e,r,i,t,o){return this.Hermite1stDerivativeToRef(e,r,i,t,o,new n)}static Hermite1stDerivativeToRef(e,r,i,t,o,a){let s=o*o;return a.x=(s-o)*6*e.x+(3*s-4*o+1)*r.x+(-s+o)*6*i.x+(3*s-2*o)*t.x,a.y=(s-o)*6*e.y+(3*s-4*o+1)*r.y+(-s+o)*6*i.y+(3*s-2*o)*t.y,a}static Lerp(e,r,i){return n.LerpToRef(e,r,i,new n)}static LerpToRef(e,r,i,t){return t.x=e.x+(r.x-e.x)*i,t.y=e.y+(r.y-e.y)*i,t}static Dot(e,r){return e.x*r.x+e.y*r.y}static Normalize(e){return n.NormalizeToRef(e,new n)}static NormalizeToRef(e,r){return e.normalizeToRef(r),r}static Minimize(e,r){let i=e.x<r.x?e.x:r.x,t=e.y<r.y?e.y:r.y;return new n(i,t)}static Maximize(e,r){let i=e.x>r.x?e.x:r.x,t=e.y>r.y?e.y:r.y;return new n(i,t)}static Transform(e,r){return n.TransformToRef(e,r,new n)}static TransformToRef(e,r,i){let t=r.m,o=e.x*t[0]+e.y*t[4]+t[12],a=e.x*t[1]+e.y*t[5]+t[13];return i.x=o,i.y=a,i}static PointInTriangle(e,r,i,t){let o=.5*(-i.y*t.x+r.y*(-i.x+t.x)+r.x*(i.y-t.y)+i.x*t.y),a=o<0?-1:1,s=(r.y*t.x-r.x*t.y+(t.y-r.y)*e.x+(r.x-t.x)*e.y)*a,c=(r.x*i.y-r.y*i.x+(r.y-i.y)*e.x+(i.x-r.x)*e.y)*a;return s>0&&c>0&&s+c<2*o*a}static Distance(e,r){return Math.sqrt(n.DistanceSquared(e,r))}static DistanceSquared(e,r){let i=e.x-r.x,t=e.y-r.y;return i*i+t*t}static Center(e,r){return n.CenterToRef(e,r,new n)}static CenterToRef(e,r,i){return i.copyFromFloats((e.x+r.x)/2,(e.y+r.y)/2)}static DistanceOfPointFromSegment(e,r,i){let t=n.DistanceSquared(r,i);if(t===0)return n.Distance(e,r);let o=i.subtract(r),a=Math.max(0,Math.min(1,n.Dot(e.subtract(r),o)/t)),s=r.add(o.multiplyByFloats(a,a));return n.Distance(e,s)}};We._V8PerformanceHack=new We(.5,.5);We._ZeroReadOnly=We.Zero();var R=class n{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}constructor(e=0,r=0,i=0){this._isDirty=!0,this._x=e,this._y=r,this._z=i}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z}}`}getClassName(){return"Vector3"}getHashCode(){let e=de(this._x),r=de(this._y),i=de(this._z),t=e;return t=t*397^r,t=t*397^i,t}asArray(){return[this._x,this._y,this._z]}toArray(e,r=0){return e[r]=this._x,e[r+1]=this._y,e[r+2]=this._z,this}fromArray(e,r=0){return n.FromArrayToRef(e,r,this),this}toQuaternion(){return ue.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._isDirty=!0,this}addInPlaceFromFloats(e,r,i){return this._x+=e,this._y+=r,this._z+=i,this._isDirty=!0,this}add(e){return new n(this._x+e._x,this._y+e._y,this._z+e._z)}addToRef(e,r){return r._x=this._x+e._x,r._y=this._y+e._y,r._z=this._z+e._z,r._isDirty=!0,r}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._isDirty=!0,this}subtract(e){return new n(this._x-e._x,this._y-e._y,this._z-e._z)}subtractToRef(e,r){return this.subtractFromFloatsToRef(e._x,e._y,e._z,r)}subtractFromFloats(e,r,i){return new n(this._x-e,this._y-r,this._z-i)}subtractFromFloatsToRef(e,r,i,t){return t._x=this._x-e,t._y=this._y-r,t._z=this._z-i,t._isDirty=!0,t}negate(){return new n(-this._x,-this._y,-this._z)}negateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(e){return e._x=this._x*-1,e._y=this._y*-1,e._z=this._z*-1,e._isDirty=!0,e}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._isDirty=!0,this}scale(e){return new n(this._x*e,this._y*e,this._z*e)}scaleToRef(e,r){return r._x=this._x*e,r._y=this._y*e,r._z=this._z*e,r._isDirty=!0,r}getNormalToRef(e){let r=this.length(),i=Math.acos(this._y/r),t=Math.atan2(this._z,this._x);i>Math.PI/2?i-=Math.PI/2:i+=Math.PI/2;let o=r*Math.sin(i)*Math.cos(t),a=r*Math.cos(i),s=r*Math.sin(i)*Math.sin(t);return e.set(o,a,s),e}applyRotationQuaternionToRef(e,r){let i=this._x,t=this._y,o=this._z,a=e._x,s=e._y,c=e._z,u=e._w,l=2*(s*o-c*t),d=2*(c*i-a*o),m=2*(a*t-s*i);return r._x=i+u*l+s*m-c*d,r._y=t+u*d+c*l-a*m,r._z=o+u*m+a*d-s*l,r._isDirty=!0,r}applyRotationQuaternionInPlace(e){return this.applyRotationQuaternionToRef(e,this)}applyRotationQuaternion(e){return this.applyRotationQuaternionToRef(e,new n)}scaleAndAddToRef(e,r){return r._x+=this._x*e,r._y+=this._y*e,r._z+=this._z*e,r._isDirty=!0,r}projectOnPlane(e,r){return this.projectOnPlaneToRef(e,r,new n)}projectOnPlaneToRef(e,r,i){let t=e.normal,o=e.d,a=w.Vector3[0];this.subtractToRef(r,a),a.normalize();let s=n.Dot(a,t);if(Math.abs(s)<1e-10)i.setAll(1/0);else{let c=-(n.Dot(r,t)+o)/s,u=a.scaleInPlace(c);r.addToRef(u,i)}return i}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z}equalsWithEpsilon(e,r=ce){return e&&X(this._x,e._x,r)&&X(this._y,e._y,r)&&X(this._z,e._z,r)}equalsToFloats(e,r,i){return this._x===e&&this._y===r&&this._z===i}multiplyInPlace(e){return this._x*=e._x,this._y*=e._y,this._z*=e._z,this._isDirty=!0,this}multiply(e){return this.multiplyByFloats(e._x,e._y,e._z)}multiplyToRef(e,r){return r._x=this._x*e._x,r._y=this._y*e._y,r._z=this._z*e._z,r._isDirty=!0,r}multiplyByFloats(e,r,i){return new n(this._x*e,this._y*r,this._z*i)}divide(e){return new n(this._x/e._x,this._y/e._y,this._z/e._z)}divideToRef(e,r){return r._x=this._x/e._x,r._y=this._y/e._y,r._z=this._z/e._z,r._isDirty=!0,r}divideInPlace(e){return this._x=this._x/e._x,this._y=this._y/e._y,this._z=this._z/e._z,this._isDirty=!0,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)}minimizeInPlaceFromFloats(e,r,i){return e<this._x&&(this.x=e),r<this._y&&(this.y=r),i<this._z&&(this.z=i),this}maximizeInPlaceFromFloats(e,r,i){return e>this._x&&(this.x=e),r>this._y&&(this.y=r),i>this._z&&(this.z=i),this}isNonUniformWithinEpsilon(e){let r=Math.abs(this._x),i=Math.abs(this._y);if(!X(r,i,e))return!0;let t=Math.abs(this._z);return!X(r,t,e)||!X(i,t,e)}get isNonUniform(){let e=Math.abs(this._x),r=Math.abs(this._y);if(e!==r)return!0;let i=Math.abs(this._z);return e!==i}floorToRef(e){return e._x=Math.floor(this._x),e._y=Math.floor(this._y),e._z=Math.floor(this._z),e._isDirty=!0,e}floor(){return new n(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))}fractToRef(e){return e._x=this._x-Math.floor(this._x),e._y=this._y-Math.floor(this._y),e._z=this._z-Math.floor(this._z),e._isDirty=!0,e}fract(){return new n(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){return this._x*this._y*this._z===0}normalize(){return this.normalizeFromLength(this.length())}reorderInPlace(e){if(e=e.toLowerCase(),e==="xyz")return this;let r=w.Vector3[0].copyFrom(this);return this.x=r[e[0]],this.y=r[e[1]],this.z=r[e[2]],this}rotateByQuaternionToRef(e,r){return e.toRotationMatrix(w.Matrix[0]),n.TransformCoordinatesToRef(this,w.Matrix[0],r),r}rotateByQuaternionAroundPointToRef(e,r,i){return this.subtractToRef(r,w.Vector3[0]),w.Vector3[0].rotateByQuaternionToRef(e,w.Vector3[0]),r.addToRef(w.Vector3[0],i),i}cross(e){return n.CrossToRef(this,e,new n)}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new n)}normalizeToRef(e){let r=this.length();return r===0||r===1?(e._x=this._x,e._y=this._y,e._z=this._z,e._isDirty=!0,e):this.scaleToRef(1/r,e)}clone(){return new n(this._x,this._y,this._z)}copyFrom(e){return this.copyFromFloats(e._x,e._y,e._z)}copyFromFloats(e,r,i){return this._x=e,this._y=r,this._z=i,this._isDirty=!0,this}set(e,r,i){return this.copyFromFloats(e,r,i)}setAll(e){return this._x=this._y=this._z=e,this._isDirty=!0,this}static GetClipFactor(e,r,i,t){let o=n.Dot(e,i),a=n.Dot(r,i);return(o-t)/(o-a)}static GetAngleBetweenVectors(e,r,i){let t=e.normalizeToRef(w.Vector3[1]),o=r.normalizeToRef(w.Vector3[2]),a=n.Dot(t,o);a=oe(a,-1,1);let s=Math.acos(a),c=w.Vector3[3];return n.CrossToRef(t,o,c),n.Dot(c,i)>0?isNaN(s)?0:s:isNaN(s)?-Math.PI:-Math.acos(a)}static GetAngleBetweenVectorsOnPlane(e,r,i){w.Vector3[0].copyFrom(e);let t=w.Vector3[0];w.Vector3[1].copyFrom(r);let o=w.Vector3[1];w.Vector3[2].copyFrom(i);let a=w.Vector3[2],s=w.Vector3[3],c=w.Vector3[4];t.normalize(),o.normalize(),a.normalize(),n.CrossToRef(a,t,s),n.CrossToRef(s,a,c);let u=Math.atan2(n.Dot(o,s),n.Dot(o,c));return pd(u)}static PitchYawRollToMoveBetweenPointsToRef(e,r,i){let t=Ie.Vector3[0];return r.subtractToRef(e,t),i._y=Math.atan2(t.x,t.z)||0,i._x=Math.atan2(Math.sqrt(t.x**2+t.z**2),t.y)||0,i._z=0,i._isDirty=!0,i}static PitchYawRollToMoveBetweenPoints(e,r){let i=n.Zero();return n.PitchYawRollToMoveBetweenPointsToRef(e,r,i)}static SlerpToRef(e,r,i,t){i=oe(i,0,1);let o=w.Vector3[0],a=w.Vector3[1];o.copyFrom(e);let s=o.length();o.normalizeFromLength(s),a.copyFrom(r);let c=a.length();a.normalizeFromLength(c);let u=n.Dot(o,a),l,d;if(u<1-ce){let m=Math.acos(u),f=1/Math.sin(m);l=Math.sin((1-i)*m)*f,d=Math.sin(i*m)*f}else l=1-i,d=i;return o.scaleInPlace(l),a.scaleInPlace(d),t.copyFrom(o).addInPlace(a),t.scaleInPlace(fd(s,c,i)),t}static SmoothToRef(e,r,i,t,o){return n.SlerpToRef(e,r,t===0?1:i/t,o),o}static FromArray(e,r=0){return new n(e[r],e[r+1],e[r+2])}static FromFloatArray(e,r){return n.FromArray(e,r)}static FromArrayToRef(e,r,i){return i._x=e[r],i._y=e[r+1],i._z=e[r+2],i._isDirty=!0,i}static FromFloatArrayToRef(e,r,i){return n.FromArrayToRef(e,r,i)}static FromFloatsToRef(e,r,i,t){return t.copyFromFloats(e,r,i),t}static Zero(){return new n(0,0,0)}static One(){return new n(1,1,1)}static Up(){return new n(0,1,0)}static get UpReadOnly(){return n._UpReadOnly}static get DownReadOnly(){return n._DownReadOnly}static get RightReadOnly(){return n._RightReadOnly}static get LeftReadOnly(){return n._LeftReadOnly}static get LeftHandedForwardReadOnly(){return n._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return n._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return n._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return n._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return n._ZeroReadOnly}static get OneReadOnly(){return n._OneReadOnly}static Down(){return new n(0,-1,0)}static Forward(e=!1){return new n(0,0,e?-1:1)}static Backward(e=!1){return new n(0,0,e?1:-1)}static Right(){return new n(1,0,0)}static Left(){return new n(-1,0,0)}static Random(e=0,r=1){return new n(G(e,r),G(e,r),G(e,r))}static RandomToRef(e=0,r=1,i){return i.copyFromFloats(G(e,r),G(e,r),G(e,r))}static TransformCoordinates(e,r){let i=n.Zero();return n.TransformCoordinatesToRef(e,r,i),i}static TransformCoordinatesToRef(e,r,i){return n.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,r,i),i}static TransformCoordinatesFromFloatsToRef(e,r,i,t,o){let a=t.m,s=e*a[0]+r*a[4]+i*a[8]+a[12],c=e*a[1]+r*a[5]+i*a[9]+a[13],u=e*a[2]+r*a[6]+i*a[10]+a[14],l=1/(e*a[3]+r*a[7]+i*a[11]+a[15]);return o._x=s*l,o._y=c*l,o._z=u*l,o._isDirty=!0,o}static TransformNormal(e,r){let i=n.Zero();return n.TransformNormalToRef(e,r,i),i}static TransformNormalToRef(e,r,i){return this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,r,i),i}static TransformNormalFromFloatsToRef(e,r,i,t,o){let a=t.m;return o._x=e*a[0]+r*a[4]+i*a[8],o._y=e*a[1]+r*a[5]+i*a[9],o._z=e*a[2]+r*a[6]+i*a[10],o._isDirty=!0,o}static CatmullRom(e,r,i,t,o){let a=o*o,s=o*a,c=.5*(2*r._x+(-e._x+i._x)*o+(2*e._x-5*r._x+4*i._x-t._x)*a+(-e._x+3*r._x-3*i._x+t._x)*s),u=.5*(2*r._y+(-e._y+i._y)*o+(2*e._y-5*r._y+4*i._y-t._y)*a+(-e._y+3*r._y-3*i._y+t._y)*s),l=.5*(2*r._z+(-e._z+i._z)*o+(2*e._z-5*r._z+4*i._z-t._z)*a+(-e._z+3*r._z-3*i._z+t._z)*s);return new n(c,u,l)}static Clamp(e,r,i){let t=new n;return n.ClampToRef(e,r,i,t),t}static ClampToRef(e,r,i,t){let o=e._x;o=o>i._x?i._x:o,o=o<r._x?r._x:o;let a=e._y;a=a>i._y?i._y:a,a=a<r._y?r._y:a;let s=e._z;return s=s>i._z?i._z:s,s=s<r._z?r._z:s,t.copyFromFloats(o,a,s),t}static CheckExtends(e,r,i){r.minimizeInPlace(e),i.maximizeInPlace(e)}static Hermite(e,r,i,t,o){let a=o*o,s=o*a,c=2*s-3*a+1,u=-2*s+3*a,l=s-2*a+o,d=s-a,m=e._x*c+i._x*u+r._x*l+t._x*d,f=e._y*c+i._y*u+r._y*l+t._y*d,h=e._z*c+i._z*u+r._z*l+t._z*d;return new n(m,f,h)}static Hermite1stDerivative(e,r,i,t,o){let a=new n;return this.Hermite1stDerivativeToRef(e,r,i,t,o,a),a}static Hermite1stDerivativeToRef(e,r,i,t,o,a){let s=o*o;return a._x=(s-o)*6*e._x+(3*s-4*o+1)*r._x+(-s+o)*6*i._x+(3*s-2*o)*t._x,a._y=(s-o)*6*e._y+(3*s-4*o+1)*r._y+(-s+o)*6*i._y+(3*s-2*o)*t._y,a._z=(s-o)*6*e._z+(3*s-4*o+1)*r._z+(-s+o)*6*i._z+(3*s-2*o)*t._z,a._isDirty=!0,a}static Lerp(e,r,i){let t=new n(0,0,0);return n.LerpToRef(e,r,i,t),t}static LerpToRef(e,r,i,t){return t._x=e._x+(r._x-e._x)*i,t._y=e._y+(r._y-e._y)*i,t._z=e._z+(r._z-e._z)*i,t._isDirty=!0,t}static Dot(e,r){return e._x*r._x+e._y*r._y+e._z*r._z}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z}static Cross(e,r){let i=new n;return n.CrossToRef(e,r,i),i}static CrossToRef(e,r,i){let t=e._y*r._z-e._z*r._y,o=e._z*r._x-e._x*r._z,a=e._x*r._y-e._y*r._x;return i.copyFromFloats(t,o,a),i}static Normalize(e){let r=n.Zero();return n.NormalizeToRef(e,r),r}static NormalizeToRef(e,r){return e.normalizeToRef(r),r}static Project(e,r,i,t){let o=new n;return n.ProjectToRef(e,r,i,t,o),o}static ProjectToRef(e,r,i,t,o){let a=t.width,s=t.height,c=t.x,u=t.y,l=w.Matrix[1],d=Le.LastCreatedEngine?.isNDCHalfZRange,m=d?1:.5,f=d?0:.5;me.FromValuesToRef(a/2,0,0,0,0,-s/2,0,0,0,0,m,0,c+a/2,s/2+u,f,1,l);let h=w.Matrix[0];return r.multiplyToRef(i,h),h.multiplyToRef(l,h),n.TransformCoordinatesToRef(e,h,o),o}static Reflect(e,r){return this.ReflectToRef(e,r,new n)}static ReflectToRef(e,r,i){let t=Ie.Vector3[0];return t.copyFrom(r).scaleInPlace(2*n.Dot(e,r)),i.copyFrom(e).subtractInPlace(t)}static UnprojectFromTransform(e,r,i,t,o){return this.Unproject(e,r,i,t,o,me.IdentityReadOnly)}static Unproject(e,r,i,t,o,a){let s=new n;return n.UnprojectToRef(e,r,i,t,o,a,s),s}static UnprojectToRef(e,r,i,t,o,a,s){return n.UnprojectFloatsToRef(e._x,e._y,e._z,r,i,t,o,a,s),s}static UnprojectFloatsToRef(e,r,i,t,o,a,s,c,u){let l=w.Matrix[0];a.multiplyToRef(s,l),l.multiplyToRef(c,l),l.invert();let d=w.Vector3[0];return d.x=e/t*2-1,d.y=-(r/o*2-1),Le.LastCreatedEngine?.isNDCHalfZRange?d.z=i:d.z=2*i-1,n.TransformCoordinatesToRef(d,l,u),u}static Minimize(e,r){let i=new n;return i.copyFrom(e),i.minimizeInPlace(r),i}static Maximize(e,r){let i=new n;return i.copyFrom(e),i.maximizeInPlace(r),i}static Distance(e,r){return Math.sqrt(n.DistanceSquared(e,r))}static DistanceSquared(e,r){let i=e._x-r._x,t=e._y-r._y,o=e._z-r._z;return i*i+t*t+o*o}static ProjectOnTriangleToRef(e,r,i,t,o){let a=w.Vector3[0],s=w.Vector3[1],c=w.Vector3[2],u=w.Vector3[3],l=w.Vector3[4];i.subtractToRef(r,a),t.subtractToRef(r,s),t.subtractToRef(i,c);let d=a.length(),m=s.length(),f=c.length();if(d<ce||m<ce||f<ce)return o.copyFrom(r),n.Distance(e,r);e.subtractToRef(r,l),n.CrossToRef(a,s,u);let h=u.length();if(h<ce)return o.copyFrom(r),n.Distance(e,r);u.normalizeFromLength(h);let _=l.length();if(_<ce)return o.copyFrom(r),0;l.normalizeFromLength(_);let z=n.Dot(u,l),P=w.Vector3[5],x=w.Vector3[6];P.copyFrom(u).scaleInPlace(-_*z),x.copyFrom(e).addInPlace(P);let T=w.Vector3[4],D=w.Vector3[5],A=w.Vector3[7],S=w.Vector3[8];T.copyFrom(a).scaleInPlace(1/d),S.copyFrom(s).scaleInPlace(1/m),T.addInPlace(S).scaleInPlace(-1),D.copyFrom(a).scaleInPlace(-1/d),S.copyFrom(c).scaleInPlace(1/f),D.addInPlace(S).scaleInPlace(-1),A.copyFrom(c).scaleInPlace(-1/f),S.copyFrom(s).scaleInPlace(-1/m),A.addInPlace(S).scaleInPlace(-1);let Z=w.Vector3[9],K;Z.copyFrom(x).subtractInPlace(r),n.CrossToRef(T,Z,S),K=n.Dot(S,u);let ge=K;Z.copyFrom(x).subtractInPlace(i),n.CrossToRef(D,Z,S),K=n.Dot(S,u);let le=K;Z.copyFrom(x).subtractInPlace(t),n.CrossToRef(A,Z,S),K=n.Dot(S,u);let ve=K,re=w.Vector3[10],te,H;ge>0&&le<0?(re.copyFrom(a),te=r,H=i):le>0&&ve<0?(re.copyFrom(c),te=i,H=t):(re.copyFrom(s).scaleInPlace(-1),te=t,H=r);let Ce=w.Vector3[9],Ue=w.Vector3[4];if(te.subtractToRef(x,S),H.subtractToRef(x,Ce),n.CrossToRef(S,Ce,Ue),!(n.Dot(Ue,u)<0))return o.copyFrom(x),Math.abs(_*z);let De=w.Vector3[5];n.CrossToRef(re,Ue,De),De.normalize();let Oe=w.Vector3[9];Oe.copyFrom(te).subtractInPlace(x);let Ne=Oe.length();if(Ne<ce)return o.copyFrom(te),n.Distance(e,te);Oe.normalizeFromLength(Ne);let qe=n.Dot(De,Oe),Qe=w.Vector3[7];Qe.copyFrom(x).addInPlace(De.scaleInPlace(Ne*qe)),S.copyFrom(Qe).subtractInPlace(te),_=re.length(),re.normalizeFromLength(_);let Ot=n.Dot(S,re)/Math.max(_,ce);return Ot=oe(Ot,0,1),Qe.copyFrom(te).addInPlace(re.scaleInPlace(Ot*_)),o.copyFrom(Qe),n.Distance(e,Qe)}static Center(e,r){return n.CenterToRef(e,r,n.Zero())}static CenterToRef(e,r,i){return i.copyFromFloats((e._x+r._x)/2,(e._y+r._y)/2,(e._z+r._z)/2)}static RotationFromAxis(e,r,i){let t=new n;return n.RotationFromAxisToRef(e,r,i,t),t}static RotationFromAxisToRef(e,r,i,t){let o=w.Quaternion[0];return ue.RotationQuaternionFromAxisToRef(e,r,i,o),o.toEulerAnglesToRef(t),t}};R._V8PerformanceHack=new R(.5,.5,.5);R._UpReadOnly=R.Up();R._DownReadOnly=R.Down();R._LeftHandedForwardReadOnly=R.Forward(!1);R._RightHandedForwardReadOnly=R.Forward(!0);R._LeftHandedBackwardReadOnly=R.Backward(!1);R._RightHandedBackwardReadOnly=R.Backward(!0);R._RightReadOnly=R.Right();R._LeftReadOnly=R.Left();R._ZeroReadOnly=R.Zero();R._OneReadOnly=R.One();var Me=class n{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,r=0,i=0,t=0){this._isDirty=!0,this._x=e,this._y=r,this._z=i,this._w=t}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Vector4"}getHashCode(){let e=de(this._x),r=de(this._y),i=de(this._z),t=de(this._w),o=e;return o=o*397^r,o=o*397^i,o=o*397^t,o}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,r){return r===void 0&&(r=0),e[r]=this._x,e[r+1]=this._y,e[r+2]=this._z,e[r+3]=this._w,this}fromArray(e,r=0){return n.FromArrayToRef(e,r,this),this}addInPlace(e){return this.x+=e._x,this.y+=e._y,this.z+=e._z,this.w+=e._w,this}addInPlaceFromFloats(e,r,i,t){return this.x+=e,this.y+=r,this.z+=i,this.w+=t,this}add(e){return new n(this._x+e.x,this._y+e.y,this._z+e.z,this._w+e.w)}addToRef(e,r){return r.x=this._x+e.x,r.y=this._y+e.y,r.z=this._z+e.z,r.w=this._w+e.w,r}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subtract(e){return new n(this._x-e.x,this._y-e.y,this._z-e.z,this._w-e.w)}subtractToRef(e,r){return r.x=this._x-e.x,r.y=this._y-e.y,r.z=this._z-e.z,r.w=this._w-e.w,r}subtractFromFloats(e,r,i,t){return new n(this._x-e,this._y-r,this._z-i,this._w-t)}subtractFromFloatsToRef(e,r,i,t,o){return o.x=this._x-e,o.y=this._y-r,o.z=this._z-i,o.w=this._w-t,o}negate(){return new n(-this._x,-this._y,-this._z,-this._w)}negateInPlace(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this}negateToRef(e){return e.x=-this._x,e.y=-this._y,e.z=-this._z,e.w=-this._w,e}scaleInPlace(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}scale(e){return new n(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,r){return r.x=this._x*e,r.y=this._y*e,r.z=this._z*e,r.w=this._w*e,r}scaleAndAddToRef(e,r){return r.x+=this._x*e,r.y+=this._y*e,r.z+=this._z*e,r.w+=this._w*e,r}equals(e){return e&&this._x===e.x&&this._y===e.y&&this._z===e.z&&this._w===e.w}equalsWithEpsilon(e,r=ce){return e&&X(this._x,e.x,r)&&X(this._y,e.y,r)&&X(this._z,e.z,r)&&X(this._w,e.w,r)}equalsToFloats(e,r,i,t){return this._x===e&&this._y===r&&this._z===i&&this._w===t}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiply(e){return new n(this._x*e.x,this._y*e.y,this._z*e.z,this._w*e.w)}multiplyToRef(e,r){return r.x=this._x*e.x,r.y=this._y*e.y,r.z=this._z*e.z,r.w=this._w*e.w,r}multiplyByFloats(e,r,i,t){return new n(this._x*e,this._y*r,this._z*i,this._w*t)}divide(e){return new n(this._x/e.x,this._y/e.y,this._z/e.z,this._w/e.w)}divideToRef(e,r){return r.x=this._x/e.x,r.y=this._y/e.y,r.z=this._z/e.z,r.w=this._w/e.w,r}divideInPlace(e){return this.divideToRef(e,this)}minimizeInPlace(e){return e.x<this._x&&(this.x=e.x),e.y<this._y&&(this.y=e.y),e.z<this._z&&(this.z=e.z),e.w<this._w&&(this.w=e.w),this}maximizeInPlace(e){return e.x>this._x&&(this.x=e.x),e.y>this._y&&(this.y=e.y),e.z>this._z&&(this.z=e.z),e.w>this._w&&(this.w=e.w),this}minimizeInPlaceFromFloats(e,r,i,t){return this.x=Math.min(e,this._x),this.y=Math.min(r,this._y),this.z=Math.min(i,this._z),this.w=Math.min(t,this._w),this}maximizeInPlaceFromFloats(e,r,i,t){return this.x=Math.max(e,this._x),this.y=Math.max(r,this._y),this.z=Math.max(i,this._z),this.w=Math.max(t,this._w),this}floorToRef(e){return e.x=Math.floor(this._x),e.y=Math.floor(this._y),e.z=Math.floor(this._z),e.w=Math.floor(this._w),e}floor(){return new n(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z),Math.floor(this._w))}fractToRef(e){return e.x=this._x-Math.floor(this._x),e.y=this._y-Math.floor(this._y),e.z=this._z-Math.floor(this._z),e.w=this._w-Math.floor(this._w),e}fract(){return new n(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z),this._w-Math.floor(this._w))}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new n)}normalizeToRef(e){let r=this.length();return r===0||r===1?(e.x=this._x,e.y=this._y,e.z=this._z,e.w=this._w,e):this.scaleToRef(1/r,e)}toVector3(){return new R(this._x,this._y,this._z)}clone(){return new n(this._x,this._y,this._z,this._w)}copyFrom(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}copyFromFloats(e,r,i,t){return this.x=e,this.y=r,this.z=i,this.w=t,this}set(e,r,i,t){return this.copyFromFloats(e,r,i,t)}setAll(e){return this.x=this.y=this.z=this.w=e,this}dot(e){return this._x*e.x+this._y*e.y+this._z*e.z+this._w*e.w}static FromArray(e,r){return r||(r=0),new n(e[r],e[r+1],e[r+2],e[r+3])}static FromArrayToRef(e,r,i){return i.x=e[r],i.y=e[r+1],i.z=e[r+2],i.w=e[r+3],i}static FromFloatArrayToRef(e,r,i){return n.FromArrayToRef(e,r,i),i}static FromFloatsToRef(e,r,i,t,o){return o.x=e,o.y=r,o.z=i,o.w=t,o}static Zero(){return new n(0,0,0,0)}static One(){return new n(1,1,1,1)}static Random(e=0,r=1){return new n(G(e,r),G(e,r),G(e,r),G(e,r))}static RandomToRef(e=0,r=1,i){return i.x=G(e,r),i.y=G(e,r),i.z=G(e,r),i.w=G(e,r),i}static Clamp(e,r,i){return n.ClampToRef(e,r,i,new n)}static ClampToRef(e,r,i,t){return t.x=oe(e.x,r.x,i.x),t.y=oe(e.y,r.y,i.y),t.z=oe(e.z,r.z,i.z),t.w=oe(e.w,r.w,i.w),t}static CheckExtends(e,r,i){r.minimizeInPlace(e),i.maximizeInPlace(e)}static get ZeroReadOnly(){return n._ZeroReadOnly}static Normalize(e){return n.NormalizeToRef(e,new n)}static NormalizeToRef(e,r){return e.normalizeToRef(r),r}static Minimize(e,r){let i=new n;return i.copyFrom(e),i.minimizeInPlace(r),i}static Maximize(e,r){let i=new n;return i.copyFrom(e),i.maximizeInPlace(r),i}static Distance(e,r){return Math.sqrt(n.DistanceSquared(e,r))}static DistanceSquared(e,r){let i=e.x-r.x,t=e.y-r.y,o=e.z-r.z,a=e.w-r.w;return i*i+t*t+o*o+a*a}static Center(e,r){return n.CenterToRef(e,r,new n)}static CenterToRef(e,r,i){return i.x=(e.x+r.x)/2,i.y=(e.y+r.y)/2,i.z=(e.z+r.z)/2,i.w=(e.w+r.w)/2,i}static TransformCoordinates(e,r){return n.TransformCoordinatesToRef(e,r,new n)}static TransformCoordinatesToRef(e,r,i){return n.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,r,i),i}static TransformCoordinatesFromFloatsToRef(e,r,i,t,o){let a=t.m,s=e*a[0]+r*a[4]+i*a[8]+a[12],c=e*a[1]+r*a[5]+i*a[9]+a[13],u=e*a[2]+r*a[6]+i*a[10]+a[14],l=e*a[3]+r*a[7]+i*a[11]+a[15];return o.x=s,o.y=c,o.z=u,o.w=l,o}static TransformNormal(e,r){return n.TransformNormalToRef(e,r,new n)}static TransformNormalToRef(e,r,i){let t=r.m,o=e.x*t[0]+e.y*t[4]+e.z*t[8],a=e.x*t[1]+e.y*t[5]+e.z*t[9],s=e.x*t[2]+e.y*t[6]+e.z*t[10];return i.x=o,i.y=a,i.z=s,i.w=e.w,i}static TransformNormalFromFloatsToRef(e,r,i,t,o,a){let s=o.m;return a.x=e*s[0]+r*s[4]+i*s[8],a.y=e*s[1]+r*s[5]+i*s[9],a.z=e*s[2]+r*s[6]+i*s[10],a.w=t,a}static FromVector3(e,r=0){return new n(e._x,e._y,e._z,r)}static Dot(e,r){return e.x*r.x+e.y*r.y+e.z*r.z+e.w*r.w}};Me._V8PerformanceHack=new Me(.5,.5,.5,.5);Me._ZeroReadOnly=Me.Zero();var ue=class n{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,r=0,i=0,t=1){this._isDirty=!0,this._x=e,this._y=r,this._z=i,this._w=t}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Quaternion"}getHashCode(){let e=de(this._x),r=de(this._y),i=de(this._z),t=de(this._w),o=e;return o=o*397^r,o=o*397^i,o=o*397^t,o}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,r=0){return e[r]=this._x,e[r+1]=this._y,e[r+2]=this._z,e[r+3]=this._w,this}fromArray(e,r=0){return n.FromArrayToRef(e,r,this)}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w}equalsWithEpsilon(e,r=ce){return e&&X(this._x,e._x,r)&&X(this._y,e._y,r)&&X(this._z,e._z,r)&&X(this._w,e._w,r)}isApprox(e,r=ce){return e&&(X(this._x,e._x,r)&&X(this._y,e._y,r)&&X(this._z,e._z,r)&&X(this._w,e._w,r)||X(this._x,-e._x,r)&&X(this._y,-e._y,r)&&X(this._z,-e._z,r)&&X(this._w,-e._w,r))}clone(){return new n(this._x,this._y,this._z,this._w)}copyFrom(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._w=e._w,this._isDirty=!0,this}copyFromFloats(e,r,i,t){return this._x=e,this._y=r,this._z=i,this._w=t,this._isDirty=!0,this}set(e,r,i,t){return this.copyFromFloats(e,r,i,t)}setAll(e){return this.copyFromFloats(e,e,e,e)}add(e){return new n(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this._isDirty=!0,this}addToRef(e,r){return r._x=this._x+e._x,r._y=this._y+e._y,r._z=this._z+e._z,r._w=this._w+e._w,r._isDirty=!0,r}addInPlaceFromFloats(e,r,i,t){return this._x+=e,this._y+=r,this._z+=i,this._w+=t,this._isDirty=!0,this}subtractToRef(e,r){return r._x=this._x-e._x,r._y=this._y-e._y,r._z=this._z-e._z,r._w=this._w-e._w,r._isDirty=!0,r}subtractFromFloats(e,r,i,t){return this.subtractFromFloatsToRef(e,r,i,t,new n)}subtractFromFloatsToRef(e,r,i,t,o){return o._x=this._x-e,o._y=this._y-r,o._z=this._z-i,o._w=this._w-t,o._isDirty=!0,o}subtract(e){return new n(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._w-=e._w,this._isDirty=!0,this}scale(e){return new n(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,r){return r._x=this._x*e,r._y=this._y*e,r._z=this._z*e,r._w=this._w*e,r._isDirty=!0,r}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._w*=e,this._isDirty=!0,this}scaleAndAddToRef(e,r){return r._x+=this._x*e,r._y+=this._y*e,r._z+=this._z*e,r._w+=this._w*e,r._isDirty=!0,r}multiply(e){let r=new n(0,0,0,1);return this.multiplyToRef(e,r),r}multiplyToRef(e,r){let i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,t=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,o=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,a=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return r.copyFromFloats(i,t,o,a),r}multiplyInPlace(e){return this.multiplyToRef(e,this)}multiplyByFloats(e,r,i,t){return this._x*=e,this._y*=r,this._z*=i,this._w*=t,this._isDirty=!0,this}divide(e){throw new ReferenceError("Can not divide a quaternion")}divideToRef(e,r){throw new ReferenceError("Can not divide a quaternion")}divideInPlace(e){throw new ReferenceError("Can not divide a quaternion")}minimizeInPlace(){throw new ReferenceError("Can not minimize a quaternion")}minimizeInPlaceFromFloats(){throw new ReferenceError("Can not minimize a quaternion")}maximizeInPlace(){throw new ReferenceError("Can not maximize a quaternion")}maximizeInPlaceFromFloats(){throw new ReferenceError("Can not maximize a quaternion")}negate(){return this.negateToRef(new n)}negateInPlace(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._w=-this._w,this._isDirty=!0,this}negateToRef(e){return e._x=-this._x,e._y=-this._y,e._z=-this._z,e._w=-this._w,e._isDirty=!0,e}equalsToFloats(e,r,i,t){return this._x===e&&this._y===r&&this._z===i&&this._w===t}floorToRef(e){throw new ReferenceError("Can not floor a quaternion")}floor(){throw new ReferenceError("Can not floor a quaternion")}fractToRef(e){throw new ReferenceError("Can not fract a quaternion")}fract(){throw new ReferenceError("Can not fract a quaternion")}conjugateToRef(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),e}conjugateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){return new n(-this._x,-this._y,-this._z,this._w)}invert(){let e=this.conjugate(),r=this.lengthSquared();return r==0||r==1||e.scaleInPlace(1/r),e}invertInPlace(){this.conjugateInPlace();let e=this.lengthSquared();return e==0||e==1?this:(this.scaleInPlace(1/e),this)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this.lengthSquared())}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){let e=new n(0,0,0,1);return this.normalizeToRef(e),e}normalizeToRef(e){let r=this.length();return r===0||r===1?e.copyFromFloats(this._x,this._y,this._z,this._w):this.scaleToRef(1/r,e)}toEulerAngles(){let e=R.Zero();return this.toEulerAnglesToRef(e),e}toEulerAnglesToRef(e){let r=this._z,i=this._x,t=this._y,o=this._w,a=t*r-i*o,s=.4999999;if(a<-s)e._y=2*Math.atan2(t,o),e._x=Math.PI/2,e._z=0,e._isDirty=!0;else if(a>s)e._y=2*Math.atan2(t,o),e._x=-Math.PI/2,e._z=0,e._isDirty=!0;else{let c=o*o,u=r*r,l=i*i,d=t*t;e._z=Math.atan2(2*(i*t+r*o),-u-l+d+c),e._x=Math.asin(-2*a),e._y=Math.atan2(2*(r*i+t*o),u-l-d+c),e._isDirty=!0}return e}toAlphaBetaGammaToRef(e){let r=this._z,i=this._x,t=this._y,o=this._w,a=Math.sqrt(i*i+t*t),s=Math.sqrt(r*r+o*o),c=2*Math.atan2(a,s),u=2*Math.atan2(r,o),l=2*Math.atan2(t,i),d=(u+l)/2,m=(u-l)/2;return e.set(m,c,d),e}toRotationMatrix(e){return me.FromQuaternionToRef(this,e),e}fromRotationMatrix(e){return n.FromRotationMatrixToRef(e,this),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}toAxisAngle(){let e=R.Zero(),r=this.toAxisAngleToRef(e);return{axis:e,angle:r}}toAxisAngleToRef(e){let r,i=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z),t=this._w;return i>0?(r=2*Math.atan2(i,t),e.set(this._x/i,this._y/i,this._z/i)):(r=0,e.set(1,0,0)),r}static FromRotationMatrix(e){let r=new n;return n.FromRotationMatrixToRef(e,r),r}static FromRotationMatrixToRef(e,r){let i=e.m,t=i[0],o=i[4],a=i[8],s=i[1],c=i[5],u=i[9],l=i[2],d=i[6],m=i[10],f=t+c+m,h;return f>0?(h=.5/Math.sqrt(f+1),r._w=.25/h,r._x=(d-u)*h,r._y=(a-l)*h,r._z=(s-o)*h,r._isDirty=!0):t>c&&t>m?(h=2*Math.sqrt(1+t-c-m),r._w=(d-u)/h,r._x=.25*h,r._y=(o+s)/h,r._z=(a+l)/h,r._isDirty=!0):c>m?(h=2*Math.sqrt(1+c-t-m),r._w=(a-l)/h,r._x=(o+s)/h,r._y=.25*h,r._z=(u+d)/h,r._isDirty=!0):(h=2*Math.sqrt(1+m-t-c),r._w=(s-o)/h,r._x=(a+l)/h,r._y=(u+d)/h,r._z=.25*h,r._isDirty=!0),r}static Dot(e,r){return e._x*r._x+e._y*r._y+e._z*r._z+e._w*r._w}static AreClose(e,r,i=.1){let t=n.Dot(e,r);return 1-t*t<=i}static SmoothToRef(e,r,i,t,o){let a=t===0?1:i/t;return a=oe(a,0,1),n.SlerpToRef(e,r,a,o),o}static Zero(){return new n(0,0,0,0)}static Inverse(e){return new n(-e._x,-e._y,-e._z,e._w)}static InverseToRef(e,r){return r.set(-e._x,-e._y,-e._z,e._w),r}static Identity(){return new n(0,0,0,1)}static IsIdentity(e){return e&&e._x===0&&e._y===0&&e._z===0&&e._w===1}static RotationAxis(e,r){return n.RotationAxisToRef(e,r,new n)}static RotationAxisToRef(e,r,i){i._w=Math.cos(r/2);let t=Math.sin(r/2)/e.length();return i._x=e._x*t,i._y=e._y*t,i._z=e._z*t,i._isDirty=!0,i}static FromArray(e,r){return r||(r=0),new n(e[r],e[r+1],e[r+2],e[r+3])}static FromArrayToRef(e,r,i){return i._x=e[r],i._y=e[r+1],i._z=e[r+2],i._w=e[r+3],i._isDirty=!0,i}static FromFloatsToRef(e,r,i,t,o){return o.copyFromFloats(e,r,i,t),o}static FromEulerAngles(e,r,i){let t=new n;return n.RotationYawPitchRollToRef(r,e,i,t),t}static FromEulerAnglesToRef(e,r,i,t){return n.RotationYawPitchRollToRef(r,e,i,t),t}static FromEulerVector(e){let r=new n;return n.RotationYawPitchRollToRef(e._y,e._x,e._z,r),r}static FromEulerVectorToRef(e,r){return n.RotationYawPitchRollToRef(e._y,e._x,e._z,r),r}static FromUnitVectorsToRef(e,r,i,t=ce){let o=R.Dot(e,r)+1;return o<t?Math.abs(e.x)>Math.abs(e.z)?i.set(-e.y,e.x,0,0):i.set(0,-e.z,e.y,0):(R.CrossToRef(e,r,Ie.Vector3[0]),i.set(Ie.Vector3[0].x,Ie.Vector3[0].y,Ie.Vector3[0].z,o)),i.normalize()}static RotationYawPitchRoll(e,r,i){let t=new n;return n.RotationYawPitchRollToRef(e,r,i,t),t}static RotationYawPitchRollToRef(e,r,i,t){let o=i*.5,a=r*.5,s=e*.5,c=Math.sin(o),u=Math.cos(o),l=Math.sin(a),d=Math.cos(a),m=Math.sin(s),f=Math.cos(s);return t._x=f*l*u+m*d*c,t._y=m*d*u-f*l*c,t._z=f*d*c-m*l*u,t._w=f*d*u+m*l*c,t._isDirty=!0,t}static RotationAlphaBetaGamma(e,r,i){let t=new n;return n.RotationAlphaBetaGammaToRef(e,r,i,t),t}static RotationAlphaBetaGammaToRef(e,r,i,t){let o=(i+e)*.5,a=(i-e)*.5,s=r*.5;return t._x=Math.cos(a)*Math.sin(s),t._y=Math.sin(a)*Math.sin(s),t._z=Math.sin(o)*Math.cos(s),t._w=Math.cos(o)*Math.cos(s),t._isDirty=!0,t}static RotationQuaternionFromAxis(e,r,i){let t=new n(0,0,0,0);return n.RotationQuaternionFromAxisToRef(e,r,i,t),t}static RotationQuaternionFromAxisToRef(e,r,i,t){let o=w.Matrix[0];return e=e.normalizeToRef(w.Vector3[0]),r=r.normalizeToRef(w.Vector3[1]),i=i.normalizeToRef(w.Vector3[2]),me.FromXYZAxesToRef(e,r,i,o),n.FromRotationMatrixToRef(o,t),t}static FromLookDirectionLH(e,r){let i=new n;return n.FromLookDirectionLHToRef(e,r,i),i}static FromLookDirectionLHToRef(e,r,i){let t=w.Matrix[0];return me.LookDirectionLHToRef(e,r,t),n.FromRotationMatrixToRef(t,i),i}static FromLookDirectionRH(e,r){let i=new n;return n.FromLookDirectionRHToRef(e,r,i),i}static FromLookDirectionRHToRef(e,r,i){let t=w.Matrix[0];return me.LookDirectionRHToRef(e,r,t),n.FromRotationMatrixToRef(t,i)}static Slerp(e,r,i){let t=n.Identity();return n.SlerpToRef(e,r,i,t),t}static SlerpToRef(e,r,i,t){let o,a,s=e._x*r._x+e._y*r._y+e._z*r._z+e._w*r._w,c=!1;if(s<0&&(c=!0,s=-s),s>.999999)a=1-i,o=c?-i:i;else{let u=Math.acos(s),l=1/Math.sin(u);a=Math.sin((1-i)*u)*l,o=c?-Math.sin(i*u)*l:Math.sin(i*u)*l}return t._x=a*e._x+o*r._x,t._y=a*e._y+o*r._y,t._z=a*e._z+o*r._z,t._w=a*e._w+o*r._w,t._isDirty=!0,t}static Hermite(e,r,i,t,o){let a=o*o,s=o*a,c=2*s-3*a+1,u=-2*s+3*a,l=s-2*a+o,d=s-a,m=e._x*c+i._x*u+r._x*l+t._x*d,f=e._y*c+i._y*u+r._y*l+t._y*d,h=e._z*c+i._z*u+r._z*l+t._z*d,_=e._w*c+i._w*u+r._w*l+t._w*d;return new n(m,f,h,_)}static Hermite1stDerivative(e,r,i,t,o){let a=new n;return this.Hermite1stDerivativeToRef(e,r,i,t,o,a),a}static Hermite1stDerivativeToRef(e,r,i,t,o,a){let s=o*o;return a._x=(s-o)*6*e._x+(3*s-4*o+1)*r._x+(-s+o)*6*i._x+(3*s-2*o)*t._x,a._y=(s-o)*6*e._y+(3*s-4*o+1)*r._y+(-s+o)*6*i._y+(3*s-2*o)*t._y,a._z=(s-o)*6*e._z+(3*s-4*o+1)*r._z+(-s+o)*6*i._z+(3*s-2*o)*t._z,a._w=(s-o)*6*e._w+(3*s-4*o+1)*r._w+(-s+o)*6*i._w+(3*s-2*o)*t._w,a._isDirty=!0,a}static Normalize(e){let r=n.Zero();return n.NormalizeToRef(e,r),r}static NormalizeToRef(e,r){return e.normalizeToRef(r),r}static Clamp(e,r,i){let t=new n;return n.ClampToRef(e,r,i,t),t}static ClampToRef(e,r,i,t){return t.copyFromFloats(oe(e.x,r.x,i.x),oe(e.y,r.y,i.y),oe(e.z,r.z,i.z),oe(e.w,r.w,i.w))}static Random(e=0,r=1){return new n(G(e,r),G(e,r),G(e,r),G(e,r))}static RandomToRef(e=0,r=1,i){return i.copyFromFloats(G(e,r),G(e,r),G(e,r),G(e,r))}static Minimize(){throw new ReferenceError("Quaternion.Minimize does not make sense")}static Maximize(){throw new ReferenceError("Quaternion.Maximize does not make sense")}static Distance(e,r){return Math.sqrt(n.DistanceSquared(e,r))}static DistanceSquared(e,r){let i=e.x-r.x,t=e.y-r.y,o=e.z-r.z,a=e.w-r.w;return i*i+t*t+o*o+a*a}static Center(e,r){return n.CenterToRef(e,r,n.Zero())}static CenterToRef(e,r,i){return i.copyFromFloats((e.x+r.x)/2,(e.y+r.y)/2,(e.z+r.z)/2,(e.w+r.w)/2)}};ue._V8PerformanceHack=new ue(.5,.5,.5,.5);var me=class n{static get Use64Bits(){return ke.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=gn._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(e,r=!1,i=!1,t=!0){this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=this._isIdentity?!1:r,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:t}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,ke.MatrixTrackPrecisionChange&&ke.MatrixTrackedMatrices.push(this),this._m=new ke.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){if(this._isIdentityDirty){this._isIdentityDirty=!1;let e=this._m;this._isIdentity=e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1}return this._isIdentity}isIdentityAs3x2(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,this._m[0]!==1||this._m[5]!==1||this._m[15]!==1?this._isIdentity3x2=!1:this._m[1]!==0||this._m[2]!==0||this._m[3]!==0||this._m[4]!==0||this._m[6]!==0||this._m[7]!==0||this._m[8]!==0||this._m[9]!==0||this._m[10]!==0||this._m[11]!==0||this._m[12]!==0||this._m[13]!==0||this._m[14]!==0?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){if(this._isIdentity===!0)return 1;let e=this._m,r=e[0],i=e[1],t=e[2],o=e[3],a=e[4],s=e[5],c=e[6],u=e[7],l=e[8],d=e[9],m=e[10],f=e[11],h=e[12],_=e[13],z=e[14],P=e[15],x=m*P-z*f,T=d*P-_*f,D=d*z-_*m,A=l*P-h*f,S=l*z-m*h,Z=l*_-h*d,K=+(s*x-c*T+u*D),ge=-(a*x-c*A+u*S),le=+(a*T-s*A+u*Z),ve=-(a*D-s*S+c*Z);return r*K+i*ge+t*le+o*ve}toString(){return`{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}
2
+ "use strict";var UptimizrReplay=(()=>{var _o=Object.defineProperty;var Jh=Object.getOwnPropertyDescriptor;var Kh=Object.getOwnPropertyNames;var qh=Object.prototype.hasOwnProperty;var Fe=(n,e)=>{for(var r in e)_o(n,r,{get:e[r],enumerable:!0})},Gh=(n,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of Kh(e))!qh.call(n,t)&&t!==r&&_o(n,t,{get:()=>e[t],enumerable:!(i=Jh(e,t))||i.enumerable});return n};var Wh=n=>Gh(_o({},"__esModule",{value:!0}),n);var V$={};Fe(V$,{ReplayPlayer:()=>sr,createBabylonReplayDriver:()=>xo,fetchSessionEvents:()=>Rh,fetchSessionEventsStream:()=>ud,replayInScene:()=>F$});var J$=(1+Math.sqrt(5))/2,ce=.001;function Hh(n,e){let r=[];for(let i=0;i<n;++i)r.push(e());return r}function Ge(n,e){return Hh(n,e)}var ke=class n{static SetMatrixPrecision(e){if(n.MatrixTrackPrecisionChange=!1,e&&!n.MatrixUse64Bits&&n.MatrixTrackedMatrices)for(let r=0;r<n.MatrixTrackedMatrices.length;++r){let i=n.MatrixTrackedMatrices[r],t=i._m;i._m=new Array(16);for(let o=0;o<16;++o)i._m[o]=t[o]}n.MatrixUse64Bits=e,n.MatrixCurrentType=n.MatrixUse64Bits?Array:Float32Array,n.MatrixTrackedMatrices=null}};ke.MatrixUse64Bits=!1;ke.MatrixTrackPrecisionChange=!0;ke.MatrixCurrentType=Float32Array;ke.MatrixTrackedMatrices=[];var Xh=typeof WeakRef<"u",yo=class{constructor(e,r=!1,i,t){this.initialize(e,r,i,t)}initialize(e,r=!1,i,t){return this.mask=e,this.skipNextObservers=r,this.target=i,this.currentTarget=t,this}},$o=class{constructor(e,r,i=null){this.callback=e,this.mask=r,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(e=!1){this._remove&&this._remove(e)}},cr=class n{static FromPromise(e,r){let i=new n;return e.then(t=>{i.notifyObservers(t)}).catch(t=>{if(r)r.notifyObservers(t);else throw t}),i}get observers(){return this._observers}constructor(e,r=!1){this.notifyIfTriggered=r,this._observers=new Array,this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new yo(0),e&&(this._onObserverAdded=e)}add(e,r=-1,i=!1,t=null,o=!1){if(!e)return null;let a=new $o(e,r,t);a.unregisterOnNextCall=o,i?this._observers.unshift(a):this._observers.push(a),this._onObserverAdded&&this._onObserverAdded(a),this._hasNotified&&this.notifyIfTriggered&&this.notifyObserver(a,this._lastNotifiedValue);let s=Xh?new WeakRef(this):{deref:()=>this};return a._remove=(c=!1)=>{let u=s.deref();u&&(c?u.remove(a):u._remove(a))},a}addOnce(e){return this.add(e,void 0,void 0,void 0,!0)}remove(e){return e?(e._remove=null,this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1):!1}removeCallback(e,r){for(let i=0;i<this._observers.length;i++){let t=this._observers[i];if(!t._willBeUnregistered&&t.callback===e&&(!r||r===t.scope))return this._deferUnregister(t),!0}return!1}_deferUnregister(e){e._willBeUnregistered||(this._numObserversMarkedAsDeleted++,e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{this._remove(e)},0))}_remove(e,r=!0){if(!e)return!1;let i=this._observers.indexOf(e);return i!==-1?(r&&this._numObserversMarkedAsDeleted--,this._observers.splice(i,1),!0):!1}makeObserverTopPriority(e){this._remove(e,!1),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e,!1),this._observers.push(e)}notifyObservers(e,r=-1,i,t,o){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;let a=this._eventState;a.mask=r,a.target=i,a.currentTarget=t,a.skipNextObservers=!1,a.lastReturnValue=e,a.userInfo=o;for(let s of this._observers)if(!s._willBeUnregistered&&(s.mask&r&&(s.unregisterOnNextCall&&this._deferUnregister(s),s.scope?a.lastReturnValue=s.callback.apply(s.scope,[e,a]):a.lastReturnValue=s.callback(e,a)),a.skipNextObservers))return!1;return!0}notifyObserver(e,r,i=-1){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=r),e._willBeUnregistered)return;let t=this._eventState;t.mask=i,t.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(r,t)}hasObservers(){return this._observers.length-this._numObserversMarkedAsDeleted>0}clear(){for(;this._observers.length;){let e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){let e=new n;return e._observers=this._observers.slice(0),e}hasSpecificMask(e=-1){for(let r of this._observers)if(r.mask&e||r.mask===e)return!0;return!1}};var Le=class{static get LastCreatedEngine(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}};Le.Instances=[];Le.OnEnginesDisposedObservable=new cr;Le._LastCreatedScene=null;Le.UseFallbackTexture=!0;Le.FallbackTexture="";function X(n,e,r=1401298e-51){return Math.abs(n-e)<=r}function G(n,e){return n===e?n:Math.random()*(e-n)+n}function fd(n,e,r){return n+(e-n)*r}function oe(n,e=0,r=1){return Math.min(r,Math.max(e,n))}function pd(n){return n-=Math.PI*2*Math.floor((n+Math.PI)/(Math.PI*2)),n}var gn=class{};gn._UpdateFlagSeed=0;function hd(n,e,r,i=0){let t=n.asArray(),o=e.asArray(),a=t[0],s=t[1],c=t[2],u=t[3],l=t[4],d=t[5],m=t[6],f=t[7],h=t[8],_=t[9],z=t[10],P=t[11],x=t[12],T=t[13],D=t[14],A=t[15],S=o[0],Z=o[1],K=o[2],ge=o[3],le=o[4],ve=o[5],re=o[6],te=o[7],H=o[8],Ce=o[9],Ue=o[10],Ye=o[11],De=o[12],Oe=o[13],Ne=o[14],qe=o[15];r[i]=a*S+s*le+c*H+u*De,r[i+1]=a*Z+s*ve+c*Ce+u*Oe,r[i+2]=a*K+s*re+c*Ue+u*Ne,r[i+3]=a*ge+s*te+c*Ye+u*qe,r[i+4]=l*S+d*le+m*H+f*De,r[i+5]=l*Z+d*ve+m*Ce+f*Oe,r[i+6]=l*K+d*re+m*Ue+f*Ne,r[i+7]=l*ge+d*te+m*Ye+f*qe,r[i+8]=h*S+_*le+z*H+P*De,r[i+9]=h*Z+_*ve+z*Ce+P*Oe,r[i+10]=h*K+_*re+z*Ue+P*Ne,r[i+11]=h*ge+_*te+z*Ye+P*qe,r[i+12]=x*S+T*le+D*H+A*De,r[i+13]=x*Z+T*ve+D*Ce+A*Oe,r[i+14]=x*K+T*re+D*Ue+A*Ne,r[i+15]=x*ge+T*te+D*Ye+A*qe}function gd(n,e,r=0){let i=n.asArray();e[r]=i[0],e[r+1]=i[1],e[r+2]=i[2],e[r+3]=i[3],e[r+4]=i[4],e[r+5]=i[5],e[r+6]=i[6],e[r+7]=i[7],e[r+8]=i[8],e[r+9]=i[9],e[r+10]=i[10],e[r+11]=i[11],e[r+12]=i[12],e[r+13]=i[13],e[r+14]=i[14],e[r+15]=i[15]}function vd(n,e){let r=n.asArray(),i=r[0],t=r[1],o=r[2],a=r[3],s=r[4],c=r[5],u=r[6],l=r[7],d=r[8],m=r[9],f=r[10],h=r[11],_=r[12],z=r[13],P=r[14],x=r[15],T=f*x-P*h,D=m*x-z*h,A=m*P-z*f,S=d*x-_*h,Z=d*P-f*_,K=d*z-_*m,ge=+(c*T-u*D+l*A),le=-(s*T-u*S+l*Z),ve=+(s*D-c*S+l*K),re=-(s*A-c*Z+u*K),te=i*ge+t*le+o*ve+a*re;if(te===0)return!1;let H=1/te,Ce=u*x-P*l,Ue=c*x-z*l,Ye=c*P-z*u,De=s*x-_*l,Oe=s*P-_*u,Ne=s*z-_*c,qe=u*h-f*l,Qe=c*h-m*l,Ot=c*f-m*u,ld=s*h-d*l,dd=s*f-d*u,md=s*m-d*c,jh=-(t*T-o*D+a*A),Uh=+(i*T-o*S+a*Z),Nh=-(i*D-t*S+a*K),Ah=+(i*A-t*Z+o*K),Eh=+(t*Ce-o*Ue+a*Ye),Zh=-(i*Ce-o*De+a*Oe),Ch=+(i*Ue-t*De+a*Ne),Fh=-(i*Ye-t*Oe+o*Ne),Lh=-(t*qe-o*Qe+a*Ot),Mh=+(i*qe-o*ld+a*dd),Vh=-(i*Qe-t*ld+a*md),Bh=+(i*Ot-t*dd+o*md);return e[0]=ge*H,e[1]=jh*H,e[2]=Eh*H,e[3]=Lh*H,e[4]=le*H,e[5]=Uh*H,e[6]=Zh*H,e[7]=Mh*H,e[8]=ve*H,e[9]=Nh*H,e[10]=Ch*H,e[11]=Vh*H,e[12]=re*H,e[13]=Ah*H,e[14]=Fh*H,e[15]=Bh*H,!0}var Yh={};function vn(n,e){Yh[n]=e}var de=n=>parseInt(n.toString().replace(/\W/g,"")),We=class n{constructor(e=0,r=0){this.x=e,this.y=r}toString(){return`{X: ${this.x} Y: ${this.y}}`}getClassName(){return"Vector2"}getHashCode(){let e=de(this.x),r=de(this.y),i=e;return i=i*397^r,i}toArray(e,r=0){return e[r]=this.x,e[r+1]=this.y,this}fromArray(e,r=0){return n.FromArrayToRef(e,r,this),this}asArray(){return[this.x,this.y]}copyFrom(e){return this.x=e.x,this.y=e.y,this}copyFromFloats(e,r){return this.x=e,this.y=r,this}set(e,r){return this.copyFromFloats(e,r)}setAll(e){return this.copyFromFloats(e,e)}add(e){return new n(this.x+e.x,this.y+e.y)}addToRef(e,r){return r.x=this.x+e.x,r.y=this.y+e.y,r}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}addInPlaceFromFloats(e,r){return this.x+=e,this.y+=r,this}addVector3(e){return new n(this.x+e.x,this.y+e.y)}subtract(e){return new n(this.x-e.x,this.y-e.y)}subtractToRef(e,r){return r.x=this.x-e.x,r.y=this.y-e.y,r}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this}multiply(e){return new n(this.x*e.x,this.y*e.y)}multiplyToRef(e,r){return r.x=this.x*e.x,r.y=this.y*e.y,r}multiplyByFloats(e,r){return new n(this.x*e,this.y*r)}divide(e){return new n(this.x/e.x,this.y/e.y)}divideToRef(e,r){return r.x=this.x/e.x,r.y=this.y/e.y,r}divideInPlace(e){return this.x=this.x/e.x,this.y=this.y/e.y,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.x,e.y)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.x,e.y)}minimizeInPlaceFromFloats(e,r){return this.x=Math.min(e,this.x),this.y=Math.min(r,this.y),this}maximizeInPlaceFromFloats(e,r){return this.x=Math.max(e,this.x),this.y=Math.max(r,this.y),this}subtractFromFloats(e,r){return new n(this.x-e,this.y-r)}subtractFromFloatsToRef(e,r,i){return i.x=this.x-e,i.y=this.y-r,i}negate(){return new n(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(e){return e.x=-this.x,e.y=-this.y,e}scaleInPlace(e){return this.x*=e,this.y*=e,this}scale(e){return new n(this.x*e,this.y*e)}scaleToRef(e,r){return r.x=this.x*e,r.y=this.y*e,r}scaleAndAddToRef(e,r){return r.x+=this.x*e,r.y+=this.y*e,r}equals(e){return e&&this.x===e.x&&this.y===e.y}equalsWithEpsilon(e,r=ce){return e&&X(this.x,e.x,r)&&X(this.y,e.y,r)}equalsToFloats(e,r){return this.x===e&&this.y===r}floor(){return new n(Math.floor(this.x),Math.floor(this.y))}floorToRef(e){return e.x=Math.floor(this.x),e.y=Math.floor(this.y),e}fract(){return new n(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}fractToRef(e){return e.x=this.x-Math.floor(this.x),e.y=this.y-Math.floor(this.y),e}rotate(e){return this.rotateToRef(e,new n)}rotateToRef(e,r){let i=Math.cos(e),t=Math.sin(e);return r.x=i*this.x-t*this.y,r.y=t*this.x+i*this.y,r}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){let e=new n;return this.normalizeToRef(e),e}normalizeToRef(e){let r=this.length();return r===0||r===1?(e.x=this.x,e.y=this.y,e):this.scaleToRef(1/r,e)}clone(){return new n(this.x,this.y)}dot(e){return this.x*e.x+this.y*e.y}static Zero(){return new n(0,0)}static One(){return new n(1,1)}static Random(e=0,r=1){return new n(G(e,r),G(e,r))}static RandomToRef(e=0,r=1,i){return i.copyFromFloats(G(e,r),G(e,r))}static get ZeroReadOnly(){return n._ZeroReadOnly}static FromArray(e,r=0){return new n(e[r],e[r+1])}static FromArrayToRef(e,r,i){return i.x=e[r],i.y=e[r+1],i}static FromFloatsToRef(e,r,i){return i.copyFromFloats(e,r),i}static CatmullRom(e,r,i,t,o){let a=o*o,s=o*a,c=.5*(2*r.x+(-e.x+i.x)*o+(2*e.x-5*r.x+4*i.x-t.x)*a+(-e.x+3*r.x-3*i.x+t.x)*s),u=.5*(2*r.y+(-e.y+i.y)*o+(2*e.y-5*r.y+4*i.y-t.y)*a+(-e.y+3*r.y-3*i.y+t.y)*s);return new n(c,u)}static ClampToRef(e,r,i,t){return t.x=oe(e.x,r.x,i.x),t.y=oe(e.y,r.y,i.y),t}static Clamp(e,r,i){let t=oe(e.x,r.x,i.x),o=oe(e.y,r.y,i.y);return new n(t,o)}static Hermite(e,r,i,t,o){let a=o*o,s=o*a,c=2*s-3*a+1,u=-2*s+3*a,l=s-2*a+o,d=s-a,m=e.x*c+i.x*u+r.x*l+t.x*d,f=e.y*c+i.y*u+r.y*l+t.y*d;return new n(m,f)}static Hermite1stDerivative(e,r,i,t,o){return this.Hermite1stDerivativeToRef(e,r,i,t,o,new n)}static Hermite1stDerivativeToRef(e,r,i,t,o,a){let s=o*o;return a.x=(s-o)*6*e.x+(3*s-4*o+1)*r.x+(-s+o)*6*i.x+(3*s-2*o)*t.x,a.y=(s-o)*6*e.y+(3*s-4*o+1)*r.y+(-s+o)*6*i.y+(3*s-2*o)*t.y,a}static Lerp(e,r,i){return n.LerpToRef(e,r,i,new n)}static LerpToRef(e,r,i,t){return t.x=e.x+(r.x-e.x)*i,t.y=e.y+(r.y-e.y)*i,t}static Dot(e,r){return e.x*r.x+e.y*r.y}static Normalize(e){return n.NormalizeToRef(e,new n)}static NormalizeToRef(e,r){return e.normalizeToRef(r),r}static Minimize(e,r){let i=e.x<r.x?e.x:r.x,t=e.y<r.y?e.y:r.y;return new n(i,t)}static Maximize(e,r){let i=e.x>r.x?e.x:r.x,t=e.y>r.y?e.y:r.y;return new n(i,t)}static Transform(e,r){return n.TransformToRef(e,r,new n)}static TransformToRef(e,r,i){let t=r.m,o=e.x*t[0]+e.y*t[4]+t[12],a=e.x*t[1]+e.y*t[5]+t[13];return i.x=o,i.y=a,i}static PointInTriangle(e,r,i,t){let o=.5*(-i.y*t.x+r.y*(-i.x+t.x)+r.x*(i.y-t.y)+i.x*t.y),a=o<0?-1:1,s=(r.y*t.x-r.x*t.y+(t.y-r.y)*e.x+(r.x-t.x)*e.y)*a,c=(r.x*i.y-r.y*i.x+(r.y-i.y)*e.x+(i.x-r.x)*e.y)*a;return s>0&&c>0&&s+c<2*o*a}static Distance(e,r){return Math.sqrt(n.DistanceSquared(e,r))}static DistanceSquared(e,r){let i=e.x-r.x,t=e.y-r.y;return i*i+t*t}static Center(e,r){return n.CenterToRef(e,r,new n)}static CenterToRef(e,r,i){return i.copyFromFloats((e.x+r.x)/2,(e.y+r.y)/2)}static DistanceOfPointFromSegment(e,r,i){let t=n.DistanceSquared(r,i);if(t===0)return n.Distance(e,r);let o=i.subtract(r),a=Math.max(0,Math.min(1,n.Dot(e.subtract(r),o)/t)),s=r.add(o.multiplyByFloats(a,a));return n.Distance(e,s)}};We._V8PerformanceHack=new We(.5,.5);We._ZeroReadOnly=We.Zero();var R=class n{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}constructor(e=0,r=0,i=0){this._isDirty=!0,this._x=e,this._y=r,this._z=i}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z}}`}getClassName(){return"Vector3"}getHashCode(){let e=de(this._x),r=de(this._y),i=de(this._z),t=e;return t=t*397^r,t=t*397^i,t}asArray(){return[this._x,this._y,this._z]}toArray(e,r=0){return e[r]=this._x,e[r+1]=this._y,e[r+2]=this._z,this}fromArray(e,r=0){return n.FromArrayToRef(e,r,this),this}toQuaternion(){return ue.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._isDirty=!0,this}addInPlaceFromFloats(e,r,i){return this._x+=e,this._y+=r,this._z+=i,this._isDirty=!0,this}add(e){return new n(this._x+e._x,this._y+e._y,this._z+e._z)}addToRef(e,r){return r._x=this._x+e._x,r._y=this._y+e._y,r._z=this._z+e._z,r._isDirty=!0,r}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._isDirty=!0,this}subtract(e){return new n(this._x-e._x,this._y-e._y,this._z-e._z)}subtractToRef(e,r){return this.subtractFromFloatsToRef(e._x,e._y,e._z,r)}subtractFromFloats(e,r,i){return new n(this._x-e,this._y-r,this._z-i)}subtractFromFloatsToRef(e,r,i,t){return t._x=this._x-e,t._y=this._y-r,t._z=this._z-i,t._isDirty=!0,t}negate(){return new n(-this._x,-this._y,-this._z)}negateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(e){return e._x=this._x*-1,e._y=this._y*-1,e._z=this._z*-1,e._isDirty=!0,e}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._isDirty=!0,this}scale(e){return new n(this._x*e,this._y*e,this._z*e)}scaleToRef(e,r){return r._x=this._x*e,r._y=this._y*e,r._z=this._z*e,r._isDirty=!0,r}getNormalToRef(e){let r=this.length(),i=Math.acos(this._y/r),t=Math.atan2(this._z,this._x);i>Math.PI/2?i-=Math.PI/2:i+=Math.PI/2;let o=r*Math.sin(i)*Math.cos(t),a=r*Math.cos(i),s=r*Math.sin(i)*Math.sin(t);return e.set(o,a,s),e}applyRotationQuaternionToRef(e,r){let i=this._x,t=this._y,o=this._z,a=e._x,s=e._y,c=e._z,u=e._w,l=2*(s*o-c*t),d=2*(c*i-a*o),m=2*(a*t-s*i);return r._x=i+u*l+s*m-c*d,r._y=t+u*d+c*l-a*m,r._z=o+u*m+a*d-s*l,r._isDirty=!0,r}applyRotationQuaternionInPlace(e){return this.applyRotationQuaternionToRef(e,this)}applyRotationQuaternion(e){return this.applyRotationQuaternionToRef(e,new n)}scaleAndAddToRef(e,r){return r._x+=this._x*e,r._y+=this._y*e,r._z+=this._z*e,r._isDirty=!0,r}projectOnPlane(e,r){return this.projectOnPlaneToRef(e,r,new n)}projectOnPlaneToRef(e,r,i){let t=e.normal,o=e.d,a=w.Vector3[0];this.subtractToRef(r,a),a.normalize();let s=n.Dot(a,t);if(Math.abs(s)<1e-10)i.setAll(1/0);else{let c=-(n.Dot(r,t)+o)/s,u=a.scaleInPlace(c);r.addToRef(u,i)}return i}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z}equalsWithEpsilon(e,r=ce){return e&&X(this._x,e._x,r)&&X(this._y,e._y,r)&&X(this._z,e._z,r)}equalsToFloats(e,r,i){return this._x===e&&this._y===r&&this._z===i}multiplyInPlace(e){return this._x*=e._x,this._y*=e._y,this._z*=e._z,this._isDirty=!0,this}multiply(e){return this.multiplyByFloats(e._x,e._y,e._z)}multiplyToRef(e,r){return r._x=this._x*e._x,r._y=this._y*e._y,r._z=this._z*e._z,r._isDirty=!0,r}multiplyByFloats(e,r,i){return new n(this._x*e,this._y*r,this._z*i)}divide(e){return new n(this._x/e._x,this._y/e._y,this._z/e._z)}divideToRef(e,r){return r._x=this._x/e._x,r._y=this._y/e._y,r._z=this._z/e._z,r._isDirty=!0,r}divideInPlace(e){return this._x=this._x/e._x,this._y=this._y/e._y,this._z=this._z/e._z,this._isDirty=!0,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)}minimizeInPlaceFromFloats(e,r,i){return e<this._x&&(this.x=e),r<this._y&&(this.y=r),i<this._z&&(this.z=i),this}maximizeInPlaceFromFloats(e,r,i){return e>this._x&&(this.x=e),r>this._y&&(this.y=r),i>this._z&&(this.z=i),this}isNonUniformWithinEpsilon(e){let r=Math.abs(this._x),i=Math.abs(this._y);if(!X(r,i,e))return!0;let t=Math.abs(this._z);return!X(r,t,e)||!X(i,t,e)}get isNonUniform(){let e=Math.abs(this._x),r=Math.abs(this._y);if(e!==r)return!0;let i=Math.abs(this._z);return e!==i}floorToRef(e){return e._x=Math.floor(this._x),e._y=Math.floor(this._y),e._z=Math.floor(this._z),e._isDirty=!0,e}floor(){return new n(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))}fractToRef(e){return e._x=this._x-Math.floor(this._x),e._y=this._y-Math.floor(this._y),e._z=this._z-Math.floor(this._z),e._isDirty=!0,e}fract(){return new n(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){return this._x*this._y*this._z===0}normalize(){return this.normalizeFromLength(this.length())}reorderInPlace(e){if(e=e.toLowerCase(),e==="xyz")return this;let r=w.Vector3[0].copyFrom(this);return this.x=r[e[0]],this.y=r[e[1]],this.z=r[e[2]],this}rotateByQuaternionToRef(e,r){return e.toRotationMatrix(w.Matrix[0]),n.TransformCoordinatesToRef(this,w.Matrix[0],r),r}rotateByQuaternionAroundPointToRef(e,r,i){return this.subtractToRef(r,w.Vector3[0]),w.Vector3[0].rotateByQuaternionToRef(e,w.Vector3[0]),r.addToRef(w.Vector3[0],i),i}cross(e){return n.CrossToRef(this,e,new n)}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new n)}normalizeToRef(e){let r=this.length();return r===0||r===1?(e._x=this._x,e._y=this._y,e._z=this._z,e._isDirty=!0,e):this.scaleToRef(1/r,e)}clone(){return new n(this._x,this._y,this._z)}copyFrom(e){return this.copyFromFloats(e._x,e._y,e._z)}copyFromFloats(e,r,i){return this._x=e,this._y=r,this._z=i,this._isDirty=!0,this}set(e,r,i){return this.copyFromFloats(e,r,i)}setAll(e){return this._x=this._y=this._z=e,this._isDirty=!0,this}static GetClipFactor(e,r,i,t){let o=n.Dot(e,i),a=n.Dot(r,i);return(o-t)/(o-a)}static GetAngleBetweenVectors(e,r,i){let t=e.normalizeToRef(w.Vector3[1]),o=r.normalizeToRef(w.Vector3[2]),a=n.Dot(t,o);a=oe(a,-1,1);let s=Math.acos(a),c=w.Vector3[3];return n.CrossToRef(t,o,c),n.Dot(c,i)>0?isNaN(s)?0:s:isNaN(s)?-Math.PI:-Math.acos(a)}static GetAngleBetweenVectorsOnPlane(e,r,i){w.Vector3[0].copyFrom(e);let t=w.Vector3[0];w.Vector3[1].copyFrom(r);let o=w.Vector3[1];w.Vector3[2].copyFrom(i);let a=w.Vector3[2],s=w.Vector3[3],c=w.Vector3[4];t.normalize(),o.normalize(),a.normalize(),n.CrossToRef(a,t,s),n.CrossToRef(s,a,c);let u=Math.atan2(n.Dot(o,s),n.Dot(o,c));return pd(u)}static PitchYawRollToMoveBetweenPointsToRef(e,r,i){let t=Ie.Vector3[0];return r.subtractToRef(e,t),i._y=Math.atan2(t.x,t.z)||0,i._x=Math.atan2(Math.sqrt(t.x**2+t.z**2),t.y)||0,i._z=0,i._isDirty=!0,i}static PitchYawRollToMoveBetweenPoints(e,r){let i=n.Zero();return n.PitchYawRollToMoveBetweenPointsToRef(e,r,i)}static SlerpToRef(e,r,i,t){i=oe(i,0,1);let o=w.Vector3[0],a=w.Vector3[1];o.copyFrom(e);let s=o.length();o.normalizeFromLength(s),a.copyFrom(r);let c=a.length();a.normalizeFromLength(c);let u=n.Dot(o,a),l,d;if(u<1-ce){let m=Math.acos(u),f=1/Math.sin(m);l=Math.sin((1-i)*m)*f,d=Math.sin(i*m)*f}else l=1-i,d=i;return o.scaleInPlace(l),a.scaleInPlace(d),t.copyFrom(o).addInPlace(a),t.scaleInPlace(fd(s,c,i)),t}static SmoothToRef(e,r,i,t,o){return n.SlerpToRef(e,r,t===0?1:i/t,o),o}static FromArray(e,r=0){return new n(e[r],e[r+1],e[r+2])}static FromFloatArray(e,r){return n.FromArray(e,r)}static FromArrayToRef(e,r,i){return i._x=e[r],i._y=e[r+1],i._z=e[r+2],i._isDirty=!0,i}static FromFloatArrayToRef(e,r,i){return n.FromArrayToRef(e,r,i)}static FromFloatsToRef(e,r,i,t){return t.copyFromFloats(e,r,i),t}static Zero(){return new n(0,0,0)}static One(){return new n(1,1,1)}static Up(){return new n(0,1,0)}static get UpReadOnly(){return n._UpReadOnly}static get DownReadOnly(){return n._DownReadOnly}static get RightReadOnly(){return n._RightReadOnly}static get LeftReadOnly(){return n._LeftReadOnly}static get LeftHandedForwardReadOnly(){return n._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return n._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return n._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return n._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return n._ZeroReadOnly}static get OneReadOnly(){return n._OneReadOnly}static Down(){return new n(0,-1,0)}static Forward(e=!1){return new n(0,0,e?-1:1)}static Backward(e=!1){return new n(0,0,e?1:-1)}static Right(){return new n(1,0,0)}static Left(){return new n(-1,0,0)}static Random(e=0,r=1){return new n(G(e,r),G(e,r),G(e,r))}static RandomToRef(e=0,r=1,i){return i.copyFromFloats(G(e,r),G(e,r),G(e,r))}static TransformCoordinates(e,r){let i=n.Zero();return n.TransformCoordinatesToRef(e,r,i),i}static TransformCoordinatesToRef(e,r,i){return n.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,r,i),i}static TransformCoordinatesFromFloatsToRef(e,r,i,t,o){let a=t.m,s=e*a[0]+r*a[4]+i*a[8]+a[12],c=e*a[1]+r*a[5]+i*a[9]+a[13],u=e*a[2]+r*a[6]+i*a[10]+a[14],l=1/(e*a[3]+r*a[7]+i*a[11]+a[15]);return o._x=s*l,o._y=c*l,o._z=u*l,o._isDirty=!0,o}static TransformNormal(e,r){let i=n.Zero();return n.TransformNormalToRef(e,r,i),i}static TransformNormalToRef(e,r,i){return this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,r,i),i}static TransformNormalFromFloatsToRef(e,r,i,t,o){let a=t.m;return o._x=e*a[0]+r*a[4]+i*a[8],o._y=e*a[1]+r*a[5]+i*a[9],o._z=e*a[2]+r*a[6]+i*a[10],o._isDirty=!0,o}static CatmullRom(e,r,i,t,o){let a=o*o,s=o*a,c=.5*(2*r._x+(-e._x+i._x)*o+(2*e._x-5*r._x+4*i._x-t._x)*a+(-e._x+3*r._x-3*i._x+t._x)*s),u=.5*(2*r._y+(-e._y+i._y)*o+(2*e._y-5*r._y+4*i._y-t._y)*a+(-e._y+3*r._y-3*i._y+t._y)*s),l=.5*(2*r._z+(-e._z+i._z)*o+(2*e._z-5*r._z+4*i._z-t._z)*a+(-e._z+3*r._z-3*i._z+t._z)*s);return new n(c,u,l)}static Clamp(e,r,i){let t=new n;return n.ClampToRef(e,r,i,t),t}static ClampToRef(e,r,i,t){let o=e._x;o=o>i._x?i._x:o,o=o<r._x?r._x:o;let a=e._y;a=a>i._y?i._y:a,a=a<r._y?r._y:a;let s=e._z;return s=s>i._z?i._z:s,s=s<r._z?r._z:s,t.copyFromFloats(o,a,s),t}static CheckExtends(e,r,i){r.minimizeInPlace(e),i.maximizeInPlace(e)}static Hermite(e,r,i,t,o){let a=o*o,s=o*a,c=2*s-3*a+1,u=-2*s+3*a,l=s-2*a+o,d=s-a,m=e._x*c+i._x*u+r._x*l+t._x*d,f=e._y*c+i._y*u+r._y*l+t._y*d,h=e._z*c+i._z*u+r._z*l+t._z*d;return new n(m,f,h)}static Hermite1stDerivative(e,r,i,t,o){let a=new n;return this.Hermite1stDerivativeToRef(e,r,i,t,o,a),a}static Hermite1stDerivativeToRef(e,r,i,t,o,a){let s=o*o;return a._x=(s-o)*6*e._x+(3*s-4*o+1)*r._x+(-s+o)*6*i._x+(3*s-2*o)*t._x,a._y=(s-o)*6*e._y+(3*s-4*o+1)*r._y+(-s+o)*6*i._y+(3*s-2*o)*t._y,a._z=(s-o)*6*e._z+(3*s-4*o+1)*r._z+(-s+o)*6*i._z+(3*s-2*o)*t._z,a._isDirty=!0,a}static Lerp(e,r,i){let t=new n(0,0,0);return n.LerpToRef(e,r,i,t),t}static LerpToRef(e,r,i,t){return t._x=e._x+(r._x-e._x)*i,t._y=e._y+(r._y-e._y)*i,t._z=e._z+(r._z-e._z)*i,t._isDirty=!0,t}static Dot(e,r){return e._x*r._x+e._y*r._y+e._z*r._z}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z}static Cross(e,r){let i=new n;return n.CrossToRef(e,r,i),i}static CrossToRef(e,r,i){let t=e._y*r._z-e._z*r._y,o=e._z*r._x-e._x*r._z,a=e._x*r._y-e._y*r._x;return i.copyFromFloats(t,o,a),i}static Normalize(e){let r=n.Zero();return n.NormalizeToRef(e,r),r}static NormalizeToRef(e,r){return e.normalizeToRef(r),r}static Project(e,r,i,t){let o=new n;return n.ProjectToRef(e,r,i,t,o),o}static ProjectToRef(e,r,i,t,o){let a=t.width,s=t.height,c=t.x,u=t.y,l=w.Matrix[1],d=Le.LastCreatedEngine?.isNDCHalfZRange,m=d?1:.5,f=d?0:.5;me.FromValuesToRef(a/2,0,0,0,0,-s/2,0,0,0,0,m,0,c+a/2,s/2+u,f,1,l);let h=w.Matrix[0];return r.multiplyToRef(i,h),h.multiplyToRef(l,h),n.TransformCoordinatesToRef(e,h,o),o}static Reflect(e,r){return this.ReflectToRef(e,r,new n)}static ReflectToRef(e,r,i){let t=Ie.Vector3[0];return t.copyFrom(r).scaleInPlace(2*n.Dot(e,r)),i.copyFrom(e).subtractInPlace(t)}static UnprojectFromTransform(e,r,i,t,o){return this.Unproject(e,r,i,t,o,me.IdentityReadOnly)}static Unproject(e,r,i,t,o,a){let s=new n;return n.UnprojectToRef(e,r,i,t,o,a,s),s}static UnprojectToRef(e,r,i,t,o,a,s){return n.UnprojectFloatsToRef(e._x,e._y,e._z,r,i,t,o,a,s),s}static UnprojectFloatsToRef(e,r,i,t,o,a,s,c,u){let l=w.Matrix[0];a.multiplyToRef(s,l),l.multiplyToRef(c,l),l.invert();let d=w.Vector3[0];return d.x=e/t*2-1,d.y=-(r/o*2-1),Le.LastCreatedEngine?.isNDCHalfZRange?d.z=i:d.z=2*i-1,n.TransformCoordinatesToRef(d,l,u),u}static Minimize(e,r){let i=new n;return i.copyFrom(e),i.minimizeInPlace(r),i}static Maximize(e,r){let i=new n;return i.copyFrom(e),i.maximizeInPlace(r),i}static Distance(e,r){return Math.sqrt(n.DistanceSquared(e,r))}static DistanceSquared(e,r){let i=e._x-r._x,t=e._y-r._y,o=e._z-r._z;return i*i+t*t+o*o}static ProjectOnTriangleToRef(e,r,i,t,o){let a=w.Vector3[0],s=w.Vector3[1],c=w.Vector3[2],u=w.Vector3[3],l=w.Vector3[4];i.subtractToRef(r,a),t.subtractToRef(r,s),t.subtractToRef(i,c);let d=a.length(),m=s.length(),f=c.length();if(d<ce||m<ce||f<ce)return o.copyFrom(r),n.Distance(e,r);e.subtractToRef(r,l),n.CrossToRef(a,s,u);let h=u.length();if(h<ce)return o.copyFrom(r),n.Distance(e,r);u.normalizeFromLength(h);let _=l.length();if(_<ce)return o.copyFrom(r),0;l.normalizeFromLength(_);let z=n.Dot(u,l),P=w.Vector3[5],x=w.Vector3[6];P.copyFrom(u).scaleInPlace(-_*z),x.copyFrom(e).addInPlace(P);let T=w.Vector3[4],D=w.Vector3[5],A=w.Vector3[7],S=w.Vector3[8];T.copyFrom(a).scaleInPlace(1/d),S.copyFrom(s).scaleInPlace(1/m),T.addInPlace(S).scaleInPlace(-1),D.copyFrom(a).scaleInPlace(-1/d),S.copyFrom(c).scaleInPlace(1/f),D.addInPlace(S).scaleInPlace(-1),A.copyFrom(c).scaleInPlace(-1/f),S.copyFrom(s).scaleInPlace(-1/m),A.addInPlace(S).scaleInPlace(-1);let Z=w.Vector3[9],K;Z.copyFrom(x).subtractInPlace(r),n.CrossToRef(T,Z,S),K=n.Dot(S,u);let ge=K;Z.copyFrom(x).subtractInPlace(i),n.CrossToRef(D,Z,S),K=n.Dot(S,u);let le=K;Z.copyFrom(x).subtractInPlace(t),n.CrossToRef(A,Z,S),K=n.Dot(S,u);let ve=K,re=w.Vector3[10],te,H;ge>0&&le<0?(re.copyFrom(a),te=r,H=i):le>0&&ve<0?(re.copyFrom(c),te=i,H=t):(re.copyFrom(s).scaleInPlace(-1),te=t,H=r);let Ce=w.Vector3[9],Ue=w.Vector3[4];if(te.subtractToRef(x,S),H.subtractToRef(x,Ce),n.CrossToRef(S,Ce,Ue),!(n.Dot(Ue,u)<0))return o.copyFrom(x),Math.abs(_*z);let De=w.Vector3[5];n.CrossToRef(re,Ue,De),De.normalize();let Oe=w.Vector3[9];Oe.copyFrom(te).subtractInPlace(x);let Ne=Oe.length();if(Ne<ce)return o.copyFrom(te),n.Distance(e,te);Oe.normalizeFromLength(Ne);let qe=n.Dot(De,Oe),Qe=w.Vector3[7];Qe.copyFrom(x).addInPlace(De.scaleInPlace(Ne*qe)),S.copyFrom(Qe).subtractInPlace(te),_=re.length(),re.normalizeFromLength(_);let Ot=n.Dot(S,re)/Math.max(_,ce);return Ot=oe(Ot,0,1),Qe.copyFrom(te).addInPlace(re.scaleInPlace(Ot*_)),o.copyFrom(Qe),n.Distance(e,Qe)}static Center(e,r){return n.CenterToRef(e,r,n.Zero())}static CenterToRef(e,r,i){return i.copyFromFloats((e._x+r._x)/2,(e._y+r._y)/2,(e._z+r._z)/2)}static RotationFromAxis(e,r,i){let t=new n;return n.RotationFromAxisToRef(e,r,i,t),t}static RotationFromAxisToRef(e,r,i,t){let o=w.Quaternion[0];return ue.RotationQuaternionFromAxisToRef(e,r,i,o),o.toEulerAnglesToRef(t),t}};R._V8PerformanceHack=new R(.5,.5,.5);R._UpReadOnly=R.Up();R._DownReadOnly=R.Down();R._LeftHandedForwardReadOnly=R.Forward(!1);R._RightHandedForwardReadOnly=R.Forward(!0);R._LeftHandedBackwardReadOnly=R.Backward(!1);R._RightHandedBackwardReadOnly=R.Backward(!0);R._RightReadOnly=R.Right();R._LeftReadOnly=R.Left();R._ZeroReadOnly=R.Zero();R._OneReadOnly=R.One();var Me=class n{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,r=0,i=0,t=0){this._isDirty=!0,this._x=e,this._y=r,this._z=i,this._w=t}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Vector4"}getHashCode(){let e=de(this._x),r=de(this._y),i=de(this._z),t=de(this._w),o=e;return o=o*397^r,o=o*397^i,o=o*397^t,o}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,r){return r===void 0&&(r=0),e[r]=this._x,e[r+1]=this._y,e[r+2]=this._z,e[r+3]=this._w,this}fromArray(e,r=0){return n.FromArrayToRef(e,r,this),this}addInPlace(e){return this.x+=e._x,this.y+=e._y,this.z+=e._z,this.w+=e._w,this}addInPlaceFromFloats(e,r,i,t){return this.x+=e,this.y+=r,this.z+=i,this.w+=t,this}add(e){return new n(this._x+e.x,this._y+e.y,this._z+e.z,this._w+e.w)}addToRef(e,r){return r.x=this._x+e.x,r.y=this._y+e.y,r.z=this._z+e.z,r.w=this._w+e.w,r}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subtract(e){return new n(this._x-e.x,this._y-e.y,this._z-e.z,this._w-e.w)}subtractToRef(e,r){return r.x=this._x-e.x,r.y=this._y-e.y,r.z=this._z-e.z,r.w=this._w-e.w,r}subtractFromFloats(e,r,i,t){return new n(this._x-e,this._y-r,this._z-i,this._w-t)}subtractFromFloatsToRef(e,r,i,t,o){return o.x=this._x-e,o.y=this._y-r,o.z=this._z-i,o.w=this._w-t,o}negate(){return new n(-this._x,-this._y,-this._z,-this._w)}negateInPlace(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this}negateToRef(e){return e.x=-this._x,e.y=-this._y,e.z=-this._z,e.w=-this._w,e}scaleInPlace(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}scale(e){return new n(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,r){return r.x=this._x*e,r.y=this._y*e,r.z=this._z*e,r.w=this._w*e,r}scaleAndAddToRef(e,r){return r.x+=this._x*e,r.y+=this._y*e,r.z+=this._z*e,r.w+=this._w*e,r}equals(e){return e&&this._x===e.x&&this._y===e.y&&this._z===e.z&&this._w===e.w}equalsWithEpsilon(e,r=ce){return e&&X(this._x,e.x,r)&&X(this._y,e.y,r)&&X(this._z,e.z,r)&&X(this._w,e.w,r)}equalsToFloats(e,r,i,t){return this._x===e&&this._y===r&&this._z===i&&this._w===t}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiply(e){return new n(this._x*e.x,this._y*e.y,this._z*e.z,this._w*e.w)}multiplyToRef(e,r){return r.x=this._x*e.x,r.y=this._y*e.y,r.z=this._z*e.z,r.w=this._w*e.w,r}multiplyByFloats(e,r,i,t){return new n(this._x*e,this._y*r,this._z*i,this._w*t)}divide(e){return new n(this._x/e.x,this._y/e.y,this._z/e.z,this._w/e.w)}divideToRef(e,r){return r.x=this._x/e.x,r.y=this._y/e.y,r.z=this._z/e.z,r.w=this._w/e.w,r}divideInPlace(e){return this.divideToRef(e,this)}minimizeInPlace(e){return e.x<this._x&&(this.x=e.x),e.y<this._y&&(this.y=e.y),e.z<this._z&&(this.z=e.z),e.w<this._w&&(this.w=e.w),this}maximizeInPlace(e){return e.x>this._x&&(this.x=e.x),e.y>this._y&&(this.y=e.y),e.z>this._z&&(this.z=e.z),e.w>this._w&&(this.w=e.w),this}minimizeInPlaceFromFloats(e,r,i,t){return this.x=Math.min(e,this._x),this.y=Math.min(r,this._y),this.z=Math.min(i,this._z),this.w=Math.min(t,this._w),this}maximizeInPlaceFromFloats(e,r,i,t){return this.x=Math.max(e,this._x),this.y=Math.max(r,this._y),this.z=Math.max(i,this._z),this.w=Math.max(t,this._w),this}floorToRef(e){return e.x=Math.floor(this._x),e.y=Math.floor(this._y),e.z=Math.floor(this._z),e.w=Math.floor(this._w),e}floor(){return new n(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z),Math.floor(this._w))}fractToRef(e){return e.x=this._x-Math.floor(this._x),e.y=this._y-Math.floor(this._y),e.z=this._z-Math.floor(this._z),e.w=this._w-Math.floor(this._w),e}fract(){return new n(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z),this._w-Math.floor(this._w))}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new n)}normalizeToRef(e){let r=this.length();return r===0||r===1?(e.x=this._x,e.y=this._y,e.z=this._z,e.w=this._w,e):this.scaleToRef(1/r,e)}toVector3(){return new R(this._x,this._y,this._z)}clone(){return new n(this._x,this._y,this._z,this._w)}copyFrom(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}copyFromFloats(e,r,i,t){return this.x=e,this.y=r,this.z=i,this.w=t,this}set(e,r,i,t){return this.copyFromFloats(e,r,i,t)}setAll(e){return this.x=this.y=this.z=this.w=e,this}dot(e){return this._x*e.x+this._y*e.y+this._z*e.z+this._w*e.w}static FromArray(e,r){return r||(r=0),new n(e[r],e[r+1],e[r+2],e[r+3])}static FromArrayToRef(e,r,i){return i.x=e[r],i.y=e[r+1],i.z=e[r+2],i.w=e[r+3],i}static FromFloatArrayToRef(e,r,i){return n.FromArrayToRef(e,r,i),i}static FromFloatsToRef(e,r,i,t,o){return o.x=e,o.y=r,o.z=i,o.w=t,o}static Zero(){return new n(0,0,0,0)}static One(){return new n(1,1,1,1)}static Random(e=0,r=1){return new n(G(e,r),G(e,r),G(e,r),G(e,r))}static RandomToRef(e=0,r=1,i){return i.x=G(e,r),i.y=G(e,r),i.z=G(e,r),i.w=G(e,r),i}static Clamp(e,r,i){return n.ClampToRef(e,r,i,new n)}static ClampToRef(e,r,i,t){return t.x=oe(e.x,r.x,i.x),t.y=oe(e.y,r.y,i.y),t.z=oe(e.z,r.z,i.z),t.w=oe(e.w,r.w,i.w),t}static CheckExtends(e,r,i){r.minimizeInPlace(e),i.maximizeInPlace(e)}static get ZeroReadOnly(){return n._ZeroReadOnly}static Normalize(e){return n.NormalizeToRef(e,new n)}static NormalizeToRef(e,r){return e.normalizeToRef(r),r}static Minimize(e,r){let i=new n;return i.copyFrom(e),i.minimizeInPlace(r),i}static Maximize(e,r){let i=new n;return i.copyFrom(e),i.maximizeInPlace(r),i}static Distance(e,r){return Math.sqrt(n.DistanceSquared(e,r))}static DistanceSquared(e,r){let i=e.x-r.x,t=e.y-r.y,o=e.z-r.z,a=e.w-r.w;return i*i+t*t+o*o+a*a}static Center(e,r){return n.CenterToRef(e,r,new n)}static CenterToRef(e,r,i){return i.x=(e.x+r.x)/2,i.y=(e.y+r.y)/2,i.z=(e.z+r.z)/2,i.w=(e.w+r.w)/2,i}static TransformCoordinates(e,r){return n.TransformCoordinatesToRef(e,r,new n)}static TransformCoordinatesToRef(e,r,i){return n.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,r,i),i}static TransformCoordinatesFromFloatsToRef(e,r,i,t,o){let a=t.m,s=e*a[0]+r*a[4]+i*a[8]+a[12],c=e*a[1]+r*a[5]+i*a[9]+a[13],u=e*a[2]+r*a[6]+i*a[10]+a[14],l=e*a[3]+r*a[7]+i*a[11]+a[15];return o.x=s,o.y=c,o.z=u,o.w=l,o}static TransformNormal(e,r){return n.TransformNormalToRef(e,r,new n)}static TransformNormalToRef(e,r,i){let t=r.m,o=e.x*t[0]+e.y*t[4]+e.z*t[8],a=e.x*t[1]+e.y*t[5]+e.z*t[9],s=e.x*t[2]+e.y*t[6]+e.z*t[10];return i.x=o,i.y=a,i.z=s,i.w=e.w,i}static TransformNormalFromFloatsToRef(e,r,i,t,o,a){let s=o.m;return a.x=e*s[0]+r*s[4]+i*s[8],a.y=e*s[1]+r*s[5]+i*s[9],a.z=e*s[2]+r*s[6]+i*s[10],a.w=t,a}static FromVector3(e,r=0){return new n(e._x,e._y,e._z,r)}static Dot(e,r){return e.x*r.x+e.y*r.y+e.z*r.z+e.w*r.w}};Me._V8PerformanceHack=new Me(.5,.5,.5,.5);Me._ZeroReadOnly=Me.Zero();var ue=class n{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,r=0,i=0,t=1){this._isDirty=!0,this._x=e,this._y=r,this._z=i,this._w=t}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Quaternion"}getHashCode(){let e=de(this._x),r=de(this._y),i=de(this._z),t=de(this._w),o=e;return o=o*397^r,o=o*397^i,o=o*397^t,o}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,r=0){return e[r]=this._x,e[r+1]=this._y,e[r+2]=this._z,e[r+3]=this._w,this}fromArray(e,r=0){return n.FromArrayToRef(e,r,this)}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w}equalsWithEpsilon(e,r=ce){return e&&X(this._x,e._x,r)&&X(this._y,e._y,r)&&X(this._z,e._z,r)&&X(this._w,e._w,r)}isApprox(e,r=ce){return e&&(X(this._x,e._x,r)&&X(this._y,e._y,r)&&X(this._z,e._z,r)&&X(this._w,e._w,r)||X(this._x,-e._x,r)&&X(this._y,-e._y,r)&&X(this._z,-e._z,r)&&X(this._w,-e._w,r))}clone(){return new n(this._x,this._y,this._z,this._w)}copyFrom(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._w=e._w,this._isDirty=!0,this}copyFromFloats(e,r,i,t){return this._x=e,this._y=r,this._z=i,this._w=t,this._isDirty=!0,this}set(e,r,i,t){return this.copyFromFloats(e,r,i,t)}setAll(e){return this.copyFromFloats(e,e,e,e)}add(e){return new n(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this._isDirty=!0,this}addToRef(e,r){return r._x=this._x+e._x,r._y=this._y+e._y,r._z=this._z+e._z,r._w=this._w+e._w,r._isDirty=!0,r}addInPlaceFromFloats(e,r,i,t){return this._x+=e,this._y+=r,this._z+=i,this._w+=t,this._isDirty=!0,this}subtractToRef(e,r){return r._x=this._x-e._x,r._y=this._y-e._y,r._z=this._z-e._z,r._w=this._w-e._w,r._isDirty=!0,r}subtractFromFloats(e,r,i,t){return this.subtractFromFloatsToRef(e,r,i,t,new n)}subtractFromFloatsToRef(e,r,i,t,o){return o._x=this._x-e,o._y=this._y-r,o._z=this._z-i,o._w=this._w-t,o._isDirty=!0,o}subtract(e){return new n(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._w-=e._w,this._isDirty=!0,this}scale(e){return new n(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,r){return r._x=this._x*e,r._y=this._y*e,r._z=this._z*e,r._w=this._w*e,r._isDirty=!0,r}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._w*=e,this._isDirty=!0,this}scaleAndAddToRef(e,r){return r._x+=this._x*e,r._y+=this._y*e,r._z+=this._z*e,r._w+=this._w*e,r._isDirty=!0,r}multiply(e){let r=new n(0,0,0,1);return this.multiplyToRef(e,r),r}multiplyToRef(e,r){let i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,t=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,o=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,a=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return r.copyFromFloats(i,t,o,a),r}multiplyInPlace(e){return this.multiplyToRef(e,this)}multiplyByFloats(e,r,i,t){return this._x*=e,this._y*=r,this._z*=i,this._w*=t,this._isDirty=!0,this}divide(e){throw new ReferenceError("Can not divide a quaternion")}divideToRef(e,r){throw new ReferenceError("Can not divide a quaternion")}divideInPlace(e){throw new ReferenceError("Can not divide a quaternion")}minimizeInPlace(){throw new ReferenceError("Can not minimize a quaternion")}minimizeInPlaceFromFloats(){throw new ReferenceError("Can not minimize a quaternion")}maximizeInPlace(){throw new ReferenceError("Can not maximize a quaternion")}maximizeInPlaceFromFloats(){throw new ReferenceError("Can not maximize a quaternion")}negate(){return this.negateToRef(new n)}negateInPlace(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._w=-this._w,this._isDirty=!0,this}negateToRef(e){return e._x=-this._x,e._y=-this._y,e._z=-this._z,e._w=-this._w,e._isDirty=!0,e}equalsToFloats(e,r,i,t){return this._x===e&&this._y===r&&this._z===i&&this._w===t}floorToRef(e){throw new ReferenceError("Can not floor a quaternion")}floor(){throw new ReferenceError("Can not floor a quaternion")}fractToRef(e){throw new ReferenceError("Can not fract a quaternion")}fract(){throw new ReferenceError("Can not fract a quaternion")}conjugateToRef(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),e}conjugateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){return new n(-this._x,-this._y,-this._z,this._w)}invert(){let e=this.conjugate(),r=this.lengthSquared();return r==0||r==1||e.scaleInPlace(1/r),e}invertInPlace(){this.conjugateInPlace();let e=this.lengthSquared();return e==0||e==1?this:(this.scaleInPlace(1/e),this)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this.lengthSquared())}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){let e=new n(0,0,0,1);return this.normalizeToRef(e),e}normalizeToRef(e){let r=this.length();return r===0||r===1?e.copyFromFloats(this._x,this._y,this._z,this._w):this.scaleToRef(1/r,e)}toEulerAngles(){let e=R.Zero();return this.toEulerAnglesToRef(e),e}toEulerAnglesToRef(e){let r=this._z,i=this._x,t=this._y,o=this._w,a=t*r-i*o,s=.4999999;if(a<-s)e._y=2*Math.atan2(t,o),e._x=Math.PI/2,e._z=0,e._isDirty=!0;else if(a>s)e._y=2*Math.atan2(t,o),e._x=-Math.PI/2,e._z=0,e._isDirty=!0;else{let c=o*o,u=r*r,l=i*i,d=t*t;e._z=Math.atan2(2*(i*t+r*o),-u-l+d+c),e._x=Math.asin(-2*a),e._y=Math.atan2(2*(r*i+t*o),u-l-d+c),e._isDirty=!0}return e}toAlphaBetaGammaToRef(e){let r=this._z,i=this._x,t=this._y,o=this._w,a=Math.sqrt(i*i+t*t),s=Math.sqrt(r*r+o*o),c=2*Math.atan2(a,s),u=2*Math.atan2(r,o),l=2*Math.atan2(t,i),d=(u+l)/2,m=(u-l)/2;return e.set(m,c,d),e}toRotationMatrix(e){return me.FromQuaternionToRef(this,e),e}fromRotationMatrix(e){return n.FromRotationMatrixToRef(e,this),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}toAxisAngle(){let e=R.Zero(),r=this.toAxisAngleToRef(e);return{axis:e,angle:r}}toAxisAngleToRef(e){let r,i=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z),t=this._w;return i>0?(r=2*Math.atan2(i,t),e.set(this._x/i,this._y/i,this._z/i)):(r=0,e.set(1,0,0)),r}static FromRotationMatrix(e){let r=new n;return n.FromRotationMatrixToRef(e,r),r}static FromRotationMatrixToRef(e,r){let i=e.m,t=i[0],o=i[4],a=i[8],s=i[1],c=i[5],u=i[9],l=i[2],d=i[6],m=i[10],f=t+c+m,h;return f>0?(h=.5/Math.sqrt(f+1),r._w=.25/h,r._x=(d-u)*h,r._y=(a-l)*h,r._z=(s-o)*h,r._isDirty=!0):t>c&&t>m?(h=2*Math.sqrt(1+t-c-m),r._w=(d-u)/h,r._x=.25*h,r._y=(o+s)/h,r._z=(a+l)/h,r._isDirty=!0):c>m?(h=2*Math.sqrt(1+c-t-m),r._w=(a-l)/h,r._x=(o+s)/h,r._y=.25*h,r._z=(u+d)/h,r._isDirty=!0):(h=2*Math.sqrt(1+m-t-c),r._w=(s-o)/h,r._x=(a+l)/h,r._y=(u+d)/h,r._z=.25*h,r._isDirty=!0),r}static Dot(e,r){return e._x*r._x+e._y*r._y+e._z*r._z+e._w*r._w}static AreClose(e,r,i=.1){let t=n.Dot(e,r);return 1-t*t<=i}static SmoothToRef(e,r,i,t,o){let a=t===0?1:i/t;return a=oe(a,0,1),n.SlerpToRef(e,r,a,o),o}static Zero(){return new n(0,0,0,0)}static Inverse(e){return new n(-e._x,-e._y,-e._z,e._w)}static InverseToRef(e,r){return r.set(-e._x,-e._y,-e._z,e._w),r}static Identity(){return new n(0,0,0,1)}static IsIdentity(e){return e&&e._x===0&&e._y===0&&e._z===0&&e._w===1}static RotationAxis(e,r){return n.RotationAxisToRef(e,r,new n)}static RotationAxisToRef(e,r,i){i._w=Math.cos(r/2);let t=Math.sin(r/2)/e.length();return i._x=e._x*t,i._y=e._y*t,i._z=e._z*t,i._isDirty=!0,i}static FromArray(e,r){return r||(r=0),new n(e[r],e[r+1],e[r+2],e[r+3])}static FromArrayToRef(e,r,i){return i._x=e[r],i._y=e[r+1],i._z=e[r+2],i._w=e[r+3],i._isDirty=!0,i}static FromFloatsToRef(e,r,i,t,o){return o.copyFromFloats(e,r,i,t),o}static FromEulerAngles(e,r,i){let t=new n;return n.RotationYawPitchRollToRef(r,e,i,t),t}static FromEulerAnglesToRef(e,r,i,t){return n.RotationYawPitchRollToRef(r,e,i,t),t}static FromEulerVector(e){let r=new n;return n.RotationYawPitchRollToRef(e._y,e._x,e._z,r),r}static FromEulerVectorToRef(e,r){return n.RotationYawPitchRollToRef(e._y,e._x,e._z,r),r}static FromUnitVectorsToRef(e,r,i,t=ce){let o=R.Dot(e,r)+1;return o<t?Math.abs(e.x)>Math.abs(e.z)?i.set(-e.y,e.x,0,0):i.set(0,-e.z,e.y,0):(R.CrossToRef(e,r,Ie.Vector3[0]),i.set(Ie.Vector3[0].x,Ie.Vector3[0].y,Ie.Vector3[0].z,o)),i.normalize()}static RotationYawPitchRoll(e,r,i){let t=new n;return n.RotationYawPitchRollToRef(e,r,i,t),t}static RotationYawPitchRollToRef(e,r,i,t){let o=i*.5,a=r*.5,s=e*.5,c=Math.sin(o),u=Math.cos(o),l=Math.sin(a),d=Math.cos(a),m=Math.sin(s),f=Math.cos(s);return t._x=f*l*u+m*d*c,t._y=m*d*u-f*l*c,t._z=f*d*c-m*l*u,t._w=f*d*u+m*l*c,t._isDirty=!0,t}static RotationAlphaBetaGamma(e,r,i){let t=new n;return n.RotationAlphaBetaGammaToRef(e,r,i,t),t}static RotationAlphaBetaGammaToRef(e,r,i,t){let o=(i+e)*.5,a=(i-e)*.5,s=r*.5;return t._x=Math.cos(a)*Math.sin(s),t._y=Math.sin(a)*Math.sin(s),t._z=Math.sin(o)*Math.cos(s),t._w=Math.cos(o)*Math.cos(s),t._isDirty=!0,t}static RotationQuaternionFromAxis(e,r,i){let t=new n(0,0,0,0);return n.RotationQuaternionFromAxisToRef(e,r,i,t),t}static RotationQuaternionFromAxisToRef(e,r,i,t){let o=w.Matrix[0];return e=e.normalizeToRef(w.Vector3[0]),r=r.normalizeToRef(w.Vector3[1]),i=i.normalizeToRef(w.Vector3[2]),me.FromXYZAxesToRef(e,r,i,o),n.FromRotationMatrixToRef(o,t),t}static FromLookDirectionLH(e,r){let i=new n;return n.FromLookDirectionLHToRef(e,r,i),i}static FromLookDirectionLHToRef(e,r,i){let t=w.Matrix[0];return me.LookDirectionLHToRef(e,r,t),n.FromRotationMatrixToRef(t,i),i}static FromLookDirectionRH(e,r){let i=new n;return n.FromLookDirectionRHToRef(e,r,i),i}static FromLookDirectionRHToRef(e,r,i){let t=w.Matrix[0];return me.LookDirectionRHToRef(e,r,t),n.FromRotationMatrixToRef(t,i)}static Slerp(e,r,i){let t=n.Identity();return n.SlerpToRef(e,r,i,t),t}static SlerpToRef(e,r,i,t){let o,a,s=e._x*r._x+e._y*r._y+e._z*r._z+e._w*r._w,c=!1;if(s<0&&(c=!0,s=-s),s>.999999)a=1-i,o=c?-i:i;else{let u=Math.acos(s),l=1/Math.sin(u);a=Math.sin((1-i)*u)*l,o=c?-Math.sin(i*u)*l:Math.sin(i*u)*l}return t._x=a*e._x+o*r._x,t._y=a*e._y+o*r._y,t._z=a*e._z+o*r._z,t._w=a*e._w+o*r._w,t._isDirty=!0,t}static Hermite(e,r,i,t,o){let a=o*o,s=o*a,c=2*s-3*a+1,u=-2*s+3*a,l=s-2*a+o,d=s-a,m=e._x*c+i._x*u+r._x*l+t._x*d,f=e._y*c+i._y*u+r._y*l+t._y*d,h=e._z*c+i._z*u+r._z*l+t._z*d,_=e._w*c+i._w*u+r._w*l+t._w*d;return new n(m,f,h,_)}static Hermite1stDerivative(e,r,i,t,o){let a=new n;return this.Hermite1stDerivativeToRef(e,r,i,t,o,a),a}static Hermite1stDerivativeToRef(e,r,i,t,o,a){let s=o*o;return a._x=(s-o)*6*e._x+(3*s-4*o+1)*r._x+(-s+o)*6*i._x+(3*s-2*o)*t._x,a._y=(s-o)*6*e._y+(3*s-4*o+1)*r._y+(-s+o)*6*i._y+(3*s-2*o)*t._y,a._z=(s-o)*6*e._z+(3*s-4*o+1)*r._z+(-s+o)*6*i._z+(3*s-2*o)*t._z,a._w=(s-o)*6*e._w+(3*s-4*o+1)*r._w+(-s+o)*6*i._w+(3*s-2*o)*t._w,a._isDirty=!0,a}static Normalize(e){let r=n.Zero();return n.NormalizeToRef(e,r),r}static NormalizeToRef(e,r){return e.normalizeToRef(r),r}static Clamp(e,r,i){let t=new n;return n.ClampToRef(e,r,i,t),t}static ClampToRef(e,r,i,t){return t.copyFromFloats(oe(e.x,r.x,i.x),oe(e.y,r.y,i.y),oe(e.z,r.z,i.z),oe(e.w,r.w,i.w))}static Random(e=0,r=1){return new n(G(e,r),G(e,r),G(e,r),G(e,r))}static RandomToRef(e=0,r=1,i){return i.copyFromFloats(G(e,r),G(e,r),G(e,r),G(e,r))}static Minimize(){throw new ReferenceError("Quaternion.Minimize does not make sense")}static Maximize(){throw new ReferenceError("Quaternion.Maximize does not make sense")}static Distance(e,r){return Math.sqrt(n.DistanceSquared(e,r))}static DistanceSquared(e,r){let i=e.x-r.x,t=e.y-r.y,o=e.z-r.z,a=e.w-r.w;return i*i+t*t+o*o+a*a}static Center(e,r){return n.CenterToRef(e,r,n.Zero())}static CenterToRef(e,r,i){return i.copyFromFloats((e.x+r.x)/2,(e.y+r.y)/2,(e.z+r.z)/2,(e.w+r.w)/2)}};ue._V8PerformanceHack=new ue(.5,.5,.5,.5);var me=class n{static get Use64Bits(){return ke.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=gn._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(e,r=!1,i=!1,t=!0){this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=this._isIdentity?!1:r,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:t}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,ke.MatrixTrackPrecisionChange&&ke.MatrixTrackedMatrices.push(this),this._m=new ke.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){if(this._isIdentityDirty){this._isIdentityDirty=!1;let e=this._m;this._isIdentity=e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1}return this._isIdentity}isIdentityAs3x2(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,this._m[0]!==1||this._m[5]!==1||this._m[15]!==1?this._isIdentity3x2=!1:this._m[1]!==0||this._m[2]!==0||this._m[3]!==0||this._m[4]!==0||this._m[6]!==0||this._m[7]!==0||this._m[8]!==0||this._m[9]!==0||this._m[10]!==0||this._m[11]!==0||this._m[12]!==0||this._m[13]!==0||this._m[14]!==0?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){if(this._isIdentity===!0)return 1;let e=this._m,r=e[0],i=e[1],t=e[2],o=e[3],a=e[4],s=e[5],c=e[6],u=e[7],l=e[8],d=e[9],m=e[10],f=e[11],h=e[12],_=e[13],z=e[14],P=e[15],x=m*P-z*f,T=d*P-_*f,D=d*z-_*m,A=l*P-h*f,S=l*z-m*h,Z=l*_-h*d,K=+(s*x-c*T+u*D),ge=-(a*x-c*A+u*S),le=+(a*T-s*A+u*Z),ve=-(a*D-s*S+c*Z);return r*K+i*ge+t*le+o*ve}toString(){return`{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}
3
3
  ${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}
4
4
  ${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}
5
5
  ${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`}toArray(e=null,r=0){if(!e)return this._m;let i=this._m;for(let t=0;t<16;t++)e[r+t]=i[t];return this}asArray(){return this._m}fromArray(e,r=0){return n.FromArrayToRef(e,r,this)}copyFromFloats(...e){return n.FromArrayToRef(e,0,this)}set(...e){let r=this._m;for(let i=0;i<16;i++)r[i]=e[i];return this.markAsUpdated(),this}setAll(e){let r=this._m;for(let i=0;i<16;i++)r[i]=e;return this.markAsUpdated(),this}invert(){return this.invertToRef(this),this}reset(){return n.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this}add(e){let r=new n;return this.addToRef(e,r),r}addToRef(e,r){let i=this._m,t=r._m,o=e.m;for(let a=0;a<16;a++)t[a]=i[a]+o[a];return r.markAsUpdated(),r}addToSelf(e){let r=this._m,i=e.m;return r[0]+=i[0],r[1]+=i[1],r[2]+=i[2],r[3]+=i[3],r[4]+=i[4],r[5]+=i[5],r[6]+=i[6],r[7]+=i[7],r[8]+=i[8],r[9]+=i[9],r[10]+=i[10],r[11]+=i[11],r[12]+=i[12],r[13]+=i[13],r[14]+=i[14],r[15]+=i[15],this.markAsUpdated(),this}addInPlace(e){let r=this._m,i=e.m;for(let t=0;t<16;t++)r[t]+=i[t];return this.markAsUpdated(),this}addInPlaceFromFloats(...e){let r=this._m;for(let i=0;i<16;i++)r[i]+=e[i];return this.markAsUpdated(),this}subtract(e){let r=this._m,i=e.m;for(let t=0;t<16;t++)r[t]-=i[t];return this.markAsUpdated(),this}subtractToRef(e,r){let i=this._m,t=e.m,o=r._m;for(let a=0;a<16;a++)o[a]=i[a]-t[a];return r.markAsUpdated(),r}subtractInPlace(e){let r=this._m,i=e.m;for(let t=0;t<16;t++)r[t]-=i[t];return this.markAsUpdated(),this}subtractFromFloats(...e){return this.subtractFromFloatsToRef(...e,new n)}subtractFromFloatsToRef(...e){let r=e.pop(),i=this._m,t=r._m,o=e;for(let a=0;a<16;a++)t[a]=i[a]-o[a];return r.markAsUpdated(),r}invertToRef(e){return this._isIdentity===!0?(n.IdentityToRef(e),e):(vd(this,e.asArray())?e.markAsUpdated():e.copyFrom(this),e)}addAtIndex(e,r){return this._m[e]+=r,this.markAsUpdated(),this}multiplyAtIndex(e,r){return this._m[e]*=r,this.markAsUpdated(),this}setTranslationFromFloats(e,r,i){return this._m[12]=e,this._m[13]=r,this._m[14]=i,this.markAsUpdated(),this}addTranslationFromFloats(e,r,i){return this._m[12]+=e,this._m[13]+=r,this._m[14]+=i,this.markAsUpdated(),this}setTranslation(e){return this.setTranslationFromFloats(e._x,e._y,e._z)}getTranslation(){return new R(this._m[12],this._m[13],this._m[14])}getTranslationToRef(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],e}removeRotationAndScaling(){let e=this.m;return n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e[12],e[13],e[14],e[15],this),this._updateIdentityStatus(e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1),this}copyFrom(e){e.copyToArray(this._m);let r=e;return this.updateFlag=r.updateFlag,this._updateIdentityStatus(r._isIdentity,r._isIdentityDirty,r._isIdentity3x2,r._isIdentity3x2Dirty),this}copyToArray(e,r=0){return gd(this,e,r),this}multiply(e){let r=new n;return this.multiplyToRef(e,r),r}multiplyInPlace(e){let r=this._m,i=e.m;for(let t=0;t<16;t++)r[t]*=i[t];return this.markAsUpdated(),this}multiplyByFloats(...e){let r=this._m;for(let i=0;i<16;i++)r[i]*=e[i];return this.markAsUpdated(),this}multiplyByFloatsToRef(...e){let r=e.pop(),i=this._m,t=r._m,o=e;for(let a=0;a<16;a++)t[a]=i[a]*o[a];return r.markAsUpdated(),r}multiplyToRef(e,r){return this._isIdentity?(r.copyFrom(e),r):e._isIdentity?(r.copyFrom(this),r):(this.multiplyToArray(e,r._m,0),r.markAsUpdated(),r)}multiplyToArray(e,r,i){return hd(this,e,r,i),this}divide(e){return this.divideToRef(e,new n)}divideToRef(e,r){let i=this._m,t=e.m,o=r._m;for(let a=0;a<16;a++)o[a]=i[a]/t[a];return r.markAsUpdated(),r}divideInPlace(e){let r=this._m,i=e.m;for(let t=0;t<16;t++)r[t]/=i[t];return this.markAsUpdated(),this}minimizeInPlace(e){let r=this._m,i=e.m;for(let t=0;t<16;t++)r[t]=Math.min(r[t],i[t]);return this.markAsUpdated(),this}minimizeInPlaceFromFloats(...e){let r=this._m;for(let i=0;i<16;i++)r[i]=Math.min(r[i],e[i]);return this.markAsUpdated(),this}maximizeInPlace(e){let r=this._m,i=e.m;for(let t=0;t<16;t++)r[t]=Math.max(r[t],i[t]);return this.markAsUpdated(),this}maximizeInPlaceFromFloats(...e){let r=this._m;for(let i=0;i<16;i++)r[i]=Math.max(r[i],e[i]);return this.markAsUpdated(),this}negate(){return this.negateToRef(new n)}negateInPlace(){let e=this._m;for(let r=0;r<16;r++)e[r]=-e[r];return this.markAsUpdated(),this}negateToRef(e){let r=this._m,i=e._m;for(let t=0;t<16;t++)i[t]=-r[t];return e.markAsUpdated(),e}equals(e){let r=e;if(!r)return!1;if((this._isIdentity||r._isIdentity)&&!this._isIdentityDirty&&!r._isIdentityDirty)return this._isIdentity&&r._isIdentity;let i=this.m,t=r.m;return i[0]===t[0]&&i[1]===t[1]&&i[2]===t[2]&&i[3]===t[3]&&i[4]===t[4]&&i[5]===t[5]&&i[6]===t[6]&&i[7]===t[7]&&i[8]===t[8]&&i[9]===t[9]&&i[10]===t[10]&&i[11]===t[11]&&i[12]===t[12]&&i[13]===t[13]&&i[14]===t[14]&&i[15]===t[15]}equalsWithEpsilon(e,r=0){let i=this._m,t=e.m;for(let o=0;o<16;o++)if(!X(i[o],t[o],r))return!1;return!0}equalsToFloats(...e){let r=this._m;for(let i=0;i<16;i++)if(r[i]!=e[i])return!1;return!0}floor(){return this.floorToRef(new n)}floorToRef(e){let r=this._m,i=e._m;for(let t=0;t<16;t++)i[t]=Math.floor(r[t]);return e.markAsUpdated(),e}fract(){return this.fractToRef(new n)}fractToRef(e){let r=this._m,i=e._m;for(let t=0;t<16;t++)i[t]=r[t]-Math.floor(r[t]);return e.markAsUpdated(),e}clone(){let e=new n;return e.copyFrom(this),e}getClassName(){return"Matrix"}getHashCode(){let e=de(this._m[0]);for(let r=1;r<16;r++)e=e*397^de(this._m[r]);return e}decomposeToTransformNode(e){return e.rotationQuaternion=e.rotationQuaternion||new ue,this.decompose(e.scaling,e.rotationQuaternion,e.position)}decompose(e,r,i,t,o=!0){if(this._isIdentity)return i&&i.setAll(0),e&&e.setAll(1),r&&r.copyFromFloats(0,0,0,1),!0;let a=this._m;if(i&&i.copyFromFloats(a[12],a[13],a[14]),e=e||w.Vector3[0],e.x=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),e.y=Math.sqrt(a[4]*a[4]+a[5]*a[5]+a[6]*a[6]),e.z=Math.sqrt(a[8]*a[8]+a[9]*a[9]+a[10]*a[10]),t){let s=(o?t.absoluteScaling.x:t.scaling.x)<0?-1:1,c=(o?t.absoluteScaling.y:t.scaling.y)<0?-1:1,u=(o?t.absoluteScaling.z:t.scaling.z)<0?-1:1;e.x*=s,e.y*=c,e.z*=u}else this.determinant()<=0&&(e.y*=-1);if(e._x===0||e._y===0||e._z===0)return r&&r.copyFromFloats(0,0,0,1),!1;if(r){let s=1/e._x,c=1/e._y,u=1/e._z;n.FromValuesToRef(a[0]*s,a[1]*s,a[2]*s,0,a[4]*c,a[5]*c,a[6]*c,0,a[8]*u,a[9]*u,a[10]*u,0,0,0,0,1,w.Matrix[0]),ue.FromRotationMatrixToRef(w.Matrix[0],r)}return!0}getRow(e){if(e<0||e>3)return null;let r=e*4;return new Me(this._m[r+0],this._m[r+1],this._m[r+2],this._m[r+3])}getRowToRef(e,r){if(e>=0&&e<=3){let i=e*4;r.x=this._m[i+0],r.y=this._m[i+1],r.z=this._m[i+2],r.w=this._m[i+3]}return r}setRow(e,r){return this.setRowFromFloats(e,r.x,r.y,r.z,r.w)}transpose(){let e=new n;return n.TransposeToRef(this,e),e}transposeToRef(e){return n.TransposeToRef(this,e),e}setRowFromFloats(e,r,i,t,o){if(e<0||e>3)return this;let a=e*4;return this._m[a+0]=r,this._m[a+1]=i,this._m[a+2]=t,this._m[a+3]=o,this.markAsUpdated(),this}scale(e){let r=new n;return this.scaleToRef(e,r),r}scaleToRef(e,r){for(let i=0;i<16;i++)r._m[i]=this._m[i]*e;return r.markAsUpdated(),r}scaleAndAddToRef(e,r){for(let i=0;i<16;i++)r._m[i]+=this._m[i]*e;return r.markAsUpdated(),r}scaleInPlace(e){let r=this._m;for(let i=0;i<16;i++)r[i]*=e;return this.markAsUpdated(),this}toNormalMatrix(e){let r=w.Matrix[0];this.invertToRef(r),r.transposeToRef(e);let i=e._m;return n.FromValuesToRef(i[0],i[1],i[2],0,i[4],i[5],i[6],0,i[8],i[9],i[10],0,0,0,0,1,e),e}getRotationMatrix(){let e=new n;return this.getRotationMatrixToRef(e),e}getRotationMatrixToRef(e){let r=w.Vector3[0];if(!this.decompose(r))return n.IdentityToRef(e),e;let i=this._m,t=1/r._x,o=1/r._y,a=1/r._z;return n.FromValuesToRef(i[0]*t,i[1]*t,i[2]*t,0,i[4]*o,i[5]*o,i[6]*o,0,i[8]*a,i[9]*a,i[10]*a,0,0,0,0,1,e),e}toggleModelMatrixHandInPlace(){let e=this._m;return e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this.markAsUpdated(),this}toggleProjectionMatrixHandInPlace(){let e=this._m;return e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this.markAsUpdated(),this}_convertProjectionToHalfZRangeInPlace(){return this.multiplyToRef(et,this),this}static FromArray(e,r=0){let i=new n;return n.FromArrayToRef(e,r,i),i}static FromArrayToRef(e,r,i){for(let t=0;t<16;t++)i._m[t]=e[t+r];return i.markAsUpdated(),i}static FromFloat32ArrayToRefScaled(e,r,i,t){return t._m[0]=e[0+r]*i,t._m[1]=e[1+r]*i,t._m[2]=e[2+r]*i,t._m[3]=e[3+r]*i,t._m[4]=e[4+r]*i,t._m[5]=e[5+r]*i,t._m[6]=e[6+r]*i,t._m[7]=e[7+r]*i,t._m[8]=e[8+r]*i,t._m[9]=e[9+r]*i,t._m[10]=e[10+r]*i,t._m[11]=e[11+r]*i,t._m[12]=e[12+r]*i,t._m[13]=e[13+r]*i,t._m[14]=e[14+r]*i,t._m[15]=e[15+r]*i,t.markAsUpdated(),t}static get IdentityReadOnly(){return n._IdentityReadOnly}static FromValuesToRef(e,r,i,t,o,a,s,c,u,l,d,m,f,h,_,z,P){let x=P._m;x[0]=e,x[1]=r,x[2]=i,x[3]=t,x[4]=o,x[5]=a,x[6]=s,x[7]=c,x[8]=u,x[9]=l,x[10]=d,x[11]=m,x[12]=f,x[13]=h,x[14]=_,x[15]=z,P.markAsUpdated()}static FromValues(e,r,i,t,o,a,s,c,u,l,d,m,f,h,_,z){let P=new n,x=P._m;return x[0]=e,x[1]=r,x[2]=i,x[3]=t,x[4]=o,x[5]=a,x[6]=s,x[7]=c,x[8]=u,x[9]=l,x[10]=d,x[11]=m,x[12]=f,x[13]=h,x[14]=_,x[15]=z,P.markAsUpdated(),P}static Compose(e,r,i){let t=new n;return n.ComposeToRef(e,r,i,t),t}static ComposeToRef(e,r,i,t){let o=t._m,a=r._x,s=r._y,c=r._z,u=r._w,l=a+a,d=s+s,m=c+c,f=a*l,h=a*d,_=a*m,z=s*d,P=s*m,x=c*m,T=u*l,D=u*d,A=u*m,S=e._x,Z=e._y,K=e._z;return o[0]=(1-(z+x))*S,o[1]=(h+A)*S,o[2]=(_-D)*S,o[3]=0,o[4]=(h-A)*Z,o[5]=(1-(f+x))*Z,o[6]=(P+T)*Z,o[7]=0,o[8]=(_+D)*K,o[9]=(P-T)*K,o[10]=(1-(f+z))*K,o[11]=0,o[12]=i._x,o[13]=i._y,o[14]=i._z,o[15]=1,t.markAsUpdated(),t}static Identity(){let e=n.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return e._updateIdentityStatus(!0),e}static IdentityToRef(e){return n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(!0),e}static Zero(){let e=n.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return e._updateIdentityStatus(!1),e}static RotationX(e){let r=new n;return n.RotationXToRef(e,r),r}static Invert(e){let r=new n;return e.invertToRef(r),r}static RotationXToRef(e,r){let i=Math.sin(e),t=Math.cos(e);return n.FromValuesToRef(1,0,0,0,0,t,i,0,0,-i,t,0,0,0,0,1,r),r._updateIdentityStatus(t===1&&i===0),r}static RotationY(e){let r=new n;return n.RotationYToRef(e,r),r}static RotationYToRef(e,r){let i=Math.sin(e),t=Math.cos(e);return n.FromValuesToRef(t,0,-i,0,0,1,0,0,i,0,t,0,0,0,0,1,r),r._updateIdentityStatus(t===1&&i===0),r}static RotationZ(e){let r=new n;return n.RotationZToRef(e,r),r}static RotationZToRef(e,r){let i=Math.sin(e),t=Math.cos(e);return n.FromValuesToRef(t,i,0,0,-i,t,0,0,0,0,1,0,0,0,0,1,r),r._updateIdentityStatus(t===1&&i===0),r}static RotationAxis(e,r){let i=new n;return n.RotationAxisToRef(e,r,i),i}static RotationAxisToRef(e,r,i){let t=Math.sin(-r),o=Math.cos(-r),a=1-o;e=e.normalizeToRef(w.Vector3[0]);let s=i._m;return s[0]=e._x*e._x*a+o,s[1]=e._x*e._y*a-e._z*t,s[2]=e._x*e._z*a+e._y*t,s[3]=0,s[4]=e._y*e._x*a+e._z*t,s[5]=e._y*e._y*a+o,s[6]=e._y*e._z*a-e._x*t,s[7]=0,s[8]=e._z*e._x*a-e._y*t,s[9]=e._z*e._y*a+e._x*t,s[10]=e._z*e._z*a+o,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,i.markAsUpdated(),i}static RotationAlignToRef(e,r,i,t=!1){let o=R.Dot(r,e),a=i._m;if(o<-1+ce)a[0]=-1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=t?1:-1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=t?-1:1,a[11]=0;else{let s=R.Cross(r,e),c=1/(1+o);a[0]=s._x*s._x*c+o,a[1]=s._y*s._x*c-s._z,a[2]=s._z*s._x*c+s._y,a[3]=0,a[4]=s._x*s._y*c+s._z,a[5]=s._y*s._y*c+o,a[6]=s._z*s._y*c-s._x,a[7]=0,a[8]=s._x*s._z*c-s._y,a[9]=s._y*s._z*c+s._x,a[10]=s._z*s._z*c+o,a[11]=0}return a[12]=0,a[13]=0,a[14]=0,a[15]=1,i.markAsUpdated(),i}static RotationYawPitchRoll(e,r,i){let t=new n;return n.RotationYawPitchRollToRef(e,r,i,t),t}static RotationYawPitchRollToRef(e,r,i,t){return ue.RotationYawPitchRollToRef(e,r,i,w.Quaternion[0]),w.Quaternion[0].toRotationMatrix(t),t}static Scaling(e,r,i){let t=new n;return n.ScalingToRef(e,r,i,t),t}static ScalingToRef(e,r,i,t){return n.FromValuesToRef(e,0,0,0,0,r,0,0,0,0,i,0,0,0,0,1,t),t._updateIdentityStatus(e===1&&r===1&&i===1),t}static Translation(e,r,i){let t=new n;return n.TranslationToRef(e,r,i,t),t}static TranslationToRef(e,r,i,t){return n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,r,i,1,t),t._updateIdentityStatus(e===0&&r===0&&i===0),t}static Lerp(e,r,i){let t=new n;return n.LerpToRef(e,r,i,t),t}static LerpToRef(e,r,i,t){let o=t._m,a=e.m,s=r.m;for(let c=0;c<16;c++)o[c]=a[c]*(1-i)+s[c]*i;return t.markAsUpdated(),t}static DecomposeLerp(e,r,i){let t=new n;return n.DecomposeLerpToRef(e,r,i,t),t}static DecomposeLerpToRef(e,r,i,t){let o=w.Vector3[0],a=w.Quaternion[0],s=w.Vector3[1];e.decompose(o,a,s);let c=w.Vector3[2],u=w.Quaternion[1],l=w.Vector3[3];r.decompose(c,u,l);let d=w.Vector3[4];R.LerpToRef(o,c,i,d);let m=w.Quaternion[2];ue.SlerpToRef(a,u,i,m);let f=w.Vector3[5];return R.LerpToRef(s,l,i,f),n.ComposeToRef(d,m,f,t),t}static LookAtLH(e,r,i){let t=new n;return n.LookAtLHToRef(e,r,i,t),t}static LookAtLHToRef(e,r,i,t){let o=w.Vector3[0],a=w.Vector3[1],s=w.Vector3[2];r.subtractToRef(e,s),s.normalize(),R.CrossToRef(i,s,o);let c=o.lengthSquared();c===0?o.x=1:o.normalizeFromLength(Math.sqrt(c)),R.CrossToRef(s,o,a),a.normalize();let u=-R.Dot(o,e),l=-R.Dot(a,e),d=-R.Dot(s,e);return n.FromValuesToRef(o._x,a._x,s._x,0,o._y,a._y,s._y,0,o._z,a._z,s._z,0,u,l,d,1,t),t}static LookAtRH(e,r,i){let t=new n;return n.LookAtRHToRef(e,r,i,t),t}static LookAtRHToRef(e,r,i,t){let o=w.Vector3[0],a=w.Vector3[1],s=w.Vector3[2];e.subtractToRef(r,s),s.normalize(),R.CrossToRef(i,s,o);let c=o.lengthSquared();c===0?o.x=1:o.normalizeFromLength(Math.sqrt(c)),R.CrossToRef(s,o,a),a.normalize();let u=-R.Dot(o,e),l=-R.Dot(a,e),d=-R.Dot(s,e);return n.FromValuesToRef(o._x,a._x,s._x,0,o._y,a._y,s._y,0,o._z,a._z,s._z,0,u,l,d,1,t),t}static LookDirectionLH(e,r){let i=new n;return n.LookDirectionLHToRef(e,r,i),i}static LookDirectionLHToRef(e,r,i){let t=w.Vector3[0];t.copyFrom(e),t.scaleInPlace(-1);let o=w.Vector3[1];return R.CrossToRef(r,t,o),n.FromValuesToRef(o._x,o._y,o._z,0,r._x,r._y,r._z,0,t._x,t._y,t._z,0,0,0,0,1,i),i}static LookDirectionRH(e,r){let i=new n;return n.LookDirectionRHToRef(e,r,i),i}static LookDirectionRHToRef(e,r,i){let t=w.Vector3[2];return R.CrossToRef(r,e,t),n.FromValuesToRef(t._x,t._y,t._z,0,r._x,r._y,r._z,0,e._x,e._y,e._z,0,0,0,0,1,i),i}static OrthoLH(e,r,i,t,o){let a=new n;return n.OrthoLHToRef(e,r,i,t,a,o),a}static OrthoLHToRef(e,r,i,t,o,a){let s=i,c=t,u=2/e,l=2/r,d=2/(c-s),m=-(c+s)/(c-s);return n.FromValuesToRef(u,0,0,0,0,l,0,0,0,0,d,0,0,0,m,1,o),a&&o.multiplyToRef(et,o),o._updateIdentityStatus(u===1&&l===1&&d===1&&m===0),o}static OrthoOffCenterLH(e,r,i,t,o,a,s){let c=new n;return n.OrthoOffCenterLHToRef(e,r,i,t,o,a,c,s),c}static OrthoOffCenterLHToRef(e,r,i,t,o,a,s,c){let u=o,l=a,d=2/(r-e),m=2/(t-i),f=2/(l-u),h=-(l+u)/(l-u),_=(e+r)/(e-r),z=(t+i)/(i-t);return n.FromValuesToRef(d,0,0,0,0,m,0,0,0,0,f,0,_,z,h,1,s),c&&s.multiplyToRef(et,s),s.markAsUpdated(),s}static ObliqueOffCenterLHToRef(e,r,i,t,o,a,s,c,u,l,d){let m=-s*Math.cos(c),f=-s*Math.sin(c);return n.TranslationToRef(0,0,-u,w.Matrix[1]),n.FromValuesToRef(1,0,0,0,0,1,0,0,m,f,1,0,0,0,0,1,w.Matrix[0]),w.Matrix[1].multiplyToRef(w.Matrix[0],w.Matrix[0]),n.TranslationToRef(0,0,u,w.Matrix[1]),w.Matrix[0].multiplyToRef(w.Matrix[1],w.Matrix[0]),n.OrthoOffCenterLHToRef(e,r,i,t,o,a,l,d),w.Matrix[0].multiplyToRef(l,l),l}static OrthoOffCenterRH(e,r,i,t,o,a,s){let c=new n;return n.OrthoOffCenterRHToRef(e,r,i,t,o,a,c,s),c}static OrthoOffCenterRHToRef(e,r,i,t,o,a,s,c){return n.OrthoOffCenterLHToRef(e,r,i,t,o,a,s,c),s._m[10]*=-1,s}static ObliqueOffCenterRHToRef(e,r,i,t,o,a,s,c,u,l,d){let m=s*Math.cos(c),f=s*Math.sin(c);return n.TranslationToRef(0,0,u,w.Matrix[1]),n.FromValuesToRef(1,0,0,0,0,1,0,0,m,f,1,0,0,0,0,1,w.Matrix[0]),w.Matrix[1].multiplyToRef(w.Matrix[0],w.Matrix[0]),n.TranslationToRef(0,0,-u,w.Matrix[1]),w.Matrix[0].multiplyToRef(w.Matrix[1],w.Matrix[0]),n.OrthoOffCenterRHToRef(e,r,i,t,o,a,l,d),w.Matrix[0].multiplyToRef(l,l),l}static PerspectiveLH(e,r,i,t,o,a=0){let s=new n,c=i,u=t,l=2*c/e,d=2*c/r,m=(u+c)/(u-c),f=-2*u*c/(u-c),h=Math.tan(a);return n.FromValuesToRef(l,0,0,0,0,d,0,h,0,0,m,1,0,0,f,0,s),o&&s.multiplyToRef(et,s),s._updateIdentityStatus(!1),s}static PerspectiveFovLH(e,r,i,t,o,a=0,s=!1){let c=new n;return n.PerspectiveFovLHToRef(e,r,i,t,c,!0,o,a,s),c}static PerspectiveFovLHToRef(e,r,i,t,o,a=!0,s,c=0,u=!1){let l=i,d=t,m=1/Math.tan(e*.5),f=a?m/r:m,h=a?m:m*r,_=u&&l===0?-1:d!==0?(d+l)/(d-l):1,z=u&&l===0?2*d:d!==0?-2*d*l/(d-l):-2*l,P=Math.tan(c);return n.FromValuesToRef(f,0,0,0,0,h,0,P,0,0,_,1,0,0,z,0,o),s&&o.multiplyToRef(et,o),o._updateIdentityStatus(!1),o}static PerspectiveFovReverseLHToRef(e,r,i,t,o,a=!0,s,c=0){let u=1/Math.tan(e*.5),l=a?u/r:u,d=a?u:u*r,m=Math.tan(c);return n.FromValuesToRef(l,0,0,0,0,d,0,m,0,0,-i,1,0,0,1,0,o),s&&o.multiplyToRef(et,o),o._updateIdentityStatus(!1),o}static PerspectiveFovRH(e,r,i,t,o,a=0,s=!1){let c=new n;return n.PerspectiveFovRHToRef(e,r,i,t,c,!0,o,a,s),c}static PerspectiveFovRHToRef(e,r,i,t,o,a=!0,s,c=0,u=!1){let l=i,d=t,m=1/Math.tan(e*.5),f=a?m/r:m,h=a?m:m*r,_=u&&l===0?1:d!==0?-(d+l)/(d-l):-1,z=u&&l===0?2*d:d!==0?-2*d*l/(d-l):-2*l,P=Math.tan(c);return n.FromValuesToRef(f,0,0,0,0,h,0,P,0,0,_,-1,0,0,z,0,o),s&&o.multiplyToRef(et,o),o._updateIdentityStatus(!1),o}static PerspectiveFovReverseRHToRef(e,r,i,t,o,a=!0,s,c=0){let u=1/Math.tan(e*.5),l=a?u/r:u,d=a?u:u*r,m=Math.tan(c);return n.FromValuesToRef(l,0,0,0,0,d,0,m,0,0,-i,-1,0,0,-1,0,o),s&&o.multiplyToRef(et,o),o._updateIdentityStatus(!1),o}static GetFinalMatrix(e,r,i,t,o,a){let s=e.width,c=e.height,u=e.x,l=e.y,d=n.FromValues(s/2,0,0,0,0,-c/2,0,0,0,0,a-o,0,u+s/2,c/2+l,o,1),m=new n;return r.multiplyToRef(i,m),m.multiplyToRef(t,m),m.multiplyToRef(d,m)}static GetAsMatrix2x2(e){let r=e.m,i=[r[0],r[1],r[4],r[5]];return ke.MatrixUse64Bits?i:new Float32Array(i)}static GetAsMatrix3x3(e){let r=e.m,i=[r[0],r[1],r[2],r[4],r[5],r[6],r[8],r[9],r[10]];return ke.MatrixUse64Bits?i:new Float32Array(i)}static Transpose(e){let r=new n;return n.TransposeToRef(e,r),r}static TransposeToRef(e,r){let i=e.m,t=i[0],o=i[4],a=i[8],s=i[12],c=i[1],u=i[5],l=i[9],d=i[13],m=i[2],f=i[6],h=i[10],_=i[14],z=i[3],P=i[7],x=i[11],T=i[15],D=r._m;return D[0]=t,D[1]=o,D[2]=a,D[3]=s,D[4]=c,D[5]=u,D[6]=l,D[7]=d,D[8]=m,D[9]=f,D[10]=h,D[11]=_,D[12]=z,D[13]=P,D[14]=x,D[15]=T,r.markAsUpdated(),r._updateIdentityStatus(e._isIdentity,e._isIdentityDirty),r}static Reflection(e){let r=new n;return n.ReflectionToRef(e,r),r}static ReflectionToRef(e,r){e.normalize();let i=e.normal.x,t=e.normal.y,o=e.normal.z,a=-2*i,s=-2*t,c=-2*o;return n.FromValuesToRef(a*i+1,s*i,c*i,0,a*t,s*t+1,c*t,0,a*o,s*o,c*o+1,0,a*e.d,s*e.d,c*e.d,1,r),r}static FromXYZAxesToRef(e,r,i,t){return n.FromValuesToRef(e._x,e._y,e._z,0,r._x,r._y,r._z,0,i._x,i._y,i._z,0,0,0,0,1,t),t}static FromQuaternionToRef(e,r){let i=e._x*e._x,t=e._y*e._y,o=e._z*e._z,a=e._x*e._y,s=e._z*e._w,c=e._z*e._x,u=e._y*e._w,l=e._y*e._z,d=e._x*e._w;return r._m[0]=1-2*(t+o),r._m[1]=2*(a+s),r._m[2]=2*(c-u),r._m[3]=0,r._m[4]=2*(a-s),r._m[5]=1-2*(o+i),r._m[6]=2*(l+d),r._m[7]=0,r._m[8]=2*(c+u),r._m[9]=2*(l-d),r._m[10]=1-2*(t+i),r._m[11]=0,r._m[12]=0,r._m[13]=0,r._m[14]=0,r._m[15]=1,r.markAsUpdated(),r}};me._IdentityReadOnly=me.Identity();var w=class{};w.Vector3=Ge(11,R.Zero);w.Matrix=Ge(2,me.Identity);w.Quaternion=Ge(3,ue.Zero);var Ie=class{};Ie.Vector2=Ge(3,We.Zero);Ie.Vector3=Ge(13,R.Zero);Ie.Vector4=Ge(3,Me.Zero);Ie.Quaternion=Ge(3,ue.Zero);Ie.Matrix=Ge(8,me.Identity);var et=me.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1),_d=!1;function yd(){_d||(_d=!0,Object.defineProperties(We.prototype,{dimension:{value:[2]},rank:{value:1}}),Object.defineProperties(R.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(Me.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(ue.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(me.prototype,{dimension:{value:[4,4]},rank:{value:2}}),vn("BABYLON.Vector2",We),vn("BABYLON.Vector3",R),vn("BABYLON.Vector4",Me),vn("BABYLON.Matrix",me))}yd();async function $d(n,e){let r=await n(e?.pluginExtension);r.addAllToScene();let i=!1;return{rootNodes:r.rootNodes??[],meshes:r.meshes??[],container:r,dispose(){i||(i=!0,r.removeAllFromScene?.(),r.dispose?.())}}}function Qh(n){return n?typeof n=="function"?n()??null:n:null}function eg(n,e){let r=n;for(let i of e.split("/")){if(!i)continue;let t=r?.getChildren?.();if(!Array.isArray(t)||(r=t.find(o=>o.name===i)??null,!r))return null}return r}function xo(n){let e=new R,r=new R,i=new R;return{reset(){},apply(t){switch(t.type){case"camera_sample":{let o=n.camera??n.scene.activeCamera;if(!o)return;let[a,s,c]=t.position;if(t.target)e.set(t.target[0],t.target[1],t.target[2]);else{let[u,l,d]=t.direction;e.set(a+u,s+l,c+d)}o.setTarget?.(e),typeof o.setPosition=="function"?(r.set(a,s,c),o.setPosition(r)):o.position.set(a,s,c);break}case"pointer_move":case"pointer_click":case"pointer_down":case"pointer_up":n.onPointer?.(t.screen,t.hitPoint,t.hitMesh,t.type);break;case"mesh_interaction":n.onMeshInteraction?.(t.mesh,t.kind,t.point);break;case"custom":n.onCustom?.(t.name,t.props,t.ts);break;case"input_action":n.onInputAction?.({action:t.action,code:t.code,button:t.button,pressed:t.pressed,source:t.source},t.ts);break;case"viewport_resize":n.onLifecycle?.({type:"viewport_resize",width:t.width,height:t.height,dpr:t.dpr},t.ts);break;case"visibility_change":n.onLifecycle?.({type:"visibility_change",state:t.state},t.ts);break;case"focus_change":n.onLifecycle?.({type:"focus_change",focused:t.focused},t.ts);break;case"context_lost":n.onLifecycle?.({type:"context_lost"},t.ts);break;case"context_restored":n.onLifecycle?.({type:"context_restored"},t.ts);break;case"runtime_error":n.onError?.({kind:t.kind,message:t.message,source:t.source,lineno:t.lineno,colno:t.colno,stack:t.stack},t.ts);break;case"camera_gesture":break;case"node_transform":{let o=Qh(n.nodes?.[t.nodeId]);if(o)if(t.boneId!==void 0){let a=o.skeleton?.bones?.find(s=>s.name===t.boneId);a&&(a.position?.set(t.position[0],t.position[1],t.position[2]),a.rotationQuaternion=new ue(t.rotation[0],t.rotation[1],t.rotation[2],t.rotation[3]),t.scale&&a.scaling?.set(t.scale[0],t.scale[1],t.scale[2]),a.markAsDirty?.())}else{let a=t.childPath===void 0?o:eg(o,t.childPath);a&&(typeof a.setAbsolutePosition=="function"?(i.set(t.position[0],t.position[1],t.position[2]),a.setAbsolutePosition(i)):a.position?.set(t.position[0],t.position[1],t.position[2]),a.rotationQuaternion=new ue(t.rotation[0],t.rotation[1],t.rotation[2],t.rotation[3]),t.scale&&a.scaling?.set(t.scale[0],t.scale[1],t.scale[2]))}n.onNodeTransform?.(t.nodeId,{boneId:t.boneId,childPath:t.childPath,position:t.position,rotation:t.rotation,scale:t.scale},t.ts);break}default:break}}}}var p={};Fe(p,{$brand:()=>Eo,$input:()=>ac,$output:()=>oc,NEVER:()=>Ao,TimePrecision:()=>gc,ZodAny:()=>nl,ZodArray:()=>al,ZodBase64:()=>eo,ZodBase64URL:()=>to,ZodBigInt:()=>dn,ZodBigIntFormat:()=>io,ZodBoolean:()=>ln,ZodCIDRv4:()=>Yi,ZodCIDRv6:()=>Qi,ZodCUID:()=>Ji,ZodCUID2:()=>Ki,ZodCatch:()=>Sl,ZodCodec:()=>rr,ZodCompileAsyncError:()=>Ee,ZodCompileUnsupportedError:()=>L,ZodCreditCard:()=>Wu,ZodCustom:()=>ir,ZodCustomStringFormat:()=>cn,ZodDate:()=>Xn,ZodDefault:()=>xl,ZodDiscriminatedUnion:()=>cl,ZodE164:()=>no,ZodEmail:()=>Li,ZodEmoji:()=>Vi,ZodEnum:()=>an,ZodError:()=>s$,ZodExactOptional:()=>co,ZodFile:()=>vl,ZodFirstPartyTypeKind:()=>Fl,ZodFunction:()=>El,ZodGUID:()=>Mi,ZodIPv4:()=>Hi,ZodIPv6:()=>Xi,ZodISODate:()=>dt,ZodISODateTime:()=>lt,ZodISODuration:()=>ft,ZodISOTime:()=>mt,ZodIntersection:()=>ul,ZodIssueCode:()=>l$,ZodJWT:()=>ro,ZodKSUID:()=>Wi,ZodLazy:()=>Ul,ZodLiteral:()=>gl,ZodMAC:()=>Gu,ZodMap:()=>pl,ZodNaN:()=>Pl,ZodNanoID:()=>Bi,ZodNever:()=>il,ZodNonOptional:()=>uo,ZodNull:()=>el,ZodNullable:()=>$l,ZodNumber:()=>un,ZodNumberFormat:()=>Dt,ZodObject:()=>Qn,ZodOptional:()=>tr,ZodPipe:()=>nr,ZodPrefault:()=>zl,ZodPreprocess:()=>Dl,ZodPromise:()=>Al,ZodReadonly:()=>Ol,ZodRealError:()=>ze,ZodRecord:()=>on,ZodSet:()=>hl,ZodString:()=>sn,ZodStringFormat:()=>q,ZodSuccess:()=>Il,ZodSymbol:()=>Yu,ZodTemplateLiteral:()=>jl,ZodTransform:()=>_l,ZodTuple:()=>dl,ZodType:()=>E,ZodULID:()=>qi,ZodURL:()=>Hn,ZodUUID:()=>Ke,ZodUndefined:()=>Qu,ZodUnion:()=>er,ZodUnknown:()=>rl,ZodVoid:()=>ol,ZodXID:()=>Gi,ZodXor:()=>sl,_ZodString:()=>Fi,_default:()=>bl,_function:()=>Np,any:()=>mp,array:()=>Yn,base64:()=>Gf,base64url:()=>Wf,bigint:()=>sp,boolean:()=>Xu,catch:()=>Tl,check:()=>Ap,cidrv4:()=>Kf,cidrv6:()=>qf,clone:()=>V,codec:()=>Op,coerce:()=>Ll,compile:()=>lc,config:()=>ee,core:()=>Xe,creditCard:()=>Xf,cuid:()=>Zf,cuid2:()=>Cf,custom:()=>Ep,date:()=>pp,decode:()=>Lu,decodeAsync:()=>Vu,deepPartial:()=>Wp,describe:()=>Zp,discriminatedUnion:()=>$p,e164:()=>Hf,email:()=>Tf,emoji:()=>Af,encode:()=>Fu,encodeAsync:()=>Mu,endsWith:()=>Wt,enum:()=>ao,exactOptional:()=>yl,file:()=>Sp,flattenError:()=>Sn,float32:()=>rp,float64:()=>ip,formatError:()=>Tn,fromJSONSchema:()=>qp,function:()=>Np,getDiscriminatedOption:()=>Os,getErrorMap:()=>m$,globalRegistry:()=>ae,gt:()=>Be,gte:()=>Pe,guid:()=>Pf,hash:()=>np,hex:()=>tp,hostname:()=>ep,httpUrl:()=>Nf,includes:()=>qt,input:()=>Xp,instanceof:()=>Fp,int:()=>Zi,int32:()=>op,int64:()=>cp,intersection:()=>ll,invertCodec:()=>Rp,ipv4:()=>Vf,ipv6:()=>Jf,iso:()=>or,json:()=>Mp,jwt:()=>Yf,keyof:()=>hp,ksuid:()=>Mf,lazy:()=>Nl,length:()=>It,literal:()=>Ip,locales:()=>Fn,looseObject:()=>_p,looseRecord:()=>bp,lowercase:()=>Jt,lt:()=>Ve,lte:()=>Te,mac:()=>Bf,map:()=>zp,maxLength:()=>kt,maxSize:()=>at,memoizer:()=>Zn,meta:()=>Cp,mime:()=>Ht,minLength:()=>He,minSize:()=>Je,multipleOf:()=>ot,nan:()=>Dp,nanoid:()=>Ef,nativeEnum:()=>kp,negative:()=>Ii,never:()=>oo,nonnegative:()=>Ti,nonoptional:()=>kl,nonpositive:()=>Si,normalize:()=>Xt,null:()=>tl,nullable:()=>Wn,nullish:()=>Tp,number:()=>Hu,object:()=>gp,optional:()=>Tt,output:()=>Yp,overwrite:()=>Ze,parse:()=>Au,parseAsync:()=>Eu,partialRecord:()=>xp,pipe:()=>Ci,positive:()=>ki,prefault:()=>wl,preprocess:()=>Vp,prettifyError:()=>Mo,promise:()=>Up,properties:()=>Di,property:()=>Pi,readonly:()=>Rl,record:()=>fl,refine:()=>Zl,regex:()=>Bt,regexes:()=>fe,registry:()=>ni,safeDecode:()=>Ju,safeDecodeAsync:()=>qu,safeEncode:()=>Bu,safeEncodeAsync:()=>Ku,safeParse:()=>Zu,safeParseAsync:()=>Cu,set:()=>wp,setErrorMap:()=>d$,size:()=>wt,slugify:()=>tn,startsWith:()=>Gt,strictObject:()=>vp,string:()=>Gn,stringFormat:()=>Qf,stringbool:()=>Lp,success:()=>Pp,superRefine:()=>Cl,symbol:()=>lp,templateLiteral:()=>jp,toJSONSchema:()=>Ui,toLowerCase:()=>Qt,toUpperCase:()=>en,toZod:()=>_n,transform:()=>so,treeifyError:()=>Lo,trim:()=>Yt,tuple:()=>ml,uint32:()=>ap,uint64:()=>up,ulid:()=>Ff,undefined:()=>dp,union:()=>mn,unknown:()=>St,uppercase:()=>Kt,url:()=>Uf,util:()=>b,uuid:()=>Df,uuidv4:()=>Of,uuidv6:()=>Rf,uuidv7:()=>jf,validate:()=>Jo,validateAsync:()=>Ko,void:()=>fp,xid:()=>Lf,xor:()=>yp});var Xe={};Fe(Xe,{$ZodAny:()=>zs,$ZodArray:()=>Ts,$ZodAsyncError:()=>xe,$ZodBase64:()=>ms,$ZodBase64URL:()=>fs,$ZodBigInt:()=>Br,$ZodBigIntFormat:()=>ys,$ZodBoolean:()=>Un,$ZodCIDRv4:()=>ls,$ZodCIDRv6:()=>ds,$ZodCUID:()=>Ya,$ZodCUID2:()=>Qa,$ZodCatch:()=>qs,$ZodCheck:()=>W,$ZodCheckBigIntFormat:()=>Sa,$ZodCheckEndsWith:()=>Ca,$ZodCheckGreaterThan:()=>Tr,$ZodCheckIncludes:()=>Ea,$ZodCheckLengthEquals:()=>ja,$ZodCheckLessThan:()=>Sr,$ZodCheckLowerCase:()=>Na,$ZodCheckMaxLength:()=>Oa,$ZodCheckMaxSize:()=>Ta,$ZodCheckMimeType:()=>Fa,$ZodCheckMinLength:()=>Ra,$ZodCheckMinSize:()=>Pa,$ZodCheckMultipleOf:()=>ka,$ZodCheckNumberFormat:()=>Ia,$ZodCheckOverwrite:()=>La,$ZodCheckProperty:()=>Pr,$ZodCheckRegex:()=>Ua,$ZodCheckSizeEquals:()=>Da,$ZodCheckStartsWith:()=>Za,$ZodCheckStringFormat:()=>Lt,$ZodCheckUpperCase:()=>Aa,$ZodCodec:()=>An,$ZodCreditCard:()=>hs,$ZodCustom:()=>ec,$ZodCustomStringFormat:()=>vs,$ZodCyclicError:()=>Hr,$ZodDate:()=>Ss,$ZodDefault:()=>Vs,$ZodDiscriminatedUnion:()=>Rs,$ZodE164:()=>ps,$ZodEmail:()=>Ka,$ZodEmoji:()=>Ha,$ZodEncodeError:()=>rt,$ZodEnum:()=>Es,$ZodError:()=>In,$ZodExactOptional:()=>Ls,$ZodFile:()=>Cs,$ZodFunction:()=>Ys,$ZodGUID:()=>Ba,$ZodIPv4:()=>ss,$ZodIPv6:()=>cs,$ZodISODate:()=>is,$ZodISODateTime:()=>rs,$ZodISODuration:()=>as,$ZodISOTime:()=>os,$ZodIntersection:()=>js,$ZodJWT:()=>gs,$ZodKSUID:()=>ns,$ZodLazy:()=>En,$ZodLiteral:()=>Zs,$ZodMAC:()=>us,$ZodMap:()=>Ns,$ZodNaN:()=>Gs,$ZodNanoID:()=>Xa,$ZodNever:()=>ks,$ZodNonOptional:()=>Js,$ZodNull:()=>bs,$ZodNullable:()=>Ms,$ZodNumber:()=>Vr,$ZodNumberFormat:()=>_s,$ZodObject:()=>Xd,$ZodObjectJIT:()=>Ps,$ZodOptional:()=>Kr,$ZodPipe:()=>qr,$ZodPrefault:()=>Bs,$ZodPreprocess:()=>Ws,$ZodPromise:()=>Qs,$ZodReadonly:()=>Hs,$ZodRealError:()=>be,$ZodRecord:()=>Us,$ZodRegistry:()=>ti,$ZodSet:()=>As,$ZodString:()=>yt,$ZodStringFormat:()=>J,$ZodSuccess:()=>Ks,$ZodSymbol:()=>$s,$ZodTemplateLiteral:()=>Xs,$ZodTransform:()=>Fs,$ZodTuple:()=>Jr,$ZodType:()=>N,$ZodULID:()=>es,$ZodURL:()=>Wa,$ZodUUID:()=>Ja,$ZodUndefined:()=>xs,$ZodUnion:()=>Nn,$ZodUnknown:()=>ws,$ZodVoid:()=>Is,$ZodXID:()=>ts,$ZodXor:()=>Ds,$brand:()=>Eo,$constructor:()=>g,$input:()=>ac,$output:()=>oc,Doc:()=>_t,INVALID:()=>Se,JSONSchema:()=>kf,JSONSchemaGenerator:()=>Ni,NEVER:()=>Ao,TimePrecision:()=>gc,URL_BAD_FORMAT:()=>qa,URL_UNPARSEABLE:()=>Ga,ZodCompileAsyncError:()=>Ee,ZodCompileUnsupportedError:()=>L,_any:()=>jc,_array:()=>Fc,_base64:()=>xi,_base64url:()=>bi,_bigint:()=>Ic,_boolean:()=>wc,_catch:()=>Xy,_check:()=>_f,_cidrv4:()=>yi,_cidrv6:()=>$i,_coercedBigint:()=>Sc,_coercedBoolean:()=>kc,_coercedDate:()=>Zc,_coercedNumber:()=>_c,_coercedString:()=>fc,_creditCard:()=>hc,_cuid:()=>mi,_cuid2:()=>fi,_custom:()=>Mc,_date:()=>Ec,_decode:()=>vr,_decodeAsync:()=>yr,_default:()=>Gy,_discriminatedUnion:()=>Ay,_e164:()=>zi,_email:()=>ii,_emoji:()=>li,_encode:()=>gr,_encodeAsync:()=>_r,_endsWith:()=>Wt,_enum:()=>My,_file:()=>Lc,_float32:()=>$c,_float64:()=>xc,_gt:()=>Be,_gte:()=>Pe,_guid:()=>oi,_includes:()=>qt,_int:()=>yc,_int32:()=>bc,_int64:()=>Tc,_intersection:()=>Ey,_ipv4:()=>vi,_ipv6:()=>_i,_isoDate:()=>Vn,_isoDateTime:()=>Mn,_isoDuration:()=>Jn,_isoTime:()=>Bn,_jwt:()=>wi,_ksuid:()=>gi,_lazy:()=>t$,_length:()=>It,_literal:()=>By,_lowercase:()=>Jt,_lt:()=>Ve,_lte:()=>Te,_mac:()=>pc,_map:()=>Fy,_max:()=>Te,_maxLength:()=>kt,_maxSize:()=>at,_mime:()=>Ht,_min:()=>Pe,_minLength:()=>He,_minSize:()=>Je,_multipleOf:()=>ot,_nan:()=>Cc,_nanoid:()=>di,_nativeEnum:()=>Vy,_negative:()=>Ii,_never:()=>Nc,_nonnegative:()=>Ti,_nonoptional:()=>Wy,_nonpositive:()=>Si,_normalize:()=>Xt,_null:()=>Rc,_nullable:()=>qy,_number:()=>vc,_optional:()=>Ky,_overwrite:()=>Ze,_parse:()=>Et,_parseAsync:()=>Zt,_pipe:()=>Yy,_positive:()=>ki,_promise:()=>n$,_properties:()=>Di,_property:()=>Pi,_readonly:()=>Qy,_record:()=>Cy,_refine:()=>Vc,_regex:()=>Bt,_safeDecode:()=>xr,_safeDecodeAsync:()=>zr,_safeEncode:()=>$r,_safeEncodeAsync:()=>br,_safeParse:()=>Ct,_safeParseAsync:()=>Ft,_set:()=>Ly,_size:()=>wt,_slugify:()=>tn,_startsWith:()=>Gt,_string:()=>mc,_stringFormat:()=>nn,_stringbool:()=>qc,_success:()=>Hy,_superRefine:()=>Bc,_symbol:()=>Dc,_templateLiteral:()=>e$,_toLowerCase:()=>Qt,_toUpperCase:()=>en,_transform:()=>Jy,_trim:()=>Yt,_tuple:()=>Zy,_uint32:()=>zc,_uint64:()=>Pc,_ulid:()=>pi,_undefined:()=>Oc,_union:()=>Uy,_unknown:()=>Uc,_uppercase:()=>Kt,_url:()=>Ln,_uuid:()=>ai,_uuidv4:()=>si,_uuidv6:()=>ci,_uuidv7:()=>ui,_void:()=>Ac,_xid:()=>hi,_xor:()=>Ny,clone:()=>V,compile:()=>lc,compileFn:()=>ri,config:()=>ee,createStandardJSONSchemaMethod:()=>rn,createToJSONSchemaMethod:()=>Wc,decode:()=>Lg,decodeAsync:()=>Vg,describe:()=>Jc,encode:()=>Fg,encodeAsync:()=>Mg,extractDefs:()=>ct,finalize:()=>ut,flattenError:()=>Sn,formatError:()=>Tn,getDiscriminatedOption:()=>Os,globalConfig:()=>ie,globalRegistry:()=>ae,handleUnrepresentable:()=>ne,initializeContext:()=>st,isBackEdge:()=>Xr,isRecursiveSchema:()=>ic,isValidBase64:()=>jn,isValidBase64URL:()=>Fr,isValidCIDRv6:()=>Cr,isValidCreditCard:()=>Lr,isValidIPv6:()=>Rn,isValidJWT:()=>Mr,locales:()=>Fn,memoizer:()=>Zn,mergeValues:()=>Mt,meta:()=>Kc,parse:()=>pr,parseAsync:()=>hr,parseURLObject:()=>Nr,prettifyError:()=>Mo,process:()=>B,regexes:()=>fe,registry:()=>ni,safeDecode:()=>Jg,safeDecodeAsync:()=>qg,safeEncode:()=>Bg,safeEncodeAsync:()=>Kg,safeParse:()=>Vo,safeParseAsync:()=>Bo,standardProps:()=>Ur,stripTabAndNewline:()=>Ar,toDotPath:()=>Td,toJSONSchema:()=>Ui,toZod:()=>_n,treeifyError:()=>Lo,urlHostnameOk:()=>Er,urlProtocolOk:()=>Zr,util:()=>b,validate:()=>Jo,validateAsync:()=>Ko,version:()=>Ma});var b={};Fe(b,{BIGINT_FORMAT_RANGES:()=>Do,CONSTANT_CATCH:()=>mr,Class:()=>zo,NUMBER_FORMAT_RANGES:()=>Po,aborted:()=>nt,allowsEval:()=>Io,assert:()=>og,assertEqual:()=>tg,assertIs:()=>rg,assertNever:()=>ig,assertNotEqual:()=>ng,assignProp:()=>Q,attachSchema:()=>dr,base64ToUint8Array:()=>bd,base64urlToUint8Array:()=>zg,cached:()=>Nt,captureStackTrace:()=>lr,cleanEnum:()=>bg,cleanRegex:()=>$n,clone:()=>V,cloneDef:()=>sg,codePointLength:()=>gt,constantCatch:()=>Uo,createTransparentProxy:()=>fg,defineLazy:()=>wo,defineLazyInternal:()=>C,esc:()=>_e,escapeRegex:()=>je,explicitlyAborted:()=>Oo,extend:()=>gg,finalizeIssue:()=>$e,floatSafeRemainder:()=>xn,getElementAtPath:()=>cg,getEnumValues:()=>yn,getLengthableOrigin:()=>kn,getParsedType:()=>mg,getSizableOrigin:()=>wn,hexToUint8Array:()=>kg,hide:()=>jo,installLazyProp:()=>Dg,isObject:()=>ht,isPlainObject:()=>Re,issue:()=>At,joinValues:()=>v,jsonStringifyReplacer:()=>Ut,members:()=>Ro,merge:()=>_g,mergeDefs:()=>Ae,normalizeParams:()=>k,nullish:()=>ur,numKeys:()=>dg,objectClone:()=>ag,omit:()=>hg,optionalKeys:()=>To,own:()=>jt,parsedType:()=>$,partial:()=>yg,pick:()=>pg,prefixIssues:()=>ye,primitiveTypes:()=>So,promiseAllObject:()=>ug,propertyKeyTypes:()=>zn,randomString:()=>lg,required:()=>$g,safeExtend:()=>vg,shallowClone:()=>bn,slugify:()=>ko,stringifyPrimitive:()=>y,toZod:()=>_n,uint8ArrayToBase64:()=>zd,uint8ArrayToBase64url:()=>wg,uint8ArrayToHex:()=>Ig,unwrapMessage:()=>Rt});function tg(n){return n}function ng(n){return n}function _n(){return n=>n}function rg(n){}function ig(n){throw new Error("Unexpected value in exhaustive check")}function og(n){}function yn(n){let e=Object.values(n).filter(i=>typeof i=="number");return Object.entries(n).filter(([i,t])=>e.indexOf(+i)===-1).map(([i,t])=>t)}function v(n,e="|"){return n.map(r=>y(r)).join(e)}function Ut(n,e){return typeof e=="bigint"?e.toString():e}function Nt(n){return{get value(){{let r=n();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function ur(n){return n==null}function $n(n){let e=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(e,r)}function xn(n,e){let r=n/e,i=Math.round(r),t=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<t?0:r-i}var xd=Symbol("evaluating");function wo(n,e,r){let i;Object.defineProperty(n,e,{get(){if(i!==xd)return i===void 0&&(i=xd,i=r()),i},set(t){Object.defineProperty(n,e,{value:t})},configurable:!0})}function ag(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function Q(n,e,r){Object.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ae(...n){let e={};for(let r of n){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function sg(n){return Ae(n._zod.def)}function cg(n,e){return e?e.reduce((r,i)=>r?.[i],n):n}function ug(n){let e=Object.keys(n),r=e.map(i=>n[i]);return Promise.all(r).then(i=>{let t={};for(let o=0;o<e.length;o++)t[e[o]]=i[o];return t})}function lg(n=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<n;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function _e(n){return JSON.stringify(n)}function ko(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var lr="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function ht(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var Io=Nt(()=>{if(ie.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function Re(n){if(ht(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(ht(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function bn(n){return Re(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}function dg(n){let e=0;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&e++;return e}var mg=n=>{let e=typeof n;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(n)?"array":n===null?"null":n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?"promise":typeof Map<"u"&&n instanceof Map?"map":typeof Set<"u"&&n instanceof Set?"set":typeof Date<"u"&&n instanceof Date?"date":typeof File<"u"&&n instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},zn=new Set(["string","number","symbol"]),So=new Set(["string","number","bigint","boolean","symbol","undefined"]);function je(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function V(n,e,r){let i=new n._zod.constr(e??n._zod.def);return(!e||r?.parent)&&(i._zod.parent=n),i}function k(n){let e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function fg(n){let e;return new Proxy({},{get(r,i,t){return e??(e=n()),Reflect.get(e,i,t)},set(r,i,t,o){return e??(e=n()),Reflect.set(e,i,t,o)},has(r,i){return e??(e=n()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=n()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=n()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=n()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,t){return e??(e=n()),Reflect.defineProperty(e,i,t)}})}function y(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function To(n){return Object.keys(n).filter(e=>n[e]._zod.optin!==void 0&&n[e]._zod.optout==="optional")}var Po={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Do={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function pg(n,e){let r=n._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Ae(n._zod.def,{get shape(){let a={};for(let s of Reflect.ownKeys(e)){if(!Object.prototype.hasOwnProperty.call(r.shape,s))throw new Error(`Unrecognized key: "${String(s)}"`);e[s]&&Q(a,s,r.shape[s])}return Q(this,"shape",a),a},checks:[]});return V(n,o)}function hg(n,e){let r=n._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Ae(n._zod.def,{get shape(){let a={...n._zod.def.shape};for(let s of Reflect.ownKeys(e)){if(!Object.prototype.hasOwnProperty.call(r.shape,s))throw new Error(`Unrecognized key: "${String(s)}"`);e[s]&&delete a[s]}return Q(this,"shape",a),a},checks:[]});return V(n,o)}function gg(n,e){if(!Re(e))throw new Error("Invalid input to extend: expected a plain object");let r=n._zod.def.checks;if(r&&r.length>0){let o=n._zod.def.shape;for(let a of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let t=Ae(n._zod.def,{get shape(){let o={...n._zod.def.shape,...e};return Q(this,"shape",o),o}});return V(n,t)}function vg(n,e){if(!Re(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ae(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e};return Q(this,"shape",i),i}});return V(n,r)}function _g(n,e){if(!e?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Ae(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e._zod.def.shape};return Q(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return V(n,r)}function yg(n,e,r,i="partial"){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let s=Ae(e._zod.def,{get shape(){let c=e._zod.def.shape,u={...c};if(r)for(let l of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(c,l))throw new Error(`Unrecognized key: "${String(l)}"`);r[l]&&(u[l]=n?new n({type:"optional",innerType:c[l]}):c[l])}else for(let l of Reflect.ownKeys(c))u[l]=n?new n({type:"optional",innerType:c[l]}):c[l];return Q(this,"shape",u),u},checks:[]});return V(e,s)}function $g(n,e,r){let i=Ae(e._zod.def,{get shape(){let t=e._zod.def.shape,o={...t};if(r)for(let a of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(o,a))throw new Error(`Unrecognized key: "${String(a)}"`);r[a]&&(o[a]=new n({type:"nonoptional",innerType:t[a]}))}else for(let a of Reflect.ownKeys(t))o[a]=new n({type:"nonoptional",innerType:t[a]});return Q(this,"shape",o),o}});return V(e,i)}function nt(n,e=0){if(n.aborted===!0)return!0;for(let r=e;r<n.issues.length;r++)if(n.issues[r]?.continue!==!0)return!0;return!1}function Oo(n,e=0){if(n.aborted===!0)return!0;for(let r=e;r<n.issues.length;r++)if(n.issues[r]?.continue===!1)return!0;return!1}function ye(n,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(n),r})}function Rt(n){return typeof n=="string"?n:n?.message}function dr(n,e,r){var i;for(let t=e;t<n.length;t++)(i=n[t]).schema??(i.schema=r)}function $e(n,e,r){var i;let t=n.inst?._zod?.traits;t?.has("$ZodType")&&(t.has("$ZodCheck")?(i=n).schema??(i.schema=n.inst):n.schema=n.inst);let o=n.schema!==n.inst?n.schema?._zod.def?.error:void 0,a=n.message?n.message:Rt(n.inst?._zod.def?.error?.(n))??Rt(o?.(n))??Rt(e?.error?.(n))??Rt(r.customError?.(n))??Rt(r.localeError?.(n))??"Invalid input",{inst:s,schema:c,continue:u,input:l,...d}=n;return d.path??(d.path=[]),d.message=a,e?.reportInput&&(d.input=l),d}function wn(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}var xg=/[\uD800-\uDBFF]/;function gt(n){let e=n.length;if(!xg.test(n))return e;let r=e;for(let i=0;i<e-1;i++)(n.charCodeAt(i)&64512)===55296&&(n.charCodeAt(i+1)&64512)===56320&&(r--,i++);return r}function kn(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function $(n){let e=typeof n;switch(e){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let r=n;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function At(...n){let[e,r,i]=n;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function bg(n){return Object.entries(n).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function bd(n){let e=atob(n),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function zd(n){let e="";for(let r=0;r<n.length;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function zg(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return bd(e+r)}function wg(n){return zd(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function kg(n){let e=n.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function Ig(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var zo=class{constructor(...e){}};function Ro(n,e){for(let r in e){let i=Object.getOwnPropertyDescriptor(e,r);i.get?Object.defineProperty(n,r,{...i,enumerable:!1}):Sg(n,r,i.value)}}function jt(n,e,r,i=!0){return Object.defineProperty(n,e,{configurable:!0,writable:!0,enumerable:i,value:r}),r}function jo(n,e,r){return jt(n,e,r,!1)}function Sg(n,e,r){Object.defineProperty(n,e,{configurable:!0,get(){return this==null?r:jt(this,e,r.bind(this))},set(i){jt(this,e,i)}})}function Tg(n,e){let r=Object.getPrototypeOf(n);return e in r?void 0:r}var bo,tt=!1,Pg={configurable:!0,get(){tt=!0}};function C(n,e,r){let i=Object.getPrototypeOf(n._zod);if(e in i&&bo!==n._zod){bo=void 0;return}bo=n._zod,Object.defineProperty(i,e,{configurable:!0,get(){Object.defineProperty(this,e,Pg);let t=tt;tt=!1;try{let o=r(this);return tt?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:o}),tt=tt||t,o}catch(o){throw delete this[e],tt=tt||t,o}},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}function Dg(n,e,r,i){let t=Tg(n,e);t&&Object.defineProperty(t,e,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,e,o),o.value=r(this),Object.defineProperty(this,e,o),o.value},set(o){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var mr="~constantCatch";function Uo(n){let e=()=>n;return e[mr]=!0,e}var wd,Ao=Object.freeze({status:"aborted"}),No={value:void 0,enumerable:!1},kd="captureStackTrace"in Error?Error:null;function Og(n){let e=kd;if(e){let r=e.stackTraceLimit;if(typeof r=="number"){try{e.stackTraceLimit=0}catch{return kd=null,new n}try{return new n}finally{e.stackTraceLimit=r}}}return new n}function g(n,e,r,i){let t={};function o(m){this.def=m,this.constr=d,this.traits=new Set}o.prototype=t;let a=r,s=a&&new WeakSet;function c(m,f){if(!m._zod){No.value=new o(f);try{Object.defineProperty(m,"_zod",No)}finally{No.value=void 0}}if(m._zod.traits.has(n))return;if(m._zod.traits.add(n),e(m,f),s){let _=Object.getPrototypeOf(m),z=m._zod.constr.prototype,P=_;for(;P&&P!==z;)P=Object.getPrototypeOf(P);let x=P??_;s.has(x)||(s.add(x),Ro(x,a))}let h=d.prototype;for(let _ in h)Object.prototype.hasOwnProperty.call(h,_)&&(_ in m||(m[_]=h[_].bind(m)))}let u=i?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:n});function d(m){let f=i?.Parent?Og(l):this;c(f,m);let h=f._zod.deferred;if(h){for(let z of h)z();f._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(f),f}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:m=>i?.Parent&&m instanceof i.Parent?!0:m?._zod?.traits?.has(n)}),Object.defineProperty(d,"name",{value:n}),d}var Eo=Symbol("zod_brand"),xe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},rt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(wd=globalThis).__zod_globalConfig??(wd.__zod_globalConfig={});var ie=globalThis.__zod_globalConfig;function ee(n){return n&&Object.assign(ie,n),ie}function Rg(){let n=this._zod;return n.message??(n.message=JSON.stringify(n.def,Ut,2)),n.message}function jg(n){this._zod.message=n}var Ug={get:Rg,set:jg,enumerable:!0,configurable:!0},Co={value:void 0,enumerable:!1},Fo={value:void 0,enumerable:!1},Id=new WeakSet([Object.prototype,Error.prototype]),Sd=(n,e)=>{n.name="$ZodError",Co.value=n._zod,Object.defineProperty(n,"_zod",Co),Fo.value=e,Object.defineProperty(n,"issues",Fo),Co.value=void 0,Fo.value=void 0,Object.defineProperty(n,"message",Ug);let r=Object.getPrototypeOf(n);Id.has(r)||(Id.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},In=g("$ZodError",Sd),be=g("$ZodError",Sd,void 0,{Parent:Error});function Ng(n,e,r){return Object.prototype.hasOwnProperty.call(n,e)||(e==="__proto__"?Object.defineProperty(n,e,{value:r(),writable:!0,enumerable:!0,configurable:!0}):n[e]=r()),n[e]}function Sn(n,e=r=>r.message){let r={},i=[];for(let t of n.issues)t.path.length>0?Ng(r,t.path[0],()=>[]).push(e(t)):i.push(e(t));return{formErrors:i,fieldErrors:r}}function Tn(n,e=r=>r.message){let r={_errors:[]},i=(t,o=[])=>{for(let a of t.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)r._errors.push(e(a));else{let c=r,u=0;for(;u<s.length;){let l=s[u],d=u===s.length-1;if(l==="_errors"){d&&c._errors.push(e(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[l];d&&m._errors.push(e(a)),c=m,u++}}}};return i(n),r}function Lo(n,e=r=>r.message){let r={errors:[]},i=(t,o=[])=>{var a;for(let s of t.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0){r.errors.push(e(s));continue}let u=r,l=0;for(;l<c.length;){let d=c[l],m=l===c.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),m&&u.errors.push(e(s)),l++}}};return i(n),r}function Td(n){let e=[],r=n.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Mo(n){let e=[],r=[...n.issues].sort((i,t)=>(i.path??[]).length-(t.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${Td(i.path)}`);return e.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uptimizr/replay",
3
- "version": "0.2.6",
3
+ "version": "1.0.1",
4
4
  "description": "Framework-agnostic session-replay core + Babylon driver. Re-drives a captured session in the user's own scene.",
5
5
  "keywords": [
6
6
  "uptimizr",
@@ -78,12 +78,12 @@
78
78
  },
79
79
  "dependencies": {
80
80
  "zod": "^4.5.4",
81
- "@uptimizr/schema": "0.6.1",
82
- "@uptimizr/sdk-core": "0.5.1"
81
+ "@uptimizr/sdk-core": "1.0.1",
82
+ "@uptimizr/schema": "1.0.1"
83
83
  },
84
84
  "devDependencies": {
85
- "@babylonjs/core": "^9.23.0",
86
- "@babylonjs/lite": "^1.25.0",
85
+ "@babylonjs/core": "^9.25.0",
86
+ "@babylonjs/lite": "^1.27.0",
87
87
  "esbuild": "^0.28.2",
88
88
  "playcanvas": "2.21.4",
89
89
  "three": "^0.185.1",
@@ -91,11 +91,11 @@
91
91
  },
92
92
  "scripts": {
93
93
  "build": "tsc -p tsconfig.json && pnpm run bundle:global",
94
- "bundle:global": "esbuild src/global.ts --bundle --format=iife --global-name=UptimizrReplay --platform=browser --target=es2022 --minify --legal-comments=none --external:@babylonjs/core/Loading/sceneLoader.js --banner:js=\"/* @uptimizr/replay standalone bundle (global) — Apache-2.0. Inject via a <script> tag into any page (e.g. playground.babylonjs.com); exposes window.UptimizrReplay. Bundles the Babylon Vector3 it constructs; the host page owns the scene (and its asset loader). */\" --outfile=dist/uptimizr-replay.global.js",
94
+ "bundle:global": "esbuild src/global.ts --bundle --format=iife --log-override:empty-import-meta=silent --global-name=UptimizrReplay --platform=browser --target=es2022 --minify --legal-comments=none --external:@babylonjs/core/Loading/sceneLoader.js --banner:js=\"/* @uptimizr/replay standalone bundle (global) — Apache-2.0. Inject via a <script> tag into any page (e.g. playground.babylonjs.com); exposes window.UptimizrReplay. Bundles the Babylon Vector3 it constructs; the host page owns the scene (and its asset loader). */\" --outfile=dist/uptimizr-replay.global.js",
95
95
  "dev": "tsc -p tsconfig.json --watch",
96
96
  "typecheck": "tsc -p tsconfig.json --noEmit",
97
97
  "test": "vitest run",
98
98
  "lint": "eslint .",
99
- "clean": "rm -rf dist"
99
+ "clean": "rimraf dist"
100
100
  }
101
101
  }