@luma.gl/engine 9.0.0-alpha.52 → 9.0.0-alpha.54

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.min.js CHANGED
@@ -4,28 +4,27 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['luma'] = factory();
6
6
  else root['luma'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var _r=Object.defineProperty;var nf=Object.getOwnPropertyDescriptor;var of=Object.getOwnPropertyNames;var af=Object.prototype.hasOwnProperty;var sf=(e,t)=>{for(var r in t)_r(e,r,{get:t[r],enumerable:!0})},ff=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of of(t))!af.call(e,i)&&i!==r&&_r(e,i,{get:()=>t[i],enumerable:!(n=nf(t,i))||n.enumerable});return e};var cf=e=>ff(_r({},"__esModule",{value:!0}),e);var yd={};sf(yd,{AnimationLoop:()=>Kt,AnimationLoopTemplate:()=>xn,BufferTransform:()=>Ya,ClipSpace:()=>us,ConeGeometry:()=>Ss,CubeGeometry:()=>As,CylinderGeometry:()=>js,GPUGeometry:()=>ir,Geometry:()=>Z,GroupNode:()=>ps,IcoSphereGeometry:()=>Cs,KeyFrames:()=>On,Model:()=>ae,ModelNode:()=>ds,PipelineFactory:()=>Et,PlaneGeometry:()=>zs,ScenegraphNode:()=>Ee,SphereGeometry:()=>Ks,TextureTransform:()=>Qa,Timeline:()=>wn,TruncatedConeGeometry:()=>Ye,_ShaderInputs:()=>nr,makeAnimationLoop:()=>Hi});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 uf(e,t){return pf(e)||hf(e,t)||bn(e,t)||lf()}function lf(){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 hf(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function pf(e){if(Array.isArray(e))return e}function Or(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=bn(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function bn(e,t){if(e){if(typeof e=="string")return vn(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 vn(e,t)}}function vn(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 gn(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,df(n.key),n)}}function mf(e,t,r){return t&&gn(e.prototype,t),r&&gn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function df(e){var t=yf(e,"string");return tt(t)==="symbol"?t:String(t)}function yf(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 vf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var gf=1,bf=1,wn=function(){function e(){vf(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,f=a===void 0?Number.POSITIVE_INFINITY:a,s=n.rate,l=s===void 0?1:s,p=n.repeat,y=p===void 0?1:p,g=gf++,w={time:0,delay:o,duration:f,rate:l,repeat:y};return this._setChannelTime(w,this.time),this.channels.set(g,w),g},t.removeChannel=function(n){this.channels.delete(n);var i=Or(this.animations),o;try{for(i.s();!(o=i.n()).done;){var a=uf(o.value,2),f=a[0],s=a[1];s.channel===n&&this.detachAnimation(f)}}catch(l){i.e(l)}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=Or(i),a;try{for(o.s();!(a=o.n()).done;){var f=a.value;this._setChannelTime(f,this.time)}}catch(b){o.e(b)}finally{o.f()}var s=this.animations.values(),l=Or(s),p;try{for(l.s();!(p=l.n()).done;){var y=p.value,g=y.animation,w=y.channel;g.setTime(this.getTime(w))}}catch(b){l.e(b)}finally{l.f()}},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=bf++;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)},mf(e)}();function rt(e){return rt=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},rt(e)}function _n(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,_f(n.key),n)}}function wf(e,t,r){return t&&_n(e.prototype,t),r&&_n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _f(e){var t=Of(e,"string");return rt(t)==="symbol"?t:String(t)}function Of(e,t){if(rt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(rt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var On=function(){function e(r){Sf(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],f=this.times[this.endIndex];this.factor=Math.min(Math.max(0,(n-a)/(f-a)),1)},wf(e)}();function Ae(e){return Ae=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},Ae(e)}function Sr(){"use strict";Sr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}e.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(N([])));S&&S!==t&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,j=U.value;return j&&Ae(j)=="object"&&r.call(j,"__await")?c.resolve(j.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(j).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function I(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(I,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,j){return O.type="throw",O.arg=c,u.next=U,j&&(u.method="next",u.arg=void 0),!!j}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:N(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function Sn(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(l){r(l);return}f.done?t(s):Promise.resolve(s).then(n,i)}function Pf(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){Sn(o,n,i,a,f,"next",s)}function f(s){Sn(o,n,i,a,f,"throw",s)}a(void 0)})}}function Pn(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,Ef(n.key),n)}}function xf(e,t,r){return t&&Pn(e.prototype,t),r&&Pn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ef(e){var t=Af(e,"string");return Ae(t)==="symbol"?t:String(t)}function Af(e,t){if(Ae(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ae(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var xn=function(){function e(r){Tf(this,e)}var t=e.prototype;return t.onInitialize=function(){var r=Pf(Sr().mark(function i(o){return Sr().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",null);case 1:case"end":return f.stop()}},i)}));function n(i){return r.apply(this,arguments)}return n}(),xf(e)}();function Pr(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 J(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Pr()}var Mf=globalThis.self||globalThis.window||globalThis.global,Te=globalThis.window||globalThis.self||globalThis.global,Rf=globalThis.document||{},_e=globalThis.process||{},Lf=globalThis.console,Pd=globalThis.navigator||{};var Ct=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",Ad=J();function jf(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Ft=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=jf(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 En(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 An(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 Ut(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,f=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),f]}var Gt;(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"})(Gt||(Gt={}));var If=10;function Tn(e){return typeof e!="string"?e:(e=e.toUpperCase(),Gt[e]||Gt.WHITE)}function Mn(e,t,r){if(!J&&typeof e=="string"){if(t){let n=Tn(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=Tn(r);e="\x1B[".concat(n+If,"m").concat(e,"\x1B[49m")}}return e}function Rn(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(f=>o===f)||(i[o]=a.bind(e)))}}function Me(e,t){if(!e)throw new Error(t||"Assertion failed")}function Oe(){let e;if(J()&&Te.performance){var t,r;e=Te===null||Te===void 0||(t=Te.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in _e){var n;let i=_e===null||_e===void 0||(n=_e.hrtime)===null||n===void 0?void 0:n.call(_e);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var Re={debug:J()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Df={enabled:!0,level:0};function te(){}var Ln={},jn={once:!0},pe=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Ct,this._startTs=Oe(),this._deltaTs=Oe(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Ft("__probe-".concat(this.id,"__"),Df),this.timeStamp("".concat(this.id," started")),Rn(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((Oe()-this._startTs).toPrecision(10))}getDelta(){return Number((Oe()-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){Me(t,r)}warn(t){return this._getLogFunction(0,t,Re.warn,arguments,jn)}error(t){return this._getLogFunction(0,t,Re.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,Re.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Re.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Re.debug||Re.info,arguments,jn)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||te,n&&[n],{tag:Uf(r)}):te}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:a=1}=t;return this._shouldLog(r||n)?J()?Ff({image:i,message:o,scale:a}):Cf({image:i,message:o,scale:a}):te}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||te)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=In({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||te)}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()>=Dn(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=In({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,Me(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Oe();let a=o.tag||o.message;if(o.once&&a)if(!Ln[a])Ln[a]=Oe();else return te;return r=Nf(this.id,o.message,o),n.bind(console,r,...o.args)}return te}};pe.VERSION=Ct;function Dn(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 Me(Number.isFinite(t)&&t>=0),t}function In(e){let{logLevel:t,message:r}=e;e.logLevel=Dn(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 Me(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function Nf(e,t,r){if(typeof t=="string"){let n=r.time?An(En(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=Mn(t,r.color,r.background)}return t}function Cf(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),te}function Ff(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let a=Ut(o,r,n);console.log(...a)},o.src=t,te}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Ut(t,r,n)),te;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...Ut(o,r,n)),o.src=t.toDataURL(),te}return te}function Uf(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Jd=new pe({id:"@probe.gl/log"});var B=new pe({id:"luma.gl"});function nt(){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 Se=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=nt(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(nt()-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 me=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 Se?i=t:i=new Se(r,n),this.stats[r]=i),i}};function it(e){return it=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},it(e)}function Nn(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,Bf(n.key),n)}}function Gf(e,t,r){return t&&Nn(e.prototype,t),r&&Nn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bf(e){var t=zf(e,"string");return it(t)==="symbol"?t:String(t)}function zf(e,t){if(it(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(it(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Vf=function(){function e(){kf(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 me({id:n})),this.stats.get(n)},Gf(e)}(),Le=new Vf;function Hf(){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||(J()&&B.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:B,stats:Le}),e}var Cn=Hf();function Kf(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function de(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:Kf(e)}var xr={};function z(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";xr[e]=xr[e]||1;var t=xr[e]++;return"".concat(e,"-").concat(t)}function ot(e){return ot=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},ot(e)}function Fn(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 Wf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fn(Object(r),!0).forEach(function(n){qf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qf(e,t,r){return t=Gn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Un(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,Gn(n.key),n)}}function Yf(e,t,r){return t&&Un(e.prototype,t),r&&Un(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gn(e){var t=Xf(e,"string");return ot(t)==="symbol"?t:String(t)}function Xf(e,t){if(ot(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ot(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Pe=function(){function e(r,n,i){if($f(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=Zf(n,i);var o=this.props.id!=="undefined"?this.props.id:z(this[Symbol.toStringTag]);this.props.id=o,this.id=o,this.userData=this.props.userData||{},this.addStats()}var 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()},Yf(e)}();Pe.defaultProps={id:"undefined",handle:void 0,userData:void 0};function Zf(e,t){var r=Wf({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}function je(e){return je=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},je(e)}var kn;function Bn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bn(Object(r),!0).forEach(function(n){Jf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jf(e,t,r){return t=Vn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zn(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,Vn(n.key),n)}}function ec(e,t,r){return t&&zn(e.prototype,t),r&&zn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vn(e){var t=tc(e,"string");return je(t)==="symbol"?t:String(t)}function tc(e,t){if(je(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(je(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rc(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&&Ar(e,t)}function Ar(e,t){return Ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ar(e,t)}function nc(e){var t=ac();return function(){var n=Bt(e),i;if(t){var o=Bt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ic(this,i)}}function ic(e,t){if(t&&(je(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oc(e)}function oc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ac(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bt(e)}kn=Symbol.toStringTag;var k=function(e){rc(r,e);var t=nc(r);function r(i,o){var a;Qf(this,r);var f=Er({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?f.indexType="uint32":o.data instanceof Uint16Array&&(f.indexType="uint16")),a=t.call(this,i,f,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=o.usage||0,a.indexType=f.indexType,a}var n=r.prototype;return n.write=function(o,a){throw new Error("not implemented")},n.readAsync=function(o,a){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},ec(r,[{key:kn,get:function(){return"Buffer"}}]),r}(Pe);k.defaultProps=Er(Er({},Pe.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});k.MAP_READ=1;k.MAP_WRITE=2;k.COPY_SRC=4;k.COPY_DST=8;k.INDEX=16;k.VERTEX=32;k.UNIFORM=64;k.STORAGE=128;k.INDIRECT=256;k.QUERY_RESOLVE=512;function at(e){return at=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},at(e)}var Wn;function Hn(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 Tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hn(Object(r),!0).forEach(function(n){sc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sc(e,t,r){return t=qn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kn(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,qn(n.key),n)}}function cc(e,t,r){return t&&Kn(e.prototype,t),r&&Kn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function qn(e){var t=uc(e,"string");return at(t)==="symbol"?t:String(t)}function uc(e,t){if(at(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(at(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}Wn=Symbol.toStringTag;var st=function(){function e(r){fc(this,e),this.id=void 0,this.statsManager=Le,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Tr(Tr({},e.defaultProps),r),this.id=this.props.id||z(this[Symbol.toStringTag].toLowerCase())}var t=e.prototype;return t.loseDevice=function(){return!1},t.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},t.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},t.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},t._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var i=Tr({},n);return(n.usage||0)&k.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":B.warn("indices buffer content must be of integer type")()),i},cc(e,[{key:Wn,get:function(){return"Device"}}]),e}();st.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(B.get("debug")),break:[],gl:null};st.VERSION=Cn;function De(e){return De=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},De(e)}function Mr(){"use strict";Mr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}e.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(N([])));S&&S!==t&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,j=U.value;return j&&De(j)=="object"&&r.call(j,"__await")?c.resolve(j.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(j).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function I(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(I,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,j){return O.type="throw",O.arg=c,u.next=U,j&&(u.method="next",u.arg=void 0),!!j}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:N(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function Yn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Xn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yn(Object(r),!0).forEach(function(n){lc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lc(e,t,r){return t=Qn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $n(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(l){r(l);return}f.done?t(s):Promise.resolve(s).then(n,i)}function hc(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){$n(o,n,i,a,f,"next",s)}function f(s){$n(o,n,i,a,f,"throw",s)}a(void 0)})}}function pc(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=mc(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function mc(e,t){if(e){if(typeof e=="string")return Zn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zn(e,t)}}function Zn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Jn(e,t){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,Qn(n.key),n)}}function dc(e,t,r){return t&&Jn(e.prototype,t),r&&Jn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qn(e){var t=yc(e,"string");return De(t)==="symbol"?t:String(t)}function yc(e,t){if(De(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(De(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ie=new Map,xe=function(){function e(){vc(this,e)}return e.registerDevices=function(r){var n=pc(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;W(o.type&&o.isSupported&&o.create),Ie.set(o.type,o)}}catch(a){n.e(a)}finally{n.f()}},e.getAvailableDevices=function(){return Array.from(Ie).map(function(r){return r.type})},e.getSupportedDevices=function(){return Array.from(Ie).filter(function(r){return r.isSupported()}).map(function(r){return r.type})},e.setDefaultDeviceProps=function(r){Object.assign(st.defaultProps,r)},e.createDevice=function(){var t=hc(Mr().mark(function n(){var i,o,a=arguments;return Mr().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:i=a.length>0&&a[0]!==void 0?a[0]:{},i=Xn(Xn({},st.defaultProps),i),i.gl&&(i.type="webgl"),s.t0=i.type,s.next=s.t0==="webgpu"?6:s.t0==="webgl"||s.t0==="webgl1"||s.t0==="webgl2"?12:s.t0==="best-available"?18:24;break;case 6:if(o=Ie.get("webgpu"),!o){s.next=11;break}return s.next=10,o.create(i);case 10:return s.abrupt("return",s.sent);case 11:return s.abrupt("break",24);case 12:if(o=Ie.get("webgl"),!o){s.next=17;break}return s.next=16,o.create(i);case 16:return s.abrupt("return",s.sent);case 17:return s.abrupt("break",24);case 18:if(o=Ie.get("webgl"),!(o&&o.isSupported())){s.next=23;break}return s.next=22,o.create(i);case 22:return s.abrupt("return",s.sent);case 23:return s.abrupt("break",24);case 24:throw new Error("No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.");case 25:case"end":return s.stop()}},n)}));function r(){return t.apply(this,arguments)}return r}(),dc(e)}();xe.stats=Le;xe.log=B;function Ne(e){return Ne=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},Ne(e)}var ni;function ei(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 ti(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ei(Object(r),!0).forEach(function(n){gc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ei(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gc(e,t,r){return t=ii(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ri(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,ii(n.key),n)}}function wc(e,t,r){return t&&ri(e.prototype,t),r&&ri(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ii(e){var t=_c(e,"string");return Ne(t)==="symbol"?t:String(t)}function _c(e,t){if(Ne(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ne(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oc(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&&Rr(e,t)}function Rr(e,t){return Rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Rr(e,t)}function Sc(e){var t=Ec();return function(){var n=zt(e),i;if(t){var o=zt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Pc(this,i)}}function Pc(e,t){if(t&&(Ne(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xc(e)}function xc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ec(){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 zt(e){return zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zt(e)}ni=Symbol.toStringTag;var Ce=function(e){Oc(r,e);var t=Sc(r);function r(n,i){var o;return bc(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 wc(r,[{key:ni,get:function(){return"RenderPipeline"}}]),r}(Pe);Ce.defaultProps=ti(ti({},Pe.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});function Ac(e,t){return Lc(e)||Rc(e,t)||Mc(e,t)||Tc()}function Tc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mc(e,t){if(e){if(typeof e=="string")return oi(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 oi(e,t)}}function oi(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 Rc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Lc(e){if(Array.isArray(e))return e}function ai(e){var t=Ac(Ic[e],2),r=t[0],n=t[1],i=r==="i32"||r==="u32",o=r!=="u32",a=Dc[r]*n,f=jc(r,n);return{dataType:r,components:n,defaultVertexFormat:f,byteLength:a,integer:i,signed:o}}function jc(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 Ic={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]},Dc={f32:4,f16:2,i32:4,u32:4};function fi(e){var t=si[e],r=Nc(t),n=e.includes("norm"),i=!n&&!e.startsWith("float"),o=e.startsWith("s");return{dataType:si[e],byteLength:r,integer:i,signed:o,normalized:n}}function Nc(e){var t=Cc[e];return t}var si={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},Cc={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Fc(e,t){return zc(e)||Bc(e,t)||Gc(e,t)||Uc()}function Uc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gc(e,t){if(e){if(typeof e=="string")return ci(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 ci(e,t)}}function ci(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 Bc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function zc(e){if(Array.isArray(e))return e}function Lr(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=Fc(r,2),i=n[0],o=n[1],a=i,f=o?parseInt(o):1,s=fi(a),l={type:a,components:f,byteLength:s.byteLength*f,integer:s.integer,signed:s.signed,normalized:s.normalized};return t&&(l.webglOnly=!0),l}function ft(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=kc(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
13
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function kc(e,t){if(e){if(typeof e=="string")return ui(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 ui(e,t)}}function ui(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 jr(e,t){var r={},n=ft(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=Vc(e,t,o.name)}}catch(a){n.e(a)}finally{n.f()}return r}function Vc(e,t,r){var n=Hc(e,r),i=Kc(t,r);if(!n)return null;var o=ai(n.type),a=i?.vertexFormat||o.defaultVertexFormat,f=Lr(a);return{attributeName:i?.attributeName||n.name,bufferName:i?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:a,bufferDataType:f.type,bufferComponents:f.components,normalized:f.normalized,integer:o.integer,stepMode:i?.stepMode||n.stepMode,byteOffset:i?.byteOffset||0,byteStride:i?.byteStride||0}}function Hc(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||B.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function Kc(e,t){Wc(e);var r=qc(e,t);return r||(r=Yc(e,t),r)?r:(B.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Wc(e){var t=ft(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&B.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function qc(e,t){var r=ft(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 Yc(e,t){var r=ft(e),n;try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=o.byteStride;if(typeof o.byteStride!="number"){var f=ft(o.attributes||[]),s;try{for(f.s();!(s=f.n()).done;){var l=s.value,p=Lr(l.format);a+=p.byteLength}}catch(g){f.e(g)}finally{f.f()}}var y=(i=o.attributes)===null||i===void 0?void 0:i.find(function(g){return g.attribute===t});if(y)return{attributeName:y.attribute,bufferName:o.name,stepMode:o.stepMode,vertexFormat:y.format,byteOffset:y.byteOffset,byteStride:a}}}catch(g){r.e(g)}finally{r.f()}return null}function W(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}var Xc={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 li(e){var t=Xc[e];return W(e),t}function hi(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}var kt;function pi(e){return(!kt||kt.byteLength<e)&&(kt=new ArrayBuffer(e)),kt}function ct(e){return ct=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},ct(e)}function mi(e,t){return Qc(e)||Jc(e,t)||Zc(e,t)||$c()}function $c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zc(e,t){if(e){if(typeof e=="string")return di(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 di(e,t)}}function di(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 Jc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Qc(e){if(Array.isArray(e))return e}function yi(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,tu(n.key),n)}}function eu(e,t,r){return t&&yi(e.prototype,t),r&&yi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tu(e){var t=ru(e,"string");return ct(t)==="symbol"?t:String(t)}function ru(e,t){if(ct(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ct(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var vi=1024,gi=function(){function e(r){nu(this,e),this.layout={},this.byteLength=void 0;for(var n=0,i=0,o=Object.entries(r);i<o.length;i++){var a=mi(o[i],2),f=a[0],s=a[1],l=li(s),p=l.type,y=l.components;n=hi(n,y);var g=n;n+=y,this.layout[f]={type:p,size:y,offset:g}}n+=(4-n%4)%4;var w=n*4;this.byteLength=Math.max(w,vi)}var t=e.prototype;return t.getData=function(n){for(var i=Math.max(this.byteLength,vi),o=pi(i),a={i32:new Int32Array(o),u32:new Uint32Array(o),f32:new Float32Array(o),f16:new Uint16Array(o)},f=0,s=Object.entries(n);f<s.length;f++){var l=mi(s[f],2),p=l[0],y=l[1],g=this.layout[p];if(!g){B.warn("Supplied uniform value ".concat(p," not present in uniform block layout"))();continue}var w=g.type,b=g.size,_=g.offset,x=a[w];if(b===1){if(typeof y!="number"&&typeof y!="boolean"){B.warn("Supplied value for single component uniform ".concat(p," is not a number: ").concat(y))();continue}x[_]=Number(y)}else{var S=de(y);if(!S){B.warn("Supplied value for multi component / array uniform ".concat(p," is not a numeric array: ").concat(y))();continue}x.set(S,_)}}return new Uint8Array(o)},t.has=function(n){return Boolean(this.layout[n])},t.get=function(n){var i=this.layout[n];return i},eu(e)}();function bi(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16;if(e!==t)return!1;var n=de(e);if(!n)return!1;var i=de(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 wi(e){var t=de(e);return t?t.slice():e}function ut(e){return ut=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},ut(e)}function iu(e,t){return su(e)||au(e,t)||Si(e,t)||ou()}function ou(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function au(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function su(e){if(Array.isArray(e))return e}function fu(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Si(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
16
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Si(e,t){if(e){if(typeof e=="string")return _i(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 _i(e,t)}}function _i(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Oi(e,t){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,uu(n.key),n)}}function cu(e,t,r){return t&&Oi(e.prototype,t),r&&Oi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function uu(e){var t=lu(e,"string");return ut(t)==="symbol"?t:String(t)}function lu(e,t){if(ut(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ut(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Pi=function(){function e(r){if(hu(this,e),this.name=void 0,this.uniforms={},this.modifiedUniforms={},this.modified=!0,this.bindingLayout={},this.needsRedraw="initialized",this.name=r?.name,r!=null&&r.name&&r!==null&&r!==void 0&&r.shaderLayout){var n,i=r==null||(n=r.shaderLayout.bindings)===null||n===void 0?void 0:n.find(function(l){return l.type==="uniform"&&l.name===r?.name});if(!i)throw new Error(r?.name);var o=i,a=fu(o.uniforms||[]),f;try{for(a.s();!(f=a.n()).done;){var s=f.value;this.bindingLayout[s.name]=s}}catch(l){a.e(l)}finally{a.f()}}}var t=e.prototype;return t.setUniforms=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=iu(o[i],2),f=a[0],s=a[1];this._setUniform(f,s),this.needsRedraw||this.setNeedsRedraw("".concat(this.name,".").concat(f,"=").concat(s))}},t.setNeedsRedraw=function(n){this.needsRedraw=this.needsRedraw||n},t.getAllUniforms=function(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}},t._setUniform=function(n,i){bi(this.uniforms[n],i)||(this.uniforms[n]=wi(i),this.modifiedUniforms[n]=!0,this.modified=!0)},cu(e)}();function lt(e){return lt=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},lt(e)}function pu(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ti(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
17
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function xi(e,t){return yu(e)||du(e,t)||Ti(e,t)||mu()}function mu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ti(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 du(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function yu(e){if(Array.isArray(e))return e}function Ai(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,gu(n.key),n)}}function vu(e,t,r){return t&&Ai(e.prototype,t),r&&Ai(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function gu(e){var t=bu(e,"string");return lt(t)==="symbol"?t:String(t)}function bu(e,t){if(lt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(lt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ir=function(){function e(r){wu(this,e),this.uniformBlocks=new Map,this.uniformBufferLayouts=new Map,this.uniformBuffers=new Map;for(var n=0,i=Object.entries(r);n<i.length;n++){var o=xi(i[n],2),a=o[0],f=o[1],s=a,l=new gi(f.uniformTypes||{});this.uniformBufferLayouts.set(s,l);var p=new Pi({name:a});p.setUniforms(f.defaultUniforms||{}),this.uniformBlocks.set(s,p)}}var t=e.prototype;return t.destroy=function(){for(var n=0,i=Object.values(this.uniformBuffers);n<i.length;n++){var o=i[n];o.destroy()}},t.setUniforms=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=xi(o[i],2),f=a[0],s=a[1];this.uniformBlocks.get(f).setUniforms(s)}this.updateUniformBuffers()},t.getUniformBufferByteLength=function(n){return this.uniformBufferLayouts.get(n).byteLength},t.getUniformBufferData=function(n){var i=this.uniformBlocks.get(n).getAllUniforms();return this.uniformBufferLayouts.get(n).getData(i)},t.createUniformBuffer=function(n,i,o){o&&this.setUniforms(o);var a=this.getUniformBufferByteLength(i),f=n.createBuffer({usage:k.UNIFORM,byteLength:a}),s=this.getUniformBufferData(i);return f.write(s),f},t.getManagedUniformBuffer=function(n,i){if(!this.uniformBuffers.get(i)){var o=this.getUniformBufferByteLength(i),a=n.createBuffer({usage:k.UNIFORM,byteLength:o});this.uniformBuffers.set(i,a)}return this.uniformBuffers.get(i)},t.updateUniformBuffers=function(){var n=!1,i=pu(this.uniformBlocks.keys()),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,f=this.updateUniformBuffer(a);n||(n=f)}}catch(s){i.e(s)}finally{i.f()}return n&&B.log(3,"UniformStore.updateUniformBuffers(): ".concat(n))(),n},t.updateUniformBuffer=function(n){var i=this.uniformBlocks.get(n),o=this.uniformBuffers.get(n),a=!1;if(o&&i.needsRedraw){a||(a=i.needsRedraw);var f=this.getUniformBufferData(n),s=this.uniformBuffers.get(n);s.write(f);var l=this.uniformBlocks.get(n).getAllUniforms();B.log(4,"Writing to uniform buffer ".concat(String(n)),f,l)()}return a},vu(e)}();function Mi(e){var t=ArrayBuffer.isView(e)?e.constructor:e;switch(t){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(t.constructor.name)}}function Dr(e,t,r){if(!t||t>4)throw new Error("size ".concat(t));var n=t,i=Mi(e);if(i==="uint8"||i==="sint8"){if(n===1||n===3)throw new Error("size: ".concat(t));return r&&(i=i.replace("int","norm")),"".concat(i,"x").concat(n)}if(i==="uint16"||i==="sint16"){if(n===1||n===3)throw new Error("size: ".concat(t));return r&&(i=i.replace("int","norm")),"".concat(i,"x").concat(n)}return n===1?i:"".concat(i,"x").concat(n)}function Ri(e){return de(e)!==null||typeof e=="number"||typeof e=="boolean"}function Nr(e){var t={bindings:{},uniforms:{}};return Object.keys(e).forEach(function(r){var n=e[r];Ri(n)?t.uniforms[r]=n:t.bindings[r]=n}),t}function Vt(e){return Vt=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},Vt(e)}function ht(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(!ht(e[n],t[n],r-1))return!1;return!0}if(Array.isArray(t))return!1;if(Vt(e)==="object"&&Vt(t)==="object"){var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var a=0,f=i;a<f.length;a++){var s=f[a];if(!t.hasOwnProperty(s)||!ht(e[s],t[s],r-1))return!1}return!0}return!1}function Cr(e){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function Fr(e){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}function pt(e){return pt=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},pt(e)}function Li(e,t,r){return t=_u(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _u(e){var t=Ou(e,"string");return pt(t)==="symbol"?t:String(t)}function Ou(e,t){if(pt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ji(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Su(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
19
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Su(e,t){if(e){if(typeof e=="string")return Ii(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ii(e,t)}}function Ii(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ur(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r={},n="Shader Layout for ".concat(t),i=ji(e.attributes),o;try{for(i.s();!(o=i.n()).done;){var a=o.value;if(a){var f="".concat(a.location," ").concat(a.name,": ").concat(a.type);r["in ".concat(f)]=Li({},n,a.stepMode||"vertex")}}}catch(g){i.e(g)}finally{i.f()}var s=ji(e.varyings||[]),l;try{for(s.s();!(l=s.n()).done;){var p=l.value,y="".concat(p.location," ").concat(p.name);r["out ".concat(y)]=Li({},n,JSON.stringify(p.accessor))}}catch(g){s.e(g)}finally{s.f()}return r}var Di=function(t){return"".concat(t)};function Fe(e){return Fe=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},Fe(e)}function Pu(e,t){return Tu(e)||Au(e,t)||Eu(e,t)||xu()}function xu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
20
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eu(e,t){if(e){if(typeof e=="string")return Ni(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 Ni(e,t)}}function Ni(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 Au(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Tu(e){if(Array.isArray(e))return e}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){Mu(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 Mu(e,t,r){return t=Bi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ui(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,Bi(n.key),n)}}function Ru(e,t,r){return t&&Ui(e.prototype,t),r&&Ui(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bi(e){var t=Lu(e,"string");return Fe(t)==="symbol"?t:String(t)}function Lu(e,t){if(Fe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Fe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ju(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fe(){"use strict";fe=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}e.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(N([])));S&&S!==t&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,j=U.value;return j&&Fe(j)=="object"&&r.call(j,"__await")?c.resolve(j.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(j).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function I(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(I,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,j){return O.type="throw",O.arg=c,u.next=U,j&&(u.method="next",u.arg=void 0),!!j}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:N(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function Gi(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(l){r(l);return}f.done?t(s):Promise.resolve(s).then(n,i)}function Ht(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){Gi(o,n,i,a,f,"next",s)}function f(s){Gi(o,n,i,a,f,"throw",s)}a(void 0)})}}var Iu=0,Du={device:null,onAddHTML:function(){return""},onInitialize:function(){var e=Ht(fe().mark(function r(){return fe().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:xe.stats.get("animation-loop-".concat(Iu++)),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1},Kt=function(){function e(r){if(ju(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=Fi(Fi({},Du),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 me({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=Ht(fe().mark(function i(){var o,a;return fe().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this._running){s.next=2;break}return s.abrupt("return",this);case 2:if(this._running=!0,s.prev=3,this._initialized){s.next=11;break}return this._initialized=!0,s.next=8,this._initDevice();case 8:return this._initialize(),s.next=11,this.props.onInitialize(this._getAnimationProps());case 11:if(this._running){s.next=13;break}return s.abrupt("return",null);case 13:return o!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),s.abrupt("return",this);case 17:throw s.prev=17,s.t0=s.catch(3),a=s.t0 instanceof Error?s.t0:new Error("Unknown error"),this.props.onError(a),a;case 22:case"end":return s.stop()}},i,this,[[3,17]])}));function n(){return r.apply(this,arguments)}return n}(),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=Ht(fe().mark(function i(){return fe().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=Cr(this._animationFrame.bind(this)))},t._cancelAnimationFrame=function(){this._animationFrameId!==null&&(Fr(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,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=Ht(fe().mark(function i(){var o;return fe().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.props.device;case 2:if(this.device=f.sent,this.device){f.next=5;break}throw new Error("No device provided");case 5:this.canvas=((o=this.device.canvasContext)===null||o===void 0?void 0:o.canvas)||null;case 6:case"end":return f.stop()}},i,this)}));function n(){return r.apply(this,arguments)}return n}(),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=Pu(o,2),f=a[0],s=a[1],l=1,p=(i=this.device)===null||i===void 0||(i=i.canvasContext)===null||i===void 0?void 0:i.canvas;return p&&p.clientHeight?l=p.clientWidth/p.clientHeight:f>0&&s>0&&(l=f/s),{width:f,height:s,aspect:l}},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},Ru(e)}();function Ue(e){return Ue=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},Ue(e)}function Gr(){"use strict";Gr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,u){h[c]=u.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,u){return Object.defineProperty(h,c,{value:u,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(u,m,v){return u[m]=v}}function l(h,c,u,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:M(h,u,O)}),d}function p(h,c,u){try{return{type:"normal",arg:h.call(c,u)}}catch(m){return{type:"throw",arg:m}}}e.wrap=l;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(N([])));S&&S!==t&&r.call(S,o)&&(_=S);var R=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(u){return this._invoke(c,u)})})}function T(h,c){function u(v,d,O,P){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,j=U.value;return j&&Ue(j)=="object"&&r.call(j,"__await")?c.resolve(j.__await).then(function(G){u("next",G,O,P)},function(G){u("throw",G,O,P)}):c.resolve(j).then(function(G){U.value=G,O(U)},function(G){return u("throw",G,O,P)})}P(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function P(){return new c(function(A,U){u(d,O,A,U)})}return m=m?m.then(P,P):P()}})}function M(h,c,u){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(u.method=v,u.arg=d;;){var O=u.delegate;if(O){var P=L(O,u);if(P){if(P===y)continue;return P}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(m==="suspendedStart")throw m="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);m="executing";var A=p(h,c,u);if(A.type==="normal"){if(m=u.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:u.done}}A.type==="throw"&&(m="completed",u.method="throw",u.arg=A.arg)}}}function L(h,c){var u=c.method,m=h.iterator[u];if(m===void 0)return c.delegate=null,u==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,L(h,c),c.method==="throw")||u!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+u+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function I(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(I,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var u=-1,m=function v(){for(;++u<h.length;)if(r.call(h,u))return v.value=h[u],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(R,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(R),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,u,m,v){v===void 0&&(v=Promise);var d=new T(l(h,c,u,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(R),s(R,f,"Generator"),s(R,o,function(){return this}),s(R,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),u=[];for(var m in c)u.push(m);return u.reverse(),function v(){for(;u.length;){var d=u.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var u in this)u.charAt(0)==="t"&&r.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var u=this;function m(U,j){return O.type="throw",O.arg=c,u.next=U,j&&(u.method="next",u.arg=void 0),!!j}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var P=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(P&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(P){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,u){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=u&&u<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=u,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,u){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&u&&(this.next=u),y},finish:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var u=this.tryEntries.length-1;u>=0;--u){var m=this.tryEntries[u];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,u,m){return this.delegate={iterator:N(c),resultName:u,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function zi(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(l){r(l);return}f.done?t(s):Promise.resolve(s).then(n,i)}function Nu(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){zi(o,n,i,a,f,"next",s)}function f(s){zi(o,n,i,a,f,"throw",s)}a(void 0)})}}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 Vi(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){Cu(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}function Cu(e,t,r){return t=Fu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fu(e){var t=Uu(e,"string");return Ue(t)==="symbol"?t:String(t)}function Uu(e,t){if(Ue(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ue(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hi(e,t){var r=this,n=null,i=t?.device||xe.createDevice(),o=new Kt(Vi(Vi({},t),{},{device:i,onInitialize:function(f){return Nu(Gr().mark(function s(){var l;return Gr().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return n=new e(f),y.next=3,(l=n)===null||l===void 0?void 0:l.onInitialize(f);case 3:return y.abrupt("return",y.sent);case 4:case"end":return y.stop()}},s)}))()},onRender:function(f){var s;return(s=n)===null||s===void 0?void 0:s.onRender(f)},onFinalize:function(f){var s;return(s=n)===null||s===void 0?void 0:s.onFinalize(f)}}));return o.getInfo=function(){return r.AnimationLoopTemplateCtor.info},o}var K=function(t){return"".concat(t)};function ie(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}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 ye(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){Gu(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}function Gu(e,t,r){return t=Bu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bu(e){var t=zu(e,"string");return ve(t)==="symbol"?t:String(t)}function zu(e,t){if(ve(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ve(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yi(e,t){return Ku(e)||Hu(e,t)||Vu(e,t)||ku()}function ku(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
21
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vu(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 Hu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Ku(e){if(Array.isArray(e))return e}function ve(e){return ve=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},ve(e)}var Br={number:{type:"number",validate:function(t,r){return Number.isFinite(t)&&ve(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 Xi(e){for(var t={},r=0,n=Object.entries(e);r<n.length;r++){var i=Yi(n[r],2),o=i[0],a=i[1];t[o]=Wu(a)}return t}function $i(e,t,r){for(var n={},i=0,o=Object.entries(t);i<o.length;i++){var a=Yi(o[i],2),f=a[0],s=a[1];e&&f in e&&!s.private?(s.validate&&ie(s.validate(e[f],s),"".concat(r,": invalid ").concat(f)),n[f]=e[f]):n[f]=s.value}return n}function Wu(e){var t=qi(e);if(t!=="object")return ye(ye({value:e},Br[t]),{},{type:t});if(ve(e)==="object")return e?e.type!==void 0?ye(ye(ye({},e),Br[e.type]),{},{type:e.type}):e.value===void 0?{type:"object",value:e}:(t=qi(e.value),ye(ye(ye({},e),Br[t]),{},{type:t})):{type:"object",value:null};throw new Error("props")}function qi(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":ve(e)}var Zi,Ji;function Qi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var eo=K(Zi||(Zi=Qi([`#ifdef MODULE_LOGDEPTH
7
+ "use strict";var __exports__=(()=>{var Sr=Object.defineProperty;var af=Object.getOwnPropertyDescriptor;var sf=Object.getOwnPropertyNames;var ff=Object.prototype.hasOwnProperty;var cf=(e,t)=>{for(var r in t)Sr(e,r,{get:t[r],enumerable:!0})},uf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sf(t))!ff.call(e,i)&&i!==r&&Sr(e,i,{get:()=>t[i],enumerable:!(n=af(t,i))||n.enumerable});return e};var lf=e=>uf(Sr({},"__esModule",{value:!0}),e);var gd={};cf(gd,{AnimationLoop:()=>Wt,AnimationLoopTemplate:()=>An,BufferTransform:()=>$a,ClipSpace:()=>hs,ConeGeometry:()=>xs,CubeGeometry:()=>Ms,CylinderGeometry:()=>Ds,GPUGeometry:()=>or,Geometry:()=>Z,GroupNode:()=>ds,IcoSphereGeometry:()=>Us,KeyFrames:()=>Pn,Model:()=>ae,ModelNode:()=>vs,PipelineFactory:()=>Et,PlaneGeometry:()=>Vs,ScenegraphNode:()=>Ae,SphereGeometry:()=>qs,TextureTransform:()=>ts,Timeline:()=>On,TruncatedConeGeometry:()=>Xe,_ShaderInputs:()=>ir,makeAnimationLoop:()=>Vi});function rt(e){return rt=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},rt(e)}function hf(e,t){return df(e)||mf(e,t)||_n(e,t)||pf()}function pf(){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 mf(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function df(e){if(Array.isArray(e))return e}function Pr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_n(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.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function _n(e,t){if(e){if(typeof e=="string")return bn(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 bn(e,t)}}function bn(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 wn(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,vf(n.key),n)}}function yf(e,t,r){return t&&wn(e.prototype,t),r&&wn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function vf(e){var t=gf(e,"string");return rt(t)==="symbol"?t:String(t)}function gf(e,t){if(rt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(rt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var wf=1,_f=1,On=function(){function e(){bf(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,f=a===void 0?Number.POSITIVE_INFINITY:a,s=n.rate,u=s===void 0?1:s,p=n.repeat,y=p===void 0?1:p,g=wf++,w={time:0,delay:o,duration:f,rate:u,repeat:y};return this._setChannelTime(w,this.time),this.channels.set(g,w),g},t.removeChannel=function(n){this.channels.delete(n);var i=Pr(this.animations),o;try{for(i.s();!(o=i.n()).done;){var a=hf(o.value,2),f=a[0],s=a[1];s.channel===n&&this.detachAnimation(f)}}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=Pr(i),a;try{for(o.s();!(a=o.n()).done;){var f=a.value;this._setChannelTime(f,this.time)}}catch(b){o.e(b)}finally{o.f()}var s=this.animations.values(),u=Pr(s),p;try{for(u.s();!(p=u.n()).done;){var y=p.value,g=y.animation,w=y.channel;g.setTime(this.getTime(w))}}catch(b){u.e(b)}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=_f++;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)},yf(e)}();function nt(e){return nt=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},nt(e)}function Sn(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,Sf(n.key),n)}}function Of(e,t,r){return t&&Sn(e.prototype,t),r&&Sn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sf(e){var t=Pf(e,"string");return nt(t)==="symbol"?t:String(t)}function Pf(e,t){if(nt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(nt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Pn=function(){function e(r){xf(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],f=this.times[this.endIndex];this.factor=Math.min(Math.max(0,(n-a)/(f-a)),1)},Of(e)}();function Te(e){return Te=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},Te(e)}function xr(){"use strict";xr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,l){h[c]=l.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,l){return Object.defineProperty(h,c,{value:l,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(l,m,v){return l[m]=v}}function u(h,c,l,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:L(h,l,O)}),d}function p(h,c,l){try{return{type:"normal",arg:h.call(c,l)}}catch(m){return{type:"throw",arg:m}}}e.wrap=u;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,P=x&&x(x(N([])));P&&P!==t&&r.call(P,o)&&(_=P);var M=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(l){return this._invoke(c,l)})})}function T(h,c){function l(v,d,O,S){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,I=U.value;return I&&Te(I)=="object"&&r.call(I,"__await")?c.resolve(I.__await).then(function(G){l("next",G,O,S)},function(G){l("throw",G,O,S)}):c.resolve(I).then(function(G){U.value=G,O(U)},function(G){return l("throw",G,O,S)})}S(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function S(){return new c(function(A,U){l(d,O,A,U)})}return m=m?m.then(S,S):S()}})}function L(h,c,l){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(l.method=v,l.arg=d;;){var O=l.delegate;if(O){var S=R(O,l);if(S){if(S===y)continue;return S}}if(l.method==="next")l.sent=l._sent=l.arg;else if(l.method==="throw"){if(m==="suspendedStart")throw m="completed",l.arg;l.dispatchException(l.arg)}else l.method==="return"&&l.abrupt("return",l.arg);m="executing";var A=p(h,c,l);if(A.type==="normal"){if(m=l.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:l.done}}A.type==="throw"&&(m="completed",l.method="throw",l.arg=A.arg)}}}function R(h,c){var l=c.method,m=h.iterator[l];if(m===void 0)return c.delegate=null,l==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,R(h,c),c.method==="throw")||l!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+l+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function j(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(j,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var l=-1,m=function v(){for(;++l<h.length;)if(r.call(h,l))return v.value=h[l],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(M,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(M),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,l,m,v){v===void 0&&(v=Promise);var d=new T(u(h,c,l,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(M),s(M,f,"Generator"),s(M,o,function(){return this}),s(M,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),l=[];for(var m in c)l.push(m);return l.reverse(),function v(){for(;l.length;){var d=l.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var l in this)l.charAt(0)==="t"&&r.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var l=this;function m(U,I){return O.type="throw",O.arg=c,l.next=U,I&&(l.method="next",l.arg=void 0),!!I}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var S=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(S&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(S){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,l){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=l&&l<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=l,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,l){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&l&&(this.next=l),y},finish:function(c){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,l,m){return this.delegate={iterator:N(c),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function xn(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(u){r(u);return}f.done?t(s):Promise.resolve(s).then(n,i)}function Ef(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){xn(o,n,i,a,f,"next",s)}function f(s){xn(o,n,i,a,f,"throw",s)}a(void 0)})}}function En(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,Tf(n.key),n)}}function Af(e,t,r){return t&&En(e.prototype,t),r&&En(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tf(e){var t=Mf(e,"string");return Te(t)==="symbol"?t:String(t)}function Mf(e,t){if(Te(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Te(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var An=function(){function e(r){Rf(this,e)}var t=e.prototype;return t.onInitialize=function(){var r=Ef(xr().mark(function i(o){return xr().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.abrupt("return",null);case 1:case"end":return f.stop()}},i)}));function n(i){return r.apply(this,arguments)}return n}(),Af(e)}();function Er(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 J(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Er()}var Lf=globalThis.self||globalThis.window||globalThis.global,Me=globalThis.window||globalThis.self||globalThis.global,If=globalThis.document||{},_e=globalThis.process||{},jf=globalThis.console,Ed=globalThis.navigator||{};var Ft=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",Md=J();function Df(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Ut=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=Df(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 Tn(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 Mn(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 Gt(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,f=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),f]}var Bt;(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"})(Bt||(Bt={}));var Nf=10;function Rn(e){return typeof e!="string"?e:(e=e.toUpperCase(),Bt[e]||Bt.WHITE)}function Ln(e,t,r){if(!J&&typeof e=="string"){if(t){let n=Rn(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=Rn(r);e="\x1B[".concat(n+Nf,"m").concat(e,"\x1B[49m")}}return e}function In(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(f=>o===f)||(i[o]=a.bind(e)))}}function Re(e,t){if(!e)throw new Error(t||"Assertion failed")}function Oe(){let e;if(J()&&Me.performance){var t,r;e=Me===null||Me===void 0||(t=Me.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in _e){var n;let i=_e===null||_e===void 0||(n=_e.hrtime)===null||n===void 0?void 0:n.call(_e);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var Le={debug:J()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Cf={enabled:!0,level:0};function te(){}var jn={},Dn={once:!0},pe=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Ft,this._startTs=Oe(),this._deltaTs=Oe(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Ut("__probe-".concat(this.id,"__"),Cf),this.timeStamp("".concat(this.id," started")),In(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((Oe()-this._startTs).toPrecision(10))}getDelta(){return Number((Oe()-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){Re(t,r)}warn(t){return this._getLogFunction(0,t,Le.warn,arguments,Dn)}error(t){return this._getLogFunction(0,t,Le.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,Le.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Le.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Le.debug||Le.info,arguments,Dn)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||te,n&&[n],{tag:Bf(r)}):te}image(t){let{logLevel:r,priority:n,image:i,message:o="",scale:a=1}=t;return this._shouldLog(r||n)?J()?Gf({image:i,message:o,scale:a}):Uf({image:i,message:o,scale:a}):te}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||te)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=Nn({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||te)}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()>=Cn(t)}_getLogFunction(t,r,n,i,o){if(this._shouldLog(t)){o=Nn({logLevel:t,message:r,args:i,opts:o}),n=n||o.method,Re(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Oe();let a=o.tag||o.message;if(o.once&&a)if(!jn[a])jn[a]=Oe();else return te;return r=Ff(this.id,o.message,o),n.bind(console,r,...o.args)}return te}};pe.VERSION=Ft;function Cn(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 Re(Number.isFinite(t)&&t>=0),t}function Nn(e){let{logLevel:t,message:r}=e;e.logLevel=Cn(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 Re(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function Ff(e,t,r){if(typeof t=="string"){let n=r.time?Mn(Tn(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=Ln(t,r.color,r.background)}return t}function Uf(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),te}function Gf(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let a=Gt(o,r,n);console.log(...a)},o.src=t,te}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Gt(t,r,n)),te;if(i.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...Gt(o,r,n)),o.src=t.toDataURL(),te}return te}function Bf(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var ey=new pe({id:"@probe.gl/log"});var B=new pe({id:"luma.gl"});function it(){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 Se=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=it(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(it()-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 me=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 Se?i=t:i=new Se(r,n),this.stats[r]=i),i}};function ot(e){return ot=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},ot(e)}function Fn(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,kf(n.key),n)}}function zf(e,t,r){return t&&Fn(e.prototype,t),r&&Fn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function kf(e){var t=Vf(e,"string");return ot(t)==="symbol"?t:String(t)}function Vf(e,t){if(ot(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ot(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Kf=function(){function e(){Hf(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 me({id:n})),this.stats.get(n)},zf(e)}(),Ie=new Kf;function Wf(){var e=typeof __VERSION__<"u"?__VERSION__:"running from 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||(J()&&B.log(1,"".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:B,stats:Ie}),e}var Un=Wf();function qf(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)?e:null}function de(e){return Array.isArray(e)?e.length===0||typeof e[0]=="number"?e:null:qf(e)}var Ar={};function z(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Ar[e]=Ar[e]||1;var t=Ar[e]++;return"".concat(e,"-").concat(t)}function at(e){return at=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},at(e)}function Gn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Yf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gn(Object(r),!0).forEach(function(n){Xf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xf(e,t,r){return t=zn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bn(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,zn(n.key),n)}}function $f(e,t,r){return t&&Bn(e.prototype,t),r&&Bn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function zn(e){var t=Zf(e,"string");return at(t)==="symbol"?t:String(t)}function Zf(e,t){if(at(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(at(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Pe=function(){function e(r,n,i){if(Jf(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=Qf(n,i);var o=this.props.id!=="undefined"?this.props.id:z(this[Symbol.toStringTag]);this.props.id=o,this.id=o,this.userData=this.props.userData||{},this.addStats()}var 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()},$f(e)}();Pe.defaultProps={id:"undefined",handle:void 0,userData:void 0};function Qf(e,t){var r=Yf({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}function je(e){return je=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},je(e)}var Hn;function kn(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 Tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kn(Object(r),!0).forEach(function(n){ec(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ec(e,t,r){return t=Kn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vn(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,Kn(n.key),n)}}function rc(e,t,r){return t&&Vn(e.prototype,t),r&&Vn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kn(e){var t=nc(e,"string");return je(t)==="symbol"?t:String(t)}function nc(e,t){if(je(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(je(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ic(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&&Mr(e,t)}function Mr(e,t){return Mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Mr(e,t)}function oc(e){var t=fc();return function(){var n=zt(e),i;if(t){var o=zt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ac(this,i)}}function ac(e,t){if(t&&(je(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sc(e)}function sc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fc(){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 zt(e){return zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zt(e)}Hn=Symbol.toStringTag;var k=function(e){ic(r,e);var t=oc(r);function r(i,o){var a;tc(this,r);var f=Tr({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?f.indexType="uint32":o.data instanceof Uint16Array&&(f.indexType="uint16")),a=t.call(this,i,f,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.debugData=new ArrayBuffer(0),a.usage=o.usage||0,a.indexType=f.indexType,a}var n=r.prototype;return n.readSyncWebGL2=function(o,a){throw new Error("not implemented")},n._setDebugData=function(o,a,f){var s=ArrayBuffer.isView(o)?o.buffer:o,u=Math.min(o?o.byteLength:f,r.DEBUG_DATA_MAX_LENGTH);o===null?this.debugData=new ArrayBuffer(u):a===0&&f===o.byteLength?this.debugData=s.slice(0,u):this.debugData=s.slice(a,a+u)},rc(r,[{key:Hn,get:function(){return"Buffer"}}]),r}(Pe);k.defaultProps=Tr(Tr({},Pe.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});k.MAP_READ=1;k.MAP_WRITE=2;k.COPY_SRC=4;k.COPY_DST=8;k.INDEX=16;k.VERTEX=32;k.UNIFORM=64;k.STORAGE=128;k.INDIRECT=256;k.QUERY_RESOLVE=512;k.DEBUG_DATA_MAX_LENGTH=32;function st(e){return st=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},st(e)}var Yn;function Wn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Rr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wn(Object(r),!0).forEach(function(n){cc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cc(e,t,r){return t=Xn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qn(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,Xn(n.key),n)}}function lc(e,t,r){return t&&qn(e.prototype,t),r&&qn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xn(e){var t=hc(e,"string");return st(t)==="symbol"?t:String(t)}function hc(e,t){if(st(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(st(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}Yn=Symbol.toStringTag;var ft=function(){function e(r){uc(this,e),this.id=void 0,this.statsManager=Ie,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Rr(Rr({},e.defaultProps),r),this.id=this.props.id||z(this[Symbol.toStringTag].toLowerCase())}var t=e.prototype;return t.loseDevice=function(){return!1},t.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},t.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},t.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},t._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var i=Rr({},n);return(n.usage||0)&k.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?i.indexType="uint32":n.data instanceof Uint16Array?i.indexType="uint16":B.warn("indices buffer content must be of integer type")()),i},lc(e,[{key:Yn,get:function(){return"Device"}}]),e}();ft.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(B.get("debug")),break:[],gl:null};ft.VERSION=Un;function W(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}function De(e){return De=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},De(e)}function Lr(){"use strict";Lr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,l){h[c]=l.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,l){return Object.defineProperty(h,c,{value:l,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(l,m,v){return l[m]=v}}function u(h,c,l,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:L(h,l,O)}),d}function p(h,c,l){try{return{type:"normal",arg:h.call(c,l)}}catch(m){return{type:"throw",arg:m}}}e.wrap=u;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,P=x&&x(x(N([])));P&&P!==t&&r.call(P,o)&&(_=P);var M=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(l){return this._invoke(c,l)})})}function T(h,c){function l(v,d,O,S){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,I=U.value;return I&&De(I)=="object"&&r.call(I,"__await")?c.resolve(I.__await).then(function(G){l("next",G,O,S)},function(G){l("throw",G,O,S)}):c.resolve(I).then(function(G){U.value=G,O(U)},function(G){return l("throw",G,O,S)})}S(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function S(){return new c(function(A,U){l(d,O,A,U)})}return m=m?m.then(S,S):S()}})}function L(h,c,l){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(l.method=v,l.arg=d;;){var O=l.delegate;if(O){var S=R(O,l);if(S){if(S===y)continue;return S}}if(l.method==="next")l.sent=l._sent=l.arg;else if(l.method==="throw"){if(m==="suspendedStart")throw m="completed",l.arg;l.dispatchException(l.arg)}else l.method==="return"&&l.abrupt("return",l.arg);m="executing";var A=p(h,c,l);if(A.type==="normal"){if(m=l.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:l.done}}A.type==="throw"&&(m="completed",l.method="throw",l.arg=A.arg)}}}function R(h,c){var l=c.method,m=h.iterator[l];if(m===void 0)return c.delegate=null,l==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,R(h,c),c.method==="throw")||l!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+l+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function j(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(j,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var l=-1,m=function v(){for(;++l<h.length;)if(r.call(h,l))return v.value=h[l],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(M,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(M),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,l,m,v){v===void 0&&(v=Promise);var d=new T(u(h,c,l,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(M),s(M,f,"Generator"),s(M,o,function(){return this}),s(M,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),l=[];for(var m in c)l.push(m);return l.reverse(),function v(){for(;l.length;){var d=l.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var l in this)l.charAt(0)==="t"&&r.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var l=this;function m(U,I){return O.type="throw",O.arg=c,l.next=U,I&&(l.method="next",l.arg=void 0),!!I}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var S=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(S&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(S){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,l){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=l&&l<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=l,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,l){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&l&&(this.next=l),y},finish:function(c){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,l,m){return this.delegate={iterator:N(c),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function $n(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 Zn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$n(Object(r),!0).forEach(function(n){pc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$n(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pc(e,t,r){return t=ti(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jn(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(u){r(u);return}f.done?t(s):Promise.resolve(s).then(n,i)}function mc(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){Jn(o,n,i,a,f,"next",s)}function f(s){Jn(o,n,i,a,f,"throw",s)}a(void 0)})}}function dc(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=yc(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,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function yc(e,t){if(e){if(typeof e=="string")return Qn(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 Qn(e,t)}}function Qn(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 ei(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,ti(n.key),n)}}function vc(e,t,r){return t&&ei(e.prototype,t),r&&ei(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ti(e){var t=gc(e,"string");return De(t)==="symbol"?t:String(t)}function gc(e,t){if(De(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(De(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var xe=new Map,Ee=function(){function e(){bc(this,e)}return e.registerDevices=function(r){var n=dc(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;W(o.type&&o.isSupported&&o.create),xe.set(o.type,o)}}catch(a){n.e(a)}finally{n.f()}},e.getAvailableDevices=function(){return Array.from(xe).map(function(r){return r.type})},e.getSupportedDevices=function(){return Array.from(xe).filter(function(r){return r.isSupported()}).map(function(r){return r.type})},e.setDefaultDeviceProps=function(r){Object.assign(ft.defaultProps,r)},e.createDevice=function(){var t=mc(Lr().mark(function n(){var i,o,a=arguments;return Lr().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:i=a.length>0&&a[0]!==void 0?a[0]:{},i=Zn(Zn({},ft.defaultProps),i),i.gl&&(i.type="webgl"),s.t0=i.type,s.next=s.t0==="webgpu"?6:s.t0==="webgl"||s.t0==="webgl1"||s.t0==="webgl2"?12:s.t0==="best-available"?18:29;break;case 6:if(o=xe.get("webgpu"),!o){s.next=11;break}return s.next=10,o.create(i);case 10:return s.abrupt("return",s.sent);case 11:return s.abrupt("break",29);case 12:if(o=xe.get("webgl"),!o){s.next=17;break}return s.next=16,o.create(i);case 16:return s.abrupt("return",s.sent);case 17:return s.abrupt("break",29);case 18:if(o=xe.get("webgpu"),!(o&&o.isSupported())){s.next=23;break}return s.next=22,o.create(i);case 22:return s.abrupt("return",s.sent);case 23:if(o=xe.get("webgl"),!(o&&o.isSupported())){s.next=28;break}return s.next=27,o.create(i);case 27:return s.abrupt("return",s.sent);case 28:return s.abrupt("break",29);case 29:throw new Error("No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.");case 30:case"end":return s.stop()}},n)}));function r(){return t.apply(this,arguments)}return r}(),vc(e)}();Ee.stats=Ie;Ee.log=B;function Ne(e){return Ne=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},Ne(e)}var oi;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 ni(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){wc(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}function wc(e,t,r){return t=ai(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ii(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,ai(n.key),n)}}function Oc(e,t,r){return t&&ii(e.prototype,t),r&&ii(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ai(e){var t=Sc(e,"string");return Ne(t)==="symbol"?t:String(t)}function Sc(e,t){if(Ne(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ne(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pc(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&&Ir(e,t)}function Ir(e,t){return Ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ir(e,t)}function xc(e){var t=Tc();return function(){var n=kt(e),i;if(t){var o=kt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ec(this,i)}}function Ec(e,t){if(t&&(Ne(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ac(e)}function Ac(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function kt(e){return kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},kt(e)}oi=Symbol.toStringTag;var Ce=function(e){Pc(r,e);var t=xc(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.shaderLayout=void 0,o.bufferLayout=void 0,o.shaderLayout=o.props.shaderLayout,o.bufferLayout=o.props.bufferLayout||[],o}return Oc(r,[{key:oi,get:function(){return"RenderPipeline"}}]),r}(Pe);Ce.defaultProps=ni(ni({},Pe.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});function Mc(e,t){return jc(e)||Ic(e,t)||Lc(e,t)||Rc()}function Rc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lc(e,t){if(e){if(typeof e=="string")return si(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 si(e,t)}}function si(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 Ic(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function jc(e){if(Array.isArray(e))return e}function fi(e){var t=Mc(Nc[e],2),r=t[0],n=t[1],i=r==="i32"||r==="u32",o=r!=="u32",a=Cc[r]*n,f=Dc(r,n);return{dataType:r,components:n,defaultVertexFormat:f,byteLength:a,integer:i,signed:o}}function Dc(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 Nc={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]},Cc={f32:4,f16:2,i32:4,u32:4};function ui(e){var t=ci[e],r=Fc(t),n=e.includes("norm"),i=!n&&!e.startsWith("float"),o=e.startsWith("s");return{dataType:ci[e],byteLength:r,integer:i,signed:o,normalized:n}}function Fc(e){var t=Uc[e];return t}var ci={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},Uc={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Gc(e,t){return Vc(e)||kc(e,t)||zc(e,t)||Bc()}function Bc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zc(e,t){if(e){if(typeof e=="string")return li(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 li(e,t)}}function li(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 kc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function Vc(e){if(Array.isArray(e))return e}function jr(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=Gc(r,2),i=n[0],o=n[1],a=i,f=o?parseInt(o):1,s=ui(a),u={type:a,components:f,byteLength:s.byteLength*f,integer:s.integer,signed:s.signed,normalized:s.normalized};return t&&(u.webglOnly=!0),u}function ct(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Hc(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.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Hc(e,t){if(e){if(typeof e=="string")return hi(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 hi(e,t)}}function hi(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 Dr(e,t){var r={},n=ct(e.attributes),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;r[o.name]=Kc(e,t,o.name)}}catch(a){n.e(a)}finally{n.f()}return r}function Kc(e,t,r){var n=Wc(e,r),i=qc(t,r);if(!n)return null;var o=fi(n.type),a=i?.vertexFormat||o.defaultVertexFormat,f=jr(a);return{attributeName:i?.attributeName||n.name,bufferName:i?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:a,bufferDataType:f.type,bufferComponents:f.components,normalized:f.normalized,integer:o.integer,stepMode:i?.stepMode||n.stepMode,byteOffset:i?.byteOffset||0,byteStride:i?.byteStride||0}}function Wc(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||B.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function qc(e,t){Yc(e);var r=Xc(e,t);return r||(r=$c(e,t),r)?r:(B.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function Yc(e){var t=ct(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&B.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(i){t.e(i)}finally{t.f()}}function Xc(e,t){var r=ct(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 $c(e,t){var r=ct(e),n;try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=o.byteStride;if(typeof o.byteStride!="number"){var f=ct(o.attributes||[]),s;try{for(f.s();!(s=f.n()).done;){var u=s.value,p=jr(u.format);a+=p.byteLength}}catch(g){f.e(g)}finally{f.f()}}var y=(i=o.attributes)===null||i===void 0?void 0:i.find(function(g){return g.attribute===t});if(y)return{attributeName:y.attribute,bufferName:o.name,stepMode:o.stepMode,vertexFormat:y.format,byteOffset:y.byteOffset,byteStride:a}}}catch(g){r.e(g)}finally{r.f()}return null}var Zc={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 pi(e){var t=Zc[e];return W(e),t}function mi(e,t){switch(t){case 1:return e;case 2:return e+e%2;default:return e+(4-e%4)%4}}var Vt;function di(e){return(!Vt||Vt.byteLength<e)&&(Vt=new ArrayBuffer(e)),Vt}function ut(e){return ut=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},ut(e)}function yi(e,t){return tu(e)||eu(e,t)||Qc(e,t)||Jc()}function Jc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qc(e,t){if(e){if(typeof e=="string")return vi(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 vi(e,t)}}function vi(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 eu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function tu(e){if(Array.isArray(e))return e}function gi(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,nu(n.key),n)}}function ru(e,t,r){return t&&gi(e.prototype,t),r&&gi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function nu(e){var t=iu(e,"string");return ut(t)==="symbol"?t:String(t)}function iu(e,t){if(ut(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ut(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ou(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var bi=1024,wi=function(){function e(r){ou(this,e),this.layout={},this.byteLength=void 0;for(var n=0,i=0,o=Object.entries(r);i<o.length;i++){var a=yi(o[i],2),f=a[0],s=a[1],u=pi(s),p=u.type,y=u.components;n=mi(n,y);var g=n;n+=y,this.layout[f]={type:p,size:y,offset:g}}n+=(4-n%4)%4;var w=n*4;this.byteLength=Math.max(w,bi)}var t=e.prototype;return t.getData=function(n){for(var i=Math.max(this.byteLength,bi),o=di(i),a={i32:new Int32Array(o),u32:new Uint32Array(o),f32:new Float32Array(o),f16:new Uint16Array(o)},f=0,s=Object.entries(n);f<s.length;f++){var u=yi(s[f],2),p=u[0],y=u[1],g=this.layout[p];if(!g){B.warn("Supplied uniform value ".concat(p," not present in uniform block layout"))();continue}var w=g.type,b=g.size,_=g.offset,x=a[w];if(b===1){if(typeof y!="number"&&typeof y!="boolean"){B.warn("Supplied value for single component uniform ".concat(p," is not a number: ").concat(y))();continue}x[_]=Number(y)}else{var P=de(y);if(!P){B.warn("Supplied value for multi component / array uniform ".concat(p," is not a numeric array: ").concat(y))();continue}x.set(P,_)}}return new Uint8Array(o)},t.has=function(n){return Boolean(this.layout[n])},t.get=function(n){var i=this.layout[n];return i},ru(e)}();function _i(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16;if(e!==t)return!1;var n=de(e);if(!n)return!1;var i=de(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 Oi(e){var t=de(e);return t?t.slice():e}function lt(e){return lt=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},lt(e)}function au(e,t){return cu(e)||fu(e,t)||xi(e,t)||su()}function su(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
15
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function cu(e){if(Array.isArray(e))return e}function uu(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=xi(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.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function xi(e,t){if(e){if(typeof e=="string")return Si(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 Si(e,t)}}function Si(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 Pi(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,hu(n.key),n)}}function lu(e,t,r){return t&&Pi(e.prototype,t),r&&Pi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hu(e){var t=pu(e,"string");return lt(t)==="symbol"?t:String(t)}function pu(e,t){if(lt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(lt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ei=function(){function e(r){if(mu(this,e),this.name=void 0,this.uniforms={},this.modifiedUniforms={},this.modified=!0,this.bindingLayout={},this.needsRedraw="initialized",this.name=r?.name,r!=null&&r.name&&r!==null&&r!==void 0&&r.shaderLayout){var n,i=r==null||(n=r.shaderLayout.bindings)===null||n===void 0?void 0:n.find(function(u){return u.type==="uniform"&&u.name===r?.name});if(!i)throw new Error(r?.name);var o=i,a=uu(o.uniforms||[]),f;try{for(a.s();!(f=a.n()).done;){var s=f.value;this.bindingLayout[s.name]=s}}catch(u){a.e(u)}finally{a.f()}}}var t=e.prototype;return t.setUniforms=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=au(o[i],2),f=a[0],s=a[1];this._setUniform(f,s),this.needsRedraw||this.setNeedsRedraw("".concat(this.name,".").concat(f,"=").concat(s))}},t.setNeedsRedraw=function(n){this.needsRedraw=this.needsRedraw||n},t.getAllUniforms=function(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}},t._setUniform=function(n,i){_i(this.uniforms[n],i)||(this.uniforms[n]=Oi(i),this.modifiedUniforms[n]=!0,this.modified=!0)},lu(e)}();function ht(e){return ht=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},ht(e)}function du(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ri(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.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Ai(e,t){return gu(e)||vu(e,t)||Ri(e,t)||yu()}function yu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ri(e,t){if(e){if(typeof e=="string")return Ti(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 Ti(e,t)}}function Ti(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 vu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function gu(e){if(Array.isArray(e))return e}function Mi(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,wu(n.key),n)}}function bu(e,t,r){return t&&Mi(e.prototype,t),r&&Mi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wu(e){var t=_u(e,"string");return ht(t)==="symbol"?t:String(t)}function _u(e,t){if(ht(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ht(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ou(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Nr=function(){function e(r){Ou(this,e),this.uniformBlocks=new Map,this.uniformBufferLayouts=new Map,this.uniformBuffers=new Map;for(var n=0,i=Object.entries(r);n<i.length;n++){var o=Ai(i[n],2),a=o[0],f=o[1],s=a,u=new wi(f.uniformTypes||{});this.uniformBufferLayouts.set(s,u);var p=new Ei({name:a});p.setUniforms(f.defaultUniforms||{}),this.uniformBlocks.set(s,p)}}var t=e.prototype;return t.destroy=function(){for(var n=0,i=Object.values(this.uniformBuffers);n<i.length;n++){var o=i[n];o.destroy()}},t.setUniforms=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=Ai(o[i],2),f=a[0],s=a[1];this.uniformBlocks.get(f).setUniforms(s)}this.updateUniformBuffers()},t.getUniformBufferByteLength=function(n){return this.uniformBufferLayouts.get(n).byteLength},t.getUniformBufferData=function(n){var i=this.uniformBlocks.get(n).getAllUniforms();return this.uniformBufferLayouts.get(n).getData(i)},t.createUniformBuffer=function(n,i,o){o&&this.setUniforms(o);var a=this.getUniformBufferByteLength(i),f=n.createBuffer({usage:k.UNIFORM,byteLength:a}),s=this.getUniformBufferData(i);return f.write(s),f},t.getManagedUniformBuffer=function(n,i){if(!this.uniformBuffers.get(i)){var o=this.getUniformBufferByteLength(i),a=n.createBuffer({usage:k.UNIFORM,byteLength:o});this.uniformBuffers.set(i,a)}return this.uniformBuffers.get(i)},t.updateUniformBuffers=function(){var n=!1,i=du(this.uniformBlocks.keys()),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,f=this.updateUniformBuffer(a);n||(n=f)}}catch(s){i.e(s)}finally{i.f()}return n&&B.log(3,"UniformStore.updateUniformBuffers(): ".concat(n))(),n},t.updateUniformBuffer=function(n){var i=this.uniformBlocks.get(n),o=this.uniformBuffers.get(n),a=!1;if(o&&i.needsRedraw){a||(a=i.needsRedraw);var f=this.getUniformBufferData(n),s=this.uniformBuffers.get(n);s.write(f);var u=this.uniformBlocks.get(n).getAllUniforms();B.log(4,"Writing to uniform buffer ".concat(String(n)),f,u)()}return a},bu(e)}();function Li(e){var t=ArrayBuffer.isView(e)?e.constructor:e;switch(t){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(t.constructor.name)}}function Cr(e){switch(e){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(e)}}function Fr(e,t,r){if(!t||t>4)throw new Error("size ".concat(t));var n=t,i=Li(e);if(i==="uint8"||i==="sint8"){if(n===1||n===3)throw new Error("size: ".concat(t));return r&&(i=i.replace("int","norm")),"".concat(i,"x").concat(n)}if(i==="uint16"||i==="sint16"){if(n===1||n===3)throw new Error("size: ".concat(t));return r&&(i=i.replace("int","norm")),"".concat(i,"x").concat(n)}return n===1?i:"".concat(i,"x").concat(n)}function Ii(e){return de(e)!==null||typeof e=="number"||typeof e=="boolean"}function Ur(e){var t={bindings:{},uniforms:{}};return Object.keys(e).forEach(function(r){var n=e[r];Ii(n)?t.uniforms[r]=n:t.bindings[r]=n}),t}function Ht(e){return Ht=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},Ht(e)}function pt(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(!pt(e[n],t[n],r-1))return!1;return!0}if(Array.isArray(t))return!1;if(Ht(e)==="object"&&Ht(t)==="object"){var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var a=0,f=i;a<f.length;a++){var s=f[a];if(!t.hasOwnProperty(s)||!pt(e[s],t[s],r-1))return!1}return!0}return!1}function Gr(e){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60)}function Br(e){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e)}var ji=function(t){return"".concat(t)};function Fe(e){return Fe=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},Fe(e)}function Su(e,t){return Au(e)||Eu(e,t)||xu(e,t)||Pu()}function Pu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xu(e,t){if(e){if(typeof e=="string")return Di(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 Di(e,t)}}function Di(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 Eu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function Au(e){if(Array.isArray(e))return e}function Ni(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 Ci(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ni(Object(r),!0).forEach(function(n){Tu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ni(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tu(e,t,r){return t=Gi(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fi(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,Gi(n.key),n)}}function Mu(e,t,r){return t&&Fi(e.prototype,t),r&&Fi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gi(e){var t=Ru(e,"string");return Fe(t)==="symbol"?t:String(t)}function Ru(e,t){if(Fe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Fe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fe(){"use strict";fe=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,l){h[c]=l.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,l){return Object.defineProperty(h,c,{value:l,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(l,m,v){return l[m]=v}}function u(h,c,l,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:L(h,l,O)}),d}function p(h,c,l){try{return{type:"normal",arg:h.call(c,l)}}catch(m){return{type:"throw",arg:m}}}e.wrap=u;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,P=x&&x(x(N([])));P&&P!==t&&r.call(P,o)&&(_=P);var M=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(l){return this._invoke(c,l)})})}function T(h,c){function l(v,d,O,S){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,I=U.value;return I&&Fe(I)=="object"&&r.call(I,"__await")?c.resolve(I.__await).then(function(G){l("next",G,O,S)},function(G){l("throw",G,O,S)}):c.resolve(I).then(function(G){U.value=G,O(U)},function(G){return l("throw",G,O,S)})}S(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function S(){return new c(function(A,U){l(d,O,A,U)})}return m=m?m.then(S,S):S()}})}function L(h,c,l){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(l.method=v,l.arg=d;;){var O=l.delegate;if(O){var S=R(O,l);if(S){if(S===y)continue;return S}}if(l.method==="next")l.sent=l._sent=l.arg;else if(l.method==="throw"){if(m==="suspendedStart")throw m="completed",l.arg;l.dispatchException(l.arg)}else l.method==="return"&&l.abrupt("return",l.arg);m="executing";var A=p(h,c,l);if(A.type==="normal"){if(m=l.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:l.done}}A.type==="throw"&&(m="completed",l.method="throw",l.arg=A.arg)}}}function R(h,c){var l=c.method,m=h.iterator[l];if(m===void 0)return c.delegate=null,l==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,R(h,c),c.method==="throw")||l!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+l+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function j(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(j,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var l=-1,m=function v(){for(;++l<h.length;)if(r.call(h,l))return v.value=h[l],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(M,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(M),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,l,m,v){v===void 0&&(v=Promise);var d=new T(u(h,c,l,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(M),s(M,f,"Generator"),s(M,o,function(){return this}),s(M,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),l=[];for(var m in c)l.push(m);return l.reverse(),function v(){for(;l.length;){var d=l.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var l in this)l.charAt(0)==="t"&&r.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var l=this;function m(U,I){return O.type="throw",O.arg=c,l.next=U,I&&(l.method="next",l.arg=void 0),!!I}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var S=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(S&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(S){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,l){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=l&&l<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=l,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,l){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&l&&(this.next=l),y},finish:function(c){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,l,m){return this.delegate={iterator:N(c),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function Ui(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(u){r(u);return}f.done?t(s):Promise.resolve(s).then(n,i)}function Kt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){Ui(o,n,i,a,f,"next",s)}function f(s){Ui(o,n,i,a,f,"throw",s)}a(void 0)})}}var Iu=0,ju={device:null,onAddHTML:function(){return""},onInitialize:function(){var e=Kt(fe().mark(function r(){return fe().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:Ee.stats.get("animation-loop-".concat(Iu++)),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1},Wt=function(){function e(r){if(Lu(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=Ci(Ci({},ju),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 me({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=Kt(fe().mark(function i(){var o,a;return fe().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this._running){s.next=2;break}return s.abrupt("return",this);case 2:if(this._running=!0,s.prev=3,this._initialized){s.next=11;break}return this._initialized=!0,s.next=8,this._initDevice();case 8:return this._initialize(),s.next=11,this.props.onInitialize(this._getAnimationProps());case 11:if(this._running){s.next=13;break}return s.abrupt("return",null);case 13:return o!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),s.abrupt("return",this);case 17:throw s.prev=17,s.t0=s.catch(3),a=s.t0 instanceof Error?s.t0:new Error("Unknown error"),this.props.onError(a),a;case 22:case"end":return s.stop()}},i,this,[[3,17]])}));function n(){return r.apply(this,arguments)}return n}(),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=Kt(fe().mark(function i(){return fe().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=Gr(this._animationFrame.bind(this)))},t._cancelAnimationFrame=function(){this._animationFrameId!==null&&(Br(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,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=Kt(fe().mark(function i(){var o;return fe().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.props.device;case 2:if(this.device=f.sent,this.device){f.next=5;break}throw new Error("No device provided");case 5:this.canvas=((o=this.device.canvasContext)===null||o===void 0?void 0:o.canvas)||null;case 6:case"end":return f.stop()}},i,this)}));function n(){return r.apply(this,arguments)}return n}(),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=Su(o,2),f=a[0],s=a[1],u=1,p=(i=this.device)===null||i===void 0||(i=i.canvasContext)===null||i===void 0?void 0:i.canvas;return p&&p.clientHeight?u=p.clientWidth/p.clientHeight:f>0&&s>0&&(u=f/s),{width:f,height:s,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._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},Mu(e)}();function Ue(e){return Ue=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},Ue(e)}function zr(){"use strict";zr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(h,c,l){h[c]=l.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",f=i.toStringTag||"@@toStringTag";function s(h,c,l){return Object.defineProperty(h,c,{value:l,enumerable:!0,configurable:!0,writable:!0}),h[c]}try{s({},"")}catch{s=function(l,m,v){return l[m]=v}}function u(h,c,l,m){var v=c&&c.prototype instanceof g?c:g,d=Object.create(v.prototype),O=new F(m||[]);return n(d,"_invoke",{value:L(h,l,O)}),d}function p(h,c,l){try{return{type:"normal",arg:h.call(c,l)}}catch(m){return{type:"throw",arg:m}}}e.wrap=u;var y={};function g(){}function w(){}function b(){}var _={};s(_,o,function(){return this});var x=Object.getPrototypeOf,P=x&&x(x(N([])));P&&P!==t&&r.call(P,o)&&(_=P);var M=b.prototype=g.prototype=Object.create(_);function E(h){["next","throw","return"].forEach(function(c){s(h,c,function(l){return this._invoke(c,l)})})}function T(h,c){function l(v,d,O,S){var A=p(h[v],h,d);if(A.type!=="throw"){var U=A.arg,I=U.value;return I&&Ue(I)=="object"&&r.call(I,"__await")?c.resolve(I.__await).then(function(G){l("next",G,O,S)},function(G){l("throw",G,O,S)}):c.resolve(I).then(function(G){U.value=G,O(U)},function(G){return l("throw",G,O,S)})}S(A.arg)}var m;n(this,"_invoke",{value:function(d,O){function S(){return new c(function(A,U){l(d,O,A,U)})}return m=m?m.then(S,S):S()}})}function L(h,c,l){var m="suspendedStart";return function(v,d){if(m==="executing")throw new Error("Generator is already running");if(m==="completed"){if(v==="throw")throw d;return C()}for(l.method=v,l.arg=d;;){var O=l.delegate;if(O){var S=R(O,l);if(S){if(S===y)continue;return S}}if(l.method==="next")l.sent=l._sent=l.arg;else if(l.method==="throw"){if(m==="suspendedStart")throw m="completed",l.arg;l.dispatchException(l.arg)}else l.method==="return"&&l.abrupt("return",l.arg);m="executing";var A=p(h,c,l);if(A.type==="normal"){if(m=l.done?"completed":"suspendedYield",A.arg===y)continue;return{value:A.arg,done:l.done}}A.type==="throw"&&(m="completed",l.method="throw",l.arg=A.arg)}}}function R(h,c){var l=c.method,m=h.iterator[l];if(m===void 0)return c.delegate=null,l==="throw"&&h.iterator.return&&(c.method="return",c.arg=void 0,R(h,c),c.method==="throw")||l!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+l+"' method")),y;var v=p(m,h.iterator,c.arg);if(v.type==="throw")return c.method="throw",c.arg=v.arg,c.delegate=null,y;var d=v.arg;return d?d.done?(c[h.resultName]=d.value,c.next=h.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,y):d:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,y)}function j(h){var c={tryLoc:h[0]};1 in h&&(c.catchLoc=h[1]),2 in h&&(c.finallyLoc=h[2],c.afterLoc=h[3]),this.tryEntries.push(c)}function D(h){var c=h.completion||{};c.type="normal",delete c.arg,h.completion=c}function F(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(j,this),this.reset(!0)}function N(h){if(h){var c=h[o];if(c)return c.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var l=-1,m=function v(){for(;++l<h.length;)if(r.call(h,l))return v.value=h[l],v.done=!1,v;return v.value=void 0,v.done=!0,v};return m.next=m}}return{next:C}}function C(){return{value:void 0,done:!0}}return w.prototype=b,n(M,"constructor",{value:b,configurable:!0}),n(b,"constructor",{value:w,configurable:!0}),w.displayName=s(b,f,"GeneratorFunction"),e.isGeneratorFunction=function(h){var c=typeof h=="function"&&h.constructor;return!!c&&(c===w||(c.displayName||c.name)==="GeneratorFunction")},e.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,b):(h.__proto__=b,s(h,f,"GeneratorFunction")),h.prototype=Object.create(M),h},e.awrap=function(h){return{__await:h}},E(T.prototype),s(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(h,c,l,m,v){v===void 0&&(v=Promise);var d=new T(u(h,c,l,m),v);return e.isGeneratorFunction(c)?d:d.next().then(function(O){return O.done?O.value:d.next()})},E(M),s(M,f,"Generator"),s(M,o,function(){return this}),s(M,"toString",function(){return"[object Generator]"}),e.keys=function(h){var c=Object(h),l=[];for(var m in c)l.push(m);return l.reverse(),function v(){for(;l.length;){var d=l.pop();if(d in c)return v.value=d,v.done=!1,v}return v.done=!0,v}},e.values=N,F.prototype={constructor:F,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!c)for(var l in this)l.charAt(0)==="t"&&r.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var l=this;function m(U,I){return O.type="throw",O.arg=c,l.next=U,I&&(l.method="next",l.arg=void 0),!!I}for(var v=this.tryEntries.length-1;v>=0;--v){var d=this.tryEntries[v],O=d.completion;if(d.tryLoc==="root")return m("end");if(d.tryLoc<=this.prev){var S=r.call(d,"catchLoc"),A=r.call(d,"finallyLoc");if(S&&A){if(this.prev<d.catchLoc)return m(d.catchLoc,!0);if(this.prev<d.finallyLoc)return m(d.finallyLoc)}else if(S){if(this.prev<d.catchLoc)return m(d.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<d.finallyLoc)return m(d.finallyLoc)}}}},abrupt:function(c,l){for(var m=this.tryEntries.length-1;m>=0;--m){var v=this.tryEntries[m];if(v.tryLoc<=this.prev&&r.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var d=v;break}}d&&(c==="break"||c==="continue")&&d.tryLoc<=l&&l<=d.finallyLoc&&(d=null);var O=d?d.completion:{};return O.type=c,O.arg=l,d?(this.method="next",this.next=d.finallyLoc,y):this.complete(O)},complete:function(c,l){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&l&&(this.next=l),y},finish:function(c){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.finallyLoc===c)return this.complete(m.completion,m.afterLoc),D(m),y}},catch:function(c){for(var l=this.tryEntries.length-1;l>=0;--l){var m=this.tryEntries[l];if(m.tryLoc===c){var v=m.completion;if(v.type==="throw"){var d=v.arg;D(m)}return d}}throw new Error("illegal catch attempt")},delegateYield:function(c,l,m){return this.delegate={iterator:N(c),resultName:l,nextLoc:m},this.method==="next"&&(this.arg=void 0),y}},e}function Bi(e,t,r,n,i,o,a){try{var f=e[o](a),s=f.value}catch(u){r(u);return}f.done?t(s):Promise.resolve(s).then(n,i)}function Du(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var o=e.apply(t,r);function a(s){Bi(o,n,i,a,f,"next",s)}function f(s){Bi(o,n,i,a,f,"throw",s)}a(void 0)})}}function zi(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 ki(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zi(Object(r),!0).forEach(function(n){Nu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Nu(e,t,r){return t=Cu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cu(e){var t=Fu(e,"string");return Ue(t)==="symbol"?t:String(t)}function Fu(e,t){if(Ue(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ue(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vi(e,t){var r=this,n=null,i=t?.device||Ee.createDevice(),o=new Wt(ki(ki({},t),{},{device:i,onInitialize:function(f){return Du(zr().mark(function s(){var u;return zr().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return n=new e(f),y.next=3,(u=n)===null||u===void 0?void 0:u.onInitialize(f);case 3:return y.abrupt("return",y.sent);case 4:case"end":return y.stop()}},s)}))()},onRender:function(f){var s;return(s=n)===null||s===void 0?void 0:s.onRender(f)},onFinalize:function(f){var s;return(s=n)===null||s===void 0?void 0:s.onFinalize(f)}}));return o.getInfo=function(){return r.AnimationLoopTemplateCtor.info},o}var K=function(t){return"".concat(t)};function ie(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}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 ye(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){Uu(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}function Uu(e,t,r){return t=Gu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gu(e){var t=Bu(e,"string");return ve(t)==="symbol"?t:String(t)}function Bu(e,t){if(ve(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ve(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qi(e,t){return Hu(e)||Vu(e,t)||ku(e,t)||zu()}function zu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
20
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ku(e,t){if(e){if(typeof e=="string")return Ki(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ki(e,t)}}function Ki(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Vu(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function Hu(e){if(Array.isArray(e))return e}function ve(e){return ve=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},ve(e)}var kr={number:{type:"number",validate:function(t,r){return Number.isFinite(t)&&ve(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 Yi(e){for(var t={},r=0,n=Object.entries(e);r<n.length;r++){var i=qi(n[r],2),o=i[0],a=i[1];t[o]=Ku(a)}return t}function Xi(e,t,r){for(var n={},i=0,o=Object.entries(t);i<o.length;i++){var a=qi(o[i],2),f=a[0],s=a[1];e&&f in e&&!s.private?(s.validate&&ie(s.validate(e[f],s),"".concat(r,": invalid ").concat(f)),n[f]=e[f]):n[f]=s.value}return n}function Ku(e){var t=Wi(e);if(t!=="object")return ye(ye({value:e},kr[t]),{},{type:t});if(ve(e)==="object")return e?e.type!==void 0?ye(ye(ye({},e),kr[e.type]),{},{type:e.type}):e.value===void 0?{type:"object",value:e}:(t=Wi(e.value),ye(ye(ye({},e),kr[t]),{},{type:t})):{type:"object",value:null};throw new Error("props")}function Wi(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":ve(e)}var $i,Zi;function Ji(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Qi=K($i||($i=Ji([`#ifdef MODULE_LOGDEPTH
22
21
  logdepth_adjustPosition(gl_Position);
23
22
  #endif
24
23
  `],[`\\
25
24
  #ifdef MODULE_LOGDEPTH
26
25
  logdepth_adjustPosition(gl_Position);
27
26
  #endif
28
- `]))),to=K(Ji||(Ji=Qi([`#ifdef MODULE_MATERIAL
27
+ `]))),eo=K(Zi||(Zi=Ji([`#ifdef MODULE_MATERIAL
29
28
  gl_FragColor = material_filterColor(gl_FragColor);
30
29
  #endif
31
30
 
@@ -66,15 +65,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
66
65
  #ifdef MODULE_LOGDEPTH
67
66
  logdepth_setFragDepth();
68
67
  #endif
69
- `])));var qu={vertex:eo,fragment:to},ro=/void\s+main\s*\([^)]*\)\s*\{\n?/,no=/}\n?[^{}]*$/,zr=[],mt="__LUMA_INJECT_DECLARATIONS__";function io(e){var t={vertex:{},fragment:{}};for(var r in e){var n=e[r],i=Yu(r);typeof n=="string"&&(n={order:0,injection:n}),t[i][r]=n}return t}function Yu(e){var t=e.slice(0,2);switch(t){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(t)}}function dt(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=t==="vertex",o=function(){var s=r[a];s.sort(function(g,w){return g.order-w.order}),zr.length=s.length;for(var l=0,p=s.length;l<p;++l)zr[l]=s[l].injection;var y="".concat(zr.join(`
68
+ `])));var Wu={vertex:Qi,fragment:eo},to=/void\s+main\s*\([^)]*\)\s*\{\n?/,ro=/}\n?[^{}]*$/,Vr=[],mt="__LUMA_INJECT_DECLARATIONS__";function no(e){var t={vertex:{},fragment:{}};for(var r in e){var n=e[r],i=qu(r);typeof n=="string"&&(n={order:0,injection:n}),t[i][r]=n}return t}function qu(e){var t=e.slice(0,2);switch(t){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(t)}}function dt(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=t==="vertex",o=function(){var s=r[a];s.sort(function(g,w){return g.order-w.order}),Vr.length=s.length;for(var u=0,p=s.length;u<p;++u)Vr[u]=s[u].injection;var y="".concat(Vr.join(`
70
69
  `),`
71
- `);switch(a){case"vs:#decl":i&&(e=e.replace(mt,y));break;case"vs:#main-start":i&&(e=e.replace(ro,function(g){return g+y}));break;case"vs:#main-end":i&&(e=e.replace(no,function(g){return y+g}));break;case"fs:#decl":i||(e=e.replace(mt,y));break;case"fs:#main-start":i||(e=e.replace(ro,function(g){return g+y}));break;case"fs:#main-end":i||(e=e.replace(no,function(g){return y+g}));break;default:e=e.replace(a,function(g){return g+y})}};for(var a in r)o();return e=e.replace(mt,""),n&&(e=e.replace(/\}\s*$/,function(f){return f+qu[t]})),e}function yt(e){return yt=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},yt(e)}function oo(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,$u(n.key),n)}}function Xu(e,t,r){return t&&oo(e.prototype,t),r&&oo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $u(e){var t=Zu(e,"string");return yt(t)==="symbol"?t:String(t)}function Zu(e,t){if(yt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ju(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Qu=1,Wt=function(){e.instantiateModules=function(n){return n.map(function(i){if(i instanceof e)return i;ie(typeof i!="string","Shader module use by name is deprecated. Import shader module '".concat(JSON.stringify(i),"' and use it directly.")),i.name||(console.warn("shader module has no name"),i.name="shader-module-".concat(Qu++));var o=new e(i);return o.dependencies=e.instantiateModules(i.dependencies||[]),o})};function e(r){Ju(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,a=r.dependencies,f=a===void 0?[]:a,s=r.uniformPropTypes,l=s===void 0?{}:s,p=r.getUniforms,y=r.deprecations,g=y===void 0?[]:y,w=r.defines,b=w===void 0?{}:w,_=r.inject,x=_===void 0?{}:_;ie(typeof n=="string"),this.name=n,this.vs=i,this.fs=o,this.getModuleUniforms=p,this.dependencies=e.instantiateModules(f),this.deprecations=this._parseDeprecationDefinitions(g),this.defines=b,this.injections=io(x),l&&(this.uniforms=Xi(l))}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:ie(!1)}var o=this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");return"// ----- MODULE ".concat(this.name,` ---------------
70
+ `);switch(a){case"vs:#decl":i&&(e=e.replace(mt,y));break;case"vs:#main-start":i&&(e=e.replace(to,function(g){return g+y}));break;case"vs:#main-end":i&&(e=e.replace(ro,function(g){return y+g}));break;case"fs:#decl":i||(e=e.replace(mt,y));break;case"fs:#main-start":i||(e=e.replace(to,function(g){return g+y}));break;case"fs:#main-end":i||(e=e.replace(ro,function(g){return y+g}));break;default:e=e.replace(a,function(g){return g+y})}};for(var a in r)o();return e=e.replace(mt,""),n&&(e=e.replace(/\}\s*$/,function(f){return f+Wu[t]})),e}function yt(e){return yt=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},yt(e)}function io(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,Xu(n.key),n)}}function Yu(e,t,r){return t&&io(e.prototype,t),r&&io(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xu(e){var t=$u(e,"string");return yt(t)==="symbol"?t:String(t)}function $u(e,t){if(yt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ju=1,qt=function(){e.instantiateModules=function(n){return n.map(function(i){if(i instanceof e)return i;ie(typeof i!="string","Shader module use by name is deprecated. Import shader module '".concat(JSON.stringify(i),"' and use it directly.")),i.name||(console.warn("shader module has no name"),i.name="shader-module-".concat(Ju++));var o=new e(i);return o.dependencies=e.instantiateModules(i.dependencies||[]),o})};function e(r){Zu(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,a=r.dependencies,f=a===void 0?[]:a,s=r.uniformPropTypes,u=s===void 0?{}:s,p=r.getUniforms,y=r.deprecations,g=y===void 0?[]:y,w=r.defines,b=w===void 0?{}:w,_=r.inject,x=_===void 0?{}:_;ie(typeof n=="string"),this.name=n,this.vs=i,this.fs=o,this.getModuleUniforms=p,this.dependencies=e.instantiateModules(f),this.deprecations=this._parseDeprecationDefinitions(g),this.defines=b,this.injections=no(x),u&&(this.uniforms=Yi(u))}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:ie(!1)}var o=this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");return"// ----- MODULE ".concat(this.name,` ---------------
72
71
 
73
72
  #define MODULE_`).concat(o,`
74
73
  `).concat(i,`
75
74
 
76
- `)},t.getUniforms=function(n,i){return this.getModuleUniforms?this.getModuleUniforms(n,i):$i(n,this.uniforms,this.name)},t.getDefines=function(){return this.defines},t.checkDeprecations=function(n,i){this.deprecations.forEach(function(o){var a;(a=o.regex)!==null&&a!==void 0&&a.test(n)&&(o.deprecated?i.deprecated(o.old,o.new)():i.removed(o.old,o.new)())})},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 a in o){var f=o[a];a in n&&!f.private?(f.validate&&ie(f.validate(n[a],f),"".concat(this.name,": invalid ").concat(a)),i[a]=n[a]):i[a]=f.value}return i},Xu(e)}();function ao(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=el(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
77
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function el(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 vt(e){var t=Wt.instantiateModules(e);return tl(t)}function tl(e){var t={},r={};return fo({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 fo(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=ao(t),a;try{for(o.s();!(a=o.n()).done;){var f=a.value;n[f.name]=f,(i[f.name]===void 0||i[f.name]<r)&&(i[f.name]=r)}}catch(y){o.e(y)}finally{o.f()}var s=ao(t),l;try{for(s.s();!(l=s.n()).done;){var p=l.value;p.dependencies&&fo({modules:p.dependencies,level:r+1,moduleMap:n,moduleDepth:i})}}catch(y){s.e(y)}finally{s.f()}}var co,uo,lo,ho,po,mo,yo,vo,go,bo;function oe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function wo(e){switch(e?.gpu.toLowerCase()){case"apple":return K(co||(co=oe([`#define APPLE_GPU
75
+ `)},t.getUniforms=function(n,i){return this.getModuleUniforms?this.getModuleUniforms(n,i):Xi(n,this.uniforms,this.name)},t.getDefines=function(){return this.defines},t.checkDeprecations=function(n,i){this.deprecations.forEach(function(o){var a;(a=o.regex)!==null&&a!==void 0&&a.test(n)&&(o.deprecated?i.deprecated(o.old,o.new)():i.removed(o.old,o.new)())})},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 a in o){var f=o[a];a in n&&!f.private?(f.validate&&ie(f.validate(n[a],f),"".concat(this.name,": invalid ").concat(a)),i[a]=n[a]):i[a]=f.value}return i},Yu(e)}();function oo(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Qu(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.
76
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Qu(e,t){if(e){if(typeof e=="string")return ao(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 ao(e,t)}}function ao(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 vt(e){var t=qt.instantiateModules(e);return el(t)}function el(e){var t={},r={};return so({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 so(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=oo(t),a;try{for(o.s();!(a=o.n()).done;){var f=a.value;n[f.name]=f,(i[f.name]===void 0||i[f.name]<r)&&(i[f.name]=r)}}catch(y){o.e(y)}finally{o.f()}var s=oo(t),u;try{for(s.s();!(u=s.n()).done;){var p=u.value;p.dependencies&&so({modules:p.dependencies,level:r+1,moduleMap:n,moduleDepth:i})}}catch(y){s.e(y)}finally{s.f()}}var fo,co,uo,lo,ho,po,mo,yo,vo,go;function oe(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function bo(e){switch(e?.gpu.toLowerCase()){case"apple":return K(fo||(fo=oe([`#define APPLE_GPU
78
77
  // Apple optimizes away the calculation necessary for emulated fp64
79
78
  #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
80
79
  #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
@@ -87,14 +86,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
87
86
  #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
88
87
  // Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
89
88
  #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
90
- `])));case"nvidia":return K(uo||(uo=oe([`#define NVIDIA_GPU
89
+ `])));case"nvidia":return K(co||(co=oe([`#define NVIDIA_GPU
91
90
  // Nvidia optimizes away the calculation necessary for emulated fp64
92
91
  #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
93
92
  `],[`\\
94
93
  #define NVIDIA_GPU
95
94
  // Nvidia optimizes away the calculation necessary for emulated fp64
96
95
  #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
97
- `])));case"intel":return K(lo||(lo=oe([`#define INTEL_GPU
96
+ `])));case"intel":return K(uo||(uo=oe([`#define INTEL_GPU
98
97
  // Intel optimizes away the calculation necessary for emulated fp64
99
98
  #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
100
99
  // Intel's built-in 'tan' function doesn't have acceptable precision
@@ -109,10 +108,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
109
108
  #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
110
109
  // Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
111
110
  #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
112
- `])));case"amd":return K(ho||(ho=oe([`#define AMD_GPU
111
+ `])));case"amd":return K(lo||(lo=oe([`#define AMD_GPU
113
112
  `],[`\\
114
113
  #define AMD_GPU
115
- `])));default:return K(po||(po=oe([`#define DEFAULT_GPU
114
+ `])));default:return K(ho||(ho=oe([`#define DEFAULT_GPU
116
115
  // Prevent driver from optimizing away the calculation necessary for emulated fp64
117
116
  #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
118
117
  // Headless Chrome's software shader 'tan' function doesn't have acceptable precision
@@ -127,7 +126,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
127
126
  #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
128
127
  // If the GPU doesn't have full 32 bits precision, will causes overflow
129
128
  #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
130
- `])))}}function _o(e){var t="";return e.features.has("webgl2")&&(t+=K(mo||(mo=oe([`# define FEATURE_GLSL_DERIVATIVES
129
+ `])))}}function wo(e){var t="";return e.features.has("webgl2")&&(t+=K(po||(po=oe([`# define FEATURE_GLSL_DERIVATIVES
131
130
  # define FEATURE_GLSL_DRAW_BUFFERS
132
131
  # define FEATURE_GLSL_FRAG_DEPTH
133
132
  # define FEATURE_GLSL_TEXTURE_LOD
@@ -136,7 +135,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
136
135
  # define FEATURE_GLSL_DRAW_BUFFERS
137
136
  # define FEATURE_GLSL_FRAG_DEPTH
138
137
  # define FEATURE_GLSL_TEXTURE_LOD
139
- `])))),e.features.has("webgl2")||(e.features.has("glsl-frag-depth")&&(t+=K(yo||(yo=oe([`
138
+ `])))),e.features.has("webgl2")||(e.features.has("glsl-frag-depth")&&(t+=K(mo||(mo=oe([`
140
139
  // FEATURE_GLSL_FRAG_DEPTH => gl_FragDepth is available
141
140
  #ifdef GL_EXT_frag_depth
142
141
  # extension GL_EXT_frag_depth : enable
@@ -153,7 +152,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
153
152
  # define FRAG_DEPTH
154
153
  # define gl_FragDepth gl_FragDepthEXT
155
154
  #endif
156
- `])))),e!=null&&e.features.has("glsl-derivatives")&&(t+=K(vo||(vo=oe([`
155
+ `])))),e!=null&&e.features.has("glsl-derivatives")&&(t+=K(yo||(yo=oe([`
157
156
  // FEATURE_GLSL_DERIVATIVES => dxdF, dxdY and fwidth are available
158
157
  #if defined(GL_OES_standard_derivatives) || defined(FEATURE_GLSL_DERIVATIVES)
159
158
  # extension GL_OES_standard_derivatives : enable
@@ -166,7 +165,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
166
165
  # extension GL_OES_standard_derivatives : enable
167
166
  # define FEATURE_GLSL_DERIVATIVES
168
167
  #endif
169
- `])))),e!=null&&e.features.has("glsl-frag-data")&&(t+=K(go||(go=oe([`
168
+ `])))),e!=null&&e.features.has("glsl-frag-data")&&(t+=K(vo||(vo=oe([`
170
169
  // FEATURE_GLSL_DRAW_BUFFERS => gl_FragData[] is available
171
170
  #ifdef GL_EXT_draw_buffers
172
171
  # extension GL_EXT_draw_buffers : require
@@ -179,7 +178,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
179
178
  # extension GL_EXT_draw_buffers : require
180
179
  # define FEATURE_GLSL_DRAW_BUFFERS
181
180
  #endif
182
- `])))),e!=null&&e.features.has("glsl-texture-lod")&&(t+=K(bo||(bo=oe([`// TEXTURE_LOD => texture2DLod etc are available
181
+ `])))),e!=null&&e.features.has("glsl-texture-lod")&&(t+=K(go||(go=oe([`// TEXTURE_LOD => texture2DLod etc are available
183
182
  #ifdef GL_EXT_shader_texture_lod
184
183
  # extension GL_EXT_shader_texture_lod : enable
185
184
  # define FEATURE_GLSL_TEXTURE_LOD
@@ -192,51 +191,51 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
192
191
  # define FEATURE_GLSL_TEXTURE_LOD
193
192
  # define TEXTURE_LOD
194
193
  #endif
195
- `]))))),t}function rl(e,t){return ol(e)||il(e,t)||Po(e,t)||nl()}function nl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
196
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function il(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function ol(e){if(Array.isArray(e))return e}function al(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Po(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
197
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Po(e,t){if(e){if(typeof e=="string")return Oo(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 Oo(e,t)}}function Oo(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 xo(e,t,r){var n,i=Number(((n=e.match(/^#version[ \t]+(\d+)/m))===null||n===void 0?void 0:n[1])||100);if(i!==300)throw new Error("luma.gl v9 only supports GLSL 3.00 shader sources");switch(t){case 300:switch(r){case"vertex":return e=gt(e,sl),e;case"fragment":return e=gt(e,fl),e;default:throw new Error(r)}case 100:switch(r){case"vertex":return e=gt(e,cl),e;case"fragment":return e=gt(e,To),e=ll(e),e;default:throw new Error(r)}default:throw new Error(String(t))}}var Eo=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,`#version 300 es
198
- `],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],sl=[].concat(Eo,[[Ge("attribute"),"in $1"],[Ge("varying"),"out $1"]]),fl=[].concat(Eo,[[Ge("varying"),"in $1"]]),Ao=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],cl=[].concat(Ao,[[Ge("in"),"attribute $1"],[Ge("out"),"varying $1"]]),To=[].concat(Ao,[[Ge("in"),"varying $1"]]),ul="gl_FragColor",So=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/;function gt(e,t){var r=al(t),n;try{for(r.s();!(n=r.n()).done;){var i=rl(n.value,2),o=i[0],a=i[1];e=e.replace(o,a)}}catch(f){r.e(f)}finally{r.f()}return e}function ll(e){e=gt(e,To);var t=So.exec(e);if(t){var r=t[1];e=e.replace(So,"").replace(new RegExp("\\b".concat(r,"\\b"),"g"),ul)}return e}function Ge(e){return new RegExp("\\b".concat(e,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}function hl(e,t){return dl(e)||ml(e,t)||Lo(e,t)||pl()}function pl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
199
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ml(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function dl(e){if(Array.isArray(e))return e}function Ro(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Lo(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(l){throw l},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,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Lo(e,t){if(e){if(typeof e=="string")return Mo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mo(e,t)}}function Mo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kr(e,t){var r="";for(var n in e){var i=e[n];if(r+="void ".concat(i.signature,` {
201
- `),i.header&&(r+=" ".concat(i.header)),t[n]){var o=t[n];o.sort(function(l,p){return l.order-p.order});var a=Ro(o),f;try{for(a.s();!(f=a.n()).done;){var s=f.value;r+=" ".concat(s.injection,`
202
- `)}}catch(l){a.e(l)}finally{a.f()}}i.footer&&(r+=" ".concat(i.footer)),r+=`}
203
- `}return r}function Vr(e){var t={vertex:{},fragment:{}},r=Ro(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=void 0,a=void 0;typeof i!="string"?(o=i,a=o.hook):(o={},a=i),a=a.trim();var f=a.split(":"),s=hl(f,2),l=s[0],p=s[1],y=a.replace(/\(.+/,""),g=Object.assign(o,{signature:p});switch(l){case"vs":t.vertex[y]=g;break;case"fs":t.fragment[y]=g;break;default:throw new Error(l)}}}catch(w){r.e(w)}finally{r.f()}return t}function jo(e,t){return{name:yl(e,t),language:"glsl",version:vl(e)}}function yl(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 vl(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)}if(t!==100&&t!==300)throw new Error("Invalid GLSL version ".concat(t));return t}function bt(e){return bt=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},bt(e)}var Io;function Hr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=gl(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
204
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function gl(e,t){if(e){if(typeof e=="string")return Do(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 Do(e,t)}}function Do(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function No(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ge(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?No(Object(r),!0).forEach(function(n){bl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):No(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bl(e,t,r){return t=wl(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wl(e){var t=_l(e,"string");return bt(t)==="symbol"?t:String(t)}function _l(e,t){if(bt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ol(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Go=`
194
+ `]))))),t}function tl(e,t){return il(e)||nl(e,t)||So(e,t)||rl()}function rl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
195
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nl(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function il(e){if(Array.isArray(e))return e}function ol(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=So(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.
196
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function So(e,t){if(e){if(typeof e=="string")return _o(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 _o(e,t)}}function _o(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 Po(e,t,r){var n,i=Number(((n=e.match(/^#version[ \t]+(\d+)/m))===null||n===void 0?void 0:n[1])||100);if(i!==300)throw new Error("luma.gl v9 only supports GLSL 3.00 shader sources");switch(t){case 300:switch(r){case"vertex":return e=gt(e,al),e;case"fragment":return e=gt(e,sl),e;default:throw new Error(r)}case 100:switch(r){case"vertex":return e=gt(e,fl),e;case"fragment":return e=gt(e,Ao),e=ul(e),e;default:throw new Error(r)}default:throw new Error(String(t))}}var xo=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,`#version 300 es
197
+ `],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],al=[].concat(xo,[[Ge("attribute"),"in $1"],[Ge("varying"),"out $1"]]),sl=[].concat(xo,[[Ge("varying"),"in $1"]]),Eo=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],fl=[].concat(Eo,[[Ge("in"),"attribute $1"],[Ge("out"),"varying $1"]]),Ao=[].concat(Eo,[[Ge("in"),"varying $1"]]),cl="gl_FragColor",Oo=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/;function gt(e,t){var r=ol(t),n;try{for(r.s();!(n=r.n()).done;){var i=tl(n.value,2),o=i[0],a=i[1];e=e.replace(o,a)}}catch(f){r.e(f)}finally{r.f()}return e}function ul(e){e=gt(e,Ao);var t=Oo.exec(e);if(t){var r=t[1];e=e.replace(Oo,"").replace(new RegExp("\\b".concat(r,"\\b"),"g"),cl)}return e}function Ge(e){return new RegExp("\\b".concat(e,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}function ll(e,t){return ml(e)||pl(e,t)||Ro(e,t)||hl()}function hl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
198
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pl(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function ml(e){if(Array.isArray(e))return e}function Mo(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Ro(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.
199
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Ro(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 Hr(e,t){var r="";for(var n in e){var i=e[n];if(r+="void ".concat(i.signature,` {
200
+ `),i.header&&(r+=" ".concat(i.header)),t[n]){var o=t[n];o.sort(function(u,p){return u.order-p.order});var a=Mo(o),f;try{for(a.s();!(f=a.n()).done;){var s=f.value;r+=" ".concat(s.injection,`
201
+ `)}}catch(u){a.e(u)}finally{a.f()}}i.footer&&(r+=" ".concat(i.footer)),r+=`}
202
+ `}return r}function Kr(e){var t={vertex:{},fragment:{}},r=Mo(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=void 0,a=void 0;typeof i!="string"?(o=i,a=o.hook):(o={},a=i),a=a.trim();var f=a.split(":"),s=ll(f,2),u=s[0],p=s[1],y=a.replace(/\(.+/,""),g=Object.assign(o,{signature:p});switch(u){case"vs":t.vertex[y]=g;break;case"fs":t.fragment[y]=g;break;default:throw new Error(u)}}}catch(w){r.e(w)}finally{r.f()}return t}function Lo(e,t){return{name:dl(e,t),language:"glsl",version:yl(e)}}function dl(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 yl(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)}if(t!==100&&t!==300)throw new Error("Invalid GLSL version ".concat(t));return t}function bt(e){return bt=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},bt(e)}var Io;function Wr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=vl(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.
203
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function vl(e,t){if(e){if(typeof e=="string")return jo(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 jo(e,t)}}function jo(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 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 ge(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){gl(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 gl(e,t,r){return t=bl(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bl(e){var t=wl(e,"string");return bt(t)==="symbol"?t:String(t)}function wl(e,t){if(bt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _l(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Uo=`
205
204
 
206
205
  `.concat(mt,`
207
- `),Sl=K(Io||(Io=Ol([`precision highp float;
206
+ `),Ol=K(Io||(Io=_l([`precision highp float;
208
207
  `],[`\\
209
208
  precision highp float;
210
- `])));function Bo(e){var t=e.vs,r=e.fs,n=vt(e.modules||[]);switch(e.platformInfo.shaderLanguage){case"glsl":return{vs:Fo(e.platformInfo,ge(ge({},e),{},{source:t,stage:"vertex",modules:n})),fs:Fo(e.platformInfo,ge(ge({},e),{},{source:r,stage:"fragment",modules:n})),getUniforms:Uo(n)};case"wgsl":return{vs:Co(e.platformInfo,ge(ge({},e),{},{source:t,stage:"vertex",modules:n})),fs:Co(e.platformInfo,ge(ge({},e),{},{source:r,stage:"fragment",modules:n})),getUniforms:Uo(n)}}}function Co(e,t){var r=t.source,n=t.stage,i=t.modules,o=t.defines,a=o===void 0?{}:o,f=t.hookFunctions,s=f===void 0?[]:f,l=t.inject,p=l===void 0?{}:l,y=t.log;ie(typeof r=="string","shader source must be a string");var g=r,w={};i.forEach(function(d){Object.assign(w,d.getDefines())}),Object.assign(w,a);var b="",_=Vr(s),x={},S={},R={};for(var E in p){var T=typeof p[E]=="string"?{injection:p[E],order:0}:p[E],M=/^(v|f)s:(#)?([\w-]+)$/.exec(E);if(M){var L=M[2],I=M[3];L?I==="decl"?S[E]=[T]:R[E]=[T]:x[E]=[T]}else R[E]=[T]}var D=Hr(i),F;try{for(D.s();!(F=D.n()).done;){var N=F.value;y&&N.checkDeprecations(g,y);var C=N.getModuleSource(n,"wgsl");b+=C;var h=N.injections[n];for(var c in h){var u=/^(v|f)s:#([\w-]+)$/.exec(c);if(u){var m=u[2],v=m==="decl"?S:R;v[c]=v[c]||[],v[c].push(h[c])}else x[c]=x[c]||[],x[c].push(h[c])}}}catch(d){D.e(d)}finally{D.f()}return b+=Go,b=dt(b,n,S),b+=kr(_[n],x),b+=g,b=dt(b,n,R),b}function Fo(e,t){var r=t.id,n=t.source,i=t.stage,o=t.language,a=o===void 0?"glsl":o,f=t.modules,s=t.defines,l=s===void 0?{}:s,p=t.hookFunctions,y=p===void 0?[]:p,g=t.inject,w=g===void 0?{}:g,b=t.prologue,_=b===void 0?!0:b,x=t.log;ie(typeof n=="string","shader source must be a string");var S=a==="glsl"?jo(n).version:-1,R=e.shaderLanguageVersion,E=S===100?"#version 100":"#version 300 es",T=n.split(`
211
- `),M=T.slice(1).join(`
212
- `),L={};f.forEach(function(H){Object.assign(L,H.getDefines())}),Object.assign(L,l);var I="";switch(a){case"wgsl":break;case"glsl":I=_?"".concat(E,`
209
+ `])));function Go(e){var t=e.vs,r=e.fs,n=vt(e.modules||[]);switch(e.platformInfo.shaderLanguage){case"glsl":return{vs:Co(e.platformInfo,ge(ge({},e),{},{source:t,stage:"vertex",modules:n})),fs:Co(e.platformInfo,ge(ge({},e),{},{source:r,stage:"fragment",modules:n})),getUniforms:Fo(n)};case"wgsl":return{vs:No(e.platformInfo,ge(ge({},e),{},{source:t,stage:"vertex",modules:n})),fs:No(e.platformInfo,ge(ge({},e),{},{source:r,stage:"fragment",modules:n})),getUniforms:Fo(n)}}}function No(e,t){var r=t.source,n=t.stage,i=t.modules,o=t.defines,a=o===void 0?{}:o,f=t.hookFunctions,s=f===void 0?[]:f,u=t.inject,p=u===void 0?{}:u,y=t.log;ie(typeof r=="string","shader source must be a string");var g=r,w={};i.forEach(function(d){Object.assign(w,d.getDefines())}),Object.assign(w,a);var b="",_=Kr(s),x={},P={},M={};for(var E in p){var T=typeof p[E]=="string"?{injection:p[E],order:0}:p[E],L=/^(v|f)s:(#)?([\w-]+)$/.exec(E);if(L){var R=L[2],j=L[3];R?j==="decl"?P[E]=[T]:M[E]=[T]:x[E]=[T]}else M[E]=[T]}var D=Wr(i),F;try{for(D.s();!(F=D.n()).done;){var N=F.value;y&&N.checkDeprecations(g,y);var C=N.getModuleSource(n,"wgsl");b+=C;var h=N.injections[n];for(var c in h){var l=/^(v|f)s:#([\w-]+)$/.exec(c);if(l){var m=l[2],v=m==="decl"?P:M;v[c]=v[c]||[],v[c].push(h[c])}else x[c]=x[c]||[],x[c].push(h[c])}}}catch(d){D.e(d)}finally{D.f()}return b+=Uo,b=dt(b,n,P),b+=Hr(_[n],x),b+=g,b=dt(b,n,M),b}function Co(e,t){var r=t.id,n=t.source,i=t.stage,o=t.language,a=o===void 0?"glsl":o,f=t.modules,s=t.defines,u=s===void 0?{}:s,p=t.hookFunctions,y=p===void 0?[]:p,g=t.inject,w=g===void 0?{}:g,b=t.prologue,_=b===void 0?!0:b,x=t.log;ie(typeof n=="string","shader source must be a string");var P=a==="glsl"?Lo(n).version:-1,M=e.shaderLanguageVersion,E=P===100?"#version 100":"#version 300 es",T=n.split(`
210
+ `),L=T.slice(1).join(`
211
+ `),R={};f.forEach(function(H){Object.assign(R,H.getDefines())}),Object.assign(R,u);var j="";switch(a){case"wgsl":break;case"glsl":j=_?"".concat(E,`
213
212
 
214
213
  // ----- PROLOGUE -------------------------
215
- `).concat(Pl({id:r,source:n,stage:i}),`
214
+ `).concat(Sl({id:r,source:n,stage:i}),`
216
215
  `,"#define SHADER_TYPE_".concat(i.toUpperCase()),`
216
+ `).concat(bo(e),`
217
217
  `).concat(wo(e),`
218
- `).concat(_o(e),`
219
- `).concat(i==="fragment"?Sl:"",`
218
+ `).concat(i==="fragment"?Ol:"",`
220
219
 
221
220
  // ----- APPLICATION DEFINES -------------------------
222
221
 
223
- `).concat(xl(L),`
222
+ `).concat(Pl(R),`
224
223
 
225
224
  `):"".concat(E,`
226
- `);break}var D=Vr(y),F={},N={},C={};for(var h in w){var c=typeof w[h]=="string"?{injection:w[h],order:0}:w[h],u=/^(v|f)s:(#)?([\w-]+)$/.exec(h);if(u){var m=u[2],v=u[3];m?v==="decl"?N[h]=[c]:C[h]=[c]:F[h]=[c]}else C[h]=[c]}var d=Hr(f),O;try{for(d.s();!(O=d.n()).done;){var P=O.value;x&&P.checkDeprecations(M,x);var A=P.getModuleSource(i);I+=A;var U=P.injections[i];for(var j in U){var G=/^(v|f)s:#([\w-]+)$/.exec(j);if(G){var ne=G[2],Q=ne==="decl"?N:C;Q[j]=Q[j]||[],Q[j].push(U[j])}else F[j]=F[j]||[],F[j].push(U[j])}}}catch(H){d.e(H)}finally{d.f()}return I+="// ----- MAIN SHADER SOURCE -------------------------",I+=Go,I=dt(I,i,N),I+=kr(D[i],F),I+=M,I=dt(I,i,C),a==="glsl"&&S!==R&&(I=xo(I,R,i)),I.trim()}function Uo(e){return function(r){var n={},i=Hr(e),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,f=a.getUniforms(r,n);Object.assign(n,f)}}catch(s){i.e(s)}finally{i.f()}return n}}function Pl(e){var t=e.id,r=e.source,n=e.stage,i=t&&r.indexOf("SHADER_NAME")===-1;return i?`
225
+ `);break}var D=Kr(y),F={},N={},C={};for(var h in w){var c=typeof w[h]=="string"?{injection:w[h],order:0}:w[h],l=/^(v|f)s:(#)?([\w-]+)$/.exec(h);if(l){var m=l[2],v=l[3];m?v==="decl"?N[h]=[c]:C[h]=[c]:F[h]=[c]}else C[h]=[c]}var d=Wr(f),O;try{for(d.s();!(O=d.n()).done;){var S=O.value;x&&S.checkDeprecations(L,x);var A=S.getModuleSource(i);j+=A;var U=S.injections[i];for(var I in U){var G=/^(v|f)s:#([\w-]+)$/.exec(I);if(G){var ne=G[2],Q=ne==="decl"?N:C;Q[I]=Q[I]||[],Q[I].push(U[I])}else F[I]=F[I]||[],F[I].push(U[I])}}}catch(H){d.e(H)}finally{d.f()}return j+="// ----- MAIN SHADER SOURCE -------------------------",j+=Uo,j=dt(j,i,N),j+=Hr(D[i],F),j+=L,j=dt(j,i,C),a==="glsl"&&P!==M&&(j=Po(j,M,i)),j.trim()}function Fo(e){return function(r){var n={},i=Wr(e),o;try{for(i.s();!(o=i.n()).done;){var a=o.value,f=a.getUniforms(r,n);Object.assign(n,f)}}catch(s){i.e(s)}finally{i.f()}return n}}function Sl(e){var t=e.id,r=e.source,n=e.stage,i=t&&r.indexOf("SHADER_NAME")===-1;return i?`
227
226
  #define SHADER_NAME `.concat(t,"_").concat(n,`
228
227
 
229
- `):""}function xl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t="";for(var r in e){var n=e[r];(n||Number.isFinite(n))&&(t+="#define ".concat(r.toUpperCase()," ").concat(e[r],`
230
- `))}return t}function wt(e){return wt=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},wt(e)}function zo(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 ko(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zo(Object(r),!0).forEach(function(n){El(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function El(e,t,r){return t=Al(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Al(e){var t=Tl(e,"string");return wt(t)==="symbol"?t:String(t)}function Tl(e,t){if(wt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(wt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ho(e){if(!e.vs)throw new Error("no vertex shader");var t=Vo(e.platformInfo,e.vs),r;return e.fs&&(r=Vo(e.platformInfo,e.fs)),ko(ko({},e),{},{vs:t,fs:r})}function Vo(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 _t(e){return _t=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},_t(e)}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 qt(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){Ml(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 Ml(e,t,r){return t=qo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wo(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,qo(n.key),n)}}function Rl(e,t,r){return t&&Wo(e.prototype,t),r&&Wo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function qo(e){var t=Ll(e,"string");return _t(t)==="symbol"?t:String(t)}function Ll(e,t){if(_t(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_t(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Yt=function(){function e(){jl(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){var i=this._getModuleList(n.modules),o=this._hookFunctions,a=Ho(n),f=Bo(qt(qt({platformInfo:n.platformInfo},a),{},{modules:i,hookFunctions:o}));return qt(qt({},f),{},{modules:i})},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,f=0,s=this._defaultModules.length;f<s;++f){var l=this._defaultModules[f],p=l.name;i[a++]=l,o[p]=!0}for(var y=0,g=n.length;y<g;++y){var w=n[y],b=w.name;o[b]||(i[a++]=w,o[b]=!0)}return i.length=a,Wt.instantiateModules(i)},Rl(e)}();Yt.defaultShaderAssembler=void 0;var Yo,Xo;function $o(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Il=K(Yo||(Yo=$o(["void main() {gl_FragColor = vec4(0);}"]))),Zo=K(Xo||(Xo=$o([`out vec4 transform_output;
228
+ `):""}function Pl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t="";for(var r in e){var n=e[r];(n||Number.isFinite(n))&&(t+="#define ".concat(r.toUpperCase()," ").concat(e[r],`
229
+ `))}return t}function wt(e){return wt=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},wt(e)}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 zo(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){xl(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 xl(e,t,r){return t=El(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function El(e){var t=Al(e,"string");return wt(t)==="symbol"?t:String(t)}function Al(e,t){if(wt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(wt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vo(e){if(!e.vs)throw new Error("no vertex shader");var t=ko(e.platformInfo,e.vs),r;return e.fs&&(r=ko(e.platformInfo,e.fs)),zo(zo({},e),{},{vs:t,fs:r})}function ko(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 _t(e){return _t=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},_t(e)}function Ho(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ho(Object(r),!0).forEach(function(n){Tl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ho(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tl(e,t,r){return t=Wo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ko(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,Wo(n.key),n)}}function Ml(e,t,r){return t&&Ko(e.prototype,t),r&&Ko(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wo(e){var t=Rl(e,"string");return _t(t)==="symbol"?t:String(t)}function Rl(e,t){if(_t(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_t(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ll(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Xt=function(){function e(){Ll(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){var i=this._getModuleList(n.modules),o=this._hookFunctions,a=Vo(n),f=Go(Yt(Yt({platformInfo:n.platformInfo},a),{},{modules:i,hookFunctions:o}));return Yt(Yt({},f),{},{modules:i})},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,f=0,s=this._defaultModules.length;f<s;++f){var u=this._defaultModules[f],p=u.name;i[a++]=u,o[p]=!0}for(var y=0,g=n.length;y<g;++y){var w=n[y],b=w.name;o[b]||(i[a++]=w,o[b]=!0)}return i.length=a,qt.instantiateModules(i)},Ml(e)}();Xt.defaultShaderAssembler=void 0;var qo,Yo;function Xo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Il=K(qo||(qo=Xo(["void main() {gl_FragColor = vec4(0);}"]))),$o=K(Yo||(Yo=Xo([`out vec4 transform_output;
231
230
  void main() {
232
231
  transform_output = vec4(0);
233
232
  }`],[`\\
234
233
  out vec4 transform_output;
235
234
  void main() {
236
235
  transform_output = vec4(0);
237
- }`]))),Dl=`#version 300 es
238
- `.concat(Zo);function Ot(e){var t=e||{},r=t.version,n=r===void 0?100:r,i=t.input,o=t.inputChannels,a=t.output;if(!i)return n===300?Dl:n>300?"#version ".concat(n,`
239
- `).concat(Zo):Il;if(!o)throw new Error("inputChannels");var f=Nl(o),s=Jo(i,o);return n>=300?"#version ".concat(n," ").concat(n===300?"es":"",`
236
+ }`]))),jl=`#version 300 es
237
+ `.concat($o);function Ot(e){var t=e||{},r=t.version,n=r===void 0?100:r,i=t.input,o=t.inputChannels,a=t.output;if(!i)return n===300?jl:n>300?"#version ".concat(n,`
238
+ `).concat($o):Il;if(!o)throw new Error("inputChannels");var f=Dl(o),s=Zo(i,o);return n>=300?"#version ".concat(n," ").concat(n===300?"es":"",`
240
239
  in `).concat(f," ").concat(i,`;
241
240
  out vec4 `).concat(a,`;
242
241
  void main() {
@@ -244,13 +243,14 @@ void main() {
244
243
  }`):"varying ".concat(f," ").concat(i,`;
245
244
  void main() {
246
245
  gl_FragColor = `).concat(s,`;
247
- }`)}function Nl(e){switch(e){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error("invalid channels: ".concat(e))}}function Jo(e,t){switch(t){case 1:return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case 2:return"vec4(".concat(e,", 0.0, 1.0)");case 3:return"vec4(".concat(e,", 1.0)");case 4:return e;default:throw new Error("invalid channels: ".concat(t))}}var _g=1/Math.PI*180,Og=1/180*Math.PI,Cl={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Cl}};var q=globalThis.mathgl.config;function Qo(e,{precision:t=q.precision}={}){return e=Fl(e),"".concat(parseFloat(e.toPrecision(t)))}function Be(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Kr(e,t,r){let n=q.EPSILON;r&&(q.EPSILON=r);try{if(e===t)return!0;if(Be(e)&&Be(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Kr(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)<=q.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{q.EPSILON=n}}function Fl(e){return Math.round(e/q.EPSILON)*q.EPSILON}function Ul(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 ze=class extends Ul(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:Be(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(q)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Qo(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(!Kr(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(q.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 Gl(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 Y(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function Xt(e,t,r=""){if(q.debug&&!Gl(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function Wr(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var $t=class extends ze{get x(){return this[0]}set x(t){this[0]=Y(t)}get y(){return this[1]}set y(t){this[1]=Y(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 Y(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Y(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 Wr(t>=0&&t<this.ELEMENTS,"index is out of range"),Y(this[t])}setComponent(t,r){return Wr(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 ce=typeof Float32Array<"u"?Float32Array:Array;var Ig=Math.PI/180;function Bl(){let e=new ce(2);return ce!=Float32Array&&(e[0]=0,e[1]=0),e}function ra(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 Dg=function(){let e=Bl();return function(t,r,n,i,o,a){let f,s;for(r||(r=2),n||(n=0),i?s=Math.min(i*r+n,t.length):s=t.length,f=n;f<s;f+=r)e[0]=t[f],e[1]=t[f+1],o(e,e,a),t[f]=e[0],t[f+1]=e[1];return t}}();function na(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 Zt(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 ia(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 zl(){let e=new ce(3);return ce!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function kl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function oa(e,t,r){let n=t[0],i=t[1],o=t[2],a=r[0],f=r[1],s=r[2];return e[0]=i*s-o*f,e[1]=o*a-n*s,e[2]=n*f-i*a,e}function Jt(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 aa(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 sa(e,t,r){let n=r[0],i=r[1],o=r[2],a=r[3],f=t[0],s=t[1],l=t[2],p=i*l-o*s,y=o*f-n*l,g=n*s-i*f,w=i*g-o*y,b=o*p-n*g,_=n*y-i*p,x=a*2;return p*=x,y*=x,g*=x,w*=2,b*=2,_*=2,e[0]=f+p+w,e[1]=s+y+b,e[2]=l+g+_,e}function fa(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 ca(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 ua(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 la(e,t){let r=e[0],n=e[1],i=e[2],o=t[0],a=t[1],f=t[2],s=Math.sqrt((r*r+n*n+i*i)*(o*o+a*a+f*f)),l=s&&kl(e,t)/s;return Math.acos(Math.min(Math.max(l,-1),1))}var Fg=function(){let e=zl();return function(t,r,n,i,o,a){let f,s;for(r||(r=3),n||(n=0),i?s=Math.min(i*r+n,t.length):s=t.length,f=n;f<s;f+=r)e[0]=t[f],e[1]=t[f+1],e[2]=t[f+2],o(e,e,a),t[f]=e[0],t[f+1]=e[1],t[f+2]=e[2];return t}}();var Yr=[0,0,0],Qt,$=class extends $t{static get ZERO(){return Qt||(Qt=new $(0,0,0),Object.freeze(Qt)),Qt}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Be(t)?this.copy(t):(q.debug&&(Y(t),Y(r),Y(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 q.debug&&(Y(t.x),Y(t.y),Y(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]=Y(t)}angle(t){return la(this,t)}cross(t){return oa(this,this,t),this.check()}rotateX({radians:t,origin:r=Yr}){return fa(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Yr}){return ca(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Yr}){return ua(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Jt(this,this,t),this.check()}transformAsVector(t){return Zt(this,this,t),this.check()}transformByMatrix3(t){return aa(this,this,t),this.check()}transformByMatrix2(t){return ia(this,this,t),this.check()}transformByQuaternion(t){return sa(this,this,t),this.check()}};var er=class extends ze{toString(){let t="[";if(q.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]=Y(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 Vl(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 ha(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],o=t[6],a=t[7],f=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]=f}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 pa(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],f=t[5],s=t[6],l=t[7],p=t[8],y=t[9],g=t[10],w=t[11],b=t[12],_=t[13],x=t[14],S=t[15],R=r*f-n*a,E=r*s-i*a,T=r*l-o*a,M=n*s-i*f,L=n*l-o*f,I=i*l-o*s,D=p*_-y*b,F=p*x-g*b,N=p*S-w*b,C=y*x-g*_,h=y*S-w*_,c=g*S-w*x,u=R*c-E*h+T*C+M*N-L*F+I*D;return u?(u=1/u,e[0]=(f*c-s*h+l*C)*u,e[1]=(i*h-n*c-o*C)*u,e[2]=(_*I-x*L+S*M)*u,e[3]=(g*L-y*I-w*M)*u,e[4]=(s*N-a*c-l*F)*u,e[5]=(r*c-i*N+o*F)*u,e[6]=(x*T-b*I-S*E)*u,e[7]=(p*I-g*T+w*E)*u,e[8]=(a*h-f*N+l*D)*u,e[9]=(n*N-r*h-o*D)*u,e[10]=(b*L-_*T+S*R)*u,e[11]=(y*T-p*L-w*R)*u,e[12]=(f*F-a*C-s*D)*u,e[13]=(r*C-n*F+i*D)*u,e[14]=(_*E-b*M-x*R)*u,e[15]=(p*M-y*E+g*R)*u,e):null}function ma(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],f=e[6],s=e[7],l=e[8],p=e[9],y=e[10],g=e[11],w=e[12],b=e[13],_=e[14],x=e[15],S=t*a-r*o,R=t*f-n*o,E=r*f-n*a,T=l*b-p*w,M=l*_-y*w,L=p*_-y*b,I=t*L-r*M+n*T,D=o*L-a*M+f*T,F=l*E-p*R+y*S,N=w*E-b*R+_*S;return s*I-i*D+x*F-g*N}function Xr(e,t,r){let n=t[0],i=t[1],o=t[2],a=t[3],f=t[4],s=t[5],l=t[6],p=t[7],y=t[8],g=t[9],w=t[10],b=t[11],_=t[12],x=t[13],S=t[14],R=t[15],E=r[0],T=r[1],M=r[2],L=r[3];return e[0]=E*n+T*f+M*y+L*_,e[1]=E*i+T*s+M*g+L*x,e[2]=E*o+T*l+M*w+L*S,e[3]=E*a+T*p+M*b+L*R,E=r[4],T=r[5],M=r[6],L=r[7],e[4]=E*n+T*f+M*y+L*_,e[5]=E*i+T*s+M*g+L*x,e[6]=E*o+T*l+M*w+L*S,e[7]=E*a+T*p+M*b+L*R,E=r[8],T=r[9],M=r[10],L=r[11],e[8]=E*n+T*f+M*y+L*_,e[9]=E*i+T*s+M*g+L*x,e[10]=E*o+T*l+M*w+L*S,e[11]=E*a+T*p+M*b+L*R,E=r[12],T=r[13],M=r[14],L=r[15],e[12]=E*n+T*f+M*y+L*_,e[13]=E*i+T*s+M*g+L*x,e[14]=E*o+T*l+M*w+L*S,e[15]=E*a+T*p+M*b+L*R,e}function da(e,t,r){let n=r[0],i=r[1],o=r[2],a,f,s,l,p,y,g,w,b,_,x,S;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],f=t[1],s=t[2],l=t[3],p=t[4],y=t[5],g=t[6],w=t[7],b=t[8],_=t[9],x=t[10],S=t[11],e[0]=a,e[1]=f,e[2]=s,e[3]=l,e[4]=p,e[5]=y,e[6]=g,e[7]=w,e[8]=b,e[9]=_,e[10]=x,e[11]=S,e[12]=a*n+p*i+b*o+t[12],e[13]=f*n+y*i+_*o+t[13],e[14]=s*n+g*i+x*o+t[14],e[15]=l*n+w*i+S*o+t[15]),e}function ya(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 va(e,t,r,n){let i=n[0],o=n[1],a=n[2],f=Math.sqrt(i*i+o*o+a*a),s,l,p,y,g,w,b,_,x,S,R,E,T,M,L,I,D,F,N,C,h,c,u,m;return f<1e-6?null:(f=1/f,i*=f,o*=f,a*=f,l=Math.sin(r),s=Math.cos(r),p=1-s,y=t[0],g=t[1],w=t[2],b=t[3],_=t[4],x=t[5],S=t[6],R=t[7],E=t[8],T=t[9],M=t[10],L=t[11],I=i*i*p+s,D=o*i*p+a*l,F=a*i*p-o*l,N=i*o*p-a*l,C=o*o*p+s,h=a*o*p+i*l,c=i*a*p+o*l,u=o*a*p-i*l,m=a*a*p+s,e[0]=y*I+_*D+E*F,e[1]=g*I+x*D+T*F,e[2]=w*I+S*D+M*F,e[3]=b*I+R*D+L*F,e[4]=y*N+_*C+E*h,e[5]=g*N+x*C+T*h,e[6]=w*N+S*C+M*h,e[7]=b*N+R*C+L*h,e[8]=y*c+_*u+E*m,e[9]=g*c+x*u+T*m,e[10]=w*c+S*u+M*m,e[11]=b*c+R*u+L*m,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function ga(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[4],a=t[5],f=t[6],s=t[7],l=t[8],p=t[9],y=t[10],g=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+l*n,e[5]=a*i+p*n,e[6]=f*i+y*n,e[7]=s*i+g*n,e[8]=l*i-o*n,e[9]=p*i-a*n,e[10]=y*i-f*n,e[11]=g*i-s*n,e}function ba(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],f=t[2],s=t[3],l=t[8],p=t[9],y=t[10],g=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-l*n,e[1]=a*i-p*n,e[2]=f*i-y*n,e[3]=s*i-g*n,e[8]=o*n+l*i,e[9]=a*n+p*i,e[10]=f*n+y*i,e[11]=s*n+g*i,e}function wa(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],f=t[2],s=t[3],l=t[4],p=t[5],y=t[6],g=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+l*n,e[1]=a*i+p*n,e[2]=f*i+y*n,e[3]=s*i+g*n,e[4]=l*i-o*n,e[5]=p*i-a*n,e[6]=y*i-f*n,e[7]=g*i-s*n,e}function _a(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],a=r+r,f=n+n,s=i+i,l=r*a,p=n*a,y=n*f,g=i*a,w=i*f,b=i*s,_=o*a,x=o*f,S=o*s;return e[0]=1-y-b,e[1]=p+S,e[2]=g-x,e[3]=0,e[4]=p-S,e[5]=1-l-b,e[6]=w+_,e[7]=0,e[8]=g+x,e[9]=w-_,e[10]=1-l-y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Oa(e,t,r,n,i,o,a){let f=1/(r-t),s=1/(i-n),l=1/(o-a);return e[0]=o*2*f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*s,e[6]=0,e[7]=0,e[8]=(r+t)*f,e[9]=(i+n)*s,e[10]=(a+o)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*l,e[15]=0,e}function Hl(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 Sa=Hl;function Kl(e,t,r,n,i,o,a){let f=1/(t-r),s=1/(n-i),l=1/(o-a);return e[0]=-2*f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+r)*f,e[13]=(i+n)*s,e[14]=(a+o)*l,e[15]=1,e}var Pa=Kl;function xa(e,t,r,n){let i,o,a,f,s,l,p,y,g,w,b=t[0],_=t[1],x=t[2],S=n[0],R=n[1],E=n[2],T=r[0],M=r[1],L=r[2];return Math.abs(b-T)<1e-6&&Math.abs(_-M)<1e-6&&Math.abs(x-L)<1e-6?Vl(e):(y=b-T,g=_-M,w=x-L,i=1/Math.sqrt(y*y+g*g+w*w),y*=i,g*=i,w*=i,o=R*w-E*g,a=E*y-S*w,f=S*g-R*y,i=Math.sqrt(o*o+a*a+f*f),i?(i=1/i,o*=i,a*=i,f*=i):(o=0,a=0,f=0),s=g*f-w*a,l=w*o-y*f,p=y*a-g*o,i=Math.sqrt(s*s+l*l+p*p),i?(i=1/i,s*=i,l*=i,p*=i):(s=0,l=0,p=0),e[0]=o,e[1]=s,e[2]=y,e[3]=0,e[4]=a,e[5]=l,e[6]=g,e[7]=0,e[8]=f,e[9]=p,e[10]=w,e[11]=0,e[12]=-(o*b+a*_+f*x),e[13]=-(s*b+l*_+p*x),e[14]=-(y*b+g*_+w*x),e[15]=1,e)}function Wl(){let e=new ce(4);return ce!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Ea(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 $g=function(){let e=Wl();return function(t,r,n,i,o,a){let f,s;for(r||(r=4),n||(n=0),i?s=Math.min(i*r+n,t.length):s=t.length,f=n;f<s;f+=r)e[0]=t[f],e[1]=t[f+1],e[2]=t[f+2],e[3]=t[f+3],o(e,e,a),t[f]=e[0],t[f+1]=e[1],t[f+2]=e[2],t[f+3]=e[3];return t}}();var Jr;(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"})(Jr||(Jr={}));var ql=45*Math.PI/180,Yl=1,$r=.1,Zr=500,Xl=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),re=class extends er{static get IDENTITY(){return Zl()}static get ZERO(){return $l()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Jr}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,f,s,l,p,y,g,w,b,_,x){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=a,this[6]=f,this[7]=s,this[8]=l,this[9]=p,this[10]=y,this[11]=g,this[12]=w,this[13]=b,this[14]=_,this[15]=x,this.check()}setRowMajor(t,r,n,i,o,a,f,s,l,p,y,g,w,b,_,x){return this[0]=t,this[1]=o,this[2]=l,this[3]=w,this[4]=r,this[5]=a,this[6]=p,this[7]=b,this[8]=n,this[9]=f,this[10]=y,this[11]=_,this[12]=i,this[13]=s,this[14]=g,this[15]=x,this.check()}toRowMajor(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(Xl)}fromObject(t){return this.check()}fromQuaternion(t){return _a(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:o,near:a=$r,far:f=Zr}=t;return f===1/0?Jl(this,r,n,i,o,a):Oa(this,r,n,i,o,a,f),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return xa(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:a=$r,far:f=Zr}=t;return Pa(this,r,n,i,o,a,f),this.check()}orthographic(t){let{fovy:r=ql,aspect:n=Yl,focalDistance:i=1,near:o=$r,far:a=Zr}=t;Aa(r);let f=r/2,s=i*Math.tan(f),l=s*n;return this.ortho({left:-l,right:l,bottom:-s,top:s,near:o,far:a})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return Aa(r),Sa(this,r,n,i,o),this.check()}determinant(){return ma(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 ha(this,this),this.check()}invert(){return pa(this,this),this.check()}multiplyLeft(t){return Xr(this,t,this),this.check()}multiplyRight(t){return Xr(this,this,t),this.check()}rotateX(t){return ga(this,this,t),this.check()}rotateY(t){return ba(this,this,t),this.check()}rotateZ(t){return wa(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return va(this,this,t,r),this.check()}scale(t){return ya(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return da(this,this,t),this.check()}transform(t,r){return t.length===4?(r=Ea(r||[-0,-0,-0,-0],t,this),Xt(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=ra(r||[-0,-0],t,this);break;case 3:i=Jt(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Xt(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=na(r||[-0,-0],t,this);break;case 3:n=Zt(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Xt(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])}},tr,rr;function $l(){return tr||(tr=new re([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(tr)),tr}function Zl(){return rr||(rr=new re,Object.freeze(rr)),rr}function Aa(e){if(e>Math.PI*2)throw Error("expected radians")}function Jl(e,t,r,n,i,o){let a=2*o/(r-t),f=2*o/(i-n),s=(r+t)/(r-t),l=(i+n)/(i-n),p=-1,y=-1,g=-2*o;return e[0]=a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=f,e[6]=0,e[7]=0,e[8]=s,e[9]=l,e[10]=p,e[11]=y,e[12]=0,e[13]=0,e[14]=g,e[15]=0,e}function St(e){return St=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},St(e)}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 Ma(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){Ql(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}function Ql(e,t,r){return t=ja(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eh(e,t){return ih(e)||nh(e,t)||rh(e,t)||th()}function th(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
248
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rh(e,t){if(e){if(typeof e=="string")return Ra(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 Ra(e,t)}}function Ra(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 nh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function ih(e){if(Array.isArray(e))return e}function La(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,ja(n.key),n)}}function oh(e,t,r){return t&&La(e.prototype,t),r&&La(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ja(e){var t=ah(e,"string");return St(t)==="symbol"?t:String(t)}function ah(e,t){if(St(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(St(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var nr=function(){function e(r){sh(this,e),this.modules=void 0,this.moduleUniforms=void 0,this.moduleBindings=void 0,this.moduleUniformsChanged=void 0;var n=vt(Object.values(r));B.log(1,"Creating ShaderInputs with modules",n.map(function(p){return p.name}))(),this.modules=r,this.moduleUniforms={},this.moduleBindings={};for(var i=0,o=Object.entries(r);i<o.length;i++){var a=eh(o[i],2),f=a[0],s=a[1],l=f;this.moduleUniforms[l]=s.defaultUniforms||{},this.moduleBindings[l]={}}}var t=e.prototype;return t.destroy=function(){},t.setProps=function(n){for(var i=0,o=Object.keys(n);i<o.length;i++){var a,f=o[i],s=f,l=n[s],p=this.modules[s];if(!p){B.warn("Module ".concat(f," not found"))();continue}var y=this.moduleUniforms[s],g=((a=p.getUniforms)===null||a===void 0?void 0:a.call(p,l,this.moduleUniforms[s]))||l;this.moduleUniforms[s]=Ma(Ma({},y),g)}},t.getModules=function(){return Object.values(this.modules)},t.getUniformValues=function(){return this.moduleUniforms},t.getBindings=function(){for(var n={},i=0,o=Object.values(this.moduleBindings);i<o.length;i++){var a=o[i];Object.assign(n,a)}return n},oh(e)}();function Pt(e){return Pt=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},Pt(e)}function fh(e,t){return hh(e)||lh(e,t)||uh(e,t)||ch()}function ch(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
249
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uh(e,t){if(e){if(typeof e=="string")return Ia(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 Ia(e,t)}}function Ia(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 lh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function hh(e){if(Array.isArray(e))return e}function Da(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,mh(n.key),n)}}function ph(e,t,r){return t&&Da(e.prototype,t),r&&Da(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mh(e){var t=dh(e,"string");return Pt(t)==="symbol"?t:String(t)}function dh(e,t){if(Pt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ir=function(){function e(r){yh(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||z("geometry"),this.topology=r.topology,this.indices=r.indices||null,this.attributes=r.attributes,this.vertexCount=r.vertexCount,this.bufferLayout=r.bufferLayout||[],this.indices&&W(this.indices.usage===k.INDEX)}var 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},ph(e)}();function Na(e,t){if(t instanceof ir)return t;var r=vh(e,t),n=gh(e,t),i=n.attributes,o=n.bufferLayout;return new ir({topology:t.topology||"triangle-list",bufferLayout:o,vertexCount:t.vertexCount,indices:r,attributes:i})}function vh(e,t){if(t.indices){var r=t.indices.value;return e.createBuffer({usage:k.INDEX,data:r})}}function gh(e,t){for(var r=[],n={},i=0,o=Object.entries(t.attributes);i<o.length;i++){var a=fh(o[i],2),f=a[0],s=a[1],l=f;switch(f){case"POSITION":l="positions";break;case"NORMAL":l="normals";break;case"TEXCOORD_0":l="texCoords";break}n[l]=e.createBuffer({data:s.value,id:"".concat(f,"-buffer")});var p=s.value,y=s.size,g=s.normalized;r.push({name:l,format:Dr(p,y,g)})}var w=t._calculateVertexCount(t.attributes,t.indices);return{attributes:n,bufferLayout:r,vertexCount:w}}function xt(e){return xt=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},xt(e)}function Ca(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 ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ca(Object(r),!0).forEach(function(n){bh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ca(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bh(e,t,r){return t=Ua(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fa(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,Ua(n.key),n)}}function wh(e,t,r){return t&&Fa(e.prototype,t),r&&Fa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ua(e){var t=_h(e,"string");return xt(t)==="symbol"?t:String(t)}function _h(e,t){if(xt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Et=function(){e.getDefaultPipelineFactory=function(n){return n._lumaData.defaultPipelineFactory=n._lumaData.defaultPipelineFactory||new e(n),n._lumaData.defaultPipelineFactory};function e(r){Oh(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=ue(ue({},e.defaultProps),n),o=this._hashRenderPipeline(ue({},i));if(!this._pipelineCache[o]){var a=this.device.createRenderPipeline(ue(ue({},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(ue(ue({},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 f=this._getHash(JSON.stringify(n.parameters)),s=this._getHash(JSON.stringify(n.bufferLayout));return"".concat(i,"/").concat(o,"V").concat(a,"T").concat(n.topology,"P").concat(f,"BL").concat(s,"}");default:return"".concat(i,"/").concat(o,"V").concat(a)}},t._getHash=function(n){return this._hashes[n]===void 0&&(this._hashes[n]=this._hashCounter++),this._hashes[n]},wh(e)}();Et.defaultProps=ue(ue({},Ce.defaultProps),{},{vs:void 0,fs:void 0});function At(e){return At=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},At(e)}function Sh(e){return Eh(e)||xh(e)||tn(e)||Ph()}function Ph(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
250
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xh(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Eh(e){if(Array.isArray(e))return en(e)}function Va(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=tn(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
251
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Ga(e,t){return Mh(e)||Th(e,t)||tn(e,t)||Ah()}function Ah(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
252
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tn(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}function Th(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Mh(e){if(Array.isArray(e))return e}function Ba(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 be(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ba(Object(r),!0).forEach(function(n){Rh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rh(e,t,r){return t=Ha(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function za(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,Ha(n.key),n)}}function Lh(e,t,r){return t&&za(e.prototype,t),r&&za(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ha(e){var t=jh(e,"string");return At(t)==="symbol"?t:String(t)}function jh(e,t){if(At(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(At(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ih(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Qr=2,Dh=1e4,ae=function(){function e(r,n){var i,o,a;Ih(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.vertexArray=void 0,this.transformFeedback=null,this.pipeline=void 0,this.shaderInputs=void 0,this._uniformStore=void 0,this._pipelineNeedsUpdate="newly created",this._attributeInfos={},this._gpuGeometry=null,this._getModuleUniforms=void 0,this.props=void 0,this._lastLogTime=0,this._logOpen=!1,this.props=be(be({},e.defaultProps),n),n=this.props,this.id=n.id||z("model"),this.device=r,Object.assign(this.userData,n.userData);var f=Object.fromEntries(((i=this.props.modules)===null||i===void 0?void 0:i.map(function(b){return[b.name,b]}))||[]);this.setShaderInputs(n.shaderInputs||new nr(f));var s=Nh(r),l=(((o=this.props.modules)===null||o===void 0?void 0:o.length)>0?this.props.modules:(a=this.shaderInputs)===null||a===void 0?void 0:a.getModules())||[],p=this.props.shaderAssembler.assembleShaders(be(be({platformInfo:s},this.props),{},{modules:l})),y=p.vs,g=p.fs,w=p.getUniforms;if(this.vs=y,this.fs=g,this._getModuleUniforms=w,this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&(this._gpuGeometry=this.setGeometry(n.geometry)),this.pipelineFactory=n.pipelineFactory||Et.getDefaultPipelineFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=r.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),n.vertexCount&&this.setVertexCount(n.vertexCount),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.indices)throw new Error("Model.props.indices removed. Use props.indexBuffer");n.indexBuffer&&this.setIndexBuffer(n.indexBuffer),n.attributes&&this.setAttributes(n.attributes),n.constantAttributes&&this.setConstantAttributes(n.constantAttributes),n.bindings&&this.setBindings(n.bindings),n.uniforms&&this.setUniforms(n.uniforms),n.moduleSettings&&(console.warn("Model.props.moduleSettings is deprecated. Use Model.shaderInputs.setProps()"),this.updateModuleSettings(n.moduleSettings)),n.transformFeedback&&(this.transformFeedback=n.transformFeedback),Object.seal(this)}var t=e.prototype;return t.destroy=function(){this.pipelineFactory.release(this.pipeline),this._uniformStore.destroy()},t.predraw=function(){this.updateShaderInputs()},t.draw=function(n){this.predraw();try{this._logDrawCallStart(),this.pipeline=this._updatePipeline(),this.pipeline.setBindings(this.bindings),this.pipeline.setUniforms(this.uniforms),this.pipeline.draw({renderPass:n,vertexArray:this.vertexArray,vertexCount:this.vertexCount,instanceCount:this.instanceCount,transformFeedback:this.transformFeedback})}finally{this._logDrawCallEnd()}},t.setGeometry=function(n){var i=n&&Na(this.device,n);return this.setTopology(i.topology||"triangle-list"),this.bufferLayout=ka(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?ka(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){ht(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.setShaderInputs=function(n){this.shaderInputs=n,this._uniformStore=new Ir(this.shaderInputs.modules);for(var i=0,o=Object.keys(this.shaderInputs.modules);i<o.length;i++){var a=o[i],f=this._uniformStore.getManagedUniformBuffer(this.device,a);this.bindings["".concat(a,"Uniforms")]=f}},t.updateShaderInputs=function(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues())},t.updateModuleSettings=function(n){console.warn("Model.updateModuleSettings is deprecated. Use Model.shaderInputs.setProps()");var i=Nr(this._getModuleUniforms(n)),o=i.bindings,a=i.uniforms;Object.assign(this.bindings,o),Object.assign(this.uniforms,a)},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.setTransformFeedback=function(n){this.transformFeedback=n},t.setAttributes=function(n){var i=this;n.indices&&B.warn("Model:".concat(this.id," setAttributes() - indexBuffer should be set using setIndexBuffer()"));for(var o=function(){var p,y=Ga(f[a],2),g=y[0],w=y[1],b=i.bufferLayout.find(function(M){return M.name===g});if(!b)return B.warn("Model(".concat(i.id,'): Missing layout for buffer "').concat(g,'".'))(),"continue";var _=b.attributes?(p=b.attributes)===null||p===void 0?void 0:p.map(function(M){return M.attribute}):[b.name],x=!1,S=Va(_),R;try{for(S.s();!(R=S.n()).done;){var E=R.value,T=i._attributeInfos[E];T&&(i.vertexArray.setBuffer(T.location,w),x=!0)}}catch(M){S.e(M)}finally{S.f()}x||B.warn("Model(".concat(i.id,'): Ignoring buffer "').concat(w.id,'" for unknown attribute "').concat(g,'"'))()},a=0,f=Object.entries(n);a<f.length;a++)var s=o()},t.setConstantAttributes=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=Ga(o[i],2),f=a[0],s=a[1],l=this._attributeInfos[f];l?this.vertexArray.setConstant(l.location,s):B.warn('Model "'.concat(this.id,': Ignoring constant supplied for unknown attribute "').concat(f,'"'))()}},t._setPipelineNeedsUpdate=function(n){this._pipelineNeedsUpdate=this._pipelineNeedsUpdate||n},t._updatePipeline=function(){return this._pipelineNeedsUpdate&&(this.pipeline&&B.log(1,"Model ".concat(this.id,': Recreating pipeline because "').concat(this._pipelineNeedsUpdate,'".'))(),this._pipelineNeedsUpdate=!1,this.pipeline=this.device.createRenderPipeline(be(be({},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=jr(this.pipeline.shaderLayout,this.bufferLayout)),this.pipeline},t._logDrawCallStart=function(){var n=B.level>3?0:Dh;Date.now()-this._lastLogTime<n||(this._lastLogTime=Date.now(),this._logOpen=!0,B.group(Qr,">>> DRAWING MODEL ".concat(this.id),{collapsed:B.level<=2})())},t._logDrawCallEnd=function(){if(this._logOpen){var n=Ur(this.pipeline.shaderLayout);B.table(Qr,n)(),B.groupEnd(Qr)(),this._logOpen=!1}},Lh(e)}();ae.defaultProps=be(be({},Ce.defaultProps),{},{vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],shaderInputs:void 0,pipelineFactory:void 0,transformFeedback:void 0,shaderAssembler:Yt.getDefaultShaderAssembler()});function ka(e,t){var r=Sh(e),n=Va(t),i;try{var o=function(){var f=i.value,s=r.findIndex(function(l){return l.name===f.name});s<0?r.push(f):r[s]=f};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}function Nh(e){return{type:e.info.type,shaderLanguage:e.info.shadingLanguage,shaderLanguageVersion:e.info.shadingLanguageVersion,gpu:e.info.gpu,features:e.features}}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 Ka(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 Ch(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ka(Object(r),!0).forEach(function(n){Fh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ka(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fh(e,t,r){return t=qa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wa(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,qa(n.key),n)}}function Uh(e,t,r){return t&&Wa(e.prototype,t),r&&Wa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function qa(e){var t=Gh(e,"string");return Tt(t)==="symbol"?t:String(t)}function Gh(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 Bh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ya=function(){e.isSupported=function(n){return n.features.has("transform-feedback-webgl2")};function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae.defaultProps;Bh(this,e),this.device=void 0,this.model=void 0,this.transformFeedback=void 0,W(r.features.has("transform-feedback-webgl2"),"Device must support transform feedback"),this.device=r,this.model=new ae(this.device,Ch({id:n.id||"buffer-transform-model",fs:n.fs||Ot({version:300}),topology:n.topology||"point-list"},n)),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}var t=e.prototype;return t.destroy=function(){this.model&&this.model.destroy()},t.delete=function(){this.destroy()},t.run=function(n){var i=this.device.beginRenderPass(n);this.model.draw(i),i.end()},t.update=function(){console.warn("TextureTransform#update() not implemented")},t.getBuffer=function(n){return this.transformFeedback.getBuffer(n)},t.readAsync=function(n){var i=this.getBuffer(n);if(i instanceof k)return i.readAsync();var o=i.buffer,a=i.byteOffset,f=a===void 0?0:a,s=i.byteLength,l=s===void 0?o.byteLength:s;return o.readAsync(f,l)},Uh(e)}();function Mt(e){return Mt=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},Mt(e)}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 $a(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){zh(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}function zh(e,t,r){return t=Ja(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Za(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,Ja(n.key),n)}}function kh(e,t,r){return t&&Za(e.prototype,t),r&&Za(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ja(e){var t=Vh(e,"string");return Mt(t)==="symbol"?t:String(t)}function Vh(e,t){if(Mt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Mt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Kh="transform_output",Qa=function(){function e(r,n){Hh(this,e),this.device=void 0,this.model=void 0,this.sampler=void 0,this.currentIndex=0,this.samplerTextureMap=null,this.bindings=[],this.resources={},this.device=r,this.sampler=r.createSampler({addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"nearest",magFilter:"nearest",mipmapFilter:"nearest"}),this.model=new ae(this.device,$a({id:n.id||"texture-transform-model",fs:n.fs||Ot({version:300,input:n.targetTextureVarying,inputChannels:n.targetTextureChannels,output:Kh}),vertexCount:n.vertexCount},n)),this._initialize(n),Object.seal(this)}var t=e.prototype;return t.destroy=function(){},t.delete=function(){this.destroy()},t.run=function(n){var i=this.bindings[this.currentIndex].framebuffer,o=this.device.beginRenderPass($a({framebuffer:i},n));this.model.draw(o),o.end()},t.update=function(){console.warn("TextureTransform#update() not implemented")},t.getData=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.packed,o=i===void 0?!1:i;throw new Error("getData() not implemented")},t.getTargetTexture=function(){var n=this.bindings[this.currentIndex].targetTexture;return n},t.getFramebuffer=function(){var n=this.bindings[this.currentIndex];return n.framebuffer},t._initialize=function(n){this._updateBindings(n)},t._updateBindings=function(n){this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],n)},t._updateBinding=function(n,i){var o=i.sourceBuffers,a=i.sourceTextures,f=i.targetTexture;if(n||(n={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(n.sourceTextures,a),Object.assign(n.sourceBuffers,o),f){n.targetTexture=f;var s=f.width,l=f.height;n.framebuffer&&n.framebuffer.destroy(),n.framebuffer=this.device.createFramebuffer({id:"transform-framebuffer",width:s,height:l,colorAttachments:[f]}),n.framebuffer.resize({width:s,height:l})}return n},t._setSourceTextureParameters=function(){var n=this.currentIndex,i=this.bindings[n].sourceTextures;for(var o in i)i[o].sampler=this.sampler},kh(e)}();function Rt(e){return Rt=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},Rt(e)}function es(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 Wh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?es(Object(r),!0).forEach(function(n){qh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):es(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qh(e,t,r){return t=ns(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yh(e,t){return Jh(e)||Zh(e,t)||$h(e,t)||Xh()}function Xh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
253
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $h(e,t){if(e){if(typeof e=="string")return ts(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 ts(e,t)}}function ts(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 Zh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function Jh(e){if(Array.isArray(e))return e}function rs(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,ns(n.key),n)}}function Qh(e,t,r){return t&&rs(e.prototype,t),r&&rs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ns(e){var t=ep(e,"string");return Rt(t)==="symbol"?t:String(t)}function ep(e,t){if(Rt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Rt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Z=function(){function e(r){tp(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,f=r.vertexCount,s=f===void 0?null:f;this.id=r.id||z("geometry"),this.topology=r.topology,a&&(this.indices=ArrayBuffer.isView(a)?{value:a,size:1}:a),this.attributes={};for(var l=0,p=Object.entries(i);l<p.length;l++){var y=Yh(p[l],2),g=y[0],w=y[1],b=ArrayBuffer.isView(w)?{value:w}:w;W(ArrayBuffer.isView(b.value),"".concat(this._print(g),": must be typed array or object with value as typed array")),(g==="POSITION"||g==="positions")&&!b.size&&(b.size=3),g==="indices"?(W(!this.indices),this.indices=b):this.attributes[g]=b}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}var t=e.prototype;return t.getVertexCount=function(){return this.vertexCount},t.getAttributes=function(){return this.indices?Wh({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,f=Object.values(n);a<f.length;a++){var s=f[a],l=s.value,p=s.size,y=s.constant;!y&&l&&p>=1&&(o=Math.min(o,l.length/p))}return W(Number.isFinite(o)),o},Qh(e)}();function Ve(e){return Ve=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},Ve(e)}var is;function os(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 as(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?os(Object(r),!0).forEach(function(n){rp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):os(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rp(e,t,r){return t=cs(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ss(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,cs(n.key),n)}}function np(e,t,r){return t&&ss(e.prototype,t),r&&ss(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function cs(e){var t=ip(e,"string");return Ve(t)==="symbol"?t:String(t)}function ip(e,t){if(Ve(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ve(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function op(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ap(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&&rn(e,t)}function rn(e,t){return rn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rn(e,t)}function sp(e){var t=up();return function(){var n=or(e),i;if(t){var o=or(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return fp(this,i)}}function fp(e,t){if(t&&(Ve(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cp(e)}function cp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function up(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function or(e){return or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},or(e)}function lp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var hp=Di(is||(is=lp([`in vec2 aClipSpacePosition;
246
+ }`)}function Dl(e){switch(e){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error("invalid channels: ".concat(e))}}function Zo(e,t){switch(t){case 1:return"vec4(".concat(e,", 0.0, 0.0, 1.0)");case 2:return"vec4(".concat(e,", 0.0, 1.0)");case 3:return"vec4(".concat(e,", 1.0)");case 4:return e;default:throw new Error("invalid channels: ".concat(t))}}var wg=1/Math.PI*180,_g=1/180*Math.PI,Nl={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Nl}};var q=globalThis.mathgl.config;function Jo(e,{precision:t=q.precision}={}){return e=Cl(e),"".concat(parseFloat(e.toPrecision(t)))}function Be(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function qr(e,t,r){let n=q.EPSILON;r&&(q.EPSILON=r);try{if(e===t)return!0;if(Be(e)&&Be(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!qr(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)<=q.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{q.EPSILON=n}}function Cl(e){return Math.round(e/q.EPSILON)*q.EPSILON}function Fl(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 ze=class extends Fl(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:Be(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(q)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Jo(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(!qr(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(q.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 Ul(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 Y(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function $t(e,t,r=""){if(q.debug&&!Ul(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function Yr(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var Zt=class extends ze{get x(){return this[0]}set x(t){this[0]=Y(t)}get y(){return this[1]}set y(t){this[1]=Y(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 Y(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Y(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 Yr(t>=0&&t<this.ELEMENTS,"index is out of range"),Y(this[t])}setComponent(t,r){return Yr(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 ce=typeof Float32Array<"u"?Float32Array:Array;var Ig=Math.PI/180;function Gl(){let e=new ce(2);return ce!=Float32Array&&(e[0]=0,e[1]=0),e}function ta(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 jg=function(){let e=Gl();return function(t,r,n,i,o,a){let f,s;for(r||(r=2),n||(n=0),i?s=Math.min(i*r+n,t.length):s=t.length,f=n;f<s;f+=r)e[0]=t[f],e[1]=t[f+1],o(e,e,a),t[f]=e[0],t[f+1]=e[1];return t}}();function ra(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 Jt(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 na(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 Bl(){let e=new ce(3);return ce!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function zl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ia(e,t,r){let n=t[0],i=t[1],o=t[2],a=r[0],f=r[1],s=r[2];return e[0]=i*s-o*f,e[1]=o*a-n*s,e[2]=n*f-i*a,e}function Qt(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 oa(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 aa(e,t,r){let n=r[0],i=r[1],o=r[2],a=r[3],f=t[0],s=t[1],u=t[2],p=i*u-o*s,y=o*f-n*u,g=n*s-i*f,w=i*g-o*y,b=o*p-n*g,_=n*y-i*p,x=a*2;return p*=x,y*=x,g*=x,w*=2,b*=2,_*=2,e[0]=f+p+w,e[1]=s+y+b,e[2]=u+g+_,e}function sa(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 fa(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 ca(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 ua(e,t){let r=e[0],n=e[1],i=e[2],o=t[0],a=t[1],f=t[2],s=Math.sqrt((r*r+n*n+i*i)*(o*o+a*a+f*f)),u=s&&zl(e,t)/s;return Math.acos(Math.min(Math.max(u,-1),1))}var Cg=function(){let e=Bl();return function(t,r,n,i,o,a){let f,s;for(r||(r=3),n||(n=0),i?s=Math.min(i*r+n,t.length):s=t.length,f=n;f<s;f+=r)e[0]=t[f],e[1]=t[f+1],e[2]=t[f+2],o(e,e,a),t[f]=e[0],t[f+1]=e[1],t[f+2]=e[2];return t}}();var $r=[0,0,0],er,$=class extends Zt{static get ZERO(){return er||(er=new $(0,0,0),Object.freeze(er)),er}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Be(t)?this.copy(t):(q.debug&&(Y(t),Y(r),Y(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 q.debug&&(Y(t.x),Y(t.y),Y(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]=Y(t)}angle(t){return ua(this,t)}cross(t){return ia(this,this,t),this.check()}rotateX({radians:t,origin:r=$r}){return sa(this,this,r,t),this.check()}rotateY({radians:t,origin:r=$r}){return fa(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=$r}){return ca(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Qt(this,this,t),this.check()}transformAsVector(t){return Jt(this,this,t),this.check()}transformByMatrix3(t){return oa(this,this,t),this.check()}transformByMatrix2(t){return na(this,this,t),this.check()}transformByQuaternion(t){return aa(this,this,t),this.check()}};var tr=class extends ze{toString(){let t="[";if(q.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]=Y(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 kl(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 la(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],o=t[6],a=t[7],f=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]=f}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 ha(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],f=t[5],s=t[6],u=t[7],p=t[8],y=t[9],g=t[10],w=t[11],b=t[12],_=t[13],x=t[14],P=t[15],M=r*f-n*a,E=r*s-i*a,T=r*u-o*a,L=n*s-i*f,R=n*u-o*f,j=i*u-o*s,D=p*_-y*b,F=p*x-g*b,N=p*P-w*b,C=y*x-g*_,h=y*P-w*_,c=g*P-w*x,l=M*c-E*h+T*C+L*N-R*F+j*D;return l?(l=1/l,e[0]=(f*c-s*h+u*C)*l,e[1]=(i*h-n*c-o*C)*l,e[2]=(_*j-x*R+P*L)*l,e[3]=(g*R-y*j-w*L)*l,e[4]=(s*N-a*c-u*F)*l,e[5]=(r*c-i*N+o*F)*l,e[6]=(x*T-b*j-P*E)*l,e[7]=(p*j-g*T+w*E)*l,e[8]=(a*h-f*N+u*D)*l,e[9]=(n*N-r*h-o*D)*l,e[10]=(b*R-_*T+P*M)*l,e[11]=(y*T-p*R-w*M)*l,e[12]=(f*F-a*C-s*D)*l,e[13]=(r*C-n*F+i*D)*l,e[14]=(_*E-b*L-x*M)*l,e[15]=(p*L-y*E+g*M)*l,e):null}function pa(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],f=e[6],s=e[7],u=e[8],p=e[9],y=e[10],g=e[11],w=e[12],b=e[13],_=e[14],x=e[15],P=t*a-r*o,M=t*f-n*o,E=r*f-n*a,T=u*b-p*w,L=u*_-y*w,R=p*_-y*b,j=t*R-r*L+n*T,D=o*R-a*L+f*T,F=u*E-p*M+y*P,N=w*E-b*M+_*P;return s*j-i*D+x*F-g*N}function Zr(e,t,r){let n=t[0],i=t[1],o=t[2],a=t[3],f=t[4],s=t[5],u=t[6],p=t[7],y=t[8],g=t[9],w=t[10],b=t[11],_=t[12],x=t[13],P=t[14],M=t[15],E=r[0],T=r[1],L=r[2],R=r[3];return e[0]=E*n+T*f+L*y+R*_,e[1]=E*i+T*s+L*g+R*x,e[2]=E*o+T*u+L*w+R*P,e[3]=E*a+T*p+L*b+R*M,E=r[4],T=r[5],L=r[6],R=r[7],e[4]=E*n+T*f+L*y+R*_,e[5]=E*i+T*s+L*g+R*x,e[6]=E*o+T*u+L*w+R*P,e[7]=E*a+T*p+L*b+R*M,E=r[8],T=r[9],L=r[10],R=r[11],e[8]=E*n+T*f+L*y+R*_,e[9]=E*i+T*s+L*g+R*x,e[10]=E*o+T*u+L*w+R*P,e[11]=E*a+T*p+L*b+R*M,E=r[12],T=r[13],L=r[14],R=r[15],e[12]=E*n+T*f+L*y+R*_,e[13]=E*i+T*s+L*g+R*x,e[14]=E*o+T*u+L*w+R*P,e[15]=E*a+T*p+L*b+R*M,e}function ma(e,t,r){let n=r[0],i=r[1],o=r[2],a,f,s,u,p,y,g,w,b,_,x,P;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],f=t[1],s=t[2],u=t[3],p=t[4],y=t[5],g=t[6],w=t[7],b=t[8],_=t[9],x=t[10],P=t[11],e[0]=a,e[1]=f,e[2]=s,e[3]=u,e[4]=p,e[5]=y,e[6]=g,e[7]=w,e[8]=b,e[9]=_,e[10]=x,e[11]=P,e[12]=a*n+p*i+b*o+t[12],e[13]=f*n+y*i+_*o+t[13],e[14]=s*n+g*i+x*o+t[14],e[15]=u*n+w*i+P*o+t[15]),e}function da(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 ya(e,t,r,n){let i=n[0],o=n[1],a=n[2],f=Math.sqrt(i*i+o*o+a*a),s,u,p,y,g,w,b,_,x,P,M,E,T,L,R,j,D,F,N,C,h,c,l,m;return f<1e-6?null:(f=1/f,i*=f,o*=f,a*=f,u=Math.sin(r),s=Math.cos(r),p=1-s,y=t[0],g=t[1],w=t[2],b=t[3],_=t[4],x=t[5],P=t[6],M=t[7],E=t[8],T=t[9],L=t[10],R=t[11],j=i*i*p+s,D=o*i*p+a*u,F=a*i*p-o*u,N=i*o*p-a*u,C=o*o*p+s,h=a*o*p+i*u,c=i*a*p+o*u,l=o*a*p-i*u,m=a*a*p+s,e[0]=y*j+_*D+E*F,e[1]=g*j+x*D+T*F,e[2]=w*j+P*D+L*F,e[3]=b*j+M*D+R*F,e[4]=y*N+_*C+E*h,e[5]=g*N+x*C+T*h,e[6]=w*N+P*C+L*h,e[7]=b*N+M*C+R*h,e[8]=y*c+_*l+E*m,e[9]=g*c+x*l+T*m,e[10]=w*c+P*l+L*m,e[11]=b*c+M*l+R*m,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function va(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[4],a=t[5],f=t[6],s=t[7],u=t[8],p=t[9],y=t[10],g=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+p*n,e[6]=f*i+y*n,e[7]=s*i+g*n,e[8]=u*i-o*n,e[9]=p*i-a*n,e[10]=y*i-f*n,e[11]=g*i-s*n,e}function ga(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],f=t[2],s=t[3],u=t[8],p=t[9],y=t[10],g=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-p*n,e[2]=f*i-y*n,e[3]=s*i-g*n,e[8]=o*n+u*i,e[9]=a*n+p*i,e[10]=f*n+y*i,e[11]=s*n+g*i,e}function ba(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],f=t[2],s=t[3],u=t[4],p=t[5],y=t[6],g=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+p*n,e[2]=f*i+y*n,e[3]=s*i+g*n,e[4]=u*i-o*n,e[5]=p*i-a*n,e[6]=y*i-f*n,e[7]=g*i-s*n,e}function wa(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],a=r+r,f=n+n,s=i+i,u=r*a,p=n*a,y=n*f,g=i*a,w=i*f,b=i*s,_=o*a,x=o*f,P=o*s;return e[0]=1-y-b,e[1]=p+P,e[2]=g-x,e[3]=0,e[4]=p-P,e[5]=1-u-b,e[6]=w+_,e[7]=0,e[8]=g+x,e[9]=w-_,e[10]=1-u-y,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _a(e,t,r,n,i,o,a){let f=1/(r-t),s=1/(i-n),u=1/(o-a);return e[0]=o*2*f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*s,e[6]=0,e[7]=0,e[8]=(r+t)*f,e[9]=(i+n)*s,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 Vl(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 Oa=Vl;function Hl(e,t,r,n,i,o,a){let f=1/(t-r),s=1/(n-i),u=1/(o-a);return e[0]=-2*f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*f,e[13]=(i+n)*s,e[14]=(a+o)*u,e[15]=1,e}var Sa=Hl;function Pa(e,t,r,n){let i,o,a,f,s,u,p,y,g,w,b=t[0],_=t[1],x=t[2],P=n[0],M=n[1],E=n[2],T=r[0],L=r[1],R=r[2];return Math.abs(b-T)<1e-6&&Math.abs(_-L)<1e-6&&Math.abs(x-R)<1e-6?kl(e):(y=b-T,g=_-L,w=x-R,i=1/Math.sqrt(y*y+g*g+w*w),y*=i,g*=i,w*=i,o=M*w-E*g,a=E*y-P*w,f=P*g-M*y,i=Math.sqrt(o*o+a*a+f*f),i?(i=1/i,o*=i,a*=i,f*=i):(o=0,a=0,f=0),s=g*f-w*a,u=w*o-y*f,p=y*a-g*o,i=Math.sqrt(s*s+u*u+p*p),i?(i=1/i,s*=i,u*=i,p*=i):(s=0,u=0,p=0),e[0]=o,e[1]=s,e[2]=y,e[3]=0,e[4]=a,e[5]=u,e[6]=g,e[7]=0,e[8]=f,e[9]=p,e[10]=w,e[11]=0,e[12]=-(o*b+a*_+f*x),e[13]=-(s*b+u*_+p*x),e[14]=-(y*b+g*_+w*x),e[15]=1,e)}function Kl(){let e=new ce(4);return ce!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function xa(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 Xg=function(){let e=Kl();return function(t,r,n,i,o,a){let f,s;for(r||(r=4),n||(n=0),i?s=Math.min(i*r+n,t.length):s=t.length,f=n;f<s;f+=r)e[0]=t[f],e[1]=t[f+1],e[2]=t[f+2],e[3]=t[f+3],o(e,e,a),t[f]=e[0],t[f+1]=e[1],t[f+2]=e[2],t[f+3]=e[3];return t}}();var en;(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"})(en||(en={}));var Wl=45*Math.PI/180,ql=1,Jr=.1,Qr=500,Yl=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),re=class extends tr{static get IDENTITY(){return $l()}static get ZERO(){return Xl()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return en}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,f,s,u,p,y,g,w,b,_,x){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=a,this[6]=f,this[7]=s,this[8]=u,this[9]=p,this[10]=y,this[11]=g,this[12]=w,this[13]=b,this[14]=_,this[15]=x,this.check()}setRowMajor(t,r,n,i,o,a,f,s,u,p,y,g,w,b,_,x){return this[0]=t,this[1]=o,this[2]=u,this[3]=w,this[4]=r,this[5]=a,this[6]=p,this[7]=b,this[8]=n,this[9]=f,this[10]=y,this[11]=_,this[12]=i,this[13]=s,this[14]=g,this[15]=x,this.check()}toRowMajor(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(Yl)}fromObject(t){return this.check()}fromQuaternion(t){return wa(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:o,near:a=Jr,far:f=Qr}=t;return f===1/0?Zl(this,r,n,i,o,a):_a(this,r,n,i,o,a,f),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return Pa(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:a=Jr,far:f=Qr}=t;return Sa(this,r,n,i,o,a,f),this.check()}orthographic(t){let{fovy:r=Wl,aspect:n=ql,focalDistance:i=1,near:o=Jr,far:a=Qr}=t;Ea(r);let f=r/2,s=i*Math.tan(f),u=s*n;return this.ortho({left:-u,right:u,bottom:-s,top:s,near:o,far:a})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return Ea(r),Oa(this,r,n,i,o),this.check()}determinant(){return pa(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 la(this,this),this.check()}invert(){return ha(this,this),this.check()}multiplyLeft(t){return Zr(this,t,this),this.check()}multiplyRight(t){return Zr(this,this,t),this.check()}rotateX(t){return va(this,this,t),this.check()}rotateY(t){return ga(this,this,t),this.check()}rotateZ(t){return ba(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return ya(this,this,t,r),this.check()}scale(t){return da(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return ma(this,this,t),this.check()}transform(t,r){return t.length===4?(r=xa(r||[-0,-0,-0,-0],t,this),$t(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=ta(r||[-0,-0],t,this);break;case 3:i=Qt(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return $t(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=ra(r||[-0,-0],t,this);break;case 3:n=Jt(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return $t(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])}},rr,nr;function Xl(){return rr||(rr=new re([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(rr)),rr}function $l(){return nr||(nr=new re,Object.freeze(nr)),nr}function Ea(e){if(e>Math.PI*2)throw Error("expected radians")}function Zl(e,t,r,n,i,o){let a=2*o/(r-t),f=2*o/(i-n),s=(r+t)/(r-t),u=(i+n)/(i-n),p=-1,y=-1,g=-2*o;return e[0]=a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=f,e[6]=0,e[7]=0,e[8]=s,e[9]=u,e[10]=p,e[11]=y,e[12]=0,e[13]=0,e[14]=g,e[15]=0,e}function St(e){return St=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},St(e)}function Aa(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 Ta(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Aa(Object(r),!0).forEach(function(n){Jl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Aa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jl(e,t,r){return t=La(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tn(e,t){return rh(e)||th(e,t)||eh(e,t)||Ql()}function Ql(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
247
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eh(e,t){if(e){if(typeof e=="string")return Ma(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 Ma(e,t)}}function Ma(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 th(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function rh(e){if(Array.isArray(e))return e}function Ra(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,La(n.key),n)}}function nh(e,t,r){return t&&Ra(e.prototype,t),r&&Ra(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function La(e){var t=ih(e,"string");return St(t)==="symbol"?t:String(t)}function ih(e,t){if(St(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(St(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ir=function(){function e(r){oh(this,e),this.modules=void 0,this.moduleUniforms=void 0,this.moduleBindings=void 0,this.moduleUniformsChanged=void 0;var n=vt(Object.values(r));B.log(1,"Creating ShaderInputs with modules",n.map(function(p){return p.name}))(),this.modules=r,this.moduleUniforms={},this.moduleBindings={};for(var i=0,o=Object.entries(r);i<o.length;i++){var a=tn(o[i],2),f=a[0],s=a[1],u=f;this.moduleUniforms[u]=s.defaultUniforms||{},this.moduleBindings[u]={}}}var t=e.prototype;return t.destroy=function(){},t.setProps=function(n){for(var i=0,o=Object.keys(n);i<o.length;i++){var a,f=o[i],s=f,u=n[s],p=this.modules[s];if(!p){B.warn("Module ".concat(f," not found"))();continue}var y=this.moduleUniforms[s],g=((a=p.getUniforms)===null||a===void 0?void 0:a.call(p,u,this.moduleUniforms[s]))||u;this.moduleUniforms[s]=Ta(Ta({},y),g)}},t.getModules=function(){return Object.values(this.modules)},t.getUniformValues=function(){return this.moduleUniforms},t.getBindings=function(){for(var n={},i=0,o=Object.values(this.moduleBindings);i<o.length;i++){var a=o[i];Object.assign(n,a)}return n},t.getDebugTable=function(){for(var n={},i=0,o=Object.entries(this.moduleUniforms);i<o.length;i++)for(var a=tn(o[i],2),f=a[0],s=a[1],u=0,p=Object.entries(s);u<p.length;u++){var y,g=tn(p[u],2),w=g[0],b=g[1];n["".concat(f,".").concat(w)]={type:(y=this.modules[f].uniformTypes)===null||y===void 0?void 0:y[w],value:String(b)}}return n},nh(e)}();function Pt(e){return Pt=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},Pt(e)}function ah(e,t){return uh(e)||ch(e,t)||fh(e,t)||sh()}function sh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
248
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fh(e,t){if(e){if(typeof e=="string")return Ia(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 Ia(e,t)}}function Ia(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 ch(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function uh(e){if(Array.isArray(e))return e}function ja(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,hh(n.key),n)}}function lh(e,t,r){return t&&ja(e.prototype,t),r&&ja(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hh(e){var t=ph(e,"string");return Pt(t)==="symbol"?t:String(t)}function ph(e,t){if(Pt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var or=function(){function e(r){mh(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||z("geometry"),this.topology=r.topology,this.indices=r.indices||null,this.attributes=r.attributes,this.vertexCount=r.vertexCount,this.bufferLayout=r.bufferLayout||[],this.indices&&W(this.indices.usage===k.INDEX)}var 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},lh(e)}();function Da(e,t){if(t instanceof or)return t;var r=dh(e,t),n=yh(e,t),i=n.attributes,o=n.bufferLayout;return new or({topology:t.topology||"triangle-list",bufferLayout:o,vertexCount:t.vertexCount,indices:r,attributes:i})}function dh(e,t){if(t.indices){var r=t.indices.value;return e.createBuffer({usage:k.INDEX,data:r})}}function yh(e,t){for(var r=[],n={},i=0,o=Object.entries(t.attributes);i<o.length;i++){var a=ah(o[i],2),f=a[0],s=a[1],u=f;switch(f){case"POSITION":u="positions";break;case"NORMAL":u="normals";break;case"TEXCOORD_0":u="texCoords";break;case"COLOR_0":u="colors";break}n[u]=e.createBuffer({data:s.value,id:"".concat(f,"-buffer")});var p=s.value,y=s.size,g=s.normalized;r.push({name:u,format:Fr(p,y,g)})}var w=t._calculateVertexCount(t.attributes,t.indices);return{attributes:n,bufferLayout:r,vertexCount:w}}function xt(e){return xt=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},xt(e)}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 ue(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){vh(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 vh(e,t,r){return t=Fa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ca(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,Fa(n.key),n)}}function gh(e,t,r){return t&&Ca(e.prototype,t),r&&Ca(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fa(e){var t=bh(e,"string");return xt(t)==="symbol"?t:String(t)}function bh(e,t){if(xt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Et=function(){e.getDefaultPipelineFactory=function(n){return n._lumaData.defaultPipelineFactory=n._lumaData.defaultPipelineFactory||new e(n),n._lumaData.defaultPipelineFactory};function e(r){wh(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=ue(ue({},e.defaultProps),n),o=this._hashRenderPipeline(ue({},i));if(!this._pipelineCache[o]){var a=this.device.createRenderPipeline(ue(ue({},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(ue(ue({},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 f=this._getHash(JSON.stringify(n.parameters)),s=this._getHash(JSON.stringify(n.bufferLayout));return"".concat(i,"/").concat(o,"V").concat(a,"T").concat(n.topology,"P").concat(f,"BL").concat(s,"}");default:return"".concat(i,"/").concat(o,"V").concat(a)}},t._getHash=function(n){return this._hashes[n]===void 0&&(this._hashes[n]=this._hashCounter++),this._hashes[n]},gh(e)}();Et.defaultProps=ue(ue({},Ce.defaultProps),{},{vs:void 0,fs:void 0});function At(e){return At=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},At(e)}function Ua(e,t,r){return t=_h(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _h(e){var t=Oh(e,"string");return At(t)==="symbol"?t:String(t)}function Oh(e,t){if(At(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(At(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ga(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Sh(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.
249
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function Sh(e,t){if(e){if(typeof e=="string")return Ba(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 Ba(e,t)}}function Ba(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 za(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r={},n="Shader Layout for ".concat(t),i=Ga(e.attributes),o;try{for(i.s();!(o=i.n()).done;){var a=o.value;if(a){var f="".concat(a.location," ").concat(a.name,": ").concat(a.type);r["in ".concat(f)]=Ua({},n,a.stepMode||"vertex")}}}catch(g){i.e(g)}finally{i.f()}var s=Ga(e.varyings||[]),u;try{for(s.s();!(u=s.n()).done;){var p=u.value,y="".concat(p.location," ").concat(p.name);r["out ".concat(y)]=Ua({},n,JSON.stringify(p.accessor))}}catch(g){s.e(g)}finally{s.f()}return r}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 Ph(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=nn(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.
250
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function xh(e){return Th(e)||Ah(e)||nn(e)||Eh()}function Eh(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
251
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ah(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Th(e){if(Array.isArray(e))return rn(e)}function ar(e,t){return Lh(e)||Rh(e,t)||nn(e,t)||Mh()}function Mh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
252
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nn(e,t){if(e){if(typeof e=="string")return rn(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 rn(e,t)}}function rn(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 Rh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function Lh(e){if(Array.isArray(e))return e}function ka(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 be(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ka(Object(r),!0).forEach(function(n){Ih(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ih(e,t,r){return t=Wa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Va(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,Wa(n.key),n)}}function jh(e,t,r){return t&&Va(e.prototype,t),r&&Va(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wa(e){var t=Dh(e,"string");return Tt(t)==="symbol"?t:String(t)}function Dh(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 Nh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ve=2,Ch=1e4,ae=function(){function e(r,n){var i,o,a;Nh(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.vertexArray=void 0,this.transformFeedback=null,this.pipeline=void 0,this.shaderInputs=void 0,this._uniformStore=void 0,this._pipelineNeedsUpdate="newly created",this._attributeInfos={},this._gpuGeometry=null,this._getModuleUniforms=void 0,this.props=void 0,this._lastLogTime=0,this._logOpen=!1,this.props=be(be({},e.defaultProps),n),n=this.props,this.id=n.id||z("model"),this.device=r,Object.assign(this.userData,n.userData);var f=Object.fromEntries(((i=this.props.modules)===null||i===void 0?void 0:i.map(function(b){return[b.name,b]}))||[]);this.setShaderInputs(n.shaderInputs||new ir(f));var s=Fh(r),u=(((o=this.props.modules)===null||o===void 0?void 0:o.length)>0?this.props.modules:(a=this.shaderInputs)===null||a===void 0?void 0:a.getModules())||[],p=this.props.shaderAssembler.assembleShaders(be(be({platformInfo:s},this.props),{},{modules:u})),y=p.vs,g=p.fs,w=p.getUniforms;if(this.vs=y,this.fs=g,this._getModuleUniforms=w,this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&(this._gpuGeometry=this.setGeometry(n.geometry)),this.pipelineFactory=n.pipelineFactory||Et.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&&(B.warn("Model.props.moduleSettings is deprecated. Use Model.shaderInputs.setProps()")(),this.updateModuleSettings(n.moduleSettings)),n.transformFeedback&&(this.transformFeedback=n.transformFeedback),Object.seal(this)}var t=e.prototype;return t.destroy=function(){this.pipelineFactory.release(this.pipeline),this._uniformStore.destroy()},t.predraw=function(){this.updateShaderInputs()},t.draw=function(n){this.predraw();try{this._logDrawCallStart(),this.pipeline=this._updatePipeline(),this.pipeline.setBindings(this.bindings),this.pipeline.setUniforms(this.uniforms),this.pipeline.draw({renderPass:n,vertexArray:this.vertexArray,vertexCount:this.vertexCount,instanceCount:this.instanceCount,transformFeedback:this.transformFeedback})}finally{this._logDrawCallEnd()}},t.setGeometry=function(n){var i=n&&Da(this.device,n);return this.setTopology(i.topology||"triangle-list"),this.bufferLayout=Ha(this.bufferLayout,i.bufferLayout),this.vertexArray&&this._setGeometryAttributes(i),i},t._setGeometryAttributes=function(n){this.vertexCount=n.vertexCount,this.setAttributes(n.attributes,"ignore-unknown"),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?Ha(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){pt(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.setShaderInputs=function(n){this.shaderInputs=n,this._uniformStore=new Nr(this.shaderInputs.modules);for(var i=0,o=Object.keys(this.shaderInputs.modules);i<o.length;i++){var a=o[i],f=this._uniformStore.getManagedUniformBuffer(this.device,a);this.bindings["".concat(a,"Uniforms")]=f}},t.updateShaderInputs=function(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues())},t.updateModuleSettings=function(n){B.warn("Model.updateModuleSettings is deprecated. Use Model.shaderInputs.setProps()")();var i=Ur(this._getModuleUniforms(n)),o=i.bindings,a=i.uniforms;Object.assign(this.bindings,o),Object.assign(this.uniforms,a)},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.setTransformFeedback=function(n){this.transformFeedback=n},t.setAttributes=function(n,i){var o=this;n.indices&&B.warn("Model:".concat(this.id," setAttributes() - indexBuffer should be set using setIndexBuffer()"))();for(var a=function(){var y=ar(s[f],2),g=y[0],w=y[1],b=o.bufferLayout.find(function(L){return Ka(L).includes(g)});if(!b)return B.warn("Model(".concat(o.id,'): Missing layout for buffer "').concat(g,'".'))(),"continue";for(var _=Ka(b),x=!1,P=0,M=_;P<M.length;P++){var E=M[P],T=o._attributeInfos[E];T&&(o.vertexArray.setBuffer(T.location,w),x=!0)}!x&&i!=="ignore-unknown"&&B.warn("Model(".concat(o.id,'): Ignoring buffer "').concat(w.id,'" for unknown attribute "').concat(g,'"'))()},f=0,s=Object.entries(n);f<s.length;f++)var u=a()},t.setConstantAttributes=function(n){for(var i=0,o=Object.entries(n);i<o.length;i++){var a=ar(o[i],2),f=a[0],s=a[1],u=this._attributeInfos[f];u?this.vertexArray.setConstant(u.location,s):B.warn('Model "'.concat(this.id,': Ignoring constant supplied for unknown attribute "').concat(f,'"'))()}},t._setPipelineNeedsUpdate=function(n){this._pipelineNeedsUpdate=this._pipelineNeedsUpdate||n},t._updatePipeline=function(){return this._pipelineNeedsUpdate&&(this.pipeline&&B.log(1,"Model ".concat(this.id,': Recreating pipeline because "').concat(this._pipelineNeedsUpdate,'".'))(),this._pipelineNeedsUpdate=!1,this.pipeline=this.device.createRenderPipeline(be(be({},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=Dr(this.pipeline.shaderLayout,this.bufferLayout)),this.pipeline},t._logDrawCallStart=function(){var n=B.level>3?0:Ch;Date.now()-this._lastLogTime<n||(this._lastLogTime=Date.now(),this._logOpen=!0,B.group(Ve,">>> DRAWING MODEL ".concat(this.id),{collapsed:B.level<=2})())},t._logDrawCallEnd=function(){if(this._logOpen){var n=za(this.pipeline.shaderLayout);B.table(Ve,n)();for(var i=this.shaderInputs.getDebugTable(),o=0,a=Object.entries(this.uniforms);o<a.length;o++){var f=ar(a[o],2),s=f[0],u=f[1];i[s]={value:u}}B.table(Ve,i)();var p=this._getAttributeDebugTable();B.table(Ve,this._attributeInfos)(),B.table(Ve,p)(),B.groupEnd(Ve)(),this._logOpen=!1}},t._getAttributeDebugTable=function(){for(var n={},i=0,o=Object.entries(this._attributeInfos);i<o.length;i++){var a=ar(o[i],2),f=a[0],s=a[1];n[s.location]={name:f,type:s.shaderType,values:this._getBufferOrConstantValues(this.vertexArray.attributes[s.location],s.bufferDataType)}}if(this.vertexArray.indexBuffer){var u=this.vertexArray.indexBuffer,p=u.indexType==="uint32"?new Uint32Array(u.debugData):new Uint16Array(u.debugData);n.indices={name:"indices",type:u.indexType,values:p.toString()}}return n},t._getBufferOrConstantValues=function(n,i){var o=Cr(i),a=n instanceof k?new o(n.debugData):n;return a.toString()},jh(e)}();ae.defaultProps=be(be({},Ce.defaultProps),{},{vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],shaderInputs:void 0,pipelineFactory:void 0,transformFeedback:void 0,shaderAssembler:Xt.getDefaultShaderAssembler()});function Ha(e,t){var r=xh(e),n=Ph(t),i;try{var o=function(){var f=i.value,s=r.findIndex(function(u){return u.name===f.name});s<0?r.push(f):r[s]=f};for(n.s();!(i=n.n()).done;)o()}catch(a){n.e(a)}finally{n.f()}return r}function Fh(e){return{type:e.info.type,shaderLanguage:e.info.shadingLanguage,shaderLanguageVersion:e.info.shadingLanguageVersion,gpu:e.info.gpu,features:e.features}}function Ka(e){var t;return e.attributes?(t=e.attributes)===null||t===void 0?void 0:t.map(function(r){return r.attribute}):[e.name]}function Mt(e){return Mt=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},Mt(e)}function qa(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 Uh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qa(Object(r),!0).forEach(function(n){Gh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gh(e,t,r){return t=Xa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ya(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,Xa(n.key),n)}}function Bh(e,t,r){return t&&Ya(e.prototype,t),r&&Ya(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xa(e){var t=zh(e,"string");return Mt(t)==="symbol"?t:String(t)}function zh(e,t){if(Mt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Mt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var $a=function(){e.isSupported=function(n){return n.features.has("transform-feedback-webgl2")};function e(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae.defaultProps;kh(this,e),this.device=void 0,this.model=void 0,this.transformFeedback=void 0,W(r.features.has("transform-feedback-webgl2"),"Device must support transform feedback"),this.device=r,this.model=new ae(this.device,Uh({id:n.id||"buffer-transform-model",fs:n.fs||Ot({version:300}),topology:n.topology||"point-list"},n)),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}var t=e.prototype;return t.destroy=function(){this.model&&this.model.destroy()},t.delete=function(){this.destroy()},t.run=function(n){var i=this.device.beginRenderPass(n);this.model.draw(i),i.end()},t.update=function(){console.warn("TextureTransform#update() not implemented")},t.getBuffer=function(n){return this.transformFeedback.getBuffer(n)},t.readAsync=function(n){var i=this.getBuffer(n);if(i instanceof k)return i.readAsync();var o=i.buffer,a=i.byteOffset,f=a===void 0?0:a,s=i.byteLength,u=s===void 0?o.byteLength:s;return o.readAsync(f,u)},Bh(e)}();function Rt(e){return Rt=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},Rt(e)}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 Ja(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){Vh(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}function Vh(e,t,r){return t=es(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qa(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,es(n.key),n)}}function Hh(e,t,r){return t&&Qa(e.prototype,t),r&&Qa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function es(e){var t=Kh(e,"string");return Rt(t)==="symbol"?t:String(t)}function Kh(e,t){if(Rt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Rt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var qh="transform_output",ts=function(){function e(r,n){Wh(this,e),this.device=void 0,this.model=void 0,this.sampler=void 0,this.currentIndex=0,this.samplerTextureMap=null,this.bindings=[],this.resources={},this.device=r,this.sampler=r.createSampler({addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"nearest",magFilter:"nearest",mipmapFilter:"nearest"}),this.model=new ae(this.device,Ja({id:n.id||"texture-transform-model",fs:n.fs||Ot({version:300,input:n.targetTextureVarying,inputChannels:n.targetTextureChannels,output:qh}),vertexCount:n.vertexCount},n)),this._initialize(n),Object.seal(this)}var t=e.prototype;return t.destroy=function(){},t.delete=function(){this.destroy()},t.run=function(n){var i=this.bindings[this.currentIndex].framebuffer,o=this.device.beginRenderPass(Ja({framebuffer:i},n));this.model.draw(o),o.end()},t.update=function(){console.warn("TextureTransform#update() not implemented")},t.getData=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.packed,o=i===void 0?!1:i;throw new Error("getData() not implemented")},t.getTargetTexture=function(){var n=this.bindings[this.currentIndex].targetTexture;return n},t.getFramebuffer=function(){var n=this.bindings[this.currentIndex];return n.framebuffer},t._initialize=function(n){this._updateBindings(n)},t._updateBindings=function(n){this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],n)},t._updateBinding=function(n,i){var o=i.sourceBuffers,a=i.sourceTextures,f=i.targetTexture;if(n||(n={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(n.sourceTextures,a),Object.assign(n.sourceBuffers,o),f){n.targetTexture=f;var s=f.width,u=f.height;n.framebuffer&&n.framebuffer.destroy(),n.framebuffer=this.device.createFramebuffer({id:"transform-framebuffer",width:s,height:u,colorAttachments:[f]}),n.framebuffer.resize({width:s,height:u})}return n},t._setSourceTextureParameters=function(){var n=this.currentIndex,i=this.bindings[n].sourceTextures;for(var o in i)i[o].sampler=this.sampler},Hh(e)}();function Lt(e){return Lt=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},Lt(e)}function rs(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 Yh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rs(Object(r),!0).forEach(function(n){Xh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xh(e,t,r){return t=os(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $h(e,t){return ep(e)||Qh(e,t)||Jh(e,t)||Zh()}function Zh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
253
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jh(e,t){if(e){if(typeof e=="string")return ns(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 ns(e,t)}}function ns(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 Qh(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function ep(e){if(Array.isArray(e))return e}function is(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,os(n.key),n)}}function tp(e,t,r){return t&&is(e.prototype,t),r&&is(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function os(e){var t=rp(e,"string");return Lt(t)==="symbol"?t:String(t)}function rp(e,t){if(Lt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Lt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function np(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Z=function(){function e(r){np(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,f=r.vertexCount,s=f===void 0?null:f;this.id=r.id||z("geometry"),this.topology=r.topology,a&&(this.indices=ArrayBuffer.isView(a)?{value:a,size:1}:a),this.attributes={};for(var u=0,p=Object.entries(i);u<p.length;u++){var y=$h(p[u],2),g=y[0],w=y[1],b=ArrayBuffer.isView(w)?{value:w}:w;W(ArrayBuffer.isView(b.value),"".concat(this._print(g),": must be typed array or object with value as typed array")),(g==="POSITION"||g==="positions")&&!b.size&&(b.size=3),g==="indices"?(W(!this.indices),this.indices=b):this.attributes[g]=b}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}var t=e.prototype;return t.getVertexCount=function(){return this.vertexCount},t.getAttributes=function(){return this.indices?Yh({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,f=Object.values(n);a<f.length;a++){var s=f[a],u=s.value,p=s.size,y=s.constant;!y&&u&&p>=1&&(o=Math.min(o,u.length/p))}return W(Number.isFinite(o)),o},tp(e)}();function He(e){return 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},He(e)}var as;function ss(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 fs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ss(Object(r),!0).forEach(function(n){ip(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ss(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ip(e,t,r){return t=ls(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cs(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,ls(n.key),n)}}function op(e,t,r){return t&&cs(e.prototype,t),r&&cs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ls(e){var t=ap(e,"string");return He(t)==="symbol"?t:String(t)}function ap(e,t){if(He(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(He(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fp(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&&on(e,t)}function on(e,t){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},on(e,t)}function cp(e){var t=hp();return function(){var n=sr(e),i;if(t){var o=sr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return up(this,i)}}function up(e,t){if(t&&(He(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lp(e)}function lp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function sr(e){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sr(e)}function pp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var mp=ji(as||(as=pp([`in vec2 aClipSpacePosition;
254
254
  in vec2 aTexCoord;
255
255
  in vec2 aCoordinate;
256
256
 
@@ -279,9 +279,9 @@ void main(void) {
279
279
  coordinate = aCoordinate;
280
280
  uv = aTexCoord;
281
281
  }
282
- `]))),fs=[-1,-1,1,-1,-1,1,1,1],us=function(e){ap(r,e);var t=sp(r);function r(n,i){op(this,r);var o=fs.map(function(a){return a===-1?0:a});return t.call(this,n,as(as({},i),{},{vs:hp,vertexCount:4,geometry:new Z({topology:"triangle-strip",vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(fs)},aTexCoord:{size:2,value:new Float32Array(o)},aCoordinate:{size:2,value:new Float32Array(o)}}})}))}return np(r)}(ae);function Lt(e){return Lt=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},Lt(e)}function ls(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,mp(n.key),n)}}function pp(e,t,r){return t&&ls(e.prototype,t),r&&ls(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mp(e){var t=dp(e,"string");return Lt(t)==="symbol"?t:String(t)}function dp(e,t){if(Lt(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Lt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ee=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yp(this,e),this.id=void 0,this.matrix=new re,this.display=!0,this.position=new $,this.rotation=new $,this.scale=new $(1,1,1),this.userData={},this.props={};var n=r.id;this.id=n||z(this.constructor.name),this._setScenegraphNodeProps(r)}var 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 W(n.length===3,"setPosition requires vector argument"),this.position=n,this},t.setRotation=function(n){return W(n.length===3,"setRotation requires vector argument"),this.rotation=n,this},t.setScale=function(n){return W(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,a=n.scale,f=n.update,s=f===void 0?!0:f;return i&&this.setPosition(i),o&&this.setRotation(o),a&&this.setScale(a),s&&this.updateMatrix(),this},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,a=n.scale;return i&&this.setPosition(i),o&&this.setRotation(o),a&&this.setScale(a),this.updateMatrix(),this},t.getCoordinateUniforms=function(n,i){W(n),i=i||this.matrix;var o=new re(n).multiplyRight(i),a=o.invert(),f=a.transpose();return{viewMatrix:n,modelMatrix:i,objectMatrix:i,worldMatrix:o,worldInverseMatrix:a,worldInverseTransposeMatrix:f}},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)},pp(e)}();function He(e){return 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},He(e)}function vp(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=an(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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
283
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,f=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function gp(e){return _p(e)||wp(e)||an(e)||bp()}function bp(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
284
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wp(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _p(e){if(Array.isArray(e))return nn(e)}function Op(e,t){return xp(e)||Pp(e,t)||an(e,t)||Sp()}function Sp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
285
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function an(e,t){if(e){if(typeof e=="string")return nn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nn(e,t)}}function nn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){l=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return f}}function xp(e){if(Array.isArray(e))return e}function hs(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,Ap(n.key),n)}}function Ep(e,t,r){return t&&hs(e.prototype,t),r&&hs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ap(e){var t=Tp(e,"string");return He(t)==="symbol"?t:String(t)}function Tp(e,t){if(He(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(He(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ar(){return typeof Reflect<"u"&&Reflect.get?ar=Reflect.get.bind():ar=function(t,r,n){var i=Rp(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},ar.apply(this,arguments)}function Rp(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ke(e),e!==null););return e}function Lp(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&&on(e,t)}function on(e,t){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},on(e,t)}function jp(e){var t=Np();return function(){var n=Ke(e),i;if(t){var o=Ke(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ip(this,i)}}function Ip(e,t){if(t&&(He(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dp(e)}function Dp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Np(){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 Ke(e){return Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ke(e)}var ps=function(e){Lp(r,e);var t=jp(r);function r(){var i,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mp(this,r),o=Array.isArray(o)?{children:o}:o;var a=o,f=a.children,s=f===void 0?[]:f;return B.assert(s.every(function(l){return l instanceof Ee}),"every child must an instance of ScenegraphNode"),i=t.call(this,o),i.children=void 0,i.children=s,i}var n=r.prototype;return n.getBounds=function(){var o=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse(function(a,f){var s=f.worldMatrix,l=a.getBounds();if(l){var p=Op(l,2),y=p[0],g=p[1],w=new $(y).add(g).divide([2,2,2]);s.transformAsPoint(w,w);var b=new $(g).subtract(y).divide([2,2,2]);s.transformAsVector(b,b);for(var _=0;_<8;_++)for(var x=new $(_&1?-1:1,_&2?-1:1,_&4?-1:1).multiply(b).add(w),S=0;S<3;S++)o[0][S]=Math.min(o[0][S],x[S]),o[1][S]=Math.max(o[1][S],x[S])}}),Number.isFinite(o[0][0])?o:null},n.destroy=function(){this.children.forEach(function(o){return o.destroy()}),this.removeAll(),ar(Ke(r.prototype),"destroy",this).call(this)},n.add=function(){for(var o=arguments.length,a=new Array(o),f=0;f<o;f++)a[f]=arguments[f];for(var s=0,l=a;s<l.length;s++){var p=l[s];Array.isArray(p)?this.add.apply(this,gp(p)):this.children.push(p)}return this},n.remove=function(o){var a=this.children,f=a.indexOf(o);return f>-1&&a.splice(f,1),this},n.removeAll=function(){return this.children=[],this},n.traverse=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=a.worldMatrix,s=f===void 0?new re:f,l=new re(s).multiplyRight(this.matrix),p=vp(this.children),y;try{for(p.s();!(y=p.n()).done;){var g=y.value;g instanceof r?g.traverse(o,{worldMatrix:l}):o(g,{worldMatrix:l})}}catch(w){p.e(w)}finally{p.f()}},Ep(r)}(Ee);function We(e){return We=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},We(e)}function ms(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,Fp(n.key),n)}}function Cp(e,t,r){return t&&ms(e.prototype,t),r&&ms(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fp(e){var t=Up(e,"string");return We(t)==="symbol"?t:String(t)}function Up(e,t){if(We(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(We(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bp(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&&sn(e,t)}function sn(e,t){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sn(e,t)}function zp(e){var t=Hp();return function(){var n=sr(e),i;if(t){var o=sr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return kp(this,i)}}function kp(e,t){if(t&&(We(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vp(e)}function Vp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function sr(e){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sr(e)}var ds=function(e){Bp(r,e);var t=zp(r);function r(i){var o;return Gp(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)},Cp(r)}(Ee);function qe(e){return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qe(e)}function ys(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 fn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ys(Object(r),!0).forEach(function(n){Kp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ys(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kp(e,t,r){return t=gs(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vs(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,gs(n.key),n)}}function Wp(e,t,r){return t&&vs(e.prototype,t),r&&vs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function gs(e){var t=qp(e,"string");return qe(t)==="symbol"?t:String(t)}function qp(e,t){if(qe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xp(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&&cn(e,t)}function cn(e,t){return cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cn(e,t)}function $p(e){var t=Qp();return function(){var n=fr(e),i;if(t){var o=fr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Zp(this,i)}}function Zp(e,t){if(t&&(qe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jp(e)}function Jp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fr(e){return fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fr(e)}var em={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Ye=function(e){Xp(r,e);var t=$p(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yp(this,r);var i=n.id,o=i===void 0?z("truncated-code-geometry"):i,a=tm(n),f=a.indices,s=a.attributes;return t.call(this,fn(fn({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:fn({POSITION:{size:3,value:s.POSITION},NORMAL:{size:3,value:s.NORMAL},TEXCOORD_0:{size:2,value:s.TEXCOORD_0}},n.attributes)}))}return Wp(r)}(Z);function tm(){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,f=e.nradial,s=f===void 0?10:f,l=e.nvertical,p=l===void 0?10:l,y=e.verticalAxis,g=y===void 0?"y":y,w=e.topCap,b=w===void 0?!1:w,_=e.bottomCap,x=_===void 0?!1:_,S=(b?2:0)+(x?2:0),R=(s+1)*(p+1+S),E=Math.atan2(r-i,a),T=Math.sin,M=Math.cos,L=Math.PI,I=M(E),D=T(E),F=b?-2:0,N=p+(x?2:0),C=s+1,h=new Uint16Array(s*(p+S)*6),c=em[g],u=new Float32Array(R*3),m=new Float32Array(R*3),v=new Float32Array(R*2),d=0,O=0,P=F;P<=N;P++){var A=P/p,U=a*A,j=void 0;P<0?(U=0,A=1,j=r):P>p?(U=a,A=1,j=i):j=r+(i-r)*(P/p),(P===-2||P===p+2)&&(j=0,A=0),U-=a/2;for(var G=0;G<C;G++){var ne=T(G*L*2/s),Q=M(G*L*2/s);u[d+c[0]]=ne*j,u[d+c[1]]=U,u[d+c[2]]=Q*j,m[d+c[0]]=P<0||P>p?0:ne*I,m[d+c[1]]=P<0?-1:P>p?1:D,m[d+c[2]]=P<0||P>p?0:Q*I,v[O+0]=G/s,v[O+1]=A,O+=2,d+=3}}for(var H=0;H<p+S;H++)for(var X=0;X<s;X++){var se=(H*s+X)*6;h[se+0]=C*(H+0)+0+X,h[se+1]=C*(H+0)+1+X,h[se+2]=C*(H+1)+1+X,h[se+3]=C*(H+0)+0+X,h[se+4]=C*(H+1)+1+X,h[se+5]=C*(H+1)+0+X}return{indices:h,attributes:{POSITION:u,NORMAL:m,TEXCOORD_0:v}}}function Xe(e){return Xe=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},Xe(e)}function bs(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 ws(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bs(Object(r),!0).forEach(function(n){rm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rm(e,t,r){return t=Os(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _s(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,Os(n.key),n)}}function nm(e,t,r){return t&&_s(e.prototype,t),r&&_s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Os(e){var t=im(e,"string");return Xe(t)==="symbol"?t:String(t)}function im(e,t){if(Xe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Xe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function om(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function am(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&&un(e,t)}function un(e,t){return un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},un(e,t)}function sm(e){var t=um();return function(){var n=cr(e),i;if(t){var o=cr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return fm(this,i)}}function fm(e,t){if(t&&(Xe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cm(e)}function cm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function um(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cr(e)}var Ss=function(e){am(r,e);var t=sm(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};om(this,r);var i=n.id,o=i===void 0?z("cone-geometry"):i,a=n.radius,f=a===void 0?1:a,s=n.cap,l=s===void 0?!0:s;return t.call(this,ws(ws({},n),{},{id:o,topRadius:0,topCap:Boolean(l),bottomCap:Boolean(l),bottomRadius:f}))}return nm(r)}(Ye);function $e(e){return $e=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},$e(e)}function Ps(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 we(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ps(Object(r),!0).forEach(function(n){lm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ps(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lm(e,t,r){return t=Es(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xs(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,Es(n.key),n)}}function hm(e,t,r){return t&&xs(e.prototype,t),r&&xs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Es(e){var t=pm(e,"string");return $e(t)==="symbol"?t:String(t)}function pm(e,t){if($e(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($e(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dm(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&&ln(e,t)}function ln(e,t){return ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ln(e,t)}function ym(e){var t=bm();return function(){var n=ur(e),i;if(t){var o=ur(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return vm(this,i)}}function vm(e,t){if(t&&($e(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gm(e)}function gm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ur(e){return ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ur(e)}var As=function(e){dm(r,e);var t=ym(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};mm(this,r);var i=n.id,o=i===void 0?z("cube-geometry"):i,a=n.indices,f=a===void 0?!0:a;return t.call(this,f?we(we({},n),{},{id:o,topology:"triangle-list",indices:{size:1,value:wm},attributes:we(we({},Am),n.attributes)}):we(we({},n),{},{id:o,topology:"triangle-list",indices:void 0,attributes:we(we({},Tm),n.attributes)}))}return hm(r)}(Z),wm=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]),_m=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]),Om=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]),Sm=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]),Pm=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]),xm=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]),Em=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]),Am={POSITION:{size:3,value:_m},NORMAL:{size:3,value:Om},TEXCOORD_0:{size:2,value:Sm}},Tm={POSITION:{size:4,value:Pm},TEXCOORD_0:{size:2,value:xm},COLOR_0:{size:3,value:Em}};function Ze(e){return Ze=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},Ze(e)}function Ts(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 Ms(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ts(Object(r),!0).forEach(function(n){Mm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ts(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mm(e,t,r){return t=Ls(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rs(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,Ls(n.key),n)}}function Rm(e,t,r){return t&&Rs(e.prototype,t),r&&Rs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ls(e){var t=Lm(e,"string");return Ze(t)==="symbol"?t:String(t)}function Lm(e,t){if(Ze(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ze(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Im(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&&hn(e,t)}function hn(e,t){return hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hn(e,t)}function Dm(e){var t=Fm();return function(){var n=lr(e),i;if(t){var o=lr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Nm(this,i)}}function Nm(e,t){if(t&&(Ze(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cm(e)}function Cm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function lr(e){return lr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lr(e)}var js=function(e){Im(r,e);var t=Dm(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jm(this,r);var i=n.id,o=i===void 0?z("cylinder-geometry"):i,a=n.radius,f=a===void 0?1:a;return t.call(this,Ms(Ms({},n),{},{id:o,bottomRadius:f,topRadius:f}))}return Rm(r)}(Ye);function Je(e){return Je=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},Je(e)}function Is(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 hr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Is(Object(r),!0).forEach(function(n){Um(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Is(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Um(e,t,r){return t=Ns(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ds(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,Ns(n.key),n)}}function Gm(e,t,r){return t&&Ds(e.prototype,t),r&&Ds(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ns(e){var t=Bm(e,"string");return Je(t)==="symbol"?t:String(t)}function Bm(e,t){if(Je(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Je(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function km(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&&pn(e,t)}function pn(e,t){return pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},pn(e,t)}function Vm(e){var t=Wm();return function(){var n=pr(e),i;if(t){var o=pr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Hm(this,i)}}function Hm(e,t){if(t&&(Je(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Km(e)}function Km(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pr(e){return pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pr(e)}var qm=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],Ym=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],Cs=function(e){km(r,e);var t=Vm(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};zm(this,r);var i=n.id,o=i===void 0?z("ico-sphere-geometry"):i,a=Xm(n),f=a.indices,s=a.attributes;return t.call(this,hr(hr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:hr(hr({},s),n.attributes)}))}return Gm(r)}(Z);function Xm(e){var t=e.iterations,r=t===void 0?0:t,n=Math.PI,i=n*2,o=[].concat(qm),a=[].concat(Ym);o.push(),a.push();for(var f=function(){var gr={};return function(le,he){le*=3,he*=3;var Xs=le<he?le:he,$s=le>he?le:he,br="".concat(Xs,"|").concat($s);if(br in gr)return gr[br];var Zs=o[le],Js=o[le+1],Qs=o[le+2],ef=o[he],tf=o[he+1],rf=o[he+2],It=(Zs+ef)/2,Dt=(Js+tf)/2,Nt=(Qs+rf)/2,wr=Math.sqrt(It*It+Dt*Dt+Nt*Nt);return It/=wr,Dt/=wr,Nt/=wr,o.push(It,Dt,Nt),gr[br]=o.length/3-1}}(),s=0;s<r;s++){for(var l=[],p=0;p<a.length;p+=3){var y=f(a[p+0],a[p+1]),g=f(a[p+1],a[p+2]),w=f(a[p+2],a[p+0]);l.push(w,a[p+0],y,y,a[p+1],g,g,a[p+2],w,y,g,w)}a=l}for(var b=new Array(o.length),_=new Array(o.length/3*2),x=a.length,S=x-3;S>=0;S-=3){var R=a[S+0],E=a[S+1],T=a[S+2],M=R*3,L=E*3,I=T*3,D=R*2,F=E*2,N=T*2,C=o[M+0],h=o[M+1],c=o[M+2],u=Math.acos(c/Math.sqrt(C*C+h*h+c*c)),m=Math.atan2(h,C)+n,v=u/n,d=1-m/i,O=o[L+0],P=o[L+1],A=o[L+2],U=Math.acos(A/Math.sqrt(O*O+P*P+A*A)),j=Math.atan2(P,O)+n,G=U/n,ne=1-j/i,Q=o[I+0],H=o[I+1],X=o[I+2],se=Math.acos(X/Math.sqrt(Q*Q+H*H+X*X)),Ws=Math.atan2(H,Q)+n,yn=se/n,jt=1-Ws/i,qs=[Q-O,H-P,X-A],Ys=[C-O,h-P,c-A],ee=new $(qs).cross(Ys).normalize(),V=void 0;(d===0||ne===0||jt===0)&&(d===0||d>.5)&&(ne===0||ne>.5)&&(jt===0||jt>.5)&&(o.push(o[M+0],o[M+1],o[M+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=v,b[V*3+0]=ee.x,b[V*3+1]=ee.y,b[V*3+2]=ee.z,o.push(o[L+0],o[L+1],o[L+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=G,b[V*3+0]=ee.x,b[V*3+1]=ee.y,b[V*3+2]=ee.z,o.push(o[I+0],o[I+1],o[I+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=yn,b[V*3+0]=ee.x,b[V*3+1]=ee.y,b[V*3+2]=ee.z),b[M+0]=b[L+0]=b[I+0]=ee.x,b[M+1]=b[L+1]=b[I+1]=ee.y,b[M+2]=b[L+2]=b[I+2]=ee.z,_[D+0]=d,_[D+1]=v,_[F+0]=ne,_[F+1]=G,_[N+0]=jt,_[N+1]=yn}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(o)},NORMAL:{size:3,value:new Float32Array(b)},TEXCOORD_0:{size:2,value:new Float32Array(_)}}}}function Fs(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],f=a.constant,s=a.value,l=a.size;if(!(f||!l)){for(var p=new s.constructor(n*l),y=0;y<n;++y)for(var g=t.value[y],w=0;w<l;w++)p[y*l+w]=s[g*l+w];i[o]={size:l,value:p}}}return{attributes:Object.assign({},r,i)}}function Qe(e){return Qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(e)}function Us(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Us(Object(r),!0).forEach(function(n){$m(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Us(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $m(e,t,r){return t=Bs(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gs(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,Bs(n.key),n)}}function Zm(e,t,r){return t&&Gs(e.prototype,t),r&&Gs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bs(e){var t=Jm(e,"string");return Qe(t)==="symbol"?t:String(t)}function Jm(e,t){if(Qe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Qe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ed(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&&mn(e,t)}function mn(e,t){return mn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mn(e,t)}function td(e){var t=id();return function(){var n=dr(e),i;if(t){var o=dr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return rd(this,i)}}function rd(e,t){if(t&&(Qe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nd(e)}function nd(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}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}}function dr(e){return dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dr(e)}var zs=function(e){ed(r,e);var t=td(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qm(this,r);var i=n.id,o=i===void 0?z("plane-geometry"):i,a=od(n),f=a.indices,s=a.attributes;return t.call(this,mr(mr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:mr(mr({},s),n.attributes)}))}return Zm(r)}(Z);function od(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,f=e.unpack,s=f===void 0?!1:f,l=r.split(","),p=e["".concat(l[0],"len")]||1,y=e["".concat(l[1],"len")]||1,g=e["n".concat(l[0])]||1,w=e["n".concat(l[1])]||1,b=(g+1)*(w+1),_=new Float32Array(b*3),x=new Float32Array(b*3),S=new Float32Array(b*2);a&&(p=-p);for(var R=0,E=0,T=0;T<=w;T++)for(var M=0;M<=g;M++){var L=M/g,I=T/w;switch(S[R+0]=a?1-L:L,S[R+1]=I,r){case"x,y":_[E+0]=p*L-p*.5,_[E+1]=y*I-y*.5,_[E+2]=i,x[E+0]=0,x[E+1]=0,x[E+2]=a?1:-1;break;case"x,z":_[E+0]=p*L-p*.5,_[E+1]=i,_[E+2]=y*I-y*.5,x[E+0]=0,x[E+1]=a?1:-1,x[E+2]=0;break;case"y,z":_[E+0]=i,_[E+1]=p*L-p*.5,_[E+2]=y*I-y*.5,x[E+0]=a?1:-1,x[E+1]=0,x[E+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}R+=2,E+=3}for(var D=g+1,F=new Uint16Array(g*w*6),N=0;N<w;N++)for(var C=0;C<g;C++){var h=(N*g+C)*6;F[h+0]=(N+0)*D+C,F[h+1]=(N+1)*D+C,F[h+2]=(N+0)*D+C+1,F[h+3]=(N+1)*D+C,F[h+4]=(N+1)*D+C+1,F[h+5]=(N+0)*D+C+1}var c={indices:{size:1,value:F},attributes:{POSITION:{size:3,value:_},NORMAL:{size:3,value:x},TEXCOORD_0:{size:2,value:S}}};return s?Fs(c):c}function et(e){return et=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},et(e)}function ks(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 yr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ks(Object(r),!0).forEach(function(n){ad(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ks(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ad(e,t,r){return t=Hs(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vs(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,Hs(n.key),n)}}function sd(e,t,r){return t&&Vs(e.prototype,t),r&&Vs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hs(e){var t=fd(e,"string");return et(t)==="symbol"?t:String(t)}function fd(e,t){if(et(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(et(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ud(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&&dn(e,t)}function dn(e,t){return dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},dn(e,t)}function ld(e){var t=md();return function(){var n=vr(e),i;if(t){var o=vr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return hd(this,i)}}function hd(e,t){if(t&&(et(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pd(e)}function pd(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}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}}function vr(e){return vr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vr(e)}var Ks=function(e){ud(r,e);var t=ld(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};cd(this,r);var i=n.id,o=i===void 0?z("sphere-geometry"):i,a=dd(n),f=a.indices,s=a.attributes;return t.call(this,yr(yr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:yr(yr({},s),n.attributes)}))}return sd(r)}(Z);function dd(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,f=a-o,s=0,l=2*Math.PI,p=l-s,y=(r+1)*(i+1),g=function(ne,Q,H,X,se){return e.radius||1},w=new Float32Array(y*3),b=new Float32Array(y*3),_=new Float32Array(y*2),x=y>65535?Uint32Array:Uint16Array,S=new x(r*i*6),R=0;R<=r;R++)for(var E=0;E<=i;E++){var T=E/i,M=R/r,L=E+R*(i+1),I=L*2,D=L*3,F=p*T,N=f*M,C=Math.sin(F),h=Math.cos(F),c=Math.sin(N),u=Math.cos(N),m=h*c,v=u,d=C*c,O=g(m,v,d,T,M);w[D+0]=O*m,w[D+1]=O*v,w[D+2]=O*d,b[D+0]=m,b[D+1]=v,b[D+2]=d,_[I+0]=T,_[I+1]=1-M}for(var P=i+1,A=0;A<i;A++)for(var U=0;U<r;U++){var j=(A*r+U)*6;S[j+0]=U*P+A,S[j+1]=U*P+A+1,S[j+2]=(U+1)*P+A,S[j+3]=(U+1)*P+A,S[j+4]=U*P+A+1,S[j+5]=(U+1)*P+A+1}return{indices:{size:1,value:S},attributes:{POSITION:{size:3,value:w},NORMAL:{size:3,value:b},TEXCOORD_0:{size:2,value:_}}}}return cf(yd);})();
282
+ `]))),us=[-1,-1,1,-1,-1,1,1,1],hs=function(e){fp(r,e);var t=cp(r);function r(n,i){sp(this,r);var o=us.map(function(a){return a===-1?0:a});return t.call(this,n,fs(fs({},i),{},{vs:mp,vertexCount:4,geometry:new Z({topology:"triangle-strip",vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(us)},aTexCoord:{size:2,value:new Float32Array(o)},aCoordinate:{size:2,value:new Float32Array(o)}}})}))}return op(r)}(ae);function It(e){return It=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},It(e)}function ps(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,yp(n.key),n)}}function dp(e,t,r){return t&&ps(e.prototype,t),r&&ps(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function yp(e){var t=vp(e,"string");return It(t)==="symbol"?t:String(t)}function vp(e,t){if(It(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(It(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ae=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gp(this,e),this.id=void 0,this.matrix=new re,this.display=!0,this.position=new $,this.rotation=new $,this.scale=new $(1,1,1),this.userData={},this.props={};var n=r.id;this.id=n||z(this.constructor.name),this._setScenegraphNodeProps(r)}var 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 W(n.length===3,"setPosition requires vector argument"),this.position=n,this},t.setRotation=function(n){return W(n.length===3,"setRotation requires vector argument"),this.rotation=n,this},t.setScale=function(n){return W(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,a=n.scale,f=n.update,s=f===void 0?!0:f;return i&&this.setPosition(i),o&&this.setRotation(o),a&&this.setScale(a),s&&this.updateMatrix(),this},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,a=n.scale;return i&&this.setPosition(i),o&&this.setRotation(o),a&&this.setScale(a),this.updateMatrix(),this},t.getCoordinateUniforms=function(n,i){W(n),i=i||this.matrix;var o=new re(n).multiplyRight(i),a=o.invert(),f=a.transpose();return{viewMatrix:n,modelMatrix:i,objectMatrix:i,worldMatrix:o,worldInverseMatrix:a,worldInverseTransposeMatrix:f}},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)},dp(e)}();function Ke(e){return Ke=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},Ke(e)}function bp(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=fn(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.
283
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,f;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,f=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw f}}}}function wp(e){return Sp(e)||Op(e)||fn(e)||_p()}function _p(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
284
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Op(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Sp(e){if(Array.isArray(e))return an(e)}function Pp(e,t){return Ap(e)||Ep(e,t)||fn(e,t)||xp()}function xp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
285
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fn(e,t){if(e){if(typeof e=="string")return an(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 an(e,t)}}function an(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,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,f=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(f.push(n.value),f.length!==t);s=!0);}catch(p){u=!0,i=p}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return f}}function Ap(e){if(Array.isArray(e))return e}function ms(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,Mp(n.key),n)}}function Tp(e,t,r){return t&&ms(e.prototype,t),r&&ms(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mp(e){var t=Rp(e,"string");return Ke(t)==="symbol"?t:String(t)}function Rp(e,t){if(Ke(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ke(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fr(){return typeof Reflect<"u"&&Reflect.get?fr=Reflect.get.bind():fr=function(t,r,n){var i=Ip(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:n):o.value}},fr.apply(this,arguments)}function Ip(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=We(e),e!==null););return e}function jp(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&&sn(e,t)}function sn(e,t){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sn(e,t)}function Dp(e){var t=Fp();return function(){var n=We(e),i;if(t){var o=We(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Np(this,i)}}function Np(e,t){if(t&&(Ke(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cp(e)}function Cp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fp(){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 We(e){return We=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},We(e)}var ds=function(e){jp(r,e);var t=Dp(r);function r(){var i,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Lp(this,r),o=Array.isArray(o)?{children:o}:o;var a=o,f=a.children,s=f===void 0?[]:f;return B.assert(s.every(function(u){return u instanceof Ae}),"every child must an instance of ScenegraphNode"),i=t.call(this,o),i.children=void 0,i.children=s,i}var n=r.prototype;return n.getBounds=function(){var o=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse(function(a,f){var s=f.worldMatrix,u=a.getBounds();if(u){var p=Pp(u,2),y=p[0],g=p[1],w=new $(y).add(g).divide([2,2,2]);s.transformAsPoint(w,w);var b=new $(g).subtract(y).divide([2,2,2]);s.transformAsVector(b,b);for(var _=0;_<8;_++)for(var x=new $(_&1?-1:1,_&2?-1:1,_&4?-1:1).multiply(b).add(w),P=0;P<3;P++)o[0][P]=Math.min(o[0][P],x[P]),o[1][P]=Math.max(o[1][P],x[P])}}),Number.isFinite(o[0][0])?o:null},n.destroy=function(){this.children.forEach(function(o){return o.destroy()}),this.removeAll(),fr(We(r.prototype),"destroy",this).call(this)},n.add=function(){for(var o=arguments.length,a=new Array(o),f=0;f<o;f++)a[f]=arguments[f];for(var s=0,u=a;s<u.length;s++){var p=u[s];Array.isArray(p)?this.add.apply(this,wp(p)):this.children.push(p)}return this},n.remove=function(o){var a=this.children,f=a.indexOf(o);return f>-1&&a.splice(f,1),this},n.removeAll=function(){return this.children=[],this},n.traverse=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=a.worldMatrix,s=f===void 0?new re:f,u=new re(s).multiplyRight(this.matrix),p=bp(this.children),y;try{for(p.s();!(y=p.n()).done;){var g=y.value;g instanceof r?g.traverse(o,{worldMatrix:u}):o(g,{worldMatrix:u})}}catch(w){p.e(w)}finally{p.f()}},Tp(r)}(Ae);function qe(e){return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qe(e)}function ys(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,Gp(n.key),n)}}function Up(e,t,r){return t&&ys(e.prototype,t),r&&ys(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gp(e){var t=Bp(e,"string");return qe(t)==="symbol"?t:String(t)}function Bp(e,t){if(qe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kp(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&&cn(e,t)}function cn(e,t){return cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cn(e,t)}function Vp(e){var t=Wp();return function(){var n=cr(e),i;if(t){var o=cr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Hp(this,i)}}function Hp(e,t){if(t&&(qe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kp(e)}function Kp(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wp(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cr(e)}var vs=function(e){kp(r,e);var t=Vp(r);function r(i){var o;return zp(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)},Up(r)}(Ae);function Ye(e){return Ye=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},Ye(e)}function gs(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 un(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gs(Object(r),!0).forEach(function(n){qp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qp(e,t,r){return t=ws(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bs(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,ws(n.key),n)}}function Yp(e,t,r){return t&&bs(e.prototype,t),r&&bs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ws(e){var t=Xp(e,"string");return Ye(t)==="symbol"?t:String(t)}function Xp(e,t){if(Ye(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ye(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zp(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&&ln(e,t)}function ln(e,t){return ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ln(e,t)}function Jp(e){var t=tm();return function(){var n=ur(e),i;if(t){var o=ur(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Qp(this,i)}}function Qp(e,t){if(t&&(Ye(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return em(e)}function em(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tm(){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 ur(e){return ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ur(e)}var rm={x:[2,0,1],y:[0,1,2],z:[1,2,0]},Xe=function(e){Zp(r,e);var t=Jp(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$p(this,r);var i=n.id,o=i===void 0?z("truncated-code-geometry"):i,a=nm(n),f=a.indices,s=a.attributes;return t.call(this,un(un({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:un({POSITION:{size:3,value:s.POSITION},NORMAL:{size:3,value:s.NORMAL},TEXCOORD_0:{size:2,value:s.TEXCOORD_0}},n.attributes)}))}return Yp(r)}(Z);function nm(){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,f=e.nradial,s=f===void 0?10:f,u=e.nvertical,p=u===void 0?10:u,y=e.verticalAxis,g=y===void 0?"y":y,w=e.topCap,b=w===void 0?!1:w,_=e.bottomCap,x=_===void 0?!1:_,P=(b?2:0)+(x?2:0),M=(s+1)*(p+1+P),E=Math.atan2(r-i,a),T=Math.sin,L=Math.cos,R=Math.PI,j=L(E),D=T(E),F=b?-2:0,N=p+(x?2:0),C=s+1,h=new Uint16Array(s*(p+P)*6),c=rm[g],l=new Float32Array(M*3),m=new Float32Array(M*3),v=new Float32Array(M*2),d=0,O=0,S=F;S<=N;S++){var A=S/p,U=a*A,I=void 0;S<0?(U=0,A=1,I=r):S>p?(U=a,A=1,I=i):I=r+(i-r)*(S/p),(S===-2||S===p+2)&&(I=0,A=0),U-=a/2;for(var G=0;G<C;G++){var ne=T(G*R*2/s),Q=L(G*R*2/s);l[d+c[0]]=ne*I,l[d+c[1]]=U,l[d+c[2]]=Q*I,m[d+c[0]]=S<0||S>p?0:ne*j,m[d+c[1]]=S<0?-1:S>p?1:D,m[d+c[2]]=S<0||S>p?0:Q*j,v[O+0]=G/s,v[O+1]=A,O+=2,d+=3}}for(var H=0;H<p+P;H++)for(var X=0;X<s;X++){var se=(H*s+X)*6;h[se+0]=C*(H+0)+0+X,h[se+1]=C*(H+0)+1+X,h[se+2]=C*(H+1)+1+X,h[se+3]=C*(H+0)+0+X,h[se+4]=C*(H+1)+1+X,h[se+5]=C*(H+1)+0+X}return{indices:h,attributes:{POSITION:l,NORMAL:m,TEXCOORD_0:v}}}function $e(e){return $e=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},$e(e)}function _s(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 Os(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_s(Object(r),!0).forEach(function(n){im(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_s(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function im(e,t,r){return t=Ps(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ss(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,Ps(n.key),n)}}function om(e,t,r){return t&&Ss(e.prototype,t),r&&Ss(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ps(e){var t=am(e,"string");return $e(t)==="symbol"?t:String(t)}function am(e,t){if($e(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($e(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fm(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&&hn(e,t)}function hn(e,t){return hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hn(e,t)}function cm(e){var t=hm();return function(){var n=lr(e),i;if(t){var o=lr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return um(this,i)}}function um(e,t){if(t&&($e(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lm(e)}function lm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function lr(e){return lr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lr(e)}var xs=function(e){fm(r,e);var t=cm(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sm(this,r);var i=n.id,o=i===void 0?z("cone-geometry"):i,a=n.radius,f=a===void 0?1:a,s=n.cap,u=s===void 0?!0:s;return t.call(this,Os(Os({},n),{},{id:o,topRadius:0,topCap:Boolean(u),bottomCap:Boolean(u),bottomRadius:f}))}return om(r)}(Xe);function Ze(e){return Ze=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},Ze(e)}function Es(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 we(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Es(Object(r),!0).forEach(function(n){pm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Es(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pm(e,t,r){return t=Ts(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function As(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,Ts(n.key),n)}}function mm(e,t,r){return t&&As(e.prototype,t),r&&As(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ts(e){var t=dm(e,"string");return Ze(t)==="symbol"?t:String(t)}function dm(e,t){if(Ze(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ze(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ym(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vm(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&&pn(e,t)}function pn(e,t){return pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},pn(e,t)}function gm(e){var t=_m();return function(){var n=hr(e),i;if(t){var o=hr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return bm(this,i)}}function bm(e,t){if(t&&(Ze(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wm(e)}function wm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _m(){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 hr(e){return hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},hr(e)}var Ms=function(e){vm(r,e);var t=gm(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ym(this,r);var i=n.id,o=i===void 0?z("cube-geometry"):i,a=n.indices,f=a===void 0?!0:a;return t.call(this,f?we(we({},n),{},{id:o,topology:"triangle-list",indices:{size:1,value:Om},attributes:we(we({},Mm),n.attributes)}):we(we({},n),{},{id:o,topology:"triangle-list",indices:void 0,attributes:we(we({},Rm),n.attributes)}))}return mm(r)}(Z),Om=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]),Sm=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]),Pm=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]),xm=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]),Em=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]),Am=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]),Tm=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]),Mm={POSITION:{size:3,value:Sm},NORMAL:{size:3,value:Pm},TEXCOORD_0:{size:2,value:xm}},Rm={POSITION:{size:4,value:Em},TEXCOORD_0:{size:2,value:Am},COLOR_0:{size:3,value:Tm}};function Je(e){return Je=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},Je(e)}function Rs(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 Ls(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rs(Object(r),!0).forEach(function(n){Lm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Lm(e,t,r){return t=js(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Is(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,js(n.key),n)}}function Im(e,t,r){return t&&Is(e.prototype,t),r&&Is(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function js(e){var t=jm(e,"string");return Je(t)==="symbol"?t:String(t)}function jm(e,t){if(Je(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Je(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nm(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&&mn(e,t)}function mn(e,t){return mn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mn(e,t)}function Cm(e){var t=Gm();return function(){var n=pr(e),i;if(t){var o=pr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Fm(this,i)}}function Fm(e,t){if(t&&(Je(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Um(e)}function Um(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pr(e){return pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pr(e)}var Ds=function(e){Nm(r,e);var t=Cm(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dm(this,r);var i=n.id,o=i===void 0?z("cylinder-geometry"):i,a=n.radius,f=a===void 0?1:a;return t.call(this,Ls(Ls({},n),{},{id:o,bottomRadius:f,topRadius:f}))}return Im(r)}(Xe);function Qe(e){return Qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(e)}function Ns(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ns(Object(r),!0).forEach(function(n){Bm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ns(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bm(e,t,r){return t=Fs(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cs(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,Fs(n.key),n)}}function zm(e,t,r){return t&&Cs(e.prototype,t),r&&Cs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fs(e){var t=km(e,"string");return Qe(t)==="symbol"?t:String(t)}function km(e,t){if(Qe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Qe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hm(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&&dn(e,t)}function dn(e,t){return dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},dn(e,t)}function Km(e){var t=Ym();return function(){var n=dr(e),i;if(t){var o=dr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Wm(this,i)}}function Wm(e,t){if(t&&(Qe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qm(e)}function qm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ym(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function dr(e){return dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dr(e)}var Xm=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],$m=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],Us=function(e){Hm(r,e);var t=Km(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vm(this,r);var i=n.id,o=i===void 0?z("ico-sphere-geometry"):i,a=Zm(n),f=a.indices,s=a.attributes;return t.call(this,mr(mr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:mr(mr({},s),n.attributes)}))}return zm(r)}(Z);function Zm(e){var t=e.iterations,r=t===void 0?0:t,n=Math.PI,i=n*2,o=[].concat(Xm),a=[].concat($m);o.push(),a.push();for(var f=function(){var wr={};return function(le,he){le*=3,he*=3;var Zs=le<he?le:he,Js=le>he?le:he,_r="".concat(Zs,"|").concat(Js);if(_r in wr)return wr[_r];var Qs=o[le],ef=o[le+1],tf=o[le+2],rf=o[he],nf=o[he+1],of=o[he+2],Dt=(Qs+rf)/2,Nt=(ef+nf)/2,Ct=(tf+of)/2,Or=Math.sqrt(Dt*Dt+Nt*Nt+Ct*Ct);return Dt/=Or,Nt/=Or,Ct/=Or,o.push(Dt,Nt,Ct),wr[_r]=o.length/3-1}}(),s=0;s<r;s++){for(var u=[],p=0;p<a.length;p+=3){var y=f(a[p+0],a[p+1]),g=f(a[p+1],a[p+2]),w=f(a[p+2],a[p+0]);u.push(w,a[p+0],y,y,a[p+1],g,g,a[p+2],w,y,g,w)}a=u}for(var b=new Array(o.length),_=new Array(o.length/3*2),x=a.length,P=x-3;P>=0;P-=3){var M=a[P+0],E=a[P+1],T=a[P+2],L=M*3,R=E*3,j=T*3,D=M*2,F=E*2,N=T*2,C=o[L+0],h=o[L+1],c=o[L+2],l=Math.acos(c/Math.sqrt(C*C+h*h+c*c)),m=Math.atan2(h,C)+n,v=l/n,d=1-m/i,O=o[R+0],S=o[R+1],A=o[R+2],U=Math.acos(A/Math.sqrt(O*O+S*S+A*A)),I=Math.atan2(S,O)+n,G=U/n,ne=1-I/i,Q=o[j+0],H=o[j+1],X=o[j+2],se=Math.acos(X/Math.sqrt(Q*Q+H*H+X*X)),Ys=Math.atan2(H,Q)+n,gn=se/n,jt=1-Ys/i,Xs=[Q-O,H-S,X-A],$s=[C-O,h-S,c-A],ee=new $(Xs).cross($s).normalize(),V=void 0;(d===0||ne===0||jt===0)&&(d===0||d>.5)&&(ne===0||ne>.5)&&(jt===0||jt>.5)&&(o.push(o[L+0],o[L+1],o[L+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=v,b[V*3+0]=ee.x,b[V*3+1]=ee.y,b[V*3+2]=ee.z,o.push(o[R+0],o[R+1],o[R+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=G,b[V*3+0]=ee.x,b[V*3+1]=ee.y,b[V*3+2]=ee.z,o.push(o[j+0],o[j+1],o[j+2]),V=o.length/3-1,a.push(V),_[V*2+0]=1,_[V*2+1]=gn,b[V*3+0]=ee.x,b[V*3+1]=ee.y,b[V*3+2]=ee.z),b[L+0]=b[R+0]=b[j+0]=ee.x,b[L+1]=b[R+1]=b[j+1]=ee.y,b[L+2]=b[R+2]=b[j+2]=ee.z,_[D+0]=d,_[D+1]=v,_[F+0]=ne,_[F+1]=G,_[N+0]=jt,_[N+1]=gn}return{indices:{size:1,value:new Uint16Array(a)},attributes:{POSITION:{size:3,value:new Float32Array(o)},NORMAL:{size:3,value:new Float32Array(b)},TEXCOORD_0:{size:2,value:new Float32Array(_)}}}}function Gs(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],f=a.constant,s=a.value,u=a.size;if(!(f||!u)){for(var p=new s.constructor(n*u),y=0;y<n;++y)for(var g=t.value[y],w=0;w<u;w++)p[y*u+w]=s[g*u+w];i[o]={size:u,value:p}}}return{attributes:Object.assign({},r,i)}}function et(e){return et=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},et(e)}function Bs(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 yr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bs(Object(r),!0).forEach(function(n){Jm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jm(e,t,r){return t=ks(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zs(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,ks(n.key),n)}}function Qm(e,t,r){return t&&zs(e.prototype,t),r&&zs(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ks(e){var t=ed(e,"string");return et(t)==="symbol"?t:String(t)}function ed(e,t){if(et(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(et(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function td(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rd(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&&yn(e,t)}function yn(e,t){return yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yn(e,t)}function nd(e){var t=ad();return function(){var n=vr(e),i;if(t){var o=vr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return id(this,i)}}function id(e,t){if(t&&(et(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return od(e)}function od(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ad(){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 vr(e){return vr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vr(e)}var Vs=function(e){rd(r,e);var t=nd(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};td(this,r);var i=n.id,o=i===void 0?z("plane-geometry"):i,a=sd(n),f=a.indices,s=a.attributes;return t.call(this,yr(yr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:yr(yr({},s),n.attributes)}))}return Qm(r)}(Z);function sd(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,f=e.unpack,s=f===void 0?!1:f,u=r.split(","),p=e["".concat(u[0],"len")]||1,y=e["".concat(u[1],"len")]||1,g=e["n".concat(u[0])]||1,w=e["n".concat(u[1])]||1,b=(g+1)*(w+1),_=new Float32Array(b*3),x=new Float32Array(b*3),P=new Float32Array(b*2);a&&(p=-p);for(var M=0,E=0,T=0;T<=w;T++)for(var L=0;L<=g;L++){var R=L/g,j=T/w;switch(P[M+0]=a?1-R:R,P[M+1]=j,r){case"x,y":_[E+0]=p*R-p*.5,_[E+1]=y*j-y*.5,_[E+2]=i,x[E+0]=0,x[E+1]=0,x[E+2]=a?1:-1;break;case"x,z":_[E+0]=p*R-p*.5,_[E+1]=i,_[E+2]=y*j-y*.5,x[E+0]=0,x[E+1]=a?1:-1,x[E+2]=0;break;case"y,z":_[E+0]=i,_[E+1]=p*R-p*.5,_[E+2]=y*j-y*.5,x[E+0]=a?1:-1,x[E+1]=0,x[E+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}M+=2,E+=3}for(var D=g+1,F=new Uint16Array(g*w*6),N=0;N<w;N++)for(var C=0;C<g;C++){var h=(N*g+C)*6;F[h+0]=(N+0)*D+C,F[h+1]=(N+1)*D+C,F[h+2]=(N+0)*D+C+1,F[h+3]=(N+1)*D+C,F[h+4]=(N+1)*D+C+1,F[h+5]=(N+0)*D+C+1}var c={indices:{size:1,value:F},attributes:{POSITION:{size:3,value:_},NORMAL:{size:3,value:x},TEXCOORD_0:{size:2,value:P}}};return s?Gs(c):c}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 Hs(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 gr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hs(Object(r),!0).forEach(function(n){fd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fd(e,t,r){return t=Ws(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ks(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,Ws(n.key),n)}}function cd(e,t,r){return t&&Ks(e.prototype,t),r&&Ks(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ws(e){var t=ud(e,"string");return tt(t)==="symbol"?t:String(t)}function ud(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 ld(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hd(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&&vn(e,t)}function vn(e,t){return vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},vn(e,t)}function pd(e){var t=yd();return function(){var n=br(e),i;if(t){var o=br(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return md(this,i)}}function md(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 dd(e)}function dd(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yd(){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 br(e){return br=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},br(e)}var qs=function(e){hd(r,e);var t=pd(r);function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ld(this,r);var i=n.id,o=i===void 0?z("sphere-geometry"):i,a=vd(n),f=a.indices,s=a.attributes;return t.call(this,gr(gr({},n),{},{id:o,topology:"triangle-list",indices:f,attributes:gr(gr({},s),n.attributes)}))}return cd(r)}(Z);function vd(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,f=a-o,s=0,u=2*Math.PI,p=u-s,y=(r+1)*(i+1),g=function(ne,Q,H,X,se){return e.radius||1},w=new Float32Array(y*3),b=new Float32Array(y*3),_=new Float32Array(y*2),x=y>65535?Uint32Array:Uint16Array,P=new x(r*i*6),M=0;M<=r;M++)for(var E=0;E<=i;E++){var T=E/i,L=M/r,R=E+M*(i+1),j=R*2,D=R*3,F=p*T,N=f*L,C=Math.sin(F),h=Math.cos(F),c=Math.sin(N),l=Math.cos(N),m=h*c,v=l,d=C*c,O=g(m,v,d,T,L);w[D+0]=O*m,w[D+1]=O*v,w[D+2]=O*d,b[D+0]=m,b[D+1]=v,b[D+2]=d,_[j+0]=T,_[j+1]=1-L}for(var S=i+1,A=0;A<i;A++)for(var U=0;U<r;U++){var I=(A*r+U)*6;P[I+0]=U*S+A,P[I+1]=U*S+A+1,P[I+2]=(U+1)*S+A,P[I+3]=(U+1)*S+A,P[I+4]=U*S+A+1,P[I+5]=(U+1)*S+A+1}return{indices:{size:1,value:P},attributes:{POSITION:{size:3,value:w},NORMAL:{size:3,value:b},TEXCOORD_0:{size:2,value:_}}}}return lf(gd);})();
286
286
  return __exports__;
287
287
  });