module.exports=function(){"use strict";function t(){if(typeof window.performance==="undefined"){window.performance={}}if(!window.performance.now){var t=Date.now();if(performance.timing&&performance.timing.navigationStart){t=performance.timing.navigationStart}window.performance.now=function e(){return Date.now()-t}}if(!window.performance.mark){window.performance.mark=function(){}}if(!window.performance.measure){window.performance.measure=function(){}}if(!window.performance.memory){window.performance.memory={usedJSHeapSize:0,totalJSHeapSize:0}}}var e=Math.round(window.devicePixelRatio||1);var i=function t(e,i){this._color=i||"#666";this._canvas=document.createElement("canvas");this._ctx=this._canvas.getContext("2d");this._canvas.className="pstats-canvas";e.appendChild(this._canvas)};i.prototype.init=function t(i,a){var n=i*e;var s=a*e;this._canvas.width=n;this._canvas.height=s;this._canvas.style.width=i+"px";this._canvas.style.height=a+"px";this._ctx.globalAlpha=1;this._ctx.fillStyle="#444";this._ctx.fillRect(0,0,n,s)};var a=Math.round(window.devicePixelRatio||1);var n=function(t){function e(e,i){t.call(this,e,i);this._current=0;this._max=0}if(t)e.__proto__=t;e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.draw=function t(e,i){var n=this._canvas.width;var s=this._canvas.height;this._current+=(e-this._current)*.1;this._max*=.99;if(this._current>this._max){this._max=this._current}var o=Math.round((1-this._current/this._max)*s);this._ctx.globalAlpha=1;this._ctx.drawImage(this._canvas,a,0,n-a,s,0,0,n-a,s);if(i){this._ctx.fillStyle="#444";this._ctx.fillRect(n-a,0,a,s);this._ctx.fillStyle="#b70000";this._ctx.fillRect(n-a,o,a,s-o);this._ctx.globalAlpha=.5;this._ctx.fillStyle="#fff";this._ctx.fillRect(n-a,o,a,a)}else{this._ctx.fillStyle="#444";this._ctx.fillRect(n-a,0,a,s);this._ctx.fillStyle=this._color;this._ctx.fillRect(n-a,o,a,s-o);this._ctx.globalAlpha=.5;this._ctx.fillStyle="#fff";this._ctx.fillRect(n-a,o,a,a)}};return e}(i);var s=Math.round(window.devicePixelRatio||1);var o=function(t){function e(e,i){t.call(this,e,i);this._threshold=0;this._canvas2=document.createElement("canvas");this._ctx2=this._canvas2.getContext("2d")}if(t)e.__proto__=t;e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.init=function e(i,a){t.prototype.init.call(this,i,a);var n=i*s;var o=a*s;this._canvas2.width=n;this._canvas2.height=o;this._canvas2.style.width=i+"px";this._canvas2.style.height=a+"px";this._ctx2.globalAlpha=1;this._ctx2.fillStyle="#444";this._ctx2.fillRect(0,0,n,o)};e.prototype.draw=function t(e,i){var a=this._canvas.width;var n=this._canvas.height;this._ctx.globalAlpha=1;this._ctx2.globalAlpha=1;if(e>this._threshold){var o=(e-e%n)/n;var r=n*(o+1);var l=this._threshold;this._threshold=r;var c=l/r;this._ctx2.drawImage(this._canvas,0,0);this._ctx.fillStyle="#444";this._ctx.fillRect(0,0,a,n);this._ctx.drawImage(this._canvas2,s,0,a-s,n,0,Math.round((1-c)*n),a-s,n)}else{this._ctx.drawImage(this._canvas,s,0,a-s,n,0,0,a-s,n)}var h=Math.round(n*(1-e/this._threshold));if(i){this._ctx.fillStyle="#444";this._ctx.fillRect(a-s,0,s,n);this._ctx.fillStyle="#b70000";this._ctx.fillRect(a-s,h,s,n-h);this._ctx.globalAlpha=.5;this._ctx.fillStyle="#fff";this._ctx.fillRect(a-s,h,s,s)}else{this._ctx.fillStyle="#444";this._ctx.fillRect(a-s,0,s,n);this._ctx.fillStyle=this._color;this._ctx.fillRect(a-s,h,s,n-h);this._ctx.globalAlpha=.5;this._ctx.fillStyle="#fff";this._ctx.fillRect(a-s,h,s,s)}};return e}(i);var r=Math.round(window.devicePixelRatio||1);var l=function(t){function e(e,i,a,n){t.call(this,e,i);this._min=a;this._max=n}if(t)e.__proto__=t;e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.draw=function t(e,i){var a=this._canvas.width;var n=this._canvas.height;var s=(e-this._min)/(this._max-this._min);var o=Math.round((1-s)*n);this._ctx.globalAlpha=1;this._ctx.drawImage(this._canvas,r,0,a-r,n,0,0,a-r,n);if(i){this._ctx.fillStyle="#444";this._ctx.fillRect(a-r,0,r,n);this._ctx.fillStyle="#b70000";this._ctx.fillRect(a-r,o,r,n-o);this._ctx.globalAlpha=.5;this._ctx.fillStyle="#fff";this._ctx.fillRect(a-r,o,r,r)}else{this._ctx.fillStyle="#444";this._ctx.fillRect(a-r,0,r,n);this._ctx.fillStyle=this._color;this._ctx.fillRect(a-r,o,r,n-o);this._ctx.globalAlpha=.5;this._ctx.fillStyle="#fff";this._ctx.fillRect(a-r,o,r,r)}};return e}(i);var c=Math.round(window.devicePixelRatio||1);var h=function t(e,i){this._colors=i;this._canvas=document.createElement("canvas");this._ctx=this._canvas.getContext("2d");this._canvas.className="pstats-canvas";e.appendChild(this._canvas)};h.prototype.init=function t(e,i,a){var n=e*c;var s=i*c;this._canvas.width=n;this._canvas.height=s*a;this._canvas.style.width=e+"px";this._canvas.style.height=i*a+"px";this._ctx.globalAlpha=1;this._ctx.fillStyle="#444";this._ctx.fillRect(0,0,n,s*a)};h.prototype.draw=function t(e){var i=this;var a=this._canvas.width;var n=this._canvas.height;this._ctx.globalAlpha=1;this._ctx.drawImage(this._canvas,c,0,a-c,n,0,0,a-c,n);var s=0;for(var o=0;o=this._opts.average){this._averageValue=this._accumValue/this._accumSamples;this._accumValue=0;this._accumStart=i;this._accumSamples=0}}};_.value.get=function(){return this._value};_.value.set=function(t){this._value=t};p.prototype.sample=function t(){this._average(this._value)};p.prototype.human=function t(){var e=this._opts.average?this._averageValue:this._value;return Math.round(e*100)/100};p.prototype.alarm=function t(){return this._opts.below&&this._valuethis._opts.over};Object.defineProperties(p.prototype,_);var f=function(t){function e(e,i){t.call(this,e,i);this._time=window.performance.now()}if(t)e.__proto__=t;e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.start=function t(){this._time=window.performance.now()};e.prototype.end=function t(){this._value=window.performance.now()-this._time;this._average(this._value)};e.prototype.tick=function t(){this.end();this.start()};e.prototype.frame=function t(){var e=window.performance.now();var i=e-this._time;this._total++;var a=this._opts.average||1e3;if(i>a){this._value=this._total*1e3/i;this._total=0;this._time=e;this._average(this._value)}};return e}(p);var u=Math.log(1024);var v=["Bytes","KB","MB","GB","TB"];function d(t){var e=100;var i=Math.floor(Math.log(t)/u);if(t===0){return"n/a"}return Math.round(t*e/Math.pow(1024,i))/e+" "+v[i]}var m=function(t){function e(e,i,a){t.call(this,i,a);this._stats=e;this._start=0;if(a.extension.indexOf("memory.")===0){this._field=a.extension.substring(7)}}if(t)e.__proto__=t;e.prototype=Object.create(t&&t.prototype);e.prototype.constructor=e;e.prototype.snapshot=function t(){this._value=this._stats[this._field]};e.prototype.start=function t(){this._start=this._stats[this._field]};e.prototype.end=function t(){this._value=this._stats[this._field]-this._start};e.prototype.human=function e(){return d(t.prototype.human.call(this))};return e}(p);var x=function t(){var e=window.performance.memory;if(e.totalJSHeapSize===0){console.warn("totalJSHeapSize === 0, performance.memory is only available in Chrome.")}this._used=0;this._total=0;this._lastUsed=0};var w={alarm:{},used:{},total:{}};x.prototype.tick=function t(){this._lastUsed=this._used;this._used=window.performance.memory.usedJSHeapSize;this._total=window.performance.memory.totalJSHeapSize};w.alarm.get=function(){return this._used-this._lastUsed<0};w.used.get=function(){return window.performance.memory.usedJSHeapSize};w.total.get=function(){return this._total};x.prototype.counter=function t(e,i){return new m(this,e,i)};Object.defineProperties(x.prototype,w);var y={memory:x};var g=100;var b=10;var S="\n .pstats {\n position: fixed;\n z-index: 9999;\n\n padding: 5px;\n width: "+(g+150)+"px;\n right: 5px;\n bottom: 5px;\n\n font-size: 10px;\n font-family: 'Roboto Condensed', tahoma, sans-serif;\n overflow: hidden;\n user-select: none;\n cursor: default;\n\n background: #222;\n border-radius: 3px;\n }\n\n .pstats-container {\n display: block;\n position: relative;\n color: #888;\n white-space: nowrap;\n }\n\n .pstats-item {\n position: absolute;\n width: 250px;\n height: 12px;\n left: 0px;\n }\n\n .pstats-label {\n position: absolute;\n width: 150px;\n height: 12px;\n text-align: left;\n transition: background 0.3s;\n }\n\n .pstats-label.alarm {\n color: #ccc;\n background: #800;\n\n transition: background 0s;\n }\n\n .pstats-counter-id {\n position: absolute;\n width: 90px;\n left: 0px;\n }\n\n .pstats-counter-value {\n position: absolute;\n width: 60px;\n left: 90px;\n text-align: right;\n }\n\n .pstats-canvas {\n display: block;\n position: absolute;\n right: 0px;\n top: 1px;\n }\n\n .pstats-fraction {\n position: absolute;\n width: 250px;\n left: 0px;\n }\n\n .pstats-legend {\n position: absolute;\n width: 150px;\n\n text-align: right;\n }\n\n .pstats-legend > span {\n position: absolute;\n right: 0px;\n }\n";var R=document.createElement("style");R.type="text/css";R.textContent=S;document.head.appendChild(R);var C=function t(e,i){var a=this;i=i||{};this._showGraph=i.showGraph!==undefined?i._showGraph:true;this._values=i.values||{};this._fractions=i.fractions||[];this._id2counter={};this._id2item={};this._name2extStats={};if(i.css){var s=document.createElement("style");s.type="text/css";s.textContent=i.css;document.head.appendChild(s)}if(i.extensions){for(var r=0;r0);l.valueText.nodeValue=r;if(e._showGraph){l.graph.draw(s.value,o)}}}if(this._showGraph){for(var c=0;c