canvaskit-wasm
Version:
A WASM version of Skia's Canvas API
112 lines (110 loc) • 217 kB
JavaScript
var CanvasKitInit = (function() {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
return (
function(CanvasKitInit) {
CanvasKitInit = CanvasKitInit || {};
var f;f||(f=typeof CanvasKitInit !== 'undefined' ? CanvasKitInit : {});
(function(a){a.ha=a.ha||[];a.ha.push(function(){a.MakeSWCanvasSurface=function(b){var c=b;if("CANVAS"!==c.tagName&&(c=document.getElementById(b),!c))throw"Canvas with id "+b+" was not found";if(b=a.MakeSurface(c.width,c.height))b.i=c;return b};a.MakeCanvasSurface||(a.MakeCanvasSurface=a.MakeSWCanvasSurface);a.MakeSurface=function(b,c){var d={width:b,height:c,colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul},e=b*c*4,h=a._malloc(e);if(d=this._getRasterDirectSurface(d,h,4*b))d.i=null,d.ec=
b,d.ac=c,d.dc=e,d.lb=h,d.getCanvas().clear(a.TRANSPARENT);return d};a.SkSurface.prototype.flush=function(){this._flush();if(this.i){var b=new Uint8ClampedArray(a.buffer,this.lb,this.dc);b=new ImageData(b,this.ec,this.ac);this.i.getContext("2d").putImageData(b,0,0)}};a.SkSurface.prototype.dispose=function(){this.lb&&a._free(this.lb);this.delete()};a.currentContext=a.currentContext||function(){};a.setCurrentContext=a.setCurrentContext||function(){}})})(f);
(function(a){a.ha=a.ha||[];a.ha.push(function(){a.MakeWebGLCanvasSurface=function(b,c,d){var e=b;if(!(0<e)){var h=b;if("CANVAS"!==h.tagName&&(h=document.getElementById(b),!h))throw"Canvas with id "+b+" was not found";e=h;var l={alpha:1,depth:1,stencil:0,antialias:1,premultipliedAlpha:1,preserveDrawingBuffer:0,preferLowPowerToHighPerformance:0,failIfMajorPerformanceCaveat:0,majorVersion:1,minorVersion:0,enableExtensionsByDefault:1,explicitSwapControl:0,renderViaOffscreenBackBuffer:0};e=!e||l.explicitSwapControl?
0:aa(e,l)}if(!e||0>e)throw"failed to create webgl context: err "+e;if(!(h||c&&d))throw"height and width must be provided with context";return(c=this._getWebGLSurface(e,c||h.width,d||h.height))?c:a.MakeSWCanvasSurface(b)};a.MakeCanvasSurface=a.MakeWebGLCanvasSurface})})(f);
(function(a){function b(a){return Math.round(Math.max(0,Math.min(a||0,255)))}a.Color=function(a,d,e,h){void 0===h&&(h=1);return b(255*h)<<24|b(a)<<16|b(d)<<8|b(e)<<0};a.getColorComponents=function(a){return[a>>16&255,a>>8&255,a>>0&255,(a>>24&255)/255]};a.multiplyByAlpha=function(a,d){return 1===d?a:b((a>>24&255)*d)<<24|a&16777215}})(f);var ba=!(new Function("try {return this===window;}catch(e){ return false;}"))();
(function(a){function b(b,c){if(!b||!b.length)return d;var e=a._malloc(b.length*c.BYTES_PER_ELEMENT);c.set(b,e/c.BYTES_PER_ELEMENT);return e}function c(b,c){if(!b||!b.length)return d;for(var e=a._malloc(b.length*b[0].length*c.BYTES_PER_ELEMENT),h=0,n=e/c.BYTES_PER_ELEMENT,q=0;q<b.length;q++)for(var t=0;t<b[0].length;t++)c[n+h]=b[q][t],h++;return e}a.onRuntimeInitialized=function(){a.SkMatrix={};a.SkMatrix.identity=function(){return[1,0,0,0,1,0,0,0,1]};a.SkMatrix.Ka=function(b){var c=b[0]*b[4]*b[8]+
b[1]*b[5]*b[6]+b[2]*b[3]*b[7]-b[2]*b[4]*b[6]-b[1]*b[3]*b[8]-b[0]*b[5]*b[7];return c?[(b[4]*b[8]-b[5]*b[7])/c,(b[2]*b[7]-b[1]*b[8])/c,(b[1]*b[5]-b[2]*b[4])/c,(b[5]*b[6]-b[3]*b[8])/c,(b[0]*b[8]-b[2]*b[6])/c,(b[2]*b[3]-b[0]*b[5])/c,(b[3]*b[7]-b[4]*b[6])/c,(b[1]*b[6]-b[0]*b[7])/c,(b[0]*b[4]-b[1]*b[3])/c]:a.SkMatrix.identity()};a.SkMatrix.mapPoints=function(a,b){if(b.length%2)throw"mapPoints requires an even length arr";for(var c=0;c<b.length;c+=2){var d=b[c],e=b[c+1],h=a[6]*d+a[7]*e+a[8],t=a[3]*d+a[4]*
e+a[5];b[c]=(a[0]*d+a[1]*e+a[2])/h;b[c+1]=t/h}return b};a.SkMatrix.multiply=function(a,b){for(var c=[0,0,0,0,0,0,0,0,0],d=0;3>d;d++)for(var e=0;3>e;e++)c[3*d+e]=a[3*d+0]*b[0+e]+a[3*d+1]*b[3+e]+(a[3*d+2]||0)*(b[6+e]||0);return c};a.SkMatrix.rotated=function(a,b,c){b=b||0;c=c||0;var d=Math.sin(a);a=Math.cos(a);return[a,-d,d*c+(1-a)*b+0,d,a,-d*b+(1-a)*c+0,0,0,1]};a.SkMatrix.scaled=function(a,b,c,d){c=c||0;d=d||0;return[a,0,c-a*c,0,b,d-b*d,0,0,1]};a.SkMatrix.skewed=function(a,b,c,d){return[1,a,-a*(c||
0),b,1,-b*(d||0),0,0,1]};a.SkMatrix.translated=function(a,b){return[1,0,a,0,1,b,0,0,1]};a.SkPath.prototype.addArc=function(a,b,c){this._addArc(a,b,c);return this};a.SkPath.prototype.addPath=function(){var a=Array.prototype.slice.call(arguments),b=a[0],c=!1;"boolean"===typeof a[a.length-1]&&(c=a.pop());if(1===a.length)this._addPath(b,1,0,0,0,1,0,0,0,1,c);else if(2===a.length)a=a[1],this._addPath(b,a[0],a[1],a[2],a[3],a[4],a[5],a[6]||0,a[7]||0,a[8]||1,c);else if(7===a.length||10===a.length)this._addPath(b,
a[1],a[2],a[3],a[4],a[5],a[6],a[7]||0,a[8]||0,a[9]||1,c);else return null;return this};a.SkPath.prototype.addRect=function(){if(1===arguments.length||2===arguments.length){var a=arguments[0];this._addRect(a.fLeft,a.fTop,a.fRight,a.fBottom,arguments[1]||!1)}else if(4===arguments.length||5===arguments.length)a=arguments,this._addRect(a[0],a[1],a[2],a[3],a[4]||!1);else return null;return this};a.SkPath.prototype.arc=function(b,c,d,m,n,q){b=a.LTRBRect(b-d,c-d,b+d,c+d);n=(n-m)/Math.PI*180-360*!!q;q=new a.SkPath;
q.addArc(b,m/Math.PI*180,n);this.addPath(q,!0);q.delete();return this};a.SkPath.prototype.arcTo=function(){var b=arguments;if(5===b.length)this._arcTo(b[0],b[1],b[2],b[3],b[4]);else if(4===b.length)this._arcTo(b[0],b[1],b[2],b[3]);else if(7===b.length)this._arcTo(a.LTRBRect(b[0],b[1],b[2],b[3]),b[4],b[5],b[6]);else throw"Invalid args for arcTo. Expected 4, 5, or 7, got "+b.length;return this};a.SkPath.prototype.close=function(){this._close();return this};a.SkPath.prototype.conicTo=function(a,b,c,
d,n){this._conicTo(a,b,c,d,n);return this};a.SkPath.prototype.cubicTo=function(a,b,c,d,n,q){this._cubicTo(a,b,c,d,n,q);return this};a.SkPath.prototype.dash=function(a,b,c){return this._dash(a,b,c)?this:null};a.SkPath.prototype.lineTo=function(a,b){this._lineTo(a,b);return this};a.SkPath.prototype.moveTo=function(a,b){this._moveTo(a,b);return this};a.SkPath.prototype.op=function(a,b){return this._op(a,b)?this:null};a.SkPath.prototype.quadTo=function(a,b,c,d){this._quadTo(a,b,c,d);return this};a.SkPath.prototype.simplify=
function(){return this._simplify()?this:null};a.SkPath.prototype.stroke=function(b){b=b||{};b.width=b.width||1;b.miter_limit=b.miter_limit||4;b.cap=b.cap||a.StrokeCap.Butt;b.join=b.join||a.StrokeJoin.Miter;b.precision=b.precision||1;return this._stroke(b)?this:null};a.SkPath.prototype.transform=function(){if(1===arguments.length){var a=arguments[0];this._transform(a[0],a[1],a[2],a[3],a[4],a[5],a[6]||0,a[7]||0,a[8]||1)}else if(6===arguments.length||9===arguments.length)a=arguments,this._transform(a[0],
a[1],a[2],a[3],a[4],a[5],a[6]||0,a[7]||0,a[8]||1);else throw"transform expected to take 1 or 9 arguments. Got "+arguments.length;return this};a.SkPath.prototype.trim=function(a,b,c){return this._trim(a,b,!!c)?this:null};a.SkVertices.prototype.applyBones=function(b){var c=a.HEAPF32;if(b&&b.length&&b[0].length){for(var e=a._malloc(b.length*b[0].length*b[0][0].length*c.BYTES_PER_ELEMENT),m=0,n=e/c.BYTES_PER_ELEMENT,q=0;q<b.length;q++)for(var t=0;t<b[0].length;t++)for(var w=0;w<b[0][0].length;w++)c[n+
m]=b[q][t][w],m++;c=e}else c=d;b=this._applyBones(c,b.length);a._free(c);return b};a.SkImage.prototype.encodeToData=function(){if(!arguments.length)return this._encodeToData();if(2===arguments.length){var a=arguments;return this._encodeToDataWithFormat(a[0],a[1])}throw"encodeToData expected to take 0 or 2 arguments. Got "+arguments.length;};a.SkCanvas.prototype.readPixels=function(b,c,d,m,n,q,t){n=n||a.AlphaType.Unpremul;q=q||a.ColorType.RGBA_8888;t=t||4*d;var e=m*t,h=a._malloc(e);if(!this._readPixels({width:d,
height:m,colorType:q,alphaType:n},h,t,b,c))return a._free(h),null;b=(new Uint8Array(a.HEAPU8.buffer,h,e)).slice();a._free(h);return b};a.SkCanvas.prototype.writePixels=function(b,c,d,m,n,q,t){if(b.byteLength%(c*d))throw"pixels length must be a multiple of the srcWidth * srcHeight";var e=b.byteLength/(c*d);q=q||a.AlphaType.Unpremul;t=t||a.ColorType.RGBA_8888;var h=e*c;e=a._malloc(b.byteLength);a.HEAPU8.set(b,e);b=this._writePixels({width:c,height:d,colorType:t,alphaType:q},e,h,m,n);a._free(e);return b};
a.SkFontMgr.prototype.MakeTypefaceFromData=function(b){b=new Uint8Array(b);var c=a._malloc(b.byteLength);a.HEAPU8.set(b,c);return(b=this._makeTypefaceFromData(c,b.byteLength))?b:null};a.ha&&a.ha.forEach(function(a){a()})};a.LTRBRect=function(a,b,c,d){return{fLeft:a,fTop:b,fRight:c,fBottom:d}};a.XYWHRect=function(a,b,c,d){return{fLeft:a,fTop:b,fRight:a+c,fBottom:b+d}};var d=0;a.MakeSkDashPathEffect=function(c,d){d||(d=0);if(!c.length||1===c.length%2)throw"Intervals array must have even length";var e=
b(c,a.HEAPF32);c=a._MakeSkDashPathEffect(e,c.length,d);a._free(e);return c};a.MakeImageFromEncoded=function(b){b=new Uint8Array(b);var c=a._malloc(b.byteLength);a.HEAPU8.set(b,c);b=a._decodeImage(c,b.byteLength);if(!b)return a._free(c),null;var d=b.delete.bind(b);b.delete=function(){a._free(c);d()};return b};a.MakeImageShader=function(b,c,d,m,n){if(!b)return null;m=m||!1;return n?(6===n.length&&n.push(0,0,1),a._MakeImageShader(b,c,d,m,n)):a._MakeImageShader(b,c,d,m)};a.Zb=function(b,c,d,m,n){var e=
b.byteLength/(c*d);d={width:c,height:d,alphaType:m,colorType:n};m=a._malloc(b.byteLength);a.HEAPU8.set(b,m);return a._MakeImage(d,m,b.byteLength,c*e)};a.MakeLinearGradientShader=function(c,d,l,m,n,q,t){var e=b(l,a.HEAP32);m=b(m,a.HEAPF32);t=t||0;q?(6===q.length&&q.push(0,0,1),c=a._MakeLinearGradientShader(c,d,e,m,l.length,n,t,q)):c=a._MakeLinearGradientShader(c,d,e,m,l.length,n,t);a._free(e);a._free(m);return c};a.MakeRadialGradientShader=function(c,d,l,m,n,q,t){var e=b(l,a.HEAP32);m=b(m,a.HEAPF32);
t=t||0;q?(6===q.length&&q.push(0,0,1),c=a._MakeRadialGradientShader(c,d,e,m,l.length,n,t,q)):c=a._MakeRadialGradientShader(c,d,e,m,l.length,n,t);a._free(e);a._free(m);return c};a.MakeTwoPointConicalGradientShader=function(c,d,l,m,n,q,t,w,G){var e=b(n,a.HEAP32);q=b(q,a.HEAPF32);G=G||0;w?(6===w.length&&w.push(0,0,1),c=a._MakeTwoPointConicalGradientShader(c,d,l,m,e,q,n.length,t,G,w)):c=a._MakeTwoPointConicalGradientShader(c,d,l,m,e,q,n.length,t,G);a._free(e);a._free(q);return c};a.MakeSkVertices=function(d,
h,l,m,n,q,t){var e=c(h,a.HEAPF32);l=c(l,a.HEAPF32);m=b(m,a.HEAP32);n=c(n,a.HEAP32);q=c(q,a.HEAPF32);var G=b(t,a.HEAPU16);d=a._MakeSkVertices(d,h.length,e,l,m,n,q,t&&t.length||0,G);e&&a._free(e);l&&a._free(l);m&&a._free(m);G&&a._free(G);n&&a._free(n);q&&a._free(q);return d}})(f);
(function(a){function b(a){for(var b=0;b<a.length;b++)if(void 0!==a[b]&&!Number.isFinite(a[b]))return!1;return!0}function c(b){var c=a.getColorComponents(b);b=c[0];var d=c[1],e=c[2];c=c[3];if(1===c)return b=b.toString(16).toLowerCase(),d=d.toString(16).toLowerCase(),e=e.toString(16).toLowerCase(),b=1===b.length?"0"+b:b,d=1===d.length?"0"+d:d,e=1===e.length?"0"+e:e,"#"+b+d+e;c=0===c||1===c?c:c.toFixed(8);return"rgba("+b+", "+d+", "+e+", "+c+")"}function d(a){var b=parseFloat(a)||1;return a&&-1!==a.indexOf("%")?
b/100:b}function e(b){b=b.toLowerCase();if(b.startsWith("#")){var c=255;switch(b.length){case 9:c=parseInt(b.slice(7,9),16);case 7:var e=parseInt(b.slice(1,3),16);var h=parseInt(b.slice(3,5),16);var l=parseInt(b.slice(5,7),16);break;case 5:c=17*parseInt(b.slice(4,5),16);case 4:e=17*parseInt(b.slice(1,2),16),h=17*parseInt(b.slice(2,3),16),l=17*parseInt(b.slice(3,4),16)}return a.Color(e,h,l,c/255)}return b.startsWith("rgba")?(b=b.slice(5,-1),b=b.split(","),a.Color(+b[0],+b[1],+b[2],d(b[3]))):b.startsWith("rgb")?
(b=b.slice(4,-1),b=b.split(","),a.Color(+b[0],+b[1],+b[2],d(b[3]))):b.startsWith("gray(")||b.startsWith("hsl")||(b=me[b],void 0===b)?a.BLACK:b}function h(a){a=ne.exec(a);if(!a)return null;var b=parseFloat(a[4]),c=16;switch(a[5]){case "em":case "rem":c=16*b;break;case "pt":c=4*b/3;break;case "px":c=b;break;case "pc":c=16*b;break;case "in":c=96*b;break;case "cm":c=96*b/2.54;break;case "mm":c=96/25.4*b;break;case "q":c=96/25.4/4*b;break;case "%":c=16/75*b}return{style:a[1],variant:a[2],weight:a[3],sizePx:c,
family:a[6].trim()}}function l(d){this.i=d;this.m=new a.SkPaint;this.m.setAntiAlias(!0);this.m.setStrokeMiter(10);this.m.setStrokeCap(a.StrokeCap.Butt);this.m.setStrokeJoin(a.StrokeJoin.Miter);this.m.setTextSize(10);this.m.setTypeface(null);this.Ua="10px monospace";this.Ta=new a.SkFont;this.M=this.T=a.BLACK;this.ra=0;this.Fa=a.TRANSPARENT;this.ta=this.sa=0;this.Ga=this.ba=1;this.Ea=0;this.qa=[];this.l=a.BlendMode.SrcOver;this.ia=a.FilterQuality.Low;this.Da=!0;this.m.setStrokeWidth(this.Ga);this.m.setBlendMode(this.l);
this.u=new a.SkPath;this.B=a.SkMatrix.identity();this.Ib=[];this.wa=[];this.ea=function(){this.u.delete();this.m.delete();this.Ta.delete();this.wa.forEach(function(a){a.ea()})};Object.defineProperty(this,"currentTransform",{enumerable:!0,get:function(){return{a:this.B[0],c:this.B[1],e:this.B[2],b:this.B[3],d:this.B[4],f:this.B[5]}},set:function(a){a.a&&this.setTransform(a.a,a.b,a.c,a.d,a.e,a.f)}});Object.defineProperty(this,"fillStyle",{enumerable:!0,get:function(){return Number.isInteger(this.M)?
c(this.M):this.M},set:function(a){"string"===typeof a?this.M=e(a):a.pa&&(this.M=a)}});Object.defineProperty(this,"font",{enumerable:!0,get:function(){return this.Ua},set:function(a){var b=h(a),c=b.family;b.typeface=Ea[c]?Ea[c][(b.style||"normal")+"|"+(b.variant||"normal")+"|"+(b.weight||"normal")]||Ea[c]["*"]:null;b&&(this.m.setTextSize(b.sizePx),this.m.setTypeface(b.typeface),this.Ta.setSize(b.sizePx),this.Ta.setTypeface(b.typeface),this.Ua=a)}});Object.defineProperty(this,"globalAlpha",{enumerable:!0,
get:function(){return this.ba},set:function(a){!isFinite(a)||0>a||1<a||(this.ba=a)}});Object.defineProperty(this,"globalCompositeOperation",{enumerable:!0,get:function(){switch(this.l){case a.BlendMode.SrcOver:return"source-over";case a.BlendMode.DstOver:return"destination-over";case a.BlendMode.Src:return"copy";case a.BlendMode.Dst:return"destination";case a.BlendMode.Clear:return"clear";case a.BlendMode.SrcIn:return"source-in";case a.BlendMode.DstIn:return"destination-in";case a.BlendMode.SrcOut:return"source-out";
case a.BlendMode.DstOut:return"destination-out";case a.BlendMode.SrcATop:return"source-atop";case a.BlendMode.DstATop:return"destination-atop";case a.BlendMode.Xor:return"xor";case a.BlendMode.Plus:return"lighter";case a.BlendMode.Multiply:return"multiply";case a.BlendMode.Screen:return"screen";case a.BlendMode.Overlay:return"overlay";case a.BlendMode.Darken:return"darken";case a.BlendMode.Lighten:return"lighten";case a.BlendMode.ColorDodge:return"color-dodge";case a.BlendMode.ColorBurn:return"color-burn";
case a.BlendMode.HardLight:return"hard-light";case a.BlendMode.SoftLight:return"soft-light";case a.BlendMode.Difference:return"difference";case a.BlendMode.Exclusion:return"exclusion";case a.BlendMode.Hue:return"hue";case a.BlendMode.Saturation:return"saturation";case a.BlendMode.Color:return"color";case a.BlendMode.Luminosity:return"luminosity"}},set:function(b){switch(b){case "source-over":this.l=a.BlendMode.SrcOver;break;case "destination-over":this.l=a.BlendMode.DstOver;break;case "copy":this.l=
a.BlendMode.Src;break;case "destination":this.l=a.BlendMode.Dst;break;case "clear":this.l=a.BlendMode.Clear;break;case "source-in":this.l=a.BlendMode.SrcIn;break;case "destination-in":this.l=a.BlendMode.DstIn;break;case "source-out":this.l=a.BlendMode.SrcOut;break;case "destination-out":this.l=a.BlendMode.DstOut;break;case "source-atop":this.l=a.BlendMode.SrcATop;break;case "destination-atop":this.l=a.BlendMode.DstATop;break;case "xor":this.l=a.BlendMode.Xor;break;case "lighter":this.l=a.BlendMode.Plus;
break;case "plus-lighter":this.l=a.BlendMode.Plus;break;case "plus-darker":throw"plus-darker is not supported";case "multiply":this.l=a.BlendMode.Multiply;break;case "screen":this.l=a.BlendMode.Screen;break;case "overlay":this.l=a.BlendMode.Overlay;break;case "darken":this.l=a.BlendMode.Darken;break;case "lighten":this.l=a.BlendMode.Lighten;break;case "color-dodge":this.l=a.BlendMode.ColorDodge;break;case "color-burn":this.l=a.BlendMode.ColorBurn;break;case "hard-light":this.l=a.BlendMode.HardLight;
break;case "soft-light":this.l=a.BlendMode.SoftLight;break;case "difference":this.l=a.BlendMode.Difference;break;case "exclusion":this.l=a.BlendMode.Exclusion;break;case "hue":this.l=a.BlendMode.Hue;break;case "saturation":this.l=a.BlendMode.Saturation;break;case "color":this.l=a.BlendMode.Color;break;case "luminosity":this.l=a.BlendMode.Luminosity;break;default:return}this.m.setBlendMode(this.l)}});Object.defineProperty(this,"imageSmoothingEnabled",{enumerable:!0,get:function(){return this.Da},set:function(a){this.Da=
!!a}});Object.defineProperty(this,"imageSmoothingQuality",{enumerable:!0,get:function(){switch(this.ia){case a.FilterQuality.Low:return"low";case a.FilterQuality.Medium:return"medium";case a.FilterQuality.High:return"high"}},set:function(b){switch(b){case "low":this.ia=a.FilterQuality.Low;break;case "medium":this.ia=a.FilterQuality.Medium;break;case "high":this.ia=a.FilterQuality.High}}});Object.defineProperty(this,"lineCap",{enumerable:!0,get:function(){switch(this.m.getStrokeCap()){case a.StrokeCap.Butt:return"butt";
case a.StrokeCap.Round:return"round";case a.StrokeCap.Square:return"square"}},set:function(b){switch(b){case "butt":this.m.setStrokeCap(a.StrokeCap.Butt);break;case "round":this.m.setStrokeCap(a.StrokeCap.Round);break;case "square":this.m.setStrokeCap(a.StrokeCap.Square)}}});Object.defineProperty(this,"lineDashOffset",{enumerable:!0,get:function(){return this.Ea},set:function(a){isFinite(a)&&(this.Ea=a)}});Object.defineProperty(this,"lineJoin",{enumerable:!0,get:function(){switch(this.m.getStrokeJoin()){case a.StrokeJoin.Miter:return"miter";
case a.StrokeJoin.Round:return"round";case a.StrokeJoin.Bevel:return"bevel"}},set:function(b){switch(b){case "miter":this.m.setStrokeJoin(a.StrokeJoin.Miter);break;case "round":this.m.setStrokeJoin(a.StrokeJoin.Round);break;case "bevel":this.m.setStrokeJoin(a.StrokeJoin.Bevel)}}});Object.defineProperty(this,"lineWidth",{enumerable:!0,get:function(){return this.m.getStrokeWidth()},set:function(a){0>=a||!a||(this.Ga=a,this.m.setStrokeWidth(a))}});Object.defineProperty(this,"miterLimit",{enumerable:!0,
get:function(){return this.m.getStrokeMiter()},set:function(a){0>=a||!a||this.m.setStrokeMiter(a)}});Object.defineProperty(this,"shadowBlur",{enumerable:!0,get:function(){return this.ra},set:function(a){0>a||!isFinite(a)||(this.ra=a)}});Object.defineProperty(this,"shadowColor",{enumerable:!0,get:function(){return c(this.Fa)},set:function(a){this.Fa=e(a)}});Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,get:function(){return this.sa},set:function(a){isFinite(a)&&(this.sa=a)}});Object.defineProperty(this,
"shadowOffsetY",{enumerable:!0,get:function(){return this.ta},set:function(a){isFinite(a)&&(this.ta=a)}});Object.defineProperty(this,"strokeStyle",{enumerable:!0,get:function(){return c(this.T)},set:function(a){"string"===typeof a?this.T=e(a):a.pa&&(this.T=a)}});this.arc=function(a,b,c,d,e,h){E(this.u,a,b,c,c,0,d,e,h)};this.arcTo=function(a,b,c,d,e){t(this.u,a,b,c,d,e)};this.beginPath=function(){this.u.delete();this.u=new a.SkPath};this.bezierCurveTo=function(a,c,d,e,h,l){var ic=this.u;b([a,c,d,e,
h,l])&&(ic.isEmpty()&&ic.moveTo(a,c),ic.cubicTo(a,c,d,e,h,l))};this.clearRect=function(b,c,d,e){this.m.setStyle(a.PaintStyle.Fill);this.m.setBlendMode(a.BlendMode.Clear);this.i.drawRect(a.XYWHRect(b,c,d,e),this.m);this.m.setBlendMode(this.l)};this.clip=function(b,c){"string"===typeof b?(c=b,b=this.u):b&&b.kb&&(b=b.C);b||(b=this.u);b=b.copy();c&&"evenodd"===c.toLowerCase()?b.setFillType(a.FillType.EvenOdd):b.setFillType(a.FillType.Winding);this.i.clipPath(b,a.ClipOp.Intersect,!0);b.delete()};this.closePath=
function(){w(this.u)};this.createImageData=function(){if(1===arguments.length){var a=arguments[0];return new n(new Uint8ClampedArray(4*a.width*a.height),a.width,a.height)}if(2===arguments.length){a=arguments[0];var b=arguments[1];return new n(new Uint8ClampedArray(4*a*b),a,b)}throw"createImageData expects 1 or 2 arguments, got "+arguments.length;};this.createLinearGradient=function(a,c,d,e){if(b(arguments)){var h=new q(a,c,d,e);this.wa.push(h);return h}};this.createPattern=function(a,b){a=new hd(a,
b);this.wa.push(a);return a};this.createRadialGradient=function(a,c,d,e,h,l){if(b(arguments)){var m=new id(a,c,d,e,h,l);this.wa.push(m);return m}};this.cc=function(){var b=this.Sa();this.Da?b.setFilterQuality(this.ia):b.setFilterQuality(a.FilterQuality.None);return b};this.drawImage=function(b){var c=this.cc();if(3===arguments.length||5===arguments.length)var d=a.XYWHRect(arguments[1],arguments[2],arguments[3]||b.width(),arguments[4]||b.height()),e=a.XYWHRect(0,0,b.width(),b.height());else if(9===
arguments.length)d=a.XYWHRect(arguments[5],arguments[6],arguments[7],arguments[8]),e=a.XYWHRect(arguments[1],arguments[2],arguments[3],arguments[4]);else throw"invalid number of args for drawImage, need 3, 5, or 9; got "+arguments.length;this.i.drawImageRect(b,e,d,c,!1);c.dispose()};this.ellipse=function(a,b,c,d,e,h,l,m){E(this.u,a,b,c,d,e,h,l,m)};this.Sa=function(){var b=this.m.copy();b.setStyle(a.PaintStyle.Fill);if(Number.isInteger(this.M)){var c=a.multiplyByAlpha(this.M,this.ba);b.setColor(c)}else c=
this.M.pa(this.B),b.setColor(a.Color(0,0,0,this.ba)),b.setShader(c);b.dispose=function(){this.delete()};return b};this.fill=function(b,c){"string"===typeof b?(c=b,b=this.u):b&&b.kb&&(b=b.C);if("evenodd"===c)this.u.setFillType(a.FillType.EvenOdd);else{if("nonzero"!==c&&c)throw"invalid fill rule";this.u.setFillType(a.FillType.Winding)}b||(b=this.u);c=this.Sa();var d=this.Wa(c);d&&(this.i.save(),this.i.concat(this.Va()),this.i.drawPath(b,d),this.i.restore(),d.dispose());this.i.drawPath(b,c);c.dispose()};
this.fillRect=function(b,c,d,e){var h=this.Sa();this.i.drawRect(a.XYWHRect(b,c,d,e),h);h.dispose()};this.fillText=function(a,b,c){var d=this.Sa(),e=this.Wa(d);e&&(this.i.save(),this.i.concat(this.Va()),this.i.drawText(a,b,c,e),this.i.restore(),e.dispose());this.i.drawText(a,b,c,d);d.dispose()};this.getImageData=function(a,b,c,d){return(a=this.i.readPixels(a,b,c,d))?new n(new Uint8ClampedArray(a.buffer),c,d):null};this.getLineDash=function(){return this.qa.slice()};this.Kb=function(b){var c=a.SkMatrix.Ka(this.B);
a.SkMatrix.mapPoints(c,b);return b};this.isPointInPath=function(b,c,d){var e=arguments;if(3===e.length)var h=this.u;else if(4===e.length)h=e[0],b=e[1],c=e[2],d=e[3];else throw"invalid arg count, need 3 or 4, got "+e.length;if(!isFinite(b)||!isFinite(c))return!1;d=d||"nonzero";if("nonzero"!==d&&"evenodd"!==d)return!1;e=this.Kb([b,c]);b=e[0];c=e[1];h.setFillType("nonzero"===d?a.FillType.Winding:a.FillType.EvenOdd);return h.contains(b,c)};this.isPointInStroke=function(b,c){var d=arguments;if(2===d.length)var e=
this.u;else if(3===d.length)e=d[0],b=d[1],c=d[2];else throw"invalid arg count, need 2 or 3, got "+d.length;if(!isFinite(b)||!isFinite(c))return!1;d=this.Kb([b,c]);b=d[0];c=d[1];e=e.copy();e.setFillType(a.FillType.Winding);e.stroke({width:this.lineWidth,miter_limit:this.miterLimit,cap:this.m.getStrokeCap(),join:this.m.getStrokeJoin(),precision:.3});d=e.contains(b,c);e.delete();return d};this.lineTo=function(a,b){X(this.u,a,b)};this.measureText=function(a){return{width:this.Ta.measureText(a)}};this.moveTo=
function(a,c){var d=this.u;b([a,c])&&d.moveTo(a,c)};this.putImageData=function(c,d,e,h,l,m,n){if(b([d,e,h,l,m,n]))if(void 0===h)this.i.writePixels(c.data,c.width,c.height,d,e);else if(h=h||0,l=l||0,m=m||c.width,n=n||c.height,0>m&&(h+=m,m=Math.abs(m)),0>n&&(l+=n,n=Math.abs(n)),0>h&&(m+=h,h=0),0>l&&(n+=l,l=0),!(0>=m||0>=n)){c=a.Zb(c.data,c.width,c.height,a.AlphaType.Unpremul,a.ColorType.RGBA_8888);var q=a.XYWHRect(h,l,m,n);d=a.XYWHRect(d+h,e+l,m,n);e=a.SkMatrix.Ka(this.B);this.i.save();this.i.concat(e);
this.i.drawImageRect(c,q,d,null,!1);this.i.restore();c.delete()}};this.quadraticCurveTo=function(a,c,d,e){var h=this.u;b([a,c,d,e])&&(h.isEmpty()&&h.moveTo(a,c),h.quadTo(a,c,d,e))};this.rect=function(a,c,d,e){var h=this.u;b([a,c,d,e])&&h.addRect(a,c,a+d,c+e)};this.resetTransform=function(){this.u.transform(this.B);var b=a.SkMatrix.Ka(this.B);this.i.concat(b);this.B=this.i.getTotalMatrix()};this.restore=function(){var b=this.Ib.pop();if(b){var c=a.SkMatrix.multiply(this.B,a.SkMatrix.Ka(b.mc));this.u.transform(c);
this.m.delete();this.m=b.Kc;this.qa=b.Ec;this.Ga=b.Xc;this.T=b.Wc;this.M=b.fs;this.sa=b.Uc;this.ta=b.Vc;this.ra=b.Qc;this.Fa=b.Tc;this.ba=b.rc;this.l=b.sc;this.Ea=b.Fc;this.Da=b.Cc;this.ia=b.Dc;this.Ua=b.pc;this.i.restore();this.B=this.i.getTotalMatrix()}};this.rotate=function(b){if(isFinite(b)){var c=a.SkMatrix.rotated(-b);this.u.transform(c);this.i.rotate(b/Math.PI*180,0,0);this.B=this.i.getTotalMatrix()}};this.save=function(){if(this.M.oa){var a=this.M.oa();this.wa.push(a)}else a=this.M;if(this.T.oa){var b=
this.T.oa();this.wa.push(b)}else b=this.T;this.Ib.push({mc:this.B.slice(),Ec:this.qa.slice(),Xc:this.Ga,Wc:b,fs:a,Uc:this.sa,Vc:this.ta,Qc:this.ra,Tc:this.Fa,rc:this.ba,Fc:this.Ea,sc:this.l,Cc:this.Da,Dc:this.ia,Kc:this.m.copy(),pc:this.Ua});this.i.save()};this.scale=function(c,d){if(b(arguments)){var e=a.SkMatrix.scaled(1/c,1/d);this.u.transform(e);this.i.scale(c,d);this.B=this.i.getTotalMatrix()}};this.setLineDash=function(a){for(var b=0;b<a.length;b++)if(!isFinite(a[b])||0>a[b])return;1===a.length%
2&&Array.prototype.push.apply(a,a);this.qa=a};this.setTransform=function(a,c,d,e,h,l){b(arguments)&&(this.resetTransform(),this.transform(a,c,d,e,h,l))};this.Va=function(){return a.SkMatrix.translated(this.sa/this.B[0],this.ta/this.B[4])};this.Wa=function(b){var c=a.multiplyByAlpha(this.Fa,this.ba);if(!a.getColorComponents(c)[3]||!(this.ra||this.ta||this.sa))return null;b=b.copy();b.setColor(c);var d=a.MakeBlurMaskFilter(a.BlurStyle.Normal,this.ra/2,!1);b.setMaskFilter(d);b.dispose=function(){d.delete();
this.delete()};return b};this.mb=function(){var b=this.m.copy();b.setStyle(a.PaintStyle.Stroke);if(Number.isInteger(this.T)){var c=a.multiplyByAlpha(this.T,this.ba);b.setColor(c)}else c=this.T.pa(this.B),b.setColor(a.Color(0,0,0,this.ba)),b.setShader(c);b.setStrokeWidth(this.Ga);if(this.qa.length){var d=a.MakeSkDashPathEffect(this.qa,this.Ea);b.setPathEffect(d)}b.dispose=function(){d&&d.delete();this.delete()};return b};this.stroke=function(a){a=a?a.C:this.u;var b=this.mb(),c=this.Wa(b);c&&(this.i.save(),
this.i.concat(this.Va()),this.i.drawPath(a,c),this.i.restore(),c.dispose());this.i.drawPath(a,b);b.dispose()};this.strokeRect=function(b,c,d,e){var h=this.mb();this.i.drawRect(a.XYWHRect(b,c,d,e),h);h.dispose()};this.strokeText=function(a,b,c){var d=this.mb(),e=this.Wa(d);e&&(this.i.save(),this.i.concat(this.Va()),this.i.drawText(a,b,c,e),this.i.restore(),e.dispose());this.i.drawText(a,b,c,d);d.dispose()};this.translate=function(c,d){if(b(arguments)){var e=a.SkMatrix.translated(-c,-d);this.u.transform(e);
this.i.translate(c,d);this.B=this.i.getTotalMatrix()}};this.transform=function(b,c,d,e,h,l){b=[b,d,h,c,e,l,0,0,1];c=a.SkMatrix.Ka(b);this.u.transform(c);this.i.concat(b);this.B=this.i.getTotalMatrix()};this.addHitRegion=function(){};this.clearHitRegions=function(){};this.drawFocusIfNeeded=function(){};this.removeHitRegion=function(){};this.scrollPathIntoView=function(){};Object.defineProperty(this,"canvas",{value:null,writable:!1})}function m(b){this.nb=b;this.Jb=new l(b.getCanvas());this.Xa=[];this.$b=
a.SkFontMgr.RefDefault();this.decodeImage=function(b){b=a.MakeImageFromEncoded(b);if(!b)throw"Invalid input";this.Xa.push(b);return b};this.loadFont=function(a,b){a=this.$b.MakeTypefaceFromData(a);if(!a)return null;this.Xa.push(a);var c=(b.style||"normal")+"|"+(b.variant||"normal")+"|"+(b.weight||"normal");b=b.family;Ea[b]||(Ea[b]={"*":a});Ea[b][c]=a};this.makePath2D=function(a){a=new jc(a);this.Xa.push(a.C);return a};this.getContext=function(a){return"2d"===a?this.Jb:null};this.toDataURL=function(b,
c){this.nb.flush();var d=this.nb.makeImageSnapshot();if(d){b=b||"image/png";var e=a.ImageFormat.PNG;"image/jpeg"===b&&(e=a.ImageFormat.JPEG);if(c=d.encodeToData(e,c||.92)){c=a.getSkDataBytes(c);b="data:"+b+";base64,";if(ba)c=Buffer.from(c).toString("base64");else{d=0;e=c.length;for(var h="",l;d<e;)l=c.slice(d,Math.min(d+32768,e)),h+=String.fromCharCode.apply(null,l),d+=32768;c=btoa(h)}return b+c}}};this.dispose=function(){this.Jb.ea();this.Xa.forEach(function(a){a.delete()});this.nb.dispose()}}function n(a,
b,c){if(!b||0===c)throw"invalid dimensions, width and height must be non-zero";if(a.length%4)throw"arr must be a multiple of 4";c=c||a.length/(4*b);Object.defineProperty(this,"data",{value:a,writable:!1});Object.defineProperty(this,"height",{value:c,writable:!1});Object.defineProperty(this,"width",{value:b,writable:!1})}function q(b,c,d,h){this.G=null;this.P=[];this.I=[];this.addColorStop=function(a,b){if(0>a||1<a||!isFinite(a))throw"offset must be between 0 and 1 inclusively";b=e(b);var c=this.I.indexOf(a);
if(-1!==c)this.P[c]=b;else{for(c=0;c<this.I.length&&!(this.I[c]>a);c++);this.I.splice(c,0,a);this.P.splice(c,0,b)}};this.oa=function(){var a=new q(b,c,d,h);a.P=this.P.slice();a.I=this.I.slice();return a};this.ea=function(){this.G&&(this.G.delete(),this.G=null)};this.pa=function(e){var l=[b,c,d,h];a.SkMatrix.mapPoints(e,l);e=l[0];var m=l[1],n=l[2];l=l[3];this.ea();return this.G=a.MakeLinearGradientShader([e,m],[n,l],this.P,this.I,a.TileMode.Clamp)}}function t(a,c,d,e,h,l){if(b([c,d,e,h,l])){if(0>l)throw"radii cannot be negative";
a.isEmpty()&&a.moveTo(c,d);a.arcTo(c,d,e,h,l)}}function w(a){if(!a.isEmpty()){var b=a.getBounds();(b.fBottom-b.fTop||b.fRight-b.fLeft)&&a.close()}}function G(b,c,d,e,h,l,m){m=(m-l)/Math.PI*180;l=l/Math.PI*180;c=a.LTRBRect(c-e,d-h,c+e,d+h);1E-5>Math.abs(Math.abs(m)-360)?(d=m/2,b.arcTo(c,l,d,!1),b.arcTo(c,l+d,d,!1)):b.arcTo(c,l,m,!1)}function E(c,d,e,h,l,m,n,q,t){if(b([d,e,h,l,m,n,q])){if(0>h||0>l)throw"radii cannot be negative";var E=2*Math.PI,w=n%E;0>w&&(w+=E);var X=w-n;n=w;q+=X;!t&&q-n>=E?q=n+E:
t&&n-q>=E?q=n-E:!t&&n>q?q=n+(E-(n-q)%E):t&&n<q&&(q=n-(E-(q-n)%E));m?(t=a.SkMatrix.rotated(m,d,e),m=a.SkMatrix.rotated(-m,d,e),c.transform(m),G(c,d,e,h,l,n,q),c.transform(t)):G(c,d,e,h,l,n,q)}}function X(a,c,d){b([c,d])&&(a.isEmpty()&&a.moveTo(c,d),a.lineTo(c,d))}function jc(c){this.C=null;"string"===typeof c?this.C=a.MakePathFromSVGString(c):c&&c.kb?this.C=c.C.copy():this.C=new a.SkPath;this.kb=function(){return this.C};this.addPath=function(a,b){b||(b={a:1,c:0,e:0,b:0,d:1,f:0});this.C.addPath(a.C,
[b.a,b.c,b.e,b.b,b.d,b.f])};this.arc=function(a,b,c,d,e,h){E(this.C,a,b,c,c,0,d,e,h)};this.arcTo=function(a,b,c,d,e){t(this.C,a,b,c,d,e)};this.bezierCurveTo=function(a,c,d,e,h,l){var m=this.C;b([a,c,d,e,h,l])&&(m.isEmpty()&&m.moveTo(a,c),m.cubicTo(a,c,d,e,h,l))};this.closePath=function(){w(this.C)};this.ellipse=function(a,b,c,d,e,h,l,m){E(this.C,a,b,c,d,e,h,l,m)};this.lineTo=function(a,b){X(this.C,a,b)};this.moveTo=function(a,c){var d=this.C;b([a,c])&&d.moveTo(a,c)};this.quadraticCurveTo=function(a,
c,d,e){var h=this.C;b([a,c,d,e])&&(h.isEmpty()&&h.moveTo(a,c),h.quadTo(a,c,d,e))};this.rect=function(a,c,d,e){var h=this.C;b([a,c,d,e])&&h.addRect(a,c,a+d,c+e)}}function hd(c,d){this.G=null;this.bc=c;this._transform=a.SkMatrix.identity();""===d&&(d="repeat");switch(d){case "repeat-x":this.ua=a.TileMode.Repeat;this.va=a.TileMode.Decal;break;case "repeat-y":this.ua=a.TileMode.Decal;this.va=a.TileMode.Repeat;break;case "repeat":this.va=this.ua=a.TileMode.Repeat;break;case "no-repeat":this.va=this.ua=
a.TileMode.Decal;break;default:throw"invalid repetition mode "+d;}this.setTransform=function(a){a=[a.a,a.c,a.e,a.b,a.d,a.f,0,0,1];b(a)&&(this._transform=a)};this.oa=function(){var a=new hd;a.ua=this.ua;a.va=this.va;return a};this.ea=function(){this.G&&(this.G.delete(),this.G=null)};this.pa=function(){this.ea();return this.G=a.MakeImageShader(this.bc,this.ua,this.va,!1,this._transform)}}function id(b,c,d,h,l,m){this.G=null;this.P=[];this.I=[];this.addColorStop=function(a,b){if(0>a||1<a||!isFinite(a))throw"offset must be between 0 and 1 inclusively";
b=e(b);var c=this.I.indexOf(a);if(-1!==c)this.P[c]=b;else{for(c=0;c<this.I.length&&!(this.I[c]>a);c++);this.I.splice(c,0,a);this.P.splice(c,0,b)}};this.oa=function(){var a=new id(b,c,d,h,l,m);a.P=this.P.slice();a.I=this.I.slice();return a};this.ea=function(){this.G&&(this.G.delete(),this.G=null)};this.pa=function(e){var n=[b,c,h,l];a.SkMatrix.mapPoints(e,n);var q=n[0],t=n[1],E=n[2];n=n[3];var w=(Math.abs(e[0])+Math.abs(e[4]))/2;e=d*w;w*=m;this.ea();return this.G=a.MakeTwoPointConicalGradientShader([q,
t],e,[E,n],w,this.P,this.I,a.TileMode.Clamp)}}a._testing={};var me={aliceblue:-984833,antiquewhite:-332841,aqua:-16711681,aquamarine:-8388652,azure:-983041,beige:-657956,bisque:-6972,black:-16777216,blanchedalmond:-5171,blue:-16776961,blueviolet:-7722014,brown:-5952982,burlywood:-2180985,cadetblue:-10510688,chartreuse:-8388864,chocolate:-2987746,coral:-32944,cornflowerblue:-10185235,cornsilk:-1828,crimson:-2354116,cyan:-16711681,darkblue:-16777077,darkcyan:-16741493,darkgoldenrod:-4684277,darkgray:-5658199,
darkgreen:-16751616,darkgrey:-5658199,darkkhaki:-4343957,darkmagenta:-7667573,darkolivegreen:-11179217,darkorange:-29696,darkorchid:-6737204,darkred:-7667712,darksalmon:-1468806,darkseagreen:-7357297,darkslateblue:-12042869,darkslategray:-13676721,darkslategrey:-13676721,darkturquoise:-16724271,darkviolet:-7077677,deeppink:-60269,deepskyblue:-16728065,dimgray:-9868951,dimgrey:-9868951,dodgerblue:-14774017,firebrick:-5103070,floralwhite:-1296,forestgreen:-14513374,fuchsia:-65281,gainsboro:-2302756,
ghostwhite:-460545,gold:-10496,goldenrod:-2448096,gray:-8355712,green:-16744448,greenyellow:-5374161,grey:-8355712,honeydew:-983056,hotpink:-38476,indianred:-3318692,indigo:-11861886,ivory:-16,khaki:-989556,lavender:-1644806,lavenderblush:-3851,lawngreen:-8586240,lemonchiffon:-1331,lightblue:-5383962,lightcoral:-1015680,lightcyan:-2031617,lightgoldenrodyellow:-329006,lightgray:-2894893,lightgreen:-7278960,lightgrey:-2894893,lightpink:-18751,lightsalmon:-24454,lightseagreen:-14634326,lightskyblue:-7876870,
lightslategray:-8943463,lightslategrey:-8943463,lightsteelblue:-5192482,lightyellow:-32,lime:-16711936,limegreen:-13447886,linen:-331546,magenta:-65281,maroon:-8388608,mediumaquamarine:-10039894,mediumblue:-16777011,mediumorchid:-4565549,mediumpurple:-7114533,mediumseagreen:-12799119,mediumslateblue:-8689426,mediumspringgreen:-16713062,mediumturquoise:-12004916,mediumvioletred:-3730043,midnightblue:-15132304,mintcream:-655366,mistyrose:-6943,moccasin:-6987,navajowhite:-8531,navy:-16777088,oldlace:-133658,
olive:-8355840,olivedrab:-9728477,orange:-23296,orangered:-47872,orchid:-2461482,palegoldenrod:-1120086,palegreen:-6751336,paleturquoise:-5247250,palevioletred:-2396013,papayawhip:-4139,peachpuff:-9543,peru:-3308225,pink:-16181,plum:-2252579,powderblue:-5185306,purple:-8388480,rebeccapurple:-10079335,red:-65536,rosybrown:-4419697,royalblue:-12490271,saddlebrown:-7650029,salmon:-360334,sandybrown:-744352,seagreen:-13726889,seashell:-2578,sienna:-6270419,silver:-4144960,skyblue:-7876885,slateblue:-9807155,
slategray:-9404272,slategrey:-9404272,snow:-1286,springgreen:-16711809,steelblue:-12156236,tan:-2968436,teal:-16744320,thistle:-2572328,transparent:0,tomato:-40121,turquoise:-12525360,violet:-1146130,wheat:-663885,white:-1,whitesmoke:-657931,yellow:-256,yellowgreen:-6632142};a._testing.parseColor=e;a._testing.colorToString=c;var ne=/(italic|oblique|normal|)\s*(small-caps|normal|)\s*(bold|bolder|lighter|[1-9]00|normal|)\s*([\d\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q)(.+)/,Ea={"Noto Mono":{"*":null},
monospace:{"*":null}};a._testing.parseFontString=h;a.MakeCanvas=function(b,c){return(b=a.MakeSurface(b,c))?new m(b):null};a.ImageData=function(){if(2===arguments.length){var a=arguments[0],b=arguments[1];return new n(new Uint8ClampedArray(4*a*b),a,b)}if(3===arguments.length){var c=arguments[0];if(c.prototype.constructor!==Uint8ClampedArray)throw"bytes must be given as a Uint8ClampedArray";a=arguments[1];b=arguments[2];if(c%4)throw"bytes must be given in a multiple of 4";if(c%a)throw"bytes must divide evenly by width";
if(b&&b!==c/(4*a))throw"invalid height given";return new n(c,a,c/(4*a))}throw"invalid number of arguments - takes 2 or 3, saw "+arguments.length;}})(f);var ca={},da;for(da in f)f.hasOwnProperty(da)&&(ca[da]=f[da]);f.arguments=[];f.thisProgram="./this.program";f.quit=function(a,b){throw b;};f.preRun=[];f.postRun=[];var ea=!1,fa=!1,ha=!1,ia=!1;ea="object"===typeof window;fa="function"===typeof importScripts;ha="object"===typeof process&&"function"===typeof require&&!ea&&!fa;ia=!ea&&!ha&&!fa;
var ja="";function ka(a){return f.locateFile?f.locateFile(a,ja):ja+a}
if(ha){ja=__dirname+"/";var la,ma;f.read=function(a,b){la||(la=require("fs"));ma||(ma=require("path"));a=ma.normalize(a);a=la.readFileSync(a);return b?a:a.toString()};f.readBinary=function(a){a=f.read(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer);return a};1<process.argv.length&&(f.thisProgram=process.argv[1].replace(/\\/g,"/"));f.arguments=process.argv.slice(2);process.on("uncaughtException",function(a){if(!(a instanceof na))throw a;});process.on("unhandledRejection",g);f.quit=function(a){process.exit(a)};
f.inspect=function(){return"[Emscripten Module object]"}}else if(ia)"undefined"!=typeof read&&(f.read=function(a){return read(a)}),f.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");assert("object"===typeof a);return a},"undefined"!=typeof scriptArgs?f.arguments=scriptArgs:"undefined"!=typeof arguments&&(f.arguments=arguments),"function"===typeof quit&&(f.quit=function(a){quit(a)});else if(ea||fa)fa?ja=self.location.href:document.currentScript&&
(ja=document.currentScript.src),_scriptDir&&(ja=_scriptDir),0!==ja.indexOf("blob:")?ja=ja.substr(0,ja.lastIndexOf("/")+1):ja="",f.read=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},fa&&(f.readBinary=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),f.readAsync=function(a,b,c){var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=function(){200==
d.status||0==d.status&&d.response?b(d.response):c()};d.onerror=c;d.send(null)},f.setWindowTitle=function(a){document.title=a};var oa=f.print||("undefined"!==typeof console?console.log.bind(console):"undefined"!==typeof print?print:null),k=f.printErr||("undefined"!==typeof printErr?printErr:"undefined"!==typeof console&&console.warn.bind(console)||oa);for(da in ca)ca.hasOwnProperty(da)&&(f[da]=ca[da]);ca=void 0;function pa(a){var b=qa;qa=qa+a+15&-16;return b}
function ra(a){var b=p[sa>>2];a=b+a+15&-16;p[sa>>2]=a;return a>=r&&!ta()?(p[sa>>2]=b,0):b}function ua(a){var b;b||(b=16);return Math.ceil(a/b)*b}function va(a){wa||(wa={});wa[a]||(wa[a]=1,k(a))}var wa,xa={"f64-rem":function(a,b){return a%b},"debugger":function(){debugger}},ya=[],za=!1;function assert(a,b){a||g("Assertion failed: "+b)}
function u(a){if("number"===typeof a){var b=!0;var c=a}else b=!1,c=a.length;var d=("function"===typeof Aa?Aa:pa)(Math.max(c,1));if(b){a=d;assert(0==(d&3));for(b=d+(c&-4);a<b;a+=4)p[a>>2]=0;for(b=d+c;a<b;)v[a++>>0]=0;return d}a.subarray||a.slice?x.set(a,d):x.set(new Uint8Array(a),d);return d}
function y(a,b){if(0===b||!a)return"";for(var c=0,d,e=0;;){d=x[a+e>>0];c|=d;if(0==d&&!b)break;e++;if(b&&e==b)break}b||(b=e);d="";if(128>c){for(;0<b;)c=String.fromCharCode.apply(String,x.subarray(a,a+Math.min(b,1024))),d=d?d+c:c,a+=1024,b-=1024;return d}return Ba(x,a)}var Ca="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
function Ba(a,b){for(var c=b;a[c];)++c;if(16<c-b&&a.subarray&&Ca)return Ca.decode(a.subarray(b,c));for(c="";;){var d=a[b++];if(!d)return c;if(d&128){var e=a[b++]&63;if(192==(d&224))c+=String.fromCharCode((d&31)<<6|e);else{var h=a[b++]&63;if(224==(d&240))d=(d&15)<<12|e<<6|h;else{var l=a[b++]&63;if(240==(d&248))d=(d&7)<<18|e<<12|h<<6|l;else{var m=a[b++]&63;if(248==(d&252))d=(d&3)<<24|e<<18|h<<12|l<<6|m;else{var n=a[b++]&63;d=(d&1)<<30|e<<24|h<<18|l<<12|m<<6|n}}}65536>d?c+=String.fromCharCode(d):(d-=
65536,c+=String.fromCharCode(55296|d>>10,56320|d&1023))}}else c+=String.fromCharCode(d)}}
function Da(a,b,c,d){if(!(0<d))return 0;var e=c;d=c+d-1;for(var h=0;h<a.length;++h){var l=a.charCodeAt(h);if(55296<=l&&57343>=l){var m=a.charCodeAt(++h);l=65536+((l&1023)<<10)|m&1023}if(127>=l){if(c>=d)break;b[c++]=l}else{if(2047>=l){if(c+1>=d)break;b[c++]=192|l>>6}else{if(65535>=l){if(c+2>=d)break;b[c++]=224|l>>12}else{if(2097151>=l){if(c+3>=d)break;b[c++]=240|l>>18}else{if(67108863>=l){if(c+4>=d)break;b[c++]=248|l>>24}else{if(c+5>=d)break;b[c++]=252|l>>30;b[c++]=128|l>>24&63}b[c++]=128|l>>18&63}b[c++]=
128|l>>12&63}b[c++]=128|l>>6&63}b[c++]=128|l&63}}b[c]=0;return c-e}function Fa(a){for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);55296<=d&&57343>=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++c)&1023);127>=d?++b:b=2047>=d?b+2:65535>=d?b+3:2097151>=d?b+4:67108863>=d?b+5:b+6}return b}"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");var Ga=65536,Ha=16777216,Ia=16777216;function Ja(a,b){0<a%b&&(a+=b-a%b);return a}var buffer,v,x,Ka,La,p,z,A,Ma;
function Na(){f.HEAP8=v=new Int8Array(buffer);f.HEAP16=Ka=new Int16Array(buffer);f.HEAP32=p=new Int32Array(buffer);f.HEAPU8=x=new Uint8Array(buffer);f.HEAPU16=La=new Uint16Array(buffer);f.HEAPU32=z=new Uint32Array(buffer);f.HEAPF32=A=new Float32Array(buffer);f.HEAPF64=Ma=new Float64Array(buffer)}var Oa,qa,Pa,Qa,Ra,Sa,Ta,sa;Oa=qa=Qa=Ra=Sa=Ta=sa=0;Pa=!1;f.reallocBuffer||(f.reallocBuffer=function(a){try{var b=v;var c=new ArrayBuffer(a);(new Int8Array(c)).set(b)}catch(d){return!1}return Ua(c)?c:!1});
function ta(){var a=f.usingWasm?Ga:Ha,b=2147483648-a;if(p[sa>>2]>b)return!1;var c=r;for(r=Math.max(r,Ia);r<p[sa>>2];)536870912>=r?r=Ja(2*r,a):r=Math.min(Ja((3*r+2147483648)/4,a),b);a=f.reallocBuffer(r);if(!a||a.byteLength!=r)return r=c,!1;f.buffer=buffer=a;Na();return!0}var Va;try{Va=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),Va(new ArrayBuffer(4))}catch(a){Va=function(b){return b.byteLength}}
var Wa=f.TOTAL_STACK||5242880,r=f.TOTAL_MEMORY||33554432;r<Wa&&k("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+r+"! (TOTAL_STACK="+Wa+")");f.buffer?buffer=f.buffer:("object"===typeof WebAssembly&&"function"===typeof WebAssembly.Memory?(f.wasmMemory=new WebAssembly.Memory({initial:r/Ga}),buffer=f.wasmMemory.buffer):buffer=new ArrayBuffer(r),f.buffer=buffer);Na();
function Xa(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b();else{var c=b.Ja;"number"===typeof c?void 0===b.Ya?f.dynCall_v(c):f.dynCall_vi(c,b.Ya):c(void 0===b.Ya?null:b.Ya)}}}var Ya=[],Za=[],$a=[],ab=[],bb=[],cb=!1;function db(){var a=f.preRun.shift();Ya.unshift(a)}var eb=Math.abs,fb=Math.ceil,gb=Math.floor,hb=Math.min,ib=Math.trunc,jb=0,kb=null,lb=null;f.preloadedImages={};f.preloadedAudios={};
function mb(a){return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):0===a.indexOf("data:application/octet-stream;base64,")}
(function(){function a(){try{if(f.wasmBinary)return new Uint8Array(f.wasmBinary);if(f.readBinary)return f.readBinary(e);throw"both async and sync fetching of the wasm failed";}catch(t){g(t)}}function b(){return f.wasmBinary||!ea&&!fa||"function"!==typeof fetch?new Promise(function(b){b(a())}):fetch(e,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+e+"'";return a.arrayBuffer()}).catch(function(){return a()})}function c(a){function c(a){m=a.exports;
if(m.memory){a=m.memory;var b=f.buffer;a.byteLength<b.byteLength&&k("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here");b=new Int8Array(b);(new Int8Array(a)).set(b);f.buffer=buffer=a;Na()}f.asm=m;f.usingWasm=!0;jb--;f.monitorRunDependencies&&f.monitorRunDependencies(jb);0==jb&&(null!==kb&&(clearInterval(kb),kb=null),lb&&(a=lb,lb=null,a()))}function d(a){c(a.instance)}function h(a){b().then(function(a){return WebAssembly.instantiate(a,l)}).then(a,
function(a){k("failed to asynchronously prepare wasm: "+a);g(a)})}if("object"!==typeof WebAssembly)return k("no native wasm support detected"),!1;if(!(f.wasmMemory instanceof WebAssembly.Memory))return k("no native wasm Memory in use"),!1;a.memory=f.wasmMemory;l.global={NaN:NaN,Infinity:Infinity};l["global.Math"]=Math;l.env=a;jb++;f.monitorRunDependencies&&f.monitorRunDependencies(jb);if(f.instantiateWasm)try{return f.instantiateWasm(l,c)}catch(X){return k("Module.instantiateWasm callback failed with error: "+
X),!1}f.wasmBinary||"function"!==typeof WebAssembly.instantiateStreaming||mb(e)||"function"!==typeof fetch?h(d):WebAssembly.instantiateStreaming(fetch(e,{credentials:"same-origin"}),l).then(d,function(a){k("wasm streaming compile failed: "+a);k("falling back to ArrayBuffer instantiation");h(d)});return{}}var d="canvaskit.wast",e="canvaskit.wasm",h="canvaskit.temp.asm.js";mb(d)||(d=ka(d));mb(e)||(e=ka(e));mb(h)||(h=ka(h));var l={global:null,env:null,asm2wasm:xa,parent:f},m=null;f.asmPreload=f.asm;
var n=f.reallocBuffer;f.reallocBuffer=function(a){if("asmjs"===q)var b=n(a);else a:{a=Ja(a,f.usingWasm?Ga:Ha);var c=f.buffer.byteLength;if(f.usingWasm)try{b=-1!==f.wasmMemory.grow((a-c)/65536)?f.buffer=f.wasmMemory.buffer:null;break a}catch(E){b=null;break a}b=void 0}return b};var q="";f.asm=function(a,b){if(!b.table){a=f.wasmTableSize;void 0===a&&(a=1024);var d=f.wasmMaxTableSize;b.table="object"===typeof WebAssembly&&"function"===typeof WebAssembly.Table?void 0!==d?new WebAssembly.Table({initial:a,
maximum:d,element:"anyfunc"}):new WebAssembly.Table({initial:a,element:"anyfunc"}):Array(a);f.wasmTable=b.table}b.memoryBase||(b.memoryBase=f.STATIC_BASE);b.tableBase||(b.tableBase=0);b=c(b);assert(b,"no binaryen method succeeded.");return b}})();Oa=1024;qa=Oa+570112;Za.push({Ja:function(){nb()}},{Ja:function(){ob()}},{Ja:function(){pb()}},{Ja:function(){qb()}});f.STATIC_BASE=Oa;f.STATIC_BUMP=570112;qa+=16;var B={};
function rb(a){if(rb.jc){var b=p[a>>2];var c=p[b>>2]}else rb.jc=!0,B.USER=B.LOGNAME="web_user",B.PATH="/",B.PWD="/",B.HOME="/home/web_user",B.LANG="C.UTF-8",B._=f.thisProgram,c=Pa?cb?Aa(1024):ra(1024):pa(1024),b=Pa?cb?Aa(256):ra(256):pa(256),p[b>>2]=c,p[a>>2]=b;a=[];var d=0,e;for(e in B)if("string"===typeof B[e]){var h=e+"="+B[e];a.push(h);d+=h.length}if(1024<d)throw Error("Environment size exceeded TOTAL_ENV_SIZE!");for(e=0;e<a.length;e++){d=h=a[e];for(var l=c,m=0;m<d.length;++m)v[l++>>0]=d.charCodeAt(m);
v[l>>0]=0;p[b+4*e>>2]=c;c+=h.length+1}p[b+4*a.length>>2]=0}
var C={na:1,aa:2,Pe:3,Md:4,Ca:5,Hb:6,dd:7,je:8,$:9,td:10,Cb:11,Ze:11,Fb:12,Oa:13,Fd:14,ve:15,Db:16,Eb:17,$e:18,Qa:19,jb:20,Pa:21,F:22,ee:23,Yb:24,ga:25,We:26,Gd:27,re:28,Ra:29,Me:30,Yd:31,Fe:32,Cd:33,Je:34,ne:42,Jd:43,ud:44,Pd:45,Qd:46,Rd:47,Xd:48,Xe:49,he:50,Od:51,zd:35,ke:37,ld:52,od:53,af:54,fe:55,pd:56,qd:57,Ad:35,rd:59,te:60,ie:61,Te:62,se:63,oe:64,pe:65,Le:66,le:67,hd:68,Qe:69,vd:70,Ge:71,$d:72,Dd:73,nd:74,Ae:76,md:77,Ke:78,Sd:79,Td:80,Wd:81,Vd:82,Ud:83,ue:38,Gb:39,ae:36,ib:40,Be:95,Ee:96,yd:104,
ge:105,jd:97,Ie:91,ye:88,qe:92,Ne:108,xd:111,ed:98,wd:103,de:101,be:100,Ue:110,Hd:112,Id:113,Ld:115,kd:114,Bd:89,Zd:90,He:93,Oe:94,gd:99,ce:102,Nd:106,we:107,Ve:109,Ye:87,Ed:122,Re:116,ze:95,me:123,Kd:84,Ce:75,sd:125,xe:131,De:130,Se:86};function sb(a){f.___errno_location&&(p[f.___errno_location()>>2]=a);return a}
var tb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",
24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",
44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",
65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",
82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available"