@luma.gl/engine 9.0.0-alpha.42 → 9.0.0-alpha.44
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/dist.dev.js +31 -16
- package/dist/geometry/gpu-geometry.d.ts.map +1 -1
- package/dist/geometry/gpu-geometry.js.map +1 -1
- package/dist/index.cjs +5 -13
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model/model.d.ts +1 -1
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +6 -12
- package/dist/model/model.js.map +1 -1
- package/dist/shadertools/shader-module-uniforms.js +1 -1
- package/dist/shadertools/shader-module-uniforms.js.map +1 -1
- package/dist.min.js +41 -41
- package/package.json +5 -5
- package/src/geometry/gpu-geometry.ts +0 -1
- package/src/index.ts +3 -0
- package/src/model/model.ts +4 -17
- package/src/shadertools/shader-module-uniforms.ts +1 -1
- package/src/model/.model.ts.swp +0 -0
package/dist.min.js
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
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 Vo(e,t){if(e){if(typeof e=="string")return Ar(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 Ar(e,t)}}function Ar(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 Ho=1,qo=1,Tr=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=Ho++,v={time:0,delay:o,duration:c,rate:f,repeat:l};return this._setChannelTime(v,this.time),this.channels.set(h,v),h},t.removeChannel=function(n){this.channels.delete(n);var i=Ve(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=Ve(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=Ve(a),u;try{for(f.s();!(u=f.n()).done;){var l=u.value,h=l.animation,v=l.channel;h.setTime(this.getTime(v))}}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)},A(e)}();var Rr=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)},A(e)}();function Cr(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){Cr(o,n,i,s,c,"next",a)}function c(a){Cr(o,n,i,s,c,"throw",a)}s(void 0)})}}var qe=pe(Jt(),1),Fr=function(){function e(r){T(this,e)}var t=e.prototype;return t.onInitialize=function(){var r=lt(qe.default.mark(function i(o){return qe.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}(),A(e)}();function L(e,t,r){return t=Zt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yt=pe(Jt(),1);function We(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)||We()}var Wo=globalThis.self||globalThis.window||globalThis.global,jt=globalThis.window||globalThis.self||globalThis.global,Ko=globalThis.document||{},Tt=globalThis.process||{},Yo=globalThis.console,kc=globalThis.navigator||{};var me=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",qc=ct();function Xo(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var ge=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=Xo(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 Ur(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 Gr(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 ve(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 $o=10;function zr(e){return typeof e!="string"?e:(e=e.toUpperCase(),ye[e]||ye.WHITE)}function Br(e,t,r){if(!ct&&typeof e=="string"){if(t){let n=zr(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=zr(r);e="\x1B[".concat(n+$o,"m").concat(e,"\x1B[49m")}}return e}function kr(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 Ft(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 Ut={debug:ct()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Zo={enabled:!0,level:0};function ht(){}var Vr={},Hr={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 ge("__probe-".concat(this.id,"__"),Zo),this.timeStamp("".concat(this.id," started")),kr(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){Ft(t,r)}warn(t){return this._getLogFunction(0,t,Ut.warn,arguments,Hr)}error(t){return this._getLogFunction(0,t,Ut.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,Ut.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Ut.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Ut.debug||Ut.info,arguments,Hr)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ht,n&&[n],{tag:es(r)}):ht}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:s=1}=t;return this._shouldLog(r||n)?ct()?ts({image:i,message:o,scale:s}):Qo({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=qr({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()>=Wr(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=qr({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,Ft(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Rt();let s=o.tag||o.message;if(o.once&&s)if(!Vr[s])Vr[s]=Rt();else return ht;return r=Jo(this.id,o.message,o),n.bind(console,r,...o.args)}return ht}};wt.VERSION=me;function Wr(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 Ft(Number.isFinite(t)&&t>=0),t}function qr(e){let{logLevel:t,message:r}=e;e.logLevel=Wr(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 Ft(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function Jo(e,t,r){if(typeof t=="string"){let n=r.time?Gr(Ur(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=Br(t,r.color,r.background)}return t}function Qo(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ht}function ts(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let s=ve(o,r,n);console.log(...s)},o.src=t,ht}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...ve(t,r,n)),ht;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...ve(o,r,n)),o.src=t.toDataURL(),ht}return ht}function es(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var vf=new wt({id:"@probe.gl/log"});var K=new wt({id:"luma.gl"});function Qt(){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=Qt(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Qt()-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 rs=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)},A(e)}(),Gt=new rs;function ns(){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()&&K.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:K,stats:Gt}),e}var Kr=ns();function Yr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function Mt(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:Yr(e)}var Ze=pe(Jt(),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 te(e,t){return te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},te(e,t)}function q(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&&te(e,t)}function Ye(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W(e,t){if(t&&(tt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ye(e)}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},F(e)}function Xr(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 is(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xr(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xr(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=os(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()},A(e)}();Lt.defaultProps={id:"undefined",handle:void 0,userData:void 0};function os(e,t){var r=is({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}var Zr;function $r(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 Xe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$r(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$r(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ss(e){var t=as();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function as(){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}}Zr=Symbol.toStringTag;var X=function(e){q(r,e);var t=ss(r);function r(i,o){var s;T(this,r);var c=Xe({},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")},A(r,[{key:Zr,get:function(){return"Buffer"}}]),r}(Lt);X.defaultProps=Xe(Xe({},Lt.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});X.MAP_READ=1;X.MAP_WRITE=2;X.COPY_SRC=4;X.COPY_DST=8;X.INDEX=16;X.VERTEX=32;X.UNIFORM=64;X.STORAGE=128;X.INDIRECT=256;X.QUERY_RESOLVE=512;var Qr;function Jr(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?Jr(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jr(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(K.get("debug")),break:[],gl:null};Qr=Symbol.toStringTag;var cs=function(){function e(r){T(this,e),this.id=void 0,this.statsManager=Gt,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=$e($e({},_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=$e({},n);return(n.usage||0)&X.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":K.warn("indices buffer content must be of integer type")()),i},A(e,[{key:Qr,get:function(){return"Device"}}]),e}();cs.VERSION=Kr;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 en(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){L(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 fs(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=us(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,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
|
|
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 ys(e,t){if(e){if(typeof e=="string")return un(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 un(e,t)}}function un(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 Qe(e,t){var r={},n=ee(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=_s(e,t,o.name)}}catch(s){n.e(s)}finally{n.f()}return r}function _s(e,t,r){var n=xs(e,r),i=bs(t,r);if(!n)return null;var o=an(n.type),s=i?.vertexFormat||o.defaultVertexFormat,c=Je(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 xs(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||K.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function bs(e,t){Os(e);var r=ws(e,t);return r||(r=Es(e,t),r)?r:(K.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Os(e){var t=ee(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&K.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function ws(e,t){var r=ee(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 Es(e,t){var r=ee(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=ee(o.attributes||[]),a;try{for(c.s();!(a=c.n()).done;){var f=a.value,u=Je(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 rt(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}var Ms={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 ln(e){var t=Ms[e];return rt(e),t}function hn(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}var xe;function pn(e){return(!xe||xe.byteLength<e)&&(xe=new ArrayBuffer(e)),xe}var dn=1024,tr=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=ln(a),u=f.type,l=f.components;n=hn(n,l);var h=n;n+=l,this.layout[c]={type:u,size:l,offset:h}}n+=(4-n%4)%4;var v=n*4;this.byteLength=Math.max(v,dn)}var t=e.prototype;return t.getData=function(n){for(var i=Math.max(this.byteLength,dn),o=pn(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){K.warn("Supplied uniform value ".concat(u," not present in uniform block layout"))();continue}var v=h.type,m=h.size,y=h.offset,b=s[v];if(m===1){if(typeof l!="number"&&typeof l!="boolean"){K.warn("Supplied value for single component uniform ".concat(u," is not a number: ").concat(l))();continue}b[y]=Number(l)}else{var O=Mt(l);if(!O){K.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},A(e)}();function re(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(!re(e[n],t[n],r-1))return!1;return!0}if(Array.isArray(t))return!1;if(tt(e)==="object"&&tt(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)||!re(e[a],t[a],r-1))return!1}return!0}return!1}function er(e){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function rr(e){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var mn=function(t){return"".concat(t)};function gn(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 vn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gn(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ss=0,Ps={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(Ss++)),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=vn(vn({},Ps),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=er(this._animationFrame.bind(this)))},t._cancelAnimationFrame=function(){this._animationFrameId===null&&(rr(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},A(e)}();var nr=pe(Jt(),1);function yn(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 _n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yn(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xn(e,t){var r=this,n=null,i=t?.device||Dt.createDevice(),o=new be(_n(_n({},t),{},{device:i,onInitialize:function(c){return lt(nr.default.mark(function a(){var f;return nr.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 ir(e){if(Array.isArray(e))return Nt(e)}function or(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sr(){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 ne(e){return
|
|
7
|
+
"use strict";var __exports__=(()=>{var Uo=Object.create;var he=Object.defineProperty;var Go=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var zo=Object.getPrototypeOf,ko=Object.prototype.hasOwnProperty;var Ge=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vo=(e,t)=>{for(var r in t)he(e,r,{get:t[r],enumerable:!0})},Pr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Bo(t))!ko.call(e,i)&&i!==r&&he(e,i,{get:()=>t[i],enumerable:!(n=Go(t,i))||n.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?Uo(zo(e)):{},Pr(t||!e||!e.__esModule?he(r,"default",{value:e,enumerable:!0}):r,e)),Ho=e=>Pr(he({},"__esModule",{value:!0}),e);var Dr=Ge((Lc,gt)=>{function qe(e){return gt.exports=qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt.exports.__esModule=!0,gt.exports.default=gt.exports,qe(e)}gt.exports=qe,gt.exports.__esModule=!0,gt.exports.default=gt.exports});var jr=Ge((Dc,vt)=>{var Ir=Dr().default;function Nr(){"use strict";vt.exports=Nr=function(){return e},vt.exports.__esModule=!0,vt.exports.default=vt.exports;var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(g,p,d){g[p]=d.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function a(g,p,d){return Object.defineProperty(g,p,{value:d,enumerable:!0,configurable:!0,writable:!0}),g[p]}try{a({},"")}catch{a=function(d,_,E){return d[_]=E}}function f(g,p,d,_){var E=p&&p.prototype instanceof h?p:h,P=Object.create(E.prototype),D=new U(_||[]);return n(P,"_invoke",{value:w(g,d,D)}),P}function u(g,p,d){try{return{type:"normal",arg:g.call(p,d)}}catch(_){return{type:"throw",arg:_}}}e.wrap=f;var l={};function h(){}function v(){}function m(){}var y={};a(y,o,function(){return this});var b=Object.getPrototypeOf,O=b&&b(b(C([])));O&&O!==t&&r.call(O,o)&&(y=O);var R=m.prototype=h.prototype=Object.create(y);function x(g){["next","throw","return"].forEach(function(p){a(g,p,function(d){return this._invoke(p,d)})})}function S(g,p){function d(E,P,D,B){var I=u(g[E],g,P);if(I.type!=="throw"){var G=I.arg,k=G.value;return k&&Ir(k)=="object"&&r.call(k,"__await")?p.resolve(k.__await).then(function(V){d("next",V,D,B)},function(V){d("throw",V,D,B)}):p.resolve(k).then(function(V){G.value=V,D(G)},function(V){return d("throw",V,D,B)})}B(I.arg)}var _;n(this,"_invoke",{value:function(P,D){function B(){return new p(function(I,G){d(P,D,I,G)})}return _=_?_.then(B,B):B()}})}function w(g,p,d){var _="suspendedStart";return function(E,P){if(_==="executing")throw new Error("Generator is already running");if(_==="completed"){if(E==="throw")throw P;return{value:void 0,done:!0}}for(d.method=E,d.arg=P;;){var D=d.delegate;if(D){var B=M(D,d);if(B){if(B===l)continue;return B}}if(d.method==="next")d.sent=d._sent=d.arg;else if(d.method==="throw"){if(_==="suspendedStart")throw _="completed",d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);_="executing";var I=u(g,p,d);if(I.type==="normal"){if(_=d.done?"completed":"suspendedYield",I.arg===l)continue;return{value:I.arg,done:d.done}}I.type==="throw"&&(_="completed",d.method="throw",d.arg=I.arg)}}}function M(g,p){var d=p.method,_=g.iterator[d];if(_===void 0)return p.delegate=null,d==="throw"&&g.iterator.return&&(p.method="return",p.arg=void 0,M(g,p),p.method==="throw")||d!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+d+"' method")),l;var E=u(_,g.iterator,p.arg);if(E.type==="throw")return p.method="throw",p.arg=E.arg,p.delegate=null,l;var P=E.arg;return P?P.done?(p[g.resultName]=P.value,p.next=g.nextLoc,p.method!=="return"&&(p.method="next",p.arg=void 0),p.delegate=null,l):P:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,l)}function j(g){var p={tryLoc:g[0]};1 in g&&(p.catchLoc=g[1]),2 in g&&(p.finallyLoc=g[2],p.afterLoc=g[3]),this.tryEntries.push(p)}function N(g){var p=g.completion||{};p.type="normal",delete p.arg,g.completion=p}function U(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(j,this),this.reset(!0)}function C(g){if(g||g===""){var p=g[o];if(p)return p.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var d=-1,_=function E(){for(;++d<g.length;)if(r.call(g,d))return E.value=g[d],E.done=!1,E;return E.value=void 0,E.done=!0,E};return _.next=_}}throw new TypeError(Ir(g)+" is not iterable")}return v.prototype=m,n(R,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:v,configurable:!0}),v.displayName=a(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(g){var p=typeof g=="function"&&g.constructor;return!!p&&(p===v||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,m):(g.__proto__=m,a(g,c,"GeneratorFunction")),g.prototype=Object.create(R),g},e.awrap=function(g){return{__await:g}},x(S.prototype),a(S.prototype,s,function(){return this}),e.AsyncIterator=S,e.async=function(g,p,d,_,E){E===void 0&&(E=Promise);var P=new S(f(g,p,d,_),E);return e.isGeneratorFunction(p)?P:P.next().then(function(D){return D.done?D.value:P.next()})},x(R),a(R,c,"Generator"),a(R,o,function(){return this}),a(R,"toString",function(){return"[object Generator]"}),e.keys=function(g){var p=Object(g),d=[];for(var _ in p)d.push(_);return d.reverse(),function E(){for(;d.length;){var P=d.pop();if(P in p)return E.value=P,E.done=!1,E}return E.done=!0,E}},e.values=C,U.prototype={constructor:U,reset:function(p){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),!p)for(var d in this)d.charAt(0)==="t"&&r.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=void 0)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function _(G,k){return D.type="throw",D.arg=p,d.next=G,k&&(d.method="next",d.arg=void 0),!!k}for(var E=this.tryEntries.length-1;E>=0;--E){var P=this.tryEntries[E],D=P.completion;if(P.tryLoc==="root")return _("end");if(P.tryLoc<=this.prev){var B=r.call(P,"catchLoc"),I=r.call(P,"finallyLoc");if(B&&I){if(this.prev<P.catchLoc)return _(P.catchLoc,!0);if(this.prev<P.finallyLoc)return _(P.finallyLoc)}else if(B){if(this.prev<P.catchLoc)return _(P.catchLoc,!0)}else{if(!I)throw new Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return _(P.finallyLoc)}}}},abrupt:function(p,d){for(var _=this.tryEntries.length-1;_>=0;--_){var E=this.tryEntries[_];if(E.tryLoc<=this.prev&&r.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var P=E;break}}P&&(p==="break"||p==="continue")&&P.tryLoc<=d&&d<=P.finallyLoc&&(P=null);var D=P?P.completion:{};return D.type=p,D.arg=d,P?(this.method="next",this.next=P.finallyLoc,l):this.complete(D)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),l},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var _=this.tryEntries[d];if(_.finallyLoc===p)return this.complete(_.completion,_.afterLoc),N(_),l}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var _=this.tryEntries[d];if(_.tryLoc===p){var E=_.completion;if(E.type==="throw"){var P=E.arg;N(_)}return P}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,_){return this.delegate={iterator:C(p),resultName:d,nextLoc:_},this.method==="next"&&(this.arg=void 0),l}},e}vt.exports=Nr,vt.exports.__esModule=!0,vt.exports.default=vt.exports});var Jt=Ge((Ic,Fr)=>{var de=jr()();Fr.exports=de;try{regeneratorRuntime=de}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=de:Function("r","regeneratorRuntime = r")(de)}});var rc={};Vo(rc,{AnimationLoop:()=>be,AnimationLoopTemplate:()=>Ur,ClipSpace:()=>ao,ConeGeometry:()=>mo,CubeGeometry:()=>vo,CylinderGeometry:()=>xo,GPUGeometry:()=>Le,Geometry:()=>st,GroupNode:()=>fo,IcoSphereGeometry:()=>Oo,KeyFrames:()=>Cr,Model:()=>ae,ModelNode:()=>uo,PipelineFactory:()=>se,PlaneGeometry:()=>Mo,ScenegraphNode:()=>It,ShaderModuleUniforms:()=>eo,SphereGeometry:()=>Po,Timeline:()=>Rr,Transform:()=>to,TruncatedConeGeometry:()=>Yt,makeAnimationLoop:()=>On});function Be(e){if(Array.isArray(e))return e}function ze(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,s,c=[],a=!0,f=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);a=!0);}catch(u){f=!0,i=u}finally{try{if(!a&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw i}}return c}}function Nt(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 $t(e,t){if(e){if(typeof e=="string")return Nt(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 Nt(e,t)}}function ke(){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 z(e,t){return Be(e)||ze(e,t)||$t(e,t)||ke()}function tt(e){return tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(e)}function Ve(e,t){if(tt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(tt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zt(e){var t=Ve(e,"string");return tt(t)==="symbol"?t:String(t)}function Ar(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Zt(n.key),n)}}function A(e,t,r){return t&&Ar(e.prototype,t),r&&Ar(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function He(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=qo(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.
|
|
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 qo(e,t){if(e){if(typeof e=="string")return Tr(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 Tr(e,t)}}function Tr(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 Wo=1,Ko=1,Rr=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=Wo++,v={time:0,delay:o,duration:c,rate:f,repeat:l};return this._setChannelTime(v,this.time),this.channels.set(h,v),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=z(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,v=l.channel;h.setTime(this.getTime(v))}}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=Ko++;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)},A(e)}();var Cr=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)},A(e)}();function Lr(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){Lr(o,n,i,s,c,"next",a)}function c(a){Lr(o,n,i,s,c,"throw",a)}s(void 0)})}}var We=pe(Jt(),1),Ur=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}(),A(e)}();function L(e,t,r){return t=Zt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yt=pe(Jt(),1);function Ke(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)||Ke()}var Yo=globalThis.self||globalThis.window||globalThis.global,jt=globalThis.window||globalThis.self||globalThis.global,Xo=globalThis.document||{},Tt=globalThis.process||{},$o=globalThis.console,Hc=globalThis.navigator||{};var me=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",Kc=ct();function Zo(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var ge=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=Zo(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 Gr(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 Br(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 ve(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 Jo=10;function zr(e){return typeof e!="string"?e:(e=e.toUpperCase(),ye[e]||ye.WHITE)}function kr(e,t,r){if(!ct&&typeof e=="string"){if(t){let n=zr(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=zr(r);e="\x1B[".concat(n+Jo,"m").concat(e,"\x1B[49m")}}return e}function Vr(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 Ft(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 Ut={debug:ct()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Qo={enabled:!0,level:0};function ht(){}var Hr={},qr={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 ge("__probe-".concat(this.id,"__"),Qo),this.timeStamp("".concat(this.id," started")),Vr(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){Ft(t,r)}warn(t){return this._getLogFunction(0,t,Ut.warn,arguments,qr)}error(t){return this._getLogFunction(0,t,Ut.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,Ut.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Ut.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Ut.debug||Ut.info,arguments,qr)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ht,n&&[n],{tag:ns(r)}):ht}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:s=1}=t;return this._shouldLog(r||n)?ct()?rs({image:i,message:o,scale:s}):es({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=Wr({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()>=Kr(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=Wr({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,Ft(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Rt();let s=o.tag||o.message;if(o.once&&s)if(!Hr[s])Hr[s]=Rt();else return ht;return r=ts(this.id,o.message,o),n.bind(console,r,...o.args)}return ht}};wt.VERSION=me;function Kr(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 Ft(Number.isFinite(t)&&t>=0),t}function Wr(e){let{logLevel:t,message:r}=e;e.logLevel=Kr(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 Ft(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function ts(e,t,r){if(typeof t=="string"){let n=r.time?Br(Gr(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=kr(t,r.color,r.background)}return t}function es(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ht}function rs(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let s=ve(o,r,n);console.log(...s)},o.src=t,ht}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...ve(t,r,n)),ht;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...ve(o,r,n)),o.src=t.toDataURL(),ht}return ht}function ns(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var _f=new wt({id:"@probe.gl/log"});var K=new wt({id:"luma.gl"});function Qt(){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=Qt(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Qt()-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 is=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)},A(e)}(),Gt=new is;function os(){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()&&K.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:K,stats:Gt}),e}var Yr=os();function Xr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function Mt(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:Xr(e)}var Je=pe(Jt(),1);var Ye={};function H(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Ye[e]=Ye[e]||1;var t=Ye[e]++;return"".concat(e,"-").concat(t)}function te(e,t){return te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},te(e,t)}function q(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&&te(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 W(e,t){if(t&&(tt(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 F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},F(e)}function $r(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 ss(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$r(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$r(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=as(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()},A(e)}();Lt.defaultProps={id:"undefined",handle:void 0,userData:void 0};function as(e,t){var r=ss({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}var Jr;function Zr(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?Zr(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cs(e){var t=fs();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function fs(){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}}Jr=Symbol.toStringTag;var X=function(e){q(r,e);var t=cs(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")},A(r,[{key:Jr,get:function(){return"Buffer"}}]),r}(Lt);X.defaultProps=$e($e({},Lt.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});X.MAP_READ=1;X.MAP_WRITE=2;X.COPY_SRC=4;X.COPY_DST=8;X.INDEX=16;X.VERTEX=32;X.UNIFORM=64;X.STORAGE=128;X.INDIRECT=256;X.QUERY_RESOLVE=512;var tn;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 Ze(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){L(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 _e={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(K.get("debug")),break:[],gl:null};tn=Symbol.toStringTag;var us=function(){function e(r){T(this,e),this.id=void 0,this.statsManager=Gt,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)&X.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":K.warn("indices buffer content must be of integer type")()),i},A(e,[{key:tn,get:function(){return"Device"}}]),e}();us.VERSION=Yr;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 rn(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){L(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 ls(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=hs(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,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 hs(e,t){if(e){if(typeof e=="string")return nn(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 nn(e,t)}}function nn(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 Bt=new Map,Dt=function(){function e(){T(this,e)}return e.registerDevices=function(r){var n=ls(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;rt(o.type&&o.isSupported&&o.create),Bt.set(o.type,o)}}catch(s){n.e(s)}finally{n.f()}},e.getAvailableDevices=function(){return Array.from(Bt).map(function(r){return r.type})},e.getSupportedDevices=function(){return Array.from(Bt).filter(function(r){return r.isSupported()}).map(function(r){return r.type})},e.setDefaultDeviceProps=function(r){Object.assign(_e,r)},e.createDevice=function(){var t=lt(Je.default.mark(function n(){var i,o,s=arguments;return Je.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:i=s.length>0&&s[0]!==void 0?s[0]:{},i=rn(rn({},_e),i),i.gl&&(i.type="webgl"),a.t0=i.type,a.next=a.t0==="webgpu"?6:a.t0==="webgl"||a.t0==="webgl1"||a.t0==="webgl2"?12:a.t0==="best-available"?18:24;break;case 6:if(o=Bt.get("webgpu"),!o){a.next=11;break}return a.next=10,o.create(i);case 10:return a.abrupt("return",a.sent);case 11:return a.abrupt("break",24);case 12:if(o=Bt.get("webgl"),!o){a.next=17;break}return a.next=16,o.create(i);case 16:return a.abrupt("return",a.sent);case 17:return a.abrupt("break",24);case 18:if(o=Bt.get("webgl"),!(o&&o.isSupported())){a.next=23;break}return a.next=22,o.create(i);case 22:return a.abrupt("return",a.sent);case 23:return a.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 a.stop()}},n)}));function r(){return t.apply(this,arguments)}return r}(),A(e)}();Dt.stats=Gt;Dt.log=K;var an;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){L(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 ps(e){var t=ds();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function ds(){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}}an=Symbol.toStringTag;var zt=function(e){q(r,e);var t=ps(r);function r(n,i){var o;return T(this,r),o=t.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 A(r,[{key:an,get:function(){return"RenderPipeline"}}]),r}(Lt);zt.defaultProps=sn(sn({},Lt.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});function cn(e){var t=z(gs[e],2),r=t[0],n=t[1],i=r==="i32"||r==="u32",o=r!=="u32",s=vs[r]*n,c=ms(r,n);return{dataType:r,components:n,defaultVertexFormat:c,byteLength:s,integer:i,signed:o}}function ms(e,t){var r;switch(e){case"f32":r="float32";break;case"i32":r="sint32";break;case"u32":r="uint32";break;case"f16":return t<=2?"float16x2":"float16x4"}return t===1?r:"".concat(r,"x").concat(t)}var gs={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]},vs={f32:4,f16:2,i32:4,u32:4};function un(e){var t=fn[e],r=ys(t),n=e.includes("norm"),i=!n&&!e.startsWith("float"),o=e.startsWith("s");return{dataType:fn[e],byteLength:r,integer:i,signed:o,normalized:n}}function ys(e){var t=_s[e];return t}var fn={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},_s={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Qe(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=z(r,2),i=n[0],o=n[1],s=i,c=o?parseInt(o):1,a=un(s),f={type:s,components:c,byteLength:a.byteLength*c,integer:a.integer,signed:a.signed,normalized:a.normalized};return t&&(f.webglOnly=!0),f}function ee(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=xs(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.
|
|
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 xs(e,t){if(e){if(typeof e=="string")return ln(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 ln(e,t)}}function ln(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=ee(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=bs(e,t,o.name)}}catch(s){n.e(s)}finally{n.f()}return r}function bs(e,t,r){var n=Os(e,r),i=ws(t,r);if(!n)return null;var o=cn(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 Os(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||K.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function ws(e,t){Es(e);var r=Ms(e,t);return r||(r=Ss(e,t),r)?r:(K.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Es(e){var t=ee(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&K.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function Ms(e,t){var r=ee(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 Ss(e,t){var r=ee(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=ee(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 rt(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}var Ps={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 hn(e){var t=Ps[e];return rt(e),t}function pn(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}var xe;function dn(e){return(!xe||xe.byteLength<e)&&(xe=new ArrayBuffer(e)),xe}var mn=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=z(o[i],2),c=s[0],a=s[1],f=hn(a),u=f.type,l=f.components;n=pn(n,l);var h=n;n+=l,this.layout[c]={type:u,size:l,offset:h}}n+=(4-n%4)%4;var v=n*4;this.byteLength=Math.max(v,mn)}var t=e.prototype;return t.getData=function(n){for(var i=Math.max(this.byteLength,mn),o=dn(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=z(a[c],2),u=f[0],l=f[1],h=this.layout[u];if(!h){K.warn("Supplied uniform value ".concat(u," not present in uniform block layout"))();continue}var v=h.type,m=h.size,y=h.offset,b=s[v];if(m===1){if(typeof l!="number"&&typeof l!="boolean"){K.warn("Supplied value for single component uniform ".concat(u," is not a number: ").concat(l))();continue}b[y]=Number(l)}else{var O=Mt(l);if(!O){K.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},A(e)}();function gn(e){return Mt(e)!==null||typeof e=="number"||typeof e=="boolean"}function rr(e){var t={bindings:{},uniforms:{}};return Object.keys(e).forEach(function(r){var n=e[r];gn(n)?t.uniforms[r]=n:t.bindings[r]=n}),t}function re(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(!re(e[n],t[n],r-1))return!1;return!0}if(Array.isArray(t))return!1;if(tt(e)==="object"&&tt(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)||!re(e[a],t[a],r-1))return!1}return!0}return!1}function nr(e){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function ir(e){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var vn=function(t){return"".concat(t)};function yn(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 _n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yn(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var As=0,Ts={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(As++)),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=_n(_n({},Ts),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=nr(this._animationFrame.bind(this)))},t._cancelAnimationFrame=function(){this._animationFrameId===null&&(ir(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=z(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},A(e)}();var or=pe(Jt(),1);function xn(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 bn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xn(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function On(e,t){var r=this,n=null,i=t?.device||Dt.createDevice(),o=new be(bn(bn({},t),{},{device:i,onInitialize:function(c){return lt(or.default.mark(function a(){var f;return or.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 sr(e){if(Array.isArray(e))return Nt(e)}function ar(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cr(){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 ne(e){return sr(e)||ar(e)||$t(e)||cr()}var nt=function(t){return"".concat(t)};function dt(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}function wn(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 St(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wn(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var fr={number:{type:"number",validate:function(t,r){return Number.isFinite(t)&&tt(r)==="object"&&(r.max===void 0||t<=r.max)&&(r.min===void 0||t>=r.min)}},array:{type:"array",validate:function(t,r){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function Mn(e){for(var t={},r=0,n=Object.entries(e);r<n.length;r++){var i=z(n[r],2),o=i[0],s=i[1];t[o]=Rs(s)}return t}function Sn(e,t,r){for(var n={},i=0,o=Object.entries(t);i<o.length;i++){var s=z(o[i],2),c=s[0],a=s[1];e&&c in e&&!a.private?(a.validate&&dt(a.validate(e[c],a),"".concat(r,": invalid ").concat(c)),n[c]=e[c]):n[c]=a.value}return n}function Rs(e){var t=En(e);if(t!=="object")return St(St({value:e},fr[t]),{},{type:t});if(tt(e)==="object")return e?e.type!==void 0?St(St(St({},e),fr[e.type]),{},{type:e.type}):e.value===void 0?{type:"object",value:e}:(t=En(e.value),St(St(St({},e),fr[t]),{},{type:t})):{type:"object",value:null};throw new Error("props")}function En(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":tt(e)}function $(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Pn,An,Tn=nt(Pn||(Pn=$([`#ifdef MODULE_LOGDEPTH
|
|
13
13
|
logdepth_adjustPosition(gl_Position);
|
|
14
14
|
#endif
|
|
15
15
|
`],[`\\
|
|
16
16
|
#ifdef MODULE_LOGDEPTH
|
|
17
17
|
logdepth_adjustPosition(gl_Position);
|
|
18
18
|
#endif
|
|
19
|
-
`]))),
|
|
19
|
+
`]))),Rn=nt(An||(An=$([`#ifdef MODULE_MATERIAL
|
|
20
20
|
gl_FragColor = material_filterColor(gl_FragColor);
|
|
21
21
|
#endif
|
|
22
22
|
|
|
@@ -57,13 +57,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
57
57
|
#ifdef MODULE_LOGDEPTH
|
|
58
58
|
logdepth_setFragDepth();
|
|
59
59
|
#endif
|
|
60
|
-
`])));var
|
|
60
|
+
`])));var Cs={vertex:Tn,fragment:Rn},Cn=/void\s+main\s*\([^)]*\)\s*\{\n?/,Ln=/}\n?[^{}]*$/,ur=[],ie="__LUMA_INJECT_DECLARATIONS__";function Dn(e){var t={vertex:{},fragment:{}};for(var r in e){var n=e[r],i=Ls(r);typeof n=="string"&&(n={order:0,injection:n}),t[i][r]=n}return t}function Ls(e){var t=e.slice(0,2);switch(t){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(t)}}function oe(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=t==="vertex",o=function(){var a=r[s];a.sort(function(h,v){return h.order-v.order}),ur.length=a.length;for(var f=0,u=a.length;f<u;++f)ur[f]=a[f].injection;var l="".concat(ur.join(`
|
|
61
61
|
`),`
|
|
62
|
-
`);switch(s){case"vs:#decl":i&&(e=e.replace(ie,l));break;case"vs:#main-start":i&&(e=e.replace(
|
|
62
|
+
`);switch(s){case"vs:#decl":i&&(e=e.replace(ie,l));break;case"vs:#main-start":i&&(e=e.replace(Cn,function(h){return h+l}));break;case"vs:#main-end":i&&(e=e.replace(Ln,function(h){return l+h}));break;case"fs:#decl":i||(e=e.replace(ie,l));break;case"fs:#main-start":i||(e=e.replace(Cn,function(h){return h+l}));break;case"fs:#main-end":i||(e=e.replace(Ln,function(h){return l+h}));break;default:e=e.replace(s,function(h){return h+l})}};for(var s in r)o();return e=e.replace(ie,""),n&&(e=e.replace(/\}\s*$/,function(c){return c+Cs[t]})),e}var In=function(){e.instantiateModules=function(n){return n.map(function(i){if(i instanceof e)return i;dt(typeof i!="string","Shader module use by name is deprecated. Import shader module '".concat(i,"' and use it directly.")),dt(i.name,"shader module has no name");var o=new e(i);return o.dependencies=e.instantiateModules(i.dependencies||[]),o})};function e(r){T(this,e),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,s=r.dependencies,c=s===void 0?[]:s,a=r.uniformPropTypes,f=a===void 0?{}:a,u=r.getUniforms,l=r.deprecations,h=l===void 0?[]:l,v=r.defines,m=v===void 0?{}:v,y=r.inject,b=y===void 0?{}:y;dt(typeof n=="string"),this.name=n,this.vs=i,this.fs=o,this.getModuleUniforms=u,this.dependencies=e.instantiateModules(c),this.deprecations=this._parseDeprecationDefinitions(h),this.defines=m,this.injections=Dn(b),f&&(this.uniforms=Mn(f))}var t=e.prototype;return t.getModuleSource=function(n){var i;switch(n){case"vertex":i=this.vs||"";break;case"fragment":i=this.fs||"";break;default:dt(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),`
|
|
63
63
|
`).concat(i,"// END MODULE_").concat(this.name,`
|
|
64
64
|
|
|
65
|
-
`)},t.getUniforms=function(n,i){return this.getModuleUniforms?this.getModuleUniforms(n,i):
|
|
66
|
-
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
|
|
65
|
+
`)},t.getUniforms=function(n,i){return this.getModuleUniforms?this.getModuleUniforms(n,i):Sn(n,this.uniforms,this.name)},t.getDefines=function(){return this.defines},t.checkDeprecations=function(n,i){this.deprecations.forEach(function(o){var s;(s=o.regex)!==null&&s!==void 0&&s.test(n)&&(o.deprecated?i.deprecated(o.old,o.new)():i.removed(o.old,o.new)())})},t._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},t._defaultGetUniforms=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={},o=this.uniforms;for(var s in o){var c=o[s];s in n&&!c.private?(c.validate&&dt(c.validate(n[s],c),"".concat(this.name,": invalid ").concat(s)),i[s]=n[s]):i[s]=c.value}return i},A(e)}();function Nn(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ds(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.
|
|
66
|
+
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 Ds(e,t){if(e){if(typeof e=="string")return jn(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 jn(e,t)}}function jn(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 Fn(e){var t=In.instantiateModules(e);return Is(t)}function Is(e){var t={},r={};return Un({modules:e,level:0,moduleMap:t,moduleDepth:r}),Object.keys(r).sort(function(n,i){return r[i]-r[n]}).map(function(n){return t[n]})}function Un(e){var t=e.modules,r=e.level,n=e.moduleMap,i=e.moduleDepth;if(r>=5)throw new Error("Possible loop in shader dependency graph");var o=Nn(t),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n[c.name]=c,(i[c.name]===void 0||i[c.name]<r)&&(i[c.name]=r)}}catch(l){o.e(l)}finally{o.f()}var a=Nn(t),f;try{for(a.s();!(f=a.n()).done;){var u=f.value;u.dependencies&&Un({modules:u.dependencies,level:r+1,moduleMap:n,moduleDepth:i})}}catch(l){a.e(l)}finally{a.f()}}var Gn,Bn,zn,kn,Vn,Hn,qn,Wn,Kn,Yn;function Xn(e){switch(e?.gpu.toLowerCase()){case"apple":return nt(Gn||(Gn=$([`#define APPLE_GPU
|
|
67
67
|
// Apple optimizes away the calculation necessary for emulated fp64
|
|
68
68
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
69
69
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
@@ -76,14 +76,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
76
76
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
77
77
|
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
|
|
78
78
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
79
|
-
`])));case"nvidia":return nt(
|
|
79
|
+
`])));case"nvidia":return nt(Bn||(Bn=$([`#define NVIDIA_GPU
|
|
80
80
|
// Nvidia optimizes away the calculation necessary for emulated fp64
|
|
81
81
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
82
82
|
`],[`\\
|
|
83
83
|
#define NVIDIA_GPU
|
|
84
84
|
// Nvidia optimizes away the calculation necessary for emulated fp64
|
|
85
85
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
86
|
-
`])));case"intel":return nt(
|
|
86
|
+
`])));case"intel":return nt(zn||(zn=$([`#define INTEL_GPU
|
|
87
87
|
// Intel optimizes away the calculation necessary for emulated fp64
|
|
88
88
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
89
89
|
// Intel's built-in 'tan' function doesn't have acceptable precision
|
|
@@ -98,10 +98,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
98
98
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
99
99
|
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
|
|
100
100
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
101
|
-
`])));case"amd":return nt(
|
|
101
|
+
`])));case"amd":return nt(kn||(kn=$([`#define AMD_GPU
|
|
102
102
|
`],[`\\
|
|
103
103
|
#define AMD_GPU
|
|
104
|
-
`])));default:return nt(
|
|
104
|
+
`])));default:return nt(Vn||(Vn=$([`#define DEFAULT_GPU
|
|
105
105
|
// Prevent driver from optimizing away the calculation necessary for emulated fp64
|
|
106
106
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
107
107
|
// Headless Chrome's software shader 'tan' function doesn't have acceptable precision
|
|
@@ -116,7 +116,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
116
116
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
117
117
|
// If the GPU doesn't have full 32 bits precision, will causes overflow
|
|
118
118
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
119
|
-
`])))}}function
|
|
119
|
+
`])))}}function $n(e){var t=nt(Hn||(Hn=$([`#if (__VERSION__ > 120)
|
|
120
120
|
# define FEATURE_GLSL_DERIVATIVES
|
|
121
121
|
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
122
122
|
# define FEATURE_GLSL_FRAG_DEPTH
|
|
@@ -129,7 +129,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
129
129
|
# define FEATURE_GLSL_FRAG_DEPTH
|
|
130
130
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
131
131
|
#endif // __VERSION
|
|
132
|
-
`])));return!e.features.has("webgl2")&&e.features.has("glsl-frag-depth")&&(t+=nt(
|
|
132
|
+
`])));return!e.features.has("webgl2")&&e.features.has("glsl-frag-depth")&&(t+=nt(qn||(qn=$([`
|
|
133
133
|
// FRAG_DEPTH => gl_FragDepth is available
|
|
134
134
|
#ifdef GL_EXT_frag_depth
|
|
135
135
|
# extension GL_EXT_frag_depth : enable
|
|
@@ -146,7 +146,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
146
146
|
# define FRAG_DEPTH
|
|
147
147
|
# define gl_FragDepth gl_FragDepthEXT
|
|
148
148
|
#endif
|
|
149
|
-
`])))),!e.features.has("webgl2")&&e!==null&&e!==void 0&&e.features.has("glsl-derivatives")&&(t+=nt(
|
|
149
|
+
`])))),!e.features.has("webgl2")&&e!==null&&e!==void 0&&e.features.has("glsl-derivatives")&&(t+=nt(Wn||(Wn=$([`
|
|
150
150
|
// DERIVATIVES => dxdF, dxdY and fwidth are available
|
|
151
151
|
#if defined(GL_OES_standard_derivatives) || defined(FEATURE_GLSL_DERIVATIVES)
|
|
152
152
|
# extension GL_OES_standard_derivatives : enable
|
|
@@ -161,7 +161,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
161
161
|
# define FEATURE_GLSL_DERIVATIVES
|
|
162
162
|
# define DERIVATIVES
|
|
163
163
|
#endif
|
|
164
|
-
`])))),!e.features.has("webgl2")&&e!==null&&e!==void 0&&e.features.has("glsl-frag-data")&&(t+=nt(
|
|
164
|
+
`])))),!e.features.has("webgl2")&&e!==null&&e!==void 0&&e.features.has("glsl-frag-data")&&(t+=nt(Kn||(Kn=$([`
|
|
165
165
|
// DRAW_BUFFERS => gl_FragData[] is available
|
|
166
166
|
#ifdef GL_EXT_draw_buffers
|
|
167
167
|
# extension GL_EXT_draw_buffers : require
|
|
@@ -176,7 +176,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
176
176
|
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
177
177
|
# define DRAW_BUFFERS
|
|
178
178
|
#endif
|
|
179
|
-
`])))),!e.features.has("webgl2")&&e!==null&&e!==void 0&&e.features.has("glsl-texture-lod")&&(t+=nt(
|
|
179
|
+
`])))),!e.features.has("webgl2")&&e!==null&&e!==void 0&&e.features.has("glsl-texture-lod")&&(t+=nt(Yn||(Yn=$([`// TEXTURE_LOD => texture2DLod etc are available
|
|
180
180
|
#ifdef GL_EXT_shader_texture_lod
|
|
181
181
|
# extension GL_EXT_shader_texture_lod : enable
|
|
182
182
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
@@ -189,42 +189,42 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
189
189
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
190
190
|
# define TEXTURE_LOD
|
|
191
191
|
#endif
|
|
192
|
-
`])))),t}function
|
|
193
|
-
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
|
|
194
|
-
`],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],
|
|
195
|
-
`).concat(i)}).replace(new RegExp("\\b".concat(
|
|
196
|
-
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
|
|
197
|
-
`),i.header&&(r+=" ".concat(i.header)),t[n]){var o=t[n];o.sort(function(f,u){return f.order-u.order});var s=
|
|
192
|
+
`])))),t}function Ns(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=js(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.
|
|
193
|
+
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 js(e,t){if(e){if(typeof e=="string")return Zn(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 Zn(e,t)}}function Zn(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 Jn(e,t,r){switch(t){case 300:switch(r){case"vertex":return Oe(e,Fs);case"fragment":return ks(e);default:throw new Error("unknown shader stage ".concat(r))}case 100:switch(r){case"vertex":return Oe(e,Gs);case"fragment":return Vs(e);default:throw new Error("unknown shader stage ".concat(r))}default:throw new Error("unknown GLSL version ".concat(t))}}var Qn=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,`#version 300 es
|
|
194
|
+
`],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],Fs=[].concat(Qn,[[kt("attribute"),"in $1"],[kt("varying"),"out $1"]]),Us=[].concat(Qn,[[kt("varying"),"in $1"]]),ti=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Gs=[].concat(ti,[[kt("in"),"attribute $1"],[kt("out"),"varying $1"]]),Bs=[].concat(ti,[[kt("in"),"varying $1"]]),lr="gl_FragColor",hr=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,zs=/void\s+main\s*\([^)]*\)\s*\{\n?/;function Oe(e,t){var r=Ns(t),n;try{for(r.s();!(n=r.n()).done;){var i=z(n.value,2),o=i[0],s=i[1];e=e.replace(o,s)}}catch(c){r.e(c)}finally{r.f()}return e}function ks(e){e=Oe(e,Us);var t=hr.exec(e);if(t){var r=t[1];e=e.replace(new RegExp("\\b".concat(lr,"\\b"),"g"),r)}else{var n="fragmentColor";e=e.replace(zs,function(i){return"out vec4 ".concat(n,`;
|
|
195
|
+
`).concat(i)}).replace(new RegExp("\\b".concat(lr,"\\b"),"g"),n)}return e}function Vs(e){e=Oe(e,Bs);var t=hr.exec(e);if(t){var r=t[1];e=e.replace(hr,"").replace(new RegExp("\\b".concat(r,"\\b"),"g"),lr)}return e}function kt(e){return new RegExp("\\b".concat(e,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}function ri(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Hs(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.
|
|
196
|
+
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 Hs(e,t){if(e){if(typeof e=="string")return ei(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 ei(e,t)}}function ei(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 pr(e,t){var r="";for(var n in e){var i=e[n];if(r+="void ".concat(i.signature,` {
|
|
197
|
+
`),i.header&&(r+=" ".concat(i.header)),t[n]){var o=t[n];o.sort(function(f,u){return f.order-u.order});var s=ri(o),c;try{for(s.s();!(c=s.n()).done;){var a=c.value;r+=" ".concat(a.injection,`
|
|
198
198
|
`)}}catch(f){s.e(f)}finally{s.f()}}i.footer&&(r+=" ".concat(i.footer)),r+=`}
|
|
199
|
-
`}return r}function
|
|
200
|
-
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
|
|
199
|
+
`}return r}function dr(e){var t={vertex:{},fragment:{}},r=ri(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=void 0,s=void 0;typeof i!="string"?(o=i,s=o.hook):(o={},s=i),s=s.trim();var c=s.split(":"),a=z(c,2),f=a[0],u=a[1],l=s.replace(/\(.+/,""),h=Object.assign(o,{signature:u});switch(f){case"vs":t.vertex[l]=h;break;case"fs":t.fragment[l]=h;break;default:throw new Error(f)}}}catch(v){r.e(v)}finally{r.f()}return t}var ni;function mr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=qs(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.
|
|
200
|
+
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 qs(e,t){if(e){if(typeof e=="string")return ii(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 ii(e,t)}}function ii(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 oi(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?oi(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var fi=`
|
|
201
201
|
|
|
202
202
|
`.concat(ie,`
|
|
203
203
|
|
|
204
|
-
`),
|
|
204
|
+
`),Ws=nt(ni||(ni=$([`precision highp float;
|
|
205
205
|
|
|
206
206
|
`],[`\\
|
|
207
207
|
precision highp float;
|
|
208
208
|
|
|
209
|
-
`])));function
|
|
209
|
+
`])));function ui(e,t){var r=t.vs,n=t.fs,i=Fn(t.modules||[]);switch(e.shaderLanguage){case"glsl":return{vs:ai(e,Pt(Pt({},t),{},{source:r,stage:"vertex",modules:i})),fs:ai(e,Pt(Pt({},t),{},{source:n,stage:"fragment",modules:i})),getUniforms:ci(i)};case"wgsl":return{vs:si(e,Pt(Pt({},t),{},{source:r,stage:"vertex",modules:i})),fs:si(e,Pt(Pt({},t),{},{source:n,stage:"fragment",modules:i})),getUniforms:ci(i)}}}function si(e,t){var r=t.source,n=t.stage,i=t.modules,o=t.defines,s=o===void 0?{}:o,c=t.hookFunctions,a=c===void 0?[]:c,f=t.inject,u=f===void 0?{}:f,l=t.log;dt(typeof r=="string","shader source must be a string");var h=r,v={};i.forEach(function(D){Object.assign(v,D.getDefines())}),Object.assign(v,s);var m="",y=dr(a),b={},O={},R={};for(var x in u){var S=typeof u[x]=="string"?{injection:u[x],order:0}:u[x],w=/^(v|f)s:(#)?([\w-]+)$/.exec(x);if(w){var M=w[2],j=w[3];M?j==="decl"?O[x]=[S]:R[x]=[S]:b[x]=[S]}else R[x]=[S]}var N=mr(i),U;try{for(N.s();!(U=N.n()).done;){var C=U.value;l&&C.checkDeprecations(h,l);var g=C.getModuleSource(n,"wgsl");m+=g;var p=C.injections[n];for(var d in p){var _=/^(v|f)s:#([\w-]+)$/.exec(d);if(_){var E=_[2],P=E==="decl"?O:R;P[d]=P[d]||[],P[d].push(p[d])}else b[d]=b[d]||[],b[d].push(p[d])}}}catch(D){N.e(D)}finally{N.f()}return m+=fi,m=oe(m,n,O),m+=pr(y[n],b),m+=h,m=oe(m,n,R),m}function ai(e,t){var r=t.source.includes("->"),n=t.id,i=t.source,o=t.stage,s=t.language,c=s===void 0?r?"wgsl":"glsl":s,a=t.modules,f=t.defines,u=f===void 0?{}:f,l=t.hookFunctions,h=l===void 0?[]:l,v=t.inject,m=v===void 0?{}:v,y=t.transpileToGLSL100,b=y===void 0?!1:y,O=t.prologue,R=O===void 0?!r:O,x=t.log;dt(typeof i=="string","shader source must be a string");var S=i.split(`
|
|
210
210
|
`),w=100,M="",j=i;S[0].indexOf("#version ")===0?(w=300,M=S[0],j=S.slice(1).join(`
|
|
211
211
|
`)):M="#version ".concat(w);var N=b?100:w,U={};a.forEach(function(Xt){Object.assign(U,Xt.getDefines())}),Object.assign(U,u);var C="";switch(c){case"wgsl":break;case"glsl":C=R?"".concat(M,`
|
|
212
|
-
`).concat(
|
|
212
|
+
`).concat(Ks({id:n,source:i,stage:o}),`
|
|
213
213
|
`,"#define SHADER_TYPE_".concat(o.toUpperCase()),`
|
|
214
|
-
`).concat(
|
|
215
|
-
`).concat(
|
|
216
|
-
`).concat(
|
|
217
|
-
`).concat(o==="fragment"?
|
|
214
|
+
`).concat(Xn(e),`
|
|
215
|
+
`).concat($n(e),`
|
|
216
|
+
`).concat(Ys(U),`
|
|
217
|
+
`).concat(o==="fragment"?Ws:"",`
|
|
218
218
|
`):"".concat(M,`
|
|
219
|
-
`);break}var g=
|
|
219
|
+
`);break}var g=dr(h),p={},d={},_={};for(var E in m){var P=typeof m[E]=="string"?{injection:m[E],order:0}:m[E],D=/^(v|f)s:(#)?([\w-]+)$/.exec(E);if(D){var B=D[2],I=D[3];B?I==="decl"?d[E]=[P]:_[E]=[P]:p[E]=[P]}else _[E]=[P]}var G=mr(a),k;try{for(G.s();!(k=G.n()).done;){var V=k.value;x&&V.checkDeprecations(j,x);var pt=V.getModuleSource(o);C+=pt;var ft=V.injections[o];for(var Z in ft){var J=/^(v|f)s:#([\w-]+)$/.exec(Z);if(J){var Q=J[2],at=Q==="decl"?d:_;at[Z]=at[Z]||[],at[Z].push(ft[Z])}else p[Z]=p[Z]||[],p[Z].push(ft[Z])}}}catch(Xt){G.e(Xt)}finally{G.f()}return C+=fi,C=oe(C,o,d),C+=pr(g[o],p),C+=j,C=oe(C,o,_),C=Jn(C,N,o),C.trim()}function ci(e){return function(r){var n={},i=mr(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 Ks(e){var t=e.id,r=e.source,n=e.stage,i=t&&r.indexOf("SHADER_NAME")===-1;return i?`
|
|
220
220
|
#define SHADER_NAME `.concat(t,"_").concat(n,`
|
|
221
221
|
|
|
222
|
-
`):""}function
|
|
222
|
+
`):""}function Ys(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=0,r="";for(var n in e){t===0&&(r+=`
|
|
223
223
|
// APPLICATION DEFINES
|
|
224
224
|
`),t++;var i=e[n];(i||Number.isFinite(i))&&(r+="#define ".concat(n.toUpperCase()," ").concat(e[n],`
|
|
225
225
|
`))}return t===0&&(r+=`
|
|
226
|
-
`),r}function fi(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 ui(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fi(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hi(e,t){if(!t.vs)throw new Error("no vertex shader");var r=li(e,t.vs),n;return t.fs&&(n=li(e,t.fs)),ui(ui({},t),{},{vs:r,fs:n})}function li(e,t){if(typeof t=="string")return t;switch(e.type){case"webgpu":if(t!=null&&t.wgsl)return t.wgsl;throw new Error("WebGPU does not support GLSL shaders");default:if(t!=null&&t.glsl)return t.glsl;throw new Error("WebGL does not support WGSL shaders")}}function pi(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 di(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pi(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var we=function(){function e(){T(this,e),this._hookFunctions=[],this._defaultModules=[]}e.getDefaultShaderAssembler=function(){return e.defaultShaderAssembler=e.defaultShaderAssembler||new e,e.defaultShaderAssembler};var t=e.prototype;return t.addDefaultModule=function(n){this._defaultModules.find(function(i){return i.name===(typeof n=="string"?n:n.name)})||this._defaultModules.push(n)},t.removeDefaultModule=function(n){var i=typeof n=="string"?n:n.name;this._defaultModules=this._defaultModules.filter(function(o){return o.name!==i})},t.addShaderHook=function(n,i){i&&(n=Object.assign(i,{hook:n})),this._hookFunctions.push(n)},t.assembleShaders=function(n,i){var o=this._getModuleList(i.modules),s=this._hookFunctions,c=hi(n,i),a=ci(n,di(di({},c),{},{modules:o,hookFunctions:s}));return a},t._getModuleList=function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=new Array(this._defaultModules.length+n.length),o={},s=0,c=0,a=this._defaultModules.length;c<a;++c){var f=this._defaultModules[c],u=f.name;i[s++]=f,o[u]=!0}for(var l=0,h=n.length;l<h;++l){var v=n[l],m=v.name;o[m]||(i[s++]=v,o[m]=!0)}return i.length=s,i},A(e)}();we.defaultShaderAssembler=void 0;var jh=1/Math.PI*180,Fh=1/180*Math.PI,Ks={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Ks}};var et=globalThis.mathgl.config;function mi(e,{precision:t=et.precision}={}){return e=Ys(e),"".concat(parseFloat(e.toPrecision(t)))}function Vt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function dr(e,t,r){let n=et.EPSILON;r&&(et.EPSILON=r);try{if(e===t)return!0;if(Vt(e)&&Vt(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!dr(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)<=et.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{et.EPSILON=n}}function Ys(e){return Math.round(e/et.EPSILON)*et.EPSILON}function Xs(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 Ht=class extends Xs(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:Vt(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(et)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+mi(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(!dr(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(et.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 $s(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(et.debug&&!$s(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function mr(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var Me=class extends Ht{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 mr(t>=0&&t<this.ELEMENTS,"index is out of range"),it(this[t])}setComponent(t,r){return mr(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 Yh=Math.PI/180;function Zs(){let e=new _t(2);return _t!=Float32Array&&(e[0]=0,e[1]=0),e}function yi(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 Xh=function(){let e=Zs();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 _i(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 Se(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 xi(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 Js(){let e=new _t(3);return _t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Qs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function bi(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 Pe(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 Oi(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 wi(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,v=i*h-o*l,m=o*u-n*h,y=n*l-i*u,b=s*2;return u*=b,l*=b,h*=b,v*=2,m*=2,y*=2,e[0]=c+u+v,e[1]=a+l+m,e[2]=f+h+y,e}function Ei(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 Mi(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 Si(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 Pi(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&&Qs(e,t)/a;return Math.acos(Math.min(Math.max(f,-1),1))}var Jh=function(){let e=Js();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 vr=[0,0,0],Ae,ot=class extends Me{static get ZERO(){return Ae||(Ae=new ot(0,0,0),Object.freeze(Ae)),Ae}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Vt(t)?this.copy(t):(et.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 et.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 Pi(this,t)}cross(t){return bi(this,this,t),this.check()}rotateX({radians:t,origin:r=vr}){return Ei(this,this,r,t),this.check()}rotateY({radians:t,origin:r=vr}){return Mi(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=vr}){return Si(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Pe(this,this,t),this.check()}transformAsVector(t){return Se(this,this,t),this.check()}transformByMatrix3(t){return Oi(this,this,t),this.check()}transformByMatrix2(t){return xi(this,this,t),this.check()}transformByQuaternion(t){return wi(this,this,t),this.check()}};var Te=class extends Ht{toString(){let t="[";if(et.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 ta(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 Ai(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 Ti(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],v=t[11],m=t[12],y=t[13],b=t[14],O=t[15],R=r*c-n*s,x=r*a-i*s,S=r*f-o*s,w=n*a-i*c,M=n*f-o*c,j=i*f-o*a,N=u*y-l*m,U=u*b-h*m,C=u*O-v*m,g=l*b-h*y,p=l*O-v*y,d=h*O-v*b,_=R*d-x*p+S*g+w*C-M*U+j*N;return _?(_=1/_,e[0]=(c*d-a*p+f*g)*_,e[1]=(i*p-n*d-o*g)*_,e[2]=(y*j-b*M+O*w)*_,e[3]=(h*M-l*j-v*w)*_,e[4]=(a*C-s*d-f*U)*_,e[5]=(r*d-i*C+o*U)*_,e[6]=(b*S-m*j-O*x)*_,e[7]=(u*j-h*S+v*x)*_,e[8]=(s*p-c*C+f*N)*_,e[9]=(n*C-r*p-o*N)*_,e[10]=(m*M-y*S+O*R)*_,e[11]=(l*S-u*M-v*R)*_,e[12]=(c*U-s*g-a*N)*_,e[13]=(r*g-n*U+i*N)*_,e[14]=(y*x-m*w-b*R)*_,e[15]=(u*w-l*x+h*R)*_,e):null}function Ri(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],v=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,S=f*m-u*v,w=f*y-l*v,M=u*y-l*m,j=t*M-r*w+n*S,N=o*M-s*w+c*S,U=f*x-u*R+l*O,C=v*x-m*R+y*O;return a*j-i*N+b*U-h*C}function yr(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],v=t[10],m=t[11],y=t[12],b=t[13],O=t[14],R=t[15],x=r[0],S=r[1],w=r[2],M=r[3];return e[0]=x*n+S*c+w*l+M*y,e[1]=x*i+S*a+w*h+M*b,e[2]=x*o+S*f+w*v+M*O,e[3]=x*s+S*u+w*m+M*R,x=r[4],S=r[5],w=r[6],M=r[7],e[4]=x*n+S*c+w*l+M*y,e[5]=x*i+S*a+w*h+M*b,e[6]=x*o+S*f+w*v+M*O,e[7]=x*s+S*u+w*m+M*R,x=r[8],S=r[9],w=r[10],M=r[11],e[8]=x*n+S*c+w*l+M*y,e[9]=x*i+S*a+w*h+M*b,e[10]=x*o+S*f+w*v+M*O,e[11]=x*s+S*u+w*m+M*R,x=r[12],S=r[13],w=r[14],M=r[15],e[12]=x*n+S*c+w*l+M*y,e[13]=x*i+S*a+w*h+M*b,e[14]=x*o+S*f+w*v+M*O,e[15]=x*s+S*u+w*m+M*R,e}function Ci(e,t,r){let n=r[0],i=r[1],o=r[2],s,c,a,f,u,l,h,v,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],v=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]=v,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+v*i+O*o+t[15]),e}function Li(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 Di(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,v,m,y,b,O,R,x,S,w,M,j,N,U,C,g,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],v=t[2],m=t[3],y=t[4],b=t[5],O=t[6],R=t[7],x=t[8],S=t[9],w=t[10],M=t[11],j=i*i*u+a,N=o*i*u+s*f,U=s*i*u-o*f,C=i*o*u-s*f,g=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*j+y*N+x*U,e[1]=h*j+b*N+S*U,e[2]=v*j+O*N+w*U,e[3]=m*j+R*N+M*U,e[4]=l*C+y*g+x*p,e[5]=h*C+b*g+S*p,e[6]=v*C+O*g+w*p,e[7]=m*C+R*g+M*p,e[8]=l*d+y*_+x*E,e[9]=h*d+b*_+S*E,e[10]=v*d+O*_+w*E,e[11]=m*d+R*_+M*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Ii(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 Ni(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 ji(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 Fi(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,v=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]=v+y,e[7]=0,e[8]=h+b,e[9]=v-y,e[10]=1-f-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ui(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 ea(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 Gi=ea;function ra(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 zi=ra;function Bi(e,t,r,n){let i,o,s,c,a,f,u,l,h,v,m=t[0],y=t[1],b=t[2],O=n[0],R=n[1],x=n[2],S=r[0],w=r[1],M=r[2];return Math.abs(m-S)<1e-6&&Math.abs(y-w)<1e-6&&Math.abs(b-M)<1e-6?ta(e):(l=m-S,h=y-w,v=b-M,i=1/Math.sqrt(l*l+h*h+v*v),l*=i,h*=i,v*=i,o=R*v-x*h,s=x*l-O*v,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-v*s,f=v*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]=v,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+v*b),e[15]=1,e)}function na(){let e=new _t(4);return _t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function ki(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 lp=function(){let e=na();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 br;(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"})(br||(br={}));var ia=45*Math.PI/180,oa=1,_r=.1,xr=500,sa=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 ca()}static get ZERO(){return aa()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return br}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,v,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]=v,this[13]=m,this[14]=y,this[15]=b,this.check()}setRowMajor(t,r,n,i,o,s,c,a,f,u,l,h,v,m,y,b){return this[0]=t,this[1]=o,this[2]=f,this[3]=v,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(sa)}fromObject(t){return this.check()}fromQuaternion(t){return Fi(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:o,near:s=_r,far:c=xr}=t;return c===1/0?fa(this,r,n,i,o,s):Ui(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 Bi(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:s=_r,far:c=xr}=t;return zi(this,r,n,i,o,s,c),this.check()}orthographic(t){let{fovy:r=ia,aspect:n=oa,focalDistance:i=1,near:o=_r,far:s=xr}=t;Vi(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 Vi(r),Gi(this,r,n,i,o),this.check()}determinant(){return Ri(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 Ai(this,this),this.check()}invert(){return Ti(this,this),this.check()}multiplyLeft(t){return yr(this,t,this),this.check()}multiplyRight(t){return yr(this,this,t),this.check()}rotateX(t){return Ii(this,this,t),this.check()}rotateY(t){return Ni(this,this,t),this.check()}rotateZ(t){return ji(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return Di(this,this,t,r),this.check()}scale(t){return Li(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Ci(this,this,t),this.check()}transform(t,r){return t.length===4?(r=ki(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=yi(r||[-0,-0],t,this);break;case 3:i=Pe(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=_i(r||[-0,-0],t,this);break;case 3:n=Se(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 aa(){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 ca(){return Ce||(Ce=new mt,Object.freeze(Ce)),Ce}function Vi(e){if(e>Math.PI*2)throw Error("expected radians")}function fa(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 Hi=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&&rt(this.indices.usage===X.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},A(e)}();function qi(e,t){if(t instanceof Hi)return t;var r=ua(e,t),n=la(e,t),i=n.attributes,o=n.bufferLayout;return new Hi({topology:t.topology||"triangle-list",bufferLayout:o,vertexCount:t.vertexCount,indices:r,attributes:i})}function ua(e,t){if(t.indices){var r=t.indices.value;return e.createBuffer({usage:X.INDEX,data:r})}}function la(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")}),r.push({name:f,format:"float32x".concat(a.size)})}var u=t._calculateVertexCount(t.attributes,t.indices);return{attributes:n,bufferLayout:r,vertexCount:u}}function Wi(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?Wi(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var se=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]},A(e)}();se.defaultProps=xt(xt({},Bt.defaultProps),{},{vs:void 0,fs:void 0});function Or(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ha(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.
|
|
227
|
-
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 ha(e,t){if(e){if(typeof e=="string")return Ki(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 Ki(e,t)}}function Ki(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 Yi(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 Wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yi(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ae=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._pipelineNeedsUpdate="newly created",this._attributeInfos={},this._gpuGeometry=null,this._getModuleUniforms=void 0,this.props=void 0,this.props=Wt(Wt({},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||se.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),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})},t.setGeometry=function(n){var i=n&&qi(this.device,n);return this.setTopology(i.topology||"triangle-list"),this.bufferLayout=Xi(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?Xi(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){re(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=this._getModuleUniforms(n),o=Object.keys(i).filter(function(u){var l=i[u];return!Mt(l)&&typeof l!="number"&&typeof l!="boolean"}),s={},c=Or(o),a;try{for(c.s();!(a=c.n()).done;){var f=a.value;s[f]=i[f],delete i[f]}}catch(u){c.e(u)}finally{c.f()}Object.assign(this.uniforms,i),Object.assign(this.bindings,s)},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&&K.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],v=l[1],m=i.bufferLayout.find(function(w){return w.name===h});if(!m)return"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=Or(y),R;try{for(O.s();!(R=O.n()).done;){var x=R.value,S=i._attributeInfos[x];S&&(i.vertexArray.setBuffer(S.location,v),b=!0)}}catch(w){O.e(w)}finally{O.f()}b||K.warn("Model(".concat(i.id,'): Ignoring buffer "').concat(v.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):K.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&&K.log(1,"Model ".concat(this.id,': Recreating pipeline because "').concat(this._pipelineNeedsUpdate,'".'))(),this._pipelineNeedsUpdate=!1,this.pipeline=this.device.createRenderPipeline(Wt(Wt({},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=Qe(this.pipeline.shaderLayout,this.bufferLayout)),this.pipeline},A(e)}();ae.defaultProps=Wt(Wt({},Bt.defaultProps),{},{vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:{},geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},pipelineFactory:void 0,shaderAssembler:we.getDefaultShaderAssembler()});function Xi(e,t){var r=ne(e),n=Or(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}function $i(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 Zi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$i(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$i(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ji=function(){e.isSupported=function(n){return!1};function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T(this,e),this.device=void 0,this.gl=void 0,this.elementCount=0,this.elementIDBuffer=null}var t=e.prototype;return t.destroy=function(){},t.delete=function(){this.destroy()},t.run=function(n){var i=n||{},o=i.clearRenderTarget,s=o===void 0?!0:o,c=this._updateDrawOptions(n);s&&c.framebuffer},t.swap=function(){},t.getBuffer=function(n){return null},t.getData=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}},t.getFramebuffer=function(){return null},t.update=function(n){},t._updateModelProps=function(n){var i=Zi({},n);return i},t._buildResourceTransforms=function(n){},t._updateDrawOptions=function(n){var i=Zi({},n);return i},A(e)}();var Qi=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.uniforms);i<o.length;i++){var s=B(o[i],2),c=s[0],a=s[1].format;n[c]=a}this.uniformBufferLayout=new tr(n),this.useUniformBuffers&&(this.uniformBuffer=this.device.createBuffer({usage:X.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){pa(this.uniforms[n],i)||(this.uniforms[n]=i,this.modifiedUniforms[n]=!0,this.modified=!0)},A(e)}();function pa(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16;if(e!==t)return!1;var n=Mt(e);if(!n)return!1;var i=Mt(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 to(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 da(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?to(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):to(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],v=l[1],m=ArrayBuffer.isView(v)?{value:v}:v;rt(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"?(rt(!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?da({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 rt(Number.isFinite(o)),o},A(e)}();var eo;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 no(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){L(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 ma(e){var t=ga();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function ga(){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 va=mn(eo||(eo=$([`attribute vec2 aClipSpacePosition;
|
|
226
|
+
`),r}function li(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 hi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?li(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):li(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function di(e,t){if(!t.vs)throw new Error("no vertex shader");var r=pi(e,t.vs),n;return t.fs&&(n=pi(e,t.fs)),hi(hi({},t),{},{vs:r,fs:n})}function pi(e,t){if(typeof t=="string")return t;switch(e.type){case"webgpu":if(t!=null&&t.wgsl)return t.wgsl;throw new Error("WebGPU does not support GLSL shaders");default:if(t!=null&&t.glsl)return t.glsl;throw new Error("WebGL does not support WGSL shaders")}}function mi(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 gi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mi(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var we=function(){function e(){T(this,e),this._hookFunctions=[],this._defaultModules=[]}e.getDefaultShaderAssembler=function(){return e.defaultShaderAssembler=e.defaultShaderAssembler||new e,e.defaultShaderAssembler};var t=e.prototype;return t.addDefaultModule=function(n){this._defaultModules.find(function(i){return i.name===(typeof n=="string"?n:n.name)})||this._defaultModules.push(n)},t.removeDefaultModule=function(n){var i=typeof n=="string"?n:n.name;this._defaultModules=this._defaultModules.filter(function(o){return o.name!==i})},t.addShaderHook=function(n,i){i&&(n=Object.assign(i,{hook:n})),this._hookFunctions.push(n)},t.assembleShaders=function(n,i){var o=this._getModuleList(i.modules),s=this._hookFunctions,c=di(n,i),a=ui(n,gi(gi({},c),{},{modules:o,hookFunctions:s}));return a},t._getModuleList=function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=new Array(this._defaultModules.length+n.length),o={},s=0,c=0,a=this._defaultModules.length;c<a;++c){var f=this._defaultModules[c],u=f.name;i[s++]=f,o[u]=!0}for(var l=0,h=n.length;l<h;++l){var v=n[l],m=v.name;o[m]||(i[s++]=v,o[m]=!0)}return i.length=s,i},A(e)}();we.defaultShaderAssembler=void 0;var zh=1/Math.PI*180,kh=1/180*Math.PI,Xs={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Xs}};var et=globalThis.mathgl.config;function vi(e,{precision:t=et.precision}={}){return e=$s(e),"".concat(parseFloat(e.toPrecision(t)))}function Vt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gr(e,t,r){let n=et.EPSILON;r&&(et.EPSILON=r);try{if(e===t)return!0;if(Vt(e)&&Vt(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!gr(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)<=et.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{et.EPSILON=n}}function $s(e){return Math.round(e/et.EPSILON)*et.EPSILON}function Zs(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 Ht=class extends Zs(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:Vt(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(et)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+vi(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(!gr(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(et.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 Js(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(et.debug&&!Js(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function vr(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var Me=class extends Ht{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 vr(t>=0&&t<this.ELEMENTS,"index is out of range"),it(this[t])}setComponent(t,r){return vr(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 Qh=Math.PI/180;function Qs(){let e=new _t(2);return _t!=Float32Array&&(e[0]=0,e[1]=0),e}function xi(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 tp=function(){let e=Qs();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 bi(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 Se(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 Oi(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 ta(){let e=new _t(3);return _t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function ea(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function wi(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 Pe(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 Ei(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 Mi(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,v=i*h-o*l,m=o*u-n*h,y=n*l-i*u,b=s*2;return u*=b,l*=b,h*=b,v*=2,m*=2,y*=2,e[0]=c+u+v,e[1]=a+l+m,e[2]=f+h+y,e}function Si(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 Pi(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 Ai(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 Ti(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&&ea(e,t)/a;return Math.acos(Math.min(Math.max(f,-1),1))}var np=function(){let e=ta();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 _r=[0,0,0],Ae,ot=class extends Me{static get ZERO(){return Ae||(Ae=new ot(0,0,0),Object.freeze(Ae)),Ae}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Vt(t)?this.copy(t):(et.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 et.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 Ti(this,t)}cross(t){return wi(this,this,t),this.check()}rotateX({radians:t,origin:r=_r}){return Si(this,this,r,t),this.check()}rotateY({radians:t,origin:r=_r}){return Pi(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=_r}){return Ai(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Pe(this,this,t),this.check()}transformAsVector(t){return Se(this,this,t),this.check()}transformByMatrix3(t){return Ei(this,this,t),this.check()}transformByMatrix2(t){return Oi(this,this,t),this.check()}transformByQuaternion(t){return Mi(this,this,t),this.check()}};var Te=class extends Ht{toString(){let t="[";if(et.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 ra(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 Ri(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 Ci(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],v=t[11],m=t[12],y=t[13],b=t[14],O=t[15],R=r*c-n*s,x=r*a-i*s,S=r*f-o*s,w=n*a-i*c,M=n*f-o*c,j=i*f-o*a,N=u*y-l*m,U=u*b-h*m,C=u*O-v*m,g=l*b-h*y,p=l*O-v*y,d=h*O-v*b,_=R*d-x*p+S*g+w*C-M*U+j*N;return _?(_=1/_,e[0]=(c*d-a*p+f*g)*_,e[1]=(i*p-n*d-o*g)*_,e[2]=(y*j-b*M+O*w)*_,e[3]=(h*M-l*j-v*w)*_,e[4]=(a*C-s*d-f*U)*_,e[5]=(r*d-i*C+o*U)*_,e[6]=(b*S-m*j-O*x)*_,e[7]=(u*j-h*S+v*x)*_,e[8]=(s*p-c*C+f*N)*_,e[9]=(n*C-r*p-o*N)*_,e[10]=(m*M-y*S+O*R)*_,e[11]=(l*S-u*M-v*R)*_,e[12]=(c*U-s*g-a*N)*_,e[13]=(r*g-n*U+i*N)*_,e[14]=(y*x-m*w-b*R)*_,e[15]=(u*w-l*x+h*R)*_,e):null}function Li(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],v=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,S=f*m-u*v,w=f*y-l*v,M=u*y-l*m,j=t*M-r*w+n*S,N=o*M-s*w+c*S,U=f*x-u*R+l*O,C=v*x-m*R+y*O;return a*j-i*N+b*U-h*C}function xr(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],v=t[10],m=t[11],y=t[12],b=t[13],O=t[14],R=t[15],x=r[0],S=r[1],w=r[2],M=r[3];return e[0]=x*n+S*c+w*l+M*y,e[1]=x*i+S*a+w*h+M*b,e[2]=x*o+S*f+w*v+M*O,e[3]=x*s+S*u+w*m+M*R,x=r[4],S=r[5],w=r[6],M=r[7],e[4]=x*n+S*c+w*l+M*y,e[5]=x*i+S*a+w*h+M*b,e[6]=x*o+S*f+w*v+M*O,e[7]=x*s+S*u+w*m+M*R,x=r[8],S=r[9],w=r[10],M=r[11],e[8]=x*n+S*c+w*l+M*y,e[9]=x*i+S*a+w*h+M*b,e[10]=x*o+S*f+w*v+M*O,e[11]=x*s+S*u+w*m+M*R,x=r[12],S=r[13],w=r[14],M=r[15],e[12]=x*n+S*c+w*l+M*y,e[13]=x*i+S*a+w*h+M*b,e[14]=x*o+S*f+w*v+M*O,e[15]=x*s+S*u+w*m+M*R,e}function Di(e,t,r){let n=r[0],i=r[1],o=r[2],s,c,a,f,u,l,h,v,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],v=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]=v,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+v*i+O*o+t[15]),e}function Ii(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 Ni(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,v,m,y,b,O,R,x,S,w,M,j,N,U,C,g,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],v=t[2],m=t[3],y=t[4],b=t[5],O=t[6],R=t[7],x=t[8],S=t[9],w=t[10],M=t[11],j=i*i*u+a,N=o*i*u+s*f,U=s*i*u-o*f,C=i*o*u-s*f,g=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*j+y*N+x*U,e[1]=h*j+b*N+S*U,e[2]=v*j+O*N+w*U,e[3]=m*j+R*N+M*U,e[4]=l*C+y*g+x*p,e[5]=h*C+b*g+S*p,e[6]=v*C+O*g+w*p,e[7]=m*C+R*g+M*p,e[8]=l*d+y*_+x*E,e[9]=h*d+b*_+S*E,e[10]=v*d+O*_+w*E,e[11]=m*d+R*_+M*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function ji(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 Fi(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 Ui(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 Gi(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,v=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]=v+y,e[7]=0,e[8]=h+b,e[9]=v-y,e[10]=1-f-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Bi(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 na(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 zi=na;function ia(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 ki=ia;function Vi(e,t,r,n){let i,o,s,c,a,f,u,l,h,v,m=t[0],y=t[1],b=t[2],O=n[0],R=n[1],x=n[2],S=r[0],w=r[1],M=r[2];return Math.abs(m-S)<1e-6&&Math.abs(y-w)<1e-6&&Math.abs(b-M)<1e-6?ra(e):(l=m-S,h=y-w,v=b-M,i=1/Math.sqrt(l*l+h*h+v*v),l*=i,h*=i,v*=i,o=R*v-x*h,s=x*l-O*v,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-v*s,f=v*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]=v,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+v*b),e[15]=1,e)}function oa(){let e=new _t(4);return _t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Hi(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 gp=function(){let e=oa();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 wr;(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"})(wr||(wr={}));var sa=45*Math.PI/180,aa=1,br=.1,Or=500,ca=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 ua()}static get ZERO(){return fa()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return wr}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,v,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]=v,this[13]=m,this[14]=y,this[15]=b,this.check()}setRowMajor(t,r,n,i,o,s,c,a,f,u,l,h,v,m,y,b){return this[0]=t,this[1]=o,this[2]=f,this[3]=v,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(ca)}fromObject(t){return this.check()}fromQuaternion(t){return Gi(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:o,near:s=br,far:c=Or}=t;return c===1/0?la(this,r,n,i,o,s):Bi(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 Vi(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:s=br,far:c=Or}=t;return ki(this,r,n,i,o,s,c),this.check()}orthographic(t){let{fovy:r=sa,aspect:n=aa,focalDistance:i=1,near:o=br,far:s=Or}=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),zi(this,r,n,i,o),this.check()}determinant(){return Li(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 Ri(this,this),this.check()}invert(){return Ci(this,this),this.check()}multiplyLeft(t){return xr(this,t,this),this.check()}multiplyRight(t){return xr(this,this,t),this.check()}rotateX(t){return ji(this,this,t),this.check()}rotateY(t){return Fi(this,this,t),this.check()}rotateZ(t){return Ui(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return Ni(this,this,t,r),this.check()}scale(t){return Ii(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Di(this,this,t),this.check()}transform(t,r){return t.length===4?(r=Hi(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=xi(r||[-0,-0],t,this);break;case 3:i=Pe(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=bi(r||[-0,-0],t,this);break;case 3:n=Se(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 fa(){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 ua(){return Ce||(Ce=new mt,Object.freeze(Ce)),Ce}function qi(e){if(e>Math.PI*2)throw Error("expected radians")}function la(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&&rt(this.indices.usage===X.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},A(e)}();function Wi(e,t){if(t instanceof Le)return t;var r=ha(e,t),n=pa(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 ha(e,t){if(t.indices){var r=t.indices.value;return e.createBuffer({usage:X.INDEX,data:r})}}function pa(e,t){for(var r=[],n={},i=0,o=Object.entries(t.attributes);i<o.length;i++){var s=z(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")}),r.push({name:f,format:"float32x".concat(a.size)})}var u=t._calculateVertexCount(t.attributes,t.indices);return{attributes:n,bufferLayout:r,vertexCount:u}}function Ki(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?Ki(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ki(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var se=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]},A(e)}();se.defaultProps=xt(xt({},zt.defaultProps),{},{vs:void 0,fs:void 0});function Zi(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=da(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.
|
|
227
|
+
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 da(e,t){if(e){if(typeof e=="string")return Yi(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 Yi(e,t)}}function Yi(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 Xi(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 Wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xi(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ae=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._pipelineNeedsUpdate="newly created",this._attributeInfos={},this._gpuGeometry=null,this._getModuleUniforms=void 0,this.props=void 0,this.props=Wt(Wt({},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||se.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),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})},t.setGeometry=function(n){var i=n&&Wi(this.device,n);return this.setTopology(i.topology||"triangle-list"),this.bufferLayout=$i(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?$i(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){re(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=rr(this._getModuleUniforms(n)),o=i.bindings,s=i.uniforms;Object.assign(this.bindings,o),Object.assign(this.uniforms,s)},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&&K.warn("Model:".concat(this.id," setAttributes() - indexBuffer should be set using setIndexBuffer()"));for(var o=function(){var u,l=z(c[s],2),h=l[0],v=l[1],m=i.bufferLayout.find(function(w){return w.name===h});if(!m)return"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=Zi(y),R;try{for(O.s();!(R=O.n()).done;){var x=R.value,S=i._attributeInfos[x];S&&(i.vertexArray.setBuffer(S.location,v),b=!0)}}catch(w){O.e(w)}finally{O.f()}b||K.warn("Model(".concat(i.id,'): Ignoring buffer "').concat(v.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=z(o[i],2),c=s[0],a=s[1],f=this._attributeInfos[c];f?this.vertexArray.setConstant(f.location,a):K.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&&K.log(1,"Model ".concat(this.id,': Recreating pipeline because "').concat(this._pipelineNeedsUpdate,'".'))(),this._pipelineNeedsUpdate=!1,this.pipeline=this.device.createRenderPipeline(Wt(Wt({},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},A(e)}();ae.defaultProps=Wt(Wt({},zt.defaultProps),{},{vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:{},geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},pipelineFactory:void 0,shaderAssembler:we.getDefaultShaderAssembler()});function $i(e,t){var r=ne(e),n=Zi(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}function Ji(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 Qi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ji(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ji(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var to=function(){e.isSupported=function(n){return!1};function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};T(this,e),this.device=void 0,this.gl=void 0,this.elementCount=0,this.elementIDBuffer=null}var t=e.prototype;return t.destroy=function(){},t.delete=function(){this.destroy()},t.run=function(n){var i=n||{},o=i.clearRenderTarget,s=o===void 0?!0:o,c=this._updateDrawOptions(n);s&&c.framebuffer},t.swap=function(){},t.getBuffer=function(n){return null},t.getData=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}},t.getFramebuffer=function(){return null},t.update=function(n){},t._updateModelProps=function(n){var i=Qi({},n);return i},t._buildResourceTransforms=function(n){},t._updateDrawOptions=function(n){var i=Qi({},n);return i},A(e)}();var eo=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=z(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:X.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=z(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){ma(this.uniforms[n],i)||(this.uniforms[n]=i,this.modifiedUniforms[n]=!0,this.modified=!0)},A(e)}();function ma(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16;if(e!==t)return!1;var n=Mt(e);if(!n)return!1;var i=Mt(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 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 ga(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){L(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}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=z(u[f],2),h=l[0],v=l[1],m=ArrayBuffer.isView(v)?{value:v}:v;rt(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"?(rt(!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?ga({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 rt(Number.isFinite(o)),o},A(e)}();var no;function io(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 oo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?io(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):io(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function va(e){var t=ya();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function ya(){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 _a=vn(no||(no=$([`attribute vec2 aClipSpacePosition;
|
|
228
228
|
attribute vec2 aTexCoord;
|
|
229
229
|
attribute vec2 aCoordinate;
|
|
230
230
|
|
|
@@ -253,8 +253,8 @@ void main(void) {
|
|
|
253
253
|
coordinate = aCoordinate;
|
|
254
254
|
uv = aTexCoord;
|
|
255
255
|
}
|
|
256
|
-
`]))),
|
|
257
|
-
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 _a(e,t){if(e){if(typeof e=="string")return so(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 so(e,t)}}function so(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 xa(e){var t=ba();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function ba(){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 ao=function(e){q(r,e);var t=xa(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 K.assert(a.every(function(f){return f instanceof It}),"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],v=new ot(l).add(h).divide([2,2,2]);a.transformAsPoint(v,v);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(v),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(F(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,ne(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=ya(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(v){u.e(v)}finally{u.f()}},A(r)}(It);function Oa(e){var t=wa();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function wa(){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){q(r,e);var t=Oa(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)},A(r)}(It);function fo(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 Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fo(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ea(e){var t=Ma();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function Ma(){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 Sa={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Yt=function(e){q(r,e);var t=Ea(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=Pa(n),c=s.indices,a=s.attributes;return t.call(this,Er(Er({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:Er({POSITION:{size:3,value:a.POSITION},NORMAL:{size:3,value:a.NORMAL},TEXCOORD_0:{size:2,value:a.TEXCOORD_0}},n.attributes)}))}return A(r)}(st);function Pa(){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,v=e.topCap,m=v===void 0?!1:v,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),S=Math.sin,w=Math.cos,M=Math.PI,j=w(x),N=S(x),U=m?-2:0,C=u+(b?2:0),g=a+1,p=new Uint16Array(a*(u+O)*6),d=Sa[h],_=new Float32Array(R*3),E=new Float32Array(R*3),P=new Float32Array(R*2),D=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<g;pt++){var ft=S(pt*M*2/a),Z=w(pt*M*2/a);_[D+d[0]]=ft*V,_[D+d[1]]=k,_[D+d[2]]=Z*V,E[D+d[0]]=I<0||I>u?0:ft*j,E[D+d[1]]=I<0?-1:I>u?1:N,E[D+d[2]]=I<0||I>u?0:Z*j,P[z+0]=pt/a,P[z+1]=G,z+=2,D+=3}}for(var J=0;J<u+O;J++)for(var Q=0;Q<a;Q++){var at=(J*a+Q)*6;p[at+0]=g*(J+0)+0+Q,p[at+1]=g*(J+0)+1+Q,p[at+2]=g*(J+1)+1+Q,p[at+3]=g*(J+0)+0+Q,p[at+4]=g*(J+1)+1+Q,p[at+5]=g*(J+1)+0+Q}return{indices:p,attributes:{POSITION:_,NORMAL:E,TEXCOORD_0:P}}}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){L(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=Ta();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function Ta(){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 ho=function(e){q(r,e);var t=Aa(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,lo(lo({},n),{},{id:o,topRadius:0,topCap:Boolean(f),bottomCap:Boolean(f),bottomRadius:c}))}return A(r)}(Yt);function po(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 At(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?po(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):po(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ra(e){var t=Ca();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function Ca(){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){q(r,e);var t=Ra(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?At(At({},n),{},{id:o,topology:"triangle-list",indices:{size:1,value:La},attributes:At(At({},Ga),n.attributes)}):At(At({},n),{},{id:o,topology:"triangle-list",indices:void 0,attributes:At(At({},za),n.attributes)}))}return A(r)}(st),La=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]),Da=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]),Ia=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]),Na=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]),ja=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]),Fa=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]),Ua=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]),Ga={POSITION:{size:3,value:Da},NORMAL:{size:3,value:Ia},TEXCOORD_0:{size:2,value:Na}},za={POSITION:{size:4,value:ja},TEXCOORD_0:{size:2,value:Fa},COLOR_0:{size:3,value:Ua}};function go(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 vo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?go(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):go(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ba(e){var t=ka();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function ka(){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 yo=function(e){q(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("cylinder-geometry"):i,s=n.radius,c=s===void 0?1:s;return t.call(this,vo(vo({},n),{},{id:o,bottomRadius:c,topRadius:c}))}return A(r)}(Yt);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 Le(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){L(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 Va(e){var t=Ha();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function Ha(){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 qa=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],Wa=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],xo=function(e){q(r,e);var t=Va(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=Ka(n),c=s.indices,a=s.attributes;return t.call(this,Le(Le({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:Le(Le({},a),n.attributes)}))}return A(r)}(st);function Ka(e){var t=e.iterations,r=t===void 0?0:t,n=Math.PI,i=n*2,o=[].concat(qa),s=[].concat(Wa);o.push(),s.push();for(var c=function(){var Ne={};return function(bt,Ot){bt*=3,Ot*=3;var Ao=bt<Ot?bt:Ot,To=bt>Ot?bt:Ot,je="".concat(Ao,"|").concat(To);if(je in Ne)return Ne[je];var Ro=o[bt],Co=o[bt+1],Lo=o[bt+2],Do=o[Ot],Io=o[Ot+1],No=o[Ot+2],fe=(Ro+Do)/2,ue=(Co+Io)/2,le=(Lo+No)/2,Fe=Math.sqrt(fe*fe+ue*ue+le*le);return fe/=Fe,ue/=Fe,le/=Fe,o.push(fe,ue,le),Ne[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]),v=c(s[u+2],s[u+0]);f.push(v,s[u+0],l,l,s[u+1],h,h,s[u+2],v,l,h,v)}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],S=s[O+2],w=R*3,M=x*3,j=S*3,N=R*2,U=x*2,C=S*2,g=o[w+0],p=o[w+1],d=o[w+2],_=Math.acos(d/Math.sqrt(g*g+p*p+d*d)),E=Math.atan2(p,g)+n,P=_/n,D=1-E/i,z=o[M+0],I=o[M+1],G=o[M+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,Z=o[j+0],J=o[j+1],Q=o[j+2],at=Math.acos(Q/Math.sqrt(Z*Z+J*J+Q*Q)),Xt=Math.atan2(J,Z)+n,Mr=at/n,ce=1-Xt/i,So=[Z-z,J-I,Q-G],Po=[g-z,p-I,d-G],ut=new ot(So).cross(Po).normalize(),Y=void 0;(D===0||ft===0||ce===0)&&(D===0||D>.5)&&(ft===0||ft>.5)&&(ce===0||ce>.5)&&(o.push(o[w+0],o[w+1],o[w+2]),Y=o.length/3-1,s.push(Y),y[Y*2+0]=1,y[Y*2+1]=P,m[Y*3+0]=ut.x,m[Y*3+1]=ut.y,m[Y*3+2]=ut.z,o.push(o[M+0],o[M+1],o[M+2]),Y=o.length/3-1,s.push(Y),y[Y*2+0]=1,y[Y*2+1]=pt,m[Y*3+0]=ut.x,m[Y*3+1]=ut.y,m[Y*3+2]=ut.z,o.push(o[j+0],o[j+1],o[j+2]),Y=o.length/3-1,s.push(Y),y[Y*2+0]=1,y[Y*2+1]=Mr,m[Y*3+0]=ut.x,m[Y*3+1]=ut.y,m[Y*3+2]=ut.z),m[w+0]=m[M+0]=m[j+0]=ut.x,m[w+1]=m[M+1]=m[j+1]=ut.y,m[w+2]=m[M+2]=m[j+2]=ut.z,y[N+0]=D,y[N+1]=P,y[U+0]=ft,y[U+1]=pt,y[C+0]=ce,y[C+1]=Mr}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 bo(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],v=0;v<f;v++)u[l*f+v]=a[h*f+v];i[o]={size:f,value:u}}}return{attributes:Object.assign({},r,i)}}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 De(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){L(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 Ya(e){var t=Xa();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function Xa(){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){q(r,e);var t=Ya(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=$a(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 A(r)}(st);function $a(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,v=e["n".concat(f[1])]||1,m=(h+1)*(v+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,S=0;S<=v;S++)for(var w=0;w<=h;w++){var M=w/h,j=S/v;switch(O[R+0]=s?1-M:M,O[R+1]=j,r){case"x,y":y[x+0]=u*M-u*.5,y[x+1]=l*j-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*M-u*.5,y[x+1]=i,y[x+2]=l*j-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*M-u*.5,y[x+2]=l*j-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*v*6),C=0;C<v;C++)for(var g=0;g<h;g++){var p=(C*h+g)*6;U[p+0]=(C+0)*N+g,U[p+1]=(C+1)*N+g,U[p+2]=(C+0)*N+g+1,U[p+3]=(C+1)*N+g,U[p+4]=(C+1)*N+g+1,U[p+5]=(C+0)*N+g+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?bo(d):d}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 Ie(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){L(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 Za(e){var t=Ja();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(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 Mo=function(e){q(r,e);var t=Za(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=Qa(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 A(r)}(st);function Qa(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,Z,J,Q,at){return e.radius||1},v=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 S=x/i,w=R/r,M=x+R*(i+1),j=M*2,N=M*3,U=u*S,C=c*w,g=Math.sin(U),p=Math.cos(U),d=Math.sin(C),_=Math.cos(C),E=p*d,P=_,D=g*d,z=h(E,P,D,S,w);v[N+0]=z*E,v[N+1]=z*P,v[N+2]=z*D,m[N+0]=E,m[N+1]=P,m[N+2]=D,y[j+0]=S,y[j+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:v},NORMAL:{size:3,value:m},TEXCOORD_0:{size:2,value:y}}}}return ko(tc);})();
|
|
256
|
+
`]))),so=[-1,-1,1,-1,-1,1,1,1],ao=function(e){q(r,e);var t=va(r);function r(n,i){T(this,r);var o=so.map(function(s){return s===-1?0:s});return t.call(this,n,oo(oo({},i),{},{vs:_a,vertexCount:4,geometry:new st({topology:"triangle-strip",vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(so)},aTexCoord:{size:2,value:new Float32Array(o)},aCoordinate:{size:2,value:new Float32Array(o)}}})}))}return A(r)}(ae);var It=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};T(this,e),this.id=void 0,this.matrix=new mt,this.display=!0,this.position=new ot,this.rotation=new ot,this.scale=new ot(1,1,1),this.userData={},this.props={};var n=r.id;this.id=n||H(this.constructor.name),this._setScenegraphNodeProps(r)}var t=e.prototype;return t.getBounds=function(){return null},t.destroy=function(){},t.delete=function(){this.destroy()},t.setProps=function(n){return this._setScenegraphNodeProps(n),this},t.toString=function(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")},t.setPosition=function(n){return rt(n.length===3,"setPosition requires vector argument"),this.position=n,this},t.setRotation=function(n){return rt(n.length===3,"setRotation requires vector argument"),this.rotation=n,this},t.setScale=function(n){return rt(n.length===3,"setScale requires vector argument"),this.scale=n,this},t.setMatrix=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i?this.matrix.copy(n):this.matrix=n},t.setMatrixComponents=function(n){var i=n.position,o=n.rotation,s=n.scale,c=n.update,a=c===void 0?!0:c;return i&&this.setPosition(i),o&&this.setRotation(o),s&&this.setScale(s),a&&this.updateMatrix(),this},t.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},t.update=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.position,o=n.rotation,s=n.scale;return i&&this.setPosition(i),o&&this.setRotation(o),s&&this.setScale(s),this.updateMatrix(),this},t.getCoordinateUniforms=function(n,i){rt(n),i=i||this.matrix;var o=new mt(n).multiplyRight(i),s=o.invert(),c=s.transpose();return{viewMatrix:n,modelMatrix:i,objectMatrix:i,worldMatrix:o,worldInverseMatrix:s,worldInverseTransposeMatrix:c}},t._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)},A(e)}();function Er(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=F(e),e!==null););return e}function Kt(){return typeof Reflect<"u"&&Reflect.get?Kt=Reflect.get.bind():Kt=function(t,r,n){var i=Er(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Kt.apply(this,arguments)}function xa(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ba(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.
|
|
257
|
+
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 ba(e,t){if(e){if(typeof e=="string")return co(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 co(e,t)}}function co(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 Oa(e){var t=wa();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function wa(){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 fo=function(e){q(r,e);var t=Oa(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 K.assert(a.every(function(f){return f instanceof It}),"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=z(f,2),l=u[0],h=u[1],v=new ot(l).add(h).divide([2,2,2]);a.transformAsPoint(v,v);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(v),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(F(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,ne(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=xa(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(v){u.e(v)}finally{u.f()}},A(r)}(It);function Ea(e){var t=Ma();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function Ma(){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 uo=function(e){q(r,e);var t=Ea(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)},A(r)}(It);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 Mr(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){L(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 Sa(e){var t=Pa();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(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 Aa={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Yt=function(e){q(r,e);var t=Sa(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=Ta(n),c=s.indices,a=s.attributes;return t.call(this,Mr(Mr({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:Mr({POSITION:{size:3,value:a.POSITION},NORMAL:{size:3,value:a.NORMAL},TEXCOORD_0:{size:2,value:a.TEXCOORD_0}},n.attributes)}))}return A(r)}(st);function Ta(){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,v=e.topCap,m=v===void 0?!1:v,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),S=Math.sin,w=Math.cos,M=Math.PI,j=w(x),N=S(x),U=m?-2:0,C=u+(b?2:0),g=a+1,p=new Uint16Array(a*(u+O)*6),d=Aa[h],_=new Float32Array(R*3),E=new Float32Array(R*3),P=new Float32Array(R*2),D=0,B=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<g;pt++){var ft=S(pt*M*2/a),Z=w(pt*M*2/a);_[D+d[0]]=ft*V,_[D+d[1]]=k,_[D+d[2]]=Z*V,E[D+d[0]]=I<0||I>u?0:ft*j,E[D+d[1]]=I<0?-1:I>u?1:N,E[D+d[2]]=I<0||I>u?0:Z*j,P[B+0]=pt/a,P[B+1]=G,B+=2,D+=3}}for(var J=0;J<u+O;J++)for(var Q=0;Q<a;Q++){var at=(J*a+Q)*6;p[at+0]=g*(J+0)+0+Q,p[at+1]=g*(J+0)+1+Q,p[at+2]=g*(J+1)+1+Q,p[at+3]=g*(J+0)+0+Q,p[at+4]=g*(J+1)+1+Q,p[at+5]=g*(J+1)+0+Q}return{indices:p,attributes:{POSITION:_,NORMAL:E,TEXCOORD_0:P}}}function ho(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 po(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ho(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ho(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ra(e){var t=Ca();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function Ca(){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){q(r,e);var t=Ra(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,po(po({},n),{},{id:o,topRadius:0,topCap:Boolean(f),bottomCap:Boolean(f),bottomRadius:c}))}return A(r)}(Yt);function go(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 At(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?go(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):go(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function La(e){var t=Da();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(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){q(r,e);var t=La(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?At(At({},n),{},{id:o,topology:"triangle-list",indices:{size:1,value:Ia},attributes:At(At({},za),n.attributes)}):At(At({},n),{},{id:o,topology:"triangle-list",indices:void 0,attributes:At(At({},ka),n.attributes)}))}return A(r)}(st),Ia=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]),Na=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]),ja=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]),Fa=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]),Ua=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]),Ga=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]),Ba=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:Na},NORMAL:{size:3,value:ja},TEXCOORD_0:{size:2,value:Fa}},ka={POSITION:{size:4,value:Ua},TEXCOORD_0:{size:2,value:Ga},COLOR_0:{size:3,value:Ba}};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 _o(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){L(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 Va(e){var t=Ha();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function Ha(){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 xo=function(e){q(r,e);var t=Va(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,_o(_o({},n),{},{id:o,bottomRadius:c,topRadius:c}))}return A(r)}(Yt);function bo(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?bo(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qa(e){var t=Wa();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(this,i)}}function Wa(){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 Ka=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],Ya=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],Oo=function(e){q(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("ico-sphere-geometry"):i,s=Xa(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 A(r)}(st);function Xa(e){var t=e.iterations,r=t===void 0?0:t,n=Math.PI,i=n*2,o=[].concat(Ka),s=[].concat(Ya);o.push(),s.push();for(var c=function(){var je={};return function(bt,Ot){bt*=3,Ot*=3;var Ro=bt<Ot?bt:Ot,Co=bt>Ot?bt:Ot,Fe="".concat(Ro,"|").concat(Co);if(Fe in je)return je[Fe];var Lo=o[bt],Do=o[bt+1],Io=o[bt+2],No=o[Ot],jo=o[Ot+1],Fo=o[Ot+2],fe=(Lo+No)/2,ue=(Do+jo)/2,le=(Io+Fo)/2,Ue=Math.sqrt(fe*fe+ue*ue+le*le);return fe/=Ue,ue/=Ue,le/=Ue,o.push(fe,ue,le),je[Fe]=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]),v=c(s[u+2],s[u+0]);f.push(v,s[u+0],l,l,s[u+1],h,h,s[u+2],v,l,h,v)}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],S=s[O+2],w=R*3,M=x*3,j=S*3,N=R*2,U=x*2,C=S*2,g=o[w+0],p=o[w+1],d=o[w+2],_=Math.acos(d/Math.sqrt(g*g+p*p+d*d)),E=Math.atan2(p,g)+n,P=_/n,D=1-E/i,B=o[M+0],I=o[M+1],G=o[M+2],k=Math.acos(G/Math.sqrt(B*B+I*I+G*G)),V=Math.atan2(I,B)+n,pt=k/n,ft=1-V/i,Z=o[j+0],J=o[j+1],Q=o[j+2],at=Math.acos(Q/Math.sqrt(Z*Z+J*J+Q*Q)),Xt=Math.atan2(J,Z)+n,Sr=at/n,ce=1-Xt/i,Ao=[Z-B,J-I,Q-G],To=[g-B,p-I,d-G],ut=new ot(Ao).cross(To).normalize(),Y=void 0;(D===0||ft===0||ce===0)&&(D===0||D>.5)&&(ft===0||ft>.5)&&(ce===0||ce>.5)&&(o.push(o[w+0],o[w+1],o[w+2]),Y=o.length/3-1,s.push(Y),y[Y*2+0]=1,y[Y*2+1]=P,m[Y*3+0]=ut.x,m[Y*3+1]=ut.y,m[Y*3+2]=ut.z,o.push(o[M+0],o[M+1],o[M+2]),Y=o.length/3-1,s.push(Y),y[Y*2+0]=1,y[Y*2+1]=pt,m[Y*3+0]=ut.x,m[Y*3+1]=ut.y,m[Y*3+2]=ut.z,o.push(o[j+0],o[j+1],o[j+2]),Y=o.length/3-1,s.push(Y),y[Y*2+0]=1,y[Y*2+1]=Sr,m[Y*3+0]=ut.x,m[Y*3+1]=ut.y,m[Y*3+2]=ut.z),m[w+0]=m[M+0]=m[j+0]=ut.x,m[w+1]=m[M+1]=m[j+1]=ut.y,m[w+2]=m[M+2]=m[j+2]=ut.z,y[N+0]=D,y[N+1]=P,y[U+0]=ft,y[U+1]=pt,y[C+0]=ce,y[C+1]=Sr}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 wo(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],v=0;v<f;v++)u[l*f+v]=a[h*f+v];i[o]={size:f,value:u}}}return{attributes:Object.assign({},r,i)}}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 Ie(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){L(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 $a(e){var t=Za();return function(){var n=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(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 Mo=function(e){q(r,e);var t=$a(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=Ja(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 A(r)}(st);function Ja(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,v=e["n".concat(f[1])]||1,m=(h+1)*(v+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,S=0;S<=v;S++)for(var w=0;w<=h;w++){var M=w/h,j=S/v;switch(O[R+0]=s?1-M:M,O[R+1]=j,r){case"x,y":y[x+0]=u*M-u*.5,y[x+1]=l*j-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*M-u*.5,y[x+1]=i,y[x+2]=l*j-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*M-u*.5,y[x+2]=l*j-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*v*6),C=0;C<v;C++)for(var g=0;g<h;g++){var p=(C*h+g)*6;U[p+0]=(C+0)*N+g,U[p+1]=(C+1)*N+g,U[p+2]=(C+0)*N+g+1,U[p+3]=(C+1)*N+g,U[p+4]=(C+1)*N+g+1,U[p+5]=(C+0)*N+g+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?wo(d):d}function So(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?So(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):So(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=F(e),i;if(t){var o=F(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return W(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 Po=function(e){q(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("sphere-geometry"):i,s=ec(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 A(r)}(st);function ec(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,Z,J,Q,at){return e.radius||1},v=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 S=x/i,w=R/r,M=x+R*(i+1),j=M*2,N=M*3,U=u*S,C=c*w,g=Math.sin(U),p=Math.cos(U),d=Math.sin(C),_=Math.cos(C),E=p*d,P=_,D=g*d,B=h(E,P,D,S,w);v[N+0]=B*E,v[N+1]=B*P,v[N+2]=B*D,m[N+0]=E,m[N+1]=P,m[N+2]=D,y[j+0]=S,y[j+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:v},NORMAL:{size:3,value:m},TEXCOORD_0:{size:2,value:y}}}}return Ho(rc);})();
|
|
258
258
|
/*! Bundled license information:
|
|
259
259
|
|
|
260
260
|
@babel/runtime/helpers/regeneratorRuntime.js:
|