@dcl/builder-site 7.2.3 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{Back-3lqsvQ4K.js → Back-CmrASlX3.js} +1 -1
- package/assets/{CollectionProvider.container-D7Q3L_Zh.js → CollectionProvider.container-DOhRKeRu.js} +1 -1
- package/assets/{CollectionStatus.container-DMTnAYoK.js → CollectionStatus.container-NEqFbtYE.js} +1 -1
- package/assets/{ConfirmDelete-C_J3qEsY.js → ConfirmDelete-DN98x9nl.js} +1 -1
- package/assets/{FileSaver.min-Bt83hOdI.js → FileSaver.min-iJfSJV1w.js} +1 -1
- package/assets/{ItemProvider.container-Y7lkADhP.js → ItemProvider.container-BRpScX9b.js} +1 -1
- package/assets/{JumpIn.container-CsAlO0hD.js → JumpIn.container-BvDOoqTn.js} +1 -1
- package/assets/{LandAction-BXNGNhXP.js → LandAction-C6Ncoc71.js} +1 -1
- package/assets/{LandProviderPage-BEOIh0H2.js → LandProviderPage-BmBQ8e2k.js} +1 -1
- package/assets/{LoggedInDetailPage.container-CG29n1_U.js → LoggedInDetailPage.container-iODRZ5_l.js} +1 -1
- package/assets/{Navigation-D3yLJtY2.css → Navigation-De175sH6.css} +1 -1
- package/assets/{Navigation.container-COpaMzxC.js → Navigation.container-BZFqWR65.js} +1 -1
- package/assets/{NotFound-CBkI36Sj.js → NotFound-DAstcQ7G.js} +1 -1
- package/assets/{OptionsDropdown-DHePoh2i.js → OptionsDropdown-wWmxnpgA.js} +1 -1
- package/assets/{RentalPeriod-x-10gWSB.js → RentalPeriod-CdjbV9WM.js} +1 -1
- package/assets/{SDKTag--ttQ5W4k.js → SDKTag-GVA6nW7P.js} +1 -1
- package/assets/{SceneStats.container-Dbo5VyJY.js → SceneStats.container-CAMK4paj.js} +1 -1
- package/assets/{SignInRequired-C_iqcbEx.js → SignInRequired-B3HAtRFv.js} +1 -1
- package/assets/{ThirdPartyKindBadge-DI8Au6V1.js → ThirdPartyKindBadge-B8owNMMy.js} +1 -1
- package/assets/{dataReader-18dNwwWA.js → dataReader-DfKSTeuK.js} +1 -1
- package/assets/{date-BUZUk5-K.js → date-DHhUNLFy.js} +1 -1
- package/assets/{fortmatic-GEUvejTj.js → fortmatic-Bej0PemP.js} +1 -1
- package/assets/{index-iQkJ7ncO.js → index-8CHEe-ss.js} +1 -1
- package/assets/{index-Dsy1fxY7.js → index-B4ZW2Z_u.js} +1 -1
- package/assets/{index-pdYsHD6j.js → index-B4yi1NlK.js} +1 -1
- package/assets/{index-fxggSp4A.js → index-B5pd48tO.js} +1 -1
- package/assets/{index-BOoLOrMt.js → index-B6qX4-6j.js} +1 -1
- package/assets/{index-1JiLs6xt.js → index-BDePC9hB.js} +1 -1
- package/assets/{index-DCP5MuDo.css → index-BFuH4F1r.css} +1 -1
- package/assets/{index-DSIhJEO7.js → index-BXWgEra7.js} +1 -1
- package/assets/{index-iQS2NjJV.js → index-BhYCONdT.js} +1 -1
- package/assets/{index-C5kvo6ZE.js → index-BmwjHEx4.js} +1 -1
- package/assets/{index-CF0IKUON.css → index-BnwFajcc.css} +1 -1
- package/assets/{index-CYDa4E7Z.css → index-Bo-YlyS1.css} +1 -1
- package/assets/{index-BqLyNmoW.js → index-Bu91bpAP.js} +1 -1
- package/assets/{index-D2UrmU_b.js → index-BuNvkYN8.js} +1 -1
- package/assets/{index-Cc35HPe0.js → index-C2F43J8F.js} +1 -1
- package/assets/index-CEHfYCKG.js +1 -0
- package/assets/{index-D16q6yvC.js → index-CO2Jsdt3.js} +1 -1
- package/assets/{index-CWzBxJIY.js → index-CWDRzwFa.js} +1 -1
- package/assets/{index-CpQkOQzi.js → index-CZiCSiQu.js} +1 -1
- package/assets/{index-BCnT436C.js → index-Cbyzlv4X.js} +1 -1
- package/assets/{index-DUKUKcUm.css → index-Cj-lVnrZ.css} +7 -7
- package/assets/index-Cq21LvcY.js +1 -0
- package/assets/{index-Ca1FIoFE.js → index-Cr8Y-7z7.js} +1 -1
- package/assets/{index-3Won5U-l.js → index-CtlR5vLP.js} +24 -24
- package/assets/{index-BotAhiGp.js → index-CwJczhBw.js} +1 -1
- package/assets/{index-CsWzLDJS.css → index-CxRhC40I.css} +1 -1
- package/assets/{index-CybdoCXN.css → index-D3BmLld5.css} +1 -1
- package/assets/{index-BIyNJ3tV.js → index-D88Kj2Su.js} +1 -1
- package/assets/{index-UMT5Znqx.js → index-D8jdVU90.js} +1 -1
- package/assets/{index-DA_BTV6W.css → index-DDVswcxH.css} +1 -1
- package/assets/{index-ylsxIjgc.js → index-DGOXxMEX.js} +1 -1
- package/assets/{index-3iUqbXt4.js → index-DHr-nc9d.js} +1 -1
- package/assets/{index-5vMgQwwN.js → index-DL2T9rVI.js} +1 -1
- package/assets/{index-DWBkKfGl.js → index-DTDcruxk.js} +1 -1
- package/assets/{index-0l5G1bvn.js → index-DWa23QKq.js} +1 -1
- package/assets/{index-zFVHafJW.js → index-DhfxQISc.js} +1 -1
- package/assets/{index-DgbTUhJF.js → index-DkQLxn7s.js} +2 -2
- package/assets/{index-C9vL9TxX.js → index-DkxIf62a.js} +1 -1
- package/assets/{index-Bgad-9EV.js → index-DlmcFMIc.js} +1 -1
- package/assets/{index-DawR4I4O.js → index-Dp84zHnv.js} +1 -1
- package/assets/{index-TFXsE77L.js → index-DuWRVwpy.js} +1 -1
- package/assets/{index-BWoFMTKz.js → index-DyLoqE9D.js} +1 -1
- package/assets/{index-B-8LRnXx.js → index-GTriaZJc.js} +1 -1
- package/assets/{index-CqAbSyBR.js → index-OCzT0a-k.js} +1 -1
- package/assets/{index-Tsy7eeyl.js → index-P5tHAbfe.js} +1 -1
- package/assets/{index-il3yM9Di.js → index-QeHYGpFS.js} +1 -1
- package/assets/{index-BlYXeJC2.js → index-d09gJZXe.js} +1 -1
- package/assets/{index-zjq-Eyga.js → index-h5x8oMDN.js} +1 -1
- package/assets/{index-Ck_fZph-.js → index-kNjlVuOw.js} +1 -1
- package/assets/{index.es-CavG5WkY.js → index.es-oJ7IgpG8.js} +4 -4
- package/assets/{selectors-ClN-5Gd3.js → selectors-DB1jYqTE.js} +1 -1
- package/index.html +3 -3
- package/package.json +3 -3
- package/assets/index-BiPrJEWC.js +0 -1
- package/assets/index-Dn7fTV6c.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{hP as g,hO as j,hQ as tt}from"./index-3Won5U-l.js";var mi=function(){function n(){this.rootNodes=new Array,this.cameras=new Array,this.lights=new Array,this.meshes=new Array,this.skeletons=new Array,this.particleSystems=new Array,this.animations=[],this.animationGroups=new Array,this.multiMaterials=new Array,this.materials=new Array,this.morphTargetManagers=new Array,this.geometries=new Array,this.transformNodes=new Array,this.actionManagers=new Array,this.textures=new Array,this._environmentTexture=null,this.postProcesses=new Array}return n.AddParser=function(e,t){this._BabylonFileParsers[e]=t},n.GetParser=function(e){return this._BabylonFileParsers[e]?this._BabylonFileParsers[e]:null},n.AddIndividualParser=function(e,t){this._IndividualBabylonFileParsers[e]=t},n.GetIndividualParser=function(e){return this._IndividualBabylonFileParsers[e]?this._IndividualBabylonFileParsers[e]:null},n.Parse=function(e,t,i,r){for(var a in this._BabylonFileParsers)this._BabylonFileParsers.hasOwnProperty(a)&&this._BabylonFileParsers[a](e,t,i,r)},Object.defineProperty(n.prototype,"environmentTexture",{get:function(){return this._environmentTexture},set:function(e){this._environmentTexture=e},enumerable:!1,configurable:!0}),n.prototype.getNodes=function(){var e=new Array;return e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes),this.skeletons.forEach(function(t){return e=e.concat(t.bones)}),e},n._BabylonFileParsers={},n._IndividualBabylonFileParsers={},n}(),Rt=function(){function n(){this.hoverCursor="",this.actions=new Array,this.isRecursive=!1}return Object.defineProperty(n,"HasTriggers",{get:function(){for(var e in n.Triggers)if(n.Triggers.hasOwnProperty(e))return!0;return!1},enumerable:!1,configurable:!0}),Object.defineProperty(n,"HasPickTriggers",{get:function(){for(var e in n.Triggers)if(n.Triggers.hasOwnProperty(e)){var t=parseInt(e);if(t>=1&&t<=7)return!0}return!1},enumerable:!1,configurable:!0}),n.HasSpecificTrigger=function(e){for(var t in n.Triggers)if(n.Triggers.hasOwnProperty(t)){var i=parseInt(t);if(i===e)return!0}return!1},n.Triggers={},n}(),lr=function(){function n(e,t,i,r){t===void 0&&(t=!1),this.initalize(e,t,i,r)}return n.prototype.initalize=function(e,t,i,r){return t===void 0&&(t=!1),this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=r,this},n}(),fr=function(){function n(e,t,i){i===void 0&&(i=null),this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1}return n}(),Ys=function(){function n(){}return n.prototype.dispose=function(){if(this._observers&&this._observables)for(var e=0;e<this._observers.length;e++)this._observables[e].remove(this._observers[e]);this._observers=null,this._observables=null},n.Watch=function(e,t,i,r){i===void 0&&(i=-1),r===void 0&&(r=null);var a=new n;a._observers=new Array,a._observables=e;for(var o=0,s=e;o<s.length;o++){var l=s[o],f=l.add(t,i,!1,r);f&&a._observers.push(f)}return a},n}(),O=function(){function n(e){this._observers=new Array,this._eventState=new lr(0),e&&(this._onObserverAdded=e)}return Object.defineProperty(n.prototype,"observers",{get:function(){return this._observers},enumerable:!1,configurable:!0}),n.prototype.add=function(e,t,i,r,a){if(t===void 0&&(t=-1),i===void 0&&(i=!1),r===void 0&&(r=null),a===void 0&&(a=!1),!e)return null;var o=new fr(e,t,r);return o.unregisterOnNextCall=a,i?this._observers.unshift(o):this._observers.push(o),this._onObserverAdded&&this._onObserverAdded(o),o},n.prototype.addOnce=function(e){return this.add(e,void 0,void 0,void 0,!0)},n.prototype.remove=function(e){if(!e)return!1;var t=this._observers.indexOf(e);return t!==-1?(this._deferUnregister(e),!0):!1},n.prototype.removeCallback=function(e,t){for(var i=0;i<this._observers.length;i++){var r=this._observers[i];if(!r._willBeUnregistered&&r.callback===e&&(!t||t===r.scope))return this._deferUnregister(r),!0}return!1},n.prototype._deferUnregister=function(e){var t=this;e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(function(){t._remove(e)},0)},n.prototype._remove=function(e){if(!e)return!1;var t=this._observers.indexOf(e);return t!==-1?(this._observers.splice(t,1),!0):!1},n.prototype.makeObserverTopPriority=function(e){this._remove(e),this._observers.unshift(e)},n.prototype.makeObserverBottomPriority=function(e){this._remove(e),this._observers.push(e)},n.prototype.notifyObservers=function(e,t,i,r,a){if(t===void 0&&(t=-1),!this._observers.length)return!0;var o=this._eventState;o.mask=t,o.target=i,o.currentTarget=r,o.skipNextObservers=!1,o.lastReturnValue=e,o.userInfo=a;for(var s=0,l=this._observers;s<l.length;s++){var f=l[s];if(!f._willBeUnregistered&&(f.mask&t&&(f.scope?o.lastReturnValue=f.callback.apply(f.scope,[e,o]):o.lastReturnValue=f.callback(e,o),f.unregisterOnNextCall&&this._deferUnregister(f)),o.skipNextObservers))return!1}return!0},n.prototype.notifyObserversWithPromise=function(e,t,i,r,a){var o=this;t===void 0&&(t=-1);var s=Promise.resolve(e);if(!this._observers.length)return s;var l=this._eventState;return l.mask=t,l.target=i,l.currentTarget=r,l.skipNextObservers=!1,l.userInfo=a,this._observers.forEach(function(f){l.skipNextObservers||f._willBeUnregistered||f.mask&t&&(f.scope?s=s.then(function(u){return l.lastReturnValue=u,f.callback.apply(f.scope,[e,l])}):s=s.then(function(u){return l.lastReturnValue=u,f.callback(e,l)}),f.unregisterOnNextCall&&o._deferUnregister(f))}),s.then(function(){return e})},n.prototype.notifyObserver=function(e,t,i){i===void 0&&(i=-1);var r=this._eventState;r.mask=i,r.skipNextObservers=!1,e.callback(t,r)},n.prototype.hasObservers=function(){return this._observers.length>0},n.prototype.clear=function(){this._observers=new Array,this._onObserverAdded=null},n.prototype.clone=function(){var e=new n;return e._observers=this._observers.slice(0),e},n.prototype.hasSpecificMask=function(e){e===void 0&&(e=-1);for(var t=0,i=this._observers;t<i.length;t++){var r=i[t];if(r.mask&e||r.mask===e)return!0}return!1},n}(),K=function(){function n(){}return n.WithinEpsilon=function(e,t,i){i===void 0&&(i=1401298e-51);var r=e-t;return-i<=r&&r<=i},n.ToHex=function(e){var t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()},n.Sign=function(e){return e=+e,e===0||isNaN(e)?e:e>0?1:-1},n.Clamp=function(e,t,i){return t===void 0&&(t=0),i===void 0&&(i=1),Math.min(i,Math.max(t,e))},n.Log2=function(e){return Math.log(e)*Math.LOG2E},n.Repeat=function(e,t){return e-Math.floor(e/t)*t},n.Normalize=function(e,t,i){return(e-t)/(i-t)},n.Denormalize=function(e,t,i){return e*(i-t)+t},n.DeltaAngle=function(e,t){var i=n.Repeat(t-e,360);return i>180&&(i-=360),i},n.PingPong=function(e,t){var i=n.Repeat(e,t*2);return t-Math.abs(i-t)},n.SmoothStep=function(e,t,i){var r=n.Clamp(i);return r=-2*r*r*r+3*r*r,t*r+e*(1-r)},n.MoveTowards=function(e,t,i){var r=0;return Math.abs(t-e)<=i?r=t:r=e+n.Sign(t-e)*i,r},n.MoveTowardsAngle=function(e,t,i){var r=n.DeltaAngle(e,t),a=0;return-i<r&&r<i?a=t:(t=e+r,a=n.MoveTowards(e,t,i)),a},n.Lerp=function(e,t,i){return e+(t-e)*i},n.LerpAngle=function(e,t,i){var r=n.Repeat(t-e,360);return r>180&&(r-=360),e+r*n.Clamp(i)},n.InverseLerp=function(e,t,i){var r=0;return e!=t?r=n.Clamp((i-e)/(t-e)):r=0,r},n.Hermite=function(e,t,i,r,a){var o=a*a,s=a*o,l=2*s-3*o+1,f=-2*s+3*o,u=s-2*o+a,c=s-o;return e*l+i*f+t*u+r*c},n.RandomRange=function(e,t){return e===t?e:Math.random()*(t-e)+e},n.RangeToPercent=function(e,t,i){return(e-t)/(i-t)},n.PercentToRange=function(e,t,i){return(i-t)*e+t},n.NormalizeRadians=function(e){return e-=n.TwoPi*Math.floor((e+Math.PI)/n.TwoPi),e},n.TwoPi=Math.PI*2,n}(),gt=1/2.2,it=2.2,Ce=.001,be=function(){function n(){}return n.BuildArray=function(e,t){for(var i=[],r=0;r<e;++r)i.push(t());return i},n}(),de=function(){function n(){}return n.GetClass=function(e){return this.RegisteredTypes&&this.RegisteredTypes[e]?this.RegisteredTypes[e]:null},n.RegisteredTypes={},n}(),ut=function(){function n(){}return n.SetMatrixPrecision=function(e){if(n.MatrixTrackPrecisionChange=!1,e&&!n.MatrixUse64Bits&&n.MatrixTrackedMatrices)for(var t=0;t<n.MatrixTrackedMatrices.length;++t){var i=n.MatrixTrackedMatrices[t],r=i._m;i._m=new Array(16);for(var a=0;a<16;++a)i._m[a]=r[a]}n.MatrixUse64Bits=e,n.MatrixCurrentType=n.MatrixUse64Bits?Array:Float32Array,n.MatrixTrackedMatrices=null},n.MatrixUse64Bits=!1,n.MatrixTrackPrecisionChange=!0,n.MatrixCurrentType=Float32Array,n.MatrixTrackedMatrices=[],n}(),ce=function(){function n(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this.x=e,this.y=t}return n.prototype.toString=function(){return"{X: "+this.x+" Y: "+this.y+"}"},n.prototype.getClassName=function(){return"Vector2"},n.prototype.getHashCode=function(){var e=this.x|0;return e=e*397^(this.y|0),e},n.prototype.toArray=function(e,t){return t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,this},n.prototype.fromArray=function(e,t){return t===void 0&&(t=0),n.FromArrayToRef(e,t,this),this},n.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},n.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this},n.prototype.copyFromFloats=function(e,t){return this.x=e,this.y=t,this},n.prototype.set=function(e,t){return this.copyFromFloats(e,t)},n.prototype.add=function(e){return new n(this.x+e.x,this.y+e.y)},n.prototype.addToRef=function(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,this},n.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this},n.prototype.addVector3=function(e){return new n(this.x+e.x,this.y+e.y)},n.prototype.subtract=function(e){return new n(this.x-e.x,this.y-e.y)},n.prototype.subtractToRef=function(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,this},n.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this},n.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this},n.prototype.multiply=function(e){return new n(this.x*e.x,this.y*e.y)},n.prototype.multiplyToRef=function(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,this},n.prototype.multiplyByFloats=function(e,t){return new n(this.x*e,this.y*t)},n.prototype.divide=function(e){return new n(this.x/e.x,this.y/e.y)},n.prototype.divideToRef=function(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,this},n.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},n.prototype.negate=function(){return new n(-this.x,-this.y)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this},n.prototype.negateToRef=function(e){return e.copyFromFloats(this.x*-1,this.y*-1)},n.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this},n.prototype.scale=function(e){var t=new n(0,0);return this.scaleToRef(e,t),t},n.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,this},n.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,this},n.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y},n.prototype.equalsWithEpsilon=function(e,t){return t===void 0&&(t=Ce),e&&K.WithinEpsilon(this.x,e.x,t)&&K.WithinEpsilon(this.y,e.y,t)},n.prototype.floor=function(){return new n(Math.floor(this.x),Math.floor(this.y))},n.prototype.fract=function(){return new n(this.x-Math.floor(this.x),this.y-Math.floor(this.y))},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},n.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},n.prototype.normalize=function(){var e=this.length();return e===0?this:(this.x/=e,this.y/=e,this)},n.prototype.clone=function(){return new n(this.x,this.y)},n.Zero=function(){return new n(0,0)},n.One=function(){return new n(1,1)},n.FromArray=function(e,t){return t===void 0&&(t=0),new n(e[t],e[t+1])},n.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1]},n.CatmullRom=function(e,t,i,r,a){var o=a*a,s=a*o,l=.5*(2*t.x+(-e.x+i.x)*a+(2*e.x-5*t.x+4*i.x-r.x)*o+(-e.x+3*t.x-3*i.x+r.x)*s),f=.5*(2*t.y+(-e.y+i.y)*a+(2*e.y-5*t.y+4*i.y-r.y)*o+(-e.y+3*t.y-3*i.y+r.y)*s);return new n(l,f)},n.Clamp=function(e,t,i){var r=e.x;r=r>i.x?i.x:r,r=r<t.x?t.x:r;var a=e.y;return a=a>i.y?i.y:a,a=a<t.y?t.y:a,new n(r,a)},n.Hermite=function(e,t,i,r,a){var o=a*a,s=a*o,l=2*s-3*o+1,f=-2*s+3*o,u=s-2*o+a,c=s-o,h=e.x*l+i.x*f+t.x*u+r.x*c,p=e.y*l+i.y*f+t.y*u+r.y*c;return new n(h,p)},n.Lerp=function(e,t,i){var r=e.x+(t.x-e.x)*i,a=e.y+(t.y-e.y)*i;return new n(r,a)},n.Dot=function(e,t){return e.x*t.x+e.y*t.y},n.Normalize=function(e){var t=e.clone();return t.normalize(),t},n.Minimize=function(e,t){var i=e.x<t.x?e.x:t.x,r=e.y<t.y?e.y:t.y;return new n(i,r)},n.Maximize=function(e,t){var i=e.x>t.x?e.x:t.x,r=e.y>t.y?e.y:t.y;return new n(i,r)},n.Transform=function(e,t){var i=n.Zero();return n.TransformToRef(e,t,i),i},n.TransformToRef=function(e,t,i){var r=t.m,a=e.x*r[0]+e.y*r[4]+r[12],o=e.x*r[1]+e.y*r[5]+r[13];i.x=a,i.y=o},n.PointInTriangle=function(e,t,i,r){var a=.5*(-i.y*r.x+t.y*(-i.x+r.x)+t.x*(i.y-r.y)+i.x*r.y),o=a<0?-1:1,s=(t.y*r.x-t.x*r.y+(r.y-t.y)*e.x+(t.x-r.x)*e.y)*o,l=(t.x*i.y-t.y*i.x+(t.y-i.y)*e.x+(i.x-t.x)*e.y)*o;return s>0&&l>0&&s+l<2*a*o},n.Distance=function(e,t){return Math.sqrt(n.DistanceSquared(e,t))},n.DistanceSquared=function(e,t){var i=e.x-t.x,r=e.y-t.y;return i*i+r*r},n.Center=function(e,t){var i=e.add(t);return i.scaleInPlace(.5),i},n.DistanceOfPointFromSegment=function(e,t,i){var r=n.DistanceSquared(t,i);if(r===0)return n.Distance(e,t);var a=i.subtract(t),o=Math.max(0,Math.min(1,n.Dot(e.subtract(t),a)/r)),s=t.add(a.multiplyByFloats(o,o));return n.Distance(e,s)},n}(),m=function(){function n(e,t,i){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),this._isDirty=!0,this._x=e,this._y=t,this._z=i}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"z",{get:function(){return this._z},set:function(e){this._z=e,this._isDirty=!0},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+"}"},n.prototype.getClassName=function(){return"Vector3"},n.prototype.getHashCode=function(){var e=this._x|0;return e=e*397^(this._y|0),e=e*397^(this._z|0),e},n.prototype.asArray=function(){var e=[];return this.toArray(e,0),e},n.prototype.toArray=function(e,t){return t===void 0&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this},n.prototype.fromArray=function(e,t){return t===void 0&&(t=0),n.FromArrayToRef(e,t,this),this},n.prototype.toQuaternion=function(){return W.RotationYawPitchRoll(this._y,this._x,this._z)},n.prototype.addInPlace=function(e){return this.addInPlaceFromFloats(e._x,e._y,e._z)},n.prototype.addInPlaceFromFloats=function(e,t,i){return this.x+=e,this.y+=t,this.z+=i,this},n.prototype.add=function(e){return new n(this._x+e._x,this._y+e._y,this._z+e._z)},n.prototype.addToRef=function(e,t){return t.copyFromFloats(this._x+e._x,this._y+e._y,this._z+e._z)},n.prototype.subtractInPlace=function(e){return this.x-=e._x,this.y-=e._y,this.z-=e._z,this},n.prototype.subtract=function(e){return new n(this._x-e._x,this._y-e._y,this._z-e._z)},n.prototype.subtractToRef=function(e,t){return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)},n.prototype.subtractFromFloats=function(e,t,i){return new n(this._x-e,this._y-t,this._z-i)},n.prototype.subtractFromFloatsToRef=function(e,t,i,r){return r.copyFromFloats(this._x-e,this._y-t,this._z-i)},n.prototype.negate=function(){return new n(-this._x,-this._y,-this._z)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},n.prototype.negateToRef=function(e){return e.copyFromFloats(this._x*-1,this._y*-1,this._z*-1)},n.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this},n.prototype.scale=function(e){return new n(this._x*e,this._y*e,this._z*e)},n.prototype.scaleToRef=function(e,t){return t.copyFromFloats(this._x*e,this._y*e,this._z*e)},n.prototype.scaleAndAddToRef=function(e,t){return t.addInPlaceFromFloats(this._x*e,this._y*e,this._z*e)},n.prototype.projectOnPlane=function(e,t){var i=n.Zero();return this.projectOnPlaneToRef(e,t,i),i},n.prototype.projectOnPlaneToRef=function(e,t,i){var r=e.normal,a=e.d,o=$.Vector3[0];this.subtractToRef(t,o),o.normalize();var s=n.Dot(o,r),l=-(n.Dot(t,r)+a)/s,f=o.scaleInPlace(l);t.addToRef(f,i)},n.prototype.equals=function(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z},n.prototype.equalsWithEpsilon=function(e,t){return t===void 0&&(t=Ce),e&&K.WithinEpsilon(this._x,e._x,t)&&K.WithinEpsilon(this._y,e._y,t)&&K.WithinEpsilon(this._z,e._z,t)},n.prototype.equalsToFloats=function(e,t,i){return this._x===e&&this._y===t&&this._z===i},n.prototype.multiplyInPlace=function(e){return this.x*=e._x,this.y*=e._y,this.z*=e._z,this},n.prototype.multiply=function(e){return this.multiplyByFloats(e._x,e._y,e._z)},n.prototype.multiplyToRef=function(e,t){return t.copyFromFloats(this._x*e._x,this._y*e._y,this._z*e._z)},n.prototype.multiplyByFloats=function(e,t,i){return new n(this._x*e,this._y*t,this._z*i)},n.prototype.divide=function(e){return new n(this._x/e._x,this._y/e._y,this._z/e._z)},n.prototype.divideToRef=function(e,t){return t.copyFromFloats(this._x/e._x,this._y/e._y,this._z/e._z)},n.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},n.prototype.minimizeInPlace=function(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)},n.prototype.maximizeInPlace=function(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)},n.prototype.minimizeInPlaceFromFloats=function(e,t,i){return e<this._x&&(this.x=e),t<this._y&&(this.y=t),i<this._z&&(this.z=i),this},n.prototype.maximizeInPlaceFromFloats=function(e,t,i){return e>this._x&&(this.x=e),t>this._y&&(this.y=t),i>this._z&&(this.z=i),this},n.prototype.isNonUniformWithinEpsilon=function(e){var t=Math.abs(this._x),i=Math.abs(this._y);if(!K.WithinEpsilon(t,i,e))return!0;var r=Math.abs(this._z);return!K.WithinEpsilon(t,r,e)||!K.WithinEpsilon(i,r,e)},Object.defineProperty(n.prototype,"isNonUniform",{get:function(){var e=Math.abs(this._x),t=Math.abs(this._y);if(e!==t)return!0;var i=Math.abs(this._z);return e!==i},enumerable:!1,configurable:!0}),n.prototype.floor=function(){return new n(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))},n.prototype.fract=function(){return new n(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))},n.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)},n.prototype.lengthSquared=function(){return this._x*this._x+this._y*this._y+this._z*this._z},n.prototype.normalize=function(){return this.normalizeFromLength(this.length())},n.prototype.reorderInPlace=function(e){var t=this;return e=e.toLowerCase(),e==="xyz"?this:($.Vector3[0].copyFrom(this),["x","y","z"].forEach(function(i,r){t[i]=$.Vector3[0][e[r]]}),this)},n.prototype.rotateByQuaternionToRef=function(e,t){return e.toRotationMatrix($.Matrix[0]),n.TransformCoordinatesToRef(this,$.Matrix[0],t),t},n.prototype.rotateByQuaternionAroundPointToRef=function(e,t,i){return this.subtractToRef(t,$.Vector3[0]),$.Vector3[0].rotateByQuaternionToRef(e,$.Vector3[0]),t.addToRef($.Vector3[0],i),i},n.prototype.cross=function(e){return n.Cross(this,e)},n.prototype.normalizeFromLength=function(e){return e===0||e===1?this:this.scaleInPlace(1/e)},n.prototype.normalizeToNew=function(){var e=new n(0,0,0);return this.normalizeToRef(e),e},n.prototype.normalizeToRef=function(e){var t=this.length();return t===0||t===1?e.copyFromFloats(this._x,this._y,this._z):this.scaleToRef(1/t,e)},n.prototype.clone=function(){return new n(this._x,this._y,this._z)},n.prototype.copyFrom=function(e){return this.copyFromFloats(e._x,e._y,e._z)},n.prototype.copyFromFloats=function(e,t,i){return this.x=e,this.y=t,this.z=i,this},n.prototype.set=function(e,t,i){return this.copyFromFloats(e,t,i)},n.prototype.setAll=function(e){return this.x=this.y=this.z=e,this},n.GetClipFactor=function(e,t,i,r){var a=n.Dot(e,i)-r,o=n.Dot(t,i)-r,s=a/(a-o);return s},n.GetAngleBetweenVectors=function(e,t,i){var r=e.normalizeToRef($.Vector3[1]),a=t.normalizeToRef($.Vector3[2]),o=n.Dot(r,a),s=$.Vector3[3];return n.CrossToRef(r,a,s),n.Dot(s,i)>0?Math.acos(o):-Math.acos(o)},n.FromArray=function(e,t){return t===void 0&&(t=0),new n(e[t],e[t+1],e[t+2])},n.FromFloatArray=function(e,t){return n.FromArray(e,t)},n.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1],i.z=e[t+2]},n.FromFloatArrayToRef=function(e,t,i){return n.FromArrayToRef(e,t,i)},n.FromFloatsToRef=function(e,t,i,r){r.copyFromFloats(e,t,i)},n.Zero=function(){return new n(0,0,0)},n.One=function(){return new n(1,1,1)},n.Up=function(){return new n(0,1,0)},Object.defineProperty(n,"UpReadOnly",{get:function(){return n._UpReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(n,"ZeroReadOnly",{get:function(){return n._ZeroReadOnly},enumerable:!1,configurable:!0}),n.Down=function(){return new n(0,-1,0)},n.Forward=function(e){return e===void 0&&(e=!1),new n(0,0,e?-1:1)},n.Backward=function(e){return e===void 0&&(e=!1),new n(0,0,e?1:-1)},n.Right=function(){return new n(1,0,0)},n.Left=function(){return new n(-1,0,0)},n.TransformCoordinates=function(e,t){var i=n.Zero();return n.TransformCoordinatesToRef(e,t,i),i},n.TransformCoordinatesToRef=function(e,t,i){n.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i)},n.TransformCoordinatesFromFloatsToRef=function(e,t,i,r,a){var o=r.m,s=e*o[0]+t*o[4]+i*o[8]+o[12],l=e*o[1]+t*o[5]+i*o[9]+o[13],f=e*o[2]+t*o[6]+i*o[10]+o[14],u=1/(e*o[3]+t*o[7]+i*o[11]+o[15]);a.x=s*u,a.y=l*u,a.z=f*u},n.TransformNormal=function(e,t){var i=n.Zero();return n.TransformNormalToRef(e,t,i),i},n.TransformNormalToRef=function(e,t,i){this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,i)},n.TransformNormalFromFloatsToRef=function(e,t,i,r,a){var o=r.m;a.x=e*o[0]+t*o[4]+i*o[8],a.y=e*o[1]+t*o[5]+i*o[9],a.z=e*o[2]+t*o[6]+i*o[10]},n.CatmullRom=function(e,t,i,r,a){var o=a*a,s=a*o,l=.5*(2*t._x+(-e._x+i._x)*a+(2*e._x-5*t._x+4*i._x-r._x)*o+(-e._x+3*t._x-3*i._x+r._x)*s),f=.5*(2*t._y+(-e._y+i._y)*a+(2*e._y-5*t._y+4*i._y-r._y)*o+(-e._y+3*t._y-3*i._y+r._y)*s),u=.5*(2*t._z+(-e._z+i._z)*a+(2*e._z-5*t._z+4*i._z-r._z)*o+(-e._z+3*t._z-3*i._z+r._z)*s);return new n(l,f,u)},n.Clamp=function(e,t,i){var r=new n;return n.ClampToRef(e,t,i,r),r},n.ClampToRef=function(e,t,i,r){var a=e._x;a=a>i._x?i._x:a,a=a<t._x?t._x:a;var o=e._y;o=o>i._y?i._y:o,o=o<t._y?t._y:o;var s=e._z;s=s>i._z?i._z:s,s=s<t._z?t._z:s,r.copyFromFloats(a,o,s)},n.CheckExtends=function(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)},n.Hermite=function(e,t,i,r,a){var o=a*a,s=a*o,l=2*s-3*o+1,f=-2*s+3*o,u=s-2*o+a,c=s-o,h=e._x*l+i._x*f+t._x*u+r._x*c,p=e._y*l+i._y*f+t._y*u+r._y*c,d=e._z*l+i._z*f+t._z*u+r._z*c;return new n(h,p,d)},n.Lerp=function(e,t,i){var r=new n(0,0,0);return n.LerpToRef(e,t,i,r),r},n.LerpToRef=function(e,t,i,r){r.x=e._x+(t._x-e._x)*i,r.y=e._y+(t._y-e._y)*i,r.z=e._z+(t._z-e._z)*i},n.Dot=function(e,t){return e._x*t._x+e._y*t._y+e._z*t._z},n.Cross=function(e,t){var i=n.Zero();return n.CrossToRef(e,t,i),i},n.CrossToRef=function(e,t,i){var r=e._y*t._z-e._z*t._y,a=e._z*t._x-e._x*t._z,o=e._x*t._y-e._y*t._x;i.copyFromFloats(r,a,o)},n.Normalize=function(e){var t=n.Zero();return n.NormalizeToRef(e,t),t},n.NormalizeToRef=function(e,t){e.normalizeToRef(t)},n.Project=function(e,t,i,r){var a=new n;return n.ProjectToRef(e,t,i,r,a),a},n.ProjectToRef=function(e,t,i,r,a){var o=r.width,s=r.height,l=r.x,f=r.y,u=$.Matrix[1];P.FromValuesToRef(o/2,0,0,0,0,-s/2,0,0,0,0,.5,0,l+o/2,s/2+f,.5,1,u);var c=$.Matrix[0];return t.multiplyToRef(i,c),c.multiplyToRef(u,c),n.TransformCoordinatesToRef(e,c,a),a},n._UnprojectFromInvertedMatrixToRef=function(e,t,i){n.TransformCoordinatesToRef(e,t,i);var r=t.m,a=e._x*r[3]+e._y*r[7]+e._z*r[11]+r[15];K.WithinEpsilon(a,1)&&i.scaleInPlace(1/a)},n.UnprojectFromTransform=function(e,t,i,r,a){var o=$.Matrix[0];r.multiplyToRef(a,o),o.invert(),e.x=e._x/t*2-1,e.y=-(e._y/i*2-1);var s=new n;return n._UnprojectFromInvertedMatrixToRef(e,o,s),s},n.Unproject=function(e,t,i,r,a,o){var s=n.Zero();return n.UnprojectToRef(e,t,i,r,a,o,s),s},n.UnprojectToRef=function(e,t,i,r,a,o,s){n.UnprojectFloatsToRef(e._x,e._y,e._z,t,i,r,a,o,s)},n.UnprojectFloatsToRef=function(e,t,i,r,a,o,s,l,f){var u=$.Matrix[0];o.multiplyToRef(s,u),u.multiplyToRef(l,u),u.invert();var c=$.Vector3[0];c.x=e/r*2-1,c.y=-(t/a*2-1),c.z=2*i-1,n._UnprojectFromInvertedMatrixToRef(c,u,f)},n.Minimize=function(e,t){var i=e.clone();return i.minimizeInPlace(t),i},n.Maximize=function(e,t){var i=e.clone();return i.maximizeInPlace(t),i},n.Distance=function(e,t){return Math.sqrt(n.DistanceSquared(e,t))},n.DistanceSquared=function(e,t){var i=e._x-t._x,r=e._y-t._y,a=e._z-t._z;return i*i+r*r+a*a},n.Center=function(e,t){var i=e.add(t);return i.scaleInPlace(.5),i},n.RotationFromAxis=function(e,t,i){var r=n.Zero();return n.RotationFromAxisToRef(e,t,i,r),r},n.RotationFromAxisToRef=function(e,t,i,r){var a=$.Quaternion[0];W.RotationQuaternionFromAxisToRef(e,t,i,a),a.toEulerAnglesToRef(r)},n._UpReadOnly=n.Up(),n._ZeroReadOnly=n.Zero(),n}(),Ve=function(){function n(e,t,i,r){this.x=e,this.y=t,this.z=i,this.w=r}return n.prototype.toString=function(){return"{X: "+this.x+" Y:"+this.y+" Z:"+this.z+" W:"+this.w+"}"},n.prototype.getClassName=function(){return"Vector4"},n.prototype.getHashCode=function(){var e=this.x|0;return e=e*397^(this.y|0),e=e*397^(this.z|0),e=e*397^(this.w|0),e},n.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},n.prototype.toArray=function(e,t){return t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,this},n.prototype.fromArray=function(e,t){return t===void 0&&(t=0),n.FromArrayToRef(e,t,this),this},n.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},n.prototype.add=function(e){return new n(this.x+e.x,this.y+e.y,this.z+e.z,this.w+e.w)},n.prototype.addToRef=function(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,t.z=this.z+e.z,t.w=this.w+e.w,this},n.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},n.prototype.subtract=function(e){return new n(this.x-e.x,this.y-e.y,this.z-e.z,this.w-e.w)},n.prototype.subtractToRef=function(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,t.z=this.z-e.z,t.w=this.w-e.w,this},n.prototype.subtractFromFloats=function(e,t,i,r){return new n(this.x-e,this.y-t,this.z-i,this.w-r)},n.prototype.subtractFromFloatsToRef=function(e,t,i,r,a){return a.x=this.x-e,a.y=this.y-t,a.z=this.z-i,a.w=this.w-r,this},n.prototype.negate=function(){return new n(-this.x,-this.y,-this.z,-this.w)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this},n.prototype.negateToRef=function(e){return e.copyFromFloats(this.x*-1,this.y*-1,this.z*-1,this.w*-1)},n.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},n.prototype.scale=function(e){return new n(this.x*e,this.y*e,this.z*e,this.w*e)},n.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,t.z=this.z*e,t.w=this.w*e,this},n.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,t.z+=this.z*e,t.w+=this.w*e,this},n.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},n.prototype.equalsWithEpsilon=function(e,t){return t===void 0&&(t=Ce),e&&K.WithinEpsilon(this.x,e.x,t)&&K.WithinEpsilon(this.y,e.y,t)&&K.WithinEpsilon(this.z,e.z,t)&&K.WithinEpsilon(this.w,e.w,t)},n.prototype.equalsToFloats=function(e,t,i,r){return this.x===e&&this.y===t&&this.z===i&&this.w===r},n.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},n.prototype.multiply=function(e){return new n(this.x*e.x,this.y*e.y,this.z*e.z,this.w*e.w)},n.prototype.multiplyToRef=function(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,t.z=this.z*e.z,t.w=this.w*e.w,this},n.prototype.multiplyByFloats=function(e,t,i,r){return new n(this.x*e,this.y*t,this.z*i,this.w*r)},n.prototype.divide=function(e){return new n(this.x/e.x,this.y/e.y,this.z/e.z,this.w/e.w)},n.prototype.divideToRef=function(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,t.z=this.z/e.z,t.w=this.w/e.w,this},n.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},n.prototype.minimizeInPlace=function(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},n.prototype.maximizeInPlace=function(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},n.prototype.floor=function(){return new n(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))},n.prototype.fract=function(){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))},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},n.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},n.prototype.normalize=function(){var e=this.length();return e===0?this:this.scaleInPlace(1/e)},n.prototype.toVector3=function(){return new m(this.x,this.y,this.z)},n.prototype.clone=function(){return new n(this.x,this.y,this.z,this.w)},n.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},n.prototype.copyFromFloats=function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},n.prototype.set=function(e,t,i,r){return this.copyFromFloats(e,t,i,r)},n.prototype.setAll=function(e){return this.x=this.y=this.z=this.w=e,this},n.FromArray=function(e,t){return t||(t=0),new n(e[t],e[t+1],e[t+2],e[t+3])},n.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3]},n.FromFloatArrayToRef=function(e,t,i){n.FromArrayToRef(e,t,i)},n.FromFloatsToRef=function(e,t,i,r,a){a.x=e,a.y=t,a.z=i,a.w=r},n.Zero=function(){return new n(0,0,0,0)},n.One=function(){return new n(1,1,1,1)},n.Normalize=function(e){var t=n.Zero();return n.NormalizeToRef(e,t),t},n.NormalizeToRef=function(e,t){t.copyFrom(e),t.normalize()},n.Minimize=function(e,t){var i=e.clone();return i.minimizeInPlace(t),i},n.Maximize=function(e,t){var i=e.clone();return i.maximizeInPlace(t),i},n.Distance=function(e,t){return Math.sqrt(n.DistanceSquared(e,t))},n.DistanceSquared=function(e,t){var i=e.x-t.x,r=e.y-t.y,a=e.z-t.z,o=e.w-t.w;return i*i+r*r+a*a+o*o},n.Center=function(e,t){var i=e.add(t);return i.scaleInPlace(.5),i},n.TransformNormal=function(e,t){var i=n.Zero();return n.TransformNormalToRef(e,t,i),i},n.TransformNormalToRef=function(e,t,i){var r=t.m,a=e.x*r[0]+e.y*r[4]+e.z*r[8],o=e.x*r[1]+e.y*r[5]+e.z*r[9],s=e.x*r[2]+e.y*r[6]+e.z*r[10];i.x=a,i.y=o,i.z=s,i.w=e.w},n.TransformNormalFromFloatsToRef=function(e,t,i,r,a,o){var s=a.m;o.x=e*s[0]+t*s[4]+i*s[8],o.y=e*s[1]+t*s[5]+i*s[9],o.z=e*s[2]+t*s[6]+i*s[10],o.w=r},n.FromVector3=function(e,t){return t===void 0&&(t=0),new n(e._x,e._y,e._z,t)},n}(),W=function(){function n(e,t,i,r){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),r===void 0&&(r=1),this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=r}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"z",{get:function(){return this._z},set:function(e){this._z=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"w",{get:function(){return this._w},set:function(e){this._w=e,this._isDirty=!0},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+" W:"+this._w+"}"},n.prototype.getClassName=function(){return"Quaternion"},n.prototype.getHashCode=function(){var e=this._x|0;return e=e*397^(this._y|0),e=e*397^(this._z|0),e=e*397^(this._w|0),e},n.prototype.asArray=function(){return[this._x,this._y,this._z,this._w]},n.prototype.equals=function(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w},n.prototype.equalsWithEpsilon=function(e,t){return t===void 0&&(t=Ce),e&&K.WithinEpsilon(this._x,e._x,t)&&K.WithinEpsilon(this._y,e._y,t)&&K.WithinEpsilon(this._z,e._z,t)&&K.WithinEpsilon(this._w,e._w,t)},n.prototype.clone=function(){return new n(this._x,this._y,this._z,this._w)},n.prototype.copyFrom=function(e){return this.x=e._x,this.y=e._y,this.z=e._z,this.w=e._w,this},n.prototype.copyFromFloats=function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},n.prototype.set=function(e,t,i,r){return this.copyFromFloats(e,t,i,r)},n.prototype.add=function(e){return new n(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)},n.prototype.addInPlace=function(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this},n.prototype.subtract=function(e){return new n(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)},n.prototype.scale=function(e){return new n(this._x*e,this._y*e,this._z*e,this._w*e)},n.prototype.scaleToRef=function(e,t){return t.x=this._x*e,t.y=this._y*e,t.z=this._z*e,t.w=this._w*e,this},n.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},n.prototype.scaleAndAddToRef=function(e,t){return t.x+=this._x*e,t.y+=this._y*e,t.z+=this._z*e,t.w+=this._w*e,this},n.prototype.multiply=function(e){var t=new n(0,0,0,1);return this.multiplyToRef(e,t),t},n.prototype.multiplyToRef=function(e,t){var i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,r=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,a=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,o=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(i,r,a,o),this},n.prototype.multiplyInPlace=function(e){return this.multiplyToRef(e,this),this},n.prototype.conjugateToRef=function(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),this},n.prototype.conjugateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},n.prototype.conjugate=function(){var e=new n(-this._x,-this._y,-this._z,this._w);return e},n.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},n.prototype.normalize=function(){var e=this.length();if(e===0)return this;var t=1/e;return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},n.prototype.toEulerAngles=function(e){var t=m.Zero();return this.toEulerAnglesToRef(t),t},n.prototype.toEulerAnglesToRef=function(e){var t=this._z,i=this._x,r=this._y,a=this._w,o=a*a,s=t*t,l=i*i,f=r*r,u=r*t-i*a,c=.4999999;return u<-c?(e.y=2*Math.atan2(r,a),e.x=Math.PI/2,e.z=0):u>c?(e.y=2*Math.atan2(r,a),e.x=-Math.PI/2,e.z=0):(e.z=Math.atan2(2*(i*r+t*a),-s-l+f+o),e.x=Math.asin(-2*(t*r-i*a)),e.y=Math.atan2(2*(t*i+r*a),s-l-f+o)),this},n.prototype.toRotationMatrix=function(e){return P.FromQuaternionToRef(this,e),this},n.prototype.fromRotationMatrix=function(e){return n.FromRotationMatrixToRef(e,this),this},n.FromRotationMatrix=function(e){var t=new n;return n.FromRotationMatrixToRef(e,t),t},n.FromRotationMatrixToRef=function(e,t){var i=e.m,r=i[0],a=i[4],o=i[8],s=i[1],l=i[5],f=i[9],u=i[2],c=i[6],h=i[10],p=r+l+h,d;p>0?(d=.5/Math.sqrt(p+1),t.w=.25/d,t.x=(c-f)*d,t.y=(o-u)*d,t.z=(s-a)*d):r>l&&r>h?(d=2*Math.sqrt(1+r-l-h),t.w=(c-f)/d,t.x=.25*d,t.y=(a+s)/d,t.z=(o+u)/d):l>h?(d=2*Math.sqrt(1+l-r-h),t.w=(o-u)/d,t.x=(a+s)/d,t.y=.25*d,t.z=(f+c)/d):(d=2*Math.sqrt(1+h-r-l),t.w=(s-a)/d,t.x=(o+u)/d,t.y=(f+c)/d,t.z=.25*d)},n.Dot=function(e,t){return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w},n.AreClose=function(e,t){var i=n.Dot(e,t);return i>=0},n.Zero=function(){return new n(0,0,0,0)},n.Inverse=function(e){return new n(-e._x,-e._y,-e._z,e._w)},n.InverseToRef=function(e,t){return t.set(-e._x,-e._y,-e._z,e._w),t},n.Identity=function(){return new n(0,0,0,1)},n.IsIdentity=function(e){return e&&e._x===0&&e._y===0&&e._z===0&&e._w===1},n.RotationAxis=function(e,t){return n.RotationAxisToRef(e,t,new n)},n.RotationAxisToRef=function(e,t,i){var r=Math.sin(t/2);return e.normalize(),i.w=Math.cos(t/2),i.x=e._x*r,i.y=e._y*r,i.z=e._z*r,i},n.FromArray=function(e,t){return t||(t=0),new n(e[t],e[t+1],e[t+2],e[t+3])},n.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3]},n.FromEulerAngles=function(e,t,i){var r=new n;return n.RotationYawPitchRollToRef(t,e,i,r),r},n.FromEulerAnglesToRef=function(e,t,i,r){return n.RotationYawPitchRollToRef(t,e,i,r),r},n.FromEulerVector=function(e){var t=new n;return n.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t},n.FromEulerVectorToRef=function(e,t){return n.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t},n.RotationYawPitchRoll=function(e,t,i){var r=new n;return n.RotationYawPitchRollToRef(e,t,i,r),r},n.RotationYawPitchRollToRef=function(e,t,i,r){var a=i*.5,o=t*.5,s=e*.5,l=Math.sin(a),f=Math.cos(a),u=Math.sin(o),c=Math.cos(o),h=Math.sin(s),p=Math.cos(s);r.x=p*u*f+h*c*l,r.y=h*c*f-p*u*l,r.z=p*c*l-h*u*f,r.w=p*c*f+h*u*l},n.RotationAlphaBetaGamma=function(e,t,i){var r=new n;return n.RotationAlphaBetaGammaToRef(e,t,i,r),r},n.RotationAlphaBetaGammaToRef=function(e,t,i,r){var a=(i+e)*.5,o=(i-e)*.5,s=t*.5;r.x=Math.cos(o)*Math.sin(s),r.y=Math.sin(o)*Math.sin(s),r.z=Math.sin(a)*Math.cos(s),r.w=Math.cos(a)*Math.cos(s)},n.RotationQuaternionFromAxis=function(e,t,i){var r=new n(0,0,0,0);return n.RotationQuaternionFromAxisToRef(e,t,i,r),r},n.RotationQuaternionFromAxisToRef=function(e,t,i,r){var a=$.Matrix[0];P.FromXYZAxesToRef(e.normalize(),t.normalize(),i.normalize(),a),n.FromRotationMatrixToRef(a,r)},n.Slerp=function(e,t,i){var r=n.Identity();return n.SlerpToRef(e,t,i,r),r},n.SlerpToRef=function(e,t,i,r){var a,o,s=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,l=!1;if(s<0&&(l=!0,s=-s),s>.999999)o=1-i,a=l?-i:i;else{var f=Math.acos(s),u=1/Math.sin(f);o=Math.sin((1-i)*f)*u,a=l?-Math.sin(i*f)*u:Math.sin(i*f)*u}r.x=o*e._x+a*t._x,r.y=o*e._y+a*t._y,r.z=o*e._z+a*t._z,r.w=o*e._w+a*t._w},n.Hermite=function(e,t,i,r,a){var o=a*a,s=a*o,l=2*s-3*o+1,f=-2*s+3*o,u=s-2*o+a,c=s-o,h=e._x*l+i._x*f+t._x*u+r._x*c,p=e._y*l+i._y*f+t._y*u+r._y*c,d=e._z*l+i._z*f+t._z*u+r._z*c,_=e._w*l+i._w*f+t._w*u+r._w*c;return new n(h,p,d,_)},n}(),P=function(){function n(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,ut.MatrixTrackPrecisionChange&&ut.MatrixTrackedMatrices.push(this),this._m=new ut.MatrixCurrentType(16),this._updateIdentityStatus(!1)}return Object.defineProperty(n,"Use64Bits",{get:function(){return ut.MatrixUse64Bits},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"m",{get:function(){return this._m},enumerable:!1,configurable:!0}),n.prototype._markAsUpdated=function(){this.updateFlag=n._updateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0},n.prototype._updateIdentityStatus=function(e,t,i,r){t===void 0&&(t=!1),i===void 0&&(i=!1),r===void 0&&(r=!0),this.updateFlag=n._updateFlagSeed++,this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=this._isIdentity?!1:t,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:r},n.prototype.isIdentity=function(){if(this._isIdentityDirty){this._isIdentityDirty=!1;var 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},n.prototype.isIdentityAs3x2=function(){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},n.prototype.determinant=function(){if(this._isIdentity===!0)return 1;var e=this._m,t=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],f=e[7],u=e[8],c=e[9],h=e[10],p=e[11],d=e[12],_=e[13],v=e[14],E=e[15],y=h*E-v*p,R=c*E-_*p,S=c*v-_*h,M=u*E-d*p,C=u*v-h*d,b=u*_-d*c,N=+(s*y-l*R+f*S),V=-(o*y-l*M+f*C),G=+(o*R-s*M+f*b),X=-(o*S-s*C+l*b);return t*N+i*V+r*G+a*X},n.prototype.toArray=function(){return this._m},n.prototype.asArray=function(){return this._m},n.prototype.invert=function(){return this.invertToRef(this),this},n.prototype.reset=function(){return n.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this},n.prototype.add=function(e){var t=new n;return this.addToRef(e,t),t},n.prototype.addToRef=function(e,t){for(var i=this._m,r=t._m,a=e.m,o=0;o<16;o++)r[o]=i[o]+a[o];return t._markAsUpdated(),this},n.prototype.addToSelf=function(e){for(var t=this._m,i=e.m,r=0;r<16;r++)t[r]+=i[r];return this._markAsUpdated(),this},n.prototype.invertToRef=function(e){if(this._isIdentity===!0)return n.IdentityToRef(e),this;var t=this._m,i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],f=t[6],u=t[7],c=t[8],h=t[9],p=t[10],d=t[11],_=t[12],v=t[13],E=t[14],y=t[15],R=p*y-E*d,S=h*y-v*d,M=h*E-v*p,C=c*y-_*d,b=c*E-p*_,N=c*v-_*h,V=+(l*R-f*S+u*M),G=-(s*R-f*C+u*b),X=+(s*S-l*C+u*N),z=-(s*M-l*b+f*N),Y=i*V+r*G+a*X+o*z;if(Y===0)return e.copyFrom(this),this;var k=1/Y,Z=f*y-E*u,re=l*y-v*u,ue=l*E-v*f,Re=s*y-_*u,se=s*E-_*f,me=s*v-_*l,pe=f*d-p*u,xe=l*d-h*u,Le=l*p-h*f,nt=s*d-c*u,qe=s*p-c*f,Tt=s*h-c*l,Ft=-(r*R-a*S+o*M),Nt=+(i*R-a*C+o*b),wt=-(i*S-r*C+o*N),Ut=+(i*M-r*b+a*N),Bt=+(r*Z-a*re+o*ue),Vt=-(i*Z-a*Re+o*se),ke=+(i*re-r*Re+o*me),He=-(i*ue-r*se+a*me),Xe=-(r*pe-a*xe+o*Le),We=+(i*pe-a*nt+o*qe),At=-(i*xe-r*nt+o*Tt),$t=+(i*Le-r*qe+a*Tt);return n.FromValuesToRef(V*k,Ft*k,Bt*k,Xe*k,G*k,Nt*k,Vt*k,We*k,X*k,wt*k,ke*k,At*k,z*k,Ut*k,He*k,$t*k,e),this},n.prototype.addAtIndex=function(e,t){return this._m[e]+=t,this._markAsUpdated(),this},n.prototype.multiplyAtIndex=function(e,t){return this._m[e]*=t,this._markAsUpdated(),this},n.prototype.setTranslationFromFloats=function(e,t,i){return this._m[12]=e,this._m[13]=t,this._m[14]=i,this._markAsUpdated(),this},n.prototype.addTranslationFromFloats=function(e,t,i){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=i,this._markAsUpdated(),this},n.prototype.setTranslation=function(e){return this.setTranslationFromFloats(e._x,e._y,e._z)},n.prototype.getTranslation=function(){return new m(this._m[12],this._m[13],this._m[14])},n.prototype.getTranslationToRef=function(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],this},n.prototype.removeRotationAndScaling=function(){var 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},n.prototype.multiply=function(e){var t=new n;return this.multiplyToRef(e,t),t},n.prototype.copyFrom=function(e){e.copyToArray(this._m);var t=e;return this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this},n.prototype.copyToArray=function(e,t){t===void 0&&(t=0);var i=this._m;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],this},n.prototype.multiplyToRef=function(e,t){return this._isIdentity?(t.copyFrom(e),this):e._isIdentity?(t.copyFrom(this),this):(this.multiplyToArray(e,t._m,0),t._markAsUpdated(),this)},n.prototype.multiplyToArray=function(e,t,i){var r=this._m,a=e.m,o=r[0],s=r[1],l=r[2],f=r[3],u=r[4],c=r[5],h=r[6],p=r[7],d=r[8],_=r[9],v=r[10],E=r[11],y=r[12],R=r[13],S=r[14],M=r[15],C=a[0],b=a[1],N=a[2],V=a[3],G=a[4],X=a[5],z=a[6],Y=a[7],k=a[8],Z=a[9],re=a[10],ue=a[11],Re=a[12],se=a[13],me=a[14],pe=a[15];return t[i]=o*C+s*G+l*k+f*Re,t[i+1]=o*b+s*X+l*Z+f*se,t[i+2]=o*N+s*z+l*re+f*me,t[i+3]=o*V+s*Y+l*ue+f*pe,t[i+4]=u*C+c*G+h*k+p*Re,t[i+5]=u*b+c*X+h*Z+p*se,t[i+6]=u*N+c*z+h*re+p*me,t[i+7]=u*V+c*Y+h*ue+p*pe,t[i+8]=d*C+_*G+v*k+E*Re,t[i+9]=d*b+_*X+v*Z+E*se,t[i+10]=d*N+_*z+v*re+E*me,t[i+11]=d*V+_*Y+v*ue+E*pe,t[i+12]=y*C+R*G+S*k+M*Re,t[i+13]=y*b+R*X+S*Z+M*se,t[i+14]=y*N+R*z+S*re+M*me,t[i+15]=y*V+R*Y+S*ue+M*pe,this},n.prototype.equals=function(e){var t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;var i=this.m,r=t.m;return i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]&&i[3]===r[3]&&i[4]===r[4]&&i[5]===r[5]&&i[6]===r[6]&&i[7]===r[7]&&i[8]===r[8]&&i[9]===r[9]&&i[10]===r[10]&&i[11]===r[11]&&i[12]===r[12]&&i[13]===r[13]&&i[14]===r[14]&&i[15]===r[15]},n.prototype.clone=function(){var e=new n;return e.copyFrom(this),e},n.prototype.getClassName=function(){return"Matrix"},n.prototype.getHashCode=function(){for(var e=this._m[0]|0,t=1;t<16;t++)e=e*397^(this._m[t]|0);return e},n.prototype.decompose=function(e,t,i){if(this._isIdentity)return i&&i.setAll(0),e&&e.setAll(1),t&&t.copyFromFloats(0,0,0,1),!0;var r=this._m;if(i&&i.copyFromFloats(r[12],r[13],r[14]),e=e||$.Vector3[0],e.x=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]),e.y=Math.sqrt(r[4]*r[4]+r[5]*r[5]+r[6]*r[6]),e.z=Math.sqrt(r[8]*r[8]+r[9]*r[9]+r[10]*r[10]),this.determinant()<=0&&(e.y*=-1),e._x===0||e._y===0||e._z===0)return t&&t.copyFromFloats(0,0,0,1),!1;if(t){var a=1/e._x,o=1/e._y,s=1/e._z;n.FromValuesToRef(r[0]*a,r[1]*a,r[2]*a,0,r[4]*o,r[5]*o,r[6]*o,0,r[8]*s,r[9]*s,r[10]*s,0,0,0,0,1,$.Matrix[0]),W.FromRotationMatrixToRef($.Matrix[0],t)}return!0},n.prototype.getRow=function(e){if(e<0||e>3)return null;var t=e*4;return new Ve(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])},n.prototype.setRow=function(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)},n.prototype.transpose=function(){return n.Transpose(this)},n.prototype.transposeToRef=function(e){return n.TransposeToRef(this,e),this},n.prototype.setRowFromFloats=function(e,t,i,r,a){if(e<0||e>3)return this;var o=e*4;return this._m[o+0]=t,this._m[o+1]=i,this._m[o+2]=r,this._m[o+3]=a,this._markAsUpdated(),this},n.prototype.scale=function(e){var t=new n;return this.scaleToRef(e,t),t},n.prototype.scaleToRef=function(e,t){for(var i=0;i<16;i++)t._m[i]=this._m[i]*e;return t._markAsUpdated(),this},n.prototype.scaleAndAddToRef=function(e,t){for(var i=0;i<16;i++)t._m[i]+=this._m[i]*e;return t._markAsUpdated(),this},n.prototype.toNormalMatrix=function(e){var t=$.Matrix[0];this.invertToRef(t),t.transposeToRef(e);var i=e._m;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)},n.prototype.getRotationMatrix=function(){var e=new n;return this.getRotationMatrixToRef(e),e},n.prototype.getRotationMatrixToRef=function(e){var t=$.Vector3[0];if(!this.decompose(t))return n.IdentityToRef(e),this;var i=this._m,r=1/t._x,a=1/t._y,o=1/t._z;return n.FromValuesToRef(i[0]*r,i[1]*r,i[2]*r,0,i[4]*a,i[5]*a,i[6]*a,0,i[8]*o,i[9]*o,i[10]*o,0,0,0,0,1,e),this},n.prototype.toggleModelMatrixHandInPlace=function(){var e=this._m;e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this._markAsUpdated()},n.prototype.toggleProjectionMatrixHandInPlace=function(){var e=this._m;e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this._markAsUpdated()},n.FromArray=function(e,t){t===void 0&&(t=0);var i=new n;return n.FromArrayToRef(e,t,i),i},n.FromArrayToRef=function(e,t,i){for(var r=0;r<16;r++)i._m[r]=e[r+t];i._markAsUpdated()},n.FromFloat32ArrayToRefScaled=function(e,t,i,r){for(var a=0;a<16;a++)r._m[a]=e[a+t]*i;r._markAsUpdated()},Object.defineProperty(n,"IdentityReadOnly",{get:function(){return n._identityReadOnly},enumerable:!1,configurable:!0}),n.FromValuesToRef=function(e,t,i,r,a,o,s,l,f,u,c,h,p,d,_,v,E){var y=E._m;y[0]=e,y[1]=t,y[2]=i,y[3]=r,y[4]=a,y[5]=o,y[6]=s,y[7]=l,y[8]=f,y[9]=u,y[10]=c,y[11]=h,y[12]=p,y[13]=d,y[14]=_,y[15]=v,E._markAsUpdated()},n.FromValues=function(e,t,i,r,a,o,s,l,f,u,c,h,p,d,_,v){var E=new n,y=E._m;return y[0]=e,y[1]=t,y[2]=i,y[3]=r,y[4]=a,y[5]=o,y[6]=s,y[7]=l,y[8]=f,y[9]=u,y[10]=c,y[11]=h,y[12]=p,y[13]=d,y[14]=_,y[15]=v,E._markAsUpdated(),E},n.Compose=function(e,t,i){var r=new n;return n.ComposeToRef(e,t,i,r),r},n.ComposeToRef=function(e,t,i,r){var a=r._m,o=t._x,s=t._y,l=t._z,f=t._w,u=o+o,c=s+s,h=l+l,p=o*u,d=o*c,_=o*h,v=s*c,E=s*h,y=l*h,R=f*u,S=f*c,M=f*h,C=e._x,b=e._y,N=e._z;a[0]=(1-(v+y))*C,a[1]=(d+M)*C,a[2]=(_-S)*C,a[3]=0,a[4]=(d-M)*b,a[5]=(1-(p+y))*b,a[6]=(E+R)*b,a[7]=0,a[8]=(_+S)*N,a[9]=(E-R)*N,a[10]=(1-(p+v))*N,a[11]=0,a[12]=i._x,a[13]=i._y,a[14]=i._z,a[15]=1,r._markAsUpdated()},n.Identity=function(){var e=n.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return e._updateIdentityStatus(!0),e},n.IdentityToRef=function(e){n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(!0)},n.Zero=function(){var e=n.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return e._updateIdentityStatus(!1),e},n.RotationX=function(e){var t=new n;return n.RotationXToRef(e,t),t},n.Invert=function(e){var t=new n;return e.invertToRef(t),t},n.RotationXToRef=function(e,t){var i=Math.sin(e),r=Math.cos(e);n.FromValuesToRef(1,0,0,0,0,r,i,0,0,-i,r,0,0,0,0,1,t),t._updateIdentityStatus(r===1&&i===0)},n.RotationY=function(e){var t=new n;return n.RotationYToRef(e,t),t},n.RotationYToRef=function(e,t){var i=Math.sin(e),r=Math.cos(e);n.FromValuesToRef(r,0,-i,0,0,1,0,0,i,0,r,0,0,0,0,1,t),t._updateIdentityStatus(r===1&&i===0)},n.RotationZ=function(e){var t=new n;return n.RotationZToRef(e,t),t},n.RotationZToRef=function(e,t){var i=Math.sin(e),r=Math.cos(e);n.FromValuesToRef(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(r===1&&i===0)},n.RotationAxis=function(e,t){var i=new n;return n.RotationAxisToRef(e,t,i),i},n.RotationAxisToRef=function(e,t,i){var r=Math.sin(-t),a=Math.cos(-t),o=1-a;e.normalize();var s=i._m;s[0]=e._x*e._x*o+a,s[1]=e._x*e._y*o-e._z*r,s[2]=e._x*e._z*o+e._y*r,s[3]=0,s[4]=e._y*e._x*o+e._z*r,s[5]=e._y*e._y*o+a,s[6]=e._y*e._z*o-e._x*r,s[7]=0,s[8]=e._z*e._x*o-e._y*r,s[9]=e._z*e._y*o+e._x*r,s[10]=e._z*e._z*o+a,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,i._markAsUpdated()},n.RotationAlignToRef=function(e,t,i){var r=m.Cross(t,e),a=m.Dot(t,e),o=1/(1+a),s=i._m;s[0]=r._x*r._x*o+a,s[1]=r._y*r._x*o-r._z,s[2]=r._z*r._x*o+r._y,s[3]=0,s[4]=r._x*r._y*o+r._z,s[5]=r._y*r._y*o+a,s[6]=r._z*r._y*o-r._x,s[7]=0,s[8]=r._x*r._z*o-r._y,s[9]=r._y*r._z*o+r._x,s[10]=r._z*r._z*o+a,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,i._markAsUpdated()},n.RotationYawPitchRoll=function(e,t,i){var r=new n;return n.RotationYawPitchRollToRef(e,t,i,r),r},n.RotationYawPitchRollToRef=function(e,t,i,r){W.RotationYawPitchRollToRef(e,t,i,$.Quaternion[0]),$.Quaternion[0].toRotationMatrix(r)},n.Scaling=function(e,t,i){var r=new n;return n.ScalingToRef(e,t,i,r),r},n.ScalingToRef=function(e,t,i,r){n.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1,r),r._updateIdentityStatus(e===1&&t===1&&i===1)},n.Translation=function(e,t,i){var r=new n;return n.TranslationToRef(e,t,i,r),r},n.TranslationToRef=function(e,t,i,r){n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1,r),r._updateIdentityStatus(e===0&&t===0&&i===0)},n.Lerp=function(e,t,i){var r=new n;return n.LerpToRef(e,t,i,r),r},n.LerpToRef=function(e,t,i,r){for(var a=r._m,o=e.m,s=t.m,l=0;l<16;l++)a[l]=o[l]*(1-i)+s[l]*i;r._markAsUpdated()},n.DecomposeLerp=function(e,t,i){var r=new n;return n.DecomposeLerpToRef(e,t,i,r),r},n.DecomposeLerpToRef=function(e,t,i,r){var a=$.Vector3[0],o=$.Quaternion[0],s=$.Vector3[1];e.decompose(a,o,s);var l=$.Vector3[2],f=$.Quaternion[1],u=$.Vector3[3];t.decompose(l,f,u);var c=$.Vector3[4];m.LerpToRef(a,l,i,c);var h=$.Quaternion[2];W.SlerpToRef(o,f,i,h);var p=$.Vector3[5];m.LerpToRef(s,u,i,p),n.ComposeToRef(c,h,p,r)},n.LookAtLH=function(e,t,i){var r=new n;return n.LookAtLHToRef(e,t,i,r),r},n.LookAtLHToRef=function(e,t,i,r){var a=$.Vector3[0],o=$.Vector3[1],s=$.Vector3[2];t.subtractToRef(e,s),s.normalize(),m.CrossToRef(i,s,a);var l=a.lengthSquared();l===0?a.x=1:a.normalizeFromLength(Math.sqrt(l)),m.CrossToRef(s,a,o),o.normalize();var f=-m.Dot(a,e),u=-m.Dot(o,e),c=-m.Dot(s,e);n.FromValuesToRef(a._x,o._x,s._x,0,a._y,o._y,s._y,0,a._z,o._z,s._z,0,f,u,c,1,r)},n.LookAtRH=function(e,t,i){var r=new n;return n.LookAtRHToRef(e,t,i,r),r},n.LookAtRHToRef=function(e,t,i,r){var a=$.Vector3[0],o=$.Vector3[1],s=$.Vector3[2];e.subtractToRef(t,s),s.normalize(),m.CrossToRef(i,s,a);var l=a.lengthSquared();l===0?a.x=1:a.normalizeFromLength(Math.sqrt(l)),m.CrossToRef(s,a,o),o.normalize();var f=-m.Dot(a,e),u=-m.Dot(o,e),c=-m.Dot(s,e);n.FromValuesToRef(a._x,o._x,s._x,0,a._y,o._y,s._y,0,a._z,o._z,s._z,0,f,u,c,1,r)},n.OrthoLH=function(e,t,i,r){var a=new n;return n.OrthoLHToRef(e,t,i,r,a),a},n.OrthoLHToRef=function(e,t,i,r,a){var o=i,s=r,l=2/e,f=2/t,u=2/(s-o),c=-(s+o)/(s-o);n.FromValuesToRef(l,0,0,0,0,f,0,0,0,0,u,0,0,0,c,1,a),a._updateIdentityStatus(l===1&&f===1&&u===1&&c===0)},n.OrthoOffCenterLH=function(e,t,i,r,a,o){var s=new n;return n.OrthoOffCenterLHToRef(e,t,i,r,a,o,s),s},n.OrthoOffCenterLHToRef=function(e,t,i,r,a,o,s){var l=a,f=o,u=2/(t-e),c=2/(r-i),h=2/(f-l),p=-(f+l)/(f-l),d=(e+t)/(e-t),_=(r+i)/(i-r);n.FromValuesToRef(u,0,0,0,0,c,0,0,0,0,h,0,d,_,p,1,s),s._markAsUpdated()},n.OrthoOffCenterRH=function(e,t,i,r,a,o){var s=new n;return n.OrthoOffCenterRHToRef(e,t,i,r,a,o,s),s},n.OrthoOffCenterRHToRef=function(e,t,i,r,a,o,s){n.OrthoOffCenterLHToRef(e,t,i,r,a,o,s),s._m[10]*=-1},n.PerspectiveLH=function(e,t,i,r){var a=new n,o=i,s=r,l=2*o/e,f=2*o/t,u=(s+o)/(s-o),c=-2*s*o/(s-o);return n.FromValuesToRef(l,0,0,0,0,f,0,0,0,0,u,1,0,0,c,0,a),a._updateIdentityStatus(!1),a},n.PerspectiveFovLH=function(e,t,i,r){var a=new n;return n.PerspectiveFovLHToRef(e,t,i,r,a),a},n.PerspectiveFovLHToRef=function(e,t,i,r,a,o){o===void 0&&(o=!0);var s=i,l=r,f=1/Math.tan(e*.5),u=o?f/t:f,c=o?f:f*t,h=(l+s)/(l-s),p=-2*l*s/(l-s);n.FromValuesToRef(u,0,0,0,0,c,0,0,0,0,h,1,0,0,p,0,a),a._updateIdentityStatus(!1)},n.PerspectiveFovReverseLHToRef=function(e,t,i,r,a,o){o===void 0&&(o=!0);var s=1/Math.tan(e*.5),l=o?s/t:s,f=o?s:s*t;n.FromValuesToRef(l,0,0,0,0,f,0,0,0,0,-i,1,0,0,1,0,a),a._updateIdentityStatus(!1)},n.PerspectiveFovRH=function(e,t,i,r){var a=new n;return n.PerspectiveFovRHToRef(e,t,i,r,a),a},n.PerspectiveFovRHToRef=function(e,t,i,r,a,o){o===void 0&&(o=!0);var s=i,l=r,f=1/Math.tan(e*.5),u=o?f/t:f,c=o?f:f*t,h=-(l+s)/(l-s),p=-2*l*s/(l-s);n.FromValuesToRef(u,0,0,0,0,c,0,0,0,0,h,-1,0,0,p,0,a),a._updateIdentityStatus(!1)},n.PerspectiveFovReverseRHToRef=function(e,t,i,r,a,o){o===void 0&&(o=!0);var s=1/Math.tan(e*.5),l=o?s/t:s,f=o?s:s*t;n.FromValuesToRef(l,0,0,0,0,f,0,0,0,0,-i,-1,0,0,-1,0,a),a._updateIdentityStatus(!1)},n.PerspectiveFovWebVRToRef=function(e,t,i,r,a){a===void 0&&(a=!1);var o=a?-1:1,s=Math.tan(e.upDegrees*Math.PI/180),l=Math.tan(e.downDegrees*Math.PI/180),f=Math.tan(e.leftDegrees*Math.PI/180),u=Math.tan(e.rightDegrees*Math.PI/180),c=2/(f+u),h=2/(s+l),p=r._m;p[0]=c,p[1]=p[2]=p[3]=p[4]=0,p[5]=h,p[6]=p[7]=0,p[8]=(f-u)*c*.5,p[9]=-((s-l)*h*.5),p[10]=-i/(t-i),p[11]=1*o,p[12]=p[13]=p[15]=0,p[14]=-(2*i*t)/(i-t),r._markAsUpdated()},n.GetFinalMatrix=function(e,t,i,r,a,o){var s=e.width,l=e.height,f=e.x,u=e.y,c=n.FromValues(s/2,0,0,0,0,-l/2,0,0,0,0,o-a,0,f+s/2,l/2+u,a,1),h=$.Matrix[0];return t.multiplyToRef(i,h),h.multiplyToRef(r,h),h.multiply(c)},n.GetAsMatrix2x2=function(e){var t=e.m,i=[t[0],t[1],t[4],t[5]];return ut.MatrixUse64Bits?i:new Float32Array(i)},n.GetAsMatrix3x3=function(e){var t=e.m,i=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return ut.MatrixUse64Bits?i:new Float32Array(i)},n.Transpose=function(e){var t=new n;return n.TransposeToRef(e,t),t},n.TransposeToRef=function(e,t){var i=t._m,r=e.m;i[0]=r[0],i[1]=r[4],i[2]=r[8],i[3]=r[12],i[4]=r[1],i[5]=r[5],i[6]=r[9],i[7]=r[13],i[8]=r[2],i[9]=r[6],i[10]=r[10],i[11]=r[14],i[12]=r[3],i[13]=r[7],i[14]=r[11],i[15]=r[15],t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty)},n.Reflection=function(e){var t=new n;return n.ReflectionToRef(e,t),t},n.ReflectionToRef=function(e,t){e.normalize();var i=e.normal.x,r=e.normal.y,a=e.normal.z,o=-2*i,s=-2*r,l=-2*a;n.FromValuesToRef(o*i+1,s*i,l*i,0,o*r,s*r+1,l*r,0,o*a,s*a,l*a+1,0,o*e.d,s*e.d,l*e.d,1,t)},n.FromXYZAxesToRef=function(e,t,i,r){n.FromValuesToRef(e._x,e._y,e._z,0,t._x,t._y,t._z,0,i._x,i._y,i._z,0,0,0,0,1,r)},n.FromQuaternionToRef=function(e,t){var i=e._x*e._x,r=e._y*e._y,a=e._z*e._z,o=e._x*e._y,s=e._z*e._w,l=e._z*e._x,f=e._y*e._w,u=e._y*e._z,c=e._x*e._w;t._m[0]=1-2*(r+a),t._m[1]=2*(o+s),t._m[2]=2*(l-f),t._m[3]=0,t._m[4]=2*(o-s),t._m[5]=1-2*(a+i),t._m[6]=2*(u+c),t._m[7]=0,t._m[8]=2*(l+f),t._m[9]=2*(u-c),t._m[10]=1-2*(r+i),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t._markAsUpdated()},n._updateFlagSeed=0,n._identityReadOnly=n.Identity(),n}(),$=function(){function n(){}return n.Vector3=be.BuildArray(6,m.Zero),n.Matrix=be.BuildArray(2,P.Identity),n.Quaternion=be.BuildArray(3,W.Zero),n}(),D=function(){function n(){}return n.Vector2=be.BuildArray(3,ce.Zero),n.Vector3=be.BuildArray(13,m.Zero),n.Vector4=be.BuildArray(3,Ve.Zero),n.Quaternion=be.BuildArray(2,W.Zero),n.Matrix=be.BuildArray(8,P.Identity),n}();de.RegisteredTypes["BABYLON.Vector2"]=ce;de.RegisteredTypes["BABYLON.Vector3"]=m;de.RegisteredTypes["BABYLON.Vector4"]=Ve;de.RegisteredTypes["BABYLON.Matrix"]=P;var J=function(){function n(e,t,i){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),this.r=e,this.g=t,this.b=i}return n.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"},n.prototype.getClassName=function(){return"Color3"},n.prototype.getHashCode=function(){var e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e},n.prototype.toArray=function(e,t){return t===void 0&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this},n.prototype.fromArray=function(e,t){return t===void 0&&(t=0),n.FromArrayToRef(e,t,this),this},n.prototype.toColor4=function(e){return e===void 0&&(e=1),new ye(this.r,this.g,this.b,e)},n.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},n.prototype.toLuminance=function(){return this.r*.3+this.g*.59+this.b*.11},n.prototype.multiply=function(e){return new n(this.r*e.r,this.g*e.g,this.b*e.b)},n.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,this},n.prototype.equals=function(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b},n.prototype.equalsFloats=function(e,t,i){return this.r===e&&this.g===t&&this.b===i},n.prototype.scale=function(e){return new n(this.r*e,this.g*e,this.b*e)},n.prototype.scaleToRef=function(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,this},n.prototype.scaleAndAddToRef=function(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,this},n.prototype.clampToRef=function(e,t,i){return e===void 0&&(e=0),t===void 0&&(t=1),i.r=K.Clamp(this.r,e,t),i.g=K.Clamp(this.g,e,t),i.b=K.Clamp(this.b,e,t),this},n.prototype.add=function(e){return new n(this.r+e.r,this.g+e.g,this.b+e.b)},n.prototype.addToRef=function(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,this},n.prototype.subtract=function(e){return new n(this.r-e.r,this.g-e.g,this.b-e.b)},n.prototype.subtractToRef=function(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,this},n.prototype.clone=function(){return new n(this.r,this.g,this.b)},n.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},n.prototype.copyFromFloats=function(e,t,i){return this.r=e,this.g=t,this.b=i,this},n.prototype.set=function(e,t,i){return this.copyFromFloats(e,t,i)},n.prototype.toHexString=function(){var e=this.r*255|0,t=this.g*255|0,i=this.b*255|0;return"#"+K.ToHex(e)+K.ToHex(t)+K.ToHex(i)},n.prototype.toLinearSpace=function(){var e=new n;return this.toLinearSpaceToRef(e),e},n.prototype.toHSV=function(){var e=new n;return this.toHSVToRef(e),e},n.prototype.toHSVToRef=function(e){var t=this.r,i=this.g,r=this.b,a=Math.max(t,i,r),o=Math.min(t,i,r),s=0,l=0,f=a,u=a-o;a!==0&&(l=u/a),a!=o&&(a==t?(s=(i-r)/u,i<r&&(s+=6)):a==i?s=(r-t)/u+2:a==r&&(s=(t-i)/u+4),s*=60),e.r=s,e.g=l,e.b=f},n.prototype.toLinearSpaceToRef=function(e){return e.r=Math.pow(this.r,it),e.g=Math.pow(this.g,it),e.b=Math.pow(this.b,it),this},n.prototype.toGammaSpace=function(){var e=new n;return this.toGammaSpaceToRef(e),e},n.prototype.toGammaSpaceToRef=function(e){return e.r=Math.pow(this.r,gt),e.g=Math.pow(this.g,gt),e.b=Math.pow(this.b,gt),this},n.HSVtoRGBToRef=function(e,t,i,r){var a=i*t,o=e/60,s=a*(1-Math.abs(o%2-1)),l=0,f=0,u=0;o>=0&&o<=1?(l=a,f=s):o>=1&&o<=2?(l=s,f=a):o>=2&&o<=3?(f=a,u=s):o>=3&&o<=4?(f=s,u=a):o>=4&&o<=5?(l=s,u=a):o>=5&&o<=6&&(l=a,u=s);var c=i-a;r.set(l+c,f+c,u+c)},n.FromHexString=function(e){if(e.substring(0,1)!=="#"||e.length!==7)return new n(0,0,0);var t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),r=parseInt(e.substring(5,7),16);return n.FromInts(t,i,r)},n.FromArray=function(e,t){return t===void 0&&(t=0),new n(e[t],e[t+1],e[t+2])},n.FromArrayToRef=function(e,t,i){t===void 0&&(t=0),i.r=e[t],i.g=e[t+1],i.b=e[t+2]},n.FromInts=function(e,t,i){return new n(e/255,t/255,i/255)},n.Lerp=function(e,t,i){var r=new n(0,0,0);return n.LerpToRef(e,t,i,r),r},n.LerpToRef=function(e,t,i,r){r.r=e.r+(t.r-e.r)*i,r.g=e.g+(t.g-e.g)*i,r.b=e.b+(t.b-e.b)*i},n.Red=function(){return new n(1,0,0)},n.Green=function(){return new n(0,1,0)},n.Blue=function(){return new n(0,0,1)},n.Black=function(){return new n(0,0,0)},Object.defineProperty(n,"BlackReadOnly",{get:function(){return n._BlackReadOnly},enumerable:!1,configurable:!0}),n.White=function(){return new n(1,1,1)},n.Purple=function(){return new n(.5,0,.5)},n.Magenta=function(){return new n(1,0,1)},n.Yellow=function(){return new n(1,1,0)},n.Gray=function(){return new n(.5,.5,.5)},n.Teal=function(){return new n(0,1,1)},n.Random=function(){return new n(Math.random(),Math.random(),Math.random())},n._BlackReadOnly=n.Black(),n}(),ye=function(){function n(e,t,i,r){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),r===void 0&&(r=1),this.r=e,this.g=t,this.b=i,this.a=r}return n.prototype.addInPlace=function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this},n.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},n.prototype.toArray=function(e,t){return t===void 0&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this},n.prototype.fromArray=function(e,t){return t===void 0&&(t=0),n.FromArrayToRef(e,t,this),this},n.prototype.equals=function(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a},n.prototype.add=function(e){return new n(this.r+e.r,this.g+e.g,this.b+e.b,this.a+e.a)},n.prototype.subtract=function(e){return new n(this.r-e.r,this.g-e.g,this.b-e.b,this.a-e.a)},n.prototype.subtractToRef=function(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,this},n.prototype.scale=function(e){return new n(this.r*e,this.g*e,this.b*e,this.a*e)},n.prototype.scaleToRef=function(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,this},n.prototype.scaleAndAddToRef=function(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,this},n.prototype.clampToRef=function(e,t,i){return e===void 0&&(e=0),t===void 0&&(t=1),i.r=K.Clamp(this.r,e,t),i.g=K.Clamp(this.g,e,t),i.b=K.Clamp(this.b,e,t),i.a=K.Clamp(this.a,e,t),this},n.prototype.multiply=function(e){return new n(this.r*e.r,this.g*e.g,this.b*e.b,this.a*e.a)},n.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t},n.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"},n.prototype.getClassName=function(){return"Color4"},n.prototype.getHashCode=function(){var e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e=e*397^(this.a*255|0),e},n.prototype.clone=function(){return new n(this.r,this.g,this.b,this.a)},n.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this},n.prototype.copyFromFloats=function(e,t,i,r){return this.r=e,this.g=t,this.b=i,this.a=r,this},n.prototype.set=function(e,t,i,r){return this.copyFromFloats(e,t,i,r)},n.prototype.toHexString=function(e){e===void 0&&(e=!1);var t=this.r*255|0,i=this.g*255|0,r=this.b*255|0;if(e)return"#"+K.ToHex(t)+K.ToHex(i)+K.ToHex(r);var a=this.a*255|0;return"#"+K.ToHex(t)+K.ToHex(i)+K.ToHex(r)+K.ToHex(a)},n.prototype.toLinearSpace=function(){var e=new n;return this.toLinearSpaceToRef(e),e},n.prototype.toLinearSpaceToRef=function(e){return e.r=Math.pow(this.r,it),e.g=Math.pow(this.g,it),e.b=Math.pow(this.b,it),e.a=this.a,this},n.prototype.toGammaSpace=function(){var e=new n;return this.toGammaSpaceToRef(e),e},n.prototype.toGammaSpaceToRef=function(e){return e.r=Math.pow(this.r,gt),e.g=Math.pow(this.g,gt),e.b=Math.pow(this.b,gt),e.a=this.a,this},n.FromHexString=function(e){if(e.substring(0,1)!=="#"||e.length!==9)return new n(0,0,0,0);var t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),r=parseInt(e.substring(5,7),16),a=parseInt(e.substring(7,9),16);return n.FromInts(t,i,r,a)},n.Lerp=function(e,t,i){var r=new n(0,0,0,0);return n.LerpToRef(e,t,i,r),r},n.LerpToRef=function(e,t,i,r){r.r=e.r+(t.r-e.r)*i,r.g=e.g+(t.g-e.g)*i,r.b=e.b+(t.b-e.b)*i,r.a=e.a+(t.a-e.a)*i},n.FromColor3=function(e,t){return t===void 0&&(t=1),new n(e.r,e.g,e.b,t)},n.FromArray=function(e,t){return t===void 0&&(t=0),new n(e[t],e[t+1],e[t+2],e[t+3])},n.FromArrayToRef=function(e,t,i){t===void 0&&(t=0),i.r=e[t],i.g=e[t+1],i.b=e[t+2],i.a=e[t+3]},n.FromInts=function(e,t,i,r){return new n(e/255,t/255,i/255,r/255)},n.CheckColors4=function(e,t){if(e.length===t*3){for(var i=[],r=0;r<e.length;r+=3){var a=r/3*4;i[a]=e[r],i[a+1]=e[r+1],i[a+2]=e[r+2],i[a+3]=1}return i}return e},n}(),et=function(){function n(){}return n.Color3=be.BuildArray(3,J.Black),n.Color4=be.BuildArray(3,function(){return new ye(0,0,0,0)}),n}();de.RegisteredTypes["BABYLON.Color3"]=J;de.RegisteredTypes["BABYLON.Color4"]=ye;var Oe=function(){function n(e,t,i,r,a,o){this.source=e,this.pointerX=t,this.pointerY=i,this.meshUnderPointer=r,this.sourceEvent=a,this.additionalData=o}return n.CreateNew=function(e,t,i){var r=e.getScene();return new n(e,r.pointerX,r.pointerY,r.meshUnderPointer||e,t,i)},n.CreateNewFromSprite=function(e,t,i,r){return new n(e,t.pointerX,t.pointerY,t.meshUnderPointer,i,r)},n.CreateNewFromScene=function(e,t){return new n(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)},n.CreateNewFromPrimitive=function(e,t,i,r){return new n(e,t.x,t.y,null,i,r)},n}(),w=function(){function n(){}return n._AddLogEntry=function(e){n._LogCache=e+n._LogCache,n.OnNewCacheEntry&&n.OnNewCacheEntry(e)},n._FormatMessage=function(e){var t=function(r){return r<10?"0"+r:""+r},i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e},n._LogDisabled=function(e){},n._LogEnabled=function(e){var t=n._FormatMessage(e);console.log("BJS - "+t);var i="<div style='color:white'>"+t+"</div><br>";n._AddLogEntry(i)},n._WarnDisabled=function(e){},n._WarnEnabled=function(e){var t=n._FormatMessage(e);console.warn("BJS - "+t);var i="<div style='color:orange'>"+t+"</div><br>";n._AddLogEntry(i)},n._ErrorDisabled=function(e){},n._ErrorEnabled=function(e){n.errorsCount++;var t=n._FormatMessage(e);console.error("BJS - "+t);var i="<div style='color:red'>"+t+"</div><br>";n._AddLogEntry(i)},Object.defineProperty(n,"LogCache",{get:function(){return n._LogCache},enumerable:!1,configurable:!0}),n.ClearLogCache=function(){n._LogCache="",n.errorsCount=0},Object.defineProperty(n,"LogLevels",{set:function(e){(e&n.MessageLogLevel)===n.MessageLogLevel?n.Log=n._LogEnabled:n.Log=n._LogDisabled,(e&n.WarningLogLevel)===n.WarningLogLevel?n.Warn=n._WarnEnabled:n.Warn=n._WarnDisabled,(e&n.ErrorLogLevel)===n.ErrorLogLevel?n.Error=n._ErrorEnabled:n.Error=n._ErrorDisabled},enumerable:!1,configurable:!0}),n.NoneLogLevel=0,n.MessageLogLevel=1,n.WarningLogLevel=2,n.ErrorLogLevel=4,n.AllLogLevel=7,n._LogCache="",n.errorsCount=0,n.Log=n._LogEnabled,n.Warn=n._WarnEnabled,n.Error=n._ErrorEnabled,n}(),ne=function(){function n(){}return Object.defineProperty(n,"LastCreatedEngine",{get:function(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(n,"LastCreatedScene",{get:function(){return this._LastCreatedScene},enumerable:!1,configurable:!0}),n.Instances=new Array,n._LastCreatedScene=null,n.UseFallbackTexture=!0,n.FallbackTexture="",n}(),Fe=function(){function n(){}return n.EndsWith=function(e,t){return e.indexOf(t,e.length-t.length)!==-1},n.StartsWith=function(e,t){return e?e.indexOf(t)===0:!1},n.Decode=function(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var t="",i=0;i<e.byteLength;i++)t+=String.fromCharCode(e[i]);return t},n.EncodeArrayBufferToBase64=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="",r,a,o,s,l,f,u,c=0,h=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);c<h.length;)r=h[c++],a=c<h.length?h[c++]:Number.NaN,o=c<h.length?h[c++]:Number.NaN,s=r>>2,l=(r&3)<<4|a>>4,f=(a&15)<<2|o>>6,u=o&63,isNaN(a)?f=u=64:isNaN(o)&&(u=64),i+=t.charAt(s)+t.charAt(l)+t.charAt(f)+t.charAt(u);return i},n.PadNumber=function(e,t){for(var i=String(e);i.length<t;)i="0"+i;return i},n}(),Mi=function(n,e){return!n||n.getClassName&&n.getClassName()==="Mesh"?null:n.getClassName&&n.getClassName()==="SubMesh"?n.clone(e):n.clone?n.clone():null};function ur(n){var e=[];do Object.getOwnPropertyNames(n).forEach(function(t){e.indexOf(t)===-1&&e.push(t)});while(n=Object.getPrototypeOf(n));return e}var Ei=function(){function n(){}return n.DeepCopy=function(e,t,i,r){for(var a=ur(e),o=0,s=a;o<s.length;o++){var l=s[o];if(!(l[0]==="_"&&(!r||r.indexOf(l)===-1))&&!Fe.EndsWith(l,"Observable")&&!(i&&i.indexOf(l)!==-1)){var f=e[l],u=typeof f;if(u!=="function")try{if(u==="object")if(f instanceof Array){if(t[l]=[],f.length>0)if(typeof f[0]=="object")for(var c=0;c<f.length;c++){var h=Mi(f[c],t);t[l].indexOf(h)===-1&&t[l].push(h)}else t[l]=f.slice(0)}else t[l]=Mi(f,t);else t[l]=f}catch(p){w.Warn(p.message)}}}},n}(),cr=function(){function n(){}return n.Eval=function(e,t){return e.match(/\([^\(\)]*\)/g)?e=e.replace(/\([^\(\)]*\)/g,function(i){return i=i.slice(1,i.length-1),n._HandleParenthesisContent(i,t)}):e=n._HandleParenthesisContent(e,t),e==="true"?!0:e==="false"?!1:n.Eval(e,t)},n._HandleParenthesisContent=function(e,t){t=t||function(u){return u==="true"};var i,r=e.split("||");for(var a in r)if(r.hasOwnProperty(a)){var o=n._SimplifyNegation(r[a].trim()),s=o.split("&&");if(s.length>1)for(var l=0;l<s.length;++l){var f=n._SimplifyNegation(s[l].trim());if(f!=="true"&&f!=="false"?f[0]==="!"?i=!t(f.substring(1)):i=t(f):i=f==="true",!i){o="false";break}}if(i||o==="true"){i=!0;break}o!=="true"&&o!=="false"?o[0]==="!"?i=!t(o.substring(1)):i=t(o):i=o==="true"}return i?"true":"false"},n._SimplifyNegation=function(e){return e=e.replace(/^[\s!]+/,function(t){return t=t.replace(/[\s]/g,function(){return""}),t.length%2?"!":""}),e=e.trim(),e==="!true"?e="false":e==="!false"&&(e="true"),e},n}(),fe=function(){function n(){}return n.EnableFor=function(e){e._tags=e._tags||{},e.hasTags=function(){return n.HasTags(e)},e.addTags=function(t){return n.AddTagsTo(e,t)},e.removeTags=function(t){return n.RemoveTagsFrom(e,t)},e.matchesTagsQuery=function(t){return n.MatchesQuery(e,t)}},n.DisableFor=function(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery},n.HasTags=function(e){if(!e._tags)return!1;var t=e._tags;for(var i in t)if(t.hasOwnProperty(i))return!0;return!1},n.GetTags=function(e,t){if(t===void 0&&(t=!0),!e._tags)return null;if(t){var i=[];for(var r in e._tags)e._tags.hasOwnProperty(r)&&e._tags[r]===!0&&i.push(r);return i.join(" ")}else return e._tags},n.AddTagsTo=function(e,t){if(t&&typeof t=="string"){var i=t.split(" ");i.forEach(function(r,a,o){n._AddTagTo(e,r)})}},n._AddTagTo=function(e,t){t=t.trim(),!(t===""||t==="true"||t==="false")&&(t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(n.EnableFor(e),e._tags[t]=!0))},n.RemoveTagsFrom=function(e,t){if(n.HasTags(e)){var i=t.split(" ");for(var r in i)n._RemoveTagFrom(e,i[r])}},n._RemoveTagFrom=function(e,t){delete e._tags[t]},n.MatchesQuery=function(e,t){return t===void 0?!0:t===""?n.HasTags(e):cr.Eval(t,function(i){return n.HasTags(e)&&e._tags[i]})},n}(),U=function(){function n(){}return n.WarnImport=function(e){return e+" needs to be imported before as it contains a side-effect required by your code."},n}(),Xt={},Gt={},Pi=function(n,e,t){var i=n();fe&&fe.AddTagsTo(i,e.tags);var r=ai(i);for(var a in r){var o=r[a],s=e[a],l=o.type;if(s!=null&&a!=="uniqueId")switch(l){case 0:case 6:case 11:i[a]=s;break;case 1:i[a]=t||s.isRenderTarget?s:s.clone();break;case 2:case 3:case 4:case 5:case 7:case 10:case 12:i[a]=t?s:s.clone();break}}return i};function hr(n){var e=n.getClassName();return Xt[e]||(Xt[e]={}),Xt[e]}function ai(n){var e=n.getClassName();if(Gt[e])return Gt[e];Gt[e]={};for(var t=Gt[e],i=n,r=e;r;){var a=Xt[r];for(var o in a)t[o]=a[o];var s=void 0,l=!1;do{if(s=Object.getPrototypeOf(i),!s.getClassName){l=!0;break}if(s.getClassName()!==r)break;i=s}while(s);if(l)break;r=s.getClassName(),i=s}return t}function Ne(n,e){return function(t,i){var r=hr(t);r[i]||(r[i]={type:n,sourceName:e})}}function dr(n,e){return e===void 0&&(e=null),function(t,i){var r=e||"_"+i;Object.defineProperty(t,i,{get:function(){return this[r]},set:function(a){this[r]!==a&&(this[r]=a,t[n].apply(this))},enumerable:!0,configurable:!0})}}function I(n,e){return e===void 0&&(e=null),dr(n,e)}function A(n){return Ne(0,n)}function oe(n){return Ne(1,n)}function Me(n){return Ne(2,n)}function bt(n){return Ne(3,n)}function pr(n){return Ne(4,n)}function Ge(n){return Ne(5,n)}function _r(n){return Ne(6,n)}function vr(n){return Ne(7,n)}function Hi(n){return Ne(8,n)}function gr(n){return Ne(9,n)}function mr(n){return Ne(10,n)}function Er(n){return Ne(12,n)}function Ks(n){return Ne(11,n)}var H=function(){function n(){}return n.AppendSerializedAnimations=function(e,t){if(e.animations){t.animations=[];for(var i=0;i<e.animations.length;i++){var r=e.animations[i];t.animations.push(r.serialize())}}},n.Serialize=function(e,t){t||(t={}),fe&&(t.tags=fe.GetTags(e));var i=ai(e);for(var r in i){var a=i[r],o=a.sourceName||r,s=a.type,l=e[r];if(l!=null&&r!=="uniqueId")switch(s){case 0:t[o]=l;break;case 1:t[o]=l.serialize();break;case 2:t[o]=l.asArray();break;case 3:t[o]=l.serialize();break;case 4:t[o]=l.asArray();break;case 5:t[o]=l.asArray();break;case 6:t[o]=l.id;break;case 7:t[o]=l.serialize();break;case 8:t[o]=l.asArray();break;case 9:t[o]=l.serialize();break;case 10:t[o]=l.asArray();break;case 11:t[o]=l.id;case 12:t[o]=l.asArray();break}}return t},n.Parse=function(e,t,i,r){r===void 0&&(r=null);var a=e();r||(r=""),fe&&fe.AddTagsTo(a,t.tags);var o=ai(a);for(var s in o){var l=o[s],f=t[l.sourceName||s],u=l.type;if(f!=null&&s!=="uniqueId"){var c=a;switch(u){case 0:c[s]=f;break;case 1:i&&(c[s]=n._TextureParser(f,i,r));break;case 2:c[s]=J.FromArray(f);break;case 3:c[s]=n._FresnelParametersParser(f);break;case 4:c[s]=ce.FromArray(f);break;case 5:c[s]=m.FromArray(f);break;case 6:i&&(c[s]=i.getLastMeshByID(f));break;case 7:c[s]=n._ColorCurvesParser(f);break;case 8:c[s]=ye.FromArray(f);break;case 9:c[s]=n._ImageProcessingConfigurationParser(f);break;case 10:c[s]=W.FromArray(f);break;case 11:i&&(c[s]=i.getCameraByID(f));case 12:c[s]=P.FromArray(f);break}}}return a},n.Clone=function(e,t){return Pi(e,t,!1)},n.Instanciate=function(e,t){return Pi(e,t,!0)},n._ImageProcessingConfigurationParser=function(e){throw U.WarnImport("ImageProcessingConfiguration")},n._FresnelParametersParser=function(e){throw U.WarnImport("FresnelParameters")},n._ColorCurvesParser=function(e){throw U.WarnImport("ColorCurves")},n._TextureParser=function(e,t,i){throw U.WarnImport("Texture")},n}(),oi;(function(n){n[n.STEP=1]="STEP"})(oi||(oi={}));var Yt=function(){function n(e,t,i){this.name=e,this.from=t,this.to=i}return n.prototype.clone=function(){return new n(this.name,this.from,this.to)},n}(),De=function(){function n(e,t){t===void 0&&(t=null),this.state="",this.metadata=null,this.reservedDataStore=null,this._doNotSerialize=!1,this._isDisposed=!1,this.animations=new Array,this._ranges={},this.onReady=null,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=P.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._sceneRootNodesIndex=-1,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new O,this._onDisposeObserver=null,this._behaviors=new Array,this.name=e,this.id=e,this._scene=t||ne.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache()}return n.AddNodeConstructor=function(e,t){this._NodeConstructors[e]=t},n.Construct=function(e,t,i,r){var a=this._NodeConstructors[e];return a?a(t,i,r):null},Object.defineProperty(n.prototype,"doNotSerialize",{get:function(){return this._doNotSerialize?!0:this._parentNode?this._parentNode.doNotSerialize:!1},set:function(e){this._doNotSerialize=e},enumerable:!1,configurable:!0}),n.prototype.isDisposed=function(){return this._isDisposed},Object.defineProperty(n.prototype,"parent",{get:function(){return this._parentNode},set:function(e){if(this._parentNode!==e){var t=this._parentNode;if(this._parentNode&&this._parentNode._children!==void 0&&this._parentNode._children!==null){var i=this._parentNode._children.indexOf(this);i!==-1&&this._parentNode._children.splice(i,1),!e&&!this._isDisposed&&this._addToSceneRootNodes()}this._parentNode=e,this._parentNode&&((this._parentNode._children===void 0||this._parentNode._children===null)&&(this._parentNode._children=new Array),this._parentNode._children.push(this),t||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}},enumerable:!1,configurable:!0}),n.prototype._addToSceneRootNodes=function(){this._sceneRootNodesIndex===-1&&(this._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))},n.prototype._removeFromSceneRootNodes=function(){if(this._sceneRootNodesIndex!==-1){var e=this._scene.rootNodes,t=e.length-1;e[this._sceneRootNodesIndex]=e[t],e[this._sceneRootNodesIndex]._sceneRootNodesIndex=this._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._sceneRootNodesIndex=-1}},Object.defineProperty(n.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),n.prototype.getClassName=function(){return"Node"},Object.defineProperty(n.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),n.prototype.getScene=function(){return this._scene},n.prototype.getEngine=function(){return this._scene.getEngine()},n.prototype.addBehavior=function(e,t){var i=this;t===void 0&&(t=!1);var r=this._behaviors.indexOf(e);return r!==-1?this:(e.init(),this._scene.isLoading&&!t?this._scene.onDataLoadedObservable.addOnce(function(){e.attach(i)}):e.attach(this),this._behaviors.push(e),this)},n.prototype.removeBehavior=function(e){var t=this._behaviors.indexOf(e);return t===-1?this:(this._behaviors[t].detach(),this._behaviors.splice(t,1),this)},Object.defineProperty(n.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!1,configurable:!0}),n.prototype.getBehaviorByName=function(e){for(var t=0,i=this._behaviors;t<i.length;t++){var r=i[t];if(r.name===e)return r}return null},n.prototype.getWorldMatrix=function(){return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix},n.prototype._getWorldMatrixDeterminant=function(){return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant},Object.defineProperty(n.prototype,"worldMatrixFromCache",{get:function(){return this._worldMatrix},enumerable:!1,configurable:!0}),n.prototype._initCache=function(){this._cache={},this._cache.parent=void 0},n.prototype.updateCache=function(e){!e&&this.isSynchronized()||(this._cache.parent=this.parent,this._updateCache())},n.prototype._getActionManagerForTrigger=function(e,t){return this.parent?this.parent._getActionManagerForTrigger(e,!1):null},n.prototype._updateCache=function(e){},n.prototype._isSynchronized=function(){return!0},n.prototype._markSyncedWithParent=function(){this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)},n.prototype.isSynchronizedWithParent=function(){return this._parentNode?this._parentUpdateId!==this._parentNode._childUpdateId?!1:this._parentNode.isSynchronized():!0},n.prototype.isSynchronized=function(){return this._cache.parent!=this._parentNode?(this._cache.parent=this._parentNode,!1):this._parentNode&&!this.isSynchronizedWithParent()?!1:this._isSynchronized()},n.prototype.isReady=function(e){return this._isReady},n.prototype.isEnabled=function(e){return e===void 0&&(e=!0),e===!1?this._isEnabled:this._isEnabled?this._isParentEnabled:!1},n.prototype._syncParentEnabledState=function(){this._isParentEnabled=this._parentNode?this._parentNode.isEnabled():!0,this._children&&this._children.forEach(function(e){e._syncParentEnabledState()})},n.prototype.setEnabled=function(e){this._isEnabled=e,this._syncParentEnabledState()},n.prototype.isDescendantOf=function(e){return this.parent?this.parent===e?!0:this.parent.isDescendantOf(e):!1},n.prototype._getDescendants=function(e,t,i){if(t===void 0&&(t=!1),!!this._children)for(var r=0;r<this._children.length;r++){var a=this._children[r];(!i||i(a))&&e.push(a),t||a._getDescendants(e,!1,i)}},n.prototype.getDescendants=function(e,t){var i=new Array;return this._getDescendants(i,e,t),i},n.prototype.getChildMeshes=function(e,t){var i=[];return this._getDescendants(i,e,function(r){return(!t||t(r))&&r.cullingStrategy!==void 0}),i},n.prototype.getChildren=function(e,t){return t===void 0&&(t=!0),this.getDescendants(t,e)},n.prototype._setReady=function(e){if(e!==this._isReady){if(!e){this._isReady=!1;return}this.onReady&&this.onReady(this),this._isReady=!0}},n.prototype.getAnimationByName=function(e){for(var t=0;t<this.animations.length;t++){var i=this.animations[t];if(i.name===e)return i}return null},n.prototype.createAnimationRange=function(e,t,i){if(!this._ranges[e]){this._ranges[e]=n._AnimationRangeFactory(e,t,i);for(var r=0,a=this.animations.length;r<a;r++)this.animations[r]&&this.animations[r].createRange(e,t,i)}},n.prototype.deleteAnimationRange=function(e,t){t===void 0&&(t=!0);for(var i=0,r=this.animations.length;i<r;i++)this.animations[i]&&this.animations[i].deleteRange(e,t);this._ranges[e]=null},n.prototype.getAnimationRange=function(e){return this._ranges[e]||null},n.prototype.getAnimationRanges=function(){var e=[],t;for(t in this._ranges)e.push(this._ranges[t]);return e},n.prototype.beginAnimation=function(e,t,i,r){var a=this.getAnimationRange(e);return a?this._scene.beginAnimation(this,a.from,a.to,t,i,r):null},n.prototype.serializeAnimationRanges=function(){var e=[];for(var t in this._ranges){var i=this._ranges[t];if(i){var r={};r.name=t,r.from=i.from,r.to=i.to,e.push(r)}}return e},n.prototype.computeWorldMatrix=function(e){return this._worldMatrix||(this._worldMatrix=P.Identity()),this._worldMatrix},n.prototype.dispose=function(e,t){if(t===void 0&&(t=!1),this._isDisposed=!0,!e)for(var i=this.getDescendants(!0),r=0,a=i;r<a.length;r++){var o=a[r];o.dispose(e,t)}this.parent?this.parent=null:this._removeFromSceneRootNodes(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear();for(var s=0,l=this._behaviors;s<l.length;s++){var f=l[s];f.detach()}this._behaviors=[]},n.ParseAnimationRanges=function(e,t,i){if(t.ranges)for(var r=0;r<t.ranges.length;r++){var a=t.ranges[r];e.createAnimationRange(a.name,a.from,a.to)}},n.prototype.getHierarchyBoundingVectors=function(e,t){e===void 0&&(e=!0),t===void 0&&(t=null),this.getScene().incrementRenderId(),this.computeWorldMatrix(!0);var i,r,a=this;if(a.getBoundingInfo&&a.subMeshes){var o=a.getBoundingInfo();i=o.boundingBox.minimumWorld.clone(),r=o.boundingBox.maximumWorld.clone()}else i=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(e)for(var s=this.getDescendants(!1),l=0,f=s;l<f.length;l++){var u=f[l],c=u;if(c.computeWorldMatrix(!0),!(t&&!t(c))&&!(!c.getBoundingInfo||c.getTotalVertices()===0)){var h=c.getBoundingInfo(),p=h.boundingBox,d=p.minimumWorld,_=p.maximumWorld;m.CheckExtends(d,i,r),m.CheckExtends(_,i,r)}}return{min:i,max:r}},n._AnimationRangeFactory=function(e,t,i){throw U.WarnImport("AnimationRange")},n._NodeConstructors={},g([A()],n.prototype,"name",void 0),g([A()],n.prototype,"id",void 0),g([A()],n.prototype,"uniqueId",void 0),g([A()],n.prototype,"state",void 0),g([A()],n.prototype,"metadata",void 0),n}(),Dt=function(){function n(e,t){this.width=e,this.height=t}return n.prototype.toString=function(){return"{W: "+this.width+", H: "+this.height+"}"},n.prototype.getClassName=function(){return"Size"},n.prototype.getHashCode=function(){var e=this.width|0;return e=e*397^(this.height|0),e},n.prototype.copyFrom=function(e){this.width=e.width,this.height=e.height},n.prototype.copyFromFloats=function(e,t){return this.width=e,this.height=t,this},n.prototype.set=function(e,t){return this.copyFromFloats(e,t)},n.prototype.multiplyByFloats=function(e,t){return new n(this.width*e,this.height*t)},n.prototype.clone=function(){return new n(this.width,this.height)},n.prototype.equals=function(e){return e?this.width===e.width&&this.height===e.height:!1},Object.defineProperty(n.prototype,"surface",{get:function(){return this.width*this.height},enumerable:!1,configurable:!0}),n.Zero=function(){return new n(0,0)},n.prototype.add=function(e){var t=new n(this.width+e.width,this.height+e.height);return t},n.prototype.subtract=function(e){var t=new n(this.width-e.width,this.height-e.height);return t},n.Lerp=function(e,t,i){var r=e.width+(t.width-e.width)*i,a=e.height+(t.height-e.height)*i;return new n(r,a)},n}();function yr(){return typeof _native<"u"&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest}var ft=function(){function n(){this._xhr=yr()}return n.prototype._injectCustomRequestHeaders=function(){for(var e in n.CustomRequestHeaders){var t=n.CustomRequestHeaders[e];t&&this._xhr.setRequestHeader(e,t)}},Object.defineProperty(n.prototype,"onprogress",{get:function(){return this._xhr.onprogress},set:function(e){this._xhr.onprogress=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"readyState",{get:function(){return this._xhr.readyState},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"status",{get:function(){return this._xhr.status},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"statusText",{get:function(){return this._xhr.statusText},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"response",{get:function(){return this._xhr.response},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"responseURL",{get:function(){return this._xhr.responseURL},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"responseText",{get:function(){return this._xhr.responseText},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"responseType",{get:function(){return this._xhr.responseType},set:function(e){this._xhr.responseType=e},enumerable:!1,configurable:!0}),n.prototype.addEventListener=function(e,t,i){this._xhr.addEventListener(e,t,i)},n.prototype.removeEventListener=function(e,t,i){this._xhr.removeEventListener(e,t,i)},n.prototype.abort=function(){this._xhr.abort()},n.prototype.send=function(e){n.CustomRequestHeaders&&this._injectCustomRequestHeaders(),this._xhr.send(e)},n.prototype.open=function(e,t){for(var i=0,r=n.CustomRequestModifiers;i<r.length;i++){var a=r[i];a(this._xhr,t)}return t=t.replace("file:http:","http:"),t=t.replace("file:https:","https:"),this._xhr.open(e,t,!0)},n.prototype.setRequestHeader=function(e,t){this._xhr.setRequestHeader(e,t)},n.prototype.getResponseHeader=function(e){return this._xhr.getResponseHeader(e)},n.CustomRequestHeaders={},n.CustomRequestModifiers=new Array,n}(),Qs=function(){function n(){}return n}(),he=function(){function n(e,t,i,r,a,o){this.name=e,this.targetProperty=t,this.framePerSecond=i,this.dataType=r,this.loopMode=a,this.enableBlending=o,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this.targetPropertyPath=t.split("."),this.dataType=r,this.loopMode=a===void 0?n.ANIMATIONLOOPMODE_CYCLE:a}return n._PrepareAnimation=function(e,t,i,r,a,o,s,l){var f=void 0;if(!isNaN(parseFloat(a))&&isFinite(a)?f=n.ANIMATIONTYPE_FLOAT:a instanceof W?f=n.ANIMATIONTYPE_QUATERNION:a instanceof m?f=n.ANIMATIONTYPE_VECTOR3:a instanceof ce?f=n.ANIMATIONTYPE_VECTOR2:a instanceof J?f=n.ANIMATIONTYPE_COLOR3:a instanceof ye?f=n.ANIMATIONTYPE_COLOR4:a instanceof Dt&&(f=n.ANIMATIONTYPE_SIZE),f==null)return null;var u=new n(e,t,i,f,s),c=[{frame:0,value:a},{frame:r,value:o}];return u.setKeys(c),l!==void 0&&u.setEasingFunction(l),u},n.CreateAnimation=function(e,t,i,r){var a=new n(e+"Animation",e,i,t,n.ANIMATIONLOOPMODE_CONSTANT);return a.setEasingFunction(r),a},n.CreateAndStartAnimation=function(e,t,i,r,a,o,s,l,f,u){var c=n._PrepareAnimation(e,i,r,a,o,s,l,f);return c?t.getScene().beginDirectAnimation(t,[c],0,a,c.loopMode===1,1,u):null},n.CreateAndStartHierarchyAnimation=function(e,t,i,r,a,o,s,l,f,u,c){var h=n._PrepareAnimation(e,r,a,o,s,l,f,u);if(!h)return null;var p=t.getScene();return p.beginDirectHierarchyAnimation(t,i,[h],0,o,h.loopMode===1,1,c)},n.CreateMergeAndStartAnimation=function(e,t,i,r,a,o,s,l,f,u){var c=n._PrepareAnimation(e,i,r,a,o,s,l,f);return c?(t.animations.push(c),t.getScene().beginAnimation(t,0,a,c.loopMode===1,1,u)):null},n.MakeAnimationAdditive=function(e,t,i,r,a){t===void 0&&(t=0),r===void 0&&(r=!1);var o=e;if(r&&(o=e.clone(),o.name=a||o.name),!o._keys.length)return o;t=t>=0?t:0;var s=0,l=o._keys[0],f=o._keys.length-1,u=o._keys[f],c={referenceValue:l.value,referencePosition:D.Vector3[0],referenceQuaternion:D.Quaternion[0],referenceScaling:D.Vector3[1],keyPosition:D.Vector3[2],keyQuaternion:D.Quaternion[1],keyScaling:D.Vector3[3]},h=!1,p=l.frame,d=u.frame;if(i){var _=o.getRange(i);_&&(p=_.from,d=_.to)}var v=l.frame===p,E=u.frame===d;if(o._keys.length===1){var y=o._getKeyValue(o._keys[0]);c.referenceValue=y.clone?y.clone():y,h=!0}else if(t<=l.frame){var y=o._getKeyValue(l.value);c.referenceValue=y.clone?y.clone():y,h=!0}else if(t>=u.frame){var y=o._getKeyValue(u.value);c.referenceValue=y.clone?y.clone():y,h=!0}for(var R=0;!h||!v||!E&&R<o._keys.length-1;){var S=o._keys[R],M=o._keys[R+1];if(!h&&t>=S.frame&&t<=M.frame){var y=void 0;if(t===S.frame)y=o._getKeyValue(S.value);else if(t===M.frame)y=o._getKeyValue(M.value);else{var C={key:R,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT};y=o._interpolate(t,C)}c.referenceValue=y.clone?y.clone():y,h=!0}if(!v&&p>=S.frame&&p<=M.frame){if(p===S.frame)s=R;else if(p===M.frame)s=R+1;else{var C={key:R,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT},y=o._interpolate(p,C),b={frame:p,value:y.clone?y.clone():y};o._keys.splice(R+1,0,b),s=R+1}v=!0}if(!E&&d>=S.frame&&d<=M.frame){if(d===S.frame)f=R;else if(d===M.frame)f=R+1;else{var C={key:R,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT},y=o._interpolate(d,C),b={frame:d,value:y.clone?y.clone():y};o._keys.splice(R+1,0,b),f=R+1}E=!0}R++}o.dataType===n.ANIMATIONTYPE_QUATERNION?c.referenceValue.normalize().conjugateInPlace():o.dataType===n.ANIMATIONTYPE_MATRIX&&(c.referenceValue.decompose(c.referenceScaling,c.referenceQuaternion,c.referencePosition),c.referenceQuaternion.normalize().conjugateInPlace());for(var R=s;R<=f;R++){var b=o._keys[R];if(!(R&&o.dataType!==n.ANIMATIONTYPE_FLOAT&&b.value===l.value))switch(o.dataType){case n.ANIMATIONTYPE_MATRIX:b.value.decompose(c.keyScaling,c.keyQuaternion,c.keyPosition),c.keyPosition.subtractInPlace(c.referencePosition),c.keyScaling.divideInPlace(c.referenceScaling),c.referenceQuaternion.multiplyToRef(c.keyQuaternion,c.keyQuaternion),P.ComposeToRef(c.keyScaling,c.keyQuaternion,c.keyPosition,b.value);break;case n.ANIMATIONTYPE_QUATERNION:c.referenceValue.multiplyToRef(b.value,b.value);break;case n.ANIMATIONTYPE_VECTOR2:case n.ANIMATIONTYPE_VECTOR3:case n.ANIMATIONTYPE_COLOR3:case n.ANIMATIONTYPE_COLOR4:b.value.subtractToRef(c.referenceValue,b.value);break;case n.ANIMATIONTYPE_SIZE:b.value.width-=c.referenceValue.width,b.value.height-=c.referenceValue.height;break;default:b.value-=c.referenceValue}}return o},n.TransitionTo=function(e,t,i,r,a,o,s,l){if(l===void 0&&(l=null),s<=0)return i[e]=t,l&&l(),null;var f=a*(s/1e3);o.setKeys([{frame:0,value:i[e].clone?i[e].clone():i[e]},{frame:f,value:t}]),i.animations||(i.animations=[]),i.animations.push(o);var u=r.beginAnimation(i,0,f,!1);return u.onAnimationEnd=l,u},Object.defineProperty(n.prototype,"runtimeAnimations",{get:function(){return this._runtimeAnimations},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRunningRuntimeAnimations",{get:function(){for(var e=0,t=this._runtimeAnimations;e<t.length;e++){var i=t[e];if(!i.isStopped)return!0}return!1},enumerable:!1,configurable:!0}),n.prototype.toString=function(e){var t="Name: "+this.name+", property: "+this.targetProperty;if(t+=", datatype: "+["Float","Vector3","Quaternion","Matrix","Color3","Vector2"][this.dataType],t+=", nKeys: "+(this._keys?this._keys.length:"none"),t+=", nRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";var i=!0;for(var r in this._ranges)i&&(t+=", ",i=!1),t+=r;t+="}"}return t},n.prototype.addEvent=function(e){this._events.push(e),this._events.sort(function(t,i){return t.frame-i.frame})},n.prototype.removeEvents=function(e){for(var t=0;t<this._events.length;t++)this._events[t].frame===e&&(this._events.splice(t,1),t--)},n.prototype.getEvents=function(){return this._events},n.prototype.createRange=function(e,t,i){this._ranges[e]||(this._ranges[e]=new Yt(e,t,i))},n.prototype.deleteRange=function(e,t){t===void 0&&(t=!0);var i=this._ranges[e];if(i){if(t)for(var r=i.from,a=i.to,o=this._keys.length-1;o>=0;o--)this._keys[o].frame>=r&&this._keys[o].frame<=a&&this._keys.splice(o,1);this._ranges[e]=null}},n.prototype.getRange=function(e){return this._ranges[e]},n.prototype.getKeys=function(){return this._keys},n.prototype.getHighestFrame=function(){for(var e=0,t=0,i=this._keys.length;t<i;t++)e<this._keys[t].frame&&(e=this._keys[t].frame);return e},n.prototype.getEasingFunction=function(){return this._easingFunction},n.prototype.setEasingFunction=function(e){this._easingFunction=e},n.prototype.floatInterpolateFunction=function(e,t,i){return K.Lerp(e,t,i)},n.prototype.floatInterpolateFunctionWithTangents=function(e,t,i,r,a){return K.Hermite(e,t,i,r,a)},n.prototype.quaternionInterpolateFunction=function(e,t,i){return W.Slerp(e,t,i)},n.prototype.quaternionInterpolateFunctionWithTangents=function(e,t,i,r,a){return W.Hermite(e,t,i,r,a).normalize()},n.prototype.vector3InterpolateFunction=function(e,t,i){return m.Lerp(e,t,i)},n.prototype.vector3InterpolateFunctionWithTangents=function(e,t,i,r,a){return m.Hermite(e,t,i,r,a)},n.prototype.vector2InterpolateFunction=function(e,t,i){return ce.Lerp(e,t,i)},n.prototype.vector2InterpolateFunctionWithTangents=function(e,t,i,r,a){return ce.Hermite(e,t,i,r,a)},n.prototype.sizeInterpolateFunction=function(e,t,i){return Dt.Lerp(e,t,i)},n.prototype.color3InterpolateFunction=function(e,t,i){return J.Lerp(e,t,i)},n.prototype.color4InterpolateFunction=function(e,t,i){return ye.Lerp(e,t,i)},n.prototype._getKeyValue=function(e){return typeof e=="function"?e():e},n.prototype._interpolate=function(e,t){if(t.loopMode===n.ANIMATIONLOOPMODE_CONSTANT&&t.repeatCount>0)return t.highLimitValue.clone?t.highLimitValue.clone():t.highLimitValue;var i=this._keys;if(i.length===1)return this._getKeyValue(i[0].value);var r=t.key;if(i[r].frame>=e)for(;r-1>=0&&i[r].frame>=e;)r--;for(var a=r;a<i.length;a++){var o=i[a+1];if(o.frame>=e){t.key=a;var s=i[a],l=this._getKeyValue(s.value);if(s.interpolation===oi.STEP)return l;var f=this._getKeyValue(o.value),u=s.outTangent!==void 0&&o.inTangent!==void 0,c=o.frame-s.frame,h=(e-s.frame)/c,p=this.getEasingFunction();switch(p!=null&&(h=p.ease(h)),this.dataType){case n.ANIMATIONTYPE_FLOAT:var d=u?this.floatInterpolateFunctionWithTangents(l,s.outTangent*c,f,o.inTangent*c,h):this.floatInterpolateFunction(l,f,h);switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return d;case n.ANIMATIONLOOPMODE_RELATIVE:return t.offsetValue*t.repeatCount+d}break;case n.ANIMATIONTYPE_QUATERNION:var _=u?this.quaternionInterpolateFunctionWithTangents(l,s.outTangent.scale(c),f,o.inTangent.scale(c),h):this.quaternionInterpolateFunction(l,f,h);switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return _;case n.ANIMATIONLOOPMODE_RELATIVE:return _.addInPlace(t.offsetValue.scale(t.repeatCount))}return _;case n.ANIMATIONTYPE_VECTOR3:var v=u?this.vector3InterpolateFunctionWithTangents(l,s.outTangent.scale(c),f,o.inTangent.scale(c),h):this.vector3InterpolateFunction(l,f,h);switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return v;case n.ANIMATIONLOOPMODE_RELATIVE:return v.add(t.offsetValue.scale(t.repeatCount))}case n.ANIMATIONTYPE_VECTOR2:var E=u?this.vector2InterpolateFunctionWithTangents(l,s.outTangent.scale(c),f,o.inTangent.scale(c),h):this.vector2InterpolateFunction(l,f,h);switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return E;case n.ANIMATIONLOOPMODE_RELATIVE:return E.add(t.offsetValue.scale(t.repeatCount))}case n.ANIMATIONTYPE_SIZE:switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(l,f,h);case n.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(l,f,h).add(t.offsetValue.scale(t.repeatCount))}case n.ANIMATIONTYPE_COLOR3:switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return this.color3InterpolateFunction(l,f,h);case n.ANIMATIONLOOPMODE_RELATIVE:return this.color3InterpolateFunction(l,f,h).add(t.offsetValue.scale(t.repeatCount))}case n.ANIMATIONTYPE_COLOR4:switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return this.color4InterpolateFunction(l,f,h);case n.ANIMATIONLOOPMODE_RELATIVE:return this.color4InterpolateFunction(l,f,h).add(t.offsetValue.scale(t.repeatCount))}case n.ANIMATIONTYPE_MATRIX:switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:if(n.AllowMatricesInterpolation)return this.matrixInterpolateFunction(l,f,h,t.workValue);case n.ANIMATIONLOOPMODE_RELATIVE:return l}}break}}return this._getKeyValue(i[i.length-1].value)},n.prototype.matrixInterpolateFunction=function(e,t,i,r){return n.AllowMatrixDecomposeForInterpolation?r?(P.DecomposeLerpToRef(e,t,i,r),r):P.DecomposeLerp(e,t,i):r?(P.LerpToRef(e,t,i,r),r):P.Lerp(e,t,i)},n.prototype.clone=function(){var e=new n(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed,this._keys&&e.setKeys(this._keys),this._ranges){e._ranges={};for(var t in this._ranges){var i=this._ranges[t];i&&(e._ranges[t]=i.clone())}}return e},n.prototype.setKeys=function(e){this._keys=e.slice(0)},n.prototype.serialize=function(){var e={};e.name=this.name,e.property=this.targetProperty,e.framePerSecond=this.framePerSecond,e.dataType=this.dataType,e.loopBehavior=this.loopMode,e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed;var t=this.dataType;e.keys=[];for(var i=this.getKeys(),r=0;r<i.length;r++){var a=i[r],o={};switch(o.frame=a.frame,t){case n.ANIMATIONTYPE_FLOAT:o.values=[a.value],a.inTangent!==void 0&&o.values.push(a.inTangent),a.outTangent!==void 0&&(a.inTangent===void 0&&o.values.push(void 0),o.values.push(a.outTangent));break;case n.ANIMATIONTYPE_QUATERNION:case n.ANIMATIONTYPE_MATRIX:case n.ANIMATIONTYPE_VECTOR3:case n.ANIMATIONTYPE_COLOR3:case n.ANIMATIONTYPE_COLOR4:o.values=a.value.asArray(),a.inTangent!=null&&o.values.push(a.inTangent.asArray()),a.outTangent!=null&&(a.inTangent===void 0&&o.values.push(void 0),o.values.push(a.outTangent.asArray()));break}e.keys.push(o)}e.ranges=[];for(var s in this._ranges){var l=this._ranges[s];if(l){var f={};f.name=s,f.from=l.from,f.to=l.to,e.ranges.push(f)}}return e},n._UniversalLerp=function(e,t,i){var r=e.constructor;return r.Lerp?r.Lerp(e,t,i):r.Slerp?r.Slerp(e,t,i):e.toFixed?e*(1-i)+i*t:t},n.Parse=function(e){var t=new n(e.name,e.property,e.framePerSecond,e.dataType,e.loopBehavior),i=e.dataType,r=[],a,o;for(e.enableBlending&&(t.enableBlending=e.enableBlending),e.blendingSpeed&&(t.blendingSpeed=e.blendingSpeed),o=0;o<e.keys.length;o++){var s=e.keys[o],l,f;switch(i){case n.ANIMATIONTYPE_FLOAT:a=s.values[0],s.values.length>=1&&(l=s.values[1]),s.values.length>=2&&(f=s.values[2]);break;case n.ANIMATIONTYPE_QUATERNION:if(a=W.FromArray(s.values),s.values.length>=8){var u=W.FromArray(s.values.slice(4,8));u.equals(W.Zero())||(l=u)}if(s.values.length>=12){var c=W.FromArray(s.values.slice(8,12));c.equals(W.Zero())||(f=c)}break;case n.ANIMATIONTYPE_MATRIX:a=P.FromArray(s.values);break;case n.ANIMATIONTYPE_COLOR3:a=J.FromArray(s.values);break;case n.ANIMATIONTYPE_COLOR4:a=ye.FromArray(s.values);break;case n.ANIMATIONTYPE_VECTOR3:default:a=m.FromArray(s.values);break}var h={};h.frame=s.frame,h.value=a,l!=null&&(h.inTangent=l),f!=null&&(h.outTangent=f),r.push(h)}if(t.setKeys(r),e.ranges)for(o=0;o<e.ranges.length;o++)a=e.ranges[o],t.createRange(a.name,a.from,a.to);return t},n.AppendSerializedAnimations=function(e,t){H.AppendSerializedAnimations(e,t)},n.ParseFromFileAsync=function(e,t){var i=this;return new Promise(function(r,a){var o=new ft;o.addEventListener("readystatechange",function(){if(o.readyState==4)if(o.status==200){var s=JSON.parse(o.responseText);if(s.length){for(var l=new Array,f=0,u=s;f<u.length;f++){var c=u[f];l.push(i.Parse(c))}r(l)}else{var l=i.Parse(s);e&&(l.name=e),r(l)}}else a("Unable to load the animation")}),o.open("GET",t),o.send()})},n.CreateFromSnippetAsync=function(e){var t=this;return new Promise(function(i,r){var a=new ft;a.addEventListener("readystatechange",function(){if(a.readyState==4)if(a.status==200){var o=JSON.parse(JSON.parse(a.responseText).jsonPayload);if(o.animations){for(var s=JSON.parse(o.animations),l=new Array,f=0,u=s;f<u.length;f++){var c=u[f];l.push(t.Parse(c))}i(l)}else{var s=JSON.parse(o.animation),l=t.Parse(s);l.snippetId=e,i(l)}}else r("Unable to load the snippet "+e)}),a.open("GET",t.SnippetUrl+"/"+e.replace(/#/g,"/")),a.send()})},n.AllowMatricesInterpolation=!1,n.AllowMatrixDecomposeForInterpolation=!0,n.SnippetUrl="https://snippet.babylonjs.com",n.ANIMATIONTYPE_FLOAT=0,n.ANIMATIONTYPE_VECTOR3=1,n.ANIMATIONTYPE_QUATERNION=2,n.ANIMATIONTYPE_MATRIX=3,n.ANIMATIONTYPE_COLOR3=4,n.ANIMATIONTYPE_COLOR4=7,n.ANIMATIONTYPE_VECTOR2=5,n.ANIMATIONTYPE_SIZE=6,n.ANIMATIONLOOPMODE_RELATIVE=0,n.ANIMATIONLOOPMODE_CYCLE=1,n.ANIMATIONLOOPMODE_CONSTANT=2,n}();de.RegisteredTypes["BABYLON.Animation"]=he;De._AnimationRangeFactory=function(n,e,t){return new Yt(n,e,t)};var Tr=Object.freeze(new W(0,0,0,0)),Ar=Object.freeze(m.Zero()),Rr=Object.freeze(ce.Zero()),br=Object.freeze(Dt.Zero()),Sr=Object.freeze(J.Black()),Cr=function(){function n(e,t,i,r){var a=this;if(this._events=new Array,this._currentFrame=0,this._originalValue=new Array,this._originalBlendValue=null,this._offsetsCache={},this._highLimitsCache={},this._stopped=!1,this._blendingFactor=0,this._currentValue=null,this._currentActiveTarget=null,this._directTarget=null,this._targetPath="",this._weight=1,this._ratioOffset=0,this._previousDelay=0,this._previousRatio=0,this._targetIsArray=!1,this._animation=t,this._target=e,this._scene=i,this._host=r,this._activeTargets=[],t._runtimeAnimations.push(this),this._animationState={key:0,repeatCount:0,loopMode:this._getCorrectLoopMode()},this._animation.dataType===he.ANIMATIONTYPE_MATRIX&&(this._animationState.workValue=P.Zero()),this._keys=this._animation.getKeys(),this._minFrame=this._keys[0].frame,this._maxFrame=this._keys[this._keys.length-1].frame,this._minValue=this._keys[0].value,this._maxValue=this._keys[this._keys.length-1].value,this._minFrame!==0){var o={frame:0,value:this._minValue};this._keys.splice(0,0,o)}if(this._target instanceof Array){for(var s=0,l=0,f=this._target;l<f.length;l++){var u=f[l];this._preparePath(u,s),this._getOriginalValues(s),s++}this._targetIsArray=!0}else this._preparePath(this._target),this._getOriginalValues(),this._targetIsArray=!1,this._directTarget=this._activeTargets[0];var c=t.getEvents();c&&c.length>0&&c.forEach(function(h){a._events.push(h._clone())}),this._enableBlending=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.enableBlending:this._animation.enableBlending}return Object.defineProperty(n.prototype,"currentFrame",{get:function(){return this._currentFrame},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"weight",{get:function(){return this._weight},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetPath",{get:function(){return this._targetPath},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"target",{get:function(){return this._currentActiveTarget},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isAdditive",{get:function(){return this._host&&this._host.isAdditive},enumerable:!1,configurable:!0}),n.prototype._preparePath=function(e,t){t===void 0&&(t=0);var i=this._animation.targetPropertyPath;if(i.length>1){for(var r=e[i[0]],a=1;a<i.length-1;a++)r=r[i[a]];this._targetPath=i[i.length-1],this._activeTargets[t]=r}else this._targetPath=i[0],this._activeTargets[t]=e},Object.defineProperty(n.prototype,"animation",{get:function(){return this._animation},enumerable:!1,configurable:!0}),n.prototype.reset=function(e){if(e===void 0&&(e=!1),e)if(this._target instanceof Array)for(var t=0,i=0,r=this._target;i<r.length;i++){var a=r[i];this._originalValue[t]!==void 0&&this._setValue(a,this._activeTargets[t],this._originalValue[t],-1,t),t++}else this._originalValue[0]!==void 0&&this._setValue(this._target,this._directTarget,this._originalValue[0],-1,0);this._offsetsCache={},this._highLimitsCache={},this._currentFrame=0,this._blendingFactor=0;for(var t=0;t<this._events.length;t++)this._events[t].isDone=!1},n.prototype.isStopped=function(){return this._stopped},n.prototype.dispose=function(){var e=this._animation.runtimeAnimations.indexOf(this);e>-1&&this._animation.runtimeAnimations.splice(e,1)},n.prototype.setValue=function(e,t){if(this._targetIsArray){for(var i=0;i<this._target.length;i++){var r=this._target[i];this._setValue(r,this._activeTargets[i],e,t,i)}return}this._setValue(this._target,this._directTarget,e,t,0)},n.prototype._getOriginalValues=function(e){e===void 0&&(e=0);var t,i=this._activeTargets[e];i.getRestPose&&this._targetPath==="_matrix"?t=i.getRestPose():t=i[this._targetPath],t&&t.clone?this._originalValue[e]=t.clone():this._originalValue[e]=t},n.prototype._setValue=function(e,t,i,r,a){if(this._currentActiveTarget=t,this._weight=r,this._enableBlending&&this._blendingFactor<=1){if(!this._originalBlendValue){var o=t[this._targetPath];o.clone?this._originalBlendValue=o.clone():this._originalBlendValue=o}this._originalBlendValue.m?he.AllowMatrixDecomposeForInterpolation?this._currentValue?P.DecomposeLerpToRef(this._originalBlendValue,i,this._blendingFactor,this._currentValue):this._currentValue=P.DecomposeLerp(this._originalBlendValue,i,this._blendingFactor):this._currentValue?P.LerpToRef(this._originalBlendValue,i,this._blendingFactor,this._currentValue):this._currentValue=P.Lerp(this._originalBlendValue,i,this._blendingFactor):this._currentValue=he._UniversalLerp(this._originalBlendValue,i,this._blendingFactor);var s=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.blendingSpeed:this._animation.blendingSpeed;this._blendingFactor+=s}else this._currentValue=i;r!==-1?this._scene._registerTargetForLateAnimationBinding(this,this._originalValue[a]):t[this._targetPath]=this._currentValue,e.markAsDirty&&e.markAsDirty(this._animation.targetProperty)},n.prototype._getCorrectLoopMode=function(){return this._target&&this._target.animationPropertiesOverride?this._target.animationPropertiesOverride.loopMode:this._animation.loopMode},n.prototype.goToFrame=function(e){var t=this._animation.getKeys();e<t[0].frame?e=t[0].frame:e>t[t.length-1].frame&&(e=t[t.length-1].frame);var i=this._events;if(i.length)for(var r=0;r<i.length;r++)i[r].onlyOnce||(i[r].isDone=i[r].frame<e);this._currentFrame=e;var a=this._animation._interpolate(e,this._animationState);this.setValue(a,-1)},n.prototype._prepareForSpeedRatioChange=function(e){var t=this._previousDelay*(this._animation.framePerSecond*e)/1e3;this._ratioOffset=this._previousRatio-t},n.prototype.animate=function(e,t,i,r,a,o){o===void 0&&(o=-1);var s=this._animation,l=s.targetPropertyPath;if(!l||l.length<1)return this._stopped=!0,!1;var f=!0;(t<this._minFrame||t>this._maxFrame)&&(t=this._minFrame),(i<this._minFrame||i>this._maxFrame)&&(i=this._maxFrame);var u=i-t,c,h=e*(s.framePerSecond*a)/1e3+this._ratioOffset,p=0;if(this._previousDelay=e,this._previousRatio=h,!r&&i>=t&&h>=u)f=!1,p=s._getKeyValue(this._maxValue);else if(!r&&t>=i&&h<=u)f=!1,p=s._getKeyValue(this._minValue);else if(this._animationState.loopMode!==he.ANIMATIONLOOPMODE_CYCLE){var d=i.toString()+t.toString();if(!this._offsetsCache[d]){this._animationState.repeatCount=0,this._animationState.loopMode=he.ANIMATIONLOOPMODE_CYCLE;var _=s._interpolate(t,this._animationState),v=s._interpolate(i,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),s.dataType){case he.ANIMATIONTYPE_FLOAT:this._offsetsCache[d]=v-_;break;case he.ANIMATIONTYPE_QUATERNION:this._offsetsCache[d]=v.subtract(_);break;case he.ANIMATIONTYPE_VECTOR3:this._offsetsCache[d]=v.subtract(_);case he.ANIMATIONTYPE_VECTOR2:this._offsetsCache[d]=v.subtract(_);case he.ANIMATIONTYPE_SIZE:this._offsetsCache[d]=v.subtract(_);case he.ANIMATIONTYPE_COLOR3:this._offsetsCache[d]=v.subtract(_)}this._highLimitsCache[d]=v}p=this._highLimitsCache[d],c=this._offsetsCache[d]}if(c===void 0)switch(s.dataType){case he.ANIMATIONTYPE_FLOAT:c=0;break;case he.ANIMATIONTYPE_QUATERNION:c=Tr;break;case he.ANIMATIONTYPE_VECTOR3:c=Ar;break;case he.ANIMATIONTYPE_VECTOR2:c=Rr;break;case he.ANIMATIONTYPE_SIZE:c=br;break;case he.ANIMATIONTYPE_COLOR3:c=Sr}var E;if(this._host&&this._host.syncRoot){var y=this._host.syncRoot,R=(y.masterFrame-y.fromFrame)/(y.toFrame-y.fromFrame);E=t+(i-t)*R}else E=f&&u!==0?t+h%u:i;var S=this._events;if((u>0&&this.currentFrame>E||u<0&&this.currentFrame<E)&&(this._onLoop(),S.length))for(var M=0;M<S.length;M++)S[M].onlyOnce||(S[M].isDone=!1);this._currentFrame=E,this._animationState.repeatCount=u===0?0:h/u>>0,this._animationState.highLimitValue=p,this._animationState.offsetValue=c;var C=s._interpolate(E,this._animationState);if(this.setValue(C,o),S.length){for(var M=0;M<S.length;M++)if(u>0&&E>=S[M].frame&&S[M].frame>=t||u<0&&E<=S[M].frame&&S[M].frame<=t){var b=S[M];b.isDone||(b.onlyOnce&&(S.splice(M,1),M--),b.isDone=!0,b.action(E))}}return f||(this._stopped=!0),f},n}(),ge=function(){function n(){}return n.IsWindowObjectExist=function(){return typeof window<"u"},n.IsNavigatorAvailable=function(){return typeof navigator<"u"},n.IsDocumentAvailable=function(){return typeof document<"u"},n.GetDOMTextContent=function(e){for(var t="",i=e.firstChild;i;)i.nodeType===3&&(t+=i.textContent),i=i.nextSibling;return t},n}(),ht=function(){function n(){}return Object.defineProperty(n,"Now",{get:function(){return ge.IsWindowObjectExist()&&window.performance&&window.performance.now?window.performance.now():Date.now()},enumerable:!1,configurable:!0}),n}(),Pt=function(){function n(){}return n.FilesToLoad={},n}(),Mr=function(){function n(){}return n.ExponentialBackoff=function(e,t){return e===void 0&&(e=3),t===void 0&&(t=500),function(i,r,a){return r.status!==0||a>=e||i.indexOf("file:")!==-1?-1:Math.pow(2,a)*t}},n}(),Et=function(n){j(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e._setPrototypeOf=Object.setPrototypeOf||function(t,i){return t.__proto__=i,t},e}(Error),Ot=function(){function n(){this.children=[]}return n.prototype.isValid=function(e){return!0},n.prototype.process=function(e,t){var i="";if(this.line){var r=this.line,a=t.processor;if(a){if(a.lineProcessor&&(r=a.lineProcessor(r,t.isFragment)),a.attributeProcessor&&Fe.StartsWith(this.line,"attribute"))r=a.attributeProcessor(this.line);else if(a.varyingProcessor&&Fe.StartsWith(this.line,"varying"))r=a.varyingProcessor(this.line,t.isFragment);else if((a.uniformProcessor||a.uniformBufferProcessor)&&Fe.StartsWith(this.line,"uniform")){var o=/uniform (.+) (.+)/;o.test(this.line)?a.uniformProcessor&&(r=a.uniformProcessor(this.line,t.isFragment)):a.uniformBufferProcessor&&(r=a.uniformBufferProcessor(this.line,t.isFragment),t.lookForClosingBracketForUniformBuffer=!0)}a.endOfUniformBufferProcessor&&t.lookForClosingBracketForUniformBuffer&&this.line.indexOf("}")!==-1&&(t.lookForClosingBracketForUniformBuffer=!1,r=a.endOfUniformBufferProcessor(this.line,t.isFragment))}i+=r+`\r
|
|
1
|
+
import{hP as g,hO as j,hQ as tt}from"./index-CtlR5vLP.js";var mi=function(){function n(){this.rootNodes=new Array,this.cameras=new Array,this.lights=new Array,this.meshes=new Array,this.skeletons=new Array,this.particleSystems=new Array,this.animations=[],this.animationGroups=new Array,this.multiMaterials=new Array,this.materials=new Array,this.morphTargetManagers=new Array,this.geometries=new Array,this.transformNodes=new Array,this.actionManagers=new Array,this.textures=new Array,this._environmentTexture=null,this.postProcesses=new Array}return n.AddParser=function(e,t){this._BabylonFileParsers[e]=t},n.GetParser=function(e){return this._BabylonFileParsers[e]?this._BabylonFileParsers[e]:null},n.AddIndividualParser=function(e,t){this._IndividualBabylonFileParsers[e]=t},n.GetIndividualParser=function(e){return this._IndividualBabylonFileParsers[e]?this._IndividualBabylonFileParsers[e]:null},n.Parse=function(e,t,i,r){for(var a in this._BabylonFileParsers)this._BabylonFileParsers.hasOwnProperty(a)&&this._BabylonFileParsers[a](e,t,i,r)},Object.defineProperty(n.prototype,"environmentTexture",{get:function(){return this._environmentTexture},set:function(e){this._environmentTexture=e},enumerable:!1,configurable:!0}),n.prototype.getNodes=function(){var e=new Array;return e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes),this.skeletons.forEach(function(t){return e=e.concat(t.bones)}),e},n._BabylonFileParsers={},n._IndividualBabylonFileParsers={},n}(),Rt=function(){function n(){this.hoverCursor="",this.actions=new Array,this.isRecursive=!1}return Object.defineProperty(n,"HasTriggers",{get:function(){for(var e in n.Triggers)if(n.Triggers.hasOwnProperty(e))return!0;return!1},enumerable:!1,configurable:!0}),Object.defineProperty(n,"HasPickTriggers",{get:function(){for(var e in n.Triggers)if(n.Triggers.hasOwnProperty(e)){var t=parseInt(e);if(t>=1&&t<=7)return!0}return!1},enumerable:!1,configurable:!0}),n.HasSpecificTrigger=function(e){for(var t in n.Triggers)if(n.Triggers.hasOwnProperty(t)){var i=parseInt(t);if(i===e)return!0}return!1},n.Triggers={},n}(),lr=function(){function n(e,t,i,r){t===void 0&&(t=!1),this.initalize(e,t,i,r)}return n.prototype.initalize=function(e,t,i,r){return t===void 0&&(t=!1),this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=r,this},n}(),fr=function(){function n(e,t,i){i===void 0&&(i=null),this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1}return n}(),Ys=function(){function n(){}return n.prototype.dispose=function(){if(this._observers&&this._observables)for(var e=0;e<this._observers.length;e++)this._observables[e].remove(this._observers[e]);this._observers=null,this._observables=null},n.Watch=function(e,t,i,r){i===void 0&&(i=-1),r===void 0&&(r=null);var a=new n;a._observers=new Array,a._observables=e;for(var o=0,s=e;o<s.length;o++){var l=s[o],f=l.add(t,i,!1,r);f&&a._observers.push(f)}return a},n}(),O=function(){function n(e){this._observers=new Array,this._eventState=new lr(0),e&&(this._onObserverAdded=e)}return Object.defineProperty(n.prototype,"observers",{get:function(){return this._observers},enumerable:!1,configurable:!0}),n.prototype.add=function(e,t,i,r,a){if(t===void 0&&(t=-1),i===void 0&&(i=!1),r===void 0&&(r=null),a===void 0&&(a=!1),!e)return null;var o=new fr(e,t,r);return o.unregisterOnNextCall=a,i?this._observers.unshift(o):this._observers.push(o),this._onObserverAdded&&this._onObserverAdded(o),o},n.prototype.addOnce=function(e){return this.add(e,void 0,void 0,void 0,!0)},n.prototype.remove=function(e){if(!e)return!1;var t=this._observers.indexOf(e);return t!==-1?(this._deferUnregister(e),!0):!1},n.prototype.removeCallback=function(e,t){for(var i=0;i<this._observers.length;i++){var r=this._observers[i];if(!r._willBeUnregistered&&r.callback===e&&(!t||t===r.scope))return this._deferUnregister(r),!0}return!1},n.prototype._deferUnregister=function(e){var t=this;e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(function(){t._remove(e)},0)},n.prototype._remove=function(e){if(!e)return!1;var t=this._observers.indexOf(e);return t!==-1?(this._observers.splice(t,1),!0):!1},n.prototype.makeObserverTopPriority=function(e){this._remove(e),this._observers.unshift(e)},n.prototype.makeObserverBottomPriority=function(e){this._remove(e),this._observers.push(e)},n.prototype.notifyObservers=function(e,t,i,r,a){if(t===void 0&&(t=-1),!this._observers.length)return!0;var o=this._eventState;o.mask=t,o.target=i,o.currentTarget=r,o.skipNextObservers=!1,o.lastReturnValue=e,o.userInfo=a;for(var s=0,l=this._observers;s<l.length;s++){var f=l[s];if(!f._willBeUnregistered&&(f.mask&t&&(f.scope?o.lastReturnValue=f.callback.apply(f.scope,[e,o]):o.lastReturnValue=f.callback(e,o),f.unregisterOnNextCall&&this._deferUnregister(f)),o.skipNextObservers))return!1}return!0},n.prototype.notifyObserversWithPromise=function(e,t,i,r,a){var o=this;t===void 0&&(t=-1);var s=Promise.resolve(e);if(!this._observers.length)return s;var l=this._eventState;return l.mask=t,l.target=i,l.currentTarget=r,l.skipNextObservers=!1,l.userInfo=a,this._observers.forEach(function(f){l.skipNextObservers||f._willBeUnregistered||f.mask&t&&(f.scope?s=s.then(function(u){return l.lastReturnValue=u,f.callback.apply(f.scope,[e,l])}):s=s.then(function(u){return l.lastReturnValue=u,f.callback(e,l)}),f.unregisterOnNextCall&&o._deferUnregister(f))}),s.then(function(){return e})},n.prototype.notifyObserver=function(e,t,i){i===void 0&&(i=-1);var r=this._eventState;r.mask=i,r.skipNextObservers=!1,e.callback(t,r)},n.prototype.hasObservers=function(){return this._observers.length>0},n.prototype.clear=function(){this._observers=new Array,this._onObserverAdded=null},n.prototype.clone=function(){var e=new n;return e._observers=this._observers.slice(0),e},n.prototype.hasSpecificMask=function(e){e===void 0&&(e=-1);for(var t=0,i=this._observers;t<i.length;t++){var r=i[t];if(r.mask&e||r.mask===e)return!0}return!1},n}(),K=function(){function n(){}return n.WithinEpsilon=function(e,t,i){i===void 0&&(i=1401298e-51);var r=e-t;return-i<=r&&r<=i},n.ToHex=function(e){var t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()},n.Sign=function(e){return e=+e,e===0||isNaN(e)?e:e>0?1:-1},n.Clamp=function(e,t,i){return t===void 0&&(t=0),i===void 0&&(i=1),Math.min(i,Math.max(t,e))},n.Log2=function(e){return Math.log(e)*Math.LOG2E},n.Repeat=function(e,t){return e-Math.floor(e/t)*t},n.Normalize=function(e,t,i){return(e-t)/(i-t)},n.Denormalize=function(e,t,i){return e*(i-t)+t},n.DeltaAngle=function(e,t){var i=n.Repeat(t-e,360);return i>180&&(i-=360),i},n.PingPong=function(e,t){var i=n.Repeat(e,t*2);return t-Math.abs(i-t)},n.SmoothStep=function(e,t,i){var r=n.Clamp(i);return r=-2*r*r*r+3*r*r,t*r+e*(1-r)},n.MoveTowards=function(e,t,i){var r=0;return Math.abs(t-e)<=i?r=t:r=e+n.Sign(t-e)*i,r},n.MoveTowardsAngle=function(e,t,i){var r=n.DeltaAngle(e,t),a=0;return-i<r&&r<i?a=t:(t=e+r,a=n.MoveTowards(e,t,i)),a},n.Lerp=function(e,t,i){return e+(t-e)*i},n.LerpAngle=function(e,t,i){var r=n.Repeat(t-e,360);return r>180&&(r-=360),e+r*n.Clamp(i)},n.InverseLerp=function(e,t,i){var r=0;return e!=t?r=n.Clamp((i-e)/(t-e)):r=0,r},n.Hermite=function(e,t,i,r,a){var o=a*a,s=a*o,l=2*s-3*o+1,f=-2*s+3*o,u=s-2*o+a,c=s-o;return e*l+i*f+t*u+r*c},n.RandomRange=function(e,t){return e===t?e:Math.random()*(t-e)+e},n.RangeToPercent=function(e,t,i){return(e-t)/(i-t)},n.PercentToRange=function(e,t,i){return(i-t)*e+t},n.NormalizeRadians=function(e){return e-=n.TwoPi*Math.floor((e+Math.PI)/n.TwoPi),e},n.TwoPi=Math.PI*2,n}(),gt=1/2.2,it=2.2,Ce=.001,be=function(){function n(){}return n.BuildArray=function(e,t){for(var i=[],r=0;r<e;++r)i.push(t());return i},n}(),de=function(){function n(){}return n.GetClass=function(e){return this.RegisteredTypes&&this.RegisteredTypes[e]?this.RegisteredTypes[e]:null},n.RegisteredTypes={},n}(),ut=function(){function n(){}return n.SetMatrixPrecision=function(e){if(n.MatrixTrackPrecisionChange=!1,e&&!n.MatrixUse64Bits&&n.MatrixTrackedMatrices)for(var t=0;t<n.MatrixTrackedMatrices.length;++t){var i=n.MatrixTrackedMatrices[t],r=i._m;i._m=new Array(16);for(var a=0;a<16;++a)i._m[a]=r[a]}n.MatrixUse64Bits=e,n.MatrixCurrentType=n.MatrixUse64Bits?Array:Float32Array,n.MatrixTrackedMatrices=null},n.MatrixUse64Bits=!1,n.MatrixTrackPrecisionChange=!0,n.MatrixCurrentType=Float32Array,n.MatrixTrackedMatrices=[],n}(),ce=function(){function n(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this.x=e,this.y=t}return n.prototype.toString=function(){return"{X: "+this.x+" Y: "+this.y+"}"},n.prototype.getClassName=function(){return"Vector2"},n.prototype.getHashCode=function(){var e=this.x|0;return e=e*397^(this.y|0),e},n.prototype.toArray=function(e,t){return t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,this},n.prototype.fromArray=function(e,t){return t===void 0&&(t=0),n.FromArrayToRef(e,t,this),this},n.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},n.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this},n.prototype.copyFromFloats=function(e,t){return this.x=e,this.y=t,this},n.prototype.set=function(e,t){return this.copyFromFloats(e,t)},n.prototype.add=function(e){return new n(this.x+e.x,this.y+e.y)},n.prototype.addToRef=function(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,this},n.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this},n.prototype.addVector3=function(e){return new n(this.x+e.x,this.y+e.y)},n.prototype.subtract=function(e){return new n(this.x-e.x,this.y-e.y)},n.prototype.subtractToRef=function(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,this},n.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this},n.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this},n.prototype.multiply=function(e){return new n(this.x*e.x,this.y*e.y)},n.prototype.multiplyToRef=function(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,this},n.prototype.multiplyByFloats=function(e,t){return new n(this.x*e,this.y*t)},n.prototype.divide=function(e){return new n(this.x/e.x,this.y/e.y)},n.prototype.divideToRef=function(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,this},n.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},n.prototype.negate=function(){return new n(-this.x,-this.y)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this},n.prototype.negateToRef=function(e){return e.copyFromFloats(this.x*-1,this.y*-1)},n.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this},n.prototype.scale=function(e){var t=new n(0,0);return this.scaleToRef(e,t),t},n.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,this},n.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,this},n.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y},n.prototype.equalsWithEpsilon=function(e,t){return t===void 0&&(t=Ce),e&&K.WithinEpsilon(this.x,e.x,t)&&K.WithinEpsilon(this.y,e.y,t)},n.prototype.floor=function(){return new n(Math.floor(this.x),Math.floor(this.y))},n.prototype.fract=function(){return new n(this.x-Math.floor(this.x),this.y-Math.floor(this.y))},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},n.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},n.prototype.normalize=function(){var e=this.length();return e===0?this:(this.x/=e,this.y/=e,this)},n.prototype.clone=function(){return new n(this.x,this.y)},n.Zero=function(){return new n(0,0)},n.One=function(){return new n(1,1)},n.FromArray=function(e,t){return t===void 0&&(t=0),new n(e[t],e[t+1])},n.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1]},n.CatmullRom=function(e,t,i,r,a){var o=a*a,s=a*o,l=.5*(2*t.x+(-e.x+i.x)*a+(2*e.x-5*t.x+4*i.x-r.x)*o+(-e.x+3*t.x-3*i.x+r.x)*s),f=.5*(2*t.y+(-e.y+i.y)*a+(2*e.y-5*t.y+4*i.y-r.y)*o+(-e.y+3*t.y-3*i.y+r.y)*s);return new n(l,f)},n.Clamp=function(e,t,i){var r=e.x;r=r>i.x?i.x:r,r=r<t.x?t.x:r;var a=e.y;return a=a>i.y?i.y:a,a=a<t.y?t.y:a,new n(r,a)},n.Hermite=function(e,t,i,r,a){var o=a*a,s=a*o,l=2*s-3*o+1,f=-2*s+3*o,u=s-2*o+a,c=s-o,h=e.x*l+i.x*f+t.x*u+r.x*c,p=e.y*l+i.y*f+t.y*u+r.y*c;return new n(h,p)},n.Lerp=function(e,t,i){var r=e.x+(t.x-e.x)*i,a=e.y+(t.y-e.y)*i;return new n(r,a)},n.Dot=function(e,t){return e.x*t.x+e.y*t.y},n.Normalize=function(e){var t=e.clone();return t.normalize(),t},n.Minimize=function(e,t){var i=e.x<t.x?e.x:t.x,r=e.y<t.y?e.y:t.y;return new n(i,r)},n.Maximize=function(e,t){var i=e.x>t.x?e.x:t.x,r=e.y>t.y?e.y:t.y;return new n(i,r)},n.Transform=function(e,t){var i=n.Zero();return n.TransformToRef(e,t,i),i},n.TransformToRef=function(e,t,i){var r=t.m,a=e.x*r[0]+e.y*r[4]+r[12],o=e.x*r[1]+e.y*r[5]+r[13];i.x=a,i.y=o},n.PointInTriangle=function(e,t,i,r){var a=.5*(-i.y*r.x+t.y*(-i.x+r.x)+t.x*(i.y-r.y)+i.x*r.y),o=a<0?-1:1,s=(t.y*r.x-t.x*r.y+(r.y-t.y)*e.x+(t.x-r.x)*e.y)*o,l=(t.x*i.y-t.y*i.x+(t.y-i.y)*e.x+(i.x-t.x)*e.y)*o;return s>0&&l>0&&s+l<2*a*o},n.Distance=function(e,t){return Math.sqrt(n.DistanceSquared(e,t))},n.DistanceSquared=function(e,t){var i=e.x-t.x,r=e.y-t.y;return i*i+r*r},n.Center=function(e,t){var i=e.add(t);return i.scaleInPlace(.5),i},n.DistanceOfPointFromSegment=function(e,t,i){var r=n.DistanceSquared(t,i);if(r===0)return n.Distance(e,t);var a=i.subtract(t),o=Math.max(0,Math.min(1,n.Dot(e.subtract(t),a)/r)),s=t.add(a.multiplyByFloats(o,o));return n.Distance(e,s)},n}(),m=function(){function n(e,t,i){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),this._isDirty=!0,this._x=e,this._y=t,this._z=i}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"z",{get:function(){return this._z},set:function(e){this._z=e,this._isDirty=!0},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+"}"},n.prototype.getClassName=function(){return"Vector3"},n.prototype.getHashCode=function(){var e=this._x|0;return e=e*397^(this._y|0),e=e*397^(this._z|0),e},n.prototype.asArray=function(){var e=[];return this.toArray(e,0),e},n.prototype.toArray=function(e,t){return t===void 0&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this},n.prototype.fromArray=function(e,t){return t===void 0&&(t=0),n.FromArrayToRef(e,t,this),this},n.prototype.toQuaternion=function(){return W.RotationYawPitchRoll(this._y,this._x,this._z)},n.prototype.addInPlace=function(e){return this.addInPlaceFromFloats(e._x,e._y,e._z)},n.prototype.addInPlaceFromFloats=function(e,t,i){return this.x+=e,this.y+=t,this.z+=i,this},n.prototype.add=function(e){return new n(this._x+e._x,this._y+e._y,this._z+e._z)},n.prototype.addToRef=function(e,t){return t.copyFromFloats(this._x+e._x,this._y+e._y,this._z+e._z)},n.prototype.subtractInPlace=function(e){return this.x-=e._x,this.y-=e._y,this.z-=e._z,this},n.prototype.subtract=function(e){return new n(this._x-e._x,this._y-e._y,this._z-e._z)},n.prototype.subtractToRef=function(e,t){return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)},n.prototype.subtractFromFloats=function(e,t,i){return new n(this._x-e,this._y-t,this._z-i)},n.prototype.subtractFromFloatsToRef=function(e,t,i,r){return r.copyFromFloats(this._x-e,this._y-t,this._z-i)},n.prototype.negate=function(){return new n(-this._x,-this._y,-this._z)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},n.prototype.negateToRef=function(e){return e.copyFromFloats(this._x*-1,this._y*-1,this._z*-1)},n.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this},n.prototype.scale=function(e){return new n(this._x*e,this._y*e,this._z*e)},n.prototype.scaleToRef=function(e,t){return t.copyFromFloats(this._x*e,this._y*e,this._z*e)},n.prototype.scaleAndAddToRef=function(e,t){return t.addInPlaceFromFloats(this._x*e,this._y*e,this._z*e)},n.prototype.projectOnPlane=function(e,t){var i=n.Zero();return this.projectOnPlaneToRef(e,t,i),i},n.prototype.projectOnPlaneToRef=function(e,t,i){var r=e.normal,a=e.d,o=$.Vector3[0];this.subtractToRef(t,o),o.normalize();var s=n.Dot(o,r),l=-(n.Dot(t,r)+a)/s,f=o.scaleInPlace(l);t.addToRef(f,i)},n.prototype.equals=function(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z},n.prototype.equalsWithEpsilon=function(e,t){return t===void 0&&(t=Ce),e&&K.WithinEpsilon(this._x,e._x,t)&&K.WithinEpsilon(this._y,e._y,t)&&K.WithinEpsilon(this._z,e._z,t)},n.prototype.equalsToFloats=function(e,t,i){return this._x===e&&this._y===t&&this._z===i},n.prototype.multiplyInPlace=function(e){return this.x*=e._x,this.y*=e._y,this.z*=e._z,this},n.prototype.multiply=function(e){return this.multiplyByFloats(e._x,e._y,e._z)},n.prototype.multiplyToRef=function(e,t){return t.copyFromFloats(this._x*e._x,this._y*e._y,this._z*e._z)},n.prototype.multiplyByFloats=function(e,t,i){return new n(this._x*e,this._y*t,this._z*i)},n.prototype.divide=function(e){return new n(this._x/e._x,this._y/e._y,this._z/e._z)},n.prototype.divideToRef=function(e,t){return t.copyFromFloats(this._x/e._x,this._y/e._y,this._z/e._z)},n.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},n.prototype.minimizeInPlace=function(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)},n.prototype.maximizeInPlace=function(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)},n.prototype.minimizeInPlaceFromFloats=function(e,t,i){return e<this._x&&(this.x=e),t<this._y&&(this.y=t),i<this._z&&(this.z=i),this},n.prototype.maximizeInPlaceFromFloats=function(e,t,i){return e>this._x&&(this.x=e),t>this._y&&(this.y=t),i>this._z&&(this.z=i),this},n.prototype.isNonUniformWithinEpsilon=function(e){var t=Math.abs(this._x),i=Math.abs(this._y);if(!K.WithinEpsilon(t,i,e))return!0;var r=Math.abs(this._z);return!K.WithinEpsilon(t,r,e)||!K.WithinEpsilon(i,r,e)},Object.defineProperty(n.prototype,"isNonUniform",{get:function(){var e=Math.abs(this._x),t=Math.abs(this._y);if(e!==t)return!0;var i=Math.abs(this._z);return e!==i},enumerable:!1,configurable:!0}),n.prototype.floor=function(){return new n(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))},n.prototype.fract=function(){return new n(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))},n.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)},n.prototype.lengthSquared=function(){return this._x*this._x+this._y*this._y+this._z*this._z},n.prototype.normalize=function(){return this.normalizeFromLength(this.length())},n.prototype.reorderInPlace=function(e){var t=this;return e=e.toLowerCase(),e==="xyz"?this:($.Vector3[0].copyFrom(this),["x","y","z"].forEach(function(i,r){t[i]=$.Vector3[0][e[r]]}),this)},n.prototype.rotateByQuaternionToRef=function(e,t){return e.toRotationMatrix($.Matrix[0]),n.TransformCoordinatesToRef(this,$.Matrix[0],t),t},n.prototype.rotateByQuaternionAroundPointToRef=function(e,t,i){return this.subtractToRef(t,$.Vector3[0]),$.Vector3[0].rotateByQuaternionToRef(e,$.Vector3[0]),t.addToRef($.Vector3[0],i),i},n.prototype.cross=function(e){return n.Cross(this,e)},n.prototype.normalizeFromLength=function(e){return e===0||e===1?this:this.scaleInPlace(1/e)},n.prototype.normalizeToNew=function(){var e=new n(0,0,0);return this.normalizeToRef(e),e},n.prototype.normalizeToRef=function(e){var t=this.length();return t===0||t===1?e.copyFromFloats(this._x,this._y,this._z):this.scaleToRef(1/t,e)},n.prototype.clone=function(){return new n(this._x,this._y,this._z)},n.prototype.copyFrom=function(e){return this.copyFromFloats(e._x,e._y,e._z)},n.prototype.copyFromFloats=function(e,t,i){return this.x=e,this.y=t,this.z=i,this},n.prototype.set=function(e,t,i){return this.copyFromFloats(e,t,i)},n.prototype.setAll=function(e){return this.x=this.y=this.z=e,this},n.GetClipFactor=function(e,t,i,r){var a=n.Dot(e,i)-r,o=n.Dot(t,i)-r,s=a/(a-o);return s},n.GetAngleBetweenVectors=function(e,t,i){var r=e.normalizeToRef($.Vector3[1]),a=t.normalizeToRef($.Vector3[2]),o=n.Dot(r,a),s=$.Vector3[3];return n.CrossToRef(r,a,s),n.Dot(s,i)>0?Math.acos(o):-Math.acos(o)},n.FromArray=function(e,t){return t===void 0&&(t=0),new n(e[t],e[t+1],e[t+2])},n.FromFloatArray=function(e,t){return n.FromArray(e,t)},n.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1],i.z=e[t+2]},n.FromFloatArrayToRef=function(e,t,i){return n.FromArrayToRef(e,t,i)},n.FromFloatsToRef=function(e,t,i,r){r.copyFromFloats(e,t,i)},n.Zero=function(){return new n(0,0,0)},n.One=function(){return new n(1,1,1)},n.Up=function(){return new n(0,1,0)},Object.defineProperty(n,"UpReadOnly",{get:function(){return n._UpReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(n,"ZeroReadOnly",{get:function(){return n._ZeroReadOnly},enumerable:!1,configurable:!0}),n.Down=function(){return new n(0,-1,0)},n.Forward=function(e){return e===void 0&&(e=!1),new n(0,0,e?-1:1)},n.Backward=function(e){return e===void 0&&(e=!1),new n(0,0,e?1:-1)},n.Right=function(){return new n(1,0,0)},n.Left=function(){return new n(-1,0,0)},n.TransformCoordinates=function(e,t){var i=n.Zero();return n.TransformCoordinatesToRef(e,t,i),i},n.TransformCoordinatesToRef=function(e,t,i){n.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i)},n.TransformCoordinatesFromFloatsToRef=function(e,t,i,r,a){var o=r.m,s=e*o[0]+t*o[4]+i*o[8]+o[12],l=e*o[1]+t*o[5]+i*o[9]+o[13],f=e*o[2]+t*o[6]+i*o[10]+o[14],u=1/(e*o[3]+t*o[7]+i*o[11]+o[15]);a.x=s*u,a.y=l*u,a.z=f*u},n.TransformNormal=function(e,t){var i=n.Zero();return n.TransformNormalToRef(e,t,i),i},n.TransformNormalToRef=function(e,t,i){this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,i)},n.TransformNormalFromFloatsToRef=function(e,t,i,r,a){var o=r.m;a.x=e*o[0]+t*o[4]+i*o[8],a.y=e*o[1]+t*o[5]+i*o[9],a.z=e*o[2]+t*o[6]+i*o[10]},n.CatmullRom=function(e,t,i,r,a){var o=a*a,s=a*o,l=.5*(2*t._x+(-e._x+i._x)*a+(2*e._x-5*t._x+4*i._x-r._x)*o+(-e._x+3*t._x-3*i._x+r._x)*s),f=.5*(2*t._y+(-e._y+i._y)*a+(2*e._y-5*t._y+4*i._y-r._y)*o+(-e._y+3*t._y-3*i._y+r._y)*s),u=.5*(2*t._z+(-e._z+i._z)*a+(2*e._z-5*t._z+4*i._z-r._z)*o+(-e._z+3*t._z-3*i._z+r._z)*s);return new n(l,f,u)},n.Clamp=function(e,t,i){var r=new n;return n.ClampToRef(e,t,i,r),r},n.ClampToRef=function(e,t,i,r){var a=e._x;a=a>i._x?i._x:a,a=a<t._x?t._x:a;var o=e._y;o=o>i._y?i._y:o,o=o<t._y?t._y:o;var s=e._z;s=s>i._z?i._z:s,s=s<t._z?t._z:s,r.copyFromFloats(a,o,s)},n.CheckExtends=function(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)},n.Hermite=function(e,t,i,r,a){var o=a*a,s=a*o,l=2*s-3*o+1,f=-2*s+3*o,u=s-2*o+a,c=s-o,h=e._x*l+i._x*f+t._x*u+r._x*c,p=e._y*l+i._y*f+t._y*u+r._y*c,d=e._z*l+i._z*f+t._z*u+r._z*c;return new n(h,p,d)},n.Lerp=function(e,t,i){var r=new n(0,0,0);return n.LerpToRef(e,t,i,r),r},n.LerpToRef=function(e,t,i,r){r.x=e._x+(t._x-e._x)*i,r.y=e._y+(t._y-e._y)*i,r.z=e._z+(t._z-e._z)*i},n.Dot=function(e,t){return e._x*t._x+e._y*t._y+e._z*t._z},n.Cross=function(e,t){var i=n.Zero();return n.CrossToRef(e,t,i),i},n.CrossToRef=function(e,t,i){var r=e._y*t._z-e._z*t._y,a=e._z*t._x-e._x*t._z,o=e._x*t._y-e._y*t._x;i.copyFromFloats(r,a,o)},n.Normalize=function(e){var t=n.Zero();return n.NormalizeToRef(e,t),t},n.NormalizeToRef=function(e,t){e.normalizeToRef(t)},n.Project=function(e,t,i,r){var a=new n;return n.ProjectToRef(e,t,i,r,a),a},n.ProjectToRef=function(e,t,i,r,a){var o=r.width,s=r.height,l=r.x,f=r.y,u=$.Matrix[1];P.FromValuesToRef(o/2,0,0,0,0,-s/2,0,0,0,0,.5,0,l+o/2,s/2+f,.5,1,u);var c=$.Matrix[0];return t.multiplyToRef(i,c),c.multiplyToRef(u,c),n.TransformCoordinatesToRef(e,c,a),a},n._UnprojectFromInvertedMatrixToRef=function(e,t,i){n.TransformCoordinatesToRef(e,t,i);var r=t.m,a=e._x*r[3]+e._y*r[7]+e._z*r[11]+r[15];K.WithinEpsilon(a,1)&&i.scaleInPlace(1/a)},n.UnprojectFromTransform=function(e,t,i,r,a){var o=$.Matrix[0];r.multiplyToRef(a,o),o.invert(),e.x=e._x/t*2-1,e.y=-(e._y/i*2-1);var s=new n;return n._UnprojectFromInvertedMatrixToRef(e,o,s),s},n.Unproject=function(e,t,i,r,a,o){var s=n.Zero();return n.UnprojectToRef(e,t,i,r,a,o,s),s},n.UnprojectToRef=function(e,t,i,r,a,o,s){n.UnprojectFloatsToRef(e._x,e._y,e._z,t,i,r,a,o,s)},n.UnprojectFloatsToRef=function(e,t,i,r,a,o,s,l,f){var u=$.Matrix[0];o.multiplyToRef(s,u),u.multiplyToRef(l,u),u.invert();var c=$.Vector3[0];c.x=e/r*2-1,c.y=-(t/a*2-1),c.z=2*i-1,n._UnprojectFromInvertedMatrixToRef(c,u,f)},n.Minimize=function(e,t){var i=e.clone();return i.minimizeInPlace(t),i},n.Maximize=function(e,t){var i=e.clone();return i.maximizeInPlace(t),i},n.Distance=function(e,t){return Math.sqrt(n.DistanceSquared(e,t))},n.DistanceSquared=function(e,t){var i=e._x-t._x,r=e._y-t._y,a=e._z-t._z;return i*i+r*r+a*a},n.Center=function(e,t){var i=e.add(t);return i.scaleInPlace(.5),i},n.RotationFromAxis=function(e,t,i){var r=n.Zero();return n.RotationFromAxisToRef(e,t,i,r),r},n.RotationFromAxisToRef=function(e,t,i,r){var a=$.Quaternion[0];W.RotationQuaternionFromAxisToRef(e,t,i,a),a.toEulerAnglesToRef(r)},n._UpReadOnly=n.Up(),n._ZeroReadOnly=n.Zero(),n}(),Ve=function(){function n(e,t,i,r){this.x=e,this.y=t,this.z=i,this.w=r}return n.prototype.toString=function(){return"{X: "+this.x+" Y:"+this.y+" Z:"+this.z+" W:"+this.w+"}"},n.prototype.getClassName=function(){return"Vector4"},n.prototype.getHashCode=function(){var e=this.x|0;return e=e*397^(this.y|0),e=e*397^(this.z|0),e=e*397^(this.w|0),e},n.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},n.prototype.toArray=function(e,t){return t===void 0&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,this},n.prototype.fromArray=function(e,t){return t===void 0&&(t=0),n.FromArrayToRef(e,t,this),this},n.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},n.prototype.add=function(e){return new n(this.x+e.x,this.y+e.y,this.z+e.z,this.w+e.w)},n.prototype.addToRef=function(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,t.z=this.z+e.z,t.w=this.w+e.w,this},n.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},n.prototype.subtract=function(e){return new n(this.x-e.x,this.y-e.y,this.z-e.z,this.w-e.w)},n.prototype.subtractToRef=function(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,t.z=this.z-e.z,t.w=this.w-e.w,this},n.prototype.subtractFromFloats=function(e,t,i,r){return new n(this.x-e,this.y-t,this.z-i,this.w-r)},n.prototype.subtractFromFloatsToRef=function(e,t,i,r,a){return a.x=this.x-e,a.y=this.y-t,a.z=this.z-i,a.w=this.w-r,this},n.prototype.negate=function(){return new n(-this.x,-this.y,-this.z,-this.w)},n.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this},n.prototype.negateToRef=function(e){return e.copyFromFloats(this.x*-1,this.y*-1,this.z*-1,this.w*-1)},n.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},n.prototype.scale=function(e){return new n(this.x*e,this.y*e,this.z*e,this.w*e)},n.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,t.z=this.z*e,t.w=this.w*e,this},n.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,t.z+=this.z*e,t.w+=this.w*e,this},n.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},n.prototype.equalsWithEpsilon=function(e,t){return t===void 0&&(t=Ce),e&&K.WithinEpsilon(this.x,e.x,t)&&K.WithinEpsilon(this.y,e.y,t)&&K.WithinEpsilon(this.z,e.z,t)&&K.WithinEpsilon(this.w,e.w,t)},n.prototype.equalsToFloats=function(e,t,i,r){return this.x===e&&this.y===t&&this.z===i&&this.w===r},n.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},n.prototype.multiply=function(e){return new n(this.x*e.x,this.y*e.y,this.z*e.z,this.w*e.w)},n.prototype.multiplyToRef=function(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,t.z=this.z*e.z,t.w=this.w*e.w,this},n.prototype.multiplyByFloats=function(e,t,i,r){return new n(this.x*e,this.y*t,this.z*i,this.w*r)},n.prototype.divide=function(e){return new n(this.x/e.x,this.y/e.y,this.z/e.z,this.w/e.w)},n.prototype.divideToRef=function(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,t.z=this.z/e.z,t.w=this.w/e.w,this},n.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},n.prototype.minimizeInPlace=function(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},n.prototype.maximizeInPlace=function(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},n.prototype.floor=function(){return new n(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))},n.prototype.fract=function(){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))},n.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},n.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},n.prototype.normalize=function(){var e=this.length();return e===0?this:this.scaleInPlace(1/e)},n.prototype.toVector3=function(){return new m(this.x,this.y,this.z)},n.prototype.clone=function(){return new n(this.x,this.y,this.z,this.w)},n.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},n.prototype.copyFromFloats=function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},n.prototype.set=function(e,t,i,r){return this.copyFromFloats(e,t,i,r)},n.prototype.setAll=function(e){return this.x=this.y=this.z=this.w=e,this},n.FromArray=function(e,t){return t||(t=0),new n(e[t],e[t+1],e[t+2],e[t+3])},n.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3]},n.FromFloatArrayToRef=function(e,t,i){n.FromArrayToRef(e,t,i)},n.FromFloatsToRef=function(e,t,i,r,a){a.x=e,a.y=t,a.z=i,a.w=r},n.Zero=function(){return new n(0,0,0,0)},n.One=function(){return new n(1,1,1,1)},n.Normalize=function(e){var t=n.Zero();return n.NormalizeToRef(e,t),t},n.NormalizeToRef=function(e,t){t.copyFrom(e),t.normalize()},n.Minimize=function(e,t){var i=e.clone();return i.minimizeInPlace(t),i},n.Maximize=function(e,t){var i=e.clone();return i.maximizeInPlace(t),i},n.Distance=function(e,t){return Math.sqrt(n.DistanceSquared(e,t))},n.DistanceSquared=function(e,t){var i=e.x-t.x,r=e.y-t.y,a=e.z-t.z,o=e.w-t.w;return i*i+r*r+a*a+o*o},n.Center=function(e,t){var i=e.add(t);return i.scaleInPlace(.5),i},n.TransformNormal=function(e,t){var i=n.Zero();return n.TransformNormalToRef(e,t,i),i},n.TransformNormalToRef=function(e,t,i){var r=t.m,a=e.x*r[0]+e.y*r[4]+e.z*r[8],o=e.x*r[1]+e.y*r[5]+e.z*r[9],s=e.x*r[2]+e.y*r[6]+e.z*r[10];i.x=a,i.y=o,i.z=s,i.w=e.w},n.TransformNormalFromFloatsToRef=function(e,t,i,r,a,o){var s=a.m;o.x=e*s[0]+t*s[4]+i*s[8],o.y=e*s[1]+t*s[5]+i*s[9],o.z=e*s[2]+t*s[6]+i*s[10],o.w=r},n.FromVector3=function(e,t){return t===void 0&&(t=0),new n(e._x,e._y,e._z,t)},n}(),W=function(){function n(e,t,i,r){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),r===void 0&&(r=1),this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=r}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"z",{get:function(){return this._z},set:function(e){this._z=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"w",{get:function(){return this._w},set:function(e){this._w=e,this._isDirty=!0},enumerable:!1,configurable:!0}),n.prototype.toString=function(){return"{X: "+this._x+" Y:"+this._y+" Z:"+this._z+" W:"+this._w+"}"},n.prototype.getClassName=function(){return"Quaternion"},n.prototype.getHashCode=function(){var e=this._x|0;return e=e*397^(this._y|0),e=e*397^(this._z|0),e=e*397^(this._w|0),e},n.prototype.asArray=function(){return[this._x,this._y,this._z,this._w]},n.prototype.equals=function(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w},n.prototype.equalsWithEpsilon=function(e,t){return t===void 0&&(t=Ce),e&&K.WithinEpsilon(this._x,e._x,t)&&K.WithinEpsilon(this._y,e._y,t)&&K.WithinEpsilon(this._z,e._z,t)&&K.WithinEpsilon(this._w,e._w,t)},n.prototype.clone=function(){return new n(this._x,this._y,this._z,this._w)},n.prototype.copyFrom=function(e){return this.x=e._x,this.y=e._y,this.z=e._z,this.w=e._w,this},n.prototype.copyFromFloats=function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},n.prototype.set=function(e,t,i,r){return this.copyFromFloats(e,t,i,r)},n.prototype.add=function(e){return new n(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)},n.prototype.addInPlace=function(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this},n.prototype.subtract=function(e){return new n(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)},n.prototype.scale=function(e){return new n(this._x*e,this._y*e,this._z*e,this._w*e)},n.prototype.scaleToRef=function(e,t){return t.x=this._x*e,t.y=this._y*e,t.z=this._z*e,t.w=this._w*e,this},n.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},n.prototype.scaleAndAddToRef=function(e,t){return t.x+=this._x*e,t.y+=this._y*e,t.z+=this._z*e,t.w+=this._w*e,this},n.prototype.multiply=function(e){var t=new n(0,0,0,1);return this.multiplyToRef(e,t),t},n.prototype.multiplyToRef=function(e,t){var i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,r=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,a=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,o=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(i,r,a,o),this},n.prototype.multiplyInPlace=function(e){return this.multiplyToRef(e,this),this},n.prototype.conjugateToRef=function(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),this},n.prototype.conjugateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},n.prototype.conjugate=function(){var e=new n(-this._x,-this._y,-this._z,this._w);return e},n.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},n.prototype.normalize=function(){var e=this.length();if(e===0)return this;var t=1/e;return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},n.prototype.toEulerAngles=function(e){var t=m.Zero();return this.toEulerAnglesToRef(t),t},n.prototype.toEulerAnglesToRef=function(e){var t=this._z,i=this._x,r=this._y,a=this._w,o=a*a,s=t*t,l=i*i,f=r*r,u=r*t-i*a,c=.4999999;return u<-c?(e.y=2*Math.atan2(r,a),e.x=Math.PI/2,e.z=0):u>c?(e.y=2*Math.atan2(r,a),e.x=-Math.PI/2,e.z=0):(e.z=Math.atan2(2*(i*r+t*a),-s-l+f+o),e.x=Math.asin(-2*(t*r-i*a)),e.y=Math.atan2(2*(t*i+r*a),s-l-f+o)),this},n.prototype.toRotationMatrix=function(e){return P.FromQuaternionToRef(this,e),this},n.prototype.fromRotationMatrix=function(e){return n.FromRotationMatrixToRef(e,this),this},n.FromRotationMatrix=function(e){var t=new n;return n.FromRotationMatrixToRef(e,t),t},n.FromRotationMatrixToRef=function(e,t){var i=e.m,r=i[0],a=i[4],o=i[8],s=i[1],l=i[5],f=i[9],u=i[2],c=i[6],h=i[10],p=r+l+h,d;p>0?(d=.5/Math.sqrt(p+1),t.w=.25/d,t.x=(c-f)*d,t.y=(o-u)*d,t.z=(s-a)*d):r>l&&r>h?(d=2*Math.sqrt(1+r-l-h),t.w=(c-f)/d,t.x=.25*d,t.y=(a+s)/d,t.z=(o+u)/d):l>h?(d=2*Math.sqrt(1+l-r-h),t.w=(o-u)/d,t.x=(a+s)/d,t.y=.25*d,t.z=(f+c)/d):(d=2*Math.sqrt(1+h-r-l),t.w=(s-a)/d,t.x=(o+u)/d,t.y=(f+c)/d,t.z=.25*d)},n.Dot=function(e,t){return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w},n.AreClose=function(e,t){var i=n.Dot(e,t);return i>=0},n.Zero=function(){return new n(0,0,0,0)},n.Inverse=function(e){return new n(-e._x,-e._y,-e._z,e._w)},n.InverseToRef=function(e,t){return t.set(-e._x,-e._y,-e._z,e._w),t},n.Identity=function(){return new n(0,0,0,1)},n.IsIdentity=function(e){return e&&e._x===0&&e._y===0&&e._z===0&&e._w===1},n.RotationAxis=function(e,t){return n.RotationAxisToRef(e,t,new n)},n.RotationAxisToRef=function(e,t,i){var r=Math.sin(t/2);return e.normalize(),i.w=Math.cos(t/2),i.x=e._x*r,i.y=e._y*r,i.z=e._z*r,i},n.FromArray=function(e,t){return t||(t=0),new n(e[t],e[t+1],e[t+2],e[t+3])},n.FromArrayToRef=function(e,t,i){i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3]},n.FromEulerAngles=function(e,t,i){var r=new n;return n.RotationYawPitchRollToRef(t,e,i,r),r},n.FromEulerAnglesToRef=function(e,t,i,r){return n.RotationYawPitchRollToRef(t,e,i,r),r},n.FromEulerVector=function(e){var t=new n;return n.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t},n.FromEulerVectorToRef=function(e,t){return n.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t},n.RotationYawPitchRoll=function(e,t,i){var r=new n;return n.RotationYawPitchRollToRef(e,t,i,r),r},n.RotationYawPitchRollToRef=function(e,t,i,r){var a=i*.5,o=t*.5,s=e*.5,l=Math.sin(a),f=Math.cos(a),u=Math.sin(o),c=Math.cos(o),h=Math.sin(s),p=Math.cos(s);r.x=p*u*f+h*c*l,r.y=h*c*f-p*u*l,r.z=p*c*l-h*u*f,r.w=p*c*f+h*u*l},n.RotationAlphaBetaGamma=function(e,t,i){var r=new n;return n.RotationAlphaBetaGammaToRef(e,t,i,r),r},n.RotationAlphaBetaGammaToRef=function(e,t,i,r){var a=(i+e)*.5,o=(i-e)*.5,s=t*.5;r.x=Math.cos(o)*Math.sin(s),r.y=Math.sin(o)*Math.sin(s),r.z=Math.sin(a)*Math.cos(s),r.w=Math.cos(a)*Math.cos(s)},n.RotationQuaternionFromAxis=function(e,t,i){var r=new n(0,0,0,0);return n.RotationQuaternionFromAxisToRef(e,t,i,r),r},n.RotationQuaternionFromAxisToRef=function(e,t,i,r){var a=$.Matrix[0];P.FromXYZAxesToRef(e.normalize(),t.normalize(),i.normalize(),a),n.FromRotationMatrixToRef(a,r)},n.Slerp=function(e,t,i){var r=n.Identity();return n.SlerpToRef(e,t,i,r),r},n.SlerpToRef=function(e,t,i,r){var a,o,s=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,l=!1;if(s<0&&(l=!0,s=-s),s>.999999)o=1-i,a=l?-i:i;else{var f=Math.acos(s),u=1/Math.sin(f);o=Math.sin((1-i)*f)*u,a=l?-Math.sin(i*f)*u:Math.sin(i*f)*u}r.x=o*e._x+a*t._x,r.y=o*e._y+a*t._y,r.z=o*e._z+a*t._z,r.w=o*e._w+a*t._w},n.Hermite=function(e,t,i,r,a){var o=a*a,s=a*o,l=2*s-3*o+1,f=-2*s+3*o,u=s-2*o+a,c=s-o,h=e._x*l+i._x*f+t._x*u+r._x*c,p=e._y*l+i._y*f+t._y*u+r._y*c,d=e._z*l+i._z*f+t._z*u+r._z*c,_=e._w*l+i._w*f+t._w*u+r._w*c;return new n(h,p,d,_)},n}(),P=function(){function n(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,ut.MatrixTrackPrecisionChange&&ut.MatrixTrackedMatrices.push(this),this._m=new ut.MatrixCurrentType(16),this._updateIdentityStatus(!1)}return Object.defineProperty(n,"Use64Bits",{get:function(){return ut.MatrixUse64Bits},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"m",{get:function(){return this._m},enumerable:!1,configurable:!0}),n.prototype._markAsUpdated=function(){this.updateFlag=n._updateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0},n.prototype._updateIdentityStatus=function(e,t,i,r){t===void 0&&(t=!1),i===void 0&&(i=!1),r===void 0&&(r=!0),this.updateFlag=n._updateFlagSeed++,this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=this._isIdentity?!1:t,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:r},n.prototype.isIdentity=function(){if(this._isIdentityDirty){this._isIdentityDirty=!1;var 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},n.prototype.isIdentityAs3x2=function(){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},n.prototype.determinant=function(){if(this._isIdentity===!0)return 1;var e=this._m,t=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],f=e[7],u=e[8],c=e[9],h=e[10],p=e[11],d=e[12],_=e[13],v=e[14],E=e[15],y=h*E-v*p,R=c*E-_*p,S=c*v-_*h,M=u*E-d*p,C=u*v-h*d,b=u*_-d*c,N=+(s*y-l*R+f*S),V=-(o*y-l*M+f*C),G=+(o*R-s*M+f*b),X=-(o*S-s*C+l*b);return t*N+i*V+r*G+a*X},n.prototype.toArray=function(){return this._m},n.prototype.asArray=function(){return this._m},n.prototype.invert=function(){return this.invertToRef(this),this},n.prototype.reset=function(){return n.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this},n.prototype.add=function(e){var t=new n;return this.addToRef(e,t),t},n.prototype.addToRef=function(e,t){for(var i=this._m,r=t._m,a=e.m,o=0;o<16;o++)r[o]=i[o]+a[o];return t._markAsUpdated(),this},n.prototype.addToSelf=function(e){for(var t=this._m,i=e.m,r=0;r<16;r++)t[r]+=i[r];return this._markAsUpdated(),this},n.prototype.invertToRef=function(e){if(this._isIdentity===!0)return n.IdentityToRef(e),this;var t=this._m,i=t[0],r=t[1],a=t[2],o=t[3],s=t[4],l=t[5],f=t[6],u=t[7],c=t[8],h=t[9],p=t[10],d=t[11],_=t[12],v=t[13],E=t[14],y=t[15],R=p*y-E*d,S=h*y-v*d,M=h*E-v*p,C=c*y-_*d,b=c*E-p*_,N=c*v-_*h,V=+(l*R-f*S+u*M),G=-(s*R-f*C+u*b),X=+(s*S-l*C+u*N),z=-(s*M-l*b+f*N),Y=i*V+r*G+a*X+o*z;if(Y===0)return e.copyFrom(this),this;var k=1/Y,Z=f*y-E*u,re=l*y-v*u,ue=l*E-v*f,Re=s*y-_*u,se=s*E-_*f,me=s*v-_*l,pe=f*d-p*u,xe=l*d-h*u,Le=l*p-h*f,nt=s*d-c*u,qe=s*p-c*f,Tt=s*h-c*l,Ft=-(r*R-a*S+o*M),Nt=+(i*R-a*C+o*b),wt=-(i*S-r*C+o*N),Ut=+(i*M-r*b+a*N),Bt=+(r*Z-a*re+o*ue),Vt=-(i*Z-a*Re+o*se),ke=+(i*re-r*Re+o*me),He=-(i*ue-r*se+a*me),Xe=-(r*pe-a*xe+o*Le),We=+(i*pe-a*nt+o*qe),At=-(i*xe-r*nt+o*Tt),$t=+(i*Le-r*qe+a*Tt);return n.FromValuesToRef(V*k,Ft*k,Bt*k,Xe*k,G*k,Nt*k,Vt*k,We*k,X*k,wt*k,ke*k,At*k,z*k,Ut*k,He*k,$t*k,e),this},n.prototype.addAtIndex=function(e,t){return this._m[e]+=t,this._markAsUpdated(),this},n.prototype.multiplyAtIndex=function(e,t){return this._m[e]*=t,this._markAsUpdated(),this},n.prototype.setTranslationFromFloats=function(e,t,i){return this._m[12]=e,this._m[13]=t,this._m[14]=i,this._markAsUpdated(),this},n.prototype.addTranslationFromFloats=function(e,t,i){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=i,this._markAsUpdated(),this},n.prototype.setTranslation=function(e){return this.setTranslationFromFloats(e._x,e._y,e._z)},n.prototype.getTranslation=function(){return new m(this._m[12],this._m[13],this._m[14])},n.prototype.getTranslationToRef=function(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],this},n.prototype.removeRotationAndScaling=function(){var 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},n.prototype.multiply=function(e){var t=new n;return this.multiplyToRef(e,t),t},n.prototype.copyFrom=function(e){e.copyToArray(this._m);var t=e;return this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this},n.prototype.copyToArray=function(e,t){t===void 0&&(t=0);var i=this._m;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],this},n.prototype.multiplyToRef=function(e,t){return this._isIdentity?(t.copyFrom(e),this):e._isIdentity?(t.copyFrom(this),this):(this.multiplyToArray(e,t._m,0),t._markAsUpdated(),this)},n.prototype.multiplyToArray=function(e,t,i){var r=this._m,a=e.m,o=r[0],s=r[1],l=r[2],f=r[3],u=r[4],c=r[5],h=r[6],p=r[7],d=r[8],_=r[9],v=r[10],E=r[11],y=r[12],R=r[13],S=r[14],M=r[15],C=a[0],b=a[1],N=a[2],V=a[3],G=a[4],X=a[5],z=a[6],Y=a[7],k=a[8],Z=a[9],re=a[10],ue=a[11],Re=a[12],se=a[13],me=a[14],pe=a[15];return t[i]=o*C+s*G+l*k+f*Re,t[i+1]=o*b+s*X+l*Z+f*se,t[i+2]=o*N+s*z+l*re+f*me,t[i+3]=o*V+s*Y+l*ue+f*pe,t[i+4]=u*C+c*G+h*k+p*Re,t[i+5]=u*b+c*X+h*Z+p*se,t[i+6]=u*N+c*z+h*re+p*me,t[i+7]=u*V+c*Y+h*ue+p*pe,t[i+8]=d*C+_*G+v*k+E*Re,t[i+9]=d*b+_*X+v*Z+E*se,t[i+10]=d*N+_*z+v*re+E*me,t[i+11]=d*V+_*Y+v*ue+E*pe,t[i+12]=y*C+R*G+S*k+M*Re,t[i+13]=y*b+R*X+S*Z+M*se,t[i+14]=y*N+R*z+S*re+M*me,t[i+15]=y*V+R*Y+S*ue+M*pe,this},n.prototype.equals=function(e){var t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;var i=this.m,r=t.m;return i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]&&i[3]===r[3]&&i[4]===r[4]&&i[5]===r[5]&&i[6]===r[6]&&i[7]===r[7]&&i[8]===r[8]&&i[9]===r[9]&&i[10]===r[10]&&i[11]===r[11]&&i[12]===r[12]&&i[13]===r[13]&&i[14]===r[14]&&i[15]===r[15]},n.prototype.clone=function(){var e=new n;return e.copyFrom(this),e},n.prototype.getClassName=function(){return"Matrix"},n.prototype.getHashCode=function(){for(var e=this._m[0]|0,t=1;t<16;t++)e=e*397^(this._m[t]|0);return e},n.prototype.decompose=function(e,t,i){if(this._isIdentity)return i&&i.setAll(0),e&&e.setAll(1),t&&t.copyFromFloats(0,0,0,1),!0;var r=this._m;if(i&&i.copyFromFloats(r[12],r[13],r[14]),e=e||$.Vector3[0],e.x=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]),e.y=Math.sqrt(r[4]*r[4]+r[5]*r[5]+r[6]*r[6]),e.z=Math.sqrt(r[8]*r[8]+r[9]*r[9]+r[10]*r[10]),this.determinant()<=0&&(e.y*=-1),e._x===0||e._y===0||e._z===0)return t&&t.copyFromFloats(0,0,0,1),!1;if(t){var a=1/e._x,o=1/e._y,s=1/e._z;n.FromValuesToRef(r[0]*a,r[1]*a,r[2]*a,0,r[4]*o,r[5]*o,r[6]*o,0,r[8]*s,r[9]*s,r[10]*s,0,0,0,0,1,$.Matrix[0]),W.FromRotationMatrixToRef($.Matrix[0],t)}return!0},n.prototype.getRow=function(e){if(e<0||e>3)return null;var t=e*4;return new Ve(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])},n.prototype.setRow=function(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)},n.prototype.transpose=function(){return n.Transpose(this)},n.prototype.transposeToRef=function(e){return n.TransposeToRef(this,e),this},n.prototype.setRowFromFloats=function(e,t,i,r,a){if(e<0||e>3)return this;var o=e*4;return this._m[o+0]=t,this._m[o+1]=i,this._m[o+2]=r,this._m[o+3]=a,this._markAsUpdated(),this},n.prototype.scale=function(e){var t=new n;return this.scaleToRef(e,t),t},n.prototype.scaleToRef=function(e,t){for(var i=0;i<16;i++)t._m[i]=this._m[i]*e;return t._markAsUpdated(),this},n.prototype.scaleAndAddToRef=function(e,t){for(var i=0;i<16;i++)t._m[i]+=this._m[i]*e;return t._markAsUpdated(),this},n.prototype.toNormalMatrix=function(e){var t=$.Matrix[0];this.invertToRef(t),t.transposeToRef(e);var i=e._m;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)},n.prototype.getRotationMatrix=function(){var e=new n;return this.getRotationMatrixToRef(e),e},n.prototype.getRotationMatrixToRef=function(e){var t=$.Vector3[0];if(!this.decompose(t))return n.IdentityToRef(e),this;var i=this._m,r=1/t._x,a=1/t._y,o=1/t._z;return n.FromValuesToRef(i[0]*r,i[1]*r,i[2]*r,0,i[4]*a,i[5]*a,i[6]*a,0,i[8]*o,i[9]*o,i[10]*o,0,0,0,0,1,e),this},n.prototype.toggleModelMatrixHandInPlace=function(){var e=this._m;e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this._markAsUpdated()},n.prototype.toggleProjectionMatrixHandInPlace=function(){var e=this._m;e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this._markAsUpdated()},n.FromArray=function(e,t){t===void 0&&(t=0);var i=new n;return n.FromArrayToRef(e,t,i),i},n.FromArrayToRef=function(e,t,i){for(var r=0;r<16;r++)i._m[r]=e[r+t];i._markAsUpdated()},n.FromFloat32ArrayToRefScaled=function(e,t,i,r){for(var a=0;a<16;a++)r._m[a]=e[a+t]*i;r._markAsUpdated()},Object.defineProperty(n,"IdentityReadOnly",{get:function(){return n._identityReadOnly},enumerable:!1,configurable:!0}),n.FromValuesToRef=function(e,t,i,r,a,o,s,l,f,u,c,h,p,d,_,v,E){var y=E._m;y[0]=e,y[1]=t,y[2]=i,y[3]=r,y[4]=a,y[5]=o,y[6]=s,y[7]=l,y[8]=f,y[9]=u,y[10]=c,y[11]=h,y[12]=p,y[13]=d,y[14]=_,y[15]=v,E._markAsUpdated()},n.FromValues=function(e,t,i,r,a,o,s,l,f,u,c,h,p,d,_,v){var E=new n,y=E._m;return y[0]=e,y[1]=t,y[2]=i,y[3]=r,y[4]=a,y[5]=o,y[6]=s,y[7]=l,y[8]=f,y[9]=u,y[10]=c,y[11]=h,y[12]=p,y[13]=d,y[14]=_,y[15]=v,E._markAsUpdated(),E},n.Compose=function(e,t,i){var r=new n;return n.ComposeToRef(e,t,i,r),r},n.ComposeToRef=function(e,t,i,r){var a=r._m,o=t._x,s=t._y,l=t._z,f=t._w,u=o+o,c=s+s,h=l+l,p=o*u,d=o*c,_=o*h,v=s*c,E=s*h,y=l*h,R=f*u,S=f*c,M=f*h,C=e._x,b=e._y,N=e._z;a[0]=(1-(v+y))*C,a[1]=(d+M)*C,a[2]=(_-S)*C,a[3]=0,a[4]=(d-M)*b,a[5]=(1-(p+y))*b,a[6]=(E+R)*b,a[7]=0,a[8]=(_+S)*N,a[9]=(E-R)*N,a[10]=(1-(p+v))*N,a[11]=0,a[12]=i._x,a[13]=i._y,a[14]=i._z,a[15]=1,r._markAsUpdated()},n.Identity=function(){var e=n.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return e._updateIdentityStatus(!0),e},n.IdentityToRef=function(e){n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(!0)},n.Zero=function(){var e=n.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return e._updateIdentityStatus(!1),e},n.RotationX=function(e){var t=new n;return n.RotationXToRef(e,t),t},n.Invert=function(e){var t=new n;return e.invertToRef(t),t},n.RotationXToRef=function(e,t){var i=Math.sin(e),r=Math.cos(e);n.FromValuesToRef(1,0,0,0,0,r,i,0,0,-i,r,0,0,0,0,1,t),t._updateIdentityStatus(r===1&&i===0)},n.RotationY=function(e){var t=new n;return n.RotationYToRef(e,t),t},n.RotationYToRef=function(e,t){var i=Math.sin(e),r=Math.cos(e);n.FromValuesToRef(r,0,-i,0,0,1,0,0,i,0,r,0,0,0,0,1,t),t._updateIdentityStatus(r===1&&i===0)},n.RotationZ=function(e){var t=new n;return n.RotationZToRef(e,t),t},n.RotationZToRef=function(e,t){var i=Math.sin(e),r=Math.cos(e);n.FromValuesToRef(r,i,0,0,-i,r,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(r===1&&i===0)},n.RotationAxis=function(e,t){var i=new n;return n.RotationAxisToRef(e,t,i),i},n.RotationAxisToRef=function(e,t,i){var r=Math.sin(-t),a=Math.cos(-t),o=1-a;e.normalize();var s=i._m;s[0]=e._x*e._x*o+a,s[1]=e._x*e._y*o-e._z*r,s[2]=e._x*e._z*o+e._y*r,s[3]=0,s[4]=e._y*e._x*o+e._z*r,s[5]=e._y*e._y*o+a,s[6]=e._y*e._z*o-e._x*r,s[7]=0,s[8]=e._z*e._x*o-e._y*r,s[9]=e._z*e._y*o+e._x*r,s[10]=e._z*e._z*o+a,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,i._markAsUpdated()},n.RotationAlignToRef=function(e,t,i){var r=m.Cross(t,e),a=m.Dot(t,e),o=1/(1+a),s=i._m;s[0]=r._x*r._x*o+a,s[1]=r._y*r._x*o-r._z,s[2]=r._z*r._x*o+r._y,s[3]=0,s[4]=r._x*r._y*o+r._z,s[5]=r._y*r._y*o+a,s[6]=r._z*r._y*o-r._x,s[7]=0,s[8]=r._x*r._z*o-r._y,s[9]=r._y*r._z*o+r._x,s[10]=r._z*r._z*o+a,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,i._markAsUpdated()},n.RotationYawPitchRoll=function(e,t,i){var r=new n;return n.RotationYawPitchRollToRef(e,t,i,r),r},n.RotationYawPitchRollToRef=function(e,t,i,r){W.RotationYawPitchRollToRef(e,t,i,$.Quaternion[0]),$.Quaternion[0].toRotationMatrix(r)},n.Scaling=function(e,t,i){var r=new n;return n.ScalingToRef(e,t,i,r),r},n.ScalingToRef=function(e,t,i,r){n.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1,r),r._updateIdentityStatus(e===1&&t===1&&i===1)},n.Translation=function(e,t,i){var r=new n;return n.TranslationToRef(e,t,i,r),r},n.TranslationToRef=function(e,t,i,r){n.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1,r),r._updateIdentityStatus(e===0&&t===0&&i===0)},n.Lerp=function(e,t,i){var r=new n;return n.LerpToRef(e,t,i,r),r},n.LerpToRef=function(e,t,i,r){for(var a=r._m,o=e.m,s=t.m,l=0;l<16;l++)a[l]=o[l]*(1-i)+s[l]*i;r._markAsUpdated()},n.DecomposeLerp=function(e,t,i){var r=new n;return n.DecomposeLerpToRef(e,t,i,r),r},n.DecomposeLerpToRef=function(e,t,i,r){var a=$.Vector3[0],o=$.Quaternion[0],s=$.Vector3[1];e.decompose(a,o,s);var l=$.Vector3[2],f=$.Quaternion[1],u=$.Vector3[3];t.decompose(l,f,u);var c=$.Vector3[4];m.LerpToRef(a,l,i,c);var h=$.Quaternion[2];W.SlerpToRef(o,f,i,h);var p=$.Vector3[5];m.LerpToRef(s,u,i,p),n.ComposeToRef(c,h,p,r)},n.LookAtLH=function(e,t,i){var r=new n;return n.LookAtLHToRef(e,t,i,r),r},n.LookAtLHToRef=function(e,t,i,r){var a=$.Vector3[0],o=$.Vector3[1],s=$.Vector3[2];t.subtractToRef(e,s),s.normalize(),m.CrossToRef(i,s,a);var l=a.lengthSquared();l===0?a.x=1:a.normalizeFromLength(Math.sqrt(l)),m.CrossToRef(s,a,o),o.normalize();var f=-m.Dot(a,e),u=-m.Dot(o,e),c=-m.Dot(s,e);n.FromValuesToRef(a._x,o._x,s._x,0,a._y,o._y,s._y,0,a._z,o._z,s._z,0,f,u,c,1,r)},n.LookAtRH=function(e,t,i){var r=new n;return n.LookAtRHToRef(e,t,i,r),r},n.LookAtRHToRef=function(e,t,i,r){var a=$.Vector3[0],o=$.Vector3[1],s=$.Vector3[2];e.subtractToRef(t,s),s.normalize(),m.CrossToRef(i,s,a);var l=a.lengthSquared();l===0?a.x=1:a.normalizeFromLength(Math.sqrt(l)),m.CrossToRef(s,a,o),o.normalize();var f=-m.Dot(a,e),u=-m.Dot(o,e),c=-m.Dot(s,e);n.FromValuesToRef(a._x,o._x,s._x,0,a._y,o._y,s._y,0,a._z,o._z,s._z,0,f,u,c,1,r)},n.OrthoLH=function(e,t,i,r){var a=new n;return n.OrthoLHToRef(e,t,i,r,a),a},n.OrthoLHToRef=function(e,t,i,r,a){var o=i,s=r,l=2/e,f=2/t,u=2/(s-o),c=-(s+o)/(s-o);n.FromValuesToRef(l,0,0,0,0,f,0,0,0,0,u,0,0,0,c,1,a),a._updateIdentityStatus(l===1&&f===1&&u===1&&c===0)},n.OrthoOffCenterLH=function(e,t,i,r,a,o){var s=new n;return n.OrthoOffCenterLHToRef(e,t,i,r,a,o,s),s},n.OrthoOffCenterLHToRef=function(e,t,i,r,a,o,s){var l=a,f=o,u=2/(t-e),c=2/(r-i),h=2/(f-l),p=-(f+l)/(f-l),d=(e+t)/(e-t),_=(r+i)/(i-r);n.FromValuesToRef(u,0,0,0,0,c,0,0,0,0,h,0,d,_,p,1,s),s._markAsUpdated()},n.OrthoOffCenterRH=function(e,t,i,r,a,o){var s=new n;return n.OrthoOffCenterRHToRef(e,t,i,r,a,o,s),s},n.OrthoOffCenterRHToRef=function(e,t,i,r,a,o,s){n.OrthoOffCenterLHToRef(e,t,i,r,a,o,s),s._m[10]*=-1},n.PerspectiveLH=function(e,t,i,r){var a=new n,o=i,s=r,l=2*o/e,f=2*o/t,u=(s+o)/(s-o),c=-2*s*o/(s-o);return n.FromValuesToRef(l,0,0,0,0,f,0,0,0,0,u,1,0,0,c,0,a),a._updateIdentityStatus(!1),a},n.PerspectiveFovLH=function(e,t,i,r){var a=new n;return n.PerspectiveFovLHToRef(e,t,i,r,a),a},n.PerspectiveFovLHToRef=function(e,t,i,r,a,o){o===void 0&&(o=!0);var s=i,l=r,f=1/Math.tan(e*.5),u=o?f/t:f,c=o?f:f*t,h=(l+s)/(l-s),p=-2*l*s/(l-s);n.FromValuesToRef(u,0,0,0,0,c,0,0,0,0,h,1,0,0,p,0,a),a._updateIdentityStatus(!1)},n.PerspectiveFovReverseLHToRef=function(e,t,i,r,a,o){o===void 0&&(o=!0);var s=1/Math.tan(e*.5),l=o?s/t:s,f=o?s:s*t;n.FromValuesToRef(l,0,0,0,0,f,0,0,0,0,-i,1,0,0,1,0,a),a._updateIdentityStatus(!1)},n.PerspectiveFovRH=function(e,t,i,r){var a=new n;return n.PerspectiveFovRHToRef(e,t,i,r,a),a},n.PerspectiveFovRHToRef=function(e,t,i,r,a,o){o===void 0&&(o=!0);var s=i,l=r,f=1/Math.tan(e*.5),u=o?f/t:f,c=o?f:f*t,h=-(l+s)/(l-s),p=-2*l*s/(l-s);n.FromValuesToRef(u,0,0,0,0,c,0,0,0,0,h,-1,0,0,p,0,a),a._updateIdentityStatus(!1)},n.PerspectiveFovReverseRHToRef=function(e,t,i,r,a,o){o===void 0&&(o=!0);var s=1/Math.tan(e*.5),l=o?s/t:s,f=o?s:s*t;n.FromValuesToRef(l,0,0,0,0,f,0,0,0,0,-i,-1,0,0,-1,0,a),a._updateIdentityStatus(!1)},n.PerspectiveFovWebVRToRef=function(e,t,i,r,a){a===void 0&&(a=!1);var o=a?-1:1,s=Math.tan(e.upDegrees*Math.PI/180),l=Math.tan(e.downDegrees*Math.PI/180),f=Math.tan(e.leftDegrees*Math.PI/180),u=Math.tan(e.rightDegrees*Math.PI/180),c=2/(f+u),h=2/(s+l),p=r._m;p[0]=c,p[1]=p[2]=p[3]=p[4]=0,p[5]=h,p[6]=p[7]=0,p[8]=(f-u)*c*.5,p[9]=-((s-l)*h*.5),p[10]=-i/(t-i),p[11]=1*o,p[12]=p[13]=p[15]=0,p[14]=-(2*i*t)/(i-t),r._markAsUpdated()},n.GetFinalMatrix=function(e,t,i,r,a,o){var s=e.width,l=e.height,f=e.x,u=e.y,c=n.FromValues(s/2,0,0,0,0,-l/2,0,0,0,0,o-a,0,f+s/2,l/2+u,a,1),h=$.Matrix[0];return t.multiplyToRef(i,h),h.multiplyToRef(r,h),h.multiply(c)},n.GetAsMatrix2x2=function(e){var t=e.m,i=[t[0],t[1],t[4],t[5]];return ut.MatrixUse64Bits?i:new Float32Array(i)},n.GetAsMatrix3x3=function(e){var t=e.m,i=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return ut.MatrixUse64Bits?i:new Float32Array(i)},n.Transpose=function(e){var t=new n;return n.TransposeToRef(e,t),t},n.TransposeToRef=function(e,t){var i=t._m,r=e.m;i[0]=r[0],i[1]=r[4],i[2]=r[8],i[3]=r[12],i[4]=r[1],i[5]=r[5],i[6]=r[9],i[7]=r[13],i[8]=r[2],i[9]=r[6],i[10]=r[10],i[11]=r[14],i[12]=r[3],i[13]=r[7],i[14]=r[11],i[15]=r[15],t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty)},n.Reflection=function(e){var t=new n;return n.ReflectionToRef(e,t),t},n.ReflectionToRef=function(e,t){e.normalize();var i=e.normal.x,r=e.normal.y,a=e.normal.z,o=-2*i,s=-2*r,l=-2*a;n.FromValuesToRef(o*i+1,s*i,l*i,0,o*r,s*r+1,l*r,0,o*a,s*a,l*a+1,0,o*e.d,s*e.d,l*e.d,1,t)},n.FromXYZAxesToRef=function(e,t,i,r){n.FromValuesToRef(e._x,e._y,e._z,0,t._x,t._y,t._z,0,i._x,i._y,i._z,0,0,0,0,1,r)},n.FromQuaternionToRef=function(e,t){var i=e._x*e._x,r=e._y*e._y,a=e._z*e._z,o=e._x*e._y,s=e._z*e._w,l=e._z*e._x,f=e._y*e._w,u=e._y*e._z,c=e._x*e._w;t._m[0]=1-2*(r+a),t._m[1]=2*(o+s),t._m[2]=2*(l-f),t._m[3]=0,t._m[4]=2*(o-s),t._m[5]=1-2*(a+i),t._m[6]=2*(u+c),t._m[7]=0,t._m[8]=2*(l+f),t._m[9]=2*(u-c),t._m[10]=1-2*(r+i),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t._markAsUpdated()},n._updateFlagSeed=0,n._identityReadOnly=n.Identity(),n}(),$=function(){function n(){}return n.Vector3=be.BuildArray(6,m.Zero),n.Matrix=be.BuildArray(2,P.Identity),n.Quaternion=be.BuildArray(3,W.Zero),n}(),D=function(){function n(){}return n.Vector2=be.BuildArray(3,ce.Zero),n.Vector3=be.BuildArray(13,m.Zero),n.Vector4=be.BuildArray(3,Ve.Zero),n.Quaternion=be.BuildArray(2,W.Zero),n.Matrix=be.BuildArray(8,P.Identity),n}();de.RegisteredTypes["BABYLON.Vector2"]=ce;de.RegisteredTypes["BABYLON.Vector3"]=m;de.RegisteredTypes["BABYLON.Vector4"]=Ve;de.RegisteredTypes["BABYLON.Matrix"]=P;var J=function(){function n(e,t,i){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),this.r=e,this.g=t,this.b=i}return n.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"},n.prototype.getClassName=function(){return"Color3"},n.prototype.getHashCode=function(){var e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e},n.prototype.toArray=function(e,t){return t===void 0&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this},n.prototype.fromArray=function(e,t){return t===void 0&&(t=0),n.FromArrayToRef(e,t,this),this},n.prototype.toColor4=function(e){return e===void 0&&(e=1),new ye(this.r,this.g,this.b,e)},n.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},n.prototype.toLuminance=function(){return this.r*.3+this.g*.59+this.b*.11},n.prototype.multiply=function(e){return new n(this.r*e.r,this.g*e.g,this.b*e.b)},n.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,this},n.prototype.equals=function(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b},n.prototype.equalsFloats=function(e,t,i){return this.r===e&&this.g===t&&this.b===i},n.prototype.scale=function(e){return new n(this.r*e,this.g*e,this.b*e)},n.prototype.scaleToRef=function(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,this},n.prototype.scaleAndAddToRef=function(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,this},n.prototype.clampToRef=function(e,t,i){return e===void 0&&(e=0),t===void 0&&(t=1),i.r=K.Clamp(this.r,e,t),i.g=K.Clamp(this.g,e,t),i.b=K.Clamp(this.b,e,t),this},n.prototype.add=function(e){return new n(this.r+e.r,this.g+e.g,this.b+e.b)},n.prototype.addToRef=function(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,this},n.prototype.subtract=function(e){return new n(this.r-e.r,this.g-e.g,this.b-e.b)},n.prototype.subtractToRef=function(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,this},n.prototype.clone=function(){return new n(this.r,this.g,this.b)},n.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},n.prototype.copyFromFloats=function(e,t,i){return this.r=e,this.g=t,this.b=i,this},n.prototype.set=function(e,t,i){return this.copyFromFloats(e,t,i)},n.prototype.toHexString=function(){var e=this.r*255|0,t=this.g*255|0,i=this.b*255|0;return"#"+K.ToHex(e)+K.ToHex(t)+K.ToHex(i)},n.prototype.toLinearSpace=function(){var e=new n;return this.toLinearSpaceToRef(e),e},n.prototype.toHSV=function(){var e=new n;return this.toHSVToRef(e),e},n.prototype.toHSVToRef=function(e){var t=this.r,i=this.g,r=this.b,a=Math.max(t,i,r),o=Math.min(t,i,r),s=0,l=0,f=a,u=a-o;a!==0&&(l=u/a),a!=o&&(a==t?(s=(i-r)/u,i<r&&(s+=6)):a==i?s=(r-t)/u+2:a==r&&(s=(t-i)/u+4),s*=60),e.r=s,e.g=l,e.b=f},n.prototype.toLinearSpaceToRef=function(e){return e.r=Math.pow(this.r,it),e.g=Math.pow(this.g,it),e.b=Math.pow(this.b,it),this},n.prototype.toGammaSpace=function(){var e=new n;return this.toGammaSpaceToRef(e),e},n.prototype.toGammaSpaceToRef=function(e){return e.r=Math.pow(this.r,gt),e.g=Math.pow(this.g,gt),e.b=Math.pow(this.b,gt),this},n.HSVtoRGBToRef=function(e,t,i,r){var a=i*t,o=e/60,s=a*(1-Math.abs(o%2-1)),l=0,f=0,u=0;o>=0&&o<=1?(l=a,f=s):o>=1&&o<=2?(l=s,f=a):o>=2&&o<=3?(f=a,u=s):o>=3&&o<=4?(f=s,u=a):o>=4&&o<=5?(l=s,u=a):o>=5&&o<=6&&(l=a,u=s);var c=i-a;r.set(l+c,f+c,u+c)},n.FromHexString=function(e){if(e.substring(0,1)!=="#"||e.length!==7)return new n(0,0,0);var t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),r=parseInt(e.substring(5,7),16);return n.FromInts(t,i,r)},n.FromArray=function(e,t){return t===void 0&&(t=0),new n(e[t],e[t+1],e[t+2])},n.FromArrayToRef=function(e,t,i){t===void 0&&(t=0),i.r=e[t],i.g=e[t+1],i.b=e[t+2]},n.FromInts=function(e,t,i){return new n(e/255,t/255,i/255)},n.Lerp=function(e,t,i){var r=new n(0,0,0);return n.LerpToRef(e,t,i,r),r},n.LerpToRef=function(e,t,i,r){r.r=e.r+(t.r-e.r)*i,r.g=e.g+(t.g-e.g)*i,r.b=e.b+(t.b-e.b)*i},n.Red=function(){return new n(1,0,0)},n.Green=function(){return new n(0,1,0)},n.Blue=function(){return new n(0,0,1)},n.Black=function(){return new n(0,0,0)},Object.defineProperty(n,"BlackReadOnly",{get:function(){return n._BlackReadOnly},enumerable:!1,configurable:!0}),n.White=function(){return new n(1,1,1)},n.Purple=function(){return new n(.5,0,.5)},n.Magenta=function(){return new n(1,0,1)},n.Yellow=function(){return new n(1,1,0)},n.Gray=function(){return new n(.5,.5,.5)},n.Teal=function(){return new n(0,1,1)},n.Random=function(){return new n(Math.random(),Math.random(),Math.random())},n._BlackReadOnly=n.Black(),n}(),ye=function(){function n(e,t,i,r){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),r===void 0&&(r=1),this.r=e,this.g=t,this.b=i,this.a=r}return n.prototype.addInPlace=function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this},n.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},n.prototype.toArray=function(e,t){return t===void 0&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this},n.prototype.fromArray=function(e,t){return t===void 0&&(t=0),n.FromArrayToRef(e,t,this),this},n.prototype.equals=function(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a},n.prototype.add=function(e){return new n(this.r+e.r,this.g+e.g,this.b+e.b,this.a+e.a)},n.prototype.subtract=function(e){return new n(this.r-e.r,this.g-e.g,this.b-e.b,this.a-e.a)},n.prototype.subtractToRef=function(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,this},n.prototype.scale=function(e){return new n(this.r*e,this.g*e,this.b*e,this.a*e)},n.prototype.scaleToRef=function(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,this},n.prototype.scaleAndAddToRef=function(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,this},n.prototype.clampToRef=function(e,t,i){return e===void 0&&(e=0),t===void 0&&(t=1),i.r=K.Clamp(this.r,e,t),i.g=K.Clamp(this.g,e,t),i.b=K.Clamp(this.b,e,t),i.a=K.Clamp(this.a,e,t),this},n.prototype.multiply=function(e){return new n(this.r*e.r,this.g*e.g,this.b*e.b,this.a*e.a)},n.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t},n.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"},n.prototype.getClassName=function(){return"Color4"},n.prototype.getHashCode=function(){var e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e=e*397^(this.a*255|0),e},n.prototype.clone=function(){return new n(this.r,this.g,this.b,this.a)},n.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this},n.prototype.copyFromFloats=function(e,t,i,r){return this.r=e,this.g=t,this.b=i,this.a=r,this},n.prototype.set=function(e,t,i,r){return this.copyFromFloats(e,t,i,r)},n.prototype.toHexString=function(e){e===void 0&&(e=!1);var t=this.r*255|0,i=this.g*255|0,r=this.b*255|0;if(e)return"#"+K.ToHex(t)+K.ToHex(i)+K.ToHex(r);var a=this.a*255|0;return"#"+K.ToHex(t)+K.ToHex(i)+K.ToHex(r)+K.ToHex(a)},n.prototype.toLinearSpace=function(){var e=new n;return this.toLinearSpaceToRef(e),e},n.prototype.toLinearSpaceToRef=function(e){return e.r=Math.pow(this.r,it),e.g=Math.pow(this.g,it),e.b=Math.pow(this.b,it),e.a=this.a,this},n.prototype.toGammaSpace=function(){var e=new n;return this.toGammaSpaceToRef(e),e},n.prototype.toGammaSpaceToRef=function(e){return e.r=Math.pow(this.r,gt),e.g=Math.pow(this.g,gt),e.b=Math.pow(this.b,gt),e.a=this.a,this},n.FromHexString=function(e){if(e.substring(0,1)!=="#"||e.length!==9)return new n(0,0,0,0);var t=parseInt(e.substring(1,3),16),i=parseInt(e.substring(3,5),16),r=parseInt(e.substring(5,7),16),a=parseInt(e.substring(7,9),16);return n.FromInts(t,i,r,a)},n.Lerp=function(e,t,i){var r=new n(0,0,0,0);return n.LerpToRef(e,t,i,r),r},n.LerpToRef=function(e,t,i,r){r.r=e.r+(t.r-e.r)*i,r.g=e.g+(t.g-e.g)*i,r.b=e.b+(t.b-e.b)*i,r.a=e.a+(t.a-e.a)*i},n.FromColor3=function(e,t){return t===void 0&&(t=1),new n(e.r,e.g,e.b,t)},n.FromArray=function(e,t){return t===void 0&&(t=0),new n(e[t],e[t+1],e[t+2],e[t+3])},n.FromArrayToRef=function(e,t,i){t===void 0&&(t=0),i.r=e[t],i.g=e[t+1],i.b=e[t+2],i.a=e[t+3]},n.FromInts=function(e,t,i,r){return new n(e/255,t/255,i/255,r/255)},n.CheckColors4=function(e,t){if(e.length===t*3){for(var i=[],r=0;r<e.length;r+=3){var a=r/3*4;i[a]=e[r],i[a+1]=e[r+1],i[a+2]=e[r+2],i[a+3]=1}return i}return e},n}(),et=function(){function n(){}return n.Color3=be.BuildArray(3,J.Black),n.Color4=be.BuildArray(3,function(){return new ye(0,0,0,0)}),n}();de.RegisteredTypes["BABYLON.Color3"]=J;de.RegisteredTypes["BABYLON.Color4"]=ye;var Oe=function(){function n(e,t,i,r,a,o){this.source=e,this.pointerX=t,this.pointerY=i,this.meshUnderPointer=r,this.sourceEvent=a,this.additionalData=o}return n.CreateNew=function(e,t,i){var r=e.getScene();return new n(e,r.pointerX,r.pointerY,r.meshUnderPointer||e,t,i)},n.CreateNewFromSprite=function(e,t,i,r){return new n(e,t.pointerX,t.pointerY,t.meshUnderPointer,i,r)},n.CreateNewFromScene=function(e,t){return new n(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)},n.CreateNewFromPrimitive=function(e,t,i,r){return new n(e,t.x,t.y,null,i,r)},n}(),w=function(){function n(){}return n._AddLogEntry=function(e){n._LogCache=e+n._LogCache,n.OnNewCacheEntry&&n.OnNewCacheEntry(e)},n._FormatMessage=function(e){var t=function(r){return r<10?"0"+r:""+r},i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e},n._LogDisabled=function(e){},n._LogEnabled=function(e){var t=n._FormatMessage(e);console.log("BJS - "+t);var i="<div style='color:white'>"+t+"</div><br>";n._AddLogEntry(i)},n._WarnDisabled=function(e){},n._WarnEnabled=function(e){var t=n._FormatMessage(e);console.warn("BJS - "+t);var i="<div style='color:orange'>"+t+"</div><br>";n._AddLogEntry(i)},n._ErrorDisabled=function(e){},n._ErrorEnabled=function(e){n.errorsCount++;var t=n._FormatMessage(e);console.error("BJS - "+t);var i="<div style='color:red'>"+t+"</div><br>";n._AddLogEntry(i)},Object.defineProperty(n,"LogCache",{get:function(){return n._LogCache},enumerable:!1,configurable:!0}),n.ClearLogCache=function(){n._LogCache="",n.errorsCount=0},Object.defineProperty(n,"LogLevels",{set:function(e){(e&n.MessageLogLevel)===n.MessageLogLevel?n.Log=n._LogEnabled:n.Log=n._LogDisabled,(e&n.WarningLogLevel)===n.WarningLogLevel?n.Warn=n._WarnEnabled:n.Warn=n._WarnDisabled,(e&n.ErrorLogLevel)===n.ErrorLogLevel?n.Error=n._ErrorEnabled:n.Error=n._ErrorDisabled},enumerable:!1,configurable:!0}),n.NoneLogLevel=0,n.MessageLogLevel=1,n.WarningLogLevel=2,n.ErrorLogLevel=4,n.AllLogLevel=7,n._LogCache="",n.errorsCount=0,n.Log=n._LogEnabled,n.Warn=n._WarnEnabled,n.Error=n._ErrorEnabled,n}(),ne=function(){function n(){}return Object.defineProperty(n,"LastCreatedEngine",{get:function(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(n,"LastCreatedScene",{get:function(){return this._LastCreatedScene},enumerable:!1,configurable:!0}),n.Instances=new Array,n._LastCreatedScene=null,n.UseFallbackTexture=!0,n.FallbackTexture="",n}(),Fe=function(){function n(){}return n.EndsWith=function(e,t){return e.indexOf(t,e.length-t.length)!==-1},n.StartsWith=function(e,t){return e?e.indexOf(t)===0:!1},n.Decode=function(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var t="",i=0;i<e.byteLength;i++)t+=String.fromCharCode(e[i]);return t},n.EncodeArrayBufferToBase64=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="",r,a,o,s,l,f,u,c=0,h=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);c<h.length;)r=h[c++],a=c<h.length?h[c++]:Number.NaN,o=c<h.length?h[c++]:Number.NaN,s=r>>2,l=(r&3)<<4|a>>4,f=(a&15)<<2|o>>6,u=o&63,isNaN(a)?f=u=64:isNaN(o)&&(u=64),i+=t.charAt(s)+t.charAt(l)+t.charAt(f)+t.charAt(u);return i},n.PadNumber=function(e,t){for(var i=String(e);i.length<t;)i="0"+i;return i},n}(),Mi=function(n,e){return!n||n.getClassName&&n.getClassName()==="Mesh"?null:n.getClassName&&n.getClassName()==="SubMesh"?n.clone(e):n.clone?n.clone():null};function ur(n){var e=[];do Object.getOwnPropertyNames(n).forEach(function(t){e.indexOf(t)===-1&&e.push(t)});while(n=Object.getPrototypeOf(n));return e}var Ei=function(){function n(){}return n.DeepCopy=function(e,t,i,r){for(var a=ur(e),o=0,s=a;o<s.length;o++){var l=s[o];if(!(l[0]==="_"&&(!r||r.indexOf(l)===-1))&&!Fe.EndsWith(l,"Observable")&&!(i&&i.indexOf(l)!==-1)){var f=e[l],u=typeof f;if(u!=="function")try{if(u==="object")if(f instanceof Array){if(t[l]=[],f.length>0)if(typeof f[0]=="object")for(var c=0;c<f.length;c++){var h=Mi(f[c],t);t[l].indexOf(h)===-1&&t[l].push(h)}else t[l]=f.slice(0)}else t[l]=Mi(f,t);else t[l]=f}catch(p){w.Warn(p.message)}}}},n}(),cr=function(){function n(){}return n.Eval=function(e,t){return e.match(/\([^\(\)]*\)/g)?e=e.replace(/\([^\(\)]*\)/g,function(i){return i=i.slice(1,i.length-1),n._HandleParenthesisContent(i,t)}):e=n._HandleParenthesisContent(e,t),e==="true"?!0:e==="false"?!1:n.Eval(e,t)},n._HandleParenthesisContent=function(e,t){t=t||function(u){return u==="true"};var i,r=e.split("||");for(var a in r)if(r.hasOwnProperty(a)){var o=n._SimplifyNegation(r[a].trim()),s=o.split("&&");if(s.length>1)for(var l=0;l<s.length;++l){var f=n._SimplifyNegation(s[l].trim());if(f!=="true"&&f!=="false"?f[0]==="!"?i=!t(f.substring(1)):i=t(f):i=f==="true",!i){o="false";break}}if(i||o==="true"){i=!0;break}o!=="true"&&o!=="false"?o[0]==="!"?i=!t(o.substring(1)):i=t(o):i=o==="true"}return i?"true":"false"},n._SimplifyNegation=function(e){return e=e.replace(/^[\s!]+/,function(t){return t=t.replace(/[\s]/g,function(){return""}),t.length%2?"!":""}),e=e.trim(),e==="!true"?e="false":e==="!false"&&(e="true"),e},n}(),fe=function(){function n(){}return n.EnableFor=function(e){e._tags=e._tags||{},e.hasTags=function(){return n.HasTags(e)},e.addTags=function(t){return n.AddTagsTo(e,t)},e.removeTags=function(t){return n.RemoveTagsFrom(e,t)},e.matchesTagsQuery=function(t){return n.MatchesQuery(e,t)}},n.DisableFor=function(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery},n.HasTags=function(e){if(!e._tags)return!1;var t=e._tags;for(var i in t)if(t.hasOwnProperty(i))return!0;return!1},n.GetTags=function(e,t){if(t===void 0&&(t=!0),!e._tags)return null;if(t){var i=[];for(var r in e._tags)e._tags.hasOwnProperty(r)&&e._tags[r]===!0&&i.push(r);return i.join(" ")}else return e._tags},n.AddTagsTo=function(e,t){if(t&&typeof t=="string"){var i=t.split(" ");i.forEach(function(r,a,o){n._AddTagTo(e,r)})}},n._AddTagTo=function(e,t){t=t.trim(),!(t===""||t==="true"||t==="false")&&(t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(n.EnableFor(e),e._tags[t]=!0))},n.RemoveTagsFrom=function(e,t){if(n.HasTags(e)){var i=t.split(" ");for(var r in i)n._RemoveTagFrom(e,i[r])}},n._RemoveTagFrom=function(e,t){delete e._tags[t]},n.MatchesQuery=function(e,t){return t===void 0?!0:t===""?n.HasTags(e):cr.Eval(t,function(i){return n.HasTags(e)&&e._tags[i]})},n}(),U=function(){function n(){}return n.WarnImport=function(e){return e+" needs to be imported before as it contains a side-effect required by your code."},n}(),Xt={},Gt={},Pi=function(n,e,t){var i=n();fe&&fe.AddTagsTo(i,e.tags);var r=ai(i);for(var a in r){var o=r[a],s=e[a],l=o.type;if(s!=null&&a!=="uniqueId")switch(l){case 0:case 6:case 11:i[a]=s;break;case 1:i[a]=t||s.isRenderTarget?s:s.clone();break;case 2:case 3:case 4:case 5:case 7:case 10:case 12:i[a]=t?s:s.clone();break}}return i};function hr(n){var e=n.getClassName();return Xt[e]||(Xt[e]={}),Xt[e]}function ai(n){var e=n.getClassName();if(Gt[e])return Gt[e];Gt[e]={};for(var t=Gt[e],i=n,r=e;r;){var a=Xt[r];for(var o in a)t[o]=a[o];var s=void 0,l=!1;do{if(s=Object.getPrototypeOf(i),!s.getClassName){l=!0;break}if(s.getClassName()!==r)break;i=s}while(s);if(l)break;r=s.getClassName(),i=s}return t}function Ne(n,e){return function(t,i){var r=hr(t);r[i]||(r[i]={type:n,sourceName:e})}}function dr(n,e){return e===void 0&&(e=null),function(t,i){var r=e||"_"+i;Object.defineProperty(t,i,{get:function(){return this[r]},set:function(a){this[r]!==a&&(this[r]=a,t[n].apply(this))},enumerable:!0,configurable:!0})}}function I(n,e){return e===void 0&&(e=null),dr(n,e)}function A(n){return Ne(0,n)}function oe(n){return Ne(1,n)}function Me(n){return Ne(2,n)}function bt(n){return Ne(3,n)}function pr(n){return Ne(4,n)}function Ge(n){return Ne(5,n)}function _r(n){return Ne(6,n)}function vr(n){return Ne(7,n)}function Hi(n){return Ne(8,n)}function gr(n){return Ne(9,n)}function mr(n){return Ne(10,n)}function Er(n){return Ne(12,n)}function Ks(n){return Ne(11,n)}var H=function(){function n(){}return n.AppendSerializedAnimations=function(e,t){if(e.animations){t.animations=[];for(var i=0;i<e.animations.length;i++){var r=e.animations[i];t.animations.push(r.serialize())}}},n.Serialize=function(e,t){t||(t={}),fe&&(t.tags=fe.GetTags(e));var i=ai(e);for(var r in i){var a=i[r],o=a.sourceName||r,s=a.type,l=e[r];if(l!=null&&r!=="uniqueId")switch(s){case 0:t[o]=l;break;case 1:t[o]=l.serialize();break;case 2:t[o]=l.asArray();break;case 3:t[o]=l.serialize();break;case 4:t[o]=l.asArray();break;case 5:t[o]=l.asArray();break;case 6:t[o]=l.id;break;case 7:t[o]=l.serialize();break;case 8:t[o]=l.asArray();break;case 9:t[o]=l.serialize();break;case 10:t[o]=l.asArray();break;case 11:t[o]=l.id;case 12:t[o]=l.asArray();break}}return t},n.Parse=function(e,t,i,r){r===void 0&&(r=null);var a=e();r||(r=""),fe&&fe.AddTagsTo(a,t.tags);var o=ai(a);for(var s in o){var l=o[s],f=t[l.sourceName||s],u=l.type;if(f!=null&&s!=="uniqueId"){var c=a;switch(u){case 0:c[s]=f;break;case 1:i&&(c[s]=n._TextureParser(f,i,r));break;case 2:c[s]=J.FromArray(f);break;case 3:c[s]=n._FresnelParametersParser(f);break;case 4:c[s]=ce.FromArray(f);break;case 5:c[s]=m.FromArray(f);break;case 6:i&&(c[s]=i.getLastMeshByID(f));break;case 7:c[s]=n._ColorCurvesParser(f);break;case 8:c[s]=ye.FromArray(f);break;case 9:c[s]=n._ImageProcessingConfigurationParser(f);break;case 10:c[s]=W.FromArray(f);break;case 11:i&&(c[s]=i.getCameraByID(f));case 12:c[s]=P.FromArray(f);break}}}return a},n.Clone=function(e,t){return Pi(e,t,!1)},n.Instanciate=function(e,t){return Pi(e,t,!0)},n._ImageProcessingConfigurationParser=function(e){throw U.WarnImport("ImageProcessingConfiguration")},n._FresnelParametersParser=function(e){throw U.WarnImport("FresnelParameters")},n._ColorCurvesParser=function(e){throw U.WarnImport("ColorCurves")},n._TextureParser=function(e,t,i){throw U.WarnImport("Texture")},n}(),oi;(function(n){n[n.STEP=1]="STEP"})(oi||(oi={}));var Yt=function(){function n(e,t,i){this.name=e,this.from=t,this.to=i}return n.prototype.clone=function(){return new n(this.name,this.from,this.to)},n}(),De=function(){function n(e,t){t===void 0&&(t=null),this.state="",this.metadata=null,this.reservedDataStore=null,this._doNotSerialize=!1,this._isDisposed=!1,this.animations=new Array,this._ranges={},this.onReady=null,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=P.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._sceneRootNodesIndex=-1,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new O,this._onDisposeObserver=null,this._behaviors=new Array,this.name=e,this.id=e,this._scene=t||ne.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache()}return n.AddNodeConstructor=function(e,t){this._NodeConstructors[e]=t},n.Construct=function(e,t,i,r){var a=this._NodeConstructors[e];return a?a(t,i,r):null},Object.defineProperty(n.prototype,"doNotSerialize",{get:function(){return this._doNotSerialize?!0:this._parentNode?this._parentNode.doNotSerialize:!1},set:function(e){this._doNotSerialize=e},enumerable:!1,configurable:!0}),n.prototype.isDisposed=function(){return this._isDisposed},Object.defineProperty(n.prototype,"parent",{get:function(){return this._parentNode},set:function(e){if(this._parentNode!==e){var t=this._parentNode;if(this._parentNode&&this._parentNode._children!==void 0&&this._parentNode._children!==null){var i=this._parentNode._children.indexOf(this);i!==-1&&this._parentNode._children.splice(i,1),!e&&!this._isDisposed&&this._addToSceneRootNodes()}this._parentNode=e,this._parentNode&&((this._parentNode._children===void 0||this._parentNode._children===null)&&(this._parentNode._children=new Array),this._parentNode._children.push(this),t||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}},enumerable:!1,configurable:!0}),n.prototype._addToSceneRootNodes=function(){this._sceneRootNodesIndex===-1&&(this._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))},n.prototype._removeFromSceneRootNodes=function(){if(this._sceneRootNodesIndex!==-1){var e=this._scene.rootNodes,t=e.length-1;e[this._sceneRootNodesIndex]=e[t],e[this._sceneRootNodesIndex]._sceneRootNodesIndex=this._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._sceneRootNodesIndex=-1}},Object.defineProperty(n.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),n.prototype.getClassName=function(){return"Node"},Object.defineProperty(n.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),n.prototype.getScene=function(){return this._scene},n.prototype.getEngine=function(){return this._scene.getEngine()},n.prototype.addBehavior=function(e,t){var i=this;t===void 0&&(t=!1);var r=this._behaviors.indexOf(e);return r!==-1?this:(e.init(),this._scene.isLoading&&!t?this._scene.onDataLoadedObservable.addOnce(function(){e.attach(i)}):e.attach(this),this._behaviors.push(e),this)},n.prototype.removeBehavior=function(e){var t=this._behaviors.indexOf(e);return t===-1?this:(this._behaviors[t].detach(),this._behaviors.splice(t,1),this)},Object.defineProperty(n.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!1,configurable:!0}),n.prototype.getBehaviorByName=function(e){for(var t=0,i=this._behaviors;t<i.length;t++){var r=i[t];if(r.name===e)return r}return null},n.prototype.getWorldMatrix=function(){return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix},n.prototype._getWorldMatrixDeterminant=function(){return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant},Object.defineProperty(n.prototype,"worldMatrixFromCache",{get:function(){return this._worldMatrix},enumerable:!1,configurable:!0}),n.prototype._initCache=function(){this._cache={},this._cache.parent=void 0},n.prototype.updateCache=function(e){!e&&this.isSynchronized()||(this._cache.parent=this.parent,this._updateCache())},n.prototype._getActionManagerForTrigger=function(e,t){return this.parent?this.parent._getActionManagerForTrigger(e,!1):null},n.prototype._updateCache=function(e){},n.prototype._isSynchronized=function(){return!0},n.prototype._markSyncedWithParent=function(){this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)},n.prototype.isSynchronizedWithParent=function(){return this._parentNode?this._parentUpdateId!==this._parentNode._childUpdateId?!1:this._parentNode.isSynchronized():!0},n.prototype.isSynchronized=function(){return this._cache.parent!=this._parentNode?(this._cache.parent=this._parentNode,!1):this._parentNode&&!this.isSynchronizedWithParent()?!1:this._isSynchronized()},n.prototype.isReady=function(e){return this._isReady},n.prototype.isEnabled=function(e){return e===void 0&&(e=!0),e===!1?this._isEnabled:this._isEnabled?this._isParentEnabled:!1},n.prototype._syncParentEnabledState=function(){this._isParentEnabled=this._parentNode?this._parentNode.isEnabled():!0,this._children&&this._children.forEach(function(e){e._syncParentEnabledState()})},n.prototype.setEnabled=function(e){this._isEnabled=e,this._syncParentEnabledState()},n.prototype.isDescendantOf=function(e){return this.parent?this.parent===e?!0:this.parent.isDescendantOf(e):!1},n.prototype._getDescendants=function(e,t,i){if(t===void 0&&(t=!1),!!this._children)for(var r=0;r<this._children.length;r++){var a=this._children[r];(!i||i(a))&&e.push(a),t||a._getDescendants(e,!1,i)}},n.prototype.getDescendants=function(e,t){var i=new Array;return this._getDescendants(i,e,t),i},n.prototype.getChildMeshes=function(e,t){var i=[];return this._getDescendants(i,e,function(r){return(!t||t(r))&&r.cullingStrategy!==void 0}),i},n.prototype.getChildren=function(e,t){return t===void 0&&(t=!0),this.getDescendants(t,e)},n.prototype._setReady=function(e){if(e!==this._isReady){if(!e){this._isReady=!1;return}this.onReady&&this.onReady(this),this._isReady=!0}},n.prototype.getAnimationByName=function(e){for(var t=0;t<this.animations.length;t++){var i=this.animations[t];if(i.name===e)return i}return null},n.prototype.createAnimationRange=function(e,t,i){if(!this._ranges[e]){this._ranges[e]=n._AnimationRangeFactory(e,t,i);for(var r=0,a=this.animations.length;r<a;r++)this.animations[r]&&this.animations[r].createRange(e,t,i)}},n.prototype.deleteAnimationRange=function(e,t){t===void 0&&(t=!0);for(var i=0,r=this.animations.length;i<r;i++)this.animations[i]&&this.animations[i].deleteRange(e,t);this._ranges[e]=null},n.prototype.getAnimationRange=function(e){return this._ranges[e]||null},n.prototype.getAnimationRanges=function(){var e=[],t;for(t in this._ranges)e.push(this._ranges[t]);return e},n.prototype.beginAnimation=function(e,t,i,r){var a=this.getAnimationRange(e);return a?this._scene.beginAnimation(this,a.from,a.to,t,i,r):null},n.prototype.serializeAnimationRanges=function(){var e=[];for(var t in this._ranges){var i=this._ranges[t];if(i){var r={};r.name=t,r.from=i.from,r.to=i.to,e.push(r)}}return e},n.prototype.computeWorldMatrix=function(e){return this._worldMatrix||(this._worldMatrix=P.Identity()),this._worldMatrix},n.prototype.dispose=function(e,t){if(t===void 0&&(t=!1),this._isDisposed=!0,!e)for(var i=this.getDescendants(!0),r=0,a=i;r<a.length;r++){var o=a[r];o.dispose(e,t)}this.parent?this.parent=null:this._removeFromSceneRootNodes(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear();for(var s=0,l=this._behaviors;s<l.length;s++){var f=l[s];f.detach()}this._behaviors=[]},n.ParseAnimationRanges=function(e,t,i){if(t.ranges)for(var r=0;r<t.ranges.length;r++){var a=t.ranges[r];e.createAnimationRange(a.name,a.from,a.to)}},n.prototype.getHierarchyBoundingVectors=function(e,t){e===void 0&&(e=!0),t===void 0&&(t=null),this.getScene().incrementRenderId(),this.computeWorldMatrix(!0);var i,r,a=this;if(a.getBoundingInfo&&a.subMeshes){var o=a.getBoundingInfo();i=o.boundingBox.minimumWorld.clone(),r=o.boundingBox.maximumWorld.clone()}else i=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(e)for(var s=this.getDescendants(!1),l=0,f=s;l<f.length;l++){var u=f[l],c=u;if(c.computeWorldMatrix(!0),!(t&&!t(c))&&!(!c.getBoundingInfo||c.getTotalVertices()===0)){var h=c.getBoundingInfo(),p=h.boundingBox,d=p.minimumWorld,_=p.maximumWorld;m.CheckExtends(d,i,r),m.CheckExtends(_,i,r)}}return{min:i,max:r}},n._AnimationRangeFactory=function(e,t,i){throw U.WarnImport("AnimationRange")},n._NodeConstructors={},g([A()],n.prototype,"name",void 0),g([A()],n.prototype,"id",void 0),g([A()],n.prototype,"uniqueId",void 0),g([A()],n.prototype,"state",void 0),g([A()],n.prototype,"metadata",void 0),n}(),Dt=function(){function n(e,t){this.width=e,this.height=t}return n.prototype.toString=function(){return"{W: "+this.width+", H: "+this.height+"}"},n.prototype.getClassName=function(){return"Size"},n.prototype.getHashCode=function(){var e=this.width|0;return e=e*397^(this.height|0),e},n.prototype.copyFrom=function(e){this.width=e.width,this.height=e.height},n.prototype.copyFromFloats=function(e,t){return this.width=e,this.height=t,this},n.prototype.set=function(e,t){return this.copyFromFloats(e,t)},n.prototype.multiplyByFloats=function(e,t){return new n(this.width*e,this.height*t)},n.prototype.clone=function(){return new n(this.width,this.height)},n.prototype.equals=function(e){return e?this.width===e.width&&this.height===e.height:!1},Object.defineProperty(n.prototype,"surface",{get:function(){return this.width*this.height},enumerable:!1,configurable:!0}),n.Zero=function(){return new n(0,0)},n.prototype.add=function(e){var t=new n(this.width+e.width,this.height+e.height);return t},n.prototype.subtract=function(e){var t=new n(this.width-e.width,this.height-e.height);return t},n.Lerp=function(e,t,i){var r=e.width+(t.width-e.width)*i,a=e.height+(t.height-e.height)*i;return new n(r,a)},n}();function yr(){return typeof _native<"u"&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest}var ft=function(){function n(){this._xhr=yr()}return n.prototype._injectCustomRequestHeaders=function(){for(var e in n.CustomRequestHeaders){var t=n.CustomRequestHeaders[e];t&&this._xhr.setRequestHeader(e,t)}},Object.defineProperty(n.prototype,"onprogress",{get:function(){return this._xhr.onprogress},set:function(e){this._xhr.onprogress=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"readyState",{get:function(){return this._xhr.readyState},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"status",{get:function(){return this._xhr.status},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"statusText",{get:function(){return this._xhr.statusText},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"response",{get:function(){return this._xhr.response},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"responseURL",{get:function(){return this._xhr.responseURL},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"responseText",{get:function(){return this._xhr.responseText},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"responseType",{get:function(){return this._xhr.responseType},set:function(e){this._xhr.responseType=e},enumerable:!1,configurable:!0}),n.prototype.addEventListener=function(e,t,i){this._xhr.addEventListener(e,t,i)},n.prototype.removeEventListener=function(e,t,i){this._xhr.removeEventListener(e,t,i)},n.prototype.abort=function(){this._xhr.abort()},n.prototype.send=function(e){n.CustomRequestHeaders&&this._injectCustomRequestHeaders(),this._xhr.send(e)},n.prototype.open=function(e,t){for(var i=0,r=n.CustomRequestModifiers;i<r.length;i++){var a=r[i];a(this._xhr,t)}return t=t.replace("file:http:","http:"),t=t.replace("file:https:","https:"),this._xhr.open(e,t,!0)},n.prototype.setRequestHeader=function(e,t){this._xhr.setRequestHeader(e,t)},n.prototype.getResponseHeader=function(e){return this._xhr.getResponseHeader(e)},n.CustomRequestHeaders={},n.CustomRequestModifiers=new Array,n}(),Qs=function(){function n(){}return n}(),he=function(){function n(e,t,i,r,a,o){this.name=e,this.targetProperty=t,this.framePerSecond=i,this.dataType=r,this.loopMode=a,this.enableBlending=o,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this.targetPropertyPath=t.split("."),this.dataType=r,this.loopMode=a===void 0?n.ANIMATIONLOOPMODE_CYCLE:a}return n._PrepareAnimation=function(e,t,i,r,a,o,s,l){var f=void 0;if(!isNaN(parseFloat(a))&&isFinite(a)?f=n.ANIMATIONTYPE_FLOAT:a instanceof W?f=n.ANIMATIONTYPE_QUATERNION:a instanceof m?f=n.ANIMATIONTYPE_VECTOR3:a instanceof ce?f=n.ANIMATIONTYPE_VECTOR2:a instanceof J?f=n.ANIMATIONTYPE_COLOR3:a instanceof ye?f=n.ANIMATIONTYPE_COLOR4:a instanceof Dt&&(f=n.ANIMATIONTYPE_SIZE),f==null)return null;var u=new n(e,t,i,f,s),c=[{frame:0,value:a},{frame:r,value:o}];return u.setKeys(c),l!==void 0&&u.setEasingFunction(l),u},n.CreateAnimation=function(e,t,i,r){var a=new n(e+"Animation",e,i,t,n.ANIMATIONLOOPMODE_CONSTANT);return a.setEasingFunction(r),a},n.CreateAndStartAnimation=function(e,t,i,r,a,o,s,l,f,u){var c=n._PrepareAnimation(e,i,r,a,o,s,l,f);return c?t.getScene().beginDirectAnimation(t,[c],0,a,c.loopMode===1,1,u):null},n.CreateAndStartHierarchyAnimation=function(e,t,i,r,a,o,s,l,f,u,c){var h=n._PrepareAnimation(e,r,a,o,s,l,f,u);if(!h)return null;var p=t.getScene();return p.beginDirectHierarchyAnimation(t,i,[h],0,o,h.loopMode===1,1,c)},n.CreateMergeAndStartAnimation=function(e,t,i,r,a,o,s,l,f,u){var c=n._PrepareAnimation(e,i,r,a,o,s,l,f);return c?(t.animations.push(c),t.getScene().beginAnimation(t,0,a,c.loopMode===1,1,u)):null},n.MakeAnimationAdditive=function(e,t,i,r,a){t===void 0&&(t=0),r===void 0&&(r=!1);var o=e;if(r&&(o=e.clone(),o.name=a||o.name),!o._keys.length)return o;t=t>=0?t:0;var s=0,l=o._keys[0],f=o._keys.length-1,u=o._keys[f],c={referenceValue:l.value,referencePosition:D.Vector3[0],referenceQuaternion:D.Quaternion[0],referenceScaling:D.Vector3[1],keyPosition:D.Vector3[2],keyQuaternion:D.Quaternion[1],keyScaling:D.Vector3[3]},h=!1,p=l.frame,d=u.frame;if(i){var _=o.getRange(i);_&&(p=_.from,d=_.to)}var v=l.frame===p,E=u.frame===d;if(o._keys.length===1){var y=o._getKeyValue(o._keys[0]);c.referenceValue=y.clone?y.clone():y,h=!0}else if(t<=l.frame){var y=o._getKeyValue(l.value);c.referenceValue=y.clone?y.clone():y,h=!0}else if(t>=u.frame){var y=o._getKeyValue(u.value);c.referenceValue=y.clone?y.clone():y,h=!0}for(var R=0;!h||!v||!E&&R<o._keys.length-1;){var S=o._keys[R],M=o._keys[R+1];if(!h&&t>=S.frame&&t<=M.frame){var y=void 0;if(t===S.frame)y=o._getKeyValue(S.value);else if(t===M.frame)y=o._getKeyValue(M.value);else{var C={key:R,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT};y=o._interpolate(t,C)}c.referenceValue=y.clone?y.clone():y,h=!0}if(!v&&p>=S.frame&&p<=M.frame){if(p===S.frame)s=R;else if(p===M.frame)s=R+1;else{var C={key:R,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT},y=o._interpolate(p,C),b={frame:p,value:y.clone?y.clone():y};o._keys.splice(R+1,0,b),s=R+1}v=!0}if(!E&&d>=S.frame&&d<=M.frame){if(d===S.frame)f=R;else if(d===M.frame)f=R+1;else{var C={key:R,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT},y=o._interpolate(d,C),b={frame:d,value:y.clone?y.clone():y};o._keys.splice(R+1,0,b),f=R+1}E=!0}R++}o.dataType===n.ANIMATIONTYPE_QUATERNION?c.referenceValue.normalize().conjugateInPlace():o.dataType===n.ANIMATIONTYPE_MATRIX&&(c.referenceValue.decompose(c.referenceScaling,c.referenceQuaternion,c.referencePosition),c.referenceQuaternion.normalize().conjugateInPlace());for(var R=s;R<=f;R++){var b=o._keys[R];if(!(R&&o.dataType!==n.ANIMATIONTYPE_FLOAT&&b.value===l.value))switch(o.dataType){case n.ANIMATIONTYPE_MATRIX:b.value.decompose(c.keyScaling,c.keyQuaternion,c.keyPosition),c.keyPosition.subtractInPlace(c.referencePosition),c.keyScaling.divideInPlace(c.referenceScaling),c.referenceQuaternion.multiplyToRef(c.keyQuaternion,c.keyQuaternion),P.ComposeToRef(c.keyScaling,c.keyQuaternion,c.keyPosition,b.value);break;case n.ANIMATIONTYPE_QUATERNION:c.referenceValue.multiplyToRef(b.value,b.value);break;case n.ANIMATIONTYPE_VECTOR2:case n.ANIMATIONTYPE_VECTOR3:case n.ANIMATIONTYPE_COLOR3:case n.ANIMATIONTYPE_COLOR4:b.value.subtractToRef(c.referenceValue,b.value);break;case n.ANIMATIONTYPE_SIZE:b.value.width-=c.referenceValue.width,b.value.height-=c.referenceValue.height;break;default:b.value-=c.referenceValue}}return o},n.TransitionTo=function(e,t,i,r,a,o,s,l){if(l===void 0&&(l=null),s<=0)return i[e]=t,l&&l(),null;var f=a*(s/1e3);o.setKeys([{frame:0,value:i[e].clone?i[e].clone():i[e]},{frame:f,value:t}]),i.animations||(i.animations=[]),i.animations.push(o);var u=r.beginAnimation(i,0,f,!1);return u.onAnimationEnd=l,u},Object.defineProperty(n.prototype,"runtimeAnimations",{get:function(){return this._runtimeAnimations},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasRunningRuntimeAnimations",{get:function(){for(var e=0,t=this._runtimeAnimations;e<t.length;e++){var i=t[e];if(!i.isStopped)return!0}return!1},enumerable:!1,configurable:!0}),n.prototype.toString=function(e){var t="Name: "+this.name+", property: "+this.targetProperty;if(t+=", datatype: "+["Float","Vector3","Quaternion","Matrix","Color3","Vector2"][this.dataType],t+=", nKeys: "+(this._keys?this._keys.length:"none"),t+=", nRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";var i=!0;for(var r in this._ranges)i&&(t+=", ",i=!1),t+=r;t+="}"}return t},n.prototype.addEvent=function(e){this._events.push(e),this._events.sort(function(t,i){return t.frame-i.frame})},n.prototype.removeEvents=function(e){for(var t=0;t<this._events.length;t++)this._events[t].frame===e&&(this._events.splice(t,1),t--)},n.prototype.getEvents=function(){return this._events},n.prototype.createRange=function(e,t,i){this._ranges[e]||(this._ranges[e]=new Yt(e,t,i))},n.prototype.deleteRange=function(e,t){t===void 0&&(t=!0);var i=this._ranges[e];if(i){if(t)for(var r=i.from,a=i.to,o=this._keys.length-1;o>=0;o--)this._keys[o].frame>=r&&this._keys[o].frame<=a&&this._keys.splice(o,1);this._ranges[e]=null}},n.prototype.getRange=function(e){return this._ranges[e]},n.prototype.getKeys=function(){return this._keys},n.prototype.getHighestFrame=function(){for(var e=0,t=0,i=this._keys.length;t<i;t++)e<this._keys[t].frame&&(e=this._keys[t].frame);return e},n.prototype.getEasingFunction=function(){return this._easingFunction},n.prototype.setEasingFunction=function(e){this._easingFunction=e},n.prototype.floatInterpolateFunction=function(e,t,i){return K.Lerp(e,t,i)},n.prototype.floatInterpolateFunctionWithTangents=function(e,t,i,r,a){return K.Hermite(e,t,i,r,a)},n.prototype.quaternionInterpolateFunction=function(e,t,i){return W.Slerp(e,t,i)},n.prototype.quaternionInterpolateFunctionWithTangents=function(e,t,i,r,a){return W.Hermite(e,t,i,r,a).normalize()},n.prototype.vector3InterpolateFunction=function(e,t,i){return m.Lerp(e,t,i)},n.prototype.vector3InterpolateFunctionWithTangents=function(e,t,i,r,a){return m.Hermite(e,t,i,r,a)},n.prototype.vector2InterpolateFunction=function(e,t,i){return ce.Lerp(e,t,i)},n.prototype.vector2InterpolateFunctionWithTangents=function(e,t,i,r,a){return ce.Hermite(e,t,i,r,a)},n.prototype.sizeInterpolateFunction=function(e,t,i){return Dt.Lerp(e,t,i)},n.prototype.color3InterpolateFunction=function(e,t,i){return J.Lerp(e,t,i)},n.prototype.color4InterpolateFunction=function(e,t,i){return ye.Lerp(e,t,i)},n.prototype._getKeyValue=function(e){return typeof e=="function"?e():e},n.prototype._interpolate=function(e,t){if(t.loopMode===n.ANIMATIONLOOPMODE_CONSTANT&&t.repeatCount>0)return t.highLimitValue.clone?t.highLimitValue.clone():t.highLimitValue;var i=this._keys;if(i.length===1)return this._getKeyValue(i[0].value);var r=t.key;if(i[r].frame>=e)for(;r-1>=0&&i[r].frame>=e;)r--;for(var a=r;a<i.length;a++){var o=i[a+1];if(o.frame>=e){t.key=a;var s=i[a],l=this._getKeyValue(s.value);if(s.interpolation===oi.STEP)return l;var f=this._getKeyValue(o.value),u=s.outTangent!==void 0&&o.inTangent!==void 0,c=o.frame-s.frame,h=(e-s.frame)/c,p=this.getEasingFunction();switch(p!=null&&(h=p.ease(h)),this.dataType){case n.ANIMATIONTYPE_FLOAT:var d=u?this.floatInterpolateFunctionWithTangents(l,s.outTangent*c,f,o.inTangent*c,h):this.floatInterpolateFunction(l,f,h);switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return d;case n.ANIMATIONLOOPMODE_RELATIVE:return t.offsetValue*t.repeatCount+d}break;case n.ANIMATIONTYPE_QUATERNION:var _=u?this.quaternionInterpolateFunctionWithTangents(l,s.outTangent.scale(c),f,o.inTangent.scale(c),h):this.quaternionInterpolateFunction(l,f,h);switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return _;case n.ANIMATIONLOOPMODE_RELATIVE:return _.addInPlace(t.offsetValue.scale(t.repeatCount))}return _;case n.ANIMATIONTYPE_VECTOR3:var v=u?this.vector3InterpolateFunctionWithTangents(l,s.outTangent.scale(c),f,o.inTangent.scale(c),h):this.vector3InterpolateFunction(l,f,h);switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return v;case n.ANIMATIONLOOPMODE_RELATIVE:return v.add(t.offsetValue.scale(t.repeatCount))}case n.ANIMATIONTYPE_VECTOR2:var E=u?this.vector2InterpolateFunctionWithTangents(l,s.outTangent.scale(c),f,o.inTangent.scale(c),h):this.vector2InterpolateFunction(l,f,h);switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return E;case n.ANIMATIONLOOPMODE_RELATIVE:return E.add(t.offsetValue.scale(t.repeatCount))}case n.ANIMATIONTYPE_SIZE:switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(l,f,h);case n.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(l,f,h).add(t.offsetValue.scale(t.repeatCount))}case n.ANIMATIONTYPE_COLOR3:switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return this.color3InterpolateFunction(l,f,h);case n.ANIMATIONLOOPMODE_RELATIVE:return this.color3InterpolateFunction(l,f,h).add(t.offsetValue.scale(t.repeatCount))}case n.ANIMATIONTYPE_COLOR4:switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:return this.color4InterpolateFunction(l,f,h);case n.ANIMATIONLOOPMODE_RELATIVE:return this.color4InterpolateFunction(l,f,h).add(t.offsetValue.scale(t.repeatCount))}case n.ANIMATIONTYPE_MATRIX:switch(t.loopMode){case n.ANIMATIONLOOPMODE_CYCLE:case n.ANIMATIONLOOPMODE_CONSTANT:if(n.AllowMatricesInterpolation)return this.matrixInterpolateFunction(l,f,h,t.workValue);case n.ANIMATIONLOOPMODE_RELATIVE:return l}}break}}return this._getKeyValue(i[i.length-1].value)},n.prototype.matrixInterpolateFunction=function(e,t,i,r){return n.AllowMatrixDecomposeForInterpolation?r?(P.DecomposeLerpToRef(e,t,i,r),r):P.DecomposeLerp(e,t,i):r?(P.LerpToRef(e,t,i,r),r):P.Lerp(e,t,i)},n.prototype.clone=function(){var e=new n(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed,this._keys&&e.setKeys(this._keys),this._ranges){e._ranges={};for(var t in this._ranges){var i=this._ranges[t];i&&(e._ranges[t]=i.clone())}}return e},n.prototype.setKeys=function(e){this._keys=e.slice(0)},n.prototype.serialize=function(){var e={};e.name=this.name,e.property=this.targetProperty,e.framePerSecond=this.framePerSecond,e.dataType=this.dataType,e.loopBehavior=this.loopMode,e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed;var t=this.dataType;e.keys=[];for(var i=this.getKeys(),r=0;r<i.length;r++){var a=i[r],o={};switch(o.frame=a.frame,t){case n.ANIMATIONTYPE_FLOAT:o.values=[a.value],a.inTangent!==void 0&&o.values.push(a.inTangent),a.outTangent!==void 0&&(a.inTangent===void 0&&o.values.push(void 0),o.values.push(a.outTangent));break;case n.ANIMATIONTYPE_QUATERNION:case n.ANIMATIONTYPE_MATRIX:case n.ANIMATIONTYPE_VECTOR3:case n.ANIMATIONTYPE_COLOR3:case n.ANIMATIONTYPE_COLOR4:o.values=a.value.asArray(),a.inTangent!=null&&o.values.push(a.inTangent.asArray()),a.outTangent!=null&&(a.inTangent===void 0&&o.values.push(void 0),o.values.push(a.outTangent.asArray()));break}e.keys.push(o)}e.ranges=[];for(var s in this._ranges){var l=this._ranges[s];if(l){var f={};f.name=s,f.from=l.from,f.to=l.to,e.ranges.push(f)}}return e},n._UniversalLerp=function(e,t,i){var r=e.constructor;return r.Lerp?r.Lerp(e,t,i):r.Slerp?r.Slerp(e,t,i):e.toFixed?e*(1-i)+i*t:t},n.Parse=function(e){var t=new n(e.name,e.property,e.framePerSecond,e.dataType,e.loopBehavior),i=e.dataType,r=[],a,o;for(e.enableBlending&&(t.enableBlending=e.enableBlending),e.blendingSpeed&&(t.blendingSpeed=e.blendingSpeed),o=0;o<e.keys.length;o++){var s=e.keys[o],l,f;switch(i){case n.ANIMATIONTYPE_FLOAT:a=s.values[0],s.values.length>=1&&(l=s.values[1]),s.values.length>=2&&(f=s.values[2]);break;case n.ANIMATIONTYPE_QUATERNION:if(a=W.FromArray(s.values),s.values.length>=8){var u=W.FromArray(s.values.slice(4,8));u.equals(W.Zero())||(l=u)}if(s.values.length>=12){var c=W.FromArray(s.values.slice(8,12));c.equals(W.Zero())||(f=c)}break;case n.ANIMATIONTYPE_MATRIX:a=P.FromArray(s.values);break;case n.ANIMATIONTYPE_COLOR3:a=J.FromArray(s.values);break;case n.ANIMATIONTYPE_COLOR4:a=ye.FromArray(s.values);break;case n.ANIMATIONTYPE_VECTOR3:default:a=m.FromArray(s.values);break}var h={};h.frame=s.frame,h.value=a,l!=null&&(h.inTangent=l),f!=null&&(h.outTangent=f),r.push(h)}if(t.setKeys(r),e.ranges)for(o=0;o<e.ranges.length;o++)a=e.ranges[o],t.createRange(a.name,a.from,a.to);return t},n.AppendSerializedAnimations=function(e,t){H.AppendSerializedAnimations(e,t)},n.ParseFromFileAsync=function(e,t){var i=this;return new Promise(function(r,a){var o=new ft;o.addEventListener("readystatechange",function(){if(o.readyState==4)if(o.status==200){var s=JSON.parse(o.responseText);if(s.length){for(var l=new Array,f=0,u=s;f<u.length;f++){var c=u[f];l.push(i.Parse(c))}r(l)}else{var l=i.Parse(s);e&&(l.name=e),r(l)}}else a("Unable to load the animation")}),o.open("GET",t),o.send()})},n.CreateFromSnippetAsync=function(e){var t=this;return new Promise(function(i,r){var a=new ft;a.addEventListener("readystatechange",function(){if(a.readyState==4)if(a.status==200){var o=JSON.parse(JSON.parse(a.responseText).jsonPayload);if(o.animations){for(var s=JSON.parse(o.animations),l=new Array,f=0,u=s;f<u.length;f++){var c=u[f];l.push(t.Parse(c))}i(l)}else{var s=JSON.parse(o.animation),l=t.Parse(s);l.snippetId=e,i(l)}}else r("Unable to load the snippet "+e)}),a.open("GET",t.SnippetUrl+"/"+e.replace(/#/g,"/")),a.send()})},n.AllowMatricesInterpolation=!1,n.AllowMatrixDecomposeForInterpolation=!0,n.SnippetUrl="https://snippet.babylonjs.com",n.ANIMATIONTYPE_FLOAT=0,n.ANIMATIONTYPE_VECTOR3=1,n.ANIMATIONTYPE_QUATERNION=2,n.ANIMATIONTYPE_MATRIX=3,n.ANIMATIONTYPE_COLOR3=4,n.ANIMATIONTYPE_COLOR4=7,n.ANIMATIONTYPE_VECTOR2=5,n.ANIMATIONTYPE_SIZE=6,n.ANIMATIONLOOPMODE_RELATIVE=0,n.ANIMATIONLOOPMODE_CYCLE=1,n.ANIMATIONLOOPMODE_CONSTANT=2,n}();de.RegisteredTypes["BABYLON.Animation"]=he;De._AnimationRangeFactory=function(n,e,t){return new Yt(n,e,t)};var Tr=Object.freeze(new W(0,0,0,0)),Ar=Object.freeze(m.Zero()),Rr=Object.freeze(ce.Zero()),br=Object.freeze(Dt.Zero()),Sr=Object.freeze(J.Black()),Cr=function(){function n(e,t,i,r){var a=this;if(this._events=new Array,this._currentFrame=0,this._originalValue=new Array,this._originalBlendValue=null,this._offsetsCache={},this._highLimitsCache={},this._stopped=!1,this._blendingFactor=0,this._currentValue=null,this._currentActiveTarget=null,this._directTarget=null,this._targetPath="",this._weight=1,this._ratioOffset=0,this._previousDelay=0,this._previousRatio=0,this._targetIsArray=!1,this._animation=t,this._target=e,this._scene=i,this._host=r,this._activeTargets=[],t._runtimeAnimations.push(this),this._animationState={key:0,repeatCount:0,loopMode:this._getCorrectLoopMode()},this._animation.dataType===he.ANIMATIONTYPE_MATRIX&&(this._animationState.workValue=P.Zero()),this._keys=this._animation.getKeys(),this._minFrame=this._keys[0].frame,this._maxFrame=this._keys[this._keys.length-1].frame,this._minValue=this._keys[0].value,this._maxValue=this._keys[this._keys.length-1].value,this._minFrame!==0){var o={frame:0,value:this._minValue};this._keys.splice(0,0,o)}if(this._target instanceof Array){for(var s=0,l=0,f=this._target;l<f.length;l++){var u=f[l];this._preparePath(u,s),this._getOriginalValues(s),s++}this._targetIsArray=!0}else this._preparePath(this._target),this._getOriginalValues(),this._targetIsArray=!1,this._directTarget=this._activeTargets[0];var c=t.getEvents();c&&c.length>0&&c.forEach(function(h){a._events.push(h._clone())}),this._enableBlending=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.enableBlending:this._animation.enableBlending}return Object.defineProperty(n.prototype,"currentFrame",{get:function(){return this._currentFrame},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"weight",{get:function(){return this._weight},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetPath",{get:function(){return this._targetPath},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"target",{get:function(){return this._currentActiveTarget},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isAdditive",{get:function(){return this._host&&this._host.isAdditive},enumerable:!1,configurable:!0}),n.prototype._preparePath=function(e,t){t===void 0&&(t=0);var i=this._animation.targetPropertyPath;if(i.length>1){for(var r=e[i[0]],a=1;a<i.length-1;a++)r=r[i[a]];this._targetPath=i[i.length-1],this._activeTargets[t]=r}else this._targetPath=i[0],this._activeTargets[t]=e},Object.defineProperty(n.prototype,"animation",{get:function(){return this._animation},enumerable:!1,configurable:!0}),n.prototype.reset=function(e){if(e===void 0&&(e=!1),e)if(this._target instanceof Array)for(var t=0,i=0,r=this._target;i<r.length;i++){var a=r[i];this._originalValue[t]!==void 0&&this._setValue(a,this._activeTargets[t],this._originalValue[t],-1,t),t++}else this._originalValue[0]!==void 0&&this._setValue(this._target,this._directTarget,this._originalValue[0],-1,0);this._offsetsCache={},this._highLimitsCache={},this._currentFrame=0,this._blendingFactor=0;for(var t=0;t<this._events.length;t++)this._events[t].isDone=!1},n.prototype.isStopped=function(){return this._stopped},n.prototype.dispose=function(){var e=this._animation.runtimeAnimations.indexOf(this);e>-1&&this._animation.runtimeAnimations.splice(e,1)},n.prototype.setValue=function(e,t){if(this._targetIsArray){for(var i=0;i<this._target.length;i++){var r=this._target[i];this._setValue(r,this._activeTargets[i],e,t,i)}return}this._setValue(this._target,this._directTarget,e,t,0)},n.prototype._getOriginalValues=function(e){e===void 0&&(e=0);var t,i=this._activeTargets[e];i.getRestPose&&this._targetPath==="_matrix"?t=i.getRestPose():t=i[this._targetPath],t&&t.clone?this._originalValue[e]=t.clone():this._originalValue[e]=t},n.prototype._setValue=function(e,t,i,r,a){if(this._currentActiveTarget=t,this._weight=r,this._enableBlending&&this._blendingFactor<=1){if(!this._originalBlendValue){var o=t[this._targetPath];o.clone?this._originalBlendValue=o.clone():this._originalBlendValue=o}this._originalBlendValue.m?he.AllowMatrixDecomposeForInterpolation?this._currentValue?P.DecomposeLerpToRef(this._originalBlendValue,i,this._blendingFactor,this._currentValue):this._currentValue=P.DecomposeLerp(this._originalBlendValue,i,this._blendingFactor):this._currentValue?P.LerpToRef(this._originalBlendValue,i,this._blendingFactor,this._currentValue):this._currentValue=P.Lerp(this._originalBlendValue,i,this._blendingFactor):this._currentValue=he._UniversalLerp(this._originalBlendValue,i,this._blendingFactor);var s=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.blendingSpeed:this._animation.blendingSpeed;this._blendingFactor+=s}else this._currentValue=i;r!==-1?this._scene._registerTargetForLateAnimationBinding(this,this._originalValue[a]):t[this._targetPath]=this._currentValue,e.markAsDirty&&e.markAsDirty(this._animation.targetProperty)},n.prototype._getCorrectLoopMode=function(){return this._target&&this._target.animationPropertiesOverride?this._target.animationPropertiesOverride.loopMode:this._animation.loopMode},n.prototype.goToFrame=function(e){var t=this._animation.getKeys();e<t[0].frame?e=t[0].frame:e>t[t.length-1].frame&&(e=t[t.length-1].frame);var i=this._events;if(i.length)for(var r=0;r<i.length;r++)i[r].onlyOnce||(i[r].isDone=i[r].frame<e);this._currentFrame=e;var a=this._animation._interpolate(e,this._animationState);this.setValue(a,-1)},n.prototype._prepareForSpeedRatioChange=function(e){var t=this._previousDelay*(this._animation.framePerSecond*e)/1e3;this._ratioOffset=this._previousRatio-t},n.prototype.animate=function(e,t,i,r,a,o){o===void 0&&(o=-1);var s=this._animation,l=s.targetPropertyPath;if(!l||l.length<1)return this._stopped=!0,!1;var f=!0;(t<this._minFrame||t>this._maxFrame)&&(t=this._minFrame),(i<this._minFrame||i>this._maxFrame)&&(i=this._maxFrame);var u=i-t,c,h=e*(s.framePerSecond*a)/1e3+this._ratioOffset,p=0;if(this._previousDelay=e,this._previousRatio=h,!r&&i>=t&&h>=u)f=!1,p=s._getKeyValue(this._maxValue);else if(!r&&t>=i&&h<=u)f=!1,p=s._getKeyValue(this._minValue);else if(this._animationState.loopMode!==he.ANIMATIONLOOPMODE_CYCLE){var d=i.toString()+t.toString();if(!this._offsetsCache[d]){this._animationState.repeatCount=0,this._animationState.loopMode=he.ANIMATIONLOOPMODE_CYCLE;var _=s._interpolate(t,this._animationState),v=s._interpolate(i,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),s.dataType){case he.ANIMATIONTYPE_FLOAT:this._offsetsCache[d]=v-_;break;case he.ANIMATIONTYPE_QUATERNION:this._offsetsCache[d]=v.subtract(_);break;case he.ANIMATIONTYPE_VECTOR3:this._offsetsCache[d]=v.subtract(_);case he.ANIMATIONTYPE_VECTOR2:this._offsetsCache[d]=v.subtract(_);case he.ANIMATIONTYPE_SIZE:this._offsetsCache[d]=v.subtract(_);case he.ANIMATIONTYPE_COLOR3:this._offsetsCache[d]=v.subtract(_)}this._highLimitsCache[d]=v}p=this._highLimitsCache[d],c=this._offsetsCache[d]}if(c===void 0)switch(s.dataType){case he.ANIMATIONTYPE_FLOAT:c=0;break;case he.ANIMATIONTYPE_QUATERNION:c=Tr;break;case he.ANIMATIONTYPE_VECTOR3:c=Ar;break;case he.ANIMATIONTYPE_VECTOR2:c=Rr;break;case he.ANIMATIONTYPE_SIZE:c=br;break;case he.ANIMATIONTYPE_COLOR3:c=Sr}var E;if(this._host&&this._host.syncRoot){var y=this._host.syncRoot,R=(y.masterFrame-y.fromFrame)/(y.toFrame-y.fromFrame);E=t+(i-t)*R}else E=f&&u!==0?t+h%u:i;var S=this._events;if((u>0&&this.currentFrame>E||u<0&&this.currentFrame<E)&&(this._onLoop(),S.length))for(var M=0;M<S.length;M++)S[M].onlyOnce||(S[M].isDone=!1);this._currentFrame=E,this._animationState.repeatCount=u===0?0:h/u>>0,this._animationState.highLimitValue=p,this._animationState.offsetValue=c;var C=s._interpolate(E,this._animationState);if(this.setValue(C,o),S.length){for(var M=0;M<S.length;M++)if(u>0&&E>=S[M].frame&&S[M].frame>=t||u<0&&E<=S[M].frame&&S[M].frame<=t){var b=S[M];b.isDone||(b.onlyOnce&&(S.splice(M,1),M--),b.isDone=!0,b.action(E))}}return f||(this._stopped=!0),f},n}(),ge=function(){function n(){}return n.IsWindowObjectExist=function(){return typeof window<"u"},n.IsNavigatorAvailable=function(){return typeof navigator<"u"},n.IsDocumentAvailable=function(){return typeof document<"u"},n.GetDOMTextContent=function(e){for(var t="",i=e.firstChild;i;)i.nodeType===3&&(t+=i.textContent),i=i.nextSibling;return t},n}(),ht=function(){function n(){}return Object.defineProperty(n,"Now",{get:function(){return ge.IsWindowObjectExist()&&window.performance&&window.performance.now?window.performance.now():Date.now()},enumerable:!1,configurable:!0}),n}(),Pt=function(){function n(){}return n.FilesToLoad={},n}(),Mr=function(){function n(){}return n.ExponentialBackoff=function(e,t){return e===void 0&&(e=3),t===void 0&&(t=500),function(i,r,a){return r.status!==0||a>=e||i.indexOf("file:")!==-1?-1:Math.pow(2,a)*t}},n}(),Et=function(n){j(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e._setPrototypeOf=Object.setPrototypeOf||function(t,i){return t.__proto__=i,t},e}(Error),Ot=function(){function n(){this.children=[]}return n.prototype.isValid=function(e){return!0},n.prototype.process=function(e,t){var i="";if(this.line){var r=this.line,a=t.processor;if(a){if(a.lineProcessor&&(r=a.lineProcessor(r,t.isFragment)),a.attributeProcessor&&Fe.StartsWith(this.line,"attribute"))r=a.attributeProcessor(this.line);else if(a.varyingProcessor&&Fe.StartsWith(this.line,"varying"))r=a.varyingProcessor(this.line,t.isFragment);else if((a.uniformProcessor||a.uniformBufferProcessor)&&Fe.StartsWith(this.line,"uniform")){var o=/uniform (.+) (.+)/;o.test(this.line)?a.uniformProcessor&&(r=a.uniformProcessor(this.line,t.isFragment)):a.uniformBufferProcessor&&(r=a.uniformBufferProcessor(this.line,t.isFragment),t.lookForClosingBracketForUniformBuffer=!0)}a.endOfUniformBufferProcessor&&t.lookForClosingBracketForUniformBuffer&&this.line.indexOf("}")!==-1&&(t.lookForClosingBracketForUniformBuffer=!1,r=a.endOfUniformBufferProcessor(this.line,t.isFragment))}i+=r+`\r
|
|
2
2
|
`}return this.children.forEach(function(s){i+=s.process(e,t)}),this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true"),i},n}(),Pr=function(){function n(){}return Object.defineProperty(n.prototype,"currentLine",{get:function(){return this._lines[this.lineIndex]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canRead",{get:function(){return this.lineIndex<this._lines.length-1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lines",{set:function(e){this._lines=[];for(var t=0,i=e;t<i.length;t++){var r=i[t];if(r[0]==="#"){this._lines.push(r);continue}for(var a=r.split(";"),o=0;o<a.length;o++){var s=a[o];s=s.trim(),s&&this._lines.push(s+(o!==a.length-1?";":""))}}},enumerable:!1,configurable:!0}),n}(),ei=function(n){j(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.process=function(t,i){for(var r=0;r<this.children.length;r++){var a=this.children[r];if(a.isValid(t))return a.process(t,i)}return""},e}(Ot),Ir=function(n){j(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.isValid=function(t){return this.testExpression.isTrue(t)},e}(Ot),Lt=function(){function n(){}return n.prototype.isTrue=function(e){return!0},n.postfixToInfix=function(e){for(var t=[],i=0,r=e;i<r.length;i++){var a=r[i];if(n._OperatorPriority[a]===void 0)t.push(a);else{var o=t[t.length-1],s=t[t.length-2];t.length-=2,t.push("("+s+a+o+")")}}return t[t.length-1]},n.infixToPostfix=function(e){for(var t=[],i=-1,r=function(){f=f.trim(),f!==""&&(t.push(f),f="")},a=function(h){i<n._Stack.length-1&&(n._Stack[++i]=h)},o=function(){return n._Stack[i]},s=function(){return i===-1?"!!INVALID EXPRESSION!!":n._Stack[i--]},l=0,f="";l<e.length;){var u=e.charAt(l),c=l<e.length-1?e.substr(l,2):"";if(u==="(")f="",a(u);else if(u===")"){for(r();i!==-1&&o()!=="(";)t.push(s());s()}else if(n._OperatorPriority[c]>1){for(r();i!==-1&&n._OperatorPriority[o()]>=n._OperatorPriority[c];)t.push(s());a(c),l++}else f+=u;l++}for(r();i!==-1;)o()==="("?s():t.push(s());return t},n._OperatorPriority={")":0,"(":1,"||":2,"&&":3},n._Stack=["","","","","","","","","","","","","","","","","","","",""],n}(),kt=function(n){j(e,n);function e(t,i){i===void 0&&(i=!1);var r=n.call(this)||this;return r.define=t,r.not=i,r}return e.prototype.isTrue=function(t){var i=t[this.define]!==void 0;return this.not&&(i=!i),i},e}(Lt),Or=function(n){j(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.isTrue=function(t){return this.leftOperand.isTrue(t)||this.rightOperand.isTrue(t)},e}(Lt),Dr=function(n){j(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.isTrue=function(t){return this.leftOperand.isTrue(t)&&this.rightOperand.isTrue(t)},e}(Lt),xr=function(n){j(e,n);function e(t,i,r){var a=n.call(this)||this;return a.define=t,a.operand=i,a.testValue=r,a}return e.prototype.isTrue=function(t){var i=t[this.define];i===void 0&&(i=this.define);var r=!1,a=parseInt(i),o=parseInt(this.testValue);switch(this.operand){case">":r=a>o;break;case"<":r=a<o;break;case"<=":r=a<=o;break;case">=":r=a>=o;break;case"==":r=a===o;break}return r},e}(Lt),Lr=/defined\s*?\((.+?)\)/g,ti=/defined\s*?\[(.+?)\]/g,si=function(){function n(){}return n.Process=function(e,t,i,r){var a=this;this._ProcessIncludes(e,t,function(o){var s=a._ProcessShaderConversion(o,t,r);i(s)})},n._ProcessPrecision=function(e,t){var i=t.shouldUseHighPrecisionShader;return e.indexOf("precision highp float")===-1?i?e=`precision highp float;
|
|
3
3
|
`+e:e=`precision mediump float;
|
|
4
4
|
`+e:i||(e=e.replace("precision highp float","precision mediump float")),e},n._ExtractOperation=function(e){var t=/defined\((.+)\)/,i=t.exec(e);if(i&&i.length)return new kt(i[1].trim(),e[0]==="!");for(var r=["==",">=","<=","<",">"],a="",o=0,s=0,l=r;s<l.length&&(a=l[s],o=e.indexOf(a),!(o>-1));s++);if(o===-1)return new kt(e);var f=e.substring(0,o).trim(),u=e.substring(o+a.length).trim();return new xr(f,a,u)},n._BuildSubExpression=function(e){e=e.replace(Lr,"defined[$1]");for(var t=Lt.infixToPostfix(e),i=[],r=0,a=t;r<a.length;r++){var o=a[r];if(o!=="||"&&o!=="&&")i.push(o);else if(i.length>=2){var s=i[i.length-1],l=i[i.length-2];i.length-=2;var f=o=="&&"?new Dr:new Or;typeof s=="string"&&(s=s.replace(ti,"defined($1)")),typeof l=="string"&&(l=l.replace(ti,"defined($1)")),f.leftOperand=typeof l=="string"?this._ExtractOperation(l):l,f.rightOperand=typeof s=="string"?this._ExtractOperation(s):s,i.push(f)}}var u=i[i.length-1];return typeof u=="string"&&(u=u.replace(ti,"defined($1)")),typeof u=="string"?this._ExtractOperation(u):u},n._BuildExpression=function(e,t){var i=new Ir,r=e.substring(0,t),a=e.substring(t);return a=a.substring(0,(a.indexOf("//")+1||a.length+1)-1).trim(),r==="#ifdef"?i.testExpression=new kt(a):r==="#ifndef"?i.testExpression=new kt(a,!0):i.testExpression=this._BuildSubExpression(a),i},n._MoveCursorWithinIf=function(e,t,i){for(var r=e.currentLine;this._MoveCursor(e,i);){r=e.currentLine;var a=r.substring(0,5).toLowerCase();if(a==="#else"){var o=new Ot;t.children.push(o),this._MoveCursor(e,o);return}else if(a==="#elif"){var s=this._BuildExpression(r,5);t.children.push(s),i=s}}},n._MoveCursor=function(e,t){for(;e.canRead;){e.lineIndex++;var i=e.currentLine,r=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/,a=r.exec(i);if(a&&a.length){var o=a[0];switch(o){case"#ifdef":{var s=new ei;t.children.push(s);var l=this._BuildExpression(i,6);s.children.push(l),this._MoveCursorWithinIf(e,s,l);break}case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":{var s=new ei;t.children.push(s);var l=this._BuildExpression(i,7);s.children.push(l),this._MoveCursorWithinIf(e,s,l);break}case"#if":{var s=new ei,l=this._BuildExpression(i,3);t.children.push(s),s.children.push(l),this._MoveCursorWithinIf(e,s,l);break}}}else{var f=new Ot;if(f.line=i,t.children.push(f),i[0]==="#"&&i[1]==="d"){var u=i.replace(";","").split(" ");f.additionalDefineKey=u[1],u.length===3&&(f.additionalDefineValue=u[2])}}}return!1},n._EvaluatePreProcessors=function(e,t,i){var r=new Ot,a=new Pr;return a.lineIndex=-1,a.lines=e.split(`
|