@luma.gl/webgpu 9.0.0-alpha.51 → 9.0.0-alpha.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.dev.js CHANGED
@@ -1506,7 +1506,10 @@ ${htmlLog}
1506
1506
  button.style.width = "100%";
1507
1507
  button.style.textAlign = "left";
1508
1508
  document.body.appendChild(button);
1509
- document.getElementsByClassName("luma-compiler-log-error")[0]?.scrollIntoView();
1509
+ const errors = document.getElementsByClassName("luma-compiler-log-error");
1510
+ if (errors[0]?.scrollIntoView) {
1511
+ errors[0].scrollIntoView();
1512
+ }
1510
1513
  button.onclick = () => {
1511
1514
  const dataURI = `data:text/plain,${encodeURIComponent(this.source)}`;
1512
1515
  navigator.clipboard.writeText(dataURI);
package/dist.min.js CHANGED
@@ -4,7 +4,7 @@
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
- var __exports__=(()=>{var Gt=Object.defineProperty;var Xo=Object.getOwnPropertyDescriptor;var Zo=Object.getOwnPropertyNames;var Jo=Object.prototype.hasOwnProperty;var Qo=(e,t)=>{for(var r in t)Gt(e,r,{get:t[r],enumerable:!0})},ei=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zo(t))!Jo.call(e,o)&&o!==r&&Gt(e,o,{get:()=>t[o],enumerable:!(n=Xo(t,o))||n.enumerable});return e};var ti=e=>ei(Gt({},"__esModule",{value:!0}),e);var cl={};Qo(cl,{WebGPUBuffer:()=>wt,WebGPUDevice:()=>vr,WebGPUSampler:()=>K,WebGPUShader:()=>jt,WebGPUTexture:()=>Pt});function Le(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 M(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Le()}var ri=globalThis.self||globalThis.window||globalThis.global,oe=globalThis.window||globalThis.self||globalThis.global,ni=globalThis.document||{},Z=globalThis.process||{},oi=globalThis.console,br=globalThis.navigator||{};var He=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",ml=M();var Ct=globalThis;function Ke(e){if(!e&&!M())return"Node";if(Le(e))return"Electron";let t=e||br.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Ct.chrome?"Chrome":Ct.safari?"Safari":Ct.mozInnerScreenX?"Firefox":"Unknown"}function ii(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var $e=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=ii(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function gr(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function wr(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 Ye(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let i=e.width*r,a=e.height*r,c=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(i/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(o,");"),"background-size:".concat(i,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),c]}var qe;(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"})(qe||(qe={}));var ai=10;function _r(e){return typeof e!="string"?e:(e=e.toUpperCase(),qe[e]||qe.WHITE)}function Or(e,t,r){if(!M&&typeof e=="string"){if(t){let n=_r(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=_r(r);e="\x1B[".concat(n+ai,"m").concat(e,"\x1B[49m")}}return e}function Pr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),o=e;for(let i of n){let a=o[i];typeof a=="function"&&(t.find(c=>i===c)||(o[i]=a.bind(e)))}}function ie(e,t){if(!e)throw new Error(t||"Assertion failed")}function J(){let e;if(M()&&oe.performance){var t,r;e=oe===null||oe===void 0||(t=oe.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Z){var n;let o=Z===null||Z===void 0||(n=Z.hrtime)===null||n===void 0?void 0:n.call(Z);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var ae={debug:M()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ui={enabled:!0,level:0};function H(){}var Sr={},Tr={once:!0},q=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=He,this._startTs=J(),this._deltaTs=J(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new $e("__probe-".concat(this.id,"__"),ui),this.timeStamp("".concat(this.id," started")),Pr(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((J()-this._startTs).toPrecision(10))}getDelta(){return Number((J()-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){ie(t,r)}warn(t){return this._getLogFunction(0,t,ae.warn,arguments,Tr)}error(t){return this._getLogFunction(0,t,ae.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,ae.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,ae.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,ae.debug||ae.info,arguments,Tr)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||H,n&&[n],{tag:li(r)}):H}image(t){let{logLevel:r,priority:n,image:o,message:i="",scale:a=1}=t;return this._shouldLog(r||n)?M()?si({image:o,message:i,scale:a}):ci({image:o,message:i,scale:a}):H}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||H)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=jr({logLevel:t,message:r,opts:n}),{collapsed:i}=n;return o.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}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||H)}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()>=Er(t)}_getLogFunction(t,r,n,o,i){if(this._shouldLog(t)){i=jr({logLevel:t,message:r,args:o,opts:i}),n=n||i.method,ie(n),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=J();let a=i.tag||i.message;if(i.once&&a)if(!Sr[a])Sr[a]=J();else return H;return r=fi(this.id,i.message,i),n.bind(console,r,...i.args)}return H}};q.VERSION=He;function Er(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 ie(Number.isFinite(t)&&t>=0),t}function jr(e){let{logLevel:t,message:r}=e;e.logLevel=Er(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 o=typeof e.message;return ie(o==="string"||o==="object"),Object.assign(e,{args:n},e.opts)}function fi(e,t,r){if(typeof t=="string"){let n=r.time?wr(gr(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=Or(t,r.color,r.background)}return t}function ci(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),H}function si(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let i=new Image;return i.onload=()=>{let a=Ye(i,r,n);console.log(...a)},i.src=t,H}let o=t.nodeName||"";if(o.toLowerCase()==="img")return console.log(...Ye(t,r,n)),H;if(o.toLowerCase()==="canvas"){let i=new Image;return i.onload=()=>console.log(...Ye(i,r,n)),i.src=t.toDataURL(),H}return H}function li(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var $l=new q({id:"@probe.gl/log"});var S=new q({id:"luma.gl"});function De(){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 Q=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=De(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(De()-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 ue=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,o=this.stats[r];return o||(t instanceof Q?o=t:o=new Q(r,n),this.stats[r]=o),o}};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)}function xr(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,hi(n.key),n)}}function pi(e,t,r){return t&&xr(e.prototype,t),r&&xr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hi(e){var t=di(e,"string");return Ne(t)==="symbol"?t:String(t)}function di(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 yi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var mi=function(){function e(){yi(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 ue({id:n})),this.stats.get(n)},pi(e)}(),Xe=new mi;function vi(){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||(M()&&S.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:S,stats:Xe}),e}var Rr=vi();var kt={};function Y(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";kt[e]=kt[e]||1;var t=kt[e]++;return"".concat(e,"-").concat(t)}function Ze(e){var t=!0;for(var r in e){t=!1;break}return t}function Ge(e){return Ge=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},Ge(e)}function Ar(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function bi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ar(Object(r),!0).forEach(function(n){gi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ar(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gi(e,t,r){return t=Br(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ir(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,Br(n.key),n)}}function wi(e,t,r){return t&&Ir(e.prototype,t),r&&Ir(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Br(e){var t=_i(e,"string");return Ge(t)==="symbol"?t:String(t)}function _i(e,t){if(Ge(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var E=function(){function e(r,n,o){if(Oi(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=Pi(n,o);var i=this.props.id!=="undefined"?this.props.id:Y(this[Symbol.toStringTag]);this.props.id=i,this.id=i,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,o=Object.values(this._attachedResources);n<o.length;n++){var i=o[n];i.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"),o=this[Symbol.toStringTag];n.get("".concat(o,"s Active")).decrementCount()},t.trackAllocatedMemory=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").addCount(n),i.get("".concat(o," Memory")).addCount(n),this.allocatedBytes=n},t.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").subtractCount(this.allocatedBytes),o.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},t.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(o,"s Created")).incrementCount(),n.get("".concat(o,"s Active")).incrementCount()},wi(e)}();E.defaultProps={id:"undefined",handle:void 0,userData:void 0};function Pi(e,t){var r=bi({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}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)}var Nr;function Lr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lr(Object(r),!0).forEach(function(n){Si(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Si(e,t,r){return t=Gr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ti(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dr(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,Gr(n.key),n)}}function ji(e,t,r){return t&&Dr(e.prototype,t),r&&Dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gr(e){var t=Ei(e,"string");return fe(t)==="symbol"?t:String(t)}function Ei(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 xi(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&&Ut(e,t)}function Ut(e,t){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ut(e,t)}function Ri(e){var t=Bi();return function(){var n=Je(e),o;if(t){var i=Je(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Ai(this,o)}}function Ai(e,t){if(t&&(fe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ii(e)}function Ii(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bi(){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 Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Je(e)}Nr=Symbol.toStringTag;var G=function(e){xi(r,e);var t=Ri(r);function r(o,i){var a;Ti(this,r);var c=Mt({},i);return(i.usage||0)&r.INDEX&&!i.indexType&&(i.data instanceof Uint32Array?c.indexType="uint32":i.data instanceof Uint16Array&&(c.indexType="uint16")),a=t.call(this,o,c,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=i.usage||0,a.indexType=c.indexType,a}var n=r.prototype;return n.write=function(i,a){throw new Error("not implemented")},n.readAsync=function(i,a){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},ji(r,[{key:Nr,get:function(){return"Buffer"}}]),r}(E);G.defaultProps=Mt(Mt({},E.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});G.MAP_READ=1;G.MAP_WRITE=2;G.COPY_SRC=4;G.COPY_DST=8;G.INDEX=16;G.VERTEX=32;G.UNIFORM=64;G.STORAGE=128;G.INDIRECT=256;G.QUERY_RESOLVE=512;function Ce(e){return Ce=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},Ce(e)}var Mr;function Cr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ft(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cr(Object(r),!0).forEach(function(n){Li(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Li(e,t,r){return t=Ur(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Di(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kr(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,Ur(n.key),n)}}function Ni(e,t,r){return t&&kr(e.prototype,t),r&&kr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ur(e){var t=Gi(e,"string");return Ce(t)==="symbol"?t:String(t)}function Gi(e,t){if(Ce(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ce(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}Mr=Symbol.toStringTag;var ke=function(){function e(r){Di(this,e),this.id=void 0,this.statsManager=Xe,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Ft(Ft({},e.defaultProps),r),this.id=this.props.id||Y(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 o=Ft({},n);return(n.usage||0)&G.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?o.indexType="uint32":n.data instanceof Uint16Array?o.indexType="uint16":S.warn("indices buffer content must be of integer type")()),o},Ni(e,[{key:Mr,get:function(){return"Device"}}]),e}();ke.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(S.get("debug")),break:[],gl:null};ke.VERSION=Rr;function Me(e){return Me=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},Me(e)}function Qe(e,t){return Mi(e)||ki(e,t)||$r(e,t)||Ci()}function Ci(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
+ var __exports__=(()=>{var Gt=Object.defineProperty;var Xo=Object.getOwnPropertyDescriptor;var Zo=Object.getOwnPropertyNames;var Jo=Object.prototype.hasOwnProperty;var Qo=(e,t)=>{for(var r in t)Gt(e,r,{get:t[r],enumerable:!0})},ei=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zo(t))!Jo.call(e,o)&&o!==r&&Gt(e,o,{get:()=>t[o],enumerable:!(n=Xo(t,o))||n.enumerable});return e};var ti=e=>ei(Gt({},"__esModule",{value:!0}),e);var cl={};Qo(cl,{WebGPUBuffer:()=>wt,WebGPUDevice:()=>vr,WebGPUSampler:()=>K,WebGPUShader:()=>jt,WebGPUTexture:()=>Pt});function Be(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 M(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Be()}var ri=globalThis.self||globalThis.window||globalThis.global,oe=globalThis.window||globalThis.self||globalThis.global,ni=globalThis.document||{},Z=globalThis.process||{},oi=globalThis.console,br=globalThis.navigator||{};var He=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",ml=M();var Ct=globalThis;function Ke(e){if(!e&&!M())return"Node";if(Be(e))return"Electron";let t=e||br.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Ct.chrome?"Chrome":Ct.safari?"Safari":Ct.mozInnerScreenX?"Firefox":"Unknown"}function ii(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var $e=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=ii(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function gr(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function wr(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 Ye(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let i=e.width*r,a=e.height*r,c=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(i/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(o,");"),"background-size:".concat(i,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),c]}var qe;(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"})(qe||(qe={}));var ai=10;function _r(e){return typeof e!="string"?e:(e=e.toUpperCase(),qe[e]||qe.WHITE)}function Or(e,t,r){if(!M&&typeof e=="string"){if(t){let n=_r(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=_r(r);e="\x1B[".concat(n+ai,"m").concat(e,"\x1B[49m")}}return e}function Pr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),o=e;for(let i of n){let a=o[i];typeof a=="function"&&(t.find(c=>i===c)||(o[i]=a.bind(e)))}}function ie(e,t){if(!e)throw new Error(t||"Assertion failed")}function J(){let e;if(M()&&oe.performance){var t,r;e=oe===null||oe===void 0||(t=oe.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Z){var n;let o=Z===null||Z===void 0||(n=Z.hrtime)===null||n===void 0?void 0:n.call(Z);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var ae={debug:M()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},ui={enabled:!0,level:0};function H(){}var Sr={},Tr={once:!0},q=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=He,this._startTs=J(),this._deltaTs=J(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new $e("__probe-".concat(this.id,"__"),ui),this.timeStamp("".concat(this.id," started")),Pr(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((J()-this._startTs).toPrecision(10))}getDelta(){return Number((J()-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){ie(t,r)}warn(t){return this._getLogFunction(0,t,ae.warn,arguments,Tr)}error(t){return this._getLogFunction(0,t,ae.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,ae.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,ae.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,ae.debug||ae.info,arguments,Tr)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||H,n&&[n],{tag:li(r)}):H}image(t){let{logLevel:r,priority:n,image:o,message:i="",scale:a=1}=t;return this._shouldLog(r||n)?M()?si({image:o,message:i,scale:a}):ci({image:o,message:i,scale:a}):H}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||H)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=jr({logLevel:t,message:r,opts:n}),{collapsed:i}=n;return o.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}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||H)}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()>=Er(t)}_getLogFunction(t,r,n,o,i){if(this._shouldLog(t)){i=jr({logLevel:t,message:r,args:o,opts:i}),n=n||i.method,ie(n),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=J();let a=i.tag||i.message;if(i.once&&a)if(!Sr[a])Sr[a]=J();else return H;return r=fi(this.id,i.message,i),n.bind(console,r,...i.args)}return H}};q.VERSION=He;function Er(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 ie(Number.isFinite(t)&&t>=0),t}function jr(e){let{logLevel:t,message:r}=e;e.logLevel=Er(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 o=typeof e.message;return ie(o==="string"||o==="object"),Object.assign(e,{args:n},e.opts)}function fi(e,t,r){if(typeof t=="string"){let n=r.time?wr(gr(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=Or(t,r.color,r.background)}return t}function ci(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),H}function si(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let i=new Image;return i.onload=()=>{let a=Ye(i,r,n);console.log(...a)},i.src=t,H}let o=t.nodeName||"";if(o.toLowerCase()==="img")return console.log(...Ye(t,r,n)),H;if(o.toLowerCase()==="canvas"){let i=new Image;return i.onload=()=>console.log(...Ye(i,r,n)),i.src=t.toDataURL(),H}return H}function li(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var $l=new q({id:"@probe.gl/log"});var S=new q({id:"luma.gl"});function De(){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 Q=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=De(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(De()-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 ue=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,o=this.stats[r];return o||(t instanceof Q?o=t:o=new Q(r,n),this.stats[r]=o),o}};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)}function xr(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,hi(n.key),n)}}function pi(e,t,r){return t&&xr(e.prototype,t),r&&xr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hi(e){var t=di(e,"string");return Ne(t)==="symbol"?t:String(t)}function di(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 yi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var mi=function(){function e(){yi(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 ue({id:n})),this.stats.get(n)},pi(e)}(),Xe=new mi;function vi(){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||(M()&&S.log(1,"luma.gl ".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:S,stats:Xe}),e}var Rr=vi();var kt={};function Y(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";kt[e]=kt[e]||1;var t=kt[e]++;return"".concat(e,"-").concat(t)}function Ze(e){var t=!0;for(var r in e){t=!1;break}return t}function Ge(e){return Ge=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},Ge(e)}function Ar(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function bi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ar(Object(r),!0).forEach(function(n){gi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ar(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gi(e,t,r){return t=Lr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ir(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,Lr(n.key),n)}}function wi(e,t,r){return t&&Ir(e.prototype,t),r&&Ir(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lr(e){var t=_i(e,"string");return Ge(t)==="symbol"?t:String(t)}function _i(e,t){if(Ge(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var E=function(){function e(r,n,o){if(Oi(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=Pi(n,o);var i=this.props.id!=="undefined"?this.props.id:Y(this[Symbol.toStringTag]);this.props.id=i,this.id=i,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,o=Object.values(this._attachedResources);n<o.length;n++){var i=o[n];i.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"),o=this[Symbol.toStringTag];n.get("".concat(o,"s Active")).decrementCount()},t.trackAllocatedMemory=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").addCount(n),i.get("".concat(o," Memory")).addCount(n),this.allocatedBytes=n},t.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").subtractCount(this.allocatedBytes),o.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},t.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(o,"s Created")).incrementCount(),n.get("".concat(o,"s Active")).incrementCount()},wi(e)}();E.defaultProps={id:"undefined",handle:void 0,userData:void 0};function Pi(e,t){var r=bi({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}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)}var Nr;function Br(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Br(Object(r),!0).forEach(function(n){Si(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Br(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Si(e,t,r){return t=Gr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ti(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dr(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,Gr(n.key),n)}}function ji(e,t,r){return t&&Dr(e.prototype,t),r&&Dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gr(e){var t=Ei(e,"string");return fe(t)==="symbol"?t:String(t)}function Ei(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 xi(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&&Ut(e,t)}function Ut(e,t){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ut(e,t)}function Ri(e){var t=Li();return function(){var n=Je(e),o;if(t){var i=Je(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Ai(this,o)}}function Ai(e,t){if(t&&(fe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ii(e)}function Ii(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Li(){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 Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Je(e)}Nr=Symbol.toStringTag;var G=function(e){xi(r,e);var t=Ri(r);function r(o,i){var a;Ti(this,r);var c=Mt({},i);return(i.usage||0)&r.INDEX&&!i.indexType&&(i.data instanceof Uint32Array?c.indexType="uint32":i.data instanceof Uint16Array&&(c.indexType="uint16")),a=t.call(this,o,c,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.usage=i.usage||0,a.indexType=c.indexType,a}var n=r.prototype;return n.write=function(i,a){throw new Error("not implemented")},n.readAsync=function(i,a){throw new Error("not implemented")},n.getData=function(){throw new Error("not implemented")},ji(r,[{key:Nr,get:function(){return"Buffer"}}]),r}(E);G.defaultProps=Mt(Mt({},E.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});G.MAP_READ=1;G.MAP_WRITE=2;G.COPY_SRC=4;G.COPY_DST=8;G.INDEX=16;G.VERTEX=32;G.UNIFORM=64;G.STORAGE=128;G.INDIRECT=256;G.QUERY_RESOLVE=512;function Ce(e){return Ce=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},Ce(e)}var Mr;function Cr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ft(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cr(Object(r),!0).forEach(function(n){Bi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bi(e,t,r){return t=Ur(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Di(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kr(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,Ur(n.key),n)}}function Ni(e,t,r){return t&&kr(e.prototype,t),r&&kr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ur(e){var t=Gi(e,"string");return Ce(t)==="symbol"?t:String(t)}function Gi(e,t){if(Ce(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ce(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}Mr=Symbol.toStringTag;var ke=function(){function e(r){Di(this,e),this.id=void 0,this.statsManager=Xe,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Ft(Ft({},e.defaultProps),r),this.id=this.props.id||Y(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 o=Ft({},n);return(n.usage||0)&G.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?o.indexType="uint32":n.data instanceof Uint16Array?o.indexType="uint16":S.warn("indices buffer content must be of integer type")()),o},Ni(e,[{key:Mr,get:function(){return"Device"}}]),e}();ke.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(S.get("debug")),break:[],gl:null};ke.VERSION=Rr;function Me(e){return Me=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},Me(e)}function Qe(e,t){return Mi(e)||ki(e,t)||$r(e,t)||Ci()}function Ci(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
8
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ki(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function Mi(e){if(Array.isArray(e))return e}function Ui(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=$r(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
9
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return i=d.done,d},e:function(d){a=!0,c=d},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function $r(e,t){if(e){if(typeof e=="string")return Fr(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 Fr(e,t)}}function Fr(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 Wr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function zr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wr(Object(r),!0).forEach(function(n){Fi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fi(e,t,r){return t=Yr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vr(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,Yr(n.key),n)}}function zi(e,t,r){return t&&Vr(e.prototype,t),r&&Vr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yr(e){var t=Vi(e,"string");return Me(t)==="symbol"?t:String(t)}function Vi(e,t){if(Me(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Me(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hi=M()&&typeof document<"u",et=function(){return Hi&&document.readyState==="complete"},Ki={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},ce=function(){function e(r){var n=this;if(Wi(this,e),this.device=void 0,this.id=void 0,this.props=void 0,this.canvas=void 0,this.htmlCanvas=void 0,this.offscreenCanvas=void 0,this.type=void 0,this.width=1,this.height=1,this.resizeObserver=void 0,this._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},this.props=zr(zr({},Ki),r),r=this.props,!M()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(r.canvas)typeof r.canvas=="string"?this.canvas=qi(r.canvas):this.canvas=r.canvas;else{var o,i,a=Xi(r),c=Yi(((o=r)===null||o===void 0?void 0:o.container)||null);c.insertBefore(a,c.firstChild),this.canvas=a,(i=r)!==null&&i!==void 0&&i.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&r.autoResize&&(this.resizeObserver=new ResizeObserver(function(l){var d=Ui(l),b;try{for(d.s();!(b=d.n()).done;){var m=b.value;m.target===n.canvas&&n.update()}}catch(g){d.e(g)}finally{d.f()}}),this.resizeObserver.observe(this.canvas))}var t=e.prototype;return t.getDevicePixelRatio=function(n){if(typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(n=n===void 0?this.props.useDevicePixels:n,!n||n<=0))return 1;if(n===!0){var o=typeof window<"u"&&window.devicePixelRatio;return o||1}return n},t.getPixelSize=function(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":var n=this.getDevicePixelRatio(),o=this.canvas;return o.parentElement?[o.clientWidth*n,o.clientHeight*n]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}},t.getAspect=function(){var n=this.getPixelSize(),o=Qe(n,2),i=o[0],a=o[1];return i/a},t.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),o=Qe(n,1),i=o[0],a=this._canvasSizeInfo.clientWidth;return a?i/a:1}catch{return 1}},t.cssToDevicePixels=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this.cssToDeviceRatio(),a=this.getDrawingBufferSize(),c=Qe(a,2),l=c[0],d=c[1];return Zi(n,i,l,d,o)},t.setDevicePixelRatio=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.htmlCanvas){var i="width"in o?o.width:this.htmlCanvas.clientWidth,a="height"in o?o.height:this.htmlCanvas.clientHeight;(!i||!a)&&(S.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,i=this.htmlCanvas.width||1,a=this.htmlCanvas.height||1);var c=this._canvasSizeInfo;if(c.clientWidth!==i||c.clientHeight!==a||c.devicePixelRatio!==n){var l=n,d=Math.floor(i*l),b=Math.floor(a*l);this.htmlCanvas.width=d,this.htmlCanvas.height=b;var m=this.getDrawingBufferSize(),g=Qe(m,2),w=g[0],P=g[1];(w!==d||P!==b)&&(l=Math.min(w/i,P/a),this.htmlCanvas.width=Math.floor(i*l),this.htmlCanvas.height=Math.floor(a*l),S.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=i,this._canvasSizeInfo.clientHeight=a,this._canvasSizeInfo.devicePixelRatio=n}}},t.getDrawingBufferSize=function(){var n=this.device.gl;if(!n)throw new Error("canvas size");return[n.drawingBufferWidth,n.drawingBufferHeight]},t._setAutoCreatedCanvasId=function(n){var o;((o=this.htmlCanvas)===null||o===void 0?void 0:o.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=n)},zi(e,null,[{key:"isPageLoaded",get:function(){return et()}}]),e}();ce.pageLoaded=$i();function $i(){return et()||typeof window>"u"?Promise.resolve():new Promise(function(e){window.addEventListener("load",function(){return e()})})}function Yi(e){if(typeof e=="string"){var t=document.getElementById(e);if(!t&&!et())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!t)throw new Error("".concat(e," is not an HTML element"));return t}else if(e)return e;return document.body}function qi(e){var t=document.getElementById(e);if(!t&&!et())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!(t instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return t}function Xi(e){var t=e.width,r=e.height,n=document.createElement("canvas");return n.id="lumagl-auto-created-canvas",n.width=t||1,n.height=r||1,n.style.width=Number.isFinite(t)?"".concat(t,"px"):"100%",n.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",n}function Zi(e,t,r,n,o){var i=e,a=Hr(i[0],t,r),c=Kr(i[1],t,n,o),l=Hr(i[0]+1,t,r),d=l===r-1?l:l-1;l=Kr(i[1]+1,t,n,o);var b;return o?(l=l===0?l:l+1,b=c,c=l):b=l===n-1?l:l-1,{x:a,y:c,width:Math.max(d-a+1,1),height:Math.max(b-c+1,1)}}function Hr(e,t,r){var n=Math.min(Math.round(e*t),r-1);return n}function Kr(e,t,r,n){return n?Math.max(0,r-1-Math.round(e*t)):Math.min(Math.round(e*t),r-1)}function se(e){return se=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},se(e)}var Jr;function qr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Xr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qr(Object(r),!0).forEach(function(n){Ji(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ji(e,t,r){return t=Qr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zr(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,Qr(n.key),n)}}function ea(e,t,r){return t&&Zr(e.prototype,t),r&&Zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qr(e){var t=ta(e,"string");return se(t)==="symbol"?t:String(t)}function ta(e,t){if(se(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(se(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ra(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&&Wt(e,t)}function Wt(e,t){return Wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Wt(e,t)}function na(e){var t=aa();return function(){var n=tt(e),o;if(t){var i=tt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return oa(this,o)}}function oa(e,t){if(t&&(se(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ia(e)}function ia(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aa(){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 tt(e){return tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},tt(e)}Jr=Symbol.toStringTag;var W=function(e){ra(r,e);var t=na(r);function r(n,o){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.defaultProps;return Qi(this,r),i=t.call(this,n,o,a),i.dimension=void 0,i.format=void 0,i.width=void 0,i.height=void 0,i.depth=void 0,i.sampler=void 0,i.dimension=i.props.dimension,i.format=i.props.format,i.width=i.props.width,i.height=i.props.height,i.depth=i.props.depth,i}return ea(r,[{key:Jr,get:function(){return"Texture"}}]),r}(E);W.defaultProps=Xr(Xr({},E.defaultProps),{},{data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!0,sampler:{},compressed:!1,usage:0,mipLevels:void 0,samples:void 0,type:void 0});W.COPY_SRC=1;W.COPY_DST=2;W.TEXTURE_BINDING=4;W.STORAGE_BINDING=8;W.RENDER_ATTACHMENT=16;function le(e){return le=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},le(e)}var nn;function en(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function tn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?en(Object(r),!0).forEach(function(n){ua(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ua(e,t,r){return t=on(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rn(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,on(n.key),n)}}function ca(e,t,r){return t&&rn(e.prototype,t),r&&rn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function on(e){var t=sa(e,"string");return le(t)==="symbol"?t:String(t)}function sa(e,t){if(le(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(le(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function la(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&&zt(e,t)}function zt(e,t){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},zt(e,t)}function pa(e){var t=ya();return function(){var n=rt(e),o;if(t){var i=rt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ha(this,o)}}function ha(e,t){if(t&&(le(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return da(e)}function da(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ya(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rt(e){return rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rt(e)}nn=Symbol.toStringTag;var nt=function(e){la(r,e);var t=pa(r);function r(n,o){return fa(this,r),t.call(this,n,o,r.defaultProps)}return ca(r,[{key:nn,get:function(){return"ExternalTexture"}}]),r}(E);nt.defaultProps=tn(tn({},E.defaultProps),{},{source:null,colorSpace:"srgb"});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 ma(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=va(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
10
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return i=d.done,d},e:function(d){a=!0,c=d},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function va(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 un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).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?un(Object(r),!0).forEach(function(n){ba(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):un(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ba(e,t,r){return t=ga(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ga(e){var t=wa(e,"string");return Ue(t)==="symbol"?t:String(t)}function wa(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 sn(e,t,r){var n="",o=t.split(/\r?\n/),i=e.slice().sort(function(g,w){return g.lineNum-w.lineNum});switch(r?.showSourceCode||"no"){case"all":for(var a=0,c=1;c<=o.length;c++)for(n+=ln(o[c-1],c,r);i.length>a&&i[a].lineNum===c;){var l=i[a++];n+=cn(l,o,l.lineNum,fn(fn({},r),{},{inlineSource:!1}))}return n;case"issues":case"no":var d=ma(e),b;try{for(d.s();!(b=d.n()).done;){var m=b.value;n+=cn(m,o,m.lineNum,{inlineSource:r?.showSourceCode!=="no"})}}catch(g){d.e(g)}finally{d.f()}return n}}function cn(e,t,r,n){if(n!=null&&n.inlineSource){var o=_a(t,r),i=e.linePos>0?"".concat(" ".repeat(e.linePos+5),`^^^
@@ -12,19 +12,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
12
12
  `.concat(o).concat(i).concat(e.type.toUpperCase(),": ").concat(e.message,`
13
13
 
14
14
  `)}return n!=null&&n.html?`<div class='luma-compiler-log-error' style="color:red;"><b> `.concat(e.type.toUpperCase(),": ").concat(e.message,"</b></div>"):"".concat(e.type.toUpperCase(),": ").concat(e.message)}function _a(e,t,r){for(var n="",o=t-2;o<=t;o++){var i=e[o-1];i!==void 0&&(n+=ln(i,t,r))}return n}function ln(e,t,r){return"".concat(Oa(String(t),4),": ").concat(e).concat(r!=null&&r.html?"<br/>":`
15
- `)}function Oa(e,t){for(var r="",n=e.length;n<t;++n)r+=" ";return r+e}function Vt(e,t){return{name:Pa(e,t),language:"glsl",version:Sa(e)}}function Pa(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 Sa(e){var t=100,r=e.match(/[^\s]+/g);if(r&&r.length>=2&&r[0]==="#version"){var n=parseInt(r[1],10);Number.isFinite(n)&&(t=n)}return t}function ee(e){return ee=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},ee(e)}var yn;function Ht(){"use strict";Ht=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(s,u,f){s[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(s,u,f){return Object.defineProperty(s,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),s[u]}try{l({},"")}catch{l=function(f,p,y){return f[p]=y}}function d(s,u,f,p){var y=u&&u.prototype instanceof g?u:g,h=Object.create(y.prototype),v=new N(p||[]);return n(h,"_invoke",{value:z(s,f,v)}),h}function b(s,u,f){try{return{type:"normal",arg:s.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=d;var m={};function g(){}function w(){}function P(){}var I={};l(I,i,function(){return this});var B=Object.getPrototypeOf,A=B&&B(B(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=g.prototype=Object.create(I);function L(s){["next","throw","return"].forEach(function(u){l(s,u,function(f){return this._invoke(u,f)})})}function D(s,u){function f(y,h,v,_){var O=b(s[y],s,h);if(O.type!=="throw"){var x=O.arg,j=x.value;return j&&ee(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,_)},function(R){f("throw",R,v,_)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,_)})}_(O.arg)}var p;n(this,"_invoke",{value:function(h,v){function _(){return new u(function(O,x){f(h,v,O,x)})}return p=p?p.then(_,_):_()}})}function z(s,u,f){var p="suspendedStart";return function(y,h){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw h;return U()}for(f.method=y,f.arg=h;;){var v=f.delegate;if(v){var _=F(v,f);if(_){if(_===m)continue;return _}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var O=b(s,u,f);if(O.type==="normal"){if(p=f.done?"completed":"suspendedYield",O.arg===m)continue;return{value:O.arg,done:f.done}}O.type==="throw"&&(p="completed",f.method="throw",f.arg=O.arg)}}}function F(s,u){var f=u.method,p=s.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&s.iterator.return&&(u.method="return",u.arg=void 0,F(s,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,s.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var h=y.arg;return h?h.done?(u[s.resultName]=h.value,u.next=s.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):h:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function V(s){var u={tryLoc:s[0]};1 in s&&(u.catchLoc=s[1]),2 in s&&(u.finallyLoc=s[2],u.afterLoc=s[3]),this.tryEntries.push(u)}function C(s){var u=s.completion||{};u.type="normal",delete u.arg,s.completion=u}function N(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(V,this),this.reset(!0)}function k(s){if(s){var u=s[i];if(u)return u.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var f=-1,p=function y(){for(;++f<s.length;)if(r.call(s,f))return y.value=s[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:U}}function U(){return{value:void 0,done:!0}}return w.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:w,configurable:!0}),w.displayName=l(P,c,"GeneratorFunction"),e.isGeneratorFunction=function(s){var u=typeof s=="function"&&s.constructor;return!!u&&(u===w||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,P):(s.__proto__=P,l(s,c,"GeneratorFunction")),s.prototype=Object.create(T),s},e.awrap=function(s){return{__await:s}},L(D.prototype),l(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(s,u,f,p,y){y===void 0&&(y=Promise);var h=new D(d(s,u,f,p),y);return e.isGeneratorFunction(u)?h:h.next().then(function(v){return v.done?v.value:h.next()})},L(T),l(T,c,"Generator"),l(T,i,function(){return this}),l(T,"toString",function(){return"[object Generator]"}),e.keys=function(s){var u=Object(s),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var h=f.pop();if(h in u)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=k,N.prototype={constructor:N,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],v=h.completion;if(h.tryLoc==="root")return p("end");if(h.tryLoc<=this.prev){var _=r.call(h,"catchLoc"),O=r.call(h,"finallyLoc");if(_&&O){if(this.prev<h.catchLoc)return p(h.catchLoc,!0);if(this.prev<h.finallyLoc)return p(h.finallyLoc)}else if(_){if(this.prev<h.catchLoc)return p(h.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return p(h.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(u==="break"||u==="continue")&&h.tryLoc<=f&&f<=h.finallyLoc&&(h=null);var v=h?h.completion:{};return v.type=u,v.arg=f,h?(this.method="next",this.next=h.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var h=y.arg;C(p)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function pn(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(d){r(d);return}c.done?t(l):Promise.resolve(l).then(n,o)}function Ta(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(l){pn(i,n,o,a,c,"next",l)}function c(l){pn(i,n,o,a,c,"throw",l)}a(void 0)})}}function hn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Kt(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){ja(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 ja(e,t,r){return t=mn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ea(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dn(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,mn(n.key),n)}}function xa(e,t,r){return t&&dn(e.prototype,t),r&&dn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mn(e){var t=Ra(e,"string");return ee(t)==="symbol"?t:String(t)}function Ra(e,t){if(ee(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ee(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Aa(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&&$t(e,t)}function $t(e,t){return $t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$t(e,t)}function Ia(e){var t=Da();return function(){var n=ot(e),o;if(t){var i=ot(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Ba(this,o)}}function Ba(e,t){if(t&&(ee(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return La(e)}function La(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Da(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ot(e){return ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ot(e)}yn=Symbol.toStringTag;var it=function(e){Aa(r,e);var t=Ia(r);function r(o,i){var a;return Ea(this,r),a=t.call(this,o,Kt({id:Na(i)},i),r.defaultProps),a.stage=void 0,a.source=void 0,a.compilationStatus="pending",a.stage=a.props.stage,a.source=a.props.source,a}var n=r.prototype;return n.getCompilationInfoSync=function(){return null},n.debugShader=function(){var o=Ta(Ht().mark(function a(){var c;return Ht().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:d.t0=this.props.debug,d.next=d.t0==="never"?3:d.t0==="errors"?4:d.t0==="warnings"||d.t0==="always"?7:8;break;case 3:return d.abrupt("return");case 4:if(this.compilationStatus!=="success"){d.next=6;break}return d.abrupt("return");case 6:return d.abrupt("break",8);case 7:return d.abrupt("break",8);case 8:return d.next=10,this.getCompilationInfo();case 10:if(c=d.sent,!(this.props.debug==="warnings"&&c?.length===0)){d.next=13;break}return d.abrupt("return");case 13:this._displayShaderLog(c);case 14:case"end":return d.stop()}},a,this)}));function i(){return o.apply(this,arguments)}return i}(),n._displayShaderLog=function(i){var a,c,l=this;if(!(typeof document>"u"||!((a=document)!==null&&a!==void 0&&a.createElement))){var d=Vt(this.source).name,b="".concat(this.stage," ").concat(d),m=sn(i,this.source,{showSourceCode:"all",html:!0}),g=document.createElement("Button");g.innerHTML=`
15
+ `)}function Oa(e,t){for(var r="",n=e.length;n<t;++n)r+=" ";return r+e}function Vt(e,t){return{name:Pa(e,t),language:"glsl",version:Sa(e)}}function Pa(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 Sa(e){var t=100,r=e.match(/[^\s]+/g);if(r&&r.length>=2&&r[0]==="#version"){var n=parseInt(r[1],10);Number.isFinite(n)&&(t=n)}return t}function ee(e){return ee=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},ee(e)}var yn;function Ht(){"use strict";Ht=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(s,u,f){s[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(s,u,f){return Object.defineProperty(s,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),s[u]}try{l({},"")}catch{l=function(f,p,y){return f[p]=y}}function d(s,u,f,p){var y=u&&u.prototype instanceof g?u:g,h=Object.create(y.prototype),v=new N(p||[]);return n(h,"_invoke",{value:z(s,f,v)}),h}function b(s,u,f){try{return{type:"normal",arg:s.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=d;var m={};function g(){}function w(){}function P(){}var I={};l(I,i,function(){return this});var L=Object.getPrototypeOf,A=L&&L(L(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=g.prototype=Object.create(I);function B(s){["next","throw","return"].forEach(function(u){l(s,u,function(f){return this._invoke(u,f)})})}function D(s,u){function f(y,h,v,_){var O=b(s[y],s,h);if(O.type!=="throw"){var x=O.arg,j=x.value;return j&&ee(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,_)},function(R){f("throw",R,v,_)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,_)})}_(O.arg)}var p;n(this,"_invoke",{value:function(h,v){function _(){return new u(function(O,x){f(h,v,O,x)})}return p=p?p.then(_,_):_()}})}function z(s,u,f){var p="suspendedStart";return function(y,h){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw h;return U()}for(f.method=y,f.arg=h;;){var v=f.delegate;if(v){var _=F(v,f);if(_){if(_===m)continue;return _}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var O=b(s,u,f);if(O.type==="normal"){if(p=f.done?"completed":"suspendedYield",O.arg===m)continue;return{value:O.arg,done:f.done}}O.type==="throw"&&(p="completed",f.method="throw",f.arg=O.arg)}}}function F(s,u){var f=u.method,p=s.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&s.iterator.return&&(u.method="return",u.arg=void 0,F(s,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,s.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var h=y.arg;return h?h.done?(u[s.resultName]=h.value,u.next=s.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):h:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function V(s){var u={tryLoc:s[0]};1 in s&&(u.catchLoc=s[1]),2 in s&&(u.finallyLoc=s[2],u.afterLoc=s[3]),this.tryEntries.push(u)}function C(s){var u=s.completion||{};u.type="normal",delete u.arg,s.completion=u}function N(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(V,this),this.reset(!0)}function k(s){if(s){var u=s[i];if(u)return u.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var f=-1,p=function y(){for(;++f<s.length;)if(r.call(s,f))return y.value=s[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:U}}function U(){return{value:void 0,done:!0}}return w.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:w,configurable:!0}),w.displayName=l(P,c,"GeneratorFunction"),e.isGeneratorFunction=function(s){var u=typeof s=="function"&&s.constructor;return!!u&&(u===w||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,P):(s.__proto__=P,l(s,c,"GeneratorFunction")),s.prototype=Object.create(T),s},e.awrap=function(s){return{__await:s}},B(D.prototype),l(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(s,u,f,p,y){y===void 0&&(y=Promise);var h=new D(d(s,u,f,p),y);return e.isGeneratorFunction(u)?h:h.next().then(function(v){return v.done?v.value:h.next()})},B(T),l(T,c,"Generator"),l(T,i,function(){return this}),l(T,"toString",function(){return"[object Generator]"}),e.keys=function(s){var u=Object(s),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var h=f.pop();if(h in u)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=k,N.prototype={constructor:N,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],v=h.completion;if(h.tryLoc==="root")return p("end");if(h.tryLoc<=this.prev){var _=r.call(h,"catchLoc"),O=r.call(h,"finallyLoc");if(_&&O){if(this.prev<h.catchLoc)return p(h.catchLoc,!0);if(this.prev<h.finallyLoc)return p(h.finallyLoc)}else if(_){if(this.prev<h.catchLoc)return p(h.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return p(h.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(u==="break"||u==="continue")&&h.tryLoc<=f&&f<=h.finallyLoc&&(h=null);var v=h?h.completion:{};return v.type=u,v.arg=f,h?(this.method="next",this.next=h.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var h=y.arg;C(p)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function pn(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(d){r(d);return}c.done?t(l):Promise.resolve(l).then(n,o)}function Ta(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(l){pn(i,n,o,a,c,"next",l)}function c(l){pn(i,n,o,a,c,"throw",l)}a(void 0)})}}function hn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Kt(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){ja(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 ja(e,t,r){return t=mn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ea(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dn(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,mn(n.key),n)}}function xa(e,t,r){return t&&dn(e.prototype,t),r&&dn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mn(e){var t=Ra(e,"string");return ee(t)==="symbol"?t:String(t)}function Ra(e,t){if(ee(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ee(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Aa(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&&$t(e,t)}function $t(e,t){return $t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$t(e,t)}function Ia(e){var t=Da();return function(){var n=ot(e),o;if(t){var i=ot(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return La(this,o)}}function La(e,t){if(t&&(ee(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ba(e)}function Ba(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Da(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ot(e){return ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ot(e)}yn=Symbol.toStringTag;var it=function(e){Aa(r,e);var t=Ia(r);function r(o,i){var a;return Ea(this,r),a=t.call(this,o,Kt({id:Na(i)},i),r.defaultProps),a.stage=void 0,a.source=void 0,a.compilationStatus="pending",a.stage=a.props.stage,a.source=a.props.source,a}var n=r.prototype;return n.getCompilationInfoSync=function(){return null},n.debugShader=function(){var o=Ta(Ht().mark(function a(){var c;return Ht().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:d.t0=this.props.debug,d.next=d.t0==="never"?3:d.t0==="errors"?4:d.t0==="warnings"||d.t0==="always"?7:8;break;case 3:return d.abrupt("return");case 4:if(this.compilationStatus!=="success"){d.next=6;break}return d.abrupt("return");case 6:return d.abrupt("break",8);case 7:return d.abrupt("break",8);case 8:return d.next=10,this.getCompilationInfo();case 10:if(c=d.sent,!(this.props.debug==="warnings"&&c?.length===0)){d.next=13;break}return d.abrupt("return");case 13:this._displayShaderLog(c);case 14:case"end":return d.stop()}},a,this)}));function i(){return o.apply(this,arguments)}return i}(),n._displayShaderLog=function(i){var a,c,l=this;if(!(typeof document>"u"||!((a=document)!==null&&a!==void 0&&a.createElement))){var d=Vt(this.source).name,b="".concat(this.stage," ").concat(d),m=sn(i,this.source,{showSourceCode:"all",html:!0}),g=document.createElement("Button");g.innerHTML=`
16
16
  <h1>Shader Compilation Error in `.concat(b,`</h1><br /><br />
17
17
  <code style="user-select:text;"><pre>
18
18
  `).concat(m,`
19
- </pre></code>`),g.style.top="10px",g.style.left="10px",g.style.position="absolute",g.style.zIndex="9999",g.style.width="100%",g.style.textAlign="left",document.body.appendChild(g),(c=document.getElementsByClassName("luma-compiler-log-error")[0])===null||c===void 0||c.scrollIntoView(),g.onclick=function(){var w="data:text/plain,".concat(encodeURIComponent(l.source));navigator.clipboard.writeText(w)}}},xa(r,[{key:yn,get:function(){return"Shader"}}]),r}(E);it.defaultProps=Kt(Kt({},E.defaultProps),{},{language:"auto",stage:"vertex",source:"",sourceMap:null,entryPoint:"main",debug:"errors"});function Na(e){return Vt(e.source).name||e.id||Y("unnamed ".concat(e.stage,"-shader"))}function pe(e){return pe=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},pe(e)}var wn;function vn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function bn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vn(Object(r),!0).forEach(function(n){Ga(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ga(e,t,r){return t=_n(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ca(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,_n(n.key),n)}}function ka(e,t,r){return t&&gn(e.prototype,t),r&&gn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _n(e){var t=Ma(e,"string");return pe(t)==="symbol"?t:String(t)}function Ma(e,t){if(pe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ua(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&&Yt(e,t)}function Yt(e,t){return Yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Yt(e,t)}function Fa(e){var t=Va();return function(){var n=at(e),o;if(t){var i=at(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Wa(this,o)}}function Wa(e,t){if(t&&(pe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return za(e)}function za(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Va(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function at(e){return at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},at(e)}wn=Symbol.toStringTag;var he=function(e){Ua(r,e);var t=Fa(r);function r(n,o){return Ca(this,r),t.call(this,n,o,r.defaultProps)}return ka(r,[{key:wn,get:function(){return"Sampler"}}]),r}(E);he.defaultProps=bn(bn({},E.defaultProps),{},{type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});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)}var Tn;function On(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?On(Object(r),!0).forEach(function(n){Ha(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):On(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ha(e,t,r){return t=jn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ka(e,t){return Xa(e)||qa(e,t)||Ya(e,t)||$a()}function $a(){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 Ya(e,t){if(e){if(typeof e=="string")return Pn(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 Pn(e,t)}}function Pn(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 qa(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function Xa(e){if(Array.isArray(e))return e}function Za(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,jn(n.key),n)}}function Ja(e,t,r){return t&&Sn(e.prototype,t),r&&Sn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jn(e){var t=Qa(e,"string");return ye(t)==="symbol"?t:String(t)}function Qa(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 eu(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&&qt(e,t)}function qt(e,t){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},qt(e,t)}function tu(e){var t=ou();return function(){var n=ut(e),o;if(t){var i=ut(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ru(this,o)}}function ru(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 nu(e)}function nu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ou(){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 ut(e){return ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ut(e)}Tn=Symbol.toStringTag;var ft=function(e){eu(r,e);var t=tu(r);function r(o){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Za(this,r),i=t.call(this,o,a,r.defaultProps),i.width=void 0,i.height=void 0,i.colorAttachments=[],i.depthStencilAttachment=null,i.width=i.props.width,i.height=i.props.height,i}var n=r.prototype;return n.resize=function(i){var a=!i;if(i){var c=Array.isArray(i)?i:[i.width,i.height],l=Ka(c,2),d=l[0],b=l[1];a=a||b!==this.height||d!==this.width,this.width=d,this.height=b}a&&(S.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(this.width,"x").concat(this.height))(),this.resizeAttachments(this.width,this.height))},n.autoCreateAttachmentTextures=function(){var i=this;if(this.colorAttachments=this.props.colorAttachments.map(function(c){if(typeof c=="string"){var l=i.createColorTexture(c);return i.attachResource(l),l}return c}),this.props.depthStencilAttachment)if(typeof this.props.depthStencilAttachment=="string"){var a=this.createDepthStencilTexture(this.props.depthStencilAttachment);this.attachResource(a),this.depthStencilAttachment=a}else this.depthStencilAttachment=this.props.depthStencilAttachment},n.createColorTexture=function(i){return this.device.createTexture({id:"color-attachment",usage:W.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.createDepthStencilTexture=function(i){return this.device.createTexture({id:"depth-stencil-attachment",usage:W.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.resizeAttachments=function(i,a){for(var c=0;c<this.colorAttachments.length;++c)if(this.colorAttachments[c]){var l=this.device._createTexture(de(de({},this.colorAttachments[c].props),{},{width:i,height:a}));this.destroyAttachedResource(this.colorAttachments[c]),this.colorAttachments[c]=l,this.attachResource(l)}if(this.depthStencilAttachment){var d=this.device._createTexture(de(de({},this.depthStencilAttachment.props),{},{width:i,height:a}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=d,this.attachResource(d)}},Ja(r,[{key:Tn,get:function(){return"Framebuffer"}}]),r}(E);ft.defaultProps=de(de({},E.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});function me(e){return me=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},me(e)}var An;function En(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).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?En(Object(r),!0).forEach(function(n){iu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):En(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iu(e,t,r){return t=In(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function au(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rn(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,In(n.key),n)}}function uu(e,t,r){return t&&Rn(e.prototype,t),r&&Rn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function In(e){var t=fu(e,"string");return me(t)==="symbol"?t:String(t)}function fu(e,t){if(me(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(me(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cu(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&&Xt(e,t)}function Xt(e,t){return Xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Xt(e,t)}function su(e){var t=hu();return function(){var n=ct(e),o;if(t){var i=ct(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return lu(this,o)}}function lu(e,t){if(t&&(me(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pu(e)}function pu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hu(){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 ct(e){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ct(e)}An=Symbol.toStringTag;var st=function(e){cu(r,e);var t=su(r);function r(n,o){var i;return au(this,r),i=t.call(this,n,o,r.defaultProps),i.hash="",i.vs=void 0,i.fs=void 0,i.shaderLayout=void 0,i.bufferLayout=void 0,i.shaderLayout=i.props.shaderLayout,i.bufferLayout=i.props.bufferLayout||[],i}return uu(r,[{key:An,get:function(){return"RenderPipeline"}}]),r}(E);st.defaultProps=xn(xn({},E.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});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 Nn;function Bn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ln(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){du(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 du(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 yu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dn(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 mu(e,t,r){return t&&Dn(e.prototype,t),r&&Dn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gn(e){var t=vu(e,"string");return ve(t)==="symbol"?t:String(t)}function vu(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 bu(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&&Zt(e,t)}function Zt(e,t){return Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Zt(e,t)}function gu(e){var t=Ou();return function(){var n=lt(e),o;if(t){var i=lt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return wu(this,o)}}function wu(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 _u(e)}function _u(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ou(){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 lt(e){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lt(e)}Nn=Symbol.toStringTag;var pt=function(e){bu(r,e);var t=gu(r);function r(n,o){var i;return yu(this,r),i=t.call(this,n,o,r.defaultProps),i.hash="",i}return mu(r,[{key:Nn,get:function(){return"ComputePipeline"}}]),r}(E);pt.defaultProps=Ln(Ln({},E.defaultProps),{},{cs:void 0,csEntryPoint:void 0,csConstants:{},shaderLayout:[]});function be(e){return be=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},be(e)}var Un;function Cn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function kn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cn(Object(r),!0).forEach(function(n){Pu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pu(e,t,r){return t=Fn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Su(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mn(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,Fn(n.key),n)}}function Tu(e,t,r){return t&&Mn(e.prototype,t),r&&Mn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fn(e){var t=ju(e,"string");return be(t)==="symbol"?t:String(t)}function ju(e,t){if(be(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(be(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Eu(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&&Jt(e,t)}function Jt(e,t){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Jt(e,t)}function xu(e){var t=Iu();return function(){var n=ht(e),o;if(t){var i=ht(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Ru(this,o)}}function Ru(e,t){if(t&&(be(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Au(e)}function Au(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Iu(){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 ht(e){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ht(e)}Un=Symbol.toStringTag;var dt=function(e){Eu(r,e);var t=xu(r);function r(n,o){return Su(this,r),t.call(this,n,o,r.defaultProps)}return Tu(r,[{key:Un,get:function(){return"RenderPass"}}]),r}(E);dt.defaultProps=kn(kn({},E.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});function ge(e){return ge=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},ge(e)}var Vn;function Wn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Bu(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){Lu(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 Lu(e,t,r){return t=Hn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Du(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,Hn(n.key),n)}}function Nu(e,t,r){return t&&zn(e.prototype,t),r&&zn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hn(e){var t=Gu(e,"string");return ge(t)==="symbol"?t:String(t)}function Gu(e,t){if(ge(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cu(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&&Qt(e,t)}function Qt(e,t){return Qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Qt(e,t)}function ku(e){var t=Fu();return function(){var n=yt(e),o;if(t){var i=yt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Mu(this,o)}}function Mu(e,t){if(t&&(ge(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uu(e)}function Uu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fu(){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 yt(e){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yt(e)}Vn=Symbol.toStringTag;var mt=function(e){Cu(r,e);var t=ku(r);function r(n,o){return Du(this,r),t.call(this,n,o,E.defaultProps)}return Nu(r,[{key:Vn,get:function(){return"ComputePass"}}]),r}(E);mt.defaultProps=Bu({},E.defaultProps);function Wu(e,t){return Ku(e)||Hu(e,t)||Vu(e,t)||zu()}function zu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
+ </pre></code>`),g.style.top="10px",g.style.left="10px",g.style.position="absolute",g.style.zIndex="9999",g.style.width="100%",g.style.textAlign="left",document.body.appendChild(g);var w=document.getElementsByClassName("luma-compiler-log-error");(c=w[0])!==null&&c!==void 0&&c.scrollIntoView&&w[0].scrollIntoView(),g.onclick=function(){var P="data:text/plain,".concat(encodeURIComponent(l.source));navigator.clipboard.writeText(P)}}},xa(r,[{key:yn,get:function(){return"Shader"}}]),r}(E);it.defaultProps=Kt(Kt({},E.defaultProps),{},{language:"auto",stage:"vertex",source:"",sourceMap:null,entryPoint:"main",debug:"errors"});function Na(e){return Vt(e.source).name||e.id||Y("unnamed ".concat(e.stage,"-shader"))}function pe(e){return pe=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},pe(e)}var wn;function vn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function bn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vn(Object(r),!0).forEach(function(n){Ga(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ga(e,t,r){return t=_n(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ca(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,_n(n.key),n)}}function ka(e,t,r){return t&&gn(e.prototype,t),r&&gn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _n(e){var t=Ma(e,"string");return pe(t)==="symbol"?t:String(t)}function Ma(e,t){if(pe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ua(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&&Yt(e,t)}function Yt(e,t){return Yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Yt(e,t)}function Fa(e){var t=Va();return function(){var n=at(e),o;if(t){var i=at(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Wa(this,o)}}function Wa(e,t){if(t&&(pe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return za(e)}function za(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Va(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function at(e){return at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},at(e)}wn=Symbol.toStringTag;var he=function(e){Ua(r,e);var t=Fa(r);function r(n,o){return Ca(this,r),t.call(this,n,o,r.defaultProps)}return ka(r,[{key:wn,get:function(){return"Sampler"}}]),r}(E);he.defaultProps=bn(bn({},E.defaultProps),{},{type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});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)}var Tn;function On(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?On(Object(r),!0).forEach(function(n){Ha(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):On(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ha(e,t,r){return t=jn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ka(e,t){return Xa(e)||qa(e,t)||Ya(e,t)||$a()}function $a(){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 Ya(e,t){if(e){if(typeof e=="string")return Pn(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 Pn(e,t)}}function Pn(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 qa(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function Xa(e){if(Array.isArray(e))return e}function Za(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,jn(n.key),n)}}function Ja(e,t,r){return t&&Sn(e.prototype,t),r&&Sn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jn(e){var t=Qa(e,"string");return ye(t)==="symbol"?t:String(t)}function Qa(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 eu(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&&qt(e,t)}function qt(e,t){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},qt(e,t)}function tu(e){var t=ou();return function(){var n=ut(e),o;if(t){var i=ut(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ru(this,o)}}function ru(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 nu(e)}function nu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ou(){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 ut(e){return ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ut(e)}Tn=Symbol.toStringTag;var ft=function(e){eu(r,e);var t=tu(r);function r(o){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Za(this,r),i=t.call(this,o,a,r.defaultProps),i.width=void 0,i.height=void 0,i.colorAttachments=[],i.depthStencilAttachment=null,i.width=i.props.width,i.height=i.props.height,i}var n=r.prototype;return n.resize=function(i){var a=!i;if(i){var c=Array.isArray(i)?i:[i.width,i.height],l=Ka(c,2),d=l[0],b=l[1];a=a||b!==this.height||d!==this.width,this.width=d,this.height=b}a&&(S.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(this.width,"x").concat(this.height))(),this.resizeAttachments(this.width,this.height))},n.autoCreateAttachmentTextures=function(){var i=this;if(this.colorAttachments=this.props.colorAttachments.map(function(c){if(typeof c=="string"){var l=i.createColorTexture(c);return i.attachResource(l),l}return c}),this.props.depthStencilAttachment)if(typeof this.props.depthStencilAttachment=="string"){var a=this.createDepthStencilTexture(this.props.depthStencilAttachment);this.attachResource(a),this.depthStencilAttachment=a}else this.depthStencilAttachment=this.props.depthStencilAttachment},n.createColorTexture=function(i){return this.device.createTexture({id:"color-attachment",usage:W.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.createDepthStencilTexture=function(i){return this.device.createTexture({id:"depth-stencil-attachment",usage:W.RENDER_ATTACHMENT,format:i,width:this.width,height:this.height})},n.resizeAttachments=function(i,a){for(var c=0;c<this.colorAttachments.length;++c)if(this.colorAttachments[c]){var l=this.device._createTexture(de(de({},this.colorAttachments[c].props),{},{width:i,height:a}));this.destroyAttachedResource(this.colorAttachments[c]),this.colorAttachments[c]=l,this.attachResource(l)}if(this.depthStencilAttachment){var d=this.device._createTexture(de(de({},this.depthStencilAttachment.props),{},{width:i,height:a}));this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=d,this.attachResource(d)}},Ja(r,[{key:Tn,get:function(){return"Framebuffer"}}]),r}(E);ft.defaultProps=de(de({},E.defaultProps),{},{width:1,height:1,colorAttachments:[],depthStencilAttachment:null});function me(e){return me=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},me(e)}var An;function En(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).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?En(Object(r),!0).forEach(function(n){iu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):En(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iu(e,t,r){return t=In(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function au(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rn(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,In(n.key),n)}}function uu(e,t,r){return t&&Rn(e.prototype,t),r&&Rn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function In(e){var t=fu(e,"string");return me(t)==="symbol"?t:String(t)}function fu(e,t){if(me(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(me(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cu(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&&Xt(e,t)}function Xt(e,t){return Xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Xt(e,t)}function su(e){var t=hu();return function(){var n=ct(e),o;if(t){var i=ct(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return lu(this,o)}}function lu(e,t){if(t&&(me(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pu(e)}function pu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hu(){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 ct(e){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ct(e)}An=Symbol.toStringTag;var st=function(e){cu(r,e);var t=su(r);function r(n,o){var i;return au(this,r),i=t.call(this,n,o,r.defaultProps),i.hash="",i.vs=void 0,i.fs=void 0,i.shaderLayout=void 0,i.bufferLayout=void 0,i.shaderLayout=i.props.shaderLayout,i.bufferLayout=i.props.bufferLayout||[],i}return uu(r,[{key:An,get:function(){return"RenderPipeline"}}]),r}(E);st.defaultProps=xn(xn({},E.defaultProps),{},{vs:null,vsEntryPoint:"",vsConstants:{},fs:null,fsEntryPoint:"",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},vertexCount:0,instanceCount:0,bindings:{},uniforms:{}});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 Nn;function Ln(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Bn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ln(Object(r),!0).forEach(function(n){du(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ln(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function du(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 yu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dn(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 mu(e,t,r){return t&&Dn(e.prototype,t),r&&Dn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gn(e){var t=vu(e,"string");return ve(t)==="symbol"?t:String(t)}function vu(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 bu(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&&Zt(e,t)}function Zt(e,t){return Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Zt(e,t)}function gu(e){var t=Ou();return function(){var n=lt(e),o;if(t){var i=lt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return wu(this,o)}}function wu(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 _u(e)}function _u(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ou(){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 lt(e){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lt(e)}Nn=Symbol.toStringTag;var pt=function(e){bu(r,e);var t=gu(r);function r(n,o){var i;return yu(this,r),i=t.call(this,n,o,r.defaultProps),i.hash="",i}return mu(r,[{key:Nn,get:function(){return"ComputePipeline"}}]),r}(E);pt.defaultProps=Bn(Bn({},E.defaultProps),{},{cs:void 0,csEntryPoint:void 0,csConstants:{},shaderLayout:[]});function be(e){return be=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},be(e)}var Un;function Cn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function kn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cn(Object(r),!0).forEach(function(n){Pu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pu(e,t,r){return t=Fn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Su(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mn(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,Fn(n.key),n)}}function Tu(e,t,r){return t&&Mn(e.prototype,t),r&&Mn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fn(e){var t=ju(e,"string");return be(t)==="symbol"?t:String(t)}function ju(e,t){if(be(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(be(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Eu(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&&Jt(e,t)}function Jt(e,t){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Jt(e,t)}function xu(e){var t=Iu();return function(){var n=ht(e),o;if(t){var i=ht(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Ru(this,o)}}function Ru(e,t){if(t&&(be(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Au(e)}function Au(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Iu(){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 ht(e){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ht(e)}Un=Symbol.toStringTag;var dt=function(e){Eu(r,e);var t=xu(r);function r(n,o){return Su(this,r),t.call(this,n,o,r.defaultProps)}return Tu(r,[{key:Un,get:function(){return"RenderPass"}}]),r}(E);dt.defaultProps=kn(kn({},E.defaultProps),{},{framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1});function ge(e){return ge=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},ge(e)}var Vn;function Wn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Lu(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){Bu(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 Bu(e,t,r){return t=Hn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Du(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,Hn(n.key),n)}}function Nu(e,t,r){return t&&zn(e.prototype,t),r&&zn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hn(e){var t=Gu(e,"string");return ge(t)==="symbol"?t:String(t)}function Gu(e,t){if(ge(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cu(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&&Qt(e,t)}function Qt(e,t){return Qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Qt(e,t)}function ku(e){var t=Fu();return function(){var n=yt(e),o;if(t){var i=yt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Mu(this,o)}}function Mu(e,t){if(t&&(ge(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uu(e)}function Uu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fu(){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 yt(e){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yt(e)}Vn=Symbol.toStringTag;var mt=function(e){Cu(r,e);var t=ku(r);function r(n,o){return Du(this,r),t.call(this,n,o,E.defaultProps)}return Nu(r,[{key:Vn,get:function(){return"ComputePass"}}]),r}(E);mt.defaultProps=Lu({},E.defaultProps);function Wu(e,t){return Ku(e)||Hu(e,t)||Vu(e,t)||zu()}function zu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
21
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 Kn(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 Kn(e,t)}}function Kn(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,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function Ku(e){if(Array.isArray(e))return e}function $n(e){var t=Wu(Yu[e],2),r=t[0],n=t[1],o=r==="i32"||r==="u32",i=r!=="u32",a=qu[r]*n,c=$u(r,n);return{dataType:r,components:n,defaultVertexFormat:c,byteLength:a,integer:o,signed:i}}function $u(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 Yu={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]},qu={f32:4,f16:2,i32:4,u32:4};function qn(e){var t=Yn[e],r=Xu(t),n=e.includes("norm"),o=!n&&!e.startsWith("float"),i=e.startsWith("s");return{dataType:Yn[e],byteLength:r,integer:o,signed:i,normalized:n}}function Xu(e){var t=Zu[e];return t}var Yn={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},Zu={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};function Ju(e,t){return rf(e)||tf(e,t)||ef(e,t)||Qu()}function Qu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
22
22
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ef(e,t){if(e){if(typeof e=="string")return Xn(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 Xn(e,t)}}function Xn(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 tf(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function rf(e){if(Array.isArray(e))return e}function X(e){var t;e.endsWith("-webgl")&&(e.replace("-webgl",""),t=!0);var r=e.split("x"),n=Ju(r,2),o=n[0],i=n[1],a=o,c=i?parseInt(i):1,l=qn(a),d={type:a,components:c,byteLength:l.byteLength*c,integer:l.integer,signed:l.signed,normalized:l.normalized};return t&&(d.webglOnly=!0),d}function Fe(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=nf(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
23
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return i=d.done,d},e:function(d){a=!0,c=d},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function nf(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 of(e,t){var r={},n=Fe(e.attributes),o;try{for(n.s();!(o=n.n()).done;){var i=o.value;r[i.name]=af(e,t,i.name)}}catch(a){n.e(a)}finally{n.f()}return r}function Jn(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,n=of(e,t),o=new Array(r).fill(null),i=0,a=Object.values(n);i<a.length;i++){var c=a[i];o[c.location]=c}return o}function af(e,t,r){var n=uf(e,r),o=ff(t,r);if(!n)return null;var i=$n(n.type),a=o?.vertexFormat||i.defaultVertexFormat,c=X(a);return{attributeName:o?.attributeName||n.name,bufferName:o?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:i.dataType,shaderComponents:i.components,vertexFormat:a,bufferDataType:c.type,bufferComponents:c.components,normalized:c.normalized,integer:i.integer,stepMode:o?.stepMode||n.stepMode,byteOffset:o?.byteOffset||0,byteStride:o?.byteStride||0}}function uf(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||S.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function ff(e,t){cf(e);var r=sf(e,t);return r||(r=lf(e,t),r)?r:(S.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function cf(e){var t=Fe(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&S.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(o){t.e(o)}finally{t.f()}}function sf(e,t){var r=Fe(e),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.format&&o.name===t)return{attributeName:o.name,bufferName:t,stepMode:o.stepMode,vertexFormat:o.format,byteOffset:0,byteStride:o.byteStride||0}}}catch(i){r.e(i)}finally{r.f()}return null}function lf(e,t){var r=Fe(e),n;try{for(r.s();!(n=r.n()).done;){var o,i=n.value,a=i.byteStride;if(typeof i.byteStride!="number"){var c=Fe(i.attributes||[]),l;try{for(c.s();!(l=c.n()).done;){var d=l.value,b=X(d.format);a+=b.byteLength}}catch(g){c.e(g)}finally{c.f()}}var m=(o=i.attributes)===null||o===void 0?void 0:o.find(function(g){return g.attribute===t});if(m)return{attributeName:m.attribute,bufferName:i.name,stepMode:i.stepMode,vertexFormat:m.format,byteOffset:m.byteOffset,byteStride:a}}}catch(g){r.e(g)}finally{r.f()}return null}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)}var ro;function Qn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function eo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qn(Object(r),!0).forEach(function(n){pf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pf(e,t,r){return t=no(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function to(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,no(n.key),n)}}function df(e,t,r){return t&&to(e.prototype,t),r&&to(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function no(e){var t=yf(e,"string");return we(t)==="symbol"?t:String(t)}function yf(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 mf(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&&er(e,t)}function er(e,t){return er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},er(e,t)}function vf(e){var t=wf();return function(){var n=vt(e),o;if(t){var i=vt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return bf(this,o)}}function bf(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 gf(e)}function gf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wf(){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 vt(e){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vt(e)}ro=Symbol.toStringTag;var bt=function(e){mf(r,e);var t=vf(r);function r(n,o){var i;return hf(this,r),i=t.call(this,n,o,r.defaultProps),i.maxVertexAttributes=void 0,i.attributeInfos=void 0,i.indexBuffer=null,i.attributes=void 0,i.maxVertexAttributes=n.limits.maxVertexAttributes,i.attributes=new Array(i.maxVertexAttributes).fill(null),i.attributeInfos=Jn(o.renderPipeline.shaderLayout,o.renderPipeline.bufferLayout,i.maxVertexAttributes),i}return df(r,[{key:ro,get:function(){return"VertexArray"}}]),r}(E);bt.defaultProps=eo(eo({},E.defaultProps),{},{renderPipeline:null});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 tr(){"use strict";tr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(s,u,f){s[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(s,u,f){return Object.defineProperty(s,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),s[u]}try{l({},"")}catch{l=function(f,p,y){return f[p]=y}}function d(s,u,f,p){var y=u&&u.prototype instanceof g?u:g,h=Object.create(y.prototype),v=new N(p||[]);return n(h,"_invoke",{value:z(s,f,v)}),h}function b(s,u,f){try{return{type:"normal",arg:s.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=d;var m={};function g(){}function w(){}function P(){}var I={};l(I,i,function(){return this});var B=Object.getPrototypeOf,A=B&&B(B(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=g.prototype=Object.create(I);function L(s){["next","throw","return"].forEach(function(u){l(s,u,function(f){return this._invoke(u,f)})})}function D(s,u){function f(y,h,v,_){var O=b(s[y],s,h);if(O.type!=="throw"){var x=O.arg,j=x.value;return j&&te(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,_)},function(R){f("throw",R,v,_)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,_)})}_(O.arg)}var p;n(this,"_invoke",{value:function(h,v){function _(){return new u(function(O,x){f(h,v,O,x)})}return p=p?p.then(_,_):_()}})}function z(s,u,f){var p="suspendedStart";return function(y,h){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw h;return U()}for(f.method=y,f.arg=h;;){var v=f.delegate;if(v){var _=F(v,f);if(_){if(_===m)continue;return _}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var O=b(s,u,f);if(O.type==="normal"){if(p=f.done?"completed":"suspendedYield",O.arg===m)continue;return{value:O.arg,done:f.done}}O.type==="throw"&&(p="completed",f.method="throw",f.arg=O.arg)}}}function F(s,u){var f=u.method,p=s.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&s.iterator.return&&(u.method="return",u.arg=void 0,F(s,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,s.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var h=y.arg;return h?h.done?(u[s.resultName]=h.value,u.next=s.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):h:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function V(s){var u={tryLoc:s[0]};1 in s&&(u.catchLoc=s[1]),2 in s&&(u.finallyLoc=s[2],u.afterLoc=s[3]),this.tryEntries.push(u)}function C(s){var u=s.completion||{};u.type="normal",delete u.arg,s.completion=u}function N(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(V,this),this.reset(!0)}function k(s){if(s){var u=s[i];if(u)return u.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var f=-1,p=function y(){for(;++f<s.length;)if(r.call(s,f))return y.value=s[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:U}}function U(){return{value:void 0,done:!0}}return w.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:w,configurable:!0}),w.displayName=l(P,c,"GeneratorFunction"),e.isGeneratorFunction=function(s){var u=typeof s=="function"&&s.constructor;return!!u&&(u===w||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,P):(s.__proto__=P,l(s,c,"GeneratorFunction")),s.prototype=Object.create(T),s},e.awrap=function(s){return{__await:s}},L(D.prototype),l(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(s,u,f,p,y){y===void 0&&(y=Promise);var h=new D(d(s,u,f,p),y);return e.isGeneratorFunction(u)?h:h.next().then(function(v){return v.done?v.value:h.next()})},L(T),l(T,c,"Generator"),l(T,i,function(){return this}),l(T,"toString",function(){return"[object Generator]"}),e.keys=function(s){var u=Object(s),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var h=f.pop();if(h in u)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=k,N.prototype={constructor:N,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],v=h.completion;if(h.tryLoc==="root")return p("end");if(h.tryLoc<=this.prev){var _=r.call(h,"catchLoc"),O=r.call(h,"finallyLoc");if(_&&O){if(this.prev<h.catchLoc)return p(h.catchLoc,!0);if(this.prev<h.finallyLoc)return p(h.finallyLoc)}else if(_){if(this.prev<h.catchLoc)return p(h.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return p(h.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(u==="break"||u==="continue")&&h.tryLoc<=f&&f<=h.finallyLoc&&(h=null);var v=h?h.completion:{};return v.type=u,v.arg=f,h?(this.method="next",this.next=h.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var h=y.arg;C(p)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function oo(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(d){r(d);return}c.done?t(l):Promise.resolve(l).then(n,o)}function _f(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(l){oo(i,n,o,a,c,"next",l)}function c(l){oo(i,n,o,a,c,"throw",l)}a(void 0)})}}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,Pf(n.key),n)}}function Of(e,t,r){return t&&io(e.prototype,t),r&&io(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pf(e){var t=Sf(e,"string");return te(t)==="symbol"?t:String(t)}function Sf(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 Tf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jf(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,o){return n.__proto__=o,n},rr(e,t)}function Ef(e){var t=Af();return function(){var n=gt(e),o;if(t){var i=gt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return xf(this,o)}}function xf(e,t){if(t&&(te(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rf(e)}function Rf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Af(){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 gt(e){return gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gt(e)}function If(e){var t;return e.byteLength||((t=e.data)===null||t===void 0?void 0:t.byteLength)||0}var wt=function(e){jf(r,e);var t=Ef(r);function r(o,i){var a;Tf(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.byteLength=void 0,a.device=o,a.byteLength=If(i);var c=Boolean(i.data),l=Math.ceil(a.byteLength/4)*4;return a.handle=a.props.handle||a.device.handle.createBuffer({size:l,usage:a.props.usage||GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST,mappedAtCreation:a.props.mappedAtCreation||c,label:a.props.id}),i.data&&a._writeMapped(i.data),c&&!i.mappedAtCreation&&a.handle.unmap(),a}var n=r.prototype;return n.destroy=function(){this.handle.destroy()},n.write=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.device.handle.queue.writeBuffer(this.handle,a,i.buffer,i.byteOffset,i.byteLength)},n.readAsync=function(){var o=_f(tr().mark(function a(){var c,l,d,b,m,g=arguments;return tr().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return c=g.length>0&&g[0]!==void 0?g[0]:0,l=g.length>1&&g[1]!==void 0?g[1]:this.byteLength,d=new r(this.device,{usage:G.MAP_READ|G.COPY_DST,byteLength:l}),b=this.device.handle.createCommandEncoder(),b.copyBufferToBuffer(this.handle,c,d.handle,0,l),this.device.handle.queue.submit([b.finish()]),P.next=8,d.handle.mapAsync(GPUMapMode.READ,c,l);case 8:return m=d.handle.getMappedRange().slice(0),d.handle.unmap(),d.destroy(),P.abrupt("return",new Uint8Array(m));case 12:case"end":return P.stop()}},a,this)}));function i(){return o.apply(this,arguments)}return i}(),n._writeMapped=function(i){var a=this.handle.getMappedRange();new i.constructor(a).set(i)},n.mapAsync=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,c=arguments.length>2?arguments[2]:void 0;return this.handle.mapAsync(i,a,c)},n.getMappedRange=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1?arguments[1]:void 0;return this.handle.getMappedRange(i,a)},n.unmap=function(){this.handle.unmap()},Of(r)}(G);function _e(e){if(e.includes("webgl"))throw new Error("webgl-only format");return e}function Oe(e){return Oe=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},Oe(e)}function ao(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Bf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ao(Object(r),!0).forEach(function(n){Lf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ao(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Lf(e,t,r){return t=fo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uo(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,fo(n.key),n)}}function Df(e,t,r){return t&&uo(e.prototype,t),r&&uo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function fo(e){var t=Nf(e,"string");return Oe(t)==="symbol"?t:String(t)}function Nf(e,t){if(Oe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Oe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cf(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&&nr(e,t)}function nr(e,t){return nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},nr(e,t)}function kf(e){var t=Ff();return function(){var n=_t(e),o;if(t){var i=_t(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Mf(this,o)}}function Mf(e,t){if(t&&(Oe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uf(e)}function Uf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ff(){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 _t(e){return _t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_t(e)}var K=function(e){Cf(r,e);var t=kf(r);function r(o,i){var a;Gf(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o;var c=Bf({},a.props);return c.type!=="comparison-sampler"&&delete c.compare,a.handle=a.handle||a.device.handle.createSampler(c),a.handle.label=a.props.id,a}var n=r.prototype;return n.destroy=function(){},Df(r)}(he);function Pe(e){return Pe=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},Pe(e)}function co(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,zf(n.key),n)}}function Wf(e,t,r){return t&&co(e.prototype,t),r&&co(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function zf(e){var t=Vf(e,"string");return Pe(t)==="symbol"?t:String(t)}function Vf(e,t){if(Pe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pe(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")}function Kf(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&&or(e,t)}function or(e,t){return or=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},or(e,t)}function $f(e){var t=Xf();return function(){var n=Ot(e),o;if(t){var i=Ot(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Yf(this,o)}}function Yf(e,t){if(t&&(Pe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qf(e)}function qf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xf(){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 Ot(e){return Ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ot(e)}var Zf={"1d":"1d","2d":"2d","2d-array":"2d",cube:"2d","cube-array":"2d","3d":"3d"},Pt=function(e){Kf(r,e);var t=$f(r);function r(o,i){var a;if(Hf(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.view=void 0,a.sampler=void 0,a.height=1,a.width=1,typeof a.props.format=="number")throw new Error("number format");return a.device=o,a.handle=a.props.handle||a.createHandle(),a.props.data&&a.setData({data:a.props.data}),a.width=a.handle.width,a.height=a.handle.height,a.sampler=i.sampler instanceof K?i.sampler:new K(a.device,i.sampler),a.view=a.handle.createView({}),a}var n=r.prototype;return n.createHandle=function(){var i,a;if(typeof this.props.format=="number")throw new Error("number format");var c=this.props.width||((i=this.props.data)===null||i===void 0?void 0:i.width)||1,l=this.props.height||((a=this.props.data)===null||a===void 0?void 0:a.height)||1;return this.device.handle.createTexture({size:{width:c,height:l,depthOrArrayLayers:this.props.depth},dimension:Zf[this.props.dimension],format:_e(this.props.format),usage:this.props.usage,mipLevelCount:this.props.mipLevels,sampleCount:this.props.samples})},n.destroy=function(){this.handle.destroy()},n.setSampler=function(i){return this.sampler=i instanceof K?i:new K(this.device,i),this},n.setData=function(i){return this.setImage({source:i.data})},n.setImage=function(i){var a=i.source,c=i.width,l=c===void 0?i.source.width:c,d=i.height,b=d===void 0?i.source.height:d,m=i.depth,g=m===void 0?1:m,w=i.sourceX,P=w===void 0?0:w,I=i.sourceY,B=I===void 0?0:I,A=i.mipLevel,T=A===void 0?0:A,L=i.x,D=L===void 0?0:L,z=i.y,F=z===void 0?0:z,V=i.z,C=V===void 0?0:V,N=i.aspect,k=N===void 0?"all":N,U=i.colorSpace,s=U===void 0?"srgb":U,u=i.premultipliedAlpha,f=u===void 0?!1:u;return this.device.handle.queue.copyExternalImageToTexture({source:a,origin:[P,B]},{texture:this.handle,origin:[D,F,C],mipLevel:T,aspect:k,colorSpace:s,premultipliedAlpha:f},[l,b,g]),{width:l,height:b}},Wf(r)}(W);function Se(e){return Se=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},Se(e)}function so(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,Qf(n.key),n)}}function Jf(e,t,r){return t&&so(e.prototype,t),r&&so(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qf(e){var t=ec(e,"string");return Se(t)==="symbol"?t:String(t)}function ec(e,t){if(Se(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Se(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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&&ir(e,t)}function ir(e,t){return ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ir(e,t)}function nc(e){var t=ac();return function(){var n=St(e),o;if(t){var i=St(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return oc(this,o)}}function oc(e,t){if(t&&(Se(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ic(e)}function ic(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 St(e){return St=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},St(e)}var lo=function(e){rc(r,e);var t=nc(r);function r(o,i){var a;return tc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.sampler=void 0,a.device=o,a.handle=a.props.handle||a.device.handle.importExternalTexture({source:i.source,colorSpace:i.colorSpace}),a.sampler=null,a}var n=r.prototype;return n.destroy=function(){},n.setSampler=function(i){return this.sampler=i instanceof K?i:new K(this.device,i),this},Jf(r)}(nt);function re(e){return re=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},re(e)}function We(){"use strict";We=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(s,u,f){s[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(s,u,f){return Object.defineProperty(s,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),s[u]}try{l({},"")}catch{l=function(f,p,y){return f[p]=y}}function d(s,u,f,p){var y=u&&u.prototype instanceof g?u:g,h=Object.create(y.prototype),v=new N(p||[]);return n(h,"_invoke",{value:z(s,f,v)}),h}function b(s,u,f){try{return{type:"normal",arg:s.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=d;var m={};function g(){}function w(){}function P(){}var I={};l(I,i,function(){return this});var B=Object.getPrototypeOf,A=B&&B(B(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=g.prototype=Object.create(I);function L(s){["next","throw","return"].forEach(function(u){l(s,u,function(f){return this._invoke(u,f)})})}function D(s,u){function f(y,h,v,_){var O=b(s[y],s,h);if(O.type!=="throw"){var x=O.arg,j=x.value;return j&&re(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,_)},function(R){f("throw",R,v,_)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,_)})}_(O.arg)}var p;n(this,"_invoke",{value:function(h,v){function _(){return new u(function(O,x){f(h,v,O,x)})}return p=p?p.then(_,_):_()}})}function z(s,u,f){var p="suspendedStart";return function(y,h){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw h;return U()}for(f.method=y,f.arg=h;;){var v=f.delegate;if(v){var _=F(v,f);if(_){if(_===m)continue;return _}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var O=b(s,u,f);if(O.type==="normal"){if(p=f.done?"completed":"suspendedYield",O.arg===m)continue;return{value:O.arg,done:f.done}}O.type==="throw"&&(p="completed",f.method="throw",f.arg=O.arg)}}}function F(s,u){var f=u.method,p=s.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&s.iterator.return&&(u.method="return",u.arg=void 0,F(s,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,s.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var h=y.arg;return h?h.done?(u[s.resultName]=h.value,u.next=s.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):h:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function V(s){var u={tryLoc:s[0]};1 in s&&(u.catchLoc=s[1]),2 in s&&(u.finallyLoc=s[2],u.afterLoc=s[3]),this.tryEntries.push(u)}function C(s){var u=s.completion||{};u.type="normal",delete u.arg,s.completion=u}function N(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(V,this),this.reset(!0)}function k(s){if(s){var u=s[i];if(u)return u.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var f=-1,p=function y(){for(;++f<s.length;)if(r.call(s,f))return y.value=s[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:U}}function U(){return{value:void 0,done:!0}}return w.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:w,configurable:!0}),w.displayName=l(P,c,"GeneratorFunction"),e.isGeneratorFunction=function(s){var u=typeof s=="function"&&s.constructor;return!!u&&(u===w||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,P):(s.__proto__=P,l(s,c,"GeneratorFunction")),s.prototype=Object.create(T),s},e.awrap=function(s){return{__await:s}},L(D.prototype),l(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(s,u,f,p,y){y===void 0&&(y=Promise);var h=new D(d(s,u,f,p),y);return e.isGeneratorFunction(u)?h:h.next().then(function(v){return v.done?v.value:h.next()})},L(T),l(T,c,"Generator"),l(T,i,function(){return this}),l(T,"toString",function(){return"[object Generator]"}),e.keys=function(s){var u=Object(s),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var h=f.pop();if(h in u)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=k,N.prototype={constructor:N,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],v=h.completion;if(h.tryLoc==="root")return p("end");if(h.tryLoc<=this.prev){var _=r.call(h,"catchLoc"),O=r.call(h,"finallyLoc");if(_&&O){if(this.prev<h.catchLoc)return p(h.catchLoc,!0);if(this.prev<h.finallyLoc)return p(h.finallyLoc)}else if(_){if(this.prev<h.catchLoc)return p(h.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return p(h.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(u==="break"||u==="continue")&&h.tryLoc<=f&&f<=h.finallyLoc&&(h=null);var v=h?h.completion:{};return v.type=u,v.arg=f,h?(this.method="next",this.next=h.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var h=y.arg;C(p)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function po(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(d){r(d);return}c.done?t(l):Promise.resolve(l).then(n,o)}function ho(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(l){po(i,n,o,a,c,"next",l)}function c(l){po(i,n,o,a,c,"throw",l)}a(void 0)})}}function yo(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,fc(n.key),n)}}function uc(e,t,r){return t&&yo(e.prototype,t),r&&yo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function fc(e){var t=cc(e,"string");return re(t)==="symbol"?t:String(t)}function cc(e,t){if(re(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(re(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lc(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,o){return n.__proto__=o,n},ar(e,t)}function pc(e){var t=yc();return function(){var n=Tt(e),o;if(t){var i=Tt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return hc(this,o)}}function hc(e,t){if(t&&(re(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dc(e)}function dc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yc(){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 Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tt(e)}var jt=function(e){lc(r,e);var t=pc(r);function r(o,i){var a;return sc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o,a.device.handle.pushErrorScope("validation"),a.handle=a.props.handle||a.createHandle(),a.handle.label=a.props.id,a._checkCompilationError(a.device.handle.popErrorScope()),a}var n=r.prototype;return n._checkCompilationError=function(){var o=ho(We().mark(function a(c){var l,d;return We().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,c;case 2:if(l=m.sent,!l){m.next=9;break}return m.next=6,this.getCompilationInfo();case 6:throw d=m.sent,S.error("Shader compilation error: ".concat(l.message),d)(),new Error("Shader compilation error: ".concat(l.message));case 9:case"end":return m.stop()}},a,this)}));function i(a){return o.apply(this,arguments)}return i}(),n.destroy=function(){},n.getCompilationInfo=function(){var o=ho(We().mark(function a(){var c;return We().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.handle.getCompilationInfo();case 2:return c=d.sent,d.abrupt("return",c.messages);case 4:case"end":return d.stop()}},a,this)}));function i(){return o.apply(this,arguments)}return i}(),n.createHandle=function(){var i=this,a=this.props,c=a.source,l=a.stage,d=this.props.language;switch(d==="auto"&&(d=c.includes("->")?"wgsl":"glsl"),d){case"wgsl":return this.device.handle.createShaderModule({code:c});case"glsl":return this.device.handle.createShaderModule({code:c,transform:function(m){return i.device.glslang.compileGLSL(m,l)}});default:throw new Error(d)}},uc(r)}(it);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 mc(e,t){return wc(e)||gc(e,t)||bc(e,t)||vc()}function vc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
23
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return i=d.done,d},e:function(d){a=!0,c=d},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function nf(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 of(e,t){var r={},n=Fe(e.attributes),o;try{for(n.s();!(o=n.n()).done;){var i=o.value;r[i.name]=af(e,t,i.name)}}catch(a){n.e(a)}finally{n.f()}return r}function Jn(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:16,n=of(e,t),o=new Array(r).fill(null),i=0,a=Object.values(n);i<a.length;i++){var c=a[i];o[c.location]=c}return o}function af(e,t,r){var n=uf(e,r),o=ff(t,r);if(!n)return null;var i=$n(n.type),a=o?.vertexFormat||i.defaultVertexFormat,c=X(a);return{attributeName:o?.attributeName||n.name,bufferName:o?.bufferName||n.name,location:n.location,shaderType:n.type,shaderDataType:i.dataType,shaderComponents:i.components,vertexFormat:a,bufferDataType:c.type,bufferComponents:c.components,normalized:c.normalized,integer:i.integer,stepMode:o?.stepMode||n.stepMode,byteOffset:o?.byteOffset||0,byteStride:o?.byteStride||0}}function uf(e,t){var r=e.attributes.find(function(n){return n.name===t});return r||S.warn('shader layout attribute "'.concat(t,'" not present in shader')),r||null}function ff(e,t){cf(e);var r=sf(e,t);return r||(r=lf(e,t),r)?r:(S.warn('layout for attribute "'.concat(t,'" not present in buffer layout')),null)}function cf(e){var t=Fe(e),r;try{for(t.s();!(r=t.n()).done;){var n=r.value;(n.attributes&&n.format||!n.attributes&&!n.format)&&S.warn("BufferLayout ".concat(name," must have either 'attributes' or 'format' field"))}}catch(o){t.e(o)}finally{t.f()}}function sf(e,t){var r=Fe(e),n;try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.format&&o.name===t)return{attributeName:o.name,bufferName:t,stepMode:o.stepMode,vertexFormat:o.format,byteOffset:0,byteStride:o.byteStride||0}}}catch(i){r.e(i)}finally{r.f()}return null}function lf(e,t){var r=Fe(e),n;try{for(r.s();!(n=r.n()).done;){var o,i=n.value,a=i.byteStride;if(typeof i.byteStride!="number"){var c=Fe(i.attributes||[]),l;try{for(c.s();!(l=c.n()).done;){var d=l.value,b=X(d.format);a+=b.byteLength}}catch(g){c.e(g)}finally{c.f()}}var m=(o=i.attributes)===null||o===void 0?void 0:o.find(function(g){return g.attribute===t});if(m)return{attributeName:m.attribute,bufferName:i.name,stepMode:i.stepMode,vertexFormat:m.format,byteOffset:m.byteOffset,byteStride:a}}}catch(g){r.e(g)}finally{r.f()}return null}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)}var ro;function Qn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function eo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qn(Object(r),!0).forEach(function(n){pf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pf(e,t,r){return t=no(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function to(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,no(n.key),n)}}function df(e,t,r){return t&&to(e.prototype,t),r&&to(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function no(e){var t=yf(e,"string");return we(t)==="symbol"?t:String(t)}function yf(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 mf(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&&er(e,t)}function er(e,t){return er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},er(e,t)}function vf(e){var t=wf();return function(){var n=vt(e),o;if(t){var i=vt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return bf(this,o)}}function bf(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 gf(e)}function gf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wf(){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 vt(e){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vt(e)}ro=Symbol.toStringTag;var bt=function(e){mf(r,e);var t=vf(r);function r(n,o){var i;return hf(this,r),i=t.call(this,n,o,r.defaultProps),i.maxVertexAttributes=void 0,i.attributeInfos=void 0,i.indexBuffer=null,i.attributes=void 0,i.maxVertexAttributes=n.limits.maxVertexAttributes,i.attributes=new Array(i.maxVertexAttributes).fill(null),i.attributeInfos=Jn(o.renderPipeline.shaderLayout,o.renderPipeline.bufferLayout,i.maxVertexAttributes),i}return df(r,[{key:ro,get:function(){return"VertexArray"}}]),r}(E);bt.defaultProps=eo(eo({},E.defaultProps),{},{renderPipeline:null});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 tr(){"use strict";tr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(s,u,f){s[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(s,u,f){return Object.defineProperty(s,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),s[u]}try{l({},"")}catch{l=function(f,p,y){return f[p]=y}}function d(s,u,f,p){var y=u&&u.prototype instanceof g?u:g,h=Object.create(y.prototype),v=new N(p||[]);return n(h,"_invoke",{value:z(s,f,v)}),h}function b(s,u,f){try{return{type:"normal",arg:s.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=d;var m={};function g(){}function w(){}function P(){}var I={};l(I,i,function(){return this});var L=Object.getPrototypeOf,A=L&&L(L(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=g.prototype=Object.create(I);function B(s){["next","throw","return"].forEach(function(u){l(s,u,function(f){return this._invoke(u,f)})})}function D(s,u){function f(y,h,v,_){var O=b(s[y],s,h);if(O.type!=="throw"){var x=O.arg,j=x.value;return j&&te(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,_)},function(R){f("throw",R,v,_)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,_)})}_(O.arg)}var p;n(this,"_invoke",{value:function(h,v){function _(){return new u(function(O,x){f(h,v,O,x)})}return p=p?p.then(_,_):_()}})}function z(s,u,f){var p="suspendedStart";return function(y,h){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw h;return U()}for(f.method=y,f.arg=h;;){var v=f.delegate;if(v){var _=F(v,f);if(_){if(_===m)continue;return _}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var O=b(s,u,f);if(O.type==="normal"){if(p=f.done?"completed":"suspendedYield",O.arg===m)continue;return{value:O.arg,done:f.done}}O.type==="throw"&&(p="completed",f.method="throw",f.arg=O.arg)}}}function F(s,u){var f=u.method,p=s.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&s.iterator.return&&(u.method="return",u.arg=void 0,F(s,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,s.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var h=y.arg;return h?h.done?(u[s.resultName]=h.value,u.next=s.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):h:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function V(s){var u={tryLoc:s[0]};1 in s&&(u.catchLoc=s[1]),2 in s&&(u.finallyLoc=s[2],u.afterLoc=s[3]),this.tryEntries.push(u)}function C(s){var u=s.completion||{};u.type="normal",delete u.arg,s.completion=u}function N(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(V,this),this.reset(!0)}function k(s){if(s){var u=s[i];if(u)return u.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var f=-1,p=function y(){for(;++f<s.length;)if(r.call(s,f))return y.value=s[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:U}}function U(){return{value:void 0,done:!0}}return w.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:w,configurable:!0}),w.displayName=l(P,c,"GeneratorFunction"),e.isGeneratorFunction=function(s){var u=typeof s=="function"&&s.constructor;return!!u&&(u===w||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,P):(s.__proto__=P,l(s,c,"GeneratorFunction")),s.prototype=Object.create(T),s},e.awrap=function(s){return{__await:s}},B(D.prototype),l(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(s,u,f,p,y){y===void 0&&(y=Promise);var h=new D(d(s,u,f,p),y);return e.isGeneratorFunction(u)?h:h.next().then(function(v){return v.done?v.value:h.next()})},B(T),l(T,c,"Generator"),l(T,i,function(){return this}),l(T,"toString",function(){return"[object Generator]"}),e.keys=function(s){var u=Object(s),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var h=f.pop();if(h in u)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=k,N.prototype={constructor:N,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],v=h.completion;if(h.tryLoc==="root")return p("end");if(h.tryLoc<=this.prev){var _=r.call(h,"catchLoc"),O=r.call(h,"finallyLoc");if(_&&O){if(this.prev<h.catchLoc)return p(h.catchLoc,!0);if(this.prev<h.finallyLoc)return p(h.finallyLoc)}else if(_){if(this.prev<h.catchLoc)return p(h.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return p(h.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(u==="break"||u==="continue")&&h.tryLoc<=f&&f<=h.finallyLoc&&(h=null);var v=h?h.completion:{};return v.type=u,v.arg=f,h?(this.method="next",this.next=h.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var h=y.arg;C(p)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function oo(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(d){r(d);return}c.done?t(l):Promise.resolve(l).then(n,o)}function _f(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(l){oo(i,n,o,a,c,"next",l)}function c(l){oo(i,n,o,a,c,"throw",l)}a(void 0)})}}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,Pf(n.key),n)}}function Of(e,t,r){return t&&io(e.prototype,t),r&&io(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pf(e){var t=Sf(e,"string");return te(t)==="symbol"?t:String(t)}function Sf(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 Tf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jf(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,o){return n.__proto__=o,n},rr(e,t)}function Ef(e){var t=Af();return function(){var n=gt(e),o;if(t){var i=gt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return xf(this,o)}}function xf(e,t){if(t&&(te(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rf(e)}function Rf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Af(){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 gt(e){return gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gt(e)}function If(e){var t;return e.byteLength||((t=e.data)===null||t===void 0?void 0:t.byteLength)||0}var wt=function(e){jf(r,e);var t=Ef(r);function r(o,i){var a;Tf(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.byteLength=void 0,a.device=o,a.byteLength=If(i);var c=Boolean(i.data),l=Math.ceil(a.byteLength/4)*4;return a.handle=a.props.handle||a.device.handle.createBuffer({size:l,usage:a.props.usage||GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST,mappedAtCreation:a.props.mappedAtCreation||c,label:a.props.id}),i.data&&a._writeMapped(i.data),c&&!i.mappedAtCreation&&a.handle.unmap(),a}var n=r.prototype;return n.destroy=function(){this.handle.destroy()},n.write=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.device.handle.queue.writeBuffer(this.handle,a,i.buffer,i.byteOffset,i.byteLength)},n.readAsync=function(){var o=_f(tr().mark(function a(){var c,l,d,b,m,g=arguments;return tr().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return c=g.length>0&&g[0]!==void 0?g[0]:0,l=g.length>1&&g[1]!==void 0?g[1]:this.byteLength,d=new r(this.device,{usage:G.MAP_READ|G.COPY_DST,byteLength:l}),b=this.device.handle.createCommandEncoder(),b.copyBufferToBuffer(this.handle,c,d.handle,0,l),this.device.handle.queue.submit([b.finish()]),P.next=8,d.handle.mapAsync(GPUMapMode.READ,c,l);case 8:return m=d.handle.getMappedRange().slice(0),d.handle.unmap(),d.destroy(),P.abrupt("return",new Uint8Array(m));case 12:case"end":return P.stop()}},a,this)}));function i(){return o.apply(this,arguments)}return i}(),n._writeMapped=function(i){var a=this.handle.getMappedRange();new i.constructor(a).set(i)},n.mapAsync=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,c=arguments.length>2?arguments[2]:void 0;return this.handle.mapAsync(i,a,c)},n.getMappedRange=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1?arguments[1]:void 0;return this.handle.getMappedRange(i,a)},n.unmap=function(){this.handle.unmap()},Of(r)}(G);function _e(e){if(e.includes("webgl"))throw new Error("webgl-only format");return e}function Oe(e){return Oe=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},Oe(e)}function ao(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Lf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ao(Object(r),!0).forEach(function(n){Bf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ao(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bf(e,t,r){return t=fo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uo(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,fo(n.key),n)}}function Df(e,t,r){return t&&uo(e.prototype,t),r&&uo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function fo(e){var t=Nf(e,"string");return Oe(t)==="symbol"?t:String(t)}function Nf(e,t){if(Oe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Oe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cf(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&&nr(e,t)}function nr(e,t){return nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},nr(e,t)}function kf(e){var t=Ff();return function(){var n=_t(e),o;if(t){var i=_t(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Mf(this,o)}}function Mf(e,t){if(t&&(Oe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uf(e)}function Uf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ff(){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 _t(e){return _t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_t(e)}var K=function(e){Cf(r,e);var t=kf(r);function r(o,i){var a;Gf(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o;var c=Lf({},a.props);return c.type!=="comparison-sampler"&&delete c.compare,a.handle=a.handle||a.device.handle.createSampler(c),a.handle.label=a.props.id,a}var n=r.prototype;return n.destroy=function(){},Df(r)}(he);function Pe(e){return Pe=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},Pe(e)}function co(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,zf(n.key),n)}}function Wf(e,t,r){return t&&co(e.prototype,t),r&&co(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function zf(e){var t=Vf(e,"string");return Pe(t)==="symbol"?t:String(t)}function Vf(e,t){if(Pe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pe(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")}function Kf(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&&or(e,t)}function or(e,t){return or=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},or(e,t)}function $f(e){var t=Xf();return function(){var n=Ot(e),o;if(t){var i=Ot(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Yf(this,o)}}function Yf(e,t){if(t&&(Pe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qf(e)}function qf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xf(){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 Ot(e){return Ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ot(e)}var Zf={"1d":"1d","2d":"2d","2d-array":"2d",cube:"2d","cube-array":"2d","3d":"3d"},Pt=function(e){Kf(r,e);var t=$f(r);function r(o,i){var a;if(Hf(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.view=void 0,a.sampler=void 0,a.height=1,a.width=1,typeof a.props.format=="number")throw new Error("number format");return a.device=o,a.handle=a.props.handle||a.createHandle(),a.props.data&&a.setData({data:a.props.data}),a.width=a.handle.width,a.height=a.handle.height,a.sampler=i.sampler instanceof K?i.sampler:new K(a.device,i.sampler),a.view=a.handle.createView({}),a}var n=r.prototype;return n.createHandle=function(){var i,a;if(typeof this.props.format=="number")throw new Error("number format");var c=this.props.width||((i=this.props.data)===null||i===void 0?void 0:i.width)||1,l=this.props.height||((a=this.props.data)===null||a===void 0?void 0:a.height)||1;return this.device.handle.createTexture({size:{width:c,height:l,depthOrArrayLayers:this.props.depth},dimension:Zf[this.props.dimension],format:_e(this.props.format),usage:this.props.usage,mipLevelCount:this.props.mipLevels,sampleCount:this.props.samples})},n.destroy=function(){this.handle.destroy()},n.setSampler=function(i){return this.sampler=i instanceof K?i:new K(this.device,i),this},n.setData=function(i){return this.setImage({source:i.data})},n.setImage=function(i){var a=i.source,c=i.width,l=c===void 0?i.source.width:c,d=i.height,b=d===void 0?i.source.height:d,m=i.depth,g=m===void 0?1:m,w=i.sourceX,P=w===void 0?0:w,I=i.sourceY,L=I===void 0?0:I,A=i.mipLevel,T=A===void 0?0:A,B=i.x,D=B===void 0?0:B,z=i.y,F=z===void 0?0:z,V=i.z,C=V===void 0?0:V,N=i.aspect,k=N===void 0?"all":N,U=i.colorSpace,s=U===void 0?"srgb":U,u=i.premultipliedAlpha,f=u===void 0?!1:u;return this.device.handle.queue.copyExternalImageToTexture({source:a,origin:[P,L]},{texture:this.handle,origin:[D,F,C],mipLevel:T,aspect:k,colorSpace:s,premultipliedAlpha:f},[l,b,g]),{width:l,height:b}},Wf(r)}(W);function Se(e){return Se=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},Se(e)}function so(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,Qf(n.key),n)}}function Jf(e,t,r){return t&&so(e.prototype,t),r&&so(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qf(e){var t=ec(e,"string");return Se(t)==="symbol"?t:String(t)}function ec(e,t){if(Se(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Se(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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&&ir(e,t)}function ir(e,t){return ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ir(e,t)}function nc(e){var t=ac();return function(){var n=St(e),o;if(t){var i=St(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return oc(this,o)}}function oc(e,t){if(t&&(Se(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ic(e)}function ic(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 St(e){return St=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},St(e)}var lo=function(e){rc(r,e);var t=nc(r);function r(o,i){var a;return tc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.sampler=void 0,a.device=o,a.handle=a.props.handle||a.device.handle.importExternalTexture({source:i.source,colorSpace:i.colorSpace}),a.sampler=null,a}var n=r.prototype;return n.destroy=function(){},n.setSampler=function(i){return this.sampler=i instanceof K?i:new K(this.device,i),this},Jf(r)}(nt);function re(e){return re=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},re(e)}function We(){"use strict";We=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(s,u,f){s[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(s,u,f){return Object.defineProperty(s,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),s[u]}try{l({},"")}catch{l=function(f,p,y){return f[p]=y}}function d(s,u,f,p){var y=u&&u.prototype instanceof g?u:g,h=Object.create(y.prototype),v=new N(p||[]);return n(h,"_invoke",{value:z(s,f,v)}),h}function b(s,u,f){try{return{type:"normal",arg:s.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=d;var m={};function g(){}function w(){}function P(){}var I={};l(I,i,function(){return this});var L=Object.getPrototypeOf,A=L&&L(L(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=g.prototype=Object.create(I);function B(s){["next","throw","return"].forEach(function(u){l(s,u,function(f){return this._invoke(u,f)})})}function D(s,u){function f(y,h,v,_){var O=b(s[y],s,h);if(O.type!=="throw"){var x=O.arg,j=x.value;return j&&re(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,_)},function(R){f("throw",R,v,_)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,_)})}_(O.arg)}var p;n(this,"_invoke",{value:function(h,v){function _(){return new u(function(O,x){f(h,v,O,x)})}return p=p?p.then(_,_):_()}})}function z(s,u,f){var p="suspendedStart";return function(y,h){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw h;return U()}for(f.method=y,f.arg=h;;){var v=f.delegate;if(v){var _=F(v,f);if(_){if(_===m)continue;return _}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var O=b(s,u,f);if(O.type==="normal"){if(p=f.done?"completed":"suspendedYield",O.arg===m)continue;return{value:O.arg,done:f.done}}O.type==="throw"&&(p="completed",f.method="throw",f.arg=O.arg)}}}function F(s,u){var f=u.method,p=s.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&s.iterator.return&&(u.method="return",u.arg=void 0,F(s,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,s.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var h=y.arg;return h?h.done?(u[s.resultName]=h.value,u.next=s.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):h:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function V(s){var u={tryLoc:s[0]};1 in s&&(u.catchLoc=s[1]),2 in s&&(u.finallyLoc=s[2],u.afterLoc=s[3]),this.tryEntries.push(u)}function C(s){var u=s.completion||{};u.type="normal",delete u.arg,s.completion=u}function N(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(V,this),this.reset(!0)}function k(s){if(s){var u=s[i];if(u)return u.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var f=-1,p=function y(){for(;++f<s.length;)if(r.call(s,f))return y.value=s[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:U}}function U(){return{value:void 0,done:!0}}return w.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:w,configurable:!0}),w.displayName=l(P,c,"GeneratorFunction"),e.isGeneratorFunction=function(s){var u=typeof s=="function"&&s.constructor;return!!u&&(u===w||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,P):(s.__proto__=P,l(s,c,"GeneratorFunction")),s.prototype=Object.create(T),s},e.awrap=function(s){return{__await:s}},B(D.prototype),l(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(s,u,f,p,y){y===void 0&&(y=Promise);var h=new D(d(s,u,f,p),y);return e.isGeneratorFunction(u)?h:h.next().then(function(v){return v.done?v.value:h.next()})},B(T),l(T,c,"Generator"),l(T,i,function(){return this}),l(T,"toString",function(){return"[object Generator]"}),e.keys=function(s){var u=Object(s),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var h=f.pop();if(h in u)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=k,N.prototype={constructor:N,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],v=h.completion;if(h.tryLoc==="root")return p("end");if(h.tryLoc<=this.prev){var _=r.call(h,"catchLoc"),O=r.call(h,"finallyLoc");if(_&&O){if(this.prev<h.catchLoc)return p(h.catchLoc,!0);if(this.prev<h.finallyLoc)return p(h.finallyLoc)}else if(_){if(this.prev<h.catchLoc)return p(h.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return p(h.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(u==="break"||u==="continue")&&h.tryLoc<=f&&f<=h.finallyLoc&&(h=null);var v=h?h.completion:{};return v.type=u,v.arg=f,h?(this.method="next",this.next=h.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var h=y.arg;C(p)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function po(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(d){r(d);return}c.done?t(l):Promise.resolve(l).then(n,o)}function ho(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(l){po(i,n,o,a,c,"next",l)}function c(l){po(i,n,o,a,c,"throw",l)}a(void 0)})}}function yo(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,fc(n.key),n)}}function uc(e,t,r){return t&&yo(e.prototype,t),r&&yo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function fc(e){var t=cc(e,"string");return re(t)==="symbol"?t:String(t)}function cc(e,t){if(re(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(re(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lc(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,o){return n.__proto__=o,n},ar(e,t)}function pc(e){var t=yc();return function(){var n=Tt(e),o;if(t){var i=Tt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return hc(this,o)}}function hc(e,t){if(t&&(re(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dc(e)}function dc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yc(){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 Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tt(e)}var jt=function(e){lc(r,e);var t=pc(r);function r(o,i){var a;return sc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o,a.device.handle.pushErrorScope("validation"),a.handle=a.props.handle||a.createHandle(),a.handle.label=a.props.id,a._checkCompilationError(a.device.handle.popErrorScope()),a}var n=r.prototype;return n._checkCompilationError=function(){var o=ho(We().mark(function a(c){var l,d;return We().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,c;case 2:if(l=m.sent,!l){m.next=9;break}return m.next=6,this.getCompilationInfo();case 6:throw d=m.sent,S.error("Shader compilation error: ".concat(l.message),d)(),new Error("Shader compilation error: ".concat(l.message));case 9:case"end":return m.stop()}},a,this)}));function i(a){return o.apply(this,arguments)}return i}(),n.destroy=function(){},n.getCompilationInfo=function(){var o=ho(We().mark(function a(){var c;return We().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.handle.getCompilationInfo();case 2:return c=d.sent,d.abrupt("return",c.messages);case 4:case"end":return d.stop()}},a,this)}));function i(){return o.apply(this,arguments)}return i}(),n.createHandle=function(){var i=this,a=this.props,c=a.source,l=a.stage,d=this.props.language;switch(d==="auto"&&(d=c.includes("->")?"wgsl":"glsl"),d){case"wgsl":return this.device.handle.createShaderModule({code:c});case"glsl":return this.device.handle.createShaderModule({code:c,transform:function(m){return i.device.glslang.compileGLSL(m,l)}});default:throw new Error(d)}},uc(r)}(it);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 mc(e,t){return wc(e)||gc(e,t)||bc(e,t)||vc()}function vc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
24
24
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bc(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 gc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function wc(e){if(Array.isArray(e))return e}function vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function bo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vo(Object(r),!0).forEach(function(n){_c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vo(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _c(e,t,r){return t=Oc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oc(e){var t=Pc(e,"string");return ze(t)==="symbol"?t:String(t)}function Pc(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 $(e){return e.depthStencil=e.depthStencil||{format:"depth24plus",stencilFront:{},stencilBack:{},depthWriteEnabled:!1,depthCompare:"less-equal"},e.depthStencil}var Sc={cullMode:function(t,r,n){n.primitive=n.primitive||{},n.primitive.cullMode=r},frontFace:function(t,r,n){n.primitive=n.primitive||{},n.primitive.frontFace=r},depthWriteEnabled:function(t,r,n){var o=$(n);o.depthWriteEnabled=r},depthCompare:function(t,r,n){var o=$(n);o.depthCompare=r},depthFormat:function(t,r,n){var o=$(n);o.format=r},depthBias:function(t,r,n){var o=$(n);o.depthBias=r},depthBiasSlopeScale:function(t,r,n){var o=$(n);o.depthBiasSlopeScale=r},depthBiasClamp:function(t,r,n){var o=$(n);o.depthBiasClamp=r},stencilReadMask:function(t,r,n){var o=$(n);o.stencilReadMask=r},stencilWriteMask:function(t,r,n){var o=$(n);o.stencilWriteMask=r},stencilCompare:function(t,r,n){var o=$(n);o.stencilFront.compare=r,o.stencilBack.compare=r},stencilPassOperation:function(t,r,n){var o=$(n);o.stencilFront.passOp=r,o.stencilBack.passOp=r},stencilFailOperation:function(t,r,n){var o=$(n);o.stencilFront.failOp=r,o.stencilBack.failOp=r},stencilDepthFailOperation:function(t,r,n){var o=$(n);o.stencilFront.depthFailOp=r,o.stencilBack.depthFailOp=r},sampleCount:function(t,r,n){n.multisample=n.multisample||{},n.multisample.count=r},sampleMask:function(t,r,n){n.multisample=n.multisample||{},n.multisample.mask=r},sampleAlphaToCoverageEnabled:function(t,r,n){n.multisample=n.multisample||{},n.multisample.alphaToCoverageEnabled=r},colorMask:function(t,r,n){var o=go(n);o[0].writeMask=r},blendColorOperation:function(t,r,n){go(n)}},Tc={primitive:{cullMode:"back",topology:"triangle-list"},vertex:{module:void 0,entryPoint:"main"},fragment:{module:void 0,entryPoint:"main",targets:[]},layout:"auto"};function wo(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Object.assign(e,bo(bo({},Tc),e)),jc(e,t)}function jc(e,t){for(var r=0,n=Object.entries(t);r<n.length;r++){var o=mc(n[r],2),i=o[0],a=o[1],c=Sc[i];if(!c)throw new Error("Illegal parameter ".concat(i));c(i,a,e)}}function go(e){var t,r,n,o;if(e.fragment.targets=((t=e.fragment)===null||t===void 0?void 0:t.targets)||[],!Array.isArray((r=e.fragment)===null||r===void 0?void 0:r.targets))throw new Error("colorstate");if(((n=e.fragment)===null||n===void 0||(n=n.targets)===null||n===void 0?void 0:n.length)===0){var i;(i=e.fragment.targets)===null||i===void 0||i.push({})}return(o=e.fragment)===null||o===void 0?void 0:o.targets}function Ec(e,t){return Ic(e)||Ac(e,t)||Rc(e,t)||xc()}function xc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
25
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rc(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 Ac(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function Ic(e){if(Array.isArray(e))return e}function Oo(e,t,r,n){var o=Lc(n,r);return e.createBindGroup({layout:t,entries:o})}function Bc(e,t){var r=e.bindings.find(function(n){return n.name===t});return r||S.warn("Binding ".concat(t," not set: Not found in shader layout."))(),r}function Lc(e,t){for(var r=[],n=0,o=Object.entries(e);n<o.length;n++){var i=Ec(o[n],2),a=i[0],c=i[1],l=Bc(t,a);l&&r.push(Dc(c,l.location))}return r}function Dc(e,t){if(e instanceof G)return{binding:t,resource:{buffer:e.handle}};if(e instanceof he)return{binding:t,resource:e.handle};if(e instanceof W)return{binding:t,resource:e.handle.createView()};throw new Error("invalid binding")}function Te(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Nc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return i=d.done,d},e:function(d){a=!0,c=d},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Nc(e,t){if(e){if(typeof e=="string")return Po(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 Po(e,t)}}function Po(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){if(e.endsWith("-webgl"))throw new Error("WebGPU does not support vertex format ".concat(e));return e}function To(e,t){var r=[],n=new Set,o=Te(t),i;try{for(o.s();!(i=o.n()).done;){var a=i.value,c=[],l="vertex",d=0;if(a.attributes){var b=Te(a.attributes),m;try{for(b.s();!(m=b.n()).done;){var g=m.value,w=g.attribute,P=So(e,w,n);l=P.stepMode||"vertex",c.push({format:ur(g.format||a.format),offset:g.byteOffset,shaderLocation:P.location}),d+=X(a.format).byteLength}}catch(L){b.e(L)}finally{b.f()}}else{var I=So(e,a.name,n);d=X(a.format).byteLength,l=I.stepMode||"vertex",c.push({format:ur(a.format),offset:0,shaderLocation:I.location})}r.push({arrayStride:a.byteStride||d,stepMode:l||"vertex",attributes:c})}}catch(L){o.e(L)}finally{o.f()}var B=Te(e.attributes),A;try{for(B.s();!(A=B.n()).done;){var T=A.value;n.has(T.name)||r.push({arrayStride:X("float32x3").byteLength,stepMode:T.stepMode||"vertex",attributes:[{format:ur("float32x3"),offset:0,shaderLocation:T.location}]})}}catch(L){B.e(L)}finally{B.f()}return r}function jo(e,t){var r=new Set,n=0,o={},i=Te(t),a;try{for(i.s();!(a=i.n()).done;){var c=a.value;if("attributes"in c){var l=Te(c.attributes),d;try{for(l.s();!(d=l.n()).done;){var b=d.value;r.add(b.attribute)}}catch(P){l.e(P)}finally{l.f()}}else r.add(c.name);o[c.name]=n++}}catch(P){i.e(P)}finally{i.f()}var m=Te(e.attributes),g;try{for(m.s();!(g=m.n()).done;){var w=g.value;r.has(w.name)||(o[w.name]=n++)}}catch(P){m.e(P)}finally{m.f()}return o}function So(e,t,r){var n=e.attributes.find(function(o){return o.name===t});if(!n)throw new Error("Unknown attribute ".concat(t));if(r.has(t))throw new Error("Duplicate attribute ".concat(t));return r.add(t),n}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 Gc(e,t){return Uc(e)||Mc(e,t)||kc(e,t)||Cc()}function Cc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
27
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kc(e,t){if(e){if(typeof e=="string")return Eo(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 Eo(e,t)}}function Eo(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 Mc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function Uc(e){if(Array.isArray(e))return e}function xo(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,Wc(n.key),n)}}function Fc(e,t,r){return t&&xo(e.prototype,t),r&&xo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wc(e){var t=zc(e,"string");return je(t)==="symbol"?t:String(t)}function zc(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 Vc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hc(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&&fr(e,t)}function fr(e,t){return fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},fr(e,t)}function Kc(e){var t=qc();return function(){var n=xt(e),o;if(t){var i=xt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return $c(this,o)}}function $c(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 Yc(e)}function Yc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qc(){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 xt(e){return xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xt(e)}var Ro=function(e){Hc(r,e);var t=Kc(r);function r(o,i){var a;if(Vc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.vs=void 0,a.fs=null,a._bufferSlots=void 0,a._buffers=void 0,a._indexBuffer=null,a._bindGroupLayout=null,a._bindGroup=null,a.device=o,a.handle=a.props.handle,!a.handle){var c=a._getRenderPipelineDescriptor();S.groupCollapsed(1,"new WebGPURenderPipeline(".concat(a.id,")"))(),S.probe(1,JSON.stringify(c,null,2))(),S.groupEnd(1)(),a.handle=a.device.handle.createRenderPipeline(c)}return a.handle.label=a.props.id,a.vs=i.vs,a.fs=i.fs,a._bufferSlots=jo(a.props.shaderLayout,a.props.bufferLayout),a._buffers=new Array(Object.keys(a._bufferSlots).length).fill(null),a}var n=r.prototype;return n.destroy=function(){},n.setIndexBuffer=function(i){this._indexBuffer=i},n.setAttributes=function(i){for(var a=0,c=Object.entries(i);a<c.length;a++){var l=Gc(c[a],2),d=l[0],b=l[1],m=this._bufferSlots[d];if(m>=0)this._buffers[m]=b;else throw new Error("Setting attribute '".concat(d,"' not listed in shader layout for program ").concat(this.id))}},n.setConstantAttributes=function(i){throw new Error("not implemented")},n.setBindings=function(i){Ze(this.props.bindings)||(Object.assign(this.props.bindings,i),this._bindGroupLayout=this._bindGroupLayout||this.handle.getBindGroupLayout(0),this._bindGroup=Oo(this.device.handle,this._bindGroupLayout,this.props.shaderLayout,this.props.bindings))},n.setUniforms=function(i){if(!Ze(i))throw new Error("WebGPU does not support uniforms")},n._getBuffers=function(){return this._buffers},n._getBindGroup=function(){return this._bindGroup},n._getRenderPipelineDescriptor=function(){var i={module:this.props.vs.handle,entryPoint:this.props.vsEntryPoint||"main",buffers:To(this.props.shaderLayout,this.props.bufferLayout)},a;if(this.props.fs){var c;a={module:this.props.fs.handle,entryPoint:this.props.fsEntryPoint||"main",targets:[{format:_e((c=this.device)===null||c===void 0||(c=c.canvasContext)===null||c===void 0?void 0:c.format)}]}}switch(this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":throw new Error("WebGPU does not support primitive topology ".concat(this.props.topology));default:}var l={vertex:i,fragment:a,primitive:{topology:this.props.topology},layout:"auto"};return wo(l,this.props.parameters),l},n.draw=function(i){var a=i.renderPass||this.device.getDefaultRenderPass();a.handle.setPipeline(this.handle);var c=this._getBindGroup();c&&a.handle.setBindGroup(0,c),this._setAttributeBuffers(a),i.indexCount?a.handle.drawIndexed(i.indexCount,i.instanceCount,i.firstIndex,i.baseVertex,i.firstInstance):a.handle.draw(i.vertexCount||0,i.instanceCount||1,i.firstInstance)},n._setAttributeBuffers=function(i){var a=this;this._indexBuffer&&i.handle.setIndexBuffer(this._indexBuffer.handle,this._indexBuffer.props.indexType);for(var c=this._getBuffers(),l=function(m){var g=c[m];if(!g){var w=a.props.shaderLayout.attributes.find(function(P){return P.location===m});throw new Error("No buffer provided for attribute '".concat(w?.name||"","' in Model '").concat(a.props.id,"'"))}i.handle.setVertexBuffer(m,g.handle)},d=0;d<c.length;++d)l(d)},Fc(r)}(st);function Ee(e){return Ee=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},Ee(e)}function Ao(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,Zc(n.key),n)}}function Xc(e,t,r){return t&&Ao(e.prototype,t),r&&Ao(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zc(e){var t=Jc(e,"string");return Ee(t)==="symbol"?t:String(t)}function Jc(e,t){if(Ee(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ee(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function es(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&&cr(e,t)}function cr(e,t){return cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},cr(e,t)}function ts(e){var t=os();return function(){var n=Rt(e),o;if(t){var i=Rt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return rs(this,o)}}function rs(e,t){if(t&&(Ee(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ns(e)}function ns(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function os(){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 Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rt(e)}var Io=function(e){es(r,e);var t=ts(r);function r(o,i){var a;Qc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o;var c=a.props.cs.handle;return a.handle=a.props.handle||a.device.handle.createComputePipeline({label:a.props.id,compute:{module:c,entryPoint:a.props.csEntryPoint},layout:"auto"}),a}var n=r.prototype;return n._getBindGroupLayout=function(){return this.handle.getBindGroupLayout(0)},Xc(r)}(pt);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 Bo(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,as(n.key),n)}}function is(e,t,r){return t&&Bo(e.prototype,t),r&&Bo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function as(e){var t=us(e,"string");return xe(t)==="symbol"?t:String(t)}function us(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 fs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cs(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&&sr(e,t)}function sr(e,t){return sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},sr(e,t)}function ss(e){var t=hs();return function(){var n=At(e),o;if(t){var i=At(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ls(this,o)}}function ls(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 ps(e)}function ps(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hs(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function At(e){return At=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},At(e)}var Lo=function(e){cs(r,e);var t=ss(r);function r(o){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};fs(this,r),i=t.call(this,o,a),i.device=void 0,i.handle=void 0,i.pipeline=null,i.device=o;var c=a.framebuffer||o.canvasContext.getCurrentFramebuffer(),l=i.getRenderPassDescriptor(c);return S.groupCollapsed(1,"new WebGPURenderPass(".concat(i.id,")"))(),S.probe(1,JSON.stringify(l,null,2))(),S.groupEnd(1)(),i.handle=i.props.handle||o.commandEncoder.beginRenderPass(l),i.handle.label=i.props.id,i}var n=r.prototype;return n.destroy=function(){},n.end=function(){this.handle.end()},n.setPipeline=function(i){this.pipeline=i,this.handle.setPipeline(this.pipeline.handle)},n.setBindings=function(i){var a,c;(a=this.pipeline)===null||a===void 0||a.setBindings(i);var l=(c=this.pipeline)===null||c===void 0?void 0:c._getBindGroup();l&&this.handle.setBindGroup(0,l)},n.setIndexBuffer=function(i,a){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,l=arguments.length>3?arguments[3]:void 0;this.handle.setIndexBuffer(i.handle,a,c,l)},n.setVertexBuffer=function(i,a){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;this.handle.setVertexBuffer(i,a.handle,c)},n.draw=function(i){i.indexCount?this.handle.drawIndexed(i.indexCount,i.instanceCount,i.firstIndex,i.baseVertex,i.firstInstance):this.handle.draw(i.vertexCount||0,i.instanceCount||1,i.firstIndex,i.firstInstance)},n.drawIndirect=function(){},n.setParameters=function(i){var a=i.blendConstant,c=i.stencilReference,l=i.scissorRect,d=i.viewport;a&&this.handle.setBlendConstant(a),c&&this.handle.setStencilReference(c),l&&this.handle.setScissorRect(l[0],l[1],l[2],l[3]),d&&this.handle.setViewport(d[0],d[1],d[2],d[3],d[4],d[5])},n.pushDebugGroup=function(i){this.handle.pushDebugGroup(i)},n.popDebugGroup=function(){this.handle.popDebugGroup()},n.insertDebugMarker=function(i){this.handle.insertDebugMarker(i)},n.getRenderPassDescriptor=function(i){var a=this,c={colorAttachments:[]};if(c.colorAttachments=i.colorAttachments.map(function(m){return{loadOp:a.props.clearColor!==!1?"clear":"load",colorClearValue:a.props.clearColor||[0,0,0,0],storeOp:a.props.discard?"discard":"store",view:m.handle.createView()}}),i.depthStencilAttachment){c.depthStencilAttachment={view:i.depthStencilAttachment.handle.createView()};var l=c.depthStencilAttachment;this.props.depthReadOnly&&(l.depthReadOnly=!0),l.depthClearValue=this.props.clearDepth||0;var d=!0;d&&(l.depthLoadOp=this.props.clearDepth!==!1?"clear":"load",l.depthStoreOp="store");var b=!1;b&&(l.stencilLoadOp=this.props.clearStencil!==!1?"clear":"load",l.stencilStoreOp="store")}return c},is(r)}(dt);function Re(e){return Re=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},Re(e)}function Do(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,ys(n.key),n)}}function ds(e,t,r){return t&&Do(e.prototype,t),r&&Do(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ys(e){var t=ms(e,"string");return Re(t)==="symbol"?t:String(t)}function ms(e,t){if(Re(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Re(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bs(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&&lr(e,t)}function lr(e,t){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},lr(e,t)}function gs(e){var t=Os();return function(){var n=It(e),o;if(t){var i=It(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ws(this,o)}}function ws(e,t){if(t&&(Re(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _s(e)}function _s(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Os(){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 It(e){return It=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},It(e)}var No=function(e){bs(r,e);var t=gs(r);function r(o,i){var a,c;return vs(this,r),c=t.call(this,o,i),c.device=void 0,c.handle=void 0,c._bindGroupLayout=null,c.device=o,c.handle=c.props.handle||((a=o.commandEncoder)===null||a===void 0?void 0:a.beginComputePass({label:c.props.id})),c}var n=r.prototype;return n.destroy=function(){},n.end=function(){this.handle.end()},n.setPipeline=function(i){var a=i;this.handle.setPipeline(a.handle),this._bindGroupLayout=a._getBindGroupLayout()},n.setBindings=function(i){throw new Error("fix me")},n.dispatch=function(i,a,c){this.handle.dispatchWorkgroups(i,a,c)},n.dispatchIndirect=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.handle.dispatchWorkgroupsIndirect(i.handle,a)},n.pushDebugGroup=function(i){this.handle.pushDebugGroup(i)},n.popDebugGroup=function(){this.handle.popDebugGroup()},n.insertDebugMarker=function(i){this.handle.insertDebugMarker(i)},ds(r)}(mt);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)}var Co;function Ps(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Go(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 Ss(e,t,r){return t&&Go(e.prototype,t),r&&Go(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ts(e){var t=js(e,"string");return Ae(t)==="symbol"?t:String(t)}function js(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 Es(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&&pr(e,t)}function pr(e,t){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},pr(e,t)}function xs(e){var t=Is();return function(){var n=Bt(e),o;if(t){var i=Bt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Rs(this,o)}}function Rs(e,t){if(t&&(Ae(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return As(e)}function As(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Is(){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)}Co=Symbol.toStringTag;var ko=function(e){Es(r,e);var t=xs(r);r.isConstantAttributeZeroSupported=function(i){return i.info.type==="webgl2"||Ke()==="Chrome"};function r(o,i){var a;return Ps(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o,a}var n=r.prototype;return n.destroy=function(){},n.setIndexBuffer=function(i){this.indexBuffer=i},n.setBuffer=function(i,a){this.attributes[i]=a},n.setConstant=function(i,a){S.warn("".concat(this.id," constant attributes not supported on WebGPU"))},n.bindBeforeRender=function(i,a,c){var l=i,d=this.indexBuffer;l.handle.setIndexBuffer(d?.handle,d?.indexType);for(var b=0;b<this.maxVertexAttributes;b++){var m=this.attributes[b];l.handle.setVertexBuffer(b,m.handle)}},n.unbindAfterRender=function(i){},Ss(r,[{key:Co,get:function(){return"WebGPUVertexArray"}}]),r}(bt);function Ie(e){return Ie=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},Ie(e)}function Mo(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 Bs(e,t,r){return t&&Mo(e.prototype,t),r&&Mo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ls(e){var t=Ds(e,"string");return Ie(t)==="symbol"?t:String(t)}function Ds(e,t){if(Ie(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ie(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ns(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gs(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&&hr(e,t)}function hr(e,t){return hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},hr(e,t)}function Cs(e){var t=Us();return function(){var n=Lt(e),o;if(t){var i=Lt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ks(this,o)}}function ks(e,t){if(t&&(Ie(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ms(e)}function Ms(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Us(){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 Lt(e){return Lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lt(e)}var Uo=function(e){Gs(r,e);var t=Cs(r);function r(n,o){var i;return Ns(this,r),i=t.call(this,n,o),i.device=void 0,i.device=n,i.autoCreateAttachmentTextures(),i}return Bs(r)}(ft);function Be(e){return Be=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},Be(e)}function Fs(e,t){return Hs(e)||Vs(e,t)||zs(e,t)||Ws()}function Ws(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
28
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zs(e,t){if(e){if(typeof e=="string")return Fo(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 Fo(e,t)}}function Fo(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 Vs(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function Hs(e){if(Array.isArray(e))return 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,$s(n.key),n)}}function Ks(e,t,r){return t&&Wo(e.prototype,t),r&&Wo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $s(e){var t=Ys(e,"string");return Be(t)==="symbol"?t:String(t)}function Ys(e,t){if(Be(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Be(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xs(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&&dr(e,t)}function dr(e,t){return dr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},dr(e,t)}function Zs(e){var t=el();return function(){var n=Dt(e),o;if(t){var i=Dt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Js(this,o)}}function Js(e,t){if(t&&(Be(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qs(e)}function Qs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function el(){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 Dt(e){return Dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dt(e)}var yr=function(e){Xs(r,e);var t=Zs(r);function r(o,i,a){var c;return qs(this,r),c=t.call(this,a),c.device=void 0,c.gpuCanvasContext=void 0,c.format=navigator.gpu.getPreferredCanvasFormat(),c.depthStencilFormat="depth24plus",c.depthStencilAttachment=null,c.device=o,c.width=-1,c.height=-1,c._setAutoCreatedCanvasId("".concat(c.device.id,"-canvas")),c.gpuCanvasContext=c.canvas.getContext("webgpu"),c.format="bgra8unorm",c}var n=r.prototype;return n.destroy=function(){this.gpuCanvasContext.unconfigure()},n.getCurrentTexture=function(){return this.device._createTexture({id:"default-render-target",handle:this.gpuCanvasContext.getCurrentTexture()})},n.getCurrentFramebuffer=function(){this.update();var i=this.getCurrentTexture();return this.width=i.width,this.height=i.height,this._createDepthStencilAttachment(),new Uo(this.device,{colorAttachments:[i],depthStencilAttachment:this.depthStencilAttachment})},n.update=function(){var i=this.getPixelSize(),a=Fs(i,2),c=a[0],l=a[1],d=c!==this.width||l!==this.height;d&&(this.width=c,this.height=l,this.depthStencilAttachment&&(this.depthStencilAttachment.destroy(),this.depthStencilAttachment=null),this.gpuCanvasContext.configure({device:this.device.handle,format:_e(this.format),colorSpace:this.props.colorSpace,alphaMode:this.props.alphaMode}),S.log(1,"Resized to ".concat(this.width,"x").concat(this.height,"px"))())},n.resize=function(i){this.update()},n._createDepthStencilAttachment=function(){return this.depthStencilAttachment||(this.depthStencilAttachment=this.device.createTexture({id:"depth-stencil-target",format:this.depthStencilFormat,width:this.width,height:this.height,usage:GPUTextureUsage.RENDER_ATTACHMENT})),this.depthStencilAttachment},Ks(r)}(ce);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)}function zo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Vo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zo(Object(r),!0).forEach(function(n){tl(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 tl(e,t,r){return t=Yo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ve(){"use strict";Ve=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(s,u,f){s[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(s,u,f){return Object.defineProperty(s,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),s[u]}try{l({},"")}catch{l=function(f,p,y){return f[p]=y}}function d(s,u,f,p){var y=u&&u.prototype instanceof g?u:g,h=Object.create(y.prototype),v=new N(p||[]);return n(h,"_invoke",{value:z(s,f,v)}),h}function b(s,u,f){try{return{type:"normal",arg:s.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=d;var m={};function g(){}function w(){}function P(){}var I={};l(I,i,function(){return this});var B=Object.getPrototypeOf,A=B&&B(B(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=g.prototype=Object.create(I);function L(s){["next","throw","return"].forEach(function(u){l(s,u,function(f){return this._invoke(u,f)})})}function D(s,u){function f(y,h,v,_){var O=b(s[y],s,h);if(O.type!=="throw"){var x=O.arg,j=x.value;return j&&ne(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,_)},function(R){f("throw",R,v,_)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,_)})}_(O.arg)}var p;n(this,"_invoke",{value:function(h,v){function _(){return new u(function(O,x){f(h,v,O,x)})}return p=p?p.then(_,_):_()}})}function z(s,u,f){var p="suspendedStart";return function(y,h){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw h;return U()}for(f.method=y,f.arg=h;;){var v=f.delegate;if(v){var _=F(v,f);if(_){if(_===m)continue;return _}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var O=b(s,u,f);if(O.type==="normal"){if(p=f.done?"completed":"suspendedYield",O.arg===m)continue;return{value:O.arg,done:f.done}}O.type==="throw"&&(p="completed",f.method="throw",f.arg=O.arg)}}}function F(s,u){var f=u.method,p=s.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&s.iterator.return&&(u.method="return",u.arg=void 0,F(s,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,s.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var h=y.arg;return h?h.done?(u[s.resultName]=h.value,u.next=s.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):h:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function V(s){var u={tryLoc:s[0]};1 in s&&(u.catchLoc=s[1]),2 in s&&(u.finallyLoc=s[2],u.afterLoc=s[3]),this.tryEntries.push(u)}function C(s){var u=s.completion||{};u.type="normal",delete u.arg,s.completion=u}function N(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(V,this),this.reset(!0)}function k(s){if(s){var u=s[i];if(u)return u.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var f=-1,p=function y(){for(;++f<s.length;)if(r.call(s,f))return y.value=s[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:U}}function U(){return{value:void 0,done:!0}}return w.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:w,configurable:!0}),w.displayName=l(P,c,"GeneratorFunction"),e.isGeneratorFunction=function(s){var u=typeof s=="function"&&s.constructor;return!!u&&(u===w||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,P):(s.__proto__=P,l(s,c,"GeneratorFunction")),s.prototype=Object.create(T),s},e.awrap=function(s){return{__await:s}},L(D.prototype),l(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(s,u,f,p,y){y===void 0&&(y=Promise);var h=new D(d(s,u,f,p),y);return e.isGeneratorFunction(u)?h:h.next().then(function(v){return v.done?v.value:h.next()})},L(T),l(T,c,"Generator"),l(T,i,function(){return this}),l(T,"toString",function(){return"[object Generator]"}),e.keys=function(s){var u=Object(s),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var h=f.pop();if(h in u)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=k,N.prototype={constructor:N,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],v=h.completion;if(h.tryLoc==="root")return p("end");if(h.tryLoc<=this.prev){var _=r.call(h,"catchLoc"),O=r.call(h,"finallyLoc");if(_&&O){if(this.prev<h.catchLoc)return p(h.catchLoc,!0);if(this.prev<h.finallyLoc)return p(h.finallyLoc)}else if(_){if(this.prev<h.catchLoc)return p(h.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return p(h.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(u==="break"||u==="continue")&&h.tryLoc<=f&&f<=h.finallyLoc&&(h=null);var v=h?h.completion:{};return v.type=u,v.arg=f,h?(this.method="next",this.next=h.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var h=y.arg;C(p)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function Ho(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(d){r(d);return}c.done?t(l):Promise.resolve(l).then(n,o)}function Ko(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(l){Ho(i,n,o,a,c,"next",l)}function c(l){Ho(i,n,o,a,c,"throw",l)}a(void 0)})}}function rl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $o(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,Yo(n.key),n)}}function nl(e,t,r){return t&&$o(e.prototype,t),r&&$o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yo(e){var t=ol(e,"string");return ne(t)==="symbol"?t:String(t)}function ol(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 il(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,o){return n.__proto__=o,n},mr(e,t)}function al(e){var t=fl();return function(){var n=Nt(e),o;if(t){var i=Nt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ul(this,o)}}function ul(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 qo(e)}function qo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fl(){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 Nt(e){return Nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Nt(e)}var vr=function(e){il(r,e);var t=al(r);r.isSupported=function(){return Boolean(typeof navigator<"u"&&navigator.gpu)},r.create=function(){var o=Ko(Ve().mark(function a(c){var l,d,b,m;return Ve().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(navigator.gpu){w.next=2;break}throw new Error("WebGPU not available. Open in Chrome Canary and turn on chrome://flags/#enable-unsafe-webgpu");case 2:return S.groupCollapsed(1,"WebGPUDevice created")(),w.next=5,navigator.gpu.requestAdapter({powerPreference:"high-performance"});case 5:if(l=w.sent,l){w.next=8;break}throw new Error("Failed to request WebGPU adapter");case 8:return w.next=10,l.requestAdapterInfo();case 10:return d=w.sent,S.probe(1,"Adapter available",d)(),w.next=14,l.requestDevice({requiredFeatures:l.features});case 14:if(b=w.sent,S.probe(1,"GPUDevice available")(),typeof c.canvas!="string"){w.next=20;break}return w.next=19,ce.pageLoaded;case 19:S.probe(1,"DOM is loaded")();case 20:return m=new r(b,l,c),S.probe(1,"Device created",m.info)(),S.table(1,m.info)(),S.groupEnd(1)(),w.abrupt("return",m);case 25:case"end":return w.stop()}},a)}));function i(a){return o.apply(this,arguments)}return i}();function r(o,i,a){var c;return rl(this,r),c=t.call(this,Vo(Vo({},a),{},{id:a.id||Y("webgpu-device")})),c.handle=void 0,c.adapter=void 0,c.lost=void 0,c.canvasContext=null,c.commandEncoder=null,c.renderPass=null,c._info=void 0,c._isLost=!1,c.features=void 0,c.handle=o,c.adapter=i,c._info={type:"webgpu",vendor:c.adapter.__brand,renderer:"",version:"",gpu:"unknown",shadingLanguage:"wgsl",shadingLanguageVersion:100,vendorMasked:"",rendererMasked:""},c.lost=new Promise(function(){var l=Ko(Ve().mark(function d(b){var m;return Ve().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,c.handle.lost;case 2:m=w.sent,c._isLost=!0,b({reason:"destroyed",message:m.message});case 5:case"end":return w.stop()}},d)}));return function(d){return l.apply(this,arguments)}}()),c.canvasContext=new yr(qo(c),c.adapter,{canvas:a.canvas,height:a.height,width:a.width,container:a.container}),c.features=c._getFeatures(),c}var n=r.prototype;return n.destroy=function(){this.handle.destroy()},n.isTextureFormatSupported=function(i){return!i.includes("webgl")},n.isTextureFormatFilterable=function(i){return this.isTextureFormatSupported(i)},n.isTextureFormatRenderable=function(i){return this.isTextureFormatSupported(i)},n.createBuffer=function(i){var a=this._getBufferProps(i);return new wt(this,a)},n._createTexture=function(i){return new Pt(this,i)},n.createExternalTexture=function(i){return new lo(this,i)},n.createShader=function(i){return new jt(this,i)},n.createSampler=function(i){return new K(this,i)},n.createRenderPipeline=function(i){return new Ro(this,i)},n.createFramebuffer=function(i){throw new Error("Not implemented")},n.createComputePipeline=function(i){return new Io(this,i)},n.createVertexArray=function(i){return new ko(this,i)},n.beginRenderPass=function(i){return this.commandEncoder=this.commandEncoder||this.handle.createCommandEncoder(),new Lo(this,i)},n.beginComputePass=function(i){return this.commandEncoder=this.commandEncoder||this.handle.createCommandEncoder(),new No(this,i)},n.createTransformFeedback=function(i){throw new Error("Transform feedback not supported in WebGPU")},n.createCanvasContext=function(i){return new yr(this,this.adapter,i)},n.getDefaultRenderPass=function(){throw new Error("a")},n.submit=function(){var i,a=(i=this.commandEncoder)===null||i===void 0?void 0:i.finish();a&&this.handle.queue.submit([a]),this.commandEncoder=null},n._getFeatures=function(){var i=new Set(this.handle.features);return i.has("depth-clamping")&&(i.delete("depth-clamping"),i.add("depth-clip-control")),i.has("texture-compression-bc")&&i.add("texture-compression-bc5-webgl"),i.add("webgpu"),i.add("timer-query-webgl"),i.add("vertex-array-object-webgl1"),i.add("instanced-rendering-webgl1"),i.add("multiple-render-targets-webgl1"),i.add("index-uint32-webgl1"),i.add("blend-minmax-webgl1"),i.add("texture-blend-float-webgl1"),i.add("texture-formats-srgb-webgl1"),i.add("texture-formats-depth-webgl1"),i.add("texture-formats-float32-webgl1"),i.add("texture-formats-float16-webgl1"),i.add("texture-filter-linear-float32-webgl"),i.add("texture-filter-linear-float16-webgl"),i.add("texture-filter-anisotropic-webgl"),i.add("texture-renderable-rgba32float-webgl"),i.add("texture-renderable-float32-webgl"),i.add("texture-renderable-float16-webgl"),i.add("glsl-frag-data"),i.add("glsl-frag-depth"),i.add("glsl-derivatives"),i.add("glsl-texture-lod"),i},n.copyExternalImageToTexture=function(i){var a,c=i.source,l=i.sourceX,d=l===void 0?0:l,b=i.sourceY,m=b===void 0?0:b,g=i.texture,w=i.mipLevel,P=w===void 0?0:w,I=i.aspect,B=I===void 0?"all":I,A=i.colorSpace,T=A===void 0?"display-p3":A,L=i.premultipliedAlpha,D=L===void 0?!1:L,z=i.width,F=z===void 0?g.width:z,V=i.height,C=V===void 0?g.height:V,N=i.depth,k=N===void 0?1:N,U=g;(a=this.handle)===null||a===void 0||a.queue.copyExternalImageToTexture({source:c,origin:[d,m]},{texture:U.handle,origin:[0,0,0],mipLevel:P,aspect:B,colorSpace:T,premultipliedAlpha:D},[F,C,k])},nl(r,[{key:"info",get:function(){return this._info}},{key:"limits",get:function(){return this.handle.limits}},{key:"isLost",get:function(){return this._isLost}}]),r}(ke);vr.type="webgpu";return ti(cl);})();
25
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rc(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 Ac(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function Ic(e){if(Array.isArray(e))return e}function Oo(e,t,r,n){var o=Bc(n,r);return e.createBindGroup({layout:t,entries:o})}function Lc(e,t){var r=e.bindings.find(function(n){return n.name===t});return r||S.warn("Binding ".concat(t," not set: Not found in shader layout."))(),r}function Bc(e,t){for(var r=[],n=0,o=Object.entries(e);n<o.length;n++){var i=Ec(o[n],2),a=i[0],c=i[1],l=Lc(t,a);l&&r.push(Dc(c,l.location))}return r}function Dc(e,t){if(e instanceof G)return{binding:t,resource:{buffer:e.handle}};if(e instanceof he)return{binding:t,resource:e.handle};if(e instanceof W)return{binding:t,resource:e.handle.createView()};throw new Error("invalid binding")}function Te(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Nc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,c;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return i=d.done,d},e:function(d){a=!0,c=d},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw c}}}}function Nc(e,t){if(e){if(typeof e=="string")return Po(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 Po(e,t)}}function Po(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){if(e.endsWith("-webgl"))throw new Error("WebGPU does not support vertex format ".concat(e));return e}function To(e,t){var r=[],n=new Set,o=Te(t),i;try{for(o.s();!(i=o.n()).done;){var a=i.value,c=[],l="vertex",d=0;if(a.attributes){var b=Te(a.attributes),m;try{for(b.s();!(m=b.n()).done;){var g=m.value,w=g.attribute,P=So(e,w,n);l=P.stepMode||"vertex",c.push({format:ur(g.format||a.format),offset:g.byteOffset,shaderLocation:P.location}),d+=X(a.format).byteLength}}catch(B){b.e(B)}finally{b.f()}}else{var I=So(e,a.name,n);d=X(a.format).byteLength,l=I.stepMode||"vertex",c.push({format:ur(a.format),offset:0,shaderLocation:I.location})}r.push({arrayStride:a.byteStride||d,stepMode:l||"vertex",attributes:c})}}catch(B){o.e(B)}finally{o.f()}var L=Te(e.attributes),A;try{for(L.s();!(A=L.n()).done;){var T=A.value;n.has(T.name)||r.push({arrayStride:X("float32x3").byteLength,stepMode:T.stepMode||"vertex",attributes:[{format:ur("float32x3"),offset:0,shaderLocation:T.location}]})}}catch(B){L.e(B)}finally{L.f()}return r}function jo(e,t){var r=new Set,n=0,o={},i=Te(t),a;try{for(i.s();!(a=i.n()).done;){var c=a.value;if("attributes"in c){var l=Te(c.attributes),d;try{for(l.s();!(d=l.n()).done;){var b=d.value;r.add(b.attribute)}}catch(P){l.e(P)}finally{l.f()}}else r.add(c.name);o[c.name]=n++}}catch(P){i.e(P)}finally{i.f()}var m=Te(e.attributes),g;try{for(m.s();!(g=m.n()).done;){var w=g.value;r.has(w.name)||(o[w.name]=n++)}}catch(P){m.e(P)}finally{m.f()}return o}function So(e,t,r){var n=e.attributes.find(function(o){return o.name===t});if(!n)throw new Error("Unknown attribute ".concat(t));if(r.has(t))throw new Error("Duplicate attribute ".concat(t));return r.add(t),n}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 Gc(e,t){return Uc(e)||Mc(e,t)||kc(e,t)||Cc()}function Cc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
27
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kc(e,t){if(e){if(typeof e=="string")return Eo(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 Eo(e,t)}}function Eo(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 Mc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function Uc(e){if(Array.isArray(e))return e}function xo(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,Wc(n.key),n)}}function Fc(e,t,r){return t&&xo(e.prototype,t),r&&xo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wc(e){var t=zc(e,"string");return je(t)==="symbol"?t:String(t)}function zc(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 Vc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hc(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&&fr(e,t)}function fr(e,t){return fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},fr(e,t)}function Kc(e){var t=qc();return function(){var n=xt(e),o;if(t){var i=xt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return $c(this,o)}}function $c(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 Yc(e)}function Yc(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qc(){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 xt(e){return xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xt(e)}var Ro=function(e){Hc(r,e);var t=Kc(r);function r(o,i){var a;if(Vc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.vs=void 0,a.fs=null,a._bufferSlots=void 0,a._buffers=void 0,a._indexBuffer=null,a._bindGroupLayout=null,a._bindGroup=null,a.device=o,a.handle=a.props.handle,!a.handle){var c=a._getRenderPipelineDescriptor();S.groupCollapsed(1,"new WebGPURenderPipeline(".concat(a.id,")"))(),S.probe(1,JSON.stringify(c,null,2))(),S.groupEnd(1)(),a.handle=a.device.handle.createRenderPipeline(c)}return a.handle.label=a.props.id,a.vs=i.vs,a.fs=i.fs,a._bufferSlots=jo(a.props.shaderLayout,a.props.bufferLayout),a._buffers=new Array(Object.keys(a._bufferSlots).length).fill(null),a}var n=r.prototype;return n.destroy=function(){},n.setIndexBuffer=function(i){this._indexBuffer=i},n.setAttributes=function(i){for(var a=0,c=Object.entries(i);a<c.length;a++){var l=Gc(c[a],2),d=l[0],b=l[1],m=this._bufferSlots[d];if(m>=0)this._buffers[m]=b;else throw new Error("Setting attribute '".concat(d,"' not listed in shader layout for program ").concat(this.id))}},n.setConstantAttributes=function(i){throw new Error("not implemented")},n.setBindings=function(i){Ze(this.props.bindings)||(Object.assign(this.props.bindings,i),this._bindGroupLayout=this._bindGroupLayout||this.handle.getBindGroupLayout(0),this._bindGroup=Oo(this.device.handle,this._bindGroupLayout,this.props.shaderLayout,this.props.bindings))},n.setUniforms=function(i){if(!Ze(i))throw new Error("WebGPU does not support uniforms")},n._getBuffers=function(){return this._buffers},n._getBindGroup=function(){return this._bindGroup},n._getRenderPipelineDescriptor=function(){var i={module:this.props.vs.handle,entryPoint:this.props.vsEntryPoint||"main",buffers:To(this.props.shaderLayout,this.props.bufferLayout)},a;if(this.props.fs){var c;a={module:this.props.fs.handle,entryPoint:this.props.fsEntryPoint||"main",targets:[{format:_e((c=this.device)===null||c===void 0||(c=c.canvasContext)===null||c===void 0?void 0:c.format)}]}}switch(this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":throw new Error("WebGPU does not support primitive topology ".concat(this.props.topology));default:}var l={vertex:i,fragment:a,primitive:{topology:this.props.topology},layout:"auto"};return wo(l,this.props.parameters),l},n.draw=function(i){var a=i.renderPass||this.device.getDefaultRenderPass();a.handle.setPipeline(this.handle);var c=this._getBindGroup();c&&a.handle.setBindGroup(0,c),this._setAttributeBuffers(a),i.indexCount?a.handle.drawIndexed(i.indexCount,i.instanceCount,i.firstIndex,i.baseVertex,i.firstInstance):a.handle.draw(i.vertexCount||0,i.instanceCount||1,i.firstInstance)},n._setAttributeBuffers=function(i){var a=this;this._indexBuffer&&i.handle.setIndexBuffer(this._indexBuffer.handle,this._indexBuffer.props.indexType);for(var c=this._getBuffers(),l=function(m){var g=c[m];if(!g){var w=a.props.shaderLayout.attributes.find(function(P){return P.location===m});throw new Error("No buffer provided for attribute '".concat(w?.name||"","' in Model '").concat(a.props.id,"'"))}i.handle.setVertexBuffer(m,g.handle)},d=0;d<c.length;++d)l(d)},Fc(r)}(st);function Ee(e){return Ee=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},Ee(e)}function Ao(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,Zc(n.key),n)}}function Xc(e,t,r){return t&&Ao(e.prototype,t),r&&Ao(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zc(e){var t=Jc(e,"string");return Ee(t)==="symbol"?t:String(t)}function Jc(e,t){if(Ee(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ee(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function es(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&&cr(e,t)}function cr(e,t){return cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},cr(e,t)}function ts(e){var t=os();return function(){var n=Rt(e),o;if(t){var i=Rt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return rs(this,o)}}function rs(e,t){if(t&&(Ee(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ns(e)}function ns(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function os(){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 Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rt(e)}var Io=function(e){es(r,e);var t=ts(r);function r(o,i){var a;Qc(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o;var c=a.props.cs.handle;return a.handle=a.props.handle||a.device.handle.createComputePipeline({label:a.props.id,compute:{module:c,entryPoint:a.props.csEntryPoint},layout:"auto"}),a}var n=r.prototype;return n._getBindGroupLayout=function(){return this.handle.getBindGroupLayout(0)},Xc(r)}(pt);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 Lo(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,as(n.key),n)}}function is(e,t,r){return t&&Lo(e.prototype,t),r&&Lo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function as(e){var t=us(e,"string");return xe(t)==="symbol"?t:String(t)}function us(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 fs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cs(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&&sr(e,t)}function sr(e,t){return sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},sr(e,t)}function ss(e){var t=hs();return function(){var n=At(e),o;if(t){var i=At(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ls(this,o)}}function ls(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 ps(e)}function ps(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hs(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function At(e){return At=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},At(e)}var Bo=function(e){cs(r,e);var t=ss(r);function r(o){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};fs(this,r),i=t.call(this,o,a),i.device=void 0,i.handle=void 0,i.pipeline=null,i.device=o;var c=a.framebuffer||o.canvasContext.getCurrentFramebuffer(),l=i.getRenderPassDescriptor(c);return S.groupCollapsed(1,"new WebGPURenderPass(".concat(i.id,")"))(),S.probe(1,JSON.stringify(l,null,2))(),S.groupEnd(1)(),i.handle=i.props.handle||o.commandEncoder.beginRenderPass(l),i.handle.label=i.props.id,i}var n=r.prototype;return n.destroy=function(){},n.end=function(){this.handle.end()},n.setPipeline=function(i){this.pipeline=i,this.handle.setPipeline(this.pipeline.handle)},n.setBindings=function(i){var a,c;(a=this.pipeline)===null||a===void 0||a.setBindings(i);var l=(c=this.pipeline)===null||c===void 0?void 0:c._getBindGroup();l&&this.handle.setBindGroup(0,l)},n.setIndexBuffer=function(i,a){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,l=arguments.length>3?arguments[3]:void 0;this.handle.setIndexBuffer(i.handle,a,c,l)},n.setVertexBuffer=function(i,a){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;this.handle.setVertexBuffer(i,a.handle,c)},n.draw=function(i){i.indexCount?this.handle.drawIndexed(i.indexCount,i.instanceCount,i.firstIndex,i.baseVertex,i.firstInstance):this.handle.draw(i.vertexCount||0,i.instanceCount||1,i.firstIndex,i.firstInstance)},n.drawIndirect=function(){},n.setParameters=function(i){var a=i.blendConstant,c=i.stencilReference,l=i.scissorRect,d=i.viewport;a&&this.handle.setBlendConstant(a),c&&this.handle.setStencilReference(c),l&&this.handle.setScissorRect(l[0],l[1],l[2],l[3]),d&&this.handle.setViewport(d[0],d[1],d[2],d[3],d[4],d[5])},n.pushDebugGroup=function(i){this.handle.pushDebugGroup(i)},n.popDebugGroup=function(){this.handle.popDebugGroup()},n.insertDebugMarker=function(i){this.handle.insertDebugMarker(i)},n.getRenderPassDescriptor=function(i){var a=this,c={colorAttachments:[]};if(c.colorAttachments=i.colorAttachments.map(function(m){return{loadOp:a.props.clearColor!==!1?"clear":"load",colorClearValue:a.props.clearColor||[0,0,0,0],storeOp:a.props.discard?"discard":"store",view:m.handle.createView()}}),i.depthStencilAttachment){c.depthStencilAttachment={view:i.depthStencilAttachment.handle.createView()};var l=c.depthStencilAttachment;this.props.depthReadOnly&&(l.depthReadOnly=!0),l.depthClearValue=this.props.clearDepth||0;var d=!0;d&&(l.depthLoadOp=this.props.clearDepth!==!1?"clear":"load",l.depthStoreOp="store");var b=!1;b&&(l.stencilLoadOp=this.props.clearStencil!==!1?"clear":"load",l.stencilStoreOp="store")}return c},is(r)}(dt);function Re(e){return Re=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},Re(e)}function Do(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,ys(n.key),n)}}function ds(e,t,r){return t&&Do(e.prototype,t),r&&Do(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ys(e){var t=ms(e,"string");return Re(t)==="symbol"?t:String(t)}function ms(e,t){if(Re(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Re(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bs(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&&lr(e,t)}function lr(e,t){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},lr(e,t)}function gs(e){var t=Os();return function(){var n=It(e),o;if(t){var i=It(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ws(this,o)}}function ws(e,t){if(t&&(Re(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _s(e)}function _s(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Os(){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 It(e){return It=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},It(e)}var No=function(e){bs(r,e);var t=gs(r);function r(o,i){var a,c;return vs(this,r),c=t.call(this,o,i),c.device=void 0,c.handle=void 0,c._bindGroupLayout=null,c.device=o,c.handle=c.props.handle||((a=o.commandEncoder)===null||a===void 0?void 0:a.beginComputePass({label:c.props.id})),c}var n=r.prototype;return n.destroy=function(){},n.end=function(){this.handle.end()},n.setPipeline=function(i){var a=i;this.handle.setPipeline(a.handle),this._bindGroupLayout=a._getBindGroupLayout()},n.setBindings=function(i){throw new Error("fix me")},n.dispatch=function(i,a,c){this.handle.dispatchWorkgroups(i,a,c)},n.dispatchIndirect=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.handle.dispatchWorkgroupsIndirect(i.handle,a)},n.pushDebugGroup=function(i){this.handle.pushDebugGroup(i)},n.popDebugGroup=function(){this.handle.popDebugGroup()},n.insertDebugMarker=function(i){this.handle.insertDebugMarker(i)},ds(r)}(mt);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)}var Co;function Ps(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Go(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 Ss(e,t,r){return t&&Go(e.prototype,t),r&&Go(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ts(e){var t=js(e,"string");return Ae(t)==="symbol"?t:String(t)}function js(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 Es(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&&pr(e,t)}function pr(e,t){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},pr(e,t)}function xs(e){var t=Is();return function(){var n=Lt(e),o;if(t){var i=Lt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Rs(this,o)}}function Rs(e,t){if(t&&(Ae(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return As(e)}function As(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Is(){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 Lt(e){return Lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lt(e)}Co=Symbol.toStringTag;var ko=function(e){Es(r,e);var t=xs(r);r.isConstantAttributeZeroSupported=function(i){return i.info.type==="webgl2"||Ke()==="Chrome"};function r(o,i){var a;return Ps(this,r),a=t.call(this,o,i),a.device=void 0,a.handle=void 0,a.device=o,a}var n=r.prototype;return n.destroy=function(){},n.setIndexBuffer=function(i){this.indexBuffer=i},n.setBuffer=function(i,a){this.attributes[i]=a},n.setConstant=function(i,a){S.warn("".concat(this.id," constant attributes not supported on WebGPU"))},n.bindBeforeRender=function(i,a,c){var l=i,d=this.indexBuffer;l.handle.setIndexBuffer(d?.handle,d?.indexType);for(var b=0;b<this.maxVertexAttributes;b++){var m=this.attributes[b];l.handle.setVertexBuffer(b,m.handle)}},n.unbindAfterRender=function(i){},Ss(r,[{key:Co,get:function(){return"WebGPUVertexArray"}}]),r}(bt);function Ie(e){return Ie=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},Ie(e)}function Mo(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 Ls(e,t,r){return t&&Mo(e.prototype,t),r&&Mo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bs(e){var t=Ds(e,"string");return Ie(t)==="symbol"?t:String(t)}function Ds(e,t){if(Ie(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ie(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ns(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gs(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&&hr(e,t)}function hr(e,t){return hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},hr(e,t)}function Cs(e){var t=Us();return function(){var n=Bt(e),o;if(t){var i=Bt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ks(this,o)}}function ks(e,t){if(t&&(Ie(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ms(e)}function Ms(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Us(){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)}var Uo=function(e){Gs(r,e);var t=Cs(r);function r(n,o){var i;return Ns(this,r),i=t.call(this,n,o),i.device=void 0,i.device=n,i.autoCreateAttachmentTextures(),i}return Ls(r)}(ft);function Le(e){return Le=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},Le(e)}function Fs(e,t){return Hs(e)||Vs(e,t)||zs(e,t)||Ws()}function Ws(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
28
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zs(e,t){if(e){if(typeof e=="string")return Fo(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 Fo(e,t)}}function Fo(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 Vs(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,c=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(b){d=!0,o=b}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(d)throw o}}return c}}function Hs(e){if(Array.isArray(e))return 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,$s(n.key),n)}}function Ks(e,t,r){return t&&Wo(e.prototype,t),r&&Wo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $s(e){var t=Ys(e,"string");return Le(t)==="symbol"?t:String(t)}function Ys(e,t){if(Le(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Le(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xs(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&&dr(e,t)}function dr(e,t){return dr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},dr(e,t)}function Zs(e){var t=el();return function(){var n=Dt(e),o;if(t){var i=Dt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Js(this,o)}}function Js(e,t){if(t&&(Le(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qs(e)}function Qs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function el(){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 Dt(e){return Dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dt(e)}var yr=function(e){Xs(r,e);var t=Zs(r);function r(o,i,a){var c;return qs(this,r),c=t.call(this,a),c.device=void 0,c.gpuCanvasContext=void 0,c.format=navigator.gpu.getPreferredCanvasFormat(),c.depthStencilFormat="depth24plus",c.depthStencilAttachment=null,c.device=o,c.width=-1,c.height=-1,c._setAutoCreatedCanvasId("".concat(c.device.id,"-canvas")),c.gpuCanvasContext=c.canvas.getContext("webgpu"),c.format="bgra8unorm",c}var n=r.prototype;return n.destroy=function(){this.gpuCanvasContext.unconfigure()},n.getCurrentTexture=function(){return this.device._createTexture({id:"default-render-target",handle:this.gpuCanvasContext.getCurrentTexture()})},n.getCurrentFramebuffer=function(){this.update();var i=this.getCurrentTexture();return this.width=i.width,this.height=i.height,this._createDepthStencilAttachment(),new Uo(this.device,{colorAttachments:[i],depthStencilAttachment:this.depthStencilAttachment})},n.update=function(){var i=this.getPixelSize(),a=Fs(i,2),c=a[0],l=a[1],d=c!==this.width||l!==this.height;d&&(this.width=c,this.height=l,this.depthStencilAttachment&&(this.depthStencilAttachment.destroy(),this.depthStencilAttachment=null),this.gpuCanvasContext.configure({device:this.device.handle,format:_e(this.format),colorSpace:this.props.colorSpace,alphaMode:this.props.alphaMode}),S.log(1,"Resized to ".concat(this.width,"x").concat(this.height,"px"))())},n.resize=function(i){this.update()},n._createDepthStencilAttachment=function(){return this.depthStencilAttachment||(this.depthStencilAttachment=this.device.createTexture({id:"depth-stencil-target",format:this.depthStencilFormat,width:this.width,height:this.height,usage:GPUTextureUsage.RENDER_ATTACHMENT})),this.depthStencilAttachment},Ks(r)}(ce);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)}function zo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Vo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zo(Object(r),!0).forEach(function(n){tl(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 tl(e,t,r){return t=Yo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ve(){"use strict";Ve=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(s,u,f){s[u]=f.value},o=typeof Symbol=="function"?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(s,u,f){return Object.defineProperty(s,u,{value:f,enumerable:!0,configurable:!0,writable:!0}),s[u]}try{l({},"")}catch{l=function(f,p,y){return f[p]=y}}function d(s,u,f,p){var y=u&&u.prototype instanceof g?u:g,h=Object.create(y.prototype),v=new N(p||[]);return n(h,"_invoke",{value:z(s,f,v)}),h}function b(s,u,f){try{return{type:"normal",arg:s.call(u,f)}}catch(p){return{type:"throw",arg:p}}}e.wrap=d;var m={};function g(){}function w(){}function P(){}var I={};l(I,i,function(){return this});var L=Object.getPrototypeOf,A=L&&L(L(k([])));A&&A!==t&&r.call(A,i)&&(I=A);var T=P.prototype=g.prototype=Object.create(I);function B(s){["next","throw","return"].forEach(function(u){l(s,u,function(f){return this._invoke(u,f)})})}function D(s,u){function f(y,h,v,_){var O=b(s[y],s,h);if(O.type!=="throw"){var x=O.arg,j=x.value;return j&&ne(j)=="object"&&r.call(j,"__await")?u.resolve(j.__await).then(function(R){f("next",R,v,_)},function(R){f("throw",R,v,_)}):u.resolve(j).then(function(R){x.value=R,v(x)},function(R){return f("throw",R,v,_)})}_(O.arg)}var p;n(this,"_invoke",{value:function(h,v){function _(){return new u(function(O,x){f(h,v,O,x)})}return p=p?p.then(_,_):_()}})}function z(s,u,f){var p="suspendedStart";return function(y,h){if(p==="executing")throw new Error("Generator is already running");if(p==="completed"){if(y==="throw")throw h;return U()}for(f.method=y,f.arg=h;;){var v=f.delegate;if(v){var _=F(v,f);if(_){if(_===m)continue;return _}}if(f.method==="next")f.sent=f._sent=f.arg;else if(f.method==="throw"){if(p==="suspendedStart")throw p="completed",f.arg;f.dispatchException(f.arg)}else f.method==="return"&&f.abrupt("return",f.arg);p="executing";var O=b(s,u,f);if(O.type==="normal"){if(p=f.done?"completed":"suspendedYield",O.arg===m)continue;return{value:O.arg,done:f.done}}O.type==="throw"&&(p="completed",f.method="throw",f.arg=O.arg)}}}function F(s,u){var f=u.method,p=s.iterator[f];if(p===void 0)return u.delegate=null,f==="throw"&&s.iterator.return&&(u.method="return",u.arg=void 0,F(s,u),u.method==="throw")||f!=="return"&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+f+"' method")),m;var y=b(p,s.iterator,u.arg);if(y.type==="throw")return u.method="throw",u.arg=y.arg,u.delegate=null,m;var h=y.arg;return h?h.done?(u[s.resultName]=h.value,u.next=s.nextLoc,u.method!=="return"&&(u.method="next",u.arg=void 0),u.delegate=null,m):h:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,m)}function V(s){var u={tryLoc:s[0]};1 in s&&(u.catchLoc=s[1]),2 in s&&(u.finallyLoc=s[2],u.afterLoc=s[3]),this.tryEntries.push(u)}function C(s){var u=s.completion||{};u.type="normal",delete u.arg,s.completion=u}function N(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(V,this),this.reset(!0)}function k(s){if(s){var u=s[i];if(u)return u.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var f=-1,p=function y(){for(;++f<s.length;)if(r.call(s,f))return y.value=s[f],y.done=!1,y;return y.value=void 0,y.done=!0,y};return p.next=p}}return{next:U}}function U(){return{value:void 0,done:!0}}return w.prototype=P,n(T,"constructor",{value:P,configurable:!0}),n(P,"constructor",{value:w,configurable:!0}),w.displayName=l(P,c,"GeneratorFunction"),e.isGeneratorFunction=function(s){var u=typeof s=="function"&&s.constructor;return!!u&&(u===w||(u.displayName||u.name)==="GeneratorFunction")},e.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,P):(s.__proto__=P,l(s,c,"GeneratorFunction")),s.prototype=Object.create(T),s},e.awrap=function(s){return{__await:s}},B(D.prototype),l(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(s,u,f,p,y){y===void 0&&(y=Promise);var h=new D(d(s,u,f,p),y);return e.isGeneratorFunction(u)?h:h.next().then(function(v){return v.done?v.value:h.next()})},B(T),l(T,c,"Generator"),l(T,i,function(){return this}),l(T,"toString",function(){return"[object Generator]"}),e.keys=function(s){var u=Object(s),f=[];for(var p in u)f.push(p);return f.reverse(),function y(){for(;f.length;){var h=f.pop();if(h in u)return y.value=h,y.done=!1,y}return y.done=!0,y}},e.values=k,N.prototype={constructor:N,reset:function(u){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(C),!u)for(var f in this)f.charAt(0)==="t"&&r.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=void 0)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if(u.type==="throw")throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var f=this;function p(x,j){return v.type="throw",v.arg=u,f.next=x,j&&(f.method="next",f.arg=void 0),!!j}for(var y=this.tryEntries.length-1;y>=0;--y){var h=this.tryEntries[y],v=h.completion;if(h.tryLoc==="root")return p("end");if(h.tryLoc<=this.prev){var _=r.call(h,"catchLoc"),O=r.call(h,"finallyLoc");if(_&&O){if(this.prev<h.catchLoc)return p(h.catchLoc,!0);if(this.prev<h.finallyLoc)return p(h.finallyLoc)}else if(_){if(this.prev<h.catchLoc)return p(h.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return p(h.finallyLoc)}}}},abrupt:function(u,f){for(var p=this.tryEntries.length-1;p>=0;--p){var y=this.tryEntries[p];if(y.tryLoc<=this.prev&&r.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var h=y;break}}h&&(u==="break"||u==="continue")&&h.tryLoc<=f&&f<=h.finallyLoc&&(h=null);var v=h?h.completion:{};return v.type=u,v.arg=f,h?(this.method="next",this.next=h.finallyLoc,m):this.complete(v)},complete:function(u,f){if(u.type==="throw")throw u.arg;return u.type==="break"||u.type==="continue"?this.next=u.arg:u.type==="return"?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):u.type==="normal"&&f&&(this.next=f),m},finish:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),C(p),m}},catch:function(u){for(var f=this.tryEntries.length-1;f>=0;--f){var p=this.tryEntries[f];if(p.tryLoc===u){var y=p.completion;if(y.type==="throw"){var h=y.arg;C(p)}return h}}throw new Error("illegal catch attempt")},delegateYield:function(u,f,p){return this.delegate={iterator:k(u),resultName:f,nextLoc:p},this.method==="next"&&(this.arg=void 0),m}},e}function Ho(e,t,r,n,o,i,a){try{var c=e[i](a),l=c.value}catch(d){r(d);return}c.done?t(l):Promise.resolve(l).then(n,o)}function Ko(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(l){Ho(i,n,o,a,c,"next",l)}function c(l){Ho(i,n,o,a,c,"throw",l)}a(void 0)})}}function rl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $o(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,Yo(n.key),n)}}function nl(e,t,r){return t&&$o(e.prototype,t),r&&$o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yo(e){var t=ol(e,"string");return ne(t)==="symbol"?t:String(t)}function ol(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 il(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,o){return n.__proto__=o,n},mr(e,t)}function al(e){var t=fl();return function(){var n=Nt(e),o;if(t){var i=Nt(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ul(this,o)}}function ul(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 qo(e)}function qo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fl(){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 Nt(e){return Nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Nt(e)}var vr=function(e){il(r,e);var t=al(r);r.isSupported=function(){return Boolean(typeof navigator<"u"&&navigator.gpu)},r.create=function(){var o=Ko(Ve().mark(function a(c){var l,d,b,m;return Ve().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(navigator.gpu){w.next=2;break}throw new Error("WebGPU not available. Open in Chrome Canary and turn on chrome://flags/#enable-unsafe-webgpu");case 2:return S.groupCollapsed(1,"WebGPUDevice created")(),w.next=5,navigator.gpu.requestAdapter({powerPreference:"high-performance"});case 5:if(l=w.sent,l){w.next=8;break}throw new Error("Failed to request WebGPU adapter");case 8:return w.next=10,l.requestAdapterInfo();case 10:return d=w.sent,S.probe(1,"Adapter available",d)(),w.next=14,l.requestDevice({requiredFeatures:l.features});case 14:if(b=w.sent,S.probe(1,"GPUDevice available")(),typeof c.canvas!="string"){w.next=20;break}return w.next=19,ce.pageLoaded;case 19:S.probe(1,"DOM is loaded")();case 20:return m=new r(b,l,c),S.probe(1,"Device created",m.info)(),S.table(1,m.info)(),S.groupEnd(1)(),w.abrupt("return",m);case 25:case"end":return w.stop()}},a)}));function i(a){return o.apply(this,arguments)}return i}();function r(o,i,a){var c;return rl(this,r),c=t.call(this,Vo(Vo({},a),{},{id:a.id||Y("webgpu-device")})),c.handle=void 0,c.adapter=void 0,c.lost=void 0,c.canvasContext=null,c.commandEncoder=null,c.renderPass=null,c._info=void 0,c._isLost=!1,c.features=void 0,c.handle=o,c.adapter=i,c._info={type:"webgpu",vendor:c.adapter.__brand,renderer:"",version:"",gpu:"unknown",shadingLanguage:"wgsl",shadingLanguageVersion:100,vendorMasked:"",rendererMasked:""},c.lost=new Promise(function(){var l=Ko(Ve().mark(function d(b){var m;return Ve().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,c.handle.lost;case 2:m=w.sent,c._isLost=!0,b({reason:"destroyed",message:m.message});case 5:case"end":return w.stop()}},d)}));return function(d){return l.apply(this,arguments)}}()),c.canvasContext=new yr(qo(c),c.adapter,{canvas:a.canvas,height:a.height,width:a.width,container:a.container}),c.features=c._getFeatures(),c}var n=r.prototype;return n.destroy=function(){this.handle.destroy()},n.isTextureFormatSupported=function(i){return!i.includes("webgl")},n.isTextureFormatFilterable=function(i){return this.isTextureFormatSupported(i)},n.isTextureFormatRenderable=function(i){return this.isTextureFormatSupported(i)},n.createBuffer=function(i){var a=this._getBufferProps(i);return new wt(this,a)},n._createTexture=function(i){return new Pt(this,i)},n.createExternalTexture=function(i){return new lo(this,i)},n.createShader=function(i){return new jt(this,i)},n.createSampler=function(i){return new K(this,i)},n.createRenderPipeline=function(i){return new Ro(this,i)},n.createFramebuffer=function(i){throw new Error("Not implemented")},n.createComputePipeline=function(i){return new Io(this,i)},n.createVertexArray=function(i){return new ko(this,i)},n.beginRenderPass=function(i){return this.commandEncoder=this.commandEncoder||this.handle.createCommandEncoder(),new Bo(this,i)},n.beginComputePass=function(i){return this.commandEncoder=this.commandEncoder||this.handle.createCommandEncoder(),new No(this,i)},n.createTransformFeedback=function(i){throw new Error("Transform feedback not supported in WebGPU")},n.createCanvasContext=function(i){return new yr(this,this.adapter,i)},n.getDefaultRenderPass=function(){throw new Error("a")},n.submit=function(){var i,a=(i=this.commandEncoder)===null||i===void 0?void 0:i.finish();a&&this.handle.queue.submit([a]),this.commandEncoder=null},n._getFeatures=function(){var i=new Set(this.handle.features);return i.has("depth-clamping")&&(i.delete("depth-clamping"),i.add("depth-clip-control")),i.has("texture-compression-bc")&&i.add("texture-compression-bc5-webgl"),i.add("webgpu"),i.add("timer-query-webgl"),i.add("vertex-array-object-webgl1"),i.add("instanced-rendering-webgl1"),i.add("multiple-render-targets-webgl1"),i.add("index-uint32-webgl1"),i.add("blend-minmax-webgl1"),i.add("texture-blend-float-webgl1"),i.add("texture-formats-srgb-webgl1"),i.add("texture-formats-depth-webgl1"),i.add("texture-formats-float32-webgl1"),i.add("texture-formats-float16-webgl1"),i.add("texture-filter-linear-float32-webgl"),i.add("texture-filter-linear-float16-webgl"),i.add("texture-filter-anisotropic-webgl"),i.add("texture-renderable-rgba32float-webgl"),i.add("texture-renderable-float32-webgl"),i.add("texture-renderable-float16-webgl"),i.add("glsl-frag-data"),i.add("glsl-frag-depth"),i.add("glsl-derivatives"),i.add("glsl-texture-lod"),i},n.copyExternalImageToTexture=function(i){var a,c=i.source,l=i.sourceX,d=l===void 0?0:l,b=i.sourceY,m=b===void 0?0:b,g=i.texture,w=i.mipLevel,P=w===void 0?0:w,I=i.aspect,L=I===void 0?"all":I,A=i.colorSpace,T=A===void 0?"display-p3":A,B=i.premultipliedAlpha,D=B===void 0?!1:B,z=i.width,F=z===void 0?g.width:z,V=i.height,C=V===void 0?g.height:V,N=i.depth,k=N===void 0?1:N,U=g;(a=this.handle)===null||a===void 0||a.queue.copyExternalImageToTexture({source:c,origin:[d,m]},{texture:U.handle,origin:[0,0,0],mipLevel:P,aspect:L,colorSpace:T,premultipliedAlpha:D},[F,C,k])},nl(r,[{key:"info",get:function(){return this._info}},{key:"limits",get:function(){return this.handle.limits}},{key:"isLost",get:function(){return this._isLost}}]),r}(ke);vr.type="webgpu";return ti(cl);})();
29
29
  return __exports__;
30
30
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/webgpu",
3
- "version": "9.0.0-alpha.51",
3
+ "version": "9.0.0-alpha.52",
4
4
  "description": "WebGPU adapter for the luma.gl API",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -37,9 +37,9 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@babel/runtime": "^7.0.0",
40
- "@luma.gl/core": "9.0.0-alpha.51",
40
+ "@luma.gl/core": "9.0.0-alpha.52",
41
41
  "@probe.gl/env": "^4.0.2",
42
42
  "@webgpu/types": "^0.1.34"
43
43
  },
44
- "gitHead": "368b615bdd46d0006717f004244a942f3d2812e7"
44
+ "gitHead": "41fa29f78dc260e5ef4c6a48e657fb5d23c96e8f"
45
45
  }