text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rextagtext=e():t.rextagtext=e()}(window,function(){return function(t){var e={};function s(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=t,s.c=e,s.d=function(t,e,i){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(i,n,function(e){return t[e]}.bind(null,n));return i},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=181)}({1:function(t,e,s){"use strict";e.a={hleft:0,hcenter:1,hright:2,vtop:0,vcenter:1,vbottom:2,NO_NEWLINE:0,RAW_NEWLINE:1,WRAPPED_NEWLINE:2,NO_WRAP:0,WORD_WRAP:1,CHAR_WRAP:2,SPLITREGEXP:/(?:\r\n|\r|\n)/}},10:function(t,e,s){"use strict";var i=class{constructor(){this.items=[]}pop(){return this.items.length>0?this.items.pop():null}push(t){this.items.push(t)}pushMultiple(t){for(var e=0,s=t.length;e<s;e++)this.items.push(t[e]);t.length=0}};e.a=i},181:function(t,e,s){"use strict";s.r(e);var i=s(75);const n=Phaser.Utils.Objects.GetAdvancedValue,r=Phaser.GameObjects.BuildGameObject;Phaser.GameObjects.GameObjectFactory.register("rexTagText",function(t,e,s,n){s=new i.a(this.scene,t,e,s,n);return this.displayList.add(s),s}),Phaser.GameObjects.GameObjectCreator.register("rexTagText",function(t,e){var s=n(t,"text",""),o=n(t,"style",null),a=n(t,"padding",null);null!==a&&(o.padding=a),void 0!==e&&(t.add=e);var h=new i.a(this.scene,0,0,s,o);return r(this.scene,h,t),h.autoRound=n(t,"autoRound",!0),h.resolution=n(t,"resolution",1),h}),e.default=i.a},27:function(t,e,s){"use strict";const i=Phaser.Display.Canvas.CanvasPool;var n={},r=function(t){var e=i.create(this),s=e.getContext("2d");t.syncFont(e,s);var r=Math.ceil(s.measureText(t.testString).width*t.baselineX),o=r,a=2*o;o=o*t.baselineY|0,e.width=r,e.height=a,s.fillStyle="#f00",s.fillRect(0,0,r,a),s.font=t._font,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(t.testString,0,o);var h=n;if(!s.getImageData(0,0,r,a))return h.ascent=o,h.descent=o+6,h.fontSize=h.ascent+h.descent,i.remove(e),h;var l,d,u=s.getImageData(0,0,r,a).data,f=u.length,p=4*r,c=0,g=!1;for(l=0;l<o;l++){for(d=0;d<p;d+=4)if(255!==u[c+d]){g=!0;break}if(g)break;c+=p}for(h.ascent=o-l,c=f-p,g=!1,l=a;l>o;l--){for(d=0;d<p;d+=4)if(255!==u[c+d]){g=!0;break}if(g)break;c-=p}return h.descent=l-o,h.fontSize=h.ascent+h.descent,i.remove(e),h},o=s(1);const a=Phaser.Utils.Objects.GetAdvancedValue,h=Phaser.Utils.Objects.GetValue;var l={backgroundColor:["backgroundColor",null],fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],underlineColor:["underline.color","#000"],underlineThickness:["underline.thickness",0],underlineOffset:["underline.offset",0],halign:["halign",0],valign:["valign",0],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],lineSpacing:["lineSpacing",0],rtl:["rtl",!1],testString:["testString","|MÃ‰qgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wrapMode:["wrap.mode",0],wrapWidth:["wrap.width",null]};const d={left:o.a.hleft,center:o.a.hcenter,right:o.a.hright},u={top:o.a.vtop,center:o.a.vcenter,bottom:o.a.vbottom},f={none:o.a.NO_WRAP,word:o.a.WORD_WRAP,char:o.a.CHAR_WRAP,character:o.a.CHAR_WRAP};e.a=class{constructor(t,e){this.parent=t,this.backgroundColor,this.fontFamily,this.fontSize,this.fontStyle,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.underlineColor,this.underlineThickness,this.underlineOffset,this.halign,this.valign,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.lineSpacing,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1);var s=h(e,"metrics",!1);this.metrics=s?{ascent:h(s,"ascent",0),descent:h(s,"descent",0),fontSize:h(s,"fontSize",0)}:r(this)}setStyle(t,e){if(void 0===e&&(e=!0),t&&t.hasOwnProperty("halign")&&"string"==typeof t.halign&&(t.halign=d[t.halign.toLowerCase()]||0),t&&t.hasOwnProperty("valign")&&"string"==typeof t.valign&&(t.valign=u[t.valign.toLowerCase()]||0),t&&t.hasOwnProperty("wrap")){var s=t.wrap;if(s.hasOwnProperty("mode")){var i=s.mode;"string"==typeof i&&(s.mode=f[i.toLowerCase()]||0)}else s.hasOwnProperty("width")&&(s.mode=1)}for(var n in t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),l)this[n]="wrapCallback"===n||"wrapCallbackScope"===n?h(t,l[n][0],l[n][1]):a(t,l[n][0],l[n][1]);var r=h(t,"font",null);this._font=null===r?this.fontStyle+" "+this.fontSize+" "+this.fontFamily:r;var o=h(t,"fill",null);return null!==o&&(this.color=o),e?this.update(!0):this.parent}syncFont(t,e){e.font=this._font}syncStyle(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"}syncShadow(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)}update(t){return t&&(this._font=this.fontStyle+" "+this.fontSize+" "+this.fontFamily,this.metrics=r(this)),this.parent.updateText(t)}buildFont(){var t=this.fontStyle+" "+this.fontSize+" "+this.fontFamily;return t!==this._font&&(this._font=t),this}setFont(t){return"string"==typeof t?(this.fontFamily=t,this.fontSize="",this.fontStyle=""):(this.fontFamily=h(t,"fontFamily","Courier"),this.fontSize=h(t,"fontSize","16px"),this.fontStyle=h(t,"fontStyle","")),this.update(!0)}setFontFamily(t){return this.fontFamily=t,this.update(!0)}setFontStyle(t){return this.fontStyle=t,this.update(!0)}setFontSize(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize=t,this.update(!0)}setTestString(t){return this.testString=t,this.update(!0)}setFixedSize(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)}setResolution(t){return this.resolution=t,this.update(!1)}setLineSpacing(t){return this.lineSpacing=t,this.update(!1)}setBackgroundColor(t){return this.backgroundColor=t,this.update(!1)}setFill(t){return this.color=t,this.update(!1)}setColor(t){return this.color=t,this.update(!1)}setStroke(t,e){return void 0===t?this.strokeThickness=0:(void 0===e&&(e=this.strokeThickness),this.stroke=t,this.strokeThickness=e),this.update(!0)}setShadow(t,e,s,i,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===s&&(s="#000"),void 0===i&&(i=0),void 0===n&&(n=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=s,this.shadowBlur=i,this.shadowStroke=n,this.shadowFill=r,this.update(!1)}setShadowOffset(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)}setShadowColor(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)}setShadowBlur(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)}setShadowStroke(t){return this.shadowStroke=t,this.update(!1)}setShadowFill(t){return this.shadowFill=t,this.update(!1)}setUnderline(t,e,s){return void 0===t&&(t="#000"),void 0===e&&(e=0),void 0===s&&(s=0),this.underlineColor=t,this.underlineThickness=e,this.underlineOffset=s,this.update(!1)}setUnderlineColor(t){return void 0===t&&(t="#000"),this.underlineColor=t,this.update(!1)}setUnderlineThickness(t){return void 0===t&&(t=0),this.underlineThickness=t,this.update(!1)}setUnderlineOffset(t){return void 0===t&&(t=0),this.underlineOffset=t,this.update(!1)}setWrapMode(t){return"string"==typeof t&&(t=f[t.toLowerCase()]||0),this.wrapMode=t,this.update(!0)}setWrapWidth(t){this.wrapWidth=t;var e=0!==this.wrapMode;return this.update(e)}setAlign(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),"string"==typeof t&&(t=d[t.toLowerCase()]||0),"string"==typeof e&&(e=d[e.toLowerCase()]||0),this.halign=t,this.valign=e,this.update(!1)}setHAlign(t){return void 0===t&&(t=0),"string"==typeof t&&(t=d[t.toLowerCase()]||0),this.halign=t,this.update(!1)}setVAlign(t){return void 0===t&&(t=0),"string"==typeof t&&(t=d[t.toLowerCase()]||0),this.valign=t,this.update(!1)}setMaxLines(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)}getTextMetrics(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}}get lineHeight(){return this.metrics.fontSize+this.strokeThickness+this.lineSpacing}toJSON(){var t={};for(var e in l)t[e]=this[e];return t.metrics=this.getTextMetrics(),t}destroy(){this.parent=void 0}}},4:function(t,e,s){"use strict";e.a=function(t){if(Array.isArray(t))t.length=0;else for(var e in t)delete t[e]}},58:function(t,e,s){"use strict";const i=Phaser.Renderer.WebGL.Utils;var n=function(t,e,s,n,r){if(""!==e.text){var o=e.frame,a=o.width,h=o.height,l=i.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a/e.style.resolution,h/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,n.alpha*e._alphaTL),l(e._tintTR,n.alpha*e._alphaTR),l(e._tintBL,n.alpha*e._alphaBL),l(e._tintBR,n.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,n,r)}},r=function(t,e,s,i,n){""!==e.text&&t.batchSprite(e,e.frame,i,n)},o=s(6),a=(o.a,o.a,{renderWebGL:n,renderCanvas:r}),h=s(27),l=s(10),d=s(1);const u=Phaser.Utils.Objects.GetValue,f=d.a.NO_NEWLINE,p=d.a.RAW_NEWLINE;var c=class{constructor(t){this.prop={},this.resetFromJSON(t)}resetFromJSON(t){this.text=u(t,"text",""),this.x=u(t,"x",0),this.y=u(t,"y",0),this.width=u(t,"width",0);var e=u(t,"prop",null);null===e&&(e={}),this.prop=e,this.newLineMode=u(t,"newLineMode",0),this.startIndex=u(t,"startIndex",0)}get plainText(){var t=this.text;return this.newLineMode===p&&(t+="\n"),t}get wrapText(){var t=this.text;return this.newLineMode!==f&&(t+="\n"),t}get rawTextLength(){var t=this.text.length;return this.newLineMode===p&&(t+=1),t}get endIndex(){return this.startIndex+this.rawTextLength}get lastX(){return this.x+this.width}},g=s(9);const y=Phaser.Utils.Objects.GetFastValue,v=d.a.NO_NEWLINE;var w=new l.a,x=new l.a;class S{constructor(t){this.pens=[],this.lines=[],this.maxLinesWidth=void 0,this.PensPool=y(t,"pensPool",w),this.LinesPool=y(t,"linesPool",x),this.tagToText=y(t,"tagToText",o.a),this.tagToTextScope=y(t,"tagToTextScope",void 0)}destroy(){this.freePens(),this.tagToText=void 0,this.tagToTextScope=void 0}freePens(){for(var t=0,e=this.lines.length;t<e;t++)this.lines[t].length=0;this.PensPool.pushMultiple(this.pens),this.LinesPool.pushMultiple(this.lines),this.maxLinesWidth=void 0}addPen(t,e,s,i,n,r){var o=this.PensPool.pop();null==o&&(o=new c),T.text=t,T.x=e,T.y=s,T.width=i,T.prop=n,T.newLineMode=r,o.resetFromJSON(T);var a=this.lastPen;o.startIndex=null==a?0:a.endIndex,this.pens.push(o);var h=this.lastLine;null==h&&(h=this.LinesPool.pop()||[],this.lines.push(h)),h.push(o),o.newLineMode!==v&&(h=this.LinesPool.pop()||[],this.lines.push(h)),this.maxLinesWidth=void 0}clone(t){null==t&&(t=new S),t.freePens();for(var e=0,s=this.lines.length;e<s;e++)for(var i=this.lines[e],n=0,r=i.length;n<r;n++){var o=i[n];t.addPen(o.text,o.x,o.y,o.width,Object(g.a)(o.prop),o.newLineMode)}return t}get lastPen(){return this.pens[this.pens.length-1]}get lastLine(){return this.lines[this.lines.length-1]}getLineStartIndex(t){if(t>=this.lines.length)return this.getLineEndIndex(t);var e=this.lines[t];return e[0]?e[0].startIndex:0}getLineEndIndex(t){t>=this.lines.length&&(t=this.lines.length-1);var e,s,i=!1;for(e=t;e>=0&&!(i=null!=(s=this.lines[e])&&s.length>0);e--);return i?s[s.length-1].endIndex:0}getLineWidth(t){var e=this.lines[t];if(!e)return 0;var s=e[e.length-1];return null==s?0:s.lastX}getMaxLineWidth(){if(void 0!==this.maxLinesWidth)return this.maxLinesWidth;for(var t,e=0,s=0,i=this.lines.length;s<i;s++)(t=this.getLineWidth(s))>e&&(e=t);return this.maxLinesWidth=e,e}getLineWidths(){for(var t=[],e=0,s=this.lines.length;e<s;e++)t.push(this.getLineWidth(e));return t}get linesCount(){return this.lines.length}get plainText(){for(var t="",e=this.pens,s=0,i=e.length;s<i;s++)t+=e[s].plainText;return t}get rawTextLength(){for(var t=0,e=this.pens,s=0,i=this.pens.length;s<i;s++)t+=e[s].rawTextLength;return t}getSliceTagText(t,e,s){if(void 0===t&&(t=0),void 0===e){var i=this.lastPen;if(null==i)return"";e=i.endIndex}void 0===s&&(s=!1);for(var n,r,o,a,h,l,d="",u=0,f=this.pens.length;u<f&&((a=(n=this.pens[u]).endIndex)<=t||(n=this.pens[u],r=s?n.wrapText:n.plainText,h=n.prop,(o=n.startIndex)>=t&&a<=e||(r=r.substring(t-o,e-o)),this.tagToTextScope?d+=this.tagToText.call(this.tagToTextScope,r,h,l):d+=this.tagToText(r,h,l),l=h,!(a>=e)));u++);return d}}var T={},P=S;const m=d.a.NO_NEWLINE,O=d.a.RAW_NEWLINE,k=d.a.WRAPPED_NEWLINE,b=d.a.NO_WRAP,M=d.a.WORD_WRAP,L=(d.a.CHAR_WRAP,d.a.SPLITREGEXP);var C=[],W=new l.a;W.newline=function(t,e,s){var i=this.pop();return null===i&&(i={}),i.text=t,i.width=e,i.newLineMode=s,i};var F=function(t,e,s,i,n){var r=C;if(W.pushMultiple(r),!t||!t.length)return r;for(var o,a,h,l=t.split(L),d=0,u=l.length;d<u;d++)if(o=l[d],h=d===u-1?m:O,s!==b){var f,p;if(a=0===d?i-n:i,o.length<=100&&(S=e(o))<=a){r.push(W.newline(o,S,h));continue}for(var c,g="",y="",v=0,w=0,x=(f=s===M?o.split(" "):o).length;w<x;w++)p=f[w],s===M?(g+=p,w<x-1&&(g+=" ")):g+=p,(c=e(g))>a&&(0===w?r.push(W.newline("",0,k)):(r.push(W.newline(y,v,k)),g=p,s===M&&w<x-1&&(g+=" "),c=e(g)),a=i),y=g,v=c;r.push(W.newline(y,v,h))}else{var S=e(o);r.push(W.newline(o,S,h))}return r};const _=Phaser.Utils.Objects.GetValue,R=(d.a.NO_WRAP,d.a.NO_NEWLINE),z=(d.a.hleft,d.a.hcenter),A=d.a.hright,I=(d.a.vtop,d.a.vcenter),N=d.a.vbottom;var j={},E=class{constructor(t){this.context=_(t,"context",null),this.canvas=this.context.canvas,this.parser=_(t,"parser",null),this.defatultStyle=_(t,"style",null),this.autoRound=!0,this.pensPool=_(t,"pensPool",null),this.pensManager=this.newPenManager(),this._tmpPensManager=null;var e=this.context;this.getTextWidth=function(t){return e.measureText(t).width}}updatePensManager(t,e,s,i,n){if(void 0===n&&(n=this.pensManager),n.freePens(),""===t)return n;for(var r,o,a,h,l,d=this.canvas,u=this.context,f=0,p=0,c=this.parser.splitText(t),y=0,v=c.length;y<v;y++)if(r=(h=this.parser.tagTextToProp(c[y],o)).plainText,o=h.prop,""!==r){this.context.save(),(a=this.parser.propToContextStyle(this.defatultStyle,o)).buildFont(),a.syncFont(d,u),a.syncStyle(d,u);for(var w=0,x=(l=F(r,this.getTextWidth,e,s,f)).length;w<x;w++){var S=l[w];n.addPen(S.text,f,p,S.width,Object(g.a)(o),S.newLineMode),S.newLineMode!==R?(f=0,p+=i):f+=S.width}this.context.restore()}return n}draw(t,e,s,i,n){void 0===n&&(n=this.pensManager);var r=this.context;r.save(),this.drawBackground();var o=this.defatultStyle;t+=o.strokeThickness/2,e+=o.strokeThickness/2+o.metrics.ascent;var a,h,l,d,u,f,p=o.halign,c=o.valign,g=o.lineHeight,y=n.lines,v=y.length,w=o.maxLines;w>0&&v>w?(h=w,l=c===I?Math.floor((v-h)/2):c===N?v-h:0):(h=v,l=0),d=l+h,f=c===I?Math.max((i-h*g)/2,0):c===N?Math.max(i-h*g-2,0):0,f+=e;for(var x=l;x<d;x++)if(0!==(a=n.getLineWidth(x))){u=p===z?(s-a)/2:p===A?s-a:0,u+=t;for(var S=y[x],T=0,P=S.length;T<P;T++)this.drawPen(S[T],u,f)}r.restore()}clear(){var t=this.canvas;this.context.clearRect(0,0,t.width,t.height)}drawBackground(){var t=this.defatultStyle.backgroundColor;if(null!==t){var e=this.context,s=this.canvas;e.fillStyle=t,e.fillRect(0,0,s.width,s.height)}}drawUnderline(t,e,s,i,n){if(!(i<=0)){var r=this.context,o=r.lineCap;r.lineCap="butt",r.beginPath(),r.strokeStyle=n,r.lineWidth=i,r.moveTo(t,e),r.lineTo(t+s,e),r.stroke(),r.lineCap=o}}drawPen(t,e,s){var i=this.canvas,n=this.context;n.save();var r=this.parser.propToContextStyle(this.defatultStyle,t.prop);r.buildFont(),r.syncFont(i,n),r.syncStyle(i,n),e+=t.x,s+=t.y,this.autoRound&&(e=Math.round(e),s=Math.round(s));var o=t.text,a=t.width;this.drawUnderline(e,s+r.underlineOffset,a,r.underlineThickness,r.underlineColor),r.strokeThickness&&(r.syncShadow(n,r.shadowStroke),n.strokeText(o,e,s)),r.color&&"none"!==r.color&&(r.syncShadow(n,r.shadowFill),n.fillText(o,e,s)),n.restore()}destroy(){this.context=void 0,this.canvas=void 0,this.parser=void 0,this.defatultStyle=void 0,this.pensManager.destroy(),this.pensManager=void 0,this._tmpPensManager&&(this._tmpPensManager.destroy(),this._tmpPensManager=void 0)}get lines(){return this.pensManager.lines}get desplayLinesCount(){var t=this.pensManager.linesCount,e=this.defatultStyle.maxLines;return e>0&&t>e&&(t=e),t}get linesWidth(){return this.pensManager.getMaxLineWidth()}get linesHeight(){var t=this.desplayLinesCount,e=this.defatultStyle.lineHeight*t;return t>0&&(e-=this.defatultStyle.lineSpacing),e}newPenManager(){return j.pensPool=this.pensPool,j.tagToText=this.parser.propToTagText,j.tagToTextScope=this.parser,new P(j)}get tmpPenManager(){return null===this._tmpPensManager&&(this._tmpPensManager=this.newPenManager()),this._tmpPensManager}getPlainText(t,e,s){var i;if(null==t)i=this.pensManager.plainText;else{var n=this.parser.splitText(t,1);i="";for(var r=0,o=n.length;r<o;r++)i+=n[r]}return null==e&&null==s||(null==e&&(e=0),null==s&&(s=i.length),i=i.substring(e,s)),i}getPenManager(t,e){if(void 0===t)return this.copyPensManager(e,this.pensManager);void 0===e&&(e=this.newPenManager());var s=this.defatultStyle;return this.updatePensManager(t,s.wrapMode,s.wrapWidth,s.lineHeight,e),e}getText(t,e,s,i){if(null==t)return this.pensManager.getSliceTagText(e,s,i);var n=this.tmpPenManager,r=this.defatultStyle;return this.updatePensManager(t,r.wrapMode,r.wrapWidth,r.lineHeight,n),n.getSliceTagText(e,s,i)}copyPensManager(t,e){return void 0===e&&(e=this.pensManager),e.copy(t)}getTextWidth(t){return void 0===t&&(t=this.pensManager),t.getMaxLineWidth()}getLastPen(t){return void 0===t&&(t=this.pensManager),t.lastPen}};const B=Phaser.DOM.AddToDOM,X=Phaser.Display.Canvas.CanvasPool,G=Phaser.GameObjects.Components,Y=Phaser.GameObjects.GameObject,H=Phaser.Utils.Objects.GetValue,D=Phaser.DOM.RemoveFromDOM,U=d.a.SPLITREGEXP;var V={},J=new Phaser.Class({Extends:Y,Mixins:[G.Alpha,G.BlendMode,G.ComputedSize,G.Crop,G.Depth,G.Flip,G.GetBounds,G.Mask,G.Origin,G.Pipeline,G.ScaleMode,G.ScrollFactor,G.Tint,G.Transform,G.Visible,a],initialize:function(t,e,s,i,n,r,o){if(void 0===e&&(e=0),void 0===s&&(s=0),Y.call(this,t,r),this.renderer=t.sys.game.renderer,this.setPosition(e,s),this.setOrigin(0,0),this.initPipeline(),this.canvas=X.create(this),this.context=this.canvas.getContext("2d"),n&&n.hasOwnProperty("align")){var a=n.align;delete n.align,n.halign=a}this.style=new h.a(this,n),this.autoRound=!0,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=t.sys.game.config.resolution),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),V.hasOwnProperty(r)||(V[r]=new l.a),q.context=this.context,q.parser=o,q.style=this.style,q.pensPool=V[r],this.canvasText=new E(q),n&&n.padding&&this.setPadding(n.padding),this.setText(i),t.sys.game.config.renderType===Phaser.WEBGL&&t.sys.game.renderer.onContextRestored(function(){this.dirty=!0},this)},text:{set:function(t){this.setText(t)},get:function(){return this._text}},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",B(this.canvas,this.scene.sys.canvas),this.originX=1)},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this._text&&(this._text=t.toString(),this.updateText(!0)),this},setStyle:function(t){return this.style.setStyle(t)},setFont:function(t){return this.style.setFont(t)},setFontFamily:function(t){return this.style.setFontFamily(t)},setFontSize:function(t){return this.style.setFontSize(t)},setFontStyle:function(t){return this.style.setFontStyle(t)},setFixedSize:function(t,e){return this.style.setFixedSize(t,e)},setBackgroundColor:function(t){return this.style.setBackgroundColor(t)},setFill:function(t){return this.style.setFill(t)},setColor:function(t){return this.style.setColor(t)},setStroke:function(t,e){return this.style.setStroke(t,e)},setShadow:function(t,e,s,i,n,r){return this.style.setShadow(t,e,s,i,n,r)},setShadowOffset:function(t,e){return this.style.setShadowOffset(t,e)},setShadowColor:function(t){return this.style.setShadowColor(t)},setShadowBlur:function(t){return this.style.setShadowBlur(t)},setShadowStroke:function(t){return this.style.setShadowStroke(t)},setShadowFill:function(t){return this.style.setShadowFill(t)},setWordWrapWidth:function(t,e){return this.style.setWordWrapWidth(t,e)},setWordWrapCallback:function(t,e){return this.style.setWordWrapCallback(t,e)},setAlign:function(t){return this.style.setHAlign(t)},setLineSpacing:function(t){return this.style.setLineSpacing(t)},setPadding:function(t,e,s,i){if("object"==typeof t){var n=t,r=H(n,"x",null);null!==r?(t=r,s=r):(t=H(n,"left",0),s=H(n,"right",t));var o=H(n,"y",null);null!==o?(e=o,i=o):(e=H(n,"top",0),i=H(n,"bottom",e))}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===s&&(s=t),void 0===i&&(i=e);return this.padding.left=t,this.padding.top=e,this.padding.right=s,this.padding.bottom=i,this.updateText()},setResolution:function(t){return this.style.setResolution(t)},setMaxLines:function(t){return this.style.setMaxLines(t)},updateText:function(t){void 0===t&&(t=!1);var e=this.canvasText,s=this.style;t&&e.updatePensManager(this._text,s.wrapMode,s.wrapWidth,s.lineHeight);var i=e.linesWidth,n=e.linesHeight,r=this.padding,o=i+r.left+r.right,a=n+r.top+r.bottom;this.width=0===s.fixedWidth?o:s.fixedWidth,this.height=0===s.fixedHeight?a:s.fixedHeight,this.updateDisplayOrigin();var h=s.resolution;o*=h,a*=h,o=Math.max(Math.ceil(o),1),a=Math.max(Math.ceil(a),1);var l=this.canvas,d=this.context;return l.width!==o||l.height!==a?(l.width=o,l.height=a,this.frame.setSize(o,a)):d.clearRect(0,0,o,a),d.save(),d.scale(h,h),e.draw(r.left,r.top,i,n),d.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(l,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0,this},getTextMetrics:function(){return this.style.getTextMetrics()},toJSON:function(){var t=G.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),resolution:this.resolution,padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&D(this.canvas),X.remove(this.canvas),this.canvasText.destroy()},getWrappedText:function(t,e,s){return(t=this.canvasText.getText(t,e,s,!0)).split(U)},getPlainText:function(t,e,s){return this.canvasText.getPlainText(t,e,s)},getText:function(t,e,s){return this.canvasText.getText(t,e,s,!1)},getSubString:function(t,e,s){return this.getText(t,e,s)},copyPensManager:function(t){return this.canvasText.copyPensManager(t)},getPenManager:function(t,e){return this.canvasText.getPenManager(t,e)}}),q={};e.a=J},6:function(t,e,s){"use strict";e.a=function(){}},75:function(t,e,s){"use strict";var i=s(58),n={plainText:null,prevProp:null},r=new(s(27).a);var o=function(t){for(var e,s,i,n={},r=0,o=(t=t.split(";")).length;r<o;r++)if(s=(e=t[r].split(":"))[0],i=e[1],!a(s)&&!a(i)){switch(s){case"stroke":var h=i.split(" ");i={},(d=h.length)>=1&&(i.color=h[0]),d>=2&&(i.thinkness=parseInt(h[1].replace("px","")));break;case"shadow":var l=i.split(" ");i={},(d=l.length)>=1&&(i.color=l[0]),d>=2&&(i.offsetX=parseInt(l[1].replace("px",""))),d>=3&&(i.offsetY=parseInt(l[2].replace("px",""))),d>=4&&(i.blur=parseInt(l[3].replace("px","")));break;case"u":case"underline":var d,u=i.split(" ");i={},(d=u.length)>=1&&(i.color=u[0]),d>=2&&(i.thinkness=parseInt(u[1].replace("px",""))),d>=3&&(i.offset=parseInt(u[2].replace("px","")))}n[s]=i}return n},a=function(t){return 0===(t=t.replace(p,"")).length},h=/<\s*class=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/class\s*\>|<\s*style=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/style\s*\>/g,l=/<\s*class=/i,d=/<\s*class=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/class\s*\>/,u=/<\s*style=/i,f=/<\s*style=["|']([^"|']+)["|']\s*\>([\s\S]*?)<\s*\/style\s*\>/,p=/^\s+|\s+$/,c=class{constructor(t){void 0===t&&(t={}),this.tags=t}addTag(t,e){this.tags[t]=e}splitText(t,e){for(var s,i,n,r=[],o=0,a=t.length,p=a;s=h.exec(t);)i=s[0],o<(p=h.lastIndex-i.length)&&r.push(t.substring(o,p)),void 0===e?r.push(i):1===e&&(l.test(i)?(n=i.match(d),r.push(n[2])):u.test(i)&&(n=i.match(f),r.push(n[2]))),o=h.lastIndex;return o<a&&r.push(t.substring(o,a)),r}tagTextToProp(t,e){var s,i;if(l.test(t)){if(null!=(h=t.match(d))){var r=h[1],a=this.tags;(i=a.hasOwnProperty(r)?a[r]:{})._class=r,s=h[2]}}else if(u.test(t)){var h;if(null!=(h=t.match(f))){var p=h[1];(i=o(p))._style=p,s=h[2]}}null==s&&(s=t),null==i&&(i={});var c=n;return c.plainText=s,c.prop=i,c}propToContextStyle(t,e){var s=r;if(e.hasOwnProperty("img"))s.image=e.img;else{if(s.image=null,e.hasOwnProperty("family")||e.hasOwnProperty("fontFamily")||e.hasOwnProperty("font-family")){var i=e.hasOwnProperty("family")?e.family:e.hasOwnProperty("fontFamily")?e.fontFamily:e["font-family"];s.fontFamily=i}else s.fontFamily=t.fontFamily;if(e.hasOwnProperty("size")||e.hasOwnProperty("fontSize")||e.hasOwnProperty("font-size")){var n=e.hasOwnProperty("size")?e.size:e.hasOwnProperty("fontSize")?e.fontSize:e["font-size"];"number"==typeof n&&(n=n.toString()+"px"),s.fontSize=n}else s.fontSize=t.fontSize;if(e.hasOwnProperty("style")||e.hasOwnProperty("fontStyle")||e.hasOwnProperty("font-style")){var o=e.hasOwnProperty("style")?e.style:e.hasOwnProperty("fontStyle")?e.fontStyle:e["font-style"];s.fontStyle=o}else s.fontStyle=t.fontStyle;if(e.hasOwnProperty("color")||e.hasOwnProperty("font-color")?(e.hasOwnProperty("color")?e.color:e["font-color"],s.color=e.color):s.color=t.color,e.hasOwnProperty("stroke")){var a=e.stroke;s.stroke=a.hasOwnProperty("color")?a.color:t.stroke,s.strokeThickness=a.hasOwnProperty("thinkness")?a.thinkness:t.strokeThickness}else s.stroke=t.stroke,s.strokeThickness=t.strokeThickness}if(e.hasOwnProperty("shadow")){var h=e.shadow;s.shadowColor=h.hasOwnProperty("color")?h.color:t.shadowColor,s.shadowOffsetX=h.hasOwnProperty("offsetX")?h.offsetX:t.shadowOffsetX,s.shadowOffsetY=h.hasOwnProperty("offsetY")?h.offsetY:t.shadowOffsetY,s.shadowBlur=h.hasOwnProperty("blur")?h.blur:t.shadowBlur,s.shadowStroke=!0,s.shadowFill=!0}else s.shadowColor=t.shadowColor,s.shadowOffsetX=t.shadowOffsetX,s.shadowOffsetY=t.shadowOffsetY,s.shadowBlur=t.shadowBlur,s.shadowStroke=t.shadowStroke,s.shadowFill=t.shadowFill;if(e.hasOwnProperty("u")||e.hasOwnProperty("underline")){var l=e.hasOwnProperty("u")?e.u:e.underline;s.underlineColor=l.hasOwnProperty("color")?l.color:t.underlineColor,s.underlineThickness=l.hasOwnProperty("thinkness")?l.thinkness:t.underlineThickness,s.underlineOffset=l.hasOwnProperty("offset")?l.offset:t.underlineOffset}else s.underlineColor=t.underlineColor,s.underlineThickness=t.underlineThickness,s.underlineOffset=t.underlineOffset;return s}propToTagText(t,e,s){return e.hasOwnProperty("_class")?""===t&&this.isTextTag(e._class)?"":"<class='"+e._class+"'>"+t+"</class>":e.hasOwnProperty("_style")?"<style='"+e._style+"'>"+t+"</style>":void 0}destroy(){this.tags=void 0}isTextTag(t){var e=this.tags[t];return!!e&&null==e.img}};const g=Phaser.Utils.Objects.GetValue;e.a=class extends i.a{constructor(t,e,s,i,n){var r=g(n,"tags",void 0),o=new c(r);super(t,e,s,i,n,"rexTagText",o),this.parser=o}addTag(t,e){return this.parser.addTag(t,e),this.updateText(!0)}addTags(t){for(var e in t)this.parser.addTag(e,t[e]);return this.updateText(!0)}preDestroy(){super.preDestroy(),this.parser.destroy(),this.parser=void 0}}},9:function(t,e,s){"use strict";var i=s(4);e.a=function(t,e){var s=Array.isArray(t);for(var n in void 0===e?e=s?[]:{}:Object(i.a)(e),s&&(e.length=t.length),t)e[n]=t[n];return e}}}).default});