@m2c2kit/addons 0.1.1 → 0.1.5
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/dist/index.d.ts +92 -2
- package/dist/index.js +2 -0
- package/package.json +10 -9
- package/dist/index.mjs +0 -398
- package/dist/index.mjs.map +0 -1
package/dist/index.mjs
DELETED
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
var t,e,n,r;!function(t){t.sequence="Sequence",t.group="Group",t.wait="Wait",t.custom="Custom",t.move="Move",t.scale="Scale";}(t||(t={}));class i{constructor(t=!1){this.startOffset=-1,this.endOffset=-1,this.started=!1,this.running=!1,this.completed=!1,this.runStartTime=-1,this.duration=0,this.isParent=!1,this.isChild=!1,this.runDuringTransition=t;}static Move(t){var e;return new u(t.point,t.duration,null!==(e=t.runDuringTransition)&&void 0!==e&&e)}static Wait(t){var e;return new l(t.duration,null!==(e=t.runDuringTransition)&&void 0!==e&&e)}static Custom(t){var e;return new s(t.callback,null!==(e=t.runDuringTransition)&&void 0!==e&&e)}static Scale(t){return new c(t.scale,t.duration,t.runDuringTransition)}static Sequence(t){const e=new a(t);return e.children=t,e}static Group(t){const e=new o(t);return e.children=t,e}initialize(e,n){this.assignParents(this,this,n);const r=this.flattenActions(this);r.forEach((t=>t.duration=this.calculateDuration(t))),this.calculateStartEndOffsets(this);return r.filter((e=>e.type!==t.group&&e.type!==t.sequence)).map((t=>i.cloneAction(t,n)))}static cloneAction(e,n){let r;switch(e.type){case t.sequence:{const t=e.children.map((t=>i.cloneAction(t,n)));r=i.Sequence(t);break}case t.group:{const t=e.children.map((t=>i.cloneAction(t,n)));r=i.Sequence(t);break}case t.move:{const t=e;r=i.Move({point:t.point,duration:t.duration,runDuringTransition:t.runDuringTransition});break}case t.custom:{const t=e;r=i.Custom({callback:t.codeCallback,runDuringTransition:t.runDuringTransition});break}case t.scale:{const t=e;r=i.Scale({scale:t.scale,duration:t.duration,runDuringTransition:t.runDuringTransition});break}case t.wait:{const t=e;r=i.Wait({duration:t.duration,runDuringTransition:t.runDuringTransition});break}default:throw new Error("unknown action")}return void 0!==n&&(r.key=n),r.startOffset=e.startOffset,r.endOffset=e.endOffset,r}static evaluateAction(e,n,r,i){if(r<e.runStartTime+e.startOffset)return;if(r>=e.runStartTime+e.startOffset&&r<=e.runStartTime+e.startOffset+e.duration?e.running=!0:e.running=!1,!1===e.running&&!0===e.completed)return;const a=r-(e.runStartTime+e.startOffset);if(e.type===t.custom){const t=e;t.codeCallback(),t.running=!1,t.completed=!0;}if(e.type===t.wait){const t=e;r>e.runStartTime+e.startOffset+e.duration&&(t.running=!1,t.completed=!0);}if(e.type===t.move){const t=e;t.started||(t.dx=t.point.x-n.position.x,t.dy=t.point.y-n.position.y,t.started=!0),a<t.duration?(n.position.x=n.position.x+t.dx*(i/t.duration),n.position.y=n.position.y+t.dy*(i/t.duration)):(n.position.x=t.point.x,n.position.y=t.point.y,t.running=!1,t.completed=!0);}if(e.type===t.scale){const t=e;t.started||(t.delta=t.scale-n.scale,t.started=!0),a<t.duration?n.scale=n.scale+t.delta*(i/t.duration):(n.scale=t.scale,t.running=!1,t.completed=!0);}}calculateDuration(e){if(e.type===t.group){return e.children.map((t=>this.calculateDuration(t))).reduce(((t,e)=>Math.max(t,e)),0)}if(e.type===t.sequence){return e.children.map((t=>this.calculateDuration(t))).reduce(((t,e)=>t+e),0)}return e.duration}calculateStartEndOffsets(e){var n,r,i;let a=0;if(void 0!==e.parent&&(a=e.parent.startOffset),(null===(n=e.parent)||void 0===n?void 0:n.type)===t.group)e.startOffset=a,e.endOffset=e.startOffset+e.duration;else if((null===(r=e.parent)||void 0===r?void 0:r.type)===t.sequence){const t=e.parent;let n=0;for(const r of t.children){if(r===e)break;n+=r.duration;}e.startOffset=n,e.endOffset=e.startOffset+e.duration;}else e.startOffset=a,e.endOffset=e.startOffset+e.duration;e.isParent&&(null===(i=e.children)||void 0===i||i.forEach((t=>this.calculateStartEndOffsets(t))));}flattenActions(t,e){if(e||(e=new Array).push(t),t.isParent){const n=t,r=n.children;e.push(...r),n.children.filter((t=>t.isParent)).forEach((t=>this.flattenActions(t,e)));}return e}assignParents(t,e,n){if(void 0!==n&&(t.key=n),e||((e=t).parent=void 0),t.isParent){const r=t;r.children.forEach((e=>{e.parent=t;})),r.children.filter((t=>t.isParent)).forEach((t=>this.assignParents(t,e,n)));}}}class a extends i{constructor(e){super(),this.type=t.sequence,this.children=e,this.isParent=!0;}}class o extends i{constructor(e){super(),this.type=t.group,this.children=new Array,this.children=e,this.isParent=!0;}}class s extends i{constructor(e,n=!1){super(n),this.type=t.custom,this.codeCallback=e,this.isParent=!1,this.duration=0;}}class l extends i{constructor(e,n){super(n),this.type=t.wait,this.duration=e,this.isParent=!1;}}class u extends i{constructor(e,n,r){super(r),this.type=t.move,this.dx=0,this.dy=0,this.duration=n,this.point=e,this.isParent=!1;}}class c extends i{constructor(e,n,r=!1){super(r),this.type=t.scale,this.delta=0,this.duration=n,this.scale=e,this.isParent=!1;}}class h{constructor(){this.now=NaN,this.deltaTime=NaN,this.canvasScale=NaN,this.rootScale=1,this.canvasCssWidth=NaN,this.canvasCssHeight=NaN;}}globalThis.Globals=new h;class f{}!function(t){t.topToTopOf="topToTopOf",t.topToBottomOf="topToBottomOf",t.bottomToTopOf="bottomToTopOf",t.bottomToBottomOf="bottomToBottomOf",t.startToStartOf="startToStartOf",t.startToEndOf="startToEndOf",t.endToEndOf="endToEndOf",t.endToStartOf="endToStartOf";}(e||(e={}));class d{constructor(t,n){this.verticalConstraint=!1,this.focalEntityMinimum=!1,this.alterEntityMinimum=!1,this.verticalTypes=[e.topToTopOf,e.topToBottomOf,e.bottomToTopOf,e.bottomToBottomOf],this.focalEntityMinimumTypes=[e.topToTopOf,e.topToBottomOf,e.startToStartOf,e.startToEndOf],this.alterEntityMinimumTypes=[e.topToTopOf,e.bottomToTopOf,e.startToStartOf,e.endToStartOf],this.type=t,this.alterEntity=n,this.verticalTypes.includes(t)?(this.verticalConstraint=!0,this.focalEntityMinimumTypes.includes(t)?this.focalEntityMinimum=!0:this.focalEntityMinimum=!1,this.alterEntityMinimumTypes.includes(t)?this.alterEntityMinimum=!0:this.alterEntityMinimum=!1):(this.verticalConstraint=!1,this.focalEntityMinimumTypes.includes(t)?this.focalEntityMinimum=!0:this.focalEntityMinimum=!1,this.alterEntityMinimumTypes.includes(t)?this.alterEntityMinimum=!0:this.alterEntityMinimum=!1);}}class p{constructor(t=0,e=0){this.width=t,this.height=e,this.width=t,this.height=e;}}class g{constructor(t,e){null!=t&&null!=e?(this.x=t,this.y=e):(this.x=0,this.y=0);}}function m(t,e){t.isDrawable&&function(t,e){e.anchorPoint&&(t.anchorPoint=e.anchorPoint),e.zPosition&&(t.zPosition=e.zPosition);}(t,e),t.isText&&function(t,e){e.text&&(t.text=e.text),e.fontName&&(t.fontName=e.fontName),e.fontColor&&(t.fontColor=e.fontColor),e.fontSize&&(t.fontSize=e.fontSize);}(t,e);}!function(t){t.entity="Entity",t.scene="Scene",t.sprite="Sprite",t.label="Label",t.textline="TextLine",t.shape="Shape",t.composite="Composite";}(n||(n={}));class y{constructor(t={}){this.type=n.entity,this.isDrawable=!1,this.isShape=!1,this.isText=!1,this.position=new g(0,0),this.scale=1,this.isUserInteractionEnabled=!1,this.hidden=!1,this.layout={},this.children=new Array,this.absolutePosition=new g(0,0),this.size=new p(0,0),this.absoluteScale=1,this.actions=new Array,this.originalActions=new Array,this.tapListeners=new Array,this.uuid=this.generateUUID(),this.needsInitialization=!0,this.userData={},this.loopMessages=new Set,this.toString=()=>this.name!==this.uuid?`"${this.name}" (${this.type}, ${this.uuid})`:`"${this.type} (${this.uuid})`,void 0===t.name?this.name=this.uuid:this.name=t.name,t.position&&(this.position=t.position),t.scale&&(this.scale=t.scale),t.isUserInteractionEnabled&&(this.isUserInteractionEnabled=t.isUserInteractionEnabled),t.layout&&(this.layout=t.layout);}initialize(){throw new Error("initialize() called in abstract base class Entity.")}addChild(t){if(t.type==n.scene)throw new Error("A scene cannot be the child of an entity. A scene can only be added to a game object");if(t.parent=this,this.children.map((t=>t.name)).includes(t.name))throw new Error(`Cannot add child entity ${t.toString()} to parent entity ${this.toString()}. A child with name "${t.name}" already exists on parent.`);this.children.push(t);}removeAllChildren(){for(;this.children.length;)this.children.pop();}removeChild(t){if(!this.children.includes(t))throw new Error(`cannot remove entity ${t} from parent ${this} because the entity is not currently a child of the parent`);this.children=this.children.filter((t=>t!=t));}descendant(t){const e=this.descendants.filter((e=>e.name===t)).find(Boolean);if(void 0===e)throw new Error(`descendant with name ${t} not found on parent ${this.toString()}`);return e}get descendants(){function t(e,n){n.push(e),e.children.forEach((e=>t(e,n)));}const e=new Array;return this.children.forEach((n=>t(n,e))),e}onTap(t,e=!0){const n=new f;n.entityName=this.name,n.codeCallback=t,e&&(this.tapListeners=this.tapListeners.filter((t=>t.entityName!==n.entityName))),this.tapListeners.push(n);}parseLayoutConstraints(t,n){const r=new Array;return Object.values(e).forEach((e=>{if(void 0!==t[e]){let i,a="";if(t[e]instanceof y)i=t[e];else {const r=t[e];i=n.filter((t=>t.name===r)).find(Boolean),a=`. sibling entity named "${r}" has not been added to the game object`;}if(void 0===i)throw new Error("could not find sibling entity for constraint"+a);const o=new d(e,i);r.push(o);}})),r}calculateYFromConstraint(t,e,r,i){let a=t.alterEntity.absolutePosition.y;return t.alterEntityMinimum?t.alterEntity.type!==n.scene&&(a-=.5*t.alterEntity.size.height*i):t.alterEntity.type!==n.scene?a+=.5*t.alterEntity.size.height*i:a+=t.alterEntity.size.height*i,t.focalEntityMinimum?(a+=.5*this.size.height*i,a+=e*i):(a-=.5*this.size.height*i,a-=r*i),a}calculateXFromConstraint(t,e,r,i){let a=t.alterEntity.absolutePosition.x;return t.alterEntityMinimum?t.alterEntity.type!==n.scene&&(a-=.5*t.alterEntity.size.width*i):t.alterEntity.type!==n.scene?a+=.5*t.alterEntity.size.width*i:a+=t.alterEntity.size.width*i,t.focalEntityMinimum?(a+=.5*this.size.width*i,a+=e*i):(a-=.5*this.size.width*i,a-=r*i),a}update(){var t,r,a,o,s,l,u,c,h,f,d,p,g,m,v,w;if(this.needsInitialization&&(this.initialize(),this.needsInitialization=!1),void 0===this.parent)this.absolutePosition.x=this.position.x*this.scale,this.absolutePosition.y=this.position.y*this.scale,this.absoluteScale=this.scale;else if(this.absoluteScale=this.parent.absoluteScale*this.scale,void 0===(null===(t=this.layout)||void 0===t?void 0:t.constraints))this.absolutePosition.x=this.parent.absolutePosition.x+this.position.x*this.parent.absoluteScale,this.absolutePosition.y=this.parent.absolutePosition.y+this.position.y*this.parent.absoluteScale;else {const t=null!==(o=null===(a=null===(r=this.layout)||void 0===r?void 0:r.constraints)||void 0===a?void 0:a.horizontalBias)&&void 0!==o?o:.5,e=null!==(u=null===(l=null===(s=this.layout)||void 0===s?void 0:s.constraints)||void 0===l?void 0:l.verticalBias)&&void 0!==u?u:.5,n=null!==(h=null===(c=this.layout)||void 0===c?void 0:c.marginTop)&&void 0!==h?h:0,i=null!==(d=null===(f=this.layout)||void 0===f?void 0:f.marginBottom)&&void 0!==d?d:0,y=null!==(g=null===(p=this.layout)||void 0===p?void 0:p.marginStart)&&void 0!==g?g:0,b=null!==(v=null===(m=this.layout)||void 0===m?void 0:m.marginEnd)&&void 0!==v?v:0,S=this.parseLayoutConstraints(null===(w=this.layout)||void 0===w?void 0:w.constraints,this.parentSceneAsEntity.descendants),T=this.parent.absoluteScale,A=S.filter((t=>t.verticalConstraint)).map((t=>this.calculateYFromConstraint(t,n,i,T)));0===A.length||(1===A.length?this.absolutePosition.y=A[0]:2===A.length&&(this.absolutePosition.y=Math.min(A[0],A[1])+e*Math.abs(A[0]-A[1])));const C=S.filter((t=>!t.verticalConstraint)).map((t=>this.calculateXFromConstraint(t,y,b,T)));0===C.length||(1===C.length?this.absolutePosition.x=C[0]:2===C.length&&(this.absolutePosition.x=Math.min(C[0],C[1])+t*Math.abs(C[0]-C[1])));}const b=this.actions.filter((t=>t.runDuringTransition&&!t.completed)),S=this.actions.filter((t=>!t.runDuringTransition&&!t.completed));b.length>0?(b.forEach((t=>{-1===t.runStartTime&&(t.runStartTime=Globals.now);})),b.forEach((t=>i.evaluateAction(t,this,Globals.now,Globals.deltaTime)))):S.length>0&&(S.forEach((t=>{-1===t.runStartTime&&(t.runStartTime=Globals.now);})),S.forEach((t=>i.evaluateAction(t,this,Globals.now,Globals.deltaTime))));const T=new Map;this.children.forEach((t=>{var r;T.set(t.uuid,function(t,r){const i=new Array;return void 0===r||Object.values(e).forEach((e=>{if(void 0!==r[e]){let a,o="";if(r[e]instanceof y)a=r[e];else {const i=r[e];let s;s=t.type===n.scene?t.descendants:t.parentSceneAsEntity.descendants,a=s.filter((t=>t.name===i)).find(Boolean),void 0===a&&(o=`. sibling entity named "${i}" has not been added to the game object`);}if(void 0===a)throw new Error("error getting uuid of sibling contraint"+o);a!==t&&i.push(a.uuid);}})),i}(this,null===(r=t.layout)||void 0===r?void 0:r.constraints));}));const A=this.findTopologicalSort(T);if(A.length>0){const t=A.reverse(),e=new Array;t.forEach((t=>{const n=this.children.filter((e=>e.uuid===t)).find(Boolean);if(void 0===n)throw new Error("error in dag topological sort");e.push(n);})),e.forEach((t=>t.update()));}else this.children.forEach((t=>t.update()));}drawChildren(t){this.children.filter((t=>!t.hidden&&t.isDrawable)).map((t=>t)).sort(((t,e)=>t.zPosition-e.zPosition)).forEach((e=>e.draw(t)));}run(t,e){this.actions.push(...t.initialize(this,e)),this.originalActions=this.actions.filter((t=>!1===t.runDuringTransition)).map((t=>i.cloneAction(t,e)));}removeAction(t){this.actions=this.actions.filter((e=>e.key!==t));}removeAllActions(){for(;this.actions.length;)this.actions.pop();}static getEntityOptions(t){return {name:t.name,position:t.position,scale:t.scale,isUserInteractionEnabled:t.isUserInteractionEnabled,hidden:t.hidden}}static getDrawableOptions(t){return {anchorPoint:t.anchorPoint,zPosition:t.zPosition}}static getTextOptions(t){return {text:t.text,fontName:t.fontName,fontColor:t.fontColor,fontSize:t.fontSize}}get parentSceneAsEntity(){if(this.type===n.scene)throw new Error(`Entity ${this} is a scene and cannot have a parent scene`);if(this.parent&&this.parent.type===n.scene)return this.parent;if(this.parent)return this.parent.parentSceneAsEntity;throw new Error(`Entity ${this} has not been added to a scene`)}generateUUID(){let t=(new Date).getTime(),e=performance&&performance.now&&1e3*performance.now()||0;return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(n=>{let r=16*Math.random();return t>0?(r=(t+r)%16|0,t=Math.floor(t/16)):(r=(e+r)%16|0,e=Math.floor(e/16)),("x"==n?r:7&r|8).toString(16)}))}findTopologicalSort(t){var e;const n=[],r=new Map;t.forEach(((t,e)=>{r.has(e)||r.set(e,0),t.forEach((t=>{r.has(t)?r.set(t,r.get(t)+1):r.set(t,1);}));}));const i=[];for(r.forEach(((t,e)=>{0==t&&i.push(e);}));i.length>0;){const a=i.shift();if(void 0===a)throw "bad";n.push(a),t.has(a)&&(null===(e=t.get(a))||void 0===e||e.forEach((t=>{if(r.has(t)&&r.get(t)>0){const e=r.get(t)-1;r.set(t,e),0==e&&i.push(t);}})));}return n}}class v extends y{constructor(t={}){super(t),this.type=n.composite,this.compositeType="<compositeType>",this.isDrawable=!0,this.anchorPoint=new g(.5,.5),this.zPosition=0,m(this,t);}initialize(){}update(){super.update();}draw(t){super.drawChildren(t);}}class w{}w.Transparent=[0,0,0,0],w.MediumVioletRed=[199,21,133,1],w.DeepPink=[255,20,147,1],w.PaleVioletRed=[219,112,147,1],w.HotPink=[255,105,180,1],w.LightPink=[255,182,193,1],w.Pink=[255,192,203,1],w.DarkRed=[139,0,0,1],w.Red=[255,0,0,1],w.Firebrick=[178,34,34,1],w.Crimson=[220,20,60,1],w.IndianRed=[205,92,92,1],w.LightCoral=[240,128,128,1],w.Salmon=[250,128,114,1],w.DarkSalmon=[233,150,122,1],w.LightSalmon=[255,160,122,1],w.OrangeRed=[255,69,0,1],w.Tomato=[255,99,71,1],w.DarkOrange=[255,140,0,1],w.Coral=[255,127,80,1],w.Orange=[255,165,0,1],w.DarkKhaki=[189,183,107,1],w.Gold=[255,215,0,1],w.Khaki=[240,230,140,1],w.PeachPuff=[255,218,185,1],w.Yellow=[255,255,0,1],w.PaleGoldenrod=[238,232,170,1],w.Moccasin=[255,228,181,1],w.PapayaWhip=[255,239,213,1],w.LightGoldenrodYellow=[250,250,210,1],w.LemonChiffon=[255,250,205,1],w.LightYellow=[255,255,224,1],w.Maroon=[128,0,0,1],w.Brown=[165,42,42,1],w.SaddleBrown=[139,69,19,1],w.Sienna=[160,82,45,1],w.Chocolate=[210,105,30,1],w.DarkGoldenrod=[184,134,11,1],w.Peru=[205,133,63,1],w.RosyBrown=[188,143,143,1],w.Goldenrod=[218,165,32,1],w.SandyBrown=[244,164,96,1],w.Tan=[210,180,140,1],w.Burlywood=[222,184,135,1],w.Wheat=[245,222,179,1],w.NavajoWhite=[255,222,173,1],w.Bisque=[255,228,196,1],w.BlanchedAlmond=[255,235,205,1],w.Cornsilk=[255,248,220,1],w.DarkGreen=[0,100,0,1],w.Green=[0,128,0,1],w.DarkOliveGreen=[85,107,47,1],w.ForestGreen=[34,139,34,1],w.SeaGreen=[46,139,87,1],w.Olive=[128,128,0,1],w.OliveDrab=[107,142,35,1],w.MediumSeaGreen=[60,179,113,1],w.LimeGreen=[50,205,50,1],w.Lime=[0,255,0,1],w.SpringGreen=[0,255,127,1],w.MediumSpringGreen=[0,250,154,1],w.DarkSeaGreen=[143,188,143,1],w.MediumAquamarine=[102,205,170,1],w.YellowGreen=[154,205,50,1],w.LawnGreen=[124,252,0,1],w.Chartreuse=[127,255,0,1],w.LightGreen=[144,238,144,1],w.GreenYellow=[173,255,47,1],w.PaleGreen=[152,251,152,1],w.Teal=[0,128,128,1],w.DarkCyan=[0,139,139,1],w.LightSeaGreen=[32,178,170,1],w.CadetBlue=[95,158,160,1],w.DarkTurquoise=[0,206,209,1],w.MediumTurquoise=[72,209,204,1],w.Turquoise=[64,224,208,1],w.Aqua=[0,255,255,1],w.Cyan=[0,255,255,1],w.Aquamarine=[127,255,212,1],w.PaleTurquoise=[175,238,238,1],w.LightCyan=[224,255,255,1],w.Navy=[0,0,128,1],w.DarkBlue=[0,0,139,1],w.MediumBlue=[0,0,205,1],w.Blue=[0,0,255,1],w.MidnightBlue=[25,25,112,1],w.RoyalBlue=[65,105,225,1],w.SteelBlue=[70,130,180,1],w.DodgerBlue=[30,144,255,1],w.DeepSkyBlue=[0,191,255,1],w.CornflowerBlue=[100,149,237,1],w.SkyBlue=[135,206,235,1],w.LightSkyBlue=[135,206,250,1],w.LightSteelBlue=[176,196,222,1],w.LightBlue=[173,216,230,1],w.PowderBlue=[176,224,230,1],w.Indigo=[75,0,130,1],w.Purple=[128,0,128,1],w.DarkMagenta=[139,0,139,1],w.DarkViolet=[148,0,211,1],w.DarkSlateBlue=[72,61,139,1],w.BlueViolet=[138,43,226,1],w.DarkOrchid=[153,50,204,1],w.Fuchsia=[255,0,255,1],w.Magenta=[255,0,255,1],w.SlateBlue=[106,90,205,1],w.MediumSlateBlue=[123,104,238,1],w.MediumOrchid=[186,85,211,1],w.MediumPurple=[147,112,219,1],w.Orchid=[218,112,214,1],w.Violet=[238,130,238,1],w.Plum=[221,160,221,1],w.Thistle=[216,191,216,1],w.Lavender=[230,230,250,1],w.MistyRose=[255,228,225,1],w.AntiqueWhite=[250,235,215,1],w.Linen=[250,240,230,1],w.Beige=[245,245,220,1],w.WhiteSmoke=[245,245,245,1],w.LavenderBlush=[255,240,245,1],w.OldLace=[253,245,230,1],w.AliceBlue=[240,248,255,1],w.Seashell=[255,245,238,1],w.GhostWhite=[248,248,255,1],w.Honeydew=[240,255,240,1],w.FloralWhite=[255,250,240,1],w.Azure=[240,255,255,1],w.MintCream=[245,255,250,1],w.Snow=[255,250,250,1],w.Ivory=[255,255,240,1],w.White=[255,255,255,1],w.Black=[0,0,0,1],w.DarkSlateGray=[47,79,79,1],w.DimGray=[105,105,105,1],w.SlateGray=[112,128,144,1],w.Gray=[128,128,128,1],w.LightSlateGray=[119,136,153,1],w.DarkGray=[169,169,169,1],w.Silver=[192,192,192,1],w.LightGray=[211,211,211,1],w.Gainsboro=[220,220,220,1],w.RebeccaPurple=[102,51,153,1];class b{}b.FPS_DISPLAY_TEXT_FONT_SIZE=12,b.FPS_DISPLAY_TEXT_COLOR=[0,0,0,.5],b.FPS_DISPLAY_UPDATE_INTERVAL=500,b.DEFAULT_SCENE_BACKGROUND_COLOR=w.WhiteSmoke,b.DEFAULT_SHAPE_FILL_COLOR=w.Red,b.DEFAULT_FONT_COLOR=w.Black,b.DEFAULT_FONT_SIZE=16,b.LIMITED_FPS_RATE=5,function(t){t[t.MATCH_CONSTRAINT=0]="MATCH_CONSTRAINT";}(r||(r={}));function R(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}});})),e}var B={exports:{}};var L=R(Object.freeze({__proto__:null,path_empty_shim:function(){}}));var I=R(Object.freeze({__proto__:null,fs_empty_shim:function(){}}));!function(t,e){var n,r=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(n=n||__filename),function(t){var e,r,i,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,i=e;})),(a=e).Vd=a.Vd||[],a.Vd.push((function(){a.MakeSWCanvasSurface=function(t){var e=t;if("CANVAS"!==e.tagName&&!(e=document.getElementById(t)))throw "Canvas with id "+t+" was not found";return (t=a.MakeSurface(e.width,e.height))&&(t.Nd=e),t},a.MakeCanvasSurface||(a.MakeCanvasSurface=a.MakeSWCanvasSurface),a.MakeSurface=function(t,e){var n={width:t,height:e,colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul,colorSpace:a.ColorSpace.SRGB},r=t*e*4,i=a._malloc(r);return (n=a.Surface._makeRasterDirect(n,i,4*t))&&(n.Nd=null,n.zf=t,n.wf=e,n.yf=r,n.af=i,n.getCanvas().clear(a.TRANSPARENT)),n},a.MakeRasterDirectSurface=function(t,e,n){return a.Surface._makeRasterDirect(t,e.byteOffset,n)},a.Surface.prototype.flush=function(t){if(a.Od(this.Md),this._flush(),this.Nd){var e=new Uint8ClampedArray(a.HEAPU8.buffer,this.af,this.yf);e=new ImageData(e,this.zf,this.wf),t?this.Nd.getContext("2d").putImageData(e,0,0,t[0],t[1],t[2]-t[0],t[3]-t[1]):this.Nd.getContext("2d").putImageData(e,0,0);}},a.Surface.prototype.dispose=function(){this.af&&a._free(this.af),this.delete();},a.Od=a.Od||function(){};})),function(t){t.Vd=t.Vd||[],t.Vd.push((function(){function e(t,e,n){return t&&t.hasOwnProperty(e)?t[e]:n}function n(t){var e=ke.length;return e||(ke.push(null),e=1),ke.push(t),e}function r(t){return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}function i(t){return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}t.GetWebGLContext=function(t,n){if(!t)throw "null canvas passed into makeWebGLContext";var r={alpha:e(n,"alpha",1),depth:e(n,"depth",1),stencil:e(n,"stencil",8),antialias:e(n,"antialias",0),premultipliedAlpha:e(n,"premultipliedAlpha",1),preserveDrawingBuffer:e(n,"preserveDrawingBuffer",0),preferLowPowerToHighPerformance:e(n,"preferLowPowerToHighPerformance",0),failIfMajorPerformanceCaveat:e(n,"failIfMajorPerformanceCaveat",0),enableExtensionsByDefault:e(n,"enableExtensionsByDefault",1),explicitSwapControl:e(n,"explicitSwapControl",0),renderViaOffscreenBackBuffer:e(n,"renderViaOffscreenBackBuffer",0)};if(r.majorVersion=n&&n.majorVersion?n.majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1,r.explicitSwapControl)throw "explicitSwapControl is not supported";return t=function(t,e){t.rf||(t.rf=t.getContext,t.getContext=function(e,n){return "webgl"==e==(n=t.rf(e,n))instanceof WebGLRenderingContext?n:null});var n=1<e.majorVersion?t.getContext("webgl2",e):t.getContext("webgl",e);return n?function(t,e){var n=Ue(Oe),r={Rf:n,attributes:e,version:e.majorVersion,le:t};return t.canvas&&(t.canvas.vf=r),Oe[n]=r,(void 0===e.Gf||e.Gf)&&function(t){if(t||(t=Ne),!t.Uf){t.Uf=!0;var e=t.le;!function(t){var e=t.getExtension("ANGLE_instanced_arrays");e&&(t.vertexAttribDivisor=function(t,n){e.vertexAttribDivisorANGLE(t,n);},t.drawArraysInstanced=function(t,n,r,i){e.drawArraysInstancedANGLE(t,n,r,i);},t.drawElementsInstanced=function(t,n,r,i,a){e.drawElementsInstancedANGLE(t,n,r,i,a);});}(e),function(t){var e=t.getExtension("OES_vertex_array_object");e&&(t.createVertexArray=function(){return e.createVertexArrayOES()},t.deleteVertexArray=function(t){e.deleteVertexArrayOES(t);},t.bindVertexArray=function(t){e.bindVertexArrayOES(t);},t.isVertexArray=function(t){return e.isVertexArrayOES(t)});}(e),function(t){var e=t.getExtension("WEBGL_draw_buffers");e&&(t.drawBuffers=function(t,n){e.drawBuffersWEBGL(t,n);});}(e),e.nf=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),e.sf=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"),2<=t.version&&(e.pf=e.getExtension("EXT_disjoint_timer_query_webgl2")),(2>t.version||!e.pf)&&(e.pf=e.getExtension("EXT_disjoint_timer_query")),e.Bg=e.getExtension("WEBGL_multi_draw"),(e.getSupportedExtensions()||[]).forEach((function(t){t.includes("lose_context")||t.includes("debug")||e.getExtension(t);}));}}(r),n}(n,e):0}(t,r),t?(We(t),t):0},t.deleteContext=function(t){Ne===Oe[t]&&(Ne=null),"object"==typeof JSEvents&&JSEvents.Eg(Oe[t].le.canvas),Oe[t]&&Oe[t].le.canvas&&(Oe[t].le.canvas.vf=void 0),Oe[t]=null;},t._setTextureCleanup({deleteTexture:function(t,e){var n=ke[e];n&&Oe[t].le.deleteTexture(n),ke[e]=null;}}),t.MakeGrContext=function(t){if(!this.Od(t))return null;var e=this._MakeGrContext();return e?(e.Md=t,e):null},t.MakeOnScreenGLSurface=function(t,e,n,r){return (e=this._MakeOnScreenGLSurface(t,e,n,r))?(e.Md=t.Md,e):null},t.MakeRenderTarget=function(t,e,n){return (e=this._MakeRenderTargetWH(t,e,n))?(e.Md=t.Md,e):null},t.MakeRenderTarget=function(t,e){return (e=this._MakeRenderTargetII(t,e))?(e.Md=t.Md,e):null},t.MakeWebGLCanvasSurface=function(e,n,r){n=n||null;var i=e,a="undefined"!=typeof OffscreenCanvas&&i instanceof OffscreenCanvas;if(!("undefined"!=typeof HTMLCanvasElement&&i instanceof HTMLCanvasElement||a||(i=document.getElementById(e),i)))throw "Canvas with id "+e+" was not found";if(!(e=this.GetWebGLContext(i,r))||0>e)throw "failed to create webgl context: err "+e;return e=this.MakeGrContext(e),(n=this.MakeOnScreenGLSurface(e,i.width,i.height,n))||(n=i.cloneNode(!0),i.parentNode.replaceChild(n,i),n.classList.add("ck-replaced"),t.MakeSWCanvasSurface(n))},t.MakeCanvasSurface=t.MakeWebGLCanvasSurface,t.Surface.prototype.makeImageFromTexture=function(e,r){return t.Od(this.Md),e=n(e),this._makeImageFromTexture(this.Md,e,r)},t.Surface.prototype.makeImageFromTextureSource=function(e,n){n||(n={height:r(e),width:i(e),colorType:t.ColorType.RGBA_8888,alphaType:t.AlphaType.Unpremul}),n.colorSpace||(n.colorSpace=t.ColorSpace.SRGB),t.Od(this.Md);var a=Ne.le,o=a.createTexture();return a.bindTexture(a.TEXTURE_2D,o),2===Ne.version?a.texImage2D(a.TEXTURE_2D,0,a.RGBA,n.width,n.height,0,a.RGBA,a.UNSIGNED_BYTE,e):a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,e),a.bindTexture(a.TEXTURE_2D,null),this.makeImageFromTexture(o,n)},t.MakeLazyImageFromTextureSource=function(e,a){a||(a={height:r(e),width:i(e),colorType:t.ColorType.RGBA_8888,alphaType:t.AlphaType.Unpremul}),a.colorSpace||(a.colorSpace=t.ColorSpace.SRGB);var o={makeTexture:function(){var t=Ne,r=t.le,i=r.createTexture();return r.bindTexture(r.TEXTURE_2D,i),2===t.version?r.texImage2D(r.TEXTURE_2D,0,r.RGBA,a.width,a.height,0,r.RGBA,r.UNSIGNED_BYTE,e):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),r.bindTexture(r.TEXTURE_2D,null),n(i)},freeSrc:function(){}};return "VideoFrame"===e.constructor.name&&(o.freeSrc=function(){e.close();}),t.Image._makeFromGenerator(a,o)},t.Od=function(t){return !!t&&We(t)};}));}(e),function(t){function n(t,e,n,r,i){for(var a=0;a<t.length;a++)e[a*n+(a*i+r+n)%n]=t[a];return e}function r(t){for(var e=t*t,n=Array(e);e--;)n[e]=0==e%(t+1)?1:0;return n}function i(t){return !!t&&t.constructor===Float32Array&&4===t.length}function a(t){return (l(255*t[3])<<24|l(255*t[0])<<16|l(255*t[1])<<8|l(255*t[2])<<0)>>>0}function o(t){if(t&&t._ck)return t;if(t instanceof Float32Array){for(var e=Math.floor(t.length/4),n=new Uint32Array(e),r=0;r<e;r++)n[r]=a(t.slice(4*r,4*(r+1)));return n}return t instanceof Uint32Array?t:t instanceof Array&&t[0]instanceof Float32Array?t.map(a):void 0}function s(t){if(void 0===t)return 1;var e=parseFloat(t);return t&&-1!==t.indexOf("%")?e/100:e}function l(t){return Math.round(Math.max(0,Math.min(t||0,255)))}function u(e,n){n&&n._ck||t._free(e);}function c(e,n,r){if(!e||!e.length)return Y;if(e&&e._ck)return e.byteOffset;var i=t[n].BYTES_PER_ELEMENT;return r||(r=t._malloc(e.length*i)),t[n].set(e,r/i),r}function h(e){var n={ce:Y,count:e.length,Ke:t.ColorType.RGBA_F32};if(e instanceof Float32Array)n.ce=c(e,"HEAPF32"),n.count=e.length/4;else if(e instanceof Uint32Array)n.ce=c(e,"HEAPU32"),n.Ke=t.ColorType.RGBA_8888;else {if(!(e instanceof Array))throw "Invalid argument to copyFlexibleColorArray, Not a color array "+typeof e;if(e&&e.length){for(var r=t._malloc(16*e.length),i=0,a=r/4,o=0;o<e.length;o++)for(var s=0;4>s;s++)t.HEAPF32[a+i]=e[o][s],i++;e=r;}else e=Y;n.ce=e;}return n}function f(e){if(!e)return Y;if(e.length){if(6===e.length||9===e.length)return c(e,"HEAPF32",B),6===e.length&&t.HEAPF32.set(V,6+B/4),B;if(16===e.length){var n=T.toTypedArray();return n[0]=e[0],n[1]=e[1],n[2]=e[3],n[3]=e[4],n[4]=e[5],n[5]=e[7],n[6]=e[12],n[7]=e[13],n[8]=e[15],B}throw "invalid matrix size"}return (n=T.toTypedArray())[0]=e.m11,n[1]=e.m21,n[2]=e.m41,n[3]=e.m12,n[4]=e.m22,n[5]=e.m42,n[6]=e.m14,n[7]=e.m24,n[8]=e.m44,B}function d(e){for(var n=Array(16),r=0;16>r;r++)n[r]=t.HEAPF32[e/4+r];return n}function p(t,e){return c(t,"HEAPF32",e||I)}function g(t,e,n,r){var i=C.toTypedArray();return i[0]=t,i[1]=e,i[2]=n,i[3]=r,I}function m(e){for(var n=new Float32Array(4),r=0;4>r;r++)n[r]=t.HEAPF32[e/4+r];return n}function y(t,e){return c(t,"HEAPF32",e||G)}function v(t,e){return c(t,"HEAPF32",e||z)}function w(){for(var t=0,e=0;e<arguments.length-1;e+=2)t+=arguments[e]*arguments[e+1];return t}function b(t,e,n){for(var r=Array(t.length),i=0;i<n;i++)for(var a=0;a<n;a++){for(var o=0,s=0;s<n;s++)o+=t[n*i+s]*e[n*s+a];r[i*n+a]=o;}return r}function S(t,e){for(var n=b(e[0],e[1],t),r=2;r<e.length;)n=b(n,e[r],t),r++;return n}t.Color=function(e,n,r,i){return void 0===i&&(i=1),t.Color4f(l(e)/255,l(n)/255,l(r)/255,i)},t.ColorAsInt=function(t,e,n,r){return void 0===r&&(r=255),(l(r)<<24|l(t)<<16|l(e)<<8|l(n)<<0&268435455)>>>0},t.Color4f=function(t,e,n,r){return void 0===r&&(r=1),Float32Array.of(t,e,n,r)},Object.defineProperty(t,"TRANSPARENT",{get:function(){return t.Color4f(0,0,0,0)}}),Object.defineProperty(t,"BLACK",{get:function(){return t.Color4f(0,0,0,1)}}),Object.defineProperty(t,"WHITE",{get:function(){return t.Color4f(1,1,1,1)}}),Object.defineProperty(t,"RED",{get:function(){return t.Color4f(1,0,0,1)}}),Object.defineProperty(t,"GREEN",{get:function(){return t.Color4f(0,1,0,1)}}),Object.defineProperty(t,"BLUE",{get:function(){return t.Color4f(0,0,1,1)}}),Object.defineProperty(t,"YELLOW",{get:function(){return t.Color4f(1,1,0,1)}}),Object.defineProperty(t,"CYAN",{get:function(){return t.Color4f(0,1,1,1)}}),Object.defineProperty(t,"MAGENTA",{get:function(){return t.Color4f(1,0,1,1)}}),t.getColorComponents=function(t){return [Math.floor(255*t[0]),Math.floor(255*t[1]),Math.floor(255*t[2]),t[3]]},t.parseColorString=function(e,n){if((e=e.toLowerCase()).startsWith("#")){switch(n=255,e.length){case 9:n=parseInt(e.slice(7,9),16);case 7:var r=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);break;case 5:n=17*parseInt(e.slice(4,5),16);case 4:r=17*parseInt(e.slice(1,2),16),i=17*parseInt(e.slice(2,3),16),a=17*parseInt(e.slice(3,4),16);}return t.Color(r,i,a,n/255)}return e.startsWith("rgba")?(e=(e=e.slice(5,-1)).split(","),t.Color(+e[0],+e[1],+e[2],s(e[3]))):e.startsWith("rgb")?(e=(e=e.slice(4,-1)).split(","),t.Color(+e[0],+e[1],+e[2],s(e[3]))):e.startsWith("gray(")||e.startsWith("hsl")||!n||void 0===(e=n[e])?t.BLACK:e},t.multiplyByAlpha=function(t,e){return (t=t.slice())[3]=Math.max(0,Math.min(t[3]*e,1)),t},t.Malloc=function(e,n){var r=t._malloc(n*e.BYTES_PER_ELEMENT);return {_ck:!0,length:n,byteOffset:r,oe:null,subarray:function(t,e){return (t=this.toTypedArray().subarray(t,e))._ck=!0,t},toTypedArray:function(){return this.oe&&this.oe.length||(this.oe=new e(t.HEAPU8.buffer,r,n),this.oe._ck=!0),this.oe}}},t.Free=function(e){t._free(e.byteOffset),e.byteOffset=Y,e.toTypedArray=null,e.oe=null;};var T,A,C,_,P,M,F,k,x,R,B=Y,L=Y,I=Y,G=Y,U=Y,W=Y,N=Y,j=Y,z=Y,H=Y,V=Float32Array.of(0,0,1),Y=0;t.onRuntimeInitialized=function(){function e(e,n,r,i,a,o){o||(o=4*i.width,i.colorType===t.ColorType.RGBA_F16?o*=2:i.colorType===t.ColorType.RGBA_F32&&(o*=4));var s=o*i.height,l=a?a.byteOffset:t._malloc(s);if(!e._readPixels(i,l,o,n,r))return a||t._free(l),null;if(a)return a.toTypedArray();switch(i.colorType){case t.ColorType.RGBA_8888:case t.ColorType.RGBA_F16:e=new Uint8Array(t.HEAPU8.buffer,l,s).slice();break;case t.ColorType.RGBA_F32:e=new Float32Array(t.HEAPU8.buffer,l,s).slice();break;default:return null}return t._free(l),e}C=t.Malloc(Float32Array,4),I=C.byteOffset,A=t.Malloc(Float32Array,16),L=A.byteOffset,T=t.Malloc(Float32Array,9),B=T.byteOffset,x=t.Malloc(Float32Array,12),z=x.byteOffset,R=t.Malloc(Float32Array,12),H=R.byteOffset,_=t.Malloc(Float32Array,4),G=_.byteOffset,P=t.Malloc(Float32Array,4),U=P.byteOffset,M=t.Malloc(Float32Array,3),W=M.byteOffset,F=t.Malloc(Float32Array,3),N=F.byteOffset,k=t.Malloc(Int32Array,4),j=k.byteOffset,t.ColorSpace.SRGB=t.ColorSpace._MakeSRGB(),t.ColorSpace.DISPLAY_P3=t.ColorSpace._MakeDisplayP3(),t.ColorSpace.ADOBE_RGB=t.ColorSpace._MakeAdobeRGB(),t.GlyphRunFlags={IsWhiteSpace:t._GlyphRunFlags_isWhiteSpace},t.Path.MakeFromCmds=function(e){var n=c(e,"HEAPF32"),r=t.Path._MakeFromCmds(n,e.length);return u(n,e),r},t.Path.MakeFromVerbsPointsWeights=function(e,n,r){var i=c(e,"HEAPU8"),a=c(n,"HEAPF32"),o=c(r,"HEAPF32"),s=t.Path._MakeFromVerbsPointsWeights(i,e.length,a,n.length,o,r&&r.length||0);return u(i,e),u(a,n),u(o,r),s},t.Path.prototype.addArc=function(t,e,n){return t=y(t),this._addArc(t,e,n),this},t.Path.prototype.addOval=function(t,e,n){return void 0===n&&(n=1),t=y(t),this._addOval(t,!!e,n),this},t.Path.prototype.addPath=function(){var t=Array.prototype.slice.call(arguments),e=t[0],n=!1;if("boolean"==typeof t[t.length-1]&&(n=t.pop()),1===t.length)this._addPath(e,1,0,0,0,1,0,0,0,1,n);else if(2===t.length)t=t[1],this._addPath(e,t[0],t[1],t[2],t[3],t[4],t[5],t[6]||0,t[7]||0,t[8]||1,n);else {if(7!==t.length&&10!==t.length)return null;this._addPath(e,t[1],t[2],t[3],t[4],t[5],t[6],t[7]||0,t[8]||0,t[9]||1,n);}return this},t.Path.prototype.addPoly=function(t,e){var n=c(t,"HEAPF32");return this._addPoly(n,t.length/2,e),u(n,t),this},t.Path.prototype.addRect=function(t,e){return t=y(t),this._addRect(t,!!e),this},t.Path.prototype.addRRect=function(t,e){return t=v(t),this._addRRect(t,!!e),this},t.Path.prototype.addVerbsPointsWeights=function(t,e,n){var r=c(t,"HEAPU8"),i=c(e,"HEAPF32"),a=c(n,"HEAPF32");this._addVerbsPointsWeights(r,t.length,i,e.length,a,n&&n.length||0),u(r,t),u(i,e),u(a,n);},t.Path.prototype.arc=function(e,n,r,i,a,o){return e=t.LTRBRect(e-r,n-r,e+r,n+r),a=(a-i)/Math.PI*180-360*!!o,(o=new t.Path).addArc(e,i/Math.PI*180,a),this.addPath(o,!0),o.delete(),this},t.Path.prototype.arcToOval=function(t,e,n,r){return t=y(t),this._arcToOval(t,e,n,r),this},t.Path.prototype.arcToRotated=function(t,e,n,r,i,a,o){return this._arcToRotated(t,e,n,!!r,!!i,a,o),this},t.Path.prototype.arcToTangent=function(t,e,n,r,i){return this._arcToTangent(t,e,n,r,i),this},t.Path.prototype.close=function(){return this._close(),this},t.Path.prototype.conicTo=function(t,e,n,r,i){return this._conicTo(t,e,n,r,i),this},t.Path.prototype.computeTightBounds=function(t){this._computeTightBounds(G);var e=_.toTypedArray();return t?(t.set(e),t):e.slice()},t.Path.prototype.cubicTo=function(t,e,n,r,i,a){return this._cubicTo(t,e,n,r,i,a),this},t.Path.prototype.dash=function(t,e,n){return this._dash(t,e,n)?this:null},t.Path.prototype.getBounds=function(t){this._getBounds(G);var e=_.toTypedArray();return t?(t.set(e),t):e.slice()},t.Path.prototype.lineTo=function(t,e){return this._lineTo(t,e),this},t.Path.prototype.moveTo=function(t,e){return this._moveTo(t,e),this},t.Path.prototype.offset=function(t,e){return this._transform(1,0,t,0,1,e,0,0,1),this},t.Path.prototype.quadTo=function(t,e,n,r){return this._quadTo(t,e,n,r),this},t.Path.prototype.rArcTo=function(t,e,n,r,i,a,o){return this._rArcTo(t,e,n,r,i,a,o),this},t.Path.prototype.rConicTo=function(t,e,n,r,i){return this._rConicTo(t,e,n,r,i),this},t.Path.prototype.rCubicTo=function(t,e,n,r,i,a){return this._rCubicTo(t,e,n,r,i,a),this},t.Path.prototype.rLineTo=function(t,e){return this._rLineTo(t,e),this},t.Path.prototype.rMoveTo=function(t,e){return this._rMoveTo(t,e),this},t.Path.prototype.rQuadTo=function(t,e,n,r){return this._rQuadTo(t,e,n,r),this},t.Path.prototype.stroke=function(e){return (e=e||{}).width=e.width||1,e.miter_limit=e.miter_limit||4,e.cap=e.cap||t.StrokeCap.Butt,e.join=e.join||t.StrokeJoin.Miter,e.precision=e.precision||1,this._stroke(e)?this:null},t.Path.prototype.transform=function(){if(1===arguments.length){var t=arguments[0];this._transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6]||0,t[7]||0,t[8]||1);}else {if(6!==arguments.length&&9!==arguments.length)throw "transform expected to take 1 or 9 arguments. Got "+arguments.length;t=arguments,this._transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6]||0,t[7]||0,t[8]||1);}return this},t.Path.prototype.trim=function(t,e,n){return this._trim(t,e,!!n)?this:null},t.Image.prototype.makeShaderCubic=function(t,e,n,r,i){return i=f(i),this._makeShaderCubic(t,e,n,r,i)},t.Image.prototype.makeShaderOptions=function(t,e,n,r,i){return i=f(i),this._makeShaderOptions(t,e,n,r,i)},t.Image.prototype.readPixels=function(t,n,r,i,a){return e(this,t,n,r,i,a)},t.Canvas.prototype.clear=function(e){t.Od(this.Md),e=p(e),this._clear(e);},t.Canvas.prototype.clipRRect=function(e,n,r){t.Od(this.Md),e=v(e),this._clipRRect(e,n,r);},t.Canvas.prototype.clipRect=function(e,n,r){t.Od(this.Md),e=y(e),this._clipRect(e,n,r);},t.Canvas.prototype.concat=function(e){t.Od(this.Md),e=function(t){if(!t)return Y;var e=A.toTypedArray();if(t.length){if(16!==t.length&&6!==t.length&&9!==t.length)throw "invalid matrix size";return 16===t.length?c(t,"HEAPF32",L):(e.fill(0),e[0]=t[0],e[1]=t[1],e[3]=t[2],e[4]=t[3],e[5]=t[4],e[7]=t[5],e[12]=t[6],e[13]=t[7],e[15]=t[8],6===t.length&&(e[12]=0,e[13]=0,e[15]=1),L)}return e[0]=t.m11,e[1]=t.m21,e[2]=t.m31,e[3]=t.m41,e[4]=t.m12,e[5]=t.m22,e[6]=t.m32,e[7]=t.m42,e[8]=t.m13,e[9]=t.m23,e[10]=t.m33,e[11]=t.m43,e[12]=t.m14,e[13]=t.m24,e[14]=t.m34,e[15]=t.m44,L}(e),this._concat(e);},t.Canvas.prototype.drawArc=function(e,n,r,i,a){t.Od(this.Md),e=y(e),this._drawArc(e,n,r,i,a);},t.Canvas.prototype.drawAtlas=function(e,n,r,i,a,s,l){if(e&&i&&n&&r&&n.length===r.length){t.Od(this.Md),a||(a=t.BlendMode.SrcOver);var h=c(n,"HEAPF32"),f=c(r,"HEAPF32"),d=r.length/4,p=c(o(s),"HEAPU32");if(l&&"B"in l&&"C"in l)this._drawAtlasCubic(e,f,h,p,d,a,l.B,l.C,i);else {let n=t.FilterMode.Linear,r=t.MipmapMode.None;l&&(n=l.filter,"mipmap"in l&&(r=l.mipmap)),this._drawAtlasOptions(e,f,h,p,d,a,n,r,i);}u(h,n),u(f,r),u(p,s);}},t.Canvas.prototype.drawCircle=function(e,n,r,i){t.Od(this.Md),this._drawCircle(e,n,r,i);},t.Canvas.prototype.drawColor=function(e,n){t.Od(this.Md),e=p(e),void 0!==n?this._drawColor(e,n):this._drawColor(e);},t.Canvas.prototype.drawColorInt=function(e,n){t.Od(this.Md),this._drawColorInt(e,n||t.BlendMode.SrcOver);},t.Canvas.prototype.drawColorComponents=function(e,n,r,i,a){t.Od(this.Md),e=g(e,n,r,i),void 0!==a?this._drawColor(e,a):this._drawColor(e);},t.Canvas.prototype.drawDRRect=function(e,n,r){t.Od(this.Md),e=v(e,z),n=v(n,H),this._drawDRRect(e,n,r);},t.Canvas.prototype.drawGlyphs=function(e,n,r,i,a,o){if(!(2*e.length<=n.length))throw "Not enough positions for the array of gyphs";t.Od(this.Md);const s=c(e,"HEAPU16"),l=c(n,"HEAPF32");this._drawGlyphs(e.length,s,l,r,i,a,o),u(l,n),u(s,e);},t.Canvas.prototype.drawImage=function(e,n,r,i){t.Od(this.Md),this._drawImage(e,n,r,i||null);},t.Canvas.prototype.drawImageCubic=function(e,n,r,i,a,o){t.Od(this.Md),this._drawImageCubic(e,n,r,i,a,o||null);},t.Canvas.prototype.drawImageOptions=function(e,n,r,i,a,o){t.Od(this.Md),this._drawImageOptions(e,n,r,i,a,o||null);},t.Canvas.prototype.drawImageNine=function(e,n,r,i,a){t.Od(this.Md),n=c(n,"HEAP32",j),r=y(r),this._drawImageNine(e,n,r,i,a||null);},t.Canvas.prototype.drawImageRect=function(e,n,r,i,a){t.Od(this.Md),y(n,G),y(r,U),this._drawImageRect(e,G,U,i,!!a);},t.Canvas.prototype.drawImageRectCubic=function(e,n,r,i,a,o){t.Od(this.Md),y(n,G),y(r,U),this._drawImageRectCubic(e,G,U,i,a,o||null);},t.Canvas.prototype.drawImageRectOptions=function(e,n,r,i,a,o){t.Od(this.Md),y(n,G),y(r,U),this._drawImageRectOptions(e,G,U,i,a,o||null);},t.Canvas.prototype.drawLine=function(e,n,r,i,a){t.Od(this.Md),this._drawLine(e,n,r,i,a);},t.Canvas.prototype.drawOval=function(e,n){t.Od(this.Md),e=y(e),this._drawOval(e,n);},t.Canvas.prototype.drawPaint=function(e){t.Od(this.Md),this._drawPaint(e);},t.Canvas.prototype.drawParagraph=function(e,n,r){t.Od(this.Md),this._drawParagraph(e,n,r);},t.Canvas.prototype.drawPatch=function(e,n,r,i,a){if(24>e.length)throw "Need 12 cubic points";if(n&&4>n.length)throw "Need 4 colors";if(r&&8>r.length)throw "Need 4 shader coordinates";t.Od(this.Md);const s=c(e,"HEAPF32"),l=n?c(o(n),"HEAPU32"):Y,h=r?c(r,"HEAPF32"):Y;i||(i=t.BlendMode.Modulate),this._drawPatch(s,l,h,i,a),u(h,r),u(l,n),u(s,e);},t.Canvas.prototype.drawPath=function(e,n){t.Od(this.Md),this._drawPath(e,n);},t.Canvas.prototype.drawPicture=function(e){t.Od(this.Md),this._drawPicture(e);},t.Canvas.prototype.drawPoints=function(e,n,r){t.Od(this.Md);var i=c(n,"HEAPF32");this._drawPoints(e,i,n.length/2,r),u(i,n);},t.Canvas.prototype.drawRRect=function(e,n){t.Od(this.Md),e=v(e),this._drawRRect(e,n);},t.Canvas.prototype.drawRect=function(e,n){t.Od(this.Md),e=y(e),this._drawRect(e,n);},t.Canvas.prototype.drawRect4f=function(e,n,r,i,a){t.Od(this.Md),this._drawRect4f(e,n,r,i,a);},t.Canvas.prototype.drawShadow=function(e,n,r,i,a,o,s){t.Od(this.Md);var l=c(a,"HEAPF32"),h=c(o,"HEAPF32");n=c(n,"HEAPF32",W),r=c(r,"HEAPF32",N),this._drawShadow(e,n,r,i,l,h,s),u(l,a),u(h,o);},t.getShadowLocalBounds=function(t,e,n,r,i,a,o){return t=f(t),n=c(n,"HEAPF32",W),r=c(r,"HEAPF32",N),this._getShadowLocalBounds(t,e,n,r,i,a,G)?(e=_.toTypedArray(),o?(o.set(e),o):e.slice()):null},t.Canvas.prototype.drawTextBlob=function(e,n,r,i){t.Od(this.Md),this._drawTextBlob(e,n,r,i);},t.Canvas.prototype.drawVertices=function(e,n,r){t.Od(this.Md),this._drawVertices(e,n,r);},t.Canvas.prototype.getLocalToDevice=function(){return this._getLocalToDevice(L),d(L)},t.Canvas.prototype.findMarkedCTM=function(t){return this._findMarkedCTM(t,L)?d(L):null},t.Canvas.prototype.getTotalMatrix=function(){this._getTotalMatrix(B);for(var e=Array(9),n=0;9>n;n++)e[n]=t.HEAPF32[B/4+n];return e},t.Canvas.prototype.makeSurface=function(t){return (t=this._makeSurface(t)).Md=this.Md,t},t.Canvas.prototype.readPixels=function(n,r,i,a,o){return t.Od(this.Md),e(this,n,r,i,a,o)},t.Canvas.prototype.saveLayer=function(t,e,n,r){return e=y(e),this._saveLayer(t||null,e,n||null,r||0)},t.Canvas.prototype.writePixels=function(e,n,r,i,a,o,s,l){if(e.byteLength%(n*r))throw "pixels length must be a multiple of the srcWidth * srcHeight";t.Od(this.Md);var h=e.byteLength/(n*r);o=o||t.AlphaType.Unpremul,s=s||t.ColorType.RGBA_8888,l=l||t.ColorSpace.SRGB;var f=h*n;return h=c(e,"HEAPU8"),n=this._writePixels({width:n,height:r,colorType:s,alphaType:o,colorSpace:l},h,f,i,a),u(h,e),n},t.ColorFilter.MakeBlend=function(e,n){return e=p(e),t.ColorFilter._MakeBlend(e,n)},t.ColorFilter.MakeMatrix=function(e){if(!e||20!==e.length)throw "invalid color matrix";var n=c(e,"HEAPF32"),r=t.ColorFilter._makeMatrix(n);return u(n,e),r},t.ContourMeasure.prototype.getPosTan=function(t,e){return this._getPosTan(t,G),t=_.toTypedArray(),e?(e.set(t),e):t.slice()},t.ImageFilter.MakeMatrixTransform=function(e,n,r){if(e=f(e),"B"in n&&"C"in n)return t.ImageFilter._MakeMatrixTransformCubic(e,n.xg,n.yg,r);const i=n.filter;let a=t.MipmapMode.None;return "mipmap"in n&&(a=n.mipmap),t.ImageFilter._MakeMatrixTransformOptions(e,i,a,r)},t.Paint.prototype.getColor=function(){return this._getColor(I),m(I)},t.Paint.prototype.setColor=function(t,e){e=e||null,t=p(t),this._setColor(t,e);},t.Paint.prototype.setColorComponents=function(t,e,n,r,i){i=i||null,t=g(t,e,n,r),this._setColor(t,i);},t.Path.prototype.getPoint=function(t,e){return this._getPoint(t,G),t=_.toTypedArray(),e?(e[0]=t[0],e[1]=t[1],e):t.slice(0,2)},t.PictureRecorder.prototype.beginRecording=function(t){return t=y(t),this._beginRecording(t)},t.Surface.prototype.getCanvas=function(){var t=this._getCanvas();return t.Md=this.Md,t},t.Surface.prototype.makeImageSnapshot=function(e){return t.Od(this.Md),e=c(e,"HEAP32",j),this._makeImageSnapshot(e)},t.Surface.prototype.makeSurface=function(e){return t.Od(this.Md),(e=this._makeSurface(e)).Md=this.Md,e},t.Surface.prototype.requestAnimationFrame=function(e,n){this.Ge||(this.Ge=this.getCanvas()),requestAnimationFrame(function(){t.Od(this.Md),e(this.Ge),this.flush(n);}.bind(this));},t.Surface.prototype.drawOnce=function(e,n){this.Ge||(this.Ge=this.getCanvas()),requestAnimationFrame(function(){t.Od(this.Md),e(this.Ge),this.flush(n),this.dispose();}.bind(this));},t.PathEffect.MakeDash=function(e,n){if(n||(n=0),!e.length||1==e.length%2)throw "Intervals array must have even length";var r=c(e,"HEAPF32");return n=t.PathEffect._MakeDash(r,e.length,n),u(r,e),n},t.Shader.MakeColor=function(e,n){return n=n||null,e=p(e),t.Shader._MakeColor(e,n)},t.Shader.Blend=t.Shader.MakeBlend,t.Shader.Color=t.Shader.MakeColor,t.Shader.MakeLinearGradient=function(e,n,r,i,a,o,s,l){l=l||null;var d=h(r),p=c(i,"HEAPF32");s=s||0,o=f(o);var g=_.toTypedArray();return g.set(e),g.set(n,2),e=t.Shader._MakeLinearGradient(G,d.ce,d.Ke,p,d.count,a,s,o,l),u(d.ce,r),i&&u(p,i),e},t.Shader.MakeRadialGradient=function(e,n,r,i,a,o,s,l){l=l||null;var d=h(r),p=c(i,"HEAPF32");return s=s||0,o=f(o),e=t.Shader._MakeRadialGradient(e[0],e[1],n,d.ce,d.Ke,p,d.count,a,s,o,l),u(d.ce,r),i&&u(p,i),e},t.Shader.MakeSweepGradient=function(e,n,r,i,a,o,s,l,d,p){p=p||null;var g=h(r),m=c(i,"HEAPF32");return s=s||0,l=l||0,d=d||360,o=f(o),e=t.Shader._MakeSweepGradient(e,n,g.ce,g.Ke,m,g.count,a,l,d,s,o,p),u(g.ce,r),i&&u(m,i),e},t.Shader.MakeTwoPointConicalGradient=function(e,n,r,i,a,o,s,l,d,p){p=p||null;var g=h(a),m=c(o,"HEAPF32");d=d||0,l=f(l);var y=_.toTypedArray();return y.set(e),y.set(r,2),e=t.Shader._MakeTwoPointConicalGradient(G,n,i,g.ce,g.Ke,m,g.count,s,d,l,p),u(g.ce,a),o&&u(m,o),e},t.Vertices.prototype.bounds=function(t){this._bounds(G);var e=_.toTypedArray();return t?(t.set(e),t):e.slice()},t.Vd&&t.Vd.forEach((function(t){t();}));},t.computeTonalColors=function(t){var e=c(t.ambient,"HEAPF32"),n=c(t.spot,"HEAPF32");this._computeTonalColors(e,n);var r={ambient:m(e),spot:m(n)};return u(e,t.ambient),u(n,t.spot),r},t.LTRBRect=function(t,e,n,r){return Float32Array.of(t,e,n,r)},t.XYWHRect=function(t,e,n,r){return Float32Array.of(t,e,t+n,e+r)},t.LTRBiRect=function(t,e,n,r){return Int32Array.of(t,e,n,r)},t.XYWHiRect=function(t,e,n,r){return Int32Array.of(t,e,t+n,e+r)},t.RRectXY=function(t,e,n){return Float32Array.of(t[0],t[1],t[2],t[3],e,n,e,n,e,n,e,n)},t.MakeAnimatedImageFromEncoded=function(e){e=new Uint8Array(e);var n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),(e=t._decodeAnimatedImage(n,e.byteLength))?e:null},t.MakeImageFromEncoded=function(e){e=new Uint8Array(e);var n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),(e=t._decodeImage(n,e.byteLength))?e:null};var q=null;t.MakeImageFromCanvasImageSource=function(e){var n=e.width,r=e.height;q||(q=document.createElement("canvas")),q.width=n,q.height=r;var i=q.getContext("2d");return i.drawImage(e,0,0),e=i.getImageData(0,0,n,r),t.MakeImage({width:n,height:r,alphaType:t.AlphaType.Unpremul,colorType:t.ColorType.RGBA_8888,colorSpace:t.ColorSpace.SRGB},e.data,4*n)},t.MakeImage=function(e,n,r){var i=t._malloc(n.length);return t.HEAPU8.set(n,i),t._MakeImage(e,i,n.length,r)},t.MakeVertices=function(e,n,r,i,a,s){var l=a&&a.length||0,u=0;return r&&r.length&&(u|=1),i&&i.length&&(u|=2),void 0===s||s||(u|=4),c(n,"HEAPF32",(e=new t._VerticesBuilder(e,n.length/2,l,u)).positions()),e.texCoords()&&c(r,"HEAPF32",e.texCoords()),e.colors()&&c(o(i),"HEAPU32",e.colors()),e.indices()&&c(a,"HEAPU16",e.indices()),e.detach()},t.Matrix={},t.Matrix.identity=function(){return r(3)},t.Matrix.invert=function(t){var e=t[0]*t[4]*t[8]+t[1]*t[5]*t[6]+t[2]*t[3]*t[7]-t[2]*t[4]*t[6]-t[1]*t[3]*t[8]-t[0]*t[5]*t[7];return e?[(t[4]*t[8]-t[5]*t[7])/e,(t[2]*t[7]-t[1]*t[8])/e,(t[1]*t[5]-t[2]*t[4])/e,(t[5]*t[6]-t[3]*t[8])/e,(t[0]*t[8]-t[2]*t[6])/e,(t[2]*t[3]-t[0]*t[5])/e,(t[3]*t[7]-t[4]*t[6])/e,(t[1]*t[6]-t[0]*t[7])/e,(t[0]*t[4]-t[1]*t[3])/e]:null},t.Matrix.mapPoints=function(t,e){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1],a=t[6]*r+t[7]*i+t[8],o=t[3]*r+t[4]*i+t[5];e[n]=(t[0]*r+t[1]*i+t[2])/a,e[n+1]=o/a;}return e},t.Matrix.multiply=function(){return S(3,arguments)},t.Matrix.rotated=function(t,e,n){e=e||0,n=n||0;var r=Math.sin(t);return [t=Math.cos(t),-r,w(r,n,1-t,e),r,t,w(-r,e,1-t,n),0,0,1]},t.Matrix.scaled=function(t,e,i,a){i=i||0,a=a||0;var o=n([t,e],r(3),3,0,1);return n([i-t*i,a-e*a],o,3,2,0)},t.Matrix.skewed=function(t,e,i,a){i=i||0,a=a||0;var o=n([t,e],r(3),3,1,-1);return n([-t*i,-e*a],o,3,2,0)},t.Matrix.translated=function(t,e){return n(arguments,r(3),3,2,0)},t.Vector={},t.Vector.dot=function(t,e){return t.map((function(t,n){return t*e[n]})).reduce((function(t,e){return t+e}))},t.Vector.lengthSquared=function(e){return t.Vector.dot(e,e)},t.Vector.length=function(e){return Math.sqrt(t.Vector.lengthSquared(e))},t.Vector.mulScalar=function(t,e){return t.map((function(t){return t*e}))},t.Vector.add=function(t,e){return t.map((function(t,n){return t+e[n]}))},t.Vector.sub=function(t,e){return t.map((function(t,n){return t-e[n]}))},t.Vector.dist=function(e,n){return t.Vector.length(t.Vector.sub(e,n))},t.Vector.normalize=function(e){return t.Vector.mulScalar(e,1/t.Vector.length(e))},t.Vector.cross=function(t,e){return [t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]},t.M44={},t.M44.identity=function(){return r(4)},t.M44.translated=function(t){return n(t,r(4),4,3,0)},t.M44.scaled=function(t){return n(t,r(4),4,0,1)},t.M44.rotated=function(e,n){return t.M44.rotatedUnitSinCos(t.Vector.normalize(e),Math.sin(n),Math.cos(n))},t.M44.rotatedUnitSinCos=function(t,e,n){var r=t[0],i=t[1],a=1-n;return [a*r*r+n,a*r*i-e*(t=t[2]),a*r*t+e*i,0,a*r*i+e*t,a*i*i+n,a*i*t-e*r,0,a*r*t-e*i,a*i*t+e*r,a*t*t+n,0,0,0,0,1]},t.M44.lookat=function(e,r,i){r=t.Vector.normalize(t.Vector.sub(r,e)),i=t.Vector.normalize(i),i=t.Vector.normalize(t.Vector.cross(r,i));var a=t.M44.identity();return n(i,a,4,0,0),n(t.Vector.cross(i,r),a,4,1,0),n(t.Vector.mulScalar(r,-1),a,4,2,0),n(e,a,4,3,0),null===(e=t.M44.invert(a))?t.M44.identity():e},t.M44.perspective=function(t,e,n){var r=1/(e-t);return n/=2,[n=Math.cos(n)/Math.sin(n),0,0,0,0,n,0,0,0,0,(e+t)*r,2*e*t*r,0,0,-1,1]},t.M44.rc=function(t,e,n){return t[4*e+n]},t.M44.multiply=function(){return S(4,arguments)},t.M44.invert=function(t){var e=t[0],n=t[4],r=t[8],i=t[12],a=t[1],o=t[5],s=t[9],l=t[13],u=t[2],c=t[6],h=t[10],f=t[14],d=t[3],p=t[7],g=t[11],m=e*o-n*a,y=e*s-r*a,v=e*l-i*a,w=n*s-r*o,b=n*l-i*o,S=r*l-i*s,T=u*p-c*d,A=u*g-h*d,C=u*(t=t[15])-f*d,_=c*g-h*p,P=c*t-f*p,M=h*t-f*g,F=m*M-y*P+v*_+w*C-b*A+S*T,k=1/F;return 0===F||1/0===k?null:(e=[o*(M*=k)-s*(P*=k)+l*(_*=k),s*(C*=k)-a*M-l*(A*=k),a*P-o*C+l*(T*=k),o*A-a*_-s*T,r*P-n*M-i*_,e*M-r*C+i*A,n*C-e*P-i*T,e*_-n*A+r*T,p*(S*=k)-g*(b*=k)+t*(w*=k),g*(v*=k)-d*S-t*(y*=k),d*b-p*v+t*(m*=k),p*y-d*w-g*m,h*b-c*S-f*w,u*S-h*v+f*y,c*v-u*b-f*m,u*w-c*y+h*m]).every((function(t){return !isNaN(t)&&1/0!==t&&-1/0!==t}))?e:null},t.M44.transpose=function(t){return [t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]]},t.M44.mustInvert=function(e){if(null===(e=t.M44.invert(e)))throw "Matrix not invertible";return e},t.M44.setupCamera=function(e,n,r){var i=t.M44.lookat(r.eye,r.coa,r.up);return r=t.M44.perspective(r.near,r.far,r.angle),n=[(e[2]-e[0])/2,(e[3]-e[1])/2,n],e=t.M44.multiply(t.M44.translated([(e[0]+e[2])/2,(e[1]+e[3])/2,0]),t.M44.scaled(n)),t.M44.multiply(e,r,i,t.M44.mustInvert(e))},t.ColorMatrix={},t.ColorMatrix.identity=function(){var t=new Float32Array(20);return t[0]=1,t[6]=1,t[12]=1,t[18]=1,t},t.ColorMatrix.scaled=function(t,e,n,r){var i=new Float32Array(20);return i[0]=t,i[6]=e,i[12]=n,i[18]=r,i};var $,X=[[6,7,11,12],[0,10,2,12],[0,1,5,6]];t.ColorMatrix.rotated=function(e,n,r){var i=t.ColorMatrix.identity();return i[(e=X[e])[0]]=r,i[e[1]]=n,i[e[2]]=-n,i[e[3]]=r,i},t.ColorMatrix.postTranslate=function(t,e,n,r,i){return t[4]+=e,t[9]+=n,t[14]+=r,t[19]+=i,t},t.ColorMatrix.concat=function(t,e){for(var n=new Float32Array(20),r=0,i=0;20>i;i+=5){for(var a=0;4>a;a++)n[r++]=t[i]*e[a]+t[i+1]*e[a+5]+t[i+2]*e[a+10]+t[i+3]*e[a+15];n[r++]=t[i]*e[4]+t[i+1]*e[9]+t[i+2]*e[14]+t[i+3]*e[19]+t[i+4];}return n},($=e).Vd=$.Vd||[],$.Vd.push((function(){function t(t){if(!t||!t.length)return [];for(var e=[],n=0;n<t.length;n+=5){var r=$.LTRBRect(t[n],t[n+1],t[n+2],t[n+3]);r.direction=0===t[n+4]?$.TextDirection.RTL:$.TextDirection.LTR,e.push(r);}return $._free(t.byteOffset),e}function e(t){return void 0===(t=t||{}).weight&&(t.weight=$.FontWeight.Normal),t.width=t.width||$.FontWidth.Normal,t.slant=t.slant||$.FontSlant.Upright,t}function n(t){if(!t||!t.length)return Y;for(var e=[],n=0;n<t.length;n++){var i=r(t[n]);e.push(i);}return c(e,"HEAPU32")}function r(t){if(o[t])return o[t];var e=O(t)+1,n=$._malloc(e);return E(t,D,n,e),o[t]=n}function i(t){if(t._colorPtr=p(t.color),t._foregroundColorPtr=Y,t._backgroundColorPtr=Y,t._decorationColorPtr=Y,t.foregroundColor&&(t._foregroundColorPtr=p(t.foregroundColor,s)),t.backgroundColor&&(t._backgroundColorPtr=p(t.backgroundColor,l)),t.decorationColor&&(t._decorationColorPtr=p(t.decorationColor,u)),Array.isArray(t.fontFamilies)&&t.fontFamilies.length?(t._fontFamiliesPtr=n(t.fontFamilies),t._fontFamiliesLen=t.fontFamilies.length):(t._fontFamiliesPtr=Y,t._fontFamiliesLen=0),t.locale){var e=t.locale;t._localePtr=r(e),t._localeLen=O(e)+1;}else t._localePtr=Y,t._localeLen=0;if(Array.isArray(t.shadows)&&t.shadows.length){var i=(e=t.shadows).map((function(t){return t.color||$.BLACK})),a=e.map((function(t){return t.blurRadius||0}));t._shadowLen=e.length;for(var o=$._malloc(8*e.length),f=o/4,d=0;d<e.length;d++){var g=e[d].offset||[0,0];$.HEAPF32[f]=g[0],$.HEAPF32[f+1]=g[1],f+=2;}t._shadowColorsPtr=h(i).ce,t._shadowOffsetsPtr=o,t._shadowBlurRadiiPtr=c(a,"HEAPF32");}else t._shadowLen=0,t._shadowColorsPtr=Y,t._shadowOffsetsPtr=Y,t._shadowBlurRadiiPtr=Y;Array.isArray(t.fontFeatures)&&t.fontFeatures.length?(i=(e=t.fontFeatures).map((function(t){return t.name})),a=e.map((function(t){return t.value})),t._fontFeatureLen=e.length,t._fontFeatureNamesPtr=n(i),t._fontFeatureValuesPtr=c(a,"HEAPU32")):(t._fontFeatureLen=0,t._fontFeatureNamesPtr=Y,t._fontFeatureValuesPtr=Y);}function a(t){$._free(t._fontFamiliesPtr),$._free(t._shadowColorsPtr),$._free(t._shadowOffsetsPtr),$._free(t._shadowBlurRadiiPtr),$._free(t._fontFeatureNamesPtr),$._free(t._fontFeatureValuesPtr);}$.Paragraph.prototype.getRectsForRange=function(e,n,r,i){return t(e=this._getRectsForRange(e,n,r,i))},$.Paragraph.prototype.getRectsForPlaceholders=function(){return t(this._getRectsForPlaceholders())},$.TypefaceFontProvider.prototype.registerFont=function(t,e){if(!(t=$.Typeface.MakeFreeTypeFaceFromData(t)))return null;e=r(e),this._registerFont(t,e);},$.ParagraphStyle=function(t){if(t.disableHinting=t.disableHinting||!1,t.ellipsis){var i=t.ellipsis;t._ellipsisPtr=r(i),t._ellipsisLen=O(i)+1;}else t._ellipsisPtr=Y,t._ellipsisLen=0;return t.heightMultiplier=t.heightMultiplier||0,t.maxLines=t.maxLines||0,(i=(i=t.strutStyle)||{}).strutEnabled=i.strutEnabled||!1,i.strutEnabled&&Array.isArray(i.fontFamilies)&&i.fontFamilies.length?(i._fontFamiliesPtr=n(i.fontFamilies),i._fontFamiliesLen=i.fontFamilies.length):(i._fontFamiliesPtr=Y,i._fontFamiliesLen=0),i.fontStyle=e(i.fontStyle),i.fontSize=i.fontSize||0,i.heightMultiplier=i.heightMultiplier||0,i.halfLeading=i.halfLeading||!1,i.leading=i.leading||0,i.forceStrutHeight=i.forceStrutHeight||!1,t.strutStyle=i,t.textAlign=t.textAlign||$.TextAlign.Start,t.textDirection=t.textDirection||$.TextDirection.LTR,t.textHeightBehavior=t.textHeightBehavior||$.TextHeightBehavior.All,t.textStyle=$.TextStyle(t.textStyle),t},$.TextStyle=function(t){return t.color||(t.color=$.BLACK),t.decoration=t.decoration||0,t.decorationThickness=t.decorationThickness||0,t.decorationStyle=t.decorationStyle||$.DecorationStyle.Solid,t.textBaseline=t.textBaseline||$.TextBaseline.Alphabetic,t.fontSize=t.fontSize||0,t.letterSpacing=t.letterSpacing||0,t.wordSpacing=t.wordSpacing||0,t.heightMultiplier=t.heightMultiplier||0,t.halfLeading=t.halfLeading||!1,t.fontStyle=e(t.fontStyle),t};var o={},s=$._malloc(16),l=$._malloc(16),u=$._malloc(16);$.ParagraphBuilder.Make=function(t,e){return i(t.textStyle),e=$.ParagraphBuilder._Make(t,e),a(t.textStyle),e},$.ParagraphBuilder.MakeFromFontProvider=function(t,e){return i(t.textStyle),e=$.ParagraphBuilder._MakeFromFontProvider(t,e),a(t.textStyle),e},$.ParagraphBuilder.ShapeText=function(t,e,n){let r=0;for(const t of e)r+=t.length;if(r!==t.length)throw "Accumulated block lengths must equal text.length";return $.ParagraphBuilder._ShapeText(t,e,n)},$.ParagraphBuilder.prototype.pushStyle=function(t){i(t),this._pushStyle(t),a(t);},$.ParagraphBuilder.prototype.pushPaintStyle=function(t,e,n){i(t),this._pushPaintStyle(t,e,n),a(t);},$.ParagraphBuilder.prototype.addPlaceholder=function(t,e,n,r,i){n=n||$.PlaceholderAlignment.Baseline,r=r||$.TextBaseline.Alphabetic,this._addPlaceholder(t||0,e||0,n,r,i||0);};})),t.Vd=t.Vd||[],t.Vd.push((function(){t.Path.prototype.op=function(t,e){return this._op(t,e)?this:null},t.Path.prototype.simplify=function(){return this._simplify()?this:null};})),t.Vd=t.Vd||[],t.Vd.push((function(){t.Canvas.prototype.drawText=function(e,n,r,i,a){var o=O(e),s=t._malloc(o+1);E(e,D,s,o+1),this._drawSimpleText(s,o,n,r,a,i),t._free(s);},t.Font.prototype.getGlyphBounds=function(e,n,r){var i=c(e,"HEAPU16"),a=t._malloc(16*e.length);return this._getGlyphWidthBounds(i,e.length,Y,a,n||null),n=new Float32Array(t.HEAPU8.buffer,a,4*e.length),u(i,e),r?(r.set(n),t._free(a),r):(e=Float32Array.from(n),t._free(a),e)},t.Font.prototype.getGlyphIDs=function(e,n,r){n||(n=e.length);var i=O(e)+1,a=t._malloc(i);return E(e,D,a,i),e=t._malloc(2*n),n=this._getGlyphIDs(a,i-1,n,e),t._free(a),0>n?(t._free(e),null):(a=new Uint16Array(t.HEAPU8.buffer,e,n),r?(r.set(a),t._free(e),r):(r=Uint16Array.from(a),t._free(e),r))},t.Font.prototype.getGlyphIntercepts=function(t,e,n,r){var i=c(t,"HEAPU16"),a=c(e,"HEAPF32");return this._getGlyphIntercepts(i,t.length,!(t&&t._ck),a,e.length,!(e&&e._ck),n,r)},t.Font.prototype.getGlyphWidths=function(e,n,r){var i=c(e,"HEAPU16"),a=t._malloc(4*e.length);return this._getGlyphWidthBounds(i,e.length,a,Y,n||null),n=new Float32Array(t.HEAPU8.buffer,a,e.length),u(i,e),r?(r.set(n),t._free(a),r):(e=Float32Array.from(n),t._free(a),e)},t.FontMgr.FromData=function(){if(!arguments.length)return null;var e=arguments;if(1===e.length&&Array.isArray(e[0])&&(e=arguments[0]),!e.length)return null;for(var n=[],r=[],i=0;i<e.length;i++){var a=new Uint8Array(e[i]),o=c(a,"HEAPU8");n.push(o),r.push(a.byteLength);}return n=c(n,"HEAPU32"),r=c(r,"HEAPU32"),e=t.FontMgr._fromData(n,r,e.length),t._free(n),t._free(r),e},t.Typeface.MakeFreeTypeFaceFromData=function(e){var n=c(e=new Uint8Array(e),"HEAPU8");return (e=t.Typeface._MakeFreeTypeFaceFromData(n,e.byteLength))?e:null},t.Typeface.prototype.getGlyphIDs=function(e,n,r){n||(n=e.length);var i=O(e)+1,a=t._malloc(i);return E(e,D,a,i),e=t._malloc(2*n),n=this._getGlyphIDs(a,i-1,n,e),t._free(a),0>n?(t._free(e),null):(a=new Uint16Array(t.HEAPU8.buffer,e,n),r?(r.set(a),t._free(e),r):(r=Uint16Array.from(a),t._free(e),r))},t.TextBlob.MakeOnPath=function(e,n,r,i){if(e&&e.length&&n&&n.countPoints()){if(1===n.countPoints())return this.MakeFromText(e,r);i||(i=0);var a=r.getGlyphIDs(e);a=r.getGlyphWidths(a);for(var o=[],s=(n=new t.ContourMeasureIter(n,!1,1)).next(),l=new Float32Array(4),u=0;u<e.length&&s;u++){var c=a[u];if((i+=c/2)>s.length()){if(s.delete(),!(s=n.next())){e=e.substring(0,u);break}i=c/2;}s.getPosTan(i,l);var h=l[2],f=l[3];o.push(h,f,l[0]-c/2*h,l[1]-c/2*f),i+=c/2;}return e=this.MakeFromRSXform(e,o,r),s&&s.delete(),n.delete(),e}},t.TextBlob.MakeFromRSXform=function(e,n,r){var i=O(e)+1,a=t._malloc(i);return E(e,D,a,i),e=c(n,"HEAPF32"),r=t.TextBlob._MakeFromRSXform(a,i-1,e,r),t._free(a),r||null},t.TextBlob.MakeFromRSXformGlyphs=function(e,n,r){var i=c(e,"HEAPU16");return n=c(n,"HEAPF32"),r=t.TextBlob._MakeFromRSXformGlyphs(i,2*e.length,n,r),u(i,e),r||null},t.TextBlob.MakeFromGlyphs=function(e,n){var r=c(e,"HEAPU16");return n=t.TextBlob._MakeFromGlyphs(r,2*e.length,n),u(r,e),n||null},t.TextBlob.MakeFromText=function(e,n){var r=O(e)+1,i=t._malloc(r);return E(e,D,i,r),e=t.TextBlob._MakeFromText(i,r-1,n),t._free(i),e||null},t.MallocGlyphIDs=function(e){return t.Malloc(Uint16Array,e)};})),t.Vd=t.Vd||[],t.Vd.push((function(){t.MakePicture=function(e){e=new Uint8Array(e);var n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),(e=t._MakePicture(n,e.byteLength))?e:null};})),function(){function e(t){for(var e=0;e<t.length;e++)if(void 0!==t[e]&&!Number.isFinite(t[e]))return !1;return !0}function n(e){var n=t.getColorComponents(e);e=n[0];var r=n[1],i=n[2];return 1===(n=n[3])?(e=e.toString(16).toLowerCase(),r=r.toString(16).toLowerCase(),i=i.toString(16).toLowerCase(),"#"+(e=1===e.length?"0"+e:e)+(r=1===r.length?"0"+r:r)+(i=1===i.length?"0"+i:i)):"rgba("+e+", "+r+", "+i+", "+(n=0===n||1===n?n:n.toFixed(8))+")"}function r(e){return t.parseColorString(e,v)}function a(t){if(!(t=w.exec(t)))return null;var e=parseFloat(t[4]),n=16;switch(t[5]){case"em":case"rem":case"pc":n=16*e;break;case"pt":n=4*e/3;break;case"px":n=e;break;case"in":n=96*e;break;case"cm":n=96*e/2.54;break;case"mm":n=96/25.4*e;break;case"q":n=96/25.4/4*e;break;case"%":n=16/75*e;}return {style:t[1],variant:t[2],weight:t[3],sizePx:n,family:t[6].trim()}}function o(o){this.Nd=o,this.Qd=new t.Paint,this.Qd.setAntiAlias(!0),this.Qd.setStrokeMiter(10),this.Qd.setStrokeCap(t.StrokeCap.Butt),this.Qd.setStrokeJoin(t.StrokeJoin.Miter),this.Pe="10px monospace",this.re=new t.Font(null,10),this.re.setSubpixel(!0),this.be=this.he=t.BLACK,this.ue=0,this.Ie=t.TRANSPARENT,this.we=this.ve=0,this.Je=this.je=1,this.He=0,this.te=[],this.Pd=t.BlendMode.SrcOver,this.Qd.setStrokeWidth(this.Je),this.Qd.setBlendMode(this.Pd),this.Td=new t.Path,this.Ud=t.Matrix.identity(),this.kf=[],this.Ae=[],this.me=function(){this.Td.delete(),this.Qd.delete(),this.re.delete(),this.Ae.forEach((function(t){t.me();}));},Object.defineProperty(this,"currentTransform",{enumerable:!0,get:function(){return {a:this.Ud[0],c:this.Ud[1],e:this.Ud[2],b:this.Ud[3],d:this.Ud[4],f:this.Ud[5]}},set:function(t){t.a&&this.setTransform(t.a,t.b,t.c,t.d,t.e,t.f);}}),Object.defineProperty(this,"fillStyle",{enumerable:!0,get:function(){return i(this.be)?n(this.be):this.be},set:function(t){"string"==typeof t?this.be=r(t):t.se&&(this.be=t);}}),Object.defineProperty(this,"font",{enumerable:!0,get:function(){return this.Pe},set:function(t){var e=a(t),n=e.family;e.typeface=b[n]?b[n][(e.style||"normal")+"|"+(e.variant||"normal")+"|"+(e.weight||"normal")]||b[n]["*"]:null,e&&(this.re.setSize(e.sizePx),this.re.setTypeface(e.typeface),this.Pe=t);}}),Object.defineProperty(this,"globalAlpha",{enumerable:!0,get:function(){return this.je},set:function(t){!isFinite(t)||0>t||1<t||(this.je=t);}}),Object.defineProperty(this,"globalCompositeOperation",{enumerable:!0,get:function(){switch(this.Pd){case t.BlendMode.SrcOver:return "source-over";case t.BlendMode.DstOver:return "destination-over";case t.BlendMode.Src:return "copy";case t.BlendMode.Dst:return "destination";case t.BlendMode.Clear:return "clear";case t.BlendMode.SrcIn:return "source-in";case t.BlendMode.DstIn:return "destination-in";case t.BlendMode.SrcOut:return "source-out";case t.BlendMode.DstOut:return "destination-out";case t.BlendMode.SrcATop:return "source-atop";case t.BlendMode.DstATop:return "destination-atop";case t.BlendMode.Xor:return "xor";case t.BlendMode.Plus:return "lighter";case t.BlendMode.Multiply:return "multiply";case t.BlendMode.Screen:return "screen";case t.BlendMode.Overlay:return "overlay";case t.BlendMode.Darken:return "darken";case t.BlendMode.Lighten:return "lighten";case t.BlendMode.ColorDodge:return "color-dodge";case t.BlendMode.ColorBurn:return "color-burn";case t.BlendMode.HardLight:return "hard-light";case t.BlendMode.SoftLight:return "soft-light";case t.BlendMode.Difference:return "difference";case t.BlendMode.Exclusion:return "exclusion";case t.BlendMode.Hue:return "hue";case t.BlendMode.Saturation:return "saturation";case t.BlendMode.Color:return "color";case t.BlendMode.Luminosity:return "luminosity"}},set:function(e){switch(e){case"source-over":this.Pd=t.BlendMode.SrcOver;break;case"destination-over":this.Pd=t.BlendMode.DstOver;break;case"copy":this.Pd=t.BlendMode.Src;break;case"destination":this.Pd=t.BlendMode.Dst;break;case"clear":this.Pd=t.BlendMode.Clear;break;case"source-in":this.Pd=t.BlendMode.SrcIn;break;case"destination-in":this.Pd=t.BlendMode.DstIn;break;case"source-out":this.Pd=t.BlendMode.SrcOut;break;case"destination-out":this.Pd=t.BlendMode.DstOut;break;case"source-atop":this.Pd=t.BlendMode.SrcATop;break;case"destination-atop":this.Pd=t.BlendMode.DstATop;break;case"xor":this.Pd=t.BlendMode.Xor;break;case"lighter":case"plus-lighter":this.Pd=t.BlendMode.Plus;break;case"plus-darker":throw "plus-darker is not supported";case"multiply":this.Pd=t.BlendMode.Multiply;break;case"screen":this.Pd=t.BlendMode.Screen;break;case"overlay":this.Pd=t.BlendMode.Overlay;break;case"darken":this.Pd=t.BlendMode.Darken;break;case"lighten":this.Pd=t.BlendMode.Lighten;break;case"color-dodge":this.Pd=t.BlendMode.ColorDodge;break;case"color-burn":this.Pd=t.BlendMode.ColorBurn;break;case"hard-light":this.Pd=t.BlendMode.HardLight;break;case"soft-light":this.Pd=t.BlendMode.SoftLight;break;case"difference":this.Pd=t.BlendMode.Difference;break;case"exclusion":this.Pd=t.BlendMode.Exclusion;break;case"hue":this.Pd=t.BlendMode.Hue;break;case"saturation":this.Pd=t.BlendMode.Saturation;break;case"color":this.Pd=t.BlendMode.Color;break;case"luminosity":this.Pd=t.BlendMode.Luminosity;break;default:return}this.Qd.setBlendMode(this.Pd);}}),Object.defineProperty(this,"imageSmoothingEnabled",{enumerable:!0,get:function(){return !0},set:function(){}}),Object.defineProperty(this,"imageSmoothingQuality",{enumerable:!0,get:function(){return "high"},set:function(){}}),Object.defineProperty(this,"lineCap",{enumerable:!0,get:function(){switch(this.Qd.getStrokeCap()){case t.StrokeCap.Butt:return "butt";case t.StrokeCap.Round:return "round";case t.StrokeCap.Square:return "square"}},set:function(e){switch(e){case"butt":this.Qd.setStrokeCap(t.StrokeCap.Butt);break;case"round":this.Qd.setStrokeCap(t.StrokeCap.Round);break;case"square":this.Qd.setStrokeCap(t.StrokeCap.Square);}}}),Object.defineProperty(this,"lineDashOffset",{enumerable:!0,get:function(){return this.He},set:function(t){isFinite(t)&&(this.He=t);}}),Object.defineProperty(this,"lineJoin",{enumerable:!0,get:function(){switch(this.Qd.getStrokeJoin()){case t.StrokeJoin.Miter:return "miter";case t.StrokeJoin.Round:return "round";case t.StrokeJoin.Bevel:return "bevel"}},set:function(e){switch(e){case"miter":this.Qd.setStrokeJoin(t.StrokeJoin.Miter);break;case"round":this.Qd.setStrokeJoin(t.StrokeJoin.Round);break;case"bevel":this.Qd.setStrokeJoin(t.StrokeJoin.Bevel);}}}),Object.defineProperty(this,"lineWidth",{enumerable:!0,get:function(){return this.Qd.getStrokeWidth()},set:function(t){0>=t||!t||(this.Je=t,this.Qd.setStrokeWidth(t));}}),Object.defineProperty(this,"miterLimit",{enumerable:!0,get:function(){return this.Qd.getStrokeMiter()},set:function(t){0>=t||!t||this.Qd.setStrokeMiter(t);}}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,get:function(){return this.ue},set:function(t){0>t||!isFinite(t)||(this.ue=t);}}),Object.defineProperty(this,"shadowColor",{enumerable:!0,get:function(){return n(this.Ie)},set:function(t){this.Ie=r(t);}}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,get:function(){return this.ve},set:function(t){isFinite(t)&&(this.ve=t);}}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,get:function(){return this.we},set:function(t){isFinite(t)&&(this.we=t);}}),Object.defineProperty(this,"strokeStyle",{enumerable:!0,get:function(){return n(this.he)},set:function(t){"string"==typeof t?this.he=r(t):t.se&&(this.he=t);}}),this.arc=function(t,e,n,r,i,a){d(this.Td,t,e,n,n,0,r,i,a);},this.arcTo=function(t,e,n,r,i){c(this.Td,t,e,n,r,i);},this.beginPath=function(){this.Td.delete(),this.Td=new t.Path;},this.bezierCurveTo=function(t,n,r,i,a,o){var s=this.Td;e([t,n,r,i,a,o])&&(s.isEmpty()&&s.moveTo(t,n),s.cubicTo(t,n,r,i,a,o));},this.clearRect=function(e,n,r,i){this.Qd.setStyle(t.PaintStyle.Fill),this.Qd.setBlendMode(t.BlendMode.Clear),this.Nd.drawRect(t.XYWHRect(e,n,r,i),this.Qd),this.Qd.setBlendMode(this.Pd);},this.clip=function(e,n){"string"==typeof e?(n=e,e=this.Td):e&&e.$e&&(e=e.Wd),e||(e=this.Td),e=e.copy(),n&&"evenodd"===n.toLowerCase()?e.setFillType(t.FillType.EvenOdd):e.setFillType(t.FillType.Winding),this.Nd.clipPath(e,t.ClipOp.Intersect,!0),e.delete();},this.closePath=function(){h(this.Td);},this.createImageData=function(){if(1===arguments.length){var t=arguments[0];return new l(new Uint8ClampedArray(4*t.width*t.height),t.width,t.height)}if(2===arguments.length){t=arguments[0];var e=arguments[1];return new l(new Uint8ClampedArray(4*t*e),t,e)}throw "createImageData expects 1 or 2 arguments, got "+arguments.length},this.createLinearGradient=function(t,n,r,i){if(e(arguments)){var a=new u(t,n,r,i);return this.Ae.push(a),a}},this.createPattern=function(t,e){return t=new m(t,e),this.Ae.push(t),t},this.createRadialGradient=function(t,n,r,i,a,o){if(e(arguments)){var s=new y(t,n,r,i,a,o);return this.Ae.push(s),s}},this.drawImage=function(e){var n=this.Oe();if(3===arguments.length||5===arguments.length)var r=t.XYWHRect(arguments[1],arguments[2],arguments[3]||e.width(),arguments[4]||e.height()),i=t.XYWHRect(0,0,e.width(),e.height());else {if(9!==arguments.length)throw "invalid number of args for drawImage, need 3, 5, or 9; got "+arguments.length;r=t.XYWHRect(arguments[5],arguments[6],arguments[7],arguments[8]),i=t.XYWHRect(arguments[1],arguments[2],arguments[3],arguments[4]);}this.Nd.drawImageRect(e,i,r,n,!1),n.dispose();},this.ellipse=function(t,e,n,r,i,a,o,s){d(this.Td,t,e,n,r,i,a,o,s);},this.Oe=function(){var e=this.Qd.copy();if(e.setStyle(t.PaintStyle.Fill),i(this.be)){var n=t.multiplyByAlpha(this.be,this.je);e.setColor(n);}else n=this.be.se(this.Ud),e.setColor(t.Color(0,0,0,this.je)),e.setShader(n);return e.dispose=function(){this.delete();},e},this.fill=function(e,n){if("string"==typeof e?(n=e,e=this.Td):e&&e.$e&&(e=e.Wd),"evenodd"===n)this.Td.setFillType(t.FillType.EvenOdd);else {if("nonzero"!==n&&n)throw "invalid fill rule";this.Td.setFillType(t.FillType.Winding);}e||(e=this.Td),n=this.Oe();var r=this.xe(n);r&&(this.Nd.save(),this.pe(),this.Nd.drawPath(e,r),this.Nd.restore(),r.dispose()),this.Nd.drawPath(e,n),n.dispose();},this.fillRect=function(e,n,r,i){var a=this.Oe(),o=this.xe(a);o&&(this.Nd.save(),this.pe(),this.Nd.drawRect(t.XYWHRect(e,n,r,i),o),this.Nd.restore(),o.dispose()),this.Nd.drawRect(t.XYWHRect(e,n,r,i),a),a.dispose();},this.fillText=function(e,n,r){var i=this.Oe();e=t.TextBlob.MakeFromText(e,this.re);var a=this.xe(i);a&&(this.Nd.save(),this.pe(),this.Nd.drawTextBlob(e,n,r,a),this.Nd.restore(),a.dispose()),this.Nd.drawTextBlob(e,n,r,i),e.delete(),i.dispose();},this.getImageData=function(e,n,r,i){return (e=this.Nd.readPixels(e,n,{width:r,height:i,colorType:t.ColorType.RGBA_8888,alphaType:t.AlphaType.Unpremul,colorSpace:t.ColorSpace.SRGB}))?new l(new Uint8ClampedArray(e.buffer),r,i):null},this.getLineDash=function(){return this.te.slice()},this.lf=function(e){var n=t.Matrix.invert(this.Ud);return t.Matrix.mapPoints(n,e),e},this.isPointInPath=function(e,n,r){var i=arguments;if(3===i.length)var a=this.Td;else {if(4!==i.length)throw "invalid arg count, need 3 or 4, got "+i.length;a=i[0],e=i[1],n=i[2],r=i[3];}return !(!isFinite(e)||!isFinite(n))&&("nonzero"===(r=r||"nonzero")||"evenodd"===r)&&(e=(i=this.lf([e,n]))[0],n=i[1],a.setFillType("nonzero"===r?t.FillType.Winding:t.FillType.EvenOdd),a.contains(e,n))},this.isPointInStroke=function(e,n){var r=arguments;if(2===r.length)var i=this.Td;else {if(3!==r.length)throw "invalid arg count, need 2 or 3, got "+r.length;i=r[0],e=r[1],n=r[2];}return !(!isFinite(e)||!isFinite(n))&&(e=(r=this.lf([e,n]))[0],n=r[1],(i=i.copy()).setFillType(t.FillType.Winding),i.stroke({width:this.lineWidth,miter_limit:this.miterLimit,cap:this.Qd.getStrokeCap(),join:this.Qd.getStrokeJoin(),precision:.3}),r=i.contains(e,n),i.delete(),r)},this.lineTo=function(t,e){p(this.Td,t,e);},this.measureText=function(){throw Error("Clients wishing to properly measure text should use the Paragraph API")},this.moveTo=function(t,n){var r=this.Td;e([t,n])&&r.moveTo(t,n);},this.putImageData=function(n,r,i,a,o,s,l){if(e([r,i,a,o,s,l]))if(void 0===a)this.Nd.writePixels(n.data,n.width,n.height,r,i);else if(a=a||0,o=o||0,s=s||n.width,l=l||n.height,0>s&&(a+=s,s=Math.abs(s)),0>l&&(o+=l,l=Math.abs(l)),0>a&&(s+=a,a=0),0>o&&(l+=o,o=0),!(0>=s||0>=l)){n=t.MakeImage({width:n.width,height:n.height,alphaType:t.AlphaType.Unpremul,colorType:t.ColorType.RGBA_8888,colorSpace:t.ColorSpace.SRGB},n.data,4*n.width);var u=t.XYWHRect(a,o,s,l);r=t.XYWHRect(r+a,i+o,s,l),i=t.Matrix.invert(this.Ud),this.Nd.save(),this.Nd.concat(i),this.Nd.drawImageRect(n,u,r,null,!1),this.Nd.restore(),n.delete();}},this.quadraticCurveTo=function(t,n,r,i){var a=this.Td;e([t,n,r,i])&&(a.isEmpty()&&a.moveTo(t,n),a.quadTo(t,n,r,i));},this.rect=function(n,r,i,a){var o=this.Td;e(n=t.XYWHRect(n,r,i,a))&&o.addRect(n);},this.resetTransform=function(){this.Td.transform(this.Ud);var e=t.Matrix.invert(this.Ud);this.Nd.concat(e),this.Ud=this.Nd.getTotalMatrix();},this.restore=function(){var e=this.kf.pop();if(e){var n=t.Matrix.multiply(this.Ud,t.Matrix.invert(e.Cf));this.Td.transform(n),this.Qd.delete(),this.Qd=e.$f,this.te=e.Wf,this.Je=e.rg,this.he=e.qg,this.be=e.fs,this.ve=e.og,this.we=e.pg,this.ue=e.dg,this.Ie=e.ng,this.je=e.Jf,this.Pd=e.Kf,this.He=e.Xf,this.Pe=e.If,this.Nd.restore(),this.Ud=this.Nd.getTotalMatrix();}},this.rotate=function(e){if(isFinite(e)){var n=t.Matrix.rotated(-e);this.Td.transform(n),this.Nd.rotate(e/Math.PI*180,0,0),this.Ud=this.Nd.getTotalMatrix();}},this.save=function(){if(this.be.qe){var t=this.be.qe();this.Ae.push(t);}else t=this.be;if(this.he.qe){var e=this.he.qe();this.Ae.push(e);}else e=this.he;this.kf.push({Cf:this.Ud.slice(),Wf:this.te.slice(),rg:this.Je,qg:e,fs:t,og:this.ve,pg:this.we,dg:this.ue,ng:this.Ie,Jf:this.je,Xf:this.He,Kf:this.Pd,$f:this.Qd.copy(),If:this.Pe}),this.Nd.save();},this.scale=function(n,r){if(e(arguments)){var i=t.Matrix.scaled(1/n,1/r);this.Td.transform(i),this.Nd.scale(n,r),this.Ud=this.Nd.getTotalMatrix();}},this.setLineDash=function(t){for(var e=0;e<t.length;e++)if(!isFinite(t[e])||0>t[e])return;1==t.length%2&&Array.prototype.push.apply(t,t),this.te=t;},this.setTransform=function(t,n,r,i,a,o){e(arguments)&&(this.resetTransform(),this.transform(t,n,r,i,a,o));},this.pe=function(){var e=t.Matrix.invert(this.Ud);this.Nd.concat(e),this.Nd.concat(t.Matrix.translated(this.ve,this.we)),this.Nd.concat(this.Ud);},this.xe=function(e){var n=t.multiplyByAlpha(this.Ie,this.je);if(!t.getColorComponents(n)[3]||!(this.ue||this.we||this.ve))return null;(e=e.copy()).setColor(n);var r=t.MaskFilter.MakeBlur(t.BlurStyle.Normal,this.ue/2,!1);return e.setMaskFilter(r),e.dispose=function(){r.delete(),this.delete();},e},this.bf=function(){var e=this.Qd.copy();if(e.setStyle(t.PaintStyle.Stroke),i(this.he)){var n=t.multiplyByAlpha(this.he,this.je);e.setColor(n);}else n=this.he.se(this.Ud),e.setColor(t.Color(0,0,0,this.je)),e.setShader(n);if(e.setStrokeWidth(this.Je),this.te.length){var r=t.PathEffect.MakeDash(this.te,this.He);e.setPathEffect(r);}return e.dispose=function(){r&&r.delete(),this.delete();},e},this.stroke=function(t){t=t?t.Wd:this.Td;var e=this.bf(),n=this.xe(e);n&&(this.Nd.save(),this.pe(),this.Nd.drawPath(t,n),this.Nd.restore(),n.dispose()),this.Nd.drawPath(t,e),e.dispose();},this.strokeRect=function(e,n,r,i){var a=this.bf(),o=this.xe(a);o&&(this.Nd.save(),this.pe(),this.Nd.drawRect(t.XYWHRect(e,n,r,i),o),this.Nd.restore(),o.dispose()),this.Nd.drawRect(t.XYWHRect(e,n,r,i),a),a.dispose();},this.strokeText=function(e,n,r){var i=this.bf();e=t.TextBlob.MakeFromText(e,this.re);var a=this.xe(i);a&&(this.Nd.save(),this.pe(),this.Nd.drawTextBlob(e,n,r,a),this.Nd.restore(),a.dispose()),this.Nd.drawTextBlob(e,n,r,i),e.delete(),i.dispose();},this.translate=function(n,r){if(e(arguments)){var i=t.Matrix.translated(-n,-r);this.Td.transform(i),this.Nd.translate(n,r),this.Ud=this.Nd.getTotalMatrix();}},this.transform=function(e,n,r,i,a,o){e=[e,r,a,n,i,o,0,0,1],n=t.Matrix.invert(e),this.Td.transform(n),this.Nd.concat(e),this.Ud=this.Nd.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 s(e){this.cf=e,this.Md=new o(e.getCanvas()),this.Qe=[],this.decodeImage=function(e){if(!(e=t.MakeImageFromEncoded(e)))throw "Invalid input";return this.Qe.push(e),e},this.loadFont=function(e,n){if(!(e=t.Typeface.MakeFreeTypeFaceFromData(e)))return null;this.Qe.push(e);var r=(n.style||"normal")+"|"+(n.variant||"normal")+"|"+(n.weight||"normal");n=n.family,b[n]||(b[n]={"*":e}),b[n][r]=e;},this.makePath2D=function(t){return t=new g(t),this.Qe.push(t.Wd),t},this.getContext=function(t){return "2d"===t?this.Md:null},this.toDataURL=function(e,n){this.cf.flush();var r=this.cf.makeImageSnapshot();if(r){e=e||"image/png";var i=t.ImageFormat.PNG;if("image/jpeg"===e&&(i=t.ImageFormat.JPEG),n=r.encodeToBytes(i,n||.92)){if(r.delete(),e="data:"+e+";base64,","undefined"!=typeof Buffer)n=Buffer.from(n).toString("base64");else {r=0,i=n.length;for(var a,o="";r<i;)a=n.slice(r,Math.min(r+32768,i)),o+=String.fromCharCode.apply(null,a),r+=32768;n=btoa(o);}return e+n}}},this.dispose=function(){this.Md.me(),this.Qe.forEach((function(t){t.delete();})),this.cf.dispose();};}function l(t,e,n){if(!e||0===n)throw "invalid dimensions, width and height must be non-zero";if(t.length%4)throw "arr must be a multiple of 4";n=n||t.length/(4*e),Object.defineProperty(this,"data",{value:t,writable:!1}),Object.defineProperty(this,"height",{value:n,writable:!1}),Object.defineProperty(this,"width",{value:e,writable:!1});}function u(e,n,i,a){this.Yd=null,this.ee=[],this.$d=[],this.addColorStop=function(t,e){if(0>t||1<t||!isFinite(t))throw "offset must be between 0 and 1 inclusively";e=r(e);var n=this.$d.indexOf(t);if(-1!==n)this.ee[n]=e;else {for(n=0;n<this.$d.length&&!(this.$d[n]>t);n++);this.$d.splice(n,0,t),this.ee.splice(n,0,e);}},this.qe=function(){var t=new u(e,n,i,a);return t.ee=this.ee.slice(),t.$d=this.$d.slice(),t},this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null);},this.se=function(r){var o=[e,n,i,a];t.Matrix.mapPoints(r,o),r=o[0];var s=o[1],l=o[2];return o=o[3],this.me(),this.Yd=t.Shader.MakeLinearGradient([r,s],[l,o],this.ee,this.$d,t.TileMode.Clamp)};}function c(t,n,r,i,a,o){if(e([n,r,i,a,o])){if(0>o)throw "radii cannot be negative";t.isEmpty()&&t.moveTo(n,r),t.arcToTangent(n,r,i,a,o);}}function h(t){if(!t.isEmpty()){var e=t.getBounds();(e[3]-e[1]||e[2]-e[0])&&t.close();}}function f(e,n,r,i,a,o,s){s=(s-o)/Math.PI*180,o=o/Math.PI*180,n=t.LTRBRect(n-i,r-a,n+i,r+a),1e-5>Math.abs(Math.abs(s)-360)?(r=s/2,e.arcToOval(n,o,r,!1),e.arcToOval(n,o+r,r,!1)):e.arcToOval(n,o,s,!1);}function d(n,r,i,a,o,s,l,u,c){if(e([r,i,a,o,s,l,u])){if(0>a||0>o)throw "radii cannot be negative";var h=2*Math.PI,d=l%h;0>d&&(d+=h);var p=d-l;l=d,u+=p,!c&&u-l>=h?u=l+h:c&&l-u>=h?u=l-h:!c&&l>u?u=l+(h-(l-u)%h):c&&l<u&&(u=l-(h-(u-l)%h)),s?(c=t.Matrix.rotated(s,r,i),s=t.Matrix.rotated(-s,r,i),n.transform(s),f(n,r,i,a,o,l,u),n.transform(c)):f(n,r,i,a,o,l,u);}}function p(t,n,r){e([n,r])&&(t.isEmpty()&&t.moveTo(n,r),t.lineTo(n,r));}function g(n){this.Wd=null,this.Wd="string"==typeof n?t.Path.MakeFromSVGString(n):n&&n.$e?n.Wd.copy():new t.Path,this.$e=function(){return this.Wd},this.addPath=function(t,e){e||(e={a:1,c:0,e:0,b:0,d:1,f:0}),this.Wd.addPath(t.Wd,[e.a,e.c,e.e,e.b,e.d,e.f]);},this.arc=function(t,e,n,r,i,a){d(this.Wd,t,e,n,n,0,r,i,a);},this.arcTo=function(t,e,n,r,i){c(this.Wd,t,e,n,r,i);},this.bezierCurveTo=function(t,n,r,i,a,o){var s=this.Wd;e([t,n,r,i,a,o])&&(s.isEmpty()&&s.moveTo(t,n),s.cubicTo(t,n,r,i,a,o));},this.closePath=function(){h(this.Wd);},this.ellipse=function(t,e,n,r,i,a,o,s){d(this.Wd,t,e,n,r,i,a,o,s);},this.lineTo=function(t,e){p(this.Wd,t,e);},this.moveTo=function(t,n){var r=this.Wd;e([t,n])&&r.moveTo(t,n);},this.quadraticCurveTo=function(t,n,r,i){var a=this.Wd;e([t,n,r,i])&&(a.isEmpty()&&a.moveTo(t,n),a.quadTo(t,n,r,i));},this.rect=function(n,r,i,a){var o=this.Wd;e(n=t.XYWHRect(n,r,i,a))&&o.addRect(n);};}function m(n,r){switch(this.Yd=null,this.xf=n,this._transform=t.Matrix.identity(),""===r&&(r="repeat"),r){case"repeat-x":this.ye=t.TileMode.Repeat,this.ze=t.TileMode.Decal;break;case"repeat-y":this.ye=t.TileMode.Decal,this.ze=t.TileMode.Repeat;break;case"repeat":this.ze=this.ye=t.TileMode.Repeat;break;case"no-repeat":this.ze=this.ye=t.TileMode.Decal;break;default:throw "invalid repetition mode "+r}this.setTransform=function(t){e(t=[t.a,t.c,t.e,t.b,t.d,t.f,0,0,1])&&(this._transform=t);},this.qe=function(){var t=new m;return t.ye=this.ye,t.ze=this.ze,t},this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null);},this.se=function(){return this.me(),this.Yd=this.xf.makeShaderCubic(this.ye,this.ze,1/3,1/3,this._transform)};}function y(e,n,i,a,o,s){this.Yd=null,this.ee=[],this.$d=[],this.addColorStop=function(t,e){if(0>t||1<t||!isFinite(t))throw "offset must be between 0 and 1 inclusively";e=r(e);var n=this.$d.indexOf(t);if(-1!==n)this.ee[n]=e;else {for(n=0;n<this.$d.length&&!(this.$d[n]>t);n++);this.$d.splice(n,0,t),this.ee.splice(n,0,e);}},this.qe=function(){var t=new y(e,n,i,a,o,s);return t.ee=this.ee.slice(),t.$d=this.$d.slice(),t},this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null);},this.se=function(r){var l=[e,n,a,o];t.Matrix.mapPoints(r,l);var u=l[0],c=l[1],h=l[2];l=l[3];var f=(Math.abs(r[0])+Math.abs(r[4]))/2;return r=i*f,f*=s,this.me(),this.Yd=t.Shader.MakeTwoPointConicalGradient([u,c],r,[h,l],f,this.ee,this.$d,t.TileMode.Clamp)};}t._testing={};var v={aliceblue:Float32Array.of(.941,.973,1,1),antiquewhite:Float32Array.of(.98,.922,.843,1),aqua:Float32Array.of(0,1,1,1),aquamarine:Float32Array.of(.498,1,.831,1),azure:Float32Array.of(.941,1,1,1),beige:Float32Array.of(.961,.961,.863,1),bisque:Float32Array.of(1,.894,.769,1),black:Float32Array.of(0,0,0,1),blanchedalmond:Float32Array.of(1,.922,.804,1),blue:Float32Array.of(0,0,1,1),blueviolet:Float32Array.of(.541,.169,.886,1),brown:Float32Array.of(.647,.165,.165,1),burlywood:Float32Array.of(.871,.722,.529,1),cadetblue:Float32Array.of(.373,.62,.627,1),chartreuse:Float32Array.of(.498,1,0,1),chocolate:Float32Array.of(.824,.412,.118,1),coral:Float32Array.of(1,.498,.314,1),cornflowerblue:Float32Array.of(.392,.584,.929,1),cornsilk:Float32Array.of(1,.973,.863,1),crimson:Float32Array.of(.863,.078,.235,1),cyan:Float32Array.of(0,1,1,1),darkblue:Float32Array.of(0,0,.545,1),darkcyan:Float32Array.of(0,.545,.545,1),darkgoldenrod:Float32Array.of(.722,.525,.043,1),darkgray:Float32Array.of(.663,.663,.663,1),darkgreen:Float32Array.of(0,.392,0,1),darkgrey:Float32Array.of(.663,.663,.663,1),darkkhaki:Float32Array.of(.741,.718,.42,1),darkmagenta:Float32Array.of(.545,0,.545,1),darkolivegreen:Float32Array.of(.333,.42,.184,1),darkorange:Float32Array.of(1,.549,0,1),darkorchid:Float32Array.of(.6,.196,.8,1),darkred:Float32Array.of(.545,0,0,1),darksalmon:Float32Array.of(.914,.588,.478,1),darkseagreen:Float32Array.of(.561,.737,.561,1),darkslateblue:Float32Array.of(.282,.239,.545,1),darkslategray:Float32Array.of(.184,.31,.31,1),darkslategrey:Float32Array.of(.184,.31,.31,1),darkturquoise:Float32Array.of(0,.808,.82,1),darkviolet:Float32Array.of(.58,0,.827,1),deeppink:Float32Array.of(1,.078,.576,1),deepskyblue:Float32Array.of(0,.749,1,1),dimgray:Float32Array.of(.412,.412,.412,1),dimgrey:Float32Array.of(.412,.412,.412,1),dodgerblue:Float32Array.of(.118,.565,1,1),firebrick:Float32Array.of(.698,.133,.133,1),floralwhite:Float32Array.of(1,.98,.941,1),forestgreen:Float32Array.of(.133,.545,.133,1),fuchsia:Float32Array.of(1,0,1,1),gainsboro:Float32Array.of(.863,.863,.863,1),ghostwhite:Float32Array.of(.973,.973,1,1),gold:Float32Array.of(1,.843,0,1),goldenrod:Float32Array.of(.855,.647,.125,1),gray:Float32Array.of(.502,.502,.502,1),green:Float32Array.of(0,.502,0,1),greenyellow:Float32Array.of(.678,1,.184,1),grey:Float32Array.of(.502,.502,.502,1),honeydew:Float32Array.of(.941,1,.941,1),hotpink:Float32Array.of(1,.412,.706,1),indianred:Float32Array.of(.804,.361,.361,1),indigo:Float32Array.of(.294,0,.51,1),ivory:Float32Array.of(1,1,.941,1),khaki:Float32Array.of(.941,.902,.549,1),lavender:Float32Array.of(.902,.902,.98,1),lavenderblush:Float32Array.of(1,.941,.961,1),lawngreen:Float32Array.of(.486,.988,0,1),lemonchiffon:Float32Array.of(1,.98,.804,1),lightblue:Float32Array.of(.678,.847,.902,1),lightcoral:Float32Array.of(.941,.502,.502,1),lightcyan:Float32Array.of(.878,1,1,1),lightgoldenrodyellow:Float32Array.of(.98,.98,.824,1),lightgray:Float32Array.of(.827,.827,.827,1),lightgreen:Float32Array.of(.565,.933,.565,1),lightgrey:Float32Array.of(.827,.827,.827,1),lightpink:Float32Array.of(1,.714,.757,1),lightsalmon:Float32Array.of(1,.627,.478,1),lightseagreen:Float32Array.of(.125,.698,.667,1),lightskyblue:Float32Array.of(.529,.808,.98,1),lightslategray:Float32Array.of(.467,.533,.6,1),lightslategrey:Float32Array.of(.467,.533,.6,1),lightsteelblue:Float32Array.of(.69,.769,.871,1),lightyellow:Float32Array.of(1,1,.878,1),lime:Float32Array.of(0,1,0,1),limegreen:Float32Array.of(.196,.804,.196,1),linen:Float32Array.of(.98,.941,.902,1),magenta:Float32Array.of(1,0,1,1),maroon:Float32Array.of(.502,0,0,1),mediumaquamarine:Float32Array.of(.4,.804,.667,1),mediumblue:Float32Array.of(0,0,.804,1),mediumorchid:Float32Array.of(.729,.333,.827,1),mediumpurple:Float32Array.of(.576,.439,.859,1),mediumseagreen:Float32Array.of(.235,.702,.443,1),mediumslateblue:Float32Array.of(.482,.408,.933,1),mediumspringgreen:Float32Array.of(0,.98,.604,1),mediumturquoise:Float32Array.of(.282,.82,.8,1),mediumvioletred:Float32Array.of(.78,.082,.522,1),midnightblue:Float32Array.of(.098,.098,.439,1),mintcream:Float32Array.of(.961,1,.98,1),mistyrose:Float32Array.of(1,.894,.882,1),moccasin:Float32Array.of(1,.894,.71,1),navajowhite:Float32Array.of(1,.871,.678,1),navy:Float32Array.of(0,0,.502,1),oldlace:Float32Array.of(.992,.961,.902,1),olive:Float32Array.of(.502,.502,0,1),olivedrab:Float32Array.of(.42,.557,.137,1),orange:Float32Array.of(1,.647,0,1),orangered:Float32Array.of(1,.271,0,1),orchid:Float32Array.of(.855,.439,.839,1),palegoldenrod:Float32Array.of(.933,.91,.667,1),palegreen:Float32Array.of(.596,.984,.596,1),paleturquoise:Float32Array.of(.686,.933,.933,1),palevioletred:Float32Array.of(.859,.439,.576,1),papayawhip:Float32Array.of(1,.937,.835,1),peachpuff:Float32Array.of(1,.855,.725,1),peru:Float32Array.of(.804,.522,.247,1),pink:Float32Array.of(1,.753,.796,1),plum:Float32Array.of(.867,.627,.867,1),powderblue:Float32Array.of(.69,.878,.902,1),purple:Float32Array.of(.502,0,.502,1),rebeccapurple:Float32Array.of(.4,.2,.6,1),red:Float32Array.of(1,0,0,1),rosybrown:Float32Array.of(.737,.561,.561,1),royalblue:Float32Array.of(.255,.412,.882,1),saddlebrown:Float32Array.of(.545,.271,.075,1),salmon:Float32Array.of(.98,.502,.447,1),sandybrown:Float32Array.of(.957,.643,.376,1),seagreen:Float32Array.of(.18,.545,.341,1),seashell:Float32Array.of(1,.961,.933,1),sienna:Float32Array.of(.627,.322,.176,1),silver:Float32Array.of(.753,.753,.753,1),skyblue:Float32Array.of(.529,.808,.922,1),slateblue:Float32Array.of(.416,.353,.804,1),slategray:Float32Array.of(.439,.502,.565,1),slategrey:Float32Array.of(.439,.502,.565,1),snow:Float32Array.of(1,.98,.98,1),springgreen:Float32Array.of(0,1,.498,1),steelblue:Float32Array.of(.275,.51,.706,1),tan:Float32Array.of(.824,.706,.549,1),teal:Float32Array.of(0,.502,.502,1),thistle:Float32Array.of(.847,.749,.847,1),tomato:Float32Array.of(1,.388,.278,1),transparent:Float32Array.of(0,0,0,0),turquoise:Float32Array.of(.251,.878,.816,1),violet:Float32Array.of(.933,.51,.933,1),wheat:Float32Array.of(.961,.871,.702,1),white:Float32Array.of(1,1,1,1),whitesmoke:Float32Array.of(.961,.961,.961,1),yellow:Float32Array.of(1,1,0,1),yellowgreen:Float32Array.of(.604,.804,.196,1)};t._testing.parseColor=r,t._testing.colorToString=n;var w=/(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)(.+)/,b={"Noto Mono":{"*":null},monospace:{"*":null}};t._testing.parseFontString=a,t.MakeCanvas=function(e,n){return (e=t.MakeSurface(e,n))?new s(e):null},t.ImageData=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new l(new Uint8ClampedArray(4*t*e),t,e)}if(3===arguments.length){var n=arguments[0];if(n.prototype.constructor!==Uint8ClampedArray)throw "bytes must be given as a Uint8ClampedArray";if(n%4)throw "bytes must be given in a multiple of 4";if(n%(t=arguments[1]))throw "bytes must divide evenly by width";if((e=arguments[2])&&e!==n/(4*t))throw "invalid height given";return new l(n,t,n/(4*t))}throw "invalid number of arguments - takes 2 or 3, saw "+arguments.length};}();}(e);var o,s={};for(o in e)e.hasOwnProperty(o)&&(s[o]=e[o]);var l,u,c,h,f="./this.program";function d(t,e){throw e}l="object"==typeof window,u="function"==typeof importScripts,c="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,h=!l&&!c&&!u;var p,g,m,y,v,w="";c?(w=u?L.dirname(w)+"/":__dirname+"/",p=function(t,e){return y||(y=I),v||(v=L),t=v.normalize(t),y.readFileSync(t,e?null:"utf8")},m=function(t){return (t=p(t,!0)).buffer||(t=new Uint8Array(t)),M(t.buffer),t},1<process.argv.length&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof Cn))throw t})),process.on("unhandledRejection",at),d=function(t){process.exit(t);},e.inspect=function(){return "[Emscripten Module object]"}):h?("undefined"!=typeof read&&(p=function(t){return read(t)}),m=function(t){return "function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(M("object"==typeof(t=read(t,"binary"))),t)},"function"==typeof quit&&(d=function(t){quit(t);}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(l||u)&&(u?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==w.indexOf("blob:")?w.substr(0,w.lastIndexOf("/")+1):"",p=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},u&&(m=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),g=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?e(r.response):n();},r.onerror=n,r.send(null);});var b=e.print||console.log.bind(console),S=e.printErr||console.warn.bind(console);for(o in s)s.hasOwnProperty(o)&&(e[o]=s[o]);s=null,e.thisProgram&&(f=e.thisProgram),e.quit&&(d=e.quit);var T,A=0;e.wasmBinary&&(T=e.wasmBinary);var C=e.noExitRuntime||!0;"object"!=typeof WebAssembly&&at("no native wasm support detected");var _,P=!1;function M(t,e){t||at("Assertion failed: "+e);}var F="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function k(t,e,n){var r=e+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.subarray&&F)return F.decode(t.subarray(e,n));for(r="";e<n;){var i=t[e++];if(128&i){var a=63&t[e++];if(192==(224&i))r+=String.fromCharCode((31&i)<<6|a);else {var o=63&t[e++];65536>(i=224==(240&i)?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&t[e++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i));}}else r+=String.fromCharCode(i);}return r}function x(t,e){return t?k(D,t,e):""}function E(t,e,n,r){if(!(0<r))return 0;var i=n;r=n+r-1;for(var a=0;a<t.length;++a){var o=t.charCodeAt(a);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++a)),127>=o){if(n>=r)break;e[n++]=o;}else {if(2047>=o){if(n+1>=r)break;e[n++]=192|o>>6;}else {if(65535>=o){if(n+2>=r)break;e[n++]=224|o>>12;}else {if(n+3>=r)break;e[n++]=240|o>>18,e[n++]=128|o>>12&63;}e[n++]=128|o>>6&63;}e[n++]=128|63&o;}}return e[n]=0,n-i}function O(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);55296<=r&&57343>=r&&(r=65536+((1023&r)<<10)|1023&t.charCodeAt(++n)),127>=r?++e:e=2047>=r?e+2:65535>=r?e+3:e+4;}return e}var R,B,D,G,U,W,N,j,z,H="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function V(t,e){for(var n=t>>1,r=n+e/2;!(n>=r)&&U[n];)++n;if(32<(n<<=1)-t&&H)return H.decode(D.subarray(t,n));for(n="",r=0;!(r>=e/2);++r){var i=G[t+2*r>>1];if(0==i)break;n+=String.fromCharCode(i);}return n}function Y(t,e,n){if(void 0===n&&(n=2147483647),2>n)return 0;var r=e;n=(n-=2)<2*t.length?n/2:t.length;for(var i=0;i<n;++i)G[e>>1]=t.charCodeAt(i),e+=2;return G[e>>1]=0,e-r}function q(t){return 2*t.length}function $(t,e){for(var n=0,r="";!(n>=e/4);){var i=W[t+4*n>>2];if(0==i)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i);}return r}function X(t,e,n){if(void 0===n&&(n=2147483647),4>n)return 0;var r=e;n=r+n-4;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),W[e>>2]=a,(e+=4)+4>n)break}return W[e>>2]=0,e-r}function K(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);55296<=r&&57343>=r&&++n,e+=4;}return e}function Q(){var t=_.buffer;R=t,e.HEAP8=B=new Int8Array(t),e.HEAP16=G=new Int16Array(t),e.HEAP32=W=new Int32Array(t),e.HEAPU8=D=new Uint8Array(t),e.HEAPU16=U=new Uint16Array(t),e.HEAPU32=N=new Uint32Array(t),e.HEAPF32=j=new Float32Array(t),e.HEAPF64=z=new Float64Array(t);}var Z,J=[],tt=[],et=[];function nt(){var t=e.preRun.shift();J.unshift(t);}var rt=0,it=null;function at(t){throw e.onAbort&&e.onAbort(t),S(t),P=!0,t=new WebAssembly.RuntimeError("abort("+t+"). Build with -s ASSERTIONS=1 for more info."),i(t),t}function ot(){return st.startsWith("data:application/octet-stream;base64,")}e.preloadedImages={},e.preloadedAudios={};var st="canvaskit.wasm";if(!ot()){var lt=st;st=e.locateFile?e.locateFile(lt,w):w+lt;}function ut(){var t=st;try{if(t==st&&T)return new Uint8Array(T);if(m)return m(t);throw "both async and sync fetching of the wasm failed"}catch(t){at(t);}}function ct(t){for(;0<t.length;){var n=t.shift();if("function"==typeof n)n(e);else {var r=n.Ag;"number"==typeof r?void 0===n.df?Z.get(r)():Z.get(r)(n.df):r(void 0===n.df?null:n.df);}}}function ht(t){this.Rd=t-16,this.ig=function(t){W[this.Rd+8>>2]=t;},this.fg=function(t){W[this.Rd+0>>2]=t;},this.gg=function(){W[this.Rd+4>>2]=0;},this.eg=function(){B[this.Rd+12>>0]=0;},this.hg=function(){B[this.Rd+13>>0]=0;},this.Tf=function(t,e){this.ig(t),this.fg(e),this.gg(),this.eg(),this.hg();};}var ft={},dt=[null,[],[]],pt={},gt={};function mt(t){for(;t.length;){var e=t.pop();t.pop()(e);}}function yt(t){return this.fromWireType(N[t>>2])}var vt={},wt={},bt={};function St(t){if(void 0===t)return "_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?"_"+t:t}function Tt(t,e){return t=St(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function At(t){var e=Error,n=Tt(t,(function(e){this.name=t,this.message=e,void 0!==(e=Error(e).stack)&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""));}));return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var Ct=void 0;function _t(t){throw new Ct(t)}function Pt(t,e,n){function r(e){(e=n(e)).length!==t.length&&_t("Mismatched type converter count");for(var r=0;r<t.length;++r)Ot(t[r],e[r]);}t.forEach((function(t){bt[t]=e;}));var i=Array(e.length),a=[],o=0;e.forEach((function(t,e){wt.hasOwnProperty(t)?i[e]=wt[t]:(a.push(t),vt.hasOwnProperty(t)||(vt[t]=[]),vt[t].push((function(){i[e]=wt[t],++o===a.length&&r(i);})));})),0===a.length&&r(i);}function Mt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var Ft=void 0;function kt(t){for(var e="";D[t];)e+=Ft[D[t++]];return e}var xt=void 0;function Et(t){throw new xt(t)}function Ot(t,e,n){if(n=n||{},!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=e.name;if(t||Et('type "'+r+'" must have a positive integer typeid pointer'),wt.hasOwnProperty(t)){if(n.Sf)return;Et("Cannot register type '"+r+"' twice");}wt[t]=e,delete bt[t],vt.hasOwnProperty(t)&&(e=vt[t],delete vt[t],e.forEach((function(t){t();})));}function Rt(t){Et(t.Ld.Xd.Sd.name+" instance already deleted");}var Bt=!1;function Lt(){}function It(t){--t.count.value,0===t.count.value&&(t.de?t.ge.ke(t.de):t.Xd.Sd.ke(t.Rd));}function Dt(t){return "undefined"==typeof FinalizationGroup?(Dt=function(t){return t},t):(Bt=new FinalizationGroup((function(t){for(var e=t.next();!e.done;e=t.next())(e=e.value).Rd?It(e):console.warn("object already deleted: "+e.Rd);})),Lt=function(t){Bt.unregister(t.Ld);},(Dt=function(t){return Bt.register(t,t.Ld,t.Ld),t})(t))}var Gt=void 0,Ut=[];function Wt(){for(;Ut.length;){var t=Ut.pop();t.Ld.De=!1,t.delete();}}function Nt(){}var jt={};function zt(t,e,n){if(void 0===t[e].Zd){var r=t[e];t[e]=function(){return t[e].Zd.hasOwnProperty(arguments.length)||Et("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].Zd+")!"),t[e].Zd[arguments.length].apply(this,arguments)},t[e].Zd=[],t[e].Zd[r.Be]=r;}}function Ht(t,n,r){e.hasOwnProperty(t)?((void 0===r||void 0!==e[t].Zd&&void 0!==e[t].Zd[r])&&Et("Cannot register public name '"+t+"' twice"),zt(e,t,t),e.hasOwnProperty(r)&&Et("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),e[t].Zd[r]=n):(e[t]=n,void 0!==r&&(e[t].Cg=r));}function Vt(t,e,n,r,i,a,o,s){this.name=t,this.constructor=e,this.Ee=n,this.ke=r,this.ie=i,this.Lf=a,this.Ne=o,this.Ff=s,this.bg=[];}function Yt(t,e,n){for(;e!==n;)e.Ne||Et("Expected null or instance of "+n.name+", got an instance of "+e.name),t=e.Ne(t),e=e.ie;return t}function qt(t,e){return null===e?(this.ff&&Et("null is not a valid "+this.name),0):(e.Ld||Et('Cannot pass "'+pe(e)+'" as a '+this.name),e.Ld.Rd||Et("Cannot pass deleted object as a pointer of type "+this.name),Yt(e.Ld.Rd,e.Ld.Xd.Sd,this.Sd))}function $t(t,e){if(null===e){if(this.ff&&Et("null is not a valid "+this.name),this.Se){var n=this.gf();return null!==t&&t.push(this.ke,n),n}return 0}if(e.Ld||Et('Cannot pass "'+pe(e)+'" as a '+this.name),e.Ld.Rd||Et("Cannot pass deleted object as a pointer of type "+this.name),!this.Re&&e.Ld.Xd.Re&&Et("Cannot convert argument of type "+(e.Ld.ge?e.Ld.ge.name:e.Ld.Xd.name)+" to parameter type "+this.name),n=Yt(e.Ld.Rd,e.Ld.Xd.Sd,this.Sd),this.Se)switch(void 0===e.Ld.de&&Et("Passing raw pointer to smart pointer is illegal"),this.mg){case 0:e.Ld.ge===this?n=e.Ld.de:Et("Cannot convert argument of type "+(e.Ld.ge?e.Ld.ge.name:e.Ld.Xd.name)+" to parameter type "+this.name);break;case 1:n=e.Ld.de;break;case 2:if(e.Ld.ge===this)n=e.Ld.de;else {var r=e.clone();n=this.cg(n,he((function(){r.delete();}))),null!==t&&t.push(this.ke,n);}break;default:Et("Unsupporting sharing policy");}return n}function Xt(t,e){return null===e?(this.ff&&Et("null is not a valid "+this.name),0):(e.Ld||Et('Cannot pass "'+pe(e)+'" as a '+this.name),e.Ld.Rd||Et("Cannot pass deleted object as a pointer of type "+this.name),e.Ld.Xd.Re&&Et("Cannot convert argument of type "+e.Ld.Xd.name+" to parameter type "+this.name),Yt(e.Ld.Rd,e.Ld.Xd.Sd,this.Sd))}function Kt(t,e,n){return e===n?t:void 0===n.ie||null===(t=Kt(t,e,n.ie))?null:n.Ff(t)}var Qt={};function Zt(t,e){return e.Xd&&e.Rd||_t("makeClassHandle requires ptr and ptrType"),!!e.ge!=!!e.de&&_t("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Dt(Object.create(t,{Ld:{value:e}}))}function Jt(t,e,n,r,i,a,o,s,l,u,c){this.name=t,this.Sd=e,this.ff=n,this.Re=r,this.Se=i,this.ag=a,this.mg=o,this.tf=s,this.gf=l,this.cg=u,this.ke=c,i||void 0!==e.ie?this.toWireType=$t:(this.toWireType=r?qt:Xt,this.fe=null);}function te(t,n,r){e.hasOwnProperty(t)||_t("Replacing nonexistant public symbol"),void 0!==e[t].Zd&&void 0!==r?e[t].Zd[r]=n:(e[t]=n,e[t].Be=r);}function ee(t,n){var r=(t=kt(t)).includes("j")?function(t,n){var r=[];return function(){r.length=arguments.length;for(var i=0;i<arguments.length;i++)r[i]=arguments[i];return t.includes("j")?(i=e["dynCall_"+t],i=r&&r.length?i.apply(null,[n].concat(r)):i.call(null,n)):i=Z.get(n).apply(null,r),i}}(t,n):Z.get(n);return "function"!=typeof r&&Et("unknown function pointer with signature "+t+": "+n),r}var ne=void 0;function re(t){var e=kt(t=vn(t));return mn(t),e}function ie(t,e){var n=[],r={};throw e.forEach((function t(e){r[e]||wt[e]||(bt[e]?bt[e].forEach(t):(n.push(e),r[e]=!0));})),new ne(t+": "+n.map(re).join([", "]))}function ae(t){var e=Function;if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=Tt(e.name||"unknownFunctionName",(function(){}));return n.prototype=e.prototype,n=new n,(t=e.apply(n,t))instanceof Object?t:n}function oe(t,e,n,r,i){var a=e.length;2>a&&Et("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==e[1]&&null!==n,s=!1;for(n=1;n<e.length;++n)if(null!==e[n]&&void 0===e[n].fe){s=!0;break}var l="void"!==e[0].name,u="",c="";for(n=0;n<a-2;++n)u+=(0!==n?", ":"")+"arg"+n,c+=(0!==n?", ":"")+"arg"+n+"Wired";t="return function "+St(t)+"("+u+") {\nif (arguments.length !== "+(a-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(a-2)+" args!');\n}\n",s&&(t+="var destructors = [];\n");var h=s?"destructors":"null";for(u="throwBindingError invoker fn runDestructors retType classParam".split(" "),r=[Et,r,i,mt,e[0],e[1]],o&&(t+="var thisWired = classParam.toWireType("+h+", this);\n"),n=0;n<a-2;++n)t+="var arg"+n+"Wired = argType"+n+".toWireType("+h+", arg"+n+"); // "+e[n+2].name+"\n",u.push("argType"+n),r.push(e[n+2]);if(o&&(c="thisWired"+(0<c.length?", ":"")+c),t+=(l?"var rv = ":"")+"invoker(fn"+(0<c.length?", ":"")+c+");\n",s)t+="runDestructors(destructors);\n";else for(n=o?1:2;n<e.length;++n)a=1===n?"thisWired":"arg"+(n-2)+"Wired",null!==e[n].fe&&(t+=a+"_dtor("+a+"); // "+e[n].name+"\n",u.push(a+"_dtor"),r.push(e[n].fe));return l&&(t+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),u.push(t+"}\n"),ae(u).apply(null,r)}function se(t,e){for(var n=[],r=0;r<t;r++)n.push(W[(e>>2)+r]);return n}var le=[],ue=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ce(t){4<t&&0==--ue[t].hf&&(ue[t]=void 0,le.push(t));}function he(t){switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=le.length?le.pop():ue.length;return ue[e]={hf:1,value:t},e}}function fe(t,e,n){switch(e){case 0:return function(t){return this.fromWireType((n?B:D)[t])};case 1:return function(t){return this.fromWireType((n?G:U)[t>>1])};case 2:return function(t){return this.fromWireType((n?W:N)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function de(t,e){var n=wt[t];return void 0===n&&Et(e+" has unknown type "+re(t)),n}function pe(t){if(null===t)return "null";var e=typeof t;return "object"===e||"array"===e||"function"===e?t.toString():""+t}function ge(t,e){switch(e){case 2:return function(t){return this.fromWireType(j[t>>2])};case 3:return function(t){return this.fromWireType(z[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function me(t,e,n){switch(e){case 0:return n?function(t){return B[t]}:function(t){return D[t]};case 1:return n?function(t){return G[t>>1]}:function(t){return U[t>>1]};case 2:return n?function(t){return W[t>>2]}:function(t){return N[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function ye(t){return t||Et("Cannot use deleted val. handle = "+t),ue[t].value}var ve={};function we(t){var e=ve[t];return void 0===e?kt(t):e}var be=[];function Se(){return "object"==typeof globalThis?globalThis:Function("return this")()}var Te,Ae={};Te=c?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var Ce=1,_e=[],Pe=[],Me=[],Fe=[],ke=[],xe=[],Ee=[],Oe=[],Re=[],Be=[],Le={},Ie={},De=4;function Ge(t){je||(je=t);}function Ue(t){for(var e=Ce++,n=t.length;n<e;n++)t[n]=null;return e}function We(t){return Ne=Oe[t],e.zg=un=Ne&&Ne.le,!(t&&!un)}var Ne,je,ze=[];function He(t,e,n,r){for(var i=0;i<t;i++){var a=un[n](),o=a&&Ue(r);a?(a.name=o,r[o]=a):Ge(1282),W[e+4*i>>2]=o;}}function Ve(t){var e=O(t)+1,n=gn(e);return E(t,D,n,e),n}function Ye(t){return 0==(t-=5120)?B:1==t?D:2==t?G:4==t?W:6==t?j:5==t||28922==t||28520==t||30779==t||30782==t?N:U}function qe(t,e,n,r,i){t=Ye(t);var a=31-Math.clz32(t.BYTES_PER_ELEMENT),o=De;return t.subarray(i>>a,i+r*(n*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1)*(1<<a)+o-1&-o)>>a)}function $e(t){var e=un.Df,n=e.Ze[t];return 0<=n&&(e.Ze[t]=n=un.getUniformLocation(e,e.uf[t]+(0<n?"["+n+"]":""))),n}var Xe,Ke=[],Qe=[],Ze={};function Je(){if(!Xe){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:f||"./this.program"};for(t in Ze)e[t]=Ze[t];var n=[];for(t in e)n.push(t+"="+e[t]);Xe=n;}return Xe}function tn(t){return 0==t%4&&(0!=t%100||0==t%400)}function en(t,e){for(var n=0,r=0;r<=e;n+=t[r++]);return n}var nn=[31,29,31,30,31,30,31,31,30,31,30,31],rn=[31,28,31,30,31,30,31,31,30,31,30,31];function an(t,e){for(t=new Date(t.getTime());0<e;){var n=t.getMonth(),r=(tn(t.getFullYear())?nn:rn)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1));}return t}function on(t,e,n,r){function i(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function a(t,e){return i(t,e,"0")}function o(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function s(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function l(t){t=an(new Date(t.ae+1900,0,1),t.Ye);var e=new Date(t.getFullYear()+1,0,4),n=s(new Date(t.getFullYear(),0,4));return e=s(e),0>=o(n,t)?0>=o(e,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var u=W[r+40>>2];for(var c in r={ug:W[r>>2],tg:W[r+4>>2],We:W[r+8>>2],Me:W[r+12>>2],Fe:W[r+16>>2],ae:W[r+20>>2],Xe:W[r+24>>2],Ye:W[r+28>>2],Fg:W[r+32>>2],sg:W[r+36>>2],vg:u?x(u):""},n=x(n),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(c,"g"),u[c]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),f="January February March April May June July August September October November December".split(" ");for(c in u={"%a":function(t){return h[t.Xe].substring(0,3)},"%A":function(t){return h[t.Xe]},"%b":function(t){return f[t.Fe].substring(0,3)},"%B":function(t){return f[t.Fe]},"%C":function(t){return a((t.ae+1900)/100|0,2)},"%d":function(t){return a(t.Me,2)},"%e":function(t){return i(t.Me,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return a(t.We,2)},"%I":function(t){return 0==(t=t.We)?t=12:12<t&&(t-=12),a(t,2)},"%j":function(t){return a(t.Me+en(tn(t.ae+1900)?nn:rn,t.Fe-1),3)},"%m":function(t){return a(t.Fe+1,2)},"%M":function(t){return a(t.tg,2)},"%n":function(){return "\n"},"%p":function(t){return 0<=t.We&&12>t.We?"AM":"PM"},"%S":function(t){return a(t.ug,2)},"%t":function(){return "\t"},"%u":function(t){return t.Xe||7},"%U":function(t){var e=new Date(t.ae+1900,0,1),n=0===e.getDay()?e:an(e,7-e.getDay());return 0>o(n,t=new Date(t.ae+1900,t.Fe,t.Me))?a(Math.ceil((31-n.getDate()+(en(tn(t.getFullYear())?nn:rn,t.getMonth()-1)-31)+t.getDate())/7),2):0===o(n,e)?"01":"00"},"%V":function(t){var e=new Date(t.ae+1901,0,4),n=s(new Date(t.ae+1900,0,4));e=s(e);var r=an(new Date(t.ae+1900,0,1),t.Ye);return 0>o(r,n)?"53":0>=o(e,r)?"01":a(Math.ceil((n.getFullYear()<t.ae+1900?t.Ye+32-n.getDate():t.Ye+1-n.getDate())/7),2)},"%w":function(t){return t.Xe},"%W":function(t){var e=new Date(t.ae,0,1),n=1===e.getDay()?e:an(e,0===e.getDay()?1:7-e.getDay()+1);return 0>o(n,t=new Date(t.ae+1900,t.Fe,t.Me))?a(Math.ceil((31-n.getDate()+(en(tn(t.getFullYear())?nn:rn,t.getMonth()-1)-31)+t.getDate())/7),2):0===o(n,e)?"01":"00"},"%y":function(t){return (t.ae+1900).toString().substring(2)},"%Y":function(t){return t.ae+1900},"%z":function(t){var e=0<=(t=t.sg);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.vg},"%%":function(){return "%"}})n.includes(c)&&(n=n.replace(new RegExp(c,"g"),u[c](r)));return c=function(t){var e=Array(O(t)+1);return E(t,e,0,e.length),e}(n),c.length>e?0:(B.set(c,t),c.length-1)}Ct=e.InternalError=At("InternalError");for(var sn=Array(256),ln=0;256>ln;++ln)sn[ln]=String.fromCharCode(ln);Ft=sn,xt=e.BindingError=At("BindingError"),Nt.prototype.isAliasOf=function(t){if(!(this instanceof Nt&&t instanceof Nt))return !1;var e=this.Ld.Xd.Sd,n=this.Ld.Rd,r=t.Ld.Xd.Sd;for(t=t.Ld.Rd;e.ie;)n=e.Ne(n),e=e.ie;for(;r.ie;)t=r.Ne(t),r=r.ie;return e===r&&n===t},Nt.prototype.clone=function(){if(this.Ld.Rd||Rt(this),this.Ld.Le)return this.Ld.count.value+=1,this;var t=Dt,e=Object,n=e.create,r=Object.getPrototypeOf(this),i=this.Ld;return (t=t(n.call(e,r,{Ld:{value:{count:i.count,De:i.De,Le:i.Le,Rd:i.Rd,Xd:i.Xd,de:i.de,ge:i.ge}}}))).Ld.count.value+=1,t.Ld.De=!1,t},Nt.prototype.delete=function(){this.Ld.Rd||Rt(this),this.Ld.De&&!this.Ld.Le&&Et("Object already scheduled for deletion"),Lt(this),It(this.Ld),this.Ld.Le||(this.Ld.de=void 0,this.Ld.Rd=void 0);},Nt.prototype.isDeleted=function(){return !this.Ld.Rd},Nt.prototype.deleteLater=function(){return this.Ld.Rd||Rt(this),this.Ld.De&&!this.Ld.Le&&Et("Object already scheduled for deletion"),Ut.push(this),1===Ut.length&&Gt&&Gt(Wt),this.Ld.De=!0,this},Jt.prototype.Mf=function(t){return this.tf&&(t=this.tf(t)),t},Jt.prototype.mf=function(t){this.ke&&this.ke(t);},Jt.prototype.argPackAdvance=8,Jt.prototype.readValueFromPointer=yt,Jt.prototype.deleteObject=function(t){null!==t&&t.delete();},Jt.prototype.fromWireType=function(t){function e(){return this.Se?Zt(this.Sd.Ee,{Xd:this.ag,Rd:n,ge:this,de:t}):Zt(this.Sd.Ee,{Xd:this,Rd:t})}var n=this.Mf(t);if(!n)return this.mf(t),null;var r=function(t,e){for(void 0===e&&Et("ptr should not be undefined");t.ie;)e=t.Ne(e),t=t.ie;return Qt[e]}(this.Sd,n);if(void 0!==r)return 0===r.Ld.count.value?(r.Ld.Rd=n,r.Ld.de=t,r.clone()):(r=r.clone(),this.mf(t),r);if(r=this.Sd.Lf(n),!(r=jt[r]))return e.call(this);r=this.Re?r.Bf:r.pointerType;var i=Kt(n,this.Sd,r.Sd);return null===i?e.call(this):this.Se?Zt(r.Sd.Ee,{Xd:r,Rd:i,ge:this,de:t}):Zt(r.Sd.Ee,{Xd:r,Rd:i})},e.getInheritedInstanceCount=function(){return Object.keys(Qt).length},e.getLiveInheritedInstances=function(){var t,e=[];for(t in Qt)Qt.hasOwnProperty(t)&&e.push(Qt[t]);return e},e.flushPendingDeletes=Wt,e.setDelayFunction=function(t){Gt=t,Ut.length&&Gt&&Gt(Wt);},ne=e.UnboundTypeError=At("UnboundTypeError"),e.count_emval_handles=function(){for(var t=0,e=5;e<ue.length;++e)void 0!==ue[e]&&++t;return t},e.get_first_emval=function(){for(var t=5;t<ue.length;++t)if(void 0!==ue[t])return ue[t];return null};for(var un,cn=0;32>cn;++cn)ze.push(Array(cn));var hn=new Float32Array(288);for(cn=0;288>cn;++cn)Ke[cn]=hn.subarray(0,cn+1);var fn=new Int32Array(288);for(cn=0;288>cn;++cn)Qe[cn]=fn.subarray(0,cn+1);var dn={Kb:function(t){return gn(t+16)+16},Eb:function(t,e,n){throw new ht(t).Tf(e,n),t},O:function(){return 0},Bb:function(){},xb:function(){return 0},yb:function(t,e,n,r,i,a){return a<<=12,0!=(16&r)&&0!=t%65536?e=-28:0!=(32&r)?(t=An(65536,e))?(pn(t,0,e),ft[t]={Zf:t,Yf:e,Af:!0,fd:i,Dg:n,flags:r,offset:a},e=t):e=-48:e=-52,e},zb:function(t,e){if(-1==(0|t)||0===e)t=-28;else {var n=ft[t];n&&e===n.Yf&&(ft[t]=null,n.Af&&mn(n.Zf)),t=0;}return t},R:function(){},Q:function(){},y:function(t){var e=gt[t];delete gt[t];var n=e.gf,r=e.ke,i=e.qf;Pt([t],i.map((function(t){return t.Qf})).concat(i.map((function(t){return t.kg}))),(function(t){var a={};return i.forEach((function(e,n){var r=t[n],o=e.Of,s=e.Pf,l=t[n+i.length],u=e.jg,c=e.lg;a[e.Hf]={read:function(t){return r.fromWireType(o(s,t))},write:function(t,e){var n=[];u(c,t,l.toWireType(n,e)),mt(n);}};})),[{name:e.name,fromWireType:function(t){var e,n={};for(e in a)n[e]=a[e].read(t);return r(t),n},toWireType:function(t,e){for(var i in a)if(!(i in e))throw new TypeError('Missing field: "'+i+'"');var o=n();for(i in a)a[i].write(o,e[i]);return null!==t&&t.push(r,o),o},argPackAdvance:8,readValueFromPointer:yt,fe:r}]}));},ob:function(){},Db:function(t,e,n,r,i){var a=Mt(n);Ot(t,{name:e=kt(e),fromWireType:function(t){return !!t},toWireType:function(t,e){return e?r:i},argPackAdvance:8,readValueFromPointer:function(t){if(1===n)var r=B;else if(2===n)r=G;else {if(4!==n)throw new TypeError("Unknown boolean type size: "+e);r=W;}return this.fromWireType(r[t>>a])},fe:null});},m:function(t,e,n,r,i,a,o,s,l,u,c,h,f){c=kt(c),a=ee(i,a),s&&(s=ee(o,s)),u&&(u=ee(l,u)),f=ee(h,f);var d=St(c);Ht(d,(function(){ie("Cannot construct "+c+" due to unbound types",[r]);})),Pt([t,e,n],r?[r]:[],(function(e){if(e=e[0],r)var n=e.Sd,i=n.Ee;else i=Nt.prototype;e=Tt(d,(function(){if(Object.getPrototypeOf(this)!==o)throw new xt("Use 'new' to construct "+c);if(void 0===l.ne)throw new xt(c+" has no accessible constructor");var t=l.ne[arguments.length];if(void 0===t)throw new xt("Tried to invoke ctor of "+c+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(l.ne).toString()+") parameters instead!");return t.apply(this,arguments)}));var o=Object.create(i,{constructor:{value:e}});e.prototype=o;var l=new Vt(c,e,o,f,n,a,s,u);n=new Jt(c,l,!0,!1,!1),i=new Jt(c+"*",l,!1,!1,!1);var h=new Jt(c+" const*",l,!1,!0,!1);return jt[t]={pointerType:i,Bf:h},te(d,e),[n,i,h]}));},f:function(t,e,n,r,i,a,o){var s=se(n,r);e=kt(e),a=ee(i,a),Pt([],[t],(function(t){function r(){ie("Cannot call "+i+" due to unbound types",s);}var i=(t=t[0]).name+"."+e,l=t.Sd.constructor;return void 0===l[e]?(r.Be=n-1,l[e]=r):(zt(l,e,i),l[e].Zd[n-1]=r),Pt([],s,(function(t){return t=[t[0],null].concat(t.slice(1)),t=oe(i,t,null,a,o),void 0===l[e].Zd?(t.Be=n-1,l[e]=t):l[e].Zd[n-1]=t,[]})),[]}));},v:function(t,e,n,r,i,a){M(0<e);var o=se(e,n);i=ee(r,i);var s=[a],l=[];Pt([],[t],(function(t){var n="constructor "+(t=t[0]).name;if(void 0===t.Sd.ne&&(t.Sd.ne=[]),void 0!==t.Sd.ne[e-1])throw new xt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.Sd.ne[e-1]=function(){ie("Cannot construct "+t.name+" due to unbound types",o);},Pt([],o,(function(r){return t.Sd.ne[e-1]=function(){arguments.length!==e-1&&Et(n+" called with "+arguments.length+" arguments, expected "+(e-1)),l.length=0,s.length=e;for(var t=1;t<e;++t)s[t]=r[t].toWireType(l,arguments[t-1]);return t=i.apply(null,s),mt(l),r[0].fromWireType(t)},[]})),[]}));},c:function(t,e,n,r,i,a,o,s){var l=se(n,r);e=kt(e),a=ee(i,a),Pt([],[t],(function(t){function r(){ie("Cannot call "+i+" due to unbound types",l);}var i=(t=t[0]).name+"."+e;s&&t.Sd.bg.push(e);var u=t.Sd.Ee,c=u[e];return void 0===c||void 0===c.Zd&&c.className!==t.name&&c.Be===n-2?(r.Be=n-2,r.className=t.name,u[e]=r):(zt(u,e,i),u[e].Zd[n-2]=r),Pt([],l,(function(r){return r=oe(i,r,t,a,o),void 0===u[e].Zd?(r.Be=n-2,u[e]=r):u[e].Zd[n-2]=r,[]})),[]}));},X:function(t,n,r){t=kt(t),Pt([],[n],(function(n){return n=n[0],e[t]=n.fromWireType(r),[]}));},Cb:function(t,e){Ot(t,{name:e=kt(e),fromWireType:function(t){var e=ue[t].value;return ce(t),e},toWireType:function(t,e){return he(e)},argPackAdvance:8,readValueFromPointer:yt,fe:null});},k:function(t,e,n,r){function i(){}n=Mt(n),e=kt(e),i.values={},Ot(t,{name:e,constructor:i,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,e){return e.value},argPackAdvance:8,readValueFromPointer:fe(e,n,r),fe:null}),Ht(e,i);},j:function(t,e,n){var r=de(t,"enum");e=kt(e),t=r.constructor,r=Object.create(r.constructor.prototype,{value:{value:n},constructor:{value:Tt(r.name+"_"+e,(function(){}))}}),t.values[n]=r,t[e]=r;},S:function(t,e,n){n=Mt(n),Ot(t,{name:e=kt(e),fromWireType:function(t){return t},toWireType:function(t,e){if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+pe(e)+'" to '+this.name);return e},argPackAdvance:8,readValueFromPointer:ge(e,n),fe:null});},t:function(t,e,n,r,i,a){var o=se(e,n);t=kt(t),i=ee(r,i),Ht(t,(function(){ie("Cannot call "+t+" due to unbound types",o);}),e-1),Pt([],o,(function(n){return n=[n[0],null].concat(n.slice(1)),te(t,oe(t,n,null,i,a),e-1),[]}));},x:function(t,e,n,r,i){function a(t){return t}e=kt(e),-1===i&&(i=4294967295);var o=Mt(n);if(0===r){var s=32-8*n;a=function(t){return t<<s>>>s};}var l=e.includes("unsigned");Ot(t,{name:e,fromWireType:a,toWireType:function(t,n){if("number"!=typeof n&&"boolean"!=typeof n)throw new TypeError('Cannot convert "'+pe(n)+'" to '+this.name);if(n<r||n>i)throw new TypeError('Passing a number "'+pe(n)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+r+", "+i+"]!");return l?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:me(e,o,0!==r),fe:null});},u:function(t,e,n){function r(t){var e=N;return new i(R,e[1+(t>>=2)],e[t])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];Ot(t,{name:n=kt(n),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{Sf:!0});},p:function(t,e,n,r,i,a,o,s,l,u,c,h){n=kt(n),a=ee(i,a),s=ee(o,s),u=ee(l,u),h=ee(c,h),Pt([t],[e],(function(t){return t=t[0],[new Jt(n,t.Sd,!1,!1,!0,t,r,a,s,u,h)]}));},T:function(t,e){var n="std::string"===(e=kt(e));Ot(t,{name:e,fromWireType:function(t){var e=N[t>>2];if(n)for(var r=t+4,i=0;i<=e;++i){var a=t+4+i;if(i==e||0==D[a]){if(r=x(r,a-r),void 0===o)var o=r;else o+=String.fromCharCode(0),o+=r;r=a+1;}}else {for(o=Array(e),i=0;i<e;++i)o[i]=String.fromCharCode(D[t+4+i]);o=o.join("");}return mn(t),o},toWireType:function(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"==typeof e;r||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||Et("Cannot pass non-string to std::string");var i=(n&&r?function(){return O(e)}:function(){return e.length})(),a=gn(4+i+1);if(N[a>>2]=i,n&&r)E(e,D,a+4,i+1);else if(r)for(r=0;r<i;++r){var o=e.charCodeAt(r);255<o&&(mn(a),Et("String has UTF-16 code units that do not fit in 8 bits")),D[a+4+r]=o;}else for(r=0;r<i;++r)D[a+4+r]=e[r];return null!==t&&t.push(mn,a),a},argPackAdvance:8,readValueFromPointer:yt,fe:function(t){mn(t);}});},I:function(t,e,n){if(n=kt(n),2===e)var r=V,i=Y,a=q,o=function(){return U},s=1;else 4===e&&(r=$,i=X,a=K,o=function(){return N},s=2);Ot(t,{name:n,fromWireType:function(t){for(var n,i=N[t>>2],a=o(),l=t+4,u=0;u<=i;++u){var c=t+4+u*e;u!=i&&0!=a[c>>s]||(l=r(l,c-l),void 0===n?n=l:(n+=String.fromCharCode(0),n+=l),l=c+e);}return mn(t),n},toWireType:function(t,r){"string"!=typeof r&&Et("Cannot pass non-string to C++ string type "+n);var o=a(r),l=gn(4+o+e);return N[l>>2]=o>>s,i(r,l+4,o+e),null!==t&&t.push(mn,l),l},argPackAdvance:8,readValueFromPointer:yt,fe:function(t){mn(t);}});},z:function(t,e,n,r,i,a){gt[t]={name:kt(e),gf:ee(n,r),ke:ee(i,a),qf:[]};},h:function(t,e,n,r,i,a,o,s,l,u){gt[t].qf.push({Hf:kt(e),Qf:n,Of:ee(r,i),Pf:a,kg:o,jg:ee(s,l),lg:u});},Fb:function(t,e){Ot(t,{Vf:!0,name:e=kt(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}});},B:function(t,e,n){t=ye(t),e=de(e,"emval::as");var r=[],i=he(r);return W[n>>2]=i,e.toWireType(r,t)},M:function(t,e,n,r,i){t=be[t],e=ye(e),n=we(n);var a=[];return W[r>>2]=he(a),t(e,n,a,i)},C:function(t,e,n,r){(t=be[t])(e=ye(e),n=we(n),null,r);},E:ce,Ab:function(t){return 0===t?he(Se()):(t=we(t),he(Se()[t]))},A:function(t,e){e=function(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=de(W[(e>>2)+r],"parameter "+r);return n}(t,e);for(var n=e[0],r=n.name+"_$"+e.slice(1).map((function(t){return t.name})).join("_")+"$",i=["retType"],a=[n],o="",s=0;s<t-1;++s)o+=(0!==s?", ":"")+"arg"+s,i.push("argType"+s),a.push(e[1+s]);r="return function "+St("methodCaller_"+r)+"(handle, name, destructors, args) {\n";var l=0;for(s=0;s<t-1;++s)r+=" var arg"+s+" = argType"+s+".readValueFromPointer(args"+(l?"+"+l:"")+");\n",l+=e[s+1].argPackAdvance;for(r+=" var rv = handle[name]("+o+");\n",s=0;s<t-1;++s)e[s+1].deleteObject&&(r+=" argType"+s+".deleteObject(arg"+s+");\n");return n.Vf||(r+=" return retType.toWireType(destructors, rv);\n"),i.push(r+"};\n"),function(t){var e=be.length;return be.push(t),e}(t=ae(i).apply(null,a))},K:function(t,e){return he((t=ye(t))[e=ye(e)])},G:function(t){4<t&&(ue[t].hf+=1);},sb:function(t,n,r,i){t=ye(t);var a=Ae[n];if(!a){a="";for(var o=0;o<n;++o)a+=(0!==o?", ":"")+"arg"+o;var s="return function emval_allocator_"+n+"(constructor, argTypes, args) {\n";for(o=0;o<n;++o)s+="var argType"+o+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+o+'], "parameter '+o+'");\nvar arg'+o+" = argType"+o+".readValueFromPointer(args);\nargs += argType"+o+"['argPackAdvance'];\n";a=new Function("requireRegisteredType","Module","__emval_register",s+"var obj = new constructor("+a+");\nreturn __emval_register(obj);\n}\n")(de,e,he),Ae[n]=a;}return a(t,r,i)},ib:function(){return he([])},Ma:function(t){return he(we(t))},jb:function(){return he({})},hb:function(t){return !(t=ye(t))},lb:function(t){mt(ue[t].value),ce(t);},w:function(t,e,n){t=ye(t),e=ye(e),n=ye(n),t[e]=n;},s:function(t,e){return he(t=(t=de(t,"_emval_take_value")).readValueFromPointer(e))},d:function(){at();},qb:function(t,e){if(0===t)t=Date.now();else {if(1!==t&&4!==t)return W[yn()>>2]=28,-1;t=Te();}return W[e>>2]=t/1e3|0,W[e+4>>2]=t%1e3*1e6|0,0},Zc:function(t){un.activeTexture(t);},_c:function(t,e){un.attachShader(Pe[t],xe[e]);},$c:function(t,e,n){un.bindAttribLocation(Pe[t],e,x(n));},_:function(t,e){35051==t?un.ef=e:35052==t&&(un.Ce=e),un.bindBuffer(t,_e[e]);},Z:function(t,e){un.bindFramebuffer(t,Me[e]);},bc:function(t,e){un.bindRenderbuffer(t,Fe[e]);},Pb:function(t,e){un.bindSampler(t,Re[e]);},$:function(t,e){un.bindTexture(t,ke[e]);},vc:function(t){un.bindVertexArray(Ee[t]);},yc:function(t){un.bindVertexArray(Ee[t]);},aa:function(t,e,n,r){un.blendColor(t,e,n,r);},ba:function(t){un.blendEquation(t);},ca:function(t,e){un.blendFunc(t,e);},Wb:function(t,e,n,r,i,a,o,s,l,u){un.blitFramebuffer(t,e,n,r,i,a,o,s,l,u);},da:function(t,e,n,r){2<=Ne.version?n?un.bufferData(t,D,r,n,e):un.bufferData(t,e,r):un.bufferData(t,n?D.subarray(n,n+e):e,r);},ea:function(t,e,n,r){2<=Ne.version?un.bufferSubData(t,e,D,r,n):un.bufferSubData(t,e,D.subarray(r,r+n));},cc:function(t){return un.checkFramebufferStatus(t)},L:function(t){un.clear(t);},Y:function(t,e,n,r){un.clearColor(t,e,n,r);},P:function(t){un.clearStencil(t);},fb:function(t,e,n,r){return un.clientWaitSync(Be[t],e,(n>>>0)+4294967296*r)},fa:function(t,e,n,r){un.colorMask(!!t,!!e,!!n,!!r);},ga:function(t){un.compileShader(xe[t]);},ha:function(t,e,n,r,i,a,o,s){2<=Ne.version?un.Ce?un.compressedTexImage2D(t,e,n,r,i,a,o,s):un.compressedTexImage2D(t,e,n,r,i,a,D,s,o):un.compressedTexImage2D(t,e,n,r,i,a,s?D.subarray(s,s+o):null);},ia:function(t,e,n,r,i,a,o,s,l){2<=Ne.version?un.Ce?un.compressedTexSubImage2D(t,e,n,r,i,a,o,s,l):un.compressedTexSubImage2D(t,e,n,r,i,a,o,D,l,s):un.compressedTexSubImage2D(t,e,n,r,i,a,o,l?D.subarray(l,l+s):null);},ja:function(t,e,n,r,i,a,o,s){un.copyTexSubImage2D(t,e,n,r,i,a,o,s);},ka:function(){var t=Ue(Pe),e=un.createProgram();return e.name=t,e.Ve=e.Te=e.Ue=0,e.jf=1,Pe[t]=e,t},la:function(t){var e=Ue(xe);return xe[e]=un.createShader(t),e},ma:function(t){un.cullFace(t);},na:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2],i=_e[r];i&&(un.deleteBuffer(i),i.name=0,_e[r]=null,r==un.ef&&(un.ef=0),r==un.Ce&&(un.Ce=0));}},dc:function(t,e){for(var n=0;n<t;++n){var r=W[e+4*n>>2],i=Me[r];i&&(un.deleteFramebuffer(i),i.name=0,Me[r]=null);}},oa:function(t){if(t){var e=Pe[t];e?(un.deleteProgram(e),e.name=0,Pe[t]=null):Ge(1281);}},ec:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2],i=Fe[r];i&&(un.deleteRenderbuffer(i),i.name=0,Fe[r]=null);}},Qb:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2],i=Re[r];i&&(un.deleteSampler(i),i.name=0,Re[r]=null);}},pa:function(t){if(t){var e=xe[t];e?(un.deleteShader(e),xe[t]=null):Ge(1281);}},Yb:function(t){if(t){var e=Be[t];e?(un.deleteSync(e),e.name=0,Be[t]=null):Ge(1281);}},qa:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2],i=ke[r];i&&(un.deleteTexture(i),i.name=0,ke[r]=null);}},wc:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2];un.deleteVertexArray(Ee[r]),Ee[r]=null;}},zc:function(t,e){for(var n=0;n<t;n++){var r=W[e+4*n>>2];un.deleteVertexArray(Ee[r]),Ee[r]=null;}},ra:function(t){un.depthMask(!!t);},sa:function(t){un.disable(t);},ta:function(t){un.disableVertexAttribArray(t);},ua:function(t,e,n){un.drawArrays(t,e,n);},tc:function(t,e,n,r){un.drawArraysInstanced(t,e,n,r);},rc:function(t,e,n,r,i){un.nf.drawArraysInstancedBaseInstanceWEBGL(t,e,n,r,i);},pc:function(t,e){for(var n=ze[t],r=0;r<t;r++)n[r]=W[e+4*r>>2];un.drawBuffers(n);},va:function(t,e,n,r){un.drawElements(t,e,n,r);},uc:function(t,e,n,r,i){un.drawElementsInstanced(t,e,n,r,i);},sc:function(t,e,n,r,i,a,o){un.nf.drawElementsInstancedBaseVertexBaseInstanceWEBGL(t,e,n,r,i,a,o);},jc:function(t,e,n,r,i,a){un.drawElements(t,r,i,a);},wa:function(t){un.enable(t);},xa:function(t){un.enableVertexAttribArray(t);},Ub:function(t,e){return (t=un.fenceSync(t,e))?(e=Ue(Be),t.name=e,Be[e]=t,e):0},ya:function(){un.finish();},za:function(){un.flush();},fc:function(t,e,n,r){un.framebufferRenderbuffer(t,e,n,Fe[r]);},gc:function(t,e,n,r,i){un.framebufferTexture2D(t,e,n,ke[r],i);},Aa:function(t){un.frontFace(t);},Ba:function(t,e){He(t,e,"createBuffer",_e);},hc:function(t,e){He(t,e,"createFramebuffer",Me);},ic:function(t,e){He(t,e,"createRenderbuffer",Fe);},Rb:function(t,e){He(t,e,"createSampler",Re);},Ca:function(t,e){He(t,e,"createTexture",ke);},xc:function(t,e){He(t,e,"createVertexArray",Ee);},Ac:function(t,e){He(t,e,"createVertexArray",Ee);},Zb:function(t){un.generateMipmap(t);},Da:function(t,e,n){n?W[n>>2]=un.getBufferParameter(t,e):Ge(1281);},Ea:function(){var t=un.getError()||je;return je=0,t},_b:function(t,e,n,r){((t=un.getFramebufferAttachmentParameter(t,e,n))instanceof WebGLRenderbuffer||t instanceof WebGLTexture)&&(t=0|t.name),W[r>>2]=t;},F:function(t,e){!function(t,e){if(e){var n=void 0;switch(t){case 36346:n=1;break;case 36344:return;case 34814:case 36345:n=0;break;case 34466:var r=un.getParameter(34467);n=r?r.length:0;break;case 33309:if(2>Ne.version)return void Ge(1282);n=2*(un.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(2>Ne.version)return void Ge(1280);n=33307==t?3:0;}if(void 0===n)switch(r=un.getParameter(t),typeof r){case"number":n=r;break;case"boolean":n=r?1:0;break;case"string":return void Ge(1280);case"object":if(null===r)switch(t){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void Ge(1280)}else {if(r instanceof Float32Array||r instanceof Uint32Array||r instanceof Int32Array||r instanceof Array){for(t=0;t<r.length;++t)W[e+4*t>>2]=r[t];return}try{n=0|r.name;}catch(e){return Ge(1280),void S("GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter("+t+")! (error: "+e+")")}}break;default:return Ge(1280),void S("GL_INVALID_ENUM in glGet0v: Native code calling glGet0v("+t+") and it returns "+r+" of type "+typeof r+"!")}W[e>>2]=n;}else Ge(1281);}(t,e);},Fa:function(t,e,n,r){null===(t=un.getProgramInfoLog(Pe[t]))&&(t="(unknown error)"),e=0<e&&r?E(t,D,r,e):0,n&&(W[n>>2]=e);},Ga:function(t,e,n){if(n)if(t>=Ce)Ge(1281);else if(t=Pe[t],35716==e)null===(t=un.getProgramInfoLog(t))&&(t="(unknown error)"),W[n>>2]=t.length+1;else if(35719==e){if(!t.Ve)for(e=0;e<un.getProgramParameter(t,35718);++e)t.Ve=Math.max(t.Ve,un.getActiveUniform(t,e).name.length+1);W[n>>2]=t.Ve;}else if(35722==e){if(!t.Te)for(e=0;e<un.getProgramParameter(t,35721);++e)t.Te=Math.max(t.Te,un.getActiveAttrib(t,e).name.length+1);W[n>>2]=t.Te;}else if(35381==e){if(!t.Ue)for(e=0;e<un.getProgramParameter(t,35382);++e)t.Ue=Math.max(t.Ue,un.getActiveUniformBlockName(t,e).length+1);W[n>>2]=t.Ue;}else W[n>>2]=un.getProgramParameter(t,e);else Ge(1281);},$b:function(t,e,n){n?W[n>>2]=un.getRenderbufferParameter(t,e):Ge(1281);},Ha:function(t,e,n,r){null===(t=un.getShaderInfoLog(xe[t]))&&(t="(unknown error)"),e=0<e&&r?E(t,D,r,e):0,n&&(W[n>>2]=e);},Mb:function(t,e,n,r){t=un.getShaderPrecisionFormat(t,e),W[n>>2]=t.rangeMin,W[n+4>>2]=t.rangeMax,W[r>>2]=t.precision;},Ia:function(t,e,n){n?35716==e?(null===(t=un.getShaderInfoLog(xe[t]))&&(t="(unknown error)"),W[n>>2]=t?t.length+1:0):35720==e?(t=un.getShaderSource(xe[t]),W[n>>2]=t?t.length+1:0):W[n>>2]=un.getShaderParameter(xe[t],e):Ge(1281);},J:function(t){var e=Le[t];if(!e){switch(t){case 7939:e=Ve((e=(e=un.getSupportedExtensions()||[]).concat(e.map((function(t){return "GL_"+t})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:(e=un.getParameter(t))||Ge(1280),e=e&&Ve(e);break;case 7938:e=un.getParameter(7938),e=Ve(e=2<=Ne.version?"OpenGL ES 3.0 ("+e+")":"OpenGL ES 2.0 ("+e+")");break;case 35724:var n=(e=un.getParameter(35724)).match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==n&&(3==n[1].length&&(n[1]+="0"),e="OpenGL ES GLSL ES "+n[1]+" ("+e+")"),e=Ve(e);break;default:Ge(1280);}Le[t]=e;}return e},eb:function(t,e){if(2>Ne.version)return Ge(1282),0;var n=Ie[t];return n?0>e||e>=n.length?(Ge(1281),0):n[e]:7939===t?(n=(n=(n=un.getSupportedExtensions()||[]).concat(n.map((function(t){return "GL_"+t})))).map((function(t){return Ve(t)})),n=Ie[t]=n,0>e||e>=n.length?(Ge(1281),0):n[e]):(Ge(1280),0)},Ja:function(t,e){function n(t){return "]"==t.slice(-1)&&t.lastIndexOf("[")}e=x(e);var r,i=(t=Pe[t]).Ze,a=t.wg,o=0,s=e,l=n(e);if(!i)for(t.Ze=i={},t.uf={},r=0;r<un.getProgramParameter(t,35718);++r){var u=un.getActiveUniform(t,r),c=u.name;u=u.size;var h=n(c);h=0<h?c.slice(0,h):c;var f=t.jf;for(t.jf+=u,a[h]=[u,f],c=0;c<u;++c)i[f]=c,t.uf[f++]=h;}return 0<l&&(o=parseInt(e.slice(l+1))>>>0,s=e.slice(0,l)),(a=a[s])&&o<a[0]&&(i[o+=a[1]]=i[o]||un.getUniformLocation(t,e))?o:-1},Nb:function(t,e,n){for(var r=ze[e],i=0;i<e;i++)r[i]=W[n+4*i>>2];un.invalidateFramebuffer(t,r);},Ob:function(t,e,n,r,i,a,o){for(var s=ze[e],l=0;l<e;l++)s[l]=W[n+4*l>>2];un.invalidateSubFramebuffer(t,s,r,i,a,o);},Vb:function(t){return un.isSync(Be[t])},Ka:function(t){return (t=ke[t])?un.isTexture(t):0},La:function(t){un.lineWidth(t);},Na:function(t){t=Pe[t],un.linkProgram(t),t.Ze=0,t.wg={};},nc:function(t,e,n,r,i,a){un.sf.multiDrawArraysInstancedBaseInstanceWEBGL(t,W,e>>2,W,n>>2,W,r>>2,N,i>>2,a);},oc:function(t,e,n,r,i,a,o,s){un.sf.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(t,W,e>>2,n,W,r>>2,W,i>>2,W,a>>2,N,o>>2,s);},Oa:function(t,e){3317==t&&(De=e),un.pixelStorei(t,e);},qc:function(t){un.readBuffer(t);},Pa:function(t,e,n,r,i,a,o){if(2<=Ne.version)if(un.ef)un.readPixels(t,e,n,r,i,a,o);else {var s=Ye(a);un.readPixels(t,e,n,r,i,a,s,o>>31-Math.clz32(s.BYTES_PER_ELEMENT));}else (o=qe(a,i,n,r,o))?un.readPixels(t,e,n,r,i,a,o):Ge(1280);},ac:function(t,e,n,r){un.renderbufferStorage(t,e,n,r);},Xb:function(t,e,n,r,i){un.renderbufferStorageMultisample(t,e,n,r,i);},Sb:function(t,e,n){un.samplerParameteri(Re[t],e,n);},Tb:function(t,e,n){un.samplerParameteri(Re[t],e,W[n>>2]);},Qa:function(t,e,n,r){un.scissor(t,e,n,r);},Ra:function(t,e,n,r){for(var i="",a=0;a<e;++a){var o=r?W[r+4*a>>2]:-1;i+=x(W[n+4*a>>2],0>o?void 0:o);}un.shaderSource(xe[t],i);},Sa:function(t,e,n){un.stencilFunc(t,e,n);},Ta:function(t,e,n,r){un.stencilFuncSeparate(t,e,n,r);},Ua:function(t){un.stencilMask(t);},Va:function(t,e){un.stencilMaskSeparate(t,e);},Wa:function(t,e,n){un.stencilOp(t,e,n);},Xa:function(t,e,n,r){un.stencilOpSeparate(t,e,n,r);},Ya:function(t,e,n,r,i,a,o,s,l){if(2<=Ne.version)if(un.Ce)un.texImage2D(t,e,n,r,i,a,o,s,l);else if(l){var u=Ye(s);un.texImage2D(t,e,n,r,i,a,o,s,u,l>>31-Math.clz32(u.BYTES_PER_ELEMENT));}else un.texImage2D(t,e,n,r,i,a,o,s,null);else un.texImage2D(t,e,n,r,i,a,o,s,l?qe(s,o,r,i,l):null);},Za:function(t,e,n){un.texParameterf(t,e,n);},_a:function(t,e,n){un.texParameterf(t,e,j[n>>2]);},$a:function(t,e,n){un.texParameteri(t,e,n);},ab:function(t,e,n){un.texParameteri(t,e,W[n>>2]);},kc:function(t,e,n,r,i){un.texStorage2D(t,e,n,r,i);},bb:function(t,e,n,r,i,a,o,s,l){if(2<=Ne.version)if(un.Ce)un.texSubImage2D(t,e,n,r,i,a,o,s,l);else if(l){var u=Ye(s);un.texSubImage2D(t,e,n,r,i,a,o,s,u,l>>31-Math.clz32(u.BYTES_PER_ELEMENT));}else un.texSubImage2D(t,e,n,r,i,a,o,s,null);else u=null,l&&(u=qe(s,o,i,a,l)),un.texSubImage2D(t,e,n,r,i,a,o,s,u);},cb:function(t,e){un.uniform1f($e(t),e);},db:function(t,e,n){if(2<=Ne.version)un.uniform1fv($e(t),j,n>>2,e);else {if(288>=e)for(var r=Ke[e-1],i=0;i<e;++i)r[i]=j[n+4*i>>2];else r=j.subarray(n>>2,n+4*e>>2);un.uniform1fv($e(t),r);}},Vc:function(t,e){un.uniform1i($e(t),e);},Wc:function(t,e,n){if(2<=Ne.version)un.uniform1iv($e(t),W,n>>2,e);else {if(288>=e)for(var r=Qe[e-1],i=0;i<e;++i)r[i]=W[n+4*i>>2];else r=W.subarray(n>>2,n+4*e>>2);un.uniform1iv($e(t),r);}},Xc:function(t,e,n){un.uniform2f($e(t),e,n);},Yc:function(t,e,n){if(2<=Ne.version)un.uniform2fv($e(t),j,n>>2,2*e);else {if(144>=e)for(var r=Ke[2*e-1],i=0;i<2*e;i+=2)r[i]=j[n+4*i>>2],r[i+1]=j[n+(4*i+4)>>2];else r=j.subarray(n>>2,n+8*e>>2);un.uniform2fv($e(t),r);}},Uc:function(t,e,n){un.uniform2i($e(t),e,n);},Tc:function(t,e,n){if(2<=Ne.version)un.uniform2iv($e(t),W,n>>2,2*e);else {if(144>=e)for(var r=Qe[2*e-1],i=0;i<2*e;i+=2)r[i]=W[n+4*i>>2],r[i+1]=W[n+(4*i+4)>>2];else r=W.subarray(n>>2,n+8*e>>2);un.uniform2iv($e(t),r);}},Sc:function(t,e,n,r){un.uniform3f($e(t),e,n,r);},Rc:function(t,e,n){if(2<=Ne.version)un.uniform3fv($e(t),j,n>>2,3*e);else {if(96>=e)for(var r=Ke[3*e-1],i=0;i<3*e;i+=3)r[i]=j[n+4*i>>2],r[i+1]=j[n+(4*i+4)>>2],r[i+2]=j[n+(4*i+8)>>2];else r=j.subarray(n>>2,n+12*e>>2);un.uniform3fv($e(t),r);}},Qc:function(t,e,n,r){un.uniform3i($e(t),e,n,r);},Pc:function(t,e,n){if(2<=Ne.version)un.uniform3iv($e(t),W,n>>2,3*e);else {if(96>=e)for(var r=Qe[3*e-1],i=0;i<3*e;i+=3)r[i]=W[n+4*i>>2],r[i+1]=W[n+(4*i+4)>>2],r[i+2]=W[n+(4*i+8)>>2];else r=W.subarray(n>>2,n+12*e>>2);un.uniform3iv($e(t),r);}},Oc:function(t,e,n,r,i){un.uniform4f($e(t),e,n,r,i);},Nc:function(t,e,n){if(2<=Ne.version)un.uniform4fv($e(t),j,n>>2,4*e);else {if(72>=e){var r=Ke[4*e-1],i=j;n>>=2;for(var a=0;a<4*e;a+=4){var o=n+a;r[a]=i[o],r[a+1]=i[o+1],r[a+2]=i[o+2],r[a+3]=i[o+3];}}else r=j.subarray(n>>2,n+16*e>>2);un.uniform4fv($e(t),r);}},Bc:function(t,e,n,r,i){un.uniform4i($e(t),e,n,r,i);},Cc:function(t,e,n){if(2<=Ne.version)un.uniform4iv($e(t),W,n>>2,4*e);else {if(72>=e)for(var r=Qe[4*e-1],i=0;i<4*e;i+=4)r[i]=W[n+4*i>>2],r[i+1]=W[n+(4*i+4)>>2],r[i+2]=W[n+(4*i+8)>>2],r[i+3]=W[n+(4*i+12)>>2];else r=W.subarray(n>>2,n+16*e>>2);un.uniform4iv($e(t),r);}},Dc:function(t,e,n,r){if(2<=Ne.version)un.uniformMatrix2fv($e(t),!!n,j,r>>2,4*e);else {if(72>=e)for(var i=Ke[4*e-1],a=0;a<4*e;a+=4)i[a]=j[r+4*a>>2],i[a+1]=j[r+(4*a+4)>>2],i[a+2]=j[r+(4*a+8)>>2],i[a+3]=j[r+(4*a+12)>>2];else i=j.subarray(r>>2,r+16*e>>2);un.uniformMatrix2fv($e(t),!!n,i);}},Ec:function(t,e,n,r){if(2<=Ne.version)un.uniformMatrix3fv($e(t),!!n,j,r>>2,9*e);else {if(32>=e)for(var i=Ke[9*e-1],a=0;a<9*e;a+=9)i[a]=j[r+4*a>>2],i[a+1]=j[r+(4*a+4)>>2],i[a+2]=j[r+(4*a+8)>>2],i[a+3]=j[r+(4*a+12)>>2],i[a+4]=j[r+(4*a+16)>>2],i[a+5]=j[r+(4*a+20)>>2],i[a+6]=j[r+(4*a+24)>>2],i[a+7]=j[r+(4*a+28)>>2],i[a+8]=j[r+(4*a+32)>>2];else i=j.subarray(r>>2,r+36*e>>2);un.uniformMatrix3fv($e(t),!!n,i);}},Fc:function(t,e,n,r){if(2<=Ne.version)un.uniformMatrix4fv($e(t),!!n,j,r>>2,16*e);else {if(18>=e){var i=Ke[16*e-1],a=j;r>>=2;for(var o=0;o<16*e;o+=16){var s=r+o;i[o]=a[s],i[o+1]=a[s+1],i[o+2]=a[s+2],i[o+3]=a[s+3],i[o+4]=a[s+4],i[o+5]=a[s+5],i[o+6]=a[s+6],i[o+7]=a[s+7],i[o+8]=a[s+8],i[o+9]=a[s+9],i[o+10]=a[s+10],i[o+11]=a[s+11],i[o+12]=a[s+12],i[o+13]=a[s+13],i[o+14]=a[s+14],i[o+15]=a[s+15];}}else i=j.subarray(r>>2,r+64*e>>2);un.uniformMatrix4fv($e(t),!!n,i);}},Gc:function(t){t=Pe[t],un.useProgram(t),un.Df=t;},Hc:function(t,e){un.vertexAttrib1f(t,e);},Ic:function(t,e){un.vertexAttrib2f(t,j[e>>2],j[e+4>>2]);},Jc:function(t,e){un.vertexAttrib3f(t,j[e>>2],j[e+4>>2],j[e+8>>2]);},Kc:function(t,e){un.vertexAttrib4f(t,j[e>>2],j[e+4>>2],j[e+8>>2],j[e+12>>2]);},lc:function(t,e){un.vertexAttribDivisor(t,e);},mc:function(t,e,n,r,i){un.vertexAttribIPointer(t,e,n,r,i);},Lc:function(t,e,n,r,i,a){un.vertexAttribPointer(t,e,n,!!r,i,a);},Mc:function(t,e,n,r){un.viewport(t,e,n,r);},gb:function(t,e,n,r){un.waitSync(Be[t],e,(n>>>0)+4294967296*r);},e:function(t,e){throw Tn(t,e||1),"longjmp"},pb:function(t){var e=D.length;if(2147483648<(t>>>=0))return !1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296),0<(r=Math.max(t,r))%65536&&(r+=65536-r%65536);t:{try{_.grow(Math.min(2147483648,r)-R.byteLength+65535>>>16),Q();var i=1;break t}catch(t){}i=void 0;}if(i)return !0}return !1},kb:function(){return Ne?Ne.Rf:0},ub:function(t,e){var n=0;return Je().forEach((function(r,i){var a=e+n;for(i=W[t+4*i>>2]=a,a=0;a<r.length;++a)B[i++>>0]=r.charCodeAt(a);B[i>>0]=0,n+=r.length+1;})),0},vb:function(t,e){var n=Je();W[t>>2]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1;})),W[e>>2]=r,0},Gb:function(t){C||(e.onExit&&e.onExit(t),P=!0),d(t,new Cn(t));},H:function(){return 0},tb:function(t,e){return t=1==t||2==t?2:at(),B[e>>0]=t,0},nb:function(t,e,n,r,i,a){return t=pt.Nf(t),e=pt.Ef(t,e,n,r),W[a>>2]=e,0},wb:function(t,e,n,r){return t=pt.Nf(t),e=pt.Ef(t,e,n),W[r>>2]=e,0},mb:function(){},N:function(t,e,n,r){for(var i=0,a=0;a<n;a++){for(var o=W[e+8*a>>2],s=W[e+(8*a+4)>>2],l=0;l<s;l++){var u=D[o+l],c=dt[t];0===u||10===u?((1===t?b:S)(k(c,0)),c.length=0):c.push(u);}i+=s;}return W[r>>2]=i,0},a:function(){return A},l:function(t,e){var n=bn();try{return Z.get(t)(e)}catch(t){if(Sn(n),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},o:function(t,e,n){var r=bn();try{return Z.get(t)(e,n)}catch(t){if(Sn(r),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},g:function(t,e,n,r){var i=bn();try{return Z.get(t)(e,n,r)}catch(t){if(Sn(i),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},D:function(t,e,n,r,i){var a=bn();try{return Z.get(t)(e,n,r,i)}catch(t){if(Sn(a),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},Lb:function(t,e,n,r,i,a){var o=bn();try{return Z.get(t)(e,n,r,i,a)}catch(t){if(Sn(o),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},W:function(t,e,n,r,i,a,o){var s=bn();try{return Z.get(t)(e,n,r,i,a,o)}catch(t){if(Sn(s),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},V:function(t,e,n,r,i,a,o,s,l,u){var c=bn();try{return Z.get(t)(e,n,r,i,a,o,s,l,u)}catch(t){if(Sn(c),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},U:function(t){var e=bn();try{Z.get(t)();}catch(t){if(Sn(e),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},n:function(t,e){var n=bn();try{Z.get(t)(e);}catch(t){if(Sn(n),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},r:function(t,e,n){var r=bn();try{Z.get(t)(e,n);}catch(t){if(Sn(r),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},i:function(t,e,n,r){var i=bn();try{Z.get(t)(e,n,r);}catch(t){if(Sn(i),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},q:function(t,e,n,r,i){var a=bn();try{Z.get(t)(e,n,r,i);}catch(t){if(Sn(a),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},Jb:function(t,e,n,r,i,a){var o=bn();try{Z.get(t)(e,n,r,i,a);}catch(t){if(Sn(o),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},Hb:function(t,e,n,r,i,a,o){var s=bn();try{Z.get(t)(e,n,r,i,a,o);}catch(t){if(Sn(s),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},Ib:function(t,e,n,r,i,a,o,s,l,u){var c=bn();try{Z.get(t)(e,n,r,i,a,o,s,l,u);}catch(t){if(Sn(c),t!==t+0&&"longjmp"!==t)throw t;Tn(1,0);}},b:function(t){A=t;},rb:function(t,e,n,r){return on(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,_=e.asm.ad,Q(),Z=e.asm.dd,tt.unshift(e.asm.bd),rt--,e.monitorRunDependencies&&e.monitorRunDependencies(rt),0==rt&&it&&(t=it,it=null,t());}function n(e){t(e.instance);}function r(t){return function(){if(!T&&(l||u)){if("function"==typeof fetch&&!st.startsWith("file://"))return fetch(st,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw "failed to load wasm binary file at '"+st+"'";return t.arrayBuffer()})).catch((function(){return ut()}));if(g)return new Promise((function(t,e){g(st,(function(e){t(new Uint8Array(e));}),e);}))}return Promise.resolve().then((function(){return ut()}))}().then((function(t){return WebAssembly.instantiate(t,a)})).then(t,(function(t){S("failed to asynchronously prepare wasm: "+t),at(t);}))}var a={a:dn};if(rt++,e.monitorRunDependencies&&e.monitorRunDependencies(rt),e.instantiateWasm)try{return e.instantiateWasm(a,t)}catch(t){return S("Module.instantiateWasm callback failed with error: "+t),!1}(T||"function"!=typeof WebAssembly.instantiateStreaming||ot()||st.startsWith("file://")||"function"!=typeof fetch?r(n):fetch(st,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,a).then(n,(function(t){return S("wasm streaming compile failed: "+t),S("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(i);}(),e.___wasm_call_ctors=function(){return (e.___wasm_call_ctors=e.asm.bd).apply(null,arguments)};var pn=e._memset=function(){return (pn=e._memset=e.asm.cd).apply(null,arguments)},gn=e._malloc=function(){return (gn=e._malloc=e.asm.ed).apply(null,arguments)},mn=e._free=function(){return (mn=e._free=e.asm.fd).apply(null,arguments)},yn=e.___errno_location=function(){return (yn=e.___errno_location=e.asm.gd).apply(null,arguments)},vn=e.___getTypeName=function(){return (vn=e.___getTypeName=e.asm.hd).apply(null,arguments)};e.___embind_register_native_and_builtin_types=function(){return (e.___embind_register_native_and_builtin_types=e.asm.id).apply(null,arguments)};var wn,bn=e.stackSave=function(){return (bn=e.stackSave=e.asm.jd).apply(null,arguments)},Sn=e.stackRestore=function(){return (Sn=e.stackRestore=e.asm.kd).apply(null,arguments)},Tn=e._setThrew=function(){return (Tn=e._setThrew=e.asm.ld).apply(null,arguments)},An=e._memalign=function(){return (An=e._memalign=e.asm.md).apply(null,arguments)};function Cn(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t;}function _n(){function t(){if(!wn&&(wn=!0,e.calledRun=!0,!P)){if(ct(tt),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();et.unshift(t);}ct(et);}}if(!(0<rt)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)nt();ct(J),0<rt||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("");}),1),t();}),1)):t());}}if(e.dynCall_iiiji=function(){return (e.dynCall_iiiji=e.asm.nd).apply(null,arguments)},e.dynCall_ji=function(){return (e.dynCall_ji=e.asm.od).apply(null,arguments)},e.dynCall_iiji=function(){return (e.dynCall_iiji=e.asm.pd).apply(null,arguments)},e.dynCall_iijjiii=function(){return (e.dynCall_iijjiii=e.asm.qd).apply(null,arguments)},e.dynCall_iij=function(){return (e.dynCall_iij=e.asm.rd).apply(null,arguments)},e.dynCall_vijjjii=function(){return (e.dynCall_vijjjii=e.asm.sd).apply(null,arguments)},e.dynCall_viji=function(){return (e.dynCall_viji=e.asm.td).apply(null,arguments)},e.dynCall_vijiii=function(){return (e.dynCall_vijiii=e.asm.ud).apply(null,arguments)},e.dynCall_viiiiij=function(){return (e.dynCall_viiiiij=e.asm.vd).apply(null,arguments)},e.dynCall_viijii=function(){return (e.dynCall_viijii=e.asm.wd).apply(null,arguments)},e.dynCall_jii=function(){return (e.dynCall_jii=e.asm.xd).apply(null,arguments)},e.dynCall_iiij=function(){return (e.dynCall_iiij=e.asm.yd).apply(null,arguments)},e.dynCall_iiiij=function(){return (e.dynCall_iiiij=e.asm.zd).apply(null,arguments)},e.dynCall_viij=function(){return (e.dynCall_viij=e.asm.Ad).apply(null,arguments)},e.dynCall_viiij=function(){return (e.dynCall_viiij=e.asm.Bd).apply(null,arguments)},e.dynCall_vij=function(){return (e.dynCall_vij=e.asm.Cd).apply(null,arguments)},e.dynCall_jiiii=function(){return (e.dynCall_jiiii=e.asm.Dd).apply(null,arguments)},e.dynCall_jiiiiii=function(){return (e.dynCall_jiiiiii=e.asm.Ed).apply(null,arguments)},e.dynCall_jiiiiji=function(){return (e.dynCall_jiiiiji=e.asm.Fd).apply(null,arguments)},e.dynCall_iijj=function(){return (e.dynCall_iijj=e.asm.Gd).apply(null,arguments)},e.dynCall_jiji=function(){return (e.dynCall_jiji=e.asm.Hd).apply(null,arguments)},e.dynCall_iiiiij=function(){return (e.dynCall_iiiiij=e.asm.Id).apply(null,arguments)},e.dynCall_iiiiijj=function(){return (e.dynCall_iiiiijj=e.asm.Jd).apply(null,arguments)},e.dynCall_iiiiiijj=function(){return (e.dynCall_iiiiiijj=e.asm.Kd).apply(null,arguments)},it=function t(){wn||_n(),wn||(it=t);},e.run=_n,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return _n(),t.ready});t.exports=r;}(B);B.exports;class G extends y{constructor(t={}){super(t),this.type=n.sprite,this.isDrawable=!0,this.anchorPoint=new g(.5,.5),this.zPosition=0,this._imageName="",m(this,t),t.imageName&&(this.imageName=t.imageName);}initialize(){}set imageName(t){if(!Object.keys(Globals.imageManager._loadedImages).includes(t))throw new Error(`an image with name ${t} has not been loaded`);this._imageName=t,this.loadedImage=Globals.imageManager._loadedImages[this.imageName],this.size.width=this.loadedImage.width,this.size.height=this.loadedImage.height;}get imageName(){return this._imageName}update(){super.update();}draw(t){if(!this.hidden){if(this.loadedImage){t.save();const e=Globals.canvasScale/this.absoluteScale;t.scale(1/e,1/e);const n=(this.absolutePosition.x-this.size.width*this.anchorPoint.x*this.absoluteScale)*e,r=(this.absolutePosition.y-this.size.height*this.anchorPoint.y*this.absoluteScale)*e;t.drawImage(this.loadedImage.image,n,r),t.restore();}super.drawChildren(t);}}}class j extends y{constructor(t={}){super(t),this.type=n.scene,this.isDrawable=!0,this.anchorPoint=new g(0,0),this.zPosition=0,this._backgroundColor=b.DEFAULT_SCENE_BACKGROUND_COLOR,this._active=!1,this._transitioning=!1,m(this,t),t.backgroundColor&&(this.backgroundColor=t.backgroundColor);}initialize(){this.scale=Globals.rootScale,this.backgroundPaint=new Globals.canvasKit.Paint,this.backgroundPaint.setColor(Globals.canvasKit.Color(this.backgroundColor[0],this.backgroundColor[1],this.backgroundColor[2],this.backgroundColor[3])),this.backgroundPaint.setStyle(Globals.canvasKit.PaintStyle.Fill);}set game(t){this._game=t;}get game(){if(void 0===this._game)throw new Error("no active game");return this._game}get backgroundColor(){return this._backgroundColor}set backgroundColor(t){this._backgroundColor=t,this.needsInitialization=!0;}setup(t){this._setupCallback=t;}draw(t){t.save();const e=Globals.canvasScale/this.absoluteScale;t.scale(1/e,1/e);const n=Globals.canvasKit.RRectXY(Globals.canvasKit.LTRBRect(this.position.x*e*Globals.rootScale,this.position.y*e*Globals.rootScale,(this.position.x+this.size.width)*e*Globals.rootScale,(this.position.y+this.size.height)*e*Globals.rootScale),0,0);t.drawRRect(n,this.backgroundPaint),t.restore(),super.drawChildren(t);}}class z{constructor(){this.duration=0;}static push(t,e){return new H(t,e)}}class H extends z{constructor(t,e){super(),this.type=V.push,this.direction=t,this.duration=e;}}var V,Y,q,$;!function(t){t.push="Push";}(V||(V={})),function(t){t.up="Up",t.down="Down",t.right="Right",t.left="Left";}(Y||(Y={}));!function(t){t[t.center=0]="center",t[t.left=1]="left",t[t.right=2]="right";}(q||(q={}));class Q extends y{constructor(t={}){super(t),this.type=n.label,this.isDrawable=!0,this.isText=!0,this.anchorPoint=new g(.5,.5),this.zPosition=0,this._text="",this._fontColor=b.DEFAULT_FONT_COLOR,this._fontSize=b.DEFAULT_FONT_SIZE,this._horizontalAlignmentMode=q.center,m(this,t),t.horizontalAlignmentMode&&(this.horizontalAlignmentMode=t.horizontalAlignmentMode),void 0!==t.preferredMaxLayoutWidth&&(this.preferredMaxLayoutWidth=t.preferredMaxLayoutWidth),t.backgroundColor&&(this.backgroundColor=t.backgroundColor);}initialize(){var t,e,n;let r=Globals.canvasKit.TextAlign.Center;switch(this.horizontalAlignmentMode){case q.center:r=Globals.canvasKit.TextAlign.Center;break;case q.left:r=Globals.canvasKit.TextAlign.Left;break;case q.right:r=Globals.canvasKit.TextAlign.Right;break;default:throw new Error("unknown horizontalAlignmentMode")}if(this.paraStyle=new Globals.canvasKit.ParagraphStyle({textStyle:{color:Globals.canvasKit.Color(this.fontColor[0],this.fontColor[1],this.fontColor[2],this.fontColor[3]),fontSize:this.fontSize*Globals.canvasScale},textAlign:r}),this.fontName&&this.paraStyle.textStyle&&(this.paraStyle.textStyle.fontFamilies=[this.fontName]),this.backgroundColor&&this.paraStyle.textStyle&&(this.paraStyle.textStyle.backgroundColor=this.backgroundColor),void 0===Globals.fontManager._fontMgr)throw new Error("no fonts loaded");const i=Globals.canvasKit.ParagraphBuilder.Make(this.paraStyle,Globals.fontManager._fontMgr);this.text||(this.text=""),i.addText(this.text),""===this.text&&console.warn(`warning: empty text in label "${this.name}"`),this.paragraph=i.build();const a=null!==(t=this.preferredMaxLayoutWidth)&&void 0!==t?t:Globals.canvasCssWidth;let o=a;if(0===a||0===this.layout.width){if(void 0===this.parent)throw new Error("width is set to match parent, but entity has no parent");const t=null!==(e=this.layout.marginStart)&&void 0!==e?e:0,r=null!==(n=this.layout.marginEnd)&&void 0!==n?n:0;o=this.parent.size.width-(t+r);}this.paragraph.layout(o*Globals.canvasScale),this.size.width=o,this.size.height=this.paragraph.getHeight()/Globals.canvasScale;}get text(){return this._text}set text(t){this._text=t,this.needsInitialization=!0;}get fontName(){return this._fontName}set fontName(t){this._fontName=t,this.needsInitialization=!0;}get fontColor(){return this._fontColor}set fontColor(t){this._fontColor=t,this.needsInitialization=!0;}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t,this.needsInitialization=!0;}get horizontalAlignmentMode(){return this._horizontalAlignmentMode}set horizontalAlignmentMode(t){this._horizontalAlignmentMode=t,this.needsInitialization=!0;}get preferredMaxLayoutWidth(){return this._preferredMaxLayoutWidth}set preferredMaxLayoutWidth(t){this._preferredMaxLayoutWidth=t,this.needsInitialization=!0;}get backgroundColor(){return this._backgroundColor}set backgroundColor(t){this._backgroundColor=t,this.needsInitialization=!0;}update(){super.update();}draw(t){if(this.parent&&""!==this.text){t.save();const e=Globals.canvasScale/this.absoluteScale;t.scale(1/e,1/e);const n=(this.absolutePosition.x-this.size.width*this.anchorPoint.x*this.absoluteScale)*e,r=(this.absolutePosition.y-this.size.height*this.anchorPoint.y*this.absoluteScale)*e;if(void 0===this.paragraph)throw new Error("no paragraph");t.drawParagraph(this.paragraph,n,r),t.restore();}super.drawChildren(t);}}class J{constructor(t){this.origin=t.origin,this.size=t.size,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height;}}!function(t){t[void 0]="Undefined",t.rectangle="Rectangle",t.circle="Circle";}($||($={}));class tt extends y{constructor(t={}){super(t),this.type=n.shape,this.isDrawable=!0,this.isShape=!0,this.anchorPoint=new g(.5,.5),this.zPosition=0,this.shapeType=$.undefined,this.cornerRadius=0,this._fillColor=b.DEFAULT_SHAPE_FILL_COLOR,m(this,t),void 0!==t.circleOfRadius&&(this.circleOfRadius=t.circleOfRadius,this.shapeType=$.circle),t.rect&&(t.rect.size?(this.size.width=t.rect.size.width,this.size.height=t.rect.size.height):void 0!==t.rect.width&&void 0!==t.rect.height&&(this.size.width=t.rect.width,this.size.height=t.rect.height),t.rect.origin?this.position=t.rect.origin:void 0!==t.rect.x&&void 0!==t.rect.y&&(this.position=new g(t.rect.x,t.rect.y)),this.shapeType=$.rectangle),t.cornerRadius&&(this.cornerRadius=t.cornerRadius),t.fillColor&&(this.fillColor=t.fillColor),t.strokeColor&&(this.strokeColor=t.strokeColor),t.lineWidth&&(this.lineWidth=t.lineWidth),t.strokeColor&&void 0===t.lineWidth&&console.warn(`warning: for entity ${this}, strokeColor = ${t.strokeColor} but lineWidth is undefined. In normal usage, both would be set or both would be undefined.`),void 0===t.strokeColor&&t.lineWidth&&console.warn(`warning: for entity ${this}, lineWidth = ${t.lineWidth} but strokeColor is undefined. In normal usage, both would be set or both would be undefined.`);}initialize(){if(this.fillColor){const t=Globals.canvasKit;this.fillColorPaint=new t.Paint,this.fillColorPaint.setColor(t.Color(this.fillColor[0],this.fillColor[1],this.fillColor[2],this.fillColor[3])),this.fillColorPaint.setStyle(t.PaintStyle.Fill),this.fillColorPaint.setAntiAlias(!0);}if(this.strokeColor){const t=Globals.canvasKit;this.strokeColorPaint=new t.Paint,this.strokeColorPaint.setColor(t.Color(this.strokeColor[0],this.strokeColor[1],this.strokeColor[2],this.strokeColor[3])),this.strokeColorPaint.setStyle(t.PaintStyle.Stroke),this.strokeColorPaint.setAntiAlias(!0);}}get fillColor(){return this._fillColor}set fillColor(t){this._fillColor=t,this.needsInitialization=!0;}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t,this.needsInitialization=!0;}update(){super.update();}draw(t){t.save();const e=Globals.canvasScale/this.absoluteScale;t.scale(1/e,1/e);const n=Globals.canvasKit;if(this.shapeType===$.circle&&void 0!==this.circleOfRadius){const n=this.absolutePosition.x*e,r=this.absolutePosition.y*e,i=this.circleOfRadius*this.absoluteScale*e;this.fillColor&&this.fillColorPaint&&t.drawCircle(n,r,i,this.fillColorPaint),this.strokeColor&&this.strokeColorPaint&&this.lineWidth&&(this.strokeColorPaint.setStrokeWidth(this.lineWidth*e),t.drawCircle(n,r,i,this.strokeColorPaint));}if(this.shapeType===$.rectangle){const r=n.RRectXY(n.LTRBRect((this.absolutePosition.x-this.anchorPoint.x*this.size.width*this.absoluteScale)*e,(this.absolutePosition.y-this.anchorPoint.y*this.size.height*this.absoluteScale)*e,(this.absolutePosition.x+this.size.width*this.absoluteScale-this.anchorPoint.x*this.size.width*this.absoluteScale)*e,(this.absolutePosition.y+this.size.height*this.absoluteScale-this.anchorPoint.y*this.size.height*this.absoluteScale)*e),this.cornerRadius*e,this.cornerRadius*e);this.fillColor&&this.fillColorPaint&&t.drawRRect(r,this.fillColorPaint),this.strokeColor&&this.strokeColorPaint&&this.lineWidth&&(this.strokeColorPaint.setStrokeWidth(this.lineWidth*e),t.drawRRect(r,this.strokeColorPaint));}t.restore(),super.drawChildren(t);}}class et{static Create(t){return new Array}}new Array;
|
|
2
|
-
|
|
3
|
-
class Grid extends v {
|
|
4
|
-
constructor(options) {
|
|
5
|
-
super(options);
|
|
6
|
-
this.compositeType = "grid";
|
|
7
|
-
// Grid options
|
|
8
|
-
// TODO: make getter, setter for these so they can be changed after initial construction
|
|
9
|
-
this.rows = 0;
|
|
10
|
-
this.columns = 0;
|
|
11
|
-
// default Grid is: transparent gray, red lines, line width 1
|
|
12
|
-
this.gridBackgroundColor = [0, 0, 233, 0.25];
|
|
13
|
-
this.gridLineColor = w.Red;
|
|
14
|
-
this.gridLineWidth = 1;
|
|
15
|
-
this.gridChildren = new Array();
|
|
16
|
-
if (options.size) {
|
|
17
|
-
this.size = options.size;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
throw new Error("grid size must be specified");
|
|
21
|
-
}
|
|
22
|
-
if (options.rows) {
|
|
23
|
-
if (options.rows >= 1) {
|
|
24
|
-
this.rows = options.rows;
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
throw new Error("rows must be at least 1");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
throw new Error("rows must be specified");
|
|
32
|
-
}
|
|
33
|
-
if (options.columns) {
|
|
34
|
-
if (options.columns >= 1) {
|
|
35
|
-
this.columns = options.columns;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
throw new Error("columns must be at least 1");
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
throw new Error("columns must be specified");
|
|
43
|
-
}
|
|
44
|
-
if (options.backgroundColor) {
|
|
45
|
-
this.gridBackgroundColor = options.backgroundColor;
|
|
46
|
-
}
|
|
47
|
-
if (options.gridLineColor) {
|
|
48
|
-
this.gridLineColor = options.gridLineColor;
|
|
49
|
-
}
|
|
50
|
-
if (options.gridLineWidth) {
|
|
51
|
-
this.gridLineWidth = options.gridLineWidth;
|
|
52
|
-
}
|
|
53
|
-
this.cellWidth = this.size.width / this.columns;
|
|
54
|
-
this.cellHeight = this.size.height / this.rows;
|
|
55
|
-
}
|
|
56
|
-
initialize() {
|
|
57
|
-
// Remove all children, including gridLines because we may need to redraw them.
|
|
58
|
-
// Call the base class (Entity) removeAllChildren. (hence, the super)
|
|
59
|
-
// (note that we override removeAllChildren in this Grid class)
|
|
60
|
-
super.removeAllChildren();
|
|
61
|
-
this.gridBackground = new tt({
|
|
62
|
-
name: "_" + this.name + "-gridBackground",
|
|
63
|
-
rect: new J({ size: this.size }),
|
|
64
|
-
//size: this.size,
|
|
65
|
-
fillColor: this.gridBackgroundColor,
|
|
66
|
-
strokeColor: this.gridLineColor,
|
|
67
|
-
lineWidth: this.gridLineWidth,
|
|
68
|
-
isUserInteractionEnabled: this.isUserInteractionEnabled,
|
|
69
|
-
});
|
|
70
|
-
this.addChild(this.gridBackground);
|
|
71
|
-
this.gridBackground.isUserInteractionEnabled =
|
|
72
|
-
this.isUserInteractionEnabled;
|
|
73
|
-
for (let col = 1; col < this.columns; col++) {
|
|
74
|
-
const verticalLine = new tt({
|
|
75
|
-
name: "_" + this.name + "-gridVerticalLine-" + col,
|
|
76
|
-
rect: new J({
|
|
77
|
-
size: new p(this.gridLineWidth, this.size.height),
|
|
78
|
-
origin: new g(-this.size.width / 2 + this.cellWidth * col, 0),
|
|
79
|
-
}),
|
|
80
|
-
fillColor: this.gridLineColor,
|
|
81
|
-
});
|
|
82
|
-
this.gridBackground.addChild(verticalLine);
|
|
83
|
-
}
|
|
84
|
-
for (let row = 1; row < this.rows; row++) {
|
|
85
|
-
const horizontalLine = new tt({
|
|
86
|
-
name: "_" + this.name + "-gridHorizontalLine-" + row,
|
|
87
|
-
rect: new J({
|
|
88
|
-
size: new p(this.size.width, this.gridLineWidth),
|
|
89
|
-
origin: new g(0, -this.size.height / 2 + this.cellHeight * row),
|
|
90
|
-
}),
|
|
91
|
-
fillColor: this.gridLineColor,
|
|
92
|
-
});
|
|
93
|
-
this.gridBackground.addChild(horizontalLine);
|
|
94
|
-
}
|
|
95
|
-
if (this.gridChildren) {
|
|
96
|
-
this.gridChildren.forEach((gridChild) => {
|
|
97
|
-
if (!this.cellWidth || !this.cellHeight || !this.gridBackground) {
|
|
98
|
-
throw new Error("cellWidth, cellHeight, or gridBackground undefined or null");
|
|
99
|
-
}
|
|
100
|
-
const x = -this.size.width / 2 +
|
|
101
|
-
this.cellWidth / 2 +
|
|
102
|
-
gridChild.column * this.cellWidth;
|
|
103
|
-
const y = -this.size.height / 2 +
|
|
104
|
-
this.cellHeight / 2 +
|
|
105
|
-
gridChild.row * this.cellHeight;
|
|
106
|
-
gridChild.entity.position = new g(x, y);
|
|
107
|
-
this.gridBackground.addChild(gridChild.entity);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
this.needsInitialization = false;
|
|
111
|
-
}
|
|
112
|
-
update() {
|
|
113
|
-
super.update();
|
|
114
|
-
}
|
|
115
|
-
draw(canvas) {
|
|
116
|
-
super.drawChildren(canvas);
|
|
117
|
-
}
|
|
118
|
-
// override Entity.RemoveAllChildren() so that when RemoveAllChildren() is called on a Grid,
|
|
119
|
-
// it removes only entities added to the grid cells (what we call grid children), not the grid lines!
|
|
120
|
-
// note: when we upgrade to typescript 4.3+, we can mark this with override keyword to make intention explicit
|
|
121
|
-
removeAllChildren() {
|
|
122
|
-
if (this.gridChildren.length === 0) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
while (this.gridChildren.length) {
|
|
126
|
-
this.gridChildren.pop();
|
|
127
|
-
}
|
|
128
|
-
this.needsInitialization = true;
|
|
129
|
-
}
|
|
130
|
-
addAtCell(entity, row, column) {
|
|
131
|
-
if (row < 0 || row >= this.rows || column < 0 || column >= this.columns) {
|
|
132
|
-
console.warn(`warning: addAtCell() requested to add entity at row ${row}, column ${column}. This is outside the bounds of grid ${this.name}, which is size ${this.rows}x${this.columns}. Note that addAtCell() uses zero-based indexing. AddAtCell() will proceed, but may draw entities outside the grid`);
|
|
133
|
-
}
|
|
134
|
-
this.gridChildren.push({ entity: entity, row: row, column: column });
|
|
135
|
-
this.needsInitialization = true;
|
|
136
|
-
}
|
|
137
|
-
removeAllAtCell(row, column) {
|
|
138
|
-
this.gridChildren = this.gridChildren.filter((gridChild) => gridChild.row != row && gridChild.column != column);
|
|
139
|
-
this.needsInitialization = true;
|
|
140
|
-
}
|
|
141
|
-
// override Entity.RemoveChild() so that when RemoveChild() is called on a Grid, it removes the
|
|
142
|
-
// entity from the gridBackground rectangle AND our grid's own list of children (in gridChildren)
|
|
143
|
-
removeChild(entity) {
|
|
144
|
-
if (!this.gridBackground) {
|
|
145
|
-
throw new Error("gridBackground is null or undefined");
|
|
146
|
-
}
|
|
147
|
-
this.gridBackground.removeChild(entity);
|
|
148
|
-
this.gridChildren = this.gridChildren.filter((gridChild) => gridChild.entity != entity);
|
|
149
|
-
this.needsInitialization = true;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
class Button extends v {
|
|
154
|
-
// todo: add getters/setters so button can respond to changes in its options
|
|
155
|
-
// todo: add default "behaviors" (?) like button click animation?
|
|
156
|
-
constructor(options) {
|
|
157
|
-
super(options);
|
|
158
|
-
this.compositeType = "button";
|
|
159
|
-
// Button options
|
|
160
|
-
this._backgroundColor = w.RoyalBlue;
|
|
161
|
-
this.size = new p(200, 50);
|
|
162
|
-
this.cornerRadius = 9;
|
|
163
|
-
this.fontSize = 20;
|
|
164
|
-
this.text = "";
|
|
165
|
-
this._fontColor = w.White;
|
|
166
|
-
if (options.text) {
|
|
167
|
-
this.text = options.text;
|
|
168
|
-
}
|
|
169
|
-
if (options.size) {
|
|
170
|
-
this.size = options.size;
|
|
171
|
-
}
|
|
172
|
-
if (options.cornerRadius) {
|
|
173
|
-
this.cornerRadius = options.cornerRadius;
|
|
174
|
-
}
|
|
175
|
-
if (options.fontSize) {
|
|
176
|
-
this.fontSize = options.fontSize;
|
|
177
|
-
}
|
|
178
|
-
if (options.fontColor) {
|
|
179
|
-
this.fontColor = options.fontColor;
|
|
180
|
-
}
|
|
181
|
-
if (options.backgroundColor) {
|
|
182
|
-
this.backgroundColor = options.backgroundColor;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
initialize() {
|
|
186
|
-
this.removeAllChildren();
|
|
187
|
-
this.backgroundPaint = new Globals.canvasKit.Paint();
|
|
188
|
-
this.backgroundPaint.setColor(Globals.canvasKit.Color(this.backgroundColor[0], this.backgroundColor[1], this.backgroundColor[2], this.backgroundColor[3]));
|
|
189
|
-
this.backgroundPaint.setStyle(Globals.canvasKit.PaintStyle.Fill);
|
|
190
|
-
const buttonRectangle = new tt({
|
|
191
|
-
rect: new J({ size: this.size }),
|
|
192
|
-
cornerRadius: this.cornerRadius,
|
|
193
|
-
fillColor: this._backgroundColor,
|
|
194
|
-
});
|
|
195
|
-
this.addChild(buttonRectangle);
|
|
196
|
-
const buttonLabel = new Q({
|
|
197
|
-
text: this.text,
|
|
198
|
-
fontSize: this.fontSize,
|
|
199
|
-
fontColor: this.fontColor,
|
|
200
|
-
});
|
|
201
|
-
buttonRectangle.addChild(buttonLabel);
|
|
202
|
-
this.needsInitialization = false;
|
|
203
|
-
}
|
|
204
|
-
get backgroundColor() {
|
|
205
|
-
return this._backgroundColor;
|
|
206
|
-
}
|
|
207
|
-
set backgroundColor(backgroundColor) {
|
|
208
|
-
this._backgroundColor = backgroundColor;
|
|
209
|
-
this.needsInitialization = true;
|
|
210
|
-
}
|
|
211
|
-
get fontColor() {
|
|
212
|
-
return this._fontColor;
|
|
213
|
-
}
|
|
214
|
-
set fontColor(fontColor) {
|
|
215
|
-
this._fontColor = fontColor;
|
|
216
|
-
this.needsInitialization = true;
|
|
217
|
-
}
|
|
218
|
-
update() {
|
|
219
|
-
super.update();
|
|
220
|
-
}
|
|
221
|
-
draw(canvas) {
|
|
222
|
-
super.drawChildren(canvas);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
class Instructions extends et {
|
|
227
|
-
static Create(options) {
|
|
228
|
-
const scenes = new Array();
|
|
229
|
-
options.instructionScenes.forEach((s, i) => {
|
|
230
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
231
|
-
const nextSceneTransition = (_b = (_a = s.nextSceneTransition) !== null && _a !== void 0 ? _a : options.nextSceneTransition) !== null && _b !== void 0 ? _b : z.push(Y.left, 500);
|
|
232
|
-
const backSceneTransition = (_d = (_c = s.backSceneTransition) !== null && _c !== void 0 ? _c : options.backSceneTransition) !== null && _d !== void 0 ? _d : z.push(Y.right, 500);
|
|
233
|
-
const backButtonText = (_f = (_e = s.backButtonText) !== null && _e !== void 0 ? _e : options.backButtonText) !== null && _f !== void 0 ? _f : "Back";
|
|
234
|
-
const nextButtonText = (_h = (_g = s.nextButtonText) !== null && _g !== void 0 ? _g : options.nextButtonText) !== null && _h !== void 0 ? _h : "Next";
|
|
235
|
-
const backButtonWidth = (_k = (_j = s.backButtonWidth) !== null && _j !== void 0 ? _j : options.backButtonWidth) !== null && _k !== void 0 ? _k : 125;
|
|
236
|
-
const nextButtonWidth = (_m = (_l = s.nextButtonWidth) !== null && _l !== void 0 ? _l : options.nextButtonWidth) !== null && _m !== void 0 ? _m : 125;
|
|
237
|
-
const backButtonHeight = (_p = (_o = s.backButtonHeight) !== null && _o !== void 0 ? _o : options.backButtonHeight) !== null && _p !== void 0 ? _p : 50;
|
|
238
|
-
const nextButtonHeight = (_r = (_q = s.nextButtonHeight) !== null && _q !== void 0 ? _q : options.nextButtonHeight) !== null && _r !== void 0 ? _r : 50;
|
|
239
|
-
const backgroundColor = (_s = s.backgroundColor) !== null && _s !== void 0 ? _s : options.backgroundColor;
|
|
240
|
-
const imageAboveText = (_t = s.imageAboveText) !== null && _t !== void 0 ? _t : true;
|
|
241
|
-
const imageMarginTop = (_u = s.imageMarginTop) !== null && _u !== void 0 ? _u : 0;
|
|
242
|
-
const imageMarginBottom = (_v = s.imageMarginBottom) !== null && _v !== void 0 ? _v : 0;
|
|
243
|
-
const textMarginStart = (_w = s.textMarginStart) !== null && _w !== void 0 ? _w : 48;
|
|
244
|
-
const textMarginEnd = (_x = s.textMarginEnd) !== null && _x !== void 0 ? _x : 48;
|
|
245
|
-
const textAlignmentMode = (_y = s.textAlignmentMode) !== null && _y !== void 0 ? _y : q.left;
|
|
246
|
-
const textFontSize = (_z = s.textFontSize) !== null && _z !== void 0 ? _z : 16;
|
|
247
|
-
const titleFontSize = (_0 = s.titleFontSize) !== null && _0 !== void 0 ? _0 : 16;
|
|
248
|
-
const titleMarginTop = (_1 = s.titleMarginTop) !== null && _1 !== void 0 ? _1 : 48;
|
|
249
|
-
const backButtonBackgroundColor = (_3 = (_2 = s.backButtonBackgroundColor) !== null && _2 !== void 0 ? _2 : options.backButtonBackgroundColor) !== null && _3 !== void 0 ? _3 : w.RoyalBlue;
|
|
250
|
-
const backButtonFontColor = (_5 = (_4 = s.backButtonFontColor) !== null && _4 !== void 0 ? _4 : options.backButtonFontColor) !== null && _5 !== void 0 ? _5 : w.White;
|
|
251
|
-
const nextButtonBackgroundColor = (_7 = (_6 = s.nextButtonBackgroundColor) !== null && _6 !== void 0 ? _6 : options.nextButtonBackgroundColor) !== null && _7 !== void 0 ? _7 : w.RoyalBlue;
|
|
252
|
-
const nextButtonFontColor = (_9 = (_8 = s.nextButtonFontColor) !== null && _8 !== void 0 ? _8 : options.nextButtonFontColor) !== null && _9 !== void 0 ? _9 : w.White;
|
|
253
|
-
const scene = new j({
|
|
254
|
-
name: options.sceneNamePrefix + "-" + (i + 1).toString().padStart(2, "0"),
|
|
255
|
-
backgroundColor: backgroundColor,
|
|
256
|
-
});
|
|
257
|
-
let titleLabel;
|
|
258
|
-
if (s.title !== undefined) {
|
|
259
|
-
titleLabel = new Q({
|
|
260
|
-
text: s.title,
|
|
261
|
-
fontSize: titleFontSize,
|
|
262
|
-
layout: {
|
|
263
|
-
marginTop: titleMarginTop,
|
|
264
|
-
constraints: {
|
|
265
|
-
topToTopOf: scene,
|
|
266
|
-
startToStartOf: scene,
|
|
267
|
-
endToEndOf: scene,
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
});
|
|
271
|
-
scene.addChild(titleLabel);
|
|
272
|
-
}
|
|
273
|
-
let textLabel;
|
|
274
|
-
if (s.text !== undefined) {
|
|
275
|
-
textLabel = new Q({
|
|
276
|
-
text: s.text,
|
|
277
|
-
preferredMaxLayoutWidth: r.MATCH_CONSTRAINT,
|
|
278
|
-
horizontalAlignmentMode: textAlignmentMode,
|
|
279
|
-
fontSize: textFontSize,
|
|
280
|
-
layout: {
|
|
281
|
-
marginStart: textMarginStart,
|
|
282
|
-
marginEnd: textMarginEnd,
|
|
283
|
-
constraints: {
|
|
284
|
-
topToTopOf: scene,
|
|
285
|
-
bottomToBottomOf: scene,
|
|
286
|
-
startToStartOf: scene,
|
|
287
|
-
endToEndOf: scene,
|
|
288
|
-
verticalBias: s.textVerticalBias,
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
});
|
|
292
|
-
scene.addChild(textLabel);
|
|
293
|
-
}
|
|
294
|
-
if (s.image !== undefined) {
|
|
295
|
-
let image;
|
|
296
|
-
if (textLabel !== undefined) {
|
|
297
|
-
if (imageAboveText) {
|
|
298
|
-
image = new G({
|
|
299
|
-
imageName: s.image,
|
|
300
|
-
layout: {
|
|
301
|
-
marginBottom: imageMarginBottom,
|
|
302
|
-
constraints: {
|
|
303
|
-
bottomToTopOf: textLabel,
|
|
304
|
-
startToStartOf: scene,
|
|
305
|
-
endToEndOf: scene,
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
image = new G({
|
|
312
|
-
imageName: s.image,
|
|
313
|
-
layout: {
|
|
314
|
-
marginTop: imageMarginTop,
|
|
315
|
-
constraints: {
|
|
316
|
-
topToBottomOf: textLabel,
|
|
317
|
-
startToStartOf: scene,
|
|
318
|
-
endToEndOf: scene,
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
image = new G({
|
|
326
|
-
imageName: s.image,
|
|
327
|
-
layout: {
|
|
328
|
-
constraints: {
|
|
329
|
-
topToTopOf: scene,
|
|
330
|
-
bottomToBottomOf: scene,
|
|
331
|
-
verticalBias: s.imageVerticalBias,
|
|
332
|
-
startToStartOf: scene,
|
|
333
|
-
endToEndOf: scene,
|
|
334
|
-
},
|
|
335
|
-
},
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
scene.addChild(image);
|
|
339
|
-
}
|
|
340
|
-
if (i > 0) {
|
|
341
|
-
const backButton = new Button({
|
|
342
|
-
text: backButtonText,
|
|
343
|
-
fontColor: backButtonFontColor,
|
|
344
|
-
backgroundColor: backButtonBackgroundColor,
|
|
345
|
-
size: new p(backButtonWidth, backButtonHeight),
|
|
346
|
-
layout: {
|
|
347
|
-
marginStart: 32,
|
|
348
|
-
marginBottom: 32,
|
|
349
|
-
constraints: { bottomToBottomOf: scene, startToStartOf: scene },
|
|
350
|
-
},
|
|
351
|
-
});
|
|
352
|
-
backButton.isUserInteractionEnabled = true;
|
|
353
|
-
backButton.onTap(() => {
|
|
354
|
-
scene.game.presentScene(options.sceneNamePrefix +
|
|
355
|
-
"-" +
|
|
356
|
-
(i + 1 - 1).toString().padStart(2, "0"), backSceneTransition);
|
|
357
|
-
});
|
|
358
|
-
scene.addChild(backButton);
|
|
359
|
-
}
|
|
360
|
-
const nextButton = new Button({
|
|
361
|
-
text: nextButtonText,
|
|
362
|
-
fontColor: nextButtonFontColor,
|
|
363
|
-
backgroundColor: nextButtonBackgroundColor,
|
|
364
|
-
size: new p(nextButtonWidth, nextButtonHeight),
|
|
365
|
-
layout: {
|
|
366
|
-
marginEnd: 32,
|
|
367
|
-
marginBottom: 32,
|
|
368
|
-
constraints: { bottomToBottomOf: scene, endToEndOf: scene },
|
|
369
|
-
},
|
|
370
|
-
});
|
|
371
|
-
nextButton.isUserInteractionEnabled = true;
|
|
372
|
-
if (i !== options.instructionScenes.length - 1) {
|
|
373
|
-
nextButton.onTap(() => {
|
|
374
|
-
scene.game.presentScene(options.sceneNamePrefix +
|
|
375
|
-
"-" +
|
|
376
|
-
(i + 1 + 1).toString().padStart(2, "0"), nextSceneTransition);
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
else {
|
|
380
|
-
if (options.postInstructionsScene !== undefined) {
|
|
381
|
-
nextButton.onTap(() => {
|
|
382
|
-
var _a;
|
|
383
|
-
scene.game.presentScene((_a = options.postInstructionsScene) !== null && _a !== void 0 ? _a : "", nextSceneTransition);
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
else {
|
|
387
|
-
console.warn("warning: instructions postInstructionsScene is not defined");
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
scene.addChild(nextButton);
|
|
391
|
-
scenes.push(scene);
|
|
392
|
-
});
|
|
393
|
-
return scenes;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
export { Button, Grid, Instructions };
|
|
398
|
-
//# sourceMappingURL=index.mjs.map
|