var t,e,n,a,o,i,r,c,s,u;t=function(){return new Promise(function(t){var a=u(),o=s({canvas:a,isCanvasVisible:n,isDurationVisible:n,maxFastDeviceDuration:e});n||a.remove(),t(o)})},e=50,n=!1,a=function(t,e){return Math.floor(Math.random()*(t-e)+e)},o=function(t,e){for(var n=t.getContext("2d"),o=0;o<1e3;o++){if(e())return;var i=["rgba(23, 106, 182, ".concat(Math.random(),")"),"rgba(251, 155, 57, ".concat(Math.random(),")"),"rgba(255, 255, 255, ".concat(Math.random(),")")],r=a(0,t.width),c=a(0,t.height),s=15*Math.random(),u=i[a(0,i.length)];n.beginPath(),n.arc(r,c,s,0,2*Math.PI),n.shadowColor=u,n.strokeStyle=u,n.fillStyle=u,n.fill(),n.stroke(),n.closePath()}},r=function(t){i||((i=document.createElement("div")).style.cssText="position: absolute; top: 0; left: 0; font-size: 20px; color: #000; background-color: #fff;z-index:999;",document.body.appendChild(i)),i.innerHTML="".concat(t,"ms")},c=function(t){var e=t.canvas,n=t.isCanvasVisible,a=t.isDurationVisible,i=t.maxFastDeviceDuration,c=Date.now(),s=c+1*i,u=e.getContext("2d");o(e,function(){return Date.now()>s}),u.clearRect(0,0,e.width,e.height);var l=Date.now()-c;if(a&&r(Date.now()>s?">".concat(l):l),n){var v=Date.now()+1*i;o(e,function(){return Date.now()>v})}return l},s=function(t){for(var e=t.canvas,n=t.isCanvasVisible,a=void 0!==n&&n,o=t.isDurationVisible,i=void 0!==o&&o,r=t.maxFastDeviceDuration,s=[],u=0;u<5;u++)s.push(c({canvas:e,isCanvasVisible:a,isDurationVisible:i,maxFastDeviceDuration:r}));return s.reduce(function(t,e){return t+e},0)/s.length},u=function(){var t=document.createElement("canvas");return t.width=1e3,t.height=1e3,t.style.cssText="position: absolute; top: 0; left: 0; width: 1000px; height: 1000px;",n||(t.style.opacity="0"),document.querySelector("body").appendChild(t),t},setTimeout(function(){window.CANVAS_PERFORMANCE_TEST=window.OffscreenCanvas&&!n?new Promise(function(t){var e,n="canvas-performance-test_worker.js";if(null==STATIC_PATH_REPLACED?void 0:STATIC_PATH_REPLACED.startsWith("http")){var a='importScripts("'.concat(STATIC_PATH_REPLACED,"/").concat(n,'");'),o=URL.createObjectURL(new Blob([a],{type:"text/javascript"}));e=new Worker(o),URL.revokeObjectURL(o)}else e=new Worker("/assets/".concat(n));e.onmessage=function(e){t(e.data.testDuration)}}).catch(function(){return t()}):t()},0);