PageSourceSearch

https://pan0.net/latest/glTFLoader.js

js pan0.net collected 2026-10-02 12:18:02 UTC 157,323 bytes, 2 lines download raw bytes

1(self.webpackChunkpan0_net=self.webpackChunkpan0_net||[]).push([[775],{354:(e,t,n)=>{"use strict";n.d(t,{H:()=>h});var r=n(4635),i=n(8079),o=n(475),a=n(221),s=n(2973),l=n(5273),u=n(4164),h=function(){function e(e,t,n,r,i,a,s,l,u,h){void 0===n&&(n=0),void 0===r&&(r=100),void 0===i&&(i=!1),void 0===a&&(a=1),void 0===h&&(h=!1),this.target=t,this.fromFrame=n,this.toFrame=r,this.loopAnimation=i,this.onAnimationEnd=s,this.onAnimationLoop=u,this.isAdditive=h,this._localDelayOffset=null,this._pausedDelay=null,this._runtimeAnimations=new Array,this._paused=!1,this._speedRatio=1,this._weight=-1,this._syncRoot=null,this.disposeOnEnd=!0,this.animationStarted=!1,this.onAnimationEndObservable=new o.y$,this.onAnimationLoopObservable=new o.y$,this._scene=e,l&&this.appendAnimations(t,l),this._speedRatio=a,e._activeAnimatables.push(this)}return Object.defineProperty(e.prototype,"syncRoot",{get:function(){return this._syncRoot},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"masterFrame",{get:function(){return 0===this._runtimeAnimations.length?0:this._runtimeAnimations[0].currentFrame},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"weight",{get:function(){return this._weight},set:function(e){this._weight=-1!==e?Math.min(Math.max(e,0),1):-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speedRatio",{get:function(){return this._speedRatio},set:function(e){for(var t=0;t<this._runtimeAnimations.length;t++)this._runtimeAnimations[t]._prepareForSpeedRatioChange(e);this._speedRatio=e},enumerable:!1,configurable:!0}),e.prototype.syncWith=function(e){if(this._syncRoot=e,e){var t=this._scene._activeAnimatables.indexOf(this);t>-1&&(this._scene._activeAnimatables.splice(t,1),this._scene._activeAnimatables.push(this))}return this},e.prototype.getAnimations=function(){return this._runtimeAnimations},e.prototype.appendAnimations=function(e,t){for(var n=this,r=0;r<t.length;r++){var o=t[r],a=new i.o(e,o,this._scene,this);a._onLoop=function(){n.onAnimationLoopObservable.notifyObservers(n),n.onAnimationLoop&&n.onAnimationLoop()},this._runtimeAnimations.push(a)}},e.prototype.getAnimationByTargetProperty=function(e){for(var t=this._runtimeAnimations,n=0;n<t.length;n++)if(t[n].animation.targetProperty===e)return t[n].animation;return null},e.prototype.getRuntimeAnimationByTargetProperty=function(e){for(var t=this._runtimeAnimations,n=0;n<t.length;n++)if(t[n].animation.targetProperty===e)return t[n];return null},e.prototype.reset=function(){for(var e=this._runtimeAnimations,t=0;t<e.length;t++)e[t].reset(!0);this._localDelayOffset=null,this._pausedDelay=null},e.prototype.enableBlending=function(e){for(var t=this._runtimeAnimations,n=0;n<t.length;n++)t[n].animation.enableBlending=!0,t[n].animation.blendingSpeed=e},e.prototype.disableBlending=function(){for(var e=this._runtimeAnimations,t=0;t<e.length;t++)e[t].animation.enableBlending=!1},e.prototype.goToFrame=function(e){var t=this._runtimeAnimations;if(t[0]){var n=t[0].animation.framePerSecond,r=t[0].currentFrame,i=0===this.speedRatio?0:(e-r)/n*1e3/this.speedRatio;null===this._localDelayOffset&&(this._localDelayOffset=0),this._localDelayOffset-=i}for(var o=0;o<t.length;o++)t[o].goToFrame(e)},e.prototype.pause=function(){this._paused||(this._paused=!0)},e.prototype.restart=function(){this._paused=!1},e.prototype._raiseOnAnimationEnd=function(){this.onAnimationEnd&&this.onAnimationEnd(),this.onAnimationEndObservable.notifyObservers(this)},e.prototype.stop=function(e,t){if(e||t){var n=this._scene._activeAnimatables.indexOf(this);if(n>-1){for(var r=(o=this._runtimeAnimations).length-1;r>=0;r--){var i=o[r];e&&i.animation.name!=e||t&&!t(i.target)||(i.dispose(),o.splice(r,1))}0==o.length&&(this._scene._activeAnimatables.splice(n,1),this._raiseOnAnimationEnd())}}else if((r=this._scene._activeAnimatables.indexOf(this))>-1){this._scene._activeAnimatables.splice(r,1);var o=this._runtimeAnimations;for(r=0;r<o.length;r++)o[r].dispose();this._raiseOnAnimationEnd()}},e.prototype.waitAsync=function(){var e=this;return new Promise((function(t,n){e.onAnimationEndObservable.add((function(){t(e)}),void 0,void 0,e,!0)}))},e.prototype._animate=function(e){if(this._paused)return this.animationStarted=!1,null===this._pausedDelay&&(this._pausedDelay=e),!0;if(null===this._localDelayOffset?(this._localDelayOffset=e,this._pausedDelay=null):null!==this._pausedDelay&&(this._localDelayOffset+=e-this._pausedDelay,this._pausedDelay=null),0===this._weight)return!0;var t,n=!1,r=this._runtimeAnimations;for(t=0;t<r.length;t++){var i=r[t].animate(e-this._localDelayOffset,this.fromFrame,this.toFrame,this.loopAnimation,this._speedRatio,this._weight);n=n||i}if(this.animationStarted=n,!n){if(this.disposeOnEnd)for(t=this._scene._activeAnimatables.indexOf(this),this._scene._activeAnimatables.splice(t,1),t=0;t<r.length;t++)r[t].dispose();this._raiseOnAnimationEnd(),this.disposeOnEnd&&(this.onAnimationEnd=null,this.onAnimationLoop=null,this.onAnimationLoopObservable.clear(),this.onAnimationEndObservable.clear())}return n},e}();a.x.prototype._animate=function(){if(this.animationsEnabled){var e=l.F.Now;
1if(!this._animationTimeLast){if(this._pendingData.length>0)return;this._animationTimeLast=e}this.deltaTime=this.useConstantAnimationDeltaTime?16:(e-this._animationTimeLast)*this.animationTimeScale,this._animationTimeLast=e;var t=this._activeAnimatables;if(0!==t.length){this._animationTime+=this.deltaTime;for(var n=this._animationTime,r=0;r<t.length;r++){var i=t[r];!i._animate(n)&&i.disposeOnEnd&&r--}this._processLateAnimationBindings()}}},a.x.prototype.beginWeightedAnimation=function(e,t,n,r,i,o,a,s,l,u,h){void 0===r&&(r=1),void 0===o&&(o=1),void 0===h&&(h=!1);var c=this.beginAnimation(e,t,n,i,o,a,s,!1,l,u,h);return c.weight=r,c},a.x.prototype.beginAnimation=function(e,t,n,r,i,o,a,s,l,u,c){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===c&&(c=!1),t>n&&i>0&&(i*=-1),s&&this.stopAnimation(e,void 0,l),a||(a=new h(this,e,t,n,r,i,o,void 0,u,c));var f=!l||l(e);if(e.animations&&f&&a.appendAnimations(e,e.animations),e.getAnimatables)for(var p=e.getAnimatables(),d=0;d<p.length;d++)this.beginAnimation(p[d],t,n,r,i,o,a,s,l,u);return a.reset(),a},a.x.prototype.beginHierarchyAnimation=function(e,t,n,r,i,o,a,s,l,u,h,c){void 0===o&&(o=1),void 0===l&&(l=!0),void 0===c&&(c=!1);var f=e.getDescendants(t),p=[];p.push(this.beginAnimation(e,n,r,i,o,a,s,l,u,void 0,c));for(var d=0,_=f;d<_.length;d++){var m=_[d];p.push(this.beginAnimation(m,n,r,i,o,a,s,l,u,void 0,c))}return p},a.x.prototype.beginDirectAnimation=function(e,t,n,r,i,o,a,s,l){return void 0===l&&(l=!1),void 0===o&&(o=1),n>r&&o>0&&(o*=-1),new h(this,e,n,r,i,o,a,t,s,l)},a.x.prototype.beginDirectHierarchyAnimation=function(e,t,n,r,i,o,a,s,l,u){void 0===u&&(u=!1);var h=e.getDescendants(t),c=[];c.push(this.beginDirectAnimation(e,n,r,i,o,a,s,l,u));for(var f=0,p=h;f<p.length;f++){var d=p[f];c.push(this.beginDirectAnimation(d,n,r,i,o,a,s,l,u))}return c},a.x.prototype.getAnimatableByTarget=function(e){for(var t=0;t<this._activeAnimatables.length;t++)if(this._activeAnimatables[t].target===e)return this._activeAnimatables[t];return null},a.x.prototype.getAllAnimatablesByTarget=function(e){for(var t=[],n=0;n<this._activeAnimatables.length;n++)this._activeAnimatables[n].target===e&&t.push(this._activeAnimatables[n]);return t},a.x.prototype.stopAnimation=function(e,t,n){for(var r=0,i=this.getAllAnimatablesByTarget(e);r<i.length;r++)i[r].stop(t,n)},a.x.prototype.stopAllAnimations=function(){if(this._activeAnimatables){for(var e=0;e<this._activeAnimatables.length;e++)this._activeAnimatables[e].stop();this._activeAnimatables=[]}for(var t=0,n=this.animationGroups;t<n.length;t++)n[t].stop()},a.x.prototype._registerTargetForLateAnimationBinding=function(e,t){var n=e.target;this._registeredForLateAnimationBindings.pushNoDuplicate(n),n._lateAnimationHolders||(n._lateAnimationHolders={}),n._lateAnimationHolders[e.targetPath]||(n._lateAnimationHolders[e.targetPath]={totalWeight:0,totalAdditiveWeight:0,animations:[],additiveAnimations:[],originalValue:t}),e.isAdditive?(n._lateAnimationHolders[e.targetPath].additiveAnimations.push(e),n._lateAnimationHolders[e.targetPath].totalAdditiveWeight+=e.weight):(n._lateAnimationHolders[e.targetPath].animations.push(e),n._lateAnimationHolders[e.targetPath].totalWeight+=e.weight)},a.x.prototype._processLateAnimationBindingsForMatrices=function(e){if(0===e.totalWeight&&0===e.totalAdditiveWeight)return e.originalValue;var t=1,n=s.jp.Vector3[0],r=s.jp.Vector3[1],i=s.jp.Quaternion[0],o=0,a=e.animations[0],l=e.originalValue,u=1,h=!1;if(e.totalWeight<1)u=1-e.totalWeight,l.decompose(r,i,n);else{if(o=1,t=e.totalWeight,1==(u=a.weight/t)){if(!e.totalAdditiveWeight)return a.currentValue;h=!0}a.currentValue.decompose(r,i,n)}if(!h){r.scaleInPlace(u),n.scaleInPlace(u),i.scaleInPlace(u);for(var c=o;c<e.animations.length;c++)if(0!==(m=e.animations[c]).weight){u=m.weight/t;var f=s.jp.Vector3[2],p=s.jp.Vector3[3],d=s.jp.Quaternion[1];m.currentValue.decompose(p,d,f),p.scaleAndAddToRef(u,r),d.scaleAndAddToRef(u,i),f.scaleAndAddToRef(u,n)}}for(var _=0;_<e.additiveAnimations.length;_++){var m;0!==(m=e.additiveAnimations[_]).weight&&(f=s.jp.Vector3[2],p=s.jp.Vector3[3],d=s.jp.Quaternion[1],m.currentValue.decompose(p,d,f),p.multiplyToRef(r,p),s.P.LerpToRef(r,p,m.weight,r),i.multiplyToRef(d,d),s._f.SlerpToRef(i,d,m.weight,i),f.scaleAndAddToRef(m.weight,n))}var g=a?a._animationState.workValue:s.jp.Matrix[0].clone();return s.y3.ComposeToRef(r,i,n,g),g},a.x.prototype._processLateAnimationBindingsForQuaternions=function(e,t){if(0===e.totalWeight&&0===e.totalAdditiveWeight)return t;var n=e.animations[0],r=e.originalValue,i=t;if(0===e.totalWeight&&e.totalAdditiveWeight>0)i.copyFrom(r);else if(1===e.animations.length){if(s._f.SlerpToRef(r,n.currentValue,Math.min(1,e.totalWeight),i),0===e.totalAdditiveWeight)return i}else if(e.animations.length>1){var o=1,a=void 0,l=void 0;if(e.totalWeight<1){var u=1-e.totalWeight;l=[],(a=[]).push(r),l.push(u)}else{if(2===e.animations.length&&(s._f.SlerpToRef(e.animations[0].currentValue,e.animations[1].currentValue,e.animations[1].weight/e.totalWeight,t),0===e.totalAdditiveWeight))return t;a=[],l=[],o=e.totalWeight}for(var h=0;h<e.animations.length;h++){var c=e.animations[h];a.push(c.currentValue),l.push(c.weight/o)}for(var f=0,p=0;p<a.length;)p?(f+=l[p],s._f.SlerpToRef(i,a[p],l[p]/f,i),p++):(s._f.SlerpToRef(a[p],a[p+1],l[p+1]/(l[p]+l[p+1]),t),i=t,f=l[p]+l[p+1],p+=2)}for(var d=0;d<e.additiveAnimations.length;
1d++)0!==(c=e.additiveAnimations[d]).weight&&(i.multiplyToRef(c.currentValue,s.jp.Quaternion[0]),s._f.SlerpToRef(i,s.jp.Quaternion[0],c.weight,i));return i},a.x.prototype._processLateAnimationBindings=function(){if(this._registeredForLateAnimationBindings.length){for(var e=0;e<this._registeredForLateAnimationBindings.length;e++){var t=this._registeredForLateAnimationBindings.data[e];for(var n in t._lateAnimationHolders){var i=t._lateAnimationHolders[n],o=i.animations[0],a=i.originalValue,l=r.f.AllowMatrixDecomposeForInterpolation&&a.m,u=t[n];if(l)u=this._processLateAnimationBindingsForMatrices(i);else if(void 0!==a.w)u=this._processLateAnimationBindingsForQuaternions(i,u||s._f.Identity());else{var h=0,c=1;if(i.totalWeight<1)u=o&&a.scale?a.scale(1-i.totalWeight):o?a*(1-i.totalWeight):a.clone?a.clone():a;else if(o){c=i.totalWeight;var f=o.weight/c;u=1!==f?o.currentValue.scale?o.currentValue.scale(f):o.currentValue*f:o.currentValue,h=1}for(var p=h;p<i.animations.length;p++)(m=(_=i.animations[p]).weight/c)&&(_.currentValue.scaleAndAddToRef?_.currentValue.scaleAndAddToRef(m,u):u+=_.currentValue*m);for(var d=0;d<i.additiveAnimations.length;d++){var _,m;(m=(_=i.additiveAnimations[d]).weight)&&(_.currentValue.scaleAndAddToRef?_.currentValue.scaleAndAddToRef(m,u):u+=_.currentValue*m)}}t[n]=u}t._lateAnimationHolders={}}this._registeredForLateAnimationBindings.reset()}},u.N.prototype.copyAnimationRange=function(e,t,n,i,o){void 0===i&&(i=!1),void 0===o&&(o=null),0===this.animations.length&&(this.animations.push(new r.f(this.name,"_matrix",e.animations[0].framePerSecond,r.f.ANIMATIONTYPE_MATRIX,0)),this.animations[0].setKeys([]));var a=e.animations[0].getRange(t);if(!a)return!1;for(var s,l,u,h=a.from,c=a.to,f=e.animations[0].getKeys(),p=e.length,d=e.getParent(),_=this.getParent(),m=i&&d&&p&&this.length&&p!==this.length,g=m&&_&&d?_.length/d.length:1,y=i&&!_&&o&&(1!==o.x||1!==o.y||1!==o.z),v=this.animations[0].getKeys(),A=0,b=f.length;A<b;A++)(s=f[A]).frame>=h&&s.frame<=c&&(i?(u=s.value.clone(),m?(l=u.getTranslation(),u.setTranslation(l.scaleInPlace(g))):y&&o?(l=u.getTranslation(),u.setTranslation(l.multiplyInPlace(o))):u=s.value):u=s.value,v.push({frame:s.frame+n,value:u}));return this.animations[0].createRange(t,h+n,c+n),!0}},4635:(e,t,n)=>{"use strict";n.d(t,{u:()=>p,f:()=>d});var r=n(2973),i=n(8362),o=n(9018),a=n(9023),s=n(6132),l=n(5569),u=n(2117),h=n(2686),c=n(488),f=n(2840),p=function(){},d=function(){function e(t,n,r,i,o,a){this.name=t,this.targetProperty=n,this.framePerSecond=r,this.dataType=i,this.loopMode=o,this.enableBlending=a,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this.targetPropertyPath=n.split("."),this.dataType=i,this.loopMode=void 0===o?e.ANIMATIONLOOPMODE_CYCLE:o}return e._PrepareAnimation=function(t,n,o,a,s,l,u,h){var f=void 0;if(!isNaN(parseFloat(s))&&isFinite(s)?f=e.ANIMATIONTYPE_FLOAT:s instanceof r._f?f=e.ANIMATIONTYPE_QUATERNION:s instanceof r.P?f=e.ANIMATIONTYPE_VECTOR3:s instanceof r.FM?f=e.ANIMATIONTYPE_VECTOR2:s instanceof i.Wo?f
1=e.ANIMATIONTYPE_COLOR3:s instanceof i.HE?f=e.ANIMATIONTYPE_COLOR4:s instanceof c.$&&(f=e.ANIMATIONTYPE_SIZE),null==f)return null;var p=new e(t,n,o,f,u),d=[{frame:0,value:s},{frame:a,value:l}];return p.setKeys(d),void 0!==h&&p.setEasingFunction(h),p},e.CreateAnimation=function(t,n,r,i){var o=new e(t+"Animation",t,r,n,e.ANIMATIONLOOPMODE_CONSTANT);return o.setEasingFunction(i),o},e.CreateAndStartAnimation=function(t,n,r,i,o,a,s,l,u,h){var c=e._PrepareAnimation(t,r,i,o,a,s,l,u);return c?n.getScene().beginDirectAnimation(n,[c],0,o,1===c.loopMode,1,h):null},e.CreateAndStartHierarchyAnimation=function(t,n,r,i,o,a,s,l,u,h,c){var f=e._PrepareAnimation(t,i,o,a,s,l,u,h);return f?n.getScene().beginDirectHierarchyAnimation(n,r,[f],0,a,1===f.loopMode,1,c):null},e.CreateMergeAndStartAnimation=function(t,n,r,i,o,a,s,l,u,h){var c=e._PrepareAnimation(t,r,i,o,a,s,l,u);return c?(n.animations.push(c),n.getScene().beginAnimation(n,0,o,1===c.loopMode,1,h)):null},e.MakeAnimationAdditive=function(t,n,i,o,a){void 0===n&&(n=0),void 0===o&&(o=!1);var s=t;if(o&&((s=t.clone()).name=a||s.name),!s._keys.length)return s;n=n>=0?n:0;var l=0,u=s._keys[0],h=s._keys.length-1,c=s._keys[h],f={referenceValue:u.value,referencePosition:r.jp.Vector3[0],referenceQuaternion:r.jp.Quaternion[0],referenceScaling:r.jp.Vector3[1],keyPosition:r.jp.Vector3[2],keyQuaternion:r.jp.Quaternion[1],keyScaling:r.jp.Vector3[3]},p=!1,d=u.frame,_=c.frame;if(i){var m=s.getRange(i);m&&(d=m.from,_=m.to)}var g=u.frame===d,y=c.frame===_;if(1===s._keys.length){var v=s._getKeyValue(s._keys[0]);f.referenceValue=v.clone?v.clone():v,p=!0}else n<=u.frame?(v=s._getKeyValue(u.value),f.referenceValue=v.clone?v.clone():v,p=!0):n>=c.frame&&(v=s._getKeyValue(c.value),f.referenceValue=v.clone?v.clone():v,p=!0);for(var A=0;!p||!g||!y&&A<s._keys.length-1;){var b=s._keys[A],T=s._keys[A+1];if(!p&&n>=b.frame&&n<=T.frame){if(v=void 0,n===b.frame)v=s._getKeyValue(b.value);else if(n===T.frame)v=s._getKeyValue(T.value);else{var O={key:A,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT};v=s._interpolate(n,O)}f.referenceValue=v.clone?v.clone():v,p=!0}if(!g&&d>=b.frame&&d<=T.frame){if(d===b.frame)l=A;else if(d===T.frame)l=A+1;else{O={key:A,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT};var M={frame:d,value:(v=s._interpolate(d,O)).clone?v.clone():v};s._keys.splice(A+1,0,M),l=A+1}g=!0}!y&&_>=b.frame&&_<=T.frame&&(_===b.frame?h=A:(_===T.frame||(O={key:A,repeatCount:0,loopMode:this.ANIMATIONLOOPMODE_CONSTANT},M={frame:_,value:(v=s._interpolate(_,O)).clone?v.clone():v},s._keys.splice(A+1,0,M)),h=A+1),y=!0),A++}for(s.dataType===e.ANIMATIONTYPE_QUATERNION?f.referenceValue.normalize().conjugateInPlace():s.dataType===e.ANIMATIONTYPE_MATRIX&&(f.referenceValue.decompose(f.referenceScaling,f.referenceQuaternion,f.referencePosition),f.referenceQuaternion.normalize().conjugateInPlace()),A=l;A<=h;A++)if(M=s._keys[A],!A||s.dataType===e.ANIMATIONTYPE_FLOAT||M.value!==u.value)switch(s.dataType){case e.ANIMATIONTYPE_MATRIX:M.value.decompose(f.keyScaling,f.keyQuaternion,f.keyPosition),f.keyPosition.subtractInPlace(f.referencePosition),f.keyScaling.divideInPlace(f.referenceScaling),f.referenceQuaternion.multiplyToRef(f.keyQuaternion,f.keyQuaternion),r.y3.ComposeToRef(f.keyScaling,f.keyQuaternion,f.keyPosition,M.value);break;case e.ANIMATIONTYPE_QUATERNION:f.referenceValue.multiplyToRef(M.value,M.value);break;case e.ANIMATIONTYPE_VECTOR2:case e.ANIMATIONTYPE_VECTOR3:case e.ANIMATIONTYPE_COLOR3:case e.ANIMATIONTYPE_COLOR4:M.value.subtractToRef(f.referenceValue,M.value);break;case e.ANIMATIONTYPE_SIZE:M.value.width-=f.referenceValue.width,M.value.height-=f.referenceValue.height;break;default:M.value-=f.referenceValue}return s}
1,e.TransitionTo=function(e,t,n,r,i,o,a,s){if(void 0===s&&(s=null),a<=0)return n[e]=t,s&&s(),null;var l=i*(a/1e3);o.setKeys([{frame:0,value:n[e].clone?n[e].clone():n[e]},{frame:l,value:t}]),n.animations||(n.animations=[]),n.animations.push(o);var u=r.beginAnimation(n,0,l,!1);return u.onAnimationEnd=s,u},Object.defineProperty(e.prototype,"runtimeAnimations",{get:function(){return this._runtimeAnimations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRunningRuntimeAnimations",{get:function(){for(var e=0,t=this._runtimeAnimations;e<t.length;e++)if(!t[e].isStopped)return!0;return!1},enumerable:!1,configurable:!0}),e.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 n=!0;for(var r in this._ranges)n&&(t+=", ",n=!1),t+=r;t+="}"}return t},e.prototype.addEvent=function(e){this._events.push(e),this._events.sort((function(e,t){return e.frame-t.frame}))},e.prototype.removeEvents=function(e){for(var t=0;t<this._events.length;t++)this._events[t].frame===e&&(this._events.splice(t,1),t--)},e.prototype.getEvents=function(){return this._events},e.prototype.createRange=function(e,t,n){this._ranges[e]||(this._ranges[e]=new u.X(e,t,n))},e.prototype.deleteRange=function(e,t){void 0===t&&(t=!0);var n=this._ranges[e];if(n){if(t)for(var r=n.from,i=n.to,o=this._keys.length-1;o>=0;o--)this._keys[o].frame>=r&&this._keys[o].frame<=i&&this._keys.splice(o,1);this._ranges[e]=null}},e.prototype.getRange=function(e){return this._ranges[e]},e.prototype.getKeys=function(){return this._keys},e.prototype.getHighestFrame=function(){for(var e=0,t=0,n=this._keys.length;t<n;t++)e<this._keys[t].frame&&(e=this._keys[t].frame);return e},e.prototype.getEasingFunction=function(){return this._easingFunction},e.prototype.setEasingFunction=function(e){this._easingFunction=e},e.prototype.floatInterpolateFunction=function(e,t,n){return o.R.Lerp(e,t,n)},e.prototype.floatInterpolateFunctionWithTangents=function(e,t,n,r,i){return o.R.Hermite(e,t,n,r,i)},e.prototype.quaternionInterpolateFunction=function(e,t,n){return r._f.Slerp(e,t,n)},e.prototype.quaternionInterpolateFunctionWithTangents=function(e,t,n,i,o){return r._f.Hermite(e,t,n,i,o).normalize()},e.prototype.vector3InterpolateFunction=function(e,t,n){return r.P.Lerp(e,t,n)},e.prototype.vector3InterpolateFunctionWithTangents=function(e,t,n,i,o){return r.P.Hermite(e,t,n,i,o)},e.prototype.vector2InterpolateFunction=function(e,t,n){return r.FM.Lerp(e,t,n)},e.prototype.vector2InterpolateFunctionWithTangents=function(e,t,n,i,o){return r.FM.Hermite(e,t,n,i,o)},e.prototype.sizeInterpolateFunction=function(e,t,n){return c.$.Lerp(e,t,n)},e.prototype.color3InterpolateFunction=function(e,t,n){return i.Wo.Lerp(e,t,n)},e.prototype.color4InterpolateFunction=function(e,t,n){return i.HE.Lerp(e,t,n)},e.prototype._getKeyValue=function(e){return"function"==typeof e?e():e},e.prototype._interpolate=function(t,n){if(n.loopMode===e.ANIMATIONLOOPMODE_CONSTANT&&n.repeatCount>0)return n.highLimitValue.clone?n.highLimitValue.clone():n.highLimitValue;var r=this._keys;if(1===r.length)return this._getKeyValue(r[0].value);var i=n.key;if(r[i].frame>=t)for(;i-1>=0&&r[i].frame>=t;)i--;for(var o=i;o<r.length;o++){var a=r[o+1];if(a.frame>=t){n.key=o;var s=r[o],u=this._getKeyValue(s.value);if(s.interpolation===l.N.STEP)return u;var h=this._getKeyValue(a.value),c=void 0!==s.outTangent&&void 0!==a.inTangent,f=a.frame-s.frame,p=(t-s.frame)/f,d=this.getEasingFunction();switch(null!=d&&(p=d.ease(p)),this.dataType){case e.ANIMATIONTYPE_FLOAT:var _=c?this.floatInterpolateFunctionWithTangents(u,s.outTangent*f,h,a.inTangent*f,p):this.floatInterpolateFunction(u,h,p);switch(n.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return _;case e.ANIMATIONLOOPMODE_RELATIVE:return n.offsetValue*n.repeatCount+_}break;case e.ANIMATIONTYPE_QUATERNION:var m=c?this.quaternionInterpolateFunctionWithTangents(u,s.outTangent.scale(f),h,a.inTangent.scale(f),p):this.quaternionInterpolateFunction(u,h,p);switch(n.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return m;case e.ANIMATIONLOOPMODE_RELATIVE:return m.addInPlace(n.offsetValue.scale(n.repeatCount))}return m;case e.ANIMATIONTYPE_VECTOR3:var g=c?this.vector3InterpolateFunctionWithTangents(u,s.outTangent.scale(f),h,a.inTangent.scale(f),p):this.vector3InterpolateFunction(u,h,p);switch(n.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return g;case e.ANIMATIONLOOPMODE_RELATIVE:return g.add(n.offsetValue.scale(n.repeatCount))}case e.ANIMATIONTYPE_VECTOR2:var y=c?this.vector2InterpolateFunctionWithTangents(u,s.outTangent.scale(f),h,a.inTangent.scale(f),p):this.vector2InterpolateFunction(u,h,p);switch(n.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return y;case e.ANIMATIONLOOPMODE_RELATIVE:return y.add(n.offsetValue.scale(n.repeatCount))}case e.ANIMATIONTYPE_SIZE:switch(n.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(u,h,p);case e.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(u,h,p).add(n.offsetValue.scale(n.repeatCount))}case e.ANIMATIONTYPE_COLOR3:switch(n.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color3InterpolateFunction(u,h,p);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color3InterpolateFunction(u,h,p).add(n.offsetValue.scale(n.repeatCount))}case e.ANIMATIONTYPE_COLOR4:switch(n.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color4InterpolateFunction(u,h,p);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color4InterpolateFunction(u,h,p).add(n.offsetValue.scale(n.repeatCount))}case e.ANIMATIONTYPE_MATRIX:switch(n.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:if(e.AllowMatricesInterpolation)return this.matrixInterpolateFunction(u,h,p,n.workValue);case e.ANIMATIONLOOPMODE_RELATIVE:return u}}break}}return this._getKeyValue(r[r.length-1].value)},e.prototype.matrixInterpolateFunction=function(t,n,i,o){return e.AllowMatrixDecomposeForInterpolation?o?(r.y3.DecomposeLerpToRef(t,n,i,o),o):r.y3.DecomposeLerp(t,n,i):o?(r.y3.LerpToRef(t,n,i,o),o):r.y3.Lerp(t,n,i)},e.prototype.clone=function(){var t=new e(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);
1if(t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed,this._keys&&t.setKeys(this._keys),this._ranges)for(var n in t._ranges={},this._ranges){var r=this._ranges[n];r&&(t._ranges[n]=r.clone())}return t},e.prototype.setKeys=function(e){this._keys=e.slice(0)},e.prototype.serialize=function(){var t={};t.name=this.name,t.property=this.targetProperty,t.framePerSecond=this.framePerSecond,t.dataType=this.dataType,t.loopBehavior=this.loopMode,t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed;var n=this.dataType;t.keys=[];for(var r=this.getKeys(),i=0;i<r.length;i++){var o=r[i],a={};switch(a.frame=o.frame,n){case e.ANIMATIONTYPE_FLOAT:a.values=[o.value],void 0!==o.inTangent&&a.values.push(o.inTangent),void 0!==o.outTangent&&(void 0===o.inTangent&&a.values.push(void 0),a.values.push(o.outTangent));break;case e.ANIMATIONTYPE_QUATERNION:case e.ANIMATIONTYPE_MATRIX:case e.ANIMATIONTYPE_VECTOR3:case e.ANIMATIONTYPE_COLOR3:case e.ANIMATIONTYPE_COLOR4:a.values=o.value.asArray(),null!=o.inTangent&&a.values.push(o.inTangent.asArray()),null!=o.outTangent&&(void 0===o.inTangent&&a.values.push(void 0),a.values.push(o.outTangent.asArray()))}t.keys.push(a)}for(var s in t.ranges=[],this._ranges){var l=this._ranges[s];if(l){var u={};u.name=s,u.from=l.from,u.to=l.to,t.ranges.push(u)}}return t},e._UniversalLerp=function(e,t,n){var r=e.constructor;return r.Lerp?r.Lerp(e,t,n):r.Slerp?r.Slerp(e,t,n):e.toFixed?e*(1-n)+n*t:t},e.Parse=function(t){var n,o,a=new e(t.name,t.property,t.framePerSecond,t.dataType,t.loopBehavior),s=t.dataType,l=[];for(t.enableBlending&&(a.enableBlending=t.enableBlending),t.blendingSpeed&&(a.blendingSpeed=t.blendingSpeed),o=0;o<t.keys.length;o++){var u,h,c=t.keys[o];switch(s){case e.ANIMATIONTYPE_FLOAT:n=c.values[0],c.values.length>=1&&(u=c.values[1]),c.values.length>=2&&(h=c.values[2]);break;case e.ANIMATIONTYPE_QUATERNION:if(n=r._f.FromArray(c.values),c.values.length>=8){var f=r._f.FromArray(c.values.slice(4,8));f.equals(r._f.Zero())||(u=f)}if(c.values.length>=12){var p=r._f.FromArray(c.values.slice(8,12));p.equals(r._f.Zero())||(h=p)}break;case e.ANIMATIONTYPE_MATRIX:n=r.y3.FromArray(c.values);break;case e.ANIMATIONTYPE_COLOR3:n=i.Wo.FromArray(c.values);break;case e.ANIMATIONTYPE_COLOR4:n=i.HE.FromArray(c.values);break;case e.ANIMATIONTYPE_VECTOR3:default:n=r.P.FromArray(c.values)}var d={};d.frame=c.frame,d.value=n,null!=u&&(d.inTangent=u),null!=h&&(d.outTangent=h),l.push(d)}if(a.setKeys(l),t.ranges)for(o=0;o<t.ranges.length;o++)n=t.ranges[o],a.createRange(n.name,n.from,n.to);return a},e.AppendSerializedAnimations=function(e,t){a.p4.AppendSerializedAnimations(e,t)},e.ParseFromFileAsync=function(e,t){var n=this;return new Promise((function(r,i){var o=new f.g;o.addEventListener("readystatechange",(function(){if(4==o.readyState)if(200==o.status){var t=JSON.parse(o.responseText);if(t.length){for(var a=new Array,s=0,l=t;s<l.length;s++){var u=l[s];a.push(n.Parse(u))}r(a)}else a=n.Parse(t),e&&(a.name=e),r(a)}else i("Unable to load the animation")})),o.open("GET",t),o.send()}))},e.CreateFromSnippetAsync=function(e){var t=this;return new Promise((function(n,r){var i=new f.g;i.addEventListener("readystatechange",(function(){if(4==i.readyState)if(200==i.status){var o=JSON.parse(JSON.parse(i.responseText).jsonPayload);if(o.animations){for(var a=JSON.parse(o.animations),s=new Array,l=0,u=a;l<u.length;l++){var h=u[l];s.push(t.Parse(h))}n(s)}else a=JSON.parse(o.animation),(s=t.Parse(a)).snippetId=e,n(s)}else r("Unable to load the snippet "+e)})),i.open("GET",t.SnippetUrl+"/"+e.replace(/#/g,"/")),i.send()}))},e.AllowMatricesInterpolation=!1,e.AllowMatrixDecomposeForInterpolation=!0,e.SnippetUrl="https://snippet.babylonjs.com",e.ANIMATIONTYPE_FLOAT=0,e.ANIMATIONTYPE_VECTOR3=1,e.ANIMATIONTYPE_QUATERNION=2,e.ANIMATIONTYPE_MATRIX=3,e.ANIMATIONTYPE_COLOR3=4,e.ANIMATIONTYPE_COLOR4=7,e.ANIMATIONTYPE_VECTOR2=5,e.ANIMATIONTYPE_SIZE=6,e.ANIMATIONLOOPMODE_RELATIVE=0,e.ANIMATIONLOOPMODE_CYCLE=1,e.ANIMATIONLOOPMODE_CONSTANT=2,e}();s.Q.RegisteredTypes["BABYLON.Animation"]=d,h.N._AnimationRangeFactory=function(e,t,n){return new u.X(e,t,n
1)}},5398:(e,t,n)=>{"use strict";n.d(t,{U:()=>a,O:()=>s});var r=n(4635),i=n(475),o=n(2733),a=(n(354),function(){function e(){}return e.prototype.getClassName=function(){return"TargetedAnimation"},e.prototype.serialize=function(){var e={};return e.animation=this.animation.serialize(),e.targetId=this.target.id,e},e}()),s=function(){function e(e,t){void 0===t&&(t=null),this.name=e,this._targetedAnimations=new Array,this._animatables=new Array,this._from=Number.MAX_VALUE,this._to=-Number.MAX_VALUE,this._speedRatio=1,this._loopAnimation=!1,this._isAdditive=!1,this.onAnimationEndObservable=new i.y$,this.onAnimationLoopObservable=new i.y$,this.onAnimationGroupLoopObservable=new i.y$,this.onAnimationGroupEndObservable=new i.y$,this.onAnimationGroupPauseObservable=new i.y$,this.onAnimationGroupPlayObservable=new i.y$,this._scene=t||o.l.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._scene.addAnimationGroup(this)}return Object.defineProperty(e.prototype,"from",{get:function(){return this._from},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"to",{get:function(){return this._to},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStarted",{get:function(){return this._isStarted},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isPlaying",{get:function(){return this._isStarted&&!this._isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"speedRatio",{get:function(){return this._speedRatio},set:function(e){if(this._speedRatio!==e){this._speedRatio=e;for(var t=0;t<this._animatables.length;t++)this._animatables[t].speedRatio=this._speedRatio}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loopAnimation",{get:function(){return this._loopAnimation},set:function(e){if(this._loopAnimation!==e){this._loopAnimation=e;for(var t=0;t<this._animatables.length;t++)this._animatables[t].loopAnimation=this._loopAnimation}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAdditive",{get:function(){return this._isAdditive},set:function(e){if(this._isAdditive!==e){this._isAdditive=e;for(var t=0;t<this._animatables.length;t++)this._animatables[t].isAdditive=this._isAdditive}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetedAnimations",{get:function(){return this._targetedAnimations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animatables",{get:function(){return this._animatables},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._targetedAnimations},enumerable:!1,configurable:!0}),e.prototype.addTargetedAnimation=function(e,t){var n=new a;n.animation=e,n.target=t;var r=e.getKeys();return this._from>r[0].frame&&(this._from=r[0].frame),this._to<r[r.length-1].frame&&(this._to=r[r.length-1].frame),this._targetedAnimations.push(n),n},e.prototype.normalize=function(e,t){void 0===e&&(e=null),void 0===t&&(t=null),null==e&&(e=this._from),null==t&&(t=this._to);for(var n=0;n<this._targetedAnimations.length;n++){var r=this._targetedAnimations[n].animation.getKeys(),i=r[0],o=r[r.length-1];if(i.frame>e){var a={frame:e,value:i.value,inTangent:i.inTangent,outTangent:i.outTangent,interpolation:i.interpolation};r.splice(0,0,a)}o.frame<t&&(a={frame:t,value:o.value,inTangent:o.inTangent,outTangent:o.outTangent,interpolation:o.interpolation},r.push(a))}return this._from=e,this._to=t,this},e.prototype._processLoop=function(e,t,n){var r=this;e.onAnimationLoop=function(){r.onAnimationLoopObservable.notifyObservers(t),r._animationLoopFlags[n]||(r._animationLoopFlags[n]=!0,r._animationLoopCount++,r._animationLoopCount===r._targetedAnimations.length&&(r.onAnimationGroupLoopObservable.notifyObservers(r),r._animationLoopCount=0,r._animationLoopFlags=[]))}},e.prototype.start=function(e,t,n,r,i){var o=this;if(void 0===e&&(e=!1),void 0===t&&(t=1),this._isStarted||0===this._targetedAnimations.length)return this;this._loopAnimation=e,this._animationLoopCount=0,this._animationLoopFlags=[];for(var a=function(){var a=s._targetedAnimations[l],u=s._scene.beginDirectAnimation(a.target,[a.animation],void 0!==n?n:s._from,void 0!==r?r:s._to,e,t,void 0,void 0,void 0!==i?i:s._isAdditive);u.onAnimationEnd=function(){o.onAnimationEndObservable.notifyObservers(a),o._checkAnimationGroupEnded(u)},s._processLoop(u,a,l),s._animatables.push(u)},s=this,l=0;l<this._targetedAnimations.length;l++)a();if(this._speedRatio=t,void 0!==n&&void 0!==r)if(n<r&&this._speedRatio<0){var u=r;r=n,n=u}else n>r&&this._speedRatio>0&&(this._speedRatio=-t);return this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this},e.prototype.pause=function(){if(!this._isStarted)return this;this._isPaused=!0;for(var e=0;e<this._animatables.length;e++)this._animatables[e].pause();return this.onAnimationGroupPauseObservable.notifyObservers(this),this},e.prototype.play=function(e){return this.isStarted&&this._animatables.length===this._targetedAnimations.length?(void 0!==e&&(this.loopAnimation=e),this.restart()):(this.stop(),this.start(e,this._speedRatio)),this._isPaused=!1,this},e.prototype.reset=function(){if(!this._isStarted)return this.play(),this.goToFrame(0),this.stop(),this;for(var e=0;e<this._animatables.length;e++)this._animatables[e].reset();return this},e.prototype.restart=function(){if(!this._isStarted)return this;for(var e=0;e<this._animatables.length;e++)this._animatables[e].restart();return this.onAnimationGroupPlayObservable.notifyObservers(this),this},e.prototype.stop=function(){if(!this._isStarted)return this;for(var e=this._animatables.slice(),t=0;t<e.length;t++)e[t].stop();return this._isStarted=!1,this},e.prototype.setWeightForAllAnimatables=function(e){for(var t=0;t<this._animatables.length;t++)this._animatables[t].weight=e;return this},e.prototype.syncAllAnimationsWith=function(e){for(var t=0;t<this._animatables.length;t++)this._animatables[t].syncWith(e);return this},e.prototype.goToFrame=function(e){if(!this._isStarted)return this;for(var t=0;t<this._animatables.length;t++)this._animatables[t].goToFrame(e);return this},e.prototype.dispose=function(){this._targetedAnimations=[],this._animatables=[];var e=this._scene.animationGroups.indexOf(this);e>-1&&this._scene.animationGroups.splice(e,1),this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear(),this.onAnimationGroupLoopObservable.clear()},e.prototype._checkAnimationGroupEnded=function(e){var t=this._animatables.indexOf(e);t>-1&&this._animatables.splice(t,1),0===this._animatables.length&&(this._isStarted=!1,this.onAnimationGroupEndObservable.notifyObservers(this))},e.prototype.clone=function(t,n){for(var r=new e(t||this.name,this._scene),i=0,o=this._targetedAnimations;i<o.length;i++){var a=o[i];r.addTargetedAnimation(a.animation.clone(),n?n(a.target):a.target)}return r},e.prototype.serialize=function(){var e={};e.name=this.name,e.from=this.from,e.to=this.to,e.targetedAnimations=[];for(var t=0;t<this.targetedAnimations.length;t++){var n=this.targetedAnimations[t];e.targetedAnimations[t]=n.serialize()}return e},e.Parse=function(t,n){for(var i=new e(t.name,n),o=0;o<t.targetedAnimations.length;o++){var a=t.targetedAnimations[o],s=r.f.Parse(a.animation),l=a.targetId;if("influence"===a.animation.property){var u=n.getMorphTargetById(l);u&&i.addTargetedAnimation(s,u)}else{var h=n.getNodeByID(l);null!=h&&i.addTargetedAnimation(s,h)}}return null!==t.from&&null!==t.to&&i.normalize(t.from,t.to),i},e.MakeAnimationAdditive=function(e,t,n,i,o){void 0===t&&(t=0),void 0===i&&(i=!1);var a=e;i&&(a=e.clone(o||a.name));for(var s=a.targetedAnimations,l=0;l<s.length;l++){var u=s[l];r.f.MakeAnimationAdditive(u.animation,t,n)}return a.isAdditive=!0,a},e.prototype.getClassName=function(){return"AnimationGroup"},e.prototype.toString=function(e){var t="Name: "+this.name;return t+=", type: "+this.getClassName(),e&&(t+=", from: "+this._from,t+=", to: "+this._to,t+=", isStarted: "+this._isStarted,t+=", speedRatio: "+this._speedRatio,t+=", targetedAnimations length: "+this._targetedAnimations.length,t+=", animatables length: "+this._animatables),t},e}()},5569:(e,t,n)=>{"use strict";var r;n.d(t,{N:()=>r}),function(e){e[e.STEP=1]="STEP"}(r||(r={}))},2117:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var r=function(){function e(e,t,n){this.name=e,this.from=t,this.to=n}return e.prototype.clone=function(){return new e(this.name,this.from,this.to)},e}()},8079:(e,t,n)=>{"use strict";n.d(t,{o:()=>f});var r=n(2973),i=n(8362),o=n(4635),a=n(488),s=Object.freeze(new r._f(0,0,0,0)),l=Object.freeze(r.P.Zero()),u=Object.freeze(r.FM.Zero()),h=Object.freeze(a.$.Zero()),c=Object.freeze(i.Wo.Black()),f=function(){function e(e,t,n,i){var a=this;if(this._events=new Array,this._currentFrame=0,this._originalValue=new Array,this._originalBlendValue=null,this._offsetsCache={}
1,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=n,this._host=i,this._activeTargets=[],t._runtimeAnimations.push(this),this._animationState={key:0,repeatCount:0,loopMode:this._getCorrectLoopMode()},this._animation.dataType===o.f.ANIMATIONTYPE_MATRIX&&(this._animationState.workValue=r.y3.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,0!==this._minFrame){var s={frame:0,value:this._minValue};this._keys.splice(0,0,s)}if(this._target instanceof Array){for(var l=0,u=0,h=this._target;u<h.length;u++){var c=h[u];this._preparePath(c,l),this._getOriginalValues(l),l++}this._targetIsArray=!0}else this._preparePath(this._target),this._getOriginalValues(),this._targetIsArray=!1,this._directTarget=this._activeTargets[0];var f=t.getEvents();f&&f.length>0&&f.forEach((function(e){a._events.push(e._clone())})),this._enableBlending=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.enableBlending:this._animation.enableBlending}return Object.defineProperty(e.prototype,"currentFrame",{get:function(){return this._currentFrame},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"weight",{get:function(){return this._weight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetPath",{get:function(){return this._targetPath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._currentActiveTarget},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAdditive",{get:function(){return this._host&&this._host.isAdditive},enumerable:!1,configurable:!0}),e.prototype._preparePath=function(e,t){void 0===t&&(t=0);var n=this._animation.targetPropertyPath;if(n.length>1){for(var r=e[n[0]],i=1;i<n.length-1;i++)r=r[n[i]];this._targetPath=n[n.length-1],this._activeTargets[t]=r}else this._targetPath=n[0],this._activeTargets[t]=e},Object.defineProperty(e.prototype,"animation",{get:function(){return this._animation},enumerable:!1,configurable:!0}),e.prototype.reset=function(e){if(void 0===e&&(e=!1),e)if(this._target instanceof Array)for(var t=0,n=0,r=this._target;n<r.length;n++){var i=r[n];void 0!==this._originalValue[t]&&this._setValue(i,this._activeTargets[t],this._originalValue[t],-1,t),t++}else void 0!==this._originalValue[0]&&this._setValue(this._target,this._directTarget,this._originalValue[0],-1,0);for(this._offsetsCache={},this._highLimitsCache={},this._currentFrame=0,this._blendingFactor=0,t=0;t<this._events.length;t++)this._events[t].isDone=!1},e.prototype.isStopped=function(){return this._stopped},e.prototype.dispose=function(){var e=this._animation.runtimeAnimations.indexOf(this);e>-1&&this._animation.runtimeAnimations.splice(e,1)},e.prototype.setValue=function(e,t){if(this._targetIsArray)for(var n=0;n<this._target.length;n++){var r=this._target[n];this._setValue(r,this._activeTargets[n],e,t,n)}else this._setValue(this._target,this._directTarget,e,t,0)},e.prototype._getOriginalValues=function(e){var t;void 0===e&&(e=0);var n=this._activeTargets[e];(t=n.getRestPose&&"_matrix"===this._targetPath?n.getRestPose():n[this._targetPath])&&t.clone?this._originalValue[e]=t.clone():this._originalValue[e]=t},e.prototype._setValue=function(e,t,n,i,a){if(this._currentActiveTarget=t,this._weight=i,this._enableBlending&&this._blendingFactor<=1){if(!this._originalBlendValue){var s=t[this._targetPath];s.clone?this._originalBlendValue=s.clone():this._originalBlendValue=s}this._originalBlendValue.m?o.f.AllowMatrixDecomposeForInterpolation?this._currentValue?r.y3.DecomposeLerpToRef(this._originalBlendValue,n,this._blendingFactor,this._currentValue):this._currentValue=r.y3.DecomposeLerp(this._originalBlendValue,n,this._blendingFactor):this._currentValue?r.y3.LerpToRef(this._originalBlendValue,n,this._blendingFactor,this._currentValue):this._currentValue=r.y3.Lerp(this._originalBlendValue,n,this._blendingFactor):this._currentValue=o.f._UniversalLerp(this._originalBlendValue,n,this._blendingFactor);var l=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.blendingSpeed:this._animation.blendingSpeed;this._blendingFactor+=l}else this._currentValue=n;-1!==i?this._scene._registerTargetForLateAnimationBinding(this,this._originalValue[a
1]):t[this._targetPath]=this._currentValue,e.markAsDirty&&e.markAsDirty(this._animation.targetProperty)},e.prototype._getCorrectLoopMode=function(){return this._target&&this._target.animationPropertiesOverride?this._target.animationPropertiesOverride.loopMode:this._animation.loopMode},e.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 n=this._events;if(n.length)for(var r=0;r<n.length;r++)n[r].onlyOnce||(n[r].isDone=n[r].frame<e);this._currentFrame=e;var i=this._animation._interpolate(e,this._animationState);this.setValue(i,-1)},e.prototype._prepareForSpeedRatioChange=function(e){var t=this._previousDelay*(this._animation.framePerSecond*e)/1e3;this._ratioOffset=this._previousRatio-t},e.prototype.animate=function(e,t,n,r,i,a){void 0===a&&(a=-1);var f=this._animation,p=f.targetPropertyPath;if(!p||p.length<1)return this._stopped=!0,!1;var d=!0;(t<this._minFrame||t>this._maxFrame)&&(t=this._minFrame),(n<this._minFrame||n>this._maxFrame)&&(n=this._maxFrame);var _,m,g=n-t,y=e*(f.framePerSecond*i)/1e3+this._ratioOffset,v=0;if(this._previousDelay=e,this._previousRatio=y,!r&&n>=t&&y>=g)d=!1,v=f._getKeyValue(this._maxValue);else if(!r&&t>=n&&y<=g)d=!1,v=f._getKeyValue(this._minValue);else if(this._animationState.loopMode!==o.f.ANIMATIONLOOPMODE_CYCLE){var A=n.toString()+t.toString();if(!this._offsetsCache[A]){this._animationState.repeatCount=0,this._animationState.loopMode=o.f.ANIMATIONLOOPMODE_CYCLE;var b=f._interpolate(t,this._animationState),T=f._interpolate(n,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),f.dataType){case o.f.ANIMATIONTYPE_FLOAT:this._offsetsCache[A]=T-b;break;case o.f.ANIMATIONTYPE_QUATERNION:this._offsetsCache[A]=T.subtract(b);break;case o.f.ANIMATIONTYPE_VECTOR3:this._offsetsCache[A]=T.subtract(b);case o.f.ANIMATIONTYPE_VECTOR2:this._offsetsCache[A]=T.subtract(b);case o.f.ANIMATIONTYPE_SIZE:this._offsetsCache[A]=T.subtract(b);case o.f.ANIMATIONTYPE_COLOR3:this._offsetsCache[A]=T.subtract(b)}this._highLimitsCache[A]=T}v=this._highLimitsCache[A],_=this._offsetsCache[A]}if(void 0===_)switch(f.dataType){case o.f.ANIMATIONTYPE_FLOAT:_=0;break;case o.f.ANIMATIONTYPE_QUATERNION:_=s;break;case o.f.ANIMATIONTYPE_VECTOR3:_=l;break;case o.f.ANIMATIONTYPE_VECTOR2:_=u;break;case o.f.ANIMATIONTYPE_SIZE:_=h;break;case o.f.ANIMATIONTYPE_COLOR3:_=c}if(this._host&&this._host.syncRoot){var O=this._host.syncRoot;m=t+(n-t)*((O.masterFrame-O.fromFrame)/(O.toFrame-O.fromFrame))}else m=d&&0!==g?t+y%g:n;var M=this._events;if((g>0&&this.currentFrame>m||g<0&&this.currentFrame<m)&&(this._onLoop(),M.length))for(var x=0;x<M.length;x++)M[x].onlyOnce||(M[x].isDone=!1);this._currentFrame=m,this._animationState.repeatCount=0===g?0:y/g>>0,this._animationState.highLimitValue=v,this._animationState.offsetValue=_;var E=f._interpolate(m,this._animationState);if(this.setValue(E,a),M.length)for(x=0;x<M.length;x++)if(g>0&&m>=M[x].frame&&M[x].frame>=t||g<0&&m<=M[x].frame&&M[x].frame<=t){var P=M[x];P.isDone||(P.onlyOnce&&(M.splice(x,1),x--),P.isDone=!0,P.action(m))}return d||(this._stopped=!0),d},e}()},4164:(e,t,n)=>{"use strict";n.d(t,{N:()=>l});var r=n(655),i=n(2973),o=n(8035),a=n(2686),s=n(9068),l=function(e){function t(t,n,r,o,a,s,l){void 0===r&&(r=null),void 0===o&&(o=null),void 0===a&&(a=null),void 0===s&&(s=null),void 0===l&&(l=null);var u=e.call(this,t,n.getScene())||this;return u.name=t,u.children=new Array,u.animations=new Array,u._index=null,u._absoluteTransform=new i.y3,u._invertedAbsoluteTransform=new i.y3,u._scalingDeterminant=1,u._worldTransform=new i.y3,u._needToDecompose=!0,u._needToCompose=!1,u._linkedTransformNode=null,u._waitingTransformNodeId=null,u._skeleton=n,u._localMatrix=o?o.clone():i.y3.Identity(),u._restPose=a||u._localMatrix.clone(),u._bindPose=u._localMatrix.clone(),u._baseMatrix=s||u._localMatrix.clone(),u._index=l,n.bones.push(u),u.setParent(r,!1),(s||o)&&u._updateDifferenceMatrix(),u}return(0,r.ZT)(t,e),Object.defineProperty(t.prototype,"_matrix",{get:function(){return this._compose(),this._localMatrix},set:function(e){this._localMatrix.copyFrom(e),this._needToDecompose=!0}
1,enumerable:!1,configurable:!0}),t.prototype.getClassName=function(){return"Bone"},t.prototype.getSkeleton=function(){return this._skeleton},t.prototype.getParent=function(){return this._parent},t.prototype.getChildren=function(){return this.children},t.prototype.getIndex=function(){return null===this._index?this.getSkeleton().bones.indexOf(this):this._index},t.prototype.setParent=function(e,t){if(void 0===t&&(t=!0),this._parent!==e){if(this._parent){var n=this._parent.children.indexOf(this);-1!==n&&this._parent.children.splice(n,1)}this._parent=e,this._parent&&this._parent.children.push(this),t&&this._updateDifferenceMatrix(),this.markAsDirty()}},t.prototype.getLocalMatrix=function(){return this._compose(),this._localMatrix},t.prototype.getBaseMatrix=function(){return this._baseMatrix},t.prototype.getRestPose=function(){return this._restPose},t.prototype.setRestPose=function(e){this._restPose.copyFrom(e)},t.prototype.getBindPose=function(){return this._bindPose},t.prototype.setBindPose=function(e){this._bindPose.copyFrom(e)},t.prototype.getWorldMatrix=function(){return this._worldTransform},t.prototype.returnToRest=function(){this._skeleton._numBonesWithLinkedTransformNode>0?this.updateMatrix(this._restPose,!1,!1):this.updateMatrix(this._restPose,!1,!0)},t.prototype.getInvertedAbsoluteTransform=function(){return this._invertedAbsoluteTransform},t.prototype.getAbsoluteTransform=function(){return this._absoluteTransform},t.prototype.linkTransformNode=function(e){this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode--,this._linkedTransformNode=e,this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode++},t.prototype.getTransformNode=function(){return this._linkedTransformNode},Object.defineProperty(t.prototype,"position",{get:function(){return this._decompose(),this._localPosition},set:function(e){this._decompose(),this._localPosition.copyFrom(e),this._markAsDirtyAndCompose()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this.getRotation()},set:function(e){this.setRotation(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._decompose(),this._localRotation},set:function(e){this.setRotationQuaternion(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this.getScale()},set:function(e){this.setScale(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationPropertiesOverride",{get:function(){return this._skeleton.animationPropertiesOverride},enumerable:!1,configurable:!0}),t.prototype._decompose=function(){this._needToDecompose&&(this._needToDecompose=!1,this._localScaling||(this._localScaling=i.P.Zero(),this._localRotation=i._f.Zero(),this._localPosition=i.P.Zero()),this._localMatrix.decompose(this._localScaling,this._localRotation,this._localPosition))},t.prototype._compose=function(){this._needToCompose&&(this._localScaling?(this._needToCompose=!1,i.y3.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix)):this._needToCompose=!1)},t.prototype.updateMatrix=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0),this._baseMatrix.copyFrom(e),t&&this._updateDifferenceMatrix(),n?(this._needToCompose=!1,this._localMatrix.copyFrom(e),this._markAsDirtyAndDecompose()):this.markAsDirty()},t.prototype._updateDifferenceMatrix=function(e,t){if(void 0===t&&(t=!0),e||(e=this._baseMatrix),this._parent?e.multiplyToRef(this._parent._absoluteTransform,this._absoluteTransform):this._absoluteTransform.copyFrom(e),this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform),t)for(var n=0;n<this.children.length;n++)this.children[n]._updateDifferenceMatrix();this._scalingDeterminant=this._absoluteTransform.determinant()<0?-1:1},t.prototype.markAsDirty=function(){this._currentRenderId++,this._childUpdateId++,this._skeleton._markAsDirty()},t.prototype._markAsDirtyAndCompose=function(){this.markAsDirty(),this._needToCompose=!0},t.prototype._markAsDirtyAndDecompose=function(){this.markAsDirty(),this._needToDecompose=!0},t.prototype.translate=function(e,n,r){void 0===n&&(n=s.T.LOCAL);var o=this.getLocalMatrix();if(n==s.T.LOCAL)o.addAtIndex(12,e.x),o.addAtIndex(13,e.y),o.addAtIndex(14,e.z);else{var a=null;r&&(a=r.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var l=t._tmpMats[0],u=t._tmpVecs[0];this._parent?r&&a?(l.copyFrom(this._parent.getAbsoluteTransform()),l.multiplyToRef(a,l)):l.copyFrom(this._parent.getAbsoluteTransform()):i.y3.IdentityToRef(l),l.setTranslationFromFloats(0,0,0),l.
1invert(),i.P.TransformCoordinatesToRef(e,l,u),o.addAtIndex(12,u.x),o.addAtIndex(13,u.y),o.addAtIndex(14,u.z)}this._markAsDirtyAndDecompose()},t.prototype.setPosition=function(e,n,r){void 0===n&&(n=s.T.LOCAL);var o=this.getLocalMatrix();if(n==s.T.LOCAL)o.setTranslationFromFloats(e.x,e.y,e.z);else{var a=null;r&&(a=r.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var l=t._tmpMats[0],u=t._tmpVecs[0];this._parent?(r&&a?(l.copyFrom(this._parent.getAbsoluteTransform()),l.multiplyToRef(a,l)):l.copyFrom(this._parent.getAbsoluteTransform()),l.invert()):i.y3.IdentityToRef(l),i.P.TransformCoordinatesToRef(e,l,u),o.setTranslationFromFloats(u.x,u.y,u.z)}this._markAsDirtyAndDecompose()},t.prototype.setAbsolutePosition=function(e,t){this.setPosition(e,s.T.WORLD,t)},t.prototype.scale=function(e,n,r,o){void 0===o&&(o=!1);var a=this.getLocalMatrix(),s=t._tmpMats[0];i.y3.ScalingToRef(e,n,r,s),s.multiplyToRef(a,a),s.invert();for(var l=0,u=this.children;l<u.length;l++){var h=(p=u[l]).getLocalMatrix();h.multiplyToRef(s,h),h.multiplyAtIndex(12,e),h.multiplyAtIndex(13,n),h.multiplyAtIndex(14,r),p._markAsDirtyAndDecompose()}if(this._markAsDirtyAndDecompose(),o)for(var c=0,f=this.children;c<f.length;c++){var p;(p=f[c]).scale(e,n,r,o)}},t.prototype.setScale=function(e){this._decompose(),this._localScaling.copyFrom(e),this._markAsDirtyAndCompose()},t.prototype.getScale=function(){return this._decompose(),this._localScaling},t.prototype.getScaleToRef=function(e){this._decompose(),e.copyFrom(this._localScaling)},t.prototype.setYawPitchRoll=function(e,n,r,o,a){if(void 0===o&&(o=s.T.LOCAL),o===s.T.LOCAL){var l=t._tmpQuat;return i._f.RotationYawPitchRollToRef(e,n,r,l),void this.setRotationQuaternion(l,o,a)}var u=t._tmpMats[0];if(this._getNegativeRotationToRef(u,a)){var h=t._tmpMats[1];i.y3.RotationYawPitchRollToRef(e,n,r,h),u.multiplyToRef(h,h),this._rotateWithMatrix(h,o,a)}},t.prototype.rotate=function(e,n,r,o){void 0===r&&(r=s.T.LOCAL);var a=t._tmpMats[0];a.setTranslationFromFloats(0,0,0),i.y3.RotationAxisToRef(e,n,a),this._rotateWithMatrix(a,r,o)},t.prototype.setAxisAngle=function(e,n,r,o){if(void 0===r&&(r=s.T.LOCAL),r===s.T.LOCAL){var a=t._tmpQuat;return i._f.RotationAxisToRef(e,n,a),void this.setRotationQuaternion(a,r,o)}var l=t._tmpMats[0];if(this._getNegativeRotationToRef(l,o)){var u=t._tmpMats[1];i.y3.RotationAxisToRef(e,n,u),l.multiplyToRef(u,u),this._rotateWithMatrix(u,r,o)}},t.prototype.setRotation=function(e,t,n){void 0===t&&(t=s.T.LOCAL),this.setYawPitchRoll(e.y,e.x,e.z,t,n)},t.prototype.setRotationQuaternion=function(e,n,r){if(void 0===n&&(n=s.T.LOCAL),n===s.T.LOCAL)return this._decompose(),this._localRotation.copyFrom(e),void this._markAsDirtyAndCompose();var o=t._tmpMats[0];if(this._getNegativeRotationToRef(o,r)){var a=t._tmpMats[1];i.y3.FromQuaternionToRef(e,a),o.multiplyToRef(a,a),this._rotateWithMatrix(a,n,r)}},t.prototype.setRotationMatrix=function(e,n,r){if(void 0===n&&(n=s.T.LOCAL),n===s.T.LOCAL){var o=t._tmpQuat;return i._f.FromRotationMatrixToRef(e,o),void this.setRotationQuaternion(o,n,r)}var a=t._tmpMats[0];if(this._getNegativeRotationToRef(a,r)){var l=t._tmpMats[1];l.copyFrom(e),a.multiplyToRef(e,l),this._rotateWithMatrix(l,n,r)}},t.prototype._rotateWithMatrix=function(e,n,r){void 0===n&&(n=s.T.LOCAL);var i=this.getLocalMatrix(),o=i.m[12],a=i.m[13],l=i.m[14],u=this.getParent(),h=t._tmpMats[3],c=t._tmpMats[4];u&&n==s.T.WORLD?(r?(h.copyFrom(r.getWorldMatrix()),u.getAbsoluteTransform().multiplyToRef(h,h)):h.copyFrom(u.getAbsoluteTransform()),c.copyFrom(h),c.invert(),i.multiplyToRef(h,i),i.multiplyToRef(e,i),i.multiplyToRef(c,i)):n==s.T.WORLD&&r?(h.copyFrom(r.getWorldMatrix()),c.copyFrom(h),c.invert(),i.multiplyToRef(h,i),i.multiplyToRef(e,i),i.multiplyToRef(c,i)):i.multiplyToRef(e,i),i.setTranslationFromFloats(o,a,l),this.computeAbsoluteTransforms(),this._markAsDirtyAndDecompose()},t.prototype._getNegativeRotationToRef=function(e,n){var r=t._tmpMats[2];return e.copyFrom(this.getAbsoluteTransform()),n&&(e.multiplyToRef(n.getWorldMatrix(),e),i.y3.ScalingToRef(n.scaling.x,n.scaling.y,n.scaling.z,r)),e.invert(),!isNaN(e.m[0])&&(r.multiplyAtIndex(0,this._scalingDeterminant),e.multiplyToRef(r,e),!0)},t.prototype.getPosition=function(e,t){void 0===e&&(e=s.T.LOCAL),void 0===t&&(t=null);var n=i.P.Zero();return this.getPositionToRef(e,t,n),n},t.prototype.getPositionToRef=function(e,n,r){if(void 0===e&&(e=s.T.LOCAL),e==s.T.LOCAL){var i=this.getLocalMatrix();r.x=i.m[12],r.y=i.m[13],r.z=i.m[14]}else{var o=null;n&&(o=n.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var a=t._tmpMats[0];n&&o?(a.copyFrom(this.getAbsoluteTransform()),a.multiplyToRef(o,a)):a=this.getAbsoluteTransform(),r.x=a.m[12],r.y=a.m[13],r.z=a.m[14]}},t.prototype.getAbsolutePosition=function(e){void 0===e&&(e=null);var t=i.P.Zero();return this.getPositionToRef(s.T.WORLD,e,t),t},t.prototype.getAbsolutePositionToRef=function(e,t){this.getPositionToRef(s.T.WORLD,e,t)},t.prototype.computeAbsoluteTransforms=function(){if(this._compose(),this._parent)this._localMatrix.multiplyToRef(this._parent._absoluteTransform,this._absoluteTransform);else{this._absoluteTransform.copyFrom(this._localMatrix);var e=this._skeleton.getPoseMatrix();e&&this._absoluteTransform.multiplyToRef(e,this._absoluteTransform)}for(var t=this.children,n=t.length,r=0;r<n;r++)t[r].computeAbsoluteTransforms()},t.prototype.getDirection=function(e,t){void 0===t&&(t=null);var n=i.P.Zero();return this.getDirectionToRef(e,t,n),n},t.prototype.getDirectionToRef=function(e,n,r){void 0===n&&(n=null);var o=null;n&&(o=n.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var a=t._tmpMats[0];a.copyFrom(this.getAbsoluteTransform()),n&&o&&a.multiplyToRef(o,a),i.P.TransformNormalToRef(e,a,r),r.normalize()},t.prototype.getRotation=function(e,t){void 0===e&&(e=s.T.LOCAL),void 0===t&&(t=null);var n=i.P.Zero();return this.getRotationToRef(e,t,n),n},t.prototype.getRotationToRef=function(e,n,r){void 0===e&&(e=s.T.LOCAL),void 0===n&&(n=null);var i=t._tmpQuat;this.getRotationQuaternionToRef(e,n,i),i.toEulerAnglesToRef(r)},t.prototype.getRotationQuaternion=function(e,t){void 0===e&&(e=s.T.LOCAL),void 0===t&&(t=null);var n=i._f.Identity();return this.getRotationQuaternionToRef(e,t,n),n},t.prototype.getRotationQuaternionToRef=function(e,n,r){if(void 0===e&&(e=s.T.LOCAL),void 0===n&&(n=null),e==s.T.LOCAL)this._decompose(),r.copyFrom(this._localRotation);else{var i=t._tmpMats[0],o=this.getAbsoluteTransform();n?o.multiplyToRef(n.getWorldMatrix(),i):i.copyFrom(o),i.multiplyAtIndex(0,this._scalingDeterminant),i.multiplyAtIndex(1,this._scalingDeterminant),i.multiplyAtIndex(2,this._scalingDeterminant),i.decompose(void 0,r,void 0)}},t.prototype.getRotationMatrix=function(e,t){void 0===e&&(e=s.T.LOCAL);var n=i.y3.Identity();return this.getRotationMatrixToRef(e,t,n),n},t.prototype.getRotationMatrixToRef=function(e,n,r){if(void 0===e&&(e=s.T.LOCAL),e==s.T.LOCAL)this.getLocalMatrix().getRotationMatrixToRef(r);else{var i=t._tmpMats[0],o=this.getAbsoluteTransform();n?o.multiplyToRef(n.getWorldMatrix(),i):i.copyFrom(o),i.multiplyAtIndex(0,this._scalingDeterminant),i.multiplyAtIndex(1,this._scalingDeterminant),i.multiplyAtIndex(2,this._scalingDeterminant),i.getRotationMatrixToRef(r)}},t.prototype.getAbsolutePositionFromLocal=function(e,t){void 0===t&&(t=null);var n=i.P.Zero();return this.getAbsolutePositionFromLocalToRef(e,t,n),n},t.prototype.getAbsolutePositionFromLocalToRef=function(e,n,r){void 0===n&&(n=null);var o=null;n&&(o=n.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var a=t._tmpMats[0];n&&o?(a.copyFrom(this.getAbsoluteTransform()),a.multiplyToRef(o,a)):a=this.getAbsoluteTransform(),i.P.TransformCoordinatesToRef(e,a,r)},t.prototype.getLocalPositionFromAbsolute=function(e,t){void 0===t&&(t=null);var n=i.P.Zero();return this.getLocalPositionFromAbsoluteToRef(e,t,n),n},t.prototype.getLocalPositionFromAbsoluteToRef=function(e,n,r){void 0===n&&(n=null);var o=null;n&&(o=n.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var a=t._tmpMats[0];a.copyFrom(this.getAbsoluteTransform()),n&&o&&a.multiplyToRef(o,a),a.invert(),i.P.TransformCoordinatesToRef(e,a,r)},t.prototype.setCurrentPoseAsRest=function(){this.setRestPose(this.getLocalMatrix())},t._tmpVecs=o.B.BuildArray(2,i.P.Zero),t._tmpQuat=i._f.Identity(),t._tmpMats=o.B.BuildArray(5,i.y3.Identity),t}(a.N)},3113:(e,t,n)=>{"use strict";n.d(t,{O:()=>f});
1var r=n(4164),i=n(475),o=n(2973),a=n(6178),s=n(4635),l=n(2117),u=n(2733),h=n(3734),c=n(789),f=function(){function e(e,t,n){this.name=e,this.id=t,this.bones=new Array,this.needInitialSkinMatrix=!1,this.overrideMesh=null,this._isDirty=!0,this._meshesWithPoseMatrix=new Array,this._identity=o.y3.Identity(),this._ranges={},this._lastAbsoluteTransformsUpdateId=-1,this._canUseTextureForBones=!1,this._uniqueId=0,this._numBonesWithLinkedTransformNode=0,this._hasWaitingData=null,this._waitingOverrideMeshId=null,this.doNotSerialize=!1,this._useTextureToStoreBoneMatrices=!0,this._animationPropertiesOverride=null,this.onBeforeComputeObservable=new i.y$,this.bones=[],this._scene=n||u.l.LastCreatedScene,this._uniqueId=this._scene.getUniqueId(),this._scene.addSkeleton(this),this._isDirty=!0;var r=this._scene.getEngine().getCaps();this._canUseTextureForBones=r.textureFloat&&r.maxVertexTextureImageUnits>0}return Object.defineProperty(e.prototype,"useTextureToStoreBoneMatrices",{get:function(){return this._useTextureToStoreBoneMatrices},set:function(e){this._useTextureToStoreBoneMatrices=e,this._markAsDirty()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUsingTextureForMatrices",{get:function(){return this.useTextureToStoreBoneMatrices&&this._canUseTextureForBones},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!1,configurable:!0}),e.prototype.getClassName=function(){return"Skeleton"},e.prototype.getChildren=function(){return this.bones.filter((function(e){return!e.getParent()}))},e.prototype.getTransformMatrices=function(e){return this.needInitialSkinMatrix&&e._bonesTransformMatrices?e._bonesTransformMatrices:(this._transformMatrices||this.prepare(),this._transformMatrices)},e.prototype.getTransformMatrixTexture=function(e){return this.needInitialSkinMatrix&&e._transformMatrixTexture?e._transformMatrixTexture:this._transformMatrixTexture},e.prototype.getScene=function(){return this._scene},e.prototype.toString=function(e){var t="Name: "+this.name+", nBones: "+this.bones.length;if(t+=", nAnimationRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";var n=!0;for(var r in this._ranges)n&&(t+=", ",n=!1),t+=r;t+="}"}return t},e.prototype.getBoneIndexByName=function(e){for(var t=0,n=this.bones.length;t<n;t++)if(this.bones[t].name===e)return t;return-1},e.prototype.createAnimationRange=function(e,t,n){if(!this._ranges[e]){this._ranges[e]=new l.X(e,t,n);for(var r=0,i=this.bones.length;r<i;r++)this.bones[r].animations[0]&&this.bones[r].animations[0].createRange(e,t,n)}},e.prototype.deleteAnimationRange=function(e,t){void 0===t&&(t=!0);for(var n=0,r=this.bones.length;n<r;n++)this.bones[n].animations[0]&&this.bones[n].animations[0].deleteRange(e,t);this._ranges[e]=null},e.prototype.getAnimationRange=function(e){return this._ranges[e]||null},e.prototype.getAnimationRanges=function(){var e,t=[];for(e in this._ranges)t.push(this._ranges[e]);return t},e.prototype.copyAnimationRange=function(e,t,n){if(void 0===n&&(n=!1),this._ranges[t]||!e.getAnimationRange(t))return!1;var r,i,o=!0,a=this._getHighestAnimationFrame()+1,s={},u=e.bones;for(i=0,r=u.length;i<r;i++)s[u[i].name]=u[i];this.bones.length!==u.length&&(h.Y.Warn("copyAnimationRange: this rig has "+this.bones.length+" bones, while source as "+u.length),o=!1);var c=n&&this.dimensionsAtRest&&e.dimensionsAtRest?this.dimensionsAtRest.divide(e.dimensionsAtRest):null;for(i=0,r=this.bones.length;i<r;i++){var f=this.bones[i].name,p=s[f];p?o=o&&this.bones[i].copyAnimationRange(p,t,a,n,c):(h.Y.Warn("copyAnimationRange: not same rig, missing source bone "+f),o=!1)}var d=e.getAnimationRange(t);return d&&(this._ranges[t]=new l.X(t,d.from+a,d.to+a)),o},e.prototype.returnToRest=function(){for(var e=o.jp.Vector3[0],t=o.jp.Quaternion[0],n=o.jp.Vector3[1],r=0;r<this.bones.length;r++){var i=this.bones[r];-1!==i._index&&(i.returnToRest(),i._linkedTransformNode&&(i.getRestPose().decompose(e,t,n),i._linkedTransformNode.position=n.clone(),i._linkedTransformNode.rotationQuaternion=t.clone(),i._linkedTransformNode.scaling=e.clone()))}},e.prototype._getHighestAnimationFrame=function(){for(var e=0,t=0,n=this.bones.length;t<n;t++)if(this.bones[t].animations[0]){var r=this.bones[t].animations[0].getHighestFrame();e<r&&(e=r)}return e},e.prototype.beginAnimation=function(e,t,n,r){var i=this.getAnimationRange(e);return i?this._scene.beginAnimation(this,i.from,i.to,t,n,r):null},e.MakeAnimationAdditive=function(e,t,n){void 0===t&&(t=0);var r=e.getAnimationRange(n);if(!r)return null;for(var i=e._scene.getAllAnimatablesByTarget(e),o=null,a=0;a<i.length;a++){var l=i[a];if(l.fromFrame===(null==r?void 0:r.from)&&l.toFrame===(null==r?void 0:r.to)){o=l;break}}var u=e.getAnimatables();for(a=0;a<u.length;a++){var h=u[a].animations;if(h)for(var c=0;c<h.length;c++)s.f.MakeAnimationAdditive(h[c],t,n)}return o&&(o.isAdditive=!0),e},e.prototype._markAsDirty=function(){this._isDirty=!0}
1,e.prototype._registerMeshWithPoseMatrix=function(e){this._meshesWithPoseMatrix.push(e)},e.prototype._unregisterMeshWithPoseMatrix=function(e){var t=this._meshesWithPoseMatrix.indexOf(e);t>-1&&this._meshesWithPoseMatrix.splice(t,1)},e.prototype._computeTransformMatrices=function(e,t){this.onBeforeComputeObservable.notifyObservers(this);for(var n=0;n<this.bones.length;n++){var r=this.bones[n];r._childUpdateId++;var i=r.getParent();if(i?r.getLocalMatrix().multiplyToRef(i.getWorldMatrix(),r.getWorldMatrix()):t?r.getLocalMatrix().multiplyToRef(t,r.getWorldMatrix()):r.getWorldMatrix().copyFrom(r.getLocalMatrix()),-1!==r._index){var o=null===r._index?n:r._index;r.getInvertedAbsoluteTransform().multiplyToArray(r.getWorldMatrix(),e,16*o)}}this._identity.copyToArray(e,16*this.bones.length)},e.prototype.prepare=function(){if(this._numBonesWithLinkedTransformNode>0)for(var e=0,t=this.bones;e<t.length;e++){var n=t[e];n._linkedTransformNode&&(n._linkedTransformNode.computeWorldMatrix(),n._matrix=n._linkedTransformNode._localMatrix,n.markAsDirty())}if(this._isDirty){if(this.needInitialSkinMatrix)for(var r=0;r<this._meshesWithPoseMatrix.length;r++){var i=this._meshesWithPoseMatrix[r],s=i.getPoseMatrix();if(i._bonesTransformMatrices&&i._bonesTransformMatrices.length===16*(this.bones.length+1)||(i._bonesTransformMatrices=new Float32Array(16*(this.bones.length+1))),this._synchronizedWithMesh!==i){this._synchronizedWithMesh=i;for(var l=0;l<this.bones.length;l++){var u=this.bones[l];u.getParent()||(u.getBaseMatrix().multiplyToRef(s,o.jp.Matrix[1]),u._updateDifferenceMatrix(o.jp.Matrix[1]))}if(this.isUsingTextureForMatrices){var h=4*(this.bones.length+1);i._transformMatrixTexture&&i._transformMatrixTexture.getSize().width===h||(i._transformMatrixTexture&&i._transformMatrixTexture.dispose(),i._transformMatrixTexture=a.l.CreateRGBATexture(i._bonesTransformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,1,1))}}this._computeTransformMatrices(i._bonesTransformMatrices,s),this.isUsingTextureForMatrices&&i._transformMatrixTexture&&i._transformMatrixTexture.update(i._bonesTransformMatrices)}else this._transformMatrices&&this._transformMatrices.length===16*(this.bones.length+1)||(this._transformMatrices=new Float32Array(16*(this.bones.length+1)),this.isUsingTextureForMatrices&&(this._transformMatrixTexture&&this._transformMatrixTexture.dispose(),this._transformMatrixTexture=a.l.CreateRGBATexture(this._transformMatrices,4*(this.bones.length+1),1,this._scene,!1,!1,1,1))),this._computeTransformMatrices(this._transformMatrices,null),this.isUsingTextureForMatrices&&this._transformMatrixTexture&&this._transformMatrixTexture.update(this._transformMatrices);this._isDirty=!1,this._scene._activeBones.addCount(this.bones.length,!1)}},e.prototype.getAnimatables=function(){if(!this._animatables||this._animatables.length!==this.bones.length){this._animatables=[];for(var e=0;e<this.bones.length;e++)this._animatables.push(this.bones[e])}return this._animatables},e.prototype.clone=function(t,n){var i=new e(t,n||t,this._scene);i.needInitialSkinMatrix=this.needInitialSkinMatrix,i.overrideMesh=this.overrideMesh;for(var o=0;o<this.bones.length;o++){var a=this.bones[o],s=null,l=a.getParent();if(l){var u=this.bones.indexOf(l);s=i.bones[u]}var h=new r.N(a.name,i,s,a.getBaseMatrix().clone(),a.getRestPose().clone());h._index=a._index,a._linkedTransformNode&&h.linkTransformNode(a._linkedTransformNode),c.j.DeepCopy(a.animations,h.animations)}if(this._ranges)for(var f in i._ranges={},this._ranges){var p=this._ranges[f];p&&(i._ranges[f]=p.clone())}return this._isDirty=!0,i},e.prototype.enableBlending=function(e){void 0===e&&(e=.01),this.bones.forEach((function(t){t.animations.forEach((function(t){t.enableBlending=!0,t.blendingSpeed=e}))}))},e.prototype.dispose=function(){this._meshesWithPoseMatrix=[],this.getScene().stopAnimation(this),this.getScene().removeSkeleton(this),this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null)},e.prototype.serialize=function(){var e,t,n={};n.name=this.name,n.id=this.id,this.dimensionsAtRest&&(n.dimensionsAtRest=this.dimensionsAtRest.asArray()),n.bones=[],n.needInitialSkinMatrix=this.needInitialSkinMatrix,n.overrideMeshId=null===(e=this.overrideMesh)||void 0===e?void 0:e.id;for(var r=0;r<this.bones.length;r++){var i=this.bones[r],o=i.getParent(),a={parentBoneIndex:o?this.bones.indexOf(o):-1,index:i.getIndex(),name:i.name,matrix:i.getBaseMatrix().toArray(),rest:i.getRestPose().toArray(),linkedTransformNodeId:null===(t=i.getTransformNode())||void 0===t?void 0:t.id};for(var s in n.bones.push(a),i.length&&(a.length=i.length),i.metadata&&(a.metadata=i.metadata),i.animations&&i.animations.length>0&&(a.animation=i.animations[0].serialize()),n.ranges=[],this._ranges){var l=this._ranges[s];if(l){var u={};u.name=s,u.from=l.from,u.to=l.to,n.ranges.push(u)}}}return n},e.Parse=function(t,n){var i,a=new e(t.name,t.id,n);for(t.dimensionsAtRest&&(a.dimensionsAtRest=o.P.FromArray(t.dimensionsAtRest)),a.needInitialSkinMatrix=t.needInitialSkinMatrix,t.overrideMeshId&&(a._hasWaitingData=!0,a._waitingOverrideMeshId=t.overrideMeshId),i=0;i<t.bones.length;i++){var l=t.bones[i],u=t.bones[i].index,h=null;l.parentBoneIndex>-1&&(h=a.bones[l.parentBoneIndex]);var c=l.rest?o.y3.FromArray(l.rest):null,f=new r.N(l.name,a,h,o.y3.FromArray(l.matrix),c,null,u);void 0!==l.id&&null!==l.id&&(f.id=l.id),l.length&&(f.length=l.length),l.metadata&&(f.metadata=l.metadata),l.animation&&f.animations.push(s.f.Parse(l.animation)),void 0!==l.linkedTransformNodeId&&null!==l.linkedTransformNodeId&&(a._hasWaitingData=!0,f._waitingTransformNodeId=l.linkedTransformNodeId)}if(t.ranges)for(i=0;i<t.ranges.length;i++){var p=t.ranges[i];a.createAnimationRange(p.name,p.from,p.to)}return a},e.prototype.computeAbsoluteTransforms=function(e){void 0===e&&(e=!1);var t=this._scene.getRenderId();(this._lastAbsoluteTransformsUpdateId!=t||e)&&(this.bones[0].computeAbsoluteTransforms(),this._lastAbsoluteTransformsUpdateId=t)},e.prototype.getPoseMatrix=function(){var e=null;
1return this._meshesWithPoseMatrix.length>0&&(e=this._meshesWithPoseMatrix[0].getPoseMatrix()),e},e.prototype.sortBones=function(){for(var e=new Array,t=new Array(this.bones.length),n=0;n<this.bones.length;n++)this._sortBones(n,e,t);this.bones=e},e.prototype._sortBones=function(e,t,n){if(!n[e]){n[e]=!0;var r=this.bones[e];void 0===r._index&&(r._index=e);var i=r.getParent();i&&this._sortBones(this.bones.indexOf(i),t,n),t.push(r)}},e.prototype.setCurrentPoseAsRest=function(){this.bones.forEach((function(e){e.setCurrentPoseAsRest()}))},e}()},4012:(e,t,n)=>{"use strict";var r=n(7627),i=n(3734),o=n(8810),a=n(6558);function s(e,t,n,r){var i;i=1===r?new Float32Array(t*n*4):new Uint32Array(t*n*4);for(var o=0;o<t;o++)for(var a=0;a<n;a++){var s=3*(a*t+o),l=4*(a*t+o);i[l+0]=e[s+0],i[l+1]=e[s+1],i[l+2]=e[s+2],i[l+3]=1}return i}function l(e){return function(t,n,i,o,a,s,l,u,h,c){void 0===h&&(h=null),void 0===c&&(c=0);var f=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,p=e?r.S.Raw3D:r.S.Raw2DArray,d=new r.l(this,p);d.baseWidth=n,d.baseHeight=i,d.baseDepth=o,d.width=n,d.height=i,d.depth=o,d.format=a,d.type=c,d.generateMipMaps=s,d.samplingMode=u,e?d.is3D=!0:d.is2DArray=!0,this._doNotHandleContextLost||(d._bufferView=t),e?this.updateRawTexture3D(d,t,a,l,h,c):this.updateRawTexture2DArray(d,t,a,l,h,c),this._bindTextureDirectly(f,d,!0);var _=this._getSamplingParameters(u,s);return this._gl.texParameteri(f,this._gl.TEXTURE_MAG_FILTER,_.mag),this._gl.texParameteri(f,this._gl.TEXTURE_MIN_FILTER,_.min),s&&this._gl.generateMipmap(f),this._bindTextureDirectly(f,null),this._internalTexturesCache.push(d),d}}function u(e){return function(t,n,r,i,o,a){void 0===o&&(o=null),void 0===a&&(a=0);var s=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,l=this._getWebGLTextureType(a),u=this._getInternalFormat(r),h=this._getRGBABufferInternalSizedFormat(a,r);this._bindTextureDirectly(s,t,!0),this._unpackFlipY(void 0===i||!!i),this._doNotHandleContextLost||(t._bufferView=n,t.format=r,t.invertY=i,t._compression=o),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),o&&n?this._gl.compressedTexImage3D(s,0,this.getCaps().s3tc[o],t.width,t.height,t.depth,0,n):this._gl.texImage3D(s,0,h,t.width,t.height,t.depth,0,u,l,n),t.generateMipMaps&&this._gl.generateMipmap(s),this._bindTextureDirectly(s,null),t.isReady=!0}}a.B.prototype.updateRawTexture=function(e,t,n,r,i,o){if(void 0===i&&(i=null),void 0===o&&(o=0),e){var a=this._getRGBABufferInternalSizedFormat(o,n),s=this._getInternalFormat(n),l=this._getWebGLTextureType(o);this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===r||!!r),this._doNotHandleContextLost||(e._bufferView=t,e.format=n,e.type=o,e.invertY=r,e._compression=i),e.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),i&&t?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[i],e.width,e.height,0,t):this._gl.texImage2D(this._gl.TEXTURE_2D,0,a,e.width,e.height,0,s,l,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0}},a.B.prototype.createRawTexture=function(e,t,n,i,o,a,s,l,u){void 0===l&&(l=null),void 0===u&&(u=0);var h=new r.l(this,r.S.Raw);h.baseWidth=t,h.baseHeight=n,h.width=t,h.height=n,h.format=i,h.generateMipMaps=o,h.samplingMode=s,h.invertY=a,h._compression=l,h.type=u,this._doNotHandleContextLost||(h._bufferView=e),this.updateRawTexture(h,e,i,a,l,u),this._bindTextureDirectly(this._gl.TEXTURE_2D,h,!0);var c=this._getSamplingParameters(s,o);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,c.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,c.min),o&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(h),h},a.B.prototype.createRawCubeTexture=function(e,t,n,a,s,l,u,h){void 0===h&&(h=null);var c=this._gl,f=new r.l(this,r.S.CubeRaw);f.isCube=!0,f.format=n,f.type=a,this._doNotHandleContextLost||(f._bufferViewArray=e);var p=this._getWebGLTextureType(a),d=this._getInternalFormat(n);d===c.RGB&&(d=c.RGBA),p!==c.FLOAT||this._caps.textureFloatLinearFiltering?p!==this._gl.HALF_FLOAT_OES||this._caps.textureHalfFloatLinearFiltering?p!==c.FLOAT||this._caps.textureFloatRen
1der?p!==c.HALF_FLOAT||this._caps.colorBufferFloat||(s=!1,i.Y.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")):(s=!1,i.Y.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):(s=!1,u=1,i.Y.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):(s=!1,u=1,i.Y.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."));var _=t,m=_;f.width=_,f.height=m,!this.needPOTTextures||o.w1.IsExponentOfTwo(f.width)&&o.w1.IsExponentOfTwo(f.height)||(s=!1),e&&this.updateRawCubeTexture(f,e,n,a,l,h),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,f,!0),e&&s&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);var g=this._getSamplingParameters(u,s);return c.texParameteri(c.TEXTURE_CUBE_MAP,c.TEXTURE_MAG_FILTER,g.mag),c.texParameteri(c.TEXTURE_CUBE_MAP,c.TEXTURE_MIN_FILTER,g.min),c.texParameteri(c.TEXTURE_CUBE_MAP,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_CUBE_MAP,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,null),f.generateMipMaps=s,f},a.B.prototype.updateRawCubeTexture=function(e,t,n,r,i,a,l){void 0===a&&(a=null),void 0===l&&(l=0),e._bufferViewArray=t,e.format=n,e.type=r,e.invertY=i,e._compression=a;var u=this._gl,h=this._getWebGLTextureType(r),c=this._getInternalFormat(n),f=this._getRGBABufferInternalSizedFormat(r),p=!1;c===u.RGB&&(c=u.RGBA,p=!0),this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(void 0===i||!!i),e.width%4!=0&&u.pixelStorei(u.UNPACK_ALIGNMENT,1);for(var d=0;d<6;d++){var _=t[d];a?u.compressedTexImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+d,l,this.getCaps().s3tc[a],e.width,e.height,0,_):(p&&(_=s(_,e.width,e.height,r)),u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+d,l,f,e.width,e.height,0,c,h,_))}(!this.needPOTTextures||o.w1.IsExponentOfTwo(e.width)&&o.w1.IsExponentOfTwo(e.height))&&e.generateMipMaps&&0===l&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),e.isReady=!0},a.B.prototype.createRawCubeTextureFromUrl=function(e,t,n,r,i,o,a,l,u,h,c,f){var p=this;void 0===u&&(u=null),void 0===h&&(h=null),void 0===c&&(c=3),void 0===f&&(f=!1);var d=this._gl,_=this.createRawCubeTexture(null,n,r,i,!o,f,c,null);return null==t||t._addPendingData(_),_.url=e,this._internalTexturesCache.push(_),this._loadFile(e,(function(e){!function(e){var n=_.width,o=a(e);if(o){if(l){var h=p._getWebGLTextureType(i),c=p._getInternalFormat(r),m=p._getRGBABufferInternalSizedFormat(i),g=!1;c===d.RGB&&(c=d.RGBA,g=!0),p._bindTextureDirectly(d.TEXTURE_CUBE_MAP,_,!0),p._unpackFlipY(!1);for(var y=l(o),v=0;v<y.length;v++)for(var A=n>>v,b=0;b<6;b++){var T=y[v][b];g&&(T=s(T,A,A,i)),d.texImage2D(b,v,m,A,A,0,c,h,T)}p._bindTextureDirectly(d.TEXTURE_CUBE_MAP,null)}else p.updateRawCubeTexture(_,o,r,i,f);_.isReady=!0,null==t||t._removePendingData(_),u&&u()}}(e)}
1),void 0,null==t?void 0:t.offlineProvider,!0,(function(e,n){null==t||t._removePendingData(_),h&&e&&h(e.status+" "+e.statusText,n)})),_},a.B.prototype.createRawTexture2DArray=l(!1),a.B.prototype.createRawTexture3D=l(!0),a.B.prototype.updateRawTexture2DArray=u(!1),a.B.prototype.updateRawTexture3D=u(!0)},6178:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var r=n(655),i=n(1277),o=(n(4012),function(e){function t(t,n,r,o,a,s,l,u,h){void 0===s&&(s=!0),void 0===l&&(l=!1),void 0===u&&(u=3),void 0===h&&(h=0);var c=e.call(this,null,a,!s,l)||this;return c.format=o,c._engine?(c._texture=c._engine.createRawTexture(t,n,r,o,s,l,u,null,h),c.wrapU=i.x.CLAMP_ADDRESSMODE,c.wrapV=i.x.CLAMP_ADDRESSMODE,c):c}return(0,r.ZT)(t,e),t.prototype.update=function(e){this._getEngine().updateRawTexture(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)},t.CreateLuminanceTexture=function(e,n,r,i,o,a,s){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=3),new t(e,n,r,1,i,o,a,s)},t.CreateLuminanceAlphaTexture=function(e,n,r,i,o,a,s){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=3),new t(e,n,r,2,i,o,a,s)},t.CreateAlphaTexture=function(e,n,r,i,o,a,s){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=3),new t(e,n,r,0,i,o,a,s)},t.CreateRGBTexture=function(e,n,r,i,o,a,s,l){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=3),void 0===l&&(l=0),new t(e,n,r,4,i,o,a,s,l)},t.CreateRGBATexture=function(e,n,r,i,o,a,s,l){return void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===s&&(s=3),void 0===l&&(l=0),new t(e,n,r,5,i,o,a,s,l)},t.CreateRTexture=function(e,n,r,o,a,s,l,u){return void 0===a&&(a=!0),void 0===s&&(s=!1),void 0===l&&(l=i.x.TRILINEAR_SAMPLINGMODE),void 0===u&&(u=1),new t(e,n,r,6,o,a,s,l,u)},t}(i.x))},4967:(e,t,n)=>{"use strict";n.d(t,{d:()=>i});var r=n(1373),i=function(){function e(e){this.byteOffset=0,this.buffer=e}return e.prototype.loadAsync=function(e){var t=this;return this.buffer.readAsync(this.byteOffset,e).then((function(e){t._dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),t._dataByteOffset=0}))},e.prototype.readUint32=function(){var e=this._dataView.getUint32(this._dataByteOffset,!0);return this._dataByteOffset+=4,this.byteOffset+=4,e},e.prototype.readUint8Array=function(e){var t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._dataByteOffset,e);return this._dataByteOffset+=e,this.byteOffset+=e,t},e.prototype.readString=function(e){return r.M.Decode(this.readUint8Array(e))},e.prototype.skipBytes=function(e){this._dataByteOffset+=e,this.byteOffset+=e},e}()},4637:(e,t,n)=>{"use strict";n.d(t,{B:()=>r});var r=function(){function e(){var e=this;this.promise=new Promise((function(t,n){e._resolve=t,e._reject=n}))}return Object.defineProperty(e.prototype,"resolve",{get:function(){return this._resolve},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reject",{get:function(){return this._reject},enumerable:!1,configurable:!0}),e}()},8502:(e,t,n)=>{"use strict";n.d(t,{Y:()=>u});var r=n(655),i=n(475),o=n(2733),a=n(6738),s=n(9023),l=n(6132),u=function(){function e(e,t,n){void 0===t&&(t=0),void 0===n&&(n=null),this.name=e,this.animations=new Array,this._positions=null,this._normals=null,this._tangents=null,this._uvs=null,this._uniqueId=0,this.onInfluenceChanged=new i.y$,this._onDataLayoutChanged=new i.y$,this._animationPropertiesOverride=null,this._scene=n||o.l.LastCreatedScene,this.influence=t,this._scene&&(this._uniqueId=this._scene.getUniqueId())}return Object.defineProperty(e.prototype,"influence",{get:function(){return this._influence},set:function(e){if(this._influence!==e){var t=this._influence;this._influence=e,this.onInfluenceChanged.hasObservers()&&this.onInfluenceChanged.notifyObservers(0===t||0===e)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return!this._animationPropertiesOverride&&this._scene?this._scene.animationPropertiesOverride:this._animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPositions",{get:function(){return!!this._positions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasNormals",{get:function(){return!!this._normals},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTangents",{get:function(){return!!this._tangents},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasUVs",{get:function(){return!!this._uvs},enumerable:!1,configurable:!0}),e.prototype.setPositions=function(e){var t=this.hasPositions;this._positions=e,t!==this.hasPositions&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getPositions=function(){return this._positions},e.prototype.setNormals=function(e){var t=this.hasNormals;this._normals=e,t!==this.hasNormals&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getNormals=function(){return this._normals},e.prototype.setTangents=function(e){var t=this.hasTangents;this._tangents=e,t!==this.hasTangents&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getTangents=function(){return this._tangents},e.prototype.setUVs=function(e){var t=this.hasUVs;this._uvs=e,t!==this.hasUVs&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getUVs=function(){return this._uvs},e.prototype.clone=function(){var t=this,n=s.p4.Clone((function(){return new e(t.name,t.influence,t._scene)}),this);return n._positions=this._positions,n._normals=this._normals,n._tangents=this._tangents,n._uvs=this._uvs,n},e.prototype.serialize=function(){var e={};return e.name=this.name,e.influence=this.influence,e.positions=Array.prototype.slice.call(this.getPositions()),null!=this.id&&(e.id=this.id),this.hasNormals&&
1(e.normals=Array.prototype.slice.call(this.getNormals())),this.hasTangents&&(e.tangents=Array.prototype.slice.call(this.getTangents())),this.hasUVs&&(e.uvs=Array.prototype.slice.call(this.getUVs())),s.p4.AppendSerializedAnimations(this,e),e},e.prototype.getClassName=function(){return"MorphTarget"},e.Parse=function(t){var n=new e(t.name,t.influence);if(n.setPositions(t.positions),null!=t.id&&(n.id=t.id),t.normals&&n.setNormals(t.normals),t.tangents&&n.setTangents(t.tangents),t.uvs&&n.setUVs(t.uvs),t.animations)for(var r=0;r<t.animations.length;r++){var i=t.animations[r],o=l.Q.GetClass("BABYLON.Animation");o&&n.animations.push(o.Parse(i))}return n},e.FromMesh=function(t,n,r){n||(n=t.name);var i=new e(n,r,t.getScene());return i.setPositions(t.getVerticesData(a.o.PositionKind)),t.isVerticesDataPresent(a.o.NormalKind)&&i.setNormals(t.getVerticesData(a.o.NormalKind)),t.isVerticesDataPresent(a.o.TangentKind)&&i.setTangents(t.getVerticesData(a.o.TangentKind)),t.isVerticesDataPresent(a.o.UVKind)&&i.setUVs(t.getVerticesData(a.o.UVKind)),i},(0,r.gn)([(0,s.qC)()],e.prototype,"id",void 0),e}()},426:(e,t,n)=>{"use strict";n.d(t,{O:()=>s});var r=n(6936),i=n(3734),o=n(2733),a=n(8502),s=function(){function e(e){void 0===e&&(e=null),this._targets=new Array,this._targetInfluenceChangedObservers=new Array,this._targetDataLayoutChangedObservers=new Array,this._activeTargets=new r.t(16),this._supportsNormals=!1,this._supportsTangents=!1,this._supportsUVs=!1,this._vertexCount=0,this._uniqueId=0,this._tempInfluences=new Array,this.enableNormalMorphing=!0,this.enableTangentMorphing=!0,this.enableUVMorphing=!0,e||(e=o.l.LastCreatedScene),this._scene=e,this._scene&&(this._scene.morphTargetManagers.push(this),this._uniqueId=this._scene.getUniqueId())}return Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vertexCount",{get:function(){return this._vertexCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsNormals",{get:function(){return this._supportsNormals&&this.enableNormalMorphing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsTangents",{get:function(){return this._supportsTangents&&this.enableTangentMorphing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsUVs",{get:function(){return this._supportsUVs&&this.enableUVMorphing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numTargets",{get:function(){return this._targets.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numInfluencers",{get:function(){return this._activeTargets.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"influences",{get:function(){return this._influences},enumerable:!1,configurable:!0}),e.prototype.getActiveTarget=function(e){return this._activeTargets.data[e]},e.prototype.getTarget=function(e){return this._targets[e]},e.prototype.addTarget=function(e){var t=this;this._targets.push(e),this._targetInfluenceChangedObservers.push(e.onInfluenceChanged.add((function(e){t._syncActiveTargets(e)}))),this._targetDataLayoutChangedObservers.push(e._onDataLayoutChanged.add((function(){t._syncActiveTargets(!0)}))),this._syncActiveTargets(!0)},e.prototype.removeTarget=function(e){var t=this._targets.indexOf(e);t>=0&&(this._targets.splice(t,1),e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t,1)[0]),e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t,1)[0]),this._syncActiveTargets(!0))},e.prototype.clone=function(){for(var t=new e(this._scene),n=0,r=this._targets;n<r.length;n++){var i=r[n];t.addTarget(i.clone())}return t.enableNormalMorphing=this.enableNormalMorphing,t.enableTangentMorphing=this.enableTangentMorphing,t.enableUVMorphing=this.enableUVMorphing,t},e.prototype.serialize=function(){var e={};e.id=this.uniqueId,e.targets=[];for(var t=0,n=this._targets;t<n.length;t++){var r=n[t];e.targets.push(r.serialize())}return e},e.prototype._syncActiveTargets=function(e){var t=0;this._activeTargets.reset(),this._supportsNormals=!0,this._supportsTangents=!0,this._supportsUVs=!0,this._vertexCount=0;for(var n=0,r=this._targets;n<r.length;n++){var o=r[n];if(0!==o.influence){this._activeTargets.push(o),this._tempInfluences[t++]=o.influence,this._supportsNormals=this._supportsNormals&&o.hasNormals,this._supportsTangents=this._supportsTangents&&o.hasTangents,this._supportsUVs=this._supportsUVs&&o.hasUVs;var a=o.getPositions();if(a){var s=a.length/3;if(0===this._vertexCount)this._vertexCount=s;else if(this._vertexCount!==s)return void i.Y.Error("Incompatible target. Targets must all have the same vertices count.")}}}this._influences&&this._influences.length===t||(this._influences=new Float32Array(t));for(var l=0;l<t;l++)this._influences[l]=this._tempInfluences[l];e&&this.synchronize()},e.prototype.synchronize=function(){if(this._scene)for(var e=0,t=this._scene.meshes;e<t.length;e++){var n=t[e];n.morphTargetManager===this&&n._syncGeometryWithMorphTargetManager()}},e.Parse=function(t,n){var r=new e(n);r._uniqueId=t.id;for(var i=0,o=t.targets;i<o.length;i++){var s=o[i];r.addTarget(a.Y.Parse(s))}return r},e}()}
1,4518:(e,t,n)=>{"use strict";n.d(t,{fD:()=>l,ve:()=>u,TJ:()=>h});var r=n(655),i=n(2611),o=n(2131),a=n(3734),s=n(2733),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.ZT)(t,e),t}(i.p),u=function(){this.rootNodes=[],this.skeletons=[],this.animationGroups=[]},h=function(e){function t(t){var n=e.call(this)||this;return n._wasAddedToScene=!1,n.scene=t,n.sounds=[],n.effectLayers=[],n.layers=[],n.lensFlareSystems=[],n.proceduralTextures=[],n.reflectionProbes=[],t.onDisposeObservable.add((function(){n._wasAddedToScene||n.dispose()})),n}return(0,r.ZT)(t,e),t.prototype.instantiateModelsToScene=function(e,t){var n=this;void 0===t&&(t=!1);var r={},i={},a=new u,s=[],l=[],h={doNotInstantiate:!0},c=function(t,n){if(r[t.uniqueId]=n.uniqueId,i[n.uniqueId]=n,e&&(n.name=e(t.name)),n instanceof o.Kj){var a=n;if(a.morphTargetManager){var s=t.morphTargetManager;a.morphTargetManager=s.clone();for(var l=0;l<s.numTargets;l++){var u=s.getTarget(l),h=a.morphTargetManager.getTarget(l);r[u.uniqueId]=h.uniqueId,i[h.uniqueId]=h}}}};return this.transformNodes.forEach((function(e){if(!e.parent){var t=e.instantiateHierarchy(null,h,(function(e,t){c(e,t)}));t&&a.rootNodes.push(t)}})),this.meshes.forEach((function(o){if(!o.parent){var s=o.instantiateHierarchy(null,h,(function(o,a){if(c(o,a),a.material){var s=a;if(s.material)if(t){var u=o.material;if(-1===l.indexOf(u)){var h=u.clone(e?e(u.name):"Clone of "+u.name);if(l.push(u),r[u.uniqueId]=h.uniqueId,i[h.uniqueId]=h,"MultiMaterial"===u.getClassName()){for(var f=u,p=0,d=f.subMaterials;p<d.length;p++){var _=d[p];_&&(h=_.clone(e?e(_.name):"Clone of "+_.name),l.push(_),r[_.uniqueId]=h.uniqueId,i[h.uniqueId]=h)}f.subMaterials=f.subMaterials.map((function(e){return e&&i[r[e.uniqueId]]}))}}s.material=i[r[u.uniqueId]]}else"MultiMaterial"===s.material.getClassName()?-1===n.scene.multiMaterials.indexOf(s.material)&&n.scene.addMultiMaterial(s.material):-1===n.scene.materials.indexOf(s.material)&&n.scene.addMaterial(s.material)}}));s&&a.rootNodes.push(s)}})),this.skeletons.forEach((function(t){var o=t.clone(e?e(t.name):"Clone of "+t.name);t.overrideMesh&&(o.overrideMesh=i[r[t.overrideMesh.uniqueId]]);for(var l=0,u=n.meshes;l<u.length;l++){var h=u[l];if(h.skeleton===t&&!h.isAnInstance){if(i[r[h.uniqueId]].skeleton=o,-1!==s.indexOf(o))continue;s.push(o);for(var c=0,f=o.bones;c<f.length;c++){var p=f[c];p._linkedTransformNode&&(p._linkedTransformNode=i[r[p._linkedTransformNode.uniqueId]])}}}a.skeletons.push(o)})),this.animationGroups.forEach((function(e){var t=e.clone(e.name,(function(e){return i[r[e.uniqueId]]||e}));a.animationGroups.push(t)})),a},t.prototype.addAllToScene=function(){var e=this;this._wasAddedToScene=!0,this.cameras.forEach((function(t){e.scene.addCamera(t)})),this.lights.forEach((function(t){e.scene.addLight(t)})),this.meshes.forEach((function(t){e.scene.addMesh(t)})),this.skeletons.forEach((function(t){e.scene.addSkeleton(t)})),this.animations.forEach((function(t){e.scene.addAnimation(t)})),this.animationGroups.forEach((function(t){e.scene.addAnimationGroup(t)})),this.multiMaterials.forEach((function(t){e.scene.addMultiMaterial(t)})),this.materials.forEach((function(t){e.scene.addMaterial(t)})),this.morphTargetManagers.forEach((function(t){e.scene.addMorphTargetManager(t)})),this.geometries.forEach((function(t){e.scene.addGeometry(t)})),this.transformNodes.forEach((function(t){e.scene.addTransformNode(t)})),this.actionManagers.forEach((function(t){e.scene.addActionManager(t)})),this.textures.forEach((function(t){e.scene.addTexture(t)})),this.reflectionProbes.forEach((function(t){e.scene.addReflectionProbe(t)})),this.environmentTexture&&(this.scene.environmentTexture=this.environmentTexture);for(var t=0,n=this.scene._serializableComponents;t<n.length;t++)n[t].addFromContainer(this)},t.prototype.removeAllFromScene=function(){var e=this;this._wasAddedToScene=!1,this.cameras.forEach((function(t){e.scene.removeCamera(t)})),this.lights.forEach((function(t){e.scene.removeLight(t)})),this.meshes.forEach((function(t){e.scene.removeMesh(t)}
1)),this.skeletons.forEach((function(t){e.scene.removeSkeleton(t)})),this.animations.forEach((function(t){e.scene.removeAnimation(t)})),this.animationGroups.forEach((function(t){e.scene.removeAnimationGroup(t)})),this.multiMaterials.forEach((function(t){e.scene.removeMultiMaterial(t)})),this.materials.forEach((function(t){e.scene.removeMaterial(t)})),this.morphTargetManagers.forEach((function(t){e.scene.removeMorphTargetManager(t)})),this.geometries.forEach((function(t){e.scene.removeGeometry(t)})),this.transformNodes.forEach((function(t){e.scene.removeTransformNode(t)})),this.actionManagers.forEach((function(t){e.scene.removeActionManager(t)})),this.textures.forEach((function(t){e.scene.removeTexture(t)})),this.reflectionProbes.forEach((function(t){e.scene.removeReflectionProbe(t)})),this.environmentTexture===this.scene.environmentTexture&&(this.scene.environmentTexture=null);for(var t=0,n=this.scene._serializableComponents;t<n.length;t++)n[t].removeFromContainer(this)},t.prototype.dispose=function(){this.cameras.forEach((function(e){e.dispose()})),this.cameras=[],this.lights.forEach((function(e){e.dispose()})),this.lights=[],this.meshes.forEach((function(e){e.dispose()})),this.meshes=[],this.skeletons.forEach((function(e){e.dispose()})),this.skeletons=[],this.animationGroups.forEach((function(e){e.dispose()})),this.animationGroups=[],this.multiMaterials.forEach((function(e){e.dispose()})),this.multiMaterials=[],this.materials.forEach((function(e){e.dispose()})),this.materials=[],this.geometries.forEach((function(e){e.dispose()})),this.geometries=[],this.transformNodes.forEach((function(e){e.dispose()})),this.transformNodes=[],this.actionManagers.forEach((function(e){e.dispose()})),this.actionManagers=[],this.textures.forEach((function(e){e.dispose()})),this.textures=[],this.reflectionProbes.forEach((function(e){e.dispose()})),this.reflectionProbes=[],this.environmentTexture&&(this.environmentTexture.dispose(),this.environmentTexture=null);for(var e=0,t=this.scene._serializableComponents;e<t.length;e++)t[e].removeFromContainer(this,!0)},t.prototype._moveAssets=function(e,t,n){if(e)for(var r=0,i=e;r<i.length;r++){var o=i[r],a=!0;if(n)for(var s=0,l=n;s<l.length;s++)if(o===l[s]){a=!1;break}a&&t.push(o)}},t.prototype.moveAllFromScene=function(e){for(var t in this._wasAddedToScene=!1,void 0===e&&(e=new l),this)this.hasOwnProperty(t)&&(this[t]=this[t]||("environmentTexture"===t?null:[]),this._moveAssets(this.scene[t],this[t],e[t]));this.environmentTexture=this.scene.environmentTexture,this.removeAllFromScene()},t.prototype.createRootMesh=function(){var e=new o.Kj("assetContainerRootMesh",this.scene);return this.meshes.forEach((function(t){t.parent||e.addChild(t)})),this.meshes.unshift(e),e},t.prototype.mergeAnimationsTo=function(e,t,n){if(void 0===e&&(e=s.l.LastCreatedScene),void 0===n&&(n=null),!e)return a.Y.Error("No scene available to merge animations to"),[];var r=n||function(t){var n=null,r=t.animations.length?t.animations[0].targetProperty:"",i=t.name.split(".").join("").split("_primitive")[0];switch(r){case"position":case"rotationQuaternion":n=e.getTransformNodeByName(t.name)||e.getTransformNodeByName(i);break;case"influence":n=e.getMorphTargetByName(t.name)||e.getMorphTargetByName(i);break;default:n=e.getNodeByName(t.name)||e.getNodeByName(i)}return n};this.getNodes().forEach((function(e){var t=r(e);if(null!==t){for(var n=function(e){for(var n=0,r=t.animations.filter((function(t){return t.targetProperty===e.targetProperty}));n<r.length;n++){var i=r[n],o=t.animations.indexOf(i,0);o>-1&&t.animations.splice(o,1)}},i=0,o=e.animations;i<o.length;i++)n(o[i]);t.animations=t.animations.concat(e.animations)}}));var i=new Array;return this.animationGroups.slice().forEach((function(e){i.push(e.clone(e.name,r)),e.animatables.forEach((function(e){e.stop()}))})),t.forEach((function(t){var n=r(t.target);n&&(e.beginAnimation(n,t.fromFrame,t.toFrame,t.loopAnimation,t.speedRatio,t.onAnimationEnd?t.onAnimationEnd:void 0,void 0,!0,void 0,t.onAnimationLoop?t.onAnimationLoop:void 0),e.stopAnimation(t.target))})),i},t}(i.p)},6282:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ArrayItem:()=>P,GLTFLoader:()=>I});var r=n(4637),i=n(2973),o=n(8362),a=n(8810),s=n(7659),l=n(1251),u=n(5398),h=n(4635),c=n(4164),f=n(3113),p=n(511),d=n(3588),_=n(1277),m=n(5511),g=n(6738),y=n(3953),v=n(2131),A=n(8502),b=n(426),T=n(3975),O=n(5569),M=n(6852),x=n(3734),E=n(9353),P=function(){function e(){}return e.Get=function(e,t,n){if(!t||null==n||!t[n])throw new Error(e+": Failed to find index ("+n+")");return t[n]},e.Assign=function(e){if(e)for(var t=0;t<e.length;t++)e[t].index=t},e}(),I=function(){function e(e){this._completePromises=new Array,this._forAssetContainer=!1,this._babylonLights=[],this._disableInstancedMesh=0,this._disposed=!1,this._state=null,this._extensions=new Array,this._defaultBabylonMaterialData={},this._parent=e}return e.RegisterExtension=function(t,n){e.UnregisterExtension(t)&&x.Y.Warn("Extension with the name '"+t+"' already exists"),e._RegisteredExtensions[t]={factory:n}},e.UnregisterExtension=function(t){return!!e._RegisteredExtensions[t]&&(delete e._RegisteredExtensions[t],!0)},Object.defineProperty(e.prototype,"state",{get:function(){return this._state}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gltf",{get:function(){return this._gltf},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bin",{get:function(){return this._bin},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"babylonScene",{get:function(){return this._babylonScene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootBabylonMesh",{get:function(){return this._rootBabylonMesh},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){if(!this._disposed){for(var e in this._disposed=!0,this._completePromises.length=0,this._extensions){var t=this._extensions[e];t.dispose&&t.dispose(),delete this._extensions[e]}this._gltf=null,this._babylonScene=null,this._rootBabylonMesh=null,this._parent.dispose()}},e.prototype.importMeshAsync=function(e,t,n,r,i,o,a){var s=this;return Promise.resolve().then((function(){s._babylonScene=t,s._rootUrl=i,s._fileName=a||"scene",s._forAssetContainer=n,s._loadData(r);var o=null;if(e){var l={};if(s._gltf.nodes)for(var u=0,h=s._gltf.nodes;u<h.length;u++){var c=h[u];c.name&&(l[c.name]=c.index)}o=(e instanceof Array?e:[e]).map((function(e){var t=l[e];if(void 0===t)throw new Error("Failed to find node '"+e+"'");return t}))}return s._loadAsync(o,(function(){return{meshes:s._getMeshes(),particleSystems:[],skeletons:s._getSkeletons(),animationGroups:s._getAnimationGroups(),lights:s._babylonLights,transformNodes:s._getTransformNodes(),geometries:s._getGeometries()}}))}))},e.prototype.loadAsync=function(e,t,n,r,i){var o=this;return Promise.resolve().then((function(){return o._babylonScene=e,o._rootUrl=n,o._fileName=i||"scene",o._loadData(t),o._loadAsync(null,(function(){}))}))},e.prototype._loadAsync=function(e,t){var n=this;return Promise.resolve().then((function(){n._uniqueRootUrl=-1===n._rootUrl.indexOf("file:")&&n._fileName?n._rootUrl:""+n._rootUrl+Date.now()+"/",n._loadExtensions(),n._checkExtensions();var r=T.zA[T.zA.LOADING]+" => "+T.zA[T.zA.READY],i=T.zA[T.zA.LOADING]+" => "+T.zA[T.zA.COMPLETE];n._parent._startPerformanceCounter(r),n._parent._startPerformanceCounter(i),n._setState(T.zA.LOADING),n._extensionsOnLoading();var o=new Array,s=n._babylonScene.blockMaterialDirtyMechanism;if(n._babylonScene.blockMaterialDirtyMechanism=!0,e)o.push(n.loadSceneAsync("/nodes",{nodes:e,index:-1}));else if(null!=n._gltf.scene||n._gltf.scenes&&n._gltf.scenes[0]){var l=P.Get("/scene",n._gltf.scenes,n._gltf.scene||0);o.push(n.loadSceneAsync("/scenes/"+l.index,l))}if(n.parent.loadAllMaterials&&n._gltf.materials)for(var u=0;u<n._gltf.materials.length;++u){var h=n._gltf.materials[u],c="/materials/"+u,f=p.F.TriangleFillMode;o.push(n._loadMaterialAsync(c,h,null,f,(function(e){})))}n._babylonScene.blockMaterialDirtyMechanism=s,n._parent.compileMaterials&&o.push(n._compileMaterialsAsync()),n._parent.compileShadowGenerators&&o.push(n._compileShadowGeneratorsAsync());var d=Promise.all(o).then((function(){return n._rootBabylonMesh&&n._rootBabylonMesh.setEnabled(!0),n._extensionsOnReady(),n._setState(T.zA.READY),n._startAnimations(),t()}));return d.then((function(){n._parent._endPerformanceCounter(r),a.w1.SetImmediate((function(){n._disposed||Promise.all(n._completePromises).then((function(){n._parent._endPerformanceCounter(i),n._setState(T.zA.COMPLETE),n._parent.onCompleteObservable.notifyObservers(void 0),n._parent.onCompleteObservable.clear(),n.dispose()}),(function(e){n._parent.onErrorObservable.notifyObservers(e),n._parent.onErrorObservable.clear(),n.dispose()}))}))})),d})).catch((function(e){throw n._disposed||(n._parent.onErrorObservable.notifyObservers(e),n._parent.onErrorObservable.clear(),n.dispose()),e}))},e.prototype._loadData=function(e){if(this._gltf=e.json,this._setupData(),e.bin){var t=this._gltf.buffers;if(t&&t[0]&&!t[0].uri){var n=t[0];(n.byteLength<e.bin.byteLength-3||n.byteLength>e.bin.byteLength)&&x.Y.Warn("Binary buffer length ("+n.byteLength+") from JSON does not match chunk length ("+e.bin.byteLength+")"),this._bin=e.bin}else x.Y.Warn("Unexpected BIN chunk")}},e.prototype._setupData=function(){if(P.Assign(this._gltf.accessors),P.Assign(this._gltf.animations),P.Assign(this._gltf.buffers),P.Assign(this._gltf.bufferViews),P.Assign(this._gltf.cameras),P.Assign(this._gltf.images),P.Assign(this._gltf.materials),P.Assign(this._gltf.meshes),P.Assign(this._gltf.nodes),P.Assign(this._gltf.samplers),P.Assign(this._gltf.scenes),P.Assign(this._gltf.skins),P.Assign(this._gltf.textures),this._gltf.nodes){for(var e={},t=0,n=this._gltf.nodes;t<n.length;t++)if((l=n[t]).children)for(var r=0,i=l.children;r<i.length;r++)e[i[r]]=l.index;for(var o=this._createRootNode(),a=0,s=this._gltf.nodes;a<s.length;a++){var l,u=e[(l=s[a]).index];l.parent=void 0===u?o:this._gltf.nodes[u]}}},e.prototype._loadExtensions=function(){for(var t in e._RegisteredExtensions){var n=e._RegisteredExtensions[t].factory(this);n.name!==t&&x.Y.Warn("The name of the glTF loader extension instance does not match the registered name: "+n.name+" !== "+t),this._extensions.push(n),this._parent.onExtensionLoadedObservable.notifyObservers(n)}this._extensions.sort((function(e,t){return(e.order||Number.MAX_VALUE)-(t.order||Number.MAX_VALUE)})),this._parent.onExtensionLoadedObservable.clear()},e.prototype._checkExtensions=function(){if(this._gltf.extensionsRequired)for(var e=function(e){if(!t._extensions.some((function(t){return t.name===e&&t.enabled})))throw new Error("Require extension "+e+" is not available")},t=this,n=0,r=this._gltf.extensionsRequired;n<r.length;n++)e(r[n])},e.prototype._setState=function(e){this._state=e,this.log(T.zA[this._state])},e.prototype._createRootNode=function(){this._babylonScene._blockEntityCollection=this._forAssetContainer,this._rootBabylonMesh=new v.Kj("__root__",this._babylonScene),this._babylonScene._blockEntityCollection=!1,this._rootBabylonMesh.setEnabled(!1);var t={_babylonTransformNode:this._rootBabylonMesh,index:-1};switch(this._parent.coordinateSystemMode){case T.em.AUTO:this._babylonScene.useRightHandedSystem||(t.rotation=[0,1,0,0],t.scale=[1,1,-1],e._LoadTransform(t,this._rootBabylonMesh));break;case T.em.FORCE_RIGHT_HANDED:this._babylonScene.useRightHandedSystem=!0;break;default:throw new Error("Invalid coordinate system mode ("+this._parent.coordinateSystemMode+")")}return this._parent.onMeshLoadedObservable.notifyObservers(this._rootBabylonMesh),t},e.prototype.loadSceneAsync=function(e,t){var n=this,r=this._extensionsLoadSceneAsync(e,t);if(r)return r;var i=new Array;
1if(this.logOpen(e+" "+(t.name||"")),t.nodes)for(var o=0,a=t.nodes;o<a.length;o++){var s=a[o],l=P.Get(e+"/nodes/"+s,this._gltf.nodes,s);i.push(this.loadNodeAsync("/nodes/"+l.index,l,(function(e){e.parent=n._rootBabylonMesh})))}if(this._gltf.nodes)for(var u=0,h=this._gltf.nodes;u<h.length;u++)if((l=h[u])._babylonTransformNode&&l._babylonBones)for(var c=0,f=l._babylonBones;c<f.length;c++)f[c].linkTransformNode(l._babylonTransformNode);return i.push(this._loadAnimationsAsync()),this.logClose(),Promise.all(i).then((function(){}))},e.prototype._forEachPrimitive=function(e,t){if(e._primitiveBabylonMeshes)for(var n=0,r=e._primitiveBabylonMeshes;n<r.length;n++)t(r[n])},e.prototype._getGeometries=function(){var e=new Array,t=this._gltf.nodes;if(t)for(var n=0,r=t;n<r.length;n++){var i=r[n];this._forEachPrimitive(i,(function(t){var n=t.geometry;n&&-1===e.indexOf(n)&&e.push(n)}))}return e},e.prototype._getMeshes=function(){var e=new Array;e.push(this._rootBabylonMesh);var t=this._gltf.nodes;if(t)for(var n=0,r=t;n<r.length;n++){var i=r[n];this._forEachPrimitive(i,(function(t){e.push(t)}))}return e},e.prototype._getTransformNodes=function(){var e=new Array,t=this._gltf.nodes;if(t)for(var n=0,r=t;n<r.length;n++){var i=r[n];i._babylonTransformNode&&"TransformNode"===i._babylonTransformNode.getClassName()&&e.push(i._babylonTransformNode)}return e},e.prototype._getSkeletons=function(){var e=new Array,t=this._gltf.skins;if(t)for(var n=0,r=t;n<r.length;n++){var i=r[n];i._data&&e.push(i._data.babylonSkeleton)}return e},e.prototype._getAnimationGroups=function(){var e=new Array,t=this._gltf.animations;if(t)for(var n=0,r=t;n<r.length;n++){var i=r[n];i._babylonAnimationGroup&&e.push(i._babylonAnimationGroup)}return e},e.prototype._startAnimations=function(){switch(this._parent.animationStartMode){case T.B2.NONE:break;case T.B2.FIRST:0!==(e=this._getAnimationGroups()).length&&e[0].start(!0);break;case T.B2.ALL:for(var e,t=0,n=e=this._getAnimationGroups();t<n.length;t++)n[t].start(!0);break;default:return void x.Y.Error("Invalid animation start mode ("+this._parent.animationStartMode+")")}},e.prototype.loadNodeAsync=function(t,n,r){var i=this;void 0===r&&(r=function(){});var o=this._extensionsLoadNodeAsync(t,n,r);if(o)return o;if(n._babylonTransformNode)throw new Error(t+": Invalid recursive node hierarchy");var a=new Array;this.logOpen(t+" "+(n.name||""));var s=function(o){if(e.AddPointerMetadata(o,t),e._LoadTransform(n,o),null!=n.camera){var s=P.Get(t+"/camera",i._gltf.cameras,n.camera);a.push(i.loadCameraAsync("/cameras/"+s.index,s,(function(e){e.parent=o})))}if(n.children)for(var l=0,u=n.children;l<u.length;l++){var h=u[l],c=P.Get(t+"/children/"+h,i._gltf.nodes,h);a.push(i.loadNodeAsync("/nodes/"+c.index,c,(function(e){e.parent=o})))}r(o)};if(null==n.mesh){var l=n.name||"node"+n.index;this._babylonScene._blockEntityCollection=this._forAssetContainer,n._babylonTransformNode=new m.Y(l,this._babylonScene),this._babylonScene._blockEntityCollection=!1,s(n._babylonTransformNode)}else{var u=P.Get(t+"/mesh",this._gltf.meshes,n.mesh);a.push(this._loadMeshAsync("/meshes/"+u.index,n,u,s))}return this.logClose(),Promise.all(a).then((function(){return i._forEachPrimitive(n,(function(e){e.geometry&&e.geometry.useBoundingInfoFromGeometry?e._updateBoundingInfo():e.refreshBoundingInfo(!0)})),n._babylonTransformNode}))},e.prototype._loadMeshAsync=function(e,t,n,r){var i=n.primitives;if(!i||!i.length)throw new Error(e+": Primitives are missing");null==i[0].index&&P.Assign(i);var o=new Array;this.logOpen(e+" "+(n.name||""));var a=t.name||"node"+t.index;if(1===i.length){var s=n.primitives[0];o.push(this._loadMeshPrimitiveAsync(e+"/primitives/"+s.index,a,t,n,s,(function(e){t._babylonTransformNode=e,t._primitiveBabylonMeshes=[e]})))}else{this._babylonScene._blockEntityCollection=this._forAssetContainer,t._babylonTransformNode=new m.Y(a,this._babylonScene),this._babylonScene._blockEntityCollection=!1,t._primitiveBabylonMeshes=[];for(var l=0,u=i;l<u.length;l++)s=u[l],o.push(this._loadMeshPrimitiveAsync(e+"/primitives/"+s.index,a+"_primitive"+s.index,t,n,s,(function(e){e.parent=t._babylonTransformNode,t._primitiveBabylonMeshes.push(e)})))}if(null!=t.skin){var h=P.Get(e+"/skin",this._gltf.skins,t.skin);o.push(this._loadSkinAsync("/skins/"+h.index,t,h))}return r(t._babylonTransformNode),this.logClose(),Promise.all(o).then((function(){return t._babylonTransformNode}))},e.prototype._loadMeshPrimitiveAsync=function(t,n,r,i,o,a){var s=this,l=this._extensionsLoadMeshPrimitiveAsync(t,n,r,i,o,a);if(l)return l;this.logOpen(""+t);var u,h,c=0===this._disableInstancedMesh&&this._parent.createInstances&&null==r.skin&&!i.primitives[0].targets;
1if(c&&o._instanceData)u=o._instanceData.babylonSourceMesh.createInstance(n),h=o._instanceData.promise;else{var f=new Array;this._babylonScene._blockEntityCollection=this._forAssetContainer;var d=new v.Kj(n,this._babylonScene);this._babylonScene._blockEntityCollection=!1,d.overrideMaterialSideOrientation=this._babylonScene.useRightHandedSystem?p.F.CounterClockWiseSideOrientation:p.F.ClockWiseSideOrientation,this._createMorphTargets(t,r,i,o,d),f.push(this._loadVertexDataAsync(t,o,d).then((function(e){return s._loadMorphTargetsAsync(t,o,d,e).then((function(){s._babylonScene._blockEntityCollection=s._forAssetContainer,e.applyToMesh(d),s._babylonScene._blockEntityCollection=!1}))})));var _=e._GetDrawMode(t,o.mode);if(null==o.material){var m=this._defaultBabylonMaterialData[_];m||(m=this._createDefaultMaterial("__GLTFLoader._default",_),this._parent.onMaterialLoadedObservable.notifyObservers(m),this._defaultBabylonMaterialData[_]=m),d.material=m}else{var g=P.Get(t+"/material",this._gltf.materials,o.material);f.push(this._loadMaterialAsync("/materials/"+g.index,g,d,_,(function(e){d.material=e})))}h=Promise.all(f),c&&(o._instanceData={babylonSourceMesh:d,promise:h}),u=d}return e.AddPointerMetadata(u,t),this._parent.onMeshLoadedObservable.notifyObservers(u),a(u),this.logClose(),h.then((function(){return u}))},e.prototype._loadVertexDataAsync=function(e,t,n){var r=this,o=this._extensionsLoadVertexDataAsync(e,t,n);if(o)return o;var a=t.attributes;if(!a)throw new Error(e+": Attributes are missing");var s=new Array,l=new y.Z(n.name,this._babylonScene);if(null==t.indices)n.isUnIndexed=!0;else{var u=P.Get(e+"/indices",this._gltf.accessors,t.indices);s.push(this._loadIndicesAccessorAsync("/accessors/"+u.index,u).then((function(e){l.setIndices(e)})))}var h=function(t,o,u){if(null!=a[t]){n._delayInfo=n._delayInfo||[],-1===n._delayInfo.indexOf(o)&&n._delayInfo.push(o);var h=P.Get(e+"/attributes/"+t,r._gltf.accessors,a[t]);s.push(r._loadVertexAccessorAsync("/accessors/"+h.index,h,o).then((function(e){if(e.getKind()===g.o.PositionKind&&!r.parent.alwaysComputeBoundingBox&&!n.skeleton){var t=h.min,o=h.max;if(void 0!==t&&void 0!==o){var a=i.jp.Vector3[0],s=i.jp.Vector3[1];a.copyFromFloats.apply(a,t),s.copyFromFloats.apply(s,o),l._boundingInfo=new E.j(a,s),l.useBoundingInfoFromGeometry=!0}}l.setVerticesBuffer(e,h.count)}))),o==g.o.MatricesIndicesExtraKind&&(n.numBoneInfluencers=8),u&&u(h)}};return h("POSITION",g.o.PositionKind),h("NORMAL",g.o.NormalKind),h("TANGENT",g.o.TangentKind),h("TEXCOORD_0",g.o.UVKind),h("TEXCOORD_1",g.o.UV2Kind),h("JOINTS_0",g.o.MatricesIndicesKind),h("WEIGHTS_0",g.o.MatricesWeightsKind),h("JOINTS_1",g.o.MatricesIndicesExtraKind),h("WEIGHTS_1",g.o.MatricesWeightsExtraKind),h("COLOR_0",g.o.ColorKind,(function(e){"VEC4"===e.type&&(n.hasVertexAlpha=!0)})),Promise.all(s).then((function(){return l}))},e.prototype._createMorphTargets=function(e,t,n,r,i){if(r.targets){if(null==t._numMorphTargets)t._numMorphTargets=r.targets.length;else if(r.targets.length!==t._numMorphTargets)throw new Error(e+": Primitives do not have the same number of targets");var o=n.extras?n.extras.targetNames:null;i.morphTargetManager=new b.O(i.getScene());for(var a=0;a<r.targets.length;a++){var s=t.weights?t.weights[a]:n.weights?n.weights[a]:0,l=o?o[a]:"morphTarget"+a;i.morphTargetManager.addTarget(new A.Y(l,s,i.getScene()))}}},e.prototype._loadMorphTargetsAsync=function(e,t,n,r){if(!t.targets)return Promise.resolve();for(var i=new Array,o=n.morphTargetManager,a=0;a<o.numTargets;a++){var s=o.getTarget(a);i.push(this._loadMorphTargetVertexDataAsync(e+"/targets/"+a,r,t.targets[a],s))}return Promise.all(i).then((function(){}))},e.prototype._loadMorphTargetVertexDataAsync=function(e,t,n,r){var i=this,o=new Array,a=function(r,a,s){if(null!=n[r]){var l=t.getVertexBuffer(a);if(l){var u=P.Get(e+"/"+r,i._gltf.accessors,n[r]);o.push(i._loadFloatAccessorAsync("/accessors/"+u.index,u).then((function(e){s(l,e)})))}}};return a("POSITION",g.o.PositionKind,(function(e,t){var n=new Float32Array(t.length);e.forEach(t.length,(function(e,r){n[r]=t[r]+e})),r.setPositions(n)})),a("NORMAL",g.o.NormalKind,(function(e,t){var n=new Float32Array(t.length);e.forEach(n.length,(function(e,r){n[r]=t[r]+e})),r.setNormals(n)})),a("TANGENT",g.o.TangentKind,(function(e,t){var n=new Float32Array(t.length/3*4),i=0;e.forEach(t.length/3*4,(function(e,r){(r+1)%4!=0&&(n[i]=t[i]+e,i++)})),r.setTangents(n)})),Promise.all(o).then((function(){}))},e._LoadTransform=function(e,t){if(null==e.skin){var n=i.P.Zero(),r=i._f.Identity(),o=i.P.One();e.matrix?i.y3.FromArray(e.matrix).decompose(o,r,n):(e.translation&&(n=i.P.FromArray(e.translation)),e.rotation&&(r=i._f.FromArray(e.rotation)),e.scale&&(o=i.P.FromArray(e.scale))),t.position=n,t.rotationQuaternion=r,t.scaling=o}},e.prototype._loadSkinAsync=function(e,t,n){var r=this,i=this._extensionsLoadSkinAsync(e,t,n);if(i)return i;var o=function(e){r._forEachPrimitive(t,(function(t){t.skeleton=e}))};if(n._data)return o(n._data.babylonSkeleton),n._data.promise;var a="skeleton"+n.index;this._babylonScene._blockEntityCollection=this._forAssetContainer;var s=new f.O(n.name||a,a,this._babylonScene);this._babylonScene._blockEntityCollection=!1,s.overrideMesh=this._rootBabylonMesh,this._loadBones(e,n,s),o(s);var l=this._loadSkinInverseBindMatricesDataAsync(e,n).then((function(e){r._updateBoneMatrices(s,e)}));return n._data={babylonSkeleton:s,promise:l},l},e.prototype._loadBones=function(e,t,n){for(var r={},i=0,o=t.joints;i<o.length;i++){var a=o[i],s=P.Get(e+"/joints/"+a,this._gltf.nodes,a);this._loadBone(s,t,n,r)}},e.prototype._loadBone=function(e,t,n,r){var i=r[e.index];if(i)return i;var o=null;e.parent&&e.parent._babylonTransformNode!==this._rootBabylonMesh&&(o=this._loadBone(e.parent,t,n,r));var a=t.joints.indexOf(e.index);return i=new c.N(e.name||"joint"+e.index,n,o,this._getNodeMatrix(e),null,null,a),r[e.index]=i,e._babylonBones=e._babylonBones||[],e._babylonBones.push(i),i},e.prototype._loadSkinInverseBindMatricesDataAsync=function(e,t){if(null==t.inverseBindMatrices)return Promise.resolve(null);var n=P.Get(e+"/inverseBindMatrices",this._gltf.accessors,t.inverseBindMatrices);return this._loadFloatAccessorAsync("/accessors/"+n.index,n)},e.prototype._updateBoneMatrices=function(e,t){for(var n=0,r=e.bone
1s;n<r.length;n++){var o=r[n],a=i.y3.Identity(),s=o._index;t&&-1!==s&&(i.y3.FromArrayToRef(t,16*s,a),a.invertToRef(a));var l=o.getParent();l&&a.multiplyToRef(l.getInvertedAbsoluteTransform(),a),o.setBindPose(a),o.updateMatrix(a,!1,!1),o._updateDifferenceMatrix(void 0,!1)}},e.prototype._getNodeMatrix=function(e){return e.matrix?i.y3.FromArray(e.matrix):i.y3.Compose(e.scale?i.P.FromArray(e.scale):i.P.One(),e.rotation?i._f.FromArray(e.rotation):i._f.Identity(),e.translation?i.P.FromArray(e.translation):i.P.Zero())},e.prototype.loadCameraAsync=function(t,n,r){void 0===r&&(r=function(){});var o=this._extensionsLoadCameraAsync(t,n,r);if(o)return o;var a=new Array;this.logOpen(t+" "+(n.name||"")),this._babylonScene._blockEntityCollection=this._forAssetContainer;var u=new l.c(n.name||"camera"+n.index,i.P.Zero(),this._babylonScene,!1);switch(this._babylonScene._blockEntityCollection=!1,u.ignoreParentScaling=!0,u.rotation=new i.P(0,Math.PI,0),n.type){case"perspective":var h=n.perspective;if(!h)throw new Error(t+": Camera perspective properties are missing");u.fov=h.yfov,u.minZ=h.znear,u.maxZ=h.zfar||Number.MAX_VALUE;break;case"orthographic":if(!n.orthographic)throw new Error(t+": Camera orthographic properties are missing");u.mode=s.V.ORTHOGRAPHIC_CAMERA,u.orthoLeft=-n.orthographic.xmag,u.orthoRight=n.orthographic.xmag,u.orthoBottom=-n.orthographic.ymag,u.orthoTop=n.orthographic.ymag,u.minZ=n.orthographic.znear,u.maxZ=n.orthographic.zfar;break;default:throw new Error(t+": Invalid camera type ("+n.type+")")}return e.AddPointerMetadata(u,t),this._parent.onCameraLoadedObservable.notifyObservers(u),r(u),this.logClose(),Promise.all(a).then((function(){return u}))},e.prototype._loadAnimationsAsync=function(){var e=this._gltf.animations;if(!e)return Promise.resolve();for(var t=new Array,n=0;n<e.length;n++){var r=e[n];t.push(this.loadAnimationAsync("/animations/"+r.index,r))}return Promise.all(t).then((function(){}))},e.prototype.loadAnimationAsync=function(e,t){var n=this._extensionsLoadAnimationAsync(e,t);if(n)return n;this._babylonScene._blockEntityCollection=this._forAssetContainer;var r=new u.O(t.name||"animation"+t.index,this._babylonScene);this._babylonScene._blockEntityCollection=!1,t._babylonAnimationGroup=r;var i=new Array;P.Assign(t.channels),P.Assign(t.samplers);for(var o=0,a=t.channels;o<a.length;o++){var s=a[o];i.push(this._loadAnimationChannelAsync(e+"/channels/"+s.index,e,t,s,r))}return Promise.all(i).then((function(){return r.normalize(0),r}))},e.prototype._loadAnimationChannelAsync=function(e,t,n,r,o,a){var s=this;if(void 0===a&&(a=null),null==r.target.node)return Promise.resolve();var l=P.Get(e+"/target/node",this._gltf.nodes,r.target.node);
1if("weights"===r.target.path&&!l._numMorphTargets||"weights"!==r.target.path&&!l._babylonTransformNode)return Promise.resolve();var u=P.Get(e+"/sampler",n.samplers,r.sampler);return this._loadAnimationSamplerAsync(t+"/samplers/"+r.sampler,u).then((function(t){var n,u;switch(r.target.path){case"translation":n="position",u=h.f.ANIMATIONTYPE_VECTOR3;break;case"rotation":n="rotationQuaternion",u=h.f.ANIMATIONTYPE_QUATERNION;break;case"scale":n="scaling",u=h.f.ANIMATIONTYPE_VECTOR3;break;case"weights":n="influence",u=h.f.ANIMATIONTYPE_FLOAT;break;default:throw new Error(e+"/target/path: Invalid value ("+r.target.path+")")}var c,f,p=0;switch(n){case"position":c=function(){var e=i.P.FromArray(t.output,p);return p+=3,e};break;case"rotationQuaternion":c=function(){var e=i._f.FromArray(t.output,p);return p+=4,e};break;case"scaling":c=function(){var e=i.P.FromArray(t.output,p);return p+=3,e};break;case"influence":c=function(){for(var e=new Array(l._numMorphTargets),n=0;n<l._numMorphTargets;n++)e[n]=t.output[p++];return e}}switch(t.interpolation){case"STEP":f=function(e){return{frame:t.input[e],value:c(),interpolation:O.N.STEP}};break;case"LINEAR":f=function(e){return{frame:t.input[e],value:c()}};break;case"CUBICSPLINE":f=function(e){return{frame:t.input[e],inTangent:c(),value:c(),outTangent:c()}}}for(var d=new Array(t.input.length),_=0;_<t.input.length;_++)d[_]=f(_);if("influence"===n)for(var m=function(e){var t=o.name+"_channel"+o.targetedAnimations.length,r=new h.f(t,n,1,u);r.setKeys(d.map((function(t){return{frame:t.frame,inTangent:t.inTangent?t.inTangent[e]:void 0,value:t.value[e],outTangent:t.outTangent?t.outTangent[e]:void 0}}))),s._forEachPrimitive(l,(function(t){var n=t.morphTargetManager.getTarget(e),i=r.clone();n.animations.push(i),o.addTargetedAnimation(i,n)}))},g=0;g<l._numMorphTargets;g++)m(g);else{var y=o.name+"_channel"+o.targetedAnimations.length,v=new h.f(y,n,1,u);v.setKeys(d),null!=a&&null!=a.animations?(a.animations.push(v),o.addTargetedAnimation(v,a)):(l._babylonTransformNode.animations.push(v),o.addTargetedAnimation(v,l._babylonTransformNode))}}))},e.prototype._loadAnimationSamplerAsync=function(e,t){if(t._data)return t._data;var n=t.interpolation||"LINEAR";switch(n){case"STEP":case"LINEAR":case"CUBICSPLINE":break;default:throw new Error(e+"/interpolation: Invalid value ("+t.interpolation+")")}var r=P.Get(e+"/input",this._gltf.accessors,t.input),i=P.Get(e+"/output",this._gltf.accessors,t.output);return t._data=Promise.all([this._loadFloatAccessorAsync("/accessors/"+r.index,r),this._loadFloatAccessorAsync("/accessors/"+i.index,i)]).then((function(e){var t=e[0],r=e[1];return{input:t,interpolation:n,output:r}})),t._data},e.prototype._loadBufferAsync=function(e,t,n,r){var i=this._extensionsLoadBufferAsync(e,t,n,r);if(i)return i;if(!t._data)if(t.uri)t._data=this.loadUriAsync(e+"/uri",t,t.uri);else{if(!this._bin)throw new Error(e+": Uri is missing or the binary glTF is missing its binary chunk");t._data=this._bin.readAsync(0,t.byteLength)}return t._data.then((function(t){try{return new Uint8Array(t.buffer,t.byteOffset+n,r)}catch(t){throw new Error(e+": "+t.message)}}))},e.prototype.loadBufferViewAsync=function(e,t){var n=this._extensionsLoadBufferViewAsync(e,t);if(n)return n;if(t._data)return t._data;var r=P.Get(e+"/buffer",this._gltf.buffers,t.buffer);return t._data=this._loadBufferAsync("/buffers/"+r.index,r,t.byteOffset||0,t.byteLength),t._data},e.prototype._loadAccessorAsync=function(t,n,r){var i=this;if(n._data)return n._data;var o=e._GetNumComponents(t,n.type),a=o*g.o.GetTypeByteLength(n.componentType),s=o*n.count;if(null==n.bufferView)n._data=Promise.resolve(new r(s));else{var l=P.Get(t+"/bufferView",this._gltf.bufferViews,n.bufferView);n._data=this.loadBufferViewAsync("/bufferViews/"+l.index,l).then((function(i){if(5126!==n.componentType||n.normalized||l.byteStride&&l.byteStride!==a){var u=new r(s);return g.o.ForEach(i,n.byteOffset||0,l.byteStride||a,o,n.componentType,u.length,n.normalized||!1,(function(e,t){u[t]=e})),u}return e._GetTypedArray(t,n.componentType,i,n.byteOffset,s)}))}if(n.sparse){var u=n.sparse;n._data=n._data.then((function(s){var l=s,h=P.Get(t+"/sparse/indices/bufferView",i._gltf.bufferViews,u.indices.bufferView),c=P.Get(t+"/sparse/values/bufferView",i._gltf.bufferViews,u.values.bufferView);return Promise.all([i.loadBufferViewAsync("/bufferViews/"+h.index,h),i.loadBufferViewAsync("/bufferViews/"+c.index,c)]).then((function(i){var s,h=i[0],c=i[1],f=e._GetTypedArray(t+"/sparse/indices",u.indices.componentType,h,u.indices.byteOffset,u.count),p=o*u.count;if(5126!==n.componentType||n.normalized){var d=e._GetTypedArray(t+"/sparse/values",n.componentType,c,u.values.byteOffset,p);s=new r(p),g.o.ForEach(d,0,a,o,n.componentType,s.length,n.normalized||!1,(function(e,t){s[t]=e}))}else s=e._GetTypedArray(t+"/sparse/values",n.componentType,c,u.values.byteOffset,p);for(var _=0,m=0;m<f.length;m++)for(var y=f[m]*o,v=0;v<o;v++)l[y++]=s[_++];return l}))}))}return n._data},e.prototype._loadFloatAccessorAsync=function(e,t){return this._loadAccessorAsync(e,t,Float32Array)},e.prototype._loadIndicesAccessorAsync=function(t,n){if("SCALAR"!==n.type)throw new Error(t+"/type: Invalid value "+n.type);if(5121!==n.componentType&&5123!==n.componentType&&5125!==n.componentType)throw new Error(t+"/componentType: Invalid value "+n.componentType);if(n._data)return n._data;if(n.sparse){var r=e._GetTypedArrayConstructor(t+"/componentType",n.componentType);n._data=this._loadAccessorAsync(t,n,r)}else{var i=P.Get(t+"/bufferView",this._gltf.bufferViews,n.bufferView);n._data=this.loadBufferViewAsync("/bufferViews/"+i.index,i).then((function(r){return e._GetTypedArray(t,n.componentType,r,n.byteOffset,n.count)}
1))}return n._data},e.prototype._loadVertexBufferViewAsync=function(e,t){var n=this;return e._babylonBuffer||(e._babylonBuffer=this.loadBufferViewAsync("/bufferViews/"+e.index,e).then((function(e){return new g.l(n._babylonScene.getEngine(),e,!1)}))),e._babylonBuffer},e.prototype._loadVertexAccessorAsync=function(t,n,r){var i=this;if(n._babylonVertexBuffer)return n._babylonVertexBuffer;if(n.sparse)n._babylonVertexBuffer=this._loadFloatAccessorAsync("/accessors/"+n.index,n).then((function(e){return new g.o(i._babylonScene.getEngine(),e,r,!1)}));else if(n.byteOffset&&n.byteOffset%g.o.GetTypeByteLength(n.componentType)!=0)x.Y.Warn("Accessor byte offset is not a multiple of component type byte length"),n._babylonVertexBuffer=this._loadFloatAccessorAsync("/accessors/"+n.index,n).then((function(e){return new g.o(i._babylonScene.getEngine(),e,r,!1)}));else if(r===g.o.MatricesIndicesKind||r===g.o.MatricesIndicesExtraKind)n._babylonVertexBuffer=this._loadFloatAccessorAsync("/accessors/"+n.index,n).then((function(e){return new g.o(i._babylonScene.getEngine(),e,r,!1)}));else{var o=P.Get(t+"/bufferView",this._gltf.bufferViews,n.bufferView);n._babylonVertexBuffer=this._loadVertexBufferViewAsync(o,r).then((function(a){var s=e._GetNumComponents(t,n.type);return new g.o(i._babylonScene.getEngine(),a,r,!1,!1,o.byteStride,!1,n.byteOffset,s,n.componentType,n.normalized,!0,1,!0)}))}return n._babylonVertexBuffer},e.prototype._loadMaterialMetallicRoughnessPropertiesAsync=function(e,t,n){if(!(n instanceof d.Y))throw new Error(e+": Material type not supported");var r=new Array;return t&&(t.baseColorFactor?(n.albedoColor=o.Wo.FromArray(t.baseColorFactor),n.alpha=t.baseColorFactor[3]):n.albedoColor=o.Wo.White(),n.metallic=null==t.metallicFactor?1:t.metallicFactor,n.roughness=null==t.roughnessFactor?1:t.roughnessFactor,t.baseColorTexture&&r.push(this.loadTextureInfoAsync(e+"/baseColorTexture",t.baseColorTexture,(function(e){e.name=n.name+" (Base Color)",n.albedoTexture=e}))),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture.nonColorData=!0,r.push(this.loadTextureInfoAsync(e+"/metallicRoughnessTexture",t.metallicRoughnessTexture,(function(e){e.name=n.name+" (Metallic Roughness)",n.metallicTexture=e}))),n.useMetallnessFromMetallicTextureBlue=!0,n.useRoughnessFromMetallicTextureGreen=!0,n.useRoughnessFromMetallicTextureAlpha=!1)),Promise.all(r).then((function(){}))},e.prototype._loadMaterialAsync=function(t,n,r,i,o){void 0===o&&(o=function(){});var a=this._extensionsLoadMaterialAsync(t,n,r,i,o);if(a)return a;n._data=n._data||{};var s=n._data[i];if(!s){this.logOpen(t+" "+(n.name||""));var l=this.createMaterial(t,n,i);s={babylonMaterial:l,babylonMeshes:[],promise:this.loadMaterialPropertiesAsync(t,n,l)},n._data[i]=s,e.AddPointerMetadata(l,t),this._parent.onMaterialLoadedObservable.notifyObservers(l),this.logClose()}return r&&(s.babylonMeshes.push(r),r.onDisposeObservable.addOnce((function(){var e=s.babylonMeshes.indexOf(r);-1!==e&&s.babylonMeshes.splice(e,1)}))),o(s.babylonMaterial),s.promise.then((function(){return s.babylonMaterial}))},e.prototype._createDefaultMaterial=function(e,t){this._babylonScene._blockEntityCollection=this._forAssetContainer;var n=new d.Y(e,this._babylonScene);return this._babylonScene._blockEntityCollection=!1,n.fillMode=t,n.enableSpecularAntiAliasing=!0,n.useRadianceOverAlpha=!this._parent.transparencyAsCoverage,n.useSpecularOverAlpha=!this._parent.transparencyAsCoverage,n.transparencyMode=d.Y.PBRMATERIAL_OPAQUE,n.metallic=1,n.roughness=1,n},e.prototype.createMaterial=function(e,t,n){var r=this._extensionsCreateMaterial(e,t,n);if(r)return r;var i=t.name||"material"+t.index;return this._createDefaultMaterial(i,n)},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var r=this._extensionsLoadMaterialPropertiesAsync(e,t,n);if(r)return r;var i=new Array;return i.push(this.loadMaterialBasePropertiesAsync(e,t,n)),t.pbrMetallicRoughness&&i.push(this._loadMaterialMetallicRoughnessPropertiesAsync(e+"/pbrMetallicRoughness",t.pbrMetallicRoughness,n)),this.loadMaterialAlphaProperties(e,t,n),Promise.all(i).then((function(){}))},e.prototype.loadMaterialBasePropertiesAsync=function(e,t,n){if(!(n instanceof d.Y))throw new Error(e+": Material type not supported");var r=new Array;return n.emissiveColor=t.emissiveFactor?o.Wo.FromArray(t.emissiveFactor):new o.Wo(0,0,0),t.doubleSided&&(n.backFaceCulling=!1,n.twoSidedLighting=!0),t.normalTexture&&(t.normalTexture.nonColorData=!0,r.push(this.loadTextureInfoA
1sync(e+"/normalTexture",t.normalTexture,(function(e){e.name=n.name+" (Normal)",n.bumpTexture=e}))),n.invertNormalMapX=!this._babylonScene.useRightHandedSystem,n.invertNormalMapY=this._babylonScene.useRightHandedSystem,null!=t.normalTexture.scale&&(n.bumpTexture.level=t.normalTexture.scale),n.forceIrradianceInFragment=!0),t.occlusionTexture&&(t.occlusionTexture.nonColorData=!0,r.push(this.loadTextureInfoAsync(e+"/occlusionTexture",t.occlusionTexture,(function(e){e.name=n.name+" (Occlusion)",n.ambientTexture=e}))),n.useAmbientInGrayScale=!0,null!=t.occlusionTexture.strength&&(n.ambientTextureStrength=t.occlusionTexture.strength)),t.emissiveTexture&&r.push(this.loadTextureInfoAsync(e+"/emissiveTexture",t.emissiveTexture,(function(e){e.name=n.name+" (Emissive)",n.emissiveTexture=e}))),Promise.all(r).then((function(){}))},e.prototype.loadMaterialAlphaProperties=function(e,t,n){if(!(n instanceof d.Y))throw new Error(e+": Material type not supported");switch(t.alphaMode||"OPAQUE"){case"OPAQUE":n.transparencyMode=d.Y.PBRMATERIAL_OPAQUE;break;case"MASK":n.transparencyMode=d.Y.PBRMATERIAL_ALPHATEST,n.alphaCutOff=null==t.alphaCutoff?.5:t.alphaCutoff,n.albedoTexture&&(n.albedoTexture.hasAlpha=!0);break;case"BLEND":n.transparencyMode=d.Y.PBRMATERIAL_ALPHABLEND,n.albedoTexture&&(n.albedoTexture.hasAlpha=!0,n.useAlphaFromAlbedoTexture=!0);break;default:throw new Error(e+"/alphaMode: Invalid value ("+t.alphaMode+")")}},e.prototype.loadTextureInfoAsync=function(t,n,r){var i=this;void 0===r&&(r=function(){});var o=this._extensionsLoadTextureInfoAsync(t,n,r);if(o)return o;if(this.logOpen(""+t),n.texCoord>=2)throw new Error(t+"/texCoord: Invalid value ("+n.texCoord+")");var a=P.Get(t+"/index",this._gltf.textures,n.index);a._textureInfo=n;var s=this._loadTextureAsync("/textures/"+n.index,a,(function(o){o.coordinatesIndex=n.texCoord||0,e.AddPointerMetadata(o,t),i._parent.onTextureLoadedObservable.notifyObservers(o),r(o)}));return this.logClose(),s},e.prototype._loadTextureAsync=function(t,n,r){void 0===r&&(r=function(){});var i=this._extensionsLoadTextureAsync(t,n,r);if(i)return i;this.logOpen(t+" "+(n.name||""));var o=null==n.sampler?e.DefaultSampler:P.Get(t+"/sampler",this._gltf.samplers,n.sampler),a=P.Get(t+"/source",this._gltf.images,n.source),s=this._createTextureAsync(t,o,a,r);return this.logClose(),s},e.prototype._createTextureAsync=function(e,t,n,i,o){var a=this;void 0===i&&(i=function(){});var s=this._loadSampler("/samplers/"+t.index,t),l=new Array,u=new r.B;this._babylonScene._blockEntityCollection=this._forAssetContainer;var h=new _.x(null,this._babylonScene,s.noMipMaps,!1,s.samplingMode,(function(){a._disposed||u.resolve()}),(function(t,n){a._disposed||u.reject(new Error(e+": "+(n&&n.message?n.message:t||"Failed to load texture")))}),void 0,void 0,void 0,n.mimeType,o);return this._babylonScene._blockEntityCollection=!1,l.push(u.promise),l.push(this.loadImageAsync("/images/"+n.index,n).then((function(e){var t=n.uri||a._fileName+"#image"+n.index,r="data:"+a._uniqueRootUrl+t;h.updateURL(r,e)}))),h.wrapU=s.wrapU,h.wrapV=s.wrapV,i(h),Promise.all(l).then((function(){return h}))},e.prototype._loadSampler=function(t,n){return n._data||(n._data={noMipMaps:9728===n.minFilter||9729===n.minFilter,samplingMode:e._GetTextureSamplingMode(t,n),wrapU:e._GetTextureWrapMode(t+"/wrapS",n.wrapS),wrapV:e._GetTextureWrapMode(t+"/wrapT",n.wrapT)}),n._data},e.prototype.loadImageAsync=function(e,t){if(!t._data){if(this.logOpen(e+" "+(t.name||"")),t.uri)t._data=this.loadUriAsync(e+"/uri",t,t.uri);else{var n=P.Get(e+"/bufferView",this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync("/bufferViews/"+n.index,n)}this.logClose()}return t._data},e.prototype.loadUriAsync=function(t,n,r){var i=this,o=this._extensionsLoadUriAsync(t,n,r);if(o)return o;if(!e._ValidateUri(r))throw new Error(t+": '"+r+"' is invalid");if(a.w1.IsBase64(r)){var s=new Uint8Array(a.w1.DecodeBase64(r));return this.log("Decoded "+r.substr(0,64)+"... ("+s.length+" bytes)"),Promise.resolve(s)}return this.log("Loading "+r),this._parent.preprocessUrlAsync(this._rootUrl+r).then((function(e){return new Promise((function(n,o){i._parent._loadFile(e,i._babylonScene,(function(e){i._disposed||(i.log("Loaded "+r+" ("+e.byteLength+" b
1ytes)"),n(new Uint8Array(e)))}),!0,(function(e){o(new M.eh(t+": Failed to load '"+r+"'"+(e?": "+e.status+" "+e.statusText:""),e))}))}))}))},e.AddPointerMetadata=function(e,t){var n=e.metadata=e.metadata||{},r=n.gltf=n.gltf||{};(r.pointers=r.pointers||[]).push(t)},e._GetTextureWrapMode=function(e,t){switch(t=null==t?10497:t){case 33071:return _.x.CLAMP_ADDRESSMODE;case 33648:return _.x.MIRROR_ADDRESSMODE;case 10497:return _.x.WRAP_ADDRESSMODE;default:return x.Y.Warn(e+": Invalid value ("+t+")"),_.x.WRAP_ADDRESSMODE}},e._GetTextureSamplingMode=function(e,t){var n=null==t.magFilter?9729:t.magFilter,r=null==t.minFilter?9987:t.minFilter;if(9729===n)switch(r){case 9728:return _.x.LINEAR_NEAREST;case 9729:return _.x.LINEAR_LINEAR;case 9984:return _.x.LINEAR_NEAREST_MIPNEAREST;case 9985:return _.x.LINEAR_LINEAR_MIPNEAREST;case 9986:return _.x.LINEAR_NEAREST_MIPLINEAR;case 9987:return _.x.LINEAR_LINEAR_MIPLINEAR;default:return x.Y.Warn(e+"/minFilter: Invalid value ("+r+")"),_.x.LINEAR_LINEAR_MIPLINEAR}else switch(9728!==n&&x.Y.Warn(e+"/magFilter: Invalid value ("+n+")"),r){case 9728:return _.x.NEAREST_NEAREST;case 9729:return _.x.NEAREST_LINEAR;case 9984:return _.x.NEAREST_NEAREST_MIPNEAREST;case 9985:return _.x.NEAREST_LINEAR_MIPNEAREST;case 9986:return _.x.NEAREST_NEAREST_MIPLINEAR;case 9987:return _.x.NEAREST_LINEAR_MIPLINEAR;default:return x.Y.Warn(e+"/minFilter: Invalid value ("+r+")"),_.x.NEAREST_NEAREST_MIPNEAREST}},e._GetTypedArrayConstructor=function(e,t){switch(t){case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:return Uint16Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw new Error(e+": Invalid component type "+t)}},e._GetTypedArray=function(t,n,r,i,o){var a=r.buffer;i=r.byteOffset+(i||0);var s=e._GetTypedArrayConstructor(t+"/componentType",n);try{return new s(a,i,o)}catch(e){throw new Error(t+": "+e)}}
1,e._GetNumComponents=function(e,t){switch(t){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}throw new Error(e+": Invalid type ("+t+")")},e._ValidateUri=function(e){return a.w1.IsBase64(e)||-1===e.indexOf("..")},e._GetDrawMode=function(e,t){switch(null==t&&(t=4),t){case 0:return p.F.PointListDrawMode;case 1:return p.F.LineListDrawMode;case 2:return p.F.LineLoopDrawMode;case 3:return p.F.LineStripDrawMode;case 4:return p.F.TriangleFillMode;case 5:return p.F.TriangleStripDrawMode;case 6:return p.F.TriangleFanDrawMode}throw new Error(e+": Invalid mesh primitive mode ("+t+")")},e.prototype._compileMaterialsAsync=function(){var e=this;this._parent._startPerformanceCounter("Compile materials");var t=new Array;if(this._gltf.materials)for(var n=0,r=this._gltf.materials;n<r.length;n++){var i=r[n];if(i._data)for(var o in i._data)for(var a=i._data[o],s=0,l=a.babylonMeshes;s<l.length;s++){var u=l[s];u.computeWorldMatrix(!0);var h=a.babylonMaterial;t.push(h.forceCompilationAsync(u)),t.push(h.forceCompilationAsync(u,{useInstances:!0})),this._parent.useClipPlane&&(t.push(h.forceCompilationAsync(u,{clipPlane:!0})),t.push(h.forceCompilationAsync(u,{clipPlane:!0,useInstances:!0})))}}return Promise.all(t).then((function(){e._parent._endPerformanceCounter("Compile materials")}))},e.prototype._compileShadowGeneratorsAsync=function(){var e=this;this._parent._startPerformanceCounter("Compile shadow generators");for(var t=new Array,n=0,r=this._babylonScene.lights;n<r.length;n++){var i=r[n].getShadowGenerator();i&&t.push(i.forceCompilationAsync())}return Promise.all(t).then((function(){e._parent._endPerformanceCounter("Compile shadow generators")}))},e.prototype._forEachExtensions=function(e){for(var t=0,n=this._extensions;t<n.length;t++){var r=n[t];r.enabled&&e(r)}},e.prototype._applyExtensions=function(e,t,n){for(var r=0,i=this._extensions;r<i.length;r++){var o=i[r];if(o.enabled){var a=o.name+"."+t,s=e;s._activeLoaderExtensionFunctions=s._activeLoaderExtensionFunctions||{};var l=s._activeLoaderExtensionFunctions;if(!l[a]){l[a]=!0;try{var u=n(o);if(u)return u}finally{delete l[a]}}}}return null},e.prototype._extensionsOnLoading=function(){this._forEachExtensions((function(e){return e.onLoading&&e.onLoading()}))},e.prototype._extensionsOnReady=function(){this._forEachExtensions((function(e){return e.onReady&&e.onReady()}))},e.prototype._extensionsLoadSceneAsync=function(e,t){return this._applyExtensions(t,"loadScene",(function(n){return n.loadSceneAsync&&n.loadSceneAsync(e,t)}))},e.prototype._extensionsLoadNodeAsync=function(e,t,n){return this._applyExtensions(t,"loadNode",(function(r){return r.loadNodeAsync&&r.loadNodeAsync(e,t,n)}))},e.prototype._extensionsLoadCameraAsync=function(e,t,n){return this._applyExtensions(t,"loadCamera",(function(r){return r.loadCameraAsync&&r.loadCameraAsync(e,t,n)}))},e.prototype._extensionsLoadVertexDataAsync=function(e,t,n){return this._applyExtensions(t,"loadVertexData",(function(r){return r._loadVertexDataAsync&&r._loadVertexDataAsync(e,t,n)}))},e.prototype._extensionsLoadMeshPrimitiveAsync=function(e,t,n,r,i,o){return this._applyExtensions(i,"loadMeshPrimitive",(function(a){return a._loadMeshPrimitiveAsync&&a._loadMeshPrimitiveAsync(e,t,n,r,i,o)}))},e.prototype._extensionsLoadMaterialAsync=function(e,t,n,r,i){return this._applyExtensions(t,"loadMaterial",(function(o){return o._loadMaterialAsync&&o._loadMaterialAsync(e,t,n,r,i)}))},e.prototype._extensionsCreateMaterial=function(e,t,n){return this._applyExtensions(t,"createMaterial",(function(r){return r.createMaterial&&r.createMaterial(e,t,n)}))},e.prototype._extensionsLoadMaterialPropertiesAsync=function(e,t,n){return this._applyExtensions(t,"loadMaterialProperties",(function(r){return r.loadMaterialPropertiesAsync&&r.loadMaterialPropertiesAsync(e,t,n)}))},e.prototype._extensionsLoadTextureInfoAsync=function(e,t,n){return this._applyExtensions(t,"loadTextureInfo",(function(r){return r.loadTextureInfoAsync&&r.loadTextureInfoAsync(e,t,n)}))},e.prototype._extensionsLoadTextureAsync=function(e,t,n){return this._applyExtensions(t,"loadTexture",(function(r){return r._loadTextureAsync&&r._loadTextureAsync(e,t,n)}))},e.prototype._extensionsLoadAnimationAsync=function(e,t){return this._applyExtensions(t,"loadAnimation",(function(n){return n.loadAnimationAsync&&n.loadAnimationAsync(e,t)}))},e.prototype._extensionsLoadSkinAsync=function(e,t,n){return this._applyExtensions(n,"loadSkin",(function(r){return r._loadSkinAsync&&r._loadSkinAsync(e,t,n)}))},e.prototype._extensionsLoadUriAsync=function(e,t,n){return this._applyExtensions(t,"loadUri",(function(r){return r._loadUriAsync&&r._loadUriAsync(e,t,n)}))},e.prototype._extensionsLoadBufferViewAsync=function(e,t){return this._applyExtensions(t,"loadBufferView",(function(n){return n.loadBufferViewAsync&&n.loadBufferViewAsync(e,t)}))},e.prototype._extensionsLoadBufferAsync=function(e,t,n,r){return this._applyExtensions(t,"loadBuffer",(function(i){return i.loadBufferAsync&&i.loadBufferAsync(e,t,n,r)}))},e.LoadExtensionAsync=function(e,t,n,r){if(!t.extensions)return null;var i=t.extensions[n];return i?r(e+"/extensions/"+n,i):null},e.LoadExtraAsync=function(e,t,n,r){if(!t.extras)return null;var i=t.extras[n];return i?r(e+"/extras/"+n,i):null},e.prototype.isExtensionUsed=function(e){return!!this._gltf.extensionsUsed&&-1!==this._gltf.extensionsUsed.indexOf(e)},e.prototype.logOpen=function(e){this._parent._logOpen(e)},e.prototype.logClose=function(){this._parent._logClose()},e.prototype.log=function(e){this._parent._log(e)},e.prototype.startPerformanceCounter=function(e){this._parent._startPerformanceCounter(e)},e.prototype.endPerformanceCounter=function(e){this._parent._endPerformanceCounter(e)},e._RegisteredExtensions={},e.DefaultSampler={index:-1},e}();T.ey._CreateGLTF2Loader=function(e){return new I(e)}},3975:(e,t,n)=>{"use strict";n.d(t,{em:()=>r,B2:()=>i,zA:()=>o,ey:()=>d});var r,i,o,a=n(475),s=n(8810),l=n(7595),u=n(4518),h=n(3734),c=n(4967),f=n(4242),p=n(1373);!function(e){e[e.AUTO=0]="AUTO",e[e.FORCE_RIGHT_HANDED=1]="FORCE_RIGHT_HANDED"}(r||(r={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.ALL=2]="ALL"}(i||(i={})),function(e){e[e.LOADING=0]="LOADING",e[e.READY=1]="READY",e[e.COMPLETE=2]="COMPLETE"}(o||(o={}));var d=function(){function e(){this.onParsedObservable=new a.y$,this.coordinateSystemMode=r.AUTO,this.animationStartMode=i.FIRST,this.compileMaterials=!1,this.useClipPlane=!1,this.compileShadowGenerators=!1,this.transparencyAsCoverage=!1,this.useRangeRequests=!1,this.createInstances=!0,this.alwaysComputeBoundingBox=!1,this.loadAllMaterials=!1,this.preprocessUrlAsync=function(e){return Promise.resolve(e)},this.onMeshLoadedObservable=new a.y$,this.onTextureLoadedObservable=new a.y$,this.onMaterialLoadedObservable=new a.y$,this.onCameraLoadedObservable=new a.y$,this.onCompleteObservable=new a.y$,this.onErrorObservable=new a.y$,this.onDisposeObservable=new a.y$,this.onExtensionLoadedObservable=new a.y$,this.validate=!1,this.onValidatedObservable=new a.y$,this._loader=null,this._requests=new Array,this.name="gltf",this.extensions={".gltf":{isBinary:!1},".glb":{isBinary:!0}},this._logIndentLevel=0,this._loggingEnabled=!1,this._log=this._logDisabled,this._capturePerformanceCounters=!1,this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled}return Object.defineProperty(e.prototype,"onParsed",{set:function(e){this._onParsedObserver&&this.onParsedObservable.remove(this._onParsedObserver),this._onParsedObserver=this.onParsedObservable.add(e)}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMeshLoaded",{set:function(e){this._onMeshLoadedObserver&&this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver),this._onMeshLoadedObserver=this.onMeshLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTextureLoaded",{set:function(e){this._onTextureLoadedObserver&&this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver),this._onTextureLoadedObserver=this.onTextureLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMaterialLoaded",{set:function(e){this._onMaterialLoadedObserver&&this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver),this._onMaterialLoadedObserver=this.onMaterialLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onCameraLoaded",{set:function(e){this._onCameraLoadedObserver&&this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver),this._onCameraLoadedObserver=this.onCameraLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{set:function(e){this._onCompleteObserver&&this.onCompleteObservable.remove(this._onCompleteObserver),this._onCompleteObserver=this.onCompleteObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{set:function(e){this._onErrorObserver&&this.onErrorObservable.remove(this._onErrorObserver),this._onErrorObserver=this.onErrorObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onExtensionLoaded",{set:function(e){this._onExtensionLoadedObserver&&this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver),this._onExtensionLoadedObserver=this.onExtensionLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loggingEnabled",{get:function(){return this._loggingEnabled},set:function(e){this._loggingEnabled!==e&&(this._loggingEnabled=e,this._loggingEnabled?this._log=this._logEnabled:this._log=this._logDisabled)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"capturePerformanceCounters",{get:function(){return this._capturePerformanceCounters},set:function(e){this._capturePerformanceCounters!==e&&(this._capturePerformanceCounters=e,this._capturePerformanceCounters?(this._startPerformanceCounter=this._startPerformanceCounterEnabled,this._endPerformanceCounter=this._endPerformanceCounterEnabled):(this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onValidated",{set:function(e){this._onValidatedObserver&&this.onValidatedObservable.remove(this._onValidatedObserver),this._onValidatedObserver=this.onValidatedObservable.add(e)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._loader&&(this._loader.dispose(),this._loader=null);for(var e=0,t=this._requests;e<t.length;e++)t[e].abort();this._requests.length=0,delete this._progressCallback,this.preprocessUrlAsync=function(e){return Promise.resolve(e)},this.onMeshLoadedObservable.clear(),this.onTextureLoadedObservable.clear(),this.onMaterialLoadedObservable.clear(),this.onCameraLoadedObservable.clear(),this.onCompleteObservable.clear(),this.onExtensionLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(void 0),this.onDisposeObservable.clear()},e.prototype.requestFile=function(e,t,n,r,i,o){var l=this;
1if(this._progressCallback=r,i){if(this.useRangeRequests){this.validate&&h.Y.Warn("glTF validation is not supported when range requests are enabled");var u={abort:function(){},onCompleteObservable:new a.y$},f={readAsync:function(n,r){return new Promise((function(i,o){l._requestFile(t,e,(function(e){i(new Uint8Array(e))}),!0,(function(e){o(e)}),(function(e){e.setRequestHeader("Range","bytes="+n+"-"+(n+r-1))}))}))},byteLength:0};return this._unpackBinaryAsync(new c.d(f)).then((function(e){u.onCompleteObservable.notifyObservers(u),n(e)}),o),u}return this._requestFile(t,e,(function(e,t){var r=e;l._unpackBinaryAsync(new c.d({readAsync:function(e,t){return Promise.resolve(new Uint8Array(r,e,t))},byteLength:r.byteLength})).then((function(e){n(e,t)}),o)}),!0,o)}return this._requestFile(t,e,(function(r,i){l._validate(e,r,s.w1.GetFolderPath(t),s.w1.GetFilename(t)),n({json:l._parseJson(r)},i)}),i,o)},e.prototype.readFile=function(e,t,n,r,i,o){var a=this;return e._readFile(t,(function(r){if(a._validate(e,r,"file:",t.name),i){var s=r;a._unpackBinaryAsync(new c.d({readAsync:function(e,t){return Promise.resolve(new Uint8Array(s,e,t))},byteLength:s.byteLength})).then(n,o)}else n({json:a._parseJson(r)})}),r,i,o)},e.prototype.importMeshAsync=function(e,t,n,r,i,o){var a=this;return Promise.resolve().then((function(){return a.onParsedObservable.notifyObservers(n),a.onParsedObservable.clear(),a._log("Loading "+(o||"")),a._loader=a._getLoader(n),a._loader.importMeshAsync(e,t,!1,n,r,i,o)}))},e.prototype.loadAsync=function(e,t,n,r,i){var o=this;return Promise.resolve().then((function(){return o.onParsedObservable.notifyObservers(t),o.onParsedObservable.clear(),o._log("Loading "+(i||"")),o._loader=o._getLoader(t),o._loader.loadAsync(e,t,n,r,i)}))},e.prototype.loadAssetContainerAsync=function(e,t,n,r,i){var o=this;return Promise.resolve().then((function(){o.onParsedObservable.notifyObservers(t),o.onParsedObservable.clear(),o._log("Loading "+(i||"")),o._loader=o._getLoader(t);var a=new u.TJ(e),s=[];o.onMaterialLoadedObservable.add((function(e){s.push(e),e.onDisposeObservable.addOnce((function(){var t=a.materials.indexOf(e);t>-1&&a.materials.splice(t,1),(t=s.indexOf(e))>-1&&s.splice(t,1)}))}));var l=[];o.onTextureLoadedObservable.add((function(e){l.push(e),e.onDisposeObservable.addOnce((function(){var t=a.textures.indexOf(e);t>-1&&a.textures.splice(t,1),(t=l.indexOf(e))>-1&&l.splice(t,1)}))}));var h=[];return o.onCameraLoadedObservable.add((function(e){h.push(e)})),o._loader.importMeshAsync(null,e,!0,t,n,r,i).then((function(e){return Array.prototype.push.apply(a.geometries,e.geometries),Array.prototype.push.apply(a.meshes,e.meshes),Array.prototype.push.apply(a.particleSystems,e.particleSystems),Array.prototype.push.apply(a.skeletons,e.skeletons),Array.prototype.push.apply(a.animationGroups,e.animationGroups),Array.prototype.push.apply(a.materials,s),Array.prototype.push.apply(a.textures,l),Array.prototype.push.apply(a.lights,e.lights),Array.prototype.push.apply(a.transformNodes,e.transformNodes),Array.prototype.push.apply(a.cameras,h),a}))}))},e.prototype.canDirectLoad=function(t){return-1!==t.indexOf("asset")&&-1!==t.indexOf("version")||p.M.StartsWith(t,"data:base64,"+e.magicBase64Encoded)||p.M.StartsWith(t,"data:application/octet-stream;base64,"+e.magicBase64Encoded)||p.M.StartsWith(t,"data:model/gltf-binary;base64,"+e.magicBase64Encoded)},e.prototype.directLoad=function(t,n){if(p.M.StartsWith(n,"base64,"+e.magicBase64Encoded)||p.M.StartsWith(n,"application/octet-stream;base64,"+e.magicBase64Encoded)||p.M.StartsWith(n,"model/gltf-binary;base64,"+e.magicBase64Encoded)){var r=s.w1.DecodeBase64(n);return this._validate(t,r),this._unpackBinaryAsync(new c.d({readAsync:function(e,t){return Promise.resolve(new Uint8Array(r,e,t))},byteLength:r.byteLength}))}return this._validate(t,n),Promise.resolve({json:this._parseJson(n)})},e.prototype.createPlugin=function(){return new e},Object.defineProperty(e.prototype,"loaderState",{get:function(){return this._loader?this._loader.state:null},enumerable:!1,configurable:!0}),e.prototype.whenCompleteAsync=function(){var e=this;return new Promise((function(t,n){e.onCompleteObservable.addOnce((function(){t()})),e.onErrorObservable.addOnce((function(e){n(e)}))}))},e.prototype._loadFile=function(e,t,n,r,i){var o=this,a=t._loadFile(e,n,(function(e){o._onProgress(e,a)}),void 0,r,i);return a.onCompleteObservable.add((function(e){o._requests.splice(o._requests.indexOf(e),1)}
1)),this._requests.push(a),a},e.prototype._requestFile=function(e,t,n,r,i,o){var a=this,s=t._requestFile(e,n,(function(e){a._onProgress(e,s)}),void 0,r,i,o);return s.onCompleteObservable.add((function(e){a._requests.splice(a._requests.indexOf(e),1)})),this._requests.push(s),s},e.prototype._onProgress=function(e,t){if(this._progressCallback){t._lengthComputable=e.lengthComputable,t._loaded=e.loaded,t._total=e.total;for(var n=!0,r=0,i=0,o=0,a=this._requests;o<a.length;o++){var s=a[o];if(void 0===s._lengthComputable||void 0===s._loaded||void 0===s._total)return;n=n&&s._lengthComputable,r+=s._loaded,i+=s._total}this._progressCallback({lengthComputable:n,loaded:r,total:n?i:0})}},e.prototype._validate=function(e,t,n,r){var i=this;void 0===n&&(n=""),void 0===r&&(r=""),this.validate&&(this._startPerformanceCounter("Validate JSON"),f.J.ValidateAsync(t,n,r,(function(t){return i.preprocessUrlAsync(n+t).then((function(t){return e._loadFileAsync(t,void 0,!0,!0)}))})).then((function(e){i._endPerformanceCounter("Validate JSON"),i.onValidatedObservable.notifyObservers(e),i.onValidatedObservable.clear()}),(function(e){i._endPerformanceCounter("Validate JSON"),s.w1.Warn("Failed to validate: "+e.message),i.onValidatedObservable.clear()})))},e.prototype._getLoader=function(t){var n=t.json.asset||{};this._log("Asset version: "+n.version),n.minVersion&&this._log("Asset minimum version: "+n.minVersion),n.generator&&this._log("Asset generator: "+n.generator);var r=e._parseVersion(n.version);if(!r)throw new Error("Invalid version: "+n.version);if(void 0!==n.minVersion){var i=e._parseVersion(n.minVersion);if(!i)throw new Error("Invalid minimum version: "+n.minVersion);if(e._compareVersion(i,{major:2,minor:0})>0)throw new Error("Incompatible minimum version: "+n.minVersion)}var o={1:e._CreateGLTF1Loader,2:e._CreateGLTF2Loader}[r.major];if(!o)throw new Error("Unsupported version: "+n.version);return o(this)},e.prototype._parseJson=function(e){this._startPerformanceCounter("Parse JSON"),this._log("JSON length: "+e.length);var t=JSON.parse(e);return this._endPerformanceCounter("Parse JSON"),t},e.prototype._unpackBinaryAsync=function(e){var t=this;return this._startPerformanceCounter("Unpack Binary"),e.loadAsync(20).then((function(){var n=e.readUint32();if(1179937895!==n)throw new Error("Unexpected magic: "+n);var r=e.readUint32();t.loggingEnabled&&t._log("Binary version: "+r);var i,o=e.readUint32();if(0!==e.buffer.byteLength&&o!==e.buffer.byteLength)throw new Error("Length in header does not match actual data length: "+o+" != "+e.buffer.byteLength);switch(r){case 1:i=t._unpackBinaryV1Async(e,o);break;case 2:i=t._unpackBinaryV2Async(e,o);break;default:throw new Error("Unsupported version: "+r)}return t._endPerformanceCounter("Unpack Binary"),i}))},e.prototype._unpackBinaryV1Async=function(e,t){var n=e.readUint32(),r=e.readUint32();if(0!==r)throw new Error("Unexpected content format: "+r);var i=t-e.byteOffset,o={json:this._parseJson(e.readString(n)),bin:null};if(0!==i){var a=e.byteOffset;o.bin={readAsync:function(t,n){return e.buffer.readAsync(a+t,n)},byteLength:i}}return Promise.resolve(o)},e.prototype._unpackBinaryV2Async=function(e,t){var n=this,r=1313821514,i=e.readUint32();if(e.readUint32()!==r)throw new Error("First chunk format is not JSON");return e.byteOffset+i===t?e.loadAsync(i).then((function(){return{json:n._parseJson(e.readString(i)),bin:null}})):e.loadAsync(i+8).then((function(){var o={json:n._parseJson(e.readString(i)),bin:null},a=function(){var n=e.readUint32();switch(e.readUint32()){case r:throw new Error("Unexpected JSON chunk");case 5130562:var i=e.byteOffset;o.bin={readAsync:function(t,n){return e.buffer.readAsync(i+t,n)},byteLength:n},e.skipBytes(n);break;default:e.skipBytes(n)}return e.byteOffset!==t?e.loadAsync(8).then(a):Promise.resolve(o)};return a()}))},e._parseVersion=function(e){if("1.0"===e||"1.0.1"===e)return{major:1,minor:0};var t=(e+"").match(/^(\d+)\.(\d+)/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null},e._compareVersion=function(e,t){return e.major>t.major?1:e.major<t.major?-1:e.minor>t.minor?1:e.minor<t.minor?-1:0},e.prototype._logOpen=function(e){this._log(e),this._logIndentLevel++},e.prototype._logClose=function(){--this._logIndentLevel},e.prototype._logEnabled=function(t){var n=e._logSpaces.substr(0,2*this._logIndentLevel);h.Y.Log(""+n+t)},e.prototype._logDisabled=function(e){},e.prototype._startPerformanceCounterEnabled=function(e){s.w1.StartPerformanceCounter(e)},e.prototype._startPerformanceCounterDisabled=function(e){},e.prototype._endPerformanceCounterEnabled=function(e){s.w1.EndPerformanceCounter(e)},e.prototype._endPerformanceCounterDisabled=function(e){},e.IncrementalLoading=!0,e.HomogeneousCoordinates=!1,e.magicBase64Encoded="Z2xURg",e._logSpaces="                                ",e}();l.SceneLoader&&l.SceneLoader.RegisterPlugin(new d)},4242:(e,t,n)=>{"use strict";n.d(t,{J:()=>a});var r=n(8810);function i(e,t,n,r){var i={externalResourceFunction:function(e){return r(e).then((function(e){return new Uint8Array(e)}))}};return n&&(i.uri="file:"===t?n:t+n),e instanceof ArrayBuffer?GLTFValidator.validateBytes(new Uint8Array(e),i):GLTFValidator.validateString(e,i)}function o(){var e=[];onmessage=function(t){var n=t.data;switch(n.id){case"init":importScripts(n.url);break;case"validate":i(n.data,n.rootUrl,n.fileName,(function(t){return new Promise((function(n,r){var i=e.length;e.push({resolve:n,reject:r}),postMessage({id:"getExternalResource",index:i,uri:t})}))})).then((function(e){postMessage({id:"validate.resolve",value:e})}),(function(e){postMessage({id:"validate.reject",reason:e})}));break;case"getExternalResource.resolve":e[n.index].resolve(n.value);break;
1case"getExternalResource.reject":e[n.index].reject(n.reason)}}}var a=function(){function e(){}return e.ValidateAsync=function(e,t,n,a){var s=this;return"function"==typeof Worker?new Promise((function(l,u){var h=i+"("+o+")()",c=URL.createObjectURL(new Blob([h],{type:"application/javascript"})),f=new Worker(c),p=function(e){f.removeEventListener("error",p),f.removeEventListener("message",d),u(e)},d=function(e){var t=e.data;switch(t.id){case"getExternalResource":a(t.uri).then((function(e){f.postMessage({id:"getExternalResource.resolve",index:t.index,value:e},[e])}),(function(e){f.postMessage({id:"getExternalResource.reject",index:t.index,reason:e})}));break;case"validate.resolve":f.removeEventListener("error",p),f.removeEventListener("message",d),l(t.value);break;case"validate.reject":f.removeEventListener("error",p),f.removeEventListener("message",d),u(t.reason)}};f.addEventListener("error",p),f.addEventListener("message",d),f.postMessage({id:"init",url:r.w1.GetAbsoluteUrl(s.Configuration.url)}),f.postMessage({id:"validate",data:e,rootUrl:t,fileName:n})})):(this._LoadScriptPromise||(this._LoadScriptPromise=r.w1.LoadScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then((function(){return i(e,t,n,a)})))},e.Configuration={url:"https://preview.babylonjs.com/gltf_validator.js"},e}()}}]);
2//# sourceMappingURL=glTFLoader.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.