New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@loaders.gl/gltf

Package Overview
Dependencies
Maintainers
10
Versions
343
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/gltf - npm Package Compare versions

Comparing version 2.1.0-alpha.8 to 2.1.0-beta.1

2

dist/dist.min.js

@@ -1,1 +0,1 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(r,s,function(t){return e[t]}.bind(null,s));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([,function(e,t,n){"use strict";(function(e,r){n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));const s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},i=s.global||s.self||s.window,o="object"!=typeof r||"[object process]"!==String(r)||r.browser,a=void 0!==r&&r.version&&r.version.match(/v([0-9]*)/);a&&parseFloat(a[1])}).call(this,n(3),n(5))},,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(t){const r=n(6),s="undefined"==typeof window?t:window;s.loaders=s.loaders||{},e.exports=Object.assign(s.loaders,r)}).call(this,n(3))},function(e,t){var n,r,s=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,f=[],c=!1,h=-1;function g(){c&&u&&(c=!1,u.length?f=u.concat(f):h=-1,f.length&&l())}function l(){if(!c){var e=a(g);c=!0;for(var t=f.length;t;){for(u=f,f=[];++h<t;)u&&u[h].run();h=-1,t=f.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new d(e,t)),1!==f.length||c||a(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=m,s.addListener=m,s.once=m,s.off=m,s.removeListener=m,s.removeAllListeners=m,s.emit=m,s.prependListener=m,s.prependOnceListener=m,s.listeners=function(e){return[]},s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"decode",(function(){return ne})),n.d(r,"encode",(function(){return re}));var s={};n.r(s),n.d(s,"decode",(function(){return oe})),n.d(s,"encode",(function(){return ae}));var i={};n.r(i),n.d(i,"decode",(function(){return ue})),n.d(i,"encode",(function(){return fe}));var o={};n.r(o),n.d(o,"decode",(function(){return ce})),n.d(o,"encode",(function(){return he}));const a="KHR_draco_mesh_compression",u="KHR_lights_punctual",f="KHR_materials_unlit",c="KHR_techniques_webgl";function h(e,t){if(!e)throw new Error(t)}var g=n(1);const{_parseImageNode:l}=g.a,d="undefined"!=typeof Image,m="undefined"!=typeof ImageBitmap,b=Boolean(l);function y(e){switch(e){case"auto":return m||d||b;case"imagebitmap":return m;case"html":case"image":return d;case"ndarray":case"data":return!!g.b||b;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function p(e){const t=w(e);if(!t)throw new Error("Not an image");return t}function w(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"==typeof e&&e.data&&e.width&&e.height?"data":null}const x=/^data:image\/svg\+xml/,j=/\.svg((\?|#).*)?$/;function T(e,t){return v(t)?(console.warn("SVG cannot be parsed to imagebitmap"),new Blob([new Uint8Array(e)],{type:"image/svg+xml"})):new Blob([new Uint8Array(e)])}function v(e){return e&&(x.test(e)||j.test(e))}async function E(e,t,n){const r=function(e,t){if(v(t)){const t=(new TextDecoder).decode(e);return`data:image/svg+xml;base64,${btoa(t)}`}return T(e,t)}(e,n),s=self.URL||self.webkitURL,i="string"!=typeof r&&s.createObjectURL(r);try{return await async function(e,t){const n=new Image;if(n.src=e,t.image&&t.image.decode&&n.decode)return await n.decode(),n;return await new Promise((t,r)=>{try{n.onload=()=>t(n),n.onerror=t=>r(new Error(`Could not load image ${e}: ${t}`))}catch(e){r(e)}})}(i||r,t)}finally{i&&s.revokeObjectURL(i)}}let _=!0;async function A(e,t,n){const r=T(e,n);let s=t&&t.imagebitmap;if(!function(e){for(const t in e||B)return!0;return!1}(s)&&_||(s=null),s)try{return await createImageBitmap(r,s)}catch(e){console.warn(e),_=!1}return await createImageBitmap(r)}const B={};const U=!1,L=!0,O=new Map([["image/png",{test:R,getSize:function(e){return{width:e.getUint32(16,U),height:e.getUint32(20,U)}}}],["image/jpeg",{test:I,getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,U))return null;const{tableMarkers:t,sofMarkers:n}=function(){const e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);const t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}();let r=2;for(;r<e.byteLength;){const s=e.getUint16(r,U);if(n.has(s))return{height:e.getUint16(r+5,U),width:e.getUint16(r+7,U)};if(!t.has(s))return null;r+=2,r+=e.getUint16(r,U)}return null}}],["image/gif",{test:V,getSize:function(e){return{width:e.getUint16(6,L),height:e.getUint16(8,L)}}}],["image/bmp",{test:S,getSize:function(e){return{width:e.getUint32(18,L),height:e.getUint32(22,L)}}}]]);function R(e){return e.byteLength>=24&&2303741511===e.getUint32(0,U)}function V(e){return e.byteLength>=10&&1195984440===e.getUint32(0,U)}function S(e){return e.byteLength>=14&&16973===e.getUint16(0,U)&&e.getUint32(2,L)===e.byteLength}function I(e){return e.byteLength>=3&&65496===e.getUint16(0,U)&&255===e.getUint8(2,U)}Array.from(O.keys()).join(", ");function C(e){const t=M(e);for(const[e,{test:n}]of O.entries())if(n(t))return e;return null}function M(e){if((e=e.buffer||e)instanceof ArrayBuffer)return new DataView(e);if(ArrayBuffer.isView(e))return new DataView(e.buffer);throw new Error("toDataView")}var k={name:"Images",version:"2.1.0-alpha.8",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vndmicrosofticon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(e,t,n){const r=((t=t||{}).image||{}).type||"auto",{url:s}=n||{};let i;switch(function(e){switch(e){case"auto":case"data":return function(){if(y("image"))return"image";if(y("imagebitmap"))return"imagebitmap";if(y("data"))return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return y(e),e}}(r)){case"imagebitmap":i=await A(e,t,s);break;case"image":i=await E(e,t,s);break;case"data":i=await function(e,t){const n=C(e),{_parseImageNode:r}=g.a;return h(r),r(e,n,t)}(e,t);break;default:h(!1)}return"data"===r&&(i=function(e){switch(p(e)){case"data":return e;case"image":case"imagebitmap":const t=document.createElement("canvas"),n=t.getContext("2d");return t.width=e.width,t.height=e.height,n.drawImage(e,0,0),n.getImageData(0,0,e.width,e.height);default:return h(!1)}}(i)),i},test:e=>{const t=new DataView(e);return I(t)||S(t)||V(t)||R(t)},options:{image:{format:"auto",decode:!0}}};function F(e,t,n){if(e.byteLength<=t+n)return"";const r=new DataView(e);let s="";for(let e=0;e<n;e++)s+=String.fromCharCode(r.getUint8(t+e));return s}function P(e){try{return JSON.parse(e)}catch(t){throw new Error(`Failed to parse JSON from data starting with "${function(e,t=5){if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return F(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return F(e,0,t)}return""}(e)}"`)}}function N(e){return e+3&-4}function D(e,t,n){const r=n?new Uint8Array(e).subarray(t,t+n):new Uint8Array(e).subarray(t);return new Uint8Array(r).buffer}function $(e,t,n){let r;if(e instanceof ArrayBuffer)r=new Uint8Array(e);else{const t=e.byteOffset,n=e.byteLength;r=new Uint8Array(e.buffer,t,n)}return t.set(r,n),n+N(r.byteLength)}function q(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function G(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;const n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}function z(e,t,n){const r=e.bufferViews[n];q(r);const s=t[r.buffer];q(s);const i=(r.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,i,r.byteLength)}const W=["SCALAR","VEC2","VEC3","VEC4"],X=new Map([[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126]]),H={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},K={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},J={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Q(e){return W[e-1]||W[0]}function Y(e){const t=X.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Z(e,t){const n=J[e.componentType],r=H[e.type],s=K[e.componentType],i=e.count*r,o=e.count*r*s;return q(o>=0&&o<=t.byteLength),{ArrayType:n,length:i,byteLength:o}}class ee{constructor(e){if(e instanceof ee)return e;e||(e={json:{version:2,buffers:[]},buffers:[]}),this.gltf=e,q(this.gltf.json)}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){const t=this.getUsedExtensions().find(t=>t===e),n=this.json.extensions||{};return t?n[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(t=>t===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getCamera(e){return null}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){const t=(e=this.getBufferView(e)).buffer,n=this.gltf.buffers[t];q(n);const r=(e.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,r,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),n=this.getBuffer(t.buffer).data,{ArrayType:r,length:s}=Z(e,t);return new r(n,t.byteOffset+e.byteOffset,s)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),n=this.getBuffer(t.buffer).data,r=t.byteOffset||0;return new Uint8Array(n,r,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return q(n),e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}removeObjectExtension(e,t){return delete(e.extensions||{})[t],this}addExtension(e,t={}){return q(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return q(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setObjectExtension(e,t,n){(e.extensions||{})[t]=n}addMesh(e,t,n=4){const r={primitives:[{attributes:this._addAttributes(e),indices:t,mode:n}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(r),this.json.meshes.length-1}addPointCloud(e){const t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}addImage(e,t){t=t||C(e);const n={bufferView:this.addBufferView(e),mimeType:t};return this.json.images=this.json.images||[],this.json.images.push(n),this.json.images.length-1}addBufferView(e){const t=e.byteLength;q(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const n={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=N(t),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(e,t){const n={bufferView:e,type:Q(t.size),componentType:t.componentType,count:t.count};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const n=this.addBufferView(e),r={size:t.size,componentType:Y(e),count:Math.round(e.length/t.size)};return this.addAccessor(n,Object.assign(r,t))}createBinaryChunk(){if(this.arrayBuffer)return;const e=this.byteLength,t=new ArrayBuffer(e),n=new Uint8Array(t);let r=0;for(let e=0;e<this.sourceBuffers.length;e++){r=$(this.sourceBuffers[e],n,r)}this.json.buffers[0].byteLength=e,this.arrayBuffer=t,this.sourceBuffers=[]}_removeStringFromArray(e,t){let n=!0;for(;n;){const r=e.indexOf(t);r>-1?e.splice(r,1):n=!1}}}function te(e,t){const{buffer:n,size:r,count:s}=function(e,t){let n=e,r=1,s=0;e&&e.value&&(n=e.value,r=e.size||1);n&&(ArrayBuffer.isView(n)||(n=function(e,t,n=!1){if(!e)return null;if(Array.isArray(e))return new t(e);if(n&&!(e instanceof t))return new t(e);return e}(n,Float32Array)),s=n.length/r);return{buffer:n,size:r,count:s}}(e);return{value:n,size:r,bufferView:null,byteOffset:0,count:s,type:Q(r),componentType:Y(n)}}async function ne(e,t,n){if(!t.gltf.decompressMeshes)return;const r=new ee(e),s=[];for(const e of function*(e){for(const t of e.json.meshes||[])for(const e of t.primitives)yield e}(r))r.getObjectExtension(e,a)&&s.push(se(e,r,t,n));await Promise.all(s),r.removeExtension(a)}function re(e,t={}){const n=new ee(e);for(const e of n.json.meshes||[])ie(e,t),n.addRequiredExtension(a)}async function se(e,t,n,r){const s=t.getObjectExtension(e,a),i=t.getTypedArrayForBufferView(s.bufferView),o=D(i.buffer,i.byteOffset),{parse:u}=r,f=await u(o,[],n,r);e.attributes=function(e){const t={};for(const n in e){const r=e[n];if("indices"!==n){const e=te(r);t[n]=e}}return t}(f.attributes),f.indices&&(e.indices=te(f.indices)),function(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("Empty glTF primitive detected: Draco decompression failure?")}(e)}function ie(e,t,n=4,r,s){if(!r.DracoWriter||!r.DracoLoader)throw new Error("DracoWriter/DracoLoader not available");const i=r.DracoWriter.encodeSync({attributes:e}),{parseSync:o}=s,u=o({attributes:e}),f=r._addFauxAttributes(u.attributes),c=r.addBufferView(i);return{primitives:[{attributes:f,mode:n,extensions:{[a]:{bufferView:c,attributes:f}}}]}}function oe(e,t){const n=new ee(e),{json:r}=n,s=n.getExtension(u);s&&(n.json.lights=s.lights,n.removeExtension(u));for(const e of r.nodes||[]){const t=n.getObjectExtension(e,u);t&&(e.light=t.light),n.removeObjectExtension(e,u)}}function ae(e,t){const n=new ee(e),{json:r}=n;if(r.lights){const e=n.addExtension(u);q(!e.lights),e.lights=r.lights,delete r.lights}if(n.json.lights){for(const e of n.json.lights){const t=e.node;n.addObjectExtension(t,u,e)}delete n.json.lights}}function ue(e,t){const n=new ee(e),{json:r}=n;n.removeExtension(f);for(const e of r.materials||[]){e.extensions&&e.extensions.KHR_materials_unlit&&(e.unlit=!0),n.removeObjectExtension(e,f)}}function fe(e,t){const n=new ee(e),{json:r}=n;if(n.materials)for(const e of r.materials)e.unlit&&(delete e.unlit,n.addObjectExtension(e,f),n.addExtension(f))}function ce(e,t){const n=new ee(e),{json:r}=n,s=n.getExtension(c);if(s){const e=function({programs:e=[],shaders:t=[],techniques:n=[]},r){const s=new TextDecoder;return t.forEach(e=>{if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=s.decode(r.getTypedArrayForBufferView(e.bufferView))}),e.forEach(e=>{e.fragmentShader=t[e.fragmentShader],e.vertexShader=t[e.vertexShader]}),n.forEach(t=>{t.program=e[t.program]}),n}(s,n);for(const t of r.materials||[]){const r=n.getObjectExtension(t,c);r&&(t.technique=Object.assign({},r,e[r.technique]),t.technique.values=ge(t.technique,n)),n.removeObjectExtension(t,c)}n.removeExtension(c)}}function he(e,t){}function ge(e,t){const n=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(t=>{!e.uniforms[t].value||t in n||(n[t]=e.uniforms[t].value)}),Object.keys(n).forEach(e=>{"object"==typeof n[e]&&void 0!==n[e].index&&(n[e].texture=t.getTexture(n[e].index))}),n}const le={KHR_draco_mesh_compression:r,KHR_lights_punctual:s,KHR_materials_unlit:i,KHR_techniques_webgl:o};function de(e,t){if(!e)throw new Error(t||"loader assertion failed.")}const me=1735152710,be=12,ye=8,pe=1313821514,we=5130562,xe=0,je=1,Te=!0;function ve(e,t=0,n={}){const r=new DataView(e),{magic:s=me}=n,i=r.getUint32(t,!1);return i===s||i===me}function Ee(e,t,n=0,r={}){const s=new DataView(t);e.type=function(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}(s,n+0),e.version=s.getUint32(n+4,Te);const i=s.getUint32(n+8,Te);return e.header={byteOffset:n,byteLength:i},de(2===e.version,`Invalid GLB version ${e.version}. Only supports v2.`),de(e.header.byteLength>be+ye),e.json={},e.binChunks=[],function(e,t,n,r){for(;n+8<=e.header.byteLength;){const s=t.getUint32(n+0,Te),i=t.getUint32(n+4,Te);switch(n+=ye,i){case pe:_e(e,t,n,s,r);break;case we:Ae(e,t,n,s,r);break;case xe:r.glb.strict||_e(e,t,n,s,r);break;case je:r.glb.strict||Ae(e,t,n,s,r)}n+=N(s)}}(e,s,n+be,r),n+e.header.byteLength}function _e(e,t,n,r,s){const i=new Uint8Array(t.buffer,n,r),o=new TextDecoder("utf8").decode(i);e.json=JSON.parse(o)}function Ae(e,t,n,r,s){e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:n,byteLength:r,arrayBuffer:t.buffer})}const Be={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ue={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Le={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Oe={magFilter:Le.TEXTURE_MAG_FILTER,minFilter:Le.TEXTURE_MIN_FILTER,wrapS:Le.TEXTURE_WRAP_S,wrapT:Le.TEXTURE_WRAP_T},Re={[Le.TEXTURE_MAG_FILTER]:Le.LINEAR,[Le.TEXTURE_MIN_FILTER]:Le.NEAREST_MIPMAP_LINEAR,[Le.TEXTURE_WRAP_S]:Le.REPEAT,[Le.TEXTURE_WRAP_]:Le.REPEAT};class Ve{postProcess(e,t={}){const{json:n,buffers:r=[],images:s=[],baseUri:i=""}=e;return q(n),this.baseUri=i,this.json=n,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((e,t)=>this._resolveBufferView(e,t))),e.images&&(e.images=e.images.map((e,t)=>this._resolveImage(e,t))),e.samplers&&(e.samplers=e.samplers.map((e,t)=>this._resolveSampler(e,t))),e.textures&&(e.textures=e.textures.map((e,t)=>this._resolveTexture(e,t))),e.accessors&&(e.accessors=e.accessors.map((e,t)=>this._resolveAccessor(e,t))),e.materials&&(e.materials=e.materials.map((e,t)=>this._resolveMaterial(e,t))),e.meshes&&(e.meshes=e.meshes.map((e,t)=>this._resolveMesh(e,t))),e.nodes&&(e.nodes=e.nodes.map((e,t)=>this._resolveNode(e,t))),e.skins&&(e.skins=e.skins.map((e,t)=>this._resolveSkin(e,t))),e.scenes&&(e.scenes=e.scenes.map((e,t)=>this._resolveScene(e,t))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const n=this.json[e]&&this.json[e][t];return n||console.warn(`glTF file error: Could not find ${e}[${t}]`),n}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(e=>this.getNode(e)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(e=>this.getNode(e))),void 0!==e.mesh&&(e.mesh=this.getMesh(e.mesh)),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(e=>{const t=(e={...e}).attributes;e.attributes={};for(const n in t)e.attributes[n]=this.getAccessor(t[n]);return void 0!==e.indices&&(e.indices=this.getAccessor(e.indices)),void 0!==e.material&&(e.material=this.getMaterial(e.material)),e})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture={...e.normalTexture},e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture={...e.occlustionTexture},e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture={...e.emmisiveTexture},e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.pbrMetallicRoughness){e.pbrMetallicRoughness={...e.pbrMetallicRoughness};const t=e.pbrMetallicRoughness;t.baseColorTexture&&(t.baseColorTexture={...t.baseColorTexture},t.baseColorTexture.texture=this.getTexture(t.baseColorTexture.index)),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture={...t.metallicRoughnessTexture},t.metallicRoughnessTexture.texture=this.getTexture(t.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){var n,r;if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(n=e.componentType,Ue[n]),e.components=(r=e.type,Be[r]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const t=e.bufferView.buffer,{ArrayType:n,length:r}=Z(e,e.bufferView),s=(e.bufferView.byteOffset||0)+t.byteOffset;e.value=new n(t.arrayBuffer,s,r)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):Re,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const t in e){const n=this._enumSamplerParameter(t);void 0!==n&&(e.parameters[n]=e[t])}return e}_enumSamplerParameter(e){return Oe[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const n=this.images[t];return n&&(e.image=n),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const n=e.buffer;e.buffer=this.buffers[n];const r=this.buffers[n].arrayBuffer;let s=this.buffers[n].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(r,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e.perspective,e.orthographic,e}}function Se(e,t){return(new Ve).postProcess(e,t)}async function Ie(e,t,n=0,r,s){!function(e,t,n,r){r.uri&&(e.baseUri=r.uri);if(t instanceof ArrayBuffer&&!ve(t,n,r)){const e=new TextDecoder;t=e.decode(t)}if("string"==typeof t)e.json=P(t);else if(t instanceof ArrayBuffer){const s={};n=Ee(s,t,n,r),q("glTF"===s.type,`Invalid GLB magic string ${s.type}`),e._glb=s,e.json=s.json}else q(!1,"GLTF: must be ArrayBuffer or string");const s=e.json.buffers||[];if(e.buffers=new Array(s.length).fill(null),e._glb&&e._glb.header.hasBinChunk){const{binChunks:t}=e._glb;e.buffers[0]={arrayBuffer:t[0].arrayBuffer,byteOffset:t[0].byteOffset,byteLength:t[0].byteLength}}const i=e.json.images||[];e.images=new Array(i.length).fill({})}(e,t,n,r);const i=[];if(r.gltf.loadImages){const t=async function(e,t,n){const r=e.json.images||[],s=[];for(let i=0;i<r.length;++i)s.push(Ce(e,r[i],i,t,n));return await Promise.all(s)}(e,r,s);i.push(t)}r.gltf.loadBuffers&&await async function(e,t,n){for(let r=0;r<e.json.buffers.length;++r){const s=e.json.buffers[r];if(s.uri){const{fetch:i}=n;q(i);const o=G(s.uri,t),a=await i(o),u=await a.arrayBuffer();e.buffers[r]={arrayBuffer:u,byteOffset:0,byteLength:u.byteLength},delete s.uri}}}(e,r,s);const o=async function(e,t={},n){t.gltf=t.gltf||{};for(const r in le){const s=t.gltf.excludeExtensions||{};if(!(r in s&&!s[r])){const s=le[r];await s.decode(e,t,n)}}}(e,r,s);return i.push(o),await Promise.all(i),r.gltf.postProcess?Se(e,r):e}async function Ce(e,t,n,r,s){const{fetch:i,parse:o}=s;let a;if(t.uri){const e=G(t.uri,r),n=await i(e);a=await n.arrayBuffer()}if(Number.isFinite(t.bufferView)){const n=z(e.json,e.buffers,t.bufferView);a=D(n.buffer,n.byteOffset,n.byteLength)}q(a,"glTF image has no data");const u=await o(a,k,{},s);e.images[n]=u}const Me={id:"gltf",name:"glTF",version:"2.1.0-alpha.8",extensions:["gltf","glb"],mimeType:"model/gltf+json",text:!0,binary:!0,test:"glTF",parse:async function(e,t={},n){(t={...Me.options,...t}).gltf={...Me.options.gltf,...t.gltf},function(e){"fetchImages"in e&&(e.gltf.loadImages=e.fetchImages);"createImages"in e&&(e.gltf.loadImages=e.createImages);"fetchLinkedResources"in e&&(e.gltf.fetchBuffers=e.fetchLinkedResources);"decompress"in e&&(e.gltf.decompressMeshes=e.decompress);"decompress"in e.gltf&&(e.gltf.decompressMeshes=e.gltf.decompress);"postProcess"in e&&(e.gltf.postProcess=e.postProcess)}(t);const{byteOffset:r=0}=t;return await Ie({},e,r,t,n)},options:{gltf:{loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},uri:"",log:console}};var ke=Me;function Fe(e,t,n,r){const s=N(n.byteLength),i=s-n.byteLength;if(e){const r=new Uint8Array(e.buffer,e.byteOffset+t,n.byteLength),s=new Uint8Array(n);r.set(s);for(let r=0;r<i;++r)e.setUint8(t+n.byteLength+r,32)}return t+=s}const Pe=1179937895,Ne=1313821514,De=5130562,$e=!0;function qe(e,t,n=0,r={}){const{magic:s=Pe,version:i=2,json:o={},binary:a}=e,u=n;t&&(t.setUint32(n+0,s,$e),t.setUint32(n+4,i,$e),t.setUint32(n+8,0,$e));const f=n+8,c=n+=12;if(t&&(t.setUint32(n+0,0,$e),t.setUint32(n+4,Ne,$e)),n=function(e,t,n,r){return t=Fe(e,t,(new TextEncoder).encode(n))}(t,n+=8,JSON.stringify(o)),t){const e=n-c-8;t.setUint32(c+0,e,$e)}if(a){const e=n;if(t&&(t.setUint32(n+0,0,$e),t.setUint32(n+4,De,$e)),n=Fe(t,n+=8,a),t){const r=n-e-8;t.setUint32(e+0,r,$e)}}if(t){const e=n-u;t.setUint32(f,e,$e)}return n}function Ge(e,t,n,r){return function(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}(e),qe(e,t,n,r)}var ze={name:"glTF",extensions:["glb"],mimeType:"model/gltf+json",encodeSync:function(e,t={}){const{byteOffset:n=0}=t,r=Ge(e,null,n,t),s=new ArrayBuffer(r),i=new DataView(s);return Ge(e,i,n,t),s},binary:!0,options:{}};var We={id:"glb",name:"GLB",version:"2.1.0-alpha.8",extensions:["glb"],mimeType:"model/gltf-binary",binary:!0,parse:async(e,t)=>Xe(e,t),parseSync:Xe,options:{glb:{strict:!1}}};function Xe(e,t){const{byteOffset:n=0}=t,r={};return Ee(r,e,n,t),r}var He={name:"GLB",extensions:["glb"],mimeType:"model/gltf-binary",encodeSync:function(e,t){const{byteOffset:n=0}=t,r=qe(e,null,n,t),s=new ArrayBuffer(r),i=new DataView(s);return qe(e,i,n,t),s},binary:!0,options:{glb:{}}};class Ke{constructor(e={}){this.byteLength=0,this.json={buffers:[{byteLength:0}],bufferViews:[],accessors:[],images:[],meshes:[]},this.sourceBuffers=[],this.log=e.log||console}getByteLength(){return this.byteLength}isImage(e){return Boolean(w(e))}encodeSync(e={}){return this.encodeAsGLB(e)}encodeAsGLB(e={}){this._packBinaryChunk(),e.magic&&console.warn("Custom glTF magic number no longer supported");const t={version:2,json:this.json,binary:this.arrayBuffer},n=qe(t,null,0,e),r=new ArrayBuffer(n);return qe(t,new DataView(r),0,e),r}addApplicationData(e,t,n={}){return this.json[e]=t,this}addBuffer(e,t={size:3}){const n=this.addBufferView(e),r={size:t.size,componentType:Y(e),count:Math.round(e.length/t.size)};return this.addAccessor(n,Object.assign(r,t))}addBufferView(e){const t=e.byteLength||e.length;return this.json.bufferViews.push({buffer:0,byteOffset:this.byteLength,byteLength:t}),this.byteLength+=N(t),this.sourceBuffers.push(e),this.json.bufferViews.length-1}addAccessor(e,t){return this.json.accessors.push({bufferView:e,type:Q(t.size),componentType:t.componentType,count:t.count}),this.json.accessors.length-1}_pack(){return this._packBinaryChunk(),{arrayBuffer:this.arrayBuffer,json:this.json}}_packBinaryChunk(){if(this.arrayBuffer)return;const e=this.byteLength,t=new ArrayBuffer(e),n=new Uint8Array(t);let r=0;for(let e=0;e<this.sourceBuffers.length;e++){r=$(this.sourceBuffers[e],n,r)}this.json.buffers[0].byteLength=e,this.arrayBuffer=t,this.sourceBuffers=[]}_getInternalCounts(){return{buffers:this.json.buffers.length,bufferViews:this.json.bufferViews.length,accessors:this.json.accessors.length,images:this.json.images.length}}}n.d(t,"KHR_DRACO_MESH_COMPRESSION",(function(){return a})),n.d(t,"UBER_POINT_CLOUD_EXTENSION",(function(){return"UBER_draco_point_cloud_compression"})),n.d(t,"GLTFLoader",(function(){return ke})),n.d(t,"GLTFWriter",(function(){return ze})),n.d(t,"GLBLoader",(function(){return We})),n.d(t,"GLBWriter",(function(){return He})),n.d(t,"GLTFScenegraph",(function(){return ee})),n.d(t,"postProcessGLTF",(function(){return Se})),n.d(t,"GLBBuilder",(function(){return Ke})),n.d(t,"encodeGLTFSync",(function(){return Ge}))}])}));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(r,s,function(t){return e[t]}.bind(null,s));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([,function(e,t,n){"use strict";(function(e,r){n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));const s={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},i=s.global||s.self||s.window,o="object"!=typeof r||"[object process]"!==String(r)||r.browser,a=void 0!==r&&r.version&&r.version.match(/v([0-9]*)/);a&&parseFloat(a[1])}).call(this,n(3),n(5))},,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(t){const r=n(6),s="undefined"==typeof window?t:window;s.loaders=s.loaders||{},e.exports=Object.assign(s.loaders,r)}).call(this,n(3))},function(e,t){var n,r,s=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,f=[],c=!1,h=-1;function g(){c&&u&&(c=!1,u.length?f=u.concat(f):h=-1,f.length&&l())}function l(){if(!c){var e=a(g);c=!0;for(var t=f.length;t;){for(u=f,f=[];++h<t;)u&&u[h].run();h=-1,t=f.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function m(){}s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new d(e,t)),1!==f.length||c||a(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=m,s.addListener=m,s.once=m,s.off=m,s.removeListener=m,s.removeAllListeners=m,s.emit=m,s.prependListener=m,s.prependOnceListener=m,s.listeners=function(e){return[]},s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"decode",(function(){return ne})),n.d(r,"encode",(function(){return re}));var s={};n.r(s),n.d(s,"decode",(function(){return oe})),n.d(s,"encode",(function(){return ae}));var i={};n.r(i),n.d(i,"decode",(function(){return ue})),n.d(i,"encode",(function(){return fe}));var o={};n.r(o),n.d(o,"decode",(function(){return ce})),n.d(o,"encode",(function(){return he}));const a="KHR_draco_mesh_compression",u="KHR_lights_punctual",f="KHR_materials_unlit",c="KHR_techniques_webgl";function h(e,t){if(!e)throw new Error(t)}var g=n(1);const{_parseImageNode:l}=g.a,d="undefined"!=typeof Image,m="undefined"!=typeof ImageBitmap,b=Boolean(l);function y(e){switch(e){case"auto":return m||d||b;case"imagebitmap":return m;case"html":case"image":return d;case"ndarray":case"data":return!!g.b||b;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function p(e){const t=w(e);if(!t)throw new Error("Not an image");return t}function w(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&e instanceof Image?"image":e&&"object"==typeof e&&e.data&&e.width&&e.height?"data":null}const x=/^data:image\/svg\+xml/,j=/\.svg((\?|#).*)?$/;function T(e,t){return v(t)?(console.warn("SVG cannot be parsed to imagebitmap"),new Blob([new Uint8Array(e)],{type:"image/svg+xml"})):new Blob([new Uint8Array(e)])}function v(e){return e&&(x.test(e)||j.test(e))}async function E(e,t,n){const r=function(e,t){if(v(t)){const t=(new TextDecoder).decode(e);return`data:image/svg+xml;base64,${btoa(t)}`}return T(e,t)}(e,n),s=self.URL||self.webkitURL,i="string"!=typeof r&&s.createObjectURL(r);try{return await async function(e,t){const n=new Image;if(n.src=e,t.image&&t.image.decode&&n.decode)return await n.decode(),n;return await new Promise((t,r)=>{try{n.onload=()=>t(n),n.onerror=t=>r(new Error(`Could not load image ${e}: ${t}`))}catch(e){r(e)}})}(i||r,t)}finally{i&&s.revokeObjectURL(i)}}let _=!0;async function A(e,t,n){const r=T(e,n);let s=t&&t.imagebitmap;if(!function(e){for(const t in e||B)return!0;return!1}(s)&&_||(s=null),s)try{return await createImageBitmap(r,s)}catch(e){console.warn(e),_=!1}return await createImageBitmap(r)}const B={};const U=!1,L=!0,O=new Map([["image/png",{test:R,getSize:function(e){return{width:e.getUint32(16,U),height:e.getUint32(20,U)}}}],["image/jpeg",{test:I,getSize:function(e){if(e.byteLength<2||65496!==e.getUint16(0,U))return null;const{tableMarkers:t,sofMarkers:n}=function(){const e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);const t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}();let r=2;for(;r<e.byteLength;){const s=e.getUint16(r,U);if(n.has(s))return{height:e.getUint16(r+5,U),width:e.getUint16(r+7,U)};if(!t.has(s))return null;r+=2,r+=e.getUint16(r,U)}return null}}],["image/gif",{test:V,getSize:function(e){return{width:e.getUint16(6,L),height:e.getUint16(8,L)}}}],["image/bmp",{test:S,getSize:function(e){return{width:e.getUint32(18,L),height:e.getUint32(22,L)}}}]]);function R(e){return e.byteLength>=24&&2303741511===e.getUint32(0,U)}function V(e){return e.byteLength>=10&&1195984440===e.getUint32(0,U)}function S(e){return e.byteLength>=14&&16973===e.getUint16(0,U)&&e.getUint32(2,L)===e.byteLength}function I(e){return e.byteLength>=3&&65496===e.getUint16(0,U)&&255===e.getUint8(2,U)}Array.from(O.keys()).join(", ");function C(e){const t=M(e);for(const[e,{test:n}]of O.entries())if(n(t))return e;return null}function M(e){if((e=e.buffer||e)instanceof ArrayBuffer)return new DataView(e);if(ArrayBuffer.isView(e))return new DataView(e.buffer);throw new Error("toDataView")}var k={name:"Images",version:"2.1.0-beta.1",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vndmicrosofticon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(e,t,n){const r=((t=t||{}).image||{}).type||"auto",{url:s}=n||{};let i;switch(function(e){switch(e){case"auto":case"data":return function(){if(y("image"))return"image";if(y("imagebitmap"))return"imagebitmap";if(y("data"))return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return y(e),e}}(r)){case"imagebitmap":i=await A(e,t,s);break;case"image":i=await E(e,t,s);break;case"data":i=await function(e,t){const n=C(e),{_parseImageNode:r}=g.a;return h(r),r(e,n,t)}(e,t);break;default:h(!1)}return"data"===r&&(i=function(e){switch(p(e)){case"data":return e;case"image":case"imagebitmap":const t=document.createElement("canvas"),n=t.getContext("2d");return t.width=e.width,t.height=e.height,n.drawImage(e,0,0),n.getImageData(0,0,e.width,e.height);default:return h(!1)}}(i)),i},test:e=>{const t=new DataView(e);return I(t)||S(t)||V(t)||R(t)},options:{image:{format:"auto",decode:!0}}};function F(e,t,n){if(e.byteLength<=t+n)return"";const r=new DataView(e);let s="";for(let e=0;e<n;e++)s+=String.fromCharCode(r.getUint8(t+e));return s}function P(e){try{return JSON.parse(e)}catch(t){throw new Error(`Failed to parse JSON from data starting with "${function(e,t=5){if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return F(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return F(e,0,t)}return""}(e)}"`)}}function N(e){return e+3&-4}function D(e,t,n){const r=n?new Uint8Array(e).subarray(t,t+n):new Uint8Array(e).subarray(t);return new Uint8Array(r).buffer}function $(e,t,n){let r;if(e instanceof ArrayBuffer)r=new Uint8Array(e);else{const t=e.byteOffset,n=e.byteLength;r=new Uint8Array(e.buffer,t,n)}return t.set(r,n),n+N(r.byteLength)}function q(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function G(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;const n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}function z(e,t,n){const r=e.bufferViews[n];q(r);const s=t[r.buffer];q(s);const i=(r.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,i,r.byteLength)}const W=["SCALAR","VEC2","VEC3","VEC4"],X=new Map([[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126]]),H={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},K={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},J={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Q(e){return W[e-1]||W[0]}function Y(e){const t=X.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Z(e,t){const n=J[e.componentType],r=H[e.type],s=K[e.componentType],i=e.count*r,o=e.count*r*s;return q(o>=0&&o<=t.byteLength),{ArrayType:n,length:i,byteLength:o}}class ee{constructor(e){if(e instanceof ee)return e;e||(e={json:{version:2,buffers:[]},buffers:[]}),this.gltf=e,q(this.gltf.json)}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){const t=this.getUsedExtensions().find(t=>t===e),n=this.json.extensions||{};return t?n[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(t=>t===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getCamera(e){return null}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){const t=(e=this.getBufferView(e)).buffer,n=this.gltf.buffers[t];q(n);const r=(e.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,r,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),n=this.getBuffer(t.buffer).data,{ArrayType:r,length:s}=Z(e,t);return new r(n,t.byteOffset+e.byteOffset,s)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),n=this.getBuffer(t.buffer).data,r=t.byteOffset||0;return new Uint8Array(n,r,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return q(n),e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}removeObjectExtension(e,t){return delete(e.extensions||{})[t],this}addExtension(e,t={}){return q(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return q(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setObjectExtension(e,t,n){(e.extensions||{})[t]=n}addMesh(e,t,n=4){const r={primitives:[{attributes:this._addAttributes(e),indices:t,mode:n}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(r),this.json.meshes.length-1}addPointCloud(e){const t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}addImage(e,t){t=t||C(e);const n={bufferView:this.addBufferView(e),mimeType:t};return this.json.images=this.json.images||[],this.json.images.push(n),this.json.images.length-1}addBufferView(e){const t=e.byteLength;q(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const n={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=N(t),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(e,t){const n={bufferView:e,type:Q(t.size),componentType:t.componentType,count:t.count};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const n=this.addBufferView(e),r={size:t.size,componentType:Y(e),count:Math.round(e.length/t.size)};return this.addAccessor(n,Object.assign(r,t))}createBinaryChunk(){if(this.arrayBuffer)return;const e=this.byteLength,t=new ArrayBuffer(e),n=new Uint8Array(t);let r=0;for(let e=0;e<this.sourceBuffers.length;e++){r=$(this.sourceBuffers[e],n,r)}this.json.buffers[0].byteLength=e,this.arrayBuffer=t,this.sourceBuffers=[]}_removeStringFromArray(e,t){let n=!0;for(;n;){const r=e.indexOf(t);r>-1?e.splice(r,1):n=!1}}}function te(e,t){const{buffer:n,size:r,count:s}=function(e,t){let n=e,r=1,s=0;e&&e.value&&(n=e.value,r=e.size||1);n&&(ArrayBuffer.isView(n)||(n=function(e,t,n=!1){if(!e)return null;if(Array.isArray(e))return new t(e);if(n&&!(e instanceof t))return new t(e);return e}(n,Float32Array)),s=n.length/r);return{buffer:n,size:r,count:s}}(e);return{value:n,size:r,bufferView:null,byteOffset:0,count:s,type:Q(r),componentType:Y(n)}}async function ne(e,t,n){if(!t.gltf.decompressMeshes)return;const r=new ee(e),s=[];for(const e of function*(e){for(const t of e.json.meshes||[])for(const e of t.primitives)yield e}(r))r.getObjectExtension(e,a)&&s.push(se(e,r,t,n));await Promise.all(s),r.removeExtension(a)}function re(e,t={}){const n=new ee(e);for(const e of n.json.meshes||[])ie(e,t),n.addRequiredExtension(a)}async function se(e,t,n,r){const s=t.getObjectExtension(e,a),i=t.getTypedArrayForBufferView(s.bufferView),o=D(i.buffer,i.byteOffset),{parse:u}=r,f=await u(o,[],n,r);e.attributes=function(e){const t={};for(const n in e){const r=e[n];if("indices"!==n){const e=te(r);t[n]=e}}return t}(f.attributes),f.indices&&(e.indices=te(f.indices)),function(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("Empty glTF primitive detected: Draco decompression failure?")}(e)}function ie(e,t,n=4,r,s){if(!r.DracoWriter||!r.DracoLoader)throw new Error("DracoWriter/DracoLoader not available");const i=r.DracoWriter.encodeSync({attributes:e}),{parseSync:o}=s,u=o({attributes:e}),f=r._addFauxAttributes(u.attributes),c=r.addBufferView(i);return{primitives:[{attributes:f,mode:n,extensions:{[a]:{bufferView:c,attributes:f}}}]}}function oe(e,t){const n=new ee(e),{json:r}=n,s=n.getExtension(u);s&&(n.json.lights=s.lights,n.removeExtension(u));for(const e of r.nodes||[]){const t=n.getObjectExtension(e,u);t&&(e.light=t.light),n.removeObjectExtension(e,u)}}function ae(e,t){const n=new ee(e),{json:r}=n;if(r.lights){const e=n.addExtension(u);q(!e.lights),e.lights=r.lights,delete r.lights}if(n.json.lights){for(const e of n.json.lights){const t=e.node;n.addObjectExtension(t,u,e)}delete n.json.lights}}function ue(e,t){const n=new ee(e),{json:r}=n;n.removeExtension(f);for(const e of r.materials||[]){e.extensions&&e.extensions.KHR_materials_unlit&&(e.unlit=!0),n.removeObjectExtension(e,f)}}function fe(e,t){const n=new ee(e),{json:r}=n;if(n.materials)for(const e of r.materials)e.unlit&&(delete e.unlit,n.addObjectExtension(e,f),n.addExtension(f))}function ce(e,t){const n=new ee(e),{json:r}=n,s=n.getExtension(c);if(s){const e=function({programs:e=[],shaders:t=[],techniques:n=[]},r){const s=new TextDecoder;return t.forEach(e=>{if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=s.decode(r.getTypedArrayForBufferView(e.bufferView))}),e.forEach(e=>{e.fragmentShader=t[e.fragmentShader],e.vertexShader=t[e.vertexShader]}),n.forEach(t=>{t.program=e[t.program]}),n}(s,n);for(const t of r.materials||[]){const r=n.getObjectExtension(t,c);r&&(t.technique=Object.assign({},r,e[r.technique]),t.technique.values=ge(t.technique,n)),n.removeObjectExtension(t,c)}n.removeExtension(c)}}function he(e,t){}function ge(e,t){const n=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(t=>{!e.uniforms[t].value||t in n||(n[t]=e.uniforms[t].value)}),Object.keys(n).forEach(e=>{"object"==typeof n[e]&&void 0!==n[e].index&&(n[e].texture=t.getTexture(n[e].index))}),n}const le={KHR_draco_mesh_compression:r,KHR_lights_punctual:s,KHR_materials_unlit:i,KHR_techniques_webgl:o};function de(e,t){if(!e)throw new Error(t||"loader assertion failed.")}const me=1735152710,be=12,ye=8,pe=1313821514,we=5130562,xe=0,je=1,Te=!0;function ve(e,t=0,n={}){const r=new DataView(e),{magic:s=me}=n,i=r.getUint32(t,!1);return i===s||i===me}function Ee(e,t,n=0,r={}){const s=new DataView(t);e.type=function(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}(s,n+0),e.version=s.getUint32(n+4,Te);const i=s.getUint32(n+8,Te);return e.header={byteOffset:n,byteLength:i},de(2===e.version,`Invalid GLB version ${e.version}. Only supports v2.`),de(e.header.byteLength>be+ye),e.json={},e.binChunks=[],function(e,t,n,r){for(;n+8<=e.header.byteLength;){const s=t.getUint32(n+0,Te),i=t.getUint32(n+4,Te);switch(n+=ye,i){case pe:_e(e,t,n,s,r);break;case we:Ae(e,t,n,s,r);break;case xe:r.glb.strict||_e(e,t,n,s,r);break;case je:r.glb.strict||Ae(e,t,n,s,r)}n+=N(s)}}(e,s,n+be,r),n+e.header.byteLength}function _e(e,t,n,r,s){const i=new Uint8Array(t.buffer,n,r),o=new TextDecoder("utf8").decode(i);e.json=JSON.parse(o)}function Ae(e,t,n,r,s){e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:n,byteLength:r,arrayBuffer:t.buffer})}const Be={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ue={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Le={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Oe={magFilter:Le.TEXTURE_MAG_FILTER,minFilter:Le.TEXTURE_MIN_FILTER,wrapS:Le.TEXTURE_WRAP_S,wrapT:Le.TEXTURE_WRAP_T},Re={[Le.TEXTURE_MAG_FILTER]:Le.LINEAR,[Le.TEXTURE_MIN_FILTER]:Le.NEAREST_MIPMAP_LINEAR,[Le.TEXTURE_WRAP_S]:Le.REPEAT,[Le.TEXTURE_WRAP_]:Le.REPEAT};class Ve{postProcess(e,t={}){const{json:n,buffers:r=[],images:s=[],baseUri:i=""}=e;return q(n),this.baseUri=i,this.json=n,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((e,t)=>this._resolveBufferView(e,t))),e.images&&(e.images=e.images.map((e,t)=>this._resolveImage(e,t))),e.samplers&&(e.samplers=e.samplers.map((e,t)=>this._resolveSampler(e,t))),e.textures&&(e.textures=e.textures.map((e,t)=>this._resolveTexture(e,t))),e.accessors&&(e.accessors=e.accessors.map((e,t)=>this._resolveAccessor(e,t))),e.materials&&(e.materials=e.materials.map((e,t)=>this._resolveMaterial(e,t))),e.meshes&&(e.meshes=e.meshes.map((e,t)=>this._resolveMesh(e,t))),e.nodes&&(e.nodes=e.nodes.map((e,t)=>this._resolveNode(e,t))),e.skins&&(e.skins=e.skins.map((e,t)=>this._resolveSkin(e,t))),e.scenes&&(e.scenes=e.scenes.map((e,t)=>this._resolveScene(e,t))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const n=this.json[e]&&this.json[e][t];return n||console.warn(`glTF file error: Could not find ${e}[${t}]`),n}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(e=>this.getNode(e)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(e=>this.getNode(e))),void 0!==e.mesh&&(e.mesh=this.getMesh(e.mesh)),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(e=>{const t=(e={...e}).attributes;e.attributes={};for(const n in t)e.attributes[n]=this.getAccessor(t[n]);return void 0!==e.indices&&(e.indices=this.getAccessor(e.indices)),void 0!==e.material&&(e.material=this.getMaterial(e.material)),e})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture={...e.normalTexture},e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture={...e.occlustionTexture},e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture={...e.emmisiveTexture},e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.pbrMetallicRoughness){e.pbrMetallicRoughness={...e.pbrMetallicRoughness};const t=e.pbrMetallicRoughness;t.baseColorTexture&&(t.baseColorTexture={...t.baseColorTexture},t.baseColorTexture.texture=this.getTexture(t.baseColorTexture.index)),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture={...t.metallicRoughnessTexture},t.metallicRoughnessTexture.texture=this.getTexture(t.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){var n,r;if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(n=e.componentType,Ue[n]),e.components=(r=e.type,Be[r]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const t=e.bufferView.buffer,{ArrayType:n,length:r}=Z(e,e.bufferView),s=(e.bufferView.byteOffset||0)+t.byteOffset;e.value=new n(t.arrayBuffer,s,r)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):Re,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const t in e){const n=this._enumSamplerParameter(t);void 0!==n&&(e.parameters[n]=e[t])}return e}_enumSamplerParameter(e){return Oe[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const n=this.images[t];return n&&(e.image=n),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const n=e.buffer;e.buffer=this.buffers[n];const r=this.buffers[n].arrayBuffer;let s=this.buffers[n].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(r,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e.perspective,e.orthographic,e}}function Se(e,t){return(new Ve).postProcess(e,t)}async function Ie(e,t,n=0,r,s){!function(e,t,n,r){r.uri&&(e.baseUri=r.uri);if(t instanceof ArrayBuffer&&!ve(t,n,r)){const e=new TextDecoder;t=e.decode(t)}if("string"==typeof t)e.json=P(t);else if(t instanceof ArrayBuffer){const s={};n=Ee(s,t,n,r),q("glTF"===s.type,`Invalid GLB magic string ${s.type}`),e._glb=s,e.json=s.json}else q(!1,"GLTF: must be ArrayBuffer or string");const s=e.json.buffers||[];if(e.buffers=new Array(s.length).fill(null),e._glb&&e._glb.header.hasBinChunk){const{binChunks:t}=e._glb;e.buffers[0]={arrayBuffer:t[0].arrayBuffer,byteOffset:t[0].byteOffset,byteLength:t[0].byteLength}}const i=e.json.images||[];e.images=new Array(i.length).fill({})}(e,t,n,r);const i=[];if(r.gltf.loadImages){const t=async function(e,t,n){const r=e.json.images||[],s=[];for(let i=0;i<r.length;++i)s.push(Ce(e,r[i],i,t,n));return await Promise.all(s)}(e,r,s);i.push(t)}r.gltf.loadBuffers&&await async function(e,t,n){for(let r=0;r<e.json.buffers.length;++r){const s=e.json.buffers[r];if(s.uri){const{fetch:i}=n;q(i);const o=G(s.uri,t),a=await i(o),u=await a.arrayBuffer();e.buffers[r]={arrayBuffer:u,byteOffset:0,byteLength:u.byteLength},delete s.uri}}}(e,r,s);const o=async function(e,t={},n){t.gltf=t.gltf||{};for(const r in le){const s=t.gltf.excludeExtensions||{};if(!(r in s&&!s[r])){const s=le[r];await s.decode(e,t,n)}}}(e,r,s);return i.push(o),await Promise.all(i),r.gltf.postProcess?Se(e,r):e}async function Ce(e,t,n,r,s){const{fetch:i,parse:o}=s;let a;if(t.uri){const e=G(t.uri,r),n=await i(e);a=await n.arrayBuffer()}if(Number.isFinite(t.bufferView)){const n=z(e.json,e.buffers,t.bufferView);a=D(n.buffer,n.byteOffset,n.byteLength)}q(a,"glTF image has no data");const u=await o(a,k,{},s);e.images[n]=u}const Me={id:"gltf",name:"glTF",version:"2.1.0-beta.1",extensions:["gltf","glb"],mimeType:"model/gltf+json",text:!0,binary:!0,test:"glTF",parse:async function(e,t={},n){(t={...Me.options,...t}).gltf={...Me.options.gltf,...t.gltf},function(e){"fetchImages"in e&&(e.gltf.loadImages=e.fetchImages);"createImages"in e&&(e.gltf.loadImages=e.createImages);"fetchLinkedResources"in e&&(e.gltf.fetchBuffers=e.fetchLinkedResources);"decompress"in e&&(e.gltf.decompressMeshes=e.decompress);"decompress"in e.gltf&&(e.gltf.decompressMeshes=e.gltf.decompress);"postProcess"in e&&(e.gltf.postProcess=e.postProcess)}(t);const{byteOffset:r=0}=t;return await Ie({},e,r,t,n)},options:{gltf:{loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},uri:"",log:console}};var ke=Me;function Fe(e,t,n,r){const s=N(n.byteLength),i=s-n.byteLength;if(e){const r=new Uint8Array(e.buffer,e.byteOffset+t,n.byteLength),s=new Uint8Array(n);r.set(s);for(let r=0;r<i;++r)e.setUint8(t+n.byteLength+r,32)}return t+=s}const Pe=1179937895,Ne=1313821514,De=5130562,$e=!0;function qe(e,t,n=0,r={}){const{magic:s=Pe,version:i=2,json:o={},binary:a}=e,u=n;t&&(t.setUint32(n+0,s,$e),t.setUint32(n+4,i,$e),t.setUint32(n+8,0,$e));const f=n+8,c=n+=12;if(t&&(t.setUint32(n+0,0,$e),t.setUint32(n+4,Ne,$e)),n=function(e,t,n,r){return t=Fe(e,t,(new TextEncoder).encode(n))}(t,n+=8,JSON.stringify(o)),t){const e=n-c-8;t.setUint32(c+0,e,$e)}if(a){const e=n;if(t&&(t.setUint32(n+0,0,$e),t.setUint32(n+4,De,$e)),n=Fe(t,n+=8,a),t){const r=n-e-8;t.setUint32(e+0,r,$e)}}if(t){const e=n-u;t.setUint32(f,e,$e)}return n}function Ge(e,t,n,r){return function(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}(e),qe(e,t,n,r)}var ze={name:"glTF",extensions:["glb"],mimeType:"model/gltf+json",encodeSync:function(e,t={}){const{byteOffset:n=0}=t,r=Ge(e,null,n,t),s=new ArrayBuffer(r),i=new DataView(s);return Ge(e,i,n,t),s},binary:!0,options:{}};var We={id:"glb",name:"GLB",version:"2.1.0-beta.1",extensions:["glb"],mimeType:"model/gltf-binary",binary:!0,parse:async(e,t)=>Xe(e,t),parseSync:Xe,options:{glb:{strict:!1}}};function Xe(e,t){const{byteOffset:n=0}=t,r={};return Ee(r,e,n,t),r}var He={name:"GLB",extensions:["glb"],mimeType:"model/gltf-binary",encodeSync:function(e,t){const{byteOffset:n=0}=t,r=qe(e,null,n,t),s=new ArrayBuffer(r),i=new DataView(s);return qe(e,i,n,t),s},binary:!0,options:{glb:{}}};class Ke{constructor(e={}){this.byteLength=0,this.json={buffers:[{byteLength:0}],bufferViews:[],accessors:[],images:[],meshes:[]},this.sourceBuffers=[],this.log=e.log||console}getByteLength(){return this.byteLength}isImage(e){return Boolean(w(e))}encodeSync(e={}){return this.encodeAsGLB(e)}encodeAsGLB(e={}){this._packBinaryChunk(),e.magic&&console.warn("Custom glTF magic number no longer supported");const t={version:2,json:this.json,binary:this.arrayBuffer},n=qe(t,null,0,e),r=new ArrayBuffer(n);return qe(t,new DataView(r),0,e),r}addApplicationData(e,t,n={}){return this.json[e]=t,this}addBuffer(e,t={size:3}){const n=this.addBufferView(e),r={size:t.size,componentType:Y(e),count:Math.round(e.length/t.size)};return this.addAccessor(n,Object.assign(r,t))}addBufferView(e){const t=e.byteLength||e.length;return this.json.bufferViews.push({buffer:0,byteOffset:this.byteLength,byteLength:t}),this.byteLength+=N(t),this.sourceBuffers.push(e),this.json.bufferViews.length-1}addAccessor(e,t){return this.json.accessors.push({bufferView:e,type:Q(t.size),componentType:t.componentType,count:t.count}),this.json.accessors.length-1}_pack(){return this._packBinaryChunk(),{arrayBuffer:this.arrayBuffer,json:this.json}}_packBinaryChunk(){if(this.arrayBuffer)return;const e=this.byteLength,t=new ArrayBuffer(e),n=new Uint8Array(t);let r=0;for(let e=0;e<this.sourceBuffers.length;e++){r=$(this.sourceBuffers[e],n,r)}this.json.buffers[0].byteLength=e,this.arrayBuffer=t,this.sourceBuffers=[]}_getInternalCounts(){return{buffers:this.json.buffers.length,bufferViews:this.json.bufferViews.length,accessors:this.json.accessors.length,images:this.json.images.length}}}n.d(t,"KHR_DRACO_MESH_COMPRESSION",(function(){return a})),n.d(t,"UBER_POINT_CLOUD_EXTENSION",(function(){return"UBER_draco_point_cloud_compression"})),n.d(t,"GLTFLoader",(function(){return ke})),n.d(t,"GLTFWriter",(function(){return ze})),n.d(t,"GLBLoader",(function(){return We})),n.d(t,"GLBWriter",(function(){return He})),n.d(t,"GLTFScenegraph",(function(){return ee})),n.d(t,"postProcessGLTF",(function(){return Se})),n.d(t,"GLBBuilder",(function(){return Ke})),n.d(t,"encodeGLTFSync",(function(){return Ge}))}])}));

@@ -16,3 +16,3 @@ "use strict";

var VERSION = typeof "2.1.0-alpha.8" !== 'undefined' ? "2.1.0-alpha.8" : 'latest';
var VERSION = typeof "2.1.0-beta.1" !== 'undefined' ? "2.1.0-beta.1" : 'latest';
var _default = {

@@ -19,0 +19,0 @@ id: 'glb',

@@ -23,3 +23,3 @@ "use strict";

var VERSION = typeof "2.1.0-alpha.8" !== 'undefined' ? "2.1.0-alpha.8" : 'latest';
var VERSION = typeof "2.1.0-beta.1" !== 'undefined' ? "2.1.0-beta.1" : 'latest';
var GLTFLoader = {

@@ -26,0 +26,0 @@ id: 'gltf',

import parseGLBSync from './lib/parse-glb';
const VERSION = typeof "2.1.0-alpha.8" !== 'undefined' ? "2.1.0-alpha.8" : 'latest';
const VERSION = typeof "2.1.0-beta.1" !== 'undefined' ? "2.1.0-beta.1" : 'latest';
export default {

@@ -4,0 +4,0 @@ id: 'glb',

@@ -8,3 +8,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

import { parseGLTF } from './lib/parse-gltf';
const VERSION = typeof "2.1.0-alpha.8" !== 'undefined' ? "2.1.0-alpha.8" : 'latest';
const VERSION = typeof "2.1.0-beta.1" !== 'undefined' ? "2.1.0-beta.1" : 'latest';
const GLTFLoader = {

@@ -11,0 +11,0 @@ id: 'gltf',

import _regeneratorRuntime from "@babel/runtime/regenerator";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
import parseGLBSync from './lib/parse-glb';
var VERSION = typeof "2.1.0-alpha.8" !== 'undefined' ? "2.1.0-alpha.8" : 'latest';
var VERSION = typeof "2.1.0-beta.1" !== 'undefined' ? "2.1.0-beta.1" : 'latest';
export default {

@@ -6,0 +6,0 @@ id: 'glb',

@@ -10,3 +10,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";

import { parseGLTF } from './lib/parse-gltf';
var VERSION = typeof "2.1.0-alpha.8" !== 'undefined' ? "2.1.0-alpha.8" : 'latest';
var VERSION = typeof "2.1.0-beta.1" !== 'undefined' ? "2.1.0-beta.1" : 'latest';
var GLTFLoader = {

@@ -13,0 +13,0 @@ id: 'gltf',

{
"name": "@loaders.gl/gltf",
"version": "2.1.0-alpha.8",
"version": "2.1.0-beta.1",
"description": "Framework-independent loader for the glTF format",

@@ -41,7 +41,7 @@ "license": "MIT",

"dependencies": {
"@loaders.gl/core": "2.1.0-alpha.8",
"@loaders.gl/images": "2.1.0-alpha.8",
"@loaders.gl/loader-utils": "2.1.0-alpha.8"
"@loaders.gl/core": "2.1.0-beta.1",
"@loaders.gl/images": "2.1.0-beta.1",
"@loaders.gl/loader-utils": "2.1.0-beta.1"
},
"gitHead": "365f83da6c1041b6bf71a2c4616700f944297afb"
"gitHead": "7abafeb2984736314d8c74c832c1c27abcf5e3f9"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc