@uptimizr/dashboard 0.1.0
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/LICENSE +201 -0
- package/README.md +76 -0
- package/out/404.html +1 -0
- package/out/__next.__PAGE__.txt +9 -0
- package/out/__next._full.txt +20 -0
- package/out/__next._head.txt +6 -0
- package/out/__next._index.txt +5 -0
- package/out/__next._tree.txt +4 -0
- package/out/_next/static/93W3szqylNKDg-afLRmVW/_buildManifest.js +11 -0
- package/out/_next/static/93W3szqylNKDg-afLRmVW/_clientMiddlewareManifest.js +1 -0
- package/out/_next/static/93W3szqylNKDg-afLRmVW/_ssgManifest.js +1 -0
- package/out/_next/static/chunks/0-2y-_oomza2l.js +87 -0
- package/out/_next/static/chunks/00k_j_r7bv_eb.js +266 -0
- package/out/_next/static/chunks/00zdau6mcqeae.js +1 -0
- package/out/_next/static/chunks/023axeoslq39i.js +1 -0
- package/out/_next/static/chunks/068j6934u8j16.js +1 -0
- package/out/_next/static/chunks/0_rf76jneiwal.js +176 -0
- package/out/_next/static/chunks/0aznt7717miff.js +1 -0
- package/out/_next/static/chunks/0cu-q5q3a7uf3.js +1 -0
- package/out/_next/static/chunks/0cz1d0mv5g_q7.js +1 -0
- package/out/_next/static/chunks/0dm32-jq30tg8.js +1 -0
- package/out/_next/static/chunks/0dn0yx0rn6mpf.js +1 -0
- package/out/_next/static/chunks/0flc7nppbmsl1.js +3 -0
- package/out/_next/static/chunks/0fskcfh9vbhtv.js +1 -0
- package/out/_next/static/chunks/0gv7mblzv3dl3.js +87 -0
- package/out/_next/static/chunks/0impkpmxx3ttp.js +1 -0
- package/out/_next/static/chunks/0jmn7u31w95ly.js +91 -0
- package/out/_next/static/chunks/0n8n481szj90g.js +1 -0
- package/out/_next/static/chunks/0o6ayai0s01js.js +1 -0
- package/out/_next/static/chunks/0rys92_73hdb0.js +22 -0
- package/out/_next/static/chunks/0tl_moiyi2txt.js +1 -0
- package/out/_next/static/chunks/0tx1j_ghpz7rc.css +3 -0
- package/out/_next/static/chunks/0ufbyo1x3qkmo.js +1 -0
- package/out/_next/static/chunks/0v82oqyoy9zol.js +1 -0
- package/out/_next/static/chunks/0wrm9jr-9bw0e.js +1893 -0
- package/out/_next/static/chunks/0wwcfw8i3j_zx.js +1 -0
- package/out/_next/static/chunks/0ys9-ozuluawt.js +1 -0
- package/out/_next/static/chunks/1-61zh4waha61.js +1 -0
- package/out/_next/static/chunks/10r_824wzt8hj.js +1 -0
- package/out/_next/static/chunks/112hws17nz665.js +7 -0
- package/out/_next/static/chunks/123xxske5c9na.js +1 -0
- package/out/_next/static/chunks/13isnf0--pmx1.js +1 -0
- package/out/_next/static/chunks/157d9euci08yu.js +1 -0
- package/out/_next/static/chunks/15s7425ffrec9.js +3 -0
- package/out/_next/static/chunks/163fa70v4mgxj.js +1 -0
- package/out/_next/static/chunks/17q0c2h5ui10r.js +4 -0
- package/out/_next/static/chunks/18u58lorfahxi.js +4 -0
- package/out/_next/static/chunks/1_aahautsz2v_.js +1 -0
- package/out/_next/static/chunks/1a9l89j7e6mqu.js +23 -0
- package/out/_next/static/chunks/1dsy2ngmfflis.js +123 -0
- package/out/_next/static/chunks/1flb8adpj6_2o.js +62 -0
- package/out/_next/static/chunks/1lsg-22yob8dx.js +1 -0
- package/out/_next/static/chunks/1nj82er7msdto.js +2 -0
- package/out/_next/static/chunks/1o1d0p-v1z8ty.js +1 -0
- package/out/_next/static/chunks/1pdep2_c530sg.js +1 -0
- package/out/_next/static/chunks/1thjncpj7u6pq.js +1 -0
- package/out/_next/static/chunks/1vdjn0pkoyypn.js +1 -0
- package/out/_next/static/chunks/1yehxf-fmeicg.js +1 -0
- package/out/_next/static/chunks/1zvc1tv--w8nn.js +1 -0
- package/out/_next/static/chunks/1zx2q-r32thv1.js +4 -0
- package/out/_next/static/chunks/2-sjjedfr0kfq.js +1 -0
- package/out/_next/static/chunks/21o42k82w4llc.js +1 -0
- package/out/_next/static/chunks/25b9x-li-tvk2.js +1 -0
- package/out/_next/static/chunks/2712627rfsmwn.js +1 -0
- package/out/_next/static/chunks/296w2ke-v5tbm.js +9 -0
- package/out/_next/static/chunks/29tfeb6amdkjb.js +23 -0
- package/out/_next/static/chunks/2a3spdq-m8drh.js +3 -0
- package/out/_next/static/chunks/2aelw3far6rii.js +1 -0
- package/out/_next/static/chunks/2aor7m-wbis85.js +1 -0
- package/out/_next/static/chunks/2cbmf9m7lqv6k.js +4 -0
- package/out/_next/static/chunks/2d09v5u7dfq0q.js +1 -0
- package/out/_next/static/chunks/2feca0xcipcyt.js +850 -0
- package/out/_next/static/chunks/2fh-_9b6tqhvb.js +1 -0
- package/out/_next/static/chunks/2g5gecypj0rqe.js +1 -0
- package/out/_next/static/chunks/2kazjq29jeamx.js +1109 -0
- package/out/_next/static/chunks/2p2vv6cc9i-3q.js +255 -0
- package/out/_next/static/chunks/2szdcpl41-kzv.js +1 -0
- package/out/_next/static/chunks/2tws5udjdcmh3.js +1 -0
- package/out/_next/static/chunks/2u6shh3oeycm-.js +1 -0
- package/out/_next/static/chunks/2unhhuv0arlcv.js +1 -0
- package/out/_next/static/chunks/2xwy0-qfho1iz.js +91 -0
- package/out/_next/static/chunks/2ycvtdd68gub7.js +1 -0
- package/out/_next/static/chunks/2yiy_l8bwiw2_.js +3 -0
- package/out/_next/static/chunks/2yph6f7khgqii.js +1 -0
- package/out/_next/static/chunks/3-shckrcpvbxu.js +1681 -0
- package/out/_next/static/chunks/30fq_t9e2_fv-.js +1 -0
- package/out/_next/static/chunks/30yzu213bqtq0.js +5 -0
- package/out/_next/static/chunks/310uz81hnnzsu.js +1 -0
- package/out/_next/static/chunks/3218lp8l0a5g_.js +1 -0
- package/out/_next/static/chunks/35h5n42wxwgzk.js +123 -0
- package/out/_next/static/chunks/37vzwr3ciejf1.js +1 -0
- package/out/_next/static/chunks/38fhw7fatsyvd.js +3 -0
- package/out/_next/static/chunks/3be6s4_kn9q-o.js +1 -0
- package/out/_next/static/chunks/3i3gbhccmhu7j.js +210 -0
- package/out/_next/static/chunks/3l1dr_qm_x5kp.js +1 -0
- package/out/_next/static/chunks/3mqy-84_ul3t2.js +1 -0
- package/out/_next/static/chunks/3nz-dh9d7cehk.js +1 -0
- package/out/_next/static/chunks/3pufs8g4ui943.js +1 -0
- package/out/_next/static/chunks/3sjq_xoi4rbyg.js +31 -0
- package/out/_next/static/chunks/3t06schbtqonl.js +1 -0
- package/out/_next/static/chunks/3v3-7fio3nw_t.js +1 -0
- package/out/_next/static/chunks/3v5ha25nxo43j.js +1 -0
- package/out/_next/static/chunks/3yfrsm8lfi6ls.js +22 -0
- package/out/_next/static/chunks/3zskk1hxu3-_o.js +1 -0
- package/out/_next/static/chunks/turbopack-2ropzf0axp1x9.js +1 -0
- package/out/_next/static/media/0c89a48fa5027cee-s.p.2cyn07wtgehh0.woff2 +0 -0
- package/out/_next/static/media/13bf9871fe164e7f-s.2f7nqdagzwx2-.woff2 +0 -0
- package/out/_next/static/media/28868e710e86be81-s.2eksvhm1z0jwa.woff2 +0 -0
- package/out/_next/static/media/32687112bd2dd8db-s.1gepa_7fcx9fm.woff2 +0 -0
- package/out/_next/static/media/3fe682a82f50d426-s.0vfdmo25voy_0.woff2 +0 -0
- package/out/_next/static/media/70bc3e132a0a741e-s.p.3t6q91iet4nsy.woff2 +0 -0
- package/out/_next/static/media/71b036adf157cdcf-s.0bp8oijd_gu96.woff2 +0 -0
- package/out/_next/static/media/89b21bb081cb7469-s.1fby2rem9ngyr.woff2 +0 -0
- package/out/_next/static/media/cc545e633e20c56d-s.176arc174-8zp.woff2 +0 -0
- package/out/_next/static/media/icon.08h29dad3pcxg.svg +4 -0
- package/out/_not-found/__next._full.txt +16 -0
- package/out/_not-found/__next._head.txt +6 -0
- package/out/_not-found/__next._index.txt +5 -0
- package/out/_not-found/__next._not-found.__PAGE__.txt +5 -0
- package/out/_not-found/__next._not-found.txt +5 -0
- package/out/_not-found/__next._tree.txt +2 -0
- package/out/_not-found.html +1 -0
- package/out/_not-found.txt +16 -0
- package/out/api/projects +1 -0
- package/out/icon.svg +4 -0
- package/out/index.html +1 -0
- package/out/index.txt +20 -0
- package/out/logo.svg +46 -0
- package/package.json +67 -0
- package/server/standalone.mjs +182 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12423,e=>{"use strict";class t{static GetShadersRepository(e=0){return 0===e?t.ShadersRepository:t.ShadersRepositoryWGSL}static GetShadersStore(e=0){return 0===e?t.ShadersStore:t.ShadersStoreWGSL}static GetIncludesShadersStore(e=0){return 0===e?t.IncludesShadersStore:t.IncludesShadersStoreWGSL}}t.ShadersRepository="src/Shaders/",t.ShadersStore={},t.IncludesShadersStore={},t.ShadersRepositoryWGSL="src/ShadersWGSL/",t.ShadersStoreWGSL={},t.IncludesShadersStoreWGSL={},e.s(["ShaderStore",0,t])},14960,e=>{"use strict";var t=e.i(68179),i=e.i(71379),s=e.i(84201);let a=!1;a=!0,i.ThinEngine.prototype.createDynamicTexture=function(e,i,a,r){let h=new s.InternalTexture(this,4);return h.baseWidth=e,h.baseHeight=i,a&&(e=this.needPOTTextures?(0,t.GetExponentOfTwo)(e,this._caps.maxTextureSize):e,i=this.needPOTTextures?(0,t.GetExponentOfTwo)(i,this._caps.maxTextureSize):i),h.width=e,h.height=i,h.isReady=!1,h.generateMipMaps=a,h.samplingMode=r,this.updateTextureSamplingMode(r,h),this._internalTexturesCache.push(h),h},i.ThinEngine.prototype.updateDynamicTexture=function(e,t,i,s=!1,a,r=!1,h=!1){if(!e)return;let n=this._gl,c=n.TEXTURE_2D,o=this._bindTextureDirectly(c,e,!0,r);this._unpackFlipY(void 0===i?e.invertY:i),s&&n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);let l=this._getWebGLTextureType(e.type),d=this._getInternalFormat(a||e.format),u=this._getRGBABufferInternalSizedFormat(e.type,d);n.texImage2D(c,0,u,d,l,t),e.generateMipMaps&&n.generateMipmap(c),o||this._bindTextureDirectly(c,null),s&&n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),a&&(e.format=a),e._dynamicTextureSource=t,e._premulAlpha=s,e.invertY=i||!1,e.isReady=!0},e.s([],55976),e.i(55976);var r=e.i(13379),h=e.i(58720);class n extends h.Texture{constructor(e,t,i,s=!1,a=3,r=5,n){const c=!i||i._isScene;super(null,c?i:i?.scene,c?!s:i,n,a,void 0,void 0,void 0,void 0,r),this.name=e,this.wrapU=h.Texture.CLAMP_ADDRESSMODE,this.wrapV=h.Texture.CLAMP_ADDRESSMODE,this._generateMipMaps=s;const o=this._getEngine();if(!o)return;t.getContext?(this._canvas=t,this._ownCanvas=!1,this._texture=o.createDynamicTexture(this._canvas.width,this._canvas.height,s,a)):(this._canvas=o.createCanvas(1,1),this._ownCanvas=!0,t.width||0===t.width?this._texture=o.createDynamicTexture(t.width,t.height,s,a):this._texture=o.createDynamicTexture(t,t,s,a));const l=this.getSize();this._canvas.width!==l.width&&(this._canvas.width=l.width),this._canvas.height!==l.height&&(this._canvas.height=l.height),this._context=this._canvas.getContext("2d")}getClassName(){return"DynamicTexture"}get canRescale(){return!0}_recreate(e){this._canvas.width=e.width,this._canvas.height=e.height,this.releaseInternalTexture(),this._texture=this._getEngine().createDynamicTexture(e.width,e.height,this._generateMipMaps,this.samplingMode)}scale(e){let t=this.getSize();t.width*=e,t.height*=e,this._recreate(t)}scaleTo(e,t){let i=this.getSize();i.width=e,i.height=t,this._recreate(i)}getContext(){return this._context}clear(e){let t=this.getSize();e&&(this._context.fillStyle=e),this._context.clearRect(0,0,t.width,t.height)}update(e,t=!1,i=!1){this._texture&&this._getEngine().updateDynamicTexture(this._texture,this._canvas,void 0===e||e,t,this._format||void 0,void 0,i)}drawText(e,t,i,s,a,r,h,n=!0){let c=this.getSize();if(r&&(this._context.fillStyle=r,this._context.fillRect(0,0,c.width,c.height)),this._context.font=s,null==t){let i=this._context.measureText(e);t=(c.width-i.width)/2}if(null==i){let e=parseInt(s.replace(/\D/g,""));i=c.height/2+e/3.65}this._context.fillStyle=a||"",this._context.fillText(e,t,i),n&&this.update(h)}dispose(){super.dispose(),this._ownCanvas&&this._canvas?.remove?.(),this._canvas=null,this._context=null}clone(){let e=this.getScene();if(!e)return this;let t=this.getSize(),i=new n(this.name,t,e,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.wrapU=this.wrapU,i.wrapV=this.wrapV,i}serialize(){let e=this.getScene();e&&!e.isReady()&&r.Logger.Warn("The scene must be ready before serializing the dynamic texture");let t=super.serialize();return n._IsCanvasElement(this._canvas)&&(t.base64String=this._canvas.toDataURL()),t.invertY=this._invertY,t.samplingMode=this.samplingMode,t}static _IsCanvasElement(e){return void 0!==e.toDataURL}_rebuild(){this.update()}}e.s(["DynamicTexture",0,n],72412),e.i(72412),e.s(["DynamicTexture",0,n],14960)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21222,e=>{"use strict";var t=e.i(96265);class i{}i.POINTERDOWN=1,i.POINTERUP=2,i.POINTERMOVE=4,i.POINTERWHEEL=8,i.POINTERPICK=16,i.POINTERTAP=32,i.POINTERDOUBLETAP=64;class s{constructor(e,t){this.type=e,this.event=t}}e.s(["PointerEventTypes",0,i,"PointerInfo",0,class extends s{get pickInfo(){return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(e,t,i,s=null){super(e,t),this._pickInfo=i,this._inputManager=s}_generatePickInfo(){this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}},"PointerInfoPre",0,class extends s{constructor(e,i,s,r){super(e,i),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new t.Vector2(s,r)}}])},36365,e=>{"use strict";class t{}t.KEYDOWN=1,t.KEYUP=2;class i{constructor(e,t){this.type=e,this.event=t}}e.s(["KeyboardEventTypes",0,t,"KeyboardInfo",0,i,"KeyboardInfoPre",0,class extends i{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(e){this.skipOnKeyboardObservable=e}constructor(e,t){super(e,t),this.type=e,this.event=t,this.skipOnKeyboardObservable=!1}}])},76696,e=>{"use strict";var t,i;(i=t||(t={}))[i.PointerMove=0]="PointerMove",i[i.PointerDown=1]="PointerDown",i[i.PointerUp=2]="PointerUp";class s{}s.DOM_DELTA_PIXEL=0,s.DOM_DELTA_LINE=1,s.DOM_DELTA_PAGE=2,e.s(["EventConstants",0,s])},1773,e=>{"use strict";e.s(["useOpenGLOrientationForUV",()=>!1])},25348,e=>{"use strict";class t{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}toGlobal(e,i){return new t(this.x*e,this.y*i,this.width*e,this.height*i)}toGlobalToRef(e,t,i){return i.x=this.x*e,i.y=this.y*t,i.width=this.width*e,i.height=this.height*t,this}clone(){return new t(this.x,this.y,this.width,this.height)}}e.s(["Viewport",0,t])},44939,e=>{"use strict";var t=e.i(23240);e.s(["DrawWrapper",0,class{static GetEffect(e){return void 0===e.getPipelineContext?e.effect:e}constructor(e,t=!0){this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=e.createDrawContext(),t&&(this.materialContext=e.createMaterialContext())}setEffect(e,t,i=!0){this.effect=e,void 0!==t&&(this.defines=t),i&&this.drawContext?.reset()}dispose(e=!1){if(this.effect){let i=this.effect;e?i.dispose():t.TimingTools.SetImmediate(()=>{i.getEngine().onEndFrameObservable.addOnce(()=>{i.dispose()})}),this.effect=null}this.drawContext?.dispose()}}])},58720,e=>{"use strict";var t=e.i(10272),i=e.i(37143),s=e.i(99267),r=e.i(96265),a=e.i(52153),n=e.i(77052),o=e.i(75405),h=e.i(23240),l=e.i(98105),c=e.i(65002),d=e.i(49311);function u(e,t,i=!1){let s=t.width,r=t.height;if(e instanceof Float32Array){let t=e.byteLength/e.BYTES_PER_ELEMENT,i=new Uint8Array(t);for(;--t>=0;){let s=e[t];s<0?s=0:s>1&&(s=1),i[t]=255*s}e=i}let a=document.createElement("canvas");a.width=s,a.height=r;let n=a.getContext("2d");if(!n)return null;let o=n.createImageData(s,r);if(o.data.set(e),n.putImageData(o,0,0),i){let e=document.createElement("canvas");e.width=s,e.height=r;let t=e.getContext("2d");return t?(t.translate(0,r),t.scale(1,-1),t.drawImage(a,0,0),e.toDataURL("image/png")):null}return a.toDataURL("image/png")}async function f(e,t=0,i=0){let s=e.getInternalTexture();if(!s)return null;let r=await e.readPixels(t,i);return r?u(r,e.getSize(),s.invertY):null}var p=e.i(1773),_=e.i(80871);class m extends a.BaseTexture{static _CreateVideoTexture(e,t,i,s=!1,r=!1,a=m.TRILINEAR_SAMPLINGMODE,n={},h,l=5){throw(0,o._WarnImport)("VideoTexture")}get noMipmap(){return this._noMipmap}get mimeType(){return this._mimeType}set isBlocking(e){this._isBlocking=e}get isBlocking(){return this._isBlocking}get invertY(){return this._invertY}constructor(e,t,i,r,a=m.TRILINEAR_SAMPLINGMODE,n=null,o=null,l=null,c=!1,d,u,f,_,x){let g;super(t),this.url=null,this.uOffset=0,this.vOffset=0,this.uScale=1,this.vScale=1,this.uAng=0,this.vAng=0,this.wAng=0,this.uRotationCenter=.5,this.vRotationCenter=.5,this.wRotationCenter=.5,this.homogeneousRotationInUVTransform=!1,this.inspectableCustomProperties=null,this._noMipmap=!1,this._invertY=!1,this._rowGenerationMatrix=null,this._cachedTextureMatrix=null,this._projectionModeMatrix=null,this._t0=null,this._t1=null,this._t2=null,this._cachedUOffset=-1,this._cachedVOffset=-1,this._cachedUScale=0,this._cachedVScale=0,this._cachedUAng=-1,this._cachedVAng=-1,this._cachedWAng=-1,this._cachedReflectionProjectionMatrixId=-1,this._cachedURotationCenter=-1,this._cachedVRotationCenter=-1,this._cachedWRotationCenter=-1,this._cachedHomogeneousRotationInUVTransform=!1,this._cachedIdentity3x2=!0,this._cachedReflectionTextureMatrix=null,this._cachedReflectionUOffset=-1,this._cachedReflectionVOffset=-1,this._cachedReflectionUScale=0,this._cachedReflectionVScale=0,this._cachedReflectionCoordinatesMode=-1,this._buffer=null,this._deleteBuffer=!1,this._format=null,this._delayedOnLoad=null,this._delayedOnError=null,this.onLoadObservable=new s.Observable,this._isBlocking=!0,this.name=e||"",this.url=e;let v=!1,R=null,T=!0;"object"==typeof i&&null!==i?(g=i.noMipmap??!1,r=i.invertY??!p.useOpenGLOrientationForUV,a=i.samplingMode??m.TRILINEAR_SAMPLINGMODE,n=i.onLoad??null,o=i.onError??null,l=i.buffer??null,c=i.deleteBuffer??!1,d=i.format,u=i.mimeType,f=i.loaderOptions,_=i.creationFlags,v=i.useSRGBBuffer??!1,R=i.internalTexture??null,T=i.gammaSpace??T,x=i.forcedExtension??x):g=!!i,this._gammaSpace=T,this._noMipmap=g,this._invertY=void 0===r?!p.useOpenGLOrientationForUV:r,this._initialSamplingMode=a,this._buffer=l,this._deleteBuffer=c,this._mimeType=u,this._loaderOptions=f,this._creationFlags=_,this._useSRGBBuffer=v,this._forcedExtension=x,void 0!==d&&(this._format=d);const M=this.getScene(),S=this._getEngine();if(!S)return;S.onBeforeTextureInitObservable.notifyObservers(this);const E=()=>{this._texture&&(this._texture._invertVScale&&(this.vScale*=-1,this.vOffset+=1),null!==this._texture._cachedWrapU&&(this.wrapU=this._texture._cachedWrapU,this._texture._cachedWrapU=null),null!==this._texture._cachedWrapV&&(this.wrapV=this._texture._cachedWrapV,this._texture._cachedWrapV=null),null!==this._texture._cachedWrapR&&(this.wrapR=this._texture._cachedWrapR,this._texture._cachedWrapR=null)),this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),n&&n(),!this.isBlocking&&M&&M.resetCachedMaterial()},b=(e,t)=>{this._loadingError=!0,this._errorObject={message:e,exception:t},o&&o(e,t),m.OnTextureLoadErrorObservable.notifyObservers(this)};if(!this.url&&!R){this._delayedOnLoad=E,this._delayedOnError=b;return}if(this._texture=R??this._getFromCache(this.url,g,a,this._invertY,v,this.isCube),this._texture)if(this._texture.isReady)h.TimingTools.SetImmediate(()=>E());else{const e=this._texture.onLoadedObservable.add(E);this._texture.onErrorObservable.add(t=>{b(t.message,t.exception),this._texture?.onLoadedObservable.remove(e)})}else if(M&&M.useDelayedTextureLoading)this.delayLoadState=4,this._delayedOnLoad=E,this._delayedOnError=b;else{try{this._texture=S.createTexture(this.url,g,this._invertY,M,a,E,b,this._buffer,void 0,this._format,this._forcedExtension,u,f,_,v)}catch(e){throw b("error loading",e),e}c&&(this._buffer=null)}}updateURL(e,t=null,i,s){this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(1,e=>e.hasTexture(this))),(!this.name||this.name.startsWith("data:"))&&(this.name=e),this.url=e,this._buffer=t,this._forcedExtension=s,this.delayLoadState=4;let r=this._delayedOnLoad,a=()=>{r?r():this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),i&&i()};this._delayedOnLoad=a,this.delayLoad()}delayLoad(){if(4!==this.delayLoadState)return;let e=this.getScene();if(!e)return;let t=this.url;!t&&(this.name.indexOf("://")>0||this.name.startsWith("data:"))&&(t=this.name),this.delayLoadState=1,this._texture=this._getFromCache(t,this._noMipmap,this.samplingMode,this._invertY,this._useSRGBBuffer,this.isCube),this._texture?this._delayedOnLoad&&(this._texture.isReady?h.TimingTools.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=e.getEngine().createTexture(t,this._noMipmap,this._invertY,e,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,this._forcedExtension,this._mimeType,this._loaderOptions,this._creationFlags,this._useSRGBBuffer),this._deleteBuffer&&(this._buffer=null)),this._delayedOnLoad=null,this._delayedOnError=null}_prepareRowForTextureGeneration(e,t,i,s){e*=this._cachedUScale,t*=this._cachedVScale,e-=this.uRotationCenter*this._cachedUScale,t-=this.vRotationCenter*this._cachedVScale,i-=this.wRotationCenter,r.Vector3.TransformCoordinatesFromFloatsToRef(e,t,i,this._rowGenerationMatrix,s),s.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,s.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,s.z+=this.wRotationCenter}getTextureMatrix(e=1){if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*e===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng&&this.uRotationCenter===this._cachedURotationCenter&&this.vRotationCenter===this._cachedVRotationCenter&&this.wRotationCenter===this._cachedWRotationCenter&&this.homogeneousRotationInUVTransform===this._cachedHomogeneousRotationInUVTransform)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*e,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedURotationCenter=this.uRotationCenter,this._cachedVRotationCenter=this.vRotationCenter,this._cachedWRotationCenter=this.wRotationCenter,this._cachedHomogeneousRotationInUVTransform=this.homogeneousRotationInUVTransform,this._cachedTextureMatrix&&this._rowGenerationMatrix||(this._cachedTextureMatrix=r.Matrix.Zero(),this._rowGenerationMatrix=new r.Matrix,this._t0=r.Vector3.Zero(),this._t1=r.Vector3.Zero(),this._t2=r.Vector3.Zero()),r.Matrix.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this.homogeneousRotationInUVTransform?(r.Matrix.TranslationToRef(-this._cachedURotationCenter,-this._cachedVRotationCenter,-this._cachedWRotationCenter,r.TmpVectors.Matrix[0]),r.Matrix.TranslationToRef(this._cachedURotationCenter,this._cachedVRotationCenter,this._cachedWRotationCenter,r.TmpVectors.Matrix[1]),r.Matrix.ScalingToRef(this._cachedUScale,this._cachedVScale,0,r.TmpVectors.Matrix[2]),r.Matrix.TranslationToRef(this._cachedUOffset,this._cachedVOffset,0,r.TmpVectors.Matrix[3]),r.TmpVectors.Matrix[0].multiplyToRef(this._rowGenerationMatrix,this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(r.TmpVectors.Matrix[1],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(r.TmpVectors.Matrix[2],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(r.TmpVectors.Matrix[3],this._cachedTextureMatrix),this._cachedTextureMatrix.setRowFromFloats(2,this._cachedTextureMatrix.m[12],this._cachedTextureMatrix.m[13],this._cachedTextureMatrix.m[14],1)):(this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),r.Matrix.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix));let t=this.getScene();if(!t)return this._cachedTextureMatrix;let i=this._cachedIdentity3x2;return this._cachedIdentity3x2=this._cachedTextureMatrix.isIdentityAs3x2(),this.optimizeUVAllocation&&i!==this._cachedIdentity3x2&&t.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)),this._cachedTextureMatrix}getReflectionTextureMatrix(){let e=this.getScene();if(!e)return this._cachedReflectionTextureMatrix;if(this.uOffset===this._cachedReflectionUOffset&&this.vOffset===this._cachedReflectionVOffset&&this.uScale===this._cachedReflectionUScale&&this.vScale===this._cachedReflectionVScale&&this.coordinatesMode===this._cachedReflectionCoordinatesMode){if(this.coordinatesMode!==m.PROJECTION_MODE)return this._cachedReflectionTextureMatrix;else if(this._cachedReflectionProjectionMatrixId===e.getProjectionMatrix().updateFlag)return this._cachedReflectionTextureMatrix}this._cachedReflectionTextureMatrix||(this._cachedReflectionTextureMatrix=r.Matrix.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=r.Matrix.Zero());let t=this._cachedReflectionCoordinatesMode!==this.coordinatesMode;switch(this._cachedReflectionUOffset=this.uOffset,this._cachedReflectionVOffset=this.vOffset,this._cachedReflectionUScale=this.uScale,this._cachedReflectionVScale=this.vScale,this._cachedReflectionCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case m.PLANAR_MODE:r.Matrix.IdentityToRef(this._cachedReflectionTextureMatrix),this._cachedReflectionTextureMatrix[0]=this.uScale,this._cachedReflectionTextureMatrix[5]=this.vScale,this._cachedReflectionTextureMatrix[12]=this.uOffset,this._cachedReflectionTextureMatrix[13]=this.vOffset;break;case m.PROJECTION_MODE:{r.Matrix.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);let t=e.getProjectionMatrix();this._cachedReflectionProjectionMatrixId=t.updateFlag,t.multiplyToRef(this._projectionModeMatrix,this._cachedReflectionTextureMatrix);break}default:r.Matrix.IdentityToRef(this._cachedReflectionTextureMatrix)}return t&&e.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)),this._cachedReflectionTextureMatrix}clone(){let e={noMipmap:this._noMipmap,invertY:this._invertY,samplingMode:this.samplingMode,onLoad:void 0,onError:void 0,buffer:this._texture?this._texture._buffer:void 0,deleteBuffer:this._deleteBuffer,format:this.textureFormat,mimeType:this.mimeType,loaderOptions:this._loaderOptions,creationFlags:this._creationFlags,useSRGBBuffer:this._useSRGBBuffer};return _.SerializationHelper.Clone(()=>new m(this._texture?this._texture.url:null,this.getScene(),e),this)}serialize(){let e=this.name;!m.SerializeBuffers&&this.name.startsWith("data:")&&(this.name=""),this.name.startsWith("data:")&&this.url===this.name&&(this.url="");let t=super.serialize(m._SerializeInternalTextureUniqueId);if(!t)return null;if(m.SerializeBuffers||m.ForceSerializeBuffers)if("string"==typeof this._buffer&&this._buffer.startsWith("data:"))t.base64String=this._buffer,t.name=t.name.replace("data:","");else if(this.url&&this.url.startsWith("data:")&&this._buffer instanceof Uint8Array){let e=this.mimeType||"image/png";t.base64String=`data:${e};base64,${(0,d.EncodeArrayBufferToBase64)(this._buffer)}`}else(m.ForceSerializeBuffers||this.url&&this.url.startsWith("blob:")||this._forceSerialize)&&(t.base64String=!this._engine||this._engine._features.supportSyncTextureRead?function(e,t=0,i=0){let s=e.getInternalTexture();if(!s)return null;let r=e._readPixelsSync(t,i);return r?u(r,e.getSize(),s.invertY):null}(this):f(this));return t.invertY=this._invertY,t.samplingMode=this.samplingMode,t._creationFlags=this._creationFlags,t._useSRGBBuffer=this._useSRGBBuffer,m._SerializeInternalTextureUniqueId&&(t.internalTextureUniqueId=this._texture?.uniqueId),t.internalTextureLabel=this._texture?.label,t.noMipmap=this._noMipmap,this.name=e,t}getClassName(){return"Texture"}dispose(){super.dispose(),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null,this._buffer=null}static Parse(e,t,i){let s;if(e.customType){let s=l.InstantiationTools.Instantiate(e.customType).Parse(e,t,i);return e.samplingMode&&s.updateSamplingMode&&s._samplingMode&&s._samplingMode!==e.samplingMode&&s.updateSamplingMode(e.samplingMode),s}if(e.isCube&&!e.isRenderTarget)return m._CubeTextureParser(e,t,i);let r=void 0!==e.internalTextureUniqueId;if(!e.name&&!e.isRenderTarget&&!r)return null;if(r){for(let i of t.getEngine().getLoadedTexturesCache())if(i.uniqueId===e.internalTextureUniqueId){s=i;break}}let a=t=>{if(t&&t._texture&&(t._texture._cachedWrapU=null,t._texture._cachedWrapV=null,t._texture._cachedWrapR=null),e.samplingMode){let i=e.samplingMode;t&&t.samplingMode!==i&&t.updateSamplingMode(i)}if(t&&e.animations)for(let i=0;i<e.animations.length;i++){let s=e.animations[i],r=(0,n.GetClass)("BABYLON.Animation");r&&t.animations.push(r.Parse(s))}t&&t._texture&&(r&&!s&&t._texture._setUniqueId(e.internalTextureUniqueId),t._texture.label=e.internalTextureLabel)};return _.SerializationHelper.Parse(()=>{let r=!0;if(e.noMipmap&&(r=!1),e.mirrorPlane){let i=m._CreateMirror(e.name,e.renderTargetSize,t,r);return i._waitingRenderList=e.renderList,i.mirrorPlane=c.Plane.FromArray(e.mirrorPlane),a(i),i}if(e.isRenderTarget&&!e.base64String){let i=null;if(e.isCube){if(t.reflectionProbes)for(let i=0;i<t.reflectionProbes.length;i++){let s=t.reflectionProbes[i];if(s.name===e.name)return s.cubeTexture}}else(i=m._CreateRenderTargetTexture(e.name,e.renderTargetSize,t,r,e._creationFlags??0))._waitingRenderList=e.renderList;return a(i),i}if(e.isVideo){let s=m._CreateVideoTexture(i+(e.url||e.name),i+(e.src||e.url),t,r,e.invertY,e.samplingMode,e.settings||{});return a(s),s}{let n;if("string"==typeof e.base64String&&e.base64String&&!s){let i={buffer:e.base64String,noMipmap:!r,invertY:e.invertY,samplingMode:e.samplingMode,useSRGBBuffer:e._useSRGBBuffer??!1,creationFlags:e._creationFlags??0,onLoad:()=>{a(n)}},s=e.base64String,o=s.startsWith("data:")?s.substring(5):s;(n=m.CreateFromBase64String("",o,t,i)).name=e.name}else{let o;o=e.name&&(e.name.indexOf("://")>0||e.name.startsWith("data:"))?e.name:i+e.name,e.url&&(e.url.startsWith("data:")||m.UseSerializedUrlIfAny)&&(o=e.url),n=new m(o,t,{noMipmap:!r,invertY:e.invertY,samplingMode:e.samplingMode,useSRGBBuffer:e._useSRGBBuffer??!1,creationFlags:e._creationFlags??0,onLoad:()=>{a(n)},internalTexture:s})}return n}},e,t)}static CreateFromBase64String(e,t,i,s,r,a=m.TRILINEAR_SAMPLINGMODE,n=null,o=null,h=5,l,c){return new m("data:"+t,i,s,r,a,n,o,e,!1,h,void 0,void 0,l,c)}static LoadFromDataString(e,t,i,s=!1,r,a=!0,n=m.TRILINEAR_SAMPLINGMODE,o=null,h=null,l=5,c,d){return"data:"!==e.substring(0,5)&&(e="data:"+e),new m(e,i,r,a,n,o,h,t,s,l,void 0,void 0,c,d)}}m.SerializeBuffers=!0,m.ForceSerializeBuffers=!1,m.OnTextureLoadErrorObservable=new s.Observable,m._SerializeInternalTextureUniqueId=!1,m._CubeTextureParser=(e,t,i)=>{throw(0,o._WarnImport)("CubeTexture")},m._CreateMirror=(e,t,i,s)=>{throw(0,o._WarnImport)("MirrorTexture")},m._CreateRenderTargetTexture=(e,t,i,s,r)=>{throw(0,o._WarnImport)("RenderTargetTexture")},m.NEAREST_SAMPLINGMODE=1,m.NEAREST_NEAREST_MIPLINEAR=8,m.BILINEAR_SAMPLINGMODE=2,m.LINEAR_LINEAR_MIPNEAREST=11,m.TRILINEAR_SAMPLINGMODE=3,m.LINEAR_LINEAR_MIPLINEAR=3,m.NEAREST_NEAREST_MIPNEAREST=4,m.NEAREST_LINEAR_MIPNEAREST=5,m.NEAREST_LINEAR_MIPLINEAR=6,m.NEAREST_LINEAR=7,m.NEAREST_NEAREST=1,m.LINEAR_NEAREST_MIPNEAREST=9,m.LINEAR_NEAREST_MIPLINEAR=10,m.LINEAR_LINEAR=2,m.LINEAR_NEAREST=12,m.EXPLICIT_MODE=0,m.SPHERICAL_MODE=1,m.PLANAR_MODE=2,m.CUBIC_MODE=3,m.PROJECTION_MODE=4,m.SKYBOX_MODE=5,m.INVCUBIC_MODE=6,m.EQUIRECTANGULAR_MODE=7,m.FIXED_EQUIRECTANGULAR_MODE=8,m.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,m.CLAMP_ADDRESSMODE=0,m.WRAP_ADDRESSMODE=1,m.MIRROR_ADDRESSMODE=2,m.UseSerializedUrlIfAny=!1,(0,t.__decorate)([(0,i.serialize)()],m.prototype,"url",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"uOffset",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"vOffset",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"uScale",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"vScale",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"uAng",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"vAng",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"wAng",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"uRotationCenter",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"vRotationCenter",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"wRotationCenter",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"homogeneousRotationInUVTransform",void 0),(0,t.__decorate)([(0,i.serialize)()],m.prototype,"isBlocking",null),e.s(["Texture",0,m],58720)},20461,e=>{"use strict";var t=e.i(96265),i=e.i(46703),s=e.i(14953),r=e.i(89030),a=e.i(70653);class n{constructor(e,t,i,s){this.name=e,this.worldAxisForNormal=t,this.worldAxisForFileX=i,this.worldAxisForFileY=s}}class o{static _NearestPow2Floor(e){return e<=1?1:1<<Math.floor(Math.log2(e))}static ConvertCubeMapTextureToSphericalPolynomial(e){let t,i;if(!e.isCube)return null;e.getScene()?.getEngine().flushFramebuffer();let s=e.getSize().width,r=e._sphericalPolynomialTargetSize,a=r>0?this._NearestPow2Floor(r):0,n=!e.noMipmap&&e._texture?.generateMipMaps===!0,o=a>0&&a<s&&n,h=o?Math.max(0,Math.round(Math.log2(s/a))):0,l=o?Math.max(1,Math.floor(s/Math.pow(2,h))):s,c=e.readPixels(0,h,void 0,!1),d=e.readPixels(1,h,void 0,!1);e.isRenderTarget?(t=e.readPixels(3,h,void 0,!1),i=e.readPixels(2,h,void 0,!1)):(t=e.readPixels(2,h,void 0,!1),i=e.readPixels(3,h,void 0,!1));let u=e.readPixels(4,h,void 0,!1),f=e.readPixels(5,h,void 0,!1),p=e.gammaSpace,_=a>0&&a<s&&!o;return new Promise(e=>{Promise.all([d,c,t,i,u,f]).then(([t,i,r,n,o,h])=>{let c=l;_&&(t=this._DownsampleFace(t,s,a,4),i=this._DownsampleFace(i,s,a,4),r=this._DownsampleFace(r,s,a,4),n=this._DownsampleFace(n,s,a,4),o=this._DownsampleFace(o,s,a,4),h=this._DownsampleFace(h,s,a,4),c=a);let d={size:c,right:i,left:t,up:r,down:n,front:o,back:h,format:5,type:+(t instanceof Float32Array),gammaSpace:p};e(this.ConvertCubeMapToSphericalPolynomial(d))})})}static _AreaElement(e,t){return Math.atan2(e*t,Math.sqrt(e*e+t*t+1))}static _DownsampleFace(e,t,i,s){let r=e instanceof Float32Array?e:Float32Array.from(e),a=i*i*s,n=new Float32Array(a),o=t/i,h=1/(o*o);for(let e=0;e<i;e++){let a=Math.floor(e*o),l=Math.floor((e+1)*o);for(let c=0;c<i;c++){let d=Math.floor(c*o),u=Math.floor((c+1)*o),f=(e*i+c)*s;for(let e=0;e<s;e++){let i=0;for(let n=a;n<l;n++)for(let a=d;a<u;a++)i+=r[(n*t+a)*s+e];n[f+e]=i*h}}}if(e instanceof Float32Array)return n;let l=new e.constructor(a);for(let e=0;e<a;e++)l[e]=n[e]+.5|0;return l}static ConvertCubeMapToSphericalPolynomial(e,t=0){let n=t>0?this._NearestPow2Floor(t):0;if(n>0&&e.size>n){let t=5===e.format?4:3,i={};for(let s of["right","left","up","down","front","back"])i[s]=this._DownsampleFace(e[s],e.size,n,t);e={...e,...i,size:n}}let o=new s.SphericalHarmonics,h=0,l=2/e.size,c=.5*l,d=c-1;for(let t=0;t<6;t++){let s=this._FileFaces[t],n=e[s.name],u=d,f=5===e.format?4:3;for(let t=0;t<e.size;t++){let p=d;for(let d=0;d<e.size;d++){let _=s.worldAxisForFileX.scale(p).add(s.worldAxisForFileY.scale(u)).add(s.worldAxisForNormal);_.normalize();let m=this._AreaElement(p-c,u-c)-this._AreaElement(p-c,u+c)-this._AreaElement(p+c,u-c)+this._AreaElement(p+c,u+c),x=n[t*e.size*f+d*f+0],g=n[t*e.size*f+d*f+1],v=n[t*e.size*f+d*f+2];isNaN(x)&&(x=0),isNaN(g)&&(g=0),isNaN(v)&&(v=0),0===e.type&&(x/=255,g/=255,v/=255),e.gammaSpace&&(x=Math.pow((0,i.Clamp)(x),r.ToLinearSpace),g=Math.pow((0,i.Clamp)(g),r.ToLinearSpace),v=Math.pow((0,i.Clamp)(v),r.ToLinearSpace));let R=this.MAX_HDRI_VALUE;if(this.PRESERVE_CLAMPED_COLORS){let e=Math.max(x,g,v);if(e>R){let t=R/e;x*=t,g*=t,v*=t}}else x=(0,i.Clamp)(x,0,R),g=(0,i.Clamp)(g,0,R),v=(0,i.Clamp)(v,0,R);let T=new a.Color3(x,g,v);o.addLight(_,T,m),h+=m,p+=l}u+=l}}let u=4*Math.PI*6/6/h;return o.scaleInPlace(u),o.convertIncidentRadianceToIrradiance(),o.convertIrradianceToLambertianRadiance(),s.SphericalPolynomial.FromHarmonics(o)}}o._FileFaces=[new n("right",new t.Vector3(1,0,0),new t.Vector3(0,0,-1),new t.Vector3(0,-1,0)),new n("left",new t.Vector3(-1,0,0),new t.Vector3(0,0,1),new t.Vector3(0,-1,0)),new n("up",new t.Vector3(0,1,0),new t.Vector3(1,0,0),new t.Vector3(0,0,1)),new n("down",new t.Vector3(0,-1,0),new t.Vector3(1,0,0),new t.Vector3(0,0,-1)),new n("front",new t.Vector3(0,0,1),new t.Vector3(1,0,0),new t.Vector3(0,-1,0)),new n("back",new t.Vector3(0,0,-1),new t.Vector3(-1,0,0),new t.Vector3(0,-1,0))],o.MAX_HDRI_VALUE=4096,o.PRESERVE_CLAMPED_COLORS=!1,e.s(["CubeMapToSphericalPolynomialTools",0,o])},37348,518,e=>{"use strict";var t=e.i(10272),i=e.i(35407),s=e.i(25348),r=e.i(99267),a=e.i(99904),n=e.i(44939);let o={positions:[1,1,-1,1,-1,-1,1,-1],indices:[0,1,2,0,2,3]};class h{constructor(e,t=o){this._fullscreenViewport=new s.Viewport(0,0,1,1);const r=t.positions??o.positions,a=t.indices??o.indices;this.engine=e,this._vertexBuffers={[i.VertexBuffer.PositionKind]:new i.VertexBuffer(e,r,i.VertexBuffer.PositionKind,!1,!1,2)},this._indexBuffer=e.createIndexBuffer(a),this._indexBufferLength=a.length,this._onContextRestoredObserver=e.onContextRestoredObservable.add(()=>{for(let t in this._indexBuffer=e.createIndexBuffer(a),this._vertexBuffers)this._vertexBuffers[t]._rebuild()})}setViewport(e=this._fullscreenViewport){this.engine.setViewport(e)}bindBuffers(e){this.engine.bindBuffers(this._vertexBuffers,this._indexBuffer,e)}applyEffectWrapper(e,t=!1,i=!1){this.engine.setState(!0),this.engine.depthCullingState.depthTest=t,this.engine.stencilState.stencilTest=i,this.engine.enableEffect(e.drawWrapper),this.bindBuffers(e.effect),e.onApplyObservable.notifyObservers({})}saveStates(){this._savedStateDepthTest=this.engine.depthCullingState.depthTest,this._savedStateStencilTest=this.engine.stencilState.stencilTest}restoreStates(){this.engine.depthCullingState.depthTest=this._savedStateDepthTest,this.engine.stencilState.stencilTest=this._savedStateStencilTest}draw(){this.engine.drawElementsType(0,0,this._indexBufferLength)}_isRenderTargetTexture(e){return void 0!==e.renderTarget}render(e,t=null){if(!e.effect.isReady())return;this.saveStates(),this.setViewport();let i=null===t?null:this._isRenderTargetTexture(t)?t.renderTarget:t;i&&this.engine.bindFramebuffer(i),this.applyEffectWrapper(e),this.draw(),i&&this.engine.unBindFramebuffer(i),this.restoreStates()}dispose(){let e=this._vertexBuffers[i.VertexBuffer.PositionKind];e&&(e.dispose(),delete this._vertexBuffers[i.VertexBuffer.PositionKind]),this._indexBuffer&&this.engine._releaseBuffer(this._indexBuffer),this._onContextRestoredObserver&&(this.engine.onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}}class l{static RegisterShaderCodeProcessing(e,t){t?l._CustomShaderCodeProcessing[e??""]=t:delete l._CustomShaderCodeProcessing[e??""]}static _GetShaderCodeProcessing(e){return l._CustomShaderCodeProcessing[e]??l._CustomShaderCodeProcessing[""]}get name(){return this.options.name}set name(e){this.options.name=e}isReady(){return this._drawWrapper.effect?.isReady()??!1}get drawWrapper(){return this._drawWrapper}get effect(){return this._drawWrapper.effect}set effect(e){this._drawWrapper.effect=e}constructor(e){this.alphaMode=0,this.onEffectCreatedObservable=new r.Observable(void 0,!0),this.onApplyObservable=new r.Observable,this._shadersLoaded=!1,this._webGPUReady=!1,this._importPromises=[],this.options={...e,name:e.name||"effectWrapper",engine:e.engine,uniforms:e.uniforms||e.uniformNames||[],uniformNames:void 0,samplers:e.samplers||e.samplerNames||[],samplerNames:void 0,attributeNames:e.attributeNames||["position"],uniformBuffers:e.uniformBuffers||[],defines:e.defines||"",useShaderStore:e.useShaderStore||!1,vertexUrl:e.vertexUrl||e.vertexShader||"postprocess",vertexShader:void 0,fragmentShader:e.fragmentShader||"pass",indexParameters:e.indexParameters,blockCompilation:e.blockCompilation||!1,shaderLanguage:e.shaderLanguage||0,onCompiled:e.onCompiled||void 0,extraInitializations:e.extraInitializations||void 0,extraInitializationsAsync:e.extraInitializationsAsync||void 0,useAsPostProcess:e.useAsPostProcess??!1,allowEmptySourceTexture:e.allowEmptySourceTexture??!1},this.options.uniformNames=this.options.uniforms,this.options.samplerNames=this.options.samplers,this.options.vertexShader=this.options.vertexUrl,this.options.useAsPostProcess&&(this.options.allowEmptySourceTexture||-1!==this.options.samplers.indexOf("textureSampler")||this.options.samplers.push("textureSampler"),-1===this.options.uniforms.indexOf("scale")&&this.options.uniforms.push("scale")),e.vertexUrl||e.vertexShader?this._shaderPath={vertexSource:this.options.vertexShader}:(this.options.useAsPostProcess||(this.options.uniforms.push("scale"),this.onApplyObservable.add(()=>{this.effect.setFloat2("scale",1,1)})),this._shaderPath={vertex:this.options.vertexShader}),this._shaderPath.fragmentSource=this.options.fragmentShader,this._shaderPath.spectorName=this.options.name,this.options.useShaderStore&&(this._shaderPath.fragment=this._shaderPath.fragmentSource,this._shaderPath.vertex||(this._shaderPath.vertex=this._shaderPath.vertexSource),delete this._shaderPath.fragmentSource,delete this._shaderPath.vertexSource),this.onApplyObservable.add(()=>{this.bind()}),this.options.useShaderStore||(this._onContextRestoredObserver=this.options.engine.onContextRestoredObservable.add(()=>{this.effect._pipelineContext=null,this.effect._prepareEffect()})),this._drawWrapper=new n.DrawWrapper(this.options.engine),this._webGPUReady=1===this.options.shaderLanguage;const t=Array.isArray(this.options.defines)?this.options.defines.join("\n"):this.options.defines;this._postConstructor(this.options.blockCompilation,t,this.options.extraInitializations)}_gatherImports(e=!1,t){}_postConstructor(t,i=null,s,r){this._importPromises.length=0,r&&this._importPromises.push(...r);let a=this.options.engine.isWebGPU&&!l.ForceGLSL;this._gatherImports(a,this._importPromises),this.options.useShaderStore&&"postprocess"===this._shaderPath.vertex&&this._importPromises.push(a&&this._webGPUReady?e.A(37828):e.A(35413)),void 0!==s&&s(a,this._importPromises),a&&this._webGPUReady&&(this.options.shaderLanguage=1),t||this.updateEffect(i)}updateEffect(e=null,t=null,i=null,s,r,n,o,h){let c,d=l._GetShaderCodeProcessing(this.name);if(d?.defineCustomBindings){let s=t?.slice()??[];s.push(...this.options.uniforms);let r=i?.slice()??[];r.push(...this.options.samplers),e=d.defineCustomBindings(this.name,e,s,r),t=s,i=r}this.options.defines=e||"";let u=this._shadersLoaded||0===this._importPromises.length?void 0:async()=>{await Promise.all(this._importPromises),this._shadersLoaded=!0};c=this.options.extraInitializationsAsync?async()=>{await u?.(),await this.options.extraInitializationsAsync()}:u,this.options.useShaderStore?this._drawWrapper.effect=this.options.engine.createEffect({vertex:o??this._shaderPath.vertex,fragment:h??this._shaderPath.fragment},{attributes:this.options.attributeNames,uniformsNames:t||this.options.uniforms,uniformBuffersNames:this.options.uniformBuffers,samplers:i||this.options.samplers,defines:null!==e?e:"",fallbacks:null,onCompiled:r??this.options.onCompiled,onError:n??null,indexParameters:s||this.options.indexParameters,processCodeAfterIncludes:d?.processCodeAfterIncludes?(e,t)=>d.processCodeAfterIncludes(this.name,e,t):null,processFinalCode:d?.processFinalCode?(e,t)=>d.processFinalCode(this.name,e,t):null,shaderLanguage:this.options.shaderLanguage,extraInitializationsAsync:c},this.options.engine):this._drawWrapper.effect=new a.Effect(this._shaderPath,this.options.attributeNames,t||this.options.uniforms,i||this.options.samplerNames,this.options.engine,e,void 0,r||this.options.onCompiled,void 0,void 0,void 0,this.options.shaderLanguage,c),this.onEffectCreatedObservable.notifyObservers(this._drawWrapper.effect)}bind(e=!1){this.options.useAsPostProcess&&!e&&(this.options.engine.setAlphaMode(this.alphaMode),this.drawWrapper.effect.setFloat2("scale",1,1)),l._GetShaderCodeProcessing(this.name)?.bindCustomBindings?.(this.name,this._drawWrapper.effect)}dispose(e=!1){this._onContextRestoredObserver&&(this.effect.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null),this.onEffectCreatedObservable.clear(),this._drawWrapper.dispose(!0)}}l.ForceGLSL=!1,l._CustomShaderCodeProcessing={},e.s(["EffectRenderer",0,h,"EffectWrapper",0,l],518);var c=e.i(65740),d=e.i(46703),u=e.i(81623),f=e.i(13379),p=e.i(49311),_=e.i(37143);let m=null;async function x(){let t=u.EngineStore.LastCreatedEngine?.createCanvas(100,100)??new OffscreenCanvas(100,100);t instanceof OffscreenCanvas&&f.Logger.Warn("DumpData: OffscreenCanvas will be used for dumping data. This may result in lossy alpha values.");let{ThinEngine:i}=await e.A(33558);if(!i.IsSupported)throw Error("DumpData: No WebGL context available. Cannot dump data.");let s=new i(t,!1,{preserveDrawingBuffer:!0,depth:!1,stencil:!1,alpha:!0,premultipliedAlpha:!1,antialias:!1,failIfMajorPerformanceCaveat:!1});u.EngineStore.Instances.pop(),u.EngineStore.OnEnginesDisposedObservable.add(e=>{s&&e!==s&&!s.isDisposed&&0===u.EngineStore.Instances.length&&E()}),s.getCaps().parallelShaderCompile=void 0;let r=new h(s),{passPixelShader:a}=await e.A(21236),n=new l({engine:s,name:a.name,fragmentShader:a.shader,samplerNames:["textureSampler"]});return{canvas:t,dumpEngine:{engine:s,renderer:r,wrapper:n}}}async function g(){return m||(m=x()),await m}class v{static async EncodeImageAsync(e,t,i,s,r,a){let n=await g(),o=n.dumpEngine;o.engine.setSize(t,i,!0);let h=o.engine.createRawTexture(e,t,i,5,!1,!r,1);return o.renderer.setViewport(),o.renderer.applyEffectWrapper(o.wrapper),o.wrapper.effect._bindTexture("textureSampler",h),o.renderer.draw(),h.dispose(),await new Promise((e,t)=>{c.Tools.ToBlob(n.canvas,i=>{i?e(i):t(Error("EncodeImageAsync: Failed to convert canvas to blob."))},s,a)})}}(0,t.__decorate)([_.nativeOverride],v,"EncodeImageAsync",null);let R=v.EncodeImageAsync;async function T(e,t,i,s,r="image/png",a,n){let o=new Uint8Array((await i.readPixels(0,0,e,t)).buffer);S(e,t,o,s,r,a,!0,void 0,n)}async function M(e,t,i,s="image/png",r,a=!1,n=!1,o){if(i instanceof Float32Array){let e=new Uint8Array(i.length),t=i.length;for(;t--;){let s=i[t];e[t]=Math.round(255*(0,d.Clamp)(s))}i=e}let h=await v.EncodeImageAsync(i,e,t,s,a,o);void 0!==r&&c.Tools.DownloadBlob(h,r),h.type!==s&&f.Logger.Warn(`DumpData: The requested mimeType '${s}' is not supported. The result has mimeType '${h.type}' instead.`);let l=await h.arrayBuffer();return n?l:`data:${s};base64,${(0,p.EncodeArrayBufferToBase64)(l)}`}function S(e,t,i,s,r="image/png",a,n=!1,o=!1,h){void 0!==a||s||(a=""),M(e,t,i,r,a,n,o,h).then(e=>{s&&s(e)})}function E(){m&&(m?.then(e=>{e.canvas instanceof HTMLCanvasElement&&e.canvas.remove(),e.dumpEngine&&(e.dumpEngine.engine.dispose(),e.dumpEngine.renderer.dispose(),e.dumpEngine.wrapper.dispose())}),m=null)}let b=!1;e.s(["Dispose",0,E,"DumpData",0,S,"DumpDataAsync",0,M,"DumpFramebuffer",0,T,"DumpTools",0,{DumpData:S,DumpDataAsync:M,DumpFramebuffer:T,Dispose:E},"EncodeImageAsync",0,R,"RegisterDumpTools",0,function(){b||(b=!0,c.Tools.DumpData=S,c.Tools.DumpDataAsync=M,c.Tools.DumpFramebuffer=T)}],37348)},35413,e=>{e.v(t=>Promise.all(["static/chunks/112hws17nz665.js"].map(t=>e.l(t))).then(()=>t(37717)))},37828,e=>{e.v(t=>Promise.all(["static/chunks/296w2ke-v5tbm.js"].map(t=>e.l(t))).then(()=>t(2689)))},49950,e=>{e.v(t=>Promise.all(["static/chunks/0dn0yx0rn6mpf.js"].map(t=>e.l(t))).then(()=>t(16681)))},21236,e=>{e.v(t=>Promise.all(["static/chunks/17q0c2h5ui10r.js"].map(t=>e.l(t))).then(()=>t(39218)))},78398,e=>{e.v(t=>Promise.all(["static/chunks/2cbmf9m7lqv6k.js"].map(t=>e.l(t))).then(()=>t(34637)))},26167,e=>{e.v(t=>Promise.all(["static/chunks/29tfeb6amdkjb.js"].map(t=>e.l(t))).then(()=>t(88647)))},7133,e=>{e.v(t=>Promise.all(["static/chunks/1a9l89j7e6mqu.js"].map(t=>e.l(t))).then(()=>t(85528)))},29574,e=>{e.v(t=>Promise.all(["static/chunks/38fhw7fatsyvd.js"].map(t=>e.l(t))).then(()=>t(49697)))},53578,e=>{e.v(t=>Promise.all(["static/chunks/3yfrsm8lfi6ls.js"].map(t=>e.l(t))).then(()=>t(95170)))},9368,e=>{e.v(t=>Promise.all(["static/chunks/0flc7nppbmsl1.js"].map(t=>e.l(t))).then(()=>t(1753)))},54745,e=>{e.v(t=>Promise.all(["static/chunks/2a3spdq-m8drh.js"].map(t=>e.l(t))).then(()=>t(74441)))},32289,e=>{e.v(t=>Promise.all(["static/chunks/0rys92_73hdb0.js"].map(t=>e.l(t))).then(()=>t(31507)))},88211,e=>{e.v(t=>Promise.all(["static/chunks/15s7425ffrec9.js"].map(t=>e.l(t))).then(()=>t(71773)))},19392,e=>{e.v(t=>Promise.all(["static/chunks/1dsy2ngmfflis.js"].map(t=>e.l(t))).then(()=>t(94597)))},35527,e=>{e.v(t=>Promise.all(["static/chunks/2xwy0-qfho1iz.js"].map(t=>e.l(t))).then(()=>t(8617)))},72206,e=>{e.v(t=>Promise.all(["static/chunks/0jmn7u31w95ly.js"].map(t=>e.l(t))).then(()=>t(7295)))},62039,e=>{e.v(t=>Promise.all(["static/chunks/35h5n42wxwgzk.js"].map(t=>e.l(t))).then(()=>t(85949)))},33558,e=>{e.v(t=>Promise.all(["static/chunks/2712627rfsmwn.js"].map(t=>e.l(t))).then(()=>t(40422)))}]);
|