@abi-software/scaffoldvuer 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31506,7 +31506,7 @@ const Gz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31506
31506
  /* 2 */
31507
31507
  /***/
31508
31508
  (o) => {
31509
- o.exports = /* @__PURE__ */ JSON.parse('{"name":"zincjs","version":"1.10.1","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
31509
+ o.exports = /* @__PURE__ */ JSON.parse('{"name":"zincjs","version":"1.10.2","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
31510
31510
  },
31511
31511
  /* 3 */
31512
31512
  /***/
@@ -31906,7 +31906,7 @@ const Gz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31906
31906
  for (var N = 0; N < E.length; N += 3)
31907
31907
  g.set(E[N], E[N + 1], E[N + 2]), b !== void 0 && g.applyMatrix4(b), this.normals.push(g.x, g.y, g.z);
31908
31908
  for (var D = 0, B = P.length; D < B; D++)
31909
- R.push(P[D].clone());
31909
+ typeof P[D] == "number" ? R.push(P[D]) : R.push(P[D].clone());
31910
31910
  for (var G = 0, H = L.length; G < H; G++) {
31911
31911
  var K = L[G], te = void 0, W = void 0, U = K.vertexNormals, j = K.vertexColors, Z = new y(K.a + _, K.b + _, K.c + _);
31912
31912
  Z.normal.copy(K.normal), T !== void 0 && Z.normal.applyMatrix3(T).normalize();
@@ -3179,7 +3179,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3179
3179
  `),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP"," vec4 texelGlossiness = texture2D( glossinessMap, vUv );"," // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture"," glossinessFactor *= texelGlossiness.a;","#endif"].join(`
3180
3180
  `),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor;"].join(`
3181
3181
  `),l={specular:{value:new Ce().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=l,this.onBeforeCompile=function(u){for(const c in l)u.uniforms[c]=l[c];u.fragmentShader=u.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return l.specular.value},set:function(u){l.specular.value=u}},specularMap:{get:function(){return l.specularMap.value},set:function(u){l.specularMap.value=u,u?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return l.glossiness.value},set:function(u){l.glossiness.value=u}},glossinessMap:{get:function(){return l.glossinessMap.value},set:function(u){l.glossinessMap.value=u,u?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class qB{constructor(){this.name=nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return Tf}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Ce(1,1,1),e.opacity=1;const s=[];if(Array.isArray(r.diffuseFactor)){const o=r.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(r.diffuseTexture!==void 0&&s.push(i.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new Ce(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Ce(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),r.specularGlossinessTexture!==void 0){const o=r.specularGlossinessTexture;s.push(i.assignTexture(e,"glossinessMap",o)),s.push(i.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){const t=new Tf(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=rr,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class KB{constructor(){this.name=nt.KHR_MESH_QUANTIZATION}}class Eo extends si{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}}Eo.prototype.beforeStart_=Eo.prototype.copySampleValue_,Eo.prototype.afterEnd_=Eo.prototype.copySampleValue_,Eo.prototype.interpolate_=function(n,e,t,i){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,u=o*3,c=i-e,f=(t-e)/c,h=f*f,m=h*f,y=n*u,p=y-u,d=-2*m+3*h,b=m-h,v=1-d,g=b-h+f;for(let x=0;x!==o;x++){const T=s[p+x+o],E=s[p+x+l]*c,_=s[y+x+o],M=s[y+x]*c;r[x]=v*T+g*E+d*_+b*M}return r};const Vi={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},ka={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},gx={9728:At,9729:wt,9984:Ko,9985:Ul,9986:Qo,9987:Ti},yx={33071:zt,33648:Ps,10497:ir},vx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ef={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Mr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},QB={CUBICSPLINE:void 0,LINEAR:Vr,STEP:Ns},Cf={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function bx(n,e){return typeof n!="string"||n===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(n)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(n)||/^data:.*,.*$/i.test(n)||/^blob:.*$/i.test(n)?n:e+n)}function eF(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Kr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:er})),n.DefaultMaterial}function za(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function cs(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function tF(n,e,t){let i=!1,r=!1;for(let l=0,u=e.length;l<u;l++){const c=e[l];if(c.POSITION!==void 0&&(i=!0),c.NORMAL!==void 0&&(r=!0),i&&r)break}if(!i&&!r)return Promise.resolve(n);const s=[],o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];if(i){const f=c.POSITION!==void 0?t.getDependency("accessor",c.POSITION):n.attributes.position;s.push(f)}if(r){const f=c.NORMAL!==void 0?t.getDependency("accessor",c.NORMAL):n.attributes.normal;o.push(f)}}return Promise.all([Promise.all(s),Promise.all(o)]).then(function(l){const u=l[0],c=l[1];return i&&(n.morphAttributes.position=u),r&&(n.morphAttributes.normal=c),n.morphTargetsRelative=!0,n})}function nF(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function iF(n){const e=n.extensions&&n.extensions[nt.KHR_DRACO_MESH_COMPRESSION];let t;return e?t="draco:"+e.bufferView+":"+e.indices+":"+xx(e.attributes):t=n.indices+":"+xx(n.attributes)+":"+n.mode,t}function xx(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function Af(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class rF{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new zB,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.textureCache={},this.nodeNamesUsed={},typeof createImageBitmap<"u"&&/Firefox/.test(navigator.userAgent)===!1?this.textureLoader=new cf(this.options.manager):this.textureLoader=new Qh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Sn(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const l={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};za(s,l,r),cs(l,r),Promise.all(i._invokeAll(function(u){return u.afterRoot&&u.afterRoot(l)})).then(function(){e(l)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let l=0,u=o.length;l<u;l++)e[o[l]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const r=i.clone();return r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[nt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(bx(t.uri,r.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const r=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0)return Promise.resolve(null);const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(o){const l=o[0],u=vx[r.type],c=ka[r.componentType],f=c.BYTES_PER_ELEMENT,h=f*u,m=r.byteOffset||0,y=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,p=r.normalized===!0;let d,b;if(y&&y!==h){const v=Math.floor(m/y),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+v+":"+r.count;let x=t.cache.get(g);x||(d=new c(l,v*y,r.count*y/f),x=new mr(d,y/f),t.cache.add(g,x)),b=new Bi(x,u,m%y/f,p)}else l===null?d=new c(r.count*u):d=new c(l,m,r.count*u),b=new He(d,u,p);if(r.sparse!==void 0){const v=vx.SCALAR,g=ka[r.sparse.indices.componentType],x=r.sparse.indices.byteOffset||0,T=r.sparse.values.byteOffset||0,E=new g(o[1],x,r.sparse.count*v),_=new c(o[2],T,r.sparse.count*u);l!==null&&(b=new He(b.array.slice(),b.itemSize,b.normalized));for(let M=0,S=E.length;M<S;M++){const C=E[M];if(b.setX(C,_[M*u]),u>=2&&b.setY(C,_[M*u+1]),u>=3&&b.setZ(C,_[M*u+2]),u>=4&&b.setW(C,_[M*u+3]),u>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e],s=t.images[r.source];let o=this.textureLoader;if(s.uri){const l=i.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,i){const r=this,s=this.json,o=this.options,l=s.textures[e],u=(t.uri||t.bufferView)+":"+l.sampler;if(this.textureCache[u])return this.textureCache[u];const c=self.URL||self.webkitURL;let f=t.uri||"",h=!1,m=!0;const y=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||y)&&(m=!1),t.bufferView!==void 0)f=r.getDependency("bufferView",t.bufferView).then(function(d){if(t.mimeType==="image/png"){const v=new DataView(d,25,1).getUint8(0,!1);m=v===6||v===4||v===3}h=!0;const b=new Blob([d],{type:t.mimeType});return f=c.createObjectURL(b),f});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const p=Promise.resolve(f).then(function(d){return new Promise(function(b,v){let g=b;i.isImageBitmapLoader===!0&&(g=function(x){const T=new Lt(x);T.needsUpdate=!0,b(T)}),i.load(bx(d,o.path),g,void 0,v)})}).then(function(d){h===!0&&c.revokeObjectURL(f),d.flipY=!1,l.name&&(d.name=l.name),m||(d.format=Ci);const v=(s.samplers||{})[l.sampler]||{};return d.magFilter=gx[v.magFilter]||wt,d.minFilter=gx[v.minFilter]||Ti,d.wrapS=yx[v.wrapS]||ir,d.wrapT=yx[v.wrapT]||ir,r.associations.set(d,{type:"textures",index:e}),d}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",f),null});return this.textureCache[u]=p,p}assignTexture(e,t,i){const r=this;return this.getDependency("texture",i.index).then(function(s){if(i.texCoord!==void 0&&i.texCoord!=0&&!(t==="aoMap"&&i.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[nt.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[nt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(s);s=r.extensions[nt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,l)}}e[t]=s})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0,l=Object.keys(t.morphAttributes).length>0,u=l&&t.morphAttributes.normal!==void 0;if(e.isPoints){const c="PointsMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new gr,Bt.prototype.copy.call(f,i),f.color.copy(i.color),f.map=i.map,f.sizeAttenuation=!1,this.cache.add(c,f)),i=f}else if(e.isLine){const c="LineBasicMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new kt,Bt.prototype.copy.call(f,i),f.color.copy(i.color),this.cache.add(c,f)),i=f}if(r||s||o||l){let c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),r&&(c+="vertex-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");let f=this.cache.get(c);f||(f=i.clone(),s&&(f.vertexColors=!0),o&&(f.flatShading=!0),l&&(f.morphTargets=!0),u&&(f.morphNormals=!0),r&&(f.vertexTangents=!0,f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(i))),i=f}i.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return Kr}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const l={},u=s.extensions||{},c=[];if(u[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else if(u[nt.KHR_MATERIALS_UNLIT]){const h=r[nt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else{const h=s.pbrMetallicRoughness||{};if(l.color=new Ce(1,1,1),l.opacity=1,Array.isArray(h.baseColorFactor)){const m=h.baseColorFactor;l.color.fromArray(m),l.opacity=m[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(l,"map",h.baseColorTexture)),l.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,l.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(l,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=tr);const f=s.alphaMode||Cf.OPAQUE;return f===Cf.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===Cf.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==mn&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Se(1,-1),s.normalTexture.scale!==void 0&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==mn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==mn&&(l.emissive=new Ce().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==mn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===Tf?h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):h=new o(l),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Ur),h.emissiveMap&&(h.emissiveMap.encoding=Ur),cs(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&za(r,h,s),h})}createUniqueName(e){const t=Qe.sanitizeNodeName(e||"");let i=t;for(let r=1;this.nodeNamesUsed[i];++r)i=t+"_"+r;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(l){return i[nt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(u){return Mx(u,l,t)})}const o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l],f=iF(c),h=r[f];if(h)o.push(h.promise);else{let m;c.extensions&&c.extensions[nt.KHR_DRACO_MESH_COMPRESSION]?m=s(c):m=Mx(new Ve,c,t),r[f]={primitive:c,promise:m},o.push(m)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,l=[];for(let u=0,c=o.length;u<c;u++){const f=o[u].material===void 0?eF(this.cache):this.getDependency("material",o[u].material);l.push(f)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(u){const c=u.slice(0,u.length-1),f=u[u.length-1],h=[];for(let y=0,p=f.length;y<p;y++){const d=f[y],b=o[y];let v;const g=c[y];if(b.mode===Vi.TRIANGLES||b.mode===Vi.TRIANGLE_STRIP||b.mode===Vi.TRIANGLE_FAN||b.mode===void 0)v=s.isSkinnedMesh===!0?new xa(d,g):new Pt(d,g),v.isSkinnedMesh===!0&&!v.geometry.attributes.skinWeight.normalized&&v.normalizeSkinWeights(),b.mode===Vi.TRIANGLE_STRIP?v.geometry=Sx(v.geometry,Ey):b.mode===Vi.TRIANGLE_FAN&&(v.geometry=Sx(v.geometry,kd));else if(b.mode===Vi.LINES)v=new un(d,g);else if(b.mode===Vi.LINE_STRIP)v=new ni(d,g);else if(b.mode===Vi.LINE_LOOP)v=new _c(d,g);else if(b.mode===Vi.POINTS)v=new ro(d,g);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(v.geometry.morphAttributes).length>0&&nF(v,s),v.name=t.createUniqueName(s.name||"mesh_"+e),cs(v,s),b.extensions&&za(r,v,b),t.assignFinalMaterial(v),h.push(v)}if(h.length===1)return h[0];const m=new ti;for(let y=0,p=h.length;y<p;y++)m.add(h[y]);return m})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Vt($d.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new wo(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),cs(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i={joints:t.joints};return t.inverseBindMatrices===void 0?Promise.resolve(i):this.getDependency("accessor",t.inverseBindMatrices).then(function(r){return i.inverseBindMatrices=r,i})}loadAnimation(e){const i=this.json.animations[e],r=[],s=[],o=[],l=[],u=[];for(let c=0,f=i.channels.length;c<f;c++){const h=i.channels[c],m=i.samplers[h.sampler],y=h.target,p=y.node!==void 0?y.node:y.id,d=i.parameters!==void 0?i.parameters[m.input]:m.input,b=i.parameters!==void 0?i.parameters[m.output]:m.output;r.push(this.getDependency("node",p)),s.push(this.getDependency("accessor",d)),o.push(this.getDependency("accessor",b)),l.push(m),u.push(y)}return Promise.all([Promise.all(r),Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(u)]).then(function(c){const f=c[0],h=c[1],m=c[2],y=c[3],p=c[4],d=[];for(let v=0,g=f.length;v<g;v++){const x=f[v],T=h[v],E=m[v],_=y[v],M=p[v];if(x===void 0)continue;x.updateMatrix(),x.matrixAutoUpdate=!0;let S;switch(Mr[M.path]){case Mr.weights:S=vo;break;case Mr.rotation:S=es;break;case Mr.position:case Mr.scale:default:S=bo;break}const C=x.name?x.name:x.uuid,A=_.interpolation!==void 0?QB[_.interpolation]:Vr,R=[];Mr[M.path]===Mr.weights?x.traverse(function(I){I.isMesh===!0&&I.morphTargetInfluences&&R.push(I.name?I.name:I.uuid)}):R.push(C);let P=E.array;if(E.normalized){const I=Af(P.constructor),O=new Float32Array(P.length);for(let N=0,w=P.length;N<w;N++)O[N]=P[N]*I;P=O}for(let I=0,O=R.length;I<O;I++){const N=new S(R[I]+"."+Mr[M.path],T.array,P,A);_.interpolation==="CUBICSPLINE"&&(N.createInterpolant=function(L){return new Eo(this.times,this.values,this.getValueSize()/3,L)},N.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),d.push(N)}}const b=i.name?i.name:"animation_"+e;return new xo(b,void 0,d)})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(l){if(l.isMesh)for(let u=0,c=r.weights.length;u<c;u++)l.morphTargetInfluences[u]=r.weights[u]}),o})}loadNode(e){const t=this.json,i=this.extensions,r=this,s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"";return function(){const l=[],u=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return u&&l.push(u),s.camera!==void 0&&l.push(r.getDependency("camera",s.camera).then(function(c){return r._getNodeRef(r.cameraCache,s.camera,c)})),r._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){l.push(c)}),Promise.all(l)}().then(function(l){let u;if(s.isBone===!0?u=new wa:l.length>1?u=new ti:l.length===1?u=l[0]:u=new We,u!==l[0])for(let c=0,f=l.length;c<f;c++)u.add(l[c]);if(s.name&&(u.userData.name=s.name,u.name=o),cs(u,s),s.extensions&&za(i,u,s),s.matrix!==void 0){const c=new De;c.fromArray(s.matrix),u.applyMatrix4(c)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);return r.associations.set(u,{type:"nodes",index:e}),u})}loadScene(e){const t=this.json,i=this.extensions,r=this.json.scenes[e],s=this,o=new ti;r.name&&(o.name=s.createUniqueName(r.name)),cs(o,r),r.extensions&&za(i,o,r);const l=r.nodes||[],u=[];for(let c=0,f=l.length;c<f;c++)u.push(wx(l[c],o,t,s));return Promise.all(u).then(function(){return o})}}function wx(n,e,t,i){const r=t.nodes[n];return i.getDependency("node",n).then(function(s){if(r.skin===void 0)return s;let o;return i.getDependency("skin",r.skin).then(function(l){o=l;const u=[];for(let c=0,f=o.joints.length;c<f;c++)u.push(i.getDependency("node",o.joints[c]));return Promise.all(u)}).then(function(l){return s.traverse(function(u){if(!u.isMesh)return;const c=[],f=[];for(let h=0,m=l.length;h<m;h++){const y=l[h];if(y){c.push(y);const p=new De;o.inverseBindMatrices!==void 0&&p.fromArray(o.inverseBindMatrices.array,h*16),f.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[h])}u.bind(new Ma(c,f),u.matrixWorld)}),s})}).then(function(s){e.add(s);const o=[];if(r.children){const l=r.children;for(let u=0,c=l.length;u<c;u++){const f=l[u];o.push(wx(f,s,t,i))}}return Promise.all(o)})}function sF(n,e,t){const i=e.attributes,r=new pn;if(i.POSITION!==void 0){const l=t.json.accessors[i.POSITION],u=l.min,c=l.max;if(u!==void 0&&c!==void 0){if(r.set(new X(u[0],u[1],u[2]),new X(c[0],c[1],c[2])),l.normalized){const f=Af(ka[l.componentType]);r.min.multiplyScalar(f),r.max.multiplyScalar(f)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const l=new X,u=new X;for(let c=0,f=s.length;c<f;c++){const h=s[c];if(h.POSITION!==void 0){const m=t.json.accessors[h.POSITION],y=m.min,p=m.max;if(y!==void 0&&p!==void 0){if(u.setX(Math.max(Math.abs(y[0]),Math.abs(p[0]))),u.setY(Math.max(Math.abs(y[1]),Math.abs(p[1]))),u.setZ(Math.max(Math.abs(y[2]),Math.abs(p[2]))),m.normalized){const d=Af(ka[m.componentType]);u.multiplyScalar(d)}l.max(u)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(l)}n.boundingBox=r;const o=new Li;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function Mx(n,e,t){const i=e.attributes,r=[];function s(o,l){return t.getDependency("accessor",o).then(function(u){n.setAttribute(l,u)})}for(const o in i){const l=Ef[o]||o.toLowerCase();l in n.attributes||r.push(s(i[o],l))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(l){n.setIndex(l)});r.push(o)}return cs(n,e),sF(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?tF(n,e.targets,t):n})}function Sx(n,e){let t=n.getIndex();if(t===null){const o=[],l=n.getAttribute("position");if(l!==void 0){for(let u=0;u<l.count;u++)o.push(u);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(e===kd)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s}const oF=Rl(Object.freeze(Object.defineProperty({__proto__:null,GLTFLoader:kB},Symbol.toStringTag,{value:"Module"})));var Lf={exports:{}},_x;function aF(){return _x||(_x=1,function(n){function e(c){var f={};function h(y){if(f[y])return f[y].exports;var p=f[y]={i:y,l:!1,exports:{}};return c[y].call(p.exports,p,p.exports,h),p.l=!0,p.exports}h.m=c,h.c=f,h.i=function(y){return y},h.d=function(y,p,d){h.o(y,p)||Object.defineProperty(y,p,{configurable:!1,enumerable:!0,get:d})},h.r=function(y){Object.defineProperty(y,"__esModule",{value:!0})},h.n=function(y){var p=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(p,"a",p),p},h.o=function(y,p){return Object.prototype.hasOwnProperty.call(y,p)},h.p="/",h.oe=function(y){throw console.error(y),y};var m=h(h.s=ENTRY_MODULE);return m.default||m}var t="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+t+").*?\\)";function r(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(c){return!isNaN(1*c)}function o(c,f,h){var m={};m[h]=[];var y=f.toString(),p=y.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!p)return m;for(var d=p[1],b=new RegExp("(\\\\n|\\W)"+r(d)+i,"g"),v;v=b.exec(y);)v[3]!=="dll-reference"&&m[h].push(v[3]);for(b=new RegExp("\\("+r(d)+'\\("(dll-reference\\s('+t+'))"\\)\\)'+i,"g");v=b.exec(y);)c[v[2]]||(m[h].push(v[1]),c[v[2]]=__webpack_require__(v[1]).m),m[v[2]]=m[v[2]]||[],m[v[2]].push(v[4]);for(var g=Object.keys(m),x=0;x<g.length;x++)for(var T=0;T<m[g[x]].length;T++)s(m[g[x]][T])&&(m[g[x]][T]=1*m[g[x]][T]);return m}function l(c){var f=Object.keys(c);return f.reduce(function(h,m){return h||c[m].length>0},!1)}function u(c,f){for(var h={main:[f]},m={main:[]},y={main:{}};l(h);)for(var p=Object.keys(h),d=0;d<p.length;d++){var b=p[d],v=h[b],g=v.pop();if(y[b]=y[b]||{},!(y[b][g]||!c[b][g])){y[b][g]=!0,m[b]=m[b]||[],m[b].push(g);for(var x=o(c,c[b][g],b),T=Object.keys(x),E=0;E<T.length;E++)h[T[E]]=h[T[E]]||[],h[T[E]]=h[T[E]].concat(x[T[E]])}}return m}n.exports=function(c,f){f=f||{};var h={main:__webpack_modules__},m=f.all?{main:Object.keys(h.main)}:u(h,c),y="";Object.keys(m).filter(function(g){return g!=="main"}).forEach(function(g){for(var x=0;m[g][x];)x++;m[g].push(x),h[g][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",y=y+"var "+g+" = ("+e.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+m[g].map(function(T){return""+JSON.stringify(T)+": "+h[g][T].toString()}).join(",")+`});
3182
- `}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+m.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var p=new window.Blob([y],{type:"text/javascript"});if(f.bare)return p;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(p),v=new window.Worker(b);return v.objectURL=b,v}}(Lf)),Lf.exports}function lF(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function cF(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function Tx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}Tx.prototype=Error.prototype;function uF(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new Tx(s,"All promises were rejected"))})}catch(l){i(l)}})}var dF=setTimeout;function Ex(n){return!!(n&&typeof n.length<"u")}function hF(){}function fF(n,e){return function(){n.apply(e,arguments)}}function xt(n){if(!(this instanceof xt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Ax(n,this)}function Cx(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,xt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?Rf:Ua)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ua(e.promise,r);return}Rf(e.promise,i)})}function Rf(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof xt){n._state=3,n._value=e,Pf(n);return}else if(typeof t=="function"){Ax(fF(t,e),n);return}}n._state=1,n._value=e,Pf(n)}catch(i){Ua(n,i)}}function Ua(n,e){n._state=2,n._value=e,Pf(n)}function Pf(n){n._state===2&&n._deferreds.length===0&&xt._immediateFn(function(){n._handled||xt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)Cx(n,n._deferreds[e]);n._deferreds=null}function pF(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function Ax(n,e){var t=!1;try{n(function(i){t||(t=!0,Rf(e,i))},function(i){t||(t=!0,Ua(e,i))})}catch(i){if(t)return;t=!0,Ua(e,i)}}xt.prototype.catch=function(n){return this.then(null,n)},xt.prototype.then=function(n,e){var t=new this.constructor(hF);return Cx(this,new pF(n,e,t)),t},xt.prototype.finally=lF,xt.all=function(n){return new xt(function(e,t){if(!Ex(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},xt.any=uF,xt.allSettled=cF,xt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===xt?n:new xt(function(e){e(n)})},xt.reject=function(n){return new xt(function(e,t){t(n)})},xt.race=function(n){return new xt(function(e,t){if(!Ex(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)xt.resolve(n[i]).then(e,t)})},xt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){dF(n,0)},xt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const mF=Rl(Object.freeze(Object.defineProperty({__proto__:null,default:xt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Ki,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=lR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.10.1","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(y,p,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var x=d.localTimeEnabled||d.localMorphColour;p?(g=p,g.morphTargets=x,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:x,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:x,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var T=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:T,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},m=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,p,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,p,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,p=this.geometry.boundingBox.min,d=new c.Vector2(0-p.x,0-p.y),b=new c.Vector2(y.x-p.x,y.y-p.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v<this.geometry.faces.length;v++){var g=this.geometry.vertices[this.geometry.faces[v].a],x=this.geometry.vertices[this.geometry.faces[v].b],T=this.geometry.vertices[this.geometry.faces[v].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((x.x+d.x)/b.x,(x.y+d.y)/b.y),new c.Vector2((T.x+d.x)/b.x,(T.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=y=>{this.morph.material.wireframe=y},this.editVertices=function(y,p){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>p)return;var v=3*p;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=m},o=>{o.exports=wB},(o,l,u)=>{function c(M){throw new TypeError('"'+M+'" is read-only')}var f=u(4),h=u(6).Geometry,m=u(7).default;function y(M){var S=M,C=u(0).modelPrefix;return C&&(C[C.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(M)||(S=C+M)),S}function p(M,S){var C=(R,P)=>{try{var I=new URL(R,P).href;if(R&&2>R.split("?").length){var O=P.split("?");O.length===2&&(I=I+"?"+O[1])}return I}catch{console.error("There is an issue creting the url link with: ".concat(R,"."))}};if(!Array.isArray(M))return C(M,S);var A=[];return M.forEach(R=>{A.push(C(R,S))}),A}function d(M,S,C,A,R){var P=M.morphTargetInfluences,I=void 0;M.geometry&&(I=M.geometry.morphAttributes);var O=!1;if(P&&I&&I.position){A.set(0,0,0),R.set(0,0,0);for(var N=0;N<P.length;N++)0<P[N]&&(O=!0,C.setFromArray(I.position[N].array),A.add(C.min.multiplyScalar(P[N])),R.add(C.max.multiplyScalar(P[N])));O&&S.set(A,R)}O||S.setFromBufferAttribute(M.geometry.attributes.position),M.updateWorldMatrix(!0,!0),S.applyMatrix4(M.matrixWorld)}function b(M,S,C,A){var R=new XMLHttpRequest;R.open("GET",y(M),!0),R.onreadystatechange=()=>{R.readyState==4&&(R.status==200?C(R.responseText,S):A(M))},R.send(null)}function v(M,S,C){function A(N,w){I[w]=N,P++,P==R&&S(I)}for(var R=M.length,P=0,I=[],O=0;O<R;O++)b(M[O],O,A,C)}l.getColorsRGB=(M,S)=>{var C=Math.floor(S/3),A=S%3,R=0;A==0?R=M[C].r:A==1?R=M[C].g:A==2&&(R=M[C].b);var P=new f.Color(R);return[P.r,P.g,P.b]},l.updateMorphColorAttribute=function(M,S){if(S&&M&&M.morphAttributes&&M.morphAttributes.color){var C=M.morphAttributes.color,A=S.morphTargetInfluences,R=A.length;M.deleteAttribute("morphColor0"),M.deleteAttribute("morphColor1");for(var P=0,I=[],O=0;1>P||O<R;O++)0<A[O]&&(P++,I.push([O,A[O]]));I.length==2?(M.setAttribute("morphColor0",C[I[0][0]]),M.setAttribute("morphColor1",C[I[1][0]])):I.length==1&&(M.setAttribute("morphColor0",C[I[0][0]]),M.setAttribute("morphColor1",C[I[0][0]]))}},l.toBufferGeometry=(M,S)=>{var C;return M instanceof h?(S.localTimeEnabled&&!M.morphNormalsReady&&(M.morphNormals==null||M.morphNormals.length==0)&&M.computeMorphNormals(),C=M.toIndexedBufferGeometry(),S.localMorphColour&&g(M,C)):M instanceof f.BufferGeometry&&(C=M.clone()),C.colorsNeedUpdate=!0,C.computeBoundingBox(),C.computeBoundingSphere(),M._video&&(C._video=M._video),C},l.copyMorphColorsToBufferGeometry=(M,S)=>{if(M&&M.morphColors&&0<M.morphColors.length){for(var C=[],A=M.morphColors,R=u(5).getColorsRGB,P=0,I=A.length;P<I;P++){for(var O=A[P],N=[],w=0;w<M.faces.length;w++){var L=M.faces[w],B=R(O.colors,L.a);N.push(B[0],B[1],B[2]),B=R(O.colors,L.b),N.push(B[0],B[1],B[2]),B=R(O.colors,L.c),N.push(B[0],B[1],B[2])}var D=new f.Float32BufferAttribute(3*(3*M.faces.length),3);D.name=O.name,C.push(D.copyArray(N))}S.morphAttributes.color=C}};var g=(M,S)=>{if(M&&M.morphColors&&0<M.morphColors.length){for(var C=[],A=M.morphColors,R=u(5).getColorsRGB,P=0,I=A.length;P<I;P++){for(var O,N=A[P],w=[],L=0;L<3*N.colors.length;L++)O=R(N.colors,L),w.push(O[0],O[1],O[2]);var B=new f.Float32BufferAttribute(w,3);B.name=N.name,C.push(B)}S.morphAttributes.color=C}};l.mergeVertices=function(M){var S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;S=Math.max(S,Number.EPSILON);for(var C,A={},R=M.getIndex(),P=M.getAttribute("position"),I=R?R.count:P.count,O=0,N=Object.keys(M.attributes),w={},L={},le=[],B=["getX","getY","getZ","getW"],D=0,V=N.length;D<V;D++){C=N[D],w[C]=[];var G=M.morphAttributes[C];G&&(L[C]=Array(G.length).fill().map(()=>[]))}for(var H=Math.log10(1/S),K=Math.pow(10,H),D=0;D<I;D++){for(var te=R?R.getX(D):D,W="",z=0,V=N.length;z<V;z++)for(var C=N[z],j=M.getAttribute(C),Z=j.itemSize,Q=0;Q<Z;Q++)W+="".concat(~~(j[B[Q]](te)*K),",");if(W in A)le.push(A[W]);else{for(var z=0,V=N.length;z<V;z++)for(var ee,C=N[z],j=M.getAttribute(C),G=M.morphAttributes[C],Z=j.itemSize,ie=w[C],Y=L[C],Q=0;Q<Z;Q++)if(ee=B[Q],ie.push(j[ee](te)),G)for(var ne=0,F=G.length;ne<F;ne++)Y[ne].push(G[ne][ee](te));A[W]=O,le.push(O),O++}}for(var $=M.clone(),D=0,V=N.length;D<V;D++){var j,C=N[D],J=M.getAttribute(C),k=new J.array.constructor(w[C]);if(J.isInterleavedBufferAttribute?j=new f.BufferAttribute(k,J.itemSize,J.itemSize):(j=M.getAttribute(C).clone(),j.setArray(k)),$.setAttribute(C,j),C in L)for(var U,z=0;z<L[C].length;z++)U=M.morphAttributes[C][z].clone(),U.setArray(new U.array.constructor(L[C][z])),$.morphAttributes[C][z]=U}var oe=Uint8Array;le.length>=Math.pow(2,8)&&(oe=Uint16Array),le.length>=Math.pow(2,16)&&(oe=Uint32Array);var ae=new oe(le),le=null;return R===null?le=new f.BufferAttribute(ae,1):(le=M.getIndex().clone(),le.setArray(ae)),$.setIndex(le),$};function x(M){if(M.isMeshPhongMaterial){var S=new f.MeshToonMaterial({color:M.color.clone(),morphTargets:M.morphTargets,morphNormals:M.morphNormals,vertexColors:M.vertexColors,transparent:M.transparent,opacity:M.opacity,side:M.side});return M.map&&(S.map=M.map),S}return M}function T(M,S){if(S&&M>=S.length){var C=new f.BufferGeometry,A=new Float32Array(3*M),R=0;return S.forEach(P=>{A[R++]=P[0],A[R++]=P[1],A[R++]=P[2]}),C.setAttribute("position",new f.BufferAttribute(A,3)),C.setDrawRange(0,S.length),C}}function E(){var M=new Image;M.src=u(8);var S=new f.Texture;return S.image=M,S.needsUpdate=!0,S}function _(M,S,C,A,R,P){var I=new m(M,S,C,A,R,P);return I.material.sizeAttenuation=!1,I.material.alphaTest=.5,I.material.transparent=!0,I.material.depthWrite=!1,I.material.depthTest=!1,I.center.set(.5,-1.2),I.renderOrder=1e4,I}l.getBoundingBox=d,l.createNewURL=p,l.createBufferGeometry=T,l.getCircularTexture=E,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=x,l.createNewSpriteText=_},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>p});var c=u(4),f=new c.Matrix4,h=new c.Object3D,m=new c.Vector3,y=new c.Vector3;function p(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}p.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:p,isGeometry:!0,applyMatrix4:function(g){for(var x,T=new c.Matrix3().getNormalMatrix(g),E=0,_=this.vertices.length;E<_;E++)x=this.vertices[E],x.applyMatrix4(g);for(var M,S=0,C=this.faces.length;S<C;S++){M=this.faces[S],M.normal.applyMatrix3(T).normalize();for(var A=0,R=M.vertexNormals.length;A<R;A++)M.vertexNormals[A].applyMatrix3(T).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,x,T){return f.makeTranslation(g,x,T),this.applyMatrix4(f),this},scale:function(g,x,T){return f.makeScale(g,x,T),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function x(H,K,te,W){var z=C===void 0?[]:[T.colors[H].clone(),T.colors[K].clone(),T.colors[te].clone()],j=S===void 0?[]:[new c.Vector3().fromBufferAttribute(S,H),new c.Vector3().fromBufferAttribute(S,K),new c.Vector3().fromBufferAttribute(S,te)],Z=new b(H,K,te,j,z,W);T.faces.push(Z),A!==void 0&&T.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(A,H),new c.Vector2().fromBufferAttribute(A,K),new c.Vector2().fromBufferAttribute(A,te)]),R!==void 0&&T.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(R,H),new c.Vector2().fromBufferAttribute(R,K),new c.Vector2().fromBufferAttribute(R,te)])}var T=this,E=g.index===null?void 0:g.index,_=g.attributes;if(_.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var M=_.position,S=_.normal,C=_.color,A=_.uv,R=_.uv2;R!==void 0&&(this.faceVertexUvs[1]=[]);for(var P=0;P<M.count;P++)T.vertices.push(new c.Vector3().fromBufferAttribute(M,P)),C!==void 0&&T.colors.push(new c.Color().fromBufferAttribute(C,P));var I=g.groups;if(0<I.length)for(var O=0;O<I.length;O++)for(var N=I[O],w=N.start,L=N.count,B=w,D=w+L;B<D;B+=3)E===void 0?x(B,B+1,B+2,N.materialIndex):x(E.getX(B),E.getX(B+1),E.getX(B+2),N.materialIndex);else if(E!==void 0)for(var V=0;V<E.count;V+=3)x(E.getX(V),E.getX(V+1),E.getX(V+2));else for(var G=0;G<M.count;G+=3)x(G,G+1,G+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(m).negate(),this.translate(m.x,m.y,m.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,x=this.boundingSphere.radius,T=x===0?1:1/x,E=new c.Matrix4;return E.set(T,0,0,-T*g.x,0,T,0,-T*g.y,0,0,T,-T*g.z,0,0,0,1),this.applyMatrix4(E),this},computeFaceNormals:function(){for(var g=new c.Vector3,x=new c.Vector3,T=0,E=this.faces.length;T<E;T++){var _=this.faces[T],M=this.vertices[_.a],S=this.vertices[_.b],C=this.vertices[_.c];g.subVectors(C,S),x.subVectors(M,S),g.cross(x),g.normalize(),_.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],x=Array(this.vertices.length),T=0,E=this.vertices.length;T<E;T++)x[T]=new c.Vector3;if(g)for(var _=new c.Vector3,M=new c.Vector3,S=0,C=this.faces.length;S<C;S++){var A=this.faces[S],R=this.vertices[A.a],P=this.vertices[A.b],I=this.vertices[A.c];_.subVectors(I,P),M.subVectors(R,P),_.cross(M),x[A.a].add(_),x[A.b].add(_),x[A.c].add(_)}else{this.computeFaceNormals();for(var O,N=0,w=this.faces.length;N<w;N++)O=this.faces[N],x[O.a].add(O.normal),x[O.b].add(O.normal),x[O.c].add(O.normal)}for(var L=0,B=this.vertices.length;L<B;L++)x[L].normalize();for(var D=0,V=this.faces.length;D<V;D++){var G=this.faces[D],H=G.vertexNormals;H.length===3?(H[0].copy(x[G.a]),H[1].copy(x[G.b]),H[2].copy(x[G.c])):(H[0]=x[G.a].clone(),H[1]=x[G.b].clone(),H[2]=x[G.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),x},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,x=this.faces.length;g<x;g++){var T=this.faces[g],E=T.vertexNormals;E.length===3?(E[0].copy(T.normal),E[1].copy(T.normal),E[2].copy(T.normal)):(E[0]=T.normal.clone(),E[1]=T.normal.clone(),E[2]=T.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,x=0,T=this.faces.length;x<T;x++){g=this.faces[x],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var E=0,_=g.vertexNormals.length;E<_;E++)g.__originalVertexNormals[E]?g.__originalVertexNormals[E].copy(g.vertexNormals[E]):g.__originalVertexNormals[E]=g.vertexNormals[E].clone()}var M=new p;M.faces=this.faces;for(var S=0,C=this.morphTargets.length;S<C;S++){if(!this.morphNormals[S]){this.morphNormals[S]={},this.morphNormals[S].faceNormals=[],this.morphNormals[S].vertexNormals=[];for(var A=this.morphNormals[S].faceNormals,R=this.morphNormals[S].vertexNormals,P=0,I=this.faces.length;P<I;P++){var O=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};A.push(O),R.push(N)}}var w=this.morphNormals[S];M.vertices=this.morphTargets[S].vertices,M.computeFaceNormals();var L=M.computeVertexNormals();if(L&&0<L.length){this.morphTargets[S].normals=Array(this.vertices.length);for(var B=0;B<L.length;B++)this.morphTargets[S].normals[B]=L[B].clone()}for(var D=0,V=this.faces.length;D<V;D++){var G=this.faces[D],H=w.faceNormals[D],K=w.vertexNormals[D];H.copy(G.normal),K.a.copy(G.vertexNormals[0]),K.b.copy(G.vertexNormals[1]),K.c.copy(G.vertexNormals[2])}}for(var te,W=0,z=this.faces.length;W<z;W++)te=this.faces[W],te.normal=te.__originalFaceNormal,te.vertexNormals=te.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,x){var T=this.morphTargets.length,E=this.morphTargets,_=g.morphTargets,M=this.morphColors.length,S=this.morphColors,C=g.morphColors;if(0<T&&T==_.length)for(var A=0,R=E.length;A<R;A++){for(var P=E[A],I=_[A],O=0,N=I.vertices.length;O<N;O++){var w=I.vertices[O],L=w.clone();x!==void 0&&L.applyMatrix4(x),P.vertices.push(L)}if(P.normals&&I.normals)for(var B=0;B<I.normals.length;B+=3)y.set(I.normals2[B],I.normals2[B+1],I.normals2[B+2]),x!==void 0&&y.applyMatrix4(x),P.normals.push(y.x,y.y,y.z)}if(0<M&&M==C.length)for(var D=0,V=S.length;D<V;D++)for(var G=S[D],H=C[D],K=0,te=H.colors;K<te;K++)G.colors.push(H.colors[K].clone())},merge:function(g,x){var T=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var E,_=this.vertices.length,M=this.vertices,S=g.vertices,C=g.normals,A=this.faces,R=g.faces,P=this.colors,I=g.colors;x!==void 0&&(E=new c.Matrix3().getNormalMatrix(x));for(var O=0,N=S.length;O<N;O++){var w=S[O],L=w.clone();x!==void 0&&L.applyMatrix4(x),M.push(L)}for(var B=0;B<C.length;B+=3)y.set(C[B],C[B+1],C[B+2]),x!==void 0&&y.applyMatrix4(x),this.normals.push(y.x,y.y,y.z);for(var D=0,V=I.length;D<V;D++)P.push(I[D].clone());for(var G=0,H=R.length;G<H;G++){var K=R[G],te=void 0,W=void 0,z=K.vertexNormals,j=K.vertexColors,Z=new b(K.a+_,K.b+_,K.c+_);Z.normal.copy(K.normal),E!==void 0&&Z.normal.applyMatrix3(E).normalize();for(var Q=0,ee=z.length;Q<ee;Q++)te=z[Q].clone(),E!==void 0&&te.applyMatrix3(E).normalize(),Z.vertexNormals.push(te);Z.color.copy(K.color);for(var ie=0,Y=j.length;ie<Y;ie++)W=j[ie],Z.vertexColors.push(W.clone());Z.materialIndex=K.materialIndex+T,A.push(Z)}for(var ne,F=0,$=g.faceVertexUvs.length;F<$;F++){ne=g.faceVertexUvs[F],this.faceVertexUvs[F]===void 0&&(this.faceVertexUvs[F]=[]);for(var J=0,k=ne.length;J<k;J++){for(var U=ne[J],oe=[],ae=0,le=U.length;ae<le;ae++)oe.push(U[ae].clone());this.faceVertexUvs[F].push(oe)}}this.mergeMorph(g,x)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,x={},T=[],E=[],_=Math.pow(10,g),M=0,S=this.vertices.length;M<S;M++){var C=this.vertices[M],A=Math.round(C.x*_)+"_"+Math.round(C.y*_)+"_"+Math.round(C.z*_);x[A]===void 0?(x[A]=M,T.push(this.vertices[M]),E[M]=T.length-1):E[M]=E[x[A]]}for(var R,P=[],I=0,O=this.faces.length;I<O;I++){R=this.faces[I],R.a=E[R.a],R.b=E[R.b],R.c=E[R.c];for(var N=[R.a,R.b,R.c],w=0;3>w;w++)if(N[w]===N[(w+1)%3]){P.push(I);break}}for(var L,B=P.length-1;0<=B;B--){L=P[B],this.faces.splice(L,1);for(var D=0,V=this.faceVertexUvs.length;D<V;D++)this.faceVertexUvs[D].splice(L,1)}var G=this.vertices.length-T.length;return this.vertices=T,G},setFromPoints:function(g){this.vertices=[];for(var x,T=0,E=g.length;T<E;T++)x=g[T],this.vertices.push(new c.Vector3(x.x,x.y,x.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,x=g.length,T=0;T<x;T++)g[T]._id=T;g.sort(function(R,P){return R.materialIndex-P.materialIndex});var E,_,M=this.faceVertexUvs[0],S=this.faceVertexUvs[1];M&&M.length===x&&(E=[]),S&&S.length===x&&(_=[]);for(var C,A=0;A<x;A++)C=g[A]._id,E&&E.push(M[C]),_&&_.push(S[C]);E&&(this.faceVertexUvs[0]=E),_&&(this.faceVertexUvs[1]=_)},toJSON:function(){function g(Y,ne,F){return F?Y|1<<ne:Y&~(1<<ne)}function x(Y){var ne=Y.x.toString()+Y.y.toString()+Y.z.toString();return O[ne]===void 0&&(O[ne]=I.length/3,I.push(Y.x,Y.y,Y.z)),O[ne]}function T(Y){var ne=Y.r.toString()+Y.g.toString()+Y.b.toString();return w[ne]===void 0&&(w[ne]=N.length,N.push(Y.getHex())),w[ne]}function E(Y){var ne=Y.x.toString()+Y.y.toString();return B[ne]===void 0&&(B[ne]=L.length/2,L.push(Y.x,Y.y)),B[ne]}var _={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(_.uuid=this.uuid,_.type=this.type,this.name!==""&&(_.name=this.name),this.parameters!==void 0){var M=this.parameters;for(var S in M)M[S]!==void 0&&(_[S]=M[S]);return _}for(var C,A=[],R=0;R<this.vertices.length;R++)C=this.vertices[R],A.push(C.x,C.y,C.z);for(var P=[],I=[],O={},N=[],w={},L=[],B={},D=0;D<this.faces.length;D++){var V=this.faces[D],G=!0,H=!1,K=this.faceVertexUvs[0][D]!==void 0,te=0<V.normal.length(),W=0<V.vertexNormals.length,z=V.color.r!==1||V.color.g!==1||V.color.b!==1,j=0<V.vertexColors.length,Z=0;if(Z=g(Z,0,0),Z=g(Z,1,G),Z=g(Z,2,H),Z=g(Z,3,K),Z=g(Z,4,te),Z=g(Z,5,W),Z=g(Z,6,z),Z=g(Z,7,j),P.push(Z),P.push(V.a,V.b,V.c),P.push(V.materialIndex),K){var Q=this.faceVertexUvs[0][D];P.push(E(Q[0]),E(Q[1]),E(Q[2]))}if(te&&P.push(x(V.normal)),W){var ee=V.vertexNormals;P.push(x(ee[0]),x(ee[1]),x(ee[2]))}if(z&&P.push(T(V.color)),j){var ie=V.vertexColors;P.push(T(ie[0]),T(ie[1]),T(ie[2]))}}return _.data={},_.data.vertices=A,_.data.normals=I,0<N.length&&(_.data.colors=N),0<L.length&&(_.data.uvs=[L]),_.data.faces=P,_},clone:function(){return new p().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var x=g.vertices,T=0,E=x.length;T<E;T++)this.vertices.push(x[T].clone());for(var _=g.colors,M=0,S=_.length;M<S;M++)this.colors.push(_[M].clone());for(var C=g.faces,A=0,R=C.length;A<R;A++)this.faces.push(C[A].clone());for(var P,I=0,O=g.faceVertexUvs.length;I<O;I++){P=g.faceVertexUvs[I],this.faceVertexUvs[I]===void 0&&(this.faceVertexUvs[I]=[]);for(var N=0,w=P.length;N<w;N++){for(var L,B=P[N],D=[],V=0,G=B.length;V<G;V++)L=B[V],D.push(L.clone());this.faceVertexUvs[I].push(D)}}for(var H,K=g.morphTargets,te=0,W=K.length;te<W;te++){if(H={},H.name=K[te].name,K[te].vertices!==void 0){H.vertices=[];for(var z=0,j=K[te].vertices.length;z<j;z++)H.vertices.push(K[te].vertices[z].clone())}if(K[te].normals!==void 0){H.normals=[];for(var Z=0,Q=K[te].normals.length;Z<Q;Z++)H.normals.push(K[te].normals[Z].clone())}this.morphTargets.push(H)}for(var ee,ie=g.morphNormals,Y=0,ne=ie.length;Y<ne;Y++){if(ee={},ie[Y].vertexNormals!==void 0){ee.vertexNormals=[];for(var F=0,$=ie[Y].vertexNormals.length;F<$;F++){var J=ie[Y].vertexNormals[F],k={};k.a=J.a.clone(),k.b=J.b.clone(),k.c=J.c.clone(),ee.vertexNormals.push(k)}}if(ie[Y].faceNormals!==void 0){ee.faceNormals=[];for(var U=0,oe=ie[Y].faceNormals.length;U<oe;U++)ee.faceNormals.push(ie[Y].faceNormals[U].clone())}this.morphNormals.push(ee)}for(var ae=g.skinWeights,le=0,de=ae.length;le<de;le++)this.skinWeights.push(ae[le].clone());for(var be=g.skinIndices,we=0,ue=be.length;we<ue;we++)this.skinIndices.push(be[we].clone());for(var me=g.lineDistances,se=0,xe=me.length;se<xe;se++)this.lineDistances.push(me[se]);var he=g.boundingBox;he!==null&&(this.boundingBox=he.clone());var ge=g.boundingSphere;return ge!==null&&(this.boundingSphere=ge.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var v,g,x=[],T=void 0,E=this.faces;for(g=0;g<E.length;g++){var _=E[g];_.materialIndex!==T&&(T=_.materialIndex,v!==void 0&&(v.count=3*g-v.start,x.push(v)),v={start:3*g,materialIndex:T})}return v!==void 0&&(v.count=3*g-v.start,x.push(v)),x},toBufferGeometry:function(){var g=new d().fromGeometry(this),x=new c.BufferGeometry,T=new Float32Array(3*g.vertices.length);if(x.setAttribute("position",new c.BufferAttribute(T,3).copyVector3sArray(g.vertices)),0<g.normals.length){var E=new Float32Array(3*g.normals.length);x.setAttribute("normal",new c.BufferAttribute(E,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var _=new Float32Array(3*g.colors.length);x.setAttribute("color",new c.BufferAttribute(_,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var M=new Float32Array(2*g.uvs.length);x.setAttribute("uv",new c.BufferAttribute(M,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var S=new Float32Array(2*g.uvs2.length);x.setAttribute("uv2",new c.BufferAttribute(S,2).copyVector2sArray(g.uvs2))}for(var C in x.groups=g.groups,g.morphTargets){for(var A=[],R=g.morphTargets[C],P=0,I=R.length;P<I;P++){var O=R[P],N=new c.Float32BufferAttribute(3*O.data.length,3);N.name=O.name,A.push(N.copyVector3sArray(O.data))}x.morphAttributes[C]=A}if(0<g.skinIndices.length){var w=new c.Float32BufferAttribute(4*g.skinIndices.length,4);x.setAttribute("skinIndex",w.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var L=new c.Float32BufferAttribute(4*g.skinWeights.length,4);x.setAttribute("skinWeight",L.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(x.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(x.boundingBox=g.boundingBox.clone()),x},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,x=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(x,3).copyVector3sArray(this.vertices)),0<this.normals.length){var T=new Float32Array(this.normals.length),E=new c.BufferAttribute(T,3).copyArray(this.normals);g.setAttribute("normal",E)}if(0<this.uvs.length&&0<this.uvs[0].length){var _=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(_,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var M=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(M,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var S=[],C=0;C<this.colors.length;C++)S.push(new c.Color(this.colors[C]));var A=new Float32Array(3*S.length);g.setAttribute("color",new c.BufferAttribute(A,3).copyColorsArray(S))}else{for(var R=new Float32Array(3*this.vertices.length),P=0;P<3*this.vertices.length;P++)R[P]=1;g.setAttribute("color",new c.BufferAttribute(R,3))}if(0<this.faces.length){for(var I=[],O=[],N=0;N<this.faces.length;N++){O.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var w=this.faces[N].vertexColors;if(w.length===3)I.push(w[0],w[1],w[2]);else{var L=this.faces[N].color;I.push(L,L,L)}}g.setIndex(O),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],V=0,G=this.morphTargets.length;V<G;V++){var H=this.morphTargets[V],K=new c.Float32BufferAttribute(3*H.vertices.length,3);if(K.name=H.name,B.push(K.copyVector3sArray(H.vertices)),H.normals){var te=new c.Float32BufferAttribute(3*H.normals.length,3);te.name=H.name,D.push(te.copyVector3sArray(H.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var W=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",W.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var z=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",z.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),p.createBufferGeometryFromObject=function(v){var g=new c.BufferGeometry,x=v.geometry;if(v.isPoints||v.isLine){var T=new c.Float32BufferAttribute(3*x.vertices.length,3),E=new c.Float32BufferAttribute(3*x.colors.length,3);if(g.setAttribute("position",T.copyVector3sArray(x.vertices)),g.setAttribute("color",E.copyColorsArray(x.colors)),x.lineDistances&&x.lineDistances.length===x.vertices.length){var _=new c.Float32BufferAttribute(x.lineDistances.length,1);g.setAttribute("lineDistance",_.copyArray(x.lineDistances))}x.boundingSphere!==null&&(g.boundingSphere=x.boundingSphere.clone()),x.boundingBox!==null&&(g.boundingBox=x.boundingBox.clone())}else v.isMesh&&(g=x.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var x,T,E=[],_=void 0,M=g.faces;for(T=0;T<M.length;T++){var S=M[T];S.materialIndex!==_&&(_=S.materialIndex,x!==void 0&&(x.count=3*T-x.start,E.push(x)),x={start:3*T,materialIndex:_})}x!==void 0&&(x.count=3*T-x.start,E.push(x)),this.groups=E}fromGeometry(g){var x,T=g.faces,E=g.vertices,_=g.faceVertexUvs,M=_[0]&&0<_[0].length,S=_[1]&&0<_[1].length,C=g.morphTargets,A=C.length;if(0<A){x=[];for(var R=0;R<A;R++)x[R]={name:C[R].name,data:[]};this.morphTargets.position=x}var P,I=g.morphNormals,O=I.length;if(0<O){P=[];for(var N=0;N<O;N++)P[N]={name:I[N].name,data:[]};this.morphTargets.normal=P}var w=g.skinIndices,L=g.skinWeights,B=w.length===E.length,D=L.length===E.length;0<E.length&&T.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var V,G=0;G<T.length;G++){V=T[G],this.vertices.push(E[V.a],E[V.b],E[V.c]);var H=V.vertexNormals;if(H.length===3)this.normals.push(H[0],H[1],H[2]);else{var K=V.normal;this.normals.push(K,K,K)}var te=V.vertexColors;if(te.length===3)this.colors.push(te[0],te[1],te[2]);else{var W=V.color;this.colors.push(W,W,W)}if(M===!0){var z=_[0][G];z===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",G),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(z[0],z[1],z[2])}if(S===!0){var j=_[1][G];j===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",G),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(j[0],j[1],j[2])}for(var Z,Q=0;Q<A;Q++)Z=C[Q].vertices,x[Q].data.push(Z[V.a],Z[V.b],Z[V.c]);for(var ee,ie=0;ie<O;ie++)ee=I[ie].vertexNormals[G],P[ie].data.push(ee.a,ee.b,ee.c);B&&this.skinIndices.push(w[V.a],w[V.b],w[V.c]),D&&this.skinWeights.push(L[V.a],L[V.b],L[V.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,x,T,E,_){var M=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=x,this.c=T,this.normal=E&&E.isVector3?E:new c.Vector3,this.vertexNormals=Array.isArray(E)?E:[],this.color=_&&_.isColor?_:new c.Color,this.vertexColors=Array.isArray(_)?_:[],this.materialIndex=M}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var x=0,T=g.vertexNormals.length;x<T;x++)this.vertexNormals[x]=g.vertexNormals[x].clone();for(var E=0,_=g.vertexColors.length;E<_;E++)this.vertexColors[E]=g.vertexColors[E].clone();return this}}},o=>{o.exports=FB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3182
+ `}),y=y+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+m.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var p=new window.Blob([y],{type:"text/javascript"});if(f.bare)return p;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(p),v=new window.Worker(b);return v.objectURL=b,v}}(Lf)),Lf.exports}function lF(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function cF(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function Tx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}Tx.prototype=Error.prototype;function uF(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new Tx(s,"All promises were rejected"))})}catch(l){i(l)}})}var dF=setTimeout;function Ex(n){return!!(n&&typeof n.length<"u")}function hF(){}function fF(n,e){return function(){n.apply(e,arguments)}}function xt(n){if(!(this instanceof xt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Ax(n,this)}function Cx(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,xt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?Rf:Ua)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Ua(e.promise,r);return}Rf(e.promise,i)})}function Rf(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof xt){n._state=3,n._value=e,Pf(n);return}else if(typeof t=="function"){Ax(fF(t,e),n);return}}n._state=1,n._value=e,Pf(n)}catch(i){Ua(n,i)}}function Ua(n,e){n._state=2,n._value=e,Pf(n)}function Pf(n){n._state===2&&n._deferreds.length===0&&xt._immediateFn(function(){n._handled||xt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)Cx(n,n._deferreds[e]);n._deferreds=null}function pF(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function Ax(n,e){var t=!1;try{n(function(i){t||(t=!0,Rf(e,i))},function(i){t||(t=!0,Ua(e,i))})}catch(i){if(t)return;t=!0,Ua(e,i)}}xt.prototype.catch=function(n){return this.then(null,n)},xt.prototype.then=function(n,e){var t=new this.constructor(hF);return Cx(this,new pF(n,e,t)),t},xt.prototype.finally=lF,xt.all=function(n){return new xt(function(e,t){if(!Ex(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},xt.any=uF,xt.allSettled=cF,xt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===xt?n:new xt(function(e){e(n)})},xt.reject=function(n){return new xt(function(e,t){t(n)})},xt.race=function(n){return new xt(function(e,t){if(!Ex(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)xt.resolve(n[i]).then(e,t)})},xt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){dF(n,0)},xt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const mF=Rl(Object.freeze(Object.defineProperty({__proto__:null,default:xt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Ki,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(50).GeometryCSG,this.GlyphsetCSG=u(56).GlyphsetCSG,this.Viewport=u(43).Viewport,this.CameraControls=u(43).CameraControls,this.SmoothCameraTransition=u(43).SmoothCameraTransition,this.RayCaster=u(43).RayCaster,this.CameraAutoTumble=u(43).CameraAutoTumble,this.StereoEffect=u(43).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=lR()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.10.2","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(y,p,d)=>{var b=f(y,d),v=!1;1>d.opacity&&(v=!0);var g;if(b._video===void 0){var x=d.localTimeEnabled||d.localMorphColour;p?(g=p,g.morphTargets=x,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:x,morphNormals:d.localTimeEnabled,transparent:v,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:x,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:v,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var T=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:v,opacity:d.opacity,map:T,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},m=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(y,p,d)=>{if(!(this.morph&&this.morph.geometry&&y!=null)){var b=h(y,p,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var y=this.geometry.boundingBox.max,p=this.geometry.boundingBox.min,d=new c.Vector2(0-p.x,0-p.y),b=new c.Vector2(y.x-p.x,y.y-p.y);this.geometry.faceVertexUvs[0]=[];for(var v=0;v<this.geometry.faces.length;v++){var g=this.geometry.vertices[this.geometry.faces[v].a],x=this.geometry.vertices[this.geometry.faces[v].b],T=this.geometry.vertices[this.geometry.faces[v].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((x.x+d.x)/b.x,(x.y+d.y)/b.y),new c.Vector2((T.x+d.x)/b.x,(T.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=y=>{this.morph.material.wireframe=y},this.editVertices=function(y,p){if(y&&y.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>p)return;var v=3*p;y.forEach(g=>{b.array[v++]=g[0],b.array[v++]=g[1],b.array[v++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=m},o=>{o.exports=wB},(o,l,u)=>{function c(M){throw new TypeError('"'+M+'" is read-only')}var f=u(4),h=u(6).Geometry,m=u(7).default;function y(M){var S=M,C=u(0).modelPrefix;return C&&(C[C.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(M)||(S=C+M)),S}function p(M,S){var C=(R,P)=>{try{var I=new URL(R,P).href;if(R&&2>R.split("?").length){var O=P.split("?");O.length===2&&(I=I+"?"+O[1])}return I}catch{console.error("There is an issue creting the url link with: ".concat(R,"."))}};if(!Array.isArray(M))return C(M,S);var A=[];return M.forEach(R=>{A.push(C(R,S))}),A}function d(M,S,C,A,R){var P=M.morphTargetInfluences,I=void 0;M.geometry&&(I=M.geometry.morphAttributes);var O=!1;if(P&&I&&I.position){A.set(0,0,0),R.set(0,0,0);for(var N=0;N<P.length;N++)0<P[N]&&(O=!0,C.setFromArray(I.position[N].array),A.add(C.min.multiplyScalar(P[N])),R.add(C.max.multiplyScalar(P[N])));O&&S.set(A,R)}O||S.setFromBufferAttribute(M.geometry.attributes.position),M.updateWorldMatrix(!0,!0),S.applyMatrix4(M.matrixWorld)}function b(M,S,C,A){var R=new XMLHttpRequest;R.open("GET",y(M),!0),R.onreadystatechange=()=>{R.readyState==4&&(R.status==200?C(R.responseText,S):A(M))},R.send(null)}function v(M,S,C){function A(N,w){I[w]=N,P++,P==R&&S(I)}for(var R=M.length,P=0,I=[],O=0;O<R;O++)b(M[O],O,A,C)}l.getColorsRGB=(M,S)=>{var C=Math.floor(S/3),A=S%3,R=0;A==0?R=M[C].r:A==1?R=M[C].g:A==2&&(R=M[C].b);var P=new f.Color(R);return[P.r,P.g,P.b]},l.updateMorphColorAttribute=function(M,S){if(S&&M&&M.morphAttributes&&M.morphAttributes.color){var C=M.morphAttributes.color,A=S.morphTargetInfluences,R=A.length;M.deleteAttribute("morphColor0"),M.deleteAttribute("morphColor1");for(var P=0,I=[],O=0;1>P||O<R;O++)0<A[O]&&(P++,I.push([O,A[O]]));I.length==2?(M.setAttribute("morphColor0",C[I[0][0]]),M.setAttribute("morphColor1",C[I[1][0]])):I.length==1&&(M.setAttribute("morphColor0",C[I[0][0]]),M.setAttribute("morphColor1",C[I[0][0]]))}},l.toBufferGeometry=(M,S)=>{var C;return M instanceof h?(S.localTimeEnabled&&!M.morphNormalsReady&&(M.morphNormals==null||M.morphNormals.length==0)&&M.computeMorphNormals(),C=M.toIndexedBufferGeometry(),S.localMorphColour&&g(M,C)):M instanceof f.BufferGeometry&&(C=M.clone()),C.colorsNeedUpdate=!0,C.computeBoundingBox(),C.computeBoundingSphere(),M._video&&(C._video=M._video),C},l.copyMorphColorsToBufferGeometry=(M,S)=>{if(M&&M.morphColors&&0<M.morphColors.length){for(var C=[],A=M.morphColors,R=u(5).getColorsRGB,P=0,I=A.length;P<I;P++){for(var O=A[P],N=[],w=0;w<M.faces.length;w++){var L=M.faces[w],B=R(O.colors,L.a);N.push(B[0],B[1],B[2]),B=R(O.colors,L.b),N.push(B[0],B[1],B[2]),B=R(O.colors,L.c),N.push(B[0],B[1],B[2])}var D=new f.Float32BufferAttribute(3*(3*M.faces.length),3);D.name=O.name,C.push(D.copyArray(N))}S.morphAttributes.color=C}};var g=(M,S)=>{if(M&&M.morphColors&&0<M.morphColors.length){for(var C=[],A=M.morphColors,R=u(5).getColorsRGB,P=0,I=A.length;P<I;P++){for(var O,N=A[P],w=[],L=0;L<3*N.colors.length;L++)O=R(N.colors,L),w.push(O[0],O[1],O[2]);var B=new f.Float32BufferAttribute(w,3);B.name=N.name,C.push(B)}S.morphAttributes.color=C}};l.mergeVertices=function(M){var S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;S=Math.max(S,Number.EPSILON);for(var C,A={},R=M.getIndex(),P=M.getAttribute("position"),I=R?R.count:P.count,O=0,N=Object.keys(M.attributes),w={},L={},le=[],B=["getX","getY","getZ","getW"],D=0,V=N.length;D<V;D++){C=N[D],w[C]=[];var G=M.morphAttributes[C];G&&(L[C]=Array(G.length).fill().map(()=>[]))}for(var H=Math.log10(1/S),K=Math.pow(10,H),D=0;D<I;D++){for(var te=R?R.getX(D):D,W="",z=0,V=N.length;z<V;z++)for(var C=N[z],j=M.getAttribute(C),Z=j.itemSize,Q=0;Q<Z;Q++)W+="".concat(~~(j[B[Q]](te)*K),",");if(W in A)le.push(A[W]);else{for(var z=0,V=N.length;z<V;z++)for(var ee,C=N[z],j=M.getAttribute(C),G=M.morphAttributes[C],Z=j.itemSize,ie=w[C],Y=L[C],Q=0;Q<Z;Q++)if(ee=B[Q],ie.push(j[ee](te)),G)for(var ne=0,F=G.length;ne<F;ne++)Y[ne].push(G[ne][ee](te));A[W]=O,le.push(O),O++}}for(var $=M.clone(),D=0,V=N.length;D<V;D++){var j,C=N[D],J=M.getAttribute(C),k=new J.array.constructor(w[C]);if(J.isInterleavedBufferAttribute?j=new f.BufferAttribute(k,J.itemSize,J.itemSize):(j=M.getAttribute(C).clone(),j.setArray(k)),$.setAttribute(C,j),C in L)for(var U,z=0;z<L[C].length;z++)U=M.morphAttributes[C][z].clone(),U.setArray(new U.array.constructor(L[C][z])),$.morphAttributes[C][z]=U}var oe=Uint8Array;le.length>=Math.pow(2,8)&&(oe=Uint16Array),le.length>=Math.pow(2,16)&&(oe=Uint32Array);var ae=new oe(le),le=null;return R===null?le=new f.BufferAttribute(ae,1):(le=M.getIndex().clone(),le.setArray(ae)),$.setIndex(le),$};function x(M){if(M.isMeshPhongMaterial){var S=new f.MeshToonMaterial({color:M.color.clone(),morphTargets:M.morphTargets,morphNormals:M.morphNormals,vertexColors:M.vertexColors,transparent:M.transparent,opacity:M.opacity,side:M.side});return M.map&&(S.map=M.map),S}return M}function T(M,S){if(S&&M>=S.length){var C=new f.BufferGeometry,A=new Float32Array(3*M),R=0;return S.forEach(P=>{A[R++]=P[0],A[R++]=P[1],A[R++]=P[2]}),C.setAttribute("position",new f.BufferAttribute(A,3)),C.setDrawRange(0,S.length),C}}function E(){var M=new Image;M.src=u(8);var S=new f.Texture;return S.image=M,S.needsUpdate=!0,S}function _(M,S,C,A,R,P){var I=new m(M,S,C,A,R,P);return I.material.sizeAttenuation=!1,I.material.alphaTest=.5,I.material.transparent=!0,I.material.depthWrite=!1,I.material.depthTest=!1,I.center.set(.5,-1.2),I.renderOrder=1e4,I}l.getBoundingBox=d,l.createNewURL=p,l.createBufferGeometry=T,l.getCircularTexture=E,l.resolveURL=y,l.loadExternalFile=b,l.loadExternalFiles=v,l.PhongToToon=x,l.createNewSpriteText=_},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>p});var c=u(4),f=new c.Matrix4,h=new c.Object3D,m=new c.Vector3,y=new c.Vector3;function p(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}p.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:p,isGeometry:!0,applyMatrix4:function(g){for(var x,T=new c.Matrix3().getNormalMatrix(g),E=0,_=this.vertices.length;E<_;E++)x=this.vertices[E],x.applyMatrix4(g);for(var M,S=0,C=this.faces.length;S<C;S++){M=this.faces[S],M.normal.applyMatrix3(T).normalize();for(var A=0,R=M.vertexNormals.length;A<R;A++)M.vertexNormals[A].applyMatrix3(T).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,x,T){return f.makeTranslation(g,x,T),this.applyMatrix4(f),this},scale:function(g,x,T){return f.makeScale(g,x,T),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function x(H,K,te,W){var z=C===void 0?[]:[T.colors[H].clone(),T.colors[K].clone(),T.colors[te].clone()],j=S===void 0?[]:[new c.Vector3().fromBufferAttribute(S,H),new c.Vector3().fromBufferAttribute(S,K),new c.Vector3().fromBufferAttribute(S,te)],Z=new b(H,K,te,j,z,W);T.faces.push(Z),A!==void 0&&T.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(A,H),new c.Vector2().fromBufferAttribute(A,K),new c.Vector2().fromBufferAttribute(A,te)]),R!==void 0&&T.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(R,H),new c.Vector2().fromBufferAttribute(R,K),new c.Vector2().fromBufferAttribute(R,te)])}var T=this,E=g.index===null?void 0:g.index,_=g.attributes;if(_.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var M=_.position,S=_.normal,C=_.color,A=_.uv,R=_.uv2;R!==void 0&&(this.faceVertexUvs[1]=[]);for(var P=0;P<M.count;P++)T.vertices.push(new c.Vector3().fromBufferAttribute(M,P)),C!==void 0&&T.colors.push(new c.Color().fromBufferAttribute(C,P));var I=g.groups;if(0<I.length)for(var O=0;O<I.length;O++)for(var N=I[O],w=N.start,L=N.count,B=w,D=w+L;B<D;B+=3)E===void 0?x(B,B+1,B+2,N.materialIndex):x(E.getX(B),E.getX(B+1),E.getX(B+2),N.materialIndex);else if(E!==void 0)for(var V=0;V<E.count;V+=3)x(E.getX(V),E.getX(V+1),E.getX(V+2));else for(var G=0;G<M.count;G+=3)x(G,G+1,G+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(m).negate(),this.translate(m.x,m.y,m.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,x=this.boundingSphere.radius,T=x===0?1:1/x,E=new c.Matrix4;return E.set(T,0,0,-T*g.x,0,T,0,-T*g.y,0,0,T,-T*g.z,0,0,0,1),this.applyMatrix4(E),this},computeFaceNormals:function(){for(var g=new c.Vector3,x=new c.Vector3,T=0,E=this.faces.length;T<E;T++){var _=this.faces[T],M=this.vertices[_.a],S=this.vertices[_.b],C=this.vertices[_.c];g.subVectors(C,S),x.subVectors(M,S),g.cross(x),g.normalize(),_.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],x=Array(this.vertices.length),T=0,E=this.vertices.length;T<E;T++)x[T]=new c.Vector3;if(g)for(var _=new c.Vector3,M=new c.Vector3,S=0,C=this.faces.length;S<C;S++){var A=this.faces[S],R=this.vertices[A.a],P=this.vertices[A.b],I=this.vertices[A.c];_.subVectors(I,P),M.subVectors(R,P),_.cross(M),x[A.a].add(_),x[A.b].add(_),x[A.c].add(_)}else{this.computeFaceNormals();for(var O,N=0,w=this.faces.length;N<w;N++)O=this.faces[N],x[O.a].add(O.normal),x[O.b].add(O.normal),x[O.c].add(O.normal)}for(var L=0,B=this.vertices.length;L<B;L++)x[L].normalize();for(var D=0,V=this.faces.length;D<V;D++){var G=this.faces[D],H=G.vertexNormals;H.length===3?(H[0].copy(x[G.a]),H[1].copy(x[G.b]),H[2].copy(x[G.c])):(H[0]=x[G.a].clone(),H[1]=x[G.b].clone(),H[2]=x[G.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),x},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,x=this.faces.length;g<x;g++){var T=this.faces[g],E=T.vertexNormals;E.length===3?(E[0].copy(T.normal),E[1].copy(T.normal),E[2].copy(T.normal)):(E[0]=T.normal.clone(),E[1]=T.normal.clone(),E[2]=T.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,x=0,T=this.faces.length;x<T;x++){g=this.faces[x],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var E=0,_=g.vertexNormals.length;E<_;E++)g.__originalVertexNormals[E]?g.__originalVertexNormals[E].copy(g.vertexNormals[E]):g.__originalVertexNormals[E]=g.vertexNormals[E].clone()}var M=new p;M.faces=this.faces;for(var S=0,C=this.morphTargets.length;S<C;S++){if(!this.morphNormals[S]){this.morphNormals[S]={},this.morphNormals[S].faceNormals=[],this.morphNormals[S].vertexNormals=[];for(var A=this.morphNormals[S].faceNormals,R=this.morphNormals[S].vertexNormals,P=0,I=this.faces.length;P<I;P++){var O=new c.Vector3,N={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};A.push(O),R.push(N)}}var w=this.morphNormals[S];M.vertices=this.morphTargets[S].vertices,M.computeFaceNormals();var L=M.computeVertexNormals();if(L&&0<L.length){this.morphTargets[S].normals=Array(this.vertices.length);for(var B=0;B<L.length;B++)this.morphTargets[S].normals[B]=L[B].clone()}for(var D=0,V=this.faces.length;D<V;D++){var G=this.faces[D],H=w.faceNormals[D],K=w.vertexNormals[D];H.copy(G.normal),K.a.copy(G.vertexNormals[0]),K.b.copy(G.vertexNormals[1]),K.c.copy(G.vertexNormals[2])}}for(var te,W=0,z=this.faces.length;W<z;W++)te=this.faces[W],te.normal=te.__originalFaceNormal,te.vertexNormals=te.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,x){var T=this.morphTargets.length,E=this.morphTargets,_=g.morphTargets,M=this.morphColors.length,S=this.morphColors,C=g.morphColors;if(0<T&&T==_.length)for(var A=0,R=E.length;A<R;A++){for(var P=E[A],I=_[A],O=0,N=I.vertices.length;O<N;O++){var w=I.vertices[O],L=w.clone();x!==void 0&&L.applyMatrix4(x),P.vertices.push(L)}if(P.normals&&I.normals)for(var B=0;B<I.normals.length;B+=3)y.set(I.normals2[B],I.normals2[B+1],I.normals2[B+2]),x!==void 0&&y.applyMatrix4(x),P.normals.push(y.x,y.y,y.z)}if(0<M&&M==C.length)for(var D=0,V=S.length;D<V;D++)for(var G=S[D],H=C[D],K=0,te=H.colors;K<te;K++)G.colors.push(H.colors[K].clone())},merge:function(g,x){var T=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var E,_=this.vertices.length,M=this.vertices,S=g.vertices,C=g.normals,A=this.faces,R=g.faces,P=this.colors,I=g.colors;x!==void 0&&(E=new c.Matrix3().getNormalMatrix(x));for(var O=0,N=S.length;O<N;O++){var w=S[O],L=w.clone();x!==void 0&&L.applyMatrix4(x),M.push(L)}for(var B=0;B<C.length;B+=3)y.set(C[B],C[B+1],C[B+2]),x!==void 0&&y.applyMatrix4(x),this.normals.push(y.x,y.y,y.z);for(var D=0,V=I.length;D<V;D++)typeof I[D]=="number"?P.push(I[D]):P.push(I[D].clone());for(var G=0,H=R.length;G<H;G++){var K=R[G],te=void 0,W=void 0,z=K.vertexNormals,j=K.vertexColors,Z=new b(K.a+_,K.b+_,K.c+_);Z.normal.copy(K.normal),E!==void 0&&Z.normal.applyMatrix3(E).normalize();for(var Q=0,ee=z.length;Q<ee;Q++)te=z[Q].clone(),E!==void 0&&te.applyMatrix3(E).normalize(),Z.vertexNormals.push(te);Z.color.copy(K.color);for(var ie=0,Y=j.length;ie<Y;ie++)W=j[ie],Z.vertexColors.push(W.clone());Z.materialIndex=K.materialIndex+T,A.push(Z)}for(var ne,F=0,$=g.faceVertexUvs.length;F<$;F++){ne=g.faceVertexUvs[F],this.faceVertexUvs[F]===void 0&&(this.faceVertexUvs[F]=[]);for(var J=0,k=ne.length;J<k;J++){for(var U=ne[J],oe=[],ae=0,le=U.length;ae<le;ae++)oe.push(U[ae].clone());this.faceVertexUvs[F].push(oe)}}this.mergeMorph(g,x)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,x={},T=[],E=[],_=Math.pow(10,g),M=0,S=this.vertices.length;M<S;M++){var C=this.vertices[M],A=Math.round(C.x*_)+"_"+Math.round(C.y*_)+"_"+Math.round(C.z*_);x[A]===void 0?(x[A]=M,T.push(this.vertices[M]),E[M]=T.length-1):E[M]=E[x[A]]}for(var R,P=[],I=0,O=this.faces.length;I<O;I++){R=this.faces[I],R.a=E[R.a],R.b=E[R.b],R.c=E[R.c];for(var N=[R.a,R.b,R.c],w=0;3>w;w++)if(N[w]===N[(w+1)%3]){P.push(I);break}}for(var L,B=P.length-1;0<=B;B--){L=P[B],this.faces.splice(L,1);for(var D=0,V=this.faceVertexUvs.length;D<V;D++)this.faceVertexUvs[D].splice(L,1)}var G=this.vertices.length-T.length;return this.vertices=T,G},setFromPoints:function(g){this.vertices=[];for(var x,T=0,E=g.length;T<E;T++)x=g[T],this.vertices.push(new c.Vector3(x.x,x.y,x.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,x=g.length,T=0;T<x;T++)g[T]._id=T;g.sort(function(R,P){return R.materialIndex-P.materialIndex});var E,_,M=this.faceVertexUvs[0],S=this.faceVertexUvs[1];M&&M.length===x&&(E=[]),S&&S.length===x&&(_=[]);for(var C,A=0;A<x;A++)C=g[A]._id,E&&E.push(M[C]),_&&_.push(S[C]);E&&(this.faceVertexUvs[0]=E),_&&(this.faceVertexUvs[1]=_)},toJSON:function(){function g(Y,ne,F){return F?Y|1<<ne:Y&~(1<<ne)}function x(Y){var ne=Y.x.toString()+Y.y.toString()+Y.z.toString();return O[ne]===void 0&&(O[ne]=I.length/3,I.push(Y.x,Y.y,Y.z)),O[ne]}function T(Y){var ne=Y.r.toString()+Y.g.toString()+Y.b.toString();return w[ne]===void 0&&(w[ne]=N.length,N.push(Y.getHex())),w[ne]}function E(Y){var ne=Y.x.toString()+Y.y.toString();return B[ne]===void 0&&(B[ne]=L.length/2,L.push(Y.x,Y.y)),B[ne]}var _={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(_.uuid=this.uuid,_.type=this.type,this.name!==""&&(_.name=this.name),this.parameters!==void 0){var M=this.parameters;for(var S in M)M[S]!==void 0&&(_[S]=M[S]);return _}for(var C,A=[],R=0;R<this.vertices.length;R++)C=this.vertices[R],A.push(C.x,C.y,C.z);for(var P=[],I=[],O={},N=[],w={},L=[],B={},D=0;D<this.faces.length;D++){var V=this.faces[D],G=!0,H=!1,K=this.faceVertexUvs[0][D]!==void 0,te=0<V.normal.length(),W=0<V.vertexNormals.length,z=V.color.r!==1||V.color.g!==1||V.color.b!==1,j=0<V.vertexColors.length,Z=0;if(Z=g(Z,0,0),Z=g(Z,1,G),Z=g(Z,2,H),Z=g(Z,3,K),Z=g(Z,4,te),Z=g(Z,5,W),Z=g(Z,6,z),Z=g(Z,7,j),P.push(Z),P.push(V.a,V.b,V.c),P.push(V.materialIndex),K){var Q=this.faceVertexUvs[0][D];P.push(E(Q[0]),E(Q[1]),E(Q[2]))}if(te&&P.push(x(V.normal)),W){var ee=V.vertexNormals;P.push(x(ee[0]),x(ee[1]),x(ee[2]))}if(z&&P.push(T(V.color)),j){var ie=V.vertexColors;P.push(T(ie[0]),T(ie[1]),T(ie[2]))}}return _.data={},_.data.vertices=A,_.data.normals=I,0<N.length&&(_.data.colors=N),0<L.length&&(_.data.uvs=[L]),_.data.faces=P,_},clone:function(){return new p().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var x=g.vertices,T=0,E=x.length;T<E;T++)this.vertices.push(x[T].clone());for(var _=g.colors,M=0,S=_.length;M<S;M++)this.colors.push(_[M].clone());for(var C=g.faces,A=0,R=C.length;A<R;A++)this.faces.push(C[A].clone());for(var P,I=0,O=g.faceVertexUvs.length;I<O;I++){P=g.faceVertexUvs[I],this.faceVertexUvs[I]===void 0&&(this.faceVertexUvs[I]=[]);for(var N=0,w=P.length;N<w;N++){for(var L,B=P[N],D=[],V=0,G=B.length;V<G;V++)L=B[V],D.push(L.clone());this.faceVertexUvs[I].push(D)}}for(var H,K=g.morphTargets,te=0,W=K.length;te<W;te++){if(H={},H.name=K[te].name,K[te].vertices!==void 0){H.vertices=[];for(var z=0,j=K[te].vertices.length;z<j;z++)H.vertices.push(K[te].vertices[z].clone())}if(K[te].normals!==void 0){H.normals=[];for(var Z=0,Q=K[te].normals.length;Z<Q;Z++)H.normals.push(K[te].normals[Z].clone())}this.morphTargets.push(H)}for(var ee,ie=g.morphNormals,Y=0,ne=ie.length;Y<ne;Y++){if(ee={},ie[Y].vertexNormals!==void 0){ee.vertexNormals=[];for(var F=0,$=ie[Y].vertexNormals.length;F<$;F++){var J=ie[Y].vertexNormals[F],k={};k.a=J.a.clone(),k.b=J.b.clone(),k.c=J.c.clone(),ee.vertexNormals.push(k)}}if(ie[Y].faceNormals!==void 0){ee.faceNormals=[];for(var U=0,oe=ie[Y].faceNormals.length;U<oe;U++)ee.faceNormals.push(ie[Y].faceNormals[U].clone())}this.morphNormals.push(ee)}for(var ae=g.skinWeights,le=0,de=ae.length;le<de;le++)this.skinWeights.push(ae[le].clone());for(var be=g.skinIndices,we=0,ue=be.length;we<ue;we++)this.skinIndices.push(be[we].clone());for(var me=g.lineDistances,se=0,xe=me.length;se<xe;se++)this.lineDistances.push(me[se]);var he=g.boundingBox;he!==null&&(this.boundingBox=he.clone());var ge=g.boundingSphere;return ge!==null&&(this.boundingSphere=ge.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var v,g,x=[],T=void 0,E=this.faces;for(g=0;g<E.length;g++){var _=E[g];_.materialIndex!==T&&(T=_.materialIndex,v!==void 0&&(v.count=3*g-v.start,x.push(v)),v={start:3*g,materialIndex:T})}return v!==void 0&&(v.count=3*g-v.start,x.push(v)),x},toBufferGeometry:function(){var g=new d().fromGeometry(this),x=new c.BufferGeometry,T=new Float32Array(3*g.vertices.length);if(x.setAttribute("position",new c.BufferAttribute(T,3).copyVector3sArray(g.vertices)),0<g.normals.length){var E=new Float32Array(3*g.normals.length);x.setAttribute("normal",new c.BufferAttribute(E,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var _=new Float32Array(3*g.colors.length);x.setAttribute("color",new c.BufferAttribute(_,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var M=new Float32Array(2*g.uvs.length);x.setAttribute("uv",new c.BufferAttribute(M,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var S=new Float32Array(2*g.uvs2.length);x.setAttribute("uv2",new c.BufferAttribute(S,2).copyVector2sArray(g.uvs2))}for(var C in x.groups=g.groups,g.morphTargets){for(var A=[],R=g.morphTargets[C],P=0,I=R.length;P<I;P++){var O=R[P],N=new c.Float32BufferAttribute(3*O.data.length,3);N.name=O.name,A.push(N.copyVector3sArray(O.data))}x.morphAttributes[C]=A}if(0<g.skinIndices.length){var w=new c.Float32BufferAttribute(4*g.skinIndices.length,4);x.setAttribute("skinIndex",w.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var L=new c.Float32BufferAttribute(4*g.skinWeights.length,4);x.setAttribute("skinWeight",L.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(x.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(x.boundingBox=g.boundingBox.clone()),x},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,x=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(x,3).copyVector3sArray(this.vertices)),0<this.normals.length){var T=new Float32Array(this.normals.length),E=new c.BufferAttribute(T,3).copyArray(this.normals);g.setAttribute("normal",E)}if(0<this.uvs.length&&0<this.uvs[0].length){var _=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(_,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var M=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(M,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var S=[],C=0;C<this.colors.length;C++)S.push(new c.Color(this.colors[C]));var A=new Float32Array(3*S.length);g.setAttribute("color",new c.BufferAttribute(A,3).copyColorsArray(S))}else{for(var R=new Float32Array(3*this.vertices.length),P=0;P<3*this.vertices.length;P++)R[P]=1;g.setAttribute("color",new c.BufferAttribute(R,3))}if(0<this.faces.length){for(var I=[],O=[],N=0;N<this.faces.length;N++){O.push(this.faces[N].a,this.faces[N].b,this.faces[N].c);var w=this.faces[N].vertexColors;if(w.length===3)I.push(w[0],w[1],w[2]);else{var L=this.faces[N].color;I.push(L,L,L)}}g.setIndex(O),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],V=0,G=this.morphTargets.length;V<G;V++){var H=this.morphTargets[V],K=new c.Float32BufferAttribute(3*H.vertices.length,3);if(K.name=H.name,B.push(K.copyVector3sArray(H.vertices)),H.normals){var te=new c.Float32BufferAttribute(3*H.normals.length,3);te.name=H.name,D.push(te.copyVector3sArray(H.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var W=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",W.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var z=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",z.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),p.createBufferGeometryFromObject=function(v){var g=new c.BufferGeometry,x=v.geometry;if(v.isPoints||v.isLine){var T=new c.Float32BufferAttribute(3*x.vertices.length,3),E=new c.Float32BufferAttribute(3*x.colors.length,3);if(g.setAttribute("position",T.copyVector3sArray(x.vertices)),g.setAttribute("color",E.copyColorsArray(x.colors)),x.lineDistances&&x.lineDistances.length===x.vertices.length){var _=new c.Float32BufferAttribute(x.lineDistances.length,1);g.setAttribute("lineDistance",_.copyArray(x.lineDistances))}x.boundingSphere!==null&&(g.boundingSphere=x.boundingSphere.clone()),x.boundingBox!==null&&(g.boundingBox=x.boundingBox.clone())}else v.isMesh&&(g=x.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var x,T,E=[],_=void 0,M=g.faces;for(T=0;T<M.length;T++){var S=M[T];S.materialIndex!==_&&(_=S.materialIndex,x!==void 0&&(x.count=3*T-x.start,E.push(x)),x={start:3*T,materialIndex:_})}x!==void 0&&(x.count=3*T-x.start,E.push(x)),this.groups=E}fromGeometry(g){var x,T=g.faces,E=g.vertices,_=g.faceVertexUvs,M=_[0]&&0<_[0].length,S=_[1]&&0<_[1].length,C=g.morphTargets,A=C.length;if(0<A){x=[];for(var R=0;R<A;R++)x[R]={name:C[R].name,data:[]};this.morphTargets.position=x}var P,I=g.morphNormals,O=I.length;if(0<O){P=[];for(var N=0;N<O;N++)P[N]={name:I[N].name,data:[]};this.morphTargets.normal=P}var w=g.skinIndices,L=g.skinWeights,B=w.length===E.length,D=L.length===E.length;0<E.length&&T.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var V,G=0;G<T.length;G++){V=T[G],this.vertices.push(E[V.a],E[V.b],E[V.c]);var H=V.vertexNormals;if(H.length===3)this.normals.push(H[0],H[1],H[2]);else{var K=V.normal;this.normals.push(K,K,K)}var te=V.vertexColors;if(te.length===3)this.colors.push(te[0],te[1],te[2]);else{var W=V.color;this.colors.push(W,W,W)}if(M===!0){var z=_[0][G];z===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",G),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(z[0],z[1],z[2])}if(S===!0){var j=_[1][G];j===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",G),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(j[0],j[1],j[2])}for(var Z,Q=0;Q<A;Q++)Z=C[Q].vertices,x[Q].data.push(Z[V.a],Z[V.b],Z[V.c]);for(var ee,ie=0;ie<O;ie++)ee=I[ie].vertexNormals[G],P[ie].data.push(ee.a,ee.b,ee.c);B&&this.skinIndices.push(w[V.a],w[V.b],w[V.c]),D&&this.skinWeights.push(L[V.a],L[V.b],L[V.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,x,T,E,_){var M=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=x,this.c=T,this.normal=E&&E.isVector3?E:new c.Vector3,this.vertexNormals=Array.isArray(E)?E:[],this.color=_&&_.isColor?_:new c.Color,this.vertexColors=Array.isArray(_)?_:[],this.materialIndex=M}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var x=0,T=g.vertexNormals.length;x<T;x++)this.vertexNormals[x]=g.vertexNormals[x].clone();for(var E=0,_=g.vertexColors.length;E<_;E++)this.vertexColors[E]=g.vertexColors[E].clone();return this}}},o=>{o.exports=FB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
3183
3183
  `)),u.vertexShader=u.vertexShader.replace("#include <color_vertex>",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join(`
3184
3184
  `))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,m=0,y=function(){return"pr"+m++},p=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=y(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1};p.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},p.prototype.getDuration=function(){return this.duration},p.prototype.setRegion=function(d){this.region=d},p.prototype.getRegion=function(){return this.region},p.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},p.prototype.getGroup=function(){return this.group},p.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},p.prototype.checkTransparentMesh=function(){},p.prototype.setMesh=function(d,b,v){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var x=g.morphAttributes.position;x||(x=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),x&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(x,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=v,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},p.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},p.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},p.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var v=d/this.duration,g=this.clipAction._clip.duration,x=v*g;x!=this.clipAction.time&&(this.clipAction.time=x,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var T=d;T=d>this.duration?this.duration:0>d?0:d,T!=this.inbuildTime&&(this.inbuildTime=T,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},p.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},p.prototype.getVisibility=function(){return this.visible},p.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},p.prototype.setAlpha=function(d){var b=this._lod._material,v=!1;1>d&&(v=!0),b.opacity=d,b.transparent=v,this.checkTransparentMesh()},p.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},p.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},p.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},p.prototype.setColour=function(d){this._lod.setColour(d)},p.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},p.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},p.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},p.prototype.setMaterial=function(d){this._lod.setMaterial(d)},p.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geoemtry){var v=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(v),this._b1.getCenter(this._v1),v)for(var g=-1,x=0,T=0;T<v.count;T++)this._v2.fromArray(v.array,3*T),x=this._v2.distanceTo(this._v1),g==-1?g=x:g>x&&(g=x,d=T)}return d},p.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var v=this.getMorph();if(v&&v.geometry&&0<=this.closestVertexIndex){var g=v.morphTargetInfluences,x=v.geometry.morphAttributes;if(g&&x&&x.position){for(var T=!1,E=0;E<g.length;E++)0<g[E]&&(T=!0,this._v1.fromArray(x.position[E].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[E])));if(T)return d?b.applyMatrix4(v.matrixWorld):b}else return b.fromArray(v.geometry.attributes.position.array,3*this.closestVertexIndex),d?b.applyMatrix4(v.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),d?b.applyMatrix4(this.morph.matrixWorld):b},p.prototype.getBoundingBox=function(){if(this.visible){var d=this._lod.getCurrentMorph();if(d&&d.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(d,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},p.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},p.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},p.prototype.updateMarker=function(d,b){if(d==!1&&this.markerIsRequired(b)){var v=b.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var g=this.getClosestVertex(!1);g&&(this.marker.setPosition(g.x,g.y,g.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(b.markersList&&!(this.marker.uuid in b.markersList)&&(v=!0,b.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),b&&b.camera&&(v||b.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(b.camera.cameraObject),b.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),b.markersList&&this.marker.uuid in b.markersList&&(b.markerCluster.markerUpdateRequired=!0,delete b.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},p.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},p.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},p.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},p.prototype.getClosestVertexDOMElementCoords=function(d){if(d&&d.camera){var b=!0,v=this.getClosestVertex(!0);return v.project(d.camera),v.z=Math.min(Math.max(v.z,0),1),(1<v.x||-1>v.x||1<v.y||-1>v.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(v.x,v.y,v),{position:v,inView:b}}},p.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number)},p.prototype.render=function(d,b,v,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(v,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var x=this.inbuildTime+d;x>this.duration&&(x-=this.duration),this.inbuildTime=x}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},p.prototype.addLOD=function(d,b,v,g,x){this._lod.addLevelFromURL(d,b,v,g,x)},p.prototype.addVertices=function(d){var b=this.getMorph(),v=void 0;if(!b)v=f(500,d),this.drawRange=d.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");d.forEach(x=>{g.setXYZ(this.drawRange,x[0],x[1],x[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),v=b.geoemtry,this.boundingBoxUpdateRequired=!0}return v},p.prototype.setPosition=function(d,b,v){var g=this.getGroup();g&&(g.position.set(d,b,v),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},p.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},p.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=p},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,m=function(y){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=y,this.addLevel=(d,b)=>{if(d){var v,g=Math.abs(b);for(v=0;v<this.levels.length&&!(g<this.levels[v].distance);v++);this.levels.splice(v,0,{distance:g,morph:d,loaded:!0,loading:!1,url:""}),d.renderOrder=this._renderOrder}},this.levelLoaded=(d,b)=>{if(d){for(var v=Math.abs(b),g=0;g<this.levels.length;g++)if(v===this.levels[g].distance){this._parent.group.add(d),this.levels[g].morph=d,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(d,b,v,g,x)=>{this._loader=d;var T,E=this.calculateDistance(b);for(T=0;T<this.levels.length&&!(E<this.levels[T].distance);T++);this.levels.splice(T,0,{distance:E,morph:void 0,loaded:!1,loading:!1,url:v,index:g}),x&&this.loadLevel(T)},this.loadLevel=d=>{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,v=0;return d==="far"?v=4.5*b:d==="medium"?v=2.5*b:d=="close"&&(v=0),v},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var v=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},x=h(b,g),T=void 0;this._parent.isGeometry?T=new c.Mesh(x,v):this._parent.isLines&&(T=new(u(12)).LineSegments(x,v)),T.userData=this._parent,T.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(T,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(v=>{v.morph&&v.morph.geometry&&f(v.morph.geometry,v.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),p()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,p(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var v=this.levels;if(1<v.length){var g,x,T=d.cameraObject.position.distanceTo(b),E=-1,_=-1;for(g=0,x=v.length;g<x&&T>=v[g].distance;g++)v[g].morph?(-1<E&&v[E].morph&&(v[E].morph.visible=!1),E=g,v[g].morph.visible=!0,_=-1):_=g;for(-1<_&&this.loadLevel(_);g<x;g++)v[g].morph&&(-1<E?v[g].morph.visible=!1:(v[g].morph.visible=!0,E=g));this._currentLevel!=E&&(this._currentLevel=E,this.checkTransparentMesh())}},this.toggleMarker=(d,b)=>{this.levels.forEach(v=>{v.morph&&(b?v.morph.add(d):v.morph.remove(d))})};var p=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=m},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>y});var c=u(13),f=u(4),h=new f.Vector3,m=new f.Vector3;class y extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,v=[],g=0,x=b.count;g<x;g+=2)h.fromBufferAttribute(b,g),m.fromBufferAttribute(b,g+1),v[g]=g==0?0:v[g-1],v[g+1]=v[g]+h.distanceTo(m);d.setAttribute("lineDistance",new f.Float32BufferAttribute(v,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}y.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>x});var c=u(4),f=new c.Vector3,h=new c.Vector3,m=new c.Matrix4,y=new c.Ray,p=new c.Sphere,d=new c.Vector3,b=new c.Vector3,v=new c.Vector3,g=new c.Vector3;class x extends c.Object3D{constructor(){var _=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,M=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=_,this.material=M,this.updateMorphTargets()}copy(_){return super.copy(_),this.material=_.material,this.geometry=_.geometry,this}computeLineDistances(){var _=this.geometry;if(!_.isBufferGeometry)_.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(_.index===null){for(var M=_.attributes.position,S=[0],C=1,A=M.count;C<A;C++)f.fromBufferAttribute(M,C-1),h.fromBufferAttribute(M,C),S[C]=S[C-1],S[C]+=f.distanceTo(h);_.setAttribute("lineDistance",new c.Float32BufferAttribute(S,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(_,M){var S=this.geometry,C=this.matrixWorld,A=_.params.Line.threshold,R=S.drawRange,P=S.morphAttributes.position;if(S.boundingSphere===null&&S.computeBoundingSphere(),p.copy(S.boundingSphere),p.applyMatrix4(C),p.radius+=A,_.ray.intersectsSphere(p)!==!1){m.copy(C).invert(),y.copy(_.ray).applyMatrix4(m);var I=A/((this.scale.x+this.scale.y+this.scale.z)/3),O=I*I,N=new c.Vector3,w=new c.Vector3,L=new c.Vector3,B=new c.Vector3,D=this.isLineSegments?2:1;if(S.isBufferGeometry){var V=S.index,G=S.attributes,H=G.position;if(V!==null)for(var K=Math.max(0,R.start),te=Math.min(V.count,R.start+R.count),W=K;W<te-1;W+=D){var z=V.getX(W),j=V.getX(W+1);T(N,w,this,H,P,z,j);var Z=y.distanceSqToSegment(N,w,B,L);if(!(Z>O)){B.applyMatrix4(this.matrixWorld);var Q=_.ray.origin.distanceTo(B);Q<_.near||Q>_.far||M.push({distance:Q,point:L.clone().applyMatrix4(this.matrixWorld),index:W,face:null,faceIndex:null,object:this})}}else for(var ee=Math.max(0,R.start),ie=Math.min(H.count,R.start+R.count),Y=ee;Y<ie-1;Y+=D){T(N,w,this,H,P,Y,Y+1);var ne=y.distanceSqToSegment(N,w,B,L);if(!(ne>O)){B.applyMatrix4(this.matrixWorld);var F=_.ray.origin.distanceTo(B);F<_.near||F>_.far||M.push({distance:F,point:L.clone().applyMatrix4(this.matrixWorld),index:Y,face:null,faceIndex:null,object:this})}}}else S.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var _=this.geometry;if(_.isBufferGeometry){var M=_.morphAttributes,S=Object.keys(M);if(0<S.length){var C=M[S[0]];if(C!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var A,R=0,P=C.length;R<P;R++)A=C[R].name||R+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[A]=R}}}else{var I=_.morphTargets;I!==void 0&&0<I.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function T(E,_,M,S,C,A,R){E.fromBufferAttribute(S,A),_.fromBufferAttribute(S,R);var P=M.morphTargetInfluences;if(M.material.morphTargets&&C&&P){d.set(0,0,0),b.set(0,0,0);for(var I=0,O=C.length;I<O;I++){var N=P[I],w=C[I];N!==0&&(v.fromBufferAttribute(w,A),g.fromBufferAttribute(w,R),d.addScaledVector(v.sub(E),N),b.addScaledVector(g.sub(_),N))}E.add(d),_.add(b)}}x.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var m=[.02,.03,1],y=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),p=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var v;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var g=!1;this.ndc=new c.Vector3;var x=void 0,T=void 0,E=()=>{v=new c.Sprite(y),v.center.set(.5,0),this.morph.add(v),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,v.scale.set(m[0],m[1],m[2]),v.userData=this};this.updateVisual=(_,M)=>{var S=1,C=0;_!==M&&(C=1-(this.ndc.z-_)/(M-_),S=.6+.4*C),this.setSpriteSize(S)},this.updateNDC=_=>(this.ndc.copy(this.morph.position),this.ndc.project(_),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(_,M,S)=>{this.morph.position.set(_,M,S)},this.setSpriteSize=_=>{v.scale.set(.015,.02,1),v.scale.multiplyScalar(_)},this.dispose=()=>{this.morph&&this.morph.clear(),v&&(v.clear(),v=void 0),T&&(T.material.map.dispose(),T.material.dispose(),T=void 0)},this.isEnabled=()=>g,this.setNumber=_=>{(!_||x!=_)&&T&&(this.morph.remove(T),T.material.map.dispose(),T.material.dispose(),T=void 0),!T&&_&&(T=p(_,.012,"black","Asap",50,500),this.morph.add(T)),x=_},this.getNumber=()=>x||1,this.setVisibility=function(_){_!==this.visible&&(this.visible=_,this.group.visible=_,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{g=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{g=!1,this.morph.visible=!1,this.visible=!1},E()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,m,y,p){u(10).ZincObject.call(this);var d;m&&(d=m.clone(),d.vertexColors=c.FaceColors),this.id=y;var b=void 0,v=void 0;this.isGlyph=!0,this.fromMesh=g=>!!(g&&g.isMesh)&&(this.morph=g.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return p},this.setLabel=g=>{g&&(typeof g=="string"||g instanceof String)&&(v=g,this.morph&&(this.morph.name=g)),b&&this.showLabel()},this.showLabel=g=>{if(b&&(position=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),v&&(typeof v=="string"||v instanceof String)){var x=[0,0,0];b=new(u(17)).Label(v,g),b.setPosition(x[0],x[1],x[2]),this.group.add(b.getSprite())}},this.getLabel=()=>v,this.getMesh=()=>this.morph,this.setTransformation=(g,x,T,E)=>{this.morph&&(this.morph.matrix.elements[0]=x[0],this.morph.matrix.elements[1]=x[1],this.morph.matrix.elements[2]=x[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=T[0],this.morph.matrix.elements[5]=T[1],this.morph.matrix.elements[6]=T[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=E[0],this.morph.matrix.elements[9]=E[1],this.morph.matrix.elements[10]=E[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=g[0],this.morph.matrix.elements[13]=g[1],this.morph.matrix.elements[14]=g[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),b&&b.setPosition(g[0],g[1],g[2])},this.setColour=g=>{b&&b.setColour(g),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry.colorsNeedUpdate=!0},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var m=f,y=void 0;y=h?new c(m,.015,h.getStyle()):new c(m,.015),y.material.sizeAttenuation=!1,y.center.x=-.05,y.center.y=0,this.getPosition=()=>y?[y.position.x,y.position.y,y.position.z]:[0,0,0],this.setPosition=(p,d,b)=>{y&&y.position.set(p,d,b)},this.setColour=p=>{y.color=p.getStyle()},this.setScale=p=>{y&&0<p&&y.scale.set(p,p,1)},this.dispose=()=>{y.dispose()},this.getSprite=()=>y,this.getString=()=>m}},(o,l,u)=>{function c(y){throw new TypeError('"'+y+'" is read-only')}var f=u(4),h=u(19).JSONLoader,m=function(){u(10).ZincObject.call(this);var y=[],p=void 0,d=void 0,b=void 0,v=void 0,g=void 0,x=void 0,T=void 0,E=0,_=0,M=[0,0,0],S=[0,0,0],C=[0,0,0],A="NONE";this.ready=!1;var R=!1,P=!1;this.isGlyphset=!0;for(var I=new f.Matrix4,O=new f.Color,N=new f.Color,w=new f.Box3,L=new f.Box3,B=new f.Box3,D=[],V=[],G=[],H=[],K=[],te=[],W=[],z=[],j=0;8>j;j++)D[j]=new f.Vector3;this.load=(F,$,J,k,U)=>{p=F.axis1,d=F.axis2,b=F.axis3,v=F.positions,g=F.scale,x=F.colors,T=F.label,R=F.metadata.MorphColours,P=F.metadata.MorphVertices,E=F.metadata.number_of_time_steps,A=F.metadata.repeat_mode,_=F.metadata.number_of_vertices,A=="AXES_2D"||A=="MIRROR"?_*=2:A=="AXES_3D"&&(_*=3),M=F.metadata.base_size,S=F.metadata.offset,C=F.metadata.scale_factors;var oe=new h;this.geometry=new f.BufferGeometry;var ae=new f.InstancedMesh(this.geometry,void 0,_);if(this.setMorph(ae),k){var le=oe.parse($);ne(J,U)(le.geometry,le.materials),le.geometry.dispose()}else oe.crossOrigin="Anonymous",oe.load($,ne(J,U))};var Z=(F,$,J,k,U,oe)=>{if(A=="NONE"||A=="MIRROR"){for(var ae,le=[0,0,0],de=[0,0,0],be=[0,0,0],we=[0,0,0],ue=[0,0,0],me=[0,0,0],se=[0,0,0],xe=[0,0,0],he=[0,0,0],ge=0;3>ge;ge++)ae=0>U[ge]?-1:1,le[ge]=ae*M[ge]+U[ge]*C[ge];for(var ge=0;3>ge;ge++)de[ge]=$[ge]*le[0],be[ge]=J[ge]*le[1],we[ge]=k[ge]*le[2],ue[ge]=F[ge]+S[0]*de[ge]+S[1]*be[ge]+S[2]*we[ge],A=="MIRROR"&&(me[ge]=-de[ge],se[ge]=-be[ge],xe[ge]=-we[ge],he[ge]=ue[ge],0>U[0]&&(ue[ge]-=de[ge],he[ge]-=me[ge]));0>we[0]*(de[1]*be[2]-de[2]*be[1])+we[1]*(de[2]*be[0]-de[0]*be[2])+we[2]*(de[0]*be[1]-de[1]*be[0])&&(we[0]=-we[0],we[1]=-we[1],we[2]=-we[2]),oe[0]=[ue,de,be,we],A=="MIRROR"&&(0>xe[0]*(me[1]*se[2]-me[2]*se[1])+xe[1]*(me[2]*se[0]-me[0]*se[2])+xe[2]*(me[0]*se[1]-me[1]*se[0])&&(xe[0]=-xe[0],xe[1]=-xe[1],xe[2]=-xe[2]),oe[1]=[he,me,se,xe])}else if(A=="AXES_2D"||A=="AXES_3D"){for(var ae,_e=[0,0,0],Ue=[0,0,0],ge=0;3>ge;ge++)ae=0>U[ge]?-1:1,_e[ge]=ae*M[0]+U[ge]*C[0];for(var ge=0;3>ge;ge++)Ue[ge]=F[ge]+S[0]*_e[0]*$[ge]+S[1]*_e[1]*J[ge]+S[2]*_e[2]*k[ge];for(var qe=glyph_repeat_mode=="AXES_2D"?2:3,Pe=0;Pe<qe;Pe++){var ct=void 0,Ie=void 0,Ye=U[Pe],$e=[0,0,0],at=[0,0,0],et=[0,0,0];Pe==0?(ct=$,Ie=J):Pe==1?(ct=J,Ie=glyph_repeat_mode=="AXES_2D"?$:k):(ct=k,Ie=$);var Gt=M[0]+Ye*C[0];$e[0]=ct[0]*Gt,$e[1]=ct[1]*Gt,$e[2]=ct[2]*Gt,et[0]=$e[1]*Ie[2]-Ie[1]*$e[2],et[1]=$e[2]*Ie[0]-Ie[2]*$e[0],et[2]=$e[0]*Ie[1]-$e[1]*Ie[0];var re=Math.sqrt(et[0]*et[0]+et[1]*et[1]+et[2]*et[2]);if(0<re){var Me=(M[2]+Ye*C[2])/re;A=="AXES_2D"&&0<Pe&&(Me*=-1),et[0]*=Me,et[1]*=Me,et[2]*=Me}if(at[0]=et[1]*$e[2]-$e[1]*et[2],at[1]=et[2]*$e[0]-$e[2]*et[0],at[2]=et[0]*$e[1]-et[1]*$e[0],re=Math.sqrt(at[0]*at[0]+at[1]*at[1]+at[2]*at[2]),0<re){var Ee=(M[1]+Ye*C[1])/re;at[0]*=Ee,at[1]*=Ee,at[2]*=Ee}oe[Pe]=[Ue,$e,at,et]}}return oe},Q=(F,$,J,k,U)=>{var oe=1;A=="AXES_2D"||A=="MIRROR"?oe=2:A=="AXES_3D"&&(oe=3);var ae=F.length/3,le=0;z.length=oe;for(var de=0;de<ae;de++){var be=3*de,we=[F[be],F[be+1],F[be+2]],ue=[$[be],$[be+1],$[be+2]],me=[J[be],J[be+1],J[be+2]],se=[k[be],k[be+1],k[be+2]],xe=[U[be],U[be+1],U[be+2]],he=Z(we,ue,me,se,xe,z);if(he.length==oe)for(var ge=0;ge<oe;ge++){I.elements[0]=he[ge][1][0],I.elements[1]=he[ge][1][1],I.elements[2]=he[ge][1][2],I.elements[3]=0,I.elements[4]=he[ge][2][0],I.elements[5]=he[ge][2][1],I.elements[6]=he[ge][2][2],I.elements[7]=0,I.elements[8]=he[ge][3][0],I.elements[9]=he[ge][3][1],I.elements[10]=he[ge][3][2],I.elements[11]=0,I.elements[12]=he[ge][0][0],I.elements[13]=he[ge][0][1],I.elements[14]=he[ge][0][2],I.elements[15]=1,this.morph.setMatrixAt(le,I);var _e=y[le];_e&&_e.setTransformation(he[ge][0],he[ge][1],he[ge][2],he[ge][3]),le++}}this.morph.instanceMatrix.needsUpdate=!0},ee=F=>{var $=1;A=="AXES_2D"||A=="MIRROR"?$=2:A=="AXES_3D"&&($=3);for(var J,k=F.length,U=0,oe=0;oe<k;oe++){J=F[oe];for(var ae=0;ae<$;ae++){O.setHex(J),this.morph.setColorAt(U,O);var le=y[U];le&&le.setColour(O),U++}}this.morph.instanceColor.needsUpdate=!0},ie=()=>{var F=V,$=G,J=H,k=K,U=te,oe=W,ae=this.inbuildTime/this.duration*(E-1),le=Math.floor(ae),de=1-(ae-le),be=Math.ceil(ae);if(P){var we=v[le.toString()],ue=v[be.toString()],me=p[le.toString()],se=p[be.toString()],xe=d[le.toString()],he=d[be.toString()],ge=b[le.toString()],_e=b[be.toString()],Ue=g[le.toString()],qe=g[be.toString()];V.length=we.length,G.length=we.length,H.length=we.length,K.length=we.length,te.length=we.length;for(var Pe=0;Pe<we.length;Pe++)F[Pe]=de*we[Pe]+(1-de)*ue[Pe],$[Pe]=de*me[Pe]+(1-de)*se[Pe],J[Pe]=de*xe[Pe]+(1-de)*he[Pe],k[Pe]=de*ge[Pe]+(1-de)*_e[Pe],U[Pe]=de*Ue[Pe]+(1-de)*qe[Pe]}else v[0],c("current_positions"),p[0],c("current_axis1s"),d[0],c("current_axis2s"),b[0],c("current_axis3s"),g[0],c("current_scales");if(Q(F,$,J,k,U),this.boundingBoxUpdateRequired=!0,x!=null){if(R){var ct=x[le.toString()],Ie=x[be.toString()];oe.length=ct.length;for(var Ye=0;Ye<ct.length;Ye++)O.setHex(ct[Ye]),N.setHex(Ie[Ye]),O.setRGB(O.r*de+N.r*(1-de),O.g*de+N.g*(1-de),O.b*de+N.b*(1-de)),oe[Ye]=O.getHex()}else x[0],c("current_colors");ee(oe)}};this.showLabel=()=>{for(var F=0;F<y.length;F++)y[F].showLabel(this.morph.material?this.morph.material.color:void 0)};var Y=F=>{if(T!=null&&F)for(var $,J=0;J<_;J++)$=new(u(16)).Glyph(void 0,void 0,J,this),T!=null&&T[J]!=null&&$.setLabel(T[J]),0<E&&$.setFrustumCulled(!1),y[J]=$,this.morph.add($.getGroup());T!=null&&F&&this.showLabel(this.morph.material?this.morph.material.color:void 0),Q(v[0],p[0],d[0],b[0],g[0]),x!=null&&ee(x[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=F=>{F.isGlyph&&y.push(F),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(F,$)=>{if(F.isMesh){var J=new(u(16)).Glyph(void 0,void 0,$,this);return J.fromMesh(F),y.push(J),this.morph.add(J.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,J}},this.forEachGlyph=F=>{for(var $=0;$<y.length;$++)F(y[$])};var ne=(F,$)=>(J,k)=>{var U=J.toBufferGeometry();this.geometry.copy(U),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),U.dispose(),k&&k[0]&&(this.morph.material=k[0]),Y($),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),J.dispose(),F!=null&&typeof F=="function"&&F(this)};this.getClosestVertexIndex=function(){var F=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var $,J=v[0],k=J.length/3,U=-1,oe=0,ae=0;ae<k;ae++)$=3*ae,this._v2.set(J[$],J[$+1],J[$+2]),oe=this._v1.distanceTo(this._v2),(U==-1||U>oe)&&(U=oe,F=ae)}return F},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var F=new f.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,I),F.setFromMatrixPosition(I),F}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){w.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var F=0;F<_;F++)this.morph.getMatrixAt(F,I),L.copy(w).applyMatrix4(I),F==0?B.copy(L):B.union(L);if(B)this.cachedBoundingBox.copy(B),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=F=>{this.inbuildTime=F>this.duration?this.duration:0>F?0:F,(R||P)&&(ie(),P&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<E)&&(R||P)),this.getCurrentTime=()=>this.inbuildTime,this.dispose=()=>{for(var F=y.length-1;0<=F;F--)y[F].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),p=void 0,d=void 0,b=void 0,v=void 0,g=void 0,x=void 0,this.ready=!1,this.groupName=void 0},this.render=(F,$,J)=>{if($==!0){var k=this.inbuildTime+F;k>this.duration&&(k-=this.duration),this.inbuildTime=k,(R||P)&&ie()}this.updateMarker($,J)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=m},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>_});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,m=c.AnimationClip,y=c.Vector3,p=c.Vector4,d=c.Color,b=c.Vector2,v=u(6).Face3,g=u(6).Geometry,x=c.FileLoader,T=c.DefaultLoadingManager,E=u(21).VideoHandler;function _(M){typeof M=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),M=void 0),this.manager=M===void 0?T:M,this.withCredentials=!1,this.paramsString=""}Object.assign(_.prototype,{load:function(S,C,A,R){var P=this,I=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(S),O=new x(this.manager);S.split("?"),this.paramsString=S.length===2?paramsStrings[1]:"",O.setWithCredentials(this.withCredentials),O.load(S,function(N){var w=JSON.parse(N),L=w.metadata;if(L!==void 0){var B=L.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+S+" should be loaded with THREE.ObjectLoader instead.")}if(P&&P.parse){var D=P.parse(w,I);C(D.geometry,D.materials)}},A,R)},setTexturePath:function(S){this.texturePath=S},parse:function(){function M(R,P){function I(xe,he){return xe&1<<he}var O,N,w,L,B,D,V,G,H,K,te,W,z,j,Z,Q,ee,ie,Y,ne,F,$,J,k,U,oe,ae,le=R.faces,de=R.vertices,be=R.normals,we=R.colors,ue=R.scale,me=0;if(R.uvs!==void 0){for(O=0;O<R.uvs.length;O++)R.uvs[O].length&&me++;for(O=0;O<me;O++)P.faceVertexUvs[O]=[]}for(L=0,B=de.length;L<B;)ie=new y,ie.x=de[L++]*ue,ie.y=de[L++]*ue,ie.z=de[L++]*ue,P.vertices.push(ie);if(L=0,B=le.length,R.uvs)for(O=0;O<R.uvs.length;O++){P.uvs[O]=[];for(var se=0;se<R.uvs[O].length;se++)P.uvs[O][se]=R.uvs[O][se]}if(be)for(O=0;O<be.length;O++)P.normals[O]=be[O];if(we)for(O=0;O<we.length;O++)P.colors[O]=we[O];for(;L<B;)if(K=le[L++],te=I(K,0),W=I(K,1),z=I(K,3),j=I(K,4),Z=I(K,5),Q=I(K,6),ee=I(K,7),te){if(ne=new v,ne.a=le[L],ne.b=le[L+1],ne.c=le[L+3],F=new v,F.a=le[L+1],F.b=le[L+2],F.c=le[L+3],L+=4,W&&(H=le[L++],ne.materialIndex=H,F.materialIndex=H),w=P.faces.length,z)for(O=0;O<me;O++)for(k=R.uvs[O],P.faceVertexUvs[O][w]=[],P.faceVertexUvs[O][w+1]=[],N=0;4>N;N++)G=le[L++],oe=k[2*G],ae=k[2*G+1],U=new b(oe,ae),N!==2&&P.faceVertexUvs[O][w].push(U),N!==0&&P.faceVertexUvs[O][w+1].push(U);if(j&&(V=3*le[L++],ne.normal.set(be[V++],be[V++],be[V]),F.normal.copy(ne.normal)),Z)for(O=0;4>O;O++)V=3*le[L++],J=new y(be[V++],be[V++],be[V]),O!==2&&ne.vertexNormals.push(J),O!==0&&F.vertexNormals.push(J);if(Q&&(D=le[L++],$=we[D],ne.color.setHex($),F.color.setHex($)),ee)for(O=0;4>O;O++)D=le[L++],$=we[D],O!==2&&ne.vertexColors.push(new d($)),O!==0&&F.vertexColors.push(new d($));P.faces.push(ne),P.faces.push(F)}else{if(Y=new v,Y.a=le[L++],Y.b=le[L++],Y.c=le[L++],W&&(H=le[L++],Y.materialIndex=H),w=P.faces.length,z)for(O=0;O<me;O++)for(k=R.uvs[O],P.faceVertexUvs[O][w]=[],N=0;3>N;N++)G=le[L++],oe=k[2*G],ae=k[2*G+1],U=new b(oe,ae),P.faceVertexUvs[O][w].push(U);if(j&&(V=3*le[L++],Y.normal.set(be[V++],be[V++],be[V])),Z)for(O=0;3>O;O++)V=3*le[L++],J=new y(be[V++],be[V++],be[V]),Y.vertexNormals.push(J);if(Q&&(D=le[L++],Y.color.setHex(we[D])),ee)for(O=0;3>O;O++)D=le[L++],Y.vertexColors.push(new d(we[D]));P.faces.push(Y)}}function S(R,P){var I=R.influencesPerVertex===void 0?2:R.influencesPerVertex;if(R.skinWeights)for(var O=0,N=R.skinWeights.length;O<N;O+=I){var w=R.skinWeights[O],L=1<I?R.skinWeights[O+1]:0,B=2<I?R.skinWeights[O+2]:0,D=3<I?R.skinWeights[O+3]:0;P.skinWeights.push(new p(w,L,B,D))}if(R.skinIndices)for(var O=0,N=R.skinIndices.length;O<N;O+=I){var V=R.skinIndices[O],G=1<I?R.skinIndices[O+1]:0,H=2<I?R.skinIndices[O+2]:0,K=3<I?R.skinIndices[O+3]:0;P.skinIndices.push(new p(V,G,H,K))}P.bones=R.bones,P.bones&&0<P.bones.length&&(P.skinWeights.length!==P.skinIndices.length||P.skinIndices.length!==P.vertices.length)&&console.warn("When skinning, number of vertices ("+P.vertices.length+"), skinIndices ("+P.skinIndices.length+"), and skinWeights ("+P.skinWeights.length+") should match.")}function C(R,P){var I=R.scale;if(R.morphTargets!==void 0)for(var O=0,N=R.morphTargets.length;O<N;O++){P.morphTargets[O]={},P.morphTargets[O].name=R.morphTargets[O].name,P.morphTargets[O].vertices=[];for(var w,L=P.morphTargets[O].vertices,B=R.morphTargets[O].vertices,D=0,V=B.length;D<V;D+=3)w=new y,w.x=B[D]*I,w.y=B[D+1]*I,w.z=B[D+2]*I,L.push(w)}if(R.morphNormals!==void 0){for(var O=0,N=R.morphNormals.length;O<N;O++)if(P.morphTargets[O]){P.morphTargets[O].normals=[];for(var G,H=P.morphTargets[O].normals,K=R.morphNormals[O].normals,D=0,V=K.length;D<V;D+=3)G=new y,G.x=K[D],G.y=K[D+1],G.z=K[D+2],H.push(G);P.morphNormalsReady=!0}}if(R.morphColors!==void 0){var O,N,te,W,z,j,Z;for(O=0,N=R.morphColors.length;O<N;O++)for(P.morphColors[O]={},P.morphColors[O].name=R.morphColors[O].name,P.morphColors[O].colors=[],z=P.morphColors[O].colors,j=R.morphColors[O].colors,te=0,W=j.length;te<W;te+=3)Z=new c.Color(16755200),Z.setRGB(j[te],j[te+1],j[te+2]),z.push(Z)}}function A(R,P){var I=[],O=[];R.animation!==void 0&&O.push(R.animation),R.animations!==void 0&&(R.animations.length?O=O.concat(R.animations):O.push(R.animations));for(var N,w=0;w<O.length;w++)N=m.parseAnimation(O[w],P.bones),N&&I.push(N);if(P.morphTargets){var L=m.CreateClipsFromMorphTargetSequences(P.morphTargets,10);I=I.concat(L)}0<I.length&&(P.animations=I)}return function(R,P){R.data!==void 0&&(R=R.data),R.scale=R.scale===void 0?1:1/R.scale;var I=new g;if(I.morphColors=[],M(R,I),S(R,I),C(R,I),A(R,I),I.computeFaceNormals(),I.computeBoundingSphere(),R.materials===void 0||R.materials.length===0)return{geometry:I};var O=f.prototype.initMaterials(R.materials,P,"Anonymous");if(R.materials[0].video){var N=P+R.materials[0].video;this.paramsString&&(N+="?".concat(this.paramsString));var w=new E(N);I._video=w}return O&&0<O.length&&(O[0].side=R.materials[0].singleSided?c.FrontSide:R.materials[0].flipSided?c.BackSide:c.DoubleSide,R.materials[0].specularCoef&&(O[0].shininess=Math.floor(R.materials[0].specularCoef/3))),{geometry:I,materials:O}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(m,y){this.handlers.push(m,y)},get:function(m){for(var y=this.handlers,p=0,d=y.length;p<d;p+=2){var b=y[p],v=y[p+1];if(b.test(m))return v}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(m,y,p){for(var d=[],b=0;b<m.length;++b)d[b]=this.createMaterial(m[b],y,p);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},m=new c.Color,y=new c.TextureLoader,p=new c.MaterialLoader;return function(d,b,v){function g(M,S,C,A,R){var P,I=b+M,O=f.Handlers.get(I);O===null?(y.setCrossOrigin(v),P=y.load(I)):P=O.load(I),S!==void 0&&(P.repeat.fromArray(S),S[0]!==1&&(P.wrapS=c.RepeatWrapping),S[1]!==1&&(P.wrapT=c.RepeatWrapping)),C!==void 0&&P.offset.fromArray(C),A!==void 0&&(A[0]==="repeat"&&(P.wrapS=c.RepeatWrapping),A[0]==="mirror"&&(P.wrapS=c.MirroredRepeatWrapping),A[1]==="repeat"&&(P.wrapT=c.RepeatWrapping),A[1]==="mirror"&&(P.wrapT=c.MirroredRepeatWrapping)),R!==void 0&&(P.anisotropy=R);var N=c.MathUtils.generateUUID();return x[N]=P,N}var x={},T={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var E in d){var _=d[E];switch(E){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":T.name=_;break;case"blending":T.blending=h[_];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",E,"is no longer supported.");break;case"colorDiffuse":T.color=m.fromArray(_).getHex();break;case"colorSpecular":T.specular=m.fromArray(_).getHex();break;case"colorEmissive":T.emissive=m.fromArray(_).getHex();break;case"specularCoef":T.shininess=_;break;case"shading":_.toLowerCase()==="basic"&&(T.type="MeshBasicMaterial"),_.toLowerCase()==="phong"&&(T.type="MeshPhongMaterial"),_.toLowerCase()==="standard"&&(T.type="MeshStandardMaterial");break;case"mapDiffuse":T.map=g(_,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":T.emissiveMap=g(_,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":T.lightMap=g(_,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":T.aoMap=g(_,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":T.bumpMap=g(_,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":T.bumpScale=_;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":T.normalMap=g(_,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":T.normalScale=_;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":T.specularMap=g(_,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":T.metalnessMap=g(_,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":T.roughnessMap=g(_,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":T.alphaMap=g(_,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":T.side=c.BackSide;break;case"doubleSided":T.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),T.opacity=_;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":T[E]=_;break;case"vertexColors":_===!0&&(T.vertexColors=c.VertexColors),_==="face"&&(T.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",E,_)}}return T.type==="MeshBasicMaterial"&&delete T.emissive,T.type!=="MeshPhongMaterial"&&delete T.specular,1>T.opacity&&(T.transparent=!0),p.setTextures(x),p.parse(T)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(m,y){var p=m/y*h.video.duration;h.video.currentTime=p},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(m){return h.video?m*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,m=u(5).getCircularTexture,y=u(17).Label,p=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(v,g,x)=>{if(v&&g){var T=h(v,x),E=m();g.map=E;var _=new f(T,g);this.setMesh(_,x.localTimeEnabled,x.localMorphColour)}};var b=(v,g,x,T)=>{if(x){var E=new c.Color(T),_=new y(x,E);_.setPosition(g[0],g[1],g[2]);var M=_.getSprite();M.material.sizeAttenuation=!1,M.material.alphaTest=.5,M.material.transparent=!0,M.material.depthWrite=!1,M.material.depthTest=!1,this.group.add(M),d[v]=_}};this.addPoints=(v,g,x)=>{if(v&&0<v.length){var T=this.drawRange-1,E=this.addVertices(v),_=this.getMorph();if(!_){var M=new c.PointsMaterial({alphaTest:.5,size:10,color:x,sizeAttenuation:!1});E.colorsNeedUpdate=!0,this.createMesh(E,M,{localTimeEnabled:!1,localMorphColour:!1})}var S=T+v.length,C=0;if(Array.isArray(g)&&g.length===v.length||typeof g=="string")for(T;T+C<S;){var A=typeof g=="string"?g:g[C];b(C,v[C],A,x),C++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setSize=v=>{this.morph&&this.morph.material&&(this.morph.material.size=v,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=v=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=v,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(v){if(0<=v&&this.drawRange>v){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(v),g.getY(v),g.getZ(v)]}},this.editVertices=function(v,g){if(v&&v.length){var x=this.getMorph(),T=g+v.length-1;if(!x||0>g||T>=this.drawRange)return;var E=x.geometry.getAttribute("position"),_=g;v.forEach(M=>{var S=d[_];S&&S.setPosition(M[0],M[1],M[2]),E.setXYZ(_++,M[0],M[1],M[2])}),E.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(v,g,x,T)=>{this.morph&&x&&(this.morph.sizePerPixel=x.pixelHeight),p.prototype.render.call(this,v,g,x,T)}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=p},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,m=new c.Sphere,y=new c.Vector3,p=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var T=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,E=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=T,this.material=E,this.sizePerPixel=1,this.updateMorphTargets()}copy(T){return super.copy(T),this.material=T.material,this.geometry=T.geometry,this}raycast(T,E){var _=this.geometry,M=this.matrixWorld,S=T.params.Points.threshold,C=_.drawRange;if(_.boundingSphere===null&&_.computeBoundingSphere(),m.copy(_.boundingSphere),m.applyMatrix4(M),m.radius+=S,T.ray.intersectsSphere(m)!==!1){f.copy(M).invert(),h.copy(T.ray).applyMatrix4(f);var A=S/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,R=A*A;if(_.isBufferGeometry){var P=_.index,I=_.attributes,O=I.position,N=_.morphAttributes.position;if(P!==null)for(var w,L=Math.max(0,C.start),B=Math.min(P.count,C.start+C.count),D=L;D<B;D++)w=P.getX(D),g(this,O,N,w),v(y,w,R,M,T,E,this);else for(var V=Math.max(0,C.start),G=Math.min(O.count,C.start+C.count),H=V;H<G;H++)g(this,O,N,H),v(y,H,R,M,T,E,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var T=this.geometry;if(T.isBufferGeometry){var E=T.morphAttributes,_=Object.keys(E);if(0<_.length){var M=E[_[0]];if(M!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var S,C=0,A=M.length;C<A;C++)S=M[C].name||C+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[S]=C}}}else{var R=T.morphTargets;R!==void 0&&0<R.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function v(x,T,E,_,M,S,C){var A=h.distanceSqToPoint(x);if(A<E){var R=new c.Vector3;h.closestPointToPoint(x,R),R.applyMatrix4(_);var P=M.ray.origin.distanceTo(R);if(P<M.near||P>M.far)return;S.push({distance:P,distanceToRay:Math.sqrt(A),point:R,index:T,face:null,object:C})}}function g(x,T,E,_){y.fromBufferAttribute(T,_);var M=x.morphTargetInfluences;if(x.material.morphTargets&&E&&M){p.set(0,0,0);for(var S=0,C=E.length;S<C;S++){var A=M[S],R=E[S];A!==0&&(d.fromBufferAttribute(R,_),p.addScaledVector(d.sub(y),A))}y.add(p)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(m,y,p)=>{if(m&&y){var d=f(m,p);p.localMorphColour&&d.morphAttributes.color&&(y.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,y);this.setMesh(b,p.localTimeEnabled,p.localMorphColour)}},this.setWidth=m=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=m,this.morph.material.needsUpdate=!0)},this.addLines=(m,y)=>{if(m&&0<m.length){var p=this.addVertices(m),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:y});p.colorsNeedUpdate=!0,this.createLineSegment(p,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=h},(o,l,u)=>{function c(y,p,d,b,v,g,x){try{var T=y[g](x),E=T.value}catch(_){return void d(_)}T.done?p(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var p=this,d=arguments;return new Promise(function(b,v){function g(E){c(T,b,v,g,x,"next",E)}function x(E){c(T,b,v,g,x,"throw",E)}var T=y.apply(p,d);g(void 0)})}}var h=u(4),m=function(){var y=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var p=f(function*(d){var b=1,v=1,g=0;if(d&&d.length){y.isLoading=!0;var x=new Image;x.crossOrigin="Anonymous";for(var T,E=document.createElement("canvas"),_=0,M=Array(d.length),S=0;S<d.length;S++)T=yield y.imageToUint8Array(y,x,d[S],E),T&&T.array&&(b=T.width,v=T.height,M[g]=T.array,_+=M[g].length,g++);var C=new Uint8Array(_);_=0,M.forEach(A=>{C.set(A,_),_+=A.length}),y.impl=new h.DataTexture2DArray(C,b,v,g),y.size={width:b,height:v,depth:g},y.isLoading=!1,y.impl.needsUpdate=!0}});return function(){return p.apply(this,arguments)}}(),this.getMaterial=p=>{if(this.impl){var d;if(!p)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(p.vs&&p.fs){var b=!0;p.transparent&&(b=p.transparent);var v=h.FrontSide;p.side&&(v=p.side),d=new h.ShaderMaterial({transparent:b,uniforms:p.uniforms,vertexShader:p.vs,fragmentShader:p.fs,side:v}),p.glslVersion&&(d.glslVersion=p.glslVersion)}if(d)return d.needsUpdate=!0,d}}};m.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=m},(o,l,u)=>{function c(y,p,d,b,v,g,x){try{var T=y[g](x),E=T.value}catch(_){return void d(_)}T.done?p(E):Promise.resolve(E).then(b,v)}function f(y){return function(){var p=this,d=arguments;return new Promise(function(b,v){function g(E){c(T,b,v,g,x,"next",E)}function x(E){c(T,b,v,g,x,"throw",E)}var T=y.apply(p,d);g(void 0)})}}var h=u(4),m=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};m.prototype.loadImage=function(y,p){return new Promise((d,b)=>{y.onload=()=>d(y),y.onerror=b,y.src=p})},m.prototype.imageToUint8Array=function(){var y=f(function*(p,d,b,v){yield p.loadImage(d,b),v.width=d.width,v.height=d.height;var g=v.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,v.width,v.height).data.buffer),width:v.width,height:v.height}});return function(){return y.apply(this,arguments)}}(),m.prototype.loadFromImages=function(){var y=f(function*(){});return function(){return y.apply(this,arguments)}}(),m.prototype.isReady=function(){return!(!this.impl||this.isLoading)},m.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=m},(o,l,u)=>{function c(v,g){var x=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);g&&(T=T.filter(function(E){return Object.getOwnPropertyDescriptor(v,E).enumerable})),x.push.apply(x,T)}return x}function f(v){for(var g,x=1;x<arguments.length;x++)g=arguments[x]==null?{}:arguments[x],x%2?c(Object(g),!0).forEach(function(T){h(v,T,g[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(g,T))});return v}function h(v,g,x){return g=m(g),g in v?Object.defineProperty(v,g,{value:x,enumerable:!0,configurable:!0,writable:!0}):v[g]=x,v}function m(v){var g=y(v,"string");return typeof g=="symbol"?g:g+""}function y(v,g){if(typeof v!="object"||!v)return v;var x=v[Symbol.toPrimitive];if(x!==void 0){var T=x.call(v,g);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}var p=u(4),d=u(28),b=function(v){u(29).TexturePrimitive.call(this,v),this.isTextureSlides=!0;var g=[],x={};this.morph=new p.Group,this.group=this.morph,this.morph.userData=this;var T=!0;this.createSlides=M=>{M.forEach(S=>this.createSlide(S))};var E=(M,S)=>{var C=M.material,A=C.uniforms;switch(M.rotation.x=0,M.rotation.y=0,M.rotation.z=0,M.position.x=0,M.position.y=0,M.position.z=0,S.direction){case"x":var R=T?-Math.PI/2:Math.PI/2;M.rotation.y=R,A.direction.value=1,A.slide.value.set(S.value,0,0),M.position.x=S.value;break;case"y":M.rotation.x=Math.PI/2,A.direction.value=2,A.slide.value.set(0,S.value,0),M.position.y=S.value;break;case"z":A.direction.value=3,A.slide.value.set(0,0,S.value),M.position.z=S.value;break}C.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=M=>{M&&M.id&&M.id in x&&x[M.id]&&E(x[M.id],M)},this.createSlide=M=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&M&&M.direction&&M.value!==void 0){var S=new p.PlaneGeometry(1,1);S.translate(.5,.5,0);var C=d.getUniforms();C.diffuse.value=this.texture.impl,C.depth.value=this.texture.size.depth,C.flipY.value=T;var A={fs:d.fs,vs:d.vs,uniforms:C,glslVersion:d.glslVersion,side:p.DoubleSide,transparent:!1},R=this.texture.getMaterial(A);R.needsUpdate=!0;var P=new p.Mesh(S,R);P.name=this.groupName,P.userData=this;var I={value:M.value,direction:M.direction,id:P.id};return g.push(I),E(P,I),x[P.id]=P,this.morph.add(P),this.boundingBoxUpdateRequired=!0,I}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=M=>{for(var S=0;S<g.length;S++)if(M===g[S].id)return f({},g[S])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=M=>{M&&this.removeSlideWithId(M.id)},this.removeSlideWithId=M=>{if(this.morph&&M in x&&x[M]){if(this.morph.getObjectById(M)){var S=x[M];this.morph.remove(S),S.clear(),S.geometry&&S.geometry.dispose(),S.material&&S.material.dispose(),this.boundingBoxUpdateRequired=!0}var C=g.findIndex(A=>A.id===M);-1<C&&g.splice(C,1)}},this.dispose=()=>{this.morph.children.forEach(M=>{M.geometry&&M.geometry.dispose(),M.material&&M.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var _=(M,S,C)=>{switch(S.direction.value){case 1:C.copy(S.slide.value),M.expandByPoint(C),C.setY(1),C.setZ(1),M.expandByPoint(C);break;case 2:C.copy(S.slide.value),M.expandByPoint(C),C.setX(1),C.setZ(1),M.expandByPoint(C);break;case 3:C.copy(S.slide.value),M.expandByPoint(C),C.setX(1),C.setY(1),M.expandByPoint(C);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var M=new p.Vector3(0,0,0);this.morph.children.forEach(S=>{_(this.cachedBoundingBox,S.material.uniforms,M)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(M,S,C)=>{var A=new p.Matrix4;A.set(M[0],M[1],M[2],0,M[3],M[4],M[5],0,M[6],M[7],M[8],0,0,0,0,0);var R=new p.Quaternion().setFromRotationMatrix(A);this.morph.position.set(...S),this.morph.quaternion.copy(R),this.morph.scale.set(...C),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.initialise=(M,S)=>{if(M){var C=M.locations;C&&0<C.length&&(this.applyTransformation(C[0].orientation,C[0].position,C[0].scale),"flipY"in C[0]&&(T=C[0].flipY)),this.createSlides(M.settings.slides),S!=null&&typeof S=="function"&&S(this)}}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,h=`
3185
3185
  precision highp float;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/scaffoldvuer",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,7 +55,7 @@
55
55
  "vue": "^3.4.15",
56
56
  "vue-router": "^4.2.5",
57
57
  "vue3-component-svg-sprite": "^0.0.1",
58
- "zincjs": "^1.10.1"
58
+ "zincjs": "^1.10.2"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@vitejs/plugin-vue": "^4.6.2",