r3f-performance 0.1.6 โ†’ 0.1.8

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/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ ![npm](https://img.shields.io/npm/v/r3f-performance)
2
+
1
3
  # R3F-Performance
2
4
 
3
5
  **[Changelog](https://github.com/anhldh/r3f-performace/blob/main/CHANGELOG.md)**
package/dist/index.cjs CHANGED
@@ -31,4 +31,4 @@
31
31
  *
32
32
  * This source code is licensed under the MIT license found in the
33
33
  * LICENSE file in the root directory of this source tree.
34
- */var de;function ze(){return de||(de=1,process.env.NODE_ENV!=="production"&&function(){function t(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=j,r=Ne(),o=typeof Object.is=="function"?Object.is:t,p=r.useSyncExternalStore,m=e.useRef,h=e.useEffect,f=e.useMemo,g=e.useDebugValue;Z.useSyncExternalStoreWithSelector=function(s,c,a,d,l){var i=m(null);if(i.current===null){var x={hasValue:!1,value:null};i.current=x}else x=i.current;i=f(function(){function _(S){if(!v){if(v=!0,E=S,S=d(S),l!==void 0&&x.hasValue){var w=x.value;if(l(w,S))return b=w}return b=S}if(w=b,o(E,S))return w;var C=d(S);return l!==void 0&&l(w,C)?(E=S,w):(E=S,b=C)}var v=!1,E,b,L=a===void 0?null:a;return[function(){return _(c())},L===null?void 0:function(){return _(L())}]},[c,a,d,l]);var u=p(s,i[0],i[1]);return h(function(){x.hasValue=!0,x.value=u},[u]),g(u),u},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Z}process.env.NODE_ENV==="production"?te.exports=qe():te.exports=ze();var $e=te.exports;const Ke=Ae($e),pe=t=>{let e;const r=new Set,o=(s,c)=>{const a=typeof s=="function"?s(e):s;if(!Object.is(a,e)){const d=e;e=c??(typeof a!="object"||a===null)?a:Object.assign({},e,a),r.forEach(l=>l(e,d))}},p=()=>e,f={setState:o,getState:p,getInitialState:()=>g,subscribe:s=>(r.add(s),()=>r.delete(s))},g=e=t(o,p,f);return f},Qe=t=>t?pe(t):pe,{useSyncExternalStoreWithSelector:Ye}=Ke,Xe=t=>t;function Je(t,e=Xe,r){const o=Ye(t.subscribe,t.getState,t.getInitialState,e,r);return j.useDebugValue(o),o}const he=(t,e)=>{const r=Qe(t),o=(p,m=e)=>Je(r,p,m);return Object.assign(o,r),o},Ze=(t,e)=>t?he(t,e):he,ge=t=>Symbol.iterator in t,xe=t=>"entries"in t,ye=(t,e)=>{const r=t instanceof Map?t:new Map(t.entries()),o=e instanceof Map?e:new Map(e.entries());if(r.size!==o.size)return!1;for(const[p,m]of r)if(!o.has(p)||!Object.is(m,o.get(p)))return!1;return!0},et=(t,e)=>{const r=t[Symbol.iterator](),o=e[Symbol.iterator]();let p=r.next(),m=o.next();for(;!p.done&&!m.done;){if(!Object.is(p.value,m.value))return!1;p=r.next(),m=o.next()}return!!p.done&&!!m.done};function tt(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:ge(t)&&ge(e)?xe(t)&&xe(e)?ye(t,e):et(t,e):ye({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}const re=Ze((t,e)=>{function r(){var x;const{accumulated:o,startTime:p,infos:m,estimatedMemory:h}=e(),f=(x=e().log)==null?void 0:x.maxMemory,{totalFrames:g,log:s,gl:c,max:a}=o,d={calls:c.calls/g,triangles:c.triangles/g,points:c.points/g,lines:c.lines/g},l={gpu:s.gpu/g,cpu:s.cpu/g,mem:s.mem/g,fps:s.fps/g};return{sessionTime:(window.performance.now()-p)/1e3,infos:m,memory:h,log:l,gl:d,max:a,maxMemory:f,totalFrames:g}}return{log:null,paused:!1,triggerProgramsUpdate:0,startTime:0,customData:0,fpsLimit:60,overclockingFps:!1,estimatedMemory:{vram:0,tex:0,geo:0,ram:0},accumulated:{totalFrames:0,gl:{calls:0,triangles:0,points:0,lines:0,counts:0},log:{gpu:0,cpu:0,mem:0,fps:0},max:{gl:{calls:0,triangles:0,points:0,lines:0,counts:0},log:{gpu:0,cpu:0,mem:0,fps:0}}},chart:{data:{fps:[],cpu:[],gpu:[],mem:[]},circularId:0},gl:void 0,objectWithMaterials:null,scene:void 0,programs:new Map,sceneLength:void 0,tab:"infos",getReport:r}}),I=t=>re(t,tt);Object.assign(I,re);const{getState:A,setState:M}=re,T={value:0,fpsLimit:60,isOverLimit:0},W=t=>(t==null?void 0:t.reduce((e,r)=>e+r,0))/t.length;class rt{constructor(e={}){this.names=[""],this.finished=[],this.paused=!1,this.overClock=!1,this.queryHasResult=!1,this.queryCreated=!1,this.isWebGL2=!0,this.memAccums=[],this.gpuAccums=[],this.activeAccums=[],this.logsAccums={mem:[],gpu:[],cpu:[],fps:[],fpsFixed:[]},this.fpsChart=[],this.gpuChart=[],this.cpuChart=[],this.memChart=[],this.paramLogger=()=>{},this.glFinish=()=>{},this.chartLogger=()=>{},this.chartLen=60,this.logsPerSecond=10,this.maxMemory=1500,this.chartHz=10,this.startCpuProfiling=!1,this.lastCalculateFixed=0,this.chartFrame=0,this.gpuTimeProcess=0,this.chartTime=0,this.activeQueries=0,this.circularId=0,this.detected=0,this.frameId=0,this.rafId=0,this.idleCbId=0,this.checkQueryId=0,this.uuid=void 0,this.currentCpu=0,this.currentMem=0,this.paramFrame=0,this.paramTime=0,this.now=()=>{},this.t0=0,window.GLPerf=window.GLPerf||{},Object.assign(this,e),this.fpsChart=new Array(this.chartLen).fill(0),this.gpuChart=new Array(this.chartLen).fill(0),this.cpuChart=new Array(this.chartLen).fill(0),this.memChart=new Array(this.chartLen).fill(0),this.now=()=>window.performance&&window.performance.now?window.performance.now():Date.now(),this.initGpu(),this.is120hz()}initGpu(){this.uuid=Te.MathUtils.generateUUID(),this.gl&&(this.isWebGL2=!0,this.extension||(this.extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")),this.extension===null&&(this.isWebGL2=!1))}is120hz(){let e=0;const r=o=>{++e<20?this.rafId=window.requestAnimationFrame(r):(this.detected=Math.ceil(1e3*e/(o-this.t0)/70),window.cancelAnimationFrame(this.rafId)),this.t0||(this.t0=o)};this.rafId=window.requestAnimationFrame(r)}addUI(e){this.names.indexOf(e)===-1&&(this.names.push(e),this.gpuAccums.push(0),this.activeAccums.push(!1))}nextFps(e){const r=16.666666666666668,o=r-e.timeRemaining(),p=r*T.fpsLimit/10/o;p<0||(T.value=p,T.isOverLimit<25?T.isOverLimit++:M({overclockingFps:!0}))}nextFrame(e){this.frameId++;const r=e||this.now(),o=r-this.paramTime;let p=0;if(this.frameId<=1)this.paramFrame=this.frameId,this.paramTime=r;else if(r>=this.paramTime){this.maxMemory=window.performance.memory?window.performance.memory.jsHeapSizeLimit/1048576:0;const m=this.frameId-this.paramFrame,h=m*1e3/o,f=A().overclockingFps?T.value:h;if(p=this.isWebGL2?this.gpuAccums[0]:this.gpuAccums[0]/o,this.isWebGL2?this.gpuAccums[0]=0:Promise.all(this.finished).then(()=>{this.gpuAccums[0]=0,this.finished=[]}),this.currentMem=Math.round(window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize/1048576:0),window.performance&&this.startCpuProfiling){window.performance.mark("cpu-finished");const g=performance.measure("cpu-duration","cpu-started","cpu-finished");this.currentCpu=(g==null?void 0:g.duration)||0,this.logsAccums.cpu.push(this.currentCpu),this.startCpuProfiling=!1}this.logsAccums.mem.push(this.currentMem),this.logsAccums.fpsFixed.push(h),this.logsAccums.fps.push(f),this.logsAccums.gpu.push(p),this.overClock&&typeof window.requestIdleCallback<"u"&&(T.isOverLimit>0&&f>h?T.isOverLimit--:A().overclockingFps&&M({overclockingFps:!1})),r>=this.paramTime+1e3/this.logsPerSecond&&(this.paramLogger({cpu:W(this.logsAccums.cpu),gpu:W(this.logsAccums.gpu),mem:W(this.logsAccums.mem),fps:W(this.logsAccums.fps),duration:Math.round(o),maxMemory:this.maxMemory,frameCount:m}),this.logsAccums.mem=[],this.logsAccums.fps=[],this.logsAccums.gpu=[],this.logsAccums.cpu=[],this.paramFrame=this.frameId,this.paramTime=r),this.overClock&&r-this.lastCalculateFixed>=2*1e3&&(this.lastCalculateFixed=e,T.fpsLimit=Math.round(W(this.logsAccums.fpsFixed)/10)*100,M({fpsLimit:T.fpsLimit/10}),this.logsAccums.fpsFixed=[],this.paramFrame=this.frameId,this.paramTime=r)}if(!this.detected||!this.chartFrame)this.chartFrame=this.frameId,this.chartTime=r,this.circularId=0;else{const m=r-this.chartTime;let h=this.chartHz*m/1e3;for(;--h>0&&this.detected;){const g=(this.frameId-this.chartFrame)/m*1e3,s=A().overclockingFps?T.value:g;this.fpsChart[this.circularId%this.chartLen]=s;const c=1e3/this.currentMem,a=this.currentCpu,d=(this.isWebGL2?this.gpuAccums[1]*2:Math.round(this.gpuAccums[1]/o*100))+4;d>0&&(this.gpuChart[this.circularId%this.chartLen]=d),a>0&&(this.cpuChart[this.circularId%this.chartLen]=a),c>0&&(this.memChart[this.circularId%this.chartLen]=c);for(let l=0;l<this.names.length;l++)this.chartLogger({i:l,data:{fps:this.fpsChart,gpu:this.gpuChart,cpu:this.cpuChart,mem:this.memChart},circularId:this.circularId});this.circularId++,this.chartFrame=this.frameId,this.chartTime=r}}}startGpu(){const e=this.gl,r=this.extension;if(!(!e||!r)&&this.isWebGL2){let o=!1,p,m;if(this.query){this.queryHasResult=!1;let h=this.query;if(o=e.getQueryParameter(h,e.QUERY_RESULT_AVAILABLE),p=e.getParameter(r.GPU_DISJOINT_EXT),o&&!p){m=e.getQueryParameter(this.query,e.QUERY_RESULT);const f=m*1e-6;(o||p)&&(e.deleteQuery(this.query),h=null),o&&f>0&&(p||this.activeAccums.forEach((g,s)=>{this.gpuAccums[s]=f}))}}(o||!this.query)&&(this.queryCreated=!0,this.query=e.createQuery(),e.beginQuery(r.TIME_ELAPSED_EXT,this.query))}}endGpu(){const e=this.extension,r=this.gl;this.isWebGL2&&this.queryCreated&&r.getQuery(e.TIME_ELAPSED_EXT,r.CURRENT_QUERY)&&r.endQuery(e.TIME_ELAPSED_EXT)}begin(e){this.startGpu(),this.updateAccums(e)}end(e){this.endGpu(),this.updateAccums(e)}updateAccums(e){let r=this.names.indexOf(e);r===-1&&(r=this.names.length,this.addUI(e));const o=this.now();this.activeAccums[r]=!this.activeAccums[r],this.t0=o}dispose(){const e=this.gl,r=this.extension;try{this.isWebGL2&&e&&r&&e.getQuery(r.TIME_ELAPSED_EXT,e.CURRENT_QUERY)&&e.endQuery(r.TIME_ELAPSED_EXT)}catch{}if(e&&this.query){try{e.deleteQuery(this.query)}catch{}this.query=null}this.queryCreated=!1,this.queryHasResult=!1}}const st=t=>{t.forEach(e=>{const{meshes:r}=e;if(!r)return;const o={total:0,type:"Triangle",data:[]};Object.keys(r).forEach(p=>{const m=r[p],{geometry:h,material:f}=m,g=h.index,s=h.attributes.position;if(!s)return;let c=1;f.wireframe===!0&&(c=0);const a=g!==null?g.count:s.count,d=h.drawRange.start*c,l=h.drawRange.count*c,i=d,x=Math.min(a,d+l)-1;let u=1;const _=m.count||1;let v="Triangle",E=0;m.isMesh?f.wireframe===!0?(v="Line",u=u/2):(v="Triangle",u=u/3):m.isLine?(v="Line",m.isLineSegments?u=u/2:m.isLineLoop?u=u:u=u-1):m.isPoints?(v="Point",u=u):m.isSprite&&(v="Triangle",u=u/3);const b=Math.round(Math.max(0,x-i+1)*(u*_));b>E&&(E=b,o.type=v),o.total+=b,o.data.push({drawCount:b,type:v}),m.userData.drawCount={type:v,count:b}}),e.drawCounts=o})};var Fe={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(r=!1));function p(g,s,c){this.fn=g,this.context=s,this.once=c||!1}function m(g,s,c,a,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var l=new p(c,a||g,d),i=r?r+s:s;return g._events[i]?g._events[i].fn?g._events[i]=[g._events[i],l]:g._events[i].push(l):(g._events[i]=l,g._eventsCount++),g}function h(g,s){--g._eventsCount===0?g._events=new o:delete g._events[s]}function f(){this._events=new o,this._eventsCount=0}f.prototype.eventNames=function(){var s=[],c,a;if(this._eventsCount===0)return s;for(a in c=this._events)e.call(c,a)&&s.push(r?a.slice(1):a);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(c)):s},f.prototype.listeners=function(s){var c=r?r+s:s,a=this._events[c];if(!a)return[];if(a.fn)return[a.fn];for(var d=0,l=a.length,i=new Array(l);d<l;d++)i[d]=a[d].fn;return i},f.prototype.listenerCount=function(s){var c=r?r+s:s,a=this._events[c];return a?a.fn?1:a.length:0},f.prototype.emit=function(s,c,a,d,l,i){var x=r?r+s:s;if(!this._events[x])return!1;var u=this._events[x],_=arguments.length,v,E;if(u.fn){switch(u.once&&this.removeListener(s,u.fn,void 0,!0),_){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,c),!0;case 3:return u.fn.call(u.context,c,a),!0;case 4:return u.fn.call(u.context,c,a,d),!0;case 5:return u.fn.call(u.context,c,a,d,l),!0;case 6:return u.fn.call(u.context,c,a,d,l,i),!0}for(E=1,v=new Array(_-1);E<_;E++)v[E-1]=arguments[E];u.fn.apply(u.context,v)}else{var b=u.length,L;for(E=0;E<b;E++)switch(u[E].once&&this.removeListener(s,u[E].fn,void 0,!0),_){case 1:u[E].fn.call(u[E].context);break;case 2:u[E].fn.call(u[E].context,c);break;case 3:u[E].fn.call(u[E].context,c,a);break;case 4:u[E].fn.call(u[E].context,c,a,d);break;default:if(!v)for(L=1,v=new Array(_-1);L<_;L++)v[L-1]=arguments[L];u[E].fn.apply(u[E].context,v)}}return!0},f.prototype.on=function(s,c,a){return m(this,s,c,a,!1)},f.prototype.once=function(s,c,a){return m(this,s,c,a,!0)},f.prototype.removeListener=function(s,c,a,d){var l=r?r+s:s;if(!this._events[l])return this;if(!c)return h(this,l),this;var i=this._events[l];if(i.fn)i.fn===c&&(!d||i.once)&&(!a||i.context===a)&&h(this,l);else{for(var x=0,u=[],_=i.length;x<_;x++)(i[x].fn!==c||d&&!i[x].once||a&&i[x].context!==a)&&u.push(i[x]);u.length?this._events[l]=u.length===1?u[0]:u:h(this,l)}return this},f.prototype.removeAllListeners=function(s){var c;return s?(c=r?r+s:s,this._events[c]&&h(this,c)):(this._events=new o,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=r,f.EventEmitter=f,t.exports=f})(Fe);var nt=Fe.exports;const it=Ae(nt),se=new it;function at(t,e,r){return se.on(t,e)}function ot(t,e,r){se.removeListener(t,e,(r==null?void 0:r.context)??null,r==null?void 0:r.once)}function ct(t,e){se.emit(t,e)}function lt(t){let e=0,r=0;const o=new Set,p=new Set;return t.traverse(m=>{if(m.isMesh){const h=m;if(h.geometry&&!o.has(h.geometry.uuid)){o.add(h.geometry.uuid);const s=h.geometry.attributes;for(const c in s){const a=s[c];a.array&&(r+=a.array.byteLength)}h.geometry.index&&h.geometry.index.array&&(r+=h.geometry.index.array.byteLength)}const f=h.material;(Array.isArray(f)?f:[f]).forEach(s=>{if(s)for(const c in s){const a=s[c];if(a&&a.isTexture){const d=a;if(!p.has(d.uuid)){if(p.add(d.uuid),d.isCompressedTexture&&d.mipmaps)d.mipmaps.forEach(l=>{l.data&&(e+=l.data.byteLength)});else if(d.image){const l=d.image,i=l.width||0,x=l.height||0,u=d.generateMipmaps?1.33:1;e+=i*x*4*u}}}}})}}),{geometry:r,texture:e,total:r+e}}const ve=O.Object3D.prototype.updateMatrixWorld,_e=O.Object3D.prototype.updateWorldMatrix,Ee=O.Object3D.prototype.updateMatrix,je=["calls","triangles","points","lines"],be=["gpu","cpu","mem","fps"],ut=t=>/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t),Se=(t,e)=>{t.defines||(t.defines={}),t.defines.muiPerf||(t.defines=Object.assign(t.defines||{},{muiPerf:t.uuid}),t.needsUpdate=!0);const r=t.uuid;return e[r]||(e[r]={meshes:{},material:t}),t.needsUpdate=!1,r},ft=t=>t==="muiPerf",mt=({overClock:t,logsPerSecond:e,chart:r,deepAnalyze:o,matrixUpdate:p})=>{const{gl:m,scene:h}=N.useThree();M({gl:m,scene:h});const f=1e3;let g=0;const s=j.useMemo(()=>{const c=new rt({trackGPU:!0,overClock:t,chartLen:r?r.length:120,chartHz:r?r.hz:60,logsPerSecond:e||10,gl:m.getContext(),chartLogger:u=>{M({chart:u})},paramLogger:u=>{var L;const _={maxMemory:u.maxMemory,gpu:u.gpu,cpu:u.cpu,mem:u.mem,fps:u.fps,totalTime:u.duration,frameCount:u.frameCount};M({log:_});const{accumulated:v}=A(),E=m.info.render;v.totalFrames++,v.gl.calls+=E.calls,v.gl.triangles+=E.triangles,v.gl.points+=E.points,v.gl.lines+=E.lines,v.log.gpu+=u.gpu,v.log.cpu+=u.cpu,v.log.mem+=u.mem,v.log.fps+=u.fps;for(let S=0;S<je.length;S++){const w=je[S],C=E[w];C>v.max.gl[w]&&(v.max.gl[w]=C)}for(let S=0;S<be.length;S++){const w=be[S],C=u[w];C>v.max.log[w]&&(v.max.log[w]=C)}M({accumulated:v});const b={calls:m.info.render.calls,triangles:m.info.render.triangles,points:m.info.render.points,lines:m.info.render.lines,geometries:m.info.memory.geometries,textures:m.info.memory.textures,programs:((L=m.info.programs)==null?void 0:L.length)||0};ct("log",[_,b])}}),a=m.getContext();let d=null,l=null;const i=a.getExtension("WEBGL_debug_renderer_info"),x=a.getParameter(a.VERSION);return i&&(d=a.getParameter(i.UNMASKED_RENDERER_WEBGL),l=a.getParameter(i.UNMASKED_VENDOR_WEBGL)),l||(l="Unknown vendor"),d||(d=a.getParameter(a.RENDERER)),M({startTime:window.performance.now(),infos:{version:x,renderer:d,vendor:l}}),c},[t,r,e,m]);return j.useEffect(()=>{s&&(s.overClock=t||!1,t===!1&&(M({overclockingFps:!1}),T.value=0,T.isOverLimit=0),s.chartHz=(r==null?void 0:r.hz)||60,s.chartLen=(r==null?void 0:r.length)||120)},[s,t,r==null?void 0:r.hz,r==null?void 0:r.length]),j.useEffect(()=>{if(!m.info)return;m.info.autoReset=!1,p&&(O.Object3D.prototype.updateMatrixWorld=function(...d){return this.matrixWorldNeedsUpdate||d[0],ve.apply(this,d)},O.Object3D.prototype.updateWorldMatrix=function(...d){return _e.apply(this,d)},O.Object3D.prototype.updateMatrix=function(...d){return Ee.apply(this,d)});const c=N.addEffect(()=>{A().paused&&M({paused:!1}),s==null||s.begin("profiler"),window.performance&&(window.performance.mark("cpu-started"),s.startCpuProfiling=!0),m.info.reset()}),a=N.addAfterEffect(()=>{var x,u;s==null||s.end("profiler"),s&&!s.paused&&(s.nextFrame(window.performance.now()),t&&typeof window.requestIdleCallback<"u"&&(s.idleCbId=requestIdleCallback(s.nextFps)));const d=window.performance.now();if(d-g>f){g=d;const _=lt(h),v=s.currentMem||0;M({estimatedMemory:{vram:_.total/1024/1024,tex:_.texture/1024/1024,geo:_.geometry/1024/1024,ram:v}})}if(!o)return;const l={},i=new Map;h.traverse(_=>{if(_ instanceof O.Mesh||_ instanceof O.Points){if(!_.material)return;let v=_.material.uuid;const E=Array.isArray(_.material)&&_.material.length>1;v=Se(E?_.material[1]:_.material,l),l[v].meshes[_.uuid]=_}}),(u=(x=m==null?void 0:m.info)==null?void 0:x.programs)==null||u.forEach(_=>{const v=_.cacheKey.split(","),E=v[v.findIndex(ft)+1];if(ut(E)&&l[E]){const{material:b,meshes:L}=l[E];i.set(E,{program:_,material:b,meshes:L,drawCounts:{total:0,type:"triangle",data:[]},expand:!1,visible:!0})}}),i.size!==A().programs.size&&(st(i),M({programs:i,triggerProgramsUpdate:A().triggerProgramsUpdate+1}))});return()=>{var d;s&&typeof window.cancelIdleCallback<"u"&&window.cancelIdleCallback(s.idleCbId),(d=s==null?void 0:s.dispose)==null||d.call(s),p&&(O.Object3D.prototype.updateMatrixWorld=ve,O.Object3D.prototype.updateWorldMatrix=_e,O.Object3D.prototype.updateMatrix=Ee),c(),a()}},[s,m,h,o,t,p]),j.useEffect(()=>{const c=N.addTail(()=>(s&&(s.paused=!0,M({paused:!0,log:{maxMemory:0,gpu:0,mem:0,cpu:0,fps:0,totalTime:0,frameCount:0}})),!1));return()=>c()},[s]),null};function ne(t,e,r=[],o){const p=j.useRef(e);j.useEffect(()=>{p.current=e},[e]),j.useEffect(()=>{const m=f=>{var g;return(g=p.current)==null?void 0:g.call(p,f)},h=at(t,m);return()=>ot(t,m,{...o,context:h})},[t,o==null?void 0:o.once,...r])}function dt(t){let e=0;for(const o in t.attributes){const p=t.getAttribute(o);e+=p.count*p.itemSize*p.array.BYTES_PER_ELEMENT}const r=t.getIndex();return e+=r?r.count*r.itemSize*r.array.BYTES_PER_ELEMENT:0,e}const pt="_perfS_ans5i_1",ht="_containerHeight_ans5i_16",gt="_topLeft_ans5i_21",xt="_topRight_ans5i_22",yt="_bottomLeft_ans5i_23",vt="_bottomRight_ans5i_24",_t="_minimal_ans5i_26",Et="_perfIContainer_ans5i_30",jt="_perfI_ans5i_30",bt="_perfB_ans5i_69",St="_toggleContainer_ans5i_83",wt="_toggle_ans5i_83",Lt="_activeTab_ans5i_105",Ct="_containerScroll_ans5i_110",Ot="_programGeo_ans5i_115",Mt="_programHeader_ans5i_120",It="_headerLeft_ans5i_149",Tt="_programTitle_ans5i_156",Rt="_toggleArrow_ans5i_166",At="_programConsole_ans5i_200",Nt="_programsContainer_ans5i_218",Ft="_headerRight_ans5i_222",Pt="_metricBadge_ans5i_228",Dt="_programsULHeader_ans5i_246",Ut="_programsUL_ans5i_246",Gt="_programsGeoLi_ans5i_309",Wt="_graph_ans5i_324",Bt="_visibilityBtn_ans5i_354",Ht="_active_ans5i_105",y={perfS:pt,containerHeight:ht,topLeft:gt,topRight:xt,bottomLeft:yt,bottomRight:vt,minimal:_t,perfIContainer:Et,perfI:jt,perfB:bt,toggleContainer:St,toggle:wt,activeTab:Lt,containerScroll:Ct,programGeo:Ot,programHeader:Mt,headerLeft:It,programTitle:Tt,toggleArrow:Rt,programConsole:At,programsContainer:Nt,headerRight:Ft,metricBadge:Pt,programsULHeader:Dt,programsUL:Ut,programsGeoLi:Gt,graph:Wt,visibilityBtn:Bt,active:Ht},we=(t,e)=>{var p,m;const r=h=>{switch(h){case 1e3:return"RepeatWrapping";case 1001:return"ClampToEdgeWrapping";case 1002:return"MirroredRepeatWrapping";default:return"ClampToEdgeWrapping"}},o=h=>{switch(h){case 3e3:return"LinearEncoding";case 3001:return"sRGBEncoding";case 3002:return"RGBEEncoding";case 3003:return"LogLuvEncoding";case 3004:return"RGBM7Encoding";case 3005:return"RGBM16Encoding";case 3006:return"RGBDEncoding";case 3007:return"GammaEncoding";default:return"ClampToEdgeWrapping"}};return{name:t,url:(p=e==null?void 0:e.image)==null?void 0:p.currentSrc,encoding:o(e.encoding),wrapT:r(e.wrapT),flipY:(m=e.flipY)==null?void 0:m.toString()}},ee=({value:t,label:e,unit:r,title:o})=>t==null||t===0||t==="0"?null:n.jsxs("div",{className:y.metricBadge,title:o,children:[n.jsx("b",{children:t})," ",r||e]}),Vt=({program:t,material:e,setTexNumber:r})=>{const o=I(h=>h.gl),[p,m]=j.useState(null);return j.useEffect(()=>{if(o){const h=t==null?void 0:t.getUniforms();let f=0;const g=new Map;h&&h.seq&&h.seq.forEach(s=>{if(!s.id.includes("uTroika")&&!["isOrthographic","uvTransform","lightProbe","projectionMatrix","viewMatrix","normalMatrix","modelMatrix","modelViewMatrix"].includes(s.id)){const c=[],a={name:s.id};s.cache&&(s.cache.forEach(d=>{typeof d<"u"&&c.push(d.toString().substring(0,4))}),a.value=c.join(),e[s.id]&&e[s.id].image&&(f++,a.value=we(s.id,e[s.id])),a.value||(a.value="empty"),g.set(s.id,a))}}),e.uniforms&&Object.keys(e.uniforms).forEach(s=>{const c=e.uniforms[s];if(c.value){const{value:a}=c,d={name:s};if(s.includes("uTroika"))return;if(a.isTexture)f++,d.value=we(s,a);else{let l=JSON.stringify(a);try{l=JSON.stringify(a)}catch{l=a.toString()}d.value=l}g.set(s,d)}}),r(f),m(g)}},[o,e,t,r]),n.jsx("ul",{className:y.programsUL,children:p&&Array.from(p.values()).map(h=>n.jsx("span",{children:typeof h.value=="string"?n.jsx("li",{children:n.jsxs("span",{children:[h.name," :"," ",n.jsxs("b",{children:[h.value.substring(0,30),h.value.length>30?"...":""]})]})}):n.jsxs(n.Fragment,{children:[n.jsx("li",{children:n.jsxs("b",{children:[h.value.name,":"]})}),n.jsxs("div",{children:[Object.keys(h.value).map(f=>f!=="name"?n.jsx("div",{children:f==="url"?n.jsx("a",{href:h.value[f],target:"_blank",rel:"noreferrer",children:n.jsx("img",{src:h.value[f],alt:"texture"})}):n.jsxs("li",{children:[f,": ",n.jsx("b",{children:h.value[f]})]})},f):null),n.jsxs("button",{className:y.programConsole,onClick:()=>{var f;console.info(e[h.value.name]||((f=e==null?void 0:e.uniforms[h.value.name])==null?void 0:f.value))},children:["console.info(",h.value.name,");"]})]})]})},h.name))})},kt=({el:t})=>{const[e,r]=j.useState(t.visible),[o,p]=j.useState(t.expand),[m,h]=j.useState(0),{meshes:f,program:g,material:s}=t,c=I(i=>i.gl),a=()=>{if(!c||!c.info||!c.info.render)return 0;const i=c.info.render.triangles+c.info.render.lines+c.info.render.points;if(i===0)return 0;const x=Math.round(t.drawCounts.total/i*100*10)/10;return isFinite(x)&&x||0},d=Object.keys(f).length,l=a();return n.jsxs("div",{className:y.programGeo,children:[n.jsxs("div",{className:y.programHeader,onClick:()=>{Object.keys(f).forEach(i=>{f[i].material.wireframe=!1}),p(!o)},children:[n.jsxs("div",{className:y.headerLeft,children:[n.jsx("div",{className:y.toggleArrow,style:{transform:o?"rotate(90deg)":"rotate(0deg)"},children:"โ–ถ"}),g&&n.jsx("span",{className:y.programTitle,children:g.name})]}),n.jsxs("div",{className:y.headerRight,children:[n.jsx(ee,{value:d,unit:d>1?"users":"user"}),n.jsx(ee,{value:m,unit:"tex"}),t.drawCounts.total>0&&n.jsxs("div",{className:y.metricBadge,title:`${l}% of total render`,children:[n.jsx("b",{children:t.drawCounts.total}),t.drawCounts.type==="Triangle"?"tris":t.drawCounts.type,t.visible&&!t.material.wireframe&&n.jsxs("span",{style:{marginLeft:"4px",opacity:.6,fontSize:"9px"},children:["(",l,"%)"]})]}),s.glslVersion==="300 es"&&n.jsx(ee,{value:"300",unit:"es"}),n.jsx("div",{className:`${y.visibilityBtn} ${e?y.active:""}`,onPointerEnter:()=>{Object.keys(f).forEach(i=>f[i].material.wireframe=!0)},onPointerLeave:()=>{Object.keys(f).forEach(i=>f[i].material.wireframe=!1)},onClick:i=>{i.stopPropagation();const x=!e;Object.keys(f).forEach(u=>{f[u]&&(f[u].visible=x)}),r(x)},children:e?"๐Ÿ‘":"ร—"})]})]}),n.jsxs("div",{style:{display:o?"block":"none"},children:[n.jsx("div",{className:y.programsULHeader,style:{marginTop:"4px"},children:"Uniforms"}),n.jsx(Vt,{program:g,material:s,setTexNumber:h}),n.jsx("div",{className:y.programsULHeader,children:"Geometries"}),n.jsx("ul",{className:y.programsUL,children:f&&Object.keys(f).map(i=>f[i]&&f[i].geometry&&n.jsx("li",{className:y.programsGeoLi,children:n.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[n.jsx("span",{children:f[i].geometry.type}),f[i].userData&&f[i].userData.drawCount&&n.jsxs("span",{style:{color:"#aaa",fontSize:"10px",display:"flex",gap:"6px"},children:[n.jsxs("span",{children:[n.jsx("b",{children:f[i].userData.drawCount.count})," ",f[i].userData.drawCount.type,"s"]}),n.jsx("span",{style:{opacity:.3},children:"|"}),n.jsxs("span",{children:[n.jsx("b",{children:Math.round(dt(f[i].geometry)/1024*100)/100})," ","KB"]})]})]})},i))}),n.jsxs("button",{className:y.programConsole,onClick:()=>console.info(s),children:["Log Material (",s.type,")"]})]})]})},qt=()=>{I(e=>e.triggerProgramsUpdate);const t=I(e=>e.programs);return n.jsx("div",{className:y.programsContainer,onWheel:e=>e.stopPropagation(),children:t&&Array.from(t.values()).map(e=>e?n.jsx(kt,{el:e},e.material.uuid):null)})},zt=({minimal:t,chart:e={length:120,hz:60}})=>{const r=j.useMemo(()=>({fps:new Float32Array(e.length*3),cpu:new Float32Array(e.length*3),gpu:new Float32Array(e.length*3)}),[e]),o=j.useRef(null),p=j.useRef(null),m=j.useRef(null),h=j.useRef(null),f=j.useMemo(()=>new O.Vector3(0,0,0),[]),g=(s,c=1,a,d)=>{let l=0;const{width:i,height:x}=d,u=A().chart.data[s];if(!u||u.length===0)return;const _=t?2:6,v=t?12:50,E=u.length;for(let b=0;b<E;b++){const L=(A().chart.circularId+b+1)%E;u[L]!==void 0&&(u[L]>l&&(l=u[L]*c),f.set(_+b/(E-1)*(i-_*2)-i/2,Math.min(100,u[L])*c/100*(x-_*2-v)-x/2,0),f.toArray(a.attributes.position.array,b*3))}a.attributes.position.needsUpdate=!0};return N.useFrame(function({viewport:c}){g("fps",1,o.current,c),p.current&&p.current.color.set(A().overclockingFps?R.overClock:R.fps),g("gpu",5,m.current,c),g("cpu",5,h.current,c)}),n.jsxs(n.Fragment,{children:[n.jsxs("line",{onUpdate:s=>{s.updateMatrix(),s.matrixWorld.copy(s.matrix)},children:[n.jsx("bufferGeometry",{ref:o,children:n.jsx("bufferAttribute",{attach:"attributes-position",count:e.length,args:[r.fps,3],array:r.fps,itemSize:3,usage:O.DynamicDrawUsage,needsUpdate:!0})}),n.jsx("lineBasicMaterial",{ref:p,color:R.fps,transparent:!0,opacity:.5})]}),n.jsxs("line",{onUpdate:s=>{s.updateMatrix(),s.matrixWorld.copy(s.matrix)},children:[n.jsx("bufferGeometry",{ref:m,children:n.jsx("bufferAttribute",{attach:"attributes-position",count:e.length,array:r.gpu,args:[r.gpu,3],itemSize:3,usage:O.DynamicDrawUsage,needsUpdate:!0})}),n.jsx("lineBasicMaterial",{color:R.gpu,transparent:!0,opacity:.5})]}),n.jsxs("line",{onUpdate:s=>{s.updateMatrix(),s.matrixWorld.copy(s.matrix)},children:[n.jsx("bufferGeometry",{ref:h,children:n.jsx("bufferAttribute",{attach:"attributes-position",count:e.length,array:r.cpu,args:[r.cpu,3],itemSize:3,usage:O.DynamicDrawUsage,needsUpdate:!0})}),n.jsx("lineBasicMaterial",{color:R.cpu,transparent:!0,opacity:.5})]})]})},$t=({chart:t,showGraph:e=!0,antialias:r=!0,minimal:o})=>{const p=j.useRef(void 0),m=I(h=>h.paused);return n.jsx("div",{className:y.graph,style:{display:"flex",marginTop:6,position:"absolute",width:"100%",height:`${o?37:e?100:60}px`},children:n.jsx(N.Canvas,{ref:p,orthographic:!0,camera:{rotation:[0,0,0]},dpr:r?[1,2]:1,gl:{antialias:!0,alpha:!0,stencil:!1,depth:!1},onCreated:({scene:h})=>{h.traverse(f=>{f.matrixWorldAutoUpdate=!1,f.matrixAutoUpdate=!1})},flat:!0,style:{marginBottom:"-42px",position:"relative",pointerEvents:"none",background:"transparent !important",width:"100%",height:`${o?37:e?100:60}px`},children:m?null:n.jsxs(n.Fragment,{children:[n.jsx(Kt,{}),e&&n.jsx(zt,{minimal:o,chart:t})]})})})},Kt=()=>(N.useFrame(function({gl:e,scene:r,camera:o}){o.updateMatrix(),o.matrixWorld.copy(o.matrix),o.matrixWorldInverse.copy(o.matrixWorld).invert(),e.render(r,o)},1/0),null),Le={fps:{fg:"#00ffff",bg:"#000022"},cpu:{fg:"#00ff00",bg:"#002200"},gpu:{fg:"#ff0080",bg:"#220011"}},D=[{key:"fps",label:"FPS",maxVal:120},{key:"cpu",label:"CPU",maxVal:40},{key:"gpu",label:"GPU",maxVal:40}],U=48,Pe=15,z=2,H=Pe,B=U-H-2,$=6,Qt=15,Ce=1e3/Qt;function Yt({show:t=!0,opacity:e=1,className:r,style:o}){const p=I(l=>l.paused),m=j.useRef(null),h=j.useRef(null),[f,g]=j.useState(300),s=j.useMemo(()=>Math.max(1,Math.round(window.devicePixelRatio||1)),[]);j.useEffect(()=>{if(!h.current)return;const l=new ResizeObserver(i=>{for(const x of i)g(x.contentRect.width)});return l.observe(h.current),()=>l.disconnect()},[]);const c=(D.length-1)*$,a=Math.max(0,(f-c)/D.length),d=Math.max(0,a-z);return j.useEffect(()=>{const l=m.current;if(!l)return;l.width=f*s,l.height=U*s,l.style.width="100%",l.style.height=`${U}px`;const i=l.getContext("2d");if(i){i.setTransform(1,0,0,1,0,0),i.scale(s,s),i.imageSmoothingEnabled=!1,i.font="bold 9px Roboto Mono, monospace",i.textBaseline="top",i.clearRect(0,0,f,U);for(let x=0;x<D.length;x++){const{key:u}=D[x],_=x*(a+$),{bg:v}=Le[u];i.fillStyle=v,i.globalAlpha=e,i.fillRect(_,0,a,U),i.globalAlpha=1}}},[s,f,a,e]),j.useEffect(()=>{if(!t)return;const l=m.current;if(!l)return;const i=l.getContext("2d");if(!i)return;let x=0,u=0;const _={fps:{min:1/0,max:0},cpu:{min:1/0,max:0},gpu:{min:1/0,max:0}};function v(E){if(!l||!i||(x=requestAnimationFrame(v),p))return;const b=E-u;if(b<Ce)return;u=E-b%Ce;const L=A(),S=L.chart.circularId;for(let w=0;w<D.length;w++){const{key:C,label:De,maxVal:ie}=D[w],G=w*(a+$),{fg:ae,bg:oe}=Le[C],V=L.chart.data[C],K=(V==null?void 0:V.length)||0;let k=0;if(K>0){const We=(S-1+K)%K;k=V[We]??0}const P=_[C];P.min=Math.min(P.min,k),P.max=Math.max(P.max,k),i.fillStyle=oe,i.globalAlpha=1,i.fillRect(G,0,a,Pe),i.fillStyle=ae;const Ue=`${De} (${Math.round(P.min)}-${Math.round(P.max)})`;i.fillText(Ue,G+3,2),d>1&&i.drawImage(l,(G+z+1)*s,H*s,(d-1)*s,B*s,G+z,H,d-1,B);const ce=G+z+d-1;i.fillStyle=oe,i.globalAlpha=1,i.fillRect(ce,H,1,B),i.fillStyle=ae,i.globalAlpha=1;const Ge=Math.min(k,ie)/ie,Q=Math.round(Ge*B);Q>0&&i.fillRect(ce,H+B-Q,1,Q)}}return x=requestAnimationFrame(v),()=>cancelAnimationFrame(x)},[p,t,s,a,d]),t?n.jsx("div",{ref:h,className:r,style:{width:"100%",...o,marginTop:$},children:n.jsx("canvas",{ref:m,style:{display:"block",pointerEvents:"none",width:"100%",height:`${U}px`}})}):null}const R={overClock:"#ff6eff",fps:"#00FFFF",cpu:"#00FF00",gpu:"#FD007F",memory:"#FFD000",vram:"#FF8C00"},Oe=({metric:t,decimal:e=0,suffix:r=""})=>{const o=j.useRef(null);return ne("log",p=>{const[m]=p;if(m&&o.current){const h=m[t];o.current.innerText=(typeof h=="number"?h.toFixed(e):"0")+r}}),n.jsxs("span",{ref:o,children:["0",r]})},F=({metric:t,suffix:e=""})=>{const r=j.useRef(null);return ne("log",o=>{const[,p]=o;if(p&&r.current){let m=p[t];t==="calls"&&m===1&&(m="--"),r.current.innerText=m+e}}),n.jsxs("span",{ref:r,children:["0",e]})},Me=({type:t})=>{const e=I(r=>r.estimatedMemory[t]);return n.jsxs("span",{children:[e.toFixed(0)," MB"]})},Xt=()=>{const t=I(p=>p.overclockingFps),e=I(p=>p.fpsLimit),r=j.useRef(null);ne("log",p=>{const[m]=p;m&&r.current&&(r.current.innerText=Math.round(m.fps).toString())});const o=t?R.overClock:R.fps;return n.jsxs("div",{className:y.perfI,children:[n.jsxs("span",{className:y.perfB,style:{color:o},children:["FPS ",t?` ${e}๐Ÿš€`:""]}),n.jsx("small",{className:y.perfSmallI,ref:r,children:"0"})]})},Jt=({showGraph:t,minimal:e})=>I(o=>o.gl)?n.jsxs("div",{className:y.perfIContainer,children:[n.jsx(Xt,{showGraph:t}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,style:{color:R.cpu},children:"CPU"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(Oe,{metric:"cpu",decimal:2,suffix:" ms"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,style:{color:R.gpu},children:"GPU"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(Oe,{metric:"gpu",decimal:2,suffix:" ms"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,style:{color:R.memory},children:"MEMORY"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(Me,{type:"ram"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,style:{color:R.vram},children:"VRAM"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(Me,{type:"vram"})})]}),!e&&n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Calls"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"calls"})})]})]}):null,Zt=({matrixUpdate:t})=>n.jsxs("div",{className:y.perfIContainer,children:[n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Geometries"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"geometries"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Textures"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"textures"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Shaders"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"programs"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Triangles"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"triangles"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Lines"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"lines"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Points"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"points"})})]}),t&&n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Matrices"}),n.jsx("small",{className:y.perfSmallI,children:t})]})]}),Ie=({tab:t,title:e,set:r})=>{const o=I(p=>p.tab);return n.jsx("div",{className:`${y.toggle} ${o===t?y.activeTab:""}`,onClick:()=>{r(!0),M({tab:t})},children:e})},er=({openByDefault:t,showGraph:e,deepAnalyze:r,matrixUpdate:o,graphType:p,perfContainerRef:m,antialias:h,chart:f,minimal:g})=>{const[s,c]=j.useState(t||!1),a=I(d=>d.tab);return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:s?"block":"none",marginTop:"4px"},children:[n.jsx(Zt,{matrixUpdate:o}),e&&(p==="bar"?n.jsx(Yt,{}):n.jsx($t,{perfContainerRef:m,chart:f,showGraph:e,antialias:h,minimal:g,matrixUpdate:o})),s&&n.jsx("div",{className:y.containerScroll,children:a==="programs"&&n.jsx(qt,{})})]}),t&&!r?null:n.jsxs("div",{className:y.toggleContainer,style:s&&e&&p==="line"?{marginTop:50}:{marginTop:6},children:[r&&n.jsx(Ie,{tab:"programs",title:"Programs",set:c}),r&&n.jsx(Ie,{tab:"infos",title:"Infos",set:c}),n.jsx("div",{className:y.toggle,onClick:()=>c(!s),children:s?"Minimize":"More"})]})]})},tr=({showGraph:t=!0,openByDefault:e=!0,className:r,overClock:o=!1,graphType:p="bar",style:m,position:h="top-right",chart:f,logsPerSecond:g,deepAnalyze:s=!1,antialias:c=!0,matrixUpdate:a,minimal:d})=>{const l=j.useRef(null),i=h==="top-left"?y.topLeft:h==="bottom-left"?y.bottomLeft:h==="bottom-right"?y.bottomRight:y.topRight,x=t&&p==="line"&&!s;return n.jsxs(n.Fragment,{children:[n.jsx(mt,{logsPerSecond:g,chart:f,overClock:o,deepAnalyze:s,matrixUpdate:a}),n.jsx(Re,{name:"r3f-perf",children:n.jsxs("div",{className:`${y.perfS} ${i} ${d?y.minimal:""} ${r||""} ${x?y.containerHeight:""}`,style:m,ref:l,children:[n.jsx(Jt,{showGraph:t,minimal:d}),!d&&n.jsx(er,{showGraph:t,deepAnalyze:s,matrixUpdate:a,openByDefault:e,graphType:p,perfContainerRef:l,antialias:c,chart:f,minimal:d})]})})]})};exports.PerfMonitor=tr;
34
+ */var de;function ze(){return de||(de=1,process.env.NODE_ENV!=="production"&&function(){function t(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=j,r=Ne(),o=typeof Object.is=="function"?Object.is:t,p=r.useSyncExternalStore,m=e.useRef,h=e.useEffect,f=e.useMemo,g=e.useDebugValue;Z.useSyncExternalStoreWithSelector=function(s,c,a,d,l){var i=m(null);if(i.current===null){var x={hasValue:!1,value:null};i.current=x}else x=i.current;i=f(function(){function _(S){if(!v){if(v=!0,E=S,S=d(S),l!==void 0&&x.hasValue){var w=x.value;if(l(w,S))return b=w}return b=S}if(w=b,o(E,S))return w;var C=d(S);return l!==void 0&&l(w,C)?(E=S,w):(E=S,b=C)}var v=!1,E,b,L=a===void 0?null:a;return[function(){return _(c())},L===null?void 0:function(){return _(L())}]},[c,a,d,l]);var u=p(s,i[0],i[1]);return h(function(){x.hasValue=!0,x.value=u},[u]),g(u),u},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Z}process.env.NODE_ENV==="production"?te.exports=qe():te.exports=ze();var $e=te.exports;const Ke=Ae($e),pe=t=>{let e;const r=new Set,o=(s,c)=>{const a=typeof s=="function"?s(e):s;if(!Object.is(a,e)){const d=e;e=c??(typeof a!="object"||a===null)?a:Object.assign({},e,a),r.forEach(l=>l(e,d))}},p=()=>e,f={setState:o,getState:p,getInitialState:()=>g,subscribe:s=>(r.add(s),()=>r.delete(s))},g=e=t(o,p,f);return f},Qe=t=>t?pe(t):pe,{useSyncExternalStoreWithSelector:Ye}=Ke,Xe=t=>t;function Je(t,e=Xe,r){const o=Ye(t.subscribe,t.getState,t.getInitialState,e,r);return j.useDebugValue(o),o}const he=(t,e)=>{const r=Qe(t),o=(p,m=e)=>Je(r,p,m);return Object.assign(o,r),o},Ze=(t,e)=>t?he(t,e):he,ge=t=>Symbol.iterator in t,xe=t=>"entries"in t,ye=(t,e)=>{const r=t instanceof Map?t:new Map(t.entries()),o=e instanceof Map?e:new Map(e.entries());if(r.size!==o.size)return!1;for(const[p,m]of r)if(!o.has(p)||!Object.is(m,o.get(p)))return!1;return!0},et=(t,e)=>{const r=t[Symbol.iterator](),o=e[Symbol.iterator]();let p=r.next(),m=o.next();for(;!p.done&&!m.done;){if(!Object.is(p.value,m.value))return!1;p=r.next(),m=o.next()}return!!p.done&&!!m.done};function tt(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:ge(t)&&ge(e)?xe(t)&&xe(e)?ye(t,e):et(t,e):ye({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}const re=Ze((t,e)=>{function r(){var x;const{accumulated:o,startTime:p,infos:m,estimatedMemory:h}=e(),f=(x=e().log)==null?void 0:x.maxMemory,{totalFrames:g,log:s,gl:c,max:a}=o,d={calls:c.calls/g,triangles:c.triangles/g,points:c.points/g,lines:c.lines/g},l={gpu:s.gpu/g,cpu:s.cpu/g,mem:s.mem/g,fps:s.fps/g};return{sessionTime:(window.performance.now()-p)/1e3,infos:m,memory:h,log:l,gl:d,max:a,maxMemory:f,totalFrames:g}}return{log:null,paused:!1,triggerProgramsUpdate:0,startTime:0,customData:0,fpsLimit:60,overclockingFps:!1,estimatedMemory:{vram:0,tex:0,geo:0,ram:0},accumulated:{totalFrames:0,gl:{calls:0,triangles:0,points:0,lines:0,counts:0},log:{gpu:0,cpu:0,mem:0,fps:0},max:{gl:{calls:0,triangles:0,points:0,lines:0,counts:0},log:{gpu:0,cpu:0,mem:0,fps:0}}},chart:{data:{fps:[],cpu:[],gpu:[],mem:[]},circularId:0},gl:void 0,objectWithMaterials:null,scene:void 0,programs:new Map,sceneLength:void 0,tab:"infos",getReport:r}}),I=t=>re(t,tt);Object.assign(I,re);const{getState:A,setState:M}=re,T={value:0,fpsLimit:60,isOverLimit:0},W=t=>(t==null?void 0:t.reduce((e,r)=>e+r,0))/t.length;class rt{constructor(e={}){this.names=[""],this.finished=[],this.paused=!1,this.overClock=!1,this.queryHasResult=!1,this.queryCreated=!1,this.isWebGL2=!0,this.memAccums=[],this.gpuAccums=[],this.activeAccums=[],this.logsAccums={mem:[],gpu:[],cpu:[],fps:[],fpsFixed:[]},this.fpsChart=[],this.gpuChart=[],this.cpuChart=[],this.memChart=[],this.paramLogger=()=>{},this.glFinish=()=>{},this.chartLogger=()=>{},this.chartLen=60,this.logsPerSecond=10,this.maxMemory=1500,this.chartHz=10,this.startCpuProfiling=!1,this.lastCalculateFixed=0,this.chartFrame=0,this.gpuTimeProcess=0,this.chartTime=0,this.activeQueries=0,this.circularId=0,this.detected=0,this.frameId=0,this.rafId=0,this.idleCbId=0,this.checkQueryId=0,this.uuid=void 0,this.currentCpu=0,this.currentMem=0,this.paramFrame=0,this.paramTime=0,this.now=()=>{},this.t0=0,window.GLPerf=window.GLPerf||{},Object.assign(this,e),this.fpsChart=new Array(this.chartLen).fill(0),this.gpuChart=new Array(this.chartLen).fill(0),this.cpuChart=new Array(this.chartLen).fill(0),this.memChart=new Array(this.chartLen).fill(0),this.now=()=>window.performance&&window.performance.now?window.performance.now():Date.now(),this.initGpu(),this.is120hz()}initGpu(){this.uuid=Te.MathUtils.generateUUID(),this.gl&&(this.isWebGL2=!0,this.extension||(this.extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")),this.extension===null&&(this.isWebGL2=!1))}is120hz(){let e=0;const r=o=>{++e<20?this.rafId=window.requestAnimationFrame(r):(this.detected=Math.ceil(1e3*e/(o-this.t0)/70),window.cancelAnimationFrame(this.rafId)),this.t0||(this.t0=o)};this.rafId=window.requestAnimationFrame(r)}addUI(e){this.names.indexOf(e)===-1&&(this.names.push(e),this.gpuAccums.push(0),this.activeAccums.push(!1))}nextFps(e){const r=16.666666666666668,o=r-e.timeRemaining(),p=r*T.fpsLimit/10/o;p<0||(T.value=p,T.isOverLimit<25?T.isOverLimit++:M({overclockingFps:!0}))}nextFrame(e){this.frameId++;const r=e||this.now(),o=r-this.paramTime;let p=0;if(this.frameId<=1)this.paramFrame=this.frameId,this.paramTime=r;else if(r>=this.paramTime){this.maxMemory=window.performance.memory?window.performance.memory.jsHeapSizeLimit/1048576:0;const m=this.frameId-this.paramFrame,h=m*1e3/o,f=A().overclockingFps?T.value:h;if(p=this.isWebGL2?this.gpuAccums[0]:this.gpuAccums[0]/o,this.isWebGL2?this.gpuAccums[0]=0:Promise.all(this.finished).then(()=>{this.gpuAccums[0]=0,this.finished=[]}),this.currentMem=Math.round(window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize/1048576:0),window.performance&&this.startCpuProfiling){window.performance.mark("cpu-finished");const g=performance.measure("cpu-duration","cpu-started","cpu-finished");this.currentCpu=(g==null?void 0:g.duration)||0,this.logsAccums.cpu.push(this.currentCpu),this.startCpuProfiling=!1}this.logsAccums.mem.push(this.currentMem),this.logsAccums.fpsFixed.push(h),this.logsAccums.fps.push(f),this.logsAccums.gpu.push(p),this.overClock&&typeof window.requestIdleCallback<"u"&&(T.isOverLimit>0&&f>h?T.isOverLimit--:A().overclockingFps&&M({overclockingFps:!1})),r>=this.paramTime+1e3/this.logsPerSecond&&(this.paramLogger({cpu:W(this.logsAccums.cpu),gpu:W(this.logsAccums.gpu),mem:W(this.logsAccums.mem),fps:W(this.logsAccums.fps),duration:Math.round(o),maxMemory:this.maxMemory,frameCount:m}),this.logsAccums.mem=[],this.logsAccums.fps=[],this.logsAccums.gpu=[],this.logsAccums.cpu=[],this.paramFrame=this.frameId,this.paramTime=r),this.overClock&&r-this.lastCalculateFixed>=2*1e3&&(this.lastCalculateFixed=e,T.fpsLimit=Math.round(W(this.logsAccums.fpsFixed)/10)*100,M({fpsLimit:T.fpsLimit/10}),this.logsAccums.fpsFixed=[],this.paramFrame=this.frameId,this.paramTime=r)}if(!this.detected||!this.chartFrame)this.chartFrame=this.frameId,this.chartTime=r,this.circularId=0;else{const m=r-this.chartTime;let h=this.chartHz*m/1e3;for(;--h>0&&this.detected;){const g=(this.frameId-this.chartFrame)/m*1e3,s=A().overclockingFps?T.value:g;this.fpsChart[this.circularId%this.chartLen]=s;const c=1e3/this.currentMem,a=this.currentCpu,d=(this.isWebGL2?this.gpuAccums[1]*2:Math.round(this.gpuAccums[1]/o*100))+4;d>0&&(this.gpuChart[this.circularId%this.chartLen]=d),a>0&&(this.cpuChart[this.circularId%this.chartLen]=a),c>0&&(this.memChart[this.circularId%this.chartLen]=c);for(let l=0;l<this.names.length;l++)this.chartLogger({i:l,data:{fps:this.fpsChart,gpu:this.gpuChart,cpu:this.cpuChart,mem:this.memChart},circularId:this.circularId});this.circularId++,this.chartFrame=this.frameId,this.chartTime=r}}}startGpu(){const e=this.gl,r=this.extension;if(!(!e||!r)&&this.isWebGL2){let o=!1,p,m;if(this.query){this.queryHasResult=!1;let h=this.query;if(o=e.getQueryParameter(h,e.QUERY_RESULT_AVAILABLE),p=e.getParameter(r.GPU_DISJOINT_EXT),o&&!p){m=e.getQueryParameter(this.query,e.QUERY_RESULT);const f=m*1e-6;(o||p)&&(e.deleteQuery(this.query),h=null),o&&f>0&&(p||this.activeAccums.forEach((g,s)=>{this.gpuAccums[s]=f}))}}(o||!this.query)&&(this.queryCreated=!0,this.query=e.createQuery(),e.beginQuery(r.TIME_ELAPSED_EXT,this.query))}}endGpu(){const e=this.extension,r=this.gl;this.isWebGL2&&this.queryCreated&&r.getQuery(e.TIME_ELAPSED_EXT,r.CURRENT_QUERY)&&r.endQuery(e.TIME_ELAPSED_EXT)}begin(e){this.startGpu(),this.updateAccums(e)}end(e){this.endGpu(),this.updateAccums(e)}updateAccums(e){let r=this.names.indexOf(e);r===-1&&(r=this.names.length,this.addUI(e));const o=this.now();this.activeAccums[r]=!this.activeAccums[r],this.t0=o}dispose(){const e=this.gl,r=this.extension;try{this.isWebGL2&&e&&r&&e.getQuery(r.TIME_ELAPSED_EXT,e.CURRENT_QUERY)&&e.endQuery(r.TIME_ELAPSED_EXT)}catch{}if(e&&this.query){try{e.deleteQuery(this.query)}catch{}this.query=null}if(this.queryCreated=!1,this.queryHasResult=!1,window.performance)try{performance.clearMarks("cpu-started"),performance.clearMarks("cpu-finished"),performance.clearMeasures("cpu-duration")}catch{}}}const st=t=>{t.forEach(e=>{const{meshes:r}=e;if(!r)return;const o={total:0,type:"Triangle",data:[]};Object.keys(r).forEach(p=>{const m=r[p],{geometry:h,material:f}=m,g=h.index,s=h.attributes.position;if(!s)return;let c=1;f.wireframe===!0&&(c=0);const a=g!==null?g.count:s.count,d=h.drawRange.start*c,l=h.drawRange.count*c,i=d,x=Math.min(a,d+l)-1;let u=1;const _=m.count||1;let v="Triangle",E=0;m.isMesh?f.wireframe===!0?(v="Line",u=u/2):(v="Triangle",u=u/3):m.isLine?(v="Line",m.isLineSegments?u=u/2:m.isLineLoop?u=u:u=u-1):m.isPoints?(v="Point",u=u):m.isSprite&&(v="Triangle",u=u/3);const b=Math.round(Math.max(0,x-i+1)*(u*_));b>E&&(E=b,o.type=v),o.total+=b,o.data.push({drawCount:b,type:v}),m.userData.drawCount={type:v,count:b}}),e.drawCounts=o})};var Fe={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(r=!1));function p(g,s,c){this.fn=g,this.context=s,this.once=c||!1}function m(g,s,c,a,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var l=new p(c,a||g,d),i=r?r+s:s;return g._events[i]?g._events[i].fn?g._events[i]=[g._events[i],l]:g._events[i].push(l):(g._events[i]=l,g._eventsCount++),g}function h(g,s){--g._eventsCount===0?g._events=new o:delete g._events[s]}function f(){this._events=new o,this._eventsCount=0}f.prototype.eventNames=function(){var s=[],c,a;if(this._eventsCount===0)return s;for(a in c=this._events)e.call(c,a)&&s.push(r?a.slice(1):a);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(c)):s},f.prototype.listeners=function(s){var c=r?r+s:s,a=this._events[c];if(!a)return[];if(a.fn)return[a.fn];for(var d=0,l=a.length,i=new Array(l);d<l;d++)i[d]=a[d].fn;return i},f.prototype.listenerCount=function(s){var c=r?r+s:s,a=this._events[c];return a?a.fn?1:a.length:0},f.prototype.emit=function(s,c,a,d,l,i){var x=r?r+s:s;if(!this._events[x])return!1;var u=this._events[x],_=arguments.length,v,E;if(u.fn){switch(u.once&&this.removeListener(s,u.fn,void 0,!0),_){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,c),!0;case 3:return u.fn.call(u.context,c,a),!0;case 4:return u.fn.call(u.context,c,a,d),!0;case 5:return u.fn.call(u.context,c,a,d,l),!0;case 6:return u.fn.call(u.context,c,a,d,l,i),!0}for(E=1,v=new Array(_-1);E<_;E++)v[E-1]=arguments[E];u.fn.apply(u.context,v)}else{var b=u.length,L;for(E=0;E<b;E++)switch(u[E].once&&this.removeListener(s,u[E].fn,void 0,!0),_){case 1:u[E].fn.call(u[E].context);break;case 2:u[E].fn.call(u[E].context,c);break;case 3:u[E].fn.call(u[E].context,c,a);break;case 4:u[E].fn.call(u[E].context,c,a,d);break;default:if(!v)for(L=1,v=new Array(_-1);L<_;L++)v[L-1]=arguments[L];u[E].fn.apply(u[E].context,v)}}return!0},f.prototype.on=function(s,c,a){return m(this,s,c,a,!1)},f.prototype.once=function(s,c,a){return m(this,s,c,a,!0)},f.prototype.removeListener=function(s,c,a,d){var l=r?r+s:s;if(!this._events[l])return this;if(!c)return h(this,l),this;var i=this._events[l];if(i.fn)i.fn===c&&(!d||i.once)&&(!a||i.context===a)&&h(this,l);else{for(var x=0,u=[],_=i.length;x<_;x++)(i[x].fn!==c||d&&!i[x].once||a&&i[x].context!==a)&&u.push(i[x]);u.length?this._events[l]=u.length===1?u[0]:u:h(this,l)}return this},f.prototype.removeAllListeners=function(s){var c;return s?(c=r?r+s:s,this._events[c]&&h(this,c)):(this._events=new o,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=r,f.EventEmitter=f,t.exports=f})(Fe);var nt=Fe.exports;const it=Ae(nt),se=new it;function at(t,e,r){return se.on(t,e)}function ot(t,e,r){se.removeListener(t,e,(r==null?void 0:r.context)??null,r==null?void 0:r.once)}function ct(t,e){se.emit(t,e)}function lt(t){let e=0,r=0;const o=new Set,p=new Set;return t.traverse(m=>{if(m.isMesh){const h=m;if(h.geometry&&!o.has(h.geometry.uuid)){o.add(h.geometry.uuid);const s=h.geometry.attributes;for(const c in s){const a=s[c];a.array&&(r+=a.array.byteLength)}h.geometry.index&&h.geometry.index.array&&(r+=h.geometry.index.array.byteLength)}const f=h.material;(Array.isArray(f)?f:[f]).forEach(s=>{if(s)for(const c in s){const a=s[c];if(a&&a.isTexture){const d=a;if(!p.has(d.uuid)){if(p.add(d.uuid),d.isCompressedTexture&&d.mipmaps)d.mipmaps.forEach(l=>{l.data&&(e+=l.data.byteLength)});else if(d.image){const l=d.image,i=l.width||0,x=l.height||0,u=d.generateMipmaps?1.33:1;e+=i*x*4*u}}}}})}}),{geometry:r,texture:e,total:r+e}}const ve=O.Object3D.prototype.updateMatrixWorld,_e=O.Object3D.prototype.updateWorldMatrix,Ee=O.Object3D.prototype.updateMatrix,je=["calls","triangles","points","lines"],be=["gpu","cpu","mem","fps"],ut=t=>/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t),Se=(t,e)=>{t.defines||(t.defines={}),t.defines.muiPerf||(t.defines=Object.assign(t.defines||{},{muiPerf:t.uuid}),t.needsUpdate=!0);const r=t.uuid;return e[r]||(e[r]={meshes:{},material:t}),t.needsUpdate=!1,r},ft=t=>t==="muiPerf",mt=({overClock:t,logsPerSecond:e,chart:r,deepAnalyze:o,matrixUpdate:p})=>{const{gl:m,scene:h}=N.useThree();M({gl:m,scene:h});const f=1e3;let g=0;const s=j.useMemo(()=>{const c=new rt({trackGPU:!0,overClock:t,chartLen:r?r.length:120,chartHz:r?r.hz:60,logsPerSecond:e||10,gl:m.getContext(),chartLogger:u=>{M({chart:u})},paramLogger:u=>{var L;const _={maxMemory:u.maxMemory,gpu:u.gpu,cpu:u.cpu,mem:u.mem,fps:u.fps,totalTime:u.duration,frameCount:u.frameCount};M({log:_});const{accumulated:v}=A(),E=m.info.render;v.totalFrames++,v.gl.calls+=E.calls,v.gl.triangles+=E.triangles,v.gl.points+=E.points,v.gl.lines+=E.lines,v.log.gpu+=u.gpu,v.log.cpu+=u.cpu,v.log.mem+=u.mem,v.log.fps+=u.fps;for(let S=0;S<je.length;S++){const w=je[S],C=E[w];C>v.max.gl[w]&&(v.max.gl[w]=C)}for(let S=0;S<be.length;S++){const w=be[S],C=u[w];C>v.max.log[w]&&(v.max.log[w]=C)}M({accumulated:v});const b={calls:m.info.render.calls,triangles:m.info.render.triangles,points:m.info.render.points,lines:m.info.render.lines,geometries:m.info.memory.geometries,textures:m.info.memory.textures,programs:((L=m.info.programs)==null?void 0:L.length)||0};ct("log",[_,b])}}),a=m.getContext();let d=null,l=null;const i=a.getExtension("WEBGL_debug_renderer_info"),x=a.getParameter(a.VERSION);return i&&(d=a.getParameter(i.UNMASKED_RENDERER_WEBGL),l=a.getParameter(i.UNMASKED_VENDOR_WEBGL)),l||(l="Unknown vendor"),d||(d=a.getParameter(a.RENDERER)),M({startTime:window.performance.now(),infos:{version:x,renderer:d,vendor:l}}),c},[t,r,e,m]);return j.useEffect(()=>{s&&(s.overClock=t||!1,t===!1&&(M({overclockingFps:!1}),T.value=0,T.isOverLimit=0),s.chartHz=(r==null?void 0:r.hz)||60,s.chartLen=(r==null?void 0:r.length)||120)},[s,t,r==null?void 0:r.hz,r==null?void 0:r.length]),j.useEffect(()=>{if(!m.info)return;m.info.autoReset=!1,p&&(O.Object3D.prototype.updateMatrixWorld=function(...d){return this.matrixWorldNeedsUpdate||d[0],ve.apply(this,d)},O.Object3D.prototype.updateWorldMatrix=function(...d){return _e.apply(this,d)},O.Object3D.prototype.updateMatrix=function(...d){return Ee.apply(this,d)});const c=N.addEffect(()=>{A().paused&&M({paused:!1}),s==null||s.begin("profiler"),window.performance&&(window.performance.mark("cpu-started"),s.startCpuProfiling=!0),m.info.reset()}),a=N.addAfterEffect(()=>{var x,u;s==null||s.end("profiler"),s&&!s.paused&&(s.nextFrame(window.performance.now()),t&&typeof window.requestIdleCallback<"u"&&(s.idleCbId=requestIdleCallback(s.nextFps)));const d=window.performance.now();if(d-g>f){g=d;const _=lt(h),v=s.currentMem||0;M({estimatedMemory:{vram:_.total/1024/1024,tex:_.texture/1024/1024,geo:_.geometry/1024/1024,ram:v}})}if(!o)return;const l={},i=new Map;h.traverse(_=>{if(_ instanceof O.Mesh||_ instanceof O.Points){if(!_.material)return;let v=_.material.uuid;const E=Array.isArray(_.material)&&_.material.length>1;v=Se(E?_.material[1]:_.material,l),l[v].meshes[_.uuid]=_}}),(u=(x=m==null?void 0:m.info)==null?void 0:x.programs)==null||u.forEach(_=>{const v=_.cacheKey.split(","),E=v[v.findIndex(ft)+1];if(ut(E)&&l[E]){const{material:b,meshes:L}=l[E];i.set(E,{program:_,material:b,meshes:L,drawCounts:{total:0,type:"triangle",data:[]},expand:!1,visible:!0})}}),i.size!==A().programs.size&&(st(i),M({programs:i,triggerProgramsUpdate:A().triggerProgramsUpdate+1}))});return()=>{var d;s&&typeof window.cancelIdleCallback<"u"&&window.cancelIdleCallback(s.idleCbId),(d=s==null?void 0:s.dispose)==null||d.call(s),p&&(O.Object3D.prototype.updateMatrixWorld=ve,O.Object3D.prototype.updateWorldMatrix=_e,O.Object3D.prototype.updateMatrix=Ee),c(),a()}},[s,m,h,o,t,p]),j.useEffect(()=>{const c=N.addTail(()=>(s&&(s.paused=!0,M({paused:!0,log:{maxMemory:0,gpu:0,mem:0,cpu:0,fps:0,totalTime:0,frameCount:0}})),!1));return()=>c()},[s]),null};function ne(t,e,r=[],o){const p=j.useRef(e);j.useEffect(()=>{p.current=e},[e]),j.useEffect(()=>{const m=f=>{var g;return(g=p.current)==null?void 0:g.call(p,f)},h=at(t,m);return()=>ot(t,m,{...o,context:h})},[t,o==null?void 0:o.once,...r])}function dt(t){let e=0;for(const o in t.attributes){const p=t.getAttribute(o);e+=p.count*p.itemSize*p.array.BYTES_PER_ELEMENT}const r=t.getIndex();return e+=r?r.count*r.itemSize*r.array.BYTES_PER_ELEMENT:0,e}const pt="_perfS_ans5i_1",ht="_containerHeight_ans5i_16",gt="_topLeft_ans5i_21",xt="_topRight_ans5i_22",yt="_bottomLeft_ans5i_23",vt="_bottomRight_ans5i_24",_t="_minimal_ans5i_26",Et="_perfIContainer_ans5i_30",jt="_perfI_ans5i_30",bt="_perfB_ans5i_69",St="_toggleContainer_ans5i_83",wt="_toggle_ans5i_83",Lt="_activeTab_ans5i_105",Ct="_containerScroll_ans5i_110",Ot="_programGeo_ans5i_115",Mt="_programHeader_ans5i_120",It="_headerLeft_ans5i_149",Tt="_programTitle_ans5i_156",Rt="_toggleArrow_ans5i_166",At="_programConsole_ans5i_200",Nt="_programsContainer_ans5i_218",Ft="_headerRight_ans5i_222",Pt="_metricBadge_ans5i_228",Dt="_programsULHeader_ans5i_246",Ut="_programsUL_ans5i_246",Gt="_programsGeoLi_ans5i_309",Wt="_graph_ans5i_324",Bt="_visibilityBtn_ans5i_354",Ht="_active_ans5i_105",y={perfS:pt,containerHeight:ht,topLeft:gt,topRight:xt,bottomLeft:yt,bottomRight:vt,minimal:_t,perfIContainer:Et,perfI:jt,perfB:bt,toggleContainer:St,toggle:wt,activeTab:Lt,containerScroll:Ct,programGeo:Ot,programHeader:Mt,headerLeft:It,programTitle:Tt,toggleArrow:Rt,programConsole:At,programsContainer:Nt,headerRight:Ft,metricBadge:Pt,programsULHeader:Dt,programsUL:Ut,programsGeoLi:Gt,graph:Wt,visibilityBtn:Bt,active:Ht},we=(t,e)=>{var p,m;const r=h=>{switch(h){case 1e3:return"RepeatWrapping";case 1001:return"ClampToEdgeWrapping";case 1002:return"MirroredRepeatWrapping";default:return"ClampToEdgeWrapping"}},o=h=>{switch(h){case 3e3:return"LinearEncoding";case 3001:return"sRGBEncoding";case 3002:return"RGBEEncoding";case 3003:return"LogLuvEncoding";case 3004:return"RGBM7Encoding";case 3005:return"RGBM16Encoding";case 3006:return"RGBDEncoding";case 3007:return"GammaEncoding";default:return"ClampToEdgeWrapping"}};return{name:t,url:(p=e==null?void 0:e.image)==null?void 0:p.currentSrc,encoding:o(e.encoding),wrapT:r(e.wrapT),flipY:(m=e.flipY)==null?void 0:m.toString()}},ee=({value:t,label:e,unit:r,title:o})=>t==null||t===0||t==="0"?null:n.jsxs("div",{className:y.metricBadge,title:o,children:[n.jsx("b",{children:t})," ",r||e]}),Vt=({program:t,material:e,setTexNumber:r})=>{const o=I(h=>h.gl),[p,m]=j.useState(null);return j.useEffect(()=>{if(o){const h=t==null?void 0:t.getUniforms();let f=0;const g=new Map;h&&h.seq&&h.seq.forEach(s=>{if(!s.id.includes("uTroika")&&!["isOrthographic","uvTransform","lightProbe","projectionMatrix","viewMatrix","normalMatrix","modelMatrix","modelViewMatrix"].includes(s.id)){const c=[],a={name:s.id};s.cache&&(s.cache.forEach(d=>{typeof d<"u"&&c.push(d.toString().substring(0,4))}),a.value=c.join(),e[s.id]&&e[s.id].image&&(f++,a.value=we(s.id,e[s.id])),a.value||(a.value="empty"),g.set(s.id,a))}}),e.uniforms&&Object.keys(e.uniforms).forEach(s=>{const c=e.uniforms[s];if(c.value){const{value:a}=c,d={name:s};if(s.includes("uTroika"))return;if(a.isTexture)f++,d.value=we(s,a);else{let l=JSON.stringify(a);try{l=JSON.stringify(a)}catch{l=a.toString()}d.value=l}g.set(s,d)}}),r(f),m(g)}},[o,e,t,r]),n.jsx("ul",{className:y.programsUL,children:p&&Array.from(p.values()).map(h=>n.jsx("span",{children:typeof h.value=="string"?n.jsx("li",{children:n.jsxs("span",{children:[h.name," :"," ",n.jsxs("b",{children:[h.value.substring(0,30),h.value.length>30?"...":""]})]})}):n.jsxs(n.Fragment,{children:[n.jsx("li",{children:n.jsxs("b",{children:[h.value.name,":"]})}),n.jsxs("div",{children:[Object.keys(h.value).map(f=>f!=="name"?n.jsx("div",{children:f==="url"?n.jsx("a",{href:h.value[f],target:"_blank",rel:"noreferrer",children:n.jsx("img",{src:h.value[f],alt:"texture"})}):n.jsxs("li",{children:[f,": ",n.jsx("b",{children:h.value[f]})]})},f):null),n.jsxs("button",{className:y.programConsole,onClick:()=>{var f;console.info(e[h.value.name]||((f=e==null?void 0:e.uniforms[h.value.name])==null?void 0:f.value))},children:["console.info(",h.value.name,");"]})]})]})},h.name))})},kt=({el:t})=>{const[e,r]=j.useState(t.visible),[o,p]=j.useState(t.expand),[m,h]=j.useState(0),{meshes:f,program:g,material:s}=t,c=I(i=>i.gl),a=()=>{if(!c||!c.info||!c.info.render)return 0;const i=c.info.render.triangles+c.info.render.lines+c.info.render.points;if(i===0)return 0;const x=Math.round(t.drawCounts.total/i*100*10)/10;return isFinite(x)&&x||0},d=Object.keys(f).length,l=a();return n.jsxs("div",{className:y.programGeo,children:[n.jsxs("div",{className:y.programHeader,onClick:()=>{Object.keys(f).forEach(i=>{f[i].material.wireframe=!1}),p(!o)},children:[n.jsxs("div",{className:y.headerLeft,children:[n.jsx("div",{className:y.toggleArrow,style:{transform:o?"rotate(90deg)":"rotate(0deg)"},children:"โ–ถ"}),g&&n.jsx("span",{className:y.programTitle,children:g.name})]}),n.jsxs("div",{className:y.headerRight,children:[n.jsx(ee,{value:d,unit:d>1?"users":"user"}),n.jsx(ee,{value:m,unit:"tex"}),t.drawCounts.total>0&&n.jsxs("div",{className:y.metricBadge,title:`${l}% of total render`,children:[n.jsx("b",{children:t.drawCounts.total}),t.drawCounts.type==="Triangle"?"tris":t.drawCounts.type,t.visible&&!t.material.wireframe&&n.jsxs("span",{style:{marginLeft:"4px",opacity:.6,fontSize:"9px"},children:["(",l,"%)"]})]}),s.glslVersion==="300 es"&&n.jsx(ee,{value:"300",unit:"es"}),n.jsx("div",{className:`${y.visibilityBtn} ${e?y.active:""}`,onPointerEnter:()=>{Object.keys(f).forEach(i=>f[i].material.wireframe=!0)},onPointerLeave:()=>{Object.keys(f).forEach(i=>f[i].material.wireframe=!1)},onClick:i=>{i.stopPropagation();const x=!e;Object.keys(f).forEach(u=>{f[u]&&(f[u].visible=x)}),r(x)},children:e?"๐Ÿ‘":"ร—"})]})]}),n.jsxs("div",{style:{display:o?"block":"none"},children:[n.jsx("div",{className:y.programsULHeader,style:{marginTop:"4px"},children:"Uniforms"}),n.jsx(Vt,{program:g,material:s,setTexNumber:h}),n.jsx("div",{className:y.programsULHeader,children:"Geometries"}),n.jsx("ul",{className:y.programsUL,children:f&&Object.keys(f).map(i=>f[i]&&f[i].geometry&&n.jsx("li",{className:y.programsGeoLi,children:n.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[n.jsx("span",{children:f[i].geometry.type}),f[i].userData&&f[i].userData.drawCount&&n.jsxs("span",{style:{color:"#aaa",fontSize:"10px",display:"flex",gap:"6px"},children:[n.jsxs("span",{children:[n.jsx("b",{children:f[i].userData.drawCount.count})," ",f[i].userData.drawCount.type,"s"]}),n.jsx("span",{style:{opacity:.3},children:"|"}),n.jsxs("span",{children:[n.jsx("b",{children:Math.round(dt(f[i].geometry)/1024*100)/100})," ","KB"]})]})]})},i))}),n.jsxs("button",{className:y.programConsole,onClick:()=>console.info(s),children:["Log Material (",s.type,")"]})]})]})},qt=()=>{I(e=>e.triggerProgramsUpdate);const t=I(e=>e.programs);return n.jsx("div",{className:y.programsContainer,onWheel:e=>e.stopPropagation(),children:t&&Array.from(t.values()).map(e=>e?n.jsx(kt,{el:e},e.material.uuid):null)})},zt=({minimal:t,chart:e={length:120,hz:60}})=>{const r=j.useMemo(()=>({fps:new Float32Array(e.length*3),cpu:new Float32Array(e.length*3),gpu:new Float32Array(e.length*3)}),[e]),o=j.useRef(null),p=j.useRef(null),m=j.useRef(null),h=j.useRef(null),f=j.useMemo(()=>new O.Vector3(0,0,0),[]),g=(s,c=1,a,d)=>{let l=0;const{width:i,height:x}=d,u=A().chart.data[s];if(!u||u.length===0)return;const _=t?2:6,v=t?12:50,E=u.length;for(let b=0;b<E;b++){const L=(A().chart.circularId+b+1)%E;u[L]!==void 0&&(u[L]>l&&(l=u[L]*c),f.set(_+b/(E-1)*(i-_*2)-i/2,Math.min(100,u[L])*c/100*(x-_*2-v)-x/2,0),f.toArray(a.attributes.position.array,b*3))}a.attributes.position.needsUpdate=!0};return N.useFrame(function({viewport:c}){g("fps",1,o.current,c),p.current&&p.current.color.set(A().overclockingFps?R.overClock:R.fps),g("gpu",5,m.current,c),g("cpu",5,h.current,c)}),n.jsxs(n.Fragment,{children:[n.jsxs("line",{onUpdate:s=>{s.updateMatrix(),s.matrixWorld.copy(s.matrix)},children:[n.jsx("bufferGeometry",{ref:o,children:n.jsx("bufferAttribute",{attach:"attributes-position",count:e.length,args:[r.fps,3],array:r.fps,itemSize:3,usage:O.DynamicDrawUsage,needsUpdate:!0})}),n.jsx("lineBasicMaterial",{ref:p,color:R.fps,transparent:!0,opacity:.5})]}),n.jsxs("line",{onUpdate:s=>{s.updateMatrix(),s.matrixWorld.copy(s.matrix)},children:[n.jsx("bufferGeometry",{ref:m,children:n.jsx("bufferAttribute",{attach:"attributes-position",count:e.length,array:r.gpu,args:[r.gpu,3],itemSize:3,usage:O.DynamicDrawUsage,needsUpdate:!0})}),n.jsx("lineBasicMaterial",{color:R.gpu,transparent:!0,opacity:.5})]}),n.jsxs("line",{onUpdate:s=>{s.updateMatrix(),s.matrixWorld.copy(s.matrix)},children:[n.jsx("bufferGeometry",{ref:h,children:n.jsx("bufferAttribute",{attach:"attributes-position",count:e.length,array:r.cpu,args:[r.cpu,3],itemSize:3,usage:O.DynamicDrawUsage,needsUpdate:!0})}),n.jsx("lineBasicMaterial",{color:R.cpu,transparent:!0,opacity:.5})]})]})},$t=({chart:t,showGraph:e=!0,antialias:r=!0,minimal:o})=>{const p=j.useRef(void 0),m=I(h=>h.paused);return n.jsx("div",{className:y.graph,style:{display:"flex",marginTop:6,position:"absolute",width:"100%",height:`${o?37:e?100:60}px`},children:n.jsx(N.Canvas,{ref:p,orthographic:!0,camera:{rotation:[0,0,0]},dpr:r?[1,2]:1,gl:{antialias:!0,alpha:!0,stencil:!1,depth:!1},onCreated:({scene:h})=>{h.traverse(f=>{f.matrixWorldAutoUpdate=!1,f.matrixAutoUpdate=!1})},flat:!0,style:{marginBottom:"-42px",position:"relative",pointerEvents:"none",background:"transparent !important",width:"100%",height:`${o?37:e?100:60}px`},children:m?null:n.jsxs(n.Fragment,{children:[n.jsx(Kt,{}),e&&n.jsx(zt,{minimal:o,chart:t})]})})})},Kt=()=>(N.useFrame(function({gl:e,scene:r,camera:o}){o.updateMatrix(),o.matrixWorld.copy(o.matrix),o.matrixWorldInverse.copy(o.matrixWorld).invert(),e.render(r,o)},1/0),null),Le={fps:{fg:"#00ffff",bg:"#000022"},cpu:{fg:"#00ff00",bg:"#002200"},gpu:{fg:"#ff0080",bg:"#220011"}},D=[{key:"fps",label:"FPS",maxVal:120},{key:"cpu",label:"CPU",maxVal:40},{key:"gpu",label:"GPU",maxVal:40}],U=48,Pe=15,z=2,H=Pe,B=U-H-2,$=6,Qt=15,Ce=1e3/Qt;function Yt({show:t=!0,opacity:e=1,className:r,style:o}){const p=I(l=>l.paused),m=j.useRef(null),h=j.useRef(null),[f,g]=j.useState(300),s=j.useMemo(()=>Math.max(1,Math.round(window.devicePixelRatio||1)),[]);j.useEffect(()=>{if(!h.current)return;const l=new ResizeObserver(i=>{for(const x of i)g(x.contentRect.width)});return l.observe(h.current),()=>l.disconnect()},[]);const c=(D.length-1)*$,a=Math.max(0,(f-c)/D.length),d=Math.max(0,a-z);return j.useEffect(()=>{const l=m.current;if(!l)return;l.width=f*s,l.height=U*s,l.style.width="100%",l.style.height=`${U}px`;const i=l.getContext("2d");if(i){i.setTransform(1,0,0,1,0,0),i.scale(s,s),i.imageSmoothingEnabled=!1,i.font="bold 9px Roboto Mono, monospace",i.textBaseline="top",i.clearRect(0,0,f,U);for(let x=0;x<D.length;x++){const{key:u}=D[x],_=x*(a+$),{bg:v}=Le[u];i.fillStyle=v,i.globalAlpha=e,i.fillRect(_,0,a,U),i.globalAlpha=1}}},[s,f,a,e]),j.useEffect(()=>{if(!t)return;const l=m.current;if(!l)return;const i=l.getContext("2d");if(!i)return;let x=0,u=0;const _={fps:{min:1/0,max:0},cpu:{min:1/0,max:0},gpu:{min:1/0,max:0}};function v(E){if(!l||!i||(x=requestAnimationFrame(v),p))return;const b=E-u;if(b<Ce)return;u=E-b%Ce;const L=A(),S=L.chart.circularId;for(let w=0;w<D.length;w++){const{key:C,label:De,maxVal:ie}=D[w],G=w*(a+$),{fg:ae,bg:oe}=Le[C],V=L.chart.data[C],K=(V==null?void 0:V.length)||0;let k=0;if(K>0){const We=(S-1+K)%K;k=V[We]??0}const P=_[C];P.min=Math.min(P.min,k),P.max=Math.max(P.max,k),i.fillStyle=oe,i.globalAlpha=1,i.fillRect(G,0,a,Pe),i.fillStyle=ae;const Ue=`${De} (${Math.round(P.min)}-${Math.round(P.max)})`;i.fillText(Ue,G+3,2),d>1&&i.drawImage(l,(G+z+1)*s,H*s,(d-1)*s,B*s,G+z,H,d-1,B);const ce=G+z+d-1;i.fillStyle=oe,i.globalAlpha=1,i.fillRect(ce,H,1,B),i.fillStyle=ae,i.globalAlpha=1;const Ge=Math.min(k,ie)/ie,Q=Math.round(Ge*B);Q>0&&i.fillRect(ce,H+B-Q,1,Q)}}return x=requestAnimationFrame(v),()=>cancelAnimationFrame(x)},[p,t,s,a,d]),t?n.jsx("div",{ref:h,className:r,style:{width:"100%",...o,marginTop:$},children:n.jsx("canvas",{ref:m,style:{display:"block",pointerEvents:"none",width:"100%",height:`${U}px`}})}):null}const R={overClock:"#ff6eff",fps:"#00FFFF",cpu:"#00FF00",gpu:"#FD007F",memory:"#FFD000",vram:"#FF8C00"},Oe=({metric:t,decimal:e=0,suffix:r=""})=>{const o=j.useRef(null);return ne("log",p=>{const[m]=p;if(m&&o.current){const h=m[t];o.current.innerText=(typeof h=="number"?h.toFixed(e):"0")+r}}),n.jsxs("span",{ref:o,children:["0",r]})},F=({metric:t,suffix:e=""})=>{const r=j.useRef(null);return ne("log",o=>{const[,p]=o;if(p&&r.current){let m=p[t];t==="calls"&&m===1&&(m="--"),r.current.innerText=m+e}}),n.jsxs("span",{ref:r,children:["0",e]})},Me=({type:t})=>{const e=I(r=>r.estimatedMemory[t]);return n.jsxs("span",{children:[e.toFixed(0)," MB"]})},Xt=()=>{const t=I(p=>p.overclockingFps),e=I(p=>p.fpsLimit),r=j.useRef(null);ne("log",p=>{const[m]=p;m&&r.current&&(r.current.innerText=Math.round(m.fps).toString())});const o=t?R.overClock:R.fps;return n.jsxs("div",{className:y.perfI,children:[n.jsxs("span",{className:y.perfB,style:{color:o},children:["FPS ",t?` ${e}๐Ÿš€`:""]}),n.jsx("small",{className:y.perfSmallI,ref:r,children:"0"})]})},Jt=({showGraph:t,minimal:e})=>I(o=>o.gl)?n.jsxs("div",{className:y.perfIContainer,children:[n.jsx(Xt,{showGraph:t}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,style:{color:R.cpu},children:"CPU"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(Oe,{metric:"cpu",decimal:2,suffix:" ms"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,style:{color:R.gpu},children:"GPU"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(Oe,{metric:"gpu",decimal:2,suffix:" ms"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,style:{color:R.memory},children:"MEMORY"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(Me,{type:"ram"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,style:{color:R.vram},children:"VRAM"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(Me,{type:"vram"})})]}),!e&&n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Calls"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"calls"})})]})]}):null,Zt=({matrixUpdate:t})=>n.jsxs("div",{className:y.perfIContainer,children:[n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Geometries"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"geometries"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Textures"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"textures"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Shaders"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"programs"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Triangles"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"triangles"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Lines"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"lines"})})]}),n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Points"}),n.jsx("small",{className:y.perfSmallI,children:n.jsx(F,{metric:"points"})})]}),t&&n.jsxs("div",{className:y.perfI,children:[n.jsx("span",{className:y.perfB,children:"Matrices"}),n.jsx("small",{className:y.perfSmallI,children:t})]})]}),Ie=({tab:t,title:e,set:r})=>{const o=I(p=>p.tab);return n.jsx("div",{className:`${y.toggle} ${o===t?y.activeTab:""}`,onClick:()=>{r(!0),M({tab:t})},children:e})},er=({openByDefault:t,showGraph:e,deepAnalyze:r,matrixUpdate:o,graphType:p,perfContainerRef:m,antialias:h,chart:f,minimal:g})=>{const[s,c]=j.useState(t||!1),a=I(d=>d.tab);return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:s?"block":"none",marginTop:"4px"},children:[n.jsx(Zt,{matrixUpdate:o}),e&&(p==="bar"?n.jsx(Yt,{}):n.jsx($t,{perfContainerRef:m,chart:f,showGraph:e,antialias:h,minimal:g,matrixUpdate:o})),s&&n.jsx("div",{className:y.containerScroll,children:a==="programs"&&n.jsx(qt,{})})]}),t&&!r?null:n.jsxs("div",{className:y.toggleContainer,style:s&&e&&p==="line"?{marginTop:50}:{marginTop:6},children:[r&&n.jsx(Ie,{tab:"programs",title:"Programs",set:c}),r&&n.jsx(Ie,{tab:"infos",title:"Infos",set:c}),n.jsx("div",{className:y.toggle,onClick:()=>c(!s),children:s?"Minimize":"More"})]})]})},tr=({showGraph:t=!0,openByDefault:e=!0,className:r,overClock:o=!1,graphType:p="bar",style:m,position:h="top-right",chart:f,logsPerSecond:g,deepAnalyze:s=!1,antialias:c=!0,matrixUpdate:a,minimal:d})=>{const l=j.useRef(null),i=h==="top-left"?y.topLeft:h==="bottom-left"?y.bottomLeft:h==="bottom-right"?y.bottomRight:y.topRight,x=t&&p==="line"&&!s;return n.jsxs(n.Fragment,{children:[n.jsx(mt,{logsPerSecond:g,chart:f,overClock:o,deepAnalyze:s,matrixUpdate:a}),n.jsx(Re,{name:"r3f-perf",children:n.jsxs("div",{className:`${y.perfS} ${i} ${d?y.minimal:""} ${r||""} ${x?y.containerHeight:""}`,style:m,ref:l,children:[n.jsx(Jt,{showGraph:t,minimal:d}),!d&&n.jsx(er,{showGraph:t,deepAnalyze:s,matrixUpdate:a,openByDefault:e,graphType:p,perfContainerRef:l,antialias:c,chart:f,minimal:d})]})})]})};exports.PerfMonitor=tr;
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import { jsx as p, jsxs as x, Fragment as q } from "react/jsx-runtime";
3
3
  import z, { forwardRef as Ke, useRef as T, useLayoutEffect as pe, useMemo as J, useEffect as P, useState as B } from "react";
4
4
  import { useThree as De, addEffect as Qe, addAfterEffect as Ye, addTail as Xe, Canvas as Je, useFrame as Ge } from "@react-three/fiber";
5
5
  import { createRoot as Ze } from "react-dom/client";
6
- import * as I from "three";
6
+ import * as M from "three";
7
7
  import { MathUtils as et } from "three";
8
8
  const We = Ke(
9
9
  ({ portal: t, className: e, children: n, name: o, ...d }, f) => {
@@ -411,7 +411,7 @@ const oe = ft((t, e) => {
411
411
  };
412
412
  }), A = (t) => oe(t, dt);
413
413
  Object.assign(A, oe);
414
- const { getState: F, setState: M } = oe, R = {
414
+ const { getState: F, setState: I } = oe, R = {
415
415
  value: 0,
416
416
  fpsLimit: 60,
417
417
  isOverLimit: 0
@@ -454,7 +454,7 @@ class pt {
454
454
  }
455
455
  nextFps(e) {
456
456
  const n = 16.666666666666668, o = n - e.timeRemaining(), d = n * R.fpsLimit / 10 / o;
457
- d < 0 || (R.value = d, R.isOverLimit < 25 ? R.isOverLimit++ : M({ overclockingFps: !0 }));
457
+ d < 0 || (R.value = d, R.isOverLimit < 25 ? R.isOverLimit++ : I({ overclockingFps: !0 }));
458
458
  }
459
459
  /**
460
460
  * Increase frameID
@@ -482,7 +482,7 @@ class pt {
482
482
  );
483
483
  this.currentCpu = (g == null ? void 0 : g.duration) || 0, this.logsAccums.cpu.push(this.currentCpu), this.startCpuProfiling = !1;
484
484
  }
485
- this.logsAccums.mem.push(this.currentMem), this.logsAccums.fpsFixed.push(h), this.logsAccums.fps.push(u), this.logsAccums.gpu.push(d), this.overClock && typeof window.requestIdleCallback < "u" && (R.isOverLimit > 0 && u > h ? R.isOverLimit-- : F().overclockingFps && M({ overclockingFps: !1 })), n >= this.paramTime + 1e3 / this.logsPerSecond && (this.paramLogger({
485
+ this.logsAccums.mem.push(this.currentMem), this.logsAccums.fpsFixed.push(h), this.logsAccums.fps.push(u), this.logsAccums.gpu.push(d), this.overClock && typeof window.requestIdleCallback < "u" && (R.isOverLimit > 0 && u > h ? R.isOverLimit-- : F().overclockingFps && I({ overclockingFps: !1 })), n >= this.paramTime + 1e3 / this.logsPerSecond && (this.paramLogger({
486
486
  cpu: V(this.logsAccums.cpu),
487
487
  gpu: V(this.logsAccums.gpu),
488
488
  mem: V(this.logsAccums.mem),
@@ -490,7 +490,7 @@ class pt {
490
490
  duration: Math.round(o),
491
491
  maxMemory: this.maxMemory,
492
492
  frameCount: f
493
- }), this.logsAccums.mem = [], this.logsAccums.fps = [], this.logsAccums.gpu = [], this.logsAccums.cpu = [], this.paramFrame = this.frameId, this.paramTime = n), this.overClock && n - this.lastCalculateFixed >= 2 * 1e3 && (this.lastCalculateFixed = e, R.fpsLimit = Math.round(V(this.logsAccums.fpsFixed) / 10) * 100, M({ fpsLimit: R.fpsLimit / 10 }), this.logsAccums.fpsFixed = [], this.paramFrame = this.frameId, this.paramTime = n);
493
+ }), this.logsAccums.mem = [], this.logsAccums.fps = [], this.logsAccums.gpu = [], this.logsAccums.cpu = [], this.paramFrame = this.frameId, this.paramTime = n), this.overClock && n - this.lastCalculateFixed >= 2 * 1e3 && (this.lastCalculateFixed = e, R.fpsLimit = Math.round(V(this.logsAccums.fpsFixed) / 10) * 100, I({ fpsLimit: R.fpsLimit / 10 }), this.logsAccums.fpsFixed = [], this.paramFrame = this.frameId, this.paramTime = n);
494
494
  }
495
495
  if (!this.detected || !this.chartFrame)
496
496
  this.chartFrame = this.frameId, this.chartTime = n, this.circularId = 0;
@@ -572,7 +572,11 @@ class pt {
572
572
  }
573
573
  this.query = null;
574
574
  }
575
- this.queryCreated = !1, this.queryHasResult = !1;
575
+ if (this.queryCreated = !1, this.queryHasResult = !1, window.performance)
576
+ try {
577
+ performance.clearMarks("cpu-started"), performance.clearMarks("cpu-finished"), performance.clearMeasures("cpu-duration");
578
+ } catch {
579
+ }
576
580
  }
577
581
  }
578
582
  const ht = (t) => {
@@ -768,7 +772,7 @@ function bt(t) {
768
772
  total: n + e
769
773
  };
770
774
  }
771
- const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.updateWorldMatrix, Oe = I.Object3D.prototype.updateMatrix, Ie = ["calls", "triangles", "points", "lines"], Me = ["gpu", "cpu", "mem", "fps"], xt = (t) => /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
775
+ const Le = M.Object3D.prototype.updateMatrixWorld, Ce = M.Object3D.prototype.updateWorldMatrix, Oe = M.Object3D.prototype.updateMatrix, Me = ["calls", "triangles", "points", "lines"], Ie = ["gpu", "cpu", "mem", "fps"], xt = (t) => /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
772
776
  t
773
777
  ), Te = (t, e) => {
774
778
  t.defines || (t.defines = {}), t.defines.muiPerf || (t.defines = Object.assign(t.defines || {}, {
@@ -784,7 +788,7 @@ const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.upd
784
788
  matrixUpdate: d
785
789
  }) => {
786
790
  const { gl: f, scene: h } = De();
787
- M({ gl: f, scene: h });
791
+ I({ gl: f, scene: h });
788
792
  const u = 1e3;
789
793
  let g = 0;
790
794
  const r = J(() => {
@@ -796,7 +800,7 @@ const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.upd
796
800
  logsPerSecond: e || 10,
797
801
  gl: f.getContext(),
798
802
  chartLogger: (l) => {
799
- M({ chart: l });
803
+ I({ chart: l });
800
804
  },
801
805
  paramLogger: (l) => {
802
806
  var C;
@@ -809,18 +813,18 @@ const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.upd
809
813
  totalTime: l.duration,
810
814
  frameCount: l.frameCount
811
815
  };
812
- M({ log: E });
816
+ I({ log: E });
813
817
  const { accumulated: _ } = F(), b = f.info.render;
814
818
  _.totalFrames++, _.gl.calls += b.calls, _.gl.triangles += b.triangles, _.gl.points += b.points, _.gl.lines += b.lines, _.log.gpu += l.gpu, _.log.cpu += l.cpu, _.log.mem += l.mem, _.log.fps += l.fps;
815
- for (let w = 0; w < Ie.length; w++) {
816
- const L = Ie[w], O = b[L];
819
+ for (let w = 0; w < Me.length; w++) {
820
+ const L = Me[w], O = b[L];
817
821
  O > _.max.gl[L] && (_.max.gl[L] = O);
818
822
  }
819
- for (let w = 0; w < Me.length; w++) {
820
- const L = Me[w], O = l[L];
823
+ for (let w = 0; w < Ie.length; w++) {
824
+ const L = Ie[w], O = l[L];
821
825
  O > _.max.log[L] && (_.max.log[L] = O);
822
826
  }
823
- M({ accumulated: _ });
827
+ I({ accumulated: _ });
824
828
  const S = {
825
829
  calls: f.info.render.calls,
826
830
  triangles: f.info.render.triangles,
@@ -835,7 +839,7 @@ const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.upd
835
839
  }), i = f.getContext();
836
840
  let m = null, c = null;
837
841
  const s = i.getExtension("WEBGL_debug_renderer_info"), y = i.getParameter(i.VERSION);
838
- return s && (m = i.getParameter(s.UNMASKED_RENDERER_WEBGL), c = i.getParameter(s.UNMASKED_VENDOR_WEBGL)), c || (c = "Unknown vendor"), m || (m = i.getParameter(i.RENDERER)), M({
842
+ return s && (m = i.getParameter(s.UNMASKED_RENDERER_WEBGL), c = i.getParameter(s.UNMASKED_VENDOR_WEBGL)), c || (c = "Unknown vendor"), m || (m = i.getParameter(i.RENDERER)), I({
839
843
  startTime: window.performance.now(),
840
844
  infos: {
841
845
  version: y,
@@ -845,18 +849,18 @@ const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.upd
845
849
  }), a;
846
850
  }, [t, n, e, f]);
847
851
  return P(() => {
848
- r && (r.overClock = t || !1, t === !1 && (M({ overclockingFps: !1 }), R.value = 0, R.isOverLimit = 0), r.chartHz = (n == null ? void 0 : n.hz) || 60, r.chartLen = (n == null ? void 0 : n.length) || 120);
852
+ r && (r.overClock = t || !1, t === !1 && (I({ overclockingFps: !1 }), R.value = 0, R.isOverLimit = 0), r.chartHz = (n == null ? void 0 : n.hz) || 60, r.chartLen = (n == null ? void 0 : n.length) || 120);
849
853
  }, [r, t, n == null ? void 0 : n.hz, n == null ? void 0 : n.length]), P(() => {
850
854
  if (!f.info) return;
851
- f.info.autoReset = !1, d && (I.Object3D.prototype.updateMatrixWorld = function(...m) {
855
+ f.info.autoReset = !1, d && (M.Object3D.prototype.updateMatrixWorld = function(...m) {
852
856
  return this.matrixWorldNeedsUpdate || m[0], Le.apply(this, m);
853
- }, I.Object3D.prototype.updateWorldMatrix = function(...m) {
857
+ }, M.Object3D.prototype.updateWorldMatrix = function(...m) {
854
858
  return Ce.apply(this, m);
855
- }, I.Object3D.prototype.updateMatrix = function(...m) {
859
+ }, M.Object3D.prototype.updateMatrix = function(...m) {
856
860
  return Oe.apply(this, m);
857
861
  });
858
862
  const a = Qe(() => {
859
- F().paused && M({ paused: !1 }), r == null || r.begin("profiler"), window.performance && (window.performance.mark("cpu-started"), r.startCpuProfiling = !0), f.info.reset();
863
+ F().paused && I({ paused: !1 }), r == null || r.begin("profiler"), window.performance && (window.performance.mark("cpu-started"), r.startCpuProfiling = !0), f.info.reset();
860
864
  }), i = Ye(() => {
861
865
  var y, l;
862
866
  r == null || r.end("profiler"), r && !r.paused && (r.nextFrame(window.performance.now()), t && typeof window.requestIdleCallback < "u" && (r.idleCbId = requestIdleCallback(r.nextFps)));
@@ -864,7 +868,7 @@ const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.upd
864
868
  if (m - g > u) {
865
869
  g = m;
866
870
  const E = bt(h), _ = r.currentMem || 0;
867
- M({
871
+ I({
868
872
  estimatedMemory: {
869
873
  vram: E.total / 1024 / 1024,
870
874
  // ฤแป•i ra MB
@@ -878,7 +882,7 @@ const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.upd
878
882
  if (!o) return;
879
883
  const c = {}, s = /* @__PURE__ */ new Map();
880
884
  h.traverse((E) => {
881
- if (E instanceof I.Mesh || E instanceof I.Points) {
885
+ if (E instanceof M.Mesh || E instanceof M.Points) {
882
886
  if (!E.material) return;
883
887
  let _ = E.material.uuid;
884
888
  const b = Array.isArray(E.material) && E.material.length > 1;
@@ -897,17 +901,17 @@ const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.upd
897
901
  visible: !0
898
902
  });
899
903
  }
900
- }), s.size !== F().programs.size && (ht(s), M({
904
+ }), s.size !== F().programs.size && (ht(s), I({
901
905
  programs: s,
902
906
  triggerProgramsUpdate: F().triggerProgramsUpdate + 1
903
907
  }));
904
908
  });
905
909
  return () => {
906
910
  var m;
907
- r && typeof window.cancelIdleCallback < "u" && window.cancelIdleCallback(r.idleCbId), (m = r == null ? void 0 : r.dispose) == null || m.call(r), d && (I.Object3D.prototype.updateMatrixWorld = Le, I.Object3D.prototype.updateWorldMatrix = Ce, I.Object3D.prototype.updateMatrix = Oe), a(), i();
911
+ r && typeof window.cancelIdleCallback < "u" && window.cancelIdleCallback(r.idleCbId), (m = r == null ? void 0 : r.dispose) == null || m.call(r), d && (M.Object3D.prototype.updateMatrixWorld = Le, M.Object3D.prototype.updateWorldMatrix = Ce, M.Object3D.prototype.updateMatrix = Oe), a(), i();
908
912
  };
909
913
  }, [r, f, h, o, t, d]), P(() => {
910
- const a = Xe(() => (r && (r.paused = !0, M({
914
+ const a = Xe(() => (r && (r.paused = !0, I({
911
915
  paused: !0,
912
916
  log: {
913
917
  maxMemory: 0,
@@ -946,11 +950,11 @@ function Lt(t) {
946
950
  const n = t.getIndex();
947
951
  return e += n ? n.count * n.itemSize * n.array.BYTES_PER_ELEMENT : 0, e;
948
952
  }
949
- const Ct = "_perfS_ans5i_1", Ot = "_containerHeight_ans5i_16", It = "_topLeft_ans5i_21", Mt = "_topRight_ans5i_22", Tt = "_bottomLeft_ans5i_23", At = "_bottomRight_ans5i_24", Rt = "_minimal_ans5i_26", Nt = "_perfIContainer_ans5i_30", Ft = "_perfI_ans5i_30", Pt = "_perfB_ans5i_69", Ut = "_toggleContainer_ans5i_83", Dt = "_toggle_ans5i_83", Gt = "_activeTab_ans5i_105", Wt = "_containerScroll_ans5i_110", Bt = "_programGeo_ans5i_115", jt = "_programHeader_ans5i_120", Vt = "_headerLeft_ans5i_149", Ht = "_programTitle_ans5i_156", kt = "_toggleArrow_ans5i_166", qt = "_programConsole_ans5i_200", zt = "_programsContainer_ans5i_218", $t = "_headerRight_ans5i_222", Kt = "_metricBadge_ans5i_228", Qt = "_programsULHeader_ans5i_246", Yt = "_programsUL_ans5i_246", Xt = "_programsGeoLi_ans5i_309", Jt = "_graph_ans5i_324", Zt = "_visibilityBtn_ans5i_354", er = "_active_ans5i_105", v = {
953
+ const Ct = "_perfS_ans5i_1", Ot = "_containerHeight_ans5i_16", Mt = "_topLeft_ans5i_21", It = "_topRight_ans5i_22", Tt = "_bottomLeft_ans5i_23", At = "_bottomRight_ans5i_24", Rt = "_minimal_ans5i_26", Nt = "_perfIContainer_ans5i_30", Ft = "_perfI_ans5i_30", Pt = "_perfB_ans5i_69", Ut = "_toggleContainer_ans5i_83", Dt = "_toggle_ans5i_83", Gt = "_activeTab_ans5i_105", Wt = "_containerScroll_ans5i_110", Bt = "_programGeo_ans5i_115", jt = "_programHeader_ans5i_120", Vt = "_headerLeft_ans5i_149", Ht = "_programTitle_ans5i_156", kt = "_toggleArrow_ans5i_166", qt = "_programConsole_ans5i_200", zt = "_programsContainer_ans5i_218", $t = "_headerRight_ans5i_222", Kt = "_metricBadge_ans5i_228", Qt = "_programsULHeader_ans5i_246", Yt = "_programsUL_ans5i_246", Xt = "_programsGeoLi_ans5i_309", Jt = "_graph_ans5i_324", Zt = "_visibilityBtn_ans5i_354", er = "_active_ans5i_105", v = {
950
954
  perfS: Ct,
951
955
  containerHeight: Ot,
952
- topLeft: It,
953
- topRight: Mt,
956
+ topLeft: Mt,
957
+ topRight: It,
954
958
  bottomLeft: Tt,
955
959
  bottomRight: At,
956
960
  minimal: Rt,
@@ -1297,7 +1301,7 @@ const Ct = "_perfS_ans5i_1", Ot = "_containerHeight_ans5i_16", It = "_topLeft_an
1297
1301
  fps: new Float32Array(e.length * 3),
1298
1302
  cpu: new Float32Array(e.length * 3),
1299
1303
  gpu: new Float32Array(e.length * 3)
1300
- }), [e]), o = T(null), d = T(null), f = T(null), h = T(null), u = J(() => new I.Vector3(0, 0, 0), []), g = (r, a = 1, i, m) => {
1304
+ }), [e]), o = T(null), d = T(null), f = T(null), h = T(null), u = J(() => new M.Vector3(0, 0, 0), []), g = (r, a = 1, i, m) => {
1301
1305
  let c = 0;
1302
1306
  const { width: s, height: y } = m, l = F().chart.data[r];
1303
1307
  if (!l || l.length === 0)
@@ -1333,7 +1337,7 @@ const Ct = "_perfS_ans5i_1", Ot = "_containerHeight_ans5i_16", It = "_topLeft_an
1333
1337
  args: [n.fps, 3],
1334
1338
  array: n.fps,
1335
1339
  itemSize: 3,
1336
- usage: I.DynamicDrawUsage,
1340
+ usage: M.DynamicDrawUsage,
1337
1341
  needsUpdate: !0
1338
1342
  }
1339
1343
  ) }),
@@ -1364,7 +1368,7 @@ const Ct = "_perfS_ans5i_1", Ot = "_containerHeight_ans5i_16", It = "_topLeft_an
1364
1368
  array: n.gpu,
1365
1369
  args: [n.gpu, 3],
1366
1370
  itemSize: 3,
1367
- usage: I.DynamicDrawUsage,
1371
+ usage: M.DynamicDrawUsage,
1368
1372
  needsUpdate: !0
1369
1373
  }
1370
1374
  ) }),
@@ -1387,7 +1391,7 @@ const Ct = "_perfS_ans5i_1", Ot = "_containerHeight_ans5i_16", It = "_topLeft_an
1387
1391
  array: n.cpu,
1388
1392
  args: [n.cpu, 3],
1389
1393
  itemSize: 3,
1390
- usage: I.DynamicDrawUsage,
1394
+ usage: M.DynamicDrawUsage,
1391
1395
  needsUpdate: !0
1392
1396
  }
1393
1397
  ) }),
@@ -1681,7 +1685,7 @@ const N = {
1681
1685
  {
1682
1686
  className: `${v.toggle} ${o === t ? v.activeTab : ""}`,
1683
1687
  onClick: () => {
1684
- n(!0), M({ tab: t });
1688
+ n(!0), I({ tab: t });
1685
1689
  },
1686
1690
  children: e
1687
1691
  }
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,GAAG,CAAC;KACb;IACD,UAAU,WAAW;QACnB,MAAM,EAAE,GAAG,CAAC;KACb;CACF;AAED,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAKD,qBAAa,MAAM;IACjB,KAAK,EAAE,MAAM,EAAE,CAAQ;IACvB,QAAQ,EAAE,GAAG,EAAE,CAAM;IACrB,EAAE,EAAE,GAAG,CAAC;IACR,SAAS,EAAE,GAAG,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,OAAO,CAAS;IACxB,SAAS,EAAE,OAAO,CAAS;IAC3B,cAAc,EAAE,OAAO,CAAS;IAChC,YAAY,EAAE,OAAO,CAAS;IAC9B,QAAQ,EAAE,OAAO,CAAQ;IACzB,SAAS,EAAE,MAAM,EAAE,CAAM;IACzB,SAAS,EAAE,MAAM,EAAE,CAAM;IACzB,YAAY,EAAE,OAAO,EAAE,CAAM;IAC7B,UAAU,EAAE,UAAU,CAMpB;IACF,QAAQ,EAAE,MAAM,EAAE,CAAM;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAM;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAM;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAM;IACxB,WAAW,EAAE,GAAG,CAAY;IAC5B,QAAQ,EAAE,GAAG,CAAY;IACzB,WAAW,EAAE,GAAG,CAAY;IAC5B,QAAQ,EAAE,MAAM,CAAM;IACtB,aAAa,EAAE,MAAM,CAAM;IAC3B,SAAS,EAAE,MAAM,CAAQ;IACzB,OAAO,EAAE,MAAM,CAAM;IACrB,iBAAiB,EAAE,OAAO,CAAS;IACnC,kBAAkB,EAAE,MAAM,CAAK;IAC/B,UAAU,EAAE,MAAM,CAAK;IACvB,cAAc,EAAE,MAAM,CAAK;IAC3B,SAAS,EAAE,MAAM,CAAK;IACtB,aAAa,EAAE,MAAM,CAAK;IAC1B,UAAU,EAAE,MAAM,CAAK;IACvB,QAAQ,EAAE,MAAM,CAAK;IACrB,OAAO,EAAE,MAAM,CAAK;IACpB,KAAK,EAAE,MAAM,CAAK;IAClB,QAAQ,EAAE,MAAM,CAAK;IACrB,YAAY,EAAE,MAAM,CAAK;IACzB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAa;IACrC,UAAU,EAAE,MAAM,CAAK;IACvB,UAAU,EAAE,MAAM,CAAK;IACvB,UAAU,EAAE,MAAM,CAAK;IACvB,SAAS,EAAE,MAAM,CAAK;IACtB,GAAG,EAAE,GAAG,CAAY;IACpB,EAAE,EAAE,MAAM,CAAK;gBAEH,QAAQ,GAAE,MAAW;IAgBjC,OAAO;IAcP;;OAEG;IACH,OAAO;IAcP;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM;IAQlB,OAAO,CAAC,CAAC,EAAE,GAAG;IAad;;;OAGG;IACH,SAAS,CAAC,GAAG,EAAE,GAAG;IAsJlB,QAAQ;IA+CR,MAAM;IAcN;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM;IAKlB;;;OAGG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM;IAKhB,YAAY,CAAC,IAAI,EAAE,MAAM;IAazB,OAAO;CAoBR"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,GAAG,CAAC;KACb;IACD,UAAU,WAAW;QACnB,MAAM,EAAE,GAAG,CAAC;KACb;CACF;AAED,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAKD,qBAAa,MAAM;IACjB,KAAK,EAAE,MAAM,EAAE,CAAQ;IACvB,QAAQ,EAAE,GAAG,EAAE,CAAM;IACrB,EAAE,EAAE,GAAG,CAAC;IACR,SAAS,EAAE,GAAG,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,OAAO,CAAS;IACxB,SAAS,EAAE,OAAO,CAAS;IAC3B,cAAc,EAAE,OAAO,CAAS;IAChC,YAAY,EAAE,OAAO,CAAS;IAC9B,QAAQ,EAAE,OAAO,CAAQ;IACzB,SAAS,EAAE,MAAM,EAAE,CAAM;IACzB,SAAS,EAAE,MAAM,EAAE,CAAM;IACzB,YAAY,EAAE,OAAO,EAAE,CAAM;IAC7B,UAAU,EAAE,UAAU,CAMpB;IACF,QAAQ,EAAE,MAAM,EAAE,CAAM;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAM;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAM;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAM;IACxB,WAAW,EAAE,GAAG,CAAY;IAC5B,QAAQ,EAAE,GAAG,CAAY;IACzB,WAAW,EAAE,GAAG,CAAY;IAC5B,QAAQ,EAAE,MAAM,CAAM;IACtB,aAAa,EAAE,MAAM,CAAM;IAC3B,SAAS,EAAE,MAAM,CAAQ;IACzB,OAAO,EAAE,MAAM,CAAM;IACrB,iBAAiB,EAAE,OAAO,CAAS;IACnC,kBAAkB,EAAE,MAAM,CAAK;IAC/B,UAAU,EAAE,MAAM,CAAK;IACvB,cAAc,EAAE,MAAM,CAAK;IAC3B,SAAS,EAAE,MAAM,CAAK;IACtB,aAAa,EAAE,MAAM,CAAK;IAC1B,UAAU,EAAE,MAAM,CAAK;IACvB,QAAQ,EAAE,MAAM,CAAK;IACrB,OAAO,EAAE,MAAM,CAAK;IACpB,KAAK,EAAE,MAAM,CAAK;IAClB,QAAQ,EAAE,MAAM,CAAK;IACrB,YAAY,EAAE,MAAM,CAAK;IACzB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAa;IACrC,UAAU,EAAE,MAAM,CAAK;IACvB,UAAU,EAAE,MAAM,CAAK;IACvB,UAAU,EAAE,MAAM,CAAK;IACvB,SAAS,EAAE,MAAM,CAAK;IACtB,GAAG,EAAE,GAAG,CAAY;IACpB,EAAE,EAAE,MAAM,CAAK;gBAEH,QAAQ,GAAE,MAAW;IAgBjC,OAAO;IAcP;;OAEG;IACH,OAAO;IAcP;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM;IAQlB,OAAO,CAAC,CAAC,EAAE,GAAG;IAad;;;OAGG;IACH,SAAS,CAAC,GAAG,EAAE,GAAG;IAsJlB,QAAQ;IA+CR,MAAM;IAcN;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM;IAKlB;;;OAGG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM;IAKhB,YAAY,CAAC,IAAI,EAAE,MAAM;IAazB,OAAO;CA6BR"}
package/package.json CHANGED
@@ -1,16 +1,13 @@
1
1
  {
2
2
  "name": "r3f-performance",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "license": "MIT",
5
5
  "description": "A performance monitor for React Three Fiber. Track FPS, draw calls, memory, and GPU usage.",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/anhldh/r3f-performance.git"
9
9
  },
10
- "homepage": "https://github.com/anhldh/r3f-performance#readme",
11
- "bugs": {
12
- "url": "https://github.com/anhldh/r3f-performance/issues"
13
- },
10
+ "homepage": "https://github.com/anhldh/r3f-performance",
14
11
  "keywords": [
15
12
  "react-three-fiber",
16
13
  "r3f",