<!-- SOLID-PLAYTIME · part 91 -->
=t,this.onProgress=e,this.onError=n,this.abortController=new AbortController,this.itemStart=function(c){if(r++,s===!1){if(i.onStart!==void 0)i.onStart(c,a,r)}s=!0},this.itemEnd=function(c){if(a++,i.onProgress!==void 0)i.onProgress(c,a,r);if(a===r){if(s=!1,i.onLoad!==void 0)i.onLoad()}},this.itemError=function(c){if(i.onError!==void 0)i.onError(c)},this.resolveURL=function(c){if(o)return o(c);return c},this.setURLModifier=function(c){return o=c,this},this.addHandler=function(c,u){return l.push(c,u),this},this.removeHandler=function(c){let u=l.indexOf(c);if(u!==-1)l.splice(u,2);return this},this.getHandler=function(c){for(let u=0,f=l.length;u<f;u+=2){let h=l[u],p=l[u+1];if(h.global)h.lastIndex=0;if(h.test(c))return p}return null},this.abort=function(){return this.abortController.abort(),this.abortController=new AbortController,this}}}var zE=new NU;class kc{constructor(t){this.manager=t!==void 0?t:zE,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let n=this;return new Promise(function(i,s){n.load(t,i,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}abort(){return this}}kc.DEFAULT_MATERIAL_NAME="__DEFAULT";var Fo=new WeakMap;class BU extends kc{constructor(t){super(t)}load(t,e,n,i){if(this.path!==void 0)t=this.path+t;t=this.manager.resolveURL(t);let s=this,a=hf.get(`image:${t}`);if(a!==void 0){if(a.complete===!0)s.manager.itemStart(t),setTimeout(function(){if(e)e(a);s.manager.itemEnd(t)},0);else{let u=Fo.get(a);if(u===void 0)u=[],Fo.set(a,u);u.push({onLoad:e,onError:i})}return a}let r=Bo("img");function o(){if(c(),e)e(this);let u=Fo.get(this)||[];for(let f=0;f<u.length;f++){let h=u[f];if(h.onLoad)h.onLoad(this)}Fo.delete(this),s.manager.itemEnd(t)}function l(u){if(c(),i)i(u);hf.remove(`image:${t}`);let f=Fo.get(this)||[];for(let h=0;h<f.length;h++){let p=f[h];if(p.onError)p.onError(u)}Fo.delete(this),s.manager.itemError(t),s.manager.itemEnd(t)}function c(){r.removeEventListener("load",o,!1),r.removeEventListener("error",l,!1)}if(r.addEventListener("load",o,!1),r.addEventListener("error",l,!1),t.slice(0,5)!=="data:"){if(this.crossOrigin!==void 0)r.crossOrigin=this.crossOrigin}return hf.add(`image:${t}`,r),s.manager.itemStart(t),r.src=t,r}}class Vf extends kc{constructor(t){super(t)}load(t,e,n,i){let s=new bn,a=new BU(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(r){if(s.image=r,s.needsUpdate=!0,e!==void 0)e(s)},n,i),s}}class Vc extends Ne{constructor(t,e=1){super();this.isLight=!0,this.type="Light",this.color=new Xt(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);if(e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0)e.object.groundColor=this.groundColor.getHex();if(this.distance!==void 0)e.object.distance=this.distance;if(this.angle!==void 0)e.object.angle=this.angle;if(this.decay!==void 0)e.object.decay=this.decay;if(this.penumbra!==void 0)e.object.penumbra=this.penumbra;if(this.shadow!==void 0)e.object.shadow=this.shadow.toJSON();if(this.target!==void 0)e.object.target=this.target.uuid;return e}}class jo extends Vc{constructor(t,e,n){super(t,n);this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Ne.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Xt(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}var Am=new ie,wb=new C,Cb=new C;class OU{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Nt(512,512),this.mapType=1009,this.map=null,this.mapPass=null,this.matrix=new ie,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Bc,this._frameExtents=new Nt(1,1),this._viewportCount=1,this._viewports=[new Le(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;if(wb.setFromMatrixPosition(t.matrixWorld),e.position.copy(wb),Cb.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Cb),e.updateMatrixWorld(),Am.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Am,e.coordinateSystem,e.reversedDepth),e.reversedDepth)n.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,1,0,0,0,0,1);else n.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);n.multiply(Am)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){if(this.map)this.map.dispose();if(this.mapPass)this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate