@luma.gl/engine 9.0.0-alpha.47 → 9.0.0-alpha.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation-loop/animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop.js +1 -4
- package/dist/animation-loop/animation-loop.js.map +1 -1
- package/dist/dist.dev.js +445 -857
- package/dist/geometry/gpu-geometry.js +3 -2
- package/dist/geometry/gpu-geometry.js.map +1 -1
- package/dist/index.cjs +374 -342
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/clip-space.js +6 -6
- package/dist/lib/clip-space.js.map +1 -1
- package/dist/model/model.d.ts +22 -14
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +49 -18
- package/dist/model/model.js.map +1 -1
- package/dist/shader-inputs.d.ts +62 -0
- package/dist/shader-inputs.d.ts.map +1 -0
- package/dist/shader-inputs.js +48 -0
- package/dist/shader-inputs.js.map +1 -0
- package/dist.min.js +96 -91
- package/package.json +5 -5
- package/src/animation-loop/animation-loop.ts +1 -5
- package/src/geometry/gpu-geometry.ts +2 -2
- package/src/index.ts +3 -3
- package/src/lib/clip-space.ts +6 -6
- package/src/model/model.ts +80 -55
- package/src/shader-inputs.ts +131 -0
- package/dist/shadertools/shader-module-uniforms.d.ts +0 -36
- package/dist/shadertools/shader-module-uniforms.d.ts.map +0 -1
- package/dist/shadertools/shader-module-uniforms.js +0 -87
- package/dist/shadertools/shader-module-uniforms.js.map +0 -1
- package/src/shadertools/shader-module-uniforms.ts +0 -178
package/dist.min.js
CHANGED
|
@@ -4,19 +4,27 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['luma'] = factory();
|
|
6
6
|
else root['luma'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var
|
|
8
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
9
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,c;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){s=!0,c=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw c}}}}function Zo(e,t){if(e){if(typeof e=="string")return Lr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lr(e,t)}}function Lr(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Jo=1,Qo=1,Dr=function(){function e(){T(this,e),this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}var t=e.prototype;return t.addChannel=function(n){var i=n.delay,o=i===void 0?0:i,s=n.duration,c=s===void 0?Number.POSITIVE_INFINITY:s,a=n.rate,f=a===void 0?1:a,u=n.repeat,l=u===void 0?1:u,h=Jo++,g={time:0,delay:o,duration:c,rate:f,repeat:l};return this._setChannelTime(g,this.time),this.channels.set(h,g),h},t.removeChannel=function(n){this.channels.delete(n);var i=He(this.animations),o;try{for(i.s();!(o=i.n()).done;){var s=B(o.value,2),c=s[0],a=s[1];a.channel===n&&this.detachAnimation(c)}}catch(f){i.e(f)}finally{i.f()}},t.isFinished=function(n){var i=this.channels.get(n);return i===void 0?!1:this.time>=i.delay+i.duration*i.repeat},t.getTime=function(n){if(n===void 0)return this.time;var i=this.channels.get(n);return i===void 0?-1:i.time},t.setTime=function(n){this.time=Math.max(0,n);var i=this.channels.values(),o=He(i),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;this._setChannelTime(c,this.time)}}catch(m){o.e(m)}finally{o.f()}var a=this.animations.values(),f=He(a),u;try{for(f.s();!(u=f.n()).done;){var l=u.value,h=l.animation,g=l.channel;h.setTime(this.getTime(g))}}catch(m){f.e(m)}finally{f.f()}},t.play=function(){this.playing=!0},t.pause=function(){this.playing=!1,this.lastEngineTime=-1},t.reset=function(){this.setTime(0)},t.attachAnimation=function(n,i){var o=Qo++;return this.animations.set(o,{animation:n,channel:i}),n.setTime(this.getTime(i)),o},t.detachAnimation=function(n){this.animations.delete(n)},t.update=function(n){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=n),this.setTime(this.time+(n-this.lastEngineTime)),this.lastEngineTime=n)},t._setChannelTime=function(n,i){var o=i-n.delay,s=n.duration*n.repeat;o>=s?n.time=n.duration*n.rate:(n.time=Math.max(0,o)%n.duration,n.time*=n.rate)},P(e)}();var Ir=function(){function e(r){T(this,e),this.startIndex=-1,this.endIndex=-1,this.factor=0,this.times=[],this.values=[],this._lastTime=-1,this.setKeyFrames(r),this.setTime(0)}var t=e.prototype;return t.setKeyFrames=function(n){var i=n.length;this.times.length=i,this.values.length=i;for(var o=0;o<i;++o)this.times[o]=n[o][0],this.values[o]=n[o][1];this._calculateKeys(this._lastTime)},t.setTime=function(n){n=Math.max(0,n),n!==this._lastTime&&(this._calculateKeys(n),this._lastTime=n)},t.getStartTime=function(){return this.times[this.startIndex]},t.getEndTime=function(){return this.times[this.endIndex]},t.getStartData=function(){return this.values[this.startIndex]},t.getEndData=function(){return this.values[this.endIndex]},t._calculateKeys=function(n){var i=0,o=this.times.length;for(i=0;i<o-2&&!(this.times[i+1]>n);++i);this.startIndex=i,this.endIndex=i+1;var s=this.times[this.startIndex],c=this.times[this.endIndex];this.factor=Math.min(Math.max(0,(n-s)/(c-s)),1)},P(e)}();function Nr(e,t,r,n,i,o,s){try{var c=e[o](s),a=c.value}catch(f){r(f);return}c.done?t(a):Promise.resolve(a).then(n,i)}function lt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function s(a){Nr(o,n,i,s,c,"next",a)}function c(a){Nr(o,n,i,s,c,"throw",a)}s(void 0)})}}var We=pe(Qt(),1),zr=function(){function e(r){T(this,e)}var t=e.prototype;return t.onInitialize=function(){var r=lt(We.default.mark(function i(o){return We.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",null);case 1:case"end":return c.stop()}},i)}));function n(i){return r.apply(this,arguments)}return n}(),P(e)}();function D(e,t,r){return t=Jt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yt=pe(Qt(),1);function Ye(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function ct(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Ye()}var ts=globalThis.self||globalThis.window||globalThis.global,jt=globalThis.window||globalThis.self||globalThis.global,es=globalThis.document||{},Tt=globalThis.process||{},rs=globalThis.console,tf=globalThis.navigator||{};var me=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",nf=ct();function ns(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var ve=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=ns(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function kr(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function Vr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function ge(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let o=e.width*r,s=e.height*r,c=["font-size:1px;","padding:".concat(Math.floor(s/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(s,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(s,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),c]}var ye;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ye||(ye={}));var is=10;function Hr(e){return typeof e!="string"?e:(e=e.toUpperCase(),ye[e]||ye.WHITE)}function qr(e,t,r){if(!ct&&typeof e=="string"){if(t){let n=Hr(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=Hr(r);e="\x1B[".concat(n+is,"m").concat(e,"\x1B[49m")}}return e}function Wr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let o of n){let s=i[o];typeof s=="function"&&(t.find(c=>o===c)||(i[o]=s.bind(e)))}}function Ut(e,t){if(!e)throw new Error(t||"Assertion failed")}function Rt(){let e;if(ct()&&jt.performance){var t,r;e=jt===null||jt===void 0||(t=jt.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Tt){var n;let i=Tt===null||Tt===void 0||(n=Tt.hrtime)===null||n===void 0?void 0:n.call(Tt);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var Gt={debug:ct()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},os={enabled:!0,level:0};function ht(){}var Yr={},Kr={once:!0},wt=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=me,this._startTs=Rt(),this._deltaTs=Rt(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new ve("__probe-".concat(this.id,"__"),os),this.timeStamp("".concat(this.id," started")),Wr(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Rt()-this._startTs).toPrecision(10))}getDelta(){return Number((Rt()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Ut(t,r)}warn(t){return this._getLogFunction(0,t,Gt.warn,arguments,Kr)}error(t){return this._getLogFunction(0,t,Gt.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,Gt.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Gt.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Gt.debug||Gt.info,arguments,Kr)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ht,n&&[n],{tag:fs(r)}):ht}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:s=1}=t;return this._shouldLog(r||n)?ct()?cs({image:i,message:o,scale:s}):as({image:i,message:o,scale:s}):ht}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||ht)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=Xr({logLevel:t,message:r,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ht)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=$r(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=Xr({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,Ut(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Rt();let s=o.tag||o.message;if(o.once&&s)if(!Yr[s])Yr[s]=Rt();else return ht;return r=ss(this.id,o.message,o),n.bind(console,r,...o.args)}return ht}};wt.VERSION=me;function $r(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Ut(Number.isFinite(t)&&t>=0),t}function Xr(e){let{logLevel:t,message:r}=e;e.logLevel=$r(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return Ut(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function ss(e,t,r){if(typeof t=="string"){let n=r.time?Vr(kr(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=qr(t,r.color,r.background)}return t}function as(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ht}function cs(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let s=ge(o,r,n);console.log(...s)},o.src=t,ht}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...ge(t,r,n)),ht;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...ge(o,r,n)),o.src=t.toDataURL(),ht}return ht}function fs(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Tf=new wt({id:"@probe.gl/log"});var q=new wt({id:"luma.gl"});function te(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Ct=class{constructor(t,r){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=te(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(te()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var Et=class{constructor(t){this.id=void 0,this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,i=this.stats[r];return i||(t instanceof Ct?i=t:i=new Ct(r,n),this.stats[r]=i),i}};var us=function(){function e(){T(this,e),this.stats=new Map}var t=e.prototype;return t.getStats=function(n){return this.get(n)},t.get=function(n){return this.stats.has(n)||this.stats.set(n,new Et({id:n})),this.stats.get(n)},P(e)}(),Bt=new us;function ls(){var e=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",t="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==e)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(e));return globalThis.luma||(ct()&&q.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:q,stats:Bt}),e}var Zr=ls();function Jr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function St(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:Jr(e)}var Je=pe(Qt(),1);var Ke={};function H(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Ke[e]=Ke[e]||1;var t=Ke[e]++;return"".concat(e,"-").concat(t)}function ee(e,t){return ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ee(e,t)}function W(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}function Xe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e,t){if(t&&(rt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xe(e)}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},j(e)}function Qr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qr(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Lt=function(){function e(r,n,i){if(T(this,e),this.id=void 0,this.props=void 0,this.userData={},this.device=void 0,this._device=void 0,this.destroyed=!1,this.allocatedBytes=0,this._attachedResources=new Set,!r)throw new Error("no device");this._device=r,this.props=ps(n,i);var o=this.props.id!=="undefined"?this.props.id:H(this[Symbol.toStringTag]);this.props.id=o,this.id=o,this.userData=this.props.userData||{},this.addStats()}var t=e.prototype;return t.destroy=function(){this.destroyResource()},t.delete=function(){return this.destroy(),this},t.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},t.getProps=function(){return this.props},t.attachResource=function(n){this._attachedResources.add(n)},t.detachResource=function(n){this._attachedResources.delete(n)},t.destroyAttachedResource=function(n){this._attachedResources.delete(n)&&n.destroy()},t.destroyAttachedResources=function(){for(var n=0,i=Object.values(this._attachedResources);n<i.length;n++){var o=i[n];o.destroy()}this._attachedResources=new Set},t.destroyResource=function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0},t.removeStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];n.get("".concat(i,"s Active")).decrementCount()},t.trackAllocatedMemory=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").addCount(n),o.get("".concat(i," Memory")).addCount(n),this.allocatedBytes=n},t.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").subtractCount(this.allocatedBytes),i.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},t.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(i,"s Created")).incrementCount(),n.get("".concat(i,"s Active")).incrementCount()},P(e)}();Lt.defaultProps={id:"undefined",handle:void 0,userData:void 0};function ps(e,t){var r=hs({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}var en;function tn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tn(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ds(e){var t=ms();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function ms(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}en=Symbol.toStringTag;var $=function(e){W(r,e);var t=ds(r);function r(i,o){var s;T(this,r);var c=$e({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?c.indexType="uint32":o.data instanceof Uint16Array&&(c.indexType="uint16")),s=t.call(this,i,c,r.defaultProps),s.usage=void 0,s.indexType=void 0,s.byteLength=void 0,s.usage=o.usage||0,s.indexType=c.indexType,s}var n=r.prototype;return n.write=function(o,s){throw new Error("not implemented")},n.readAsync=function(o,s){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},P(r,[{key:en,get:function(){return"Buffer"}}]),r}(Lt);$.defaultProps=$e($e({},Lt.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});$.MAP_READ=1;$.MAP_WRITE=2;$.COPY_SRC=4;$.COPY_DST=8;$.INDEX=16;$.VERTEX=32;$.UNIFORM=64;$.STORAGE=128;$.INDIRECT=256;$.QUERY_RESOLVE=512;var nn;function rn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ze(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rn(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var _e={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(q.get("debug")),break:[],gl:null};nn=Symbol.toStringTag;var vs=function(){function e(r){T(this,e),this.id=void 0,this.statsManager=Bt,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Ze(Ze({},_e),r),this.id=this.props.id||H(this[Symbol.toStringTag].toLowerCase())}var t=e.prototype;return t.loseDevice=function(){return!1},t.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},t.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},t.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},t._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var i=Ze({},n);return(n.usage||0)&$.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":q.warn("indices buffer content must be of integer type")()),i},P(e,[{key:nn,get:function(){return"Device"}}]),e}();vs.VERSION=Zr;function on(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?on(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):on(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gs(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ys(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
10
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,
|
|
11
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,c;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){s=!0,c=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw c}}}}function Ms(e,t){if(e){if(typeof e=="string")return dn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dn(e,t)}}function dn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function tr(e,t){var r={},n=re(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=As(e,t,o.name)}}catch(s){n.e(s)}finally{n.f()}return r}function As(e,t,r){var n=Ps(e,r),i=Ts(t,r);if(!n)return null;var o=ln(n.type),s=i?.vertexFormat||o.defaultVertexFormat,c=Qe(s);return{attributeName:i?.attributeName||n.name,bufferName:i?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:s,bufferDataType:c.type,bufferComponents:c.components,normalized:c.normalized,integer:o.integer,stepMode:i?.stepMode||n.stepMode,byteOffset:i?.byteOffset||0,byteStride:i?.byteStride||0}}function Ps(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||q.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function Ts(e,t){Rs(e);var r=Cs(e,t);return r||(r=Ls(e,t),r)?r:(q.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Rs(e){var t=re(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&q.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function Cs(e,t){var r=re(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.format&&i.name===t)return{attributeName:i.name,bufferName:t,stepMode:i.stepMode,vertexFormat:i.format,byteOffset:0,byteStride:i.byteStride||0}}}catch(o){r.e(o)}finally{r.f()}return null}function Ls(e,t){var r=re(e),n;try{for(r.s();!(n=r.n()).done;){var i,o=n.value,s=o.byteStride;if(typeof o.byteStride!="number"){var c=re(o.attributes||[]),a;try{for(c.s();!(a=c.n()).done;){var f=a.value,u=Qe(f.format);s+=u.byteLength}}catch(h){c.e(h)}finally{c.f()}}var l=(i=o.attributes)===null||i===void 0?void 0:i.find(function(h){return h.attribute===t});if(l)return{attributeName:l.attribute,bufferName:o.name,stepMode:o.stepMode,vertexFormat:l.format,byteOffset:l.byteOffset,byteStride:s}}}catch(h){r.e(h)}finally{r.f()}return null}function tt(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}var Ds={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function mn(e){var t=Ds[e];return tt(e),t}function vn(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}var xe;function gn(e){return(!xe||xe.byteLength<e)&&(xe=new ArrayBuffer(e)),xe}var yn=1024,er=function(){function e(r){T(this,e),this.layout={},this.byteLength=void 0;for(var n=0,i=0,o=Object.entries(r);i<o.length;i++){var s=B(o[i],2),c=s[0],a=s[1],f=mn(a),u=f.type,l=f.components;n=vn(n,l);var h=n;n+=l,this.layout[c]={type:u,size:l,offset:h}}n+=(4-n%4)%4;var g=n*4;this.byteLength=Math.max(g,yn)}var t=e.prototype;return t.getData=function(n){for(var i=Math.max(this.byteLength,yn),o=gn(i),s={i32:new Int32Array(o),u32:new Uint32Array(o),f32:new Float32Array(o),f16:new Uint16Array(o)},c=0,a=Object.entries(n);c<a.length;c++){var f=B(a[c],2),u=f[0],l=f[1],h=this.layout[u];if(!h){q.warn("Supplied uniform value ".concat(u," not present in uniform block layout"))();continue}var g=h.type,m=h.size,y=h.offset,b=s[g];if(m===1){if(typeof l!="number"&&typeof l!="boolean"){q.warn("Supplied value for single component uniform ".concat(u," is not a number: ").concat(l))();continue}b[y]=Number(l)}else{var O=St(l);if(!O){q.warn("Supplied value for multi component / array uniform ".concat(u," is not a numeric array: ").concat(l))();continue}b.set(O,y)}}return new Uint8Array(o)},t.has=function(n){return Boolean(this.layout[n])},t.get=function(n){var i=this.layout[n];return i},P(e)}();function _n(e){var t=ArrayBuffer.isView(e)?e.constructor:e;switch(t){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(t.constructor.name)}}function rr(e,t){if(!t||t>4)throw new Error("size ".concat(t));var r=t,n=_n(e);if(n==="uint8"||n==="sint8"){if(r===1||r===3)throw new Error("size: ".concat(t));return"".concat(n,"x").concat(r)}if(n==="uint16"||n==="sint16"){if(r===1||r===3)throw new Error("size: ".concat(t));return"".concat(n,"x").concat(r)}return r===1?n:"".concat(n,"x").concat(r)}function xn(e){return St(e)!==null||typeof e=="number"||typeof e=="boolean"}function nr(e){var t={bindings:{},uniforms:{}};return Object.keys(e).forEach(function(r){var n=e[r];xn(n)?t.uniforms[r]=n:t.bindings[r]=n}),t}function ne(e,t,r){if(e===t)return!0;if(!r||!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ne(e[n],t[n],r-1))return!1;return!0}if(Array.isArray(t))return!1;if(rt(e)==="object"&&rt(t)==="object"){var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var s=0,c=i;s<c.length;s++){var a=c[s];if(!t.hasOwnProperty(a)||!ne(e[a],t[a],r-1))return!1}return!0}return!1}function ir(e){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function or(e){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var bn=function(t){return"".concat(t)};function On(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?On(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):On(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Is=0,Ns={device:null,onAddHTML:function(){return""},onInitialize:function(){var e=lt(yt.default.mark(function r(){return yt.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",null);case 1:case"end":return i.stop()}},r)}));function t(){return e.apply(this,arguments)}return t}(),onRender:function(){},onFinalize:function(){},onError:function(t){return console.error(t)},stats:Dt.stats.get("animation-loop-".concat(Is++)),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1},be=function(){function e(r){if(T(this,e),this.device=null,this.canvas=null,this.props=void 0,this.animationProps=null,this.timeline=null,this.stats=void 0,this.cpuTime=void 0,this.gpuTime=void 0,this.frameRate=void 0,this.display=void 0,this.needsRedraw="initialized",this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.props=wn(wn({},Ns),r),r=this.props,!r.device)throw new Error("No device provided");var n=this.props.useDevicePixels,i=n===void 0?!0:n;this.stats=r.stats||new Et({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:r.autoResizeViewport,autoResizeDrawingBuffer:r.autoResizeDrawingBuffer,useDevicePixels:i}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}var t=e.prototype;return t.destroy=function(){this.stop(),this._setDisplay(null)},t.delete=function(){this.destroy()},t.setNeedsRedraw=function(n){return this.needsRedraw=this.needsRedraw||n,this},t.setProps=function(n){return"autoResizeViewport"in n&&(this.props.autoResizeViewport=n.autoResizeViewport||!1),"autoResizeDrawingBuffer"in n&&(this.props.autoResizeDrawingBuffer=n.autoResizeDrawingBuffer||!1),"useDevicePixels"in n&&(this.props.useDevicePixels=n.useDevicePixels||!1),this},t.start=function(){var r=lt(yt.default.mark(function i(){var o,s;return yt.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!this._running){a.next=2;break}return a.abrupt("return",this);case 2:if(this._running=!0,a.prev=3,this._running){a.next=6;break}return a.abrupt("return",null);case 6:if(this._initialized){a.next=13;break}return this._initialized=!0,a.next=10,this._initDevice();case 10:return this._initialize(),a.next=13,this.props.onInitialize(this._getAnimationProps());case 13:if(this._running){a.next=15;break}return a.abrupt("return",null);case 15:return o!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),a.abrupt("return",this);case 19:throw a.prev=19,a.t0=a.catch(3),s=a.t0 instanceof Error?a.t0:new Error("Unknown error"),this.props.onError(s),s;case 24:case"end":return a.stop()}},i,this,[[3,19]])}));function n(){return r.apply(this,arguments)}return n}(),t.redraw=function(){var n;return(n=this.device)!==null&&n!==void 0&&n.isLost?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)},t.stop=function(){return this._running&&(this.animationProps&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this},t.attachTimeline=function(n){return this.timeline=n,this.timeline},t.detachTimeline=function(){this.timeline=null},t.waitForRender=function(){var n=this;return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(function(i){n._resolveNextFrame=i})),this._nextFramePromise},t.toDataURL=function(){var r=lt(yt.default.mark(function i(){return yt.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return this.setNeedsRedraw("toDataURL"),s.next=3,this.waitForRender();case 3:if(!(this.canvas instanceof HTMLCanvasElement)){s.next=5;break}return s.abrupt("return",this.canvas.toDataURL());case 5:throw new Error("OffscreenCanvas");case 6:case"end":return s.stop()}},i,this)}));function n(){return r.apply(this,arguments)}return n}(),t._initialize=function(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()},t._setDisplay=function(n){this.display&&(this.display.destroy(),this.display.animationLoop=null),n&&(n.animationLoop=this),this.display=n},t._requestAnimationFrame=function(){this._running&&(this._animationFrameId=ir(this._animationFrame.bind(this)))},t._cancelAnimationFrame=function(){this._animationFrameId===null&&(or(this._animationFrameId),this._animationFrameId=null)},t._animationFrame=function(){this._running&&(this.redraw(),this._requestAnimationFrame())},t._renderFrame=function(n){if(this.display){this.display._renderFrame(n);return}this.props.onRender(this._getAnimationProps())},t._clearNeedsRedraw=function(){this.needsRedraw=!1},t._setupFrame=function(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()},t._initializeAnimationProps=function(){var n;if(!this.device)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:(n=this.device)===null||n===void 0||(n=n.canvasContext)===null||n===void 0?void 0:n.canvas,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}},t._getAnimationProps=function(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps},t._updateAnimationProps=function(){if(this.animationProps){var n=this._getSizeAndAspect(),i=n.width,o=n.height,s=n.aspect;(i!==this.animationProps.width||o!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),s!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=i,this.animationProps.height=o,this.animationProps.aspect=s,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}},t._initDevice=function(){var r=lt(yt.default.mark(function i(){var o;return yt.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.props.device;case 2:if(this.device=c.sent,this.device){c.next=5;break}throw new Error("No device provided");case 5:this.canvas=((o=this.device.canvasContext)===null||o===void 0?void 0:o.canvas)||null;case 6:case"end":return c.stop()}},i,this)}));function n(){return r.apply(this,arguments)}return n}(),t._createInfoDiv=function(){if(this.canvas&&this.props.onAddHTML){var n=document.createElement("div");document.body.appendChild(n),n.style.position="relative";var i=document.createElement("div");i.style.position="absolute",i.style.left="10px",i.style.bottom="10px",i.style.width="300px",i.style.background="white",this.canvas instanceof HTMLCanvasElement&&n.appendChild(this.canvas),n.appendChild(i);var o=this.props.onAddHTML(i);o&&(i.innerHTML=o)}},t._getSizeAndAspect=function(){var n,i;if(!this.device)return{width:1,height:1,aspect:1};var o=((n=this.device)===null||n===void 0||(n=n.canvasContext)===null||n===void 0?void 0:n.getPixelSize())||[1,1],s=B(o,2),c=s[0],a=s[1],f=1,u=(i=this.device)===null||i===void 0||(i=i.canvasContext)===null||i===void 0?void 0:i.canvas;return u&&u.clientHeight?f=u.clientWidth/u.clientHeight:c>0&&a>0&&(f=c/a),{width:c,height:a,aspect:f}},t._resizeViewport=function(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)},t._resizeCanvasDrawingBuffer=function(){if(this.props.autoResizeDrawingBuffer){var n;(n=this.device)===null||n===void 0||(n=n.canvasContext)===null||n===void 0||n.resize({useDevicePixels:this.props.useDevicePixels})}},t._beginFrameTimers=function(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()},t._endFrameTimers=function(){this.cpuTime.timeEnd()},t._startEventHandling=function(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))},t._onMousemove=function(n){n instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[n.offsetX,n.offsetY])},t._onMouseleave=function(n){this._getAnimationProps()._mousePosition=null},P(e)}();var sr=pe(Qt(),1);function En(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Sn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?En(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):En(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mn(e,t){var r=this,n=null,i=t?.device||Dt.createDevice(),o=new be(Sn(Sn({},t),{},{device:i,onInitialize:function(c){return lt(sr.default.mark(function a(){var f;return sr.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=new e(c),l.next=3,(f=n)===null||f===void 0?void 0:f.onInitialize(c);case 3:return l.abrupt("return",l.sent);case 4:case"end":return l.stop()}},a)}))()},onRender:function(c){var a;return(a=n)===null||a===void 0?void 0:a.onRender(c)},onFinalize:function(c){var a;return(a=n)===null||a===void 0?void 0:a.onFinalize(c)}}));return o.getInfo=function(){return r.AnimationLoopTemplateCtor.info},o}function ar(e){if(Array.isArray(e))return Ft(e)}function cr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
7
|
+
"use strict";var __exports__=(()=>{var br=Object.defineProperty;var Bs=Object.getOwnPropertyDescriptor;var zs=Object.getOwnPropertyNames;var ks=Object.prototype.hasOwnProperty;var Vs=(t,e)=>{for(var r in e)br(t,r,{get:e[r],enumerable:!0})},Hs=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of zs(e))!ks.call(t,i)&&i!==r&&br(t,i,{get:()=>e[i],enumerable:!(n=Bs(e,i))||n.enumerable});return t};var Ks=t=>Hs(br({},"__esModule",{value:!0}),t);var km={};Vs(km,{AnimationLoop:()=>Ve,AnimationLoopTemplate:()=>On,ClipSpace:()=>qa,ConeGeometry:()=>as,CubeGeometry:()=>us,CylinderGeometry:()=>ds,GPUGeometry:()=>rr,Geometry:()=>Z,GroupNode:()=>$a,IcoSphereGeometry:()=>bs,KeyFrames:()=>bn,Model:()=>xt,ModelNode:()=>Ja,PipelineFactory:()=>xe,PlaneGeometry:()=>Ps,ScenegraphNode:()=>Et,SphereGeometry:()=>Ts,Timeline:()=>vn,Transform:()=>Ca,TruncatedConeGeometry:()=>Yt,_ShaderInputs:()=>er,makeAnimationLoop:()=>Ui});function ee(t){return ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(t)}function Ws(t,e){return Xs(t)||Ys(t,e)||yn(t,e)||qs()}function qs(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
8
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ys(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Xs(t){if(Array.isArray(t))return t}function wr(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=yn(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
9
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function yn(t,e){if(t){if(typeof t=="string")return mn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mn(t,e)}}function mn(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function dn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Zs(n.key),n)}}function $s(t,e,r){return e&&dn(t.prototype,e),r&&dn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Zs(t){var e=Js(t,"string");return ee(e)==="symbol"?e:String(e)}function Js(t,e){if(ee(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ee(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var tf=1,ef=1,vn=function(){function t(){Qs(this,t),this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}var e=t.prototype;return e.addChannel=function(n){var i=n.delay,o=i===void 0?0:i,a=n.duration,f=a===void 0?Number.POSITIVE_INFINITY:a,s=n.rate,l=s===void 0?1:s,p=n.repeat,y=p===void 0?1:p,g=tf++,w={time:0,delay:o,duration:f,rate:l,repeat:y};return this._setChannelTime(w,this.time),this.channels.set(g,w),g},e.removeChannel=function(n){this.channels.delete(n);var i=wr(this.animations),o;try{for(i.s();!(o=i.n()).done;){var a=Ws(o.value,2),f=a[0],s=a[1];s.channel===n&&this.detachAnimation(f)}}catch(l){i.e(l)}finally{i.f()}},e.isFinished=function(n){var i=this.channels.get(n);return i===void 0?!1:this.time>=i.delay+i.duration*i.repeat},e.getTime=function(n){if(n===void 0)return this.time;var i=this.channels.get(n);return i===void 0?-1:i.time},e.setTime=function(n){this.time=Math.max(0,n);var i=this.channels.values(),o=wr(i),a;try{for(o.s();!(a=o.n()).done;){var f=a.value;this._setChannelTime(f,this.time)}}catch(b){o.e(b)}finally{o.f()}var s=this.animations.values(),l=wr(s),p;try{for(l.s();!(p=l.n()).done;){var y=p.value,g=y.animation,w=y.channel;g.setTime(this.getTime(w))}}catch(b){l.e(b)}finally{l.f()}},e.play=function(){this.playing=!0},e.pause=function(){this.playing=!1,this.lastEngineTime=-1},e.reset=function(){this.setTime(0)},e.attachAnimation=function(n,i){var o=ef++;return this.animations.set(o,{animation:n,channel:i}),n.setTime(this.getTime(i)),o},e.detachAnimation=function(n){this.animations.delete(n)},e.update=function(n){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=n),this.setTime(this.time+(n-this.lastEngineTime)),this.lastEngineTime=n)},e._setChannelTime=function(n,i){var o=i-n.delay,a=n.duration*n.repeat;o>=a?n.time=n.duration*n.rate:(n.time=Math.max(0,o)%n.duration,n.time*=n.rate)},$s(t)}();function re(t){return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},re(t)}function gn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nf(n.key),n)}}function rf(t,e,r){return e&&gn(t.prototype,e),r&&gn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function nf(t){var e=of(t,"string");return re(e)==="symbol"?e:String(e)}function of(t,e){if(re(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(re(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function af(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var bn=function(){function t(r){af(this,t),this.startIndex=-1,this.endIndex=-1,this.factor=0,this.times=[],this.values=[],this._lastTime=-1,this.setKeyFrames(r),this.setTime(0)}var e=t.prototype;return e.setKeyFrames=function(n){var i=n.length;this.times.length=i,this.values.length=i;for(var o=0;o<i;++o)this.times[o]=n[o][0],this.values[o]=n[o][1];this._calculateKeys(this._lastTime)},e.setTime=function(n){n=Math.max(0,n),n!==this._lastTime&&(this._calculateKeys(n),this._lastTime=n)},e.getStartTime=function(){return this.times[this.startIndex]},e.getEndTime=function(){return this.times[this.endIndex]},e.getStartData=function(){return this.values[this.startIndex]},e.getEndData=function(){return this.values[this.endIndex]},e._calculateKeys=function(n){var i=0,o=this.times.length;for(i=0;i<o-2&&!(this.times[i+1]>n);++i);this.startIndex=i,this.endIndex=i+1;var a=this.times[this.startIndex],f=this.times[this.endIndex];this.factor=Math.min(Math.max(0,(n-a)/(f-a)),1)},rf(t)}();function At(t){return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(t)}function _r(){"use strict";_r=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}t.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(D([])));S&&S!==e&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,I=U.value;return I&&At(I)=="object"&&r.call(I,"__await")?c.resolve(I.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(I).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function j(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function N(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(j,this),this.reset(!0)}function D(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),t.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},t.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},t.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),t.AsyncIterator=T,t.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return t.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),t.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},t.values=D,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,I){return O.type="throw",O.arg=c,u.next=U,I&&(u.method="next",u.arg=void 0),!!I}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),N(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;N(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:D(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},t}function wn(t,e,r,n,i,o,a){try{var f=t[o](a),s=f.value}catch(l){r(l);return}f.done?e(s):Promise.resolve(s).then(n,i)}function sf(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(s){wn(o,n,i,a,f,"next",s)}function f(s){wn(o,n,i,a,f,"throw",s)}a(void 0)})}}function _n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,cf(n.key),n)}}function ff(t,e,r){return e&&_n(t.prototype,e),r&&_n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function cf(t){var e=uf(t,"string");return At(e)==="symbol"?e:String(e)}function uf(t,e){if(At(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(At(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function lf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var On=function(){function t(r){lf(this,t)}var e=t.prototype;return e.onInitialize=function(){var r=sf(_r().mark(function i(o){return _r().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",null);case 1:case"end":return f.stop()}},i)}));function n(i){return r.apply(this,arguments)}return n}(),ff(t)}();function Or(t){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let e=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}function J(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Or()}var hf=globalThis.self||globalThis.window||globalThis.global,Tt=globalThis.window||globalThis.self||globalThis.global,pf=globalThis.document||{},wt=globalThis.process||{},mf=globalThis.console,$m=globalThis.navigator||{};var Ne=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",Qm=J();function df(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var De=class{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=df(n),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}};function Sn(t){let e;return t<10?e="".concat(t.toFixed(2),"ms"):t<100?e="".concat(t.toFixed(1),"ms"):t<1e3?e="".concat(t.toFixed(0),"ms"):e="".concat((t/1e3).toFixed(2),"s"),e}function Pn(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}function Ce(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));let o=t.width*r,a=t.height*r,f=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),f]}var Fe;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Fe||(Fe={}));var yf=10;function xn(t){return typeof t!="string"?t:(t=t.toUpperCase(),Fe[t]||Fe.WHITE)}function En(t,e,r){if(!J&&typeof t=="string"){if(e){let n=xn(e);t="\x1B[".concat(n,"m").concat(t,"\x1B[39m")}if(r){let n=xn(r);t="\x1B[".concat(n+yf,"m").concat(t,"\x1B[49m")}}return t}function An(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r),i=t;for(let o of n){let a=i[o];typeof a=="function"&&(e.find(f=>o===f)||(i[o]=a.bind(t)))}}function Mt(t,e){if(!t)throw new Error(e||"Assertion failed")}function _t(){let t;if(J()&&Tt.performance){var e,r;t=Tt===null||Tt===void 0||(e=Tt.performance)===null||e===void 0||(r=e.now)===null||r===void 0?void 0:r.call(e)}else if("hrtime"in wt){var n;let i=wt===null||wt===void 0||(n=wt.hrtime)===null||n===void 0?void 0:n.call(wt);t=i[0]*1e3+i[1]/1e6}else t=Date.now();return t}var Rt={debug:J()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},vf={enabled:!0,level:0};function et(){}var Tn={},Mn={once:!0},ht=class{constructor(){let{id:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Ne,this._startTs=_t(),this._deltaTs=_t(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new De("__probe-".concat(this.id,"__"),vf),this.timeStamp("".concat(this.id," started")),An(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((_t()-this._startTs).toPrecision(10))}getDelta(){return Number((_t()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,r){this._storage.setConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){Mt(e,r)}warn(e){return this._getLogFunction(0,e,Rt.warn,arguments,Mn)}error(e){return this._getLogFunction(0,e,Rt.error,arguments)}deprecated(e,r){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(e,r){return this.error("`".concat(e,"` has been removed. Use `").concat(r,"` instead"))}probe(e,r){return this._getLogFunction(e,r,Rt.log,arguments,{time:!0,once:!0})}log(e,r){return this._getLogFunction(e,r,Rt.debug,arguments)}info(e,r){return this._getLogFunction(e,r,console.info,arguments)}once(e,r){return this._getLogFunction(e,r,Rt.debug||Rt.info,arguments,Mn)}table(e,r,n){return r?this._getLogFunction(e,r,console.table||et,n&&[n],{tag:_f(r)}):et}image(e){let{logLevel:r,priority:n,image:i,message:o="",scale:a=1}=e;return this._shouldLog(r||n)?J()?wf({image:i,message:o,scale:a}):bf({image:i,message:o,scale:a}):et}time(e,r){return this._getLogFunction(e,r,console.time?console.time:console.info)}timeEnd(e,r){return this._getLogFunction(e,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,r){return this._getLogFunction(e,r,console.timeStamp||et)}group(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=Rn({logLevel:e,message:r,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(e,r,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||et)}withGroup(e,r,n){this.group(e,r)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Ln(e)}_getLogFunction(e,r,n,i,o){if(this._shouldLog(e)){o=Rn({logLevel:e,message:r,args:i,opts:o}),n=n||o.method,Mt(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=_t();let a=o.tag||o.message;if(o.once&&a)if(!Tn[a])Tn[a]=_t();else return et;return r=gf(this.id,o.message,o),n.bind(console,r,...o.args)}return et}};ht.VERSION=Ne;function Ln(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Mt(Number.isFinite(e)&&e>=0),e}function Rn(t){let{logLevel:e,message:r}=t;t.logLevel=Ln(e);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let i=typeof t.message;return Mt(i==="string"||i==="object"),Object.assign(t,{args:n},t.opts)}function gf(t,e,r){if(typeof e=="string"){let n=r.time?Pn(Sn(r.total)):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),e=En(e,r.color,r.background)}return e}function bf(t){let{image:e,message:r="",scale:n=1}=t;return console.warn("removed"),et}function wf(t){let{image:e,message:r="",scale:n=1}=t;if(typeof e=="string"){let o=new Image;return o.onload=()=>{let a=Ce(o,r,n);console.log(...a)},o.src=e,et}let i=e.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Ce(e,r,n)),et;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...Ce(o,r,n)),o.src=e.toDataURL(),et}return et}function _f(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var Pd=new ht({id:"@probe.gl/log"});var B=new ht({id:"luma.gl"});function ne(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}var Ot=class{constructor(e,r){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=ne(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ne()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var pt=class{constructor(e){this.id=void 0,this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:e,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let r of Object.values(this.stats))e(r)}getTable(){let e={};return this.forEach(r=>{e[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(e){let{name:r,type:n}=e,i=this.stats[r];return i||(e instanceof Ot?i=e:i=new Ot(r,n),this.stats[r]=i),i}};function ie(t){return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(t)}function In(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Sf(n.key),n)}}function Of(t,e,r){return e&&In(t.prototype,e),r&&In(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Sf(t){var e=Pf(t,"string");return ie(e)==="symbol"?e:String(e)}function Pf(t,e){if(ie(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ie(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Ef=function(){function t(){xf(this,t),this.stats=new Map}var e=t.prototype;return e.getStats=function(n){return this.get(n)},e.get=function(n){return this.stats.has(n)||this.stats.set(n,new pt({id:n})),this.stats.get(n)},Of(t)}(),Lt=new Ef;function Af(){var t=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",e="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==t)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(t));return globalThis.luma||(J()&&B.log(1,"luma.gl ".concat(t," - ").concat(e))(),globalThis.luma=globalThis.luma||{VERSION:t,version:t,log:B,stats:Lt}),t}var jn=Af();function Tf(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)?t:null}function mt(t){return Array.isArray(t)?t.length===0||typeof t[0]=="number"?t:null:Tf(t)}var Sr={};function z(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Sr[t]=Sr[t]||1;var e=Sr[t]++;return"".concat(t,"-").concat(e)}function oe(t){return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oe(t)}function Nn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Mf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nn(Object(r),!0).forEach(function(n){Rf(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nn(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Rf(t,e,r){return e=Cn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Cn(n.key),n)}}function Lf(t,e,r){return e&&Dn(t.prototype,e),r&&Dn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Cn(t){var e=If(t,"string");return oe(e)==="symbol"?e:String(e)}function If(t,e){if(oe(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(oe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var St=function(){function t(r,n,i){if(jf(this,t),this.id=void 0,this.props=void 0,this.userData={},this.device=void 0,this._device=void 0,this.destroyed=!1,this.allocatedBytes=0,this._attachedResources=new Set,!r)throw new Error("no device");this._device=r,this.props=Nf(n,i);var o=this.props.id!=="undefined"?this.props.id:z(this[Symbol.toStringTag]);this.props.id=o,this.id=o,this.userData=this.props.userData||{},this.addStats()}var e=t.prototype;return e.destroy=function(){this.destroyResource()},e.delete=function(){return this.destroy(),this},e.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},e.getProps=function(){return this.props},e.attachResource=function(n){this._attachedResources.add(n)},e.detachResource=function(n){this._attachedResources.delete(n)},e.destroyAttachedResource=function(n){this._attachedResources.delete(n)&&n.destroy()},e.destroyAttachedResources=function(){for(var n=0,i=Object.values(this._attachedResources);n<i.length;n++){var o=i[n];o.destroy()}this._attachedResources=new Set},e.destroyResource=function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0},e.removeStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];n.get("".concat(i,"s Active")).decrementCount()},e.trackAllocatedMemory=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").addCount(n),o.get("".concat(i," Memory")).addCount(n),this.allocatedBytes=n},e.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").subtractCount(this.allocatedBytes),i.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},e.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),i=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(i,"s Created")).incrementCount(),n.get("".concat(i,"s Active")).incrementCount()},Lf(t)}();St.defaultProps={id:"undefined",handle:void 0,userData:void 0};function Nf(t,e){var r=Mf({},e);for(var n in t)t[n]!==void 0&&(r[n]=t[n]);return r}function It(t){return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(t)}var Gn;function Fn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Pr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Fn(Object(r),!0).forEach(function(n){Df(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Df(t,e,r){return e=Bn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Un(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bn(n.key),n)}}function Ff(t,e,r){return e&&Un(t.prototype,e),r&&Un(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bn(t){var e=Uf(t,"string");return It(e)==="symbol"?e:String(e)}function Uf(t,e){if(It(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(It(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gf(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xr(t,e)}function xr(t,e){return xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},xr(t,e)}function Bf(t){var e=Vf();return function(){var n=Ue(t),i;if(e){var o=Ue(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return zf(this,i)}}function zf(t,e){if(e&&(It(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kf(t)}function kf(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vf(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ue(t){return Ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ue(t)}Gn=Symbol.toStringTag;var k=function(t){Gf(r,t);var e=Bf(r);function r(i,o){var a;Cf(this,r);var f=Pr({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?f.indexType="uint32":o.data instanceof Uint16Array&&(f.indexType="uint16")),a=e.call(this,i,f,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=o.usage||0,a.indexType=f.indexType,a}var n=r.prototype;return n.write=function(o,a){throw new Error("not implemented")},n.readAsync=function(o,a){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},Ff(r,[{key:Gn,get:function(){return"Buffer"}}]),r}(St);k.defaultProps=Pr(Pr({},St.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});k.MAP_READ=1;k.MAP_WRITE=2;k.COPY_SRC=4;k.COPY_DST=8;k.INDEX=16;k.VERTEX=32;k.UNIFORM=64;k.STORAGE=128;k.INDIRECT=256;k.QUERY_RESOLVE=512;function ae(t){return ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(t)}var Vn;function zn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Er(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zn(Object(r),!0).forEach(function(n){Hf(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zn(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hf(t,e,r){return e=Hn(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Hn(n.key),n)}}function Wf(t,e,r){return e&&kn(t.prototype,e),r&&kn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Hn(t){var e=qf(t,"string");return ae(e)==="symbol"?e:String(e)}function qf(t,e){if(ae(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ae(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}Vn=Symbol.toStringTag;var se=function(){function t(r){Kf(this,t),this.id=void 0,this.statsManager=Lt,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Er(Er({},t.defaultProps),r),this.id=this.props.id||z(this[Symbol.toStringTag].toLowerCase())}var e=t.prototype;return e.loseDevice=function(){return!1},e.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},e.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},e.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},e._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var i=Er({},n);return(n.usage||0)&k.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":B.warn("indices buffer content must be of integer type")()),i},Wf(t,[{key:Vn,get:function(){return"Device"}}]),t}();se.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(B.get("debug")),break:[],gl:null};se.VERSION=jn;function Nt(t){return Nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nt(t)}function Ar(){"use strict";Ar=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}t.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(D([])));S&&S!==e&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,I=U.value;return I&&Nt(I)=="object"&&r.call(I,"__await")?c.resolve(I.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(I).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function j(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function N(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(j,this),this.reset(!0)}function D(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),t.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},t.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},t.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),t.AsyncIterator=T,t.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return t.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),t.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},t.values=D,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,I){return O.type="throw",O.arg=c,u.next=U,I&&(u.method="next",u.arg=void 0),!!I}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),N(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;N(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:D(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},t}function Kn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Wn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Kn(Object(r),!0).forEach(function(n){Yf(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kn(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Yf(t,e,r){return e=$n(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qn(t,e,r,n,i,o,a){try{var f=t[o](a),s=f.value}catch(l){r(l);return}f.done?e(s):Promise.resolve(s).then(n,i)}function Xf(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(s){qn(o,n,i,a,f,"next",s)}function f(s){qn(o,n,i,a,f,"throw",s)}a(void 0)})}}function $f(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Zf(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
10
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Zf(t,e){if(t){if(typeof t=="string")return Yn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yn(t,e)}}function Yn(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Xn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$n(n.key),n)}}function Jf(t,e,r){return e&&Xn(t.prototype,e),r&&Xn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $n(t){var e=Qf(t,"string");return Nt(e)==="symbol"?e:String(e)}function Qf(t,e){if(Nt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Nt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var jt=new Map,Pt=function(){function t(){tc(this,t)}return t.registerDevices=function(r){var n=$f(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;W(o.type&&o.isSupported&&o.create),jt.set(o.type,o)}}catch(a){n.e(a)}finally{n.f()}},t.getAvailableDevices=function(){return Array.from(jt).map(function(r){return r.type})},t.getSupportedDevices=function(){return Array.from(jt).filter(function(r){return r.isSupported()}).map(function(r){return r.type})},t.setDefaultDeviceProps=function(r){Object.assign(se.defaultProps,r)},t.createDevice=function(){var e=Xf(Ar().mark(function n(){var i,o,a=arguments;return Ar().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:i=a.length>0&&a[0]!==void 0?a[0]:{},i=Wn(Wn({},se.defaultProps),i),i.gl&&(i.type="webgl"),s.t0=i.type,s.next=s.t0==="webgpu"?6:s.t0==="webgl"||s.t0==="webgl1"||s.t0==="webgl2"?12:s.t0==="best-available"?18:24;break;case 6:if(o=jt.get("webgpu"),!o){s.next=11;break}return s.next=10,o.create(i);case 10:return s.abrupt("return",s.sent);case 11:return s.abrupt("break",24);case 12:if(o=jt.get("webgl"),!o){s.next=17;break}return s.next=16,o.create(i);case 16:return s.abrupt("return",s.sent);case 17:return s.abrupt("break",24);case 18:if(o=jt.get("webgl"),!(o&&o.isSupported())){s.next=23;break}return s.next=22,o.create(i);case 22:return s.abrupt("return",s.sent);case 23:return s.abrupt("break",24);case 24:throw new Error("No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.");case 25:case"end":return s.stop()}},n)}));function r(){return e.apply(this,arguments)}return r}(),Jf(t)}();Pt.stats=Lt;Pt.log=B;function Dt(t){return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dt(t)}var ti;function Zn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Jn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Zn(Object(r),!0).forEach(function(n){ec(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zn(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ec(t,e,r){return e=ei(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ei(n.key),n)}}function nc(t,e,r){return e&&Qn(t.prototype,e),r&&Qn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ei(t){var e=ic(t,"string");return Dt(e)==="symbol"?e:String(e)}function ic(t,e){if(Dt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Dt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oc(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tr(t,e)}function Tr(t,e){return Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Tr(t,e)}function ac(t){var e=cc();return function(){var n=Ge(t),i;if(e){var o=Ge(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return sc(this,i)}}function sc(t,e){if(e&&(Dt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fc(t)}function fc(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ge(t){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ge(t)}ti=Symbol.toStringTag;var Ct=function(t){oc(r,t);var e=ac(r);function r(n,i){var o;return rc(this,r),o=e.call(this,n,i,r.defaultProps),o.hash="",o.vs=void 0,o.fs=void 0,o.shaderLayout=void 0,o.bufferLayout=void 0,o.shaderLayout=o.props.shaderLayout,o.bufferLayout=o.props.bufferLayout||[],o}return nc(r,[{key:ti,get:function(){return"RenderPipeline"}}]),r}(St);Ct.defaultProps=Jn(Jn({},St.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});function uc(t,e){return mc(t)||pc(t,e)||hc(t,e)||lc()}function lc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
11
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hc(t,e){if(t){if(typeof t=="string")return ri(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ri(t,e)}}function ri(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function pc(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function mc(t){if(Array.isArray(t))return t}function ni(t){var e=uc(yc[t],2),r=e[0],n=e[1],i=r==="i32"||r==="u32",o=r!=="u32",a=vc[r]*n,f=dc(r,n);return{dataType:r,components:n,defaultVertexFormat:f,byteLength:a,integer:i,signed:o}}function dc(t,e){var r;switch(t){case"f32":r="float32";break;case"i32":r="sint32";break;case"u32":r="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return e===1?r:"".concat(r,"x").concat(e)}var yc={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},vc={f32:4,f16:2,i32:4,u32:4};function oi(t){var e=ii[t],r=gc(e),n=t.includes("norm"),i=!n&&!t.startsWith("float"),o=t.startsWith("s");return{dataType:ii[t],byteLength:r,integer:i,signed:o,normalized:n}}function gc(t){var e=bc[t];return e}var ii={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},bc={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function wc(t,e){return Pc(t)||Sc(t,e)||Oc(t,e)||_c()}function _c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oc(t,e){if(t){if(typeof t=="string")return ai(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ai(t,e)}}function ai(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Sc(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Pc(t){if(Array.isArray(t))return t}function Mr(t){var e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);var r=t.split("x"),n=wc(r,2),i=n[0],o=n[1],a=i,f=o?parseInt(o):1,s=oi(a),l={type:a,components:f,byteLength:s.byteLength*f,integer:s.integer,signed:s.signed,normalized:s.normalized};return e&&(l.webglOnly=!0),l}function fe(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=xc(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
13
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function xc(t,e){if(t){if(typeof t=="string")return si(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return si(t,e)}}function si(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Rr(t,e){var r={},n=fe(t.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=Ec(t,e,o.name)}}catch(a){n.e(a)}finally{n.f()}return r}function Ec(t,e,r){var n=Ac(t,r),i=Tc(e,r);if(!n)return null;var o=ni(n.type),a=i?.vertexFormat||o.defaultVertexFormat,f=Mr(a);return{attributeName:i?.attributeName||n.name,bufferName:i?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:a,bufferDataType:f.type,bufferComponents:f.components,normalized:f.normalized,integer:o.integer,stepMode:i?.stepMode||n.stepMode,byteOffset:i?.byteOffset||0,byteStride:i?.byteStride||0}}function Ac(t,e){var r=t.attributes.find(function(n){return n.name===e});return r||B.warn('shader layout attribute "'.concat(e,'" not present in shader')),r||null}function Tc(t,e){Mc(t);var r=Rc(t,e);return r||(r=Lc(t,e),r)?r:(B.warn('layout for attribute "'.concat(e,'" not present in buffer layout')),null)}function Mc(t){var e=fe(t),r;try{for(e.s();!(r=e.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&B.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){e.e(i)}finally{e.f()}}function Rc(t,e){var r=fe(t),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.format&&i.name===e)return{attributeName:i.name,bufferName:e,stepMode:i.stepMode,vertexFormat:i.format,byteOffset:0,byteStride:i.byteStride||0}}}catch(o){r.e(o)}finally{r.f()}return null}function Lc(t,e){var r=fe(t),n;try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=o.byteStride;if(typeof o.byteStride!="number"){var f=fe(o.attributes||[]),s;try{for(f.s();!(s=f.n()).done;){var l=s.value,p=Mr(l.format);a+=p.byteLength}}catch(g){f.e(g)}finally{f.f()}}var y=(i=o.attributes)===null||i===void 0?void 0:i.find(function(g){return g.attribute===e});if(y)return{attributeName:y.attribute,bufferName:o.name,stepMode:o.stepMode,vertexFormat:y.format,byteOffset:y.byteOffset,byteStride:a}}}catch(g){r.e(g)}finally{r.f()}return null}function W(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}var Ic={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function fi(t){var e=Ic[t];return W(t),e}function ci(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}var Be;function ui(t){return(!Be||Be.byteLength<t)&&(Be=new ArrayBuffer(t)),Be}function ce(t){return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ce(t)}function li(t,e){return Cc(t)||Dc(t,e)||Nc(t,e)||jc()}function jc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
14
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nc(t,e){if(t){if(typeof t=="string")return hi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hi(t,e)}}function hi(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Dc(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Cc(t){if(Array.isArray(t))return t}function pi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Uc(n.key),n)}}function Fc(t,e,r){return e&&pi(t.prototype,e),r&&pi(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Uc(t){var e=Gc(t,"string");return ce(e)==="symbol"?e:String(e)}function Gc(t,e){if(ce(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ce(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var mi=1024,di=function(){function t(r){Bc(this,t),this.layout={},this.byteLength=void 0;for(var n=0,i=0,o=Object.entries(r);i<o.length;i++){var a=li(o[i],2),f=a[0],s=a[1],l=fi(s),p=l.type,y=l.components;n=ci(n,y);var g=n;n+=y,this.layout[f]={type:p,size:y,offset:g}}n+=(4-n%4)%4;var w=n*4;this.byteLength=Math.max(w,mi)}var e=t.prototype;return e.getData=function(n){for(var i=Math.max(this.byteLength,mi),o=ui(i),a={i32:new Int32Array(o),u32:new Uint32Array(o),f32:new Float32Array(o),f16:new Uint16Array(o)},f=0,s=Object.entries(n);f<s.length;f++){var l=li(s[f],2),p=l[0],y=l[1],g=this.layout[p];if(!g){B.warn("Supplied uniform value ".concat(p," not present in uniform block layout"))();continue}var w=g.type,b=g.size,_=g.offset,x=a[w];if(b===1){if(typeof y!="number"&&typeof y!="boolean"){B.warn("Supplied value for single component uniform ".concat(p," is not a number: ").concat(y))();continue}x[_]=Number(y)}else{var S=mt(y);if(!S){B.warn("Supplied value for multi component / array uniform ".concat(p," is not a numeric array: ").concat(y))();continue}x.set(S,_)}}return new Uint8Array(o)},e.has=function(n){return Boolean(this.layout[n])},e.get=function(n){var i=this.layout[n];return i},Fc(t)}();function yi(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16;if(t!==e)return!1;var n=mt(t);if(!n)return!1;var i=mt(e);if(i&&n.length===i.length){for(var o=0;o<n.length;++o)if(i[o]!==n[o])return!1}return!0}function vi(t){var e=mt(t);return e?e.slice():t}function ue(t){return ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(t)}function zc(t,e){return Hc(t)||Vc(t,e)||wi(t,e)||kc()}function kc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
15
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vc(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Hc(t){if(Array.isArray(t))return t}function Kc(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=wi(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
16
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function wi(t,e){if(t){if(typeof t=="string")return gi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gi(t,e)}}function gi(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qc(n.key),n)}}function Wc(t,e,r){return e&&bi(t.prototype,e),r&&bi(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function qc(t){var e=Yc(t,"string");return ue(e)==="symbol"?e:String(e)}function Yc(t,e){if(ue(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ue(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var _i=function(){function t(r){if(Xc(this,t),this.name=void 0,this.uniforms={},this.modifiedUniforms={},this.modified=!0,this.bindingLayout={},this.needsRedraw="initialized",this.name=r?.name,r!=null&&r.name&&r!==null&&r!==void 0&&r.shaderLayout){var n,i=r==null||(n=r.shaderLayout.bindings)===null||n===void 0?void 0:n.find(function(l){return l.type==="uniform"&&l.name===r?.name});if(!i)throw new Error(r?.name);var o=i,a=Kc(o.uniforms||[]),f;try{for(a.s();!(f=a.n()).done;){var s=f.value;this.bindingLayout[s.name]=s}}catch(l){a.e(l)}finally{a.f()}}}var e=t.prototype;return e.setUniforms=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=zc(o[i],2),f=a[0],s=a[1];this._setUniform(f,s),this.needsRedraw||this.setNeedsRedraw("".concat(this.name,".").concat(f,"=").concat(s))}},e.setNeedsRedraw=function(n){this.needsRedraw=this.needsRedraw||n},e.getAllUniforms=function(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}},e._setUniform=function(n,i){yi(this.uniforms[n],i)||(this.uniforms[n]=vi(i),this.modifiedUniforms[n]=!0,this.modified=!0)},Wc(t)}();function le(t){return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(t)}function $c(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=xi(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
17
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Oi(t,e){return Qc(t)||Jc(t,e)||xi(t,e)||Zc()}function Zc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xi(t,e){if(t){if(typeof t=="string")return Si(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Si(t,e)}}function Si(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Jc(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Qc(t){if(Array.isArray(t))return t}function Pi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,eu(n.key),n)}}function tu(t,e,r){return e&&Pi(t.prototype,e),r&&Pi(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function eu(t){var e=ru(t,"string");return le(e)==="symbol"?e:String(e)}function ru(t,e){if(le(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(le(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Lr=function(){function t(r){nu(this,t),this.uniformBlocks=new Map,this.uniformBufferLayouts=new Map,this.uniformBuffers=new Map;for(var n=0,i=Object.entries(r);n<i.length;n++){var o=Oi(i[n],2),a=o[0],f=o[1],s=a,l=new di(f.uniformTypes||{});this.uniformBufferLayouts.set(s,l);var p=new _i({name:a});p.setUniforms(f.defaultUniforms||{}),this.uniformBlocks.set(s,p)}}var e=t.prototype;return e.destroy=function(){for(var n=0,i=Object.values(this.uniformBuffers);n<i.length;n++){var o=i[n];o.destroy()}},e.setUniforms=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=Oi(o[i],2),f=a[0],s=a[1];this.uniformBlocks.get(f).setUniforms(s)}this.updateUniformBuffers()},e.getUniformBufferByteLength=function(n){return this.uniformBufferLayouts.get(n).byteLength},e.getUniformBufferData=function(n){var i=this.uniformBlocks.get(n).getAllUniforms();return this.uniformBufferLayouts.get(n).getData(i)},e.createUniformBuffer=function(n,i,o){o&&this.setUniforms(o);var a=this.getUniformBufferByteLength(i),f=n.createBuffer({usage:k.UNIFORM,byteLength:a}),s=this.getUniformBufferData(i);return f.write(s),f},e.getManagedUniformBuffer=function(n,i){if(!this.uniformBuffers.get(i)){var o=this.getUniformBufferByteLength(i),a=n.createBuffer({usage:k.UNIFORM,byteLength:o});this.uniformBuffers.set(i,a)}return this.uniformBuffers.get(i)},e.updateUniformBuffers=function(){var n=!1,i=$c(this.uniformBlocks.keys()),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,f=this.updateUniformBuffer(a);n||(n=f)}}catch(s){i.e(s)}finally{i.f()}return n&&B.log(3,"UniformStore.updateUniformBuffers(): ".concat(n))(),n},e.updateUniformBuffer=function(n){var i=this.uniformBlocks.get(n),o=this.uniformBuffers.get(n),a=!1;if(o&&i.needsRedraw){a||(a=i.needsRedraw);var f=this.getUniformBufferData(n),s=this.uniformBuffers.get(n);s.write(f);var l=this.uniformBlocks.get(n).getAllUniforms();B.log(4,"Writing to uniform buffer ".concat(String(n)),f,l)()}return a},tu(t)}();function Ei(t){var e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function Ir(t,e,r){if(!e||e>4)throw new Error("size ".concat(e));var n=e,i=Ei(t);if(i==="uint8"||i==="sint8"){if(n===1||n===3)throw new Error("size: ".concat(e));return r&&(i=i.replace("int","norm")),"".concat(i,"x").concat(n)}if(i==="uint16"||i==="sint16"){if(n===1||n===3)throw new Error("size: ".concat(e));return r&&(i=i.replace("int","norm")),"".concat(i,"x").concat(n)}return n===1?i:"".concat(i,"x").concat(n)}function Ai(t){return mt(t)!==null||typeof t=="number"||typeof t=="boolean"}function jr(t){var e={bindings:{},uniforms:{}};return Object.keys(t).forEach(function(r){var n=t[r];Ai(n)?e.uniforms[r]=n:e.bindings[r]=n}),e}function ze(t){return ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ze(t)}function he(t,e,r){if(t===e)return!0;if(!r||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!he(t[n],e[n],r-1))return!1;return!0}if(Array.isArray(e))return!1;if(ze(t)==="object"&&ze(e)==="object"){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(var a=0,f=i;a<f.length;a++){var s=f[a];if(!e.hasOwnProperty(s)||!he(t[s],e[s],r-1))return!1}return!0}return!1}function Nr(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function Dr(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}var Ti=function(e){return"".concat(e)};function Ft(t){return Ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ft(t)}function iu(t,e){return fu(t)||su(t,e)||au(t,e)||ou()}function ou(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
19
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function au(t,e){if(t){if(typeof t=="string")return Mi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mi(t,e)}}function Mi(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function su(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function fu(t){if(Array.isArray(t))return t}function Ri(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Li(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ri(Object(r),!0).forEach(function(n){cu(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ri(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function cu(t,e,r){return e=Ni(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ii(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ni(n.key),n)}}function uu(t,e,r){return e&&Ii(t.prototype,e),r&&Ii(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ni(t){var e=lu(t,"string");return Ft(e)==="symbol"?e:String(e)}function lu(t,e){if(Ft(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ft(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function st(){"use strict";st=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}t.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(D([])));S&&S!==e&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,I=U.value;return I&&Ft(I)=="object"&&r.call(I,"__await")?c.resolve(I.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(I).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function j(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function N(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(j,this),this.reset(!0)}function D(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),t.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},t.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},t.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),t.AsyncIterator=T,t.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return t.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),t.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},t.values=D,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,I){return O.type="throw",O.arg=c,u.next=U,I&&(u.method="next",u.arg=void 0),!!I}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),N(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;N(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:D(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},t}function ji(t,e,r,n,i,o,a){try{var f=t[o](a),s=f.value}catch(l){r(l);return}f.done?e(s):Promise.resolve(s).then(n,i)}function ke(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(s){ji(o,n,i,a,f,"next",s)}function f(s){ji(o,n,i,a,f,"throw",s)}a(void 0)})}}var pu=0,mu={device:null,onAddHTML:function(){return""},onInitialize:function(){var t=ke(st().mark(function r(){return st().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",null);case 1:case"end":return i.stop()}},r)}));function e(){return t.apply(this,arguments)}return e}(),onRender:function(){},onFinalize:function(){},onError:function(e){return console.error(e)},stats:Pt.stats.get("animation-loop-".concat(pu++)),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1},Ve=function(){function t(r){if(hu(this,t),this.device=null,this.canvas=null,this.props=void 0,this.animationProps=null,this.timeline=null,this.stats=void 0,this.cpuTime=void 0,this.gpuTime=void 0,this.frameRate=void 0,this.display=void 0,this.needsRedraw="initialized",this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.props=Li(Li({},mu),r),r=this.props,!r.device)throw new Error("No device provided");var n=this.props.useDevicePixels,i=n===void 0?!0:n;this.stats=r.stats||new pt({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:r.autoResizeViewport,autoResizeDrawingBuffer:r.autoResizeDrawingBuffer,useDevicePixels:i}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}var e=t.prototype;return e.destroy=function(){this.stop(),this._setDisplay(null)},e.delete=function(){this.destroy()},e.setNeedsRedraw=function(n){return this.needsRedraw=this.needsRedraw||n,this},e.setProps=function(n){return"autoResizeViewport"in n&&(this.props.autoResizeViewport=n.autoResizeViewport||!1),"autoResizeDrawingBuffer"in n&&(this.props.autoResizeDrawingBuffer=n.autoResizeDrawingBuffer||!1),"useDevicePixels"in n&&(this.props.useDevicePixels=n.useDevicePixels||!1),this},e.start=function(){var r=ke(st().mark(function i(){var o,a;return st().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this._running){s.next=2;break}return s.abrupt("return",this);case 2:if(this._running=!0,s.prev=3,this._initialized){s.next=11;break}return this._initialized=!0,s.next=8,this._initDevice();case 8:return this._initialize(),s.next=11,this.props.onInitialize(this._getAnimationProps());case 11:if(this._running){s.next=13;break}return s.abrupt("return",null);case 13:return o!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),s.abrupt("return",this);case 17:throw s.prev=17,s.t0=s.catch(3),a=s.t0 instanceof Error?s.t0:new Error("Unknown error"),this.props.onError(a),a;case 22:case"end":return s.stop()}},i,this,[[3,17]])}));function n(){return r.apply(this,arguments)}return n}(),e.redraw=function(){var n;return(n=this.device)!==null&&n!==void 0&&n.isLost?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)},e.stop=function(){return this._running&&(this.animationProps&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this},e.attachTimeline=function(n){return this.timeline=n,this.timeline},e.detachTimeline=function(){this.timeline=null},e.waitForRender=function(){var n=this;return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(function(i){n._resolveNextFrame=i})),this._nextFramePromise},e.toDataURL=function(){var r=ke(st().mark(function i(){return st().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return this.setNeedsRedraw("toDataURL"),a.next=3,this.waitForRender();case 3:if(!(this.canvas instanceof HTMLCanvasElement)){a.next=5;break}return a.abrupt("return",this.canvas.toDataURL());case 5:throw new Error("OffscreenCanvas");case 6:case"end":return a.stop()}},i,this)}));function n(){return r.apply(this,arguments)}return n}(),e._initialize=function(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()},e._setDisplay=function(n){this.display&&(this.display.destroy(),this.display.animationLoop=null),n&&(n.animationLoop=this),this.display=n},e._requestAnimationFrame=function(){this._running&&(this._animationFrameId=Nr(this._animationFrame.bind(this)))},e._cancelAnimationFrame=function(){this._animationFrameId!=null&&(Dr(this._animationFrameId),this._animationFrameId=null)},e._animationFrame=function(){this._running&&(this.redraw(),this._requestAnimationFrame())},e._renderFrame=function(n){if(this.display){this.display._renderFrame(n);return}this.props.onRender(this._getAnimationProps())},e._clearNeedsRedraw=function(){this.needsRedraw=!1},e._setupFrame=function(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()},e._initializeAnimationProps=function(){var n;if(!this.device)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:(n=this.device)===null||n===void 0||(n=n.canvasContext)===null||n===void 0?void 0:n.canvas,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}},e._getAnimationProps=function(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps},e._updateAnimationProps=function(){if(this.animationProps){var n=this._getSizeAndAspect(),i=n.width,o=n.height,a=n.aspect;(i!==this.animationProps.width||o!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),a!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=i,this.animationProps.height=o,this.animationProps.aspect=a,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}},e._initDevice=function(){var r=ke(st().mark(function i(){var o;return st().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.props.device;case 2:if(this.device=f.sent,this.device){f.next=5;break}throw new Error("No device provided");case 5:this.canvas=((o=this.device.canvasContext)===null||o===void 0?void 0:o.canvas)||null;case 6:case"end":return f.stop()}},i,this)}));function n(){return r.apply(this,arguments)}return n}(),e._createInfoDiv=function(){if(this.canvas&&this.props.onAddHTML){var n=document.createElement("div");document.body.appendChild(n),n.style.position="relative";var i=document.createElement("div");i.style.position="absolute",i.style.left="10px",i.style.bottom="10px",i.style.width="300px",i.style.background="white",this.canvas instanceof HTMLCanvasElement&&n.appendChild(this.canvas),n.appendChild(i);var o=this.props.onAddHTML(i);o&&(i.innerHTML=o)}},e._getSizeAndAspect=function(){var n,i;if(!this.device)return{width:1,height:1,aspect:1};var o=((n=this.device)===null||n===void 0||(n=n.canvasContext)===null||n===void 0?void 0:n.getPixelSize())||[1,1],a=iu(o,2),f=a[0],s=a[1],l=1,p=(i=this.device)===null||i===void 0||(i=i.canvasContext)===null||i===void 0?void 0:i.canvas;return p&&p.clientHeight?l=p.clientWidth/p.clientHeight:f>0&&s>0&&(l=f/s),{width:f,height:s,aspect:l}},e._resizeViewport=function(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)},e._resizeCanvasDrawingBuffer=function(){if(this.props.autoResizeDrawingBuffer){var n;(n=this.device)===null||n===void 0||(n=n.canvasContext)===null||n===void 0||n.resize({useDevicePixels:this.props.useDevicePixels})}},e._beginFrameTimers=function(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()},e._endFrameTimers=function(){this.cpuTime.timeEnd()},e._startEventHandling=function(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))},e._onMousemove=function(n){n instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[n.offsetX,n.offsetY])},e._onMouseleave=function(n){this._getAnimationProps()._mousePosition=null},uu(t)}();function Ut(t){return Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ut(t)}function Cr(){"use strict";Cr=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}t.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(D([])));S&&S!==e&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,I=U.value;return I&&Ut(I)=="object"&&r.call(I,"__await")?c.resolve(I.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(I).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function j(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function N(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(j,this),this.reset(!0)}function D(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),t.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},t.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},t.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),t.AsyncIterator=T,t.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return t.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),t.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},t.values=D,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(N),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,I){return O.type="throw",O.arg=c,u.next=U,I&&(u.method="next",u.arg=void 0),!!I}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),N(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;N(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:D(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},t}function Di(t,e,r,n,i,o,a){try{var f=t[o](a),s=f.value}catch(l){r(l);return}f.done?e(s):Promise.resolve(s).then(n,i)}function du(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(s){Di(o,n,i,a,f,"next",s)}function f(s){Di(o,n,i,a,f,"throw",s)}a(void 0)})}}function Ci(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Fi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ci(Object(r),!0).forEach(function(n){yu(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ci(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function yu(t,e,r){return e=vu(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vu(t){var e=gu(t,"string");return Ut(e)==="symbol"?e:String(e)}function gu(t,e){if(Ut(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ut(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ui(t,e){var r=this,n=null,i=e?.device||Pt.createDevice(),o=new Ve(Fi(Fi({},e),{},{device:i,onInitialize:function(f){return du(Cr().mark(function s(){var l;return Cr().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return n=new t(f),y.next=3,(l=n)===null||l===void 0?void 0:l.onInitialize(f);case 3:return y.abrupt("return",y.sent);case 4:case"end":return y.stop()}},s)}))()},onRender:function(f){var s;return(s=n)===null||s===void 0?void 0:s.onRender(f)},onFinalize:function(f){var s;return(s=n)===null||s===void 0?void 0:s.onFinalize(f)}}));return o.getInfo=function(){return r.AnimationLoopTemplateCtor.info},o}var K=function(e){return"".concat(e)};function it(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}function Gi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function dt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Gi(Object(r),!0).forEach(function(n){bu(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bu(t,e,r){return e=wu(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wu(t){var e=_u(t,"string");return yt(e)==="symbol"?e:String(e)}function _u(t,e){if(yt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(yt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ki(t,e){return xu(t)||Pu(t,e)||Su(t,e)||Ou()}function Ou(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
20
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Su(t,e){if(t){if(typeof t=="string")return Bi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bi(t,e)}}function Bi(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Pu(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function xu(t){if(Array.isArray(t))return t}function yt(t){return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(t)}var Fr={number:{type:"number",validate:function(e,r){return Number.isFinite(e)&&yt(r)==="object"&&(r.max===void 0||e<=r.max)&&(r.min===void 0||e>=r.min)}},array:{type:"array",validate:function(e,r){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function Vi(t){for(var e={},r=0,n=Object.entries(t);r<n.length;r++){var i=ki(n[r],2),o=i[0],a=i[1];e[o]=Eu(a)}return e}function Hi(t,e,r){for(var n={},i=0,o=Object.entries(e);i<o.length;i++){var a=ki(o[i],2),f=a[0],s=a[1];t&&f in t&&!s.private?(s.validate&&it(s.validate(t[f],s),"".concat(r,": invalid ").concat(f)),n[f]=t[f]):n[f]=s.value}return n}function Eu(t){var e=zi(t);if(e!=="object")return dt(dt({value:t},Fr[e]),{},{type:e});if(yt(t)==="object")return t?t.type!==void 0?dt(dt(dt({},t),Fr[t.type]),{},{type:t.type}):t.value===void 0?{type:"object",value:t}:(e=zi(t.value),dt(dt(dt({},t),Fr[e]),{},{type:e})):{type:"object",value:null};throw new Error("props")}function zi(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":yt(t)}var Ki,Wi;function qi(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Yi=K(Ki||(Ki=qi([`#ifdef MODULE_LOGDEPTH
|
|
13
21
|
logdepth_adjustPosition(gl_Position);
|
|
14
22
|
#endif
|
|
15
23
|
`],[`\\
|
|
16
24
|
#ifdef MODULE_LOGDEPTH
|
|
17
25
|
logdepth_adjustPosition(gl_Position);
|
|
18
26
|
#endif
|
|
19
|
-
`]))),
|
|
27
|
+
`]))),Xi=K(Wi||(Wi=qi([`#ifdef MODULE_MATERIAL
|
|
20
28
|
gl_FragColor = material_filterColor(gl_FragColor);
|
|
21
29
|
#endif
|
|
22
30
|
|
|
@@ -57,13 +65,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
57
65
|
#ifdef MODULE_LOGDEPTH
|
|
58
66
|
logdepth_setFragDepth();
|
|
59
67
|
#endif
|
|
60
|
-
`])));var
|
|
68
|
+
`])));var Au={vertex:Yi,fragment:Xi},$i=/void\s+main\s*\([^)]*\)\s*\{\n?/,Zi=/}\n?[^{}]*$/,Ur=[],pe="__LUMA_INJECT_DECLARATIONS__";function Ji(t){var e={vertex:{},fragment:{}};for(var r in t){var n=t[r],i=Tu(r);typeof n=="string"&&(n={order:0,injection:n}),e[i][r]=n}return e}function Tu(t){var e=t.slice(0,2);switch(e){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(e)}}function me(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=e==="vertex",o=function(){var s=r[a];s.sort(function(g,w){return g.order-w.order}),Ur.length=s.length;for(var l=0,p=s.length;l<p;++l)Ur[l]=s[l].injection;var y="".concat(Ur.join(`
|
|
61
69
|
`),`
|
|
62
|
-
`);switch(
|
|
63
|
-
`).concat(i,"// END MODULE_").concat(this.name,`
|
|
70
|
+
`);switch(a){case"vs:#decl":i&&(t=t.replace(pe,y));break;case"vs:#main-start":i&&(t=t.replace($i,function(g){return g+y}));break;case"vs:#main-end":i&&(t=t.replace(Zi,function(g){return y+g}));break;case"fs:#decl":i||(t=t.replace(pe,y));break;case"fs:#main-start":i||(t=t.replace($i,function(g){return g+y}));break;case"fs:#main-end":i||(t=t.replace(Zi,function(g){return y+g}));break;default:t=t.replace(a,function(g){return g+y})}};for(var a in r)o();return t=t.replace(pe,""),n&&(t=t.replace(/\}\s*$/,function(f){return f+Au[e]})),t}function de(t){return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},de(t)}function Qi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ru(n.key),n)}}function Mu(t,e,r){return e&&Qi(t.prototype,e),r&&Qi(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ru(t){var e=Lu(t,"string");return de(e)==="symbol"?e:String(e)}function Lu(t,e){if(de(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(de(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Iu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var ju=1,He=function(){t.instantiateModules=function(n){return n.map(function(i){if(i instanceof t)return i;it(typeof i!="string","Shader module use by name is deprecated. Import shader module '".concat(i,"' and use it directly.")),i.name||(console.warn("shader module has no name"),i.name="shader-module-".concat(ju++));var o=new t(i);return o.dependencies=t.instantiateModules(i.dependencies||[]),o})};function t(r){Iu(this,t),this.name=void 0,this.vs=void 0,this.fs=void 0,this.getModuleUniforms=void 0,this.dependencies=void 0,this.deprecations=void 0,this.defines=void 0,this.injections=void 0,this.uniforms={},this.uniformTypes={};var n=r.name,i=r.vs,o=r.fs,a=r.dependencies,f=a===void 0?[]:a,s=r.uniformPropTypes,l=s===void 0?{}:s,p=r.getUniforms,y=r.deprecations,g=y===void 0?[]:y,w=r.defines,b=w===void 0?{}:w,_=r.inject,x=_===void 0?{}:_;it(typeof n=="string"),this.name=n,this.vs=i,this.fs=o,this.getModuleUniforms=p,this.dependencies=t.instantiateModules(f),this.deprecations=this._parseDeprecationDefinitions(g),this.defines=b,this.injections=Ji(x),l&&(this.uniforms=Vi(l))}var e=t.prototype;return e.getModuleSource=function(n){var i;switch(n){case"vertex":i=this.vs||"";break;case"fragment":i=this.fs||"";break;default:it(!1)}var o=this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");return"// ----- MODULE ".concat(this.name,` ---------------
|
|
64
71
|
|
|
65
|
-
`)
|
|
66
|
-
|
|
72
|
+
#define MODULE_`).concat(o,`
|
|
73
|
+
`).concat(i,`
|
|
74
|
+
|
|
75
|
+
`)},e.getUniforms=function(n,i){return this.getModuleUniforms?this.getModuleUniforms(n,i):Hi(n,this.uniforms,this.name)},e.getDefines=function(){return this.defines},e.checkDeprecations=function(n,i){this.deprecations.forEach(function(o){var a;(a=o.regex)!==null&&a!==void 0&&a.test(n)&&(o.deprecated?i.deprecated(o.old,o.new)():i.removed(o.old,o.new)())})},e._parseDeprecationDefinitions=function(n){return n.forEach(function(i){switch(i.type){case"function":i.regex=new RegExp("\\b".concat(i.old,"\\("));break;default:i.regex=new RegExp("".concat(i.type," ").concat(i.old,";"))}}),n},e._defaultGetUniforms=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={},o=this.uniforms;for(var a in o){var f=o[a];a in n&&!f.private?(f.validate&&it(f.validate(n[a],f),"".concat(this.name,": invalid ").concat(a)),i[a]=n[a]):i[a]=f.value}return i},Mu(t)}();function to(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Nu(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
76
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Nu(t,e){if(t){if(typeof t=="string")return eo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eo(t,e)}}function eo(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ye(t){var e=He.instantiateModules(t);return Du(e)}function Du(t){var e={},r={};return ro({modules:t,level:0,moduleMap:e,moduleDepth:r}),Object.keys(r).sort(function(n,i){return r[i]-r[n]}).map(function(n){return e[n]})}function ro(t){var e=t.modules,r=t.level,n=t.moduleMap,i=t.moduleDepth;if(r>=5)throw new Error("Possible loop in shader dependency graph");var o=to(e),a;try{for(o.s();!(a=o.n()).done;){var f=a.value;n[f.name]=f,(i[f.name]===void 0||i[f.name]<r)&&(i[f.name]=r)}}catch(y){o.e(y)}finally{o.f()}var s=to(e),l;try{for(s.s();!(l=s.n()).done;){var p=l.value;p.dependencies&&ro({modules:p.dependencies,level:r+1,moduleMap:n,moduleDepth:i})}}catch(y){s.e(y)}finally{s.f()}}var no,io,oo,ao,so,fo,co,uo,lo,ho;function ot(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function po(t){switch(t?.gpu.toLowerCase()){case"apple":return K(no||(no=ot([`#define APPLE_GPU
|
|
67
77
|
// Apple optimizes away the calculation necessary for emulated fp64
|
|
68
78
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
69
79
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
@@ -76,14 +86,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
76
86
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
77
87
|
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
|
|
78
88
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
79
|
-
`])));case"nvidia":return
|
|
89
|
+
`])));case"nvidia":return K(io||(io=ot([`#define NVIDIA_GPU
|
|
80
90
|
// Nvidia optimizes away the calculation necessary for emulated fp64
|
|
81
91
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
82
92
|
`],[`\\
|
|
83
93
|
#define NVIDIA_GPU
|
|
84
94
|
// Nvidia optimizes away the calculation necessary for emulated fp64
|
|
85
95
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
86
|
-
`])));case"intel":return
|
|
96
|
+
`])));case"intel":return K(oo||(oo=ot([`#define INTEL_GPU
|
|
87
97
|
// Intel optimizes away the calculation necessary for emulated fp64
|
|
88
98
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
89
99
|
// Intel's built-in 'tan' function doesn't have acceptable precision
|
|
@@ -98,10 +108,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
98
108
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
99
109
|
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
|
|
100
110
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
101
|
-
`])));case"amd":return
|
|
111
|
+
`])));case"amd":return K(ao||(ao=ot([`#define AMD_GPU
|
|
102
112
|
`],[`\\
|
|
103
113
|
#define AMD_GPU
|
|
104
|
-
`])));default:return
|
|
114
|
+
`])));default:return K(so||(so=ot([`#define DEFAULT_GPU
|
|
105
115
|
// Prevent driver from optimizing away the calculation necessary for emulated fp64
|
|
106
116
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
107
117
|
// Headless Chrome's software shader 'tan' function doesn't have acceptable precision
|
|
@@ -116,21 +126,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
116
126
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
117
127
|
// If the GPU doesn't have full 32 bits precision, will causes overflow
|
|
118
128
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
119
|
-
`])))}}function
|
|
120
|
-
# define FEATURE_GLSL_DERIVATIVES
|
|
129
|
+
`])))}}function mo(t){var e="";return t.features.has("webgl2")&&(e+=K(fo||(fo=ot([`# define FEATURE_GLSL_DERIVATIVES
|
|
121
130
|
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
122
131
|
# define FEATURE_GLSL_FRAG_DEPTH
|
|
123
132
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
124
|
-
#endif // __VERSION
|
|
125
133
|
`],[`\\
|
|
126
|
-
#if (__VERSION__ > 120)
|
|
127
134
|
# define FEATURE_GLSL_DERIVATIVES
|
|
128
135
|
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
129
136
|
# define FEATURE_GLSL_FRAG_DEPTH
|
|
130
137
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
// FRAG_DEPTH => gl_FragDepth is available
|
|
138
|
+
`])))),t.features.has("webgl2")||(t.features.has("glsl-frag-depth")&&(e+=K(co||(co=ot([`
|
|
139
|
+
// FEATURE_GLSL_FRAG_DEPTH => gl_FragDepth is available
|
|
134
140
|
#ifdef GL_EXT_frag_depth
|
|
135
141
|
# extension GL_EXT_frag_depth : enable
|
|
136
142
|
# define FEATURE_GLSL_FRAG_DEPTH
|
|
@@ -139,44 +145,40 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
139
145
|
#endif
|
|
140
146
|
`],[`\\
|
|
141
147
|
|
|
142
|
-
//
|
|
148
|
+
// FEATURE_GLSL_FRAG_DEPTH => gl_FragDepth is available
|
|
143
149
|
#ifdef GL_EXT_frag_depth
|
|
144
150
|
# extension GL_EXT_frag_depth : enable
|
|
145
151
|
# define FEATURE_GLSL_FRAG_DEPTH
|
|
146
152
|
# define FRAG_DEPTH
|
|
147
153
|
# define gl_FragDepth gl_FragDepthEXT
|
|
148
154
|
#endif
|
|
149
|
-
`]))))
|
|
150
|
-
//
|
|
155
|
+
`])))),t!=null&&t.features.has("glsl-derivatives")&&(e+=K(uo||(uo=ot([`
|
|
156
|
+
// FEATURE_GLSL_DERIVATIVES => dxdF, dxdY and fwidth are available
|
|
151
157
|
#if defined(GL_OES_standard_derivatives) || defined(FEATURE_GLSL_DERIVATIVES)
|
|
152
158
|
# extension GL_OES_standard_derivatives : enable
|
|
153
159
|
# define FEATURE_GLSL_DERIVATIVES
|
|
154
|
-
# define DERIVATIVES
|
|
155
160
|
#endif
|
|
156
161
|
`],[`\\
|
|
157
162
|
|
|
158
|
-
//
|
|
163
|
+
// FEATURE_GLSL_DERIVATIVES => dxdF, dxdY and fwidth are available
|
|
159
164
|
#if defined(GL_OES_standard_derivatives) || defined(FEATURE_GLSL_DERIVATIVES)
|
|
160
165
|
# extension GL_OES_standard_derivatives : enable
|
|
161
166
|
# define FEATURE_GLSL_DERIVATIVES
|
|
162
|
-
# define DERIVATIVES
|
|
163
167
|
#endif
|
|
164
|
-
`]))))
|
|
165
|
-
//
|
|
168
|
+
`])))),t!=null&&t.features.has("glsl-frag-data")&&(e+=K(lo||(lo=ot([`
|
|
169
|
+
// FEATURE_GLSL_DRAW_BUFFERS => gl_FragData[] is available
|
|
166
170
|
#ifdef GL_EXT_draw_buffers
|
|
167
171
|
# extension GL_EXT_draw_buffers : require
|
|
168
172
|
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
169
|
-
# define DRAW_BUFFERS
|
|
170
173
|
#endif
|
|
171
174
|
`],[`\\
|
|
172
175
|
|
|
173
|
-
//
|
|
176
|
+
// FEATURE_GLSL_DRAW_BUFFERS => gl_FragData[] is available
|
|
174
177
|
#ifdef GL_EXT_draw_buffers
|
|
175
178
|
# extension GL_EXT_draw_buffers : require
|
|
176
179
|
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
177
|
-
# define DRAW_BUFFERS
|
|
178
180
|
#endif
|
|
179
|
-
`]))))
|
|
181
|
+
`])))),t!=null&&t.features.has("glsl-texture-lod")&&(e+=K(ho||(ho=ot([`// TEXTURE_LOD => texture2DLod etc are available
|
|
180
182
|
#ifdef GL_EXT_shader_texture_lod
|
|
181
183
|
# extension GL_EXT_shader_texture_lod : enable
|
|
182
184
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
@@ -189,65 +191,71 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
189
191
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
190
192
|
# define TEXTURE_LOD
|
|
191
193
|
#endif
|
|
192
|
-
`])))),
|
|
193
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,
|
|
194
|
-
|
|
195
|
-
`).concat(
|
|
196
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,
|
|
197
|
-
|
|
198
|
-
`)
|
|
199
|
-
`
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
`.concat(oe,`
|
|
203
|
-
|
|
204
|
-
`),Js=Z(ai||(ai=K([`precision highp float;
|
|
194
|
+
`]))))),e}function Cu(t,e){return Gu(t)||Uu(t,e)||go(t,e)||Fu()}function Fu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
195
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uu(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Gu(t){if(Array.isArray(t))return t}function Bu(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=go(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
196
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function go(t,e){if(t){if(typeof t=="string")return yo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yo(t,e)}}function yo(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bo(t,e,r){var n,i=Number(((n=t.match(/^#version[ \t]+(\d+)/m))===null||n===void 0?void 0:n[1])||100);if(i!==300)throw new Error("luma.gl v9 only supports GLSL 3.00 shader sources");switch(e){case 300:switch(r){case"vertex":return t=ve(t,zu),t;case"fragment":return t=ve(t,ku),t;default:throw new Error(r)}case 100:switch(r){case"vertex":return t=ve(t,Vu),t;case"fragment":return t=ve(t,Oo),t=Ku(t),t;default:throw new Error(r)}default:throw new Error(String(e))}}var wo=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,`#version 300 es
|
|
197
|
+
`],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],zu=[].concat(wo,[[Gt("attribute"),"in $1"],[Gt("varying"),"out $1"]]),ku=[].concat(wo,[[Gt("varying"),"in $1"]]),_o=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Vu=[].concat(_o,[[Gt("in"),"attribute $1"],[Gt("out"),"varying $1"]]),Oo=[].concat(_o,[[Gt("in"),"varying $1"]]),Hu="gl_FragColor",vo=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/;function ve(t,e){var r=Bu(e),n;try{for(r.s();!(n=r.n()).done;){var i=Cu(n.value,2),o=i[0],a=i[1];t=t.replace(o,a)}}catch(f){r.e(f)}finally{r.f()}return t}function Ku(t){t=ve(t,Oo);var e=vo.exec(t);if(e){var r=e[1];t=t.replace(vo,"").replace(new RegExp("\\b".concat(r,"\\b"),"g"),Hu)}return t}function Gt(t){return new RegExp("\\b".concat(t,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}function Wu(t,e){return Xu(t)||Yu(t,e)||xo(t,e)||qu()}function qu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
198
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yu(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Xu(t){if(Array.isArray(t))return t}function Po(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=xo(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
199
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function xo(t,e){if(t){if(typeof t=="string")return So(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return So(t,e)}}function So(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Gr(t,e){var r="";for(var n in t){var i=t[n];if(r+="void ".concat(i.signature,` {
|
|
200
|
+
`),i.header&&(r+=" ".concat(i.header)),e[n]){var o=e[n];o.sort(function(l,p){return l.order-p.order});var a=Po(o),f;try{for(a.s();!(f=a.n()).done;){var s=f.value;r+=" ".concat(s.injection,`
|
|
201
|
+
`)}}catch(l){a.e(l)}finally{a.f()}}i.footer&&(r+=" ".concat(i.footer)),r+=`}
|
|
202
|
+
`}return r}function Br(t){var e={vertex:{},fragment:{}},r=Po(t),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=void 0,a=void 0;typeof i!="string"?(o=i,a=o.hook):(o={},a=i),a=a.trim();var f=a.split(":"),s=Wu(f,2),l=s[0],p=s[1],y=a.replace(/\(.+/,""),g=Object.assign(o,{signature:p});switch(l){case"vs":e.vertex[y]=g;break;case"fs":e.fragment[y]=g;break;default:throw new Error(l)}}}catch(w){r.e(w)}finally{r.f()}return e}function ge(t,e){return{name:$u(t,e),language:"glsl",version:Zu(t)}}function $u(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unnamed",r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,n=r.exec(t);return n?n[1]:e}function Zu(t){var e=100,r=t.match(/[^\s]+/g);if(r&&r.length>=2&&r[0]==="#version"){var n=parseInt(r[1],10);Number.isFinite(n)&&(e=n)}if(e!==100&&e!==300)throw new Error("Invalid GLSL version ".concat(e));return e}function be(t){return be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(t)}var Eo;function zr(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Ju(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
203
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Ju(t,e){if(t){if(typeof t=="string")return Ao(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ao(t,e)}}function Ao(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function To(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function vt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?To(Object(r),!0).forEach(function(n){Qu(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):To(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Qu(t,e,r){return e=tl(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tl(t){var e=el(t,"string");return be(e)==="symbol"?e:String(e)}function el(t,e){if(be(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(be(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rl(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Io=`
|
|
205
204
|
|
|
205
|
+
`.concat(pe,`
|
|
206
|
+
`),nl=K(Eo||(Eo=rl([`precision highp float;
|
|
206
207
|
`],[`\\
|
|
207
208
|
precision highp float;
|
|
209
|
+
`])));function jo(t){var e=t.vs,r=t.fs,n=ye(t.modules||[]);switch(t.platformInfo.shaderLanguage){case"glsl":return{vs:Ro(t.platformInfo,vt(vt({},t),{},{source:e,stage:"vertex",modules:n})),fs:Ro(t.platformInfo,vt(vt({},t),{},{source:r,stage:"fragment",modules:n})),getUniforms:Lo(n)};case"wgsl":return{vs:Mo(t.platformInfo,vt(vt({},t),{},{source:e,stage:"vertex",modules:n})),fs:Mo(t.platformInfo,vt(vt({},t),{},{source:r,stage:"fragment",modules:n})),getUniforms:Lo(n)}}}function Mo(t,e){var r=e.source,n=e.stage,i=e.modules,o=e.defines,a=o===void 0?{}:o,f=e.hookFunctions,s=f===void 0?[]:f,l=e.inject,p=l===void 0?{}:l,y=e.log;it(typeof r=="string","shader source must be a string");var g=r,w={};i.forEach(function(d){Object.assign(w,d.getDefines())}),Object.assign(w,a);var b="",_=Br(s),x={},S={},R={};for(var E in p){var T=typeof p[E]=="string"?{injection:p[E],order:0}:p[E],M=/^(v|f)s:(#)?([\w-]+)$/.exec(E);if(M){var L=M[2],j=M[3];L?j==="decl"?S[E]=[T]:R[E]=[T]:x[E]=[T]}else R[E]=[T]}var N=zr(i),F;try{for(N.s();!(F=N.n()).done;){var D=F.value;y&&D.checkDeprecations(g,y);var C=D.getModuleSource(n,"wgsl");b+=C;var h=D.injections[n];for(var c in h){var u=/^(v|f)s:#([\w-]+)$/.exec(c);if(u){var m=u[2],v=m==="decl"?S:R;v[c]=v[c]||[],v[c].push(h[c])}else x[c]=x[c]||[],x[c].push(h[c])}}}catch(d){N.e(d)}finally{N.f()}return b+=Io,b=me(b,n,S),b+=Gr(_[n],x),b+=g,b=me(b,n,R),b}function Ro(t,e){var r=e.id,n=e.source,i=e.stage,o=e.language,a=o===void 0?"glsl":o,f=e.modules,s=e.defines,l=s===void 0?{}:s,p=e.hookFunctions,y=p===void 0?[]:p,g=e.inject,w=g===void 0?{}:g,b=e.prologue,_=b===void 0?!0:b,x=e.log;it(typeof n=="string","shader source must be a string");var S=a==="glsl"?ge(n).version:-1,R=t.shaderLanguageVersion,E=S===100?"#version 100":"#version 300 es",T=n.split(`
|
|
210
|
+
`),M=T.slice(1).join(`
|
|
211
|
+
`),L={};f.forEach(function(H){Object.assign(L,H.getDefines())}),Object.assign(L,l);var j="";switch(a){case"wgsl":break;case"glsl":j=_?"".concat(E,`
|
|
208
212
|
|
|
209
|
-
|
|
210
|
-
`)
|
|
211
|
-
|
|
212
|
-
`).concat(
|
|
213
|
-
|
|
214
|
-
`).concat(
|
|
215
|
-
`).concat(ti(e),`
|
|
216
|
-
`).concat(ta(U),`
|
|
217
|
-
`).concat(o==="fragment"?Js:"",`
|
|
218
|
-
`):"".concat(S,`
|
|
219
|
-
`);break}var v=mr(h),p={},d={},_={};for(var E in m){var A=typeof m[E]=="string"?{injection:m[E],order:0}:m[E],L=/^(v|f)s:(#)?([\w-]+)$/.exec(E);if(L){var z=L[2],I=L[3];z?I==="decl"?d[E]=[A]:_[E]=[A]:p[E]=[A]}else _[E]=[A]}var G=vr(a),k;try{for(G.s();!(k=G.n()).done;){var V=k.value;x&&V.checkDeprecations(F,x);var pt=V.getModuleSource(o);C+=pt;var ft=V.injections[o];for(var J in ft){var Q=/^(v|f)s:#([\w-]+)$/.exec(J);if(Q){var et=Q[2],at=et==="decl"?d:_;at[J]=at[J]||[],at[J].push(ft[J])}else p[J]=p[J]||[],p[J].push(ft[J])}}}catch($t){G.e($t)}finally{G.f()}return C+=pi,C=se(C,o,d),C+=dr(v[o],p),C+=F,C=se(C,o,_),C=ri(C,N,o),C.trim()}function hi(e){return function(r){var n={},i=vr(e),o;try{for(i.s();!(o=i.n()).done;){var s=o.value,c=s.getUniforms(r,n);Object.assign(n,c)}}catch(a){i.e(a)}finally{i.f()}return n}}function Qs(e){var t=e.id,r=e.source,n=e.stage,i=t&&r.indexOf("SHADER_NAME")===-1;return i?`
|
|
220
|
-
#define SHADER_NAME `.concat(t,"_").concat(n,`
|
|
213
|
+
// ----- PROLOGUE -------------------------
|
|
214
|
+
`).concat(il({id:r,source:n,stage:i}),`
|
|
215
|
+
`,"#define SHADER_TYPE_".concat(i.toUpperCase()),`
|
|
216
|
+
`).concat(po(t),`
|
|
217
|
+
`).concat(mo(t),`
|
|
218
|
+
`).concat(i==="fragment"?nl:"",`
|
|
221
219
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
`)
|
|
225
|
-
|
|
226
|
-
`)
|
|
220
|
+
// ----- APPLICATION DEFINES -------------------------
|
|
221
|
+
|
|
222
|
+
`).concat(ol(L),`
|
|
223
|
+
|
|
224
|
+
`):"".concat(E,`
|
|
225
|
+
`);break}var N=Br(y),F={},D={},C={};for(var h in w){var c=typeof w[h]=="string"?{injection:w[h],order:0}:w[h],u=/^(v|f)s:(#)?([\w-]+)$/.exec(h);if(u){var m=u[2],v=u[3];m?v==="decl"?D[h]=[c]:C[h]=[c]:F[h]=[c]}else C[h]=[c]}var d=zr(f),O;try{for(d.s();!(O=d.n()).done;){var P=O.value;x&&P.checkDeprecations(M,x);var A=P.getModuleSource(i);j+=A;var U=P.injections[i];for(var I in U){var G=/^(v|f)s:#([\w-]+)$/.exec(I);if(G){var nt=G[2],Q=nt==="decl"?D:C;Q[I]=Q[I]||[],Q[I].push(U[I])}else F[I]=F[I]||[],F[I].push(U[I])}}}catch(H){d.e(H)}finally{d.f()}return j+="// ----- MAIN SHADER SOURCE -------------------------",j+=Io,j=me(j,i,D),j+=Gr(N[i],F),j+=M,j=me(j,i,C),a==="glsl"&&S!==R&&(j=bo(j,R,i)),j.trim()}function Lo(t){return function(r){var n={},i=zr(t),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,f=a.getUniforms(r,n);Object.assign(n,f)}}catch(s){i.e(s)}finally{i.f()}return n}}function il(t){var e=t.id,r=t.source,n=t.stage,i=e&&r.indexOf("SHADER_NAME")===-1;return i?`
|
|
226
|
+
#define SHADER_NAME `.concat(e,"_").concat(n,`
|
|
227
|
+
|
|
228
|
+
`):""}function ol(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e="";for(var r in t){var n=t[r];(n||Number.isFinite(n))&&(e+="#define ".concat(r.toUpperCase()," ").concat(t[r],`
|
|
229
|
+
`))}return e}function we(t){return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},we(t)}function No(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Do(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?No(Object(r),!0).forEach(function(n){al(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):No(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function al(t,e,r){return e=sl(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sl(t){var e=fl(t,"string");return we(e)==="symbol"?e:String(e)}function fl(t,e){if(we(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(we(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fo(t){if(!t.vs)throw new Error("no vertex shader");var e=Co(t.platformInfo,t.vs),r;return t.fs&&(r=Co(t.platformInfo,t.fs)),Do(Do({},t),{},{vs:e,fs:r})}function Co(t,e){if(typeof e=="string")return e;switch(t.type){case"webgpu":if(e!=null&&e.wgsl)return e.wgsl;throw new Error("WebGPU does not support GLSL shaders");default:if(e!=null&&e.glsl)return e.glsl;throw new Error("WebGL does not support WGSL shaders")}}function _e(t){return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(t)}function Uo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ke(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Uo(Object(r),!0).forEach(function(n){cl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uo(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function cl(t,e,r){return e=Bo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Go(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bo(n.key),n)}}function ul(t,e,r){return e&&Go(t.prototype,e),r&&Go(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bo(t){var e=ll(t,"string");return _e(e)==="symbol"?e:String(e)}function ll(t,e){if(_e(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(_e(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var We=function(){function t(){hl(this,t),this._hookFunctions=[],this._defaultModules=[]}t.getDefaultShaderAssembler=function(){return t.defaultShaderAssembler=t.defaultShaderAssembler||new t,t.defaultShaderAssembler};var e=t.prototype;return e.addDefaultModule=function(n){this._defaultModules.find(function(i){return i.name===(typeof n=="string"?n:n.name)})||this._defaultModules.push(n)},e.removeDefaultModule=function(n){var i=typeof n=="string"?n:n.name;this._defaultModules=this._defaultModules.filter(function(o){return o.name!==i})},e.addShaderHook=function(n,i){i&&(n=Object.assign(i,{hook:n})),this._hookFunctions.push(n)},e.assembleShaders=function(n){var i=this._getModuleList(n.modules),o=this._hookFunctions,a=Fo(n),f=jo(Ke(Ke({platformInfo:n.platformInfo},a),{},{modules:i,hookFunctions:o}));return Ke(Ke({},f),{},{modules:i})},e._getModuleList=function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=new Array(this._defaultModules.length+n.length),o={},a=0,f=0,s=this._defaultModules.length;f<s;++f){var l=this._defaultModules[f],p=l.name;i[a++]=l,o[p]=!0}for(var y=0,g=n.length;y<g;++y){var w=n[y],b=w.name;o[b]||(i[a++]=w,o[b]=!0)}return i.length=a,He.instantiateModules(i)},ul(t)}();We.defaultShaderAssembler=void 0;var zo,ko;function Vo(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var pl=K(zo||(zo=Vo(["void main() {gl_FragColor = vec4(0);}"]))),Ho=K(ko||(ko=Vo([`out vec4 transform_output;
|
|
227
230
|
void main() {
|
|
228
231
|
transform_output = vec4(0);
|
|
229
232
|
}`],[`\\
|
|
230
233
|
out vec4 transform_output;
|
|
231
234
|
void main() {
|
|
232
235
|
transform_output = vec4(0);
|
|
233
|
-
}`]))),
|
|
234
|
-
`.concat(
|
|
235
|
-
`).concat(
|
|
236
|
+
}`]))),ml=`#version 300 es
|
|
237
|
+
`.concat(Ho);function kr(t){var e=t||{},r=e.version,n=r===void 0?100:r,i=e.input,o=e.inputType,a=e.output;if(!i)return n===300?ml:n>300?"#version ".concat(n,`
|
|
238
|
+
`).concat(Ho):pl;if(!o)throw new Error("inputType");var f=Ko(i,o);return n>=300?"#version ".concat(n," ").concat(n===300?"es":"",`
|
|
236
239
|
in `).concat(o," ").concat(i,`;
|
|
237
|
-
out vec4 `).concat(
|
|
240
|
+
out vec4 `).concat(a,`;
|
|
238
241
|
void main() {
|
|
239
|
-
`).concat(
|
|
242
|
+
`).concat(a," = ").concat(f,`;
|
|
240
243
|
}`):"varying ".concat(o," ").concat(i,`;
|
|
241
244
|
void main() {
|
|
242
|
-
gl_FragColor = `).concat(
|
|
243
|
-
}`)}function Ei(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:throw new Error(t)}}var op=1/Math.PI*180,sp=1/180*Math.PI,oa={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...oa}};var nt=globalThis.mathgl.config;function Si(e,{precision:t=nt.precision}={}){return e=sa(e),"".concat(parseFloat(e.toPrecision(t)))}function Ht(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _r(e,t,r){let n=nt.EPSILON;r&&(nt.EPSILON=r);try{if(e===t)return!0;if(Ht(e)&&Ht(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!_r(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=nt.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{nt.EPSILON=n}}function sa(e){return Math.round(e/nt.EPSILON)*nt.EPSILON}function aa(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var qt=class extends aa(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Ht(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(nt)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Si(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!_r(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let o=t[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(nt.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function ca(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function it(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function Ee(e,t,r=""){if(nt.debug&&!ca(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function xr(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var Se=class extends qt{get x(){return this[0]}set x(t){this[0]=it(t)}get y(){return this[1]}set y(t){this[1]=it(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return it(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return it(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return xr(t>=0&&t<this.ELEMENTS,"index is out of range"),it(this[t])}setComponent(t,r){return xr(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var _t=typeof Float32Array<"u"?Float32Array:Array;var gp=Math.PI/180;function fa(){let e=new _t(2);return _t!=Float32Array&&(e[0]=0,e[1]=0),e}function Pi(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var yp=function(){let e=fa();return function(t,r,n,i,o,s){let c,a;for(r||(r=2),n||(n=0),i?a=Math.min(i*r+n,t.length):a=t.length,c=n;c<a;c+=r)e[0]=t[c],e[1]=t[c+1],o(e,e,s),t[c]=e[0],t[c+1]=e[1];return t}}();function Ti(e,t,r){let n=t[0],i=t[1],o=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/o,e[1]=(r[1]*n+r[5]*i)/o,e}function Me(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o||1;return e[0]=(r[0]*n+r[4]*i+r[8]*o)/s,e[1]=(r[1]*n+r[5]*i+r[9]*o)/s,e[2]=(r[2]*n+r[6]*i+r[10]*o)/s,e}function Ri(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function ua(){let e=new _t(3);return _t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function la(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ci(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[0],c=r[1],a=r[2];return e[0]=i*a-o*c,e[1]=o*s-n*a,e[2]=n*c-i*s,e}function Ae(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,e}function Li(e,t,r){let n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e}function Di(e,t,r){let n=r[0],i=r[1],o=r[2],s=r[3],c=t[0],a=t[1],f=t[2],u=i*f-o*a,l=o*c-n*f,h=n*a-i*c,g=i*h-o*l,m=o*u-n*h,y=n*l-i*u,b=s*2;return u*=b,l*=b,h*=b,g*=2,m*=2,y*=2,e[0]=c+u+g,e[1]=a+l+m,e[2]=f+h+y,e}function Ii(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Ni(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Fi(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function ji(e,t){let r=e[0],n=e[1],i=e[2],o=t[0],s=t[1],c=t[2],a=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+c*c)),f=a&&la(e,t)/a;return Math.acos(Math.min(Math.max(f,-1),1))}var bp=function(){let e=ua();return function(t,r,n,i,o,s){let c,a;for(r||(r=3),n||(n=0),i?a=Math.min(i*r+n,t.length):a=t.length,c=n;c<a;c+=r)e[0]=t[c],e[1]=t[c+1],e[2]=t[c+2],o(e,e,s),t[c]=e[0],t[c+1]=e[1],t[c+2]=e[2];return t}}();var Or=[0,0,0],Pe,ot=class extends Se{static get ZERO(){return Pe||(Pe=new ot(0,0,0),Object.freeze(Pe)),Pe}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Ht(t)?this.copy(t):(nt.debug&&(it(t),it(r),it(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return nt.debug&&(it(t.x),it(t.y),it(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=it(t)}angle(t){return ji(this,t)}cross(t){return Ci(this,this,t),this.check()}rotateX({radians:t,origin:r=Or}){return Ii(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Or}){return Ni(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Or}){return Fi(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Ae(this,this,t),this.check()}transformAsVector(t){return Me(this,this,t),this.check()}transformByMatrix3(t){return Li(this,this,t),this.check()}transformByMatrix2(t){return Ri(this,this,t),this.check()}transformByQuaternion(t){return Di(this,this,t),this.check()}};var Te=class extends qt{toString(){let t="[";if(nt.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=it(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function ha(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ui(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],o=t[6],s=t[7],c=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=s,e[14]=c}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Gi(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],c=t[5],a=t[6],f=t[7],u=t[8],l=t[9],h=t[10],g=t[11],m=t[12],y=t[13],b=t[14],O=t[15],R=r*c-n*s,x=r*a-i*s,M=r*f-o*s,w=n*a-i*c,S=n*f-o*c,F=i*f-o*a,N=u*y-l*m,U=u*b-h*m,C=u*O-g*m,v=l*b-h*y,p=l*O-g*y,d=h*O-g*b,_=R*d-x*p+M*v+w*C-S*U+F*N;return _?(_=1/_,e[0]=(c*d-a*p+f*v)*_,e[1]=(i*p-n*d-o*v)*_,e[2]=(y*F-b*S+O*w)*_,e[3]=(h*S-l*F-g*w)*_,e[4]=(a*C-s*d-f*U)*_,e[5]=(r*d-i*C+o*U)*_,e[6]=(b*M-m*F-O*x)*_,e[7]=(u*F-h*M+g*x)*_,e[8]=(s*p-c*C+f*N)*_,e[9]=(n*C-r*p-o*N)*_,e[10]=(m*S-y*M+O*R)*_,e[11]=(l*M-u*S-g*R)*_,e[12]=(c*U-s*v-a*N)*_,e[13]=(r*v-n*U+i*N)*_,e[14]=(y*x-m*w-b*R)*_,e[15]=(u*w-l*x+h*R)*_,e):null}function Bi(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],c=e[6],a=e[7],f=e[8],u=e[9],l=e[10],h=e[11],g=e[12],m=e[13],y=e[14],b=e[15],O=t*s-r*o,R=t*c-n*o,x=r*c-n*s,M=f*m-u*g,w=f*y-l*g,S=u*y-l*m,F=t*S-r*w+n*M,N=o*S-s*w+c*M,U=f*x-u*R+l*O,C=g*x-m*R+y*O;return a*F-i*N+b*U-h*C}function wr(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],c=t[4],a=t[5],f=t[6],u=t[7],l=t[8],h=t[9],g=t[10],m=t[11],y=t[12],b=t[13],O=t[14],R=t[15],x=r[0],M=r[1],w=r[2],S=r[3];return e[0]=x*n+M*c+w*l+S*y,e[1]=x*i+M*a+w*h+S*b,e[2]=x*o+M*f+w*g+S*O,e[3]=x*s+M*u+w*m+S*R,x=r[4],M=r[5],w=r[6],S=r[7],e[4]=x*n+M*c+w*l+S*y,e[5]=x*i+M*a+w*h+S*b,e[6]=x*o+M*f+w*g+S*O,e[7]=x*s+M*u+w*m+S*R,x=r[8],M=r[9],w=r[10],S=r[11],e[8]=x*n+M*c+w*l+S*y,e[9]=x*i+M*a+w*h+S*b,e[10]=x*o+M*f+w*g+S*O,e[11]=x*s+M*u+w*m+S*R,x=r[12],M=r[13],w=r[14],S=r[15],e[12]=x*n+M*c+w*l+S*y,e[13]=x*i+M*a+w*h+S*b,e[14]=x*o+M*f+w*g+S*O,e[15]=x*s+M*u+w*m+S*R,e}function zi(e,t,r){let n=r[0],i=r[1],o=r[2],s,c,a,f,u,l,h,g,m,y,b,O;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*o+t[12],e[13]=t[1]*n+t[5]*i+t[9]*o+t[13],e[14]=t[2]*n+t[6]*i+t[10]*o+t[14],e[15]=t[3]*n+t[7]*i+t[11]*o+t[15]):(s=t[0],c=t[1],a=t[2],f=t[3],u=t[4],l=t[5],h=t[6],g=t[7],m=t[8],y=t[9],b=t[10],O=t[11],e[0]=s,e[1]=c,e[2]=a,e[3]=f,e[4]=u,e[5]=l,e[6]=h,e[7]=g,e[8]=m,e[9]=y,e[10]=b,e[11]=O,e[12]=s*n+u*i+m*o+t[12],e[13]=c*n+l*i+y*o+t[13],e[14]=a*n+h*i+b*o+t[14],e[15]=f*n+g*i+O*o+t[15]),e}function ki(e,t,r){let n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Vi(e,t,r,n){let i=n[0],o=n[1],s=n[2],c=Math.sqrt(i*i+o*o+s*s),a,f,u,l,h,g,m,y,b,O,R,x,M,w,S,F,N,U,C,v,p,d,_,E;return c<1e-6?null:(c=1/c,i*=c,o*=c,s*=c,f=Math.sin(r),a=Math.cos(r),u=1-a,l=t[0],h=t[1],g=t[2],m=t[3],y=t[4],b=t[5],O=t[6],R=t[7],x=t[8],M=t[9],w=t[10],S=t[11],F=i*i*u+a,N=o*i*u+s*f,U=s*i*u-o*f,C=i*o*u-s*f,v=o*o*u+a,p=s*o*u+i*f,d=i*s*u+o*f,_=o*s*u-i*f,E=s*s*u+a,e[0]=l*F+y*N+x*U,e[1]=h*F+b*N+M*U,e[2]=g*F+O*N+w*U,e[3]=m*F+R*N+S*U,e[4]=l*C+y*v+x*p,e[5]=h*C+b*v+M*p,e[6]=g*C+O*v+w*p,e[7]=m*C+R*v+S*p,e[8]=l*d+y*_+x*E,e[9]=h*d+b*_+M*E,e[10]=g*d+O*_+w*E,e[11]=m*d+R*_+S*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Hi(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[4],s=t[5],c=t[6],a=t[7],f=t[8],u=t[9],l=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+f*n,e[5]=s*i+u*n,e[6]=c*i+l*n,e[7]=a*i+h*n,e[8]=f*i-o*n,e[9]=u*i-s*n,e[10]=l*i-c*n,e[11]=h*i-a*n,e}function qi(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],c=t[2],a=t[3],f=t[8],u=t[9],l=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-f*n,e[1]=s*i-u*n,e[2]=c*i-l*n,e[3]=a*i-h*n,e[8]=o*n+f*i,e[9]=s*n+u*i,e[10]=c*n+l*i,e[11]=a*n+h*i,e}function Wi(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],c=t[2],a=t[3],f=t[4],u=t[5],l=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+f*n,e[1]=s*i+u*n,e[2]=c*i+l*n,e[3]=a*i+h*n,e[4]=f*i-o*n,e[5]=u*i-s*n,e[6]=l*i-c*n,e[7]=h*i-a*n,e}function Yi(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,c=n+n,a=i+i,f=r*s,u=n*s,l=n*c,h=i*s,g=i*c,m=i*a,y=o*s,b=o*c,O=o*a;return e[0]=1-l-m,e[1]=u+O,e[2]=h-b,e[3]=0,e[4]=u-O,e[5]=1-f-m,e[6]=g+y,e[7]=0,e[8]=h+b,e[9]=g-y,e[10]=1-f-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ki(e,t,r,n,i,o,s){let c=1/(r-t),a=1/(i-n),f=1/(o-s);return e[0]=o*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*a,e[6]=0,e[7]=0,e[8]=(r+t)*c,e[9]=(i+n)*a,e[10]=(s+o)*f,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*f,e[15]=0,e}function pa(e,t,r,n,i){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let s=1/(n-i);e[10]=(i+n)*s,e[14]=2*i*n*s}else e[10]=-1,e[14]=-2*n;return e}var Xi=pa;function da(e,t,r,n,i,o,s){let c=1/(t-r),a=1/(n-i),f=1/(o-s);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*f,e[11]=0,e[12]=(t+r)*c,e[13]=(i+n)*a,e[14]=(s+o)*f,e[15]=1,e}var $i=da;function Zi(e,t,r,n){let i,o,s,c,a,f,u,l,h,g,m=t[0],y=t[1],b=t[2],O=n[0],R=n[1],x=n[2],M=r[0],w=r[1],S=r[2];return Math.abs(m-M)<1e-6&&Math.abs(y-w)<1e-6&&Math.abs(b-S)<1e-6?ha(e):(l=m-M,h=y-w,g=b-S,i=1/Math.sqrt(l*l+h*h+g*g),l*=i,h*=i,g*=i,o=R*g-x*h,s=x*l-O*g,c=O*h-R*l,i=Math.sqrt(o*o+s*s+c*c),i?(i=1/i,o*=i,s*=i,c*=i):(o=0,s=0,c=0),a=h*c-g*s,f=g*o-l*c,u=l*s-h*o,i=Math.sqrt(a*a+f*f+u*u),i?(i=1/i,a*=i,f*=i,u*=i):(a=0,f=0,u=0),e[0]=o,e[1]=a,e[2]=l,e[3]=0,e[4]=s,e[5]=f,e[6]=h,e[7]=0,e[8]=c,e[9]=u,e[10]=g,e[11]=0,e[12]=-(o*m+s*y+c*b),e[13]=-(a*m+f*y+u*b),e[14]=-(l*m+h*y+g*b),e[15]=1,e)}function ma(){let e=new _t(4);return _t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Ji(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,e}var Ip=function(){let e=ma();return function(t,r,n,i,o,s){let c,a;for(r||(r=4),n||(n=0),i?a=Math.min(i*r+n,t.length):a=t.length,c=n;c<a;c+=r)e[0]=t[c],e[1]=t[c+1],e[2]=t[c+2],e[3]=t[c+3],o(e,e,s),t[c]=e[0],t[c+1]=e[1],t[c+2]=e[2],t[c+3]=e[3];return t}}();var Mr;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Mr||(Mr={}));var va=45*Math.PI/180,ga=1,Er=.1,Sr=500,ya=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),mt=class extends Te{static get IDENTITY(){return xa()}static get ZERO(){return _a()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Mr}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,o,s,c,a,f,u,l,h,g,m,y,b){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=c,this[7]=a,this[8]=f,this[9]=u,this[10]=l,this[11]=h,this[12]=g,this[13]=m,this[14]=y,this[15]=b,this.check()}setRowMajor(t,r,n,i,o,s,c,a,f,u,l,h,g,m,y,b){return this[0]=t,this[1]=o,this[2]=f,this[3]=g,this[4]=r,this[5]=s,this[6]=u,this[7]=m,this[8]=n,this[9]=c,this[10]=l,this[11]=y,this[12]=i,this[13]=a,this[14]=h,this[15]=b,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(ya)}fromObject(t){return this.check()}fromQuaternion(t){return Yi(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:o,near:s=Er,far:c=Sr}=t;return c===1/0?ba(this,r,n,i,o,s):Ki(this,r,n,i,o,s,c),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return Zi(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:s=Er,far:c=Sr}=t;return $i(this,r,n,i,o,s,c),this.check()}orthographic(t){let{fovy:r=va,aspect:n=ga,focalDistance:i=1,near:o=Er,far:s=Sr}=t;Qi(r);let c=r/2,a=i*Math.tan(c),f=a*n;return this.ortho({left:-f,right:f,bottom:-a,top:a,near:o,far:s})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return Qi(r),Xi(this,r,n,i,o),this.check()}determinant(){return Bi(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*s,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*o,t[6]=this[6]*s,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*o,t[10]=this[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*s,t[3]=this[4]*i,t[4]=this[5]*o,t[5]=this[6]*s,t[6]=this[8]*i,t[7]=this[9]*o,t[8]=this[10]*s,t}transpose(){return Ui(this,this),this.check()}invert(){return Gi(this,this),this.check()}multiplyLeft(t){return wr(this,t,this),this.check()}multiplyRight(t){return wr(this,this,t),this.check()}rotateX(t){return Hi(this,this,t),this.check()}rotateY(t){return qi(this,this,t),this.check()}rotateZ(t){return Wi(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return Vi(this,this,t,r),this.check()}scale(t){return ki(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return zi(this,this,t),this.check()}transform(t,r){return t.length===4?(r=Ji(r||[-0,-0,-0,-0],t,this),Ee(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=Pi(r||[-0,-0],t,this);break;case 3:i=Ae(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Ee(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=Ti(r||[-0,-0],t,this);break;case 3:n=Me(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Ee(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},Re,Ce;function _a(){return Re||(Re=new mt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Re)),Re}function xa(){return Ce||(Ce=new mt,Object.freeze(Ce)),Ce}function Qi(e){if(e>Math.PI*2)throw Error("expected radians")}function ba(e,t,r,n,i,o){let s=2*o/(r-t),c=2*o/(i-n),a=(r+t)/(r-t),f=(i+n)/(i-n),u=-1,l=-1,h=-2*o;return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=a,e[9]=f,e[10]=u,e[11]=l,e[12]=0,e[13]=0,e[14]=h,e[15]=0,e}var Le=function(){function e(r){T(this,e),this.id=void 0,this.userData={},this.topology=void 0,this.bufferLayout=[],this.vertexCount=void 0,this.indices=void 0,this.attributes=void 0,this.id=r.id||H("geometry"),this.topology=r.topology,this.indices=r.indices||null,this.attributes=r.attributes,this.vertexCount=r.vertexCount,this.bufferLayout=r.bufferLayout||[],this.indices&&tt(this.indices.usage===$.INDEX)}var t=e.prototype;return t.destroy=function(){var n;this.indices.destroy(),this.attributes.positions.destroy(),this.attributes.normals.destroy(),this.attributes.texCoords.destroy(),(n=this.attributes.colors)===null||n===void 0||n.destroy()},t.getVertexCount=function(){return this.vertexCount},t.getAttributes=function(){return this.attributes},t.getIndexes=function(){return this.indices},t._calculateVertexCount=function(n){var i=n.byteLength/12;return i},P(e)}();function to(e,t){if(t instanceof Le)return t;var r=Oa(e,t),n=wa(e,t),i=n.attributes,o=n.bufferLayout;return new Le({topology:t.topology||"triangle-list",bufferLayout:o,vertexCount:t.vertexCount,indices:r,attributes:i})}function Oa(e,t){if(t.indices){var r=t.indices.value;return e.createBuffer({usage:$.INDEX,data:r})}}function wa(e,t){for(var r=[],n={},i=0,o=Object.entries(t.attributes);i<o.length;i++){var s=B(o[i],2),c=s[0],a=s[1],f=c;switch(c){case"POSITION":f="positions";break;case"NORMAL":f="normals";break;case"TEXCOORD_0":f="texCoords";break}n[f]=e.createBuffer({data:a.value,id:"".concat(c,"-buffer")});var u=a.value,l=a.size;r.push({name:f,format:rr(u,l)})}var h=t._calculateVertexCount(t.attributes,t.indices);return{attributes:n,bufferLayout:r,vertexCount:h}}function eo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eo(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ae=function(){e.getDefaultPipelineFactory=function(n){return n._lumaData.defaultPipelineFactory=n._lumaData.defaultPipelineFactory||new e(n),n._lumaData.defaultPipelineFactory};function e(r){T(this,e),this.device=void 0,this._hashCounter=0,this._hashes={},this._useCounts={},this._pipelineCache={},this.device=r}var t=e.prototype;return t.createRenderPipeline=function(n){var i=xt(xt({},e.defaultProps),n),o=this._hashRenderPipeline(xt({},i));if(!this._pipelineCache[o]){var s=this.device.createRenderPipeline(xt(xt({},i),{},{vs:this.device.createShader({stage:"vertex",source:i.vs}),fs:i.fs?this.device.createShader({stage:"fragment",source:i.fs}):null}));s.hash=o,this._pipelineCache[o]=s,this._useCounts[o]=0}return this._useCounts[o]++,this._pipelineCache[o]},t.release=function(n){var i=n.hash;this._useCounts[i]--,this._useCounts[i]===0&&(this._pipelineCache[i].destroy(),delete this._pipelineCache[i],delete this._useCounts[i])},t._createRenderPipeline=function(n){if(!n.fs)throw new Error("fs");var i=this.device.createRenderPipeline(xt(xt({},n),{},{vs:this.device.createShader({stage:"vertex",source:n.vs}),fs:n.fs?this.device.createShader({stage:"fragment",source:n.fs}):null}));return i},t._hashRenderPipeline=function(n){var i=this._getHash(n.vs),o=n.fs?this._getHash(n.fs):0,s="-";switch(this.device.info.type){case"webgpu":var c=this._getHash(JSON.stringify(n.parameters)),a=this._getHash(JSON.stringify(n.bufferLayout));return"".concat(i,"/").concat(o,"V").concat(s,"T").concat(n.topology,"P").concat(c,"BL").concat(a,"}");default:return"".concat(i,"/").concat(o,"V").concat(s)}},t._getHash=function(n){return this._hashes[n]===void 0&&(this._hashes[n]=this._hashCounter++),this._hashes[n]},P(e)}();ae.defaultProps=xt(xt({},kt.defaultProps),{},{vs:void 0,fs:void 0});function oo(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ea(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
244
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,c;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){s=!0,c=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw c}}}}function Ea(e,t){if(e){if(typeof e=="string")return ro(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ro(e,t)}}function ro(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function no(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?no(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):no(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var It=function(){function e(r,n){T(this,e),this.device=void 0,this.id=void 0,this.vs=void 0,this.fs=void 0,this.pipelineFactory=void 0,this.userData={},this.parameters=void 0,this.topology=void 0,this.bufferLayout=void 0,this.vertexCount=void 0,this.instanceCount=0,this.indexBuffer=null,this.bufferAttributes={},this.constantAttributes={},this.bindings={},this.uniforms={},this.pipeline=void 0,this.vertexArray=void 0,this.transformFeedback=null,this._pipelineNeedsUpdate="newly created",this._attributeInfos={},this._gpuGeometry=null,this._getModuleUniforms=void 0,this.props=void 0,this.props=Yt(Yt({},e.defaultProps),n),n=this.props,this.id=n.id||H("model"),this.device=r,Object.assign(this.userData,n.userData);var i={type:r.info.type,shaderLanguage:r.info.shadingLanguages[0],gpu:r.info.gpu,features:r.features},o=this.props.shaderAssembler.assembleShaders(i,this.props),s=o.vs,c=o.fs,a=o.getUniforms;if(this.vs=s,this.fs=c,this._getModuleUniforms=a,this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&(this._gpuGeometry=this.setGeometry(n.geometry)),this.pipelineFactory=n.pipelineFactory||ae.getDefaultPipelineFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=r.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),n.vertexCount&&this.setVertexCount(n.vertexCount),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.indices)throw new Error("Model.props.indices removed. Use props.indexBuffer");n.indexBuffer&&this.setIndexBuffer(n.indexBuffer),n.attributes&&this.setAttributes(n.attributes),n.constantAttributes&&this.setConstantAttributes(n.constantAttributes),n.bindings&&this.setBindings(n.bindings),n.uniforms&&this.setUniforms(n.uniforms),n.moduleSettings&&this.updateModuleSettings(n.moduleSettings),n.transformFeedback&&(this.transformFeedback=n.transformFeedback),this.setUniforms(this._getModuleUniforms()),Object.seal(this)}var t=e.prototype;return t.destroy=function(){this.pipelineFactory.release(this.pipeline)},t.draw=function(n){this.pipeline=this._updatePipeline(),this.pipeline.setBindings(this.bindings),this.pipeline.setUniforms(this.uniforms),this.pipeline.draw({renderPass:n,vertexArray:this.vertexArray,vertexCount:this.vertexCount,instanceCount:this.instanceCount,transformFeedback:this.transformFeedback})},t.setGeometry=function(n){var i=n&&to(this.device,n);return this.setTopology(i.topology||"triangle-list"),this.bufferLayout=io(this.bufferLayout,i.bufferLayout),this.vertexArray&&this._setGeometryAttributes(i),i},t._setGeometryAttributes=function(n){this.vertexCount=n.vertexCount,this.setAttributes(n.attributes),this.setIndexBuffer(n.indices)},t.setTopology=function(n){n!==this.topology&&(this.topology=n,this._setPipelineNeedsUpdate("topology"))},t.setBufferLayout=function(n){this.bufferLayout=this._gpuGeometry?io(n,this._gpuGeometry.bufferLayout):n,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)},t.setParameters=function(n){ne(n,this.parameters,2)||(this.parameters=n,this._setPipelineNeedsUpdate("parameters"))},t.setVertexCount=function(n){this.vertexCount=n},t.setInstanceCount=function(n){this.instanceCount=n},t.setShaderModuleProps=function(n){var i=nr(this._getModuleUniforms(n)),o=i.bindings,s=i.uniforms;Object.assign(this.bindings,o),Object.assign(this.uniforms,s)},t.setTransformFeedback=function(n){this.transformFeedback=n},t.updateModuleSettings=function(n){this.setShaderModuleProps(n)},t.setBindings=function(n){Object.assign(this.bindings,n)},t.setUniforms=function(n){this.pipeline.setUniforms(n),Object.assign(this.uniforms,n)},t.setIndexBuffer=function(n){this.vertexArray.setIndexBuffer(n)},t.setAttributes=function(n){var i=this;n.indices&&q.warn("Model:".concat(this.id," setAttributes() - indexBuffer should be set using setIndexBuffer()"));for(var o=function(){var u,l=B(c[s],2),h=l[0],g=l[1],m=i.bufferLayout.find(function(w){return w.name===h});if(!m)return q.warn("Model(".concat(i.id,'): Missing layout for buffer "').concat(h,'".'))(),"continue";var y=m.attributes?(u=m.attributes)===null||u===void 0?void 0:u.map(function(w){return w.attribute}):[m.name],b=!1,O=oo(y),R;try{for(O.s();!(R=O.n()).done;){var x=R.value,M=i._attributeInfos[x];M&&(i.vertexArray.setBuffer(M.location,g),b=!0)}}catch(w){O.e(w)}finally{O.f()}b||q.warn("Model(".concat(i.id,'): Ignoring buffer "').concat(g.id,'" for unknown attribute "').concat(h,'"'))()},s=0,c=Object.entries(n);s<c.length;s++)var a=o()},t.setConstantAttributes=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var s=B(o[i],2),c=s[0],a=s[1],f=this._attributeInfos[c];f?this.vertexArray.setConstant(f.location,a):q.warn('Model "'.concat(this.id,': Ignoring constant supplied for unknown attribute "').concat(c,'"'))()}},t._setPipelineNeedsUpdate=function(n){this._pipelineNeedsUpdate=this._pipelineNeedsUpdate||n},t._updatePipeline=function(){return this._pipelineNeedsUpdate&&(this.pipeline&&q.log(1,"Model ".concat(this.id,': Recreating pipeline because "').concat(this._pipelineNeedsUpdate,'".'))(),this._pipelineNeedsUpdate=!1,this.pipeline=this.device.createRenderPipeline(Yt(Yt({},this.props),{},{bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,vs:this.device.createShader({id:"{$this.id}-vertex",stage:"vertex",source:this.vs}),fs:this.fs?this.device.createShader({id:"{$this.id}-fragment",stage:"fragment",source:this.fs}):null})),this._attributeInfos=tr(this.pipeline.shaderLayout,this.bufferLayout)),this.pipeline},P(e)}();It.defaultProps=Yt(Yt({},kt.defaultProps),{},{vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:{},geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],pipelineFactory:void 0,transformFeedback:void 0,shaderAssembler:we.getDefaultShaderAssembler()});function io(e,t){var r=ie(e),n=oo(t),i;try{var o=function(){var c=i.value,a=r.findIndex(function(f){return f.name===c.name});a<0?r.push(c):r[a]=c};for(n.s();!(i=n.n()).done;)o()}catch(s){n.e(s)}finally{n.f()}return r}var so=function(){e.isSupported=function(n){return n.features.has("transform-feedback-webgl2")};function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T(this,e),this.device=void 0,this.model=void 0,this.transformFeedback=void 0,this.elementIDBuffer=null,tt(r.features.has("transform-feedback-webgl2"),"Device must support transform feedback"),this.device=r,this.model=new It(this.device,{vs:n.vs,fs:n.fs||yr({version:gr(n.vs).version}),id:n.id||"transform-model",varyings:n.varyings,attributes:n.attributes,bufferLayout:n.bufferLayout,topology:n.topology||"point-list",vertexCount:n.vertexCount,defines:n.defines,modules:n.modules}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}var t=e.prototype;return t.destroy=function(){this.model&&this.model.destroy()},t.run=function(n){var i=n||{},o=i.framebuffer,s=i.parameters,c=i.discard,a=i.uniforms,f=this.device.beginRenderPass({framebuffer:o,parameters:s,discard:c});a&&this.model.setUniforms(a),this.model.draw(f),f.end()},t.swap=function(){throw new Error("Not implemented")},t.getBuffer=function(n){return this.transformFeedback.getBuffer(n)},t.readAsync=function(n){var i=this.getBuffer(n);if(i instanceof $)return i.readAsync();var o=i.buffer,s=i.byteOffset,c=s===void 0?0:s,a=i.byteLength,f=a===void 0?o.byteLength:a;return o.readAsync(c,f)},t.getData=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("Not implemented")},t.getFramebuffer=function(){throw new Error("Not implemented")},t.update=function(n){throw new Error("Not implemented")},t._updateModelProps=function(n){throw new Error("Not implemented")},P(e)}();var ao=function(){function e(r){T(this,e),this.device=void 0,this.shaderModule=void 0,this.useUniformBuffers=void 0,this.uniformBufferLayout=void 0,this.uniformBuffer=null,this.uniforms={},this.modifiedUniforms={},this.modified=!0,this.needsRedraw="initialized",this.device=r.device,this.shaderModule=r.shaderModule,this.useUniformBuffers=this.device.info.type!=="webgl";for(var n={},i=0,o=Object.entries(r.shaderModule.uniformPropTypes||{});i<o.length;i++){var s=B(o[i],2),c=s[0],a=s[1].format;n[c]=a}this.uniformBufferLayout=new er(n),this.useUniformBuffers&&(this.uniformBuffer=this.device.createBuffer({usage:$.UNIFORM,byteLength:this.uniformBufferLayout.byteLength}))}var t=e.prototype;return t.setUniforms=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var s=B(o[i],2),c=s[0],a=s[1];this._setUniform(c,a),this.setNeedsRedraw(c)}},t.setNeedsRedraw=function(n){this.needsRedraw=this.needsRedraw||n},t.getUniformBuffer=function(){if(this.needsRedraw){var n=this.getModifiedUniforms(),i=this.uniformBufferLayout.getData(n);this.uniformBuffer.write(i)}return this.uniformBuffer},t.getUniforms=function(n){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms[n]||{}},t.getModifiedUniforms=function(){var n=this.modifiedUniforms;return this.modifiedUniforms={},this.needsRedraw=!1,n},t._setUniform=function(n,i){Sa(this.uniforms[n],i)||(this.uniforms[n]=i,this.modifiedUniforms[n]=!0,this.modified=!0)},P(e)}();function Sa(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16;if(e!==t)return!1;var n=St(e);if(!n)return!1;var i=St(t);if(i&&n.length===i.length){for(var o=0;o<n.length;++o)if(i[o]!==n[o])return!1}return!0}function co(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ma(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?co(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):co(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var st=function(){function e(r){T(this,e),this.id=void 0,this.topology=void 0,this.vertexCount=void 0,this.indices=void 0,this.attributes=void 0,this.userData={};var n=r.attributes,i=n===void 0?{}:n,o=r.indices,s=o===void 0?null:o,c=r.vertexCount,a=c===void 0?null:c;this.id=r.id||H("geometry"),this.topology=r.topology,s&&(this.indices=ArrayBuffer.isView(s)?{value:s,size:1}:s),this.attributes={};for(var f=0,u=Object.entries(i);f<u.length;f++){var l=B(u[f],2),h=l[0],g=l[1],m=ArrayBuffer.isView(g)?{value:g}:g;tt(ArrayBuffer.isView(m.value),"".concat(this._print(h),": must be typed array or object with value as typed array")),(h==="POSITION"||h==="positions")&&!m.size&&(m.size=3),h==="indices"?(tt(!this.indices),this.indices=m):this.attributes[h]=m}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=a||this._calculateVertexCount(this.attributes,this.indices)}var t=e.prototype;return t.getVertexCount=function(){return this.vertexCount},t.getAttributes=function(){return this.indices?Ma({indices:this.indices},this.attributes):this.attributes},t._print=function(n){return"Geometry ".concat(this.id," attribute ").concat(n)},t._setAttributes=function(n,i){return this},t._calculateVertexCount=function(n,i){if(i)return i.value.length;for(var o=1/0,s=0,c=Object.values(n);s<c.length;s++){var a=c[s],f=a.value,u=a.size,l=a.constant;!l&&f&&u>=1&&(o=Math.min(o,f.length/u))}return tt(Number.isFinite(o)),o},P(e)}();var fo;function uo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uo(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Aa(e){var t=Pa();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function Pa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ta=bn(fo||(fo=K([`attribute vec2 aClipSpacePosition;
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
gl_FragColor = `).concat(f,`;
|
|
246
|
+
}`)}function Ko(t,e){switch(e){case"float":return"vec4(".concat(t,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(t,", 0.0, 1.0)");case"vec3":return"vec4(".concat(t,", 1.0)");case"vec4":return t;default:throw new Error(e)}}var Kv=1/Math.PI*180,Wv=1/180*Math.PI,dl={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...dl}};var q=globalThis.mathgl.config;function Wo(t,{precision:e=q.precision}={}){return t=yl(t),"".concat(parseFloat(t.toPrecision(e)))}function Bt(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Vr(t,e,r){let n=q.EPSILON;r&&(q.EPSILON=r);try{if(t===e)return!0;if(Bt(t)&&Bt(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!Vr(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=q.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{q.EPSILON=n}}function yl(t){return Math.round(t/q.EPSILON)*q.EPSILON}function vl(t){function e(){var r=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var zt=class extends vl(Array){clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:Bt(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(q)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Wo(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Vr(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let i=0;i<this.ELEMENTS;++i){let o=e[i],a=typeof r=="number"?r:r[i];this[i]=o+n*(a-o)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(q.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function gl(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function Y(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(JSON.stringify(t)));return t}function qe(t,e,r=""){if(q.debug&&!gl(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}function Hr(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var Ye=class extends zt{get x(){return this[0]}set x(e){this[0]=Y(e)}get y(){return this[1]}set y(e){this[1]=Y(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-e[n];r+=i*i}return Y(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return Y(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Hr(e>=0&&e<this.ELEMENTS,"index is out of range"),Y(this[e])}setComponent(e,r){return Hr(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){return this.add(new this.constructor(e).multiplyScalar(r))}};var ft=typeof Float32Array<"u"?Float32Array:Array;var ng=Math.PI/180;function bl(){let t=new ft(2);return ft!=Float32Array&&(t[0]=0,t[1]=0),t}function Xo(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}var ig=function(){let t=bl();return function(e,r,n,i,o,a){let f,s;for(r||(r=2),n||(n=0),i?s=Math.min(i*r+n,e.length):s=e.length,f=n;f<s;f+=r)t[0]=e[f],t[1]=e[f+1],o(t,t,a),e[f]=t[0],e[f+1]=t[1];return e}}();function $o(t,e,r){let n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function Xe(t,e,r){let n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/a,t[1]=(r[1]*n+r[5]*i+r[9]*o)/a,t[2]=(r[2]*n+r[6]*i+r[10]*o)/a,t}function Zo(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t}function wl(){let t=new ft(3);return ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _l(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Jo(t,e,r){let n=e[0],i=e[1],o=e[2],a=r[0],f=r[1],s=r[2];return t[0]=i*s-o*f,t[1]=o*a-n*s,t[2]=n*f-i*a,t}function $e(t,e,r){let n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function Qo(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function ta(t,e,r){let n=r[0],i=r[1],o=r[2],a=r[3],f=e[0],s=e[1],l=e[2],p=i*l-o*s,y=o*f-n*l,g=n*s-i*f,w=i*g-o*y,b=o*p-n*g,_=n*y-i*p,x=a*2;return p*=x,y*=x,g*=x,w*=2,b*=2,_*=2,t[0]=f+p+w,t[1]=s+y+b,t[2]=l+g+_,t}function ea(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function ra(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function na(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function ia(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],f=e[2],s=Math.sqrt((r*r+n*n+i*i)*(o*o+a*a+f*f)),l=s&&_l(t,e)/s;return Math.acos(Math.min(Math.max(l,-1),1))}var sg=function(){let t=wl();return function(e,r,n,i,o,a){let f,s;for(r||(r=3),n||(n=0),i?s=Math.min(i*r+n,e.length):s=e.length,f=n;f<s;f+=r)t[0]=e[f],t[1]=e[f+1],t[2]=e[f+2],o(t,t,a),e[f]=t[0],e[f+1]=t[1],e[f+2]=t[2];return e}}();var Wr=[0,0,0],Ze,$=class extends Ye{static get ZERO(){return Ze||(Ze=new $(0,0,0),Object.freeze(Ze)),Ze}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Bt(e)?this.copy(e):(q.debug&&(Y(e),Y(r),Y(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return q.debug&&(Y(e.x),Y(e.y),Y(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=Y(e)}angle(e){return ia(this,e)}cross(e){return Jo(this,this,e),this.check()}rotateX({radians:e,origin:r=Wr}){return ea(this,this,r,e),this.check()}rotateY({radians:e,origin:r=Wr}){return ra(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=Wr}){return na(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return $e(this,this,e),this.check()}transformAsVector(e){return Xe(this,this,e),this.check()}transformByMatrix3(e){return Qo(this,this,e),this.check()}transformByMatrix2(e){return Zo(this,this,e),this.check()}transformByQuaternion(e){return ta(this,this,e),this.check()}};var Je=class extends zt{toString(){let e="[";if(q.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+r])}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=" ".concat(this[r])}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=Y(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(e,r){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function Ol(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function oa(t,e){if(t===e){let r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],f=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=f}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function aa(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],f=e[5],s=e[6],l=e[7],p=e[8],y=e[9],g=e[10],w=e[11],b=e[12],_=e[13],x=e[14],S=e[15],R=r*f-n*a,E=r*s-i*a,T=r*l-o*a,M=n*s-i*f,L=n*l-o*f,j=i*l-o*s,N=p*_-y*b,F=p*x-g*b,D=p*S-w*b,C=y*x-g*_,h=y*S-w*_,c=g*S-w*x,u=R*c-E*h+T*C+M*D-L*F+j*N;return u?(u=1/u,t[0]=(f*c-s*h+l*C)*u,t[1]=(i*h-n*c-o*C)*u,t[2]=(_*j-x*L+S*M)*u,t[3]=(g*L-y*j-w*M)*u,t[4]=(s*D-a*c-l*F)*u,t[5]=(r*c-i*D+o*F)*u,t[6]=(x*T-b*j-S*E)*u,t[7]=(p*j-g*T+w*E)*u,t[8]=(a*h-f*D+l*N)*u,t[9]=(n*D-r*h-o*N)*u,t[10]=(b*L-_*T+S*R)*u,t[11]=(y*T-p*L-w*R)*u,t[12]=(f*F-a*C-s*N)*u,t[13]=(r*C-n*F+i*N)*u,t[14]=(_*E-b*M-x*R)*u,t[15]=(p*M-y*E+g*R)*u,t):null}function sa(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],f=t[6],s=t[7],l=t[8],p=t[9],y=t[10],g=t[11],w=t[12],b=t[13],_=t[14],x=t[15],S=e*a-r*o,R=e*f-n*o,E=r*f-n*a,T=l*b-p*w,M=l*_-y*w,L=p*_-y*b,j=e*L-r*M+n*T,N=o*L-a*M+f*T,F=l*E-p*R+y*S,D=w*E-b*R+_*S;return s*j-i*N+x*F-g*D}function qr(t,e,r){let n=e[0],i=e[1],o=e[2],a=e[3],f=e[4],s=e[5],l=e[6],p=e[7],y=e[8],g=e[9],w=e[10],b=e[11],_=e[12],x=e[13],S=e[14],R=e[15],E=r[0],T=r[1],M=r[2],L=r[3];return t[0]=E*n+T*f+M*y+L*_,t[1]=E*i+T*s+M*g+L*x,t[2]=E*o+T*l+M*w+L*S,t[3]=E*a+T*p+M*b+L*R,E=r[4],T=r[5],M=r[6],L=r[7],t[4]=E*n+T*f+M*y+L*_,t[5]=E*i+T*s+M*g+L*x,t[6]=E*o+T*l+M*w+L*S,t[7]=E*a+T*p+M*b+L*R,E=r[8],T=r[9],M=r[10],L=r[11],t[8]=E*n+T*f+M*y+L*_,t[9]=E*i+T*s+M*g+L*x,t[10]=E*o+T*l+M*w+L*S,t[11]=E*a+T*p+M*b+L*R,E=r[12],T=r[13],M=r[14],L=r[15],t[12]=E*n+T*f+M*y+L*_,t[13]=E*i+T*s+M*g+L*x,t[14]=E*o+T*l+M*w+L*S,t[15]=E*a+T*p+M*b+L*R,t}function fa(t,e,r){let n=r[0],i=r[1],o=r[2],a,f,s,l,p,y,g,w,b,_,x,S;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(a=e[0],f=e[1],s=e[2],l=e[3],p=e[4],y=e[5],g=e[6],w=e[7],b=e[8],_=e[9],x=e[10],S=e[11],t[0]=a,t[1]=f,t[2]=s,t[3]=l,t[4]=p,t[5]=y,t[6]=g,t[7]=w,t[8]=b,t[9]=_,t[10]=x,t[11]=S,t[12]=a*n+p*i+b*o+e[12],t[13]=f*n+y*i+_*o+e[13],t[14]=s*n+g*i+x*o+e[14],t[15]=l*n+w*i+S*o+e[15]),t}function ca(t,e,r){let n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ua(t,e,r,n){let i=n[0],o=n[1],a=n[2],f=Math.sqrt(i*i+o*o+a*a),s,l,p,y,g,w,b,_,x,S,R,E,T,M,L,j,N,F,D,C,h,c,u,m;return f<1e-6?null:(f=1/f,i*=f,o*=f,a*=f,l=Math.sin(r),s=Math.cos(r),p=1-s,y=e[0],g=e[1],w=e[2],b=e[3],_=e[4],x=e[5],S=e[6],R=e[7],E=e[8],T=e[9],M=e[10],L=e[11],j=i*i*p+s,N=o*i*p+a*l,F=a*i*p-o*l,D=i*o*p-a*l,C=o*o*p+s,h=a*o*p+i*l,c=i*a*p+o*l,u=o*a*p-i*l,m=a*a*p+s,t[0]=y*j+_*N+E*F,t[1]=g*j+x*N+T*F,t[2]=w*j+S*N+M*F,t[3]=b*j+R*N+L*F,t[4]=y*D+_*C+E*h,t[5]=g*D+x*C+T*h,t[6]=w*D+S*C+M*h,t[7]=b*D+R*C+L*h,t[8]=y*c+_*u+E*m,t[9]=g*c+x*u+T*m,t[10]=w*c+S*u+M*m,t[11]=b*c+R*u+L*m,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function la(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],f=e[6],s=e[7],l=e[8],p=e[9],y=e[10],g=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*n,t[5]=a*i+p*n,t[6]=f*i+y*n,t[7]=s*i+g*n,t[8]=l*i-o*n,t[9]=p*i-a*n,t[10]=y*i-f*n,t[11]=g*i-s*n,t}function ha(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],f=e[2],s=e[3],l=e[8],p=e[9],y=e[10],g=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*n,t[1]=a*i-p*n,t[2]=f*i-y*n,t[3]=s*i-g*n,t[8]=o*n+l*i,t[9]=a*n+p*i,t[10]=f*n+y*i,t[11]=s*n+g*i,t}function pa(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],f=e[2],s=e[3],l=e[4],p=e[5],y=e[6],g=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*n,t[1]=a*i+p*n,t[2]=f*i+y*n,t[3]=s*i+g*n,t[4]=l*i-o*n,t[5]=p*i-a*n,t[6]=y*i-f*n,t[7]=g*i-s*n,t}function ma(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,f=n+n,s=i+i,l=r*a,p=n*a,y=n*f,g=i*a,w=i*f,b=i*s,_=o*a,x=o*f,S=o*s;return t[0]=1-y-b,t[1]=p+S,t[2]=g-x,t[3]=0,t[4]=p-S,t[5]=1-l-b,t[6]=w+_,t[7]=0,t[8]=g+x,t[9]=w-_,t[10]=1-l-y,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function da(t,e,r,n,i,o,a){let f=1/(r-e),s=1/(i-n),l=1/(o-a);return t[0]=o*2*f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*s,t[6]=0,t[7]=0,t[8]=(r+e)*f,t[9]=(i+n)*s,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t}function Sl(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let a=1/(n-i);t[10]=(i+n)*a,t[14]=2*i*n*a}else t[10]=-1,t[14]=-2*n;return t}var ya=Sl;function Pl(t,e,r,n,i,o,a){let f=1/(e-r),s=1/(n-i),l=1/(o-a);return t[0]=-2*f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*f,t[13]=(i+n)*s,t[14]=(a+o)*l,t[15]=1,t}var va=Pl;function ga(t,e,r,n){let i,o,a,f,s,l,p,y,g,w,b=e[0],_=e[1],x=e[2],S=n[0],R=n[1],E=n[2],T=r[0],M=r[1],L=r[2];return Math.abs(b-T)<1e-6&&Math.abs(_-M)<1e-6&&Math.abs(x-L)<1e-6?Ol(t):(y=b-T,g=_-M,w=x-L,i=1/Math.sqrt(y*y+g*g+w*w),y*=i,g*=i,w*=i,o=R*w-E*g,a=E*y-S*w,f=S*g-R*y,i=Math.sqrt(o*o+a*a+f*f),i?(i=1/i,o*=i,a*=i,f*=i):(o=0,a=0,f=0),s=g*f-w*a,l=w*o-y*f,p=y*a-g*o,i=Math.sqrt(s*s+l*l+p*p),i?(i=1/i,s*=i,l*=i,p*=i):(s=0,l=0,p=0),t[0]=o,t[1]=s,t[2]=y,t[3]=0,t[4]=a,t[5]=l,t[6]=g,t[7]=0,t[8]=f,t[9]=p,t[10]=w,t[11]=0,t[12]=-(o*b+a*_+f*x),t[13]=-(s*b+l*_+p*x),t[14]=-(y*b+g*_+w*x),t[15]=1,t)}function xl(){let t=new ft(4);return ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ba(t,e,r){let n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}var wg=function(){let t=xl();return function(e,r,n,i,o,a){let f,s;for(r||(r=4),n||(n=0),i?s=Math.min(i*r+n,e.length):s=e.length,f=n;f<s;f+=r)t[0]=e[f],t[1]=e[f+1],t[2]=e[f+2],t[3]=e[f+3],o(t,t,a),e[f]=t[0],e[f+1]=t[1],e[f+2]=t[2],e[f+3]=t[3];return e}}();var $r;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})($r||($r={}));var El=45*Math.PI/180,Al=1,Yr=.1,Xr=500,Tl=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),rt=class extends Je{static get IDENTITY(){return Rl()}static get ZERO(){return Ml()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return $r}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,i,o,a,f,s,l,p,y,g,w,b,_,x){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=a,this[6]=f,this[7]=s,this[8]=l,this[9]=p,this[10]=y,this[11]=g,this[12]=w,this[13]=b,this[14]=_,this[15]=x,this.check()}setRowMajor(e,r,n,i,o,a,f,s,l,p,y,g,w,b,_,x){return this[0]=e,this[1]=o,this[2]=l,this[3]=w,this[4]=r,this[5]=a,this[6]=p,this[7]=b,this[8]=n,this[9]=f,this[10]=y,this[11]=_,this[12]=i,this[13]=s,this[14]=g,this[15]=x,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Tl)}fromObject(e){return this.check()}fromQuaternion(e){return ma(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:i,top:o,near:a=Yr,far:f=Xr}=e;return f===1/0?Ll(this,r,n,i,o,a):da(this,r,n,i,o,a,f),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=e;return ga(this,r,n,i),this.check()}ortho(e){let{left:r,right:n,bottom:i,top:o,near:a=Yr,far:f=Xr}=e;return va(this,r,n,i,o,a,f),this.check()}orthographic(e){let{fovy:r=El,aspect:n=Al,focalDistance:i=1,near:o=Yr,far:a=Xr}=e;wa(r);let f=r/2,s=i*Math.tan(f),l=s*n;return this.ortho({left:-l,right:l,bottom:-s,top:s,near:o,far:a})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=e;return wa(r),ya(this,r,n,i,o),this.check()}determinant(){return sa(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],a=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*i,e[5]=this[5]*o,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*i,e[9]=this[9]*o,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],a=1/n[2];return e[0]=this[0]*i,e[1]=this[1]*o,e[2]=this[2]*a,e[3]=this[4]*i,e[4]=this[5]*o,e[5]=this[6]*a,e[6]=this[8]*i,e[7]=this[9]*o,e[8]=this[10]*a,e}transpose(){return oa(this,this),this.check()}invert(){return aa(this,this),this.check()}multiplyLeft(e){return qr(this,e,this),this.check()}multiplyRight(e){return qr(this,this,e),this.check()}rotateX(e){return la(this,this,e),this.check()}rotateY(e){return ha(this,this,e),this.check()}rotateZ(e){return pa(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return ua(this,this,e,r),this.check()}scale(e){return ca(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return fa(this,this,e),this.check()}transform(e,r){return e.length===4?(r=ba(r||[-0,-0,-0,-0],e,this),qe(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,i;switch(n){case 2:i=Xo(r||[-0,-0],e,this);break;case 3:i=$e(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return qe(i,e.length),i}transformAsVector(e,r){let n;switch(e.length){case 2:n=$o(r||[-0,-0],e,this);break;case 3:n=Xe(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return qe(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},Qe,tr;function Ml(){return Qe||(Qe=new rt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Qe)),Qe}function Rl(){return tr||(tr=new rt,Object.freeze(tr)),tr}function wa(t){if(t>Math.PI*2)throw Error("expected radians")}function Ll(t,e,r,n,i,o){let a=2*o/(r-e),f=2*o/(i-n),s=(r+e)/(r-e),l=(i+n)/(i-n),p=-1,y=-1,g=-2*o;return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=s,t[9]=l,t[10]=p,t[11]=y,t[12]=0,t[13]=0,t[14]=g,t[15]=0,t}function Oe(t){return Oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oe(t)}function Il(t,e){return Cl(t)||Dl(t,e)||Nl(t,e)||jl()}function jl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
247
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nl(t,e){if(t){if(typeof t=="string")return _a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _a(t,e)}}function _a(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Dl(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Cl(t){if(Array.isArray(t))return t}function Oa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ul(n.key),n)}}function Fl(t,e,r){return e&&Oa(t.prototype,e),r&&Oa(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ul(t){var e=Gl(t,"string");return Oe(e)==="symbol"?e:String(e)}function Gl(t,e){if(Oe(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Oe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var er=function(){function t(r){Bl(this,t),this.modules=void 0,this.moduleUniforms=void 0,this.moduleBindings=void 0,this.moduleUniformsChanged=void 0;var n=ye(Object.values(r));B.log(1,"Creating ShaderInputs with modules",n.map(function(y){return y.name}))(),this.modules=r,this.moduleUniforms={},this.moduleBindings={};for(var i=0,o=Object.entries(r);i<o.length;i++){var a,f=Il(o[i],2),s=f[0],l=f[1],p=s;this.moduleUniforms[p]=((a=l.getUniforms)===null||a===void 0?void 0:a.call(l,{}))||l.defaultUniforms||{},this.moduleBindings[p]={}}}var e=t.prototype;return e.destroy=function(){},e.setProps=function(n){for(var i=0,o=Object.keys(n);i<o.length;i++){var a,f=o[i],s=f,l=n[s],p=this.modules[s],y=(a=p.getUniforms)===null||a===void 0?void 0:a.call(p,l,this.moduleUniforms[s]);console.error(y),this.moduleUniforms[s]=y||l,console.log("setProps(".concat(String(s)),s,this.moduleUniforms[s])}},e.getModules=function(){return Object.values(this.modules)},e.getUniformValues=function(){return this.moduleUniforms},e.getBindings=function(){for(var n={},i=0,o=Object.values(this.moduleBindings);i<o.length;i++){var a=o[i];Object.assign(n,a)}return n},Fl(t)}();function Se(t){return Se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Se(t)}function zl(t,e){return Kl(t)||Hl(t,e)||Vl(t,e)||kl()}function kl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
248
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vl(t,e){if(t){if(typeof t=="string")return Sa(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Sa(t,e)}}function Sa(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Hl(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Kl(t){if(Array.isArray(t))return t}function Pa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ql(n.key),n)}}function Wl(t,e,r){return e&&Pa(t.prototype,e),r&&Pa(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ql(t){var e=Yl(t,"string");return Se(e)==="symbol"?e:String(e)}function Yl(t,e){if(Se(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Se(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var rr=function(){function t(r){Xl(this,t),this.id=void 0,this.userData={},this.topology=void 0,this.bufferLayout=[],this.vertexCount=void 0,this.indices=void 0,this.attributes=void 0,this.id=r.id||z("geometry"),this.topology=r.topology,this.indices=r.indices||null,this.attributes=r.attributes,this.vertexCount=r.vertexCount,this.bufferLayout=r.bufferLayout||[],this.indices&&W(this.indices.usage===k.INDEX)}var e=t.prototype;return e.destroy=function(){var n;this.indices.destroy(),this.attributes.positions.destroy(),this.attributes.normals.destroy(),this.attributes.texCoords.destroy(),(n=this.attributes.colors)===null||n===void 0||n.destroy()},e.getVertexCount=function(){return this.vertexCount},e.getAttributes=function(){return this.attributes},e.getIndexes=function(){return this.indices},e._calculateVertexCount=function(n){var i=n.byteLength/12;return i},Wl(t)}();function xa(t,e){if(e instanceof rr)return e;var r=$l(t,e),n=Zl(t,e),i=n.attributes,o=n.bufferLayout;return new rr({topology:e.topology||"triangle-list",bufferLayout:o,vertexCount:e.vertexCount,indices:r,attributes:i})}function $l(t,e){if(e.indices){var r=e.indices.value;return t.createBuffer({usage:k.INDEX,data:r})}}function Zl(t,e){for(var r=[],n={},i=0,o=Object.entries(e.attributes);i<o.length;i++){var a=zl(o[i],2),f=a[0],s=a[1],l=f;switch(f){case"POSITION":l="positions";break;case"NORMAL":l="normals";break;case"TEXCOORD_0":l="texCoords";break}n[l]=t.createBuffer({data:s.value,id:"".concat(f,"-buffer")});var p=s.value,y=s.size,g=s.normalized;r.push({name:l,format:Ir(p,y,g)})}var w=e._calculateVertexCount(e.attributes,e.indices);return{attributes:n,bufferLayout:r,vertexCount:w}}function Pe(t){return Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pe(t)}function Ea(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ea(Object(r),!0).forEach(function(n){Jl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ea(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Jl(t,e,r){return e=Ta(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Aa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ta(n.key),n)}}function Ql(t,e,r){return e&&Aa(t.prototype,e),r&&Aa(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ta(t){var e=th(t,"string");return Pe(e)==="symbol"?e:String(e)}function th(t,e){if(Pe(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var xe=function(){t.getDefaultPipelineFactory=function(n){return n._lumaData.defaultPipelineFactory=n._lumaData.defaultPipelineFactory||new t(n),n._lumaData.defaultPipelineFactory};function t(r){eh(this,t),this.device=void 0,this._hashCounter=0,this._hashes={},this._useCounts={},this._pipelineCache={},this.device=r}var e=t.prototype;return e.createRenderPipeline=function(n){var i=ct(ct({},t.defaultProps),n),o=this._hashRenderPipeline(ct({},i));if(!this._pipelineCache[o]){var a=this.device.createRenderPipeline(ct(ct({},i),{},{vs:this.device.createShader({stage:"vertex",source:i.vs}),fs:i.fs?this.device.createShader({stage:"fragment",source:i.fs}):null}));a.hash=o,this._pipelineCache[o]=a,this._useCounts[o]=0}return this._useCounts[o]++,this._pipelineCache[o]},e.release=function(n){var i=n.hash;this._useCounts[i]--,this._useCounts[i]===0&&(this._pipelineCache[i].destroy(),delete this._pipelineCache[i],delete this._useCounts[i])},e._createRenderPipeline=function(n){if(!n.fs)throw new Error("fs");var i=this.device.createRenderPipeline(ct(ct({},n),{},{vs:this.device.createShader({stage:"vertex",source:n.vs}),fs:n.fs?this.device.createShader({stage:"fragment",source:n.fs}):null}));return i},e._hashRenderPipeline=function(n){var i=this._getHash(n.vs),o=n.fs?this._getHash(n.fs):0,a="-";switch(this.device.info.type){case"webgpu":var f=this._getHash(JSON.stringify(n.parameters)),s=this._getHash(JSON.stringify(n.bufferLayout));return"".concat(i,"/").concat(o,"V").concat(a,"T").concat(n.topology,"P").concat(f,"BL").concat(s,"}");default:return"".concat(i,"/").concat(o,"V").concat(a)}},e._getHash=function(n){return this._hashes[n]===void 0&&(this._hashes[n]=this._hashCounter++),this._hashes[n]},Ql(t)}();xe.defaultProps=ct(ct({},Ct.defaultProps),{},{vs:void 0,fs:void 0});function Ee(t){return Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ee(t)}function rh(t){return oh(t)||ih(t)||Jr(t)||nh()}function nh(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
249
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ih(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function oh(t){if(Array.isArray(t))return Zr(t)}function ja(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Jr(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
250
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Ma(t,e){return fh(t)||sh(t,e)||Jr(t,e)||ah()}function ah(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
251
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jr(t,e){if(t){if(typeof t=="string")return Zr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zr(t,e)}}function Zr(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function sh(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function fh(t){if(Array.isArray(t))return t}function Ra(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ra(Object(r),!0).forEach(function(n){ch(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ra(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ch(t,e,r){return e=Na(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function La(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Na(n.key),n)}}function uh(t,e,r){return e&&La(t.prototype,e),r&&La(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Na(t){var e=lh(t,"string");return Ee(e)==="symbol"?e:String(e)}function lh(t,e){if(Ee(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ee(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var xt=function(){function t(r,n){var i,o,a;hh(this,t),this.device=void 0,this.id=void 0,this.vs=void 0,this.fs=void 0,this.pipelineFactory=void 0,this.userData={},this.parameters=void 0,this.topology=void 0,this.bufferLayout=void 0,this.vertexCount=void 0,this.instanceCount=0,this.indexBuffer=null,this.bufferAttributes={},this.constantAttributes={},this.bindings={},this.uniforms={},this.vertexArray=void 0,this.transformFeedback=null,this.pipeline=void 0,this.shaderInputs=void 0,this._uniformStore=void 0,this._pipelineNeedsUpdate="newly created",this._attributeInfos={},this._gpuGeometry=null,this._getModuleUniforms=void 0,this.props=void 0,this.props=gt(gt({},t.defaultProps),n),n=this.props,this.id=n.id||z("model"),this.device=r,Object.assign(this.userData,n.userData);var f=Object.fromEntries(((i=this.props.modules)===null||i===void 0?void 0:i.map(function(b){return[b.name,b]}))||[]);this.setShaderInputs(n.shaderInputs||new er(f));var s=ph(r),l=(((o=this.props.modules)===null||o===void 0?void 0:o.length)>0?this.props.modules:(a=this.shaderInputs)===null||a===void 0?void 0:a.getModules())||[],p=this.props.shaderAssembler.assembleShaders(gt(gt({platformInfo:s},this.props),{},{modules:l})),y=p.vs,g=p.fs,w=p.getUniforms;if(this.vs=y,this.fs=g,this._getModuleUniforms=w,this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&(this._gpuGeometry=this.setGeometry(n.geometry)),this.pipelineFactory=n.pipelineFactory||xe.getDefaultPipelineFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=r.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),n.vertexCount&&this.setVertexCount(n.vertexCount),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.indices)throw new Error("Model.props.indices removed. Use props.indexBuffer");n.indexBuffer&&this.setIndexBuffer(n.indexBuffer),n.attributes&&this.setAttributes(n.attributes),n.constantAttributes&&this.setConstantAttributes(n.constantAttributes),n.bindings&&this.setBindings(n.bindings),n.uniforms&&this.setUniforms(n.uniforms),n.moduleSettings&&(console.warn("Model.props.moduleSettings is deprecated. Use Model.shaderInputs.setProps()"),this.updateModuleSettings(n.moduleSettings)),n.transformFeedback&&(this.transformFeedback=n.transformFeedback),Object.seal(this)}var e=t.prototype;return e.destroy=function(){this.pipelineFactory.release(this.pipeline),this._uniformStore.destroy()},e.predraw=function(){this.updateShaderInputs()},e.draw=function(n){this.predraw(),this.pipeline=this._updatePipeline(),this.pipeline.setBindings(this.bindings),this.pipeline.setUniforms(this.uniforms),this.pipeline.draw({renderPass:n,vertexArray:this.vertexArray,vertexCount:this.vertexCount,instanceCount:this.instanceCount,transformFeedback:this.transformFeedback})},e.setGeometry=function(n){var i=n&&xa(this.device,n);return this.setTopology(i.topology||"triangle-list"),this.bufferLayout=Ia(this.bufferLayout,i.bufferLayout),this.vertexArray&&this._setGeometryAttributes(i),i},e._setGeometryAttributes=function(n){this.vertexCount=n.vertexCount,this.setAttributes(n.attributes),this.setIndexBuffer(n.indices)},e.setTopology=function(n){n!==this.topology&&(this.topology=n,this._setPipelineNeedsUpdate("topology"))},e.setBufferLayout=function(n){this.bufferLayout=this._gpuGeometry?Ia(n,this._gpuGeometry.bufferLayout):n,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)},e.setParameters=function(n){he(n,this.parameters,2)||(this.parameters=n,this._setPipelineNeedsUpdate("parameters"))},e.setVertexCount=function(n){this.vertexCount=n},e.setInstanceCount=function(n){this.instanceCount=n},e.setShaderInputs=function(n){this.shaderInputs=n,this._uniformStore=new Lr(this.shaderInputs.modules);for(var i=0,o=Object.keys(this.shaderInputs.modules);i<o.length;i++){var a=o[i],f=this._uniformStore.getManagedUniformBuffer(this.device,a);this.bindings["".concat(a,"Uniforms")]=f}},e.updateShaderInputs=function(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues())},e.updateModuleSettings=function(n){console.warn("Model.updateModuleSettings is deprecated. Use Model.shaderInputs.setProps()");var i=jr(this._getModuleUniforms(n)),o=i.bindings,a=i.uniforms;Object.assign(this.bindings,o),Object.assign(this.uniforms,a)},e.setBindings=function(n){Object.assign(this.bindings,n)},e.setUniforms=function(n){this.pipeline.setUniforms(n),Object.assign(this.uniforms,n)},e.setIndexBuffer=function(n){this.vertexArray.setIndexBuffer(n)},e.setTransformFeedback=function(n){this.transformFeedback=n},e.setAttributes=function(n){var i=this;n.indices&&B.warn("Model:".concat(this.id," setAttributes() - indexBuffer should be set using setIndexBuffer()"));for(var o=function(){var p,y=Ma(f[a],2),g=y[0],w=y[1],b=i.bufferLayout.find(function(M){return M.name===g});if(!b)return B.warn("Model(".concat(i.id,'): Missing layout for buffer "').concat(g,'".'))(),"continue";var _=b.attributes?(p=b.attributes)===null||p===void 0?void 0:p.map(function(M){return M.attribute}):[b.name],x=!1,S=ja(_),R;try{for(S.s();!(R=S.n()).done;){var E=R.value,T=i._attributeInfos[E];T&&(i.vertexArray.setBuffer(T.location,w),x=!0)}}catch(M){S.e(M)}finally{S.f()}x||B.warn("Model(".concat(i.id,'): Ignoring buffer "').concat(w.id,'" for unknown attribute "').concat(g,'"'))()},a=0,f=Object.entries(n);a<f.length;a++)var s=o()},e.setConstantAttributes=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=Ma(o[i],2),f=a[0],s=a[1],l=this._attributeInfos[f];l?this.vertexArray.setConstant(l.location,s):B.warn('Model "'.concat(this.id,': Ignoring constant supplied for unknown attribute "').concat(f,'"'))()}},e._setPipelineNeedsUpdate=function(n){this._pipelineNeedsUpdate=this._pipelineNeedsUpdate||n},e._updatePipeline=function(){return this._pipelineNeedsUpdate&&(this.pipeline&&B.log(1,"Model ".concat(this.id,': Recreating pipeline because "').concat(this._pipelineNeedsUpdate,'".'))(),this._pipelineNeedsUpdate=!1,this.pipeline=this.device.createRenderPipeline(gt(gt({},this.props),{},{bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,vs:this.device.createShader({id:"{$this.id}-vertex",stage:"vertex",source:this.vs}),fs:this.fs?this.device.createShader({id:"{$this.id}-fragment",stage:"fragment",source:this.fs}):null})),this._attributeInfos=Rr(this.pipeline.shaderLayout,this.bufferLayout)),this.pipeline},uh(t)}();xt.defaultProps=gt(gt({},Ct.defaultProps),{},{vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],shaderInputs:void 0,pipelineFactory:void 0,transformFeedback:void 0,shaderAssembler:We.getDefaultShaderAssembler()});function Ia(t,e){var r=rh(t),n=ja(e),i;try{var o=function(){var f=i.value,s=r.findIndex(function(l){return l.name===f.name});s<0?r.push(f):r[s]=f};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}function ph(t){return{type:t.info.type,shaderLanguage:t.info.shadingLanguage,shaderLanguageVersion:t.info.shadingLanguageVersion,gpu:t.info.gpu,features:t.features}}function Ae(t){return Ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(t)}function Da(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dh(n.key),n)}}function mh(t,e,r){return e&&Da(t.prototype,e),r&&Da(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function dh(t){var e=yh(t,"string");return Ae(e)==="symbol"?e:String(e)}function yh(t,e){if(Ae(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ae(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Ca=function(){t.isSupported=function(n){return n.features.has("transform-feedback-webgl2")};function t(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vh(this,t),this.device=void 0,this.model=void 0,this.transformFeedback=void 0,this.elementIDBuffer=null,W(r.features.has("transform-feedback-webgl2"),"Device must support transform feedback"),this.device=r,this.model=new xt(this.device,{vs:n.vs,fs:n.fs||kr({version:ge(n.vs).version}),id:n.id||"transform-model",varyings:n.varyings,attributes:n.attributes,bufferLayout:n.bufferLayout,topology:n.topology||"point-list",vertexCount:n.vertexCount,defines:n.defines,modules:n.modules}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}var e=t.prototype;return e.destroy=function(){this.model&&this.model.destroy()},e.run=function(n){var i=n||{},o=i.framebuffer,a=i.parameters,f=i.discard,s=i.uniforms,l=this.device.beginRenderPass({framebuffer:o,parameters:a,discard:f});s&&this.model.setUniforms(s),this.model.draw(l),l.end()},e.swap=function(){throw new Error("Not implemented")},e.getBuffer=function(n){return this.transformFeedback.getBuffer(n)},e.readAsync=function(n){var i=this.getBuffer(n);if(i instanceof k)return i.readAsync();var o=i.buffer,a=i.byteOffset,f=a===void 0?0:a,s=i.byteLength,l=s===void 0?o.byteLength:s;return o.readAsync(f,l)},e.getData=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("Not implemented")},e.getFramebuffer=function(){throw new Error("Not implemented")},e.update=function(n){throw new Error("Not implemented")},e._updateModelProps=function(n){throw new Error("Not implemented")},mh(t)}();function Te(t){return Te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Te(t)}function Fa(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Fa(Object(r),!0).forEach(function(n){bh(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fa(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bh(t,e,r){return e=Ba(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wh(t,e){return Ph(t)||Sh(t,e)||Oh(t,e)||_h()}function _h(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
252
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oh(t,e){if(t){if(typeof t=="string")return Ua(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ua(t,e)}}function Ua(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Sh(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Ph(t){if(Array.isArray(t))return t}function Ga(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ba(n.key),n)}}function xh(t,e,r){return e&&Ga(t.prototype,e),r&&Ga(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ba(t){var e=Eh(t,"string");return Te(e)==="symbol"?e:String(e)}function Eh(t,e){if(Te(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Te(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ah(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Z=function(){function t(r){Ah(this,t),this.id=void 0,this.topology=void 0,this.vertexCount=void 0,this.indices=void 0,this.attributes=void 0,this.userData={};var n=r.attributes,i=n===void 0?{}:n,o=r.indices,a=o===void 0?null:o,f=r.vertexCount,s=f===void 0?null:f;this.id=r.id||z("geometry"),this.topology=r.topology,a&&(this.indices=ArrayBuffer.isView(a)?{value:a,size:1}:a),this.attributes={};for(var l=0,p=Object.entries(i);l<p.length;l++){var y=wh(p[l],2),g=y[0],w=y[1],b=ArrayBuffer.isView(w)?{value:w}:w;W(ArrayBuffer.isView(b.value),"".concat(this._print(g),": must be typed array or object with value as typed array")),(g==="POSITION"||g==="positions")&&!b.size&&(b.size=3),g==="indices"?(W(!this.indices),this.indices=b):this.attributes[g]=b}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}var e=t.prototype;return e.getVertexCount=function(){return this.vertexCount},e.getAttributes=function(){return this.indices?gh({indices:this.indices},this.attributes):this.attributes},e._print=function(n){return"Geometry ".concat(this.id," attribute ").concat(n)},e._setAttributes=function(n,i){return this},e._calculateVertexCount=function(n,i){if(i)return i.value.length;for(var o=1/0,a=0,f=Object.values(n);a<f.length;a++){var s=f[a],l=s.value,p=s.size,y=s.constant;!y&&l&&p>=1&&(o=Math.min(o,l.length/p))}return W(Number.isFinite(o)),o},xh(t)}();function Vt(t){return Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vt(t)}var za;function ka(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Va(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ka(Object(r),!0).forEach(function(n){Th(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Th(t,e,r){return e=Wa(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ha(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wa(n.key),n)}}function Mh(t,e,r){return e&&Ha(t.prototype,e),r&&Ha(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wa(t){var e=Rh(t,"string");return Vt(e)==="symbol"?e:String(e)}function Rh(t,e){if(Vt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Vt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ih(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qr(t,e)}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qr(t,e)}function jh(t){var e=Ch();return function(){var n=nr(t),i;if(e){var o=nr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Nh(this,i)}}function Nh(t,e){if(e&&(Vt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dh(t)}function Dh(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ch(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function nr(t){return nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nr(t)}function Fh(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Uh=Ti(za||(za=Fh([`in vec2 aClipSpacePosition;
|
|
253
|
+
in vec2 aTexCoord;
|
|
254
|
+
in vec2 aCoordinate;
|
|
247
255
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
256
|
+
out vec2 position;
|
|
257
|
+
out vec2 coordinate;
|
|
258
|
+
out vec2 uv;
|
|
251
259
|
|
|
252
260
|
void main(void) {
|
|
253
261
|
gl_Position = vec4(aClipSpacePosition, 0., 1.);
|
|
@@ -256,13 +264,13 @@ void main(void) {
|
|
|
256
264
|
uv = aTexCoord;
|
|
257
265
|
}
|
|
258
266
|
`],[`\\
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
267
|
+
in vec2 aClipSpacePosition;
|
|
268
|
+
in vec2 aTexCoord;
|
|
269
|
+
in vec2 aCoordinate;
|
|
262
270
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
271
|
+
out vec2 position;
|
|
272
|
+
out vec2 coordinate;
|
|
273
|
+
out vec2 uv;
|
|
266
274
|
|
|
267
275
|
void main(void) {
|
|
268
276
|
gl_Position = vec4(aClipSpacePosition, 0., 1.);
|
|
@@ -270,12 +278,9 @@ void main(void) {
|
|
|
270
278
|
coordinate = aCoordinate;
|
|
271
279
|
uv = aTexCoord;
|
|
272
280
|
}
|
|
273
|
-
`]))),
|
|
274
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,c;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return o=f.done,f},e:function(f){s=!0,c=f},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw c}}}}function Ca(e,t){if(e){if(typeof e=="string")return mo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mo(e,t)}}function mo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function La(e){var t=Da();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function Da(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var vo=function(e){W(r,e);var t=La(r);function r(){var i,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,r),o=Array.isArray(o)?{children:o}:o;var s=o,c=s.children,a=c===void 0?[]:c;return q.assert(a.every(function(f){return f instanceof Nt}),"every child must an instance of ScenegraphNode"),i=t.call(this,o),i.children=void 0,i.children=a,i}var n=r.prototype;return n.getBounds=function(){var o=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse(function(s,c){var a=c.worldMatrix,f=s.getBounds();if(f){var u=B(f,2),l=u[0],h=u[1],g=new ot(l).add(h).divide([2,2,2]);a.transformAsPoint(g,g);var m=new ot(h).subtract(l).divide([2,2,2]);a.transformAsVector(m,m);for(var y=0;y<8;y++)for(var b=new ot(y&1?-1:1,y&2?-1:1,y&4?-1:1).multiply(m).add(g),O=0;O<3;O++)o[0][O]=Math.min(o[0][O],b[O]),o[1][O]=Math.max(o[1][O],b[O])}}),Number.isFinite(o[0][0])?o:null},n.destroy=function(){this.children.forEach(function(o){return o.destroy()}),this.removeAll(),Kt(j(r.prototype),"destroy",this).call(this)},n.add=function(){for(var o=arguments.length,s=new Array(o),c=0;c<o;c++)s[c]=arguments[c];for(var a=0,f=s;a<f.length;a++){var u=f[a];Array.isArray(u)?this.add.apply(this,ie(u)):this.children.push(u)}return this},n.remove=function(o){var s=this.children,c=s.indexOf(o);return c>-1&&s.splice(c,1),this},n.removeAll=function(){return this.children=[],this},n.traverse=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=s.worldMatrix,a=c===void 0?new mt:c,f=new mt(a).multiplyRight(this.matrix),u=Ra(this.children),l;try{for(u.s();!(l=u.n()).done;){var h=l.value;h instanceof r?h.traverse(o,{worldMatrix:f}):o(h,{worldMatrix:f})}}catch(g){u.e(g)}finally{u.f()}},P(r)}(Nt);function Ia(e){var t=Na();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function Na(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var go=function(e){W(r,e);var t=Ia(r);function r(i){var o;return T(this,r),o=t.call(this,i),o.model=void 0,o.bounds=null,o.managedResources=void 0,o.model=i.model,o.managedResources=i.managedResources||[],o.bounds=i.bounds||null,o.setProps(i),o}var n=r.prototype;return n.getBounds=function(){return this.bounds},n.destroy=function(){this.model&&(this.model.destroy(),this.model=null),this.managedResources.forEach(function(o){return o.destroy()}),this.managedResources=[]},n.draw=function(o){return this.model.draw(o)},P(r)}(Nt);function yo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yo(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fa(e){var t=ja();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function ja(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ua={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Xt=function(e){W(r,e);var t=Fa(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,r);var i=n.id,o=i===void 0?H("truncated-code-geometry"):i,s=Ga(n),c=s.indices,a=s.attributes;return t.call(this,Pr(Pr({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:Pr({POSITION:{size:3,value:a.POSITION},NORMAL:{size:3,value:a.NORMAL},TEXCOORD_0:{size:2,value:a.TEXCOORD_0}},n.attributes)}))}return P(r)}(st);function Ga(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.bottomRadius,r=t===void 0?0:t,n=e.topRadius,i=n===void 0?0:n,o=e.height,s=o===void 0?1:o,c=e.nradial,a=c===void 0?10:c,f=e.nvertical,u=f===void 0?10:f,l=e.verticalAxis,h=l===void 0?"y":l,g=e.topCap,m=g===void 0?!1:g,y=e.bottomCap,b=y===void 0?!1:y,O=(m?2:0)+(b?2:0),R=(a+1)*(u+1+O),x=Math.atan2(r-i,s),M=Math.sin,w=Math.cos,S=Math.PI,F=w(x),N=M(x),U=m?-2:0,C=u+(b?2:0),v=a+1,p=new Uint16Array(a*(u+O)*6),d=Ua[h],_=new Float32Array(R*3),E=new Float32Array(R*3),A=new Float32Array(R*2),L=0,z=0,I=U;I<=C;I++){var G=I/u,k=s*G,V=void 0;I<0?(k=0,G=1,V=r):I>u?(k=s,G=1,V=i):V=r+(i-r)*(I/u),(I===-2||I===u+2)&&(V=0,G=0),k-=s/2;for(var pt=0;pt<v;pt++){var ft=M(pt*S*2/a),J=w(pt*S*2/a);_[L+d[0]]=ft*V,_[L+d[1]]=k,_[L+d[2]]=J*V,E[L+d[0]]=I<0||I>u?0:ft*F,E[L+d[1]]=I<0?-1:I>u?1:N,E[L+d[2]]=I<0||I>u?0:J*F,A[z+0]=pt/a,A[z+1]=G,z+=2,L+=3}}for(var Q=0;Q<u+O;Q++)for(var et=0;et<a;et++){var at=(Q*a+et)*6;p[at+0]=v*(Q+0)+0+et,p[at+1]=v*(Q+0)+1+et,p[at+2]=v*(Q+1)+1+et,p[at+3]=v*(Q+0)+0+et,p[at+4]=v*(Q+1)+1+et,p[at+5]=v*(Q+1)+0+et}return{indices:p,attributes:{POSITION:_,NORMAL:E,TEXCOORD_0:A}}}function _o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_o(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_o(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ba(e){var t=za();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function za(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var bo=function(e){W(r,e);var t=Ba(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,r);var i=n.id,o=i===void 0?H("cone-geometry"):i,s=n.radius,c=s===void 0?1:s,a=n.cap,f=a===void 0?!0:a;return t.call(this,xo(xo({},n),{},{id:o,topRadius:0,topCap:Boolean(f),bottomCap:Boolean(f),bottomRadius:c}))}return P(r)}(Xt);function Oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Oo(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ka(e){var t=Va();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function Va(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var wo=function(e){W(r,e);var t=ka(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,r);var i=n.id,o=i===void 0?H("cube-geometry"):i,s=n.indices,c=s===void 0?!0:s;return t.call(this,c?Pt(Pt({},n),{},{id:o,topology:"triangle-list",indices:{size:1,value:Ha},attributes:Pt(Pt({},Za),n.attributes)}):Pt(Pt({},n),{},{id:o,topology:"triangle-list",indices:void 0,attributes:Pt(Pt({},Ja),n.attributes)}))}return P(r)}(st),Ha=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),qa=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),Wa=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Ya=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),Ka=new Float32Array([1,-1,1,1,-1,-1,1,1,-1,-1,-1,1,1,-1,-1,1,1,-1,1,1,-1,-1,-1,1,1,1,1,1,1,-1,1,1,1,-1,-1,1,1,1,-1,1,1,1,1,1,1,-1,-1,1,-1,1,1,1,1,1,1,1,1,1,-1,1,-1,1,-1,1,-1,1,1,1,1,1,-1,1,-1,-1,1,1,-1,1,1,1,-1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,1,1,1,-1,1,1,1,-1,-1,1,1,-1,-1,1,1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,1,-1,1]),Xa=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),$a=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),Za={POSITION:{size:3,value:qa},NORMAL:{size:3,value:Wa},TEXCOORD_0:{size:2,value:Ya}},Ja={POSITION:{size:4,value:Ka},TEXCOORD_0:{size:2,value:Xa},COLOR_0:{size:3,value:$a}};function Eo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function So(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Eo(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Eo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qa(e){var t=tc();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function tc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Mo=function(e){W(r,e);var t=Qa(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,r);var i=n.id,o=i===void 0?H("cylinder-geometry"):i,s=n.radius,c=s===void 0?1:s;return t.call(this,So(So({},n),{},{id:o,bottomRadius:c,topRadius:c}))}return P(r)}(Xt);function Ao(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function De(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ao(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ao(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ec(e){var t=rc();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function rc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var nc=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],ic=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],Po=function(e){W(r,e);var t=ec(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,r);var i=n.id,o=i===void 0?H("ico-sphere-geometry"):i,s=oc(n),c=s.indices,a=s.attributes;return t.call(this,De(De({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:De(De({},a),n.attributes)}))}return P(r)}(st);function oc(e){var t=e.iterations,r=t===void 0?0:t,n=Math.PI,i=n*2,o=[].concat(nc),s=[].concat(ic);o.push(),s.push();for(var c=function(){var Fe={};return function(bt,Ot){bt*=3,Ot*=3;var Fo=bt<Ot?bt:Ot,jo=bt>Ot?bt:Ot,je="".concat(Fo,"|").concat(jo);if(je in Fe)return Fe[je];var Uo=o[bt],Go=o[bt+1],Bo=o[bt+2],zo=o[Ot],ko=o[Ot+1],Vo=o[Ot+2],fe=(Uo+zo)/2,ue=(Go+ko)/2,le=(Bo+Vo)/2,Ue=Math.sqrt(fe*fe+ue*ue+le*le);return fe/=Ue,ue/=Ue,le/=Ue,o.push(fe,ue,le),Fe[je]=o.length/3-1}}(),a=0;a<r;a++){for(var f=[],u=0;u<s.length;u+=3){var l=c(s[u+0],s[u+1]),h=c(s[u+1],s[u+2]),g=c(s[u+2],s[u+0]);f.push(g,s[u+0],l,l,s[u+1],h,h,s[u+2],g,l,h,g)}s=f}for(var m=new Array(o.length),y=new Array(o.length/3*2),b=s.length,O=b-3;O>=0;O-=3){var R=s[O+0],x=s[O+1],M=s[O+2],w=R*3,S=x*3,F=M*3,N=R*2,U=x*2,C=M*2,v=o[w+0],p=o[w+1],d=o[w+2],_=Math.acos(d/Math.sqrt(v*v+p*p+d*d)),E=Math.atan2(p,v)+n,A=_/n,L=1-E/i,z=o[S+0],I=o[S+1],G=o[S+2],k=Math.acos(G/Math.sqrt(z*z+I*I+G*G)),V=Math.atan2(I,z)+n,pt=k/n,ft=1-V/i,J=o[F+0],Q=o[F+1],et=o[F+2],at=Math.acos(et/Math.sqrt(J*J+Q*Q+et*et)),$t=Math.atan2(Q,J)+n,Tr=at/n,ce=1-$t/i,Io=[J-z,Q-I,et-G],No=[v-z,p-I,d-G],ut=new ot(Io).cross(No).normalize(),X=void 0;(L===0||ft===0||ce===0)&&(L===0||L>.5)&&(ft===0||ft>.5)&&(ce===0||ce>.5)&&(o.push(o[w+0],o[w+1],o[w+2]),X=o.length/3-1,s.push(X),y[X*2+0]=1,y[X*2+1]=A,m[X*3+0]=ut.x,m[X*3+1]=ut.y,m[X*3+2]=ut.z,o.push(o[S+0],o[S+1],o[S+2]),X=o.length/3-1,s.push(X),y[X*2+0]=1,y[X*2+1]=pt,m[X*3+0]=ut.x,m[X*3+1]=ut.y,m[X*3+2]=ut.z,o.push(o[F+0],o[F+1],o[F+2]),X=o.length/3-1,s.push(X),y[X*2+0]=1,y[X*2+1]=Tr,m[X*3+0]=ut.x,m[X*3+1]=ut.y,m[X*3+2]=ut.z),m[w+0]=m[S+0]=m[F+0]=ut.x,m[w+1]=m[S+1]=m[F+1]=ut.y,m[w+2]=m[S+2]=m[F+2]=ut.z,y[N+0]=L,y[N+1]=A,y[U+0]=ft,y[U+1]=pt,y[C+0]=ce,y[C+1]=Tr}return{indices:{size:1,value:new Uint16Array(s)},attributes:{POSITION:{size:3,value:new Float32Array(o)},NORMAL:{size:3,value:new Float32Array(m)},TEXCOORD_0:{size:2,value:new Float32Array(y)}}}}function To(e){var t=e.indices,r=e.attributes;if(!t)return e;var n=t.value.length,i={};for(var o in r){var s=r[o],c=s.constant,a=s.value,f=s.size;if(!(c||!f)){for(var u=new a.constructor(n*f),l=0;l<n;++l)for(var h=t.value[l],g=0;g<f;g++)u[l*f+g]=a[h*f+g];i[o]={size:f,value:u}}}return{attributes:Object.assign({},r,i)}}function Ro(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ro(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ro(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sc(e){var t=ac();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function ac(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Co=function(e){W(r,e);var t=sc(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,r);var i=n.id,o=i===void 0?H("plane-geometry"):i,s=cc(n),c=s.indices,a=s.attributes;return t.call(this,Ie(Ie({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:Ie(Ie({},a),n.attributes)}))}return P(r)}(st);function cc(e){var t=e.type,r=t===void 0?"x,y":t,n=e.offset,i=n===void 0?0:n,o=e.flipCull,s=o===void 0?!1:o,c=e.unpack,a=c===void 0?!1:c,f=r.split(","),u=e["".concat(f[0],"len")]||1,l=e["".concat(f[1],"len")]||1,h=e["n".concat(f[0])]||1,g=e["n".concat(f[1])]||1,m=(h+1)*(g+1),y=new Float32Array(m*3),b=new Float32Array(m*3),O=new Float32Array(m*2);s&&(u=-u);for(var R=0,x=0,M=0;M<=g;M++)for(var w=0;w<=h;w++){var S=w/h,F=M/g;switch(O[R+0]=s?1-S:S,O[R+1]=F,r){case"x,y":y[x+0]=u*S-u*.5,y[x+1]=l*F-l*.5,y[x+2]=i,b[x+0]=0,b[x+1]=0,b[x+2]=s?1:-1;break;case"x,z":y[x+0]=u*S-u*.5,y[x+1]=i,y[x+2]=l*F-l*.5,b[x+0]=0,b[x+1]=s?1:-1,b[x+2]=0;break;case"y,z":y[x+0]=i,y[x+1]=u*S-u*.5,y[x+2]=l*F-l*.5,b[x+0]=s?1:-1,b[x+1]=0,b[x+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}R+=2,x+=3}for(var N=h+1,U=new Uint16Array(h*g*6),C=0;C<g;C++)for(var v=0;v<h;v++){var p=(C*h+v)*6;U[p+0]=(C+0)*N+v,U[p+1]=(C+1)*N+v,U[p+2]=(C+0)*N+v+1,U[p+3]=(C+1)*N+v,U[p+4]=(C+1)*N+v+1,U[p+5]=(C+0)*N+v+1}var d={indices:{size:1,value:U},attributes:{POSITION:{size:3,value:y},NORMAL:{size:3,value:b},TEXCOORD_0:{size:2,value:O}}};return a?To(d):d}function Lo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lo(Object(r),!0).forEach(function(n){D(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fc(e){var t=uc();return function(){var n=j(e),i;if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Y(this,i)}}function uc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Do=function(e){W(r,e);var t=fc(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,r);var i=n.id,o=i===void 0?H("sphere-geometry"):i,s=lc(n),c=s.indices,a=s.attributes;return t.call(this,Ne(Ne({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:Ne(Ne({},a),n.attributes)}))}return P(r)}(st);function lc(e){for(var t=e.nlat,r=t===void 0?10:t,n=e.nlong,i=n===void 0?10:n,o=0,s=Math.PI,c=s-o,a=0,f=2*Math.PI,u=f-a,l=(r+1)*(i+1),h=function(ft,J,Q,et,at){return e.radius||1},g=new Float32Array(l*3),m=new Float32Array(l*3),y=new Float32Array(l*2),b=l>65535?Uint32Array:Uint16Array,O=new b(r*i*6),R=0;R<=r;R++)for(var x=0;x<=i;x++){var M=x/i,w=R/r,S=x+R*(i+1),F=S*2,N=S*3,U=u*M,C=c*w,v=Math.sin(U),p=Math.cos(U),d=Math.sin(C),_=Math.cos(C),E=p*d,A=_,L=v*d,z=h(E,A,L,M,w);g[N+0]=z*E,g[N+1]=z*A,g[N+2]=z*L,m[N+0]=E,m[N+1]=A,m[N+2]=L,y[F+0]=M,y[F+1]=1-w}for(var I=i+1,G=0;G<i;G++)for(var k=0;k<r;k++){var V=(G*r+k)*6;O[V+0]=k*I+G,O[V+1]=k*I+G+1,O[V+2]=(k+1)*I+G,O[V+3]=(k+1)*I+G,O[V+4]=k*I+G+1,O[V+5]=(k+1)*I+G+1}return{indices:{size:1,value:O},attributes:{POSITION:{size:3,value:g},NORMAL:{size:3,value:m},TEXCOORD_0:{size:2,value:y}}}}return $o(hc);})();
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
@babel/runtime/helpers/regeneratorRuntime.js:
|
|
278
|
-
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *)
|
|
279
|
-
*/
|
|
281
|
+
`]))),Ka=[-1,-1,1,-1,-1,1,1,1],qa=function(t){Ih(r,t);var e=jh(r);function r(n,i){Lh(this,r);var o=Ka.map(function(a){return a===-1?0:a});return e.call(this,n,Va(Va({},i),{},{vs:Uh,vertexCount:4,geometry:new Z({topology:"triangle-strip",vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(Ka)},aTexCoord:{size:2,value:new Float32Array(o)},aCoordinate:{size:2,value:new Float32Array(o)}}})}))}return Mh(r)}(xt);function Me(t){return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(t)}function Ya(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bh(n.key),n)}}function Gh(t,e,r){return e&&Ya(t.prototype,e),r&&Ya(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bh(t){var e=zh(t,"string");return Me(e)==="symbol"?e:String(e)}function zh(t,e){if(Me(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Me(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function kh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Et=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};kh(this,t),this.id=void 0,this.matrix=new rt,this.display=!0,this.position=new $,this.rotation=new $,this.scale=new $(1,1,1),this.userData={},this.props={};var n=r.id;this.id=n||z(this.constructor.name),this._setScenegraphNodeProps(r)}var e=t.prototype;return e.getBounds=function(){return null},e.destroy=function(){},e.delete=function(){this.destroy()},e.setProps=function(n){return this._setScenegraphNodeProps(n),this},e.toString=function(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")},e.setPosition=function(n){return W(n.length===3,"setPosition requires vector argument"),this.position=n,this},e.setRotation=function(n){return W(n.length===3,"setRotation requires vector argument"),this.rotation=n,this},e.setScale=function(n){return W(n.length===3,"setScale requires vector argument"),this.scale=n,this},e.setMatrix=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i?this.matrix.copy(n):this.matrix=n},e.setMatrixComponents=function(n){var i=n.position,o=n.rotation,a=n.scale,f=n.update,s=f===void 0?!0:f;return i&&this.setPosition(i),o&&this.setRotation(o),a&&this.setScale(a),s&&this.updateMatrix(),this},e.updateMatrix=function(){var n=this.position,i=this.rotation,o=this.scale;return this.matrix.identity(),this.matrix.translate(n),this.matrix.rotateXYZ(i),this.matrix.scale(o),this},e.update=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.position,o=n.rotation,a=n.scale;return i&&this.setPosition(i),o&&this.setRotation(o),a&&this.setScale(a),this.updateMatrix(),this},e.getCoordinateUniforms=function(n,i){W(n),i=i||this.matrix;var o=new rt(n).multiplyRight(i),a=o.invert(),f=a.transpose();return{viewMatrix:n,modelMatrix:i,objectMatrix:i,worldMatrix:o,worldInverseMatrix:a,worldInverseTransposeMatrix:f}},e._setScenegraphNodeProps=function(n){"display"in n&&(this.display=n.display),"position"in n&&this.setPosition(n.position),"rotation"in n&&this.setRotation(n.rotation),"scale"in n&&this.setScale(n.scale),"matrix"in n&&this.setMatrix(n.matrix),Object.assign(this.props,n)},Gh(t)}();function Ht(t){return Ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ht(t)}function Vh(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=rn(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
282
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Hh(t){return qh(t)||Wh(t)||rn(t)||Kh()}function Kh(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
283
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wh(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function qh(t){if(Array.isArray(t))return tn(t)}function Yh(t,e){return Zh(t)||$h(t,e)||rn(t,e)||Xh()}function Xh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
284
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rn(t,e){if(t){if(typeof t=="string")return tn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tn(t,e)}}function tn(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $h(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==e);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Zh(t){if(Array.isArray(t))return t}function Xa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qh(n.key),n)}}function Jh(t,e,r){return e&&Xa(t.prototype,e),r&&Xa(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qh(t){var e=tp(t,"string");return Ht(e)==="symbol"?e:String(e)}function tp(t,e){if(Ht(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ht(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ep(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ir(){return typeof Reflect<"u"&&Reflect.get?ir=Reflect.get.bind():ir=function(e,r,n){var i=rp(e,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?e:n):o.value}},ir.apply(this,arguments)}function rp(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&(t=Kt(t),t!==null););return t}function np(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&en(t,e)}function en(t,e){return en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},en(t,e)}function ip(t){var e=sp();return function(){var n=Kt(t),i;if(e){var o=Kt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return op(this,i)}}function op(t,e){if(e&&(Ht(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ap(t)}function ap(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Kt(t){return Kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kt(t)}var $a=function(t){np(r,t);var e=ip(r);function r(){var i,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ep(this,r),o=Array.isArray(o)?{children:o}:o;var a=o,f=a.children,s=f===void 0?[]:f;return B.assert(s.every(function(l){return l instanceof Et}),"every child must an instance of ScenegraphNode"),i=e.call(this,o),i.children=void 0,i.children=s,i}var n=r.prototype;return n.getBounds=function(){var o=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse(function(a,f){var s=f.worldMatrix,l=a.getBounds();if(l){var p=Yh(l,2),y=p[0],g=p[1],w=new $(y).add(g).divide([2,2,2]);s.transformAsPoint(w,w);var b=new $(g).subtract(y).divide([2,2,2]);s.transformAsVector(b,b);for(var _=0;_<8;_++)for(var x=new $(_&1?-1:1,_&2?-1:1,_&4?-1:1).multiply(b).add(w),S=0;S<3;S++)o[0][S]=Math.min(o[0][S],x[S]),o[1][S]=Math.max(o[1][S],x[S])}}),Number.isFinite(o[0][0])?o:null},n.destroy=function(){this.children.forEach(function(o){return o.destroy()}),this.removeAll(),ir(Kt(r.prototype),"destroy",this).call(this)},n.add=function(){for(var o=arguments.length,a=new Array(o),f=0;f<o;f++)a[f]=arguments[f];for(var s=0,l=a;s<l.length;s++){var p=l[s];Array.isArray(p)?this.add.apply(this,Hh(p)):this.children.push(p)}return this},n.remove=function(o){var a=this.children,f=a.indexOf(o);return f>-1&&a.splice(f,1),this},n.removeAll=function(){return this.children=[],this},n.traverse=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=a.worldMatrix,s=f===void 0?new rt:f,l=new rt(s).multiplyRight(this.matrix),p=Vh(this.children),y;try{for(p.s();!(y=p.n()).done;){var g=y.value;g instanceof r?g.traverse(o,{worldMatrix:l}):o(g,{worldMatrix:l})}}catch(w){p.e(w)}finally{p.f()}},Jh(r)}(Et);function Wt(t){return Wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wt(t)}function Za(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,cp(n.key),n)}}function fp(t,e,r){return e&&Za(t.prototype,e),r&&Za(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function cp(t){var e=up(t,"string");return Wt(e)==="symbol"?e:String(e)}function up(t,e){if(Wt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Wt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function lp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nn(t,e)}function nn(t,e){return nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},nn(t,e)}function pp(t){var e=yp();return function(){var n=or(t),i;if(e){var o=or(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return mp(this,i)}}function mp(t,e){if(e&&(Wt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dp(t)}function dp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function or(t){return or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},or(t)}var Ja=function(t){hp(r,t);var e=pp(r);function r(i){var o;return lp(this,r),o=e.call(this,i),o.model=void 0,o.bounds=null,o.managedResources=void 0,o.model=i.model,o.managedResources=i.managedResources||[],o.bounds=i.bounds||null,o.setProps(i),o}var n=r.prototype;return n.getBounds=function(){return this.bounds},n.destroy=function(){this.model&&(this.model.destroy(),this.model=null),this.managedResources.forEach(function(o){return o.destroy()}),this.managedResources=[]},n.draw=function(o){return this.model.draw(o)},fp(r)}(Et);function qt(t){return qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(t)}function Qa(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function on(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qa(Object(r),!0).forEach(function(n){vp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qa(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vp(t,e,r){return e=es(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ts(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,es(n.key),n)}}function gp(t,e,r){return e&&ts(t.prototype,e),r&&ts(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function es(t){var e=bp(t,"string");return qt(e)==="symbol"?e:String(e)}function bp(t,e){if(qt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _p(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&an(t,e)}function an(t,e){return an=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},an(t,e)}function Op(t){var e=xp();return function(){var n=ar(t),i;if(e){var o=ar(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Sp(this,i)}}function Sp(t,e){if(e&&(qt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pp(t)}function Pp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ar(t){return ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ar(t)}var Ep={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Yt=function(t){_p(r,t);var e=Op(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wp(this,r);var i=n.id,o=i===void 0?z("truncated-code-geometry"):i,a=Ap(n),f=a.indices,s=a.attributes;return e.call(this,on(on({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:on({POSITION:{size:3,value:s.POSITION},NORMAL:{size:3,value:s.NORMAL},TEXCOORD_0:{size:2,value:s.TEXCOORD_0}},n.attributes)}))}return gp(r)}(Z);function Ap(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.bottomRadius,r=e===void 0?0:e,n=t.topRadius,i=n===void 0?0:n,o=t.height,a=o===void 0?1:o,f=t.nradial,s=f===void 0?10:f,l=t.nvertical,p=l===void 0?10:l,y=t.verticalAxis,g=y===void 0?"y":y,w=t.topCap,b=w===void 0?!1:w,_=t.bottomCap,x=_===void 0?!1:_,S=(b?2:0)+(x?2:0),R=(s+1)*(p+1+S),E=Math.atan2(r-i,a),T=Math.sin,M=Math.cos,L=Math.PI,j=M(E),N=T(E),F=b?-2:0,D=p+(x?2:0),C=s+1,h=new Uint16Array(s*(p+S)*6),c=Ep[g],u=new Float32Array(R*3),m=new Float32Array(R*3),v=new Float32Array(R*2),d=0,O=0,P=F;P<=D;P++){var A=P/p,U=a*A,I=void 0;P<0?(U=0,A=1,I=r):P>p?(U=a,A=1,I=i):I=r+(i-r)*(P/p),(P===-2||P===p+2)&&(I=0,A=0),U-=a/2;for(var G=0;G<C;G++){var nt=T(G*L*2/s),Q=M(G*L*2/s);u[d+c[0]]=nt*I,u[d+c[1]]=U,u[d+c[2]]=Q*I,m[d+c[0]]=P<0||P>p?0:nt*j,m[d+c[1]]=P<0?-1:P>p?1:N,m[d+c[2]]=P<0||P>p?0:Q*j,v[O+0]=G/s,v[O+1]=A,O+=2,d+=3}}for(var H=0;H<p+S;H++)for(var X=0;X<s;X++){var at=(H*s+X)*6;h[at+0]=C*(H+0)+0+X,h[at+1]=C*(H+0)+1+X,h[at+2]=C*(H+1)+1+X,h[at+3]=C*(H+0)+0+X,h[at+4]=C*(H+1)+1+X,h[at+5]=C*(H+1)+0+X}return{indices:h,attributes:{POSITION:u,NORMAL:m,TEXCOORD_0:v}}}function Xt(t){return Xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xt(t)}function rs(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ns(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rs(Object(r),!0).forEach(function(n){Tp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rs(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Tp(t,e,r){return e=os(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function is(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,os(n.key),n)}}function Mp(t,e,r){return e&&is(t.prototype,e),r&&is(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function os(t){var e=Rp(t,"string");return Xt(e)==="symbol"?e:String(e)}function Rp(t,e){if(Xt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Xt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ip(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sn(t,e)}function sn(t,e){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sn(t,e)}function jp(t){var e=Cp();return function(){var n=sr(t),i;if(e){var o=sr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Np(this,i)}}function Np(t,e){if(e&&(Xt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dp(t)}function Dp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Cp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function sr(t){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sr(t)}var as=function(t){Ip(r,t);var e=jp(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Lp(this,r);var i=n.id,o=i===void 0?z("cone-geometry"):i,a=n.radius,f=a===void 0?1:a,s=n.cap,l=s===void 0?!0:s;return e.call(this,ns(ns({},n),{},{id:o,topRadius:0,topCap:Boolean(l),bottomCap:Boolean(l),bottomRadius:f}))}return Mp(r)}(Yt);function $t(t){return $t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$t(t)}function ss(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function bt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ss(Object(r),!0).forEach(function(n){Fp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ss(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fp(t,e,r){return e=cs(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,cs(n.key),n)}}function Up(t,e,r){return e&&fs(t.prototype,e),r&&fs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function cs(t){var e=Gp(t,"string");return $t(e)==="symbol"?e:String(e)}function Gp(t,e){if($t(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if($t(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zp(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fn(t,e)}function fn(t,e){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fn(t,e)}function kp(t){var e=Kp();return function(){var n=fr(t),i;if(e){var o=fr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Vp(this,i)}}function Vp(t,e){if(e&&($t(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hp(t)}function Hp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Kp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fr(t){return fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fr(t)}var us=function(t){zp(r,t);var e=kp(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bp(this,r);var i=n.id,o=i===void 0?z("cube-geometry"):i,a=n.indices,f=a===void 0?!0:a;return e.call(this,f?bt(bt({},n),{},{id:o,topology:"triangle-list",indices:{size:1,value:Wp},attributes:bt(bt({},Qp),n.attributes)}):bt(bt({},n),{},{id:o,topology:"triangle-list",indices:void 0,attributes:bt(bt({},tm),n.attributes)}))}return Up(r)}(Z),Wp=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),qp=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),Yp=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Xp=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),$p=new Float32Array([1,-1,1,1,-1,-1,1,1,-1,-1,-1,1,1,-1,-1,1,1,-1,1,1,-1,-1,-1,1,1,1,1,1,1,-1,1,1,1,-1,-1,1,1,1,-1,1,1,1,1,1,1,-1,-1,1,-1,1,1,1,1,1,1,1,1,1,-1,1,-1,1,-1,1,-1,1,1,1,1,1,-1,1,-1,-1,1,1,-1,1,1,1,-1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,1,1,1,-1,1,1,1,-1,-1,1,1,-1,-1,1,1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,1,-1,1]),Zp=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),Jp=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),Qp={POSITION:{size:3,value:qp},NORMAL:{size:3,value:Yp},TEXCOORD_0:{size:2,value:Xp}},tm={POSITION:{size:4,value:$p},TEXCOORD_0:{size:2,value:Zp},COLOR_0:{size:3,value:Jp}};function Zt(t){return Zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(t)}function ls(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function hs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ls(Object(r),!0).forEach(function(n){em(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ls(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function em(t,e,r){return e=ms(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ps(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ms(n.key),n)}}function rm(t,e,r){return e&&ps(t.prototype,e),r&&ps(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ms(t){var e=nm(t,"string");return Zt(e)==="symbol"?e:String(e)}function nm(t,e){if(Zt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Zt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function im(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function om(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cn(t,e)}function cn(t,e){return cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cn(t,e)}function am(t){var e=cm();return function(){var n=cr(t),i;if(e){var o=cr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return sm(this,i)}}function sm(t,e){if(e&&(Zt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fm(t)}function fm(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cr(t){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cr(t)}var ds=function(t){om(r,t);var e=am(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};im(this,r);var i=n.id,o=i===void 0?z("cylinder-geometry"):i,a=n.radius,f=a===void 0?1:a;return e.call(this,hs(hs({},n),{},{id:o,bottomRadius:f,topRadius:f}))}return rm(r)}(Yt);function Jt(t){return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(t)}function ys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ur(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ys(Object(r),!0).forEach(function(n){um(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ys(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function um(t,e,r){return e=gs(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,gs(n.key),n)}}function lm(t,e,r){return e&&vs(t.prototype,e),r&&vs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function gs(t){var e=hm(t,"string");return Jt(e)==="symbol"?e:String(e)}function hm(t,e){if(Jt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Jt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mm(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&un(t,e)}function un(t,e){return un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},un(t,e)}function dm(t){var e=gm();return function(){var n=lr(t),i;if(e){var o=lr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ym(this,i)}}function ym(t,e){if(e&&(Jt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vm(t)}function vm(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function lr(t){return lr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lr(t)}var bm=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],wm=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],bs=function(t){mm(r,t);var e=dm(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pm(this,r);var i=n.id,o=i===void 0?z("ico-sphere-geometry"):i,a=_m(n),f=a.indices,s=a.attributes;return e.call(this,ur(ur({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:ur(ur({},s),n.attributes)}))}return lm(r)}(Z);function _m(t){var e=t.iterations,r=e===void 0?0:e,n=Math.PI,i=n*2,o=[].concat(bm),a=[].concat(wm);o.push(),a.push();for(var f=function(){var yr={};return function(ut,lt){ut*=3,lt*=3;var Is=ut<lt?ut:lt,js=ut>lt?ut:lt,vr="".concat(Is,"|").concat(js);if(vr in yr)return yr[vr];var Ns=o[ut],Ds=o[ut+1],Cs=o[ut+2],Fs=o[lt],Us=o[lt+1],Gs=o[lt+2],Le=(Ns+Fs)/2,Ie=(Ds+Us)/2,je=(Cs+Gs)/2,gr=Math.sqrt(Le*Le+Ie*Ie+je*je);return Le/=gr,Ie/=gr,je/=gr,o.push(Le,Ie,je),yr[vr]=o.length/3-1}}(),s=0;s<r;s++){for(var l=[],p=0;p<a.length;p+=3){var y=f(a[p+0],a[p+1]),g=f(a[p+1],a[p+2]),w=f(a[p+2],a[p+0]);l.push(w,a[p+0],y,y,a[p+1],g,g,a[p+2],w,y,g,w)}a=l}for(var b=new Array(o.length),_=new Array(o.length/3*2),x=a.length,S=x-3;S>=0;S-=3){var R=a[S+0],E=a[S+1],T=a[S+2],M=R*3,L=E*3,j=T*3,N=R*2,F=E*2,D=T*2,C=o[M+0],h=o[M+1],c=o[M+2],u=Math.acos(c/Math.sqrt(C*C+h*h+c*c)),m=Math.atan2(h,C)+n,v=u/n,d=1-m/i,O=o[L+0],P=o[L+1],A=o[L+2],U=Math.acos(A/Math.sqrt(O*O+P*P+A*A)),I=Math.atan2(P,O)+n,G=U/n,nt=1-I/i,Q=o[j+0],H=o[j+1],X=o[j+2],at=Math.acos(X/Math.sqrt(Q*Q+H*H+X*X)),Ms=Math.atan2(H,Q)+n,pn=at/n,Re=1-Ms/i,Rs=[Q-O,H-P,X-A],Ls=[C-O,h-P,c-A],tt=new $(Rs).cross(Ls).normalize(),V=void 0;(d===0||nt===0||Re===0)&&(d===0||d>.5)&&(nt===0||nt>.5)&&(Re===0||Re>.5)&&(o.push(o[M+0],o[M+1],o[M+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=v,b[V*3+0]=tt.x,b[V*3+1]=tt.y,b[V*3+2]=tt.z,o.push(o[L+0],o[L+1],o[L+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=G,b[V*3+0]=tt.x,b[V*3+1]=tt.y,b[V*3+2]=tt.z,o.push(o[j+0],o[j+1],o[j+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=pn,b[V*3+0]=tt.x,b[V*3+1]=tt.y,b[V*3+2]=tt.z),b[M+0]=b[L+0]=b[j+0]=tt.x,b[M+1]=b[L+1]=b[j+1]=tt.y,b[M+2]=b[L+2]=b[j+2]=tt.z,_[N+0]=d,_[N+1]=v,_[F+0]=nt,_[F+1]=G,_[D+0]=Re,_[D+1]=pn}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(o)},NORMAL:{size:3,value:new Float32Array(b)},TEXCOORD_0:{size:2,value:new Float32Array(_)}}}}function ws(t){var e=t.indices,r=t.attributes;if(!e)return t;var n=e.value.length,i={};for(var o in r){var a=r[o],f=a.constant,s=a.value,l=a.size;if(!(f||!l)){for(var p=new s.constructor(n*l),y=0;y<n;++y)for(var g=e.value[y],w=0;w<l;w++)p[y*l+w]=s[g*l+w];i[o]={size:l,value:p}}}return{attributes:Object.assign({},r,i)}}function Qt(t){return Qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qt(t)}function _s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function hr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_s(Object(r),!0).forEach(function(n){Om(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_s(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Om(t,e,r){return e=Ss(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Os(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ss(n.key),n)}}function Sm(t,e,r){return e&&Os(t.prototype,e),r&&Os(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ss(t){var e=Pm(t,"string");return Qt(e)==="symbol"?e:String(e)}function Pm(t,e){if(Qt(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Qt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Em(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ln(t,e)}function ln(t,e){return ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ln(t,e)}function Am(t){var e=Rm();return function(){var n=pr(t),i;if(e){var o=pr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Tm(this,i)}}function Tm(t,e){if(e&&(Qt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mm(t)}function Mm(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pr(t){return pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pr(t)}var Ps=function(t){Em(r,t);var e=Am(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xm(this,r);var i=n.id,o=i===void 0?z("plane-geometry"):i,a=Lm(n),f=a.indices,s=a.attributes;return e.call(this,hr(hr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:hr(hr({},s),n.attributes)}))}return Sm(r)}(Z);function Lm(t){var e=t.type,r=e===void 0?"x,y":e,n=t.offset,i=n===void 0?0:n,o=t.flipCull,a=o===void 0?!1:o,f=t.unpack,s=f===void 0?!1:f,l=r.split(","),p=t["".concat(l[0],"len")]||1,y=t["".concat(l[1],"len")]||1,g=t["n".concat(l[0])]||1,w=t["n".concat(l[1])]||1,b=(g+1)*(w+1),_=new Float32Array(b*3),x=new Float32Array(b*3),S=new Float32Array(b*2);a&&(p=-p);for(var R=0,E=0,T=0;T<=w;T++)for(var M=0;M<=g;M++){var L=M/g,j=T/w;switch(S[R+0]=a?1-L:L,S[R+1]=j,r){case"x,y":_[E+0]=p*L-p*.5,_[E+1]=y*j-y*.5,_[E+2]=i,x[E+0]=0,x[E+1]=0,x[E+2]=a?1:-1;break;case"x,z":_[E+0]=p*L-p*.5,_[E+1]=i,_[E+2]=y*j-y*.5,x[E+0]=0,x[E+1]=a?1:-1,x[E+2]=0;break;case"y,z":_[E+0]=i,_[E+1]=p*L-p*.5,_[E+2]=y*j-y*.5,x[E+0]=a?1:-1,x[E+1]=0,x[E+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}R+=2,E+=3}for(var N=g+1,F=new Uint16Array(g*w*6),D=0;D<w;D++)for(var C=0;C<g;C++){var h=(D*g+C)*6;F[h+0]=(D+0)*N+C,F[h+1]=(D+1)*N+C,F[h+2]=(D+0)*N+C+1,F[h+3]=(D+1)*N+C,F[h+4]=(D+1)*N+C+1,F[h+5]=(D+0)*N+C+1}var c={indices:{size:1,value:F},attributes:{POSITION:{size:3,value:_},NORMAL:{size:3,value:x},TEXCOORD_0:{size:2,value:S}}};return s?ws(c):c}function te(t){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(t)}function xs(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function mr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xs(Object(r),!0).forEach(function(n){Im(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xs(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Im(t,e,r){return e=As(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Es(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,As(n.key),n)}}function jm(t,e,r){return e&&Es(t.prototype,e),r&&Es(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function As(t){var e=Nm(t,"string");return te(e)==="symbol"?e:String(e)}function Nm(t,e){if(te(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(te(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cm(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hn(t,e)}function hn(t,e){return hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hn(t,e)}function Fm(t){var e=Bm();return function(){var n=dr(t),i;if(e){var o=dr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Um(this,i)}}function Um(t,e){if(e&&(te(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gm(t)}function Gm(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Bm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function dr(t){return dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dr(t)}var Ts=function(t){Cm(r,t);var e=Fm(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dm(this,r);var i=n.id,o=i===void 0?z("sphere-geometry"):i,a=zm(n),f=a.indices,s=a.attributes;return e.call(this,mr(mr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:mr(mr({},s),n.attributes)}))}return jm(r)}(Z);function zm(t){for(var e=t.nlat,r=e===void 0?10:e,n=t.nlong,i=n===void 0?10:n,o=0,a=Math.PI,f=a-o,s=0,l=2*Math.PI,p=l-s,y=(r+1)*(i+1),g=function(nt,Q,H,X,at){return t.radius||1},w=new Float32Array(y*3),b=new Float32Array(y*3),_=new Float32Array(y*2),x=y>65535?Uint32Array:Uint16Array,S=new x(r*i*6),R=0;R<=r;R++)for(var E=0;E<=i;E++){var T=E/i,M=R/r,L=E+R*(i+1),j=L*2,N=L*3,F=p*T,D=f*M,C=Math.sin(F),h=Math.cos(F),c=Math.sin(D),u=Math.cos(D),m=h*c,v=u,d=C*c,O=g(m,v,d,T,M);w[N+0]=O*m,w[N+1]=O*v,w[N+2]=O*d,b[N+0]=m,b[N+1]=v,b[N+2]=d,_[j+0]=T,_[j+1]=1-M}for(var P=i+1,A=0;A<i;A++)for(var U=0;U<r;U++){var I=(A*r+U)*6;S[I+0]=U*P+A,S[I+1]=U*P+A+1,S[I+2]=(U+1)*P+A,S[I+3]=(U+1)*P+A,S[I+4]=U*P+A+1,S[I+5]=(U+1)*P+A+1}return{indices:{size:1,value:S},attributes:{POSITION:{size:3,value:w},NORMAL:{size:3,value:b},TEXCOORD_0:{size:2,value:_}}}}return Ks(km);})();
|
|
280
285
|
return __exports__;
|
|
281
286
|
});
|