nolascoin commited on
Commit
874a2dc
·
1 Parent(s): 559611f

replaces scroll

Browse files
dist/assets/index-CN23FNcd.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{T as Pe,a as te,b as Ae,L as De,c as j,F as Te,M,V as xe,C as F,d as I,S as z,e as Fe,P as He,D as Re,f as W,g as D,I as ke,Q as Ee,h as Ge,O as Le,i as ve,j as Be,B as Y,k as Ue,l as we,N as je,m as Ke,n as Ve,o as ne,p as _e,R as se,q as Xe,r as ze,s as We,t as Q,u as qe,v as ye,w as Ye,x as U,y as Qe,z as Ze,A as Je,E as $e,G as et,H as tt,J as nt,K as st,U as Z,W as rt,X as it,Y as Se,Z as ot,_ as at,$ as ct,a0 as lt,a1 as Me,a2 as ut,a3 as ae,a4 as ce,a5 as le,a6 as ue,a7 as de,a8 as dt,a9 as ft,aa as be,ab as ht,ac as pt,ad as mt,ae as gt}from"./three-BBdsPnFb.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function e(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(n){if(n.ep)return;n.ep=!0;const r=e(n);fetch(n.href,r)}})();var K=function(){var d=0,t=document.createElement("div");t.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",t.addEventListener("click",function(u){u.preventDefault(),i(++d%t.children.length)},!1);function e(u){return t.appendChild(u.dom),u}function i(u){for(var l=0;l<t.children.length;l++)t.children[l].style.display=l===u?"block":"none";d=u}var n=(performance||Date).now(),r=n,s=0,a=e(new K.Panel("FPS","#0ff","#002")),o=e(new K.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=e(new K.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:t,addPanel:e,showPanel:i,begin:function(){n=(performance||Date).now()},end:function(){s++;var u=(performance||Date).now();if(o.update(u-n,200),u>=r+1e3&&(a.update(s*1e3/(u-r),100),r=u,s=0,c)){var l=performance.memory;c.update(l.usedJSHeapSize/1048576,l.jsHeapSizeLimit/1048576)}return u},update:function(){n=this.end()},domElement:t,setMode:i}};K.Panel=function(d,t,e){var i=1/0,n=0,r=Math.round,s=r(window.devicePixelRatio||1),a=80*s,o=48*s,c=3*s,u=2*s,l=3*s,f=15*s,h=74*s,m=30*s,T=document.createElement("canvas");T.width=a,T.height=o,T.style.cssText="width:80px;height:48px";var p=T.getContext("2d");return p.font="bold "+9*s+"px Helvetica,Arial,sans-serif",p.textBaseline="top",p.fillStyle=e,p.fillRect(0,0,a,o),p.fillStyle=t,p.fillText(d,c,u),p.fillRect(l,f,h,m),p.fillStyle=e,p.globalAlpha=.9,p.fillRect(l,f,h,m),{dom:T,update:function(g,R){i=Math.min(i,g),n=Math.max(n,g),p.fillStyle=e,p.globalAlpha=1,p.fillRect(0,0,a,f),p.fillStyle=t,p.fillText(r(g)+" "+d+" ("+r(i)+"-"+r(n)+")",c,u),p.drawImage(T,l+s,f,h-s,m,l,f,h-s,m),p.fillRect(l+h-s,f,s,m),p.fillStyle=e,p.globalAlpha=.9,p.fillRect(l+h-s,f,s,r((1-g/R)*m))}}};function fe(d,t){if(t===Pe)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),d;if(t===te||t===Ae){let e=d.getIndex();if(e===null){const s=[],a=d.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)s.push(o);d.setIndex(s),e=d.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),d}const i=e.count-2,n=[];if(t===te)for(let s=1;s<=i;s++)n.push(e.getX(0)),n.push(e.getX(s)),n.push(e.getX(s+1));else for(let s=0;s<i;s++)s%2===0?(n.push(e.getX(s)),n.push(e.getX(s+1)),n.push(e.getX(s+2))):(n.push(e.getX(s+2)),n.push(e.getX(s+1)),n.push(e.getX(s)));n.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const r=d.clone();return r.setIndex(n),r.clearGroups(),r}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),d}class At extends De{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new Lt(e)}),this.register(function(e){return new wt(e)}),this.register(function(e){return new Ct(e)}),this.register(function(e){return new Pt(e)}),this.register(function(e){return new Dt(e)}),this.register(function(e){return new yt(e)}),this.register(function(e){return new St(e)}),this.register(function(e){return new Mt(e)}),this.register(function(e){return new bt(e)}),this.register(function(e){return new Et(e)}),this.register(function(e){return new It(e)}),this.register(function(e){return new _t(e)}),this.register(function(e){return new Ot(e)}),this.register(function(e){return new Nt(e)}),this.register(function(e){return new xt(e)}),this.register(function(e){return new Ft(e)}),this.register(function(e){return new Ht(e)})}load(t,e,i,n){const r=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const c=j.extractUrlBase(t);s=j.resolveURL(c,this.path)}else s=j.extractUrlBase(t);this.manager.itemStart(t);const a=function(c){n?n(c):console.error(c),r.manager.itemError(t),r.manager.itemEnd(t)},o=new Te(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(c){try{r.parse(c,s,function(u){e(u),r.manager.itemEnd(t)},a)}catch(u){a(u)}},i,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,n){let r;const s={},a={},o=new TextDecoder;if(typeof t=="string")r=JSON.parse(t);else if(t instanceof ArrayBuffer)if(o.decode(new Uint8Array(t,0,4))===Ie){try{s[A.KHR_BINARY_GLTF]=new kt(t)}catch(l){n&&n(l);return}r=JSON.parse(s[A.KHR_BINARY_GLTF].content)}else r=JSON.parse(o.decode(t));else r=t;if(r.asset===void 0||r.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new Qt(r,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const l=this.pluginCallbacks[u](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,s[l.name]=!0}if(r.extensionsUsed)for(let u=0;u<r.extensionsUsed.length;++u){const l=r.extensionsUsed[u],f=r.extensionsRequired||[];switch(l){case A.KHR_MATERIALS_UNLIT:s[l]=new Rt;break;case A.KHR_DRACO_MESH_COMPRESSION:s[l]=new Gt(r,this.dracoLoader);break;case A.KHR_TEXTURE_TRANSFORM:s[l]=new vt;break;case A.KHR_MESH_QUANTIZATION:s[l]=new Bt;break;default:f.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(s),c.setPlugins(a),c.parse(i,n)}parseAsync(t,e){const i=this;return new Promise(function(n,r){i.parse(t,e,n,r)})}}function Tt(){let d={};return{get:function(t){return d[t]},add:function(t,e){d[t]=e},remove:function(t){delete d[t]},removeAll:function(){d={}}}}const A={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class xt{constructor(t){this.parser=t,this.name=A.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,n=e.length;i<n;i++){const r=e[i];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(t){const e=this.parser,i="light:"+t;let n=e.cache.get(i);if(n)return n;const r=e.json,o=((r.extensions&&r.extensions[this.name]||{}).lights||[])[t];let c;const u=new F(16777215);o.color!==void 0&&u.setRGB(o.color[0],o.color[1],o.color[2],I);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new Re(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new He(u),c.distance=l;break;case"spot":c=new Fe(u),c.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),b(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+t),n=Promise.resolve(c),e.cache.add(i,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){const e=this,i=this.parser,r=i.json.nodes[t],a=(r.extensions&&r.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return i._getNodeRef(e.cache,a,o)})}}class Rt{constructor(){this.name=A.KHR_MATERIALS_UNLIT}getMaterialType(){return U}extendParams(t,e,i){const n=[];t.color=new F(1,1,1),t.opacity=1;const r=e.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const s=r.baseColorFactor;t.color.setRGB(s[0],s[1],s[2],I),t.opacity=s[3]}r.baseColorTexture!==void 0&&n.push(i.assignTexture(t,"map",r.baseColorTexture,z))}return Promise.all(n)}}class Et{constructor(t){this.parser=t,this.name=A.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name].emissiveStrength;return r!==void 0&&(e.emissiveIntensity=r),Promise.resolve()}}class Lt{constructor(t){this.parser=t,this.name=A.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:M}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];if(s.clearcoatFactor!==void 0&&(e.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&r.push(i.assignTexture(e,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&r.push(i.assignTexture(e,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(r.push(i.assignTexture(e,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const a=s.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new xe(a,a)}return Promise.all(r)}}class wt{constructor(t){this.parser=t,this.name=A.KHR_MATERIALS_DISPERSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:M}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return e.dispersion=r.dispersion!==void 0?r.dispersion:0,Promise.resolve()}}class _t{constructor(t){this.parser=t,this.name=A.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:M}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];return s.iridescenceFactor!==void 0&&(e.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&r.push(i.assignTexture(e,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(e.iridescenceIOR=s.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&r.push(i.assignTexture(e,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(r)}}class yt{constructor(t){this.parser=t,this.name=A.KHR_MATERIALS_SHEEN}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:M}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[];e.sheenColor=new F(0,0,0),e.sheenRoughness=0,e.sheen=1;const s=n.extensions[this.name];if(s.sheenColorFactor!==void 0){const a=s.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],I)}return s.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&r.push(i.assignTexture(e,"sheenColorMap",s.sheenColorTexture,z)),s.sheenRoughnessTexture!==void 0&&r.push(i.assignTexture(e,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(r)}}class St{constructor(t){this.parser=t,this.name=A.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:M}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];return s.transmissionFactor!==void 0&&(e.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&r.push(i.assignTexture(e,"transmissionMap",s.transmissionTexture)),Promise.all(r)}}class Mt{constructor(t){this.parser=t,this.name=A.KHR_MATERIALS_VOLUME}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:M}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];e.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&r.push(i.assignTexture(e,"thicknessMap",s.thicknessTexture)),e.attenuationDistance=s.attenuationDistance||1/0;const a=s.attenuationColor||[1,1,1];return e.attenuationColor=new F().setRGB(a[0],a[1],a[2],I),Promise.all(r)}}class bt{constructor(t){this.parser=t,this.name=A.KHR_MATERIALS_IOR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:M}extendMaterialParams(t,e){const n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return e.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}}class It{constructor(t){this.parser=t,this.name=A.KHR_MATERIALS_SPECULAR}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:M}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];e.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&r.push(i.assignTexture(e,"specularIntensityMap",s.specularTexture));const a=s.specularColorFactor||[1,1,1];return e.specularColor=new F().setRGB(a[0],a[1],a[2],I),s.specularColorTexture!==void 0&&r.push(i.assignTexture(e,"specularColorMap",s.specularColorTexture,z)),Promise.all(r)}}class Nt{constructor(t){this.parser=t,this.name=A.EXT_MATERIALS_BUMP}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:M}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];return e.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&r.push(i.assignTexture(e,"bumpMap",s.bumpTexture)),Promise.all(r)}}class Ot{constructor(t){this.parser=t,this.name=A.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){const i=this.parser.json.materials[t];return!i.extensions||!i.extensions[this.name]?null:M}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];return s.anisotropyStrength!==void 0&&(e.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(e.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&r.push(i.assignTexture(e,"anisotropyMap",s.anisotropyTexture)),Promise.all(r)}}class Ct{constructor(t){this.parser=t,this.name=A.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,i=e.json,n=i.textures[t];if(!n.extensions||!n.extensions[this.name])return null;const r=n.extensions[this.name],s=e.options.ktx2Loader;if(!s){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,r.source,s)}}class Pt{constructor(t){this.parser=t,this.name=A.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,n=i.json,r=n.textures[t];if(!r.extensions||!r.extensions[e])return null;const s=r.extensions[e],a=n.images[s.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(t,s.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}}class Dt{constructor(t){this.parser=t,this.name=A.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,n=i.json,r=n.textures[t];if(!r.extensions||!r.extensions[e])return null;const s=r.extensions[e],a=n.images[s.source];let o=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(o=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(t,s.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}}class Ft{constructor(t){this.name=A.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const n=i.extensions[this.name],r=this.parser.getDependency("buffer",n.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const o=n.byteOffset||0,c=n.byteLength||0,u=n.count,l=n.byteStride,f=new Uint8Array(a,o,c);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(u,l,f,n.mode,n.filter).then(function(h){return h.buffer}):s.ready.then(function(){const h=new ArrayBuffer(u*l);return s.decodeGltfBuffer(new Uint8Array(h),u,l,f,n.mode,n.filter),h})})}else return null}}class Ht{constructor(t){this.name=A.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,i=e.nodes[t];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const n=e.meshes[i.mesh];for(const c of n.primitives)if(c.mode!==L.TRIANGLES&&c.mode!==L.TRIANGLE_STRIP&&c.mode!==L.TRIANGLE_FAN&&c.mode!==void 0)return null;const s=i.extensions[this.name].attributes,a=[],o={};for(const c in s)a.push(this.parser.getDependency("accessor",s[c]).then(u=>(o[c]=u,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{const u=c.pop(),l=u.isGroup?u.children:[u],f=c[0].count,h=[];for(const m of l){const T=new W,p=new D,g=new Ee,R=new D(1,1,1),E=new ke(m.geometry,m.material,f);for(let x=0;x<f;x++)o.TRANSLATION&&p.fromBufferAttribute(o.TRANSLATION,x),o.ROTATION&&g.fromBufferAttribute(o.ROTATION,x),o.SCALE&&R.fromBufferAttribute(o.SCALE,x),E.setMatrixAt(x,T.compose(p,g,R));for(const x in o)if(x==="_COLOR_0"){const y=o[x];E.instanceColor=new Ge(y.array,y.itemSize,y.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&m.geometry.setAttribute(x,o[x]);Le.prototype.copy.call(E,m),this.parser.assignFinalMaterial(E),h.push(E)}return u.isGroup?(u.clear(),u.add(...h),u):h[0]}))}}const Ie="glTF",B=12,he={JSON:1313821514,BIN:5130562};class kt{constructor(t){this.name=A.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,B),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Ie)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-B,r=new DataView(t,B);let s=0;for(;s<n;){const a=r.getUint32(s,!0);s+=4;const o=r.getUint32(s,!0);if(s+=4,o===he.JSON){const c=new Uint8Array(t,B+s,a);this.content=i.decode(c)}else if(o===he.BIN){const c=B+s;this.body=t.slice(c,c+a)}s+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Gt{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=A.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const i=this.json,n=this.dracoLoader,r=t.extensions[this.name].bufferView,s=t.extensions[this.name].attributes,a={},o={},c={};for(const u in s){const l=re[u]||u.toLowerCase();a[l]=s[u]}for(const u in t.attributes){const l=re[u]||u.toLowerCase();if(s[u]!==void 0){const f=i.accessors[t.attributes[u]],h=k[f.componentType];c[l]=h.name,o[l]=f.normalized===!0}}return e.getDependency("bufferView",r).then(function(u){return new Promise(function(l,f){n.decodeDracoFile(u,function(h){for(const m in h.attributes){const T=h.attributes[m],p=o[m];p!==void 0&&(T.normalized=p)}l(h)},a,c,I,f)})})}}class vt{constructor(){this.name=A.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class Bt{constructor(){this.name=A.KHR_MESH_QUANTIZATION}}class Ne extends ft{constructor(t,e,i,n){super(t,e,i,n)}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n*3+n;for(let s=0;s!==n;s++)e[s]=i[r+s];return e}interpolate_(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,u=n-e,l=(i-e)/u,f=l*l,h=f*l,m=t*c,T=m-c,p=-2*h+3*f,g=h-f,R=1-p,E=g-f+l;for(let x=0;x!==a;x++){const y=s[T+x+a],N=s[T+x+o]*u,_=s[m+x+a],v=s[m+x]*u;r[x]=R*y+E*N+p*_+g*v}return r}}const Ut=new Ee;class jt extends Ne{interpolate_(t,e,i,n){const r=super.interpolate_(t,e,i,n);return Ut.fromArray(r).normalize().toArray(r),r}}const L={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},k={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},pe={9728:_e,9729:ne,9984:Ve,9985:Ke,9986:je,9987:we},me={33071:ze,33648:Xe,10497:se},J={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},re={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},C={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Kt={CUBICSPLINE:void 0,LINEAR:Me,STEP:lt},$={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Vt(d){return d.DefaultMaterial===void 0&&(d.DefaultMaterial=new ye({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:dt})),d.DefaultMaterial}function P(d,t,e){for(const i in e.extensions)d[i]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=e.extensions[i])}function b(d,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(d.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function Xt(d,t,e){let i=!1,n=!1,r=!1;for(let c=0,u=t.length;c<u;c++){const l=t[c];if(l.POSITION!==void 0&&(i=!0),l.NORMAL!==void 0&&(n=!0),l.COLOR_0!==void 0&&(r=!0),i&&n&&r)break}if(!i&&!n&&!r)return Promise.resolve(d);const s=[],a=[],o=[];for(let c=0,u=t.length;c<u;c++){const l=t[c];if(i){const f=l.POSITION!==void 0?e.getDependency("accessor",l.POSITION):d.attributes.position;s.push(f)}if(n){const f=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):d.attributes.normal;a.push(f)}if(r){const f=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):d.attributes.color;o.push(f)}}return Promise.all([Promise.all(s),Promise.all(a),Promise.all(o)]).then(function(c){const u=c[0],l=c[1],f=c[2];return i&&(d.morphAttributes.position=u),n&&(d.morphAttributes.normal=l),r&&(d.morphAttributes.color=f),d.morphTargetsRelative=!0,d})}function zt(d,t){if(d.updateMorphTargets(),t.weights!==void 0)for(let e=0,i=t.weights.length;e<i;e++)d.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){const e=t.extras.targetNames;if(d.morphTargetInfluences.length===e.length){d.morphTargetDictionary={};for(let i=0,n=e.length;i<n;i++)d.morphTargetDictionary[e[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Wt(d){let t;const e=d.extensions&&d.extensions[A.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+ee(e.attributes):t=d.indices+":"+ee(d.attributes)+":"+d.mode,d.targets!==void 0)for(let i=0,n=d.targets.length;i<n;i++)t+=":"+ee(d.targets[i]);return t}function ee(d){let t="";const e=Object.keys(d).sort();for(let i=0,n=e.length;i<n;i++)t+=e[i]+":"+d[e[i]]+";";return t}function ie(d){switch(d){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.")}}function qt(d){return d.search(/\.jpe?g($|\?)/i)>0||d.search(/^data\:image\/jpeg/)===0?"image/jpeg":d.search(/\.webp($|\?)/i)>0||d.search(/^data\:image\/webp/)===0?"image/webp":d.search(/\.ktx2($|\?)/i)>0||d.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Yt=new W;class Qt{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new Tt,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,n=-1,r=!1,s=-1;if(typeof navigator<"u"){const a=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(a)===!0;const o=a.match(/Version\/(\d+)/);n=i&&o?parseInt(o[1],10):-1,r=a.indexOf("Firefox")>-1,s=r?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&n<17||r&&s<98?this.textureLoader=new ve(this.options.manager):this.textureLoader=new Be(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Te(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,n=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(s){const a={scene:s[0][n.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:n.asset,parser:i,userData:{}};return P(r,a,n),b(a,n),Promise.all(i._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(const o of a.scenes)o.updateMatrixWorld();t(a)})}).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let n=0,r=e.length;n<r;n++){const s=e[n].joints;for(let a=0,o=s.length;a<o;a++)t[s[a]].isBone=!0}for(let n=0,r=t.length;n<r;n++){const s=t[n];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(i[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,i){if(t.refs[e]<=1)return i;const n=i.clone(),r=(s,a)=>{const o=this.associations.get(s);o!=null&&this.associations.set(a,o);for(const[c,u]of s.children.entries())r(u,a.children[c])};return r(i,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i<e.length;i++){const n=t(e[i]);if(n)return n}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const i=[];for(let n=0;n<e.length;n++){const r=t(e[n]);r&&i.push(r)}return i}getDependency(t,e){const i=t+":"+e;let n=this.cache.get(i);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this._invokeOne(function(r){return r.loadNode&&r.loadNode(e)});break;case"mesh":n=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(e)});break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(e)});break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(e)});break;case"texture":n=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(e)});break;case"skin":n=this.loadSkin(e);break;case"animation":n=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(e)});break;case"camera":n=this.loadCamera(e);break;default:if(n=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(t,e)}),!n)throw new Error("Unknown type: "+t);break}this.cache.add(i,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){const i=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(r,s){return i.getDependency(t,s)})),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],i=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[A.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(r,s){i.load(j.resolveURL(e.uri,n.path),r,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){const e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(i){const n=e.byteLength||0,r=e.byteOffset||0;return i.slice(r,r+n)})}loadAccessor(t){const e=this,i=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){const s=J[n.type],a=k[n.componentType],o=n.normalized===!0,c=new a(n.count*s);return Promise.resolve(new Y(c,s,o))}const r=[];return n.bufferView!==void 0?r.push(this.getDependency("bufferView",n.bufferView)):r.push(null),n.sparse!==void 0&&(r.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(r).then(function(s){const a=s[0],o=J[n.type],c=k[n.componentType],u=c.BYTES_PER_ELEMENT,l=u*o,f=n.byteOffset||0,h=n.bufferView!==void 0?i.bufferViews[n.bufferView].byteStride:void 0,m=n.normalized===!0;let T,p;if(h&&h!==l){const g=Math.floor(f/h),R="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+g+":"+n.count;let E=e.cache.get(R);E||(T=new c(a,g*h,n.count*h/u),E=new Ue(T,h/u),e.cache.add(R,E)),p=new ut(E,o,f%h/u,m)}else a===null?T=new c(n.count*o):T=new c(a,f,n.count*o),p=new Y(T,o,m);if(n.sparse!==void 0){const g=J.SCALAR,R=k[n.sparse.indices.componentType],E=n.sparse.indices.byteOffset||0,x=n.sparse.values.byteOffset||0,y=new R(s[1],E,n.sparse.count*g),N=new c(s[2],x,n.sparse.count*o);a!==null&&(p=new Y(p.array.slice(),p.itemSize,p.normalized)),p.normalized=!1;for(let _=0,v=y.length;_<v;_++){const O=y[_];if(p.setX(O,N[_*o]),o>=2&&p.setY(O,N[_*o+1]),o>=3&&p.setZ(O,N[_*o+2]),o>=4&&p.setW(O,N[_*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}p.normalized=m}return p})}loadTexture(t){const e=this.json,i=this.options,r=e.textures[t].source,s=e.images[r];let a=this.textureLoader;if(s.uri){const o=i.manager.getHandler(s.uri);o!==null&&(a=o)}return this.loadTextureImage(t,r,a)}loadTextureImage(t,e,i){const n=this,r=this.json,s=r.textures[t],a=r.images[e],o=(a.uri||a.bufferView)+":"+s.sampler;if(this.textureCache[o])return this.textureCache[o];const c=this.loadImageSource(e,i).then(function(u){u.flipY=!1,u.name=s.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const f=(r.samplers||{})[s.sampler]||{};return u.magFilter=pe[f.magFilter]||ne,u.minFilter=pe[f.minFilter]||we,u.wrapS=me[f.wrapS]||se,u.wrapT=me[f.wrapT]||se,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==_e&&u.minFilter!==ne,n.associations.set(u,{textures:t}),u}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(t,e){const i=this,n=this.json,r=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(l=>l.clone());const s=n.images[t],a=self.URL||self.webkitURL;let o=s.uri||"",c=!1;if(s.bufferView!==void 0)o=i.getDependency("bufferView",s.bufferView).then(function(l){c=!0;const f=new Blob([l],{type:s.mimeType});return o=a.createObjectURL(f),o});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const u=Promise.resolve(o).then(function(l){return new Promise(function(f,h){let m=f;e.isImageBitmapLoader===!0&&(m=function(T){const p=new ae(T);p.needsUpdate=!0,f(p)}),e.load(j.resolveURL(l,r.path),m,void 0,h)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),b(l,s),l.userData.mimeType=s.mimeType||qt(s.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),l});return this.sourceCache[t]=u,u}assignTexture(t,e,i,n){const r=this;return this.getDependency("texture",i.index).then(function(s){if(!s)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(s=s.clone(),s.channel=i.texCoord),r.extensions[A.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[A.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const o=r.associations.get(s);s=r.extensions[A.KHR_TEXTURE_TRANSFORM].extendTexture(s,a),r.associations.set(s,o)}}return n!==void 0&&(s.colorSpace=n),t[e]=s,s})}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const n=e.attributes.tangent===void 0,r=e.attributes.color!==void 0,s=e.attributes.normal===void 0;if(t.isPoints){const a="PointsMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new We,Q.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,o.sizeAttenuation=!1,this.cache.add(a,o)),i=o}else if(t.isLine){const a="LineBasicMaterial:"+i.uuid;let o=this.cache.get(a);o||(o=new qe,Q.prototype.copy.call(o,i),o.color.copy(i.color),o.map=i.map,this.cache.add(a,o)),i=o}if(n||r||s){let a="ClonedMaterial:"+i.uuid+":";n&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),s&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=i.clone(),r&&(o.vertexColors=!0),s&&(o.flatShading=!0),n&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(i))),i=o}t.material=i}getMaterialType(){return ye}loadMaterial(t){const e=this,i=this.json,n=this.extensions,r=i.materials[t];let s;const a={},o=r.extensions||{},c=[];if(o[A.KHR_MATERIALS_UNLIT]){const l=n[A.KHR_MATERIALS_UNLIT];s=l.getMaterialType(),c.push(l.extendParams(a,r,e))}else{const l=r.pbrMetallicRoughness||{};if(a.color=new F(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const f=l.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],I),a.opacity=f[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,z)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),s=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(t,a)})))}r.doubleSided===!0&&(a.side=Ye);const u=r.alphaMode||$.OPAQUE;if(u===$.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===$.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&s!==U&&(c.push(e.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new xe(1,1),r.normalTexture.scale!==void 0)){const l=r.normalTexture.scale;a.normalScale.set(l,l)}if(r.occlusionTexture!==void 0&&s!==U&&(c.push(e.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&s!==U){const l=r.emissiveFactor;a.emissive=new F().setRGB(l[0],l[1],l[2],I)}return r.emissiveTexture!==void 0&&s!==U&&c.push(e.assignTexture(a,"emissiveMap",r.emissiveTexture,z)),Promise.all(c).then(function(){const l=new s(a);return r.name&&(l.name=r.name),b(l,r),e.associations.set(l,{materials:t}),r.extensions&&P(n,l,r),l})}createUniqueName(t){const e=Qe.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,i=this.extensions,n=this.primitiveCache;function r(a){return i[A.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return ge(o,a,e)})}const s=[];for(let a=0,o=t.length;a<o;a++){const c=t[a],u=Wt(c),l=n[u];if(l)s.push(l.promise);else{let f;c.extensions&&c.extensions[A.KHR_DRACO_MESH_COMPRESSION]?f=r(c):f=ge(new Ze,c,e),n[u]={primitive:c,promise:f},s.push(f)}}return Promise.all(s)}loadMesh(t){const e=this,i=this.json,n=this.extensions,r=i.meshes[t],s=r.primitives,a=[];for(let o=0,c=s.length;o<c;o++){const u=s[o].material===void 0?Vt(this.cache):this.getDependency("material",s[o].material);a.push(u)}return a.push(e.loadGeometries(s)),Promise.all(a).then(function(o){const c=o.slice(0,o.length-1),u=o[o.length-1],l=[];for(let h=0,m=u.length;h<m;h++){const T=u[h],p=s[h];let g;const R=c[h];if(p.mode===L.TRIANGLES||p.mode===L.TRIANGLE_STRIP||p.mode===L.TRIANGLE_FAN||p.mode===void 0)g=r.isSkinnedMesh===!0?new Je(T,R):new $e(T,R),g.isSkinnedMesh===!0&&g.normalizeSkinWeights(),p.mode===L.TRIANGLE_STRIP?g.geometry=fe(g.geometry,Ae):p.mode===L.TRIANGLE_FAN&&(g.geometry=fe(g.geometry,te));else if(p.mode===L.LINES)g=new et(T,R);else if(p.mode===L.LINE_STRIP)g=new tt(T,R);else if(p.mode===L.LINE_LOOP)g=new nt(T,R);else if(p.mode===L.POINTS)g=new st(T,R);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+p.mode);Object.keys(g.geometry.morphAttributes).length>0&&zt(g,r),g.name=e.createUniqueName(r.name||"mesh_"+t),b(g,r),p.extensions&&P(n,g,p),e.assignFinalMaterial(g),l.push(g)}for(let h=0,m=l.length;h<m;h++)e.associations.set(l[h],{meshes:t,primitives:h});if(l.length===1)return r.extensions&&P(n,l[0],r),l[0];const f=new Z;r.extensions&&P(n,f,r),e.associations.set(f,{meshes:t});for(let h=0,m=l.length;h<m;h++)f.add(l[h]);return f})}loadCamera(t){let e;const i=this.json.cameras[t],n=i[i.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?e=new rt(it.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):i.type==="orthographic"&&(e=new Se(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),i.name&&(e.name=this.createUniqueName(i.name)),b(e,i),Promise.resolve(e)}loadSkin(t){const e=this.json.skins[t],i=[];for(let n=0,r=e.joints.length;n<r;n++)i.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",e.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(n){const r=n.pop(),s=n,a=[],o=[];for(let c=0,u=s.length;c<u;c++){const l=s[c];if(l){a.push(l);const f=new W;r!==null&&f.fromArray(r.array,c*16),o.push(f)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new ot(a,o)})}loadAnimation(t){const e=this.json,i=this,n=e.animations[t],r=n.name?n.name:"animation_"+t,s=[],a=[],o=[],c=[],u=[];for(let l=0,f=n.channels.length;l<f;l++){const h=n.channels[l],m=n.samplers[h.sampler],T=h.target,p=T.node,g=n.parameters!==void 0?n.parameters[m.input]:m.input,R=n.parameters!==void 0?n.parameters[m.output]:m.output;T.node!==void 0&&(s.push(this.getDependency("node",p)),a.push(this.getDependency("accessor",g)),o.push(this.getDependency("accessor",R)),c.push(m),u.push(T))}return Promise.all([Promise.all(s),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(u)]).then(function(l){const f=l[0],h=l[1],m=l[2],T=l[3],p=l[4],g=[];for(let R=0,E=f.length;R<E;R++){const x=f[R],y=h[R],N=m[R],_=T[R],v=p[R];if(x===void 0)continue;x.updateMatrix&&x.updateMatrix();const O=i._createAnimationTracks(x,y,N,_,v);if(O)for(let q=0;q<O.length;q++)g.push(O[q])}return new at(r,void 0,g)})}createNodeMesh(t){const e=this.json,i=this,n=e.nodes[t];return n.mesh===void 0?null:i.getDependency("mesh",n.mesh).then(function(r){const s=i._getNodeRef(i.meshCache,n.mesh,r);return n.weights!==void 0&&s.traverse(function(a){if(a.isMesh)for(let o=0,c=n.weights.length;o<c;o++)a.morphTargetInfluences[o]=n.weights[o]}),s})}loadNode(t){const e=this.json,i=this,n=e.nodes[t],r=i._loadNodeShallow(t),s=[],a=n.children||[];for(let c=0,u=a.length;c<u;c++)s.push(i.getDependency("node",a[c]));const o=n.skin===void 0?Promise.resolve(null):i.getDependency("skin",n.skin);return Promise.all([r,Promise.all(s),o]).then(function(c){const u=c[0],l=c[1],f=c[2];f!==null&&u.traverse(function(h){h.isSkinnedMesh&&h.bind(f,Yt)});for(let h=0,m=l.length;h<m;h++)u.add(l[h]);return u})}_loadNodeShallow(t){const e=this.json,i=this.extensions,n=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];const r=e.nodes[t],s=r.name?n.createUniqueName(r.name):"",a=[],o=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return o&&a.push(o),r.camera!==void 0&&a.push(n.getDependency("camera",r.camera).then(function(c){return n._getNodeRef(n.cameraCache,r.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let u;if(r.isBone===!0?u=new ct:c.length>1?u=new Z:c.length===1?u=c[0]:u=new Le,u!==c[0])for(let l=0,f=c.length;l<f;l++)u.add(c[l]);if(r.name&&(u.userData.name=r.name,u.name=s),b(u,r),r.extensions&&P(i,u,r),r.matrix!==void 0){const l=new W;l.fromArray(r.matrix),u.applyMatrix4(l)}else r.translation!==void 0&&u.position.fromArray(r.translation),r.rotation!==void 0&&u.quaternion.fromArray(r.rotation),r.scale!==void 0&&u.scale.fromArray(r.scale);return n.associations.has(u)||n.associations.set(u,{}),n.associations.get(u).nodes=t,u}),this.nodeCache[t]}loadScene(t){const e=this.extensions,i=this.json.scenes[t],n=this,r=new Z;i.name&&(r.name=n.createUniqueName(i.name)),b(r,i),i.extensions&&P(e,r,i);const s=i.nodes||[],a=[];for(let o=0,c=s.length;o<c;o++)a.push(n.getDependency("node",s[o]));return Promise.all(a).then(function(o){for(let u=0,l=o.length;u<l;u++)r.add(o[u]);const c=u=>{const l=new Map;for(const[f,h]of n.associations)(f instanceof Q||f instanceof ae)&&l.set(f,h);return u.traverse(f=>{const h=n.associations.get(f);h!=null&&l.set(f,h)}),l};return n.associations=c(r),r})}_createAnimationTracks(t,e,i,n,r){const s=[],a=t.name?t.name:t.uuid,o=[];C[r.path]===C.weights?t.traverse(function(f){f.morphTargetInfluences&&o.push(f.name?f.name:f.uuid)}):o.push(a);let c;switch(C[r.path]){case C.weights:c=le;break;case C.rotation:c=ue;break;case C.translation:case C.scale:c=ce;break;default:switch(i.itemSize){case 1:c=le;break;case 2:case 3:default:c=ce;break}break}const u=n.interpolation!==void 0?Kt[n.interpolation]:Me,l=this._getArrayFromAccessor(i);for(let f=0,h=o.length;f<h;f++){const m=new c(o[f]+"."+C[r.path],e.array,l,u);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),s.push(m)}return s}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){const i=ie(e.constructor),n=new Float32Array(e.length);for(let r=0,s=e.length;r<s;r++)n[r]=e[r]*i;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=function(i){const n=this instanceof ue?jt:Ne;return new n(this.times,this.values,this.getValueSize()/3,i)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Zt(d,t,e){const i=t.attributes,n=new be;if(i.POSITION!==void 0){const a=e.json.accessors[i.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(n.set(new D(o[0],o[1],o[2]),new D(c[0],c[1],c[2])),a.normalized){const u=ie(k[a.componentType]);n.min.multiplyScalar(u),n.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const r=t.targets;if(r!==void 0){const a=new D,o=new D;for(let c=0,u=r.length;c<u;c++){const l=r[c];if(l.POSITION!==void 0){const f=e.json.accessors[l.POSITION],h=f.min,m=f.max;if(h!==void 0&&m!==void 0){if(o.setX(Math.max(Math.abs(h[0]),Math.abs(m[0]))),o.setY(Math.max(Math.abs(h[1]),Math.abs(m[1]))),o.setZ(Math.max(Math.abs(h[2]),Math.abs(m[2]))),f.normalized){const T=ie(k[f.componentType]);o.multiplyScalar(T)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}d.boundingBox=n;const s=new ht;n.getCenter(s.center),s.radius=n.min.distanceTo(n.max)/2,d.boundingSphere=s}function ge(d,t,e){const i=t.attributes,n=[];function r(s,a){return e.getDependency("accessor",s).then(function(o){d.setAttribute(a,o)})}for(const s in i){const a=re[s]||s.toLowerCase();a in d.attributes||n.push(r(i[s],a))}if(t.indices!==void 0&&!d.index){const s=e.getDependency("accessor",t.indices).then(function(a){d.setIndex(a)});n.push(s)}return de.workingColorSpace!==I&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${de.workingColorSpace}" not supported.`),b(d,t),Zt(d,t,e),Promise.all(n).then(function(){return t.targets!==void 0?Xt(d,t.targets,e):d})}class Jt{gltfLoader;constructor(){this.gltfLoader=new At}loadGLB(t){return new Promise((e,i)=>{this.gltfLoader.load(t,n=>e(n.scene),void 0,n=>i(n))})}async loadAssets(t){const e=Object.entries(t).map(([r,s])=>this.loadGLB(s).then(a=>({key:r,asset:a}))),i=await Promise.all(e),n={};return i.forEach(({key:r,asset:s})=>{n[r]=s}),n}}const $t=d=>{const t=document.getElementById(d);t&&(t.style.opacity="0",setTimeout(()=>t.style.display="none",500))};let V=window.innerHeight,X=window.innerWidth,H,w,oe,S,G={};const en={plane:"/plane.glb",middleObject:"/apollo13.glb"},tn=async()=>{G=await new Jt().loadAssets(en)},Oe=(d,t,e)=>{const i=new be().setFromObject(d),n=new D;i.getSize(n);const r=e.right-e.left,s=e.top-e.bottom,a=Math.ceil(r/n.x)+1,o=Math.ceil(s/n.z);for(let c=0;c<o;c++)for(let u=0;u<a;u++){const l=d.clone();l.position.set(u*n.x-r/2+n.x/2,0,c*n.z-s/2+n.z/2),l.isPlaneTile=!0,t.add(l)}return n},nn=async d=>{const t=X/V,e=5;S=new pt,oe=new K,w=new Se(e*t/-2,e*t/2,e/2,e/-2,.1,1e4),w.position.set(0,10,0),w.lookAt(0,0,0),H=new mt({antialias:!0,alpha:!0}),H.setSize(X,V),H.shadowMap.enabled=!0;const i=document.getElementById(d);i&&i.appendChild(H.domElement),document.body.appendChild(oe.dom),window.addEventListener("resize",rn,!1);const n=G.middleObject;n.scale.set(.2,.2,.2),n.position.set(0,2,0),S.add(n),$t("loader")},sn=(d,t)=>{let e;return(...i)=>{clearTimeout(e),e=setTimeout(()=>d(...i),t)}},rn=sn(()=>{V=window.innerHeight,X=window.innerWidth;const d=X/V,t=5;w.left=-5*d/2,w.right=t*d/2,w.top=t/2,w.bottom=-5/2,w.updateProjectionMatrix(),H.setSize(X,V),on()},100),on=()=>{S.children=S.children.filter(t=>!t.isPlaneTile);const d=G.plane;d&&Oe(d,S,w)},an=(d,t,e)=>{const i=e.right-e.left;d.children.forEach(n=>{n.isPlaneTile&&t&&(n.position.x-=.005,n.position.x<-i/2-t.x/2&&(n.position.x+=i+t.x))})},cn=()=>{const d=new gt(16777215,2);S.add(d);const t=new Re(16777215,1);t.position.set(10,20,20),S.add(t)},Ce=d=>{requestAnimationFrame(()=>Ce(d)),an(S,d,w),G.middleObject.rotation.x+=.02,G.middleObject.rotation.y+=.01,oe.update(),H.render(S,w)},ln=async()=>{await tn(),await nn("app"),cn();const d=Oe(G.plane,S,w);Ce(d)};await ln();
dist/assets/index-CN23FNcd.js.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ebb75bc50e5ffc5dbd6882fec02fb731b23edcd7bb54ff89762d019f164a7456
3
+ size 15750
dist/index.html CHANGED
@@ -36,7 +36,7 @@
36
  transition: opacity 0.5s ease;
37
  }
38
  </style>
39
- <script type="module" crossorigin src="/assets/index-Csdf6onh.js"></script>
40
  <link rel="modulepreload" crossorigin href="/assets/three-BBdsPnFb.js">
41
  </head>
42
  <body>
 
36
  transition: opacity 0.5s ease;
37
  }
38
  </style>
39
+ <script type="module" crossorigin src="/assets/index-CN23FNcd.js"></script>
40
  <link rel="modulepreload" crossorigin href="/assets/three-BBdsPnFb.js">
41
  </head>
42
  <body>
dist/index.html.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:bc6421959706ee29e3fb72cfe7c4b8c9fe0d2a852324ce511eabe046e566ce42
3
- size 550
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f459036e24bdd3e69f1542d5c9eadb7fb65b1cc691b30ca25fbe32b161efe1c
3
+ size 552