@luma.gl/engine 9.0.0-alpha.35 → 9.0.0-alpha.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation/timeline.d.ts +4 -4
- package/dist/animation/timeline.d.ts.map +1 -1
- package/dist/animation/timeline.js +13 -13
- package/dist/animation/timeline.js.map +1 -1
- package/dist/animation-loop/animation-loop.d.ts +2 -2
- package/dist/animation-loop/animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop.js +5 -6
- package/dist/animation-loop/animation-loop.js.map +1 -1
- package/dist/animation-loop/animation-props.d.ts +1 -2
- package/dist/animation-loop/animation-props.d.ts.map +1 -1
- package/dist/animation-loop/animation-props.js.map +1 -1
- package/dist/dist.dev.js +999 -9127
- package/dist/index.cjs +269 -125
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/clip-space.d.ts +1 -1
- package/dist/lib/clip-space.d.ts.map +1 -1
- package/dist/lib/clip-space.js +1 -2
- package/dist/lib/clip-space.js.map +1 -1
- package/dist/model/model.d.ts +44 -22
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +80 -22
- package/dist/model/model.js.map +1 -1
- package/dist/scenegraph/scenegraph-node.d.ts +5 -5
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-node.js.map +1 -1
- package/dist/shadertools/shader-module-uniforms.d.ts +36 -0
- package/dist/shadertools/shader-module-uniforms.d.ts.map +1 -0
- package/dist/shadertools/shader-module-uniforms.js +87 -0
- package/dist/shadertools/shader-module-uniforms.js.map +1 -0
- package/dist/transform/transform.d.ts +2 -2
- package/dist/transform/transform.d.ts.map +1 -1
- package/dist/transform/transform.js +0 -18
- package/dist/transform/transform.js.map +1 -1
- package/dist.min.js +107 -165
- package/package.json +5 -6
- package/src/.DS_Store +0 -0
- package/src/animation/timeline.ts +13 -13
- package/src/animation-loop/animation-loop.ts +6 -8
- package/src/animation-loop/animation-props.ts +1 -2
- package/src/index.ts +3 -0
- package/src/lib/clip-space.ts +2 -3
- package/src/model/model.ts +169 -63
- package/src/scenegraph/scenegraph-node.ts +5 -5
- package/src/shadertools/shader-module-uniforms.ts +178 -0
- package/src/transform/transform.ts +8 -6
package/dist.min.js
CHANGED
|
@@ -4,23 +4,66 @@
|
|
|
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,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function _u(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}var Eu=1,pu=1,ki=function(){function e(){C(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,a=n.duration,c=a===void 0?Number.POSITIVE_INFINITY:a,f=n.rate,u=f===void 0?1:f,_=n.repeat,E=_===void 0?1:_,p=Eu++,d={time:0,delay:o,duration:c,rate:u,repeat:E};return this._setChannelTime(d,this.time),this.channels.set(p,d),p},t.removeChannel=function(n){this.channels.delete(n);var i=bn(this.animations),o;try{for(i.s();!(o=i.n()).done;){var a=W(o.value,2),c=a[0],f=a[1];f.channel===n&&this.detachAnimation(c)}}catch(u){i.e(u)}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=bn(i),a;try{for(o.s();!(a=o.n()).done;){var c=a.value;this._setChannelTime(c,this.time)}}catch(h){o.e(h)}finally{o.f()}var f=this.animations.values(),u=bn(f),_;try{for(u.s();!(_=u.n()).done;){var E=_.value,p=E.animation,d=E.channel;p.setTime(this.getTime(d))}}catch(h){u.e(h)}finally{u.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=pu++;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,a=n.duration*n.repeat;o>=a?n.time=n.duration*n.rate:(n.time=Math.max(0,o)%n.duration,n.time*=n.rate)},y(e)}();var Yi=function(){function e(r){C(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 a=this.times[this.startIndex],c=this.times[this.endIndex];this.factor=Math.min(Math.max(0,(n-a)/(c-a)),1)},y(e)}();function zi(e,t,r,n,i,o,a){try{var c=e[o](a),f=c.value}catch(u){r(u);return}c.done?t(f):Promise.resolve(f).then(n,i)}function ne(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(f){zi(o,n,i,a,c,"next",f)}function c(f){zi(o,n,i,a,c,"throw",f)}a(void 0)})}}var Cn=De(Me(),1),Ji=function(){function e(r){C(this,e)}var t=e.prototype;return t.onInitialize=function(){var r=ne(Cn.default.mark(function i(o){return Cn.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}(),y(e)}();function l(e,t,r){return t=Gt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var $e=De(Me(),1);function $t(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 ae(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||$t()}var du=globalThis.self||globalThis.window||globalThis.global,St=globalThis.window||globalThis.self||globalThis.global,hu=globalThis.document||{},ut=globalThis.process||{},mu=globalThis.console,eo=globalThis.navigator||{};var Sr=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",qh=ae();var Pn=globalThis;function qt(e){if(!e&&!ae())return"Node";if($t(e))return"Electron";let t=e||eo.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Pn.chrome?"Chrome":Pn.safari?"Safari":Pn.mozInnerScreenX?"Firefox":"Unknown"}function Ru(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Or=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=Ru(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 to(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 ro(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 br(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,a=e.height*r,c=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),c]}var yr;(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"})(yr||(yr={}));var Au=10;function no(e){return typeof e!="string"?e:(e=e.toUpperCase(),yr[e]||yr.WHITE)}function io(e,t,r){if(!ae&&typeof e=="string"){if(t){let n=no(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=no(r);e="\x1B[".concat(n+Au,"m").concat(e,"\x1B[49m")}}return e}function oo(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 a=i[o];typeof a=="function"&&(t.find(c=>o===c)||(i[o]=a.bind(e)))}}function Ot(e,t){if(!e)throw new Error(t||"Assertion failed")}function lt(){let e;if(ae()&&St.performance){var t,r;e=St===null||St===void 0||(t=St.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in ut){var n;let i=ut===null||ut===void 0||(n=ut.hrtime)===null||n===void 0?void 0:n.call(ut);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var bt={debug:ae()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Tu={enabled:!0,level:0};function Ie(){}var ao={},so={once:!0},rt=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Sr,this._startTs=lt(),this._deltaTs=lt(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Or("__probe-".concat(this.id,"__"),Tu),this.timeStamp("".concat(this.id," started")),oo(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((lt()-this._startTs).toPrecision(10))}getDelta(){return Number((lt()-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){Ot(t,r)}warn(t){return this._getLogFunction(0,t,bt.warn,arguments,so)}error(t){return this._getLogFunction(0,t,bt.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,bt.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,bt.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,bt.debug||bt.info,arguments,so)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||Ie,n&&[n],{tag:Ou(r)}):Ie}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:a=1}=t;return this._shouldLog(r||n)?ae()?Su({image:i,message:o,scale:a}):vu({image:i,message:o,scale:a}):Ie}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||Ie)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=co({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||Ie)}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()>=fo(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=co({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,Ot(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=lt();let a=o.tag||o.message;if(o.once&&a)if(!ao[a])ao[a]=lt();else return Ie;return r=gu(this.id,o.message,o),n.bind(console,r,...o.args)}return Ie}};rt.VERSION=Sr;function fo(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 Ot(Number.isFinite(t)&&t>=0),t}function co(e){let{logLevel:t,message:r}=e;e.logLevel=fo(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 Ot(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function gu(e,t,r){if(typeof t=="string"){let n=r.time?ro(to(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=io(t,r.color,r.background)}return t}function vu(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),Ie}function Su(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let a=br(o,r,n);console.log(...a)},o.src=t,Ie}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...br(t,r,n)),Ie;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...br(o,r,n)),o.src=t.toDataURL(),Ie}return Ie}function Ou(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Cm=new rt({id:"@probe.gl/log"});var x=new rt({id:"luma.gl"});function Zt(){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 _t=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=Zt(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Zt()-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 nt=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 _t?i=t:i=new _t(r,n),this.stats[r]=i),i}};var bu=function(){function e(){C(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 nt({id:n})),this.stats.get(n)},y(e)}(),yt=new bu;function yu(){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||(ae()&&x.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:x,stats:yt}),e}var uo=yu();var Fn=De(Me(),1);var Nn={};function J(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Nn[e]=Nn[e]||1;var t=Nn[e]++;return"".concat(e,"-").concat(t)}function Cr(e){return e>0&&(e&e-1)===0}function Ct(e){var t=!0;for(var r in e){t=!1;break}return t}function Et(e,t){return Et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Et(e,t)}function U(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&&Et(e,t)}function Fe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e,t){if(t&&(ce(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fe(e)}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},b(e)}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 Cu(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}var ee=function(){function e(r,n,i){if(C(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=Pu(n,i);var o=this.props.id!=="undefined"?this.props.id:J(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()},y(e)}();ee.defaultProps={id:"undefined",handle:void 0,userData:void 0};function Pu(e,t){var r=Cu({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}var Eo;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 Mn(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 Nu(e){var t=Mu();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Mu(){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}}Eo=Symbol.toStringTag;var se=function(e){U(r,e);var t=Nu(r);function r(i,o){var a;C(this,r);var c=Mn({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?c.indexType="uint32":o.data instanceof Uint16Array&&(c.indexType="uint16")),a=t.call(this,i,c,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=o.usage||0,a.indexType=c.indexType,a}var n=r.prototype;return n.write=function(o,a){throw new Error("not implemented")},n.readAsync=function(o,a){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},y(r,[{key:Eo,get:function(){return"Buffer"}}]),r}(ee);se.defaultProps=Mn(Mn({},ee.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});se.MAP_READ=1;se.MAP_WRITE=2;se.COPY_SRC=4;se.COPY_DST=8;se.INDEX=16;se.VERTEX=32;se.UNIFORM=64;se.STORAGE=128;se.INDIRECT=256;se.QUERY_RESOLVE=512;var ho;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 In(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}var Pr={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(x.get("debug")),break:[],gl:null};ho=Symbol.toStringTag;var Qt=function(){function e(r){C(this,e),this.id=void 0,this.statsManager=yt,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=In(In({},Pr),r),this.id=this.props.id||J(this[Symbol.toStringTag].toLowerCase())}var t=e.prototype;return t.loseDevice=function(){return!1},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=In({},n);return(n.usage||0)&se.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":x.warn("indices buffer content must be of integer type")()),i},y(e,[{key:ho,get:function(){return"Device"}}]),e}();Qt.VERSION=uo;function mo(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 Ro(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mo(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Iu(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Fu(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
10
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,
|
|
11
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Du(e,t){if(e){if(typeof e=="string")return To(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 To(e,t)}}function To(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 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}var Bu=ae()&&typeof document<"u",Nr=function(){return Bu&&document.readyState==="complete"},wu={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},Nt=function(){function e(r){var n=this;if(C(this,e),this.device=void 0,this.id=void 0,this.props=void 0,this.canvas=void 0,this.htmlCanvas=void 0,this.offscreenCanvas=void 0,this.type=void 0,this.width=1,this.height=1,this.resizeObserver=void 0,this._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},this.props=vo(vo({},wu),r),r=this.props,!ae()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(r.canvas)typeof r.canvas=="string"?this.canvas=Xu(r.canvas):this.canvas=r.canvas;else{var i,o,a=Hu(r),c=Lu(((i=r)===null||i===void 0?void 0:i.container)||null);c.insertBefore(a,c.firstChild),this.canvas=a,(o=r)!==null&&o!==void 0&&o.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&r.autoResize&&(this.resizeObserver=new ResizeObserver(function(f){var u=xu(f),_;try{for(u.s();!(_=u.n()).done;){var E=_.value;E.target===n.canvas&&n.update()}}catch(p){u.e(p)}finally{u.f()}}),this.resizeObserver.observe(this.canvas))}var t=e.prototype;return t.getDevicePixelRatio=function(n){if(typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(n=n===void 0?this.props.useDevicePixels:n,!n||n<=0))return 1;if(n===!0){var i=typeof window<"u"&&window.devicePixelRatio;return i||1}return n},t.getPixelSize=function(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":var n=this.getDevicePixelRatio(),i=this.canvas;return i.parentElement?[i.clientWidth*n,i.clientHeight*n]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}},t.getAspect=function(){var n=this.getPixelSize(),i=W(n,2),o=i[0],a=i[1];return o/a},t.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),i=W(n,1),o=i[0],a=this._canvasSizeInfo.clientWidth;return a?o/a:1}catch{return 1}},t.cssToDevicePixels=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,o=this.cssToDeviceRatio(),a=this.getDrawingBufferSize(),c=W(a,2),f=c[0],u=c[1];return Wu(n,o,f,u,i)},t.setDevicePixelRatio=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.htmlCanvas){var o="width"in i?i.width:this.htmlCanvas.clientWidth,a="height"in i?i.height:this.htmlCanvas.clientHeight;(!o||!a)&&(x.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,o=this.htmlCanvas.width||1,a=this.htmlCanvas.height||1);var c=this._canvasSizeInfo;if(c.clientWidth!==o||c.clientHeight!==a||c.devicePixelRatio!==n){var f=n,u=Math.floor(o*f),_=Math.floor(a*f);this.htmlCanvas.width=u,this.htmlCanvas.height=_;var E=this.getDrawingBufferSize(),p=W(E,2),d=p[0],h=p[1];(d!==u||h!==_)&&(f=Math.min(d/o,h/a),this.htmlCanvas.width=Math.floor(o*f),this.htmlCanvas.height=Math.floor(a*f),x.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=o,this._canvasSizeInfo.clientHeight=a,this._canvasSizeInfo.devicePixelRatio=n}}},t.getDrawingBufferSize=function(){var n=this.device.gl;if(!n)throw new Error("canvas size");return[n.drawingBufferWidth,n.drawingBufferHeight]},t._setAutoCreatedCanvasId=function(n){var i;((i=this.htmlCanvas)===null||i===void 0?void 0:i.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=n)},y(e,null,[{key:"isPageLoaded",get:function(){return Nr()}}]),e}();Nt.pageLoaded=Uu();function Uu(){return Nr()||typeof window>"u"?Promise.resolve():new Promise(function(e){window.addEventListener("load",function(){return e()})})}function Lu(e){if(typeof e=="string"){var t=document.getElementById(e);if(!t&&!Nr())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!t)throw new Error("".concat(e," is not an HTML element"));return t}else if(e)return e;return document.body}function Xu(e){var t=document.getElementById(e);if(!t&&!Nr())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!(t instanceof HTMLCanvasElement))throw new Error("'".concat(t,"' is not a canvas element"));return t}function Hu(e){var t=e.width,r=e.height,n=document.createElement("canvas");return n.id="lumagl-auto-created-canvas",n.width=t||1,n.height=r||1,n.style.width=Number.isFinite(t)?"".concat(t,"px"):"100%",n.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",n}function Wu(e,t,r,n,i){var o=e,a=So(o[0],t,r),c=Oo(o[1],t,n,i),f=So(o[0]+1,t,r),u=f===r-1?f:f-1;f=Oo(o[1]+1,t,n,i);var _;return i?(f=f===0?f:f+1,_=c,c=f):_=f===n-1?f:f-1,{x:a,y:c,width:Math.max(u-a+1,1),height:Math.max(_-c+1,1)}}function So(e,t,r){var n=Math.min(Math.round(e*t),r-1);return n}function Oo(e,t,r,n){return n?Math.max(0,r-1-Math.round(e*t)):Math.min(Math.round(e*t),r-1)}var Co;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 yo(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 Vu(e){var t=ju();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function ju(){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}}Co=Symbol.toStringTag;var Oe=function(e){U(r,e);var t=Vu(r);function r(n,i){var o,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.defaultProps;return C(this,r),o=t.call(this,n,i,a),o.dimension=void 0,o.format=void 0,o.width=void 0,o.height=void 0,o.depth=void 0,o.sampler=void 0,o.dimension=o.props.dimension,o.format=o.props.format,o.width=o.props.width,o.height=o.props.height,o.depth=o.props.depth,o}return y(r,[{key:Co,get:function(){return"Texture"}}]),r}(ee);Oe.defaultProps=yo(yo({},ee.defaultProps),{},{data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!0,sampler:{},compressed:!1,usage:0,mipLevels:void 0,samples:void 0,type:void 0});Oe.COPY_SRC=1;Oe.COPY_DST=2;Oe.TEXTURE_BINDING=4;Oe.STORAGE_BINDING=8;Oe.RENDER_ATTACHMENT=16;var Mo;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 No(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 Ku(e){var t=ku();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function ku(){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}}Mo=Symbol.toStringTag;var Mr=function(e){U(r,e);var t=Ku(r);function r(n,i){var o;return C(this,r),o=t.call(this,n,i,r.defaultProps),o.stage=void 0,o.source=void 0,o.stage=o.props.stage,o.source=o.props.source,o}return y(r,[{key:Mo,get:function(){return"Shader"}}]),r}(ee);Mr.defaultProps=No(No({},ee.defaultProps),{},{stage:"vertex",source:"",sourceMap:null,language:"glsl",shaderType:0});var xo;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 Fo(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 Yu(e){var t=zu();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function zu(){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}}xo=Symbol.toStringTag;var Ir=function(e){U(r,e);var t=Yu(r);function r(n,i){return C(this,r),t.call(this,n,i,r.defaultProps)}return y(r,[{key:xo,get:function(){return"Sampler"}}]),r}(ee);Ir.defaultProps=Fo(Fo({},ee.defaultProps),{},{type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});var Bo;function Do(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 Mt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Do(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Do(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gu(e){var t=$u();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function $u(){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}}Bo=Symbol.toStringTag;var Fr=function(e){U(r,e);var t=Gu(r);function r(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return C(this,r),o=t.call(this,i,a,r.defaultProps),o.width=void 0,o.height=void 0,o.colorAttachments=[],o.depthStencilAttachment=null,o.width=o.props.width,o.height=o.props.height,o}var n=r.prototype;return n.resize=function(o){var a=!o;if(o){var c=Array.isArray(o)?o:[o.width,o.height],f=W(c,2),u=f[0],_=f[1];a=a||_!==this.height||u!==this.width,this.width=u,this.height=_}a&&(x.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(this.width,"x").concat(this.height))(),this.resizeAttachments(this.width,this.height))},n.autoCreateAttachmentTextures=function(){var o=this;if(this.colorAttachments=this.props.colorAttachments.map(function(c){if(typeof c=="string"){var f=o.createColorTexture(c);return o.attachResource(f),f}return c}),this.props.depthStencilAttachment)if(typeof this.props.depthStencilAttachment=="string"){var a=this.createDepthStencilTexture(this.props.depthStencilAttachment);this.attachResource(a),this.depthStencilAttachment=a}else this.depthStencilAttachment=this.props.depthStencilAttachment},n.createColorTexture=function(o){return this.device.createTexture({id:"color-attachment",usage:Oe.RENDER_ATTACHMENT,format:o,width:this.width,height:this.height})},n.createDepthStencilTexture=function(o){return this.device.createTexture({id:"depth-stencil-attachment",usage:Oe.RENDER_ATTACHMENT,format:o,width:this.width,height:this.height})},n.resizeAttachments=function(o,a){for(var c=0;c<this.colorAttachments.length;++c)if(this.colorAttachments[c]){var f=this.device._createTexture(Mt(Mt({},this.colorAttachments[c].props),{},{width:o,height:a}));this.destroyAttachedResource(this.colorAttachments[c]),this.colorAttachments[c]=f,this.attachResource(f)}if(this.depthStencilAttachment){var u=this.device._createTexture(Mt(Mt({},this.depthStencilAttachment.props),{},{width:o,height:a}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=u,this.attachResource(u)}},y(r,[{key:Bo,get:function(){return"Framebuffer"}}]),r}(ee);Fr.defaultProps=Mt(Mt({},ee.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var Lo;function wo(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 Uo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wo(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qu(e){var t=Zu();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Zu(){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}}Lo=Symbol.toStringTag;var it=function(e){U(r,e);var t=qu(r);function r(n,i){var o;return C(this,r),o=t.call(this,n,i,r.defaultProps),o.hash="",o.vs=void 0,o.fs=void 0,o}return y(r,[{key:Lo,get:function(){return"RenderPipeline"}}]),r}(ee);it.defaultProps=Uo(Uo({},ee.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,indices:null,attributes:{},bindings:{},uniforms:{}});var Wo;function Xo(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 Ho(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xo(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qu(e){var t=Ju();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Ju(){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}}Wo=Symbol.toStringTag;var xr=function(e){U(r,e);var t=Qu(r);function r(n,i){return C(this,r),t.call(this,n,i,r.defaultProps)}return y(r,[{key:Wo,get:function(){return"RenderPass"}}]),r}(ee);xr.defaultProps=Ho(Ho({},ee.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});var Ko;function Vo(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 jo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vo(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function el(e){var t=tl();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function tl(){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}}Ko=Symbol.toStringTag;var Dr=function(e){U(r,e);var t=el(r);function r(i,o){return C(this,r),t.call(this,i,o,r.defaultProps)}var n=r.prototype;return n.pushDebugGroup=function(o){},n.popDebugGroup=function(){},n.insertDebugMarker=function(o){},y(r,[{key:Ko,get:function(){return"CommandEncoder"}}]),r}(ee);Dr.defaultProps=jo(jo({},ee.defaultProps),{},{measureExecutionTime:void 0});var Yo;function ko(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 rl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ko(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ko(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nl(e){var t=il();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function il(){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}}Yo=Symbol.toStringTag;var Br=function(e){U(r,e);var t=nl(r);function r(n){return C(this,r),t.call(this,n,r.defaultProps)}return y(r,[{key:Yo,get:function(){return"CommandBuffer"}}]),r}(ee);Br.defaultProps=rl({},ee.defaultProps);function H(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function wr(e){var t=zo[e],r=ol(t),n=e.includes("norm"),i=!n&&!e.startsWith("float"),o=e.startsWith("s");return{dataType:zo[e],byteLength:r,integer:i,signed:o,normalized:n}}function ol(e){var t=al[e];return t}var zo={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},al={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function xn(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=W(r,2),i=n[0],o=n[1],a=i,c=o?parseInt(o):1,f=wr(a),u={type:a,components:c,byteLength:f.byteLength*c,integer:f.integer,signed:f.signed,normalized:f.normalized};return t&&(u.webglOnly=!0),u}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 sl(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}var cl=/^(rg?b?a?)([0-9]*)([a-z]*)(-srgb)?(-webgl|-unsized)?$/;function Ur(e){var t=cl.exec(e);if(t){var r=W(t,6),n=r[1],i=r[2],o=r[3],a=r[4],c=r[5];if(n){var f="".concat(o).concat(i),u=wr(f);return sl({format:n,components:0,srgb:a==="-srgb",unsized:c==="-unsized",webgl:c==="-webgl"},u)}}return ul(e)}var fl={"rgba4unorm-webgl":{format:"rgba",bpp:2},"rgb565unorm-webgl":{format:"rgb",bpp:2},"rgb5a1unorm-webgl":{format:"rgba",bbp:2},rgb9e5ufloat:{format:"rgb",bbp:4},rg11b10ufloat:{format:"rgb",bbp:4},rgb10a2unorm:{format:"rgba",bbp:4},"rgb10a2unorm-webgl":{format:"rgba",bbp:4},stencil8:{components:1,bpp:1,a:"stencil"},depth16unorm:{components:1,bpp:2,a:"depth"},depth24plus:{components:1,bpp:3,a:"depth"},depth32float:{components:1,bpp:4,a:"depth"},"depth24plus-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth24unorm-stencil8":{components:2,bpp:4,a:"depth-stencil"},"depth32float-stencil8":{components:2,bpp:4,a:"depth-stencil"}};function ul(e){var t=fl[e];if(!t)throw new Error("Unknown format ".concat(e));return{format:t.format||"",components:t.components||1,byteLength:t.bpp||1,srgb:!1,unsized:!1}}function $o(e){var t=W(_l[e],2),r=t[0],n=t[1],i=r==="i32"||r==="u32",o=r!=="u32",a=El[r]*n,c=ll(r,n);return{dataType:r,components:n,defaultVertexFormat:c,byteLength:a,integer:i,signed:o}}function ll(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 _l={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]},El={f32:4,f16:2,i32:4,u32:4};function pl(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=dl(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
|
|
13
|
-
|
|
7
|
+
"use strict";var __exports__=(()=>{var jo=Object.create;var he=Object.defineProperty;var Fo=Object.getOwnPropertyDescriptor;var Uo=Object.getOwnPropertyNames;var Go=Object.getPrototypeOf,zo=Object.prototype.hasOwnProperty;var Ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bo=(e,t)=>{for(var r in t)he(e,r,{get:t[r],enumerable:!0})},Mr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Uo(t))!zo.call(e,i)&&i!==r&&he(e,i,{get:()=>t[i],enumerable:!(n=Fo(t,i))||n.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?jo(Go(e)):{},Mr(t||!e||!e.__esModule?he(r,"default",{value:e,enumerable:!0}):r,e)),ko=e=>Mr(he({},"__esModule",{value:!0}),e);var Cr=Ue((Rc,gt)=>{function He(e){return gt.exports=He=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,He(e)}gt.exports=He,gt.exports.__esModule=!0,gt.exports.default=gt.exports});var Ir=Ue((Cc,vt)=>{var Lr=Cr().default;function Dr(){"use strict";vt.exports=Dr=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,z){var I=u(g[E],g,P);if(I.type!=="throw"){var G=I.arg,k=G.value;return k&&Lr(k)=="object"&&r.call(k,"__await")?p.resolve(k.__await).then(function(V){d("next",V,D,z)},function(V){d("throw",V,D,z)}):p.resolve(k).then(function(V){G.value=V,D(G)},function(V){return d("throw",V,D,z)})}z(I.arg)}var _;n(this,"_invoke",{value:function(P,D){function z(){return new p(function(I,G){d(P,D,I,G)})}return _=_?_.then(z,z):z()}})}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 z=M(D,d);if(z){if(z===l)continue;return z}}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(Lr(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 z=r.call(P,"catchLoc"),I=r.call(P,"finallyLoc");if(z&&I){if(this.prev<P.catchLoc)return _(P.catchLoc,!0);if(this.prev<P.finallyLoc)return _(P.finallyLoc)}else if(z){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=Dr,vt.exports.__esModule=!0,vt.exports.default=vt.exports});var Jt=Ue((Lc,Nr)=>{var de=Ir()();Nr.exports=de;try{regeneratorRuntime=de}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=de:Function("r","regeneratorRuntime = r")(de)}});var tc={};Bo(tc,{AnimationLoop:()=>be,AnimationLoopTemplate:()=>jr,ClipSpace:()=>oo,ConeGeometry:()=>ho,CubeGeometry:()=>mo,CylinderGeometry:()=>yo,Geometry:()=>st,GroupNode:()=>ao,IcoSphereGeometry:()=>xo,KeyFrames:()=>Tr,Model:()=>ae,ModelNode:()=>co,PipelineFactory:()=>se,PlaneGeometry:()=>wo,ScenegraphNode:()=>Dt,ShaderModuleUniforms:()=>Qi,SphereGeometry:()=>Mo,Timeline:()=>Ar,Transform:()=>Ji,TruncatedConeGeometry:()=>Yt,makeAnimationLoop:()=>_n});function Ge(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 It(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 It(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 It(e,t)}}function Be(){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 B(e,t){return Ge(e)||ze(e,t)||$t(e,t)||Be()}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 ke(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=ke(e,"string");return tt(t)==="symbol"?t:String(t)}function Sr(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&&Sr(e.prototype,t),r&&Sr(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 Ve(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Vo(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 Vo(e,t){if(e){if(typeof e=="string")return Pr(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 Pr(e,t)}}function Pr(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,Ar=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 Tr=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 Rr(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){Rr(o,n,i,s,c,"next",a)}function c(a){Rr(o,n,i,s,c,"throw",a)}s(void 0)})}}var qe=pe(Jt(),1),jr=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,Nt=globalThis.window||globalThis.self||globalThis.global,Ko=globalThis.document||{},At=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 Fr(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 Ur(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 Gr(e){return typeof e!="string"?e:(e=e.toUpperCase(),ye[e]||ye.WHITE)}function zr(e,t,r){if(!ct&&typeof e=="string"){if(t){let n=Gr(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=Gr(r);e="\x1B[".concat(n+$o,"m").concat(e,"\x1B[49m")}}return e}function Br(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 jt(e,t){if(!e)throw new Error(t||"Assertion failed")}function Tt(){let e;if(ct()&&Nt.performance){var t,r;e=Nt===null||Nt===void 0||(t=Nt.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in At){var n;let i=At===null||At===void 0||(n=At.hrtime)===null||n===void 0?void 0:n.call(At);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var Ft={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 kr={},Vr={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=Tt(),this._deltaTs=Tt(),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")),Br(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((Tt()-this._startTs).toPrecision(10))}getDelta(){return Number((Tt()-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){jt(t,r)}warn(t){return this._getLogFunction(0,t,Ft.warn,arguments,Vr)}error(t){return this._getLogFunction(0,t,Ft.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,Ft.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Ft.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Ft.debug||Ft.info,arguments,Vr)}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=Hr({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()>=qr(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=Hr({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,jt(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Tt();let s=o.tag||o.message;if(o.once&&s)if(!kr[s])kr[s]=Tt();else return ht;return r=Jo(this.id,o.message,o),n.bind(console,r,...o.args)}return ht}};wt.VERSION=me;function qr(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 jt(Number.isFinite(t)&&t>=0),t}function Hr(e){let{logLevel:t,message:r}=e;e.logLevel=qr(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 jt(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function Jo(e,t,r){if(typeof t=="string"){let n=r.time?Ur(Fr(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=zr(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 Rt=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 Rt?i=t:i=new Rt(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)}(),Ut=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:Ut}),e}var Wr=ns();function Kr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function Gt(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:Kr(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 Yr(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?Yr(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ct=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)}();Ct.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 $r;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 Xe(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}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}}$r=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:$r,get:function(){return"Buffer"}}]),r}(Ct);X.defaultProps=Xe(Xe({},Ct.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 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}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};Jr=Symbol.toStringTag;var cs=function(){function e(r){T(this,e),this.id=void 0,this.statsManager=Ut,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.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:Jr,get:function(){return"Device"}}]),e}();cs.VERSION=Wr;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 tn(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}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 us(e,t){if(e){if(typeof e=="string")return en(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 en(e,t)}}function en(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 zt=new Map,Lt=function(){function e(){T(this,e)}return e.registerDevices=function(r){var n=fs(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;rt(o.type&&o.isSupported&&o.create),zt.set(o.type,o)}}catch(s){n.e(s)}finally{n.f()}},e.getAvailableDevices=function(){return Array.from(zt).map(function(r){return r.type})},e.getSupportedDevices=function(){return Array.from(zt).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(Ze.default.mark(function n(){var i,o,s=arguments;return Ze.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:i=s.length>0&&s[0]!==void 0?s[0]:{},i=tn(tn({},_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=zt.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=zt.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=zt.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)}();Lt.stats=Ut;Lt.log=K;var on;function rn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rn(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ls(e){var t=hs();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 hs(){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}}on=Symbol.toStringTag;var Bt=function(e){q(r,e);var t=ls(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:on,get:function(){return"RenderPipeline"}}]),r}(Ct);Bt.defaultProps=nn(nn({},Ct.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});function sn(e){var t=B(ds[e],2),r=t[0],n=t[1],i=r==="i32"||r==="u32",o=r!=="u32",s=ms[r]*n,c=ps(r,n);return{dataType:r,components:n,defaultVertexFormat:c,byteLength:s,integer:i,signed:o}}function ps(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 ds={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]},ms={f32:4,f16:2,i32:4,u32:4};function cn(e){var t=an[e],r=gs(t),n=e.includes("norm"),i=!n&&!e.startsWith("float"),o=e.startsWith("s");return{dataType:an[e],byteLength:r,integer:i,signed:o,normalized:n}}function gs(e){var t=vs[e];return t}var an={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},vs={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Je(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=B(r,2),i=n[0],o=n[1],s=i,c=o?parseInt(o):1,a=cn(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=ys(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
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 fn(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 fn(e,t)}}function fn(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=sn(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 un(e){var t=Ms[e];return rt(e),t}function ln(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}var xe;function hn(e){return(!xe||xe.byteLength<e)&&(xe=new ArrayBuffer(e)),xe}var pn=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=un(a),u=f.type,l=f.components;n=ln(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,pn)}var t=e.prototype;return t.getData=function(n){for(var i=Math.max(this.byteLength,pn),o=hn(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=Gt(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 dn=function(t){return"".concat(t)};function mn(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 gn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mn(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mn(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:Lt.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=gn(gn({},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 vn(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 yn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vn(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _n(e,t){var r=this,n=null,i=t?.device||Lt.createDevice(),o=new be(yn(yn({},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 It(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 ir(e)||or(e)||$t(e)||sr()}var nt=function(t){return"".concat(t)};function dt(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}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 Mt(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}var ar={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 On(e){for(var t={},r=0,n=Object.entries(e);r<n.length;r++){var i=B(n[r],2),o=i[0],s=i[1];t[o]=As(s)}return t}function wn(e,t,r){for(var n={},i=0,o=Object.entries(t);i<o.length;i++){var s=B(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 As(e){var t=bn(e);if(t!=="object")return Mt(Mt({value:e},ar[t]),{},{type:t});if(tt(e)==="object")return e?e.type!==void 0?Mt(Mt(Mt({},e),ar[e.type]),{},{type:e.type}):e.value===void 0?{type:"object",value:e}:(t=bn(e.value),Mt(Mt(Mt({},e),ar[t]),{},{type:t})):{type:"object",value:null};throw new Error("props")}function bn(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 En,Mn,Sn=nt(En||(En=$([`#ifdef MODULE_LOGDEPTH
|
|
13
|
+
logdepth_adjustPosition(gl_Position);
|
|
14
|
+
#endif
|
|
15
|
+
`],[`\\
|
|
16
|
+
#ifdef MODULE_LOGDEPTH
|
|
17
|
+
logdepth_adjustPosition(gl_Position);
|
|
18
|
+
#endif
|
|
19
|
+
`]))),Pn=nt(Mn||(Mn=$([`#ifdef MODULE_MATERIAL
|
|
20
|
+
gl_FragColor = material_filterColor(gl_FragColor);
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
#ifdef MODULE_LIGHTING
|
|
24
|
+
gl_FragColor = lighting_filterColor(gl_FragColor);
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
#ifdef MODULE_FOG
|
|
28
|
+
gl_FragColor = fog_filterColor(gl_FragColor);
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
#ifdef MODULE_PICKING
|
|
32
|
+
gl_FragColor = picking_filterHighlightColor(gl_FragColor);
|
|
33
|
+
gl_FragColor = picking_filterPickingColor(gl_FragColor);
|
|
34
|
+
#endif
|
|
35
|
+
|
|
36
|
+
#ifdef MODULE_LOGDEPTH
|
|
37
|
+
logdepth_setFragDepth();
|
|
38
|
+
#endif
|
|
39
|
+
`],[`\\
|
|
40
|
+
#ifdef MODULE_MATERIAL
|
|
41
|
+
gl_FragColor = material_filterColor(gl_FragColor);
|
|
42
|
+
#endif
|
|
14
43
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Al(e,t){if(e){if(typeof e=="string")return Qo(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 Qo(e,t)}}function Qo(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 Lr(e,t){var r={},n=It(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=Tl(e,t,o.name)}}catch(a){n.e(a)}finally{n.f()}return r}function Tl(e,t,r){var n=gl(e,r),i=vl(t,r);if(!n)return null;var o=$o(n.type),a=i?.vertexFormat||o.defaultVertexFormat,c=xn(a);return{attributeName:i?.attributeName||n.name,bufferName:i?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:a,bufferDataType: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 gl(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||x.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function vl(e,t){Sl(e);var r=Ol(e,t);return r||(r=bl(e,t),r)?r:(x.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Sl(e){var t=It(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&x.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function Ol(e,t){var r=It(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 bl(e,t){var r=It(e),n;try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=o.byteStride;if(typeof o.byteStride!="number"){var c=It(o.attributes||[]),f;try{for(c.s();!(f=c.n()).done;){var u=f.value,_=xn(u.format);a+=_.byteLength}}catch(p){c.e(p)}finally{c.f()}}var E=(i=o.attributes)===null||i===void 0?void 0:i.find(function(p){return p.attribute===t});if(E)return{attributeName:E.attribute,bufferName:o.name,stepMode:o.stepMode,vertexFormat:E.format,byteOffset:E.byteOffset,byteStride:a}}}catch(p){r.e(p)}finally{r.f()}return null}function wn(e,t){var r=Bn(Bn({},e),{},{attributes:e.attributes.map(function(a){return Bn({},a)})}),n=It(t?.attributes||[]),i;try{var o=function(){var c=i.value,f=r.attributes.find(function(u){return u.name===c.name});f?(f.type=c.type||f.type,f.stepMode=c.stepMode||f.stepMode):x.warn("shader layout attribute ".concat(c.name," not present in shader"))};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}function Un(e,t,r,n){var i="See luma.gl ".concat(r," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),o=Object.getPrototypeOf(e);n.forEach(function(a){o.methodName||(o[a]=function(){throw x.removed("Calling removed method ".concat(t,".").concat(a,": "),i)(),new Error(a)})})}function dt(e,t,r){var n=r.removedProps,i=n===void 0?{}:n,o=r.deprecatedProps,a=o===void 0?{}:o,c=r.replacedProps,f=c===void 0?{}:c;for(var u in i)if(u in t){var _=i[u],E=_?"".concat(e,".").concat(i[u]):"N/A";x.removed("".concat(e,".").concat(u),E)()}for(var p in a)if(p in t){var d=a[p];x.deprecated("".concat(e,".").concat(p),"".concat(e,".").concat(d))()}for(var h=null,m=0,A=Object.entries(f);m<A.length;m++){var T=W(A[m],2),P=T[0],S=T[1];P in t&&(x.deprecated("".concat(e,".").concat(P),"".concat(e,".").concat(S))(),h=h||Object.assign({},t),h[S]=t[P],delete h[P])}return h||t}var Jt=De(Me(),1),yl="";function Hn(e,t){return Ln.apply(this,arguments)}function Ln(){return Ln=ne(Jt.default.mark(function e(t,r){return Jt.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,a){try{var c=new Image;c.onload=function(){return o(c)},c.onerror=function(){return a(new Error("Could not load image ".concat(t,".")))},c.crossOrigin=r?.crossOrigin||"anonymous",c.src=t.startsWith("http")?t:yl+t}catch(f){a(f)}}));case 1:case"end":return i.stop()}},e)})),Ln.apply(this,arguments)}function er(e,t){return Xn.apply(this,arguments)}function Xn(){return Xn=ne(Jt.default.mark(function e(t,r){var n,i;return Jt.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(n=document.getElementsByTagName("head")[0],n){a.next=3;break}throw new Error("loadScript");case 3:return i=document.createElement("script"),i.setAttribute("type","text/javascript"),i.setAttribute("src",t),r&&(i.id=r),a.abrupt("return",new Promise(function(c,f){i.onload=c,i.onerror=function(u){return f(new Error("Unable to load script '".concat(t,"': ").concat(u)))},n.appendChild(i)}));case 8:case"end":return a.stop()}},e)})),Xn.apply(this,arguments)}var Xr;function Jo(e){return(!Xr||Xr.byteLength<e)&&(Xr=new ArrayBuffer(e)),Xr}function Wn(e,t){var r=Jo(e.BYTES_PER_ELEMENT*t);return new e(r,0,t)}function Vn(e){for(var t=e.target,r=e.source,n=e.start,i=n===void 0?0:n,o=e.count,a=o===void 0?1:o,c=r.length,f=a*c,u=0,_=i;u<c;u++)t[_++]=r[u];for(;u<f;)u<f-u?(t.copyWithin(i+u,i,i+u),u*=2):(t.copyWithin(i+u,i,i+f-u),u=f);return e.target}function tr(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(!tr(e[n],t[n],r-1))return!1;return!0}if(Array.isArray(t))return!1;if(ce(e)==="object"&&ce(t)==="object"){var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var a=0,c=i;a<c.length;a++){var f=c[a];if(!t.hasOwnProperty(f)||!tr(e[f],t[f],r-1))return!1}return!0}return!1}function jn(e){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function Kn(e){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var ea=function(t){return"".concat(t)};function ta(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 ra(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ta(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ta(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Cl=0,Pl={device:null,onAddHTML:function(){return""},onInitialize:function(){var e=ne($e.default.mark(function r(){return $e.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:pt.stats.get("animation-loop-".concat(Cl++)),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1},Hr=function(){function e(r){if(C(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=ra(ra({},Pl),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 nt({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=ne($e.default.mark(function i(){var o,a;return $e.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(!this._running){f.next=2;break}return f.abrupt("return",this);case 2:if(this._running=!0,f.prev=3,this._running){f.next=6;break}return f.abrupt("return",null);case 6:if(this._initialized){f.next=13;break}return this._initialized=!0,f.next=10,this._initDevice();case 10:return this._initialize(),f.next=13,this.props.onInitialize(this._getAnimationProps());case 13:if(this._running){f.next=15;break}return f.abrupt("return",null);case 15:return o!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),f.abrupt("return",this);case 19:throw f.prev=19,f.t0=f.catch(3),a=f.t0 instanceof Error?f.t0:new Error("Unknown error"),this.props.onError(a),a;case 24:case"end":return f.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._beginTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers(),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=ne($e.default.mark(function i(){return $e.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return this.setNeedsRedraw("toDataURL"),a.next=3,this.waitForRender();case 3:if(!(this.canvas instanceof HTMLCanvasElement)){a.next=5;break}return a.abrupt("return",this.canvas.toDataURL());case 5:throw new Error("OffscreenCanvas");case 6:case"end":return a.stop()}},i,this)}));function n(){return r.apply(this,arguments)}return n}(),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=jn(this._animationFrame.bind(this)))},t._cancelAnimationFrame=function(){this._animationFrameId===null&&(Kn(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,renderPass:this.device.getDefaultRenderPass(),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){this.animationProps.renderPass=this.device.getDefaultRenderPass();var n=this._getSizeAndAspect(),i=n.width,o=n.height,a=n.aspect;(i!==this.animationProps.width||o!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),a!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=i,this.animationProps.height=o,this.animationProps.aspect=a,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}},t._initDevice=function(){var r=ne($e.default.mark(function i(){var o;return $e.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],a=W(o,2),c=a[0],f=a[1],u=1,_=(i=this.device)===null||i===void 0||(i=i.canvasContext)===null||i===void 0?void 0:i.canvas;return _&&_.clientHeight?u=_.clientWidth/_.clientHeight:c>0&&f>0&&(u=c/f),{width:c,height:f,aspect:u}},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._beginTimers=function(){this.frameRate.timeEnd(),this.frameRate.timeStart()},t._endTimers=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},y(e)}();var kn=De(Me(),1);function na(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 ia(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?na(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):na(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oa(e,t){var r=this,n=null,i=t?.device||pt.createDevice(),o=new Hr(ia(ia({},t),{},{device:i,onInitialize:function(c){return ne(kn.default.mark(function f(){var u;return kn.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return n=new e(c),E.next=3,(u=n)===null||u===void 0?void 0:u.onInitialize(c);case 3:return E.abrupt("return",E.sent);case 4:case"end":return E.stop()}},f)}))()},onRender:function(c){var f;return(f=n)===null||f===void 0?void 0:f.onRender(c)},onFinalize:function(c){var f;return(f=n)===null||f===void 0?void 0:f.onFinalize(c)}}));return o.getInfo=function(){return r.AnimationLoopTemplateCtor.info},o}function Yn(e){if(Array.isArray(e))return vt(e)}function rr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
19
|
-
|
|
44
|
+
#ifdef MODULE_LIGHTING
|
|
45
|
+
gl_FragColor = lighting_filterColor(gl_FragColor);
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
#ifdef MODULE_FOG
|
|
49
|
+
gl_FragColor = fog_filterColor(gl_FragColor);
|
|
50
|
+
#endif
|
|
51
|
+
|
|
52
|
+
#ifdef MODULE_PICKING
|
|
53
|
+
gl_FragColor = picking_filterHighlightColor(gl_FragColor);
|
|
54
|
+
gl_FragColor = picking_filterPickingColor(gl_FragColor);
|
|
55
|
+
#endif
|
|
56
|
+
|
|
57
|
+
#ifdef MODULE_LOGDEPTH
|
|
58
|
+
logdepth_setFragDepth();
|
|
59
|
+
#endif
|
|
60
|
+
`])));var Ts={vertex:Sn,fragment:Pn},An=/void\s+main\s*\([^)]*\)\s*\{\n?/,Tn=/}\n?[^{}]*$/,cr=[],ie="__LUMA_INJECT_DECLARATIONS__";function Rn(e){var t={vertex:{},fragment:{}};for(var r in e){var n=e[r],i=Rs(r);typeof n=="string"&&(n={order:0,injection:n}),t[i][r]=n}return t}function Rs(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}),cr.length=a.length;for(var f=0,u=a.length;f<u;++f)cr[f]=a[f].injection;var l="".concat(cr.join(`
|
|
61
|
+
`),`
|
|
62
|
+
`);switch(s){case"vs:#decl":i&&(e=e.replace(ie,l));break;case"vs:#main-start":i&&(e=e.replace(An,function(h){return h+l}));break;case"vs:#main-end":i&&(e=e.replace(Tn,function(h){return l+h}));break;case"fs:#decl":i||(e=e.replace(ie,l));break;case"fs:#main-start":i||(e=e.replace(An,function(h){return h+l}));break;case"fs:#main-end":i||(e=e.replace(Tn,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+Ts[t]})),e}var Cn=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.uniforms,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=Rn(b),f&&(this.uniforms=On(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,"_"),`
|
|
20
63
|
`).concat(i,"// END MODULE_").concat(this.name,`
|
|
21
64
|
|
|
22
|
-
`)},t.getUniforms=function(n,i){return this.getModuleUniforms?this.getModuleUniforms(n,i):
|
|
23
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,
|
|
65
|
+
`)},t.getUniforms=function(n,i){return this.getModuleUniforms?this.getModuleUniforms(n,i):wn(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 Ln(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Cs(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 Cs(e,t){if(e){if(typeof e=="string")return Dn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dn(e,t)}}function Dn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function In(e){var t=Cn.instantiateModules(e);return Ls(t)}function Ls(e){var t={},r={};return Nn({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 Nn(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=Ln(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=Ln(t),f;try{for(a.s();!(f=a.n()).done;){var u=f.value;u.dependencies&&Nn({modules:u.dependencies,level:r+1,moduleMap:n,moduleDepth:i})}}catch(l){a.e(l)}finally{a.f()}}var jn,Fn,Un,Gn,zn,Bn,kn,Vn,Hn,qn;function Wn(e){switch(e?.gpu.toLowerCase()){case"apple":return nt(jn||(jn=$([`#define APPLE_GPU
|
|
24
67
|
// Apple optimizes away the calculation necessary for emulated fp64
|
|
25
68
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
26
69
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
@@ -33,14 +76,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
33
76
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
34
77
|
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
|
|
35
78
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
36
|
-
`])));case"nvidia":return
|
|
79
|
+
`])));case"nvidia":return nt(Fn||(Fn=$([`#define NVIDIA_GPU
|
|
37
80
|
// Nvidia optimizes away the calculation necessary for emulated fp64
|
|
38
81
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
39
82
|
`],[`\\
|
|
40
83
|
#define NVIDIA_GPU
|
|
41
84
|
// Nvidia optimizes away the calculation necessary for emulated fp64
|
|
42
85
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
43
|
-
`])));case"intel":return
|
|
86
|
+
`])));case"intel":return nt(Un||(Un=$([`#define INTEL_GPU
|
|
44
87
|
// Intel optimizes away the calculation necessary for emulated fp64
|
|
45
88
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
46
89
|
// Intel's built-in 'tan' function doesn't have acceptable precision
|
|
@@ -55,10 +98,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
55
98
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
56
99
|
// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
|
|
57
100
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
58
|
-
`])));case"amd":return
|
|
101
|
+
`])));case"amd":return nt(Gn||(Gn=$([`#define AMD_GPU
|
|
59
102
|
`],[`\\
|
|
60
103
|
#define AMD_GPU
|
|
61
|
-
`])));default:return
|
|
104
|
+
`])));default:return nt(zn||(zn=$([`#define DEFAULT_GPU
|
|
62
105
|
// Prevent driver from optimizing away the calculation necessary for emulated fp64
|
|
63
106
|
#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
|
|
64
107
|
// Headless Chrome's software shader 'tan' function doesn't have acceptable precision
|
|
@@ -73,39 +116,23 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
73
116
|
#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
|
|
74
117
|
// If the GPU doesn't have full 32 bits precision, will causes overflow
|
|
75
118
|
#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
|
|
76
|
-
`])))}}function
|
|
77
|
-
|
|
119
|
+
`])))}}function Kn(e){var t=nt(Bn||(Bn=$([`#if (__VERSION__ > 120)
|
|
78
120
|
# define FEATURE_GLSL_DERIVATIVES
|
|
79
121
|
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
80
122
|
# define FEATURE_GLSL_FRAG_DEPTH
|
|
81
123
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
82
|
-
|
|
83
|
-
// DEPRECATED FLAGS, remove in v9
|
|
84
|
-
# define FRAG_DEPTH
|
|
85
|
-
# define DERIVATIVES
|
|
86
|
-
# define DRAW_BUFFERS
|
|
87
|
-
# define TEXTURE_LOD
|
|
88
|
-
|
|
89
124
|
#endif // __VERSION
|
|
90
125
|
`],[`\\
|
|
91
126
|
#if (__VERSION__ > 120)
|
|
92
|
-
|
|
93
127
|
# define FEATURE_GLSL_DERIVATIVES
|
|
94
128
|
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
95
129
|
# define FEATURE_GLSL_FRAG_DEPTH
|
|
96
130
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
97
|
-
|
|
98
|
-
// DEPRECATED FLAGS, remove in v9
|
|
99
|
-
# define FRAG_DEPTH
|
|
100
|
-
# define DERIVATIVES
|
|
101
|
-
# define DRAW_BUFFERS
|
|
102
|
-
# define TEXTURE_LOD
|
|
103
|
-
|
|
104
131
|
#endif // __VERSION
|
|
105
|
-
`])));return
|
|
132
|
+
`])));return!e.features.has("webgl2")&&e.features.has("glsl-frag-depth")&&(t+=nt(kn||(kn=$([`
|
|
106
133
|
// FRAG_DEPTH => gl_FragDepth is available
|
|
107
134
|
#ifdef GL_EXT_frag_depth
|
|
108
|
-
#extension GL_EXT_frag_depth : enable
|
|
135
|
+
# extension GL_EXT_frag_depth : enable
|
|
109
136
|
# define FEATURE_GLSL_FRAG_DEPTH
|
|
110
137
|
# define FRAG_DEPTH
|
|
111
138
|
# define gl_FragDepth gl_FragDepthEXT
|
|
@@ -114,15 +141,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
114
141
|
|
|
115
142
|
// FRAG_DEPTH => gl_FragDepth is available
|
|
116
143
|
#ifdef GL_EXT_frag_depth
|
|
117
|
-
#extension GL_EXT_frag_depth : enable
|
|
144
|
+
# extension GL_EXT_frag_depth : enable
|
|
118
145
|
# define FEATURE_GLSL_FRAG_DEPTH
|
|
119
146
|
# define FRAG_DEPTH
|
|
120
147
|
# define gl_FragDepth gl_FragDepthEXT
|
|
121
148
|
#endif
|
|
122
|
-
`]))))
|
|
149
|
+
`])))),!e.features.has("webgl2")&&e!==null&&e!==void 0&&e.features.has("glsl-derivatives")&&(t+=nt(Vn||(Vn=$([`
|
|
123
150
|
// DERIVATIVES => dxdF, dxdY and fwidth are available
|
|
124
151
|
#if defined(GL_OES_standard_derivatives) || defined(FEATURE_GLSL_DERIVATIVES)
|
|
125
|
-
#extension GL_OES_standard_derivatives : enable
|
|
152
|
+
# extension GL_OES_standard_derivatives : enable
|
|
126
153
|
# define FEATURE_GLSL_DERIVATIVES
|
|
127
154
|
# define DERIVATIVES
|
|
128
155
|
#endif
|
|
@@ -130,159 +157,74 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
130
157
|
|
|
131
158
|
// DERIVATIVES => dxdF, dxdY and fwidth are available
|
|
132
159
|
#if defined(GL_OES_standard_derivatives) || defined(FEATURE_GLSL_DERIVATIVES)
|
|
133
|
-
#extension GL_OES_standard_derivatives : enable
|
|
160
|
+
# extension GL_OES_standard_derivatives : enable
|
|
134
161
|
# define FEATURE_GLSL_DERIVATIVES
|
|
135
162
|
# define DERIVATIVES
|
|
136
163
|
#endif
|
|
137
|
-
`]))))
|
|
164
|
+
`])))),!e.features.has("webgl2")&&e!==null&&e!==void 0&&e.features.has("glsl-frag-data")&&(t+=nt(Hn||(Hn=$([`
|
|
138
165
|
// DRAW_BUFFERS => gl_FragData[] is available
|
|
139
166
|
#ifdef GL_EXT_draw_buffers
|
|
140
|
-
#extension GL_EXT_draw_buffers : require
|
|
141
|
-
#define FEATURE_GLSL_DRAW_BUFFERS
|
|
142
|
-
#define DRAW_BUFFERS
|
|
167
|
+
# extension GL_EXT_draw_buffers : require
|
|
168
|
+
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
169
|
+
# define DRAW_BUFFERS
|
|
143
170
|
#endif
|
|
144
171
|
`],[`\\
|
|
145
172
|
|
|
146
173
|
// DRAW_BUFFERS => gl_FragData[] is available
|
|
147
174
|
#ifdef GL_EXT_draw_buffers
|
|
148
|
-
#extension GL_EXT_draw_buffers : require
|
|
149
|
-
#define FEATURE_GLSL_DRAW_BUFFERS
|
|
150
|
-
#define DRAW_BUFFERS
|
|
175
|
+
# extension GL_EXT_draw_buffers : require
|
|
176
|
+
# define FEATURE_GLSL_DRAW_BUFFERS
|
|
177
|
+
# define DRAW_BUFFERS
|
|
151
178
|
#endif
|
|
152
|
-
`]))))
|
|
179
|
+
`])))),!e.features.has("webgl2")&&e!==null&&e!==void 0&&e.features.has("glsl-texture-lod")&&(t+=nt(qn||(qn=$([`// TEXTURE_LOD => texture2DLod etc are available
|
|
153
180
|
#ifdef GL_EXT_shader_texture_lod
|
|
154
|
-
#extension GL_EXT_shader_texture_lod : enable
|
|
155
|
-
|
|
181
|
+
# extension GL_EXT_shader_texture_lod : enable
|
|
156
182
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
157
183
|
# define TEXTURE_LOD
|
|
158
|
-
|
|
159
184
|
#endif
|
|
160
185
|
`],[`\\
|
|
161
186
|
// TEXTURE_LOD => texture2DLod etc are available
|
|
162
187
|
#ifdef GL_EXT_shader_texture_lod
|
|
163
|
-
#extension GL_EXT_shader_texture_lod : enable
|
|
164
|
-
|
|
188
|
+
# extension GL_EXT_shader_texture_lod : enable
|
|
165
189
|
# define FEATURE_GLSL_TEXTURE_LOD
|
|
166
190
|
# define TEXTURE_LOD
|
|
167
|
-
|
|
168
|
-
#endif
|
|
169
|
-
`])))),t}var Ca,Pa,Na=Ee(Ca||(Ca=fe([`#ifdef MODULE_LOGDEPTH
|
|
170
|
-
logdepth_adjustPosition(gl_Position);
|
|
171
|
-
#endif
|
|
172
|
-
`],[`\\
|
|
173
|
-
#ifdef MODULE_LOGDEPTH
|
|
174
|
-
logdepth_adjustPosition(gl_Position);
|
|
175
|
-
#endif
|
|
176
|
-
`]))),Ma=Ee(Pa||(Pa=fe([`#ifdef MODULE_MATERIAL
|
|
177
|
-
gl_FragColor = material_filterColor(gl_FragColor);
|
|
178
|
-
#endif
|
|
179
|
-
|
|
180
|
-
#ifdef MODULE_LIGHTING
|
|
181
|
-
gl_FragColor = lighting_filterColor(gl_FragColor);
|
|
182
|
-
#endif
|
|
183
|
-
|
|
184
|
-
#ifdef MODULE_FOG
|
|
185
|
-
gl_FragColor = fog_filterColor(gl_FragColor);
|
|
186
|
-
#endif
|
|
187
|
-
|
|
188
|
-
#ifdef MODULE_PICKING
|
|
189
|
-
gl_FragColor = picking_filterHighlightColor(gl_FragColor);
|
|
190
|
-
gl_FragColor = picking_filterPickingColor(gl_FragColor);
|
|
191
191
|
#endif
|
|
192
|
+
`])))),t}function Ds(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Is(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 Is(e,t){if(e){if(typeof e=="string")return Yn(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 Yn(e,t)}}function Yn(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 Xn(e,t,r){switch(t){case 300:switch(r){case"vertex":return Oe(e,Ns);case"fragment":return zs(e);default:throw new Error("unknown shader stage ".concat(r))}case 100:switch(r){case"vertex":return Oe(e,Fs);case"fragment":return Bs(e);default:throw new Error("unknown shader stage ".concat(r))}default:throw new Error("unknown GLSL version ".concat(t))}}var $n=[[/^(#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("]],Ns=[].concat($n,[[kt("attribute"),"in $1"],[kt("varying"),"out $1"]]),js=[].concat($n,[[kt("varying"),"in $1"]]),Zn=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Fs=[].concat(Zn,[[kt("in"),"attribute $1"],[kt("out"),"varying $1"]]),Us=[].concat(Zn,[[kt("in"),"varying $1"]]),fr="gl_FragColor",ur=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,Gs=/void\s+main\s*\([^)]*\)\s*\{\n?/;function Oe(e,t){var r=Ds(t),n;try{for(r.s();!(n=r.n()).done;){var i=B(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 zs(e){e=Oe(e,js);var t=ur.exec(e);if(t){var r=t[1];e=e.replace(new RegExp("\\b".concat(fr,"\\b"),"g"),r)}else{var n="fragmentColor";e=e.replace(Gs,function(i){return"out vec4 ".concat(n,`;
|
|
195
|
+
`).concat(i)}).replace(new RegExp("\\b".concat(fr,"\\b"),"g"),n)}return e}function Bs(e){e=Oe(e,Us);var t=ur.exec(e);if(t){var r=t[1];e=e.replace(ur,"").replace(new RegExp("\\b".concat(r,"\\b"),"g"),fr)}return e}function kt(e){return new RegExp("\\b".concat(e,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}function Qn(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ks(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 ks(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 lr(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=Qn(o),c;try{for(s.s();!(c=s.n()).done;){var a=c.value;r+=" ".concat(a.injection,`
|
|
198
|
+
`)}}catch(f){s.e(f)}finally{s.f()}}i.footer&&(r+=" ".concat(i.footer)),r+=`}
|
|
199
|
+
`}return r}function hr(e){var t={vertex:{},fragment:{}},r=Qn(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=B(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 ti;function pr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Vs(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 Vs(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 ri(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?ri(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ri(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var si=`
|
|
192
201
|
|
|
193
|
-
|
|
194
|
-
logdepth_setFragDepth();
|
|
195
|
-
#endif
|
|
196
|
-
`],[`\\
|
|
197
|
-
#ifdef MODULE_MATERIAL
|
|
198
|
-
gl_FragColor = material_filterColor(gl_FragColor);
|
|
199
|
-
#endif
|
|
202
|
+
`.concat(ie,`
|
|
200
203
|
|
|
201
|
-
|
|
202
|
-
gl_FragColor = lighting_filterColor(gl_FragColor);
|
|
203
|
-
#endif
|
|
204
|
-
|
|
205
|
-
#ifdef MODULE_FOG
|
|
206
|
-
gl_FragColor = fog_filterColor(gl_FragColor);
|
|
207
|
-
#endif
|
|
208
|
-
|
|
209
|
-
#ifdef MODULE_PICKING
|
|
210
|
-
gl_FragColor = picking_filterHighlightColor(gl_FragColor);
|
|
211
|
-
gl_FragColor = picking_filterPickingColor(gl_FragColor);
|
|
212
|
-
#endif
|
|
213
|
-
|
|
214
|
-
#ifdef MODULE_LOGDEPTH
|
|
215
|
-
logdepth_setFragDepth();
|
|
216
|
-
#endif
|
|
217
|
-
`])));var xl={vs:Na,fs:Ma},Ia=/void\s+main\s*\([^)]*\)\s*\{\n?/,Fa=/}\n?[^{}]*$/,$n=[],nr="__LUMA_INJECT_DECLARATIONS__";function qn(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=t==="vs",o=function(){var f=r[a];f.sort(function(p,d){return p.order-d.order}),$n.length=f.length;for(var u=0,_=f.length;u<_;++u)$n[u]=f[u].injection;var E="".concat($n.join(`
|
|
218
|
-
`),`
|
|
219
|
-
`);switch(a){case"vs:#decl":i&&(e=e.replace(nr,E));break;case"vs:#main-start":i&&(e=e.replace(Ia,function(p){return p+E}));break;case"vs:#main-end":i&&(e=e.replace(Fa,function(p){return E+p}));break;case"fs:#decl":i||(e=e.replace(nr,E));break;case"fs:#main-start":i||(e=e.replace(Ia,function(p){return p+E}));break;case"fs:#main-end":i||(e=e.replace(Fa,function(p){return E+p}));break;default:e=e.replace(a,function(p){return p+E})}};for(var a in r)o();return e=e.replace(nr,""),n&&(e=e.replace(/\}\s*$/,function(c){return c+xl[t]})),e}function Dl(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Bl(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
220
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Bl(e,t){if(e){if(typeof e=="string")return xa(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 xa(e,t)}}function xa(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 Da(e,t,r){switch(t){case 300:return r?Wr(e,wl):Wl(e);case 100:return r?Wr(e,Ll):Vl(e);default:throw new Error("unknown GLSL version ".concat(t))}}var Ba=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,`#version 300 es
|
|
221
|
-
`],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],wl=[].concat(Ba,[[Ft("attribute"),"in $1"],[Ft("varying"),"out $1"]]),Ul=[].concat(Ba,[[Ft("varying"),"in $1"]]),wa=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],Ll=[].concat(wa,[[Ft("in"),"attribute $1"],[Ft("out"),"varying $1"]]),Xl=[].concat(wa,[[Ft("in"),"varying $1"]]),Zn="gl_FragColor",Qn=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,Hl=/void\s+main\s*\([^)]*\)\s*\{\n?/;function Wr(e,t){var r=Dl(t),n;try{for(r.s();!(n=r.n()).done;){var i=W(n.value,2),o=i[0],a=i[1];e=e.replace(o,a)}}catch(c){r.e(c)}finally{r.f()}return e}function Wl(e){e=Wr(e,Ul);var t=Qn.exec(e);if(t){var r=t[1];e=e.replace(new RegExp("\\b".concat(Zn,"\\b"),"g"),r)}else{var n="fragmentColor";e=e.replace(Hl,function(i){return"out vec4 ".concat(n,`;
|
|
222
|
-
`).concat(i)}).replace(new RegExp("\\b".concat(Zn,"\\b"),"g"),n)}return e}function Vl(e){e=Wr(e,Xl);var t=Qn.exec(e);if(t){var r=t[1];e=e.replace(Qn,"").replace(new RegExp("\\b".concat(r,"\\b"),"g"),Zn)}return e}function Ft(e){return new RegExp("\\b".concat(e,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}var Ua;function Jn(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=jl(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
223
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function jl(e,t){if(e){if(typeof e=="string")return La(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 La(e,t)}}function La(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,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 Vr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xa(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Kl=`
|
|
224
|
-
|
|
225
|
-
`.concat(nr,`
|
|
226
|
-
|
|
227
|
-
`),Wa={fs:"fragment",vs:"vertex"},kl=Ee(Ua||(Ua=fe([`precision highp float;
|
|
204
|
+
`),Hs=nt(ti||(ti=$([`precision highp float;
|
|
228
205
|
|
|
229
206
|
`],[`\\
|
|
230
207
|
precision highp float;
|
|
231
208
|
|
|
232
|
-
`])));function
|
|
233
|
-
`),
|
|
234
|
-
`)):
|
|
235
|
-
`).concat(
|
|
236
|
-
|
|
237
|
-
`).concat(
|
|
238
|
-
`).concat(
|
|
239
|
-
`).concat(
|
|
240
|
-
`).concat(
|
|
241
|
-
`):"".concat(
|
|
242
|
-
`)
|
|
243
|
-
#define
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
`):""}function $l(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=0,r="";for(var n in e){t===0&&(r+=`
|
|
209
|
+
`])));function ai(e,t){var r=t.vs,n=t.fs,i=In(t.modules||[]);switch(e.shaderLanguage){case"glsl":return{vs:ii(e,St(St({},t),{},{source:r,stage:"vertex",modules:i})),fs:ii(e,St(St({},t),{},{source:n,stage:"fragment",modules:i})),getUniforms:oi(i)};case"wgsl":return{vs:ni(e,St(St({},t),{},{source:r,stage:"vertex",modules:i})),fs:ni(e,St(St({},t),{},{source:n,stage:"fragment",modules:i})),getUniforms:oi(i)}}}function ni(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=hr(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=pr(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+=si,m=oe(m,n,O),m+=lr(y[n],b),m+=h,m=oe(m,n,R),m}function ii(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
|
+
`),w=100,M="",j=i;S[0].indexOf("#version ")===0?(w=300,M=S[0],j=S.slice(1).join(`
|
|
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(qs({id:n,source:i,stage:o}),`
|
|
213
|
+
`,"#define SHADER_TYPE_".concat(o.toUpperCase()),`
|
|
214
|
+
`).concat(Wn(e),`
|
|
215
|
+
`).concat(Kn(e),`
|
|
216
|
+
`).concat(Ws(U),`
|
|
217
|
+
`).concat(o==="fragment"?Hs:"",`
|
|
218
|
+
`):"".concat(M,`
|
|
219
|
+
`);break}var g=hr(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 z=D[2],I=D[3];z?I==="decl"?d[E]=[P]:_[E]=[P]:p[E]=[P]}else _[E]=[P]}var G=pr(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+=si,C=oe(C,o,d),C+=lr(g[o],p),C+=j,C=oe(C,o,_),C=Xn(C,N,o),C.trim()}function oi(e){return function(r){var n={},i=pr(e),o;try{for(i.s();!(o=i.n()).done;){var s=o.value,c=s.getUniforms(r,n);Object.assign(n,c)}}catch(a){i.e(a)}finally{i.f()}return n}}function qs(e){var t=e.id,r=e.source,n=e.stage,i=t&&r.indexOf("SHADER_NAME")===-1;return i?`
|
|
220
|
+
#define SHADER_NAME `.concat(t,"_").concat(n,`
|
|
221
|
+
|
|
222
|
+
`):""}function Ws(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=0,r="";for(var n in e){t===0&&(r+=`
|
|
248
223
|
// APPLICATION DEFINES
|
|
249
224
|
`),t++;var i=e[n];(i||Number.isFinite(i))&&(r+="#define ".concat(n.toUpperCase()," ").concat(e[n],`
|
|
250
225
|
`))}return t===0&&(r+=`
|
|
251
|
-
`),r}function ql(e,t){var r="";for(var n in e){var i=e[n];if(r+="void ".concat(i.signature,` {
|
|
252
|
-
`),i.header&&(r+=" ".concat(i.header)),t[n]){var o=t[n];o.sort(function(u,_){return u.order-_.order});var a=Jn(o),c;try{for(a.s();!(c=a.n()).done;){var f=c.value;r+=" ".concat(f.injection,`
|
|
253
|
-
`)}}catch(u){a.e(u)}finally{a.f()}}i.footer&&(r+=" ".concat(i.footer)),r+=`}
|
|
254
|
-
`}return r}function Zl(e){var t={vs:{},fs:{}};return e.forEach(function(r){var n,i;typeof r!="string"?(n=r,i=n.hook):(n={},i=r),i=i.trim();var o=i.split(":"),a=W(o,2),c=a[0],f=a[1],u=i.replace(/\(.+/,"");if(c!=="vs"&&c!=="fs")throw new Error(c);t[c][u]=Object.assign(n,{signature:f})}),t}function ja(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 Ka(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ja(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ja(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ya(e,t){if(!t.vs)throw new Error("no vertex shader");var r=ka(e,t.vs),n;return t.fs&&(n=ka(e,t.fs)),Ka(Ka({},t),{},{vs:r,fs:n})}function ka(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 za(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?za(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):za(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var jr=function(){function e(){C(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),a=this._hookFunctions,c=Ya(n,i),f=Va(n,Ga(Ga({},c),{},{modules:o,hookFunctions:a}));return f},t._getModuleList=function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i=new Array(this._defaultModules.length+n.length),o={},a=0,c=0,f=this._defaultModules.length;c<f;++c){var u=this._defaultModules[c],_=u.name;i[a++]=u,o[_]=!0}for(var E=0,p=n.length;E<p;++E){var d=n[E],h=d.name;o[h]||(i[a++]=d,o[h]=!0)}return i.length=a,i},y(e)}();jr.defaultShaderAssembler=void 0;function ei(e,t){return{name:Ql(e,t),language:"glsl",version:Jl(e)}}function Ql(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unnamed",r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,n=r.exec(e);return n?n[1]:t}function Jl(e){var t=100,r=e.match(/[^\s]+/g);if(r&&r.length>=2&&r[0]==="#version"){var n=parseInt(r[1],10);Number.isFinite(n)&&(t=n)}return t}var $a,qa,e_=Ee($a||($a=fe(["void main() {gl_FragColor = vec4(0);}"]))),Za=Ee(qa||(qa=fe([`out vec4 transform_output;
|
|
255
|
-
void main() {
|
|
256
|
-
transform_output = vec4(0);
|
|
257
|
-
}`],[`\\
|
|
258
|
-
out vec4 transform_output;
|
|
259
|
-
void main() {
|
|
260
|
-
transform_output = vec4(0);
|
|
261
|
-
}`]))),t_=`#version 300 es
|
|
262
|
-
`.concat(Za);function ti(e){var t=e||{},r=t.version,n=r===void 0?100:r,i=t.input,o=t.inputType,a=t.output;if(!i)return n===300?t_:n>300?"#version ".concat(n,`
|
|
263
|
-
`).concat(Za):e_;if(!o)throw new Error("inputType");var c=Qa(i,o);return n>=300?"#version ".concat(n," ").concat(n===300?"es":"",`
|
|
264
|
-
in `).concat(o," ").concat(i,`;
|
|
265
|
-
out vec4 `).concat(a,`;
|
|
266
|
-
void main() {
|
|
267
|
-
`).concat(a," = ").concat(c,`;
|
|
268
|
-
}`):"varying ".concat(o," ").concat(i,`;
|
|
269
|
-
void main() {
|
|
270
|
-
gl_FragColor = `).concat(c,`;
|
|
271
|
-
}`)}function Qa(e,t){switch(t){case"float":return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(e,", 0.0, 1.0)");case"vec3":return"vec4(".concat(e,", 1.0)");case"vec4":return e;default:throw new Error(t)}}var gv=1/Math.PI*180,vv=1/180*Math.PI,r_={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...r_}};var de=globalThis.mathgl.config;function Ja(e,{precision:t=de.precision}={}){return e=n_(e),"".concat(parseFloat(e.toPrecision(t)))}function xt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ri(e,t,r){let n=de.EPSILON;r&&(de.EPSILON=r);try{if(e===t)return!0;if(xt(e)&&xt(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!ri(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)<=de.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{de.EPSILON=n}}function n_(e){return Math.round(e/de.EPSILON)*de.EPSILON}function i_(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 Dt=class extends i_(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:xt(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(de)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Ja(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(!ri(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],a=typeof r=="number"?r:r[i];this[i]=o+n*(a-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(de.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 o_(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 Re(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function Kr(e,t,r=""){if(de.debug&&!o_(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function ni(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var kr=class extends Dt{get x(){return this[0]}set x(t){this[0]=Re(t)}get y(){return this[1]}set y(t){this[1]=Re(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 Re(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Re(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 ni(t>=0&&t<this.ELEMENTS,"index is out of range"),Re(this[t])}setComponent(t,r){return ni(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 qe=typeof Float32Array<"u"?Float32Array:Array;var xv=Math.PI/180;function a_(){let e=new qe(2);return qe!=Float32Array&&(e[0]=0,e[1]=0),e}function rs(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 Dv=function(){let e=a_();return function(t,r,n,i,o,a){let c,f;for(r||(r=2),n||(n=0),i?f=Math.min(i*r+n,t.length):f=t.length,c=n;c<f;c+=r)e[0]=t[c],e[1]=t[c+1],o(e,e,a),t[c]=e[0],t[c+1]=e[1];return t}}();function ns(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 Yr(e,t,r){let n=t[0],i=t[1],o=t[2],a=r[3]*n+r[7]*i+r[11]*o||1;return e[0]=(r[0]*n+r[4]*i+r[8]*o)/a,e[1]=(r[1]*n+r[5]*i+r[9]*o)/a,e[2]=(r[2]*n+r[6]*i+r[10]*o)/a,e}function is(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 s_(){let e=new qe(3);return qe!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function c_(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function os(e,t,r){let n=t[0],i=t[1],o=t[2],a=r[0],c=r[1],f=r[2];return e[0]=i*f-o*c,e[1]=o*a-n*f,e[2]=n*c-i*a,e}function zr(e,t,r){let n=t[0],i=t[1],o=t[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,e}function as(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 ss(e,t,r){let n=r[0],i=r[1],o=r[2],a=r[3],c=t[0],f=t[1],u=t[2],_=i*u-o*f,E=o*c-n*u,p=n*f-i*c,d=i*p-o*E,h=o*_-n*p,m=n*E-i*_,A=a*2;return _*=A,E*=A,p*=A,d*=2,h*=2,m*=2,e[0]=c+_+d,e[1]=f+E+h,e[2]=u+p+m,e}function cs(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 fs(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 us(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 ls(e,t){let r=e[0],n=e[1],i=e[2],o=t[0],a=t[1],c=t[2],f=Math.sqrt((r*r+n*n+i*i)*(o*o+a*a+c*c)),u=f&&c_(e,t)/f;return Math.acos(Math.min(Math.max(u,-1),1))}var Uv=function(){let e=s_();return function(t,r,n,i,o,a){let c,f;for(r||(r=3),n||(n=0),i?f=Math.min(i*r+n,t.length):f=t.length,c=n;c<f;c+=r)e[0]=t[c],e[1]=t[c+1],e[2]=t[c+2],o(e,e,a),t[c]=e[0],t[c+1]=e[1],t[c+2]=e[2];return t}}();var oi=[0,0,0],Gr,ve=class extends kr{static get ZERO(){return Gr||(Gr=new ve(0,0,0),Object.freeze(Gr)),Gr}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&xt(t)?this.copy(t):(de.debug&&(Re(t),Re(r),Re(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 de.debug&&(Re(t.x),Re(t.y),Re(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]=Re(t)}angle(t){return ls(this,t)}cross(t){return os(this,this,t),this.check()}rotateX({radians:t,origin:r=oi}){return cs(this,this,r,t),this.check()}rotateY({radians:t,origin:r=oi}){return fs(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=oi}){return us(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return zr(this,this,t),this.check()}transformAsVector(t){return Yr(this,this,t),this.check()}transformByMatrix3(t){return as(this,this,t),this.check()}transformByMatrix2(t){return is(this,this,t),this.check()}transformByQuaternion(t){return ss(this,this,t),this.check()}};var $r=class extends Dt{toString(){let t="[";if(de.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]=Re(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 f_(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 _s(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],o=t[6],a=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]=a,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 Es(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],c=t[5],f=t[6],u=t[7],_=t[8],E=t[9],p=t[10],d=t[11],h=t[12],m=t[13],A=t[14],T=t[15],P=r*c-n*a,S=r*f-i*a,O=r*u-o*a,F=n*f-i*c,M=n*u-o*c,X=i*u-o*f,j=_*m-E*h,k=_*A-p*h,V=_*T-d*h,g=E*A-p*m,R=E*T-d*m,v=p*T-d*A,I=P*v-S*R+O*g+F*V-M*k+X*j;return I?(I=1/I,e[0]=(c*v-f*R+u*g)*I,e[1]=(i*R-n*v-o*g)*I,e[2]=(m*X-A*M+T*F)*I,e[3]=(p*M-E*X-d*F)*I,e[4]=(f*V-a*v-u*k)*I,e[5]=(r*v-i*V+o*k)*I,e[6]=(A*O-h*X-T*S)*I,e[7]=(_*X-p*O+d*S)*I,e[8]=(a*R-c*V+u*j)*I,e[9]=(n*V-r*R-o*j)*I,e[10]=(h*M-m*O+T*P)*I,e[11]=(E*O-_*M-d*P)*I,e[12]=(c*k-a*g-f*j)*I,e[13]=(r*g-n*k+i*j)*I,e[14]=(m*S-h*F-A*P)*I,e[15]=(_*F-E*S+p*P)*I,e):null}function ps(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],c=e[6],f=e[7],u=e[8],_=e[9],E=e[10],p=e[11],d=e[12],h=e[13],m=e[14],A=e[15],T=t*a-r*o,P=t*c-n*o,S=r*c-n*a,O=u*h-_*d,F=u*m-E*d,M=_*m-E*h,X=t*M-r*F+n*O,j=o*M-a*F+c*O,k=u*S-_*P+E*T,V=d*S-h*P+m*T;return f*X-i*j+A*k-p*V}function ai(e,t,r){let n=t[0],i=t[1],o=t[2],a=t[3],c=t[4],f=t[5],u=t[6],_=t[7],E=t[8],p=t[9],d=t[10],h=t[11],m=t[12],A=t[13],T=t[14],P=t[15],S=r[0],O=r[1],F=r[2],M=r[3];return e[0]=S*n+O*c+F*E+M*m,e[1]=S*i+O*f+F*p+M*A,e[2]=S*o+O*u+F*d+M*T,e[3]=S*a+O*_+F*h+M*P,S=r[4],O=r[5],F=r[6],M=r[7],e[4]=S*n+O*c+F*E+M*m,e[5]=S*i+O*f+F*p+M*A,e[6]=S*o+O*u+F*d+M*T,e[7]=S*a+O*_+F*h+M*P,S=r[8],O=r[9],F=r[10],M=r[11],e[8]=S*n+O*c+F*E+M*m,e[9]=S*i+O*f+F*p+M*A,e[10]=S*o+O*u+F*d+M*T,e[11]=S*a+O*_+F*h+M*P,S=r[12],O=r[13],F=r[14],M=r[15],e[12]=S*n+O*c+F*E+M*m,e[13]=S*i+O*f+F*p+M*A,e[14]=S*o+O*u+F*d+M*T,e[15]=S*a+O*_+F*h+M*P,e}function ds(e,t,r){let n=r[0],i=r[1],o=r[2],a,c,f,u,_,E,p,d,h,m,A,T;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]):(a=t[0],c=t[1],f=t[2],u=t[3],_=t[4],E=t[5],p=t[6],d=t[7],h=t[8],m=t[9],A=t[10],T=t[11],e[0]=a,e[1]=c,e[2]=f,e[3]=u,e[4]=_,e[5]=E,e[6]=p,e[7]=d,e[8]=h,e[9]=m,e[10]=A,e[11]=T,e[12]=a*n+_*i+h*o+t[12],e[13]=c*n+E*i+m*o+t[13],e[14]=f*n+p*i+A*o+t[14],e[15]=u*n+d*i+T*o+t[15]),e}function hs(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 ms(e,t,r,n){let i=n[0],o=n[1],a=n[2],c=Math.sqrt(i*i+o*o+a*a),f,u,_,E,p,d,h,m,A,T,P,S,O,F,M,X,j,k,V,g,R,v,I,B;return c<1e-6?null:(c=1/c,i*=c,o*=c,a*=c,u=Math.sin(r),f=Math.cos(r),_=1-f,E=t[0],p=t[1],d=t[2],h=t[3],m=t[4],A=t[5],T=t[6],P=t[7],S=t[8],O=t[9],F=t[10],M=t[11],X=i*i*_+f,j=o*i*_+a*u,k=a*i*_-o*u,V=i*o*_-a*u,g=o*o*_+f,R=a*o*_+i*u,v=i*a*_+o*u,I=o*a*_-i*u,B=a*a*_+f,e[0]=E*X+m*j+S*k,e[1]=p*X+A*j+O*k,e[2]=d*X+T*j+F*k,e[3]=h*X+P*j+M*k,e[4]=E*V+m*g+S*R,e[5]=p*V+A*g+O*R,e[6]=d*V+T*g+F*R,e[7]=h*V+P*g+M*R,e[8]=E*v+m*I+S*B,e[9]=p*v+A*I+O*B,e[10]=d*v+T*I+F*B,e[11]=h*v+P*I+M*B,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Rs(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[4],a=t[5],c=t[6],f=t[7],u=t[8],_=t[9],E=t[10],p=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+u*n,e[5]=a*i+_*n,e[6]=c*i+E*n,e[7]=f*i+p*n,e[8]=u*i-o*n,e[9]=_*i-a*n,e[10]=E*i-c*n,e[11]=p*i-f*n,e}function As(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],c=t[2],f=t[3],u=t[8],_=t[9],E=t[10],p=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-u*n,e[1]=a*i-_*n,e[2]=c*i-E*n,e[3]=f*i-p*n,e[8]=o*n+u*i,e[9]=a*n+_*i,e[10]=c*n+E*i,e[11]=f*n+p*i,e}function Ts(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],c=t[2],f=t[3],u=t[4],_=t[5],E=t[6],p=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+u*n,e[1]=a*i+_*n,e[2]=c*i+E*n,e[3]=f*i+p*n,e[4]=u*i-o*n,e[5]=_*i-a*n,e[6]=E*i-c*n,e[7]=p*i-f*n,e}function gs(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],a=r+r,c=n+n,f=i+i,u=r*a,_=n*a,E=n*c,p=i*a,d=i*c,h=i*f,m=o*a,A=o*c,T=o*f;return e[0]=1-E-h,e[1]=_+T,e[2]=p-A,e[3]=0,e[4]=_-T,e[5]=1-u-h,e[6]=d+m,e[7]=0,e[8]=p+A,e[9]=d-m,e[10]=1-u-E,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function vs(e,t,r,n,i,o,a){let c=1/(r-t),f=1/(i-n),u=1/(o-a);return e[0]=o*2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*f,e[6]=0,e[7]=0,e[8]=(r+t)*c,e[9]=(i+n)*f,e[10]=(a+o)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*u,e[15]=0,e}function u_(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 a=1/(n-i);e[10]=(i+n)*a,e[14]=2*i*n*a}else e[10]=-1,e[14]=-2*n;return e}var Ss=u_;function l_(e,t,r,n,i,o,a){let c=1/(t-r),f=1/(n-i),u=1/(o-a);return e[0]=-2*c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*c,e[13]=(i+n)*f,e[14]=(a+o)*u,e[15]=1,e}var Os=l_;function bs(e,t,r,n){let i,o,a,c,f,u,_,E,p,d,h=t[0],m=t[1],A=t[2],T=n[0],P=n[1],S=n[2],O=r[0],F=r[1],M=r[2];return Math.abs(h-O)<1e-6&&Math.abs(m-F)<1e-6&&Math.abs(A-M)<1e-6?f_(e):(E=h-O,p=m-F,d=A-M,i=1/Math.sqrt(E*E+p*p+d*d),E*=i,p*=i,d*=i,o=P*d-S*p,a=S*E-T*d,c=T*p-P*E,i=Math.sqrt(o*o+a*a+c*c),i?(i=1/i,o*=i,a*=i,c*=i):(o=0,a=0,c=0),f=p*c-d*a,u=d*o-E*c,_=E*a-p*o,i=Math.sqrt(f*f+u*u+_*_),i?(i=1/i,f*=i,u*=i,_*=i):(f=0,u=0,_=0),e[0]=o,e[1]=f,e[2]=E,e[3]=0,e[4]=a,e[5]=u,e[6]=p,e[7]=0,e[8]=c,e[9]=_,e[10]=d,e[11]=0,e[12]=-(o*h+a*m+c*A),e[13]=-(f*h+u*m+_*A),e[14]=-(E*h+p*m+d*A),e[15]=1,e)}function __(){let e=new qe(4);return qe!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function ys(e,t,r){let n=t[0],i=t[1],o=t[2],a=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,e}var qv=function(){let e=__();return function(t,r,n,i,o,a){let c,f;for(r||(r=4),n||(n=0),i?f=Math.min(i*r+n,t.length):f=t.length,c=n;c<f;c+=r)e[0]=t[c],e[1]=t[c+1],e[2]=t[c+2],e[3]=t[c+3],o(e,e,a),t[c]=e[0],t[c+1]=e[1],t[c+2]=e[2],t[c+3]=e[3];return t}}();var fi;(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"})(fi||(fi={}));var E_=45*Math.PI/180,p_=1,si=.1,ci=500,d_=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Be=class extends $r{static get IDENTITY(){return m_()}static get ZERO(){return h_()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return fi}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,a,c,f,u,_,E,p,d,h,m,A){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=a,this[6]=c,this[7]=f,this[8]=u,this[9]=_,this[10]=E,this[11]=p,this[12]=d,this[13]=h,this[14]=m,this[15]=A,this.check()}setRowMajor(t,r,n,i,o,a,c,f,u,_,E,p,d,h,m,A){return this[0]=t,this[1]=o,this[2]=u,this[3]=d,this[4]=r,this[5]=a,this[6]=_,this[7]=h,this[8]=n,this[9]=c,this[10]=E,this[11]=m,this[12]=i,this[13]=f,this[14]=p,this[15]=A,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(d_)}fromObject(t){return this.check()}fromQuaternion(t){return gs(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:o,near:a=si,far:c=ci}=t;return c===1/0?R_(this,r,n,i,o,a):vs(this,r,n,i,o,a,c),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return bs(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:a=si,far:c=ci}=t;return Os(this,r,n,i,o,a,c),this.check()}orthographic(t){let{fovy:r=E_,aspect:n=p_,focalDistance:i=1,near:o=si,far:a=ci}=t;Cs(r);let c=r/2,f=i*Math.tan(c),u=f*n;return this.ortho({left:-u,right:u,bottom:-f,top:f,near:o,far:a})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return Cs(r),Ss(this,r,n,i,o),this.check()}determinant(){return ps(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],a=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*a,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*o,t[6]=this[6]*a,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*o,t[10]=this[10]*a,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],a=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*a,t[3]=this[4]*i,t[4]=this[5]*o,t[5]=this[6]*a,t[6]=this[8]*i,t[7]=this[9]*o,t[8]=this[10]*a,t}transpose(){return _s(this,this),this.check()}invert(){return Es(this,this),this.check()}multiplyLeft(t){return ai(this,t,this),this.check()}multiplyRight(t){return ai(this,this,t),this.check()}rotateX(t){return Rs(this,this,t),this.check()}rotateY(t){return As(this,this,t),this.check()}rotateZ(t){return Ts(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return ms(this,this,t,r),this.check()}scale(t){return hs(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return ds(this,this,t),this.check()}transform(t,r){return t.length===4?(r=ys(r||[-0,-0,-0,-0],t,this),Kr(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=rs(r||[-0,-0],t,this);break;case 3:i=zr(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Kr(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=ns(r||[-0,-0],t,this);break;case 3:n=Yr(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Kr(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])}},qr,Zr;function h_(){return qr||(qr=new Be([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(qr)),qr}function m_(){return Zr||(Zr=new Be,Object.freeze(Zr)),Zr}function Cs(e){if(e>Math.PI*2)throw Error("expected radians")}function R_(e,t,r,n,i,o){let a=2*o/(r-t),c=2*o/(i-n),f=(r+t)/(r-t),u=(i+n)/(i-n),_=-1,E=-1,p=-2*o;return e[0]=a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=f,e[9]=u,e[10]=_,e[11]=E,e[12]=0,e[13]=0,e[14]=p,e[15]=0,e}var Ps=function(){function e(r){C(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||J("geometry"),this.topology=r.topology,this.indices=r.indices||null,this.attributes=r.attributes,this.vertexCount=r.vertexCount,this.bufferLayout=r.bufferLayout||[],this.indices&&H(this.indices.usage===se.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},y(e)}();function Ns(e,t){if(t instanceof Ps)return t;var r=A_(e,t),n=T_(e,t),i=n.attributes,o=n.bufferLayout;return new Ps({topology:t.topology||"triangle-list",bufferLayout:o,vertexCount:t.vertexCount,indices:r,attributes:i})}function A_(e,t){if(t.indices){var r=t.indices.value;return e.createBuffer({usage:se.INDEX,data:r})}}function T_(e,t){for(var r=[],n={},i=0,o=Object.entries(t.attributes);i<o.length;i++){var a=W(o[i],2),c=a[0],f=a[1],u=c;switch(c){case"POSITION":u="positions";break;case"NORMAL":u="normals";break;case"TEXCOORD_0":u="texCoords";break}n[u]=e.createBuffer({data:f.value,id:"".concat(c,"-buffer")}),r.push({name:u,format:"float32x".concat(f.size)})}var _=t._calculateVertexCount(t.attributes,t.indices);return{attributes:n,bufferLayout:r,vertexCount:_}}function Ms(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?Ms(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ms(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ir=function(){e.getDefaultPipelineFactory=function(n){return n._lumaData.defaultPipelineFactory=n._lumaData.defaultPipelineFactory||new e(n),n._lumaData.defaultPipelineFactory};function e(r){C(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=Ze(Ze({},e.defaultProps),n),o=this._hashRenderPipeline(Ze({},i));if(!this._pipelineCache[o]){var a=this.device.createRenderPipeline(Ze(Ze({},i),{},{vs:this.device.createShader({stage:"vertex",source:i.vs}),fs:i.fs?this.device.createShader({stage:"fragment",source:i.fs}):null}));a.hash=o,this._pipelineCache[o]=a,this._useCounts[o]=0}return this._useCounts[o]++,this._pipelineCache[o]},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(Ze(Ze({},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,a="-";switch(this.device.info.type){case"webgpu":var c=this._getHash(JSON.stringify(n.parameters)),f=this._getHash(JSON.stringify(n.bufferLayout));return"".concat(i,"/").concat(o,"V").concat(a,"T").concat(n.topology,"P").concat(c,"BL").concat(f,"}");default:return"".concat(i,"/").concat(o,"V").concat(a)}},t._getHash=function(n){return this._hashes[n]===void 0&&(this._hashes[n]=this._hashCounter++),this._hashes[n]},y(e)}();ir.defaultProps=Ze(Ze({},it.defaultProps),{},{vs:void 0,fs:void 0});function g_(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=v_(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
272
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function v_(e,t){if(e){if(typeof e=="string")return Is(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 Is(e,t)}}function Is(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 Fs(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?Fs(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ht=function(){function e(r,n){C(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.indices=null,this.bufferAttributes={},this.constantAttributes={},this.bindings={},this.uniforms={},this.pipeline=void 0,this._pipelineNeedsUpdate="newly created",this._getModuleUniforms=void 0,this.props=void 0,this.props=wt(wt({},e.defaultProps),n),n=this.props,this.id=n.id||J("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),a=o.vs,c=o.fs,f=o.getUniforms;this.vs=a,this.fs=c,this._getModuleUniforms=f,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.setGeometry(n.geometry),this.pipelineFactory=n.pipelineFactory||ir.getDefaultPipelineFactory(this.device),this.pipeline=this._updatePipeline(),n.vertexCount&&this.setVertexCount(n.vertexCount),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.indices&&this.setIndexBuffer(n.indices),n.attributes&&this.setAttributes(n.attributes),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.setIndexBuffer(this.indices),this.pipeline.setAttributes(this.bufferAttributes),this.pipeline.setConstantAttributes(this.constantAttributes),this.pipeline.setBindings(this.bindings),this.pipeline.setUniforms(this.uniforms),this.pipeline.draw({renderPass:n,vertexCount:this.vertexCount,instanceCount:this.instanceCount})},t.setGeometry=function(n){var i=n&&Ns(this.device,n);this.setTopology(i.topology||"triangle-list"),this.bufferLayout=S_(this.bufferLayout,i.bufferLayout),this.vertexCount=i.vertexCount,this.setAttributes(i.attributes),this.setIndexBuffer(i.indices)},t.setTopology=function(n){n!==this.topology&&(this.topology=n,this._setPipelineNeedsUpdate("topology"))},t.setBufferLayout=function(n){n!==this.bufferLayout&&(this.bufferLayout=n,this._setPipelineNeedsUpdate("bufferLayout"))},t.setParameters=function(n){tr(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);Object.assign(this.uniforms,i)},t.updateModuleSettings=function(n){this.setShaderModuleProps(n)},t.setIndexBuffer=function(n){this.indices=n},t.setAttributes=function(n){n.indices&&x.warn("Model:".concat(this.id," setAttributes() - indices should be set using setIndexBuffer()")),Object.assign(this.bufferAttributes,n)},t.setConstantAttributes=function(n){Object.assign(this.constantAttributes,n)},t.setBindings=function(n){Object.assign(this.bindings,n)},t.setUniforms=function(n){this.pipeline.setUniforms(n),Object.assign(this.uniforms,n)},t._setPipelineNeedsUpdate=function(n){this._pipelineNeedsUpdate=this._pipelineNeedsUpdate||n},t._updatePipeline=function(){return this._pipelineNeedsUpdate&&(x.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({stage:"vertex",source:this.vs}),fs:this.fs?this.device.createShader({stage:"fragment",source:this.fs}):null}))),this.pipeline},y(e)}();ht.defaultProps=wt(wt({},it.defaultProps),{},{vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:{},geometry:null,pipelineFactory:void 0,shaderAssembler:jr.getDefaultShaderAssembler()});function S_(e,t){var r=te(e),n=g_(t),i;try{var o=function(){var c=i.value,f=r.findIndex(function(u){return u.name===c.name});f<0?r.push(c):r[f]=c};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}var s=function(e){return e[e.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",e[e.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",e[e.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN",e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.FUNC_ADD=32774]="FUNC_ADD",e[e.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",e[e.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",e[e.BLEND_EQUATION=32777]="BLEND_EQUATION",e[e.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",e[e.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",e[e.BLEND_DST_RGB=32968]="BLEND_DST_RGB",e[e.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",e[e.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",e[e.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",e[e.BLEND_COLOR=32773]="BLEND_COLOR",e[e.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",e[e.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",e[e.LINE_WIDTH=2849]="LINE_WIDTH",e[e.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",e[e.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",e[e.CULL_FACE_MODE=2885]="CULL_FACE_MODE",e[e.FRONT_FACE=2886]="FRONT_FACE",e[e.DEPTH_RANGE=2928]="DEPTH_RANGE",e[e.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",e[e.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",e[e.DEPTH_FUNC=2932]="DEPTH_FUNC",e[e.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",e[e.STENCIL_FUNC=2962]="STENCIL_FUNC",e[e.STENCIL_FAIL=2964]="STENCIL_FAIL",e[e.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",e[e.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",e[e.STENCIL_REF=2967]="STENCIL_REF",e[e.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",e[e.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",e[e.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",e[e.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",e[e.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",e[e.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",e[e.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",e[e.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",e[e.VIEWPORT=2978]="VIEWPORT",e[e.SCISSOR_BOX=3088]="SCISSOR_BOX",e[e.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",e[e.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",e[e.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",e[e.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",e[e.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",e[e.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",e[e.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",e[e.RED_BITS=3410]="RED_BITS",e[e.GREEN_BITS=3411]="GREEN_BITS",e[e.BLUE_BITS=3412]="BLUE_BITS",e[e.ALPHA_BITS=3413]="ALPHA_BITS",e[e.DEPTH_BITS=3414]="DEPTH_BITS",e[e.STENCIL_BITS=3415]="STENCIL_BITS",e[e.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",e[e.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",e[e.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",e[e.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",e[e.SAMPLES=32937]="SAMPLES",e[e.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",e[e.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",e[e.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",e[e.VENDOR=7936]="VENDOR",e[e.RENDERER=7937]="RENDERER",e[e.VERSION=7938]="VERSION",e[e.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",e[e.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",e[e.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",e[e.STATIC_DRAW=35044]="STATIC_DRAW",e[e.STREAM_DRAW=35040]="STREAM_DRAW",e[e.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.BUFFER_SIZE=34660]="BUFFER_SIZE",e[e.BUFFER_USAGE=34661]="BUFFER_USAGE",e[e.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",e[e.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",e[e.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",e[e.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",e[e.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",e[e.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",e[e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",e[e.CULL_FACE=2884]="CULL_FACE",e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK",e[e.BLEND=3042]="BLEND",e[e.DEPTH_TEST=2929]="DEPTH_TEST",e[e.DITHER=3024]="DITHER",e[e.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",e[e.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",e[e.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",e[e.SCISSOR_TEST=3089]="SCISSOR_TEST",e[e.STENCIL_TEST=2960]="STENCIL_TEST",e[e.NO_ERROR=0]="NO_ERROR",e[e.INVALID_ENUM=1280]="INVALID_ENUM",e[e.INVALID_VALUE=1281]="INVALID_VALUE",e[e.INVALID_OPERATION=1282]="INVALID_OPERATION",e[e.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",e[e.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",e[e.CW=2304]="CW",e[e.CCW=2305]="CCW",e[e.DONT_CARE=4352]="DONT_CARE",e[e.FASTEST=4353]="FASTEST",e[e.NICEST=4354]="NICEST",e[e.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.DOUBLE=5130]="DOUBLE",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",e[e.VERTEX_SHADER=35633]="VERTEX_SHADER",e[e.COMPILE_STATUS=35713]="COMPILE_STATUS",e[e.DELETE_STATUS=35712]="DELETE_STATUS",e[e.LINK_STATUS=35714]="LINK_STATUS",e[e.VALIDATE_STATUS=35715]="VALIDATE_STATUS",e[e.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",e[e.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",e[e.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",e[e.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",e[e.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",e[e.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",e[e.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",e[e.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",e[e.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",e[e.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",e[e.SHADER_TYPE=35663]="SHADER_TYPE",e[e.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",e[e.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",e[e.NEVER=512]="NEVER",e[e.LESS=513]="LESS",e[e.EQUAL=514]="EQUAL",e[e.LEQUAL=515]="LEQUAL",e[e.GREATER=516]="GREATER",e[e.NOTEQUAL=517]="NOTEQUAL",e[e.GEQUAL=518]="GEQUAL",e[e.ALWAYS=519]="ALWAYS",e[e.KEEP=7680]="KEEP",e[e.REPLACE=7681]="REPLACE",e[e.INCR=7682]="INCR",e[e.DECR=7683]="DECR",e[e.INVERT=5386]="INVERT",e[e.INCR_WRAP=34055]="INCR_WRAP",e[e.DECR_WRAP=34056]="DECR_WRAP",e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",e[e.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",e[e.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",e[e.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",e[e.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE=5890]="TEXTURE",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",e[e.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",e[e.TEXTURE0=33984]="TEXTURE0",e[e.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",e[e.REPEAT=10497]="REPEAT",e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",e[e.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D",e[e.SAMPLER_CUBE=35680]="SAMPLER_CUBE",e[e.LOW_FLOAT=36336]="LOW_FLOAT",e[e.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",e[e.HIGH_FLOAT=36338]="HIGH_FLOAT",e[e.LOW_INT=36339]="LOW_INT",e[e.MEDIUM_INT=36340]="MEDIUM_INT",e[e.HIGH_INT=36341]="HIGH_INT",e[e.FRAMEBUFFER=36160]="FRAMEBUFFER",e[e.RENDERBUFFER=36161]="RENDERBUFFER",e[e.RGBA4=32854]="RGBA4",e[e.RGB5_A1=32855]="RGB5_A1",e[e.RGB565=36194]="RGB565",e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.STENCIL_INDEX=6401]="STENCIL_INDEX",e[e.STENCIL_INDEX8=36168]="STENCIL_INDEX8",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL",e[e.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",e[e.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",e[e.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",e[e.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",e[e.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",e[e.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",e[e.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",e[e.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",e[e.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",e[e.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",e[e.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",e[e.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",e[e.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",e[e.NONE=0]="NONE",e[e.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",e[e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",e[e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",e[e.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",e[e.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",e[e.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",e[e.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",e[e.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",e[e.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",e[e.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",e[e.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",e[e.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",e[e.READ_BUFFER=3074]="READ_BUFFER",e[e.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",e[e.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",e[e.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",e[e.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",e[e.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",e[e.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",e[e.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",e[e.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",e[e.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",e[e.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",e[e.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",e[e.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",e[e.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",e[e.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",e[e.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",e[e.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",e[e.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",e[e.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",e[e.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",e[e.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",e[e.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",e[e.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",e[e.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",e[e.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",e[e.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",e[e.RED=6403]="RED",e[e.RGB8=32849]="RGB8",e[e.RGBA8=32856]="RGBA8",e[e.RGB10_A2=32857]="RGB10_A2",e[e.TEXTURE_3D=32879]="TEXTURE_3D",e[e.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",e[e.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",e[e.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",e[e.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",e[e.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",e[e.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",e[e.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",e[e.SRGB=35904]="SRGB",e[e.SRGB8=35905]="SRGB8",e[e.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",e[e.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",e[e.RGBA32F=34836]="RGBA32F",e[e.RGB32F=34837]="RGB32F",e[e.RGBA16F=34842]="RGBA16F",e[e.RGB16F=34843]="RGB16F",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",e[e.R11F_G11F_B10F=35898]="R11F_G11F_B10F",e[e.RGB9_E5=35901]="RGB9_E5",e[e.RGBA32UI=36208]="RGBA32UI",e[e.RGB32UI=36209]="RGB32UI",e[e.RGBA16UI=36214]="RGBA16UI",e[e.RGB16UI=36215]="RGB16UI",e[e.RGBA8UI=36220]="RGBA8UI",e[e.RGB8UI=36221]="RGB8UI",e[e.RGBA32I=36226]="RGBA32I",e[e.RGB32I=36227]="RGB32I",e[e.RGBA16I=36232]="RGBA16I",e[e.RGB16I=36233]="RGB16I",e[e.RGBA8I=36238]="RGBA8I",e[e.RGB8I=36239]="RGB8I",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.R8=33321]="R8",e[e.RG8=33323]="RG8",e[e.R16F=33325]="R16F",e[e.R32F=33326]="R32F",e[e.RG16F=33327]="RG16F",e[e.RG32F=33328]="RG32F",e[e.R8I=33329]="R8I",e[e.R8UI=33330]="R8UI",e[e.R16I=33331]="R16I",e[e.R16UI=33332]="R16UI",e[e.R32I=33333]="R32I",e[e.R32UI=33334]="R32UI",e[e.RG8I=33335]="RG8I",e[e.RG8UI=33336]="RG8UI",e[e.RG16I=33337]="RG16I",e[e.RG16UI=33338]="RG16UI",e[e.RG32I=33339]="RG32I",e[e.RG32UI=33340]="RG32UI",e[e.R8_SNORM=36756]="R8_SNORM",e[e.RG8_SNORM=36757]="RG8_SNORM",e[e.RGB8_SNORM=36758]="RGB8_SNORM",e[e.RGBA8_SNORM=36759]="RGBA8_SNORM",e[e.RGB10_A2UI=36975]="RGB10_A2UI",e[e.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",e[e.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.HALF_FLOAT=5131]="HALF_FLOAT",e[e.RG=33319]="RG",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",e[e.CURRENT_QUERY=34917]="CURRENT_QUERY",e[e.QUERY_RESULT=34918]="QUERY_RESULT",e[e.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",e[e.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",e[e.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",e[e.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",e[e.DRAW_BUFFER0=34853]="DRAW_BUFFER0",e[e.DRAW_BUFFER1=34854]="DRAW_BUFFER1",e[e.DRAW_BUFFER2=34855]="DRAW_BUFFER2",e[e.DRAW_BUFFER3=34856]="DRAW_BUFFER3",e[e.DRAW_BUFFER4=34857]="DRAW_BUFFER4",e[e.DRAW_BUFFER5=34858]="DRAW_BUFFER5",e[e.DRAW_BUFFER6=34859]="DRAW_BUFFER6",e[e.DRAW_BUFFER7=34860]="DRAW_BUFFER7",e[e.DRAW_BUFFER8=34861]="DRAW_BUFFER8",e[e.DRAW_BUFFER9=34862]="DRAW_BUFFER9",e[e.DRAW_BUFFER10=34863]="DRAW_BUFFER10",e[e.DRAW_BUFFER11=34864]="DRAW_BUFFER11",e[e.DRAW_BUFFER12=34865]="DRAW_BUFFER12",e[e.DRAW_BUFFER13=34866]="DRAW_BUFFER13",e[e.DRAW_BUFFER14=34867]="DRAW_BUFFER14",e[e.DRAW_BUFFER15=34868]="DRAW_BUFFER15",e[e.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",e[e.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",e[e.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",e[e.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",e[e.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",e[e.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",e[e.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",e[e.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",e[e.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",e[e.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",e[e.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",e[e.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",e[e.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",e[e.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",e[e.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",e[e.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",e[e.SAMPLER_3D=35679]="SAMPLER_3D",e[e.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",e[e.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",e[e.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",e[e.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",e[e.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",e[e.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",e[e.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",e[e.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",e[e.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",e[e.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",e[e.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",e[e.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",e[e.MAX_SAMPLES=36183]="MAX_SAMPLES",e[e.SAMPLER_BINDING=35097]="SAMPLER_BINDING",e[e.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",e[e.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",e[e.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",e[e.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",e[e.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",e[e.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",e[e.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",e[e.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",e[e.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",e[e.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",e[e.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",e[e.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",e[e.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",e[e.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",e[e.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",e[e.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",e[e.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",e[e.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",e[e.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",e[e.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",e[e.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",e[e.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",e[e.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",e[e.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",e[e.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",e[e.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",e[e.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",e[e.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",e[e.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",e[e.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",e[e.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",e[e.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",e[e.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",e[e.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",e[e.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",e[e.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",e[e.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",e[e.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",e[e.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",e[e.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",e[e.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",e[e.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",e[e.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",e[e.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",e[e.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",e[e.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",e[e.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",e[e.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",e[e.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",e[e.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",e[e.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",e[e.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",e[e.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",e[e.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",e[e.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",e[e.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",e[e.UNIFORM_TYPE=35383]="UNIFORM_TYPE",e[e.UNIFORM_SIZE=35384]="UNIFORM_SIZE",e[e.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",e[e.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",e[e.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",e[e.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",e[e.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",e[e.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",e[e.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",e[e.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",e[e.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",e[e.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",e[e.OBJECT_TYPE=37138]="OBJECT_TYPE",e[e.SYNC_CONDITION=37139]="SYNC_CONDITION",e[e.SYNC_STATUS=37140]="SYNC_STATUS",e[e.SYNC_FLAGS=37141]="SYNC_FLAGS",e[e.SYNC_FENCE=37142]="SYNC_FENCE",e[e.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",e[e.UNSIGNALED=37144]="UNSIGNALED",e[e.SIGNALED=37145]="SIGNALED",e[e.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",e[e.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",e[e.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",e[e.WAIT_FAILED=37149]="WAIT_FAILED",e[e.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",e[e.COLOR=6144]="COLOR",e[e.DEPTH=6145]="DEPTH",e[e.STENCIL=6146]="STENCIL",e[e.MIN=32775]="MIN",e[e.MAX=32776]="MAX",e[e.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",e[e.STREAM_READ=35041]="STREAM_READ",e[e.STREAM_COPY=35042]="STREAM_COPY",e[e.STATIC_READ=35045]="STATIC_READ",e[e.STATIC_COPY=35046]="STATIC_COPY",e[e.DYNAMIC_READ=35049]="DYNAMIC_READ",e[e.DYNAMIC_COPY=35050]="DYNAMIC_COPY",e[e.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",e[e.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",e[e.INVALID_INDEX=4294967295]="INVALID_INDEX",e[e.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",e[e.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",e[e.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",e[e.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",e[e.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",e[e.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",e[e.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",e[e.SRGB_EXT=35904]="SRGB_EXT",e[e.SRGB_ALPHA_EXT=35906]="SRGB_ALPHA_EXT",e[e.SRGB8_ALPHA8_EXT=35907]="SRGB8_ALPHA8_EXT",e[e.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",e[e.R16_EXT=33322]="R16_EXT",e[e.RG16_EXT=33324]="RG16_EXT",e[e.RGB16_EXT=32852]="RGB16_EXT",e[e.RGBA16_EXT=32859]="RGBA16_EXT",e[e.R16_SNORM_EXT=36760]="R16_SNORM_EXT",e[e.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",e[e.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",e[e.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",e[e.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",e[e.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",e[e.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",e[e.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",e[e.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",e[e.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",e[e.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",e[e.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",e[e.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",e[e.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",e[e.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",e[e.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",e[e.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",e[e.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",e[e.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",e[e.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",e[e.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",e[e.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",e[e.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",e[e.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",e[e.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",e[e.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",e[e.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",e[e.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",e[e.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",e[e.UNSIGNED_INT_24_8_WEBGL=34042]="UNSIGNED_INT_24_8_WEBGL",e[e.HALF_FLOAT_OES=36193]="HALF_FLOAT_OES",e[e.RGBA32F_EXT=34836]="RGBA32F_EXT",e[e.RGB32F_EXT=34837]="RGB32F_EXT",e[e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",e[e.UNSIGNED_NORMALIZED_EXT=35863]="UNSIGNED_NORMALIZED_EXT",e[e.MIN_EXT=32775]="MIN_EXT",e[e.MAX_EXT=32776]="MAX_EXT",e[e.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT_OES",e[e.COLOR_ATTACHMENT0_WEBGL=36064]="COLOR_ATTACHMENT0_WEBGL",e[e.COLOR_ATTACHMENT1_WEBGL=36065]="COLOR_ATTACHMENT1_WEBGL",e[e.COLOR_ATTACHMENT2_WEBGL=36066]="COLOR_ATTACHMENT2_WEBGL",e[e.COLOR_ATTACHMENT3_WEBGL=36067]="COLOR_ATTACHMENT3_WEBGL",e[e.COLOR_ATTACHMENT4_WEBGL=36068]="COLOR_ATTACHMENT4_WEBGL",e[e.COLOR_ATTACHMENT5_WEBGL=36069]="COLOR_ATTACHMENT5_WEBGL",e[e.COLOR_ATTACHMENT6_WEBGL=36070]="COLOR_ATTACHMENT6_WEBGL",e[e.COLOR_ATTACHMENT7_WEBGL=36071]="COLOR_ATTACHMENT7_WEBGL",e[e.COLOR_ATTACHMENT8_WEBGL=36072]="COLOR_ATTACHMENT8_WEBGL",e[e.COLOR_ATTACHMENT9_WEBGL=36073]="COLOR_ATTACHMENT9_WEBGL",e[e.COLOR_ATTACHMENT10_WEBGL=36074]="COLOR_ATTACHMENT10_WEBGL",e[e.COLOR_ATTACHMENT11_WEBGL=36075]="COLOR_ATTACHMENT11_WEBGL",e[e.COLOR_ATTACHMENT12_WEBGL=36076]="COLOR_ATTACHMENT12_WEBGL",e[e.COLOR_ATTACHMENT13_WEBGL=36077]="COLOR_ATTACHMENT13_WEBGL",e[e.COLOR_ATTACHMENT14_WEBGL=36078]="COLOR_ATTACHMENT14_WEBGL",e[e.COLOR_ATTACHMENT15_WEBGL=36079]="COLOR_ATTACHMENT15_WEBGL",e[e.DRAW_BUFFER0_WEBGL=34853]="DRAW_BUFFER0_WEBGL",e[e.DRAW_BUFFER1_WEBGL=34854]="DRAW_BUFFER1_WEBGL",e[e.DRAW_BUFFER2_WEBGL=34855]="DRAW_BUFFER2_WEBGL",e[e.DRAW_BUFFER3_WEBGL=34856]="DRAW_BUFFER3_WEBGL",e[e.DRAW_BUFFER4_WEBGL=34857]="DRAW_BUFFER4_WEBGL",e[e.DRAW_BUFFER5_WEBGL=34858]="DRAW_BUFFER5_WEBGL",e[e.DRAW_BUFFER6_WEBGL=34859]="DRAW_BUFFER6_WEBGL",e[e.DRAW_BUFFER7_WEBGL=34860]="DRAW_BUFFER7_WEBGL",e[e.DRAW_BUFFER8_WEBGL=34861]="DRAW_BUFFER8_WEBGL",e[e.DRAW_BUFFER9_WEBGL=34862]="DRAW_BUFFER9_WEBGL",e[e.DRAW_BUFFER10_WEBGL=34863]="DRAW_BUFFER10_WEBGL",e[e.DRAW_BUFFER11_WEBGL=34864]="DRAW_BUFFER11_WEBGL",e[e.DRAW_BUFFER12_WEBGL=34865]="DRAW_BUFFER12_WEBGL",e[e.DRAW_BUFFER13_WEBGL=34866]="DRAW_BUFFER13_WEBGL",e[e.DRAW_BUFFER14_WEBGL=34867]="DRAW_BUFFER14_WEBGL",e[e.DRAW_BUFFER15_WEBGL=34868]="DRAW_BUFFER15_WEBGL",e[e.MAX_COLOR_ATTACHMENTS_WEBGL=36063]="MAX_COLOR_ATTACHMENTS_WEBGL",e[e.MAX_DRAW_BUFFERS_WEBGL=34852]="MAX_DRAW_BUFFERS_WEBGL",e[e.VERTEX_ARRAY_BINDING_OES=34229]="VERTEX_ARRAY_BINDING_OES",e[e.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",e[e.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",e[e.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",e[e.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",e[e.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",e[e.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",e[e.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",e}({});function xs(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 Ds(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xs(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var O_="Failed to create WebGL context in Node.js, headless gl returned null",b_=" luma.gl: loaded under Node.js without headless gl installed, meaning that WebGL contexts can not be created. This may not be an error. For example, this is a typical configuration for isorender applications running on the server.",y_={width:1,height:1,debug:!0,throwOnError:!1},ui=null;function Bs(){return ui!==null}function ws(e){e=Ds(Ds({},y_),e);var t=e,r=t.width,n=t.height,i=t.webgl1,o=t.webgl2;if(o&&!i)throw new Error("headless-gl does not support WebGL2");if(!ui)throw new Error(b_);var a=ui(r,n,e);if(!a)throw new Error(O_);return a}var Xi=De(Me(),1);var or={};function C_(e){globalThis.console&&globalThis.console.error&&globalThis.console.error(e)}function P_(e){globalThis.console&&globalThis.console.log&&globalThis.console.log(e)}function N_(e,t){or[e]=!0,t!==void 0&&C_(t)}function M_(e){var t=e.getError;e.getError=function(){var n;do n=t.apply(e),n!==e.NO_ERROR&&(or[n]=!0);while(n!==e.NO_ERROR);for(n in or)if(or[n])return delete or[n],parseInt(n,10);return e.NO_ERROR}}var ar=function e(t){var r=t.gl;this.ext=t,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(t.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new e.VertexAttrib(r);this.attribs[n]=i}this.maxAttrib=0};ar.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=t.FLOAT,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()};ar.VertexAttrib.prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var mt=function(t){var r=this;this.gl=t,M_(t);var n=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(o){return o===r.VERTEX_ARRAY_BINDING_OES?r.currentVertexArrayObject===r.defaultVertexArrayObject?null:r.currentVertexArrayObject:n.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(o){var a=r.currentVertexArrayObject;a.maxAttrib=Math.max(a.maxAttrib,o);var c=a.attribs[o];return c.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(o){var a=r.currentVertexArrayObject;a.maxAttrib=Math.max(a.maxAttrib,o);var c=a.attribs[o];return c.enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(o,a){switch(o){case t.ARRAY_BUFFER:r.currentArrayBuffer=a;break;case t.ELEMENT_ARRAY_BUFFER:r.currentVertexArrayObject.elementArrayBuffer=a;break;default:}return n.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(o,a){var c=r.currentVertexArrayObject,f=c.attribs[o];switch(a){case t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:return f.buffer;case t.VERTEX_ATTRIB_ARRAY_ENABLED:return f.enabled;case t.VERTEX_ATTRIB_ARRAY_SIZE:return f.size;case t.VERTEX_ATTRIB_ARRAY_STRIDE:return f.stride;case t.VERTEX_ATTRIB_ARRAY_TYPE:return f.type;case t.VERTEX_ATTRIB_ARRAY_NORMALIZED:return f.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(o,a,c,f,u,_){var E=r.currentVertexArrayObject;E.maxAttrib=Math.max(E.maxAttrib,o);var p=E.attribs[o];return p.buffer=r.currentArrayBuffer,p.size=a,p.type=c,p.normalized=f,p.stride=u,p.offset=_,p.recache(),n.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",function(){P_("OESVertexArrayObject emulation library context restored"),r.reset_()},!0),this.reset_()};mt.prototype.VERTEX_ARRAY_BINDING_OES=34229;mt.prototype.reset_=function(){var t=this.vertexArrayObjects!==void 0;if(t)for(var r=0;r<this.vertexArrayObjects.length;++r)this.vertexArrayObjects.isAlive=!1;var n=this.gl;this.maxVertexAttribs=n.getParameter(n.MAX_VERTEX_ATTRIBS),this.defaultVertexArrayObject=new ar(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)};mt.prototype.createVertexArrayOES=function(){var t=new ar(this);return this.vertexArrayObjects.push(t),t};mt.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)};mt.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof ar&&t.hasBeenBound&&t.ext===this)};mt.prototype.bindVertexArrayOES=function(t){var r=this.gl;if(t&&!t.isAlive){N_(r.INVALID_OPERATION,"bindVertexArrayOES: attempt to bind deleted arrayObject");return}var n=this.original,i=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var o=this.currentVertexArrayObject;if(i!==o){(!i||o.elementArrayBuffer!==i.elementArrayBuffer)&&n.bindBuffer.call(r,r.ELEMENT_ARRAY_BUFFER,o.elementArrayBuffer);for(var a=this.currentArrayBuffer,c=Math.max(i?i.maxAttrib:0,o.maxAttrib),f=0;f<=c;f++){var u=o.attribs[f],_=i?i.attribs[f]:null;if((!i||u.enabled!==_.enabled)&&(u.enabled?n.enableVertexAttribArray.call(r,f):n.disableVertexAttribArray.call(r,f)),u.enabled){var E=!1;(!i||u.buffer!==_.buffer)&&(a!==u.buffer&&(n.bindBuffer.call(r,r.ARRAY_BUFFER,u.buffer),a=u.buffer),E=!0),(E||u.cached!==_.cached)&&n.vertexAttribPointer.call(r,f,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==a&&n.bindBuffer.call(r,r.ARRAY_BUFFER,this.currentArrayBuffer)}};function Us(e){if(typeof e.createVertexArray!="function"){var t=e.getSupportedExtensions;e.getSupportedExtensions=function(){var i=t.call(this)||[];return i.indexOf("OES_vertex_array_object")<0&&i.push("OES_vertex_array_object"),i};var r=e.getExtension;e.getExtension=function(i){var o=r.call(this,i);return o||(i!=="OES_vertex_array_object"?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new mt(this)),this.__OESVertexArrayObject))}}}var I_="Invalid WebGLRenderingContext";var F_="Requires WebGL2";function x_(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function Q(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function li(e){return Q(e)?e:null}function Ls(e){return H(x_(e),I_),e}function Qr(e){return H(Q(e),F_),e}var z,Xs="OES_element_index",Hs="WEBGL_draw_buffers",D_="EXT_disjoint_timer_query",B_="EXT_disjoint_timer_query_webgl2",w_="EXT_texture_filter_anisotropic",Ws="WEBGL_debug_renderer_info",U_=35723,L_=4352,X_=36795,H_=34047,W_=37445,V_=37446,oe=function(t){return Q(t)?void 0:0},j_=(z={},l(z,s.READ_BUFFER,function(e){return Q(e)?void 0:s.COLOR_ATTACHMENT0}),l(z,U_,function(e){return Q(e)?void 0:L_}),l(z,s.RASTERIZER_DISCARD,oe),l(z,s.SAMPLES,oe),l(z,X_,function(e,t){var r=Q(e)?e.getExtension(B_):e.getExtension(D_);return r&&r.GPU_DISJOINT_EXT?t(r.GPU_DISJOINT_EXT):0}),l(z,W_,function(e,t){var r=e.getExtension(Ws);return t(r&&r.UNMASKED_VENDOR_WEBGL||s.VENDOR)}),l(z,V_,function(e,t){var r=e.getExtension(Ws);return t(r&&r.UNMASKED_RENDERER_WEBGL||s.RENDERER)}),l(z,H_,function(e,t){var r,n=((r=e.luma)===null||r===void 0||(r=r.extensions)===null||r===void 0?void 0:r[w_])||e.getExtension("EXT_texture_filter_anisotropic");return n?t(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),l(z,s.MAX_3D_TEXTURE_SIZE,oe),l(z,s.MAX_ARRAY_TEXTURE_LAYERS,oe),l(z,s.MAX_CLIENT_WAIT_TIMEOUT_WEBGL,oe),l(z,s.MAX_COLOR_ATTACHMENTS,function(e,t){if(!Q(e)){var r=e.getExtension(Hs);return r?t(r.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),l(z,s.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,oe),l(z,s.MAX_COMBINED_UNIFORM_BLOCKS,oe),l(z,s.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,oe),l(z,s.MAX_DRAW_BUFFERS,function(e){if(!Q(e)){var t=e.getExtension(Hs);return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),l(z,s.MAX_ELEMENT_INDEX,function(e){return e.getExtension(Xs)?2147483647:65535}),l(z,s.MAX_ELEMENTS_INDICES,function(e){return e.getExtension(Xs)?16777216:65535}),l(z,s.MAX_ELEMENTS_VERTICES,function(e){return 16777216}),l(z,s.MAX_FRAGMENT_INPUT_COMPONENTS,oe),l(z,s.MAX_FRAGMENT_UNIFORM_BLOCKS,oe),l(z,s.MAX_FRAGMENT_UNIFORM_COMPONENTS,oe),l(z,s.MAX_SAMPLES,oe),l(z,s.MAX_SERVER_WAIT_TIMEOUT,oe),l(z,s.MAX_TEXTURE_LOD_BIAS,oe),l(z,s.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,oe),l(z,s.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,oe),l(z,s.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,oe),l(z,s.MAX_UNIFORM_BLOCK_SIZE,oe),l(z,s.MAX_UNIFORM_BUFFER_BINDINGS,oe),l(z,s.MAX_VARYING_COMPONENTS,oe),l(z,s.MAX_VERTEX_OUTPUT_COMPONENTS,oe),l(z,s.MAX_VERTEX_UNIFORM_BLOCKS,oe),l(z,s.MAX_VERTEX_UNIFORM_COMPONENTS,oe),l(z,s.MIN_PROGRAM_TEXEL_OFFSET,oe),l(z,s.MAX_PROGRAM_TEXEL_OFFSET,oe),l(z,s.UNIFORM_BUFFER_OFFSET_ALIGNMENT,oe),z);function Vs(e,t,r){var n=j_[r],i=typeof n=="function"?n(e,t,r):n,o=i!==void 0?i:t(r);return o}function Ut(e){var t=e.luma;if(!t){var r={_polyfilled:!1,_extensions:{}};e.luma=r}return e.luma}var Lt,K_="OES_vertex_array_object",js="ANGLE_instanced_arrays",k_="WEBGL_draw_buffers",Y_="EXT_disjoint_timer_query",z_="EXT_texture_filter_anisotropic",G_="VertexArray requires WebGL2 or OES_vertex_array_object extension";function $_(e,t){return{webgl2:Q(e),ext:e.getExtension(t)}}var _i=(Lt={},l(Lt,K_,{meta:{suffix:"OES"},createVertexArray:function(){H(!1,G_)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),l(Lt,js,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,r){H(r===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),l(Lt,k_,{meta:{suffix:"WEBGL"},drawBuffers:function(){H(!1)}}),l(Lt,Y_,{meta:{suffix:"EXT"},createQuery:function(){H(!1)},deleteQuery:function(){H(!1)},beginQuery:function(){H(!1)},endQuery:function(){},getQuery:function(t,r){return this.getQueryObject(t,r)},getQueryParameter:function(t,r){return this.getQueryObject(t,r)},getQueryObject:function(t,r){}}),Lt),Jr={readBuffer:function(t,r,n){Q(t)&&r(n)},getVertexAttrib:function(t,r,n,i){var o=$_(t,js),a=o.webgl2,c=o.ext,f;switch(i){case s.VERTEX_ATTRIB_ARRAY_INTEGER:f=a?void 0:!1;break;case s.VERTEX_ATTRIB_ARRAY_DIVISOR:f=!a&&!c?0:void 0;break;default:}return f!==void 0?f:r(n,i)},getProgramParameter:function(t,r,n,i){if(!Q(t))switch(i){case s.TRANSFORM_FEEDBACK_BUFFER_MODE:return s.SEPARATE_ATTRIBS;case s.TRANSFORM_FEEDBACK_VARYINGS:return 0;case s.ACTIVE_UNIFORM_BLOCKS:return 0;default:}return r(n,i)},getInternalformatParameter:function(t,r,n,i,o){if(!Q(t))switch(o){case s.SAMPLES:return new Int32Array([0]);default:}var a=t;return a.getInternalformatParameter(n,i,o)},getTexParameter:function(t,r,n,i){switch(i){case s.TEXTURE_MAX_ANISOTROPY_EXT:var o=Ut(t),a=o._extensions,c=a[z_];i=c&&c.TEXTURE_MAX_ANISOTROPY_EXT||s.TEXTURE_MAX_ANISOTROPY_EXT;break;default:}return r(n,i)},getParameter:Vs,hint:function(t,r,n,i){return r(n,i)}};function ks(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=q_(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
273
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function q_(e,t){if(e){if(typeof e=="string")return Ks(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 Ks(e,t)}}function Ks(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 Ys(e){var t=Ut(e);return t._polyfilled||(Us(e),Z_(e),Q_(e,_i),eE(e,{target:t,target2:e}),t._polyfilled=!0),e}function Z_(e){var t=Ut(e),r=e.getSupportedExtensions()||[],n=ks(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,a=e.getExtension(o);t._extensions[o]=a}}catch(c){n.e(c)}finally{n.f()}}function Q_(e,t){var r=Ut(e),n=ks(Object.getOwnPropertyNames(t)),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;o!=="overrides"&&J_(e,{extension:o,target:r,target2:e})}}catch(a){n.e(a)}finally{n.f()}}function J_(e,t){var r=t.extension,n=t.target,i=t.target2,o=_i[r];H(o);for(var a=o.meta,c=a===void 0?{}:a,f=c.suffix,u=f===void 0?"":f,_=e.getExtension(r),E=function(){var m=d[p],A="".concat(m).concat(u),T=null;m==="meta"||typeof e[m]=="function"||(_&&typeof _[A]=="function"?T=function(){return _[A].apply(_,arguments)}:typeof o[m]=="function"&&(T=o[m].bind(n))),T&&(n[m]=T,i[m]=T)},p=0,d=Object.keys(o);p<d.length;p++)E()}function eE(e,t){var r=t.target,n=t.target2;Object.keys(Jr).forEach(function(i){if(typeof Jr[i]=="function"){var o=e[i]?e[i].bind(e):function(){},a=Jr[i].bind(null,e,o);r[i]=a,n[i]=a}})}var D,N,xe,en=(D={},l(D,s.BLEND,!1),l(D,s.BLEND_COLOR,new Float32Array([0,0,0,0])),l(D,s.BLEND_EQUATION_RGB,s.FUNC_ADD),l(D,s.BLEND_EQUATION_ALPHA,s.FUNC_ADD),l(D,s.BLEND_SRC_RGB,s.ONE),l(D,s.BLEND_DST_RGB,s.ZERO),l(D,s.BLEND_SRC_ALPHA,s.ONE),l(D,s.BLEND_DST_ALPHA,s.ZERO),l(D,s.COLOR_CLEAR_VALUE,new Float32Array([0,0,0,0])),l(D,s.COLOR_WRITEMASK,[!0,!0,!0,!0]),l(D,s.CULL_FACE,!1),l(D,s.CULL_FACE_MODE,s.BACK),l(D,s.DEPTH_TEST,!1),l(D,s.DEPTH_CLEAR_VALUE,1),l(D,s.DEPTH_FUNC,s.LESS),l(D,s.DEPTH_RANGE,new Float32Array([0,1])),l(D,s.DEPTH_WRITEMASK,!0),l(D,s.DITHER,!0),l(D,s.CURRENT_PROGRAM,null),l(D,s.FRAMEBUFFER_BINDING,null),l(D,s.RENDERBUFFER_BINDING,null),l(D,s.VERTEX_ARRAY_BINDING,null),l(D,s.ARRAY_BUFFER_BINDING,null),l(D,s.FRONT_FACE,s.CCW),l(D,s.GENERATE_MIPMAP_HINT,s.DONT_CARE),l(D,s.LINE_WIDTH,1),l(D,s.POLYGON_OFFSET_FILL,!1),l(D,s.POLYGON_OFFSET_FACTOR,0),l(D,s.POLYGON_OFFSET_UNITS,0),l(D,s.SAMPLE_ALPHA_TO_COVERAGE,!1),l(D,s.SAMPLE_COVERAGE,!1),l(D,s.SAMPLE_COVERAGE_VALUE,1),l(D,s.SAMPLE_COVERAGE_INVERT,!1),l(D,s.SCISSOR_TEST,!1),l(D,s.SCISSOR_BOX,new Int32Array([0,0,1024,1024])),l(D,s.STENCIL_TEST,!1),l(D,s.STENCIL_CLEAR_VALUE,0),l(D,s.STENCIL_WRITEMASK,4294967295),l(D,s.STENCIL_BACK_WRITEMASK,4294967295),l(D,s.STENCIL_FUNC,s.ALWAYS),l(D,s.STENCIL_REF,0),l(D,s.STENCIL_VALUE_MASK,4294967295),l(D,s.STENCIL_BACK_FUNC,s.ALWAYS),l(D,s.STENCIL_BACK_REF,0),l(D,s.STENCIL_BACK_VALUE_MASK,4294967295),l(D,s.STENCIL_FAIL,s.KEEP),l(D,s.STENCIL_PASS_DEPTH_FAIL,s.KEEP),l(D,s.STENCIL_PASS_DEPTH_PASS,s.KEEP),l(D,s.STENCIL_BACK_FAIL,s.KEEP),l(D,s.STENCIL_BACK_PASS_DEPTH_FAIL,s.KEEP),l(D,s.STENCIL_BACK_PASS_DEPTH_PASS,s.KEEP),l(D,s.VIEWPORT,[0,0,1024,1024]),l(D,s.PACK_ALIGNMENT,4),l(D,s.UNPACK_ALIGNMENT,4),l(D,s.UNPACK_FLIP_Y_WEBGL,!1),l(D,s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),l(D,s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL),l(D,s.TRANSFORM_FEEDBACK_BINDING,null),l(D,s.COPY_READ_BUFFER_BINDING,null),l(D,s.COPY_WRITE_BUFFER_BINDING,null),l(D,s.PIXEL_PACK_BUFFER_BINDING,null),l(D,s.PIXEL_UNPACK_BUFFER_BINDING,null),l(D,s.FRAGMENT_SHADER_DERIVATIVE_HINT,s.DONT_CARE),l(D,s.READ_FRAMEBUFFER_BINDING,null),l(D,s.RASTERIZER_DISCARD,!1),l(D,s.PACK_ROW_LENGTH,0),l(D,s.PACK_SKIP_PIXELS,0),l(D,s.PACK_SKIP_ROWS,0),l(D,s.UNPACK_ROW_LENGTH,0),l(D,s.UNPACK_IMAGE_HEIGHT,0),l(D,s.UNPACK_SKIP_PIXELS,0),l(D,s.UNPACK_SKIP_ROWS,0),l(D,s.UNPACK_SKIP_IMAGES,0),D),Le=function(t,r,n){return r?t.enable(n):t.disable(n)},zs=function(t,r,n){return t.hint(n,r)},Ce=function(t,r,n){return t.pixelStorei(n,r)},Gs=function(t,r,n){var i;return n===s.FRAMEBUFFER_BINDING?i=Q(t)?s.DRAW_FRAMEBUFFER:s.FRAMEBUFFER:i=s.READ_FRAMEBUFFER,t.bindFramebuffer(i,r)},sr=function(t,r,n){var i,o=(i={},l(i,s.ARRAY_BUFFER_BINDING,s.ARRAY_BUFFER),l(i,s.COPY_READ_BUFFER_BINDING,s.COPY_READ_BUFFER),l(i,s.COPY_WRITE_BUFFER_BINDING,s.COPY_WRITE_BUFFER),l(i,s.PIXEL_PACK_BUFFER_BINDING,s.PIXEL_PACK_BUFFER),l(i,s.PIXEL_UNPACK_BUFFER_BINDING,s.PIXEL_UNPACK_BUFFER),i),a=o[n];t.bindBuffer(a,r)};function Ei(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}var $s=(N={},l(N,s.BLEND,Le),l(N,s.BLEND_COLOR,function(e,t){return e.blendColor.apply(e,te(t))}),l(N,s.BLEND_EQUATION_RGB,"blendEquation"),l(N,s.BLEND_EQUATION_ALPHA,"blendEquation"),l(N,s.BLEND_SRC_RGB,"blendFunc"),l(N,s.BLEND_DST_RGB,"blendFunc"),l(N,s.BLEND_SRC_ALPHA,"blendFunc"),l(N,s.BLEND_DST_ALPHA,"blendFunc"),l(N,s.COLOR_CLEAR_VALUE,function(e,t){return e.clearColor.apply(e,te(t))}),l(N,s.COLOR_WRITEMASK,function(e,t){return e.colorMask.apply(e,te(t))}),l(N,s.CULL_FACE,Le),l(N,s.CULL_FACE_MODE,function(e,t){return e.cullFace(t)}),l(N,s.DEPTH_TEST,Le),l(N,s.DEPTH_CLEAR_VALUE,function(e,t){return e.clearDepth(t)}),l(N,s.DEPTH_FUNC,function(e,t){return e.depthFunc(t)}),l(N,s.DEPTH_RANGE,function(e,t){return e.depthRange.apply(e,te(t))}),l(N,s.DEPTH_WRITEMASK,function(e,t){return e.depthMask(t)}),l(N,s.DITHER,Le),l(N,s.FRAGMENT_SHADER_DERIVATIVE_HINT,zs),l(N,s.CURRENT_PROGRAM,function(e,t){return e.useProgram(t)}),l(N,s.RENDERBUFFER_BINDING,function(e,t){return e.bindRenderbuffer(s.RENDERBUFFER,t)}),l(N,s.TRANSFORM_FEEDBACK_BINDING,function(e,t){var r,n;return(r=(n=e).bindTransformFeedback)===null||r===void 0?void 0:r.call(n,s.TRANSFORM_FEEDBACK,t)}),l(N,s.VERTEX_ARRAY_BINDING,function(e,t){return e.bindVertexArray(t)}),l(N,s.FRAMEBUFFER_BINDING,Gs),l(N,s.READ_FRAMEBUFFER_BINDING,Gs),l(N,s.ARRAY_BUFFER_BINDING,sr),l(N,s.COPY_READ_BUFFER_BINDING,sr),l(N,s.COPY_WRITE_BUFFER_BINDING,sr),l(N,s.PIXEL_PACK_BUFFER_BINDING,sr),l(N,s.PIXEL_UNPACK_BUFFER_BINDING,sr),l(N,s.FRONT_FACE,function(e,t){return e.frontFace(t)}),l(N,s.GENERATE_MIPMAP_HINT,zs),l(N,s.LINE_WIDTH,function(e,t){return e.lineWidth(t)}),l(N,s.POLYGON_OFFSET_FILL,Le),l(N,s.POLYGON_OFFSET_FACTOR,"polygonOffset"),l(N,s.POLYGON_OFFSET_UNITS,"polygonOffset"),l(N,s.RASTERIZER_DISCARD,Le),l(N,s.SAMPLE_ALPHA_TO_COVERAGE,Le),l(N,s.SAMPLE_COVERAGE,Le),l(N,s.SAMPLE_COVERAGE_VALUE,"sampleCoverage"),l(N,s.SAMPLE_COVERAGE_INVERT,"sampleCoverage"),l(N,s.SCISSOR_TEST,Le),l(N,s.SCISSOR_BOX,function(e,t){return e.scissor.apply(e,te(t))}),l(N,s.STENCIL_TEST,Le),l(N,s.STENCIL_CLEAR_VALUE,function(e,t){return e.clearStencil(t)}),l(N,s.STENCIL_WRITEMASK,function(e,t){return e.stencilMaskSeparate(s.FRONT,t)}),l(N,s.STENCIL_BACK_WRITEMASK,function(e,t){return e.stencilMaskSeparate(s.BACK,t)}),l(N,s.STENCIL_FUNC,"stencilFuncFront"),l(N,s.STENCIL_REF,"stencilFuncFront"),l(N,s.STENCIL_VALUE_MASK,"stencilFuncFront"),l(N,s.STENCIL_BACK_FUNC,"stencilFuncBack"),l(N,s.STENCIL_BACK_REF,"stencilFuncBack"),l(N,s.STENCIL_BACK_VALUE_MASK,"stencilFuncBack"),l(N,s.STENCIL_FAIL,"stencilOpFront"),l(N,s.STENCIL_PASS_DEPTH_FAIL,"stencilOpFront"),l(N,s.STENCIL_PASS_DEPTH_PASS,"stencilOpFront"),l(N,s.STENCIL_BACK_FAIL,"stencilOpBack"),l(N,s.STENCIL_BACK_PASS_DEPTH_FAIL,"stencilOpBack"),l(N,s.STENCIL_BACK_PASS_DEPTH_PASS,"stencilOpBack"),l(N,s.VIEWPORT,function(e,t){return e.viewport.apply(e,te(t))}),l(N,s.PACK_ALIGNMENT,Ce),l(N,s.UNPACK_ALIGNMENT,Ce),l(N,s.UNPACK_FLIP_Y_WEBGL,Ce),l(N,s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ce),l(N,s.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ce),l(N,s.PACK_ROW_LENGTH,Ce),l(N,s.PACK_SKIP_PIXELS,Ce),l(N,s.PACK_SKIP_ROWS,Ce),l(N,s.UNPACK_ROW_LENGTH,Ce),l(N,s.UNPACK_IMAGE_HEIGHT,Ce),l(N,s.UNPACK_SKIP_PIXELS,Ce),l(N,s.UNPACK_SKIP_ROWS,Ce),l(N,s.UNPACK_SKIP_IMAGES,Ce),l(N,"framebuffer",function(t,r){var n=r&&"handle"in r?r.handle:r;return t.bindFramebuffer(s.FRAMEBUFFER,n)}),l(N,"blend",function(t,r){return r?t.enable(s.BLEND):t.disable(s.BLEND)}),l(N,"blendColor",function(t,r){return t.blendColor.apply(t,te(r))}),l(N,"blendEquation",function(t,r){var n=typeof r=="number"?[r,r]:r;t.blendEquationSeparate.apply(t,te(n))}),l(N,"blendFunc",function(t,r){var n=r?.length===2?[].concat(te(r),te(r)):r;t.blendFuncSeparate.apply(t,te(n))}),l(N,"clearColor",function(t,r){return t.clearColor.apply(t,te(r))}),l(N,"clearDepth",function(t,r){return t.clearDepth(r)}),l(N,"clearStencil",function(t,r){return t.clearStencil(r)}),l(N,"colorMask",function(t,r){return t.colorMask.apply(t,te(r))}),l(N,"cull",function(t,r){return r?t.enable(s.CULL_FACE):t.disable(s.CULL_FACE)}),l(N,"cullFace",function(t,r){return t.cullFace(r)}),l(N,"depthTest",function(t,r){return r?t.enable(s.DEPTH_TEST):t.disable(s.DEPTH_TEST)}),l(N,"depthFunc",function(t,r){return t.depthFunc(r)}),l(N,"depthMask",function(t,r){return t.depthMask(r)}),l(N,"depthRange",function(t,r){return t.depthRange.apply(t,te(r))}),l(N,"dither",function(t,r){return r?t.enable(s.DITHER):t.disable(s.DITHER)}),l(N,"derivativeHint",function(t,r){t.hint(s.FRAGMENT_SHADER_DERIVATIVE_HINT,r)}),l(N,"frontFace",function(t,r){return t.frontFace(r)}),l(N,"mipmapHint",function(t,r){return t.hint(s.GENERATE_MIPMAP_HINT,r)}),l(N,"lineWidth",function(t,r){return t.lineWidth(r)}),l(N,"polygonOffsetFill",function(t,r){return r?t.enable(s.POLYGON_OFFSET_FILL):t.disable(s.POLYGON_OFFSET_FILL)}),l(N,"polygonOffset",function(t,r){return t.polygonOffset.apply(t,te(r))}),l(N,"sampleCoverage",function(t,r){return t.sampleCoverage.apply(t,te(r))}),l(N,"scissorTest",function(t,r){return r?t.enable(s.SCISSOR_TEST):t.disable(s.SCISSOR_TEST)}),l(N,"scissor",function(t,r){return t.scissor.apply(t,te(r))}),l(N,"stencilTest",function(t,r){return r?t.enable(s.STENCIL_TEST):t.disable(s.STENCIL_TEST)}),l(N,"stencilMask",function(t,r){r=Ei(r)?r:[r,r];var n=r,i=W(n,2),o=i[0],a=i[1];t.stencilMaskSeparate(s.FRONT,o),t.stencilMaskSeparate(s.BACK,a)}),l(N,"stencilFunc",function(t,r){r=Ei(r)&&r.length===3?[].concat(te(r),te(r)):r;var n=r,i=W(n,6),o=i[0],a=i[1],c=i[2],f=i[3],u=i[4],_=i[5];t.stencilFuncSeparate(s.FRONT,o,a,c),t.stencilFuncSeparate(s.BACK,f,u,_)}),l(N,"stencilOp",function(t,r){r=Ei(r)&&r.length===3?[].concat(te(r),te(r)):r;var n=r,i=W(n,6),o=i[0],a=i[1],c=i[2],f=i[3],u=i[4],_=i[5];t.stencilOpSeparate(s.FRONT,o,a,c),t.stencilOpSeparate(s.BACK,f,u,_)}),l(N,"viewport",function(t,r){return t.viewport.apply(t,te(r))}),N);function ue(e,t,r){return t[e]!==void 0?t[e]:r[e]}var qs={blendEquation:function(t,r,n){return t.blendEquationSeparate(ue(s.BLEND_EQUATION_RGB,r,n),ue(s.BLEND_EQUATION_ALPHA,r,n))},blendFunc:function(t,r,n){return t.blendFuncSeparate(ue(s.BLEND_SRC_RGB,r,n),ue(s.BLEND_DST_RGB,r,n),ue(s.BLEND_SRC_ALPHA,r,n),ue(s.BLEND_DST_ALPHA,r,n))},polygonOffset:function(t,r,n){return t.polygonOffset(ue(s.POLYGON_OFFSET_FACTOR,r,n),ue(s.POLYGON_OFFSET_UNITS,r,n))},sampleCoverage:function(t,r,n){return t.sampleCoverage(ue(s.SAMPLE_COVERAGE_VALUE,r,n),ue(s.SAMPLE_COVERAGE_INVERT,r,n))},stencilFuncFront:function(t,r,n){return t.stencilFuncSeparate(s.FRONT,ue(s.STENCIL_FUNC,r,n),ue(s.STENCIL_REF,r,n),ue(s.STENCIL_VALUE_MASK,r,n))},stencilFuncBack:function(t,r,n){return t.stencilFuncSeparate(s.BACK,ue(s.STENCIL_BACK_FUNC,r,n),ue(s.STENCIL_BACK_REF,r,n),ue(s.STENCIL_BACK_VALUE_MASK,r,n))},stencilOpFront:function(t,r,n){return t.stencilOpSeparate(s.FRONT,ue(s.STENCIL_FAIL,r,n),ue(s.STENCIL_PASS_DEPTH_FAIL,r,n),ue(s.STENCIL_PASS_DEPTH_PASS,r,n))},stencilOpBack:function(t,r,n){return t.stencilOpSeparate(s.BACK,ue(s.STENCIL_BACK_FAIL,r,n),ue(s.STENCIL_BACK_PASS_DEPTH_FAIL,r,n),ue(s.STENCIL_BACK_PASS_DEPTH_PASS,r,n))}},pi={enable:function(t,r){return t(l({},r,!0))},disable:function(t,r){return t(l({},r,!1))},pixelStorei:function(t,r,n){return t(l({},r,n))},hint:function(t,r,n){return t(l({},r,n))},useProgram:function(t,r){return t(l({},s.CURRENT_PROGRAM,r))},bindRenderbuffer:function(t,r,n){return t(l({},s.RENDERBUFFER_BINDING,n))},bindTransformFeedback:function(t,r,n){return t(l({},s.TRANSFORM_FEEDBACK_BINDING,n))},bindVertexArray:function(t,r){return t(l({},s.VERTEX_ARRAY_BINDING,r))},bindFramebuffer:function(t,r,n){var i;switch(r){case s.FRAMEBUFFER:return t((i={},l(i,s.DRAW_FRAMEBUFFER_BINDING,n),l(i,s.READ_FRAMEBUFFER_BINDING,n),i));case s.DRAW_FRAMEBUFFER:return t(l({},s.DRAW_FRAMEBUFFER_BINDING,n));case s.READ_FRAMEBUFFER:return t(l({},s.READ_FRAMEBUFFER_BINDING,n));default:return null}},bindBuffer:function(t,r,n){var i,o=(i={},l(i,s.ARRAY_BUFFER,[s.ARRAY_BUFFER_BINDING]),l(i,s.COPY_READ_BUFFER,[s.COPY_READ_BUFFER_BINDING]),l(i,s.COPY_WRITE_BUFFER,[s.COPY_WRITE_BUFFER_BINDING]),l(i,s.PIXEL_PACK_BUFFER,[s.PIXEL_PACK_BUFFER_BINDING]),l(i,s.PIXEL_UNPACK_BUFFER,[s.PIXEL_UNPACK_BUFFER_BINDING]),i)[r];return o?t(l({},o,n)):{valueChanged:!0}},blendColor:function(t,r,n,i,o){return t(l({},s.BLEND_COLOR,new Float32Array([r,n,i,o])))},blendEquation:function(t,r){var n;return t((n={},l(n,s.BLEND_EQUATION_RGB,r),l(n,s.BLEND_EQUATION_ALPHA,r),n))},blendEquationSeparate:function(t,r,n){var i;return t((i={},l(i,s.BLEND_EQUATION_RGB,r),l(i,s.BLEND_EQUATION_ALPHA,n),i))},blendFunc:function(t,r,n){var i;return t((i={},l(i,s.BLEND_SRC_RGB,r),l(i,s.BLEND_DST_RGB,n),l(i,s.BLEND_SRC_ALPHA,r),l(i,s.BLEND_DST_ALPHA,n),i))},blendFuncSeparate:function(t,r,n,i,o){var a;return t((a={},l(a,s.BLEND_SRC_RGB,r),l(a,s.BLEND_DST_RGB,n),l(a,s.BLEND_SRC_ALPHA,i),l(a,s.BLEND_DST_ALPHA,o),a))},clearColor:function(t,r,n,i,o){return t(l({},s.COLOR_CLEAR_VALUE,new Float32Array([r,n,i,o])))},clearDepth:function(t,r){return t(l({},s.DEPTH_CLEAR_VALUE,r))},clearStencil:function(t,r){return t(l({},s.STENCIL_CLEAR_VALUE,r))},colorMask:function(t,r,n,i,o){return t(l({},s.COLOR_WRITEMASK,[r,n,i,o]))},cullFace:function(t,r){return t(l({},s.CULL_FACE_MODE,r))},depthFunc:function(t,r){return t(l({},s.DEPTH_FUNC,r))},depthRange:function(t,r,n){return t(l({},s.DEPTH_RANGE,new Float32Array([r,n])))},depthMask:function(t,r){return t(l({},s.DEPTH_WRITEMASK,r))},frontFace:function(t,r){return t(l({},s.FRONT_FACE,r))},lineWidth:function(t,r){return t(l({},s.LINE_WIDTH,r))},polygonOffset:function(t,r,n){var i;return t((i={},l(i,s.POLYGON_OFFSET_FACTOR,r),l(i,s.POLYGON_OFFSET_UNITS,n),i))},sampleCoverage:function(t,r,n){var i;return t((i={},l(i,s.SAMPLE_COVERAGE_VALUE,r),l(i,s.SAMPLE_COVERAGE_INVERT,n),i))},scissor:function(t,r,n,i,o){return t(l({},s.SCISSOR_BOX,new Int32Array([r,n,i,o])))},stencilMask:function(t,r){var n;return t((n={},l(n,s.STENCIL_WRITEMASK,r),l(n,s.STENCIL_BACK_WRITEMASK,r),n))},stencilMaskSeparate:function(t,r,n){return t(l({},r===s.FRONT?s.STENCIL_WRITEMASK:s.STENCIL_BACK_WRITEMASK,n))},stencilFunc:function(t,r,n,i){var o;return t((o={},l(o,s.STENCIL_FUNC,r),l(o,s.STENCIL_REF,n),l(o,s.STENCIL_VALUE_MASK,i),l(o,s.STENCIL_BACK_FUNC,r),l(o,s.STENCIL_BACK_REF,n),l(o,s.STENCIL_BACK_VALUE_MASK,i),o))},stencilFuncSeparate:function(t,r,n,i,o){var a;return t((a={},l(a,r===s.FRONT?s.STENCIL_FUNC:s.STENCIL_BACK_FUNC,n),l(a,r===s.FRONT?s.STENCIL_REF:s.STENCIL_BACK_REF,i),l(a,r===s.FRONT?s.STENCIL_VALUE_MASK:s.STENCIL_BACK_VALUE_MASK,o),a))},stencilOp:function(t,r,n,i){var o;return t((o={},l(o,s.STENCIL_FAIL,r),l(o,s.STENCIL_PASS_DEPTH_FAIL,n),l(o,s.STENCIL_PASS_DEPTH_PASS,i),l(o,s.STENCIL_BACK_FAIL,r),l(o,s.STENCIL_BACK_PASS_DEPTH_FAIL,n),l(o,s.STENCIL_BACK_PASS_DEPTH_PASS,i),o))},stencilOpSeparate:function(t,r,n,i,o){var a;return t((a={},l(a,r===s.FRONT?s.STENCIL_FAIL:s.STENCIL_BACK_FAIL,n),l(a,r===s.FRONT?s.STENCIL_PASS_DEPTH_FAIL:s.STENCIL_BACK_PASS_DEPTH_FAIL,i),l(a,r===s.FRONT?s.STENCIL_PASS_DEPTH_PASS:s.STENCIL_BACK_PASS_DEPTH_PASS,o),a))},viewport:function(t,r,n,i,o){return t(l({},s.VIEWPORT,[r,n,i,o]))}},Xe=function(t,r){return t.isEnabled(r)},di=(xe={},l(xe,s.BLEND,Xe),l(xe,s.CULL_FACE,Xe),l(xe,s.DEPTH_TEST,Xe),l(xe,s.DITHER,Xe),l(xe,s.POLYGON_OFFSET_FILL,Xe),l(xe,s.SAMPLE_ALPHA_TO_COVERAGE,Xe),l(xe,s.SAMPLE_COVERAGE,Xe),l(xe,s.SCISSOR_TEST,Xe),l(xe,s.STENCIL_TEST,Xe),l(xe,s.RASTERIZER_DISCARD,Xe),xe),Zs=new Set([s.ACTIVE_TEXTURE,s.TRANSFORM_FEEDBACK_ACTIVE,s.TRANSFORM_FEEDBACK_PAUSED,s.TRANSFORM_FEEDBACK_BUFFER_BINDING,s.UNIFORM_BUFFER_BINDING,s.ELEMENT_ARRAY_BUFFER_BINDING,s.IMPLEMENTATION_COLOR_READ_FORMAT,s.IMPLEMENTATION_COLOR_READ_TYPE,s.READ_BUFFER,s.DRAW_BUFFER0,s.DRAW_BUFFER1,s.DRAW_BUFFER2,s.DRAW_BUFFER3,s.DRAW_BUFFER4,s.DRAW_BUFFER5,s.DRAW_BUFFER6,s.DRAW_BUFFER7,s.DRAW_BUFFER8,s.DRAW_BUFFER9,s.DRAW_BUFFER10,s.DRAW_BUFFER11,s.DRAW_BUFFER12,s.DRAW_BUFFER13,s.DRAW_BUFFER14,s.DRAW_BUFFER15,s.SAMPLER_BINDING,s.TEXTURE_BINDING_2D,s.TEXTURE_BINDING_2D_ARRAY,s.TEXTURE_BINDING_3D,s.TEXTURE_BINDING_CUBE_MAP]);function tE(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=rE(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
274
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function rE(e,t){if(e){if(typeof e=="string")return Qs(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 Qs(e,t)}}function Qs(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 Xt(e,t){var r=he.attach(e),n=r.gl;if(!nE(t)){var i={};for(var o in t){var a=Number(o),c=$s[o];c&&(typeof c=="string"?i[c]=!0:c(n,t[o],a))}var f=n.state&&n.state.cache;if(f)for(var u in i){var _=qs[u];_(n,t,f)}}}function Js(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:en,r=he.attach(e),n=r.gl;if(typeof t=="number"){var i=t,o=di[i];return o?o(n,i):n.getParameter(i)}var a=Array.isArray(t)?t:Object.keys(t),c={},f=tE(a),u;try{for(f.s();!(u=f.n()).done;){var _=u.value,E=di[_];c[_]=E?E(n,Number(_)):n.getParameter(Number(_))}}catch(p){f.e(p)}finally{f.f()}return c}function nE(e){for(var t in e)return!1;return!0}function ec(e,t){if(e===t)return!0;var r=Array.isArray(e)||ArrayBuffer.isView(e),n=Array.isArray(t)||ArrayBuffer.isView(t);if(r&&n&&e.length===t.length){for(var i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}return!1}var iE=function(){function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.copyState,o=i===void 0?!1:i,a=n.log,c=a===void 0?function(){}:a;C(this,e),this.gl=void 0,this.program=null,this.stateStack=[],this.enable=!0,this.cache=void 0,this.log=void 0,this.gl=r,this.cache=o?Js(r):Object.assign({},en),this.log=c,this._updateCache=this._updateCache.bind(this),Object.seal(this)}var t=e.prototype;return t.push=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.stateStack.push({})},t.pop=function(){H(this.stateStack.length>0);var n=this.stateStack[this.stateStack.length-1];Xt(this.gl,n),this.stateStack.pop()},t._updateCache=function(n){var i=!1,o,a=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(var c in n){H(c!==void 0);var f=n[c],u=this.cache[c];ec(f,u)||(i=!0,o=u,a&&!(c in a)&&(a[c]=u),this.cache[c]=f)}return{valueChanged:i,oldValue:o}},y(e)}();function Rt(e){return e.state}function hi(e,t){var r=t.enable,n=r===void 0?!0:r,i=t.copyState;if(H(i!==void 0),!e.state){e.state=new iE(e,{copyState:i}),aE(e);for(var o in pi){var a=pi[o];oE(e,o,a)}tc(e,"getParameter"),tc(e,"isEnabled")}var c=Rt(e);return c.enable=n,e}function At(e){var t=Rt(e);t||(hi(e,{copyState:!1}),t=Rt(e)),t.push()}function at(e){var t=Rt(e);H(t),t.pop()}function tc(e,t){var r=e[t].bind(e);e[t]=function(i){if(i===void 0||Zs.has(i))return r(i);var o=Rt(e);return i in o.cache||(o.cache[i]=r(i)),o.enable?o.cache[i]:r(i)},Object.defineProperty(e[t],"name",{value:"".concat(t,"-from-cache"),configurable:!1})}function oE(e,t,r){if(e[t]){var n=e[t].bind(e);e[t]=function(){for(var o=Rt(e),a=arguments.length,c=new Array(a),f=0;f<a;f++)c[f]=arguments[f];var u=r.apply(void 0,[o._updateCache].concat(c)),_=u.valueChanged,E=u.oldValue;return _&&n.apply(void 0,c),E},Object.defineProperty(e[t],"name",{value:"".concat(t,"-to-cache"),configurable:!1})}}function aE(e){var t=e.useProgram.bind(e);e.useProgram=function(n){var i=Rt(e);i.program!==n&&(t(n),i.program=n)}}function rc(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 Ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rc(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var sE={webgl2:!0,webgl1:!0,powerPreference:"high-performance",onContextLost:function(){return console.error("WebGL context lost")},onContextRestored:function(){return console.info("WebGL context restored")}};function nc(e,t){t=Ht(Ht({},sE),t);var r=null,n=function(_){return r=_.statusMessage||r};e.addEventListener("webglcontextcreationerror",n,!1);var i=null;if(t.type==="webgl2"&&(t=Ht(Ht({},t),{},{webgl1:!1})),t.type==="webgl1"&&(t=Ht(Ht({},t),{},{webgl2:!1})),!i&&t.webgl2&&(i=e.getContext("webgl2",t)),!i&&t.webgl1&&(i=e.getContext("webgl",t)),e.removeEventListener("webglcontextcreationerror",n,!1),!i)throw new Error("Failed to create ".concat(t.webgl2&&!t.webgl1?"WebGL2":"WebGL"," context: ").concat(r||"Unknown error"));if(t.onContextLost){var o=t,a=o.onContextLost;e.addEventListener("webglcontextlost",function(u){return a(u)},!1)}if(t.onContextRestored){var c=t,f=c.onContextRestored;e.addEventListener("webglcontextrestored",function(u){return f(u)},!1)}return i}function ic(e){var t=e.getParameter(s.VENDOR),r=e.getParameter(s.RENDERER),n=e.getExtension("WEBGL_debug_renderer_info"),i=e.getParameter(n?n.UNMASKED_VENDOR_WEBGL:s.VENDOR),o=e.getParameter(n?n.UNMASKED_RENDERER_WEBGL:s.RENDERER),a=i||t,c=o||r,f=cE(a,c);return{type:Q(e)?"webgl2":"webgl",gpu:f,vendor:i||t,renderer:o||r,version:e.getParameter(s.VERSION),shadingLanguages:["glsl"],shadingLanguageVersions:{glsl:e.getParameter(s.SHADING_LANGUAGE_VERSION)}}}function cE(e,t){return/NVIDIA/i.exec(e)||/NVIDIA/i.exec(t)?"nvidia":/INTEL/i.exec(e)||/INTEL/i.exec(t)?"intel":/Apple/i.exec(e)||/Apple/i.exec(t)?"apple":/AMD/i.exec(e)||/AMD/i.exec(t)||/ATI/i.exec(e)||/ATI/i.exec(t)?"amd":/SwiftShader/i.exec(e)||/SwiftShader/i.exec(t)?"software":"unknown"}function oc(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=typeof window<"u"?window.navigator||{}:{},r=e.userAgent||t.userAgent||"",n=r.indexOf("MSIE ")!==-1,i=r.indexOf("Trident/")!==-1;return n||i}function tn(e){switch(e){case"uint8":return s.UNSIGNED_BYTE;case"sint8":return s.BYTE;case"unorm8":return s.UNSIGNED_BYTE;case"snorm8":return s.BYTE;case"uint16":return s.UNSIGNED_SHORT;case"sint16":return s.SHORT;case"unorm16":return s.UNSIGNED_SHORT;case"snorm16":return s.SHORT;case"uint32":return s.UNSIGNED_INT;case"sint32":return s.INT;case"float16":return s.HALF_FLOAT;case"float32":return s.FLOAT}throw new Error(String(e))}var Se,He,Ae="texture-compression-bc",re="texture-compression-astc",We="texture-compression-etc2",fE="texture-compression-etc1-webgl",rn="texture-compression-pvrtc-webgl",mi="texture-compression-atc-webgl",cr="WEBGL_compressed_texture_s3tc",fr="WEBGL_compressed_texture_s3tc_srgb",Wt="EXT_texture_compression_rgtc",ur="EXT_texture_compression_bptc",uE="WEBGL_compressed_texture_etc",lE="WEBGL_compressed_texture_astc",_E="WEBGL_compressed_texture_etc1",EE="WEBGL_compressed_texture_pvrtc",pE="WEBGL_compressed_texture_atc",ac="EXT_sRGB",Qe="EXT_texture_norm16",dE="WEBGL_color_buffer_float",hE="EXT_color_buffer_float",we=function(t,r){return t.getExtension(r)},Tt=function(t,r){return r.every(function(n){return t.getExtension(n)})},Ri={"texture-blend-float-webgl1":function(t){return Q(t)?!0:we(t,"EXT_float_blend")},"texture-formats-srgb-webgl1":function(t){return Q(t)?!0:we(t,ac)},"texture-formats-depth-webgl1":function(t){return Q(t)?!0:we(t,"WEBGL_depth_texture")},"texture-formats-float32-webgl1":function(t){return Q(t)?!0:we(t,"OES_texture_float")},"texture-formats-float16-webgl1":function(t){return Q(t)?!0:we(t,"OES_texture_half_float")},"texture-formats-norm16-webgl":function(t){return Q(t)?we(t,Qe):!1},"texture-filter-linear-float32-webgl":function(t){return we(t,"OES_texture_float_linear")},"texture-filter-linear-float16-webgl":function(t){return we(t,"OES_texture_half_float_linear")},"texture-filter-anisotropic-webgl":function(t){return we(t,"EXT_texture_filter_anisotropic")},"texture-renderable-float32-webgl":function(t){return we(t,"EXT_color_buffer_float")},"texture-renderable-float16-webgl":function(t){return we(t,"EXT_color_buffer_half_float")},"texture-compression-bc":function(t){return Tt(t,[cr,fr,Wt,ur])},"texture-compression-bc5-webgl":function(t){return Tt(t,[Wt])},"texture-compression-etc2":function(t){return Tt(t,[uE])},"texture-compression-astc":function(t){return Tt(t,[lE])},"texture-compression-etc1-webgl":function(t){return Tt(t,[_E])},"texture-compression-pvrtc-webgl":function(t){return Tt(t,[EE])},"texture-compression-atc-webgl":function(t){return Tt(t,[pE])}};function mE(e,t){var r;return((r=Ri[t])===null||r===void 0?void 0:r.call(Ri,e))||!1}function sc(e){var t=Object.keys(Ri);return t.filter(function(r){return mE(e,r)})}var lr={"rgb8unorm-unsized":{gl:s.RGB,gl1:s.RGB,b:4,c:2,bpp:4,dataFormat:s.RGB,types:[s.UNSIGNED_BYTE,s.UNSIGNED_SHORT_5_6_5]},"rgba8unorm-unsized":{gl:s.RGBA,gl1:s.RGBA,b:4,c:2,bpp:4,dataFormat:s.RGBA,types:[s.UNSIGNED_BYTE,s.UNSIGNED_SHORT_4_4_4_4,s.UNSIGNED_SHORT_5_5_5_1]},r8unorm:{gl:s.R8,b:1,c:1,renderbuffer:!0},r8snorm:{gl:s.R8_SNORM,b:1,c:1},r8uint:{gl:s.R8UI,b:1,c:1,renderbuffer:!0},r8sint:{gl:s.R8I,b:1,c:1,renderbuffer:!0},rg8unorm:{gl:s.RG8,b:2,c:2,renderbuffer:!0},rg8snorm:{gl:s.RG8_SNORM,b:2,c:2},rg8uint:{gl:s.RG8UI,b:2,c:2,renderbuffer:!0},rg8sint:{gl:s.RG8I,b:2,c:2,renderbuffer:!0},r16uint:{gl:s.R16UI,b:2,c:1,renderbuffer:!0},r16sint:{gl:s.R16I,b:2,c:1,renderbuffer:!0},r16float:{gl:s.R16F,b:2,c:1,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl",renderbuffer:!0},"r16unorm-webgl":{gl:s.R16_EXT,b:2,c:1,f:"texture-formats-norm16-webgl",renderbuffer:!0,x:Qe},"r16snorm-webgl":{gl:s.R16_SNORM_EXT,b:2,c:1,f:"texture-formats-norm16-webgl",x:Qe},"rgba4unorm-webgl":{gl:s.RGBA4,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb565unorm-webgl":{gl:s.RGB565,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb5a1unorm-webgl":{gl:s.RGB5_A1,b:2,c:4,wgpu:!1,renderbuffer:!0},"rgb8unorm-webgl":{gl:s.RGB8,b:3,c:3,wgpu:!1},"rgb8snorm-webgl":{gl:s.RGB8_SNORM,b:3,c:3,wgpu:!1},rgba8unorm:{gl:s.RGBA8,gl1:s.RGBA,b:4,c:2,bpp:4},"rgba8unorm-srgb":{gl:s.SRGB8_ALPHA8,gl1:s.SRGB_ALPHA_EXT,b:4,c:4,gl1ext:ac,bpp:4},rgba8snorm:{gl:s.RGBA8_SNORM,b:4,c:4},rgba8uint:{gl:s.RGBA8UI,b:4,c:4,bpp:4},rgba8sint:{gl:s.RGBA8I,b:4,c:4,bpp:4},bgra8unorm:{b:4,c:4},"bgra8unorm-srgb":{b:4,c:4},rg16uint:{gl:s.RG16UI,b:4,c:1,bpp:4},rg16sint:{gl:s.RG16I,b:4,c:2,bpp:4},rg16float:{gl:s.RG16F,bpp:4,b:4,c:2,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl",renderbuffer:!0},"rg16unorm-webgl":{gl:s.RG16_EXT,b:2,c:2,f:"texture-formats-norm16-webgl",x:Qe},"rg16snorm-webgl":{gl:s.RG16_SNORM_EXT,b:2,c:2,f:"texture-formats-norm16-webgl",x:Qe},r32uint:{gl:s.R32UI,b:4,c:1,bpp:4,renderbuffer:!0},r32sint:{gl:s.R32I,b:4,c:1,bpp:4,renderbuffer:!0},r32float:{gl:s.R32F,bpp:4,b:4,c:1,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl"},rgb9e5ufloat:{gl:s.RGB9_E5,b:4,c:3,p:1,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl"},rg11b10ufloat:{gl:s.R11F_G11F_B10F,b:4,c:3,p:1,render:"texture-renderable-float32-webgl",renderbuffer:!0},rgb10a2unorm:{gl:s.RGB10_A2,b:4,c:4,p:1,renderbuffer:!0},"rgb10a2unorm-webgl":{b:4,c:4,gl:s.RGB10_A2UI,p:1,wgpu:!1,bpp:4,renderbuffer:!0},"rgb16unorm-webgl":{gl:s.RGB16_EXT,b:2,c:3,f:"texture-formats-norm16-webgl",x:Qe},"rgb16snorm-webgl":{gl:s.RGB16_SNORM_EXT,b:2,c:3,f:"texture-formats-norm16-webgl",x:Qe},rg32uint:{gl:s.RG32UI,b:8,c:2,renderbuffer:!0},rg32sint:{gl:s.RG32I,b:8,c:2,renderbuffer:!0},rg32float:{gl:s.RG32F,b:8,c:2,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",renderbuffer:!0},rgba16uint:{gl:s.RGBA16UI,b:8,c:4,renderbuffer:!0},rgba16sint:{gl:s.RGBA16I,b:8,c:4,renderbuffer:!0},rgba16float:{gl:s.RGBA16F,gl1:s.RGBA,b:8,c:4,render:"texture-renderable-float16-webgl",filter:"texture-filter-linear-float16-webgl"},"rgba16unorm-webgl":{gl:s.RGBA16_EXT,b:2,c:4,f:"texture-formats-norm16-webgl",renderbuffer:!0,x:Qe},"rgba16snorm-webgl":{gl:s.RGBA16_SNORM_EXT,b:2,c:4,f:"texture-formats-norm16-webgl",x:Qe},"rgb32float-webgl":{gl:s.RGB32F,gl1:s.RGB,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",gl2ext:hE,gl1ext:dE,dataFormat:s.RGB,types:[s.FLOAT]},rgba32uint:{gl:s.RGBA32UI,b:16,c:4,renderbuffer:!0},rgba32sint:{gl:s.RGBA32I,b:16,c:4,renderbuffer:!0},rgba32float:{gl:s.RGBA32F,b:16,c:4,render:"texture-renderable-float32-webgl",filter:"texture-filter-linear-float32-webgl",renderbuffer:!0},stencil8:{gl:s.STENCIL_INDEX8,gl1:s.STENCIL_INDEX8,b:1,c:1,attachment:s.STENCIL_ATTACHMENT,renderbuffer:!0},depth16unorm:{gl:s.DEPTH_COMPONENT16,gl1:s.DEPTH_COMPONENT16,b:2,c:1,attachment:s.DEPTH_ATTACHMENT,renderbuffer:!0},depth24plus:{gl:s.DEPTH_COMPONENT24,b:3,c:1,attachment:s.DEPTH_ATTACHMENT},depth32float:{gl:s.DEPTH_COMPONENT32F,b:4,c:1,attachment:s.DEPTH_ATTACHMENT,renderbuffer:!0},"depth24plus-stencil8":{gl:s.DEPTH_STENCIL,gl1:s.DEPTH_STENCIL,b:4,c:2,p:1,attachment:s.DEPTH_STENCIL_ATTACHMENT,renderbuffer:!0,depthTexture:!0},"depth24unorm-stencil8":{gl:s.DEPTH24_STENCIL8,b:4,c:2,p:1,attachment:s.DEPTH_STENCIL_ATTACHMENT,renderbuffer:!0},"depth32float-stencil8":{gl:s.DEPTH32F_STENCIL8,b:5,c:2,p:1,attachment:s.DEPTH_STENCIL_ATTACHMENT,renderbuffer:!0},"bc1-rgb-unorm-webgl":{gl:s.COMPRESSED_RGB_S3TC_DXT1_EXT,x:cr,f:Ae},"bc1-rgb-unorm-srgb-webgl":{gl:s.COMPRESSED_SRGB_S3TC_DXT1_EXT,x:fr,f:Ae},"bc1-rgba-unorm":{gl:s.COMPRESSED_RGBA_S3TC_DXT1_EXT,x:cr,f:Ae},"bc1-rgba-unorm-srgb":{gl:s.COMPRESSED_SRGB_S3TC_DXT1_EXT,x:fr,f:Ae},"bc2-rgba-unorm":{gl:s.COMPRESSED_RGBA_S3TC_DXT3_EXT,x:cr,f:Ae},"bc2-rgba-unorm-srgb":{gl:s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,x:fr,f:Ae},"bc3-rgba-unorm":{gl:s.COMPRESSED_RGBA_S3TC_DXT5_EXT,x:cr,f:Ae},"bc3-rgba-unorm-srgb":{gl:s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,x:fr,f:Ae},"bc4-r-unorm":{gl:s.COMPRESSED_RED_RGTC1_EXT,x:Wt,f:Ae},"bc4-r-snorm":{gl:s.COMPRESSED_SIGNED_RED_RGTC1_EXT,x:Wt,f:Ae},"bc5-rg-unorm":{gl:s.COMPRESSED_RED_GREEN_RGTC2_EXT,x:Wt,f:Ae},"bc5-rg-snorm":{gl:s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,x:Wt,f:Ae},"bc6h-rgb-ufloat":{gl:s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,x:ur,f:Ae},"bc6h-rgb-float":{gl:s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,x:ur,f:Ae},"bc7-rgba-unorm":{gl:s.COMPRESSED_RGBA_BPTC_UNORM_EXT,x:ur,f:Ae},"bc7-rgba-unorm-srgb":{gl:s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,x:ur,f:Ae},"etc2-rgb8unorm":{gl:s.COMPRESSED_RGB8_ETC2,f:We},"etc2-rgb8unorm-srgb":{gl:s.COMPRESSED_SRGB8_ETC2,f:We},"etc2-rgb8a1unorm":{gl:s.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,f:We},"etc2-rgb8a1unorm-srgb":{gl:s.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,f:We},"etc2-rgba8unorm":{gl:s.COMPRESSED_RGBA8_ETC2_EAC,f:We},"etc2-rgba8unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,f:We},"eac-r11unorm":{gl:s.COMPRESSED_R11_EAC,f:We},"eac-r11snorm":{gl:s.COMPRESSED_SIGNED_R11_EAC,f:We},"eac-rg11unorm":{gl:s.COMPRESSED_RG11_EAC,f:We},"eac-rg11snorm":{gl:s.COMPRESSED_SIGNED_RG11_EAC,f:We},"astc-4x4-unorm":{gl:s.COMPRESSED_RGBA_ASTC_4x4_KHR,f:re},"astc-4x4-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,f:re},"astc-5x4-unorm":{gl:s.COMPRESSED_RGBA_ASTC_5x4_KHR,f:re},"astc-5x4-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,f:re},"astc-5x5-unorm":{gl:s.COMPRESSED_RGBA_ASTC_5x5_KHR,f:re},"astc-5x5-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,f:re},"astc-6x5-unorm":{gl:s.COMPRESSED_RGBA_ASTC_6x5_KHR,f:re},"astc-6x5-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,f:re},"astc-6x6-unorm":{gl:s.COMPRESSED_RGBA_ASTC_6x6_KHR,f:re},"astc-6x6-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,f:re},"astc-8x5-unorm":{gl:s.COMPRESSED_RGBA_ASTC_8x5_KHR,f:re},"astc-8x5-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,f:re},"astc-8x6-unorm":{gl:s.COMPRESSED_RGBA_ASTC_8x6_KHR,f:re},"astc-8x6-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,f:re},"astc-8x8-unorm":{gl:s.COMPRESSED_RGBA_ASTC_8x8_KHR,f:re},"astc-8x8-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,f:re},"astc-10x5-unorm":{gl:s.COMPRESSED_RGBA_ASTC_10x10_KHR,f:re},"astc-10x5-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,f:re},"astc-10x6-unorm":{gl:s.COMPRESSED_RGBA_ASTC_10x6_KHR,f:re},"astc-10x6-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,f:re},"astc-10x8-unorm":{gl:s.COMPRESSED_RGBA_ASTC_10x8_KHR,f:re},"astc-10x8-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,f:re},"astc-10x10-unorm":{gl:s.COMPRESSED_RGBA_ASTC_10x10_KHR,f:re},"astc-10x10-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,f:re},"astc-12x10-unorm":{gl:s.COMPRESSED_RGBA_ASTC_12x10_KHR,f:re},"astc-12x10-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,f:re},"astc-12x12-unorm":{gl:s.COMPRESSED_RGBA_ASTC_12x12_KHR,f:re},"astc-12x12-unorm-srgb":{gl:s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,f:re},"pvrtc-rgb4unorm-webgl":{gl:s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,f:rn},"pvrtc-rgba4unorm-webgl":{gl:s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,f:rn},"pvrtc-rbg2unorm-webgl":{gl:s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,f:rn},"pvrtc-rgba2unorm-webgl":{gl:s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,f:rn},"etc1-rbg-unorm-webgl":{gl:s.COMPRESSED_RGB_ETC1_WEBGL,f:fE},"atc-rgb-unorm-webgl":{gl:s.COMPRESSED_RGB_ATC_WEBGL,f:mi},"atc-rgba-unorm-webgl":{gl:s.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,f:mi},"atc-rgbai-unorm-webgl":{gl:s.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL,f:mi}},RE=(Se={},l(Se,s.RED,1),l(Se,s.RED_INTEGER,1),l(Se,s.RG,2),l(Se,s.RG_INTEGER,2),l(Se,s.RGB,3),l(Se,s.RGB_INTEGER,3),l(Se,s.RGBA,4),l(Se,s.RGBA_INTEGER,4),l(Se,s.DEPTH_COMPONENT,1),l(Se,s.DEPTH_STENCIL,1),l(Se,s.ALPHA,1),l(Se,s.LUMINANCE,1),l(Se,s.LUMINANCE_ALPHA,2),Se),AE=(He={},l(He,s.FLOAT,4),l(He,s.UNSIGNED_INT,4),l(He,s.INT,4),l(He,s.UNSIGNED_SHORT,2),l(He,s.SHORT,2),l(He,s.HALF_FLOAT,2),l(He,s.BYTE,1),l(He,s.UNSIGNED_BYTE,1),He);function _r(e,t){var r=Er(t),n=lr[r];if(!n||(Q(e)?n.gl===void 0:n.gl1===void 0))return!1;var i=n.x||Q(e)&&n.gl2ext||n.gl1ext;return i?Boolean(e.getExtension(i)):!0}function cc(e,t){var r;return _r(e,t)&&((r=lr[t])===null||r===void 0?void 0:r.renderbuffer)}function Er(e){if(typeof e=="string")return e;var t=Object.entries(lr).find(function(r){var n=W(r,2),i=n[1];return i.gl===e||i.gl1===e});if(!t)throw new Error("Unknown texture format ".concat(e));return t[0]}function pr(e,t){var r=lr[e],n=t?r?.gl:r?.gl1;if(n===void 0)throw new Error("Unsupported texture format ".concat(e));return n}function fc(e,t){var r=Er(t);if(!_r(e,r))return!1;try{var n=Ur(r);if(n.signed)return!1}catch{return!1}return r.endsWith("32float")?Boolean(e.getExtension("OES_texture_float_linear")):r.endsWith("16float")?Boolean(e.getExtension("OES_texture_half_float_linear")):!0}function uc(e,t){var r=Er(t);return!(!_r(e,r)||typeof r=="number")}function nn(e,t){var r=Er(e),n=pr(r,t),i=Ur(r);return{format:n,dataFormat:TE(i.format,i.integer,i.normalized,n),type:i.dataType?tn(i.dataType):s.UNSIGNED_BYTE,compressed:i.compressed}}function lc(e){var t=lr[e];if(!(t!=null&&t.attachment))throw new Error("".concat(e," is not a depth stencil format"));return t.attachment}function _c(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.RGBA,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:s.RGBA,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:s.UNSIGNED_BYTE,i=null,o=null;try{i=e.createTexture(),e.bindTexture(s.TEXTURE_2D,i);var a=0,c=1,f=1,u=0,_=new Uint8Array([0,0,255,255]);e.texImage2D(e.TEXTURE_2D,a,t,c,f,u,r,n,_),o=e.createFramebuffer(),e.bindFramebuffer(s.FRAMEBUFFER,o),e.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,i,0);var E=e.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE;return e.bindTexture(s.TEXTURE_2D,null),E}finally{e.deleteTexture(i),e.deleteFramebuffer(o)}}function dr(e,t){var r=Er(e),n=nn(r,t),i=RE[n.dataFormat]||4,o=AE[n.type]||1;return i*o}function TE(e,t,r,n){if(n===s.RGBA||n===s.RGB)return n;switch(e){case"r":return t&&!r?s.RED_INTEGER:s.RED;case"rg":return t&&!r?s.RG_INTEGER:s.RG;case"rgb":return t&&!r?s.RGB_INTEGER:s.RGB;case"rgba":return t&&!r?s.RGBA_INTEGER:s.RGBA;default:return s.RGBA}}function gE(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=vE(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
275
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function vE(e,t){if(e){if(typeof e=="string")return Ec(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 Ec(e,t)}}function Ec(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 pc(e){var t=SE(e),r=gE(sc(e)),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;t.add(i)}}catch(o){r.e(o)}finally{r.f()}return t}function SE(e){e.getExtension("EXT_color_buffer_float"),e.getExtension("WEBGL_color_buffer_float"),e.getExtension("EXT_float_blend");for(var t=new Set,r=0,n=Object.keys(dc);r<n.length;r++){var i=n[r];OE(e,i)&&t.add(i)}return t}function OE(e,t){var r=dc[t];if(!r)return!1;var n=r||[],i=W(n,2),o=i[0],a=i[1],c=Q(e)?a:o;if(typeof c=="boolean")return c;switch(t){case"texture-renderable-rgba32float-webgl":return Q(e)?Boolean(e.getExtension(c)):_c(e);case"glsl-derivatives":return Ti(e,c);case"glsl-frag-data":return Ti(e,c,{behavior:"require"});case"glsl-frag-depth":return Ti(e,c);default:return Boolean(e.getExtension(c))}}var Ai={};function Ti(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!oc(r))return!0;if(t in Ai)return Ai[t];var n=r.behavior||"enable",i="#extension GL_".concat(t," : ").concat(n,`
|
|
276
|
-
void main(void) {}`),o=e.createShader(e.VERTEX_SHADER);if(!o)throw new Error("shader");e.shaderSource(o,i),e.compileShader(o);var a=e.getShaderParameter(o,e.COMPILE_STATUS);return e.deleteShader(o),Ai[t]=a,a}var dc={webgl:[!0,!0],webgl2:[!1,!0],"timer-query-webgl":["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],"vertex-array-object-webgl1":["OES_vertex_array_object",!0],"instanced-rendering-webgl1":["ANGLE_instanced_arrays",!0],"multiple-render-targets-webgl1":["WEBGL_draw_buffers",!0],"index-uint32-webgl1":["OES_element_index_uint",!0],"blend-minmax-webgl1":["EXT_blend_minmax",!0],"texture-blend-float-webgl1":["EXT_float_blend","EXT_float_blend"],"texture-formats-srgb-webgl1":["EXT_sRGB",!0],"texture-formats-depth-webgl1":["WEBGL_depth_texture",!0],"texture-formats-float32-webgl1":["OES_texture_float",!0],"texture-formats-float16-webgl1":["OES_texture_half_float",!0],"texture-filter-linear-float32-webgl":["OES_texture_float_linear","OES_texture_float_linear"],"texture-filter-linear-float16-webgl":["OES_texture_half_float_linear","OES_texture_half_float_linear"],"texture-filter-anisotropic-webgl":["EXT_texture_filter_anisotropic","EXT_texture_filter_anisotropic"],"texture-renderable-rgba32float-webgl":["WEBGL_color_buffer_float","EXT_color_buffer_float"],"texture-renderable-float32-webgl":[!1,"EXT_color_buffer_float"],"texture-renderable-float16-webgl":["EXT_color_buffer_half_float","EXT_color_buffer_half_float"],"glsl-frag-data":["WEBGL_draw_buffers",!0],"glsl-frag-depth":["EXT_frag_depth",!0],"glsl-derivatives":["OES_standard_derivatives",!0],"glsl-texture-lod":["EXT_shader_texture_lod",!0]};function hc(e){var t=li(e);return{maxTextureDimension1D:0,maxTextureDimension2D:e.getParameter(s.MAX_TEXTURE_SIZE),maxTextureDimension3D:t?t.getParameter(s.MAX_3D_TEXTURE_SIZE):0,maxTextureArrayLayers:t?t.getParameter(s.MAX_ARRAY_TEXTURE_LAYERS):0,maxBindGroups:1,maxDynamicUniformBuffersPerPipelineLayout:0,maxDynamicStorageBuffersPerPipelineLayout:0,maxSampledTexturesPerShaderStage:e.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxSamplersPerShaderStage:e.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxStorageBuffersPerShaderStage:0,maxStorageTexturesPerShaderStage:0,maxUniformBuffersPerShaderStage:t?t.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS):0,maxUniformBufferBindingSize:t?t.getParameter(s.MAX_UNIFORM_BLOCK_SIZE):0,maxStorageBufferBindingSize:0,minUniformBufferOffsetAlignment:t?t.getParameter(s.UNIFORM_BUFFER_OFFSET_ALIGNMENT):0,minStorageBufferOffsetAlignment:0,maxVertexBuffers:0,maxVertexAttributes:e.getParameter(s.MAX_VERTEX_ATTRIBS),maxVertexBufferArrayStride:2048,maxInterStageShaderComponents:t?t.getParameter(s.MAX_VARYING_COMPONENTS):0,maxComputeWorkgroupStorageSize:0,maxComputeInvocationsPerWorkgroup:0,maxComputeWorkgroupSizeX:0,maxComputeWorkgroupSizeY:0,maxComputeWorkgroupSizeZ:0,maxComputeWorkgroupsPerDimension:0}}function mc(e){var t,r=li(e);function n(o){return e.getParameter(o)}function i(o,a){return r?r.getParameter(o):a||0}return t={},l(t,s.ALIASED_LINE_WIDTH_RANGE,n(s.ALIASED_LINE_WIDTH_RANGE)),l(t,s.ALIASED_POINT_SIZE_RANGE,n(s.ALIASED_POINT_SIZE_RANGE)),l(t,s.MAX_TEXTURE_SIZE,n(s.MAX_TEXTURE_SIZE)),l(t,s.MAX_CUBE_MAP_TEXTURE_SIZE,n(s.MAX_CUBE_MAP_TEXTURE_SIZE)),l(t,s.MAX_TEXTURE_IMAGE_UNITS,n(s.MAX_TEXTURE_IMAGE_UNITS)),l(t,s.MAX_COMBINED_TEXTURE_IMAGE_UNITS,n(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),l(t,s.MAX_VERTEX_TEXTURE_IMAGE_UNITS,n(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),l(t,s.MAX_RENDERBUFFER_SIZE,n(s.MAX_RENDERBUFFER_SIZE)),l(t,s.MAX_VARYING_VECTORS,n(s.MAX_VARYING_VECTORS)),l(t,s.MAX_VERTEX_ATTRIBS,n(s.MAX_VERTEX_ATTRIBS)),l(t,s.MAX_VERTEX_UNIFORM_VECTORS,n(s.MAX_VERTEX_UNIFORM_VECTORS)),l(t,s.MAX_FRAGMENT_UNIFORM_VECTORS,n(s.MAX_FRAGMENT_UNIFORM_VECTORS)),l(t,s.MAX_VIEWPORT_DIMS,n(s.MAX_VIEWPORT_DIMS)),l(t,s.MAX_TEXTURE_MAX_ANISOTROPY_EXT,n(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),l(t,s.MAX_3D_TEXTURE_SIZE,i(s.MAX_3D_TEXTURE_SIZE)),l(t,s.MAX_ARRAY_TEXTURE_LAYERS,i(s.MAX_ARRAY_TEXTURE_LAYERS)),l(t,s.MAX_CLIENT_WAIT_TIMEOUT_WEBGL,i(s.MAX_CLIENT_WAIT_TIMEOUT_WEBGL)),l(t,s.MAX_COLOR_ATTACHMENTS,i(s.MAX_COLOR_ATTACHMENTS)),l(t,s.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,i(s.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS)),l(t,s.MAX_COMBINED_UNIFORM_BLOCKS,i(s.MAX_COMBINED_UNIFORM_BLOCKS)),l(t,s.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,i(s.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS)),l(t,s.MAX_DRAW_BUFFERS,i(s.MAX_DRAW_BUFFERS)),l(t,s.MAX_ELEMENT_INDEX,i(s.MAX_ELEMENT_INDEX)),l(t,s.MAX_ELEMENTS_INDICES,i(s.MAX_ELEMENTS_INDICES)),l(t,s.MAX_ELEMENTS_VERTICES,i(s.MAX_ELEMENTS_VERTICES)),l(t,s.MAX_FRAGMENT_INPUT_COMPONENTS,i(s.MAX_FRAGMENT_INPUT_COMPONENTS)),l(t,s.MAX_FRAGMENT_UNIFORM_BLOCKS,i(s.MAX_FRAGMENT_UNIFORM_BLOCKS)),l(t,s.MAX_FRAGMENT_UNIFORM_COMPONENTS,i(s.MAX_FRAGMENT_UNIFORM_COMPONENTS)),l(t,s.MAX_SAMPLES,i(s.MAX_SAMPLES)),l(t,s.MAX_SERVER_WAIT_TIMEOUT,i(s.MAX_SERVER_WAIT_TIMEOUT)),l(t,s.MAX_TEXTURE_LOD_BIAS,i(s.MAX_TEXTURE_LOD_BIAS)),l(t,s.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,i(s.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS)),l(t,s.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,i(s.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS)),l(t,s.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,i(s.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS)),l(t,s.MAX_UNIFORM_BLOCK_SIZE,i(s.MAX_UNIFORM_BLOCK_SIZE)),l(t,s.MAX_UNIFORM_BUFFER_BINDINGS,i(s.MAX_UNIFORM_BUFFER_BINDINGS)),l(t,s.MAX_VARYING_COMPONENTS,i(s.MAX_VARYING_COMPONENTS)),l(t,s.MAX_VERTEX_OUTPUT_COMPONENTS,i(s.MAX_VERTEX_OUTPUT_COMPONENTS)),l(t,s.MAX_VERTEX_UNIFORM_BLOCKS,i(s.MAX_VERTEX_UNIFORM_BLOCKS)),l(t,s.MAX_VERTEX_UNIFORM_COMPONENTS,i(s.MAX_VERTEX_UNIFORM_COMPONENTS)),l(t,s.MIN_PROGRAM_TEXEL_OFFSET,i(s.MIN_PROGRAM_TEXEL_OFFSET)),l(t,s.MAX_PROGRAM_TEXEL_OFFSET,i(s.MAX_PROGRAM_TEXEL_OFFSET)),l(t,s.UNIFORM_BUFFER_OFFSET_ALIGNMENT,i(s.UNIFORM_BUFFER_OFFSET_ALIGNMENT)),t}function gi(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=b(e),e!==null););return e}function Ve(){return typeof Reflect<"u"&&Reflect.get?Ve=Reflect.get.bind():Ve=function(t,r,n){var i=gi(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ve.apply(this,arguments)}var yi=De(Me(),1);function st(e,t,r){var n=he.attach(e),i=n.gl;if(bE(t))return r(e);var o=t.nocatch,a=o===void 0?!0:o;At(i),Xt(i,t);var c;if(a)c=r(i),at(i);else try{c=r(i)}finally{at(i)}return c}function bE(e){for(var t in e)return!1;return!0}function Rc(e,t,r){if(Ct(t))return r(e);At(e.gl);try{return Xt(e,t),r(e)}finally{at(e.gl)}}function Ac(e,t,r){if(Ct(t))return r(e);At(e.gl);try{return yE(e,t),r(e)}finally{at(e.gl)}}function yE(e,t){var r=he.attach(e),n=r.gl;if(t.cullMode)switch(t.cullMode){case"none":n.disable(s.CULL_FACE);break;case"front":n.enable(s.CULL_FACE),n.cullFace(s.FRONT);break;case"back":n.enable(s.CULL_FACE),n.cullFace(s.BACK);break}if(t.frontFace&&n.frontFace(Si("frontFace",t.frontFace,{ccw:s.CCW,cw:s.CW})),t.depthBias!==void 0&&n.polygonOffset(t.depthBias,t.depthBiasSlopeScale||0),t.depthWriteEnabled!==void 0&&n.depthMask(PE("depthWriteEnabled",t.depthWriteEnabled)),t.depthCompare&&(t.depthCompare!=="always"?n.enable(s.DEPTH_TEST):n.disable(s.DEPTH_TEST),n.depthFunc(on("depthCompare",t.depthCompare))),t.stencilWriteMask){var i=t.stencilWriteMask;n.stencilMaskSeparate(s.FRONT,i),n.stencilMaskSeparate(s.BACK,i)}if(t.stencilReadMask&&x.warn("stencilReadMask not supported under WebGL"),t.stencilCompare){var o=t.stencilReadMask||4294967295,a=on("depthCompare",t.stencilCompare);t.stencilCompare!=="always"?n.enable(s.STENCIL_TEST):n.disable(s.STENCIL_TEST),n.stencilFuncSeparate(s.FRONT,a,0,o),n.stencilFuncSeparate(s.BACK,a,0,o)}if(t.stencilPassOperation&&t.stencilFailOperation&&t.stencilDepthFailOperation){var c=vi("stencilPassOperation",t.stencilPassOperation),f=vi("stencilFailOperation",t.stencilFailOperation),u=vi("stencilDepthFailOperation",t.stencilDepthFailOperation);n.stencilOpSeparate(s.FRONT,f,u,c),n.stencilOpSeparate(s.BACK,f,u,c)}}function on(e,t){return Si(e,t,{never:s.NEVER,less:s.LESS,equal:s.EQUAL,"less-equal":s.LEQUAL,greater:s.GREATER,"not-equal":s.NOTEQUAL,"greater-equal":s.GEQUAL,always:s.ALWAYS})}function vi(e,t){return Si(e,t,{keep:s.KEEP,zero:s.ZERO,replace:s.REPLACE,invert:s.INVERT,"increment-clamp":s.INCR,"decrement-clamp":s.DECR,"increment-wrap":s.INCR_WRAP,"decrement-wrap":s.DECR_WRAP})}function CE(e,t){return"Illegal parameter ".concat(t," for ").concat(e)}function Si(e,t,r){if(!(t in r))throw new Error(CE(e,t));return r[t]}function PE(e,t){return t}function Tc(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?Tc(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function an(e){var t={};return e.addressModeU&&(t[s.TEXTURE_WRAP_S]=Oi(e.addressModeU)),e.addressModeV&&(t[s.TEXTURE_WRAP_T]=Oi(e.addressModeV)),e.addressModeW&&(t[s.TEXTURE_WRAP_R]=Oi(e.addressModeW)),e.magFilter&&(t[s.TEXTURE_MAG_FILTER]=gc(e.magFilter)),(e.minFilter||e.mipmapFilter)&&(t[s.TEXTURE_MIN_FILTER]=ME(e.minFilter||"linear",e.mipmapFilter)),e.lodMinClamp!==void 0&&(t[s.TEXTURE_MIN_LOD]=e.lodMinClamp),e.lodMaxClamp!==void 0&&(t[s.TEXTURE_MAX_LOD]=e.lodMaxClamp),e.type==="comparison-sampler"&&(t[s.TEXTURE_COMPARE_MODE]=s.COMPARE_REF_TO_TEXTURE),e.compare&&(t[s.TEXTURE_COMPARE_FUNC]=on("compare",e.compare)),e.maxAnisotropy&&(t[s.TEXTURE_MAX_ANISOTROPY_EXT]=e.maxAnisotropy),t}function Oi(e){switch(e){case"clamp-to-edge":return s.CLAMP_TO_EDGE;case"repeat":return s.REPEAT;case"mirror-repeat":return s.MIRRORED_REPEAT}}function gc(e){switch(e){case"nearest":return s.NEAREST;case"linear":return s.LINEAR}}function ME(e,t){if(!t)return gc(e);switch(e){case"nearest":return t==="nearest"?s.NEAREST_MIPMAP_NEAREST:s.NEAREST_MIPMAP_LINEAR;case"linear":return t==="nearest"?s.LINEAR_MIPMAP_NEAREST:s.LINEAR_MIPMAP_LINEAR}}function vc(e){var t=NE({},e);return e[s.TEXTURE_MIN_FILTER]!==s.NEAREST&&(t[s.TEXTURE_MIN_FILTER]=s.LINEAR),t[s.TEXTURE_WRAP_S]=s.CLAMP_TO_EDGE,t[s.TEXTURE_WRAP_T]=s.CLAMP_TO_EDGE,t}var bi=De(Me(),1);function Sc(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 Oc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sc(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IE(e){var t=FE();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function FE(){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 xE=10,je=function(e){U(r,e);var t=IE(r);function r(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,r),o=t.call(this,i,a),o.device=void 0,o.gl=void 0,o.gl2=void 0,o.handle=void 0,o.glTarget=void 0,o.glUsage=void 0,o.glIndexType=s.UNSIGNED_SHORT,o.byteLength=void 0,o.bytesUsed=void 0,o.debugData=null,o.device=i,o.gl=o.device.gl,o.gl2=o.device.gl2;var c=ce(a)==="object"?a.handle:void 0;return o.handle=c||o.gl.createBuffer(),i.setSpectorMetadata(o.handle,Oc(Oc({},o.props),{},{data:ce(o.props.data)})),o.glTarget=DE(o.props.usage),o.glUsage=BE(o.props.usage),o.glIndexType=o.props.indexType==="uint32"?s.UNSIGNED_INT:s.UNSIGNED_SHORT,o.debugData=null,a.data?o._initWithData(a.data,a.byteOffset,a.byteLength):o._initWithByteLength(a.byteLength||0),o}var n=r.prototype;return n._initWithData=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:o.byteLength+a;H(ArrayBuffer.isView(o));var f=this._getWriteTarget();return this.gl.bindBuffer(f,this.handle),this.gl.bufferData(f,c,this.glUsage),this.gl.bufferSubData(f,a,o),this.gl.bindBuffer(f,null),this.debugData=o.slice(0,xE),this.bytesUsed=c,this.byteLength=c,this.trackAllocatedMemory(c),this},n._initWithByteLength=function(o){H(o>=0);var a=o;o===0&&(a=new Float32Array(0));var c=this._getWriteTarget();return this.gl.bindBuffer(c,this.handle),this.gl.bufferData(c,a,this.glUsage),this.gl.bindBuffer(c,null),this.debugData=null,this.bytesUsed=o,this.byteLength=o,this},n.destroy=function(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)},n.write=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,c=0,f=void 0,u=this.device.isWebGL2?s.COPY_WRITE_BUFFER:this.glTarget;this.gl.bindBuffer(u,this.handle),c!==0||f!==void 0?(this.device.assertWebGL2(),this.gl2.bufferSubData(u,a,o,c,f)):this.gl.bufferSubData(u,a,o),this.gl.bindBuffer(u,null)},n.readAsync=function(){var i=ne(bi.default.mark(function a(){var c,f,u,_,E=arguments;return bi.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return c=E.length>0&&E[0]!==void 0?E[0]:0,f=E.length>1?E[1]:void 0,this.device.assertWebGL2(),u=new Uint8Array(f),_=0,this.gl.bindBuffer(s.COPY_READ_BUFFER,this.handle),this.gl2.getBufferSubData(s.COPY_READ_BUFFER,c,u,_,f),this.gl.bindBuffer(s.COPY_READ_BUFFER,null),d.abrupt("return",u);case 9:case"end":return d.stop()}},a,this)}));function o(){return i.apply(this,arguments)}return o}(),n._invalidateDebugData=function(){this.debugData=null},n._getWriteTarget=function(){return this.glTarget},n._getReadTarget=function(){return this.glTarget},y(r)}(se);function DE(e){return e&se.INDEX?s.ELEMENT_ARRAY_BUFFER:e&se.VERTEX?s.ARRAY_BUFFER:e&se.UNIFORM?s.UNIFORM_BUFFER:s.ARRAY_BUFFER}function BE(e){return e&se.INDEX?s.STATIC_DRAW:e&se.VERTEX?s.STATIC_DRAW:e&se.UNIFORM?s.DYNAMIC_DRAW:s.STATIC_DRAW}function wE(e){var t=UE();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function UE(){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 hr=function(e){U(r,e);var t=wE(r);function r(i,o){var a;return C(this,r),a=t.call(this,i,o),a.device=void 0,a.handle=void 0,a.parameters=void 0,a.device=i,a.parameters=an(o),a.device.isWebGL2&&(a.handle=a.handle||a.device.gl2.createSampler(),a._setSamplerParameters(a.parameters)),a}var n=r.prototype;return n.destroy=function(){this.handle&&(this.device.gl2.deleteSampler(this.handle),this.handle=void 0)},n.toString=function(){return"Sampler(".concat(this.id,",").concat(JSON.stringify(this.props),")")},n._setSamplerParameters=function(o){for(var a=0,c=Object.entries(o);a<c.length;a++){var f=W(c[a],2),u=f[0],_=f[1],E=Number(u);switch(E){case s.TEXTURE_MIN_LOD:case s.TEXTURE_MAX_LOD:this.device.gl2.samplerParameterf(this.handle,E,_);break;default:this.device.gl2.samplerParameteri(this.handle,E,_);break}}},y(r)}(Ir);function XE(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=HE(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
277
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function HE(e,t){if(e){if(typeof e=="string")return bc(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 bc(e,t)}}function bc(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 yc(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?yc(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function WE(e){var t=VE();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function VE(){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 jE={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0},Ke=function(e){U(r,e);var t=WE(r);function r(i,o){var a,c;return C(this,r),c=t.call(this,i,sn(sn({},jE),{},{format:"rgba8unorm"},o)),c.MAX_ATTRIBUTES=void 0,c.device=void 0,c.gl=void 0,c.gl2=void 0,c.handle=void 0,c.sampler=void 0,c.glFormat=void 0,c.type=void 0,c.dataFormat=void 0,c.mipmaps=void 0,c.target=void 0,c.textureUnit=void 0,c.loaded=!1,c._video=void 0,c.device=i,c.gl=c.device.gl,c.gl2=c.device.gl2,c.handle=c.props.handle||c.gl.createTexture(),c.device.setSpectorMetadata(c.handle,sn(sn({},c.props),{},{data:ce(c.props.data)})),c.glFormat=s.RGBA,c.target=KE(c.props),c.loaded=!1,typeof((a=c.props)===null||a===void 0?void 0:a.data)=="string"&&Object.assign(c.props,{data:Hn(c.props.data)}),c.initialize(c.props),Object.seal(Fe(c)),c}var n=r.prototype;return n.destroy=function(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)},n.toString=function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")},n.initialize=function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.props.dimension==="cube")return this.initializeCube(a);var c=a.data;if(c instanceof Promise)return c.then(function(v){return o.initialize(Object.assign({},a,{pixels:v,data:v}))}),this;var f=typeof HTMLVideoElement<"u"&&c instanceof HTMLVideoElement;if(f&&c.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,c.addEventListener("loadeddata",function(){return o.initialize(a)}),this;var u=a.parameters,_=u===void 0?{}:u,E=a.pixels,p=E===void 0?null:E,d=a.pixelStore,h=d===void 0?{}:d,m=a.textureUnit,A=m===void 0?void 0:m;c||(c=p);var T=a.width,P=a.height,S=a.dataFormat,O=a.type,F=a.compressed,M=F===void 0?!1:F,X=a.mipmaps,j=X===void 0?!0:X,k=a.depth,V=k===void 0?0:k,g=pr(a.format,this.device.isWebGL2),R=this._deduceParameters({format:a.format,type:O,dataFormat:S,compressed:M,data:c,width:T,height:P});return T=R.width,P=R.height,M=R.compressed,S=R.dataFormat,O=R.type,this.width=T,this.height=P,this.glFormat=g,this.type=O,this.dataFormat=S,this.textureUnit=A,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(s.TEXTURE0+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),j&&this.device.isWebGL1&&cn(this.width,this.height)&&(x.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaps"))(),j=!1),this.mipmaps=j,this.setImageData({data:c,width:T,height:P,depth:V,format:g,type:O,dataFormat:S,parameters:h,compressed:M}),this.setSampler(a.sampler),this._setSamplerParameters(_),j&&this.generateMipmap(),f&&(this._video={video:c,parameters:_,lastTime:c.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?c.currentTime:-1}),this},n.initializeCube=function(o){var a=this,c=o.mipmaps,f=c===void 0?!0:c,u=o.parameters,_=u===void 0?{}:u;return this.setCubeMapImageData(o).then(function(){a.loaded=!0,f&&a.generateMipmap(o),a.setSampler(o.sampler),a._setSamplerParameters(_)}),this},n.setSampler=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a;o instanceof hr?(this.sampler=o,a=o.props):(this.sampler=new hr(this.device,o),a=o);var c=an(a);return this._setSamplerParameters(c),this},n.resize=function(o){var a=o.height,c=o.width,f=o.mipmaps,u=f===void 0?!1:f;return c!==this.width||a!==this.height?this.initialize({width:c,height:a,format:this.format,type:this.type,dataFormat:this.dataFormat,mipmaps:u}):this},n.update=function(){if(this._video){var o=this._video,a=o.video,c=o.parameters,f=o.lastTime;if(f===a.currentTime||a.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:a,parameters:c}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=a.currentTime}},n.generateMipmap=function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.device.isWebGL1&&cn(this.width,this.height)?(x.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),st(this.gl,a,function(){o.gl.generateMipmap(o.target)}),this.gl.bindTexture(this.target,null),this)},n.setImageData=function(o){var a=this;if(this.props.dimension==="3d"||this.props.dimension==="2d-array")return this.setImageData3D(o);this.trackDeallocatedMemory("Texture");var c=o.target,f=c===void 0?this.target:c,u=o.pixels,_=u===void 0?null:u,E=o.level,p=E===void 0?0:E,d=o.glFormat,h=d===void 0?this.glFormat:d,m=o.offset,A=m===void 0?0:m,T=o.parameters,P=T===void 0?{}:T,S=o.data,O=S===void 0?null:S,F=o.type,M=F===void 0?this.type:F,X=o.width,j=X===void 0?this.width:X,k=o.height,V=k===void 0?this.height:k,g=o.dataFormat,R=g===void 0?this.dataFormat:g,v=o.compressed,I=v===void 0?!1:v;O||(O=_);var B=this._deduceParameters({format:this.props.format,type:M,dataFormat:R,compressed:I,data:O,width:j,height:V});M=B.type,R=B.dataFormat,I=B.compressed,j=B.width,V=B.height;var w=this.gl;w.bindTexture(this.target,this.handle);var Y=null,q=this._getDataType({data:O,compressed:I});O=q.data,Y=q.dataType;var K;if(st(this.gl,P,function(){switch(Y){case"null":w.texImage2D(f,p,h,j,V,0,R,M,O);break;case"typed-array":w.texImage2D(f,p,h,j,V,0,R,M,O,A);break;case"buffer":K=a.device.assertWebGL2(),K.bindBuffer(s.PIXEL_UNPACK_BUFFER,O.handle||O),K.texImage2D(f,p,h,j,V,0,R,M,A),K.bindBuffer(s.PIXEL_UNPACK_BUFFER,null);break;case"browser-object":a.device.isWebGL2?w.texImage2D(f,p,h,j,V,0,R,M,O):w.texImage2D(f,p,h,R,M,O);break;case"compressed":var G=XE(O.entries()),$;try{for(G.s();!($=G.n()).done;){var Te=W($.value,2),Pe=Te[0],pe=Te[1];w.compressedTexImage2D(f,Pe,pe.format,pe.width,pe.height,0,pe.data)}}catch(le){G.e(le)}finally{G.f()}break;default:H(!1,"Unknown image data type")}}),O&&O.byteLength)this.trackAllocatedMemory(O.byteLength,"Texture");else{var Z=dr(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*Z,"Texture")}return this.loaded=!0,this},n.setSubImageData=function(o){var a=this,c=o.target,f=c===void 0?this.target:c,u=o.pixels,_=u===void 0?null:u,E=o.data,p=E===void 0?null:E,d=o.x,h=d===void 0?0:d,m=o.y,A=m===void 0?0:m,T=o.width,P=T===void 0?this.width:T,S=o.height,O=S===void 0?this.height:S,F=o.level,M=F===void 0?0:F,X=o.glFormat,j=X===void 0?this.glFormat:X,k=o.type,V=k===void 0?this.type:k,g=o.dataFormat,R=g===void 0?this.dataFormat:g,v=o.compressed,I=v===void 0?!1:v,B=o.offset,w=B===void 0?0:B,Y=o.parameters,q=Y===void 0?{}:Y,K=this._deduceParameters({format:this.props.format,type:V,dataFormat:R,compressed:I,data:p,width:P,height:O});if(V=K.type,R=K.dataFormat,I=K.compressed,P=K.width,O=K.height,H(this.depth===1,"texSubImage not supported for 3D textures"),p||(p=_),p&&p.data){var Z=p;p=Z.data,P=Z.shape[0],O=Z.shape[1]}p instanceof je&&(p=p.handle),this.gl.bindTexture(this.target,this.handle),st(this.gl,q,function(){if(I)a.gl.compressedTexSubImage2D(f,M,h,A,P,O,j,p);else if(p===null)a.gl.texSubImage2D(f,M,h,A,P,O,R,V,null);else if(ArrayBuffer.isView(p))a.gl.texSubImage2D(f,M,h,A,P,O,R,V,p,w);else if(typeof WebGLBuffer<"u"&&p instanceof WebGLBuffer){var G=a.device.assertWebGL2();G.bindBuffer(s.PIXEL_UNPACK_BUFFER,p),G.texSubImage2D(f,M,h,A,P,O,R,V,w),G.bindBuffer(s.PIXEL_UNPACK_BUFFER,null)}else if(a.device.isWebGL2){var $=a.device.assertWebGL2();$.texSubImage2D(f,M,h,A,P,O,R,V,p)}else a.gl.texSubImage2D(f,M,h,A,R,V,p)}),this.gl.bindTexture(this.target,null)},n.copyFramebuffer=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return x.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null},n.getActiveUnit=function(){return this.gl.getParameter(s.ACTIVE_TEXTURE)-s.TEXTURE0},n.bind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,a=this.gl;return o!==void 0&&(this.textureUnit=o,a.activeTexture(a.TEXTURE0+o)),a.bindTexture(this.target,this.handle),o},n.unbind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,a=this.gl;return o!==void 0&&(this.textureUnit=o,a.activeTexture(a.TEXTURE0+o)),a.bindTexture(this.target,null),o},n._getDataType=function(o){var a=o.data,c=o.compressed,f=c===void 0?!1:c;return f?{data:a,dataType:"compressed"}:a===null?{data:a,dataType:"null"}:ArrayBuffer.isView(a)?{data:a,dataType:"typed-array"}:a instanceof je?{data:a.handle,dataType:"buffer"}:typeof WebGLBuffer<"u"&&a instanceof WebGLBuffer?{data:a,dataType:"buffer"}:{data:a,dataType:"browser-object"}},n._deduceParameters=function(o){var a=o.format,c=o.data,f=o.width,u=o.height,_=o.dataFormat,E=o.type,p=o.compressed,d=nn(a,this.device.isWebGL2);_=_||d.dataFormat,E=E||d.type,p=p||d.compressed;var h=this._deduceImageSize(c,f,u);return f=h.width,u=h.height,{dataFormat:_,type:E,compressed:p,width:f,height:u,format:a,data:c}},n._deduceImageSize=function(o,a,c){var f;return typeof ImageData<"u"&&o instanceof ImageData?f={width:o.width,height:o.height}:typeof HTMLImageElement<"u"&&o instanceof HTMLImageElement?f={width:o.naturalWidth,height:o.naturalHeight}:typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement?f={width:o.width,height:o.height}:typeof ImageBitmap<"u"&&o instanceof ImageBitmap?f={width:o.width,height:o.height}:typeof HTMLVideoElement<"u"&&o instanceof HTMLVideoElement?f={width:o.videoWidth,height:o.videoHeight}:o?f={width:a,height:c}:f={width:a>=0?a:1,height:c>=0?c:1},H(f,"Could not deduced texture size"),H(a===void 0||f.width===a,"Deduced texture width does not match supplied width"),H(c===void 0||f.height===c,"Deduced texture height does not match supplied height"),f},n.setCubeMapImageData=function(){var i=ne(yi.default.mark(function a(c){var f=this,u,_,E,p,d,h,m,A,T,P,S;return yi.default.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return u=this.gl,_=c.width,E=c.height,p=c.pixels,d=c.data,h=c.format,m=h===void 0?s.RGBA:h,A=c.type,T=A===void 0?s.UNSIGNED_BYTE:A,P=p||d,F.next=5,Promise.all(r.FACES.map(function(M){var X=P[M];return Promise.all(Array.isArray(X)?X:[X])}));case 5:S=F.sent,this.bind(),r.FACES.forEach(function(M,X){S[X].length>1&&f.props.mipmaps!==!1&&x.warn("".concat(f.id," has mipmap and multiple LODs."))(),S[X].forEach(function(j,k){_&&E?u.texImage2D(M,k,m,_,E,0,m,T,j):u.texImage2D(M,k,m,m,T,j)})}),this.unbind();case 9:case"end":return F.stop()}},a,this)}));function o(a){return i.apply(this,arguments)}return o}(),n.setImageDataForFace=function(o){var a=this,c=o.face,f=o.width,u=o.height,_=o.pixels,E=o.data,p=o.format,d=p===void 0?s.RGBA:p,h=o.type,m=h===void 0?s.UNSIGNED_BYTE:h,A=this.gl,T=_||E;return this.bind(),T instanceof Promise?T.then(function(P){return a.setImageDataForFace(Object.assign({},o,{face:c,data:P,pixels:P}))}):this.width||this.height?A.texImage2D(c,0,d,f,u,0,d,m,T):A.texImage2D(c,0,d,d,m,T),this},n.setImageData3D=function(o){var a=this,c=o.level,f=c===void 0?0:c,u=o.dataFormat,_=o.format,E=o.type,p=o.width,d=o.height,h=o.depth,m=h===void 0?1:h,A=o.offset,T=A===void 0?0:A,P=o.data,S=o.parameters,O=S===void 0?{}:S;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);var F=nn(_,this.device.isWebGL2);if(st(this.gl,O,function(){ArrayBuffer.isView(P)&&a.gl.texImage3D(a.target,f,F.format,p,d,m,0,F.dataFormat,F.type,P),P instanceof je&&(a.gl.bindBuffer(s.PIXEL_UNPACK_BUFFER,P.handle),a.gl.texImage3D(a.target,f,u,p,d,m,0,_,E,T))}),P&&P.byteLength)this.trackAllocatedMemory(P.byteLength,"Texture");else{var M=dr(this.props.format,this.device.isWebGL2);this.trackAllocatedMemory(this.width*this.height*this.depth*M,"Texture")}return this.loaded=!0,this},n._setSamplerParameters=function(o){if(this.device.isWebGL1&&cn(this.width,this.height)&&(o=vc(o)),!Ct(o)){kE(o),this.gl.bindTexture(this.target,this.handle);for(var a=0,c=Object.entries(o);a<c.length;a++){var f=W(c[a],2),u=f[0],_=f[1],E=Number(u),p=_;switch(E){case s.TEXTURE_MIN_LOD:case s.TEXTURE_MAX_LOD:this.gl.texParameterf(this.target,E,p);break;default:this.gl.texParameteri(this.target,E,p);break}}this.gl.bindTexture(this.target,null)}},n._getWebGL1NPOTParameterOverride=function(o,a){var c=this.device.isWebGL1&&cn(this.width,this.height);if(c)switch(o){case s.TEXTURE_MIN_FILTER:if(a!==s.LINEAR&&a!==s.NEAREST)return s.LINEAR;break;case s.TEXTURE_WRAP_S:case s.TEXTURE_WRAP_T:return s.CLAMP_TO_EDGE;default:break}return a},y(r)}(Oe);Ke.FACES=[s.TEXTURE_CUBE_MAP_POSITIVE_X,s.TEXTURE_CUBE_MAP_NEGATIVE_X,s.TEXTURE_CUBE_MAP_POSITIVE_Y,s.TEXTURE_CUBE_MAP_NEGATIVE_Y,s.TEXTURE_CUBE_MAP_POSITIVE_Z,s.TEXTURE_CUBE_MAP_NEGATIVE_Z];function KE(e){switch(e.dimension){case"2d":return s.TEXTURE_2D;case"cube":return s.TEXTURE_CUBE_MAP;case"2d-array":return s.TEXTURE_2D_ARRAY;case"3d":return s.TEXTURE_3D;case"1d":case"cube-array":default:throw new Error(e.dimension)}}function cn(e,t){return!e||!t?!1:!Cr(e)||!Cr(t)}function kE(e){x.log(1,"texture sampler parameters",e)()}function fn(e,t){if(typeof t!="string")return t;var r=Number(t);if(!isNaN(r))return r;t=t.replace(/^.*\./,"");var n=e[t];return H(n!==void 0,"Accessing undefined constant GL.".concat(t)),n}function YE(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=zE(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
278
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function zE(e,t){if(e){if(typeof e=="string")return Cc(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 Cc(e,t)}}function Cc(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 GE(e){var t=$E();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function $E(){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 Vt="Resource subclass must define virtual methods",un=function(e){U(r,e);var t=GE(r);function r(i,o,a){var c;C(this,r),c=t.call(this,i,o,a),c.device=void 0,c.gl=void 0,c.gl2=void 0,c._handle=void 0,c._bound=!1,c.byteLength=0,c.device=he.attach(i);var f=c.device.gl;Ls(f);var u=o||{},_=u.id;return c.gl=f,c.gl2=f,c.id=_||J(c.constructor.name),c._handle=o?.handle,c._handle===void 0&&(c._handle=c._createHandle()),c.byteLength=0,c}var n=r.prototype;return n.toString=function(){return"".concat(this.constructor.name,"(").concat(this.id,")")},n.delete=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=o.deleteChildren,c=a===void 0?!1:a,f=this._handle&&this._deleteHandle(this._handle);return this._handle&&this.removeStats(),this._handle=null,f&&c&&f.filter(Boolean).forEach(function(u){return u.destroy()}),this},n.bind=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof o!="function")return this._bindHandle(o),this;var a;return this._bound?a=o():(this._bindHandle(this.handle),this._bound=!0,a=o(),this._bound=!1,this._bindHandle(null)),a},n.unbind=function(){this.bind(null)},n.getParameter=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};o=fn(this.gl,o),H(o);var c=this.constructor.PARAMETERS||{},f=c[o];if(f){var u=Q(this.gl),_=(!("webgl2"in f)||u)&&(!("extension"in f)||this.gl.getExtension(f.extension));if(!_){var E=f.webgl1,p="webgl2"in f?f.webgl2:f.webgl1,d=u?p:E;return d}}return this._getParameter(o,a)},n.getParameters=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=o.parameters,c=o.keys,f=this.constructor.PARAMETERS||{},u=Q(this.gl),_={},E=a||Object.keys(f),p=YE(E),d;try{for(p.s();!(d=p.n()).done;){var h=d.value,m=f[h],A=m&&(!("webgl2"in m)||u)&&(!("extension"in m)||this.gl.getExtension(m.extension));if(A){var T=c?this.device.getGLKey(h):h;_[T]=this.getParameter(h,o),c&&m.type==="GLenum"&&(_[T]=this.device.getGLKey(_[T]))}}}catch(P){p.e(P)}finally{p.f()}return _},n.setParameter=function(o,a){o=fn(this.gl,o),H(o);var c=this.constructor.PARAMETERS||{},f=c[o];if(f){var u=Q(this.gl),_=(!("webgl2"in f)||u)&&(!("extension"in f)||this.gl.getExtension(f.extension));if(!_)throw new Error("Parameter not available on this platform");f.type==="GLenum"&&(a=fn(a))}return this._setParameter(o,a),this},n.setParameters=function(o){for(var a in o)this.setParameter(a,o[a]);return this},n.stubRemovedMethods=function(o,a,c){return Un(this,o,a,c)},n.initialize=function(o){},n._createHandle=function(){throw new Error(Vt)},n._deleteHandle=function(){throw new Error(Vt)},n._bindHandle=function(o){throw new Error(Vt)},n._getOptsFromHandle=function(){throw new Error(Vt)},n._getParameter=function(o,a){throw new Error(Vt)},n._setParameter=function(o,a){throw new Error(Vt)},y(r,[{key:"handle",get:function(){return this._handle}}]),r}(ee);var Mc;function Pc(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 Nc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pc(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qE(e){var t=ZE();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function ZE(){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}}Mc=Symbol.toStringTag;var ln=function(e){U(r,e);var t=qE(r);r.isTextureFormatSupported=function(o,a){return cc(o.gl,a)};function r(i,o){var a;if(C(this,r),typeof o.format=="number")throw new Error("Renderbuffer");return a=t.call(this,i,o,r.defaultProps),a.glFormat=void 0,a.glFormat=pr(a.props.format,i.isWebGL2),a._initialize(a.props),a}var n=r.prototype;return n.resize=function(o){(o.width!==this.width||o.height!==this.height)&&(Object.assign(this.props,Nc(Nc({},o),{},{format:this.format,samples:this.samples})),this._initialize(this.props))},n._initialize=function(o){var a=o.format,c=o.width,f=o.height,u=o.samples;H(a,"Needs format"),this.trackDeallocatedMemory(),this.gl.bindRenderbuffer(s.RENDERBUFFER,this.handle),u!==0&&this.device.isWebGL2?this.gl2.renderbufferStorageMultisample(s.RENDERBUFFER,u,this.glFormat,c,f):this.gl.renderbufferStorage(s.RENDERBUFFER,this.glFormat,c,f),this.gl.bindRenderbuffer(s.RENDERBUFFER,null),this.trackAllocatedMemory(c*f*(u||1)*dr(this.glFormat,this.device.isWebGL2))},n._createHandle=function(){return this.gl.createRenderbuffer()},n._deleteHandle=function(){this.gl.deleteRenderbuffer(this.handle),this.trackDeallocatedMemory()},n._bindHandle=function(o){this.gl.bindRenderbuffer(s.RENDERBUFFER,o)},y(r,[{key:Mc,get:function(){return"Renderbuffer"}},{key:"width",get:function(){return this.props.width}},{key:"height",get:function(){return this.props.height}},{key:"format",get:function(){return this.props.format}},{key:"samples",get:function(){return this.props.samples}},{key:"attachment",get:function(){}}]),r}(un);ln.defaultProps={id:void 0,handle:void 0,userData:void 0,format:void 0,width:1,height:1,samples:0};function QE(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=JE(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
279
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function JE(e,t){if(e){if(typeof e=="string")return Ic(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 Ic(e,t)}}function Ic(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 ep(e){var t=tp();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function tp(){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 _n=function(e){U(r,e);var t=ep(r);function r(i,o){var a;C(this,r),a=t.call(this,i,o),a.device=void 0,a.gl=void 0,a.handle=void 0;var c=o.handle===null;if(a.device=i,a.gl=i.gl,a.handle=a.props.handle||c?a.props.handle:a.gl.createFramebuffer(),!c){i.setSpectorMetadata(a.handle,{id:a.props.id,props:a.props}),a.autoCreateAttachmentTextures(),a.gl.bindFramebuffer(s.FRAMEBUFFER,a.handle);for(var f=0;f<a.colorAttachments.length;++f){var u=a.colorAttachments[f],_=s.COLOR_ATTACHMENT0+f;u&&a._attachOne(_,u)}a.depthStencilAttachment&&a._attachOne(lc(a.depthStencilAttachment.format),a.depthStencilAttachment),a.gl.bindFramebuffer(s.FRAMEBUFFER,null)}return o.check!==!1&&a._checkStatus(),a}var n=r.prototype;return n.destroy=function(){Ve(b(r.prototype),"destroy",this).call(this),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)},n._checkStatus=function(){var o=this.gl,a=o.bindFramebuffer(s.FRAMEBUFFER,this.handle),c=o.checkFramebufferStatus(s.FRAMEBUFFER);if(o.bindFramebuffer(s.FRAMEBUFFER,a||null),c!==o.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer ".concat(np(c)))},n.createDepthStencilTexture=function(o){return new ln(this.device,{id:"".concat(this.id,"-depth-stencil"),format:o,width:this.width,height:this.height})},n.resizeAttachments=function(o,a){if(this.handle===null)return this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;o===void 0&&(o=this.gl.drawingBufferWidth),a===void 0&&(a=this.gl.drawingBufferHeight);var c=QE(this.colorAttachments),f;try{for(c.s();!(f=c.n()).done;){var u=f.value;u.resize({width:o,height:a})}}catch(_){c.e(_)}finally{c.f()}return this.depthStencilAttachment&&this.depthStencilAttachment.resize({width:o,height:a}),this},n._attachOne=function(o,a){if(a instanceof ln)return this._attachWEBGLRenderbuffer(o,a),a;if(Array.isArray(a)){var c=W(a,3),f=c[0],u=c[1],_=u===void 0?0:u,E=c[2],p=E===void 0?0:E;return this._attachTexture(o,f,_,p),f}else if(a instanceof Ke)return this._attachTexture(o,a,0,0),a;throw new Error("attach")},n._attachWEBGLRenderbuffer=function(o,a){this.gl.framebufferRenderbuffer(s.FRAMEBUFFER,o,s.RENDERBUFFER,a.handle)},n._attachTexture=function(o,a,c,f){var u=this.device,_=u.gl,E=u.gl2;switch(_.bindTexture(a.target,a.handle),a.target){case s.TEXTURE_2D_ARRAY:case s.TEXTURE_3D:this.device.assertWebGL2(),E?.framebufferTextureLayer(s.FRAMEBUFFER,o,a.target,f,c);break;case s.TEXTURE_CUBE_MAP:var p=rp(c);_.framebufferTexture2D(s.FRAMEBUFFER,o,p,a.handle,f);break;case s.TEXTURE_2D:_.framebufferTexture2D(s.FRAMEBUFFER,o,s.TEXTURE_2D,a.handle,f);break;default:H(!1,"Illegal texture type")}_.bindTexture(a.target,null)},y(r,[{key:"texture",get:function(){return this.colorAttachments[0]}}]),r}(Fr);function rp(e){return e<s.TEXTURE_CUBE_MAP_POSITIVE_X?e+s.TEXTURE_CUBE_MAP_POSITIVE_X:e}function np(e){switch(e){case s.FRAMEBUFFER_COMPLETE:return"success";case s.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"Mismatched attachments";case s.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"No attachments";case s.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"Height/width mismatch";case s.FRAMEBUFFER_UNSUPPORTED:return"Unsupported or split attachments";case s.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:return"Samples mismatch";default:return"".concat(e)}}function ip(e){var t=op();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function op(){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 Fc=function(e){U(r,e);var t=ip(r);function r(i,o){var a;return C(this,r),a=t.call(this,o),a.device=void 0,a.presentationSize=void 0,a._framebuffer=null,a.device=i,a.presentationSize=[-1,-1],a._setAutoCreatedCanvasId("".concat(a.device.id,"-canvas")),a.update(),a}var n=r.prototype;return n.getCurrentFramebuffer=function(){return this.update(),this._framebuffer=this._framebuffer||new _n(this.device,{handle:null}),this._framebuffer},n.update=function(){var o=this.getPixelSize(),a=o[0]!==this.presentationSize[0]||o[1]!==this.presentationSize[1];a&&(this.presentationSize=o)},n.resize=function(o){if(this.canvas){var a=this.getDevicePixelRatio(o?.useDevicePixels);this.setDevicePixelRatio(a,o);return}var c=this.device.gl.getExtension("STACKGL_resize_drawingbuffer");c&&o&&"width"in o&&"height"in o&&c.resize(o.width,o.height)},n.commit=function(){},y(r)}(Nt);var Ci=De(Me(),1);function xc(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 Dc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xc(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ap={spector:x.get("spector")||x.get("inspect")},sp="https://spectorcdn.babylonjs.com/spector.bundle.js",cp=1,be=null,Bc=!1;function wc(e){return Pi.apply(this,arguments)}function Pi(){return Pi=ne(Ci.default.mark(function e(t){return Ci.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(globalThis.SPECTOR){n.next=9;break}return n.prev=1,n.next=4,er(sp);case 4:n.next=9;break;case 6:n.prev=6,n.t0=n.catch(1),x.warn(String(n.t0));case 9:case"end":return n.stop()}},e,null,[[1,6]])})),Pi.apply(this,arguments)}function Uc(e){var t,r;if(e=Dc(Dc({},ap),e),!((t=e)!==null&&t!==void 0&&t.spector)||(!be&&globalThis.SPECTOR&&(x.probe(cp,"SPECTOR found and initialized")(),be=new globalThis.SPECTOR.Spector,globalThis.luma&&(globalThis.luma.spector=be)),!be))return null;if(!Bc){var n,i;Bc=!0,be.spyCanvases(),(n=be)===null||n===void 0||n.onCaptureStarted.add(function(c){return x.info("Spector capture started:",c)()}),(i=be)===null||i===void 0||i.onCapture.add(function(c){var f,u,_;x.info("Spector capture complete:",c)(),(f=be)===null||f===void 0||f.getResultUI(),(u=be)===null||u===void 0||u.resultView.display(),(_=be)===null||_===void 0||_.resultView.addCapture(c)})}if((r=e)!==null&&r!==void 0&&r.canvas){var o,a;if(typeof e.spector=="string"&&e.spector!==e.canvas.id)return be;(o=be)===null||o===void 0||o.startCapture((a=e)===null||a===void 0?void 0:a.canvas,500),new Promise(function(c){return setTimeout(c,2e3)}).then(function(c){var f;x.info("Spector capture stopped after 2 seconds")(),(f=be)===null||f===void 0||f.stopCapture()})}return be}var Mi=De(Me(),1);function fp(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=up(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
280
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function up(e,t){if(e){if(typeof e=="string")return Lc(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 Lc(e,t)}}function Lc(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 Xc(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 Hc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xc(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var lp="https://unpkg.com/webgl-debug@2.0.1/index.js";function Wc(e){return e.luma=e.luma||{},e.luma}function Vc(){return Ii.apply(this,arguments)}function Ii(){return Ii=ne(Mi.default.mark(function e(){return Mi.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(ae()&&!globalThis.WebGLDebugUtils)){r.next=5;break}return globalThis.global=globalThis.global||globalThis,globalThis.global.module={},r.next=5,er(lp);case 5:case"end":return r.stop()}},e)})),Ii.apply(this,arguments)}function jc(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e?t.debug?Ep(e,t):_p(e):null}function _p(e){var t=Wc(e);return t.realContext?t.realContext:e}function Ep(e,t){if(!globalThis.WebGLDebugUtils)return x.warn("webgl-debug not loaded")(),e;var r=Wc(e);if(r.debugContext)return r.debugContext;globalThis.WebGLDebugUtils.init(Hc(Hc({},s),e));var n=globalThis.WebGLDebugUtils.makeDebugContext(e,pp.bind(null,t),dp.bind(null,t));for(var i in s)!(i in n)&&typeof s[i]=="number"&&(n[i]=s[i]);var o=y(function c(){C(this,c)});Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.setPrototypeOf(o,n);var a=Object.create(o);return r.realContext=e,r.debugContext=a,a.debug=!0,a}function Ni(e,t){t=Array.from(t).map(function(n){return n===void 0?"undefined":n});var r=globalThis.WebGLDebugUtils.glFunctionArgsToString(e,t);return r="".concat(r.slice(0,100)).concat(r.length>100?"...":""),"gl.".concat(e,"(").concat(r,")")}function pp(e,t,r,n){n=Array.from(n).map(function(f){return f===void 0?"undefined":f});var i=globalThis.WebGLDebugUtils.glEnumToString(t),o=globalThis.WebGLDebugUtils.glFunctionArgsToString(r,n),a=e.webgl2?"gl2":"gl1",c="".concat(i," in ").concat(a,".").concat(r,"(").concat(o,")");x.error(c)();debugger;if(e.throwOnError)throw new Error(c)}function dp(e,t,r){var n="";if(x.level>=1&&(n=Ni(t,r),x.log(1,n)()),e.break&&e.break.length>0){n=n||Ni(t,r);var i=e.break.every(function(f){return n.indexOf(f)!==-1});if(i)debugger}var o=fp(r),a;try{for(o.s();!(a=o.n()).done;){var c=a.value;if(c===void 0){if(n=n||Ni(t,r),e.throwOnError)throw new Error("Undefined argument: ".concat(n));x.error("Undefined argument: ".concat(n))();debugger}}}catch(f){o.e(f)}finally{o.f()}}function Fi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jt(e,t,r){return Fi()?jt=Reflect.construct.bind():jt=function(i,o,a){var c=[null];c.push.apply(c,o);var f=Function.bind.apply(i,c),u=new f;return a&&Et(u,a.prototype),u},jt.apply(null,arguments)}var hp="Failed to deduce GL constant from typed array";function En(e){var t=ArrayBuffer.isView(e)?e.constructor:e;switch(t){case Float32Array:return s.FLOAT;case Uint16Array:return s.UNSIGNED_SHORT;case Uint32Array:return s.UNSIGNED_INT;case Uint8Array:return s.UNSIGNED_BYTE;case Uint8ClampedArray:return s.UNSIGNED_BYTE;case Int8Array:return s.BYTE;case Int16Array:return s.SHORT;case Int32Array:return s.INT;default:throw new Error(hp)}}function Kt(e,t){var r=t||{},n=r.clamped,i=n===void 0?!0:n;switch(e){case s.FLOAT:return Float32Array;case s.UNSIGNED_SHORT:case s.UNSIGNED_SHORT_5_6_5:case s.UNSIGNED_SHORT_4_4_4_4:case s.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;case s.UNSIGNED_INT:return Uint32Array;case s.UNSIGNED_BYTE:return i?Uint8ClampedArray:Uint8Array;case s.BYTE:return Int8Array;case s.SHORT:return Int16Array;case s.INT:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}var mp={offset:0,stride:0,type:s.FLOAT,size:1,divisor:0,normalized:!1,integer:!1},Rp={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Je=function(){e.getBytesPerElement=function(n){var i=Kt(n.type||s.FLOAT);return i.BYTES_PER_ELEMENT},e.getBytesPerVertex=function(n){H(n.size);var i=Kt(n.type||s.FLOAT);return i.BYTES_PER_ELEMENT*n.size},e.resolve=function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return jt(e,[mp].concat(i))};function e(){var r=this;C(this,e),this.offset=void 0,this.stride=void 0,this.type=void 0,this.size=void 0,this.divisor=void 0,this.normalized=void 0,this.integer=void 0,this.buffer=void 0,this.index=void 0;for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];i.forEach(function(a){return r._assign(a)}),Object.freeze(this)}var t=e.prototype;return t.toString=function(){return JSON.stringify(this)},t._assign=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return n=dt("Accessor",n,Rp),n.type!==void 0&&(this.type=n.type,(n.type===s.INT||n.type===s.UNSIGNED_INT)&&(this.integer=!0)),n.size!==void 0&&(this.size=n.size),n.offset!==void 0&&(this.offset=n.offset),n.stride!==void 0&&(this.stride=n.stride),n.normalize!==void 0&&(this.normalized=n.normalize),n.normalized!==void 0&&(this.normalized=n.normalized),n.integer!==void 0&&(this.integer=n.integer),n.divisor!==void 0&&(this.divisor=n.divisor),n.buffer!==void 0&&(this.buffer=n.buffer),n.index!==void 0&&(typeof n.index=="boolean"?this.index=n.index?1:0:this.index=n.index),n.instanced!==void 0&&(this.divisor=n.instanced?1:0),n.isInstanced!==void 0&&(this.divisor=n.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this},y(e,[{key:"BYTES_PER_ELEMENT",get:function(){return e.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return e.getBytesPerVertex(this)}}]),e}();function Ap(e){var t=Tp();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Tp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Kc(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 gp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kc(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var kc=10,Yc={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},zc={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Yc},vp={removedProps:Yc};function Sp(e){if(ArrayBuffer.isView(e))return{data:e};if(typeof e=="number")return{byteLength:e};e=dt("Buffer",e,zc);var t=gp({},e);return t}var Gc=function(e){U(r,e);var t=Ap(r);function r(i){var o,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(C(this,r),o=t.call(this,he.attach(i),Sp(a)),o.accessor=void 0,o.setAccessor(Object.assign({},a,a.accessor)),o.props.data){var c=En(o.props.data);H(c),o.setAccessor(new Je(o.accessor,{type:c}))}return Object.seal(Fe(o)),o}var n=r.prototype;return n.getElementCount=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/Je.getBytesPerElement(o))},n.getVertexCount=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/Je.getBytesPerVertex(o))},n.initialize=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ArrayBuffer.isView(o)&&(o={data:o}),Number.isFinite(o)&&(o={byteLength:o}),o=dt("Buffer",o,zc),this.glUsage=o.glUsage||s.STATIC_DRAW,this.debugData=null,this.setAccessor(Object.assign({},o,o.accessor)),o.data?this._setData(o.data,o.byteOffset,o.byteLength):this._setByteLength(o.byteLength||0),this},n.setProps=function(o){return o=dt("Buffer",o,vp),"accessor"in o&&this.setAccessor(o.accessor),this},n.setAccessor=function(o){return o=Object.assign({},o),delete o.buffer,this.accessor=new Je(o),this},n.reallocate=function(o){return o>this.byteLength?(this._setByteLength(o),!0):(this.bytesUsed=o,!1)},n.setData=function(o){return this.initialize(o)},n.subData=function(o){ArrayBuffer.isView(o)&&(o={data:o});var a=o,c=a.data,f=a.offset,u=f===void 0?0:f,_=a.srcOffset,E=_===void 0?0:_,p=o.byteLength||o.length;H(c);var d=this.gl.webgl2?s.COPY_WRITE_BUFFER:this.glTarget;return this.gl.bindBuffer(d,this.handle),E!==0||p!==void 0?(Qr(this.gl),this.gl.bufferSubData(this.glTarget,u,c,E,p)):this.gl.bufferSubData(d,u,c),this.gl.bindBuffer(d,null),this.debugData=null,this._inferType(c),this},n.copyData=function(o){var a=o.sourceBuffer,c=o.readOffset,f=c===void 0?0:c,u=o.writeOffset,_=u===void 0?0:u,E=o.size,p=this.gl,d=this.gl2;return Qr(p),p.bindBuffer(s.COPY_READ_BUFFER,a.handle),p.bindBuffer(s.COPY_WRITE_BUFFER,this.handle),d?.copyBufferSubData(s.COPY_READ_BUFFER,s.COPY_WRITE_BUFFER,f,_,E),p.bindBuffer(s.COPY_READ_BUFFER,null),p.bindBuffer(s.COPY_WRITE_BUFFER,null),this.debugData=null,this},n.getData=function(o){var a,c=o||{},f=c.dstData,u=f===void 0?null:f,_=c.length,E=_===void 0?0:_,p=o||{},d=p.srcByteOffset,h=d===void 0?0:d,m=p.dstOffset,A=m===void 0?0:m;Qr(this.gl);var T=Kt(this.accessor.type||s.FLOAT,{clamped:!1}),P=this._getAvailableElementCount(h),S=A,O,F;u?(F=u.length,O=F-S):(O=Math.min(P,E||P),F=S+O);var M=Math.min(P,O);return E=E||M,H(E<=M),u=u||new T(F),this.gl.bindBuffer(s.COPY_READ_BUFFER,this.handle),(a=this.gl2)===null||a===void 0||a.getBufferSubData(s.COPY_READ_BUFFER,h,u,A,E),this.gl.bindBuffer(s.COPY_READ_BUFFER,null),u},n.bind=function(o){var a=o||{},c=a.glTarget,f=c===void 0?this.glTarget:c,u=a.index,_=u===void 0?this.accessor&&this.accessor.index:u,E=a.offset,p=E===void 0?0:E,d=a.size;if(f===s.UNIFORM_BUFFER||f===s.TRANSFORM_FEEDBACK_BUFFER)if(d!==void 0){var h;(h=this.gl2)===null||h===void 0||h.bindBufferRange(f,_,this.handle,p,d)}else{var m;H(p===0),(m=this.gl2)===null||m===void 0||m.bindBufferBase(f,_,this.handle)}else this.gl.bindBuffer(f,this.handle);return this},n.unbind=function(o){var a=o||{},c=a.glTarget,f=c===void 0?this.glTarget:c,u=a.index,_=u===void 0?this.accessor&&this.accessor.index:u,E=f===s.UNIFORM_BUFFER||f===s.TRANSFORM_FEEDBACK_BUFFER;if(E){var p;(p=this.gl2)===null||p===void 0||p.bindBufferBase(f,_,null)}else this.gl.bindBuffer(f,null);return this},n.getDebugData=function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(kc,this.byteLength)}),{data:this.debugData,changed:!0})},n.invalidateDebugData=function(){this.debugData=null},n._setData=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:o.byteLength+a;H(ArrayBuffer.isView(o)),this.trackDeallocatedMemory();var f=this._getTarget();this.gl.bindBuffer(f,this.handle),this.gl.bufferData(f,c,this.glUsage),this.gl.bufferSubData(f,a,o),this.gl.bindBuffer(f,null),this.debugData=o.slice(0,kc),this.bytesUsed=c,this.byteLength=c,this.trackAllocatedMemory(c);var u=En(o);return H(u),this.setAccessor(new Je(this.accessor,{type:u})),this},n._setByteLength=function(o){H(o>=0),this.trackDeallocatedMemory();var a=o;o===0&&(a=new Float32Array(0));var c=this._getTarget();return this.gl.bindBuffer(c,this.handle),this.gl.bufferData(c,a,this.glUsage),this.gl.bindBuffer(c,null),this.debugData=null,this.bytesUsed=o,this.byteLength=o,this.trackAllocatedMemory(o),this},n._getTarget=function(){return this.gl.webgl2?s.COPY_WRITE_BUFFER:this.glTarget},n._getAvailableElementCount=function(o){var a=Kt(this.accessor.type||s.FLOAT,{clamped:!1}),c=o/a.BYTES_PER_ELEMENT;return this.getElementCount()-c},n._inferType=function(o){this.accessor.type||this.setAccessor(new Je(this.accessor,{type:En(o)}))},n.getParameter=function(o){this.gl.bindBuffer(this.glTarget,this.handle);var a=this.gl.getBufferParameter(this.glTarget,o);return this.gl.bindBuffer(this.glTarget,null),a},y(r,[{key:"type",get:function(){return this.accessor.type}}]),r}(je);var wi=De(Me(),1);function xi(e,t){return{name:Op(e,t),language:"glsl",version:bp(e)}}function Op(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unnamed",r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,n=r.exec(e);return n?n[1]:t}function bp(e){var t=100,r=e.match(/[^\s]+/g);if(r&&r.length>=2&&r[0]==="#version"){var n=parseInt(r[1],10);Number.isFinite(n)&&(t=n)}return t}function Di(e){return Yt(e)||rr(e)||ft(e)||zt()}function yp(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Cp(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
281
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Cp(e,t){if(e){if(typeof e=="string")return $c(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 $c(e,t)}}function $c(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 Pp=["warning","error","info"];function Bi(e){var t=e.split(/\r?\n/),r=[],n=yp(t),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;if(!(o.length<=1)){var a=o.split(":"),c=Di(a),f=c[0],u=c[1],_=c[2],E=c.slice(3),p=parseInt(_,10);isNaN(p)&&(p=0);var d=parseInt(u,10);isNaN(d)&&(d=0);var h=f.toLowerCase(),m=Pp.includes(h)?h:"info";r.push({message:E.join(":").trim(),type:m,lineNum:p,linePos:d})}}}catch(A){n.e(A)}finally{n.f()}return r}function qc(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 Np(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qc(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mp(e){var t=Ip();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Ip(){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 Zc=function(e){U(r,e);var t=Mp(r);function r(i,o){var a;switch(C(this,r),a=t.call(this,i,Np({id:Fp(o)},o)),a.device=void 0,a.handle=void 0,a.device=i,a.props.stage){case"vertex":a.handle=a.props.handle||a.device.gl.createShader(s.VERTEX_SHADER);break;case"fragment":a.handle=a.props.handle||a.device.gl.createShader(s.FRAGMENT_SHADER);break;default:throw new Error(a.props.stage)}return a._compile(a.source),a}var n=r.prototype;return n.destroy=function(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)},n.compilationInfo=function(){var i=ne(wi.default.mark(function a(){var c;return wi.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return c=this.device.gl.getShaderInfoLog(this.handle),u.abrupt("return",c?Bi(c):[]);case 2:case"end":return u.stop()}},a,this)}));function o(){return i.apply(this,arguments)}return o}(),n._compile=function(o){var a=function(A){return A.startsWith("#version ")?A:`#version 100
|
|
282
|
-
`.concat(A)};o=a(o);var c=this.device.gl;c.shaderSource(this.handle,o),c.compileShader(this.handle);var f=c.getShaderParameter(this.handle,s.COMPILE_STATUS);if(!f){var u=c.getShaderInfoLog(this.handle),_=u?Bi(u):[],E=_.filter(function(m){return m.type==="error"}),p=Dn(E,o),d=xi(o).name,h="".concat(this.stage," shader ").concat(d);throw x.error("GLSL compilation errors in ".concat(h,`
|
|
283
|
-
`).concat(p))(),new Error("GLSL compilation errors in ".concat(d))}},y(r)}(Mr);function Fp(e){return xi(e.source).name||e.id||J("unnamed ".concat(e.stage,"-shader"))}function Qc(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 xp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qc(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dp(e){var t=Bp();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Bp(){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 wp=256,Up=1024,Lp=16384,Ui=6144,Jc=function(e){U(r,e);var t=Dp(r);function r(i,o){var a;return C(this,r),a=t.call(this,i,o),a.device=void 0,a.glParameters=void 0,a.device=i,a.setParameters(a.props.parameters),a.clear(),a}var n=r.prototype;return n.end=function(){},n.pushDebugGroup=function(o){},n.popDebugGroup=function(){},n.insertDebugMarker=function(o){},n.setParameters=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a={};this.props.framebuffer&&(a.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(a.depthMask=!this.props.depthReadOnly),a.stencilMask=this.props.stencilReadOnly?0:1,a[s.RASTERIZER_DISCARD]=this.props.discard,o.viewport&&(o.viewport.length>=6?(a.viewport=o.viewport.slice(0,4),a.depthRange=[o.viewport[4],o.viewport[5]]):a.viewport=o.viewport),a.scissorTest=Boolean(o.scissorRect),o.scissorRect&&(a.scissor=o.scissorRect),o.blendConstant&&(a.blendColor=o.blendConstant),o.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),o[s.STENCIL_REF]=o.stencilReference),this.glParameters=a},n.clear=function(){var o=this,a=xp({},this.glParameters),c=0;this.props.clearColor!==!1&&(c|=Lp,a.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(c|=wp,a.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(c|=Up,a.clearStencil=this.props.clearStencil),c!==0&&st(this.device,a,function(){o.device.gl.clear(c)})},n.clearColorBuffer=function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0];st(this.device.gl2,{framebuffer:this.props.framebuffer},function(){switch(c.constructor){case Int32Array:o.device.gl2.clearBufferiv(Ui,a,c);break;case Uint32Array:o.device.gl2.clearBufferuiv(Ui,a,c);break;case Float32Array:default:o.device.gl2.clearBufferfv(Ui,a,c);break}})},y(r)}(xr);var ie;function ef(e){return Xp.includes(e)}var Xp=[s.SAMPLER_2D,s.SAMPLER_CUBE,s.SAMPLER_3D,s.SAMPLER_2D_SHADOW,s.SAMPLER_2D_ARRAY,s.SAMPLER_2D_ARRAY_SHADOW,s.SAMPLER_CUBE_SHADOW,s.INT_SAMPLER_2D,s.INT_SAMPLER_3D,s.INT_SAMPLER_CUBE,s.INT_SAMPLER_2D_ARRAY,s.UNSIGNED_INT_SAMPLER_2D,s.UNSIGNED_INT_SAMPLER_3D,s.UNSIGNED_INT_SAMPLER_CUBE,s.UNSIGNED_INT_SAMPLER_2D_ARRAY],tf=(ie={},l(ie,s.FLOAT,[s.FLOAT,1,"float","f32","float32"]),l(ie,s.FLOAT_VEC2,[s.FLOAT,2,"vec2","vec2<f32>","float32x2"]),l(ie,s.FLOAT_VEC3,[s.FLOAT,3,"vec3","vec3<f32>","float32x3"]),l(ie,s.FLOAT_VEC4,[s.FLOAT,4,"vec4","vec4<f32>","float32x4"]),l(ie,s.INT,[s.INT,1,"int","i32","sint32"]),l(ie,s.INT_VEC2,[s.INT,2,"ivec2","vec2<i32>","sint32x2"]),l(ie,s.INT_VEC3,[s.INT,3,"ivec3","vec3<i32>","sint32x3"]),l(ie,s.INT_VEC4,[s.INT,4,"ivec4","vec4<i32>","sint32x4"]),l(ie,s.UNSIGNED_INT,[s.UNSIGNED_INT,1,"uint","u32","uint32"]),l(ie,s.UNSIGNED_INT_VEC2,[s.UNSIGNED_INT,2,"uvec2","vec2<u32>","uint32x2"]),l(ie,s.UNSIGNED_INT_VEC3,[s.UNSIGNED_INT,3,"uvec3","vec3<u32>","uint32x3"]),l(ie,s.UNSIGNED_INT_VEC4,[s.UNSIGNED_INT,4,"uvec4","vec4<u32>","uint32x4"]),l(ie,s.BOOL,[s.FLOAT,1,"bool","f32","float32"]),l(ie,s.BOOL_VEC2,[s.FLOAT,2,"bvec2","vec2<f32>","float32x2"]),l(ie,s.BOOL_VEC3,[s.FLOAT,3,"bvec3","vec3<f32>","float32x3"]),l(ie,s.BOOL_VEC4,[s.FLOAT,4,"bvec4","vec4<f32>","float32x4"]),l(ie,s.FLOAT_MAT2,[s.FLOAT,8,"mat2","mat2x2<f32>"]),l(ie,s.FLOAT_MAT2x3,[s.FLOAT,8,"mat2x3","mat2x3<f32>"]),l(ie,s.FLOAT_MAT2x4,[s.FLOAT,8,"mat2x4","mat2x4<f32>"]),l(ie,s.FLOAT_MAT3x2,[s.FLOAT,12,"mat3x2","mat3x2<f32>"]),l(ie,s.FLOAT_MAT3,[s.FLOAT,12,"mat3","mat3x3<f32>"]),l(ie,s.FLOAT_MAT3x4,[s.FLOAT,12,"mat3x4","mat3x4<f32>"]),l(ie,s.FLOAT_MAT4x2,[s.FLOAT,16,"mat4x2","mat4x2<f32>"]),l(ie,s.FLOAT_MAT4x3,[s.FLOAT,16,"mat4x3","mat4x3<f32>"]),l(ie,s.FLOAT_MAT4,[s.FLOAT,16,"mat4","mat4x4<f32>"]),ie);function Li(e){var t=tf[e];if(!t)throw new Error("uniform");var r=W(t,4),n=r[0],i=r[1],o=r[3];return{format:o,components:i,glType:n}}function rf(e){var t=tf[e];if(!t)throw new Error("attribute");var r=W(t,5),n=r[1],i=r[3],o=r[4],a=i;return{attributeType:a,vertexFormat:o,components:n}}var me;function nf(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 of(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function af(e,t){var r={attributes:[],bindings:[]};r.attributes=Hp(e,t);for(var n=jp(e,t),i=0,o=n;i<o.length;i++){var a=o[i],c=a.uniforms.map(function(T){return{name:T.name,format:T.format,byteOffset:T.byteOffset,byteStride:T.byteStride,arrayLength:T.arrayLength}});r.bindings.push({type:"uniform",name:a.name,location:a.location,visibility:(a.vertex?1:0)&(a.fragment?2:0),minBindingSize:a.byteLength,uniforms:c})}for(var f=Vp(e,t),u=0,_=0,E=f;_<E.length;_++){var p=E[_];if(ef(p.type)){var d=kp(p.type),h=d.viewDimension,m=d.sampleType;r.bindings.push({type:"texture",name:p.name,location:u,viewDimension:h,sampleType:m}),p.textureUnit=u,u+=1}}f.length&&(r.uniforms=f);var A=Wp(e,t);return A!=null&&A.length&&(r.varyings=A),r}function Hp(e,t){for(var r=[],n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),i=0;i<n;i++){var o=e.getActiveAttrib(t,i);if(!o)throw new Error("activeInfo");var a=o.name,c=o.type,f=e.getAttribLocation(t,a);if(f>=0){var u=rf(c),_=u.attributeType,E=/instance/i.test(a)?"instance":"vertex";r.push({name:a,location:f,stepMode:E,type:_})}}return r.sort(function(p,d){return p.location-d.location}),r}function Wp(e,t){if(!Q(e))return[];for(var r=e,n=[],i=e.getProgramParameter(t,s.TRANSFORM_FEEDBACK_VARYINGS),o=0;o<i;o++){var a=r.getTransformFeedbackVarying(t,o);if(!a)throw new Error("activeInfo");var c=a.name,f=a.type,u=a.size,_=Li(f),E=_.glType,p=_.components,d=new Je({type:E,size:u*p}),h={location:o,name:c,accessor:d};n.push(h)}return n.sort(function(m,A){return m.location-A.location}),n}function Vp(e,t){for(var r=[],n=e.getProgramParameter(t,s.ACTIVE_UNIFORMS),i=0;i<n;i++){var o=e.getActiveUniform(t,i);if(!o)throw new Error("activeInfo");var a=o.name,c=o.size,f=o.type,u=Yp(a),_=u.name,E=u.isArray,p=e.getUniformLocation(t,_),d={location:p,name:_,size:c,type:f,isArray:E};if(r.push(d),d.size>1)for(var h=0;h<d.size;h++){var m="".concat(_,"[").concat(h,"]");p=e.getUniformLocation(t,m);var A=of(of({},d),{},{name:m,location:p});r.push(A)}}return r}function jp(e,t){if(!Q(e))return[];for(var r=e,n=function(A,T){return r.getActiveUniformBlockParameter(t,A,T)},i=[],o=r.getProgramParameter(t,s.ACTIVE_UNIFORM_BLOCKS),a=0;a<o;a++){for(var c={name:r.getActiveUniformBlockName(t,a)||"",location:n(a,s.UNIFORM_BLOCK_BINDING),byteLength:n(a,s.UNIFORM_BLOCK_DATA_SIZE),vertex:n(a,s.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),fragment:n(a,s.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),uniformCount:n(a,s.UNIFORM_BLOCK_ACTIVE_UNIFORMS),uniforms:[]},f=n(a,s.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES)||[],u=r.getActiveUniforms(t,f,s.UNIFORM_TYPE),_=r.getActiveUniforms(t,f,s.UNIFORM_SIZE),E=r.getActiveUniforms(t,f,s.UNIFORM_OFFSET),p=r.getActiveUniforms(t,f,s.UNIFORM_ARRAY_STRIDE),d=0;d<c.uniformCount;++d){var h=r.getActiveUniform(t,f[d]);if(!h)throw new Error("activeInfo");c.uniforms.push({name:h.name,format:Li(u[d]).format,type:u[d],arrayLength:_[d],byteOffset:E[d],byteStride:p[d]})}i.push(c)}return i.sort(function(m,A){return m.location-A.location}),i}var Kp=(me={},l(me,s.SAMPLER_2D,["2d","float"]),l(me,s.SAMPLER_CUBE,["cube","float"]),l(me,s.SAMPLER_3D,["3d","float"]),l(me,s.SAMPLER_2D_SHADOW,["3d","depth"]),l(me,s.SAMPLER_2D_ARRAY,["2d-array","float"]),l(me,s.SAMPLER_2D_ARRAY_SHADOW,["2d-array","depth"]),l(me,s.SAMPLER_CUBE_SHADOW,["cube","float"]),l(me,s.INT_SAMPLER_2D,["2d","sint"]),l(me,s.INT_SAMPLER_3D,["3d","sint"]),l(me,s.INT_SAMPLER_CUBE,["cube","sint"]),l(me,s.INT_SAMPLER_2D_ARRAY,["2d-array","uint"]),l(me,s.UNSIGNED_INT_SAMPLER_2D,["2d","uint"]),l(me,s.UNSIGNED_INT_SAMPLER_3D,["3d","uint"]),l(me,s.UNSIGNED_INT_SAMPLER_CUBE,["cube","uint"]),l(me,s.UNSIGNED_INT_SAMPLER_2D_ARRAY,["2d-array","uint"]),me);function kp(e){var t=Kp[e];if(!t)throw new Error("sampler");var r=W(t,2),n=r[0],i=r[1];return{viewDimension:n,sampleType:i}}function Yp(e){if(e[e.length-1]!=="]")return{name:e,length:1,isArray:!1};var t=/([^[]*)(\[[0-9]+\])?/,r=t.exec(e);if(!r||r.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(e));return{name:r[1],length:r[2]?1:0,isArray:Boolean(r[2])}}function sf(e,t,r,n){var i=e,o=n;o===!0&&(o=1),o===!1&&(o=0);var a=typeof o=="number"?[o]:o;switch(r){case s.SAMPLER_2D:case s.SAMPLER_CUBE:case s.SAMPLER_3D:case s.SAMPLER_2D_SHADOW:case s.SAMPLER_2D_ARRAY:case s.SAMPLER_2D_ARRAY_SHADOW:case s.SAMPLER_CUBE_SHADOW:case s.INT_SAMPLER_2D:case s.INT_SAMPLER_3D:case s.INT_SAMPLER_CUBE:case s.INT_SAMPLER_2D_ARRAY:case s.UNSIGNED_INT_SAMPLER_2D:case s.UNSIGNED_INT_SAMPLER_3D:case s.UNSIGNED_INT_SAMPLER_CUBE:case s.UNSIGNED_INT_SAMPLER_2D_ARRAY:if(typeof n!="number")throw new Error("samplers must be set to integers");return e.uniform1i(t,n);case s.FLOAT:return e.uniform1fv(t,a);case s.FLOAT_VEC2:return e.uniform2fv(t,a);case s.FLOAT_VEC3:return e.uniform3fv(t,a);case s.FLOAT_VEC4:return e.uniform4fv(t,a);case s.INT:return e.uniform1iv(t,a);case s.INT_VEC2:return e.uniform2iv(t,a);case s.INT_VEC3:return e.uniform3iv(t,a);case s.INT_VEC4:return e.uniform4iv(t,a);case s.BOOL:return e.uniform1iv(t,a);case s.BOOL_VEC2:return e.uniform2iv(t,a);case s.BOOL_VEC3:return e.uniform3iv(t,a);case s.BOOL_VEC4:return e.uniform4iv(t,a);case s.UNSIGNED_INT:return i.uniform1uiv(t,a,1);case s.UNSIGNED_INT_VEC2:return i.uniform2uiv(t,a,2);case s.UNSIGNED_INT_VEC3:return i.uniform3uiv(t,a,3);case s.UNSIGNED_INT_VEC4:return i.uniform4uiv(t,a,4);case s.FLOAT_MAT2:return e.uniformMatrix2fv(t,!1,a);case s.FLOAT_MAT3:return e.uniformMatrix3fv(t,!1,a);case s.FLOAT_MAT4:return e.uniformMatrix4fv(t,!1,a);case s.FLOAT_MAT2x3:return i.uniformMatrix2x3fv(t,!1,a);case s.FLOAT_MAT2x4:return i.uniformMatrix2x4fv(t,!1,a);case s.FLOAT_MAT3x2:return i.uniformMatrix3x2fv(t,!1,a);case s.FLOAT_MAT3x4:return i.uniformMatrix3x4fv(t,!1,a);case s.FLOAT_MAT4x2:return i.uniformMatrix4x2fv(t,!1,a);case s.FLOAT_MAT4x3:return i.uniformMatrix4x3fv(t,!1,a)}throw new Error("Illegal uniform")}var uf;function cf(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 ff(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zp(e){var t=Gp();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Gp(){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 $p="elements must be GL.ELEMENT_ARRAY_BUFFER";uf=Symbol.toStringTag;var lf=function(e){U(r,e);var t=zp(r);r.isConstantAttributeZeroSupported=function(o){return o.info.type==="webgl2"||qt()==="Chrome"};function r(i,o){var a;return C(this,r),a=t.call(this,i,o,ff(ff({},ee.defaultProps),{},{constantAttributeZero:!1})),a.buffer=null,a.bufferValue=null,Object.seal(Fe(a)),a}var n=r.prototype;return n.destroy=function(){if(Ve(b(r.prototype),"destroy",this).call(this),this.buffer){var o;(o=this.buffer)===null||o===void 0||o.destroy()}},n._createHandle=function(){return this.gl2.createVertexArray()},n._deleteHandle=function(){return this.gl2.deleteVertexArray(this.handle),[this.elements]},n._bindHandle=function(o){this.gl2.bindVertexArray(o)},n.enable=function(o){var a=this,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,f=this.device.isWebGL2||qt()==="Chrome",u=f||o!==0;(c||u)&&(o=Number(o),this.bind(function(){return c?a.gl.enableVertexAttribArray(o):a.gl.disableVertexAttribArray(o)}))},n.setElementBuffer=function(){var o=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};H(!a||a.glTarget===s.ELEMENT_ARRAY_BUFFER,$p),this.bind(function(){o.gl.bindBuffer(s.ELEMENT_ARRAY_BUFFER,a?a.handle:null)})},n.setBuffer=function(o,a,c){var f=this;if(a.glTarget===s.ELEMENT_ARRAY_BUFFER){this.setElementBuffer(a,c);return}var u=c.size,_=c.type,E=c.stride,p=c.offset,d=c.normalized,h=c.integer,m=c.divisor,A=this.gl,T=this.gl2;o=Number(o),this.bind(function(){A.bindBuffer(A.ARRAY_BUFFER,a.handle),h?(f.device.assertWebGL2(),T.vertexAttribIPointer(o,u,_,E,p)):A.vertexAttribPointer(o,u,_,d,E,p),A.enableVertexAttribArray(o),T.vertexAttribDivisor(o,m||0)})},n.setConstant=function(o,a){switch(a.constructor){case Float32Array:qp(this.device,o,a);break;case Int32Array:Zp(this.device,o,a);break;case Uint32Array:Qp(this.device,o,a);break;default:H(!1)}},n.getConstantBuffer=function(o,a){var c=Jp(a),f=c.byteLength*o,u=c.length*o,_=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:f}),_=_||this.buffer.reallocate(f),_=_||!ed(c,this.bufferValue),_){var E=Wn(a.constructor,u);Vn({target:E,source:c,start:0,count:u}),this.buffer.subData(E),this.bufferValue=a}return this.buffer},y(r,[{key:uf,get:function(){return"BaseVertexArrayObject"}}]),r}(un);function qp(e,t,r){switch(r.length){case 1:e.gl.vertexAttrib1fv(t,r);break;case 2:e.gl.vertexAttrib2fv(t,r);break;case 3:e.gl.vertexAttrib3fv(t,r);break;case 4:e.gl.vertexAttrib4fv(t,r);break;default:H(!1)}}function Zp(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4iv(t,r)}function Qp(e,t,r){var n;e.assertWebGL2(),(n=e.gl2)===null||n===void 0||n.vertexAttribI4uiv(t,r)}function Jp(e){return Array.isArray(e)?new Float32Array(e):e}function ed(e,t){if(!e||!t||e.length!==t.length||e.constructor!==t.constructor)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}function _f(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=td(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
284
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function td(e,t){if(e){if(typeof e=="string")return Ef(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 Ef(e,t)}}function Ef(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 rd(e){var t=nd();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function nd(){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 pf=4,df=function(e){U(r,e);var t=rd(r);function r(i,o){var a;C(this,r),a=t.call(this,i,o),a.device=void 0,a.handle=void 0,a.vs=void 0,a.fs=void 0,a.introspectedLayout=void 0,a.shaderLayout=void 0,a.bufferLayout=void 0,a.uniforms={},a.bindings={},a.constantAttributes={},a._indexBuffer=void 0,a.varyings=null,a.vertexArrayObject=void 0,a._textureUniforms={},a._textureIndexCounter=0,a._uniformCount=0,a._uniformSetters={},a.device=i,a.handle=a.props.handle||a.device.gl.createProgram(),a.device.setSpectorMetadata(a.handle,{id:a.props.id}),a.vs=o.vs,a.fs=o.fs;var c=o.varyings,f=o.bufferMode,u=f===void 0?s.SEPARATE_ATTRIBS:f;if(c&&c.length>0){var _;a.device.assertWebGL2(),a.varyings=c,(_=a.device.gl2)===null||_===void 0||_.transformFeedbackVaryings(a.handle,c,u)}return a._compileAndLink(),a.introspectedLayout=af(a.device.gl,a.handle),a.shaderLayout=wn(a.introspectedLayout,o.shaderLayout),a.bufferLayout=o.bufferLayout||[],a.vertexArrayObject=new lf(a.device),a}var n=r.prototype;return n.destroy=function(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)},n.setIndexBuffer=function(o){var a=o;this.vertexArrayObject.setElementBuffer(a),this._indexBuffer=a},n.setAttributes=function(o){for(var a=Lr(this.shaderLayout,this.bufferLayout),c=0,f=Object.entries(o);c<f.length;c++){for(var u=W(f[c],2),_=u[0],E=u[1],p=!1,d=0,h=Object.values(a);d<h.length;d++){var m=h[d];if(m.bufferName===_){var A=E,T=tn(m.bufferDataType);x.log(2,{setAttribute:m.attributeName,toBuffer:_,size:m.bufferComponents,type:T,stride:m.byteStride,offset:m.byteOffset,normalized:m.normalized,integer:m.integer,divisor:m.stepMode==="instance"?1:0})(),this.vertexArrayObject.setBuffer(m.location,A,{size:m.bufferComponents,type:T,stride:m.byteStride,offset:m.byteOffset,normalized:m.normalized,integer:m.integer,divisor:m.stepMode==="instance"?1:0}),p=!0}}p||x.warn('setAttributes(): Ignoring (buffer "'.concat(E.id,'" for unknown attribute "').concat(name,'" in pipeline "').concat(this.id,'"'))()}},n.setConstantAttributes=function(o){Object.assign(this.constantAttributes,o)},n.setBindings=function(o){for(var a=this,c=function(){var p=W(u[f],2),d=p[0],h=p[1],m=a.shaderLayout.bindings.find(function(A){return A.name===d});if(!m)return x.warn("Unknown binding ".concat(d," in render pipeline ").concat(a.id))(),"continue";switch(h||x.warn("Unsetting binding ".concat(d," in render pipeline ").concat(a.id))(),m.type){case"uniform":if(!(h instanceof je)&&!(h.buffer instanceof je))throw new Error("buffer value");break;case"texture":if(!(h instanceof Ke))throw new Error("texture value");break;case"sampler":x.warn("Ignoring sampler ".concat(d))();break;default:throw new Error(m.type)}a.bindings[d]=h},f=0,u=Object.entries(o);f<u.length;f++)var _=c()},n.setUniforms=function(o){Object.assign(this.uniforms,o)},n.draw=function(o){var a,c=this,f=o.renderPass,u=o.vertexCount,_=o.instanceCount,E=o.firstVertex,p=E===void 0?0:E,d=id(this.props.topology),h=Boolean(this._indexBuffer),m=(a=this._indexBuffer)===null||a===void 0?void 0:a.glIndexType,A=Number(o.instanceCount)>0;return!this._areTexturesRenderable()||o.vertexCount===0?!1:(this.device.gl.useProgram(this.handle),this.vertexArrayObject.bind(function(){var T=od(c.props.topology),P=null;P&&P.begin(T),c._applyBindings(),c._applyUniforms(),c._applyConstantAttributes();var S=f;Ac(c.device,c.props.parameters,function(){Rc(c.device,S.glParameters,function(){if(h&&A){var O;(O=c.device.gl2)===null||O===void 0||O.drawElementsInstanced(d,u||0,m,p,_||0)}else if(h)c.device.gl.drawElements(d,u||0,m,p);else if(A){var F;(F=c.device.gl2)===null||F===void 0||F.drawArraysInstanced(d,p,u||0,_||0)}else c.device.gl.drawArrays(d,p,u||0)}),P&&P.end()})}),!0)},n._compileAndLink=function(){var o=this.device.gl;if(o.attachShader(this.handle,this.vs.handle),o.attachShader(this.handle,this.fs.handle),x.time(pf,"linkProgram for ".concat(this.id))(),o.linkProgram(this.handle),x.timeEnd(pf,"linkProgram for ".concat(this.id))(),o.debug||x.level>0){var a=o.getProgramParameter(this.handle,o.LINK_STATUS);if(!a)throw new Error("Error linking: ".concat(o.getProgramInfoLog(this.handle)));o.validateProgram(this.handle);var c=o.getProgramParameter(this.handle,o.VALIDATE_STATUS);if(!c)throw new Error("Error validating: ".concat(o.getProgramInfoLog(this.handle)))}},n._areTexturesRenderable=function(){for(var o=!0,a=0,c=Object.entries(this._textureUniforms);a<c.length;a++){var f=W(c[a],2),u=f[1];u.update(),o=o&&u.loaded}for(var _=0,E=Object.entries(this.bindings);_<E.length;_++){var p=W(E[_],2),d=p[1];d.loaded!==void 0&&(o=o&&d.loaded)}return o},n._applyConstantAttributes=function(){for(var o=Lr(this.shaderLayout,this.bufferLayout),a=0,c=Object.entries(this.constantAttributes);a<c.length;a++){var f=W(c[a],2),u=f[0],_=f[1],E=o[u];if(!E){x.warn('Ignoring constant value supplied for unknown attribute "'.concat(u,'" in pipeline "').concat(this.id,'"'))();continue}this.vertexArrayObject.setConstant(E.location,_),this.vertexArrayObject.enable(E.location,!1)}},n._applyBindings=function(){this.device.gl.useProgram(this.handle);var o=this.device.gl2;if(!o)throw new Error("bindings");var a=0,c=0,f=_f(this.shaderLayout.bindings),u;try{for(f.s();!(u=f.n()).done;){var _=u.value,E=this.bindings[_.name];if(!E)throw new Error("No value for binding ".concat(_.name," in ").concat(this.id));switch(_.type){case"uniform":var p=_.name,d=o.getUniformBlockIndex(this.handle,p);if(d===s.INVALID_INDEX)throw new Error("Invalid uniform block name ".concat(p));o.uniformBlockBinding(this.handle,c,d),E instanceof je?o.bindBufferBase(s.UNIFORM_BUFFER,c,E.handle):o.bindBufferRange(s.UNIFORM_BUFFER,c,E.buffer.handle,E.offset||0,E.size||E.buffer.byteLength-E.offset),c+=1;break;case"texture":if(!(E instanceof Ke))throw new Error("texture");var h=E;o.activeTexture(s.TEXTURE0+a),o.bindTexture(h.target,h.handle),a+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error("binding type '".concat(_.type,"' not supported in WebGL"))}}}catch(m){f.e(m)}finally{f.f()}},n._applyUniforms=function(){var o=_f(this.shaderLayout.uniforms||[]),a;try{for(o.s();!(a=o.n()).done;){var c,f=a.value,u=f.name,_=f.location,E=f.type,p=f.textureUnit,d=(c=this.uniforms[u])!==null&&c!==void 0?c:p;d!==void 0&&sf(this.device.gl,_,E,d)}}catch(h){o.e(h)}finally{o.f()}},y(r)}(it);function id(e){switch(e){case"point-list":return s.POINTS;case"line-list":return s.LINES;case"line-strip":return s.LINE_STRIP;case"line-loop-webgl":return s.LINE_LOOP;case"triangle-list":return s.TRIANGLES;case"triangle-strip":return s.TRIANGLE_STRIP;case"triangle-fan-webgl":return s.TRIANGLE_FAN;default:throw new Error(e)}}function od(e){switch(e){case"point-list":return s.POINTS;case"line-list":return s.LINES;case"line-strip":return s.LINES;case"line-loop-webgl":return s.LINES;case"triangle-list":return s.TRIANGLES;case"triangle-strip":return s.TRIANGLES;case"triangle-fan-webgl":return s.TRIANGLES;default:throw new Error(e)}}function ad(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=sd(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(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
285
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function sd(e,t){if(e){if(typeof e=="string")return hf(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 hf(e,t)}}function hf(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 cd(e){var t=fd();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function fd(){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 mf=function(e){U(r,e);var t=cd(r);function r(i){var o;return C(this,r),o=t.call(this,{}),o.device=void 0,o.commands=[],o.device=i,o}var n=r.prototype;return n.submitCommands=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.commands,a=ad(o),c;try{for(a.s();!(c=a.n()).done;){var f=c.value;switch(f.name){case"copy-buffer-to-buffer":ud(this.device,f.options);break;case"copy-buffer-to-texture":ld(this.device,f.options);break;case"copy-texture-to-buffer":_d(this.device,f.options);break;case"copy-texture-to-texture":Ed(this.device,f.options);break}}}catch(u){a.e(u)}finally{a.f()}},y(r)}(Br);function ud(e,t){var r=t.source,n=t.destination,i=e.assertWebGL2();if(i){var o,a;i.bindBuffer(s.COPY_READ_BUFFER,r.handle),i.bindBuffer(s.COPY_WRITE_BUFFER,n.handle),i.copyBufferSubData(s.COPY_READ_BUFFER,s.COPY_WRITE_BUFFER,(o=t.sourceOffset)!==null&&o!==void 0?o:0,(a=t.destinationOffset)!==null&&a!==void 0?a:0,t.size),i.bindBuffer(s.COPY_READ_BUFFER,null),i.bindBuffer(s.COPY_WRITE_BUFFER,null)}else throw new Error("copyBufferToBuffer not implemented in WebGL1")}function ld(e,t){throw new Error("Not implemented")}function _d(e,t){var r=t.source,n=t.mipLevel,i=n===void 0?0:n,o=t.aspect,a=o===void 0?"all":o,c=t.width,f=c===void 0?t.source.width:c,u=t.height,_=u===void 0?t.source.height:u,E=t.depthOrArrayLayers,p=E===void 0?0:E,d=t.origin,h=d===void 0?[0,0]:d,m=t.destination,A=t.byteOffset,T=A===void 0?0:A,P=t.bytesPerRow,S=t.rowsPerImage;if(a!=="all")throw new Error("not supported");if(i!==0||p!==void 0||P||S)throw new Error("not implemented");var O=e.assertWebGL2(),F=Rf(r),M=F.framebuffer,X=F.destroyFramebuffer;try{var j=m,k=f||M.width,V=_||M.height,g=s.RGBA,R=s.UNSIGNED_BYTE;O.bindBuffer(s.PIXEL_PACK_BUFFER,j.handle),O.bindFramebuffer(s.FRAMEBUFFER,M.handle),O.readPixels(h[0],h[1],k,V,g,R,T)}finally{O.bindBuffer(s.PIXEL_PACK_BUFFER,null),O.bindFramebuffer(s.FRAMEBUFFER,null),X&&M.destroy()}}function Ed(e,t){var r=t.source,n=t.origin,i=n===void 0?[0,0]:n,o=t.destination,a=t.width,c=a===void 0?t.destination.width:a,f=t.height,u=f===void 0?t.destination.width:f,_=0,E=s.RGBA,p=Rf(r),d=p.framebuffer,h=p.destroyFramebuffer,m=W(i,2),A=m[0],T=m[1],P=!1;e.gl.bindFramebuffer(s.FRAMEBUFFER,d.handle);var S=null,O;if(o instanceof Ke)S=o,c=Number.isFinite(c)?c:S.width,u=Number.isFinite(u)?u:S.height,S.bind(0),O=S.destination;else throw new Error("whoops");return P||e.gl.copyTexImage2D(O,_,E,A,T,c,u,0),S&&S.unbind(),e.gl.bindFramebuffer(s.FRAMEBUFFER,prevHandle||null),h&&d.destroy(),S}function Rf(e){if(e instanceof Oe){var t=e.width,r=e.height,n=e.id,i=e.device.createFramebuffer({id:"framebuffer-for-".concat(n),width:t,height:r,colorAttachments:[e]});return{framebuffer:i,destroyFramebuffer:!0}}return{framebuffer:e,destroyFramebuffer:!1}}function pd(e){var t=dd();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function dd(){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 Af=function(e){U(r,e);var t=pd(r);function r(i,o){var a;return C(this,r),a=t.call(this,i,o),a.device=void 0,a.commandBuffer=void 0,a.device=i,a.commandBuffer=new mf(i),a}var n=r.prototype;return n.destroy=function(){},n.finish=function(){this.commandBuffer.submitCommands()},n.copyBufferToBuffer=function(o){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:o})},n.copyBufferToTexture=function(o){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:o})},n.copyTextureToBuffer=function(o){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:o})},n.copyTextureToTexture=function(o){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:o})},n.pushDebugGroup=function(o){},n.popDebugGroup=function(){},n.insertDebugMarker=function(o){},y(r)}(Dr);function Tf(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 ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hd(e){var t=md();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function md(){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 pn=1,he=function(e){U(r,e);var t=hd(r);r.isSupported=function(){return typeof WebGLRenderingContext<"u"||Bs()},r.attach=function(o){if(o instanceof r)return o;if(o?.device instanceof Qt)return o.device;if(!Rd(o))throw new Error("Invalid WebGLRenderingContext");return new r({gl:o})},r.create=function(){var i=ne(Xi.default.mark(function a(){var c,f,u=arguments;return Xi.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(c=u.length>0&&u[0]!==void 0?u[0]:{},x.groupCollapsed(pn,"WebGLDevice created"),typeof c.canvas!="string"){E.next=5;break}return E.next=5,Nt.pageLoaded;case 5:if(!(x.get("debug")||c.debug)){E.next=8;break}return E.next=8,Vc();case 8:if(f=c.spector,!(x.get("spector")||f)){E.next=12;break}return E.next=12,wc();case 12:if(x.probe(pn+1,"DOM is loaded")(),!(c.gl&&c.gl.device)){E.next=15;break}return E.abrupt("return",r.attach(c.gl));case 15:return E.abrupt("return",new r(c));case 16:case"end":return E.stop()}},a)}));function o(){return i.apply(this,arguments)}return o}();function r(i){var o,a;C(this,r),a=t.call(this,ke(ke({},i),{},{id:i.id||J("webgl-device")})),a.info=void 0,a.canvasContext=void 0,a.handle=void 0,a.lost=void 0,a._resolveContextLost=void 0,a._features=void 0,a._limits=void 0,a.renderPass=null,a.gl=void 0,a.gl2=null,a.debug=!1,a.isWebGL1=void 0,a.isWebGL2=void 0,a._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},a._extensions={},a._polyfilled=!1,a.spector=void 0,a._webglLimits=void 0;var c=(o=i.gl)===null||o===void 0?void 0:o.device;if(c)throw new Error("WebGL context already attached to device ".concat(c.id));a.canvasContext=new Fc(Fe(a),i),a.lost=new Promise(function(A){a._resolveContextLost=A});var f=function(T){var P,S;return(P=(S=a)._resolveContextLost)===null||P===void 0?void 0:P.call(S,{reason:"destroyed",message:"Computer entered sleep mode, or too many apps or browser tabs are using the GPU."})},u=i.gl||null;if(u=u||(ae()?nc(a.canvasContext.canvas,ke(ke({},i),{},{onContextLost:f})):null),u=u||(ae()?null:ws(ke(ke({},i),{},{onContextLost:f}))),!u)throw new Error("WebGL context creation failed");a.handle=u,a.gl=a.handle,a.gl2=a.gl,a.isWebGL2=Ad(a.gl),a.isWebGL1=!a.isWebGL2,a.info=ic(a.gl),a.gl.device=Fe(a),a.gl._version=a.isWebGL2?2:1,Ys(a.gl);var _=i.enable,E=_===void 0?!0:_,p=i.copyState,d=p===void 0?!1:p;if(hi(a.gl,{enable:E,copyState:d,log:function(){for(var T=arguments.length,P=new Array(T),S=0;S<T;S++)P[S]=arguments[S];return x.log.apply(x,[1].concat(P))()}}),ae()&&i.debug&&(a.gl=jc(a.gl,ke(ke({},i),{},{webgl2:a.isWebGL2,throwOnError:!0})),a.gl2=a.gl,a.debug=!0,x.level=Math.max(x.level,1),x.warn("WebGL debug mode activated. Performance reduced.")()),ae()&&i.spector){var h=a.handle.canvas||i.canvas;a.spector=Uc(ke(ke({},a.props),{},{canvas:h}))}var m="Created ".concat(a.info.type).concat(a.debug?" debug":""," context: ").concat(a.info.vendor,", ").concat(a.info.renderer," for canvas: ").concat(a.canvasContext.id);return x.probe(pn,m)(),x.groupEnd(pn)(),a}var n=r.prototype;return n.destroy=function(){var o=this.gl.getExtension("STACKGL_destroy_context");o&&o.destroy()},n.getSize=function(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]},n.isTextureFormatSupported=function(o){return _r(this.gl,o)},n.isTextureFormatFilterable=function(o){return fc(this.gl,o)},n.isTextureFormatRenderable=function(o){return uc(this.gl,o)},n.assertWebGL2=function(){if(!this.gl2)throw new Error("Requires WebGL2");return this.gl2},n.createCanvasContext=function(o){throw new Error("WebGL only supports a single canvas")},n.createBuffer=function(o){var a=this._getBufferProps(o);return new Gc(this,a)},n._createTexture=function(o){return new Ke(this,o)},n.createExternalTexture=function(o){throw new Error("createExternalTexture() not implemented")},n.createSampler=function(o){return new hr(this,o)},n.createShader=function(o){return new Zc(this,o)},n.createFramebuffer=function(o){return new _n(this,o)},n.createRenderPipeline=function(o){return new df(this,o)},n.beginRenderPass=function(o){return new Jc(this,o)},n.createComputePipeline=function(o){throw new Error("ComputePipeline not supported in WebGL")},n.beginComputePass=function(o){throw new Error("compute shaders not supported in WebGL")},n.getDefaultRenderPass=function(){return this.renderPass=this.renderPass||this.beginRenderPass({framebuffer:this.canvasContext.getCurrentFramebuffer()}),this.renderPass},n.createCommandEncoder=function(o){return new Af(this,o)},n.submit=function(){var o;(o=this.renderPass)===null||o===void 0||o.end(),this.renderPass=null},n.loseDevice=function(){var o,a=!1,c=this.gl.getExtension("WEBGL_lose_context");return c&&(a=!0,c.loseContext()),(o=this._resolveContextLost)===null||o===void 0||o.call(this,{reason:"destroyed",message:"Application triggered context loss"}),a},n.pushState=function(){At(this.gl)},n.popState=function(){at(this.gl)},n.setSpectorMetadata=function(o,a){o.__SPECTOR_Metadata=a},n.getGLKey=function(o,a){a=a||this.gl2||this.gl;var c=Number(o);for(var f in a)if(a[f]===c)return"GL.".concat(f);return String(o)},y(r,[{key:"features",get:function(){return this._features=this._features||pc(this.gl),this._features}},{key:"limits",get:function(){return this._limits=this._limits||hc(this.gl),this._limits}},{key:"isLost",get:function(){return this.gl.isContextLost()}},{key:"webglLimits",get:function(){return this._webglLimits=this._webglLimits||mc(this.gl),this._webglLimits}}]),r}(Qt);he.type="webgl";function Rd(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function Ad(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function gf(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 dn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var vf=function(){e.isSupported=function(n){return!1};function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};C(this,e),this.device=void 0,this.gl=void 0,this.elementCount=0,this.elementIDBuffer=null,this.device=he.attach(r),this.gl=this.device.gl2,this._buildResourceTransforms(n),n=this._updateModelProps(n),this.model=new ht(this.device,dn(dn({},n),{},{fs:n.fs||ti({version:ei(n.vs).version}),id:n.id||"transform-model",drawMode:n.drawMode||s.POINTS,vertexCount:n.elementCount})),Object.seal(this)}var t=e.prototype;return t.destroy=function(){},t.delete=function(){this.destroy()},t.run=function(n){var i=n||{},o=i.clearRenderTarget,a=o===void 0?!0:o,c=this._updateDrawOptions(n);a&&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=dn({},n);return i},t._buildResourceTransforms=function(n){},t._updateDrawOptions=function(n){var i=dn({},n);return i},y(e)}();function Sf(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 Td(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ye=function(){function e(r){C(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,a=o===void 0?null:o,c=r.vertexCount,f=c===void 0?null:c;this.id=r.id||J("geometry"),this.topology=r.topology,a&&(this.indices=ArrayBuffer.isView(a)?{value:a,size:1}:a),this.attributes={};for(var u=0,_=Object.entries(i);u<_.length;u++){var E=W(_[u],2),p=E[0],d=E[1],h=ArrayBuffer.isView(d)?{value:d}:d;H(ArrayBuffer.isView(h.value),"".concat(this._print(p),": must be typed array or object with value as typed array")),(p==="POSITION"||p==="positions")&&!h.size&&(h.size=3),p==="indices"?(H(!this.indices),this.indices=h):this.attributes[p]=h}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=f||this._calculateVertexCount(this.attributes,this.indices)}var t=e.prototype;return t.getVertexCount=function(){return this.vertexCount},t.getAttributes=function(){return this.indices?Td({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,a=0,c=Object.values(n);a<c.length;a++){var f=c[a],u=f.value,_=f.size,E=f.constant;!E&&u&&_>=1&&(o=Math.min(o,u.length/_))}return H(Number.isFinite(o)),o},y(e)}();var Of;function bf(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 yf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gd(e){var t=vd();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function vd(){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 Sd=ea(Of||(Of=fe([`attribute vec2 aClipSpacePosition;
|
|
226
|
+
`),r}function ci(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 fi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ci(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ci(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function li(e,t){if(!t.vs)throw new Error("no vertex shader");var r=ui(e,t.vs),n;return t.fs&&(n=ui(e,t.fs)),fi(fi({},t),{},{vs:r,fs:n})}function ui(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 hi(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 pi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hi(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hi(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=li(n,i),a=ai(n,pi(pi({},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 di(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?", ":"")+di(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 vi(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 yi(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 _i(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 xi(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 bi(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 Oi(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 wi(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 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[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 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[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 Si(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 Si(this,t)}cross(t){return xi(this,this,t),this.check()}rotateX({radians:t,origin:r=vr}){return wi(this,this,r,t),this.check()}rotateY({radians:t,origin:r=vr}){return Ei(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=vr}){return Mi(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 bi(this,this,t),this.check()}transformByMatrix2(t){return _i(this,this,t),this.check()}transformByQuaternion(t){return Oi(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 Pi(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 Ai(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 Ti(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 Ri(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 Ci(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 Li(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 Di(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 Ii(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 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[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 ji(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 Fi(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 Ui=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 Gi=ra;function zi(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 Bi(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 ji(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):Fi(this,r,n,i,o,s,c),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return zi(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:s=_r,far:c=xr}=t;return Gi(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;ki(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 ki(r),Ui(this,r,n,i,o),this.check()}determinant(){return Ti(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 Pi(this,this),this.check()}invert(){return Ai(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 Di(this,this,t),this.check()}rotateY(t){return Ii(this,this,t),this.check()}rotateZ(t){return Ni(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return Li(this,this,t,r),this.check()}scale(t){return Ci(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Ri(this,this,t),this.check()}transform(t,r){return t.length===4?(r=Bi(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=vi(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=yi(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 ki(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 Vi=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 Hi(e,t){if(t instanceof Vi)return t;var r=ua(e,t),n=la(e,t),i=n.attributes,o=n.bufferLayout;return new Vi({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 qi(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?qi(Object(r),!0).forEach(function(n){L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qi(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 Xi(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 Wi(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 Wi(e,t)}}function Wi(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 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 Wt(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 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&&Hi(this.device,n);return this.setTopology(i.topology||"triangle-list"),this.bufferLayout=Yi(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?Yi(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);Object.assign(this.uniforms,i)},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=Xi(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 Yi(e,t){var r=ne(e),n=Xi(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=Gt(e);if(!n)return!1;var i=Gt(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=dn(eo||(eo=$([`attribute vec2 aClipSpacePosition;
|
|
286
228
|
attribute vec2 aTexCoord;
|
|
287
229
|
attribute vec2 aCoordinate;
|
|
288
230
|
|
|
@@ -311,8 +253,8 @@ void main(void) {
|
|
|
311
253
|
coordinate = aCoordinate;
|
|
312
254
|
uv = aTexCoord;
|
|
313
255
|
}
|
|
314
|
-
`]))),
|
|
315
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,c=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function bd(e,t){if(e){if(typeof e=="string")return Nf(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 Nf(e,t)}}function Nf(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 yd(e){var t=Cd();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Cd(){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 Mf=function(e){U(r,e);var t=yd(r);function r(){var i,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r),o=Array.isArray(o)?{children:o}:o;var a=o,c=a.children,f=c===void 0?[]:c;return x.assert(f.every(function(u){return u instanceof gt}),"every child must an instance of ScenegraphNode"),i=t.call(this,o),i.children=void 0,i.children=f,i}var n=r.prototype;return n.getBounds=function(){var o=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse(function(a,c){var f=c.worldMatrix,u=a.getBounds();if(u){var _=W(u,2),E=_[0],p=_[1],d=new ve(E).add(p).divide([2,2,2]);f.transformAsPoint(d,d);var h=new ve(p).subtract(E).divide([2,2,2]);f.transformAsVector(h,h);for(var m=0;m<8;m++)for(var A=new ve(m&1?-1:1,m&2?-1:1,m&4?-1:1).multiply(h).add(d),T=0;T<3;T++)o[0][T]=Math.min(o[0][T],A[T]),o[1][T]=Math.max(o[1][T],A[T])}}),Number.isFinite(o[0][0])?o:null},n.destroy=function(){this.children.forEach(function(o){return o.destroy()}),this.removeAll(),Ve(b(r.prototype),"destroy",this).call(this)},n.add=function(){for(var o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];for(var f=0,u=a;f<u.length;f++){var _=u[f];Array.isArray(_)?this.add.apply(this,te(_)):this.children.push(_)}return this},n.remove=function(o){var a=this.children,c=a.indexOf(o);return c>-1&&a.splice(c,1),this},n.removeAll=function(){return this.children=[],this},n.traverse=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=a.worldMatrix,f=c===void 0?new Be:c,u=new Be(f).multiplyRight(this.matrix),_=Od(this.children),E;try{for(_.s();!(E=_.n()).done;){var p=E.value;p instanceof r?p.traverse(o,{worldMatrix:u}):o(p,{worldMatrix:u})}}catch(d){_.e(d)}finally{_.f()}},y(r)}(gt);function Pd(e){var t=Nd();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Nd(){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 If=function(e){U(r,e);var t=Pd(r);function r(i){var o;return C(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)},y(r)}(gt);function Ff(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?Ff(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ff(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Md(e){var t=Id();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Id(){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 Fd={x:[2,0,1],y:[0,1,2],z:[1,2,0]},kt=function(e){U(r,e);var t=Md(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var i=n.id,o=i===void 0?J("truncated-code-geometry"):i,a=xd(n),c=a.indices,f=a.attributes;return t.call(this,Hi(Hi({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:Hi({POSITION:{size:3,value:f.POSITION},NORMAL:{size:3,value:f.NORMAL},TEXCOORD_0:{size:2,value:f.TEXCOORD_0}},n.attributes)}))}return y(r)}(ye);function xd(){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,a=o===void 0?1:o,c=e.nradial,f=c===void 0?10:c,u=e.nvertical,_=u===void 0?10:u,E=e.verticalAxis,p=E===void 0?"y":E,d=e.topCap,h=d===void 0?!1:d,m=e.bottomCap,A=m===void 0?!1:m,T=(h?2:0)+(A?2:0),P=(f+1)*(_+1+T),S=Math.atan2(r-i,a),O=Math.sin,F=Math.cos,M=Math.PI,X=F(S),j=O(S),k=h?-2:0,V=_+(A?2:0),g=f+1,R=new Uint16Array(f*(_+T)*6),v=Fd[p],I=new Float32Array(P*3),B=new Float32Array(P*3),w=new Float32Array(P*2),Y=0,q=0,K=k;K<=V;K++){var Z=K/_,G=a*Z,$=void 0;K<0?(G=0,Z=1,$=r):K>_?(G=a,Z=1,$=i):$=r+(i-r)*(K/_),(K===-2||K===_+2)&&($=0,Z=0),G-=a/2;for(var Te=0;Te<g;Te++){var Pe=O(Te*M*2/f),pe=F(Te*M*2/f);I[Y+v[0]]=Pe*$,I[Y+v[1]]=G,I[Y+v[2]]=pe*$,B[Y+v[0]]=K<0||K>_?0:Pe*X,B[Y+v[1]]=K<0?-1:K>_?1:j,B[Y+v[2]]=K<0||K>_?0:pe*X,w[q+0]=Te/f,w[q+1]=Z,q+=2,Y+=3}}for(var le=0;le<_+T;le++)for(var ge=0;ge<f;ge++){var Ye=(le*f+ge)*6;R[Ye+0]=g*(le+0)+0+ge,R[Ye+1]=g*(le+0)+1+ge,R[Ye+2]=g*(le+1)+1+ge,R[Ye+3]=g*(le+0)+0+ge,R[Ye+4]=g*(le+1)+1+ge,R[Ye+5]=g*(le+1)+0+ge}return{indices:R,attributes:{POSITION:I,NORMAL:B,TEXCOORD_0:w}}}function xf(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 Df(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dd(e){var t=Bd();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Bd(){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 Bf=function(e){U(r,e);var t=Dd(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var i=n.id,o=i===void 0?J("cone-geometry"):i,a=n.radius,c=a===void 0?1:a,f=n.cap,u=f===void 0?!0:f;return t.call(this,Df(Df({},n),{},{id:o,topRadius:0,topCap:Boolean(u),bottomCap:Boolean(u),bottomRadius:c}))}return y(r)}(kt);function wf(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 ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wd(e){var t=Ud();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Ud(){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 Uf=function(e){U(r,e);var t=wd(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var i=n.id,o=i===void 0?J("cube-geometry"):i,a=n.indices,c=a===void 0?!0:a;return t.call(this,c?ct(ct({},n),{},{id:o,topology:"triangle-list",indices:{size:1,value:Ld},attributes:ct(ct({},kd),n.attributes)}):ct(ct({},n),{},{id:o,topology:"triangle-list",indices:void 0,attributes:ct(ct({},Yd),n.attributes)}))}return y(r)}(ye),Ld=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]),Xd=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]),Hd=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]),Wd=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]),Vd=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]),jd=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]),Kd=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]),kd={POSITION:{size:3,value:Xd},NORMAL:{size:3,value:Hd},TEXCOORD_0:{size:2,value:Wd}},Yd={POSITION:{size:4,value:Vd},TEXCOORD_0:{size:2,value:jd},COLOR_0:{size:3,value:Kd}};function Lf(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 Xf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zd(e){var t=Gd();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function Gd(){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 Hf=function(e){U(r,e);var t=zd(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var i=n.id,o=i===void 0?J("cylinder-geometry"):i,a=n.radius,c=a===void 0?1:a;return t.call(this,Xf(Xf({},n),{},{id:o,bottomRadius:c,topRadius:c}))}return y(r)}(kt);function Wf(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 hn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $d(e){var t=qd();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function qd(){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 Zd=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],Qd=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],Vf=function(e){U(r,e);var t=$d(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var i=n.id,o=i===void 0?J("ico-sphere-geometry"):i,a=Jd(n),c=a.indices,f=a.attributes;return t.call(this,hn(hn({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:hn(hn({},f),n.attributes)}))}return y(r)}(ye);function Jd(e){var t=e.iterations,r=t===void 0?0:t,n=Math.PI,i=n*2,o=[].concat(Zd),a=[].concat(Qd);o.push(),a.push();for(var c=function(){var An={};return function(et,tt){et*=3,tt*=3;var Zf=et<tt?et:tt,Qf=et>tt?et:tt,Tn="".concat(Zf,"|").concat(Qf);if(Tn in An)return An[Tn];var Jf=o[et],eu=o[et+1],tu=o[et+2],ru=o[tt],nu=o[tt+1],iu=o[tt+2],Rr=(Jf+ru)/2,Ar=(eu+nu)/2,Tr=(tu+iu)/2,gn=Math.sqrt(Rr*Rr+Ar*Ar+Tr*Tr);return Rr/=gn,Ar/=gn,Tr/=gn,o.push(Rr,Ar,Tr),An[Tn]=o.length/3-1}}(),f=0;f<r;f++){for(var u=[],_=0;_<a.length;_+=3){var E=c(a[_+0],a[_+1]),p=c(a[_+1],a[_+2]),d=c(a[_+2],a[_+0]);u.push(d,a[_+0],E,E,a[_+1],p,p,a[_+2],d,E,p,d)}a=u}for(var h=new Array(o.length),m=new Array(o.length/3*2),A=a.length,T=A-3;T>=0;T-=3){var P=a[T+0],S=a[T+1],O=a[T+2],F=P*3,M=S*3,X=O*3,j=P*2,k=S*2,V=O*2,g=o[F+0],R=o[F+1],v=o[F+2],I=Math.acos(v/Math.sqrt(g*g+R*R+v*v)),B=Math.atan2(R,g)+n,w=I/n,Y=1-B/i,q=o[M+0],K=o[M+1],Z=o[M+2],G=Math.acos(Z/Math.sqrt(q*q+K*K+Z*Z)),$=Math.atan2(K,q)+n,Te=G/n,Pe=1-$/i,pe=o[X+0],le=o[X+1],ge=o[X+2],Ye=Math.acos(ge/Math.sqrt(pe*pe+le*le+ge*ge)),Gf=Math.atan2(le,pe)+n,Wi=Ye/n,mr=1-Gf/i,$f=[pe-q,le-K,ge-Z],qf=[g-q,R-K,v-Z],Ne=new ve($f).cross(qf).normalize(),_e=void 0;(Y===0||Pe===0||mr===0)&&(Y===0||Y>.5)&&(Pe===0||Pe>.5)&&(mr===0||mr>.5)&&(o.push(o[F+0],o[F+1],o[F+2]),_e=o.length/3-1,a.push(_e),m[_e*2+0]=1,m[_e*2+1]=w,h[_e*3+0]=Ne.x,h[_e*3+1]=Ne.y,h[_e*3+2]=Ne.z,o.push(o[M+0],o[M+1],o[M+2]),_e=o.length/3-1,a.push(_e),m[_e*2+0]=1,m[_e*2+1]=Te,h[_e*3+0]=Ne.x,h[_e*3+1]=Ne.y,h[_e*3+2]=Ne.z,o.push(o[X+0],o[X+1],o[X+2]),_e=o.length/3-1,a.push(_e),m[_e*2+0]=1,m[_e*2+1]=Wi,h[_e*3+0]=Ne.x,h[_e*3+1]=Ne.y,h[_e*3+2]=Ne.z),h[F+0]=h[M+0]=h[X+0]=Ne.x,h[F+1]=h[M+1]=h[X+1]=Ne.y,h[F+2]=h[M+2]=h[X+2]=Ne.z,m[j+0]=Y,m[j+1]=w,m[k+0]=Pe,m[k+1]=Te,m[V+0]=mr,m[V+1]=Wi}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(o)},NORMAL:{size:3,value:new Float32Array(h)},TEXCOORD_0:{size:2,value:new Float32Array(m)}}}}function jf(e){var t=e.indices,r=e.attributes;if(!t)return e;var n=t.value.length,i={};for(var o in r){var a=r[o],c=a.constant,f=a.value,u=a.size;if(!(c||!u)){for(var _=new f.constructor(n*u),E=0;E<n;++E)for(var p=t.value[E],d=0;d<u;d++)_[E*u+d]=f[p*u+d];i[o]={size:u,value:_}}}return{attributes:Object.assign({},r,i)}}function Kf(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 mn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eh(e){var t=th();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function th(){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 kf=function(e){U(r,e);var t=eh(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var i=n.id,o=i===void 0?J("plane-geometry"):i,a=rh(n),c=a.indices,f=a.attributes;return t.call(this,mn(mn({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:mn(mn({},f),n.attributes)}))}return y(r)}(ye);function rh(e){var t=e.type,r=t===void 0?"x,y":t,n=e.offset,i=n===void 0?0:n,o=e.flipCull,a=o===void 0?!1:o,c=e.unpack,f=c===void 0?!1:c,u=r.split(","),_=e["".concat(u[0],"len")]||1,E=e["".concat(u[1],"len")]||1,p=e["n".concat(u[0])]||1,d=e["n".concat(u[1])]||1,h=(p+1)*(d+1),m=new Float32Array(h*3),A=new Float32Array(h*3),T=new Float32Array(h*2);a&&(_=-_);for(var P=0,S=0,O=0;O<=d;O++)for(var F=0;F<=p;F++){var M=F/p,X=O/d;switch(T[P+0]=a?1-M:M,T[P+1]=X,r){case"x,y":m[S+0]=_*M-_*.5,m[S+1]=E*X-E*.5,m[S+2]=i,A[S+0]=0,A[S+1]=0,A[S+2]=a?1:-1;break;case"x,z":m[S+0]=_*M-_*.5,m[S+1]=i,m[S+2]=E*X-E*.5,A[S+0]=0,A[S+1]=a?1:-1,A[S+2]=0;break;case"y,z":m[S+0]=i,m[S+1]=_*M-_*.5,m[S+2]=E*X-E*.5,A[S+0]=a?1:-1,A[S+1]=0,A[S+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}P+=2,S+=3}for(var j=p+1,k=new Uint16Array(p*d*6),V=0;V<d;V++)for(var g=0;g<p;g++){var R=(V*p+g)*6;k[R+0]=(V+0)*j+g,k[R+1]=(V+1)*j+g,k[R+2]=(V+0)*j+g+1,k[R+3]=(V+1)*j+g,k[R+4]=(V+1)*j+g+1,k[R+5]=(V+0)*j+g+1}var v={indices:{size:1,value:k},attributes:{POSITION:{size:3,value:m},NORMAL:{size:3,value:A},TEXCOORD_0:{size:2,value:T}}};return f?jf(v):v}function Yf(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?Yf(Object(r),!0).forEach(function(n){l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nh(e){var t=ih();return function(){var n=b(e),i;if(t){var o=b(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return L(this,i)}}function ih(){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 zf=function(e){U(r,e);var t=nh(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};C(this,r);var i=n.id,o=i===void 0?J("sphere-geometry"):i,a=oh(n),c=a.indices,f=a.attributes;return t.call(this,Rn(Rn({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:Rn(Rn({},f),n.attributes)}))}return y(r)}(ye);function oh(e){for(var t=e.nlat,r=t===void 0?10:t,n=e.nlong,i=n===void 0?10:n,o=0,a=Math.PI,c=a-o,f=0,u=2*Math.PI,_=u-f,E=(r+1)*(i+1),p=function(Pe,pe,le,ge,Ye){return e.radius||1},d=new Float32Array(E*3),h=new Float32Array(E*3),m=new Float32Array(E*2),A=E>65535?Uint32Array:Uint16Array,T=new A(r*i*6),P=0;P<=r;P++)for(var S=0;S<=i;S++){var O=S/i,F=P/r,M=S+P*(i+1),X=M*2,j=M*3,k=_*O,V=c*F,g=Math.sin(k),R=Math.cos(k),v=Math.sin(V),I=Math.cos(V),B=R*v,w=I,Y=g*v,q=p(B,w,Y,O,F);d[j+0]=q*B,d[j+1]=q*w,d[j+2]=q*Y,h[j+0]=B,h[j+1]=w,h[j+2]=Y,m[X+0]=O,m[X+1]=1-F}for(var K=i+1,Z=0;Z<i;Z++)for(var G=0;G<r;G++){var $=(Z*r+G)*6;T[$+0]=G*K+Z,T[$+1]=G*K+Z+1,T[$+2]=(G+1)*K+Z,T[$+3]=(G+1)*K+Z,T[$+4]=G*K+Z+1,T[$+5]=(G+1)*K+Z+1}return{indices:{size:1,value:T},attributes:{POSITION:{size:3,value:d},NORMAL:{size:3,value:h},TEXCOORD_0:{size:2,value:m}}}}return lu(ah);})();
|
|
256
|
+
`]))),io=[-1,-1,1,-1,-1,1,1,1],oo=function(e){q(r,e);var t=ma(r);function r(n,i){T(this,r);var o=io.map(function(s){return s===-1?0:s});return t.call(this,n,no(no({},i),{},{vs:va,vertexCount:4,geometry:new st({topology:"triangle-strip",vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(io)},aTexCoord:{size:2,value:new Float32Array(o)},aCoordinate:{size:2,value:new Float32Array(o)}}})}))}return A(r)}(ae);var Dt=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 Or(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=Or(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 ya(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_a(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 _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 Dt}),"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)}(Dt);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)}(Dt);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 wr(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,wr(wr({},n),{},{id:o,topology:"triangle-list",indices:c,attributes:wr({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 Pt(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?Pt(Pt({},n),{},{id:o,topology:"triangle-list",indices:{size:1,value:La},attributes:Pt(Pt({},Ga),n.attributes)}):Pt(Pt({},n),{},{id:o,topology:"triangle-list",indices:void 0,attributes:Pt(Pt({},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,Er=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]=Er,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]=Er}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);})();
|
|
316
258
|
/*! Bundled license information:
|
|
317
259
|
|
|
318
260
|
@babel/runtime/helpers/regeneratorRuntime.js:
|