CVE-2021-4306 (JavaScript, published 2023-01-07T17:15Z)
Description: value: A vulnerability classified as problematic has been found in cronvel terminal-kit up to 2.1.7. Affected is an unknown function. The manipulation leads to inefficient regular expression complexity. Upgrading to version 2.1.8 is able to address this issue. The name of the patch is a2e446cc3927b559d0281683feb9b821e83b758c. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-217620.
Severity: nan (CVSS v3 base score: 7.5)
Weakness: CWE-1333 \u2014 Inefficient Regular Expression Complexity
The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.
Repository: https://github.com/cronvel/terminal-kit
Files changed:
CHANGELOG
SECURITY.md
browser/termkit.js
browser/termkit.min.js
lib/misc.js
package.json
Commit message: Fix a possible ReDoS


Vulnerable code:
// width of a string with a markup, without control chars
	return string.unicode.width( str.replace( /\^\[[^\]]*]|\^(.)/g , ( match , second ) => {
(function(t){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=t()}else if(typeof define==="function"&&define.amd){define([],t)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.TerminalKit=t()}})(function(){var n,t,e;return function(){function f(s,o,a){function u(r,t){if(!o[r]){if(!s[r]){var e="function"==typeof require&&require;if(!t&&e)return e(r,!0);if(l)return l(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=o[r]={exports:{}};s[r][0].call(n.exports,function(t){var e=s[r][1][t];return u(e||t)},n,n.exports,f,s,o,a)}return o[r].exports}for(var l="function"==typeof require&&require,t=0;t<a.length;t++)u(a[t]);return u}return f}()({1:[function(t,e,r){"use strict";const l=t("./termkit.js");const i=[{names:["red"],code:"#e32322"},{names:["orange"],code:"#f18e1c"},{names:["gold","yellow-orange","amber"],code:"#fdc60b"},{names:["yellow"],code:"#f4e500"},{names:["chartreuse","yellow-green"],code:"#8cbb26"},{names:["green"],code:"#25ad28"},{names:["turquoise","turquoise-green"],code:"#1bc17d"},{names:["cyan","turquoise-blue"],code:"#0dc0cd"},{names:["blue"],code:"#2a60b0"},{names:["indigo"],code:"#3b3ba2"},{names:["violet","purple"],code:"#713795"},{names:["magenta"],code:"#bd0a7d"}];const n=[{names:["crimson"],code:"#dc143c"},{names:["vermilion","cinnabar"],code:"#e34234"},{names:["brown"],code:"#a52a2a"},{names:["bronze"],code:"#cd7f32"},{names:["coquelicot"],code:"#ff3800"},{names:["coral-pink"],code:"#f88379"},{names:["see-green"],code:"#2e8b57"},{names:["medium-spring-green"],code:"#00fa9a"},{names:["olivine"],code:"#9ab973"},{names:["royal-blue"],code:"#4169e1"},{names:["purple"],code:"#800080"},{names:["lavender-purple"],code:"#967bb6"},{names:["pink"],code:"#ffc0cb"}];const s={black:0,red:1,green:2,yellow:3,blue:4,magenta:5,violet:5,cyan:6,white:7,grey:8,gray:8,"bright-black":8,"bright-red":9,"bright-green":10,"bright-yellow":11,"bright-blue":12,"bright-magenta":13,"bright-violet":13,"bright-cyan":14,"bright-white":15};function o(t={}){this.term=t.term||l.terminal;this.system=!!t.system;this.adaptivePaletteDef=this.system?null:t.adaptivePaletteDef||i;this.extraPaletteDef=this.system?null:t.extraPaletteDef||n;this.escape=[];this.bgEscape=[];this.chromaColors=[];this.colorIndex={};this.colorNameToIndex=this.colorNameToIndex.bind(this);this.generate()}e.exports=o;o.prototype.colorNameToIndex=function(t){t=t.toLowerCase();return this.colorIndex[t]||l.colorNameToIndex(t)};o.prototype.generate=function(){this.generateDefaultMapping();this.generateAnsiColorNames();this.generateAdaptive();this.generateExtra();this.generateGrayscale()};o.prototype.generateDefaultMapping=function(){var t;for(t=0;t<256;t++){this.escape[t]=this.term.str.color256(t);this.bgEscape[t]=this.term.str.bgColor256(t)}};o.prototype.generateAnsiColorNames=function(){var t,e;for(t in s){e=t.replace(/-/g,"");this.colorIndex[t]=s[t];if(e!==t){this.colorIndex[e]=s[t]}}};o.prototype.generateAdaptive=function(){if(this.system){return}var t,e,r,i,n,s,o,a,u;n=this.adaptivePaletteDef.map(t=>l.chroma(t.code));i=16;for(r=0;r>=-2;r--){if(r>0){o="!".repeat(r)}else if(r<0){o="~".repeat(-r)}else{o=""}for(e=2;e>=-3;e--){if(e>0){a="+".repeat(e)}else if(e<0){a="-".repeat(-e)}else{a=""}u=o+a;for(t=0;t<12;t++){s=this.clStep(n[t],r,e);this.addColor(i,s,this.adaptivePaletteDef[t].names,"@",u);i++}}}};o.prototype.generateExtra=function(){if(this.system){return}var t,e;e=232;for(t=0;t<13&&t<this.extraPaletteDef.length;t++){this.addColor(e,l.chroma(this.extraPaletteDef[t].code),this.extraPaletteDef[t].names,"*");e++}};const a=[["black"],["darkest-gray"],["darker-gray"],["dark-gray"],["dark-medium-gray"],["medium-gray","gray"],["light-medium-gray"],["light-gray"],["lighter-gray"],["lightest-gray"],["white"]];o.prototype.generateGrayscale=function(){if(this.system){return}var t,e,r;e=245;for(t=0;t<=10;t++){r=l.chroma(0,0,10*t,"hcl");this.addColor(e,r,a[t],"@");e++}};o.prototype.getRgb=function(t){var e=this.chromaColors[t];if(!e){return null}var[r,i,n]=e.rgb();return{r:r,g:i,b:n}};o.prototype.addColor=function(r,t,e,i="",n=""){var s,[o,a,u]=t.rgb();this.chromaColors[r]=t;if(this.term.support.trueColor){this.escape[r]=this.term.str.colorRgb(o,a,u);this.bgEscape[r]=this.term.str.bgColorRgb(o,a,u)}else if(this.term.support["256colors"]){s=this.term.registerForRgb({r:o,g:a,b:u},o===a&&a===u?232:0,255);this.escape[r]=this.term.str.color256(s);this.bgEscape[r]=this.term.str.bgColor256(s)}else{s=this.term.registerForRgb({r:o,g:a,b:u},0,15);this.escape[r]=this.term.str.color256(s);this.bgEscape[r]=this.term.str.bgColor256(s)}e.forEach(t=>{var e=i+t.replace(/-/g,"")+n;t=i+t+n;this.colorIndex[t]=r;if(e!==t){this.colorIndex[e]=r}})};const f=1.1;o.prototype.clStep=function(t,e,r,i=true){var n,s,o,a,u,l;if(!e&&!r){return t}n=t.get("hcl.c");s=t.get("hcl.l");n*=(e>0?1.6:1.7)**e;s*=(r>0?1.2:1.35)**r;t=t.set("hcl.c",n).set("hcl.l",s);if(!i||!t.clipped){return t}l=Math.abs(r)>=e;for(;;){o=t._rgb._unclipped;o.length=3;if(o.every(t=>t>-5&&t<260)){return t}u=[...o].sort();if(u[2]>=256){a=(u[0]+u[1]+u[2])/3;if(l){n=t.get("hcl.c");n/=f;t=t.set("hcl.c",n)}else{s=t.get("hcl.l");s/=f;t=t.set("hcl.l",s)}if(a>255){return t}}else if(u[1]<0){a=(u[0]+u[1]+u[2])/3;if(l){n=t.get("hcl.c");n/=f;t=t.set("hcl.c",n)}else{s=t.get("hcl.l");s*=f;t=t.set("hcl.l",s)}if(a<0){return t}}else{return t}}}},{"./termkit.js":50}],2:[function(t,e,r){"use strict";const s=t("./termkit.js");function d(t,e,r,i){var n=t;this.xmin=0;this.xmax=0;this.ymin=0;this.ymax=0;this.width=0;this.height=0;this.isNull=true;if(n&&(typeof n==="object"||typeof n==="function")){if(n instanceof s.Terminal){this.set({xmin:1,ymin:1,xmax:n.width,ymax:n.height})}else if(n instanceof s.ScreenBuffer){this.set({xmin:0,ymin:0,xmax:n.width-1,ymax:n.height-1})}else if(n instanceof s.TextBuffer){this.set({xmin:0,ymin:0,xmax:n.width-1,ymax:n.height-1})}else if(n instanceof d){this.set(n)}else if(n.xmin!==undefined||n.ymin!==undefined||n.xmax!==undefined||n.ymax!==undefined){this.set({xmin:n.xmin!==undefined?n.xmin:0,ymin:n.ymin!==undefined?n.ymin:0,xmax:n.xmax!==undefined?n.xmax:1,ymax:n.ymax!==undefined?n.ymax:1})}else if(n.x!==undefined||n.y!==undefined||n.width!==undefined||n.height!==undefined){this.set({xmin:n.x!==undefined?n.x:0,ymin:n.y!==undefined?n.y:0,xmax:n.width!==undefined?n.x+n.width-1:1,ymax:n.height!==undefined?n.y+n.height-1:1})}}else{this.set({xmin:t!==undefined?t:0,ymin:e!==undefined?e:0,xmax:r!==undefined?r:1,ymax:i!==undefined?i:1})}}e.exports=d;d.create=(...t)=>new d(...t);d.prototype.set=function(t){if(t.xmin!==undefined){this.xmin=Math.floor(t.xmin)}if(t.xmax!==undefined){this.xmax=Math.floor(t.xmax)}if(t.ymin!==undefined){this.ymin=Math.floor(t.ymin)}if(t.ymax!==undefined){this.ymax=Math.floor(t.ymax)}this.width=this.xmax-this.xmin+1;this.height=this.ymax-this.ymin+1;this.isNull=this.xmin>this.xmax||this.ymin>this.ymax};d.prototype.setSize=function(t){if(t.width!==undefined){this.width=Math.floor(t.width);this.xmax=this.xmin+this.width-1}if(t.height!==undefined){this.height=Math.floor(t.height);this.ymax=this.ymin+this.height-1}this.isNull=this.xmin>this.xmax||this.ymin>this.ymax};d.prototype.isInside=function(t,e){return t>=this.xmin&&t<=this.xmax&&e>=this.ymin&&e<=this.ymax};d.prototype.clip=function(t,e,r,i){var n=this;e=e||0;r=r||0;n.set({xmin:Math.max(n.xmin,t.xmin-e),ymin:Math.max(n.ymin,t.ymin-r),xmax:Math.min(n.xmax,t.xmax-e),ymax:Math.min(n.ymax,t.ymax-r)});if(i){t.set({xmin:Math.max(t.xmin,n.xmin+e),ymin:Math.max(t.ymin,n.ymin+r),xmax:Math.min(t.xmax,n.xmax+e),ymax:Math.min(t.ymax,n.ymax+r)})}return this};d.prototype.merge=function(t){this.set({xmin:Math.min(this.xmin,t.xmin),ymin:Math.min(this.ymin,t.ymin),xmax:Math.max(this.xmax,t.xmax),ymax:Math.max(this.ymax,t.ymax)});return this};d.wrappingRect=function(t){var e=[],r,i,n,s;r={srcRect:new d(t.srcRect),dstRect:new d(t.dstRect),offsetX:t.offsetX,offsetY:t.offsetY};if(t.wrapOnly!=="y"){r.offsetX=r.offsetX%t.dstRect.width;if(r.offsetX<0){r.offsetX+=t.dstRect.width}}if(t.wrapOnly!=="x"){r.offsetY=r.offsetY%t.dstRect.height;if(r.offsetY<0){r.offsetY+=t.dstRect.height}}r.srcRect.clip(r.dstRect,r.offsetX,r.offsetY,true);if(!r.srcRect.isNull){e.push(r)}if(r.srcRect.width<t.srcRect.width&&t.wrapOnly!=="y"){i={srcRect:new d(t.srcRect),dstRect:new d(t.dstRect),offsetX:r.offsetX-t.dstRect.width,offsetY:r.offsetY};i.srcRect.clip(i.dstRect,i.offsetX,i.offsetY,true);if(!i.srcRect.isNull){e.push(i)}}if(r.srcRect.height<t.srcRect.height&&t.wrapOnly!=="x"){n={srcRect:new d(t.srcRect),dstRect:new d(t.dstRect),offsetX:r.offsetX,offsetY:r.offsetY-t.dstRect.height};n.srcRect.clip(n.dstRect,n.offsetX,n.offsetY,true);if(!n.srcRect.isNull){e.push(n)}}if(i&&n){s={srcRect:new d(t.srcRect),dstRect:new d(t.dstRect),offsetX:r.offsetX-t.dstRect.width,offsetY:r.offsetY-t.dstRect.height};s.srcRect.clip(s.dstRect,s.offsetX,s.offsetY,true);if(!s.srcRect.isNull){e.push(s)}}return e};d.regionIterator=function(t,e){var r,i,n,s,o,a,u,l,f;if(!t.multiply){t.multiply=1}if(!t.offsetX){t.offsetX=0}if(!t.offsetY){t.offsetY=0}if(t.dstClipRect){t.dstClipRect.clip(t.dstRect)}else{t.dstClipRect=new d(t.dstRect)}if(t.srcClipRect){t.srcClipRect.clip(t.srcRect)}else{t.srcClipRect=new d(t.srcRect)}t.srcClipRect.clip(t.dstClipRect,t.offsetX,t.offsetY,true);if(t.dstRect.isNull||t.srcClipRect.isNull||t.dstClipRect.isNull){return}switch(t.type){case"line":for(i=0;i<t.srcClipRect.height;i++){s=t.srcClipRect.ymin+i;a=t.dstClipRect.ymin+i;e({context:t.context,srcXmin:t.srcClipRect.xmin,srcXmax:t.srcClipRect.xmax,srcY:s,srcStart:(s*t.srcRect.width+t.srcClipRect.xmin)*t.multiply,srcEnd:(s*t.srcRect.width+t.srcClipRect.xmax+1)*t.multiply,dstXmin:t.dstClipRect.xmin,dstXmax:t.dstClipRect.xmax,dstY:a,dstStart:(a*t.dstRect.width+t.dstClipRect.xmin)*t.multiply,dstEnd:(a*t.dstRect.width+t.dstClipRect.xmax+1)*t.multiply})}break;case"reversedLine":for(i=t.srcClipRect.height-1;i>=0;i--){s=t.srcClipRect.ymin+i;a=t.dstClipRect.ymin+i;e({context:t.context,srcXmin:t.srcClipRect.xmin,srcXmax:t.srcClipRect.xmax,srcY:s,srcStart:(s*t.srcRect.width+t.srcClipRect.xmin)*t.multiply,srcEnd:(s*t.srcRect.width+t.srcClipRect.xmax+1)*t.multiply,dstXmin:t.dstClipRect.xmin,dstXmax:t.dstClipRect.xmax,dstY:a,dstStart:(a*t.dstRect.width+t.dstClipRect.xmin)*t.multiply,dstEnd:(a*t.dstRect.width+t.dstClipRect.xmax+1)*t.multiply})}break;case"cell":for(i=0;i<t.srcClipRect.height;i++){for(r=0;r<t.srcClipRect.width;r++){n=t.srcClipRect.xmin+r;s=t.srcClipRect.ymin+i;o=t.dstClipRect.xmin+r;a=t.dstClipRect.ymin+i;u=(s*t.srcRect.width+n)*t.multiply;l=(a*t.dstRect.width+o)*t.multiply;f=e({context:t.context,srcX:n,srcY:s,srcStart:u,srcEnd:u+t.multiply,dstX:o,dstY:a,dstStart:l,dstEnd:l+t.multiply,startOfBlitLine:!r,endOfBlitLine:r===t.srcClipRect.width-1});if(f){r++}}}break}};d.tileIterator=function(t,e){var r,i,n,s,o,a,u,l,f,h,c;if(!t.multiply){t.multiply=1}if(!t.offsetX){t.offsetX=0}if(!t.offsetY){t.offsetY=0}if(t.dstClipRect){t.dstClipRect.clip(t.dstRect)}else{t.dstClipRect=new d(t.dstRect)}if(t.srcClipRect){t.srcClipRect.clip(t.srcRect)}else{t.srcClipRect=new d(t.srcRect)}switch(t.type){case"cell":for(a=0;a<t.dstClipRect.height;a++){i=(a-t.offsetY)%t.srcClipRect.height;if(i<0){i+=t.srcClipRect.height}for(o=0;o<t.dstClipRect.width;o++){r=(o-t.offsetX)%t.srcClipRect.width;if(r<0){r+=t.srcClipRect.width}n=t.srcClipRect.xmin+r;s=t.srcClipRect.ymin+i;u=t.dstClipRect.xmin+o;l=t.dstClipRect.ymin+a;h=(s*t.srcRect.width+n)*t.multiply;c=(l*t.dstRect.width+u)*t.multiply;e({context:t.context,srcX:n,srcY:s,srcStart:h,srcEnd:h+t.multiply,dstX:u,dstY:l,dstStart:c,dstEnd:c+t.multiply})}}break;case"line":for(a=0;a<t.dstClipRect.height;a++){i=(a-t.offsetY)%t.srcClipRect.height;if(i<0){i+=t.srcClipRect.height}o=0;while(o<t.dstClipRect.width){r=(o-t.offsetX)%t.srcClipRect.width;if(r<0){r+=t.srcClipRect.width}f=Math.min(t.srcClipRect.width-r,t.dstClipRect.width-o);n=t.srcClipRect.xmin+r;s=t.srcClipRect.ymin+i;u=t.dstClipRect.xmin+o;l=t.dstClipRect.ymin+a;h=(s*t.srcRect.width+n)*t.multiply;c=(l*t.dstRect.width+u)*t.multiply;e({context:t.context,srcXmin:n,srcXmax:n+f-1,srcY:s,srcStart:h,srcEnd:h+f*t.multiply,dstXmin:u,dstXmax:u+f-1,dstY:l,dstStart:c,dstEnd:c+f*t.multiply});o+=f}}break}};d.wrapIterator=function(t,e){var r,i;i=d.wrappingRect({dstRect:t.dstClipRect,srcRect:t.srcClipRect,offsetX:t.offsetX,offsetY:t.offsetY,wrapOnly:t.wrap});for(r=0;r<i.length;r++){t.dstClipRect=i[r].dstRect;t.srcClipRect=i[r].srcRect;t.offsetX=i[r].offsetX;t.offsetY=i[r].offsetY;d.regionIterator(t,e)}}},{"./termkit.js":50}],3:[function(r,M,t){(function(I){(function(){"use strict";const t=r("./misc.js");const o=r("fs");const b=r("string-kit");const e=r("nextgen-events");function d(t={}){this.dst=t.dst;this.inline=!!t.inline;this.width=Math.floor(t.width)||(t.dst?t.dst.width:1);this.height=Math.floor(t.height)||(t.dst?t.dst.height:1);this.x=t.x!==undefined?t.x:t.dst&&t.dst instanceof m.Terminal?1:0;this.y=t.y!==undefined?t.y:t.dst&&t.dst instanceof m.Terminal?1:0;this.cx=0;this.cy=0;this.ch=false;this.lastCh=null;this.lastBuffer=null;this.lastBufferUpToDate=false;this.blending=t.blending||false;this.wrap=!!t.wrap;this.buffer=I.allocUnsafe(this.width*this.height*this.ITEM_SIZE);this.palette=t.palette||this.dst&&this.dst.palette;if(!t.noFill){this.fill()}}M.exports=d;d.prototype=Object.create(e.prototype);d.prototype.constructor=d;d.prototype.bitsPerColor=8;d.create=(...t)=>new d(...t);const m=r("./termkit.js");const h=m.Rect;d.createFromString=function(t,e){var r,i,n,s,o,a,u,l,f;if(!t){t={}}if(typeof e!=="string"){if(!e.toString){throw new Error("[terminal] ScreenBuffer.createFromDataString(): argument #1 should be a string or provide a .toString() method.")}e=e.toString()}e=m.stripControlChars(e,true).split("\n");a=0;u=e.length;s=t.attr!==undefined?t.attr:d.prototype.DEFAULT_ATTR;if(s&&typeof s==="object"&&!s.BYTES_PER_ELEMENT){s=d.object2attr(s)}o=s;if(t.transparencyChar){if(!t.transparencyType){o|=T}else{o|=t.transparencyType&T}}for(i=0;i<e.length;i++){l=b.unicode.width(e[i]);if(l>a){a=l}}f=new d({width:a,height:u});for(i=0;i<e.length;i++){if(!t.transparencyChar){f.put({x:0,y:i,attr:s},e[i])}else{n=e[i].length;for(r=0;r<n;r++){if(e[i][r]===t.transparencyChar){f.put({x:r,y:i,attr:o},e[i][r])}else{f.put({x:r,y:i,attr:s},e[i][r])}}}}return f};d.createFromChars=d.createFromString;d.prototype.setClearAttr=function(t){this.CLEAR_ATTR=this.object2attr(t);this.CLEAR_BUFFER=I.allocUnsafe(this.ITEM_SIZE);if(I.isBuffer(this.CLEAR_ATTR)){this.CLEAR_ATTR.copy(this.CLEAR_BUFFER)}else{this.CLEAR_BUFFER.writeInt32BE(this.CLEAR_ATTR,0)}this.CLEAR_BUFFER.write(" \0\0\0",this.ATTR_SIZE)};d.prototype.fill=function(t){var e,r,i,n,s,o,a,u,l=this.CLEAR_BUFFER,f=this.buffer;if(t&&typeof t==="object"){if(t.char||t.attr){l=I.allocUnsafe(this.ITEM_SIZE);r=t.attr!==undefined?t.attr:this.DEFAULT_ATTR;if(r&&typeof r==="object"&&!r.BYTES_PER_ELEMENT){r=this.object2attr(r)}this.writeAttr(l,r,0);i=t.char&&typeof t.char==="string"?t.char:" ";i=b.unicode.firstChar(m.stripControlChars(i));this.writeChar(l,i,0)}else if(t.clearBuffer){l=t.clearBuffer}if(t.buffer){f=t.buffer}n=t.start?Math.floor(t.start/this.ITEM_SIZE):0;s=t.end?Math.floor(t.end/this.ITEM_SIZE):f.length/this.ITEM_SIZE;o=t.region?t.region:null}else{n=0;s=f.length/this.ITEM_SIZE}if(o){a=new h(0,0,0,0);u=new h(o);u.clip(new h(this));if(u.isNull){return}h.tileIterator({type:"line",context:{srcBuffer:l,dstBuffer:this.buffer},srcRect:a,dstRect:new h(this),dstClipRect:u,multiply:this.ITEM_SIZE},this.blitterLineIterator.bind(this))}else{for(e=n;e<s;e++){l.copy(f,e*this.ITEM_SIZE)}}};d.prototype.clear=d.prototype.fill;d.prototype.preserveMarkupFormat=t.preserveMarkupFormat;d.prototype.markupOptions=t.markupOptions;d.prototype.put=function(u,t,...e){var r,i,l,f,h,c,d,p,n,g,s,y;if(!u){u={}}y=u.wrap!==undefined?u.wrap:this.wrap;l=h=Math.floor(u.x!==undefined?u.x:this.cx);f=c=Math.floor(u.y!==undefined?u.y:this.cy);d=1;p=0;switch(u.direction){case"left":d=-1;break;case"up":d=0;p=-1;break;case"down":d=0;p=1;break;case null:case"none":d=0;p=0;break}if(typeof u.dx==="number"){d=u.dx}if(typeof u.dy==="number"){p=u.dy}g=u.attr!==undefined?u.attr:this.DEFAULT_ATTR;if(g&&typeof g==="object"&&!g.BYTES_PER_ELEMENT){g=this.object2attr(g)}n=g;if(u.resumeAttr!==undefined){g=u.resumeAttr}if(typeof t!=="string"){if(t.toString){t=t.toString()}else{return}}if(e.length){t=u.markup===true?this.preserveMarkupFormat(t,...e):b.format(t,...e)}i=false;r=null;switch(u.markup){case"ansi":r=m.parseAnsi;break;case"legacyAnsi":r=m.parseAnsi;i=true;break;case true:r=m.parseMarkup;break}var o=t=>{var e,r,i,n,s=b.unicode.toArray(t),o,a=s.length;for(o=0;o<a;o++){r=(c*this.width+h)*this.ITEM_SIZE;i=s[o];n=i.charCodeAt(0);if(n<32||n===127){if(u.newLine&&(n===10||n===13)){if(d){h=l;c++}else{c=f;h++}continue}else{i=" ";n=32}}e=b.unicode.isFullWidth(i);if(e){if(h+e*d>=0&&h+e*(d||1)<this.width&&c>=0&&c<this.height){if(d<0){r-=this.ITEM_SIZE}if(this.hasTrailingFullWidth(this.buffer,r)&&h){this.removeFullWidth(this.buffer,r-this.ITEM_SIZE)}this.writeAttr(this.buffer,g,r,this.LEADING_FULLWIDTH);this.writeChar(this.buffer,i,r);r+=this.ITEM_SIZE;if(this.hasLeadingFullWidth(this.buffer,r)&&h<this.width-1){this.removeFullWidth(this.buffer,r+this.ITEM_SIZE)}this.writeAttr(this.buffer,g,r,this.TRAILING_FULLWIDTH);this.writeChar(this.buffer," ",r)}}else if(h>=0&&h<this.width&&c>=0&&c<this.height){if(this.hasLeadingFullWidth(this.buffer,r)&&h<this.width-1){this.removeFullWidth(this.buffer,r+this.ITEM_SIZE)}else if(this.hasTrailingFullWidth(this.buffer,r)&&h){this.removeFullWidth(this.buffer,r-this.ITEM_SIZE)}this.writeAttr(this.buffer,g,r);this.writeChar(this.buffer,i,r)}h+=d*(1+e);c+=p;if(y){if(h<0){h=this.width-1;c--}else if(h>=this.width){h=0;c++}}}};if(!u.markup){o(t)}else{s=this.attr2object(g);r(t,this.markupOptions).forEach(t=>{if(typeof t==="string"){o(t)}else{if(t.markup.reset){g=t.markup.special?this.DEFAULT_ATTR:n;s=this.attr2object(g)}else{Object.assign(s,t.markup);if(s.defaultColor&&s.color){delete s.defaultColor}if(s.bgDefaultColor&&s.bgColor){delete s.bgDefaultColor}g=this.object2attr(s,undefined,i)}if(t.markup.raw){o(t.markup.raw)}}})}this.cx=h;this.cy=c;return g};d.prototype.get=function(t){var e,r,i;if(!t){t={}}e=t.x!==undefined?t.x:this.cx;r=t.y!==undefined?t.y:this.cy;if(typeof e!=="number"||e<0||e>=this.width){return null}e=Math.floor(e);if(typeof r!=="number"||r<0||r>=this.height){return null}r=Math.floor(r);i=(r*this.width+e)*this.ITEM_SIZE;return{attr:this.attr2object(this.readAttr(this.buffer,i)),char:this.readChar(this.buffer,i)}};d.prototype.resize=function(t){t=new h(t);var e=-t.xmin,r=-t.ymin;var i=new h({xmin:0,ymin:0,xmax:t.width-1,ymax:t.height-1});t.clip(new h(this));if(i.isNull){return false}var n=I.allocUnsafe(i.width*i.height*this.ITEM_SIZE);this.fill({buffer:n});h.regionIterator({type:"line",context:{srcBuffer:this.buffer,dstBuffer:n},dstRect:i,dstClipRect:new h(i),srcRect:new h(this),srcClipRect:t,offsetX:e,offsetY:r,multiply:this.ITEM_SIZE},this.blitterLineIterator.bind(this));this.width=i.width;this.height=i.height;this.buffer=n;this.lastBuffer=null;this.emit("resize",this.width,this.height);return true};d.prototype.draw=function(t){if(!t||typeof t!=="object"){t={}}var e={dst:t.dst||this.dst,inline:t.inline!==undefined?!!t.inline:this.inline,offsetX:t.x!==undefined?Math.floor(t.x):Math.floor(this.x),offsetY:t.y!==undefined?Math.floor(t.y):Math.floor(this.y),dstClipRect:t.dstClipRect?new h(t.dstClipRect):undefined,srcClipRect:t.srcClipRect?new h(t.srcClipRect):undefined,delta:t.delta,blending:t.blending!==undefined?t.blending:this.blending,wrap:t.wrap,tile:t.tile};if(e.dst instanceof d){return this.blitter(e)}else if(e.dst instanceof m.Terminal){return this.terminalBlitter(e)}};d.prototype.moveTo=function(t,e){this.cx=Math.max(0,Math.min(t,this.width-1));this.cy=Math.max(0,Math.min(e,this.height-1))};d.prototype.drawCursor=function(t){if(!t||typeof t!=="object"){t={}}var e=t.dst||this.dst;if(e instanceof d){if(this.ch){e.ch=true}else{e.ch=false;e.moveTo(this.cx+this.x,this.cy+this.y)}}else if(e instanceof m.Terminal){if(this.ch){if(this.ch!==this.lastCh){e.hideCursor()}}else{if(this.ch!==this.lastCh){e.hideCursor(false)}e.moveTo(Math.max(1,Math.min(this.cx+this.x,e.width)),Math.max(1,Math.min(this.cy+this.y,e.height)))}this.lastCh=this.ch}};d.prototype.blitter=function(t){var e,r,i;e={type:"line",context:{srcBuffer:this.buffer,dstBuffer:t.dst.buffer,blending:t.blending},dstRect:new h(t.dst),srcRect:new h(this),dstClipRect:t.dstClipRect||new h(t.dst),srcClipRect:t.srcClipRect||new h(this),offsetX:t.offsetX,offsetY:t.offsetY,wrap:t.wrap,tile:t.tile,multiply:this.ITEM_SIZE};r="regionIterator";i=this.blitterLineIterator.bind(this);if(t.blending){e.type="cell";i=this.blitterCellBlendingIterator.bind(this)}if(t.wrap){r="wrapIterator"}else if(t.tile){r="tileIterator"}else{r="regionIterator"}h[r](e,i)};d.prototype.blitterLineIterator=function(t){if(t.dstStart>=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart,t.srcStart,t.srcEnd);this.removeLeadingFullWidth(t.context.dstBuffer,t.dstEnd-this.ITEM_SIZE);if(t.dstEnd<t.context.dstBuffer.length){this.removeTrailingFullWidth(t.context.dstBuffer,t.dstEnd)}};d.prototype.blitterCellBlendingIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart),r=e&T;if(r===T){return}if(t.startOfBlitLine&&t.dstStart>=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}if(t.endOfBlitLine&&t.dstEnd<t.context.dstBuffer.length){this.removeTrailingFullWidth(t.context.dstBuffer,t.dstEnd)}if(r===i&&!(t.endOfBlitLine||!(e&s))){t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart,t.srcStart,t.srcEnd);return}if(!(r&a)){t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart+3,t.srcStart+3,t.srcStart+4)}if(!(r&u)){t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart+2,t.srcStart+2,t.srcStart+3)}if(!(r&C)){t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart+1,t.srcStart+1,t.srcStart+2)}if(!(r&k)){if(t.endOfBlitLine&&e&s){this.writeChar(t.context.dstBuffer," ",t.dstStart)}else{t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart+this.ATTR_SIZE,t.srcStart+this.ATTR_SIZE,t.srcEnd)}}};d.prototype.terminalBlitter=function(t){var e,r,i,n;n={srcBuffer:this.buffer,blending:t.blending,term:t.dst,inline:t.inline,deltaEscapeSequence:t.dst.support.deltaEscapeSequence,rawTerm:t.dst.raw,lastAttr:null,sequence:"",cells:0,moves:0,attrs:0,writes:0};e={type:"line",context:n,dstRect:new h(t.dst),srcRect:new h(this),dstClipRect:t.dstClipRect,srcClipRect:t.srcClipRect,offsetX:t.offsetX,offsetY:t.offsetY,multiply:this.ITEM_SIZE};if(t.inline){e.dstRect.setSize({height:Infinity})}if(t.delta&&!t.inline){if(!this.lastBuffer||this.lastBuffer.length!==this.buffer.length){this.lastBuffer=I.from(this.buffer);i=this.terminalBlitterLineIterator.bind(this)}else if(this.lastBufferUpToDate){n.srcLastBuffer=this.lastBuffer;i=this.terminalBlitterCellIterator.bind(this);e.type="cell"}else{this.buffer.copy(this.lastBuffer);i=this.terminalBlitterLineIterator.bind(this)}this.lastBufferUpToDate=true}else{this.lastBufferUpToDate=false;i=this.terminalBlitterLineIterator.bind(this)}if(t.wrap){r="wrapIterator"}else if(t.tile){r="tileIterator"}else{r="regionIterator"}h[r](e,i);if(n.sequence.length){n.rawTerm(n.sequence);n.writes++}return{cells:n.cells,moves:n.moves,attrs:n.attrs,writes:n.writes}};d.prototype.terminalBlitterLineIterator=function(t){var e,r;if(!t.context.inline){t.context.sequence+=t.context.term.optimized.moveTo(t.dstXmin,t.dstY);t.context.moves++}for(e=t.srcStart;e<t.srcEnd;e+=this.ITEM_SIZE){r=this.readAttr(t.context.srcBuffer,e);if((r&T)===T){t.context.sequence+=t.context.term.optimized.right;continue}else if(r&A){continue}if((r&n)!==(t.context.lastAttr&n)){t.context.sequence+=t.context.lastAttr===null||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,r):this.generateDeltaEscapeSequence(t.context.term,r,t.context.lastAttr);t.context.lastAttr=r}t.context.sequence+=this.readChar(t.context.srcBuffer,e);t.context.cells++}if(t.context.inline){t.context.sequence+=t.context.term.optimized.styleReset+"\n";t.context.attrs++;t.context.lastAttr=null}if(t.context.sequence.length>O){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}};d.prototype.terminalBlitterCellIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);if(t.context.srcLastBuffer){if(e===this.readAttr(t.context.srcLastBuffer,t.srcStart)&&this.readChar(t.context.srcBuffer,t.srcStart)===this.readChar(t.context.srcLastBuffer,t.srcStart)){return}t.context.srcBuffer.copy(t.context.srcLastBuffer,t.srcStart,t.srcStart,t.srcEnd)}if((e&T)===T||e&A){return}t.context.cells++;if(t.dstX!==t.context.cx||t.dstY!==t.context.cy){t.context.sequence+=t.context.term.optimized.moveTo(t.dstX,t.dstY);t.context.moves++}if((e&n)!==(t.context.lastAttr&n)){t.context.sequence+=t.context.lastAttr===null||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,e):this.generateDeltaEscapeSequence(t.context.term,e,t.context.lastAttr);t.context.lastAttr=e;t.context.attrs++}t.context.sequence+=this.readChar(t.context.srcBuffer,t.srcStart);if(t.context.sequence.length>O){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}t.context.cy=t.dstY;if(e&s){t.context.cx=t.dstX+2;return true}t.context.cx=t.dstX+1};d.fromNdarrayImage=function(t,e){var r=e.terminal||m.terminal;var i,n=t.shape[0],s,o=Math.ceil(t.shape[1]/2),a=t.shape[2]===4,u=r.support["256colors"]?255:15,l,f,h={};var c=new d({width:n,height:o,blending:true,noFill:true});for(i=0;i<n;i++){for(s=0;s<o;s++){l=r.registerForRgbCache(h,t.get(i,s*2,0),t.get(i,s*2,1),t.get(i,s*2,2),0,u,1);if(s*2+1<t.shape[1]){f=r.registerForRgbCache(h,t.get(i,s*2+1,0),t.get(i,s*2+1,1),t.get(i,s*2+1,2),0,u,1);c.put({x:i,y:s,attr:{color:l,fgTransparency:a&&t.get(i,s*2,3)<127,bgColor:f,bgTransparency:a&&t.get(i,s*2+1,3)<127}},"▀")}else{c.put({x:i,y:s,attr:{color:l,fgTransparency:a&&t.get(i,s*2,3)<127,bgTransparency:true}},"▀")}}}return c};d.loadImage=m.image.load.bind(d,d.fromNdarrayImage);d.prototype.dumpChars=function(){var t,e,r,i="";for(t=0;t<this.height;t++){for(e=0;e<this.width;e++){r=(t*this.width+e)*this.ITEM_SIZE;i+=this.readChar(this.buffer,r)}i+="\n"}return i};d.prototype.dump=function(){var t,e,r,i="",n;for(t=0;t<this.height;t++){for(e=0;e<this.width;e++){r=(t*this.width+e)*this.ITEM_SIZE;n=this.readChar(this.buffer,r);i+=n+(b.unicode.isFullWidth(n)?" ":"  ");i+=b.format("%x%x%x%x ",this.buffer.readUInt8(r),this.buffer.readUInt8(r+1),this.buffer.readUInt8(r+2),this.buffer.readUInt8(r+3))}i+="\n"}return i};d.prototype.readAttr=function(t,e){return t.readInt32BE(e)};d.prototype.writeAttr=function(t,e,r,i=0){return t.writeInt32BE(e|i,r)};d.prototype.hasLeadingFullWidth=function(t,e){return!!(t.readInt32BE(e)&s)};d.prototype.hasTrailingFullWidth=function(t,e){return!!(t.readInt32BE(e)&A)};d.prototype.removeLeadingFullWidth=function(t,e){var r=t.readInt32BE(e);if(!(r&s)){return}r^=s;t.writeInt32BE(r,e);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};d.prototype.removeTrailingFullWidth=function(t,e){var r=t.readInt32BE(e);if(!(r&A)){return}r^=A;t.writeInt32BE(r,e);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};d.prototype.removeFullWidth=function(t,e){var r=t.readInt32BE(e);if(!(r&R)){return}r=r&B;t.writeInt32BE(r,e);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};d.prototype.readChar=function(t,e){var r;e+=this.ATTR_SIZE;if(t[e]<128){r=1}else if(t[e]<192){return"\0"}else if(t[e]<224){r=2}else if(t[e]<240){r=3}else if(t[e]<248){r=4}else if(t[e]<252){r=5}else{r=6}if(r>this.CHAR_SIZE){return"\0"}return t.toString("utf8",e,e+r)};d.prototype.writeChar=function(t,e,r){return t.write(e,r+this.ATTR_SIZE,this.CHAR_SIZE)};d.prototype.generateEscapeSequence=function(t,e){var r=this.palette||t.palette;var i=t.optimized.styleReset+(e&S?t.optimized.defaultColor:r.escape[e&255])+(e&E?t.optimized.bgDefaultColor:r.bgEscape[e>>>8&255]);if(e&f){i+=t.optimized.bold}if(e&c){i+=t.optimized.dim}if(e&p){i+=t.optimized.italic}if(e&g){i+=t.optimized.underline}if(e&y){i+=t.optimized.blink}if(e&v){i+=t.optimized.inverse}if(e&w){i+=t.optimized.hidden}if(e&_){i+=t.optimized.strike}return i};d.prototype.generateDeltaEscapeSequence=function(t,e,r){var i=this.palette||t.palette;var n="",s=e&255,o=r&255,a=e>>>8&255,u=r>>>8&255;if(e&S){if(!(r&S)){n+=t.optimized.defaultColor}}else if(s!==o||r&S){n+=i.escape[s]}if(e&E){if(!(r&E)){n+=t.optimized.bgDefaultColor}}else if(a!==u||r&E){n+=i.bgEscape[a]}if((e&l)!==(r&l)){if((e&x)!==(r&x)){if(r&f&&!(e&f)||r&c&&!(e&c)){n+=t.optimized.noBold;if(e&f){n+=t.optimized.bold}if(e&c){n+=t.optimized.dim}}else{if(e&f&&!(r&f)){n+=t.optimized.bold}if(e&c&&!(r&c)){n+=t.optimized.dim}}}if((e&p)!==(r&p)){n+=e&p?t.optimized.italic:t.optimized.noItalic}if((e&g)!==(r&g)){n+=e&g?t.optimized.underline:t.optimized.noUnderline}if((e&y)!==(r&y)){n+=e&y?t.optimized.blink:t.optimized.noBlink}if((e&v)!==(r&v)){n+=e&v?t.optimized.inverse:t.optimized.noInverse}if((e&w)!==(r&w)){n+=e&w?t.optimized.hidden:t.optimized.noHidden}if((e&_)!==(r&_)){n+=e&_?t.optimized.strike:t.optimized.noStrike}}return n};d.prototype.vScroll=function(t,e,r,i,n){if(!t){return}if(typeof e==="boolean"){n=e;e=r=i=undefined}if(e===undefined||e===null){e=this.DEFAULT_ATTR}else if(e&&typeof e==="object"&&!e.BYTES_PER_ELEMENT){e=this.object2attr(e)}if(r===undefined||r===null){r=0;i=this.height-1}else{if(r<0){r=0}if(i>this.height-1){i=this.height-1}}var s=t*this.width*this.ITEM_SIZE,o=r*this.width*this.ITEM_SIZE,a=(i+1)*this.width*this.ITEM_SIZE;if(s>0){this.buffer.copy(this.buffer,o+s,o,a-s);this.fill({start:o,end:o+s})}else{this.buffer.copy(this.buffer,o,o-s,a);this.fill({start:a+s,end:a})}if(n&&this.dst instanceof m.Terminal){if(this.lastBufferUpToDate&&this.lastBuffer){if(s>0){this.lastBuffer.copy(this.lastBuffer,o+s,o,a-s);this.fill({buffer:this.lastBuffer,start:o,end:o+s})}else{this.lastBuffer.copy(this.lastBuffer,o,o-s,a);this.fill({buffer:this.lastBuffer,start:a+s,end:a})}}this.dst.scrollingRegion(this.y+r,this.y+i);if(t>0){this.dst.scrollDown(t)}else{this.dst.scrollUp(-t)}this.dst.resetScrollingRegion()}};d.prototype.copyRegion=function(t,e,r,i){var n=new h(this),s=new h(t),o=new h(e);o.setSize(s);s.clip(n);o.clip(n);if(s.isNull){return}if(!o.isNull){h.regionIterator({type:o.ymin-s.ymin>0?"reversedLine":"line",context:{srcBuffer:this.buffer,dstBuffer:this.buffer},srcRect:new h(this),srcClipRect:s,dstRect:new h(this),dstClipRect:o,offsetX:o.xmin-s.xmin,offsetY:o.ymin-s.ymin,multiply:this.ITEM_SIZE},this.blitterLineIterator.bind(this))}if(r){throw new Error("Move is not coded ATM")}};d.attr2object=function(t){var e={};if(t&S){e.color=0;e.defaultColor=true}else{e.color=t&255}if(t&E){e.bgColor=0;e.bgDefaultColor=true}else{e.bgColor=t>>>8&255}if(t&f){e.bold=true}if(t&c){e.dim=true}if(t&p){e.italic=true}if(t&g){e.underline=true}if(t&y){e.blink=true}if(t&v){e.inverse=true}if(t&w){e.hidden=true}if(t&_){e.strike=true}if(t&a){e.fgTransparency=true}if(t&u){e.bgTransparency=true}if(t&C){e.styleTransparency=true}if(t&k){e.charTransparency=true}if((t&T)===T){e.transparency=true}return e};d.prototype.attr2object=d.attr2object;d.object2attr=function(t,e,r=false){var i=0,n=false,s=false;if(!t||typeof t!=="object"){t={}}e=e||m.colorNameToIndex;if(t.bold){if(r){n=true}else{i|=f}}if(t.dim){i|=c}if(t.italic){i|=p}if(t.underline){i|=g}if(t.blink){if(r){s=true}else{i|=y}}if(t.inverse){i|=v}if(t.hidden){i|=w}if(t.strike){i|=_}if(typeof t.color==="string"){if(t.color==="default"){t.color=0;t.defaultColor=true}else{t.color=e(t.color)}}if(typeof t.color!=="number"||t.color<0||t.color>255){t.color=0;t.defaultColor=true}else{t.color=Math.floor(t.color);if(r&&t.color<=15){if(n&&t.color<=7){t.color+=8}else if(!n&&t.color>=8){t.color-=8}}}i+=t.color;if(typeof t.bgColor==="string"){if(t.bgColor==="default"){t.bgColor=0;t.bgDefaultColor=true}else{t.bgColor=e(t.bgColor)}}if(typeof t.bgColor!=="number"||t.bgColor<0||t.bgColor>255){t.bgColor=0;t.bgDefaultColor=true}else{t.bgColor=Math.floor(t.bgColor);if(r&&t.bgColor<=15){if(s&&t.bgColor<=7){t.bgColor+=8}else if(!s&&t.bgColor>=8){t.bgColor-=8}}}i+=t.bgColor<<8;if(t.defaultColor){i|=S}if(t.bgDefaultColor){i|=E}if(t.transparency){i|=T}if(t.fgTransparency){i|=a}if(t.bgTransparency){i|=u}if(t.styleTransparency){i|=C}if(t.charTransparency){i|=k}return i};d.prototype.object2attr=function(t,e=this.palette&&this.palette.colorNameToIndex,r=false){return d.object2attr(t,e,r)};d.attrAndObject=function(t,e,r){if(!e||typeof e!=="object"){return t}r=r||m.colorNameToIndex;if(e.defaultColor||e.color==="default"){t-=t&255;t|=S}else if(typeof e.color==="string"){t=t-(t&255)+r(e.color);if(t&S){t^=S}}else if(typeof e.color==="number"&&e.color>=0&&e.color<=255){t=t-(t&255)+e.color;if(t&S){t^=S}}if(e.bgDefaultColor||e.bgColor==="default"){t-=(t>>>8&255)<<8;t|=E}else if(typeof e.bgColor==="string"){t=t-((t>>>8&255)<<8)+(r(e.bgColor)<<8);if(t&E){t^=E}}else if(typeof e.bgColor==="number"&&e.bgColor>=0&&e.bgColor<=255){t=t-((t>>>8&255)<<8)+(e.bgColor<<8);if(t&E){t^=E}}if(e.bold===true){t|=f}else if(e.bold===false){t&=~f}if(e.dim===true){t|=c}else if(e.dim===false){t&=~c}if(e.italic===true){t|=p}else if(e.italic===false){t&=~p}if(e.underline===true){t|=g}else if(e.underline===false){t&=~g}if(e.blink===true){t|=y}else if(e.blink===false){t&=~y}if(e.inverse===true){t|=v}else if(e.inverse===false){t&=~v}if(e.hidden===true){t|=w}else if(e.hidden===false){t&=~w}if(e.strike===true){t|=_}else if(e.strike===false){t&=~_}if(e.transparency===true){t|=T}else if(e.transparency===false){t&=~T}if(e.fgTransparency===true){t|=a}else if(e.fgTransparency===false){t&=~a}if(e.bgTransparency===true){t|=u}else if(e.bgTransparency===false){t&=~u}if(e.styleTransparency===true){t|=C}else if(e.styleTransparency===false){t&=~C}if(e.charTransparency===true){t|=k}else if(e.charTransparency===false){t&=~k}return t};d.prototype.attrAndObject=function(t,e){return d.attrAndObject(t,e,this.palette&&this.palette.colorNameToIndex)};d.attrSelect=d.prototype.attrSelect=t=>t|v;d.attrUnselect=d.prototype.attrUnselect=t=>t&~v;const i=0;const l=255<<16;const f=1<<16;const c=2<<16;const p=4<<16;const g=8<<16;const y=16<<16;const v=32<<16;const w=64<<16;const _=128<<16;const x=f|c;const a=1<<24;const u=2<<24;const C=4<<24;const k=8<<24;const T=a|u|C|k;const S=16<<24;const E=32<<24;const n=255+(255<<8)+(255<<16)+T+S+E;const s=64<<24;const A=128<<24;const R=s|A;const B=~R;const O=1e4;const P=40;d.prototype.ATTR_SIZE=4;d.prototype.CHAR_SIZE=4;d.prototype.ITEM_SIZE=d.prototype.ATTR_SIZE+d.prototype.CHAR_SIZE;d.DEFAULT_ATTR=d.prototype.DEFAULT_ATTR=d.object2attr({defaultColor:true,bgDefaultColor:true});d.prototype.CLEAR_ATTR=d.object2attr({defaultColor:true,bgDefaultColor:true,transparency:true});d.prototype.CLEAR_BUFFER=I.allocUnsafe(d.prototype.ITEM_SIZE);d.prototype.CLEAR_BUFFER.writeInt32BE(d.prototype.CLEAR_ATTR,0);d.prototype.CLEAR_BUFFER.write(" \0\0\0",d.prototype.ATTR_SIZE);d.prototype.LEADING_FULLWIDTH=s;d.prototype.TRAILING_FULLWIDTH=A;d.loadSyncV1=function(t){var e,r,i,n,s;e=o.readFileSync(t);if(e.length<P){throw new Error("No header found: this is not a ScreenBuffer file")}if(e[0]!==83||e[1]!==66){throw new Error("Magic number mismatch: this is not a ScreenBuffer file")}r=e.readUInt16BE(4);i=e.readUInt16BE(6);n=P+r*i*d.prototype.ITEM_SIZE;if(e.length!==n){throw new Error("Bad file size: this is not a ScreenBuffer file")}s=new d({width:r,height:i});e.copy(s.buffer,0,P);return s};d.prototype.saveSyncV1=function(t){var e;e=I.allocUnsafe(P+this.buffer.length);e.fill(0,0,P);e[0]=83;e[1]=66;e.writeUInt16BE(this.width,4);e.writeUInt16BE(this.height,6);this.buffer.copy(e,P);o.writeFileSync(t,e)};d.loadSyncV2=function(t){var e,r,i,n;r=o.readFileSync(t);if(r.length<3||r.toString("ascii",0,3)!=="SB\n"){throw new Error("Magic number mismatch: this is not a ScreenBuffer file")}for(e=3;e<r.length;e++){if(r[e]===10){break}}if(e===r.length){throw new Error("No header found: this is not a ScreenBuffer file")}try{i=JSON.parse(r.toString("utf8",3,e))}catch(t){throw new Error("No correct one-lined JSON header found: this is not a ScreenBuffer file")}if(i.version===undefined||i.width===undefined||i.height===undefined){throw new Error("Missing mandatory header data, this is a corrupted or obsolete ScreenBuffer file")}if(i.bitsPerColor&&i.bitsPerColor!==d.prototype.bitsPerColor){throw new Error("Bad Bits Per Color: "+i.bitsPerColor+" (should be "+d.prototype.bitsPerColor+")")}if(r.length!==e+1+i.width*i.height*d.prototype.ITEM_SIZE){throw new Error("Bad file size: this is a corrupted ScreenBuffer file")}n=new d({width:i.width,height:i.height});r.copy(n.buffer,0,e+1);return n};d.prototype.saveSyncV2=function(t){var e,r;r={version:2,width:this.width,height:this.height,bpp:this.bpp};r="SB\n"+JSON.stringify(r)+"\n";e=I.allocUnsafe(r.length+this.buffer.length);e.write(r);this.buffer.copy(e,r.length);o.writeFileSync(t,e)};d.loadSync=d.loadSyncV2;d.prototype.saveSync=d.prototype.saveSyncV2}).call(this)}).call(this,r("buffer").Buffer)},{"./misc.js":42,"./termkit.js":50,buffer:147,fs:136,"nextgen-events":72,"string-kit":123}],4:[function(H,N,t){(function(W){(function(){"use strict";const e=H("./ScreenBuffer.js");const s=H("fs");const h=H("string-kit");function c(t={}){e.call(this,t)}N.exports=c;const d=H("./termkit.js");c.prototype=Object.create(e.prototype);c.prototype.constructor=c;c.prototype.bitsPerColor=24;c.create=(...t)=>new c(...t);c.createFromString=function(t,e){var r,i,n,s,o,a,u,l,f;if(!t){t={}}if(typeof e!=="string"){if(!e.toString){throw new Error("[terminal] ScreenBufferHD.createFromDataString(): argument #1 should be a string or provide a .toString() method.")}e=e.toString()}e=d.stripControlChars(e,true).split("\n");a=0;u=e.length;s=t.attr!==undefined?t.attr:c.prototype.DEFAULT_ATTR;if(s&&typeof s==="object"&&!s.BYTES_PER_ELEMENT){s=c.object2attr(s)}o=s;if(t.transparencyChar){if(!t.transparencyType){o|=c.prototype.TRANSPARENCY}else{o|=t.transparencyType&c.prototype.TRANSPARENCY}}for(i=0;i<e.length;i++){l=h.unicode.width(e[i]);if(l>a){a=l}}f=new c({width:a,height:u});for(i=0;i<e.length;i++){if(!t.transparencyChar){f.put({x:0,y:i,attr:s},e[i])}else{n=e[i].length;for(r=0;r<n;r++){if(e[i][r]===t.transparencyChar){f.put({x:r,y:i,attr:o},e[i][r])}else{f.put({x:r,y:i,attr:s},e[i][r])}}}}return f};c.createFromChars=c.createFromString;var t=H("./colorScheme/gnome.json").map(t=>({color:{r:t.r,g:t.g,b:t.b}}));var r=t.map(t=>({bgColor:{r:t.r,g:t.g,b:t.b}}));c.prototype.markupToAttrObject={normal:{"-":{dim:true},"+":{bold:true},_:{underline:true},"/":{italic:true},"!":{inverse:true},k:t[0],r:t[1],g:t[2],y:t[3],b:t[4],m:t[5],c:t[6],w:t[7],K:t[8],R:t[9],G:t[10],Y:t[11],B:t[12],M:t[13],C:t[14],W:t[15]},background:{k:r[0],r:r[1],g:r[2],y:r[3],b:r[4],m:r[5],c:r[6],w:r[7],K:r[8],R:r[9],G:r[10],Y:r[11],B:r[12],M:r[13],C:r[14],W:r[15]}};c.prototype.blitterCellBlendingIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);var r=c.blendFn.normal;var i=1;var n=false;if(typeof t.context.blending==="object"){if(t.context.blending.fn){r=t.context.blending.fn}if(t.context.blending.opacity!==undefined){i=t.context.blending.opacity}if(t.context.blending.blendSrcFgWithDstBg){n=true}}if(e[v]&O&&e[v]&P&&(!i||e[f]===0&&e[b]===0)){return}if(t.startOfBlitLine&&t.dstStart>=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}if(t.endOfBlitLine&&t.dstEnd<t.context.dstBuffer.length){this.removeTrailingFullWidth(t.context.dstBuffer,t.dstEnd)}if(!(e[v]&O)&&!(e[v]&P)&&e[f]===255&&e[b]===255&&i===1&&r===c.blendFn.normal&&!(t.endOfBlitLine||!(e[v]&M))){t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart,t.srcStart,t.srcEnd);return}var s;if(e[f]){s=i*e[f]/255;if(n){t.context.dstBuffer[t.dstStart+a]=o(t.context.srcBuffer[t.srcStart+a],t.context.dstBuffer[t.dstStart+p],s,r);t.context.dstBuffer[t.dstStart+u]=o(t.context.srcBuffer[t.srcStart+u],t.context.dstBuffer[t.dstStart+g],s,r);t.context.dstBuffer[t.dstStart+l]=o(t.context.srcBuffer[t.srcStart+l],t.context.dstBuffer[t.dstStart+y],s,r);t.context.dstBuffer[t.dstStart+f]=o(t.context.srcBuffer[t.srcStart+f],t.context.dstBuffer[t.dstStart+b],i,c.blendFn.screen)}else{t.context.dstBuffer[t.dstStart+a]=o(t.context.srcBuffer[t.srcStart+a],t.context.dstBuffer[t.dstStart+a],s,r);t.context.dstBuffer[t.dstStart+u]=o(t.context.srcBuffer[t.srcStart+u],t.context.dstBuffer[t.dstStart+u],s,r);t.context.dstBuffer[t.dstStart+l]=o(t.context.srcBuffer[t.srcStart+l],t.context.dstBuffer[t.dstStart+l],s,r);t.context.dstBuffer[t.dstStart+f]=o(t.context.srcBuffer[t.srcStart+f],t.context.dstBuffer[t.dstStart+f],i,c.blendFn.screen)}}if(e[b]){s=i*e[b]/255;t.context.dstBuffer[t.dstStart+p]=o(t.context.srcBuffer[t.srcStart+p],t.context.dstBuffer[t.dstStart+p],s,r);t.context.dstBuffer[t.dstStart+g]=o(t.context.srcBuffer[t.srcStart+g],t.context.dstBuffer[t.dstStart+g],s,r);t.context.dstBuffer[t.dstStart+y]=o(t.context.srcBuffer[t.srcStart+y],t.context.dstBuffer[t.dstStart+y],s,r);t.context.dstBuffer[t.dstStart+b]=o(t.context.srcBuffer[t.srcStart+b],t.context.dstBuffer[t.dstStart+b],i,c.blendFn.screen)}if(!(e[v]&O)){t.context.dstBuffer[t.dstStart+m]=t.context.srcBuffer[t.srcStart+m]}if(!(e[v]&P)){if(t.endOfBlitLine&&e[v]&M){this.writeChar(t.context.dstBuffer," ",t.dstStart)}else{t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart+this.ATTR_SIZE,t.srcStart+this.ATTR_SIZE,t.srcEnd)}}};function o(t,e,r,i){return Math.round(i(t,e)*r+e*(1-r))}c.blendFn={normal:t=>t,multiply:(t,e)=>255*(t/255*(e/255)),screen:(t,e)=>255*(1-(1-t/255)*(1-e/255)),overlay:(t,e)=>e<=127?255*(2*(t/255)*(e/255)):255*(1-2*(1-t/255)*(1-e/255)),hardLight:(t,e)=>t<=127?255*(2*(t/255)*(e/255)):255*(1-2*(1-t/255)*(1-e/255)),softLight:(t,e)=>{t/=255;e/=255;return 255*((1-2*t)*e*e+2*t*e)}};function i(t,e){if(t.readUInt32BE(w)!==e.readUInt32BE(w)){return false}if(t.readUInt32BE(_)!==e.readUInt32BE(_)){return false}if(t[m]!==e[m]){return false}if((t[v]&I)!==(e[v]&I)){return false}return true}c.prototype.terminalBlitterLineIterator=function(t){var e,r;if(!t.context.inline){t.context.sequence+=t.context.term.optimized.moveTo(t.dstXmin,t.dstY);t.context.moves++}for(e=t.srcStart;e<t.srcEnd;e+=this.ITEM_SIZE){r=this.readAttr(t.context.srcBuffer,e);if(r[v]&j){continue}if(!t.context.lastAttr||!i(r,t.context.lastAttr)){t.context.sequence+=!t.context.lastAttr||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,r):this.generateDeltaEscapeSequence(t.context.term,r,t.context.lastAttr);t.context.lastAttr=r;t.context.attrs++}t.context.sequence+=this.readChar(t.context.srcBuffer,e);t.context.cells++}if(t.context.inline){t.context.sequence+=t.context.term.optimized.styleReset+"\n";t.context.attrs++;t.context.lastAttr=null}if(t.context.sequence.length>F){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}};c.prototype.terminalBlitterCellIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);if(t.context.srcLastBuffer){if(i(e,this.readAttr(t.context.srcLastBuffer,t.srcStart))&&this.readChar(t.context.srcBuffer,t.srcStart)===this.readChar(t.context.srcLastBuffer,t.srcStart)){return}t.context.srcBuffer.copy(t.context.srcLastBuffer,t.srcStart,t.srcStart,t.srcEnd)}if(e[v]&j){return}t.context.cells++;if(t.dstX!==t.context.cx||t.dstY!==t.context.cy){t.context.sequence+=t.context.term.optimized.moveTo(t.dstX,t.dstY);t.context.moves++}if(!t.context.lastAttr||!i(e,t.context.lastAttr)){t.context.sequence+=!t.context.lastAttr||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,e):this.generateDeltaEscapeSequence(t.context.term,e,t.context.lastAttr);t.context.lastAttr=e;t.context.attrs++}t.context.sequence+=this.readChar(t.context.srcBuffer,t.srcStart);if(t.context.sequence.length>F){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}t.context.cy=t.dstY;if(e&M){t.context.cx=t.dstX+2;return true}t.context.cx=t.dstX+1};c.fromNdarrayImage=function(t){var e,r=t.shape[0],i,n=Math.ceil(t.shape[1]/2),s=t.shape[2]===4;var o=new c({width:r,height:n,blending:true,noFill:true});for(e=0;e<r;e++){for(i=0;i<n;i++){if(i*2+1<t.shape[1]){o.put({x:e,y:i,attr:{color:{r:t.get(e,i*2,0),g:t.get(e,i*2,1),b:t.get(e,i*2,2),a:s?t.get(e,i*2,3):255},bgColor:{r:t.get(e,i*2+1,0),g:t.get(e,i*2+1,1),b:t.get(e,i*2+1,2),a:s?t.get(e,i*2+1,3):255}}},"▀")}else{o.put({x:e,y:i,attr:{color:{r:t.get(e,i*2,0),g:t.get(e,i*2,1),b:t.get(e,i*2,2),a:s?t.get(e,i*2,3):255},bgColor:{r:0,g:0,b:0,a:0}}},"▀")}}}return o};c.loadImage=d.image.load.bind(c,c.fromNdarrayImage);c.prototype.dump=function(){var t,e,r,i="",n;for(t=0;t<this.height;t++){for(e=0;e<this.width;e++){r=(t*this.width+e)*this.ITEM_SIZE;n=this.readChar(this.buffer,r);i+=n+(h.unicode.isFullWidth(n)?" ":"  ");i+=h.format("%x%x%x%x %x%x%x%x %x%x ",this.buffer.readUInt8(r),this.buffer.readUInt8(r+1),this.buffer.readUInt8(r+2),this.buffer.readUInt8(r+3),this.buffer.readUInt8(r+4),this.buffer.readUInt8(r+5),this.buffer.readUInt8(r+6),this.buffer.readUInt8(r+7),this.buffer.readUInt8(r+8),this.buffer.readUInt8(r+9))}i+="\n"}return i};c.prototype.readAttr=function(t,e){return t.slice(e,e+this.ATTR_SIZE)};c.prototype.writeAttr=function(t,e,r,i=0){if(!i){return e.copy(t,r)}e.copy(t,r);return t.writeUInt8(e[v]|i,r+v)};c.prototype.hasLeadingFullWidth=function(t,e){return!!(t.readUInt8(e+v)&M)};c.prototype.hasTrailingFullWidth=function(t,e){return!!(t.readUInt8(e+v)&j)};c.prototype.removeLeadingFullWidth=function(t,e){var r=t.readUInt8(e+v);if(!(r&M)){return}r^=M;t.writeUInt8(r,e+v);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};c.prototype.removeTrailingFullWidth=function(t,e){var r=t.readUInt8(e+v);if(!(r&j)){return}r^=j;t.writeUInt8(r,e+v);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};c.prototype.removeFullWidth=function(t,e){var r=t.readUInt8(e+v);if(!(r&L)){return}r=r&D;t.writeUInt8(r,e+v);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};c.prototype.attrLeadingFullWidth=function(t){t.writeUInt8(t[v]|M,v);return t};c.prototype.attrTrailingFullWidth=function(t){t.writeUInt8(t[v]|j,v);return t};c.prototype.readChar=function(t,e){var r;e+=this.ATTR_SIZE;if(t[e]<128){r=1}else if(t[e]<192){return"\0"}else if(t[e]<224){r=2}else if(t[e]<240){r=3}else if(t[e]<248){r=4}else if(t[e]<252){r=5}else{r=6}if(r>this.CHAR_SIZE){return"\0"}return t.toString("utf8",e,e+r)};c.prototype.writeChar=function(t,e,r){return t.write(e,r+this.ATTR_SIZE,this.CHAR_SIZE)};c.prototype.generateEscapeSequence=function(t,e){var r=t.optimized.styleReset+t.optimized.color24bits(e[a],e[u],e[l])+t.optimized.bgColor24bits(e[p],e[g],e[y]);var i=e[m];if(i&x){r+=t.optimized.bold}if(i&C){r+=t.optimized.dim}if(i&k){r+=t.optimized.italic}if(i&T){r+=t.optimized.underline}if(i&S){r+=t.optimized.blink}if(i&E){r+=t.optimized.inverse}if(i&A){r+=t.optimized.hidden}if(i&R){r+=t.optimized.strike}return r};c.prototype.generateDeltaEscapeSequence=function(t,e,r){var i="";if(e[a]!==r[a]||e[u]!==r[u]||e[l]!==r[l]){i+=t.optimized.color24bits(e[a],e[u],e[l])}if(e[p]!==r[p]||e[g]!==r[g]||e[y]!==r[y]){i+=t.optimized.bgColor24bits(e[p],e[g],e[y])}var n=e[m];var s=r[m];if(n!==s){if((n&B)!==(s&B)){if(s&x&&!(n&x)||s&C&&!(n&C)){i+=t.optimized.noBold;if(n&x){i+=t.optimized.bold}if(n&C){i+=t.optimized.dim}}else{if(n&x&&!(s&x)){i+=t.optimized.bold}if(n&C&&!(s&C)){i+=t.optimized.dim}}}if((n&k)!==(s&k)){i+=n&k?t.optimized.italic:t.optimized.noItalic}if((n&T)!==(s&T)){i+=n&T?t.optimized.underline:t.optimized.noUnderline}if((n&S)!==(s&S)){i+=n&S?t.optimized.blink:t.optimized.noBlink}if((n&E)!==(s&E)){i+=n&E?t.optimized.inverse:t.optimized.noInverse}if((n&A)!==(s&A)){i+=n&A?t.optimized.hidden:t.optimized.noHidden}if((n&R)!==(s&R)){i+=n&R?t.optimized.strike:t.optimized.noStrike}}return i};c.attr2object=function(t){var e={color:{},bgColor:{}};e.color.r=t[a];e.color.g=t[u];e.color.b=t[l];e.color.a=t[f];e.bgColor.r=t[p];e.bgColor.g=t[g];e.bgColor.b=t[y];e.bgColor.a=t[b];e.bold=!!(t[m]&x);e.dim=!!(t[m]&C);e.italic=!!(t[m]&k);e.underline=!!(t[m]&T);e.blink=!!(t[m]&S);e.inverse=!!(t[m]&E);e.hidden=!!(t[m]&A);e.strike=!!(t[m]&R);e.styleTransparency=!!(t[v]&O);e.charTransparency=!!(t[v]&P);return e};c.prototype.attr2object=c.attr2object;c.object2attr=function(t){var e=W.allocUnsafe(c.prototype.ATTR_SIZE);if(!t||typeof t!=="object"){t={}}e[v]=0;if(t.color&&typeof t.color==="object"){e[a]=+t.color.r||0;e[u]=+t.color.g||0;e[l]=+t.color.b||0;e[f]=t.color.a!==undefined?+t.color.a||0:255}else{e[a]=0;e[u]=0;e[l]=0;e[f]=255}if(t.bgColor&&typeof t.bgColor==="object"){e[p]=+t.bgColor.r||0;e[g]=+t.bgColor.g||0;e[y]=+t.bgColor.b||0;e[b]=t.bgColor.a!==undefined?+t.bgColor.a||0:255}else{e[p]=0;e[g]=0;e[y]=0;e[b]=255}if(t.styleTransparency){e[v]|=O}if(t.charTransparency){e[v]|=P}e[m]=0;if(t.bold){e[m]|=x}if(t.dim){e[m]|=C}if(t.italic){e[m]|=k}if(t.underline){e[m]|=T}if(t.blink){e[m]|=S}if(t.inverse){e[m]|=E}if(t.hidden){e[m]|=A}if(t.strike){e[m]|=R}return e};c.prototype.object2attr=c.object2attr;c.attrAndObject=function(t,e){if(!e||typeof e!=="object"){return t}if(e.color&&typeof e.color==="object"){if(e.color.r!==undefined){t[a]=+e.color.r||0}if(e.color.g!==undefined){t[u]=+e.color.g||0}if(e.color.b!==undefined){t[l]=+e.color.b||0}if(e.color.a!==undefined){t[f]=+e.color.a||0}}if(e.bgColor&&typeof e.bgColor==="object"){if(e.bgColor.r!==undefined){t[p]=+e.bgColor.r||0}if(e.bgColor.g!==undefined){t[g]=+e.bgColor.g||0}if(e.bgColor.b!==undefined){t[y]=+e.bgColor.b||0}if(e.bgColor.a!==undefined){t[b]=+e.bgColor.a||0}}if(e.styleTransparency===true){t[v]|=O}else if(e.styleTransparency===false){t[v]&=~O}if(e.charTransparency===true){t[v]|=P}else if(e.charTransparency===false){t[v]&=~P}if(e.bold===true){t[m]|=x}else if(e.bold===false){t[m]&=~x}if(e.dim===true){t[m]|=C}else if(e.dim===false){t[m]&=~C}if(e.italic===true){t[m]|=k}else if(e.italic===false){t[m]&=~k}if(e.underline===true){t[m]|=T}else if(e.underline===false){t[m]&=~T}if(e.blink===true){t[m]|=S}else if(e.blink===false){t[m]&=~S}if(e.inverse===true){t[m]|=E}else if(e.inverse===false){t[m]&=~E}if(e.hidden===true){t[m]|=A}else if(e.hidden===false){t[m]&=~A}if(e.strike===true){t[m]|=R}else if(e.strike===false){t[m]&=~R}return t};c.prototype.attrAndObject=c.attrAndObject;c.attrSelect=c.prototype.attrSelect=t=>{t[m]|=E;return t};c.attrUnselect=c.prototype.attrUnselect=t=>{t[m]&=~E;return t};const n=0;const a=0;const u=1;const l=2;const f=3;const p=4;const g=5;const y=6;const b=7;const m=8;const v=9;const w=0;const _=4;const x=1;const C=2;const k=4;const T=8;const S=16;const E=32;const A=64;const R=128;const B=x|C;const O=4;const P=8;const I=O|P;const M=64;const j=128;const L=M|j;const D=255^L;const F=1e4;c.prototype.ATTR_SIZE=10;c.prototype.CHAR_SIZE=4;c.prototype.ITEM_SIZE=c.prototype.ATTR_SIZE+c.prototype.CHAR_SIZE;c.DEFAULT_ATTR=c.prototype.DEFAULT_ATTR=c.object2attr({color:{r:255,g:255,b:255,a:255},bgColor:{r:0,g:0,b:0,a:255}});c.prototype.CLEAR_ATTR=c.object2attr({color:{r:255,g:255,b:255,a:0},bgColor:{r:0,g:0,b:0,a:0},charTransparency:true,styleTransparency:true});c.prototype.CLEAR_BUFFER=W.allocUnsafe(c.prototype.ITEM_SIZE);c.prototype.CLEAR_ATTR.copy(c.prototype.CLEAR_BUFFER);c.prototype.CLEAR_BUFFER.write(" \0\0\0",c.prototype.ATTR_SIZE);c.prototype.LEADING_FULLWIDTH=M;c.prototype.TRAILING_FULLWIDTH=j;c.loadSyncV2=function(t){var e,r,i,n;r=s.readFileSync(t);if(r.length<3||r.toString("ascii",0,3)!=="SB\n"){throw new Error("Magic number mismatch: this is not a ScreenBufferHD file")}for(e=3;e<r.length;e++){if(r[e]===10){break}}if(e===r.length){throw new Error("No header found: this is not a ScreenBufferHD file")}try{i=JSON.parse(r.toString("utf8",3,e))}catch(t){throw new Error("No correct one-lined JSON header found: this is not a ScreenBufferHD file")}if(i.version===undefined||i.width===undefined||i.height===undefined){throw new Error("Missing mandatory header data, this is a corrupted or obsolete ScreenBufferHD file")}if(i.bitsPerColor&&i.bitsPerColor!==c.prototype.bitsPerColor){throw new Error("Bad Bits Per Color: "+i.bitsPerColor+" (should be "+c.prototype.bitsPerColor+")")}if(r.length!==e+1+i.width*i.height*c.prototype.ITEM_SIZE){throw new Error("Bad file size: this is a corrupted ScreenBufferHD file")}n=new c({width:i.width,height:i.height});r.copy(n.buffer,0,e+1);return n};c.prototype.saveSyncV2=function(t){var e,r;r={version:2,width:this.width,height:this.height};r="SB\n"+JSON.stringify(r)+"\n";e=W.allocUnsafe(r.length+this.buffer.length);e.write(r);this.buffer.copy(e,r.length);s.writeFileSync(t,e)};c.loadSync=c.loadSyncV2;c.prototype.saveSync=c.prototype.saveSyncV2}).call(this)}).call(this,H("buffer").Buffer)},{"./ScreenBuffer.js":3,"./colorScheme/gnome.json":11,"./termkit.js":50,buffer:147,fs:136,"string-kit":123}],5:[function(m,n,t){(function(b,w){(function(){"use strict";const a=m("tree-kit");const v=m("string-kit");const t=m("nextgen-events");const l=m("seventh");const p=m("./termkit.js");function e(...t){return e.create(...t)}e.prototype=Object.create(t.prototype);e.prototype.constructor=e;n.exports=e;e.create=function(t){if(!t||typeof t!=="object"){t={}}if(!t.stdin){t.stdin=b.stdin}if(!t.stdout){t.stdout=b.stdout}if(!t.stderr){t.stderr=b.stderr}if(typeof t.generic!=="string"){t.generic="xterm"}var e;var r;var i=Object.create(d);var n={on:"",off:"",params:0,out:t.stdout};var o=f.bind(undefined,n);Object.setPrototypeOf(o,i);o.apply=Function.prototype.apply;o.call=Function.prototype.call;n.root=o;o.root=o;o.options=n;o.stdin=t.stdin;o.stdout=t.stdout;o.stderr=t.stderr;o.generic=t.generic;o.appId=t.appId;o.appName=t.appName;o.isTTY=t.isTTY===undefined?true:!!t.isTTY;o.isSSH=!!t.isSSH;o.pid=t.pid;o.grabbing=false;o.mouseGrabbing=false;o.focusGrabbing=false;o.timeout=o.isSSH?500:200;o.shutdown=false;o.raw=o.stdout.write.bind(o.stdout);o.onStdin=g.bind(o);o.prependStdinChunk=null;o.lock={};o.wrapOptions={x:1,width:null,continue:false,offset:0};o.width=undefined;o.height=undefined;c.call(o);if(t.preferProcessSigwinch){b.on("SIGWINCH",c.bind(o))}else if(o.stdout.isTTY){o.stdout.on("resize",c.bind(o))}else if(t.processSigwinch){b.on("SIGWINCH",c.bind(o))}o.state={fullscreen:false,button:{left:null,middle:null,right:null,other:null}};if(o.appId){try{o.termconfigFile=o.appId+".js";r=m("./termconfig/"+o.termconfigFile)}catch(t){}}if(!r){try{o.termconfigFile=o.generic+".generic.js";r=m("./termconfig/"+o.termconfigFile)}catch(t){try{o.termconfigFile=o.generic+".js";r=m("./termconfig/"+o.termconfigFile)}catch(t){o.termconfigFile="xterm.generic.js";r=m("./termconfig/"+o.termconfigFile)}}}o.esc=a.extend({deep:true},{},r.esc);o.support=a.extend({deep:true},{},r.support);a.extend(null,o.esc,h,{gray:o.esc.brightBlack,grey:o.esc.brightBlack,bgGray:o.esc.bgBrightBlack,bgGrey:o.esc.bgBrightBlack});o.handler=a.extend(null,{},r.handler);o.keymap=a.extend({deep:true},{},r.keymap);o.colorRegister=a.extend({deep:true},[],y,r.colorRegister);o.escHandler={root:o};o.escOffHandler={root:o};o.rKeymap=[];o.rKeymapMaxSize=-1;o.rKeymapStarter=[];o.rKeymapStarterMaxSize=-1;Object.keys(o.keymap).forEach(t=>{var e,r,i,n,s=o.keymap[t];if(!Array.isArray(s)){s=[s];o.keymap[t]=s}for(r=0;r<s.length;r++){n=s[r];if(typeof n==="object"){i=n;i.name=t;n=i.code}else{i={code:n,name:t,matches:[t]};o.keymap[t][r]={code:n}}if(i.handler&&typeof i.handler!=="function"){o.keymap[t][r].handler=o.handler[i.handler]}if(n){if(n.length>o.rKeymapMaxSize){for(e=o.rKeymapMaxSize+1;e<=n.length;e++){o.rKeymap[e]={}}o.rKeymapMaxSize=n.length}if(o.rKeymap[n.length][n]){o.rKeymap[n.length][n].matches.push(t)}else{o.rKeymap[n.length][n]=i;o.rKeymap[n.length][n].matches=[t]}}else{if(!i.starter||!i.ender||!i.handler){continue}if(i.starter.length>o.rKeymapStarterMaxSize){for(e=o.rKeymapStarterMaxSize+1;e<=i.starter.length;e++){o.rKeymapStarter[e]={}}o.rKeymapStarterMaxSize=i.starter.length}if(o.rKeymapStarter[i.starter.length][i.starter]){o.rKeymapStarter[i.starter.length][i.starter].push(t)}else{o.rKeymapStarter[i.starter.length][i.starter]=[i]}}}});Object.keys(o.esc).forEach(r=>{if(!o.esc[r]||typeof o.esc[r]!=="object"){console.error("Bad escape sequence entry '"+r+"' using termconfig: '"+o.termconfigFile+"'.");return}if(typeof o.esc[r].on==="function"){o.esc[r].on=o.esc[r].on.call(o)}if(typeof o.esc[r].off==="function"){o.esc[r].off=o.esc[r].off.call(o)}if(o.esc[r].handler){if(typeof o.esc[r].handler==="function"){o.escHandler[r]=o.esc[r].handler.bind(o)}else{o.escHandler[r]=o.handler[o.esc[r].handler]}}if(o.esc[r].offHandler){if(typeof o.esc[r].offHandler==="function"){o.escOffHandler[r]=o.esc[r].offHandler.bind(o)}else{o.escOffHandler[r]=o.handler[o.esc[r].offHandler]}}Object.defineProperty(i,r,{configurable:true,get:function(){var t,e;e=Object.assign({},this.options);e.on+=this.root.esc[r].on||"";e.off=(this.root.esc[r].off||"")+e.off;e.params+=v.format.count(this.root.esc[r].on);if(!e.onHasFormatting&&(e.params||typeof this.root.esc[r].on==="string"&&v.format.hasFormatting(this.root.esc[r].on))){e.onHasFormatting=true}if(!e.offHasFormatting&&(typeof this.root.esc[r].off==="string"&&v.format.hasFormatting(this.root.esc[r].off))){e.offHasFormatting=true}if(this.root.esc[r].err){e.err=true;e.out=this.root.stderr}if(this.root.esc[r].str){e.str=true}if(this.root.esc[r].bind){e.bind=true}if(this.root.esc[r].forceStyleOnReset){e.forceStyleOnReset=true}if(this.root.esc[r].noFormat){e.noFormat=true}if(this.root.esc[r].markupOnly){e.markupOnly=true}if(this.root.esc[r].wrap){e.wrap=true}t=f.bind(undefined,e);Object.setPrototypeOf(t,i);t.apply=Function.prototype.apply;t.root=this.root||this;t.options=e;Object.defineProperty(this,r,{value:t,configurable:true});return t}})});o.resetString="";o.setResetString=function(t){o.resetString=v.markupMethod.call(o.formatConfig.rawMarkupConfig,t)};var s=t=>o.str.styleReset()+o.resetString+t;o.formatConfig={fn:{},endingMarkupReset:true,markupReset:s.bind(undefined,""),shiftMarkup:{"#":"background"},markup:{":":s.bind(undefined,"")," ":s.bind(undefined," "),"-":o.str.dim(),"+":o.str.bold(),_:o.str.underline(),"/":o.str.italic(),"!":o.str.inverse(),b:o.str.blue(),B:o.str.brightBlue(),c:o.str.cyan(),C:o.str.brightCyan(),g:o.str.green(),G:o.str.brightGreen(),k:o.str.black(),K:o.str.brightBlack(),m:o.str.magenta(),M:o.str.brightMagenta(),r:o.str.red(),R:o.str.brightRed(),w:o.str.white(),W:o.str.brightWhite(),y:o.str.yellow(),Y:o.str.brightYellow()},shiftedMarkup:{background:{":":s.bind(undefined,"")," ":s.bind(undefined," "),b:o.str.bgBlue(),B:o.str.bgBrightBlue(),c:o.str.bgCyan(),C:o.str.bgBrightCyan(),g:o.str.bgGreen(),G:o.str.bgBrightGreen(),k:o.str.bgBlack(),K:o.str.bgBrightBlack(),m:o.str.bgMagenta(),M:o.str.bgBrightMagenta(),r:o.str.bgRed(),R:o.str.bgBrightRed(),w:o.str.bgWhite(),W:o.str.bgBrightWhite(),y:o.str.bgYellow(),Y:o.str.bgBrightYellow()}}};o.formatConfig.rawMarkupConfig=Object.create(o.formatConfig);o.formatConfig.rawMarkupConfig.startingMarkupReset=false;o.formatConfig.rawMarkupConfig.endingMarkupReset=false;for(e in o.escHandler){o.formatConfig.fn[e]=o.escHandler[e]}for(e in o.escOffHandler){o.formatConfig.fn[e+"_off"]=o.escOffHandler[e]}o.format=v.createFormatter(o.formatConfig);o.markup=v.createMarkup(o.formatConfig);o.options=n;u(o);b.on("exit",()=>{if(o.shutdown){return}o.shutdown=true;o.styleReset();o.grabInput(false)});b.on("asyncExit",(t,e,r)=>{o.asyncCleanup().then(r)});b.once("beforeExit",()=>{o.asyncCleanup()});o.palette=new p.Palette({system:true,term:o});return o};function u(t){var e;t.optimized={};t.optimized.styleReset=t.str.styleReset();t.optimized.bold=t.str.bold();t.optimized.dim=t.str.dim();t.optimized.italic=t.str.italic();t.optimized.underline=t.str.underline();t.optimized.blink=t.str.blink();t.optimized.inverse=t.str.inverse();t.optimized.hidden=t.str.hidden();t.optimized.strike=t.str.strike();t.optimized.noBold=t.str.bold(false);t.optimized.noDim=t.str.dim(false);t.optimized.noItalic=t.str.italic(false);t.optimized.noUnderline=t.str.underline(false);t.optimized.noBlink=t.str.blink(false);t.optimized.noInverse=t.str.inverse(false);t.optimized.noHidden=t.str.hidden(false);t.optimized.noStrike=t.str.strike(false);t.optimized.color256=[];t.optimized.bgColor256=[];for(e=0;e<=255;e++){t.optimized.color256[e]=t.str.color256(e);t.optimized.bgColor256[e]=t.str.bgColor256(e)}t.optimized.defaultColor=t.str.defaultColor();t.optimized.bgDefaultColor=t.str.bgDefaultColor();t.optimized.moveTo=t.esc.moveTo.optimized||t.str.moveTo;t.optimized.right=t.str.right(1);t.optimized.color24bits=t.esc.color24bits.optimized||t.str.color24bits;t.optimized.bgColor24bits=t.esc.bgColor24bits.optimized||t.str.bgColor24bits}function f(t,...e){var r,i,n;if(t.bounded){e=t.bounded.concat(e)}if(t.bind){i=Object.assign({},t,{bind:false,bounded:e});r=f.bind(this,i);Object.setPrototypeOf(r,Object.getPrototypeOf(t.root));r.apply=Function.prototype.apply;r.root=t.root;r.options=i;return r}var s=[t.on],o,a,u;var l=e[t.params];if(t.params){s=s.concat(e.slice(0,t.params))}if(l===undefined||l===true){a=t.onHasFormatting?t.root.format(...s):t.on;if(t.str){return a}t.out.write(a);return t.root}if(l===null||l===false){u=t.offHasFormatting?t.root.format(t.off):t.off;if(t.str){return u}t.out.write(u);return t.root}if(typeof l!=="string"){if(typeof l.toString==="function"){l=l.toString()}else{l=""}}a=t.onHasFormatting?t.root.format(...s):t.on;if(t.markupOnly){l=t.root.markup(...e.slice(t.params))}else if(!t.noFormat){l=t.root.format(...e.slice(t.params))}if(t.wrap){if(t.root.wrapOptions.x&&t.root.wrapOptions.x>1){n={width:t.root.wrapOptions.width||t.root.width-t.root.wrapOptions.x+1,glue:"\n"+t.root.str.column(t.root.wrapOptions.x),offset:t.root.wrapOptions.offset,updateOffset:true,skipFn:p.escapeSequenceSkipFn};l=v.wordwrap(l,n);if(!t.root.wrapOptions.continue){l=t.root.str.column(t.root.wrapOptions.x)+l}t.root.wrapOptions.continue=true;t.root.wrapOptions.offset=n.offset}else{n={width:t.root.wrapOptions.width||t.root.width,glue:"\n",offset:t.root.wrapOptions.offset,updateOffset:true,skipFn:p.escapeSequenceSkipFn};l=v.wordwrap(l,n);t.root.wrapOptions.continue=true;t.root.wrapOptions.offset=n.offset}}else{t.root.wrapOptions.continue=false;t.root.wrapOptions.offset=0}u=t.offHasFormatting?t.root.format(t.off):t.off;if(t.forceStyleOnReset){l=l.replace(new RegExp(v.escape.regExp(t.root.optimized.styleReset),"g"),t.root.optimized.styleReset+a)}if(t.root.resetString){o=t.root.resetString+a+l+u+t.root.resetString}else{o=a+l+u}if(t.crlf){o=o.replace(/\n/g,"\r\n")}if(t.str){return o}t.out.write(o);return t.root}var h={error:{err:true},str:{str:true},attr:{attr:true},bindArgs:{bind:true},forceStyleOnReset:{forceStyleOnReset:true},noFormat:{noFormat:true},markupOnly:{markupOnly:true},wrap:{wrap:true},move:{on:"%[move:%a%a]F",handler:function t(e,r){var i="";if(e){if(e>0){i+=this.root.format(this.root.esc.right.on,e)}else{i+=this.root.format(this.root.esc.left.on,-e)}}if(r){if(r>0){i+=this.root.format(this.root.esc.down.on,r)}else{i+=this.root.format(this.root.esc.up.on,-r)}}return i}},color:{on:"%[color:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:function t(e){if(typeof e==="string"){e=p.colorNameToIndex(e)}if(typeof e!=="number"){return""}e=Math.floor(e);if(e<0||e>15){return""}if(e<=7){return this.root.format(this.root.esc.darkColor.on,e)}return this.root.format(this.root.esc.brightColor.on,e-8)}},bgColor:{on:"%[bgColor:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:function t(e){if(typeof e==="string"){e=p.colorNameToIndex(e)}if(typeof e!=="number"){return""}e=Math.floor(e);if(e<0||e>15){return""}if(e<=7){return this.root.format(this.root.esc.bgDarkColor.on,e)}return this.root.format(this.root.esc.bgBrightColor.on,e-8)}},colorRgb:{on:"%[colorRgb:%a%a%a]F",off:function(){return this.root.esc.defaultColor.on},handler:r},bgColorRgb:{on:"%[bgColorRgb:%a%a%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:i},colorRgbHex:{on:"%[colorRgbHex:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:r},bgColorRgbHex:{on:"%[bgColorRgbHex:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:i},colorGrayscale:{on:"%[colorGrayscale:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:function t(e){var r;if(typeof e!=="number"){return""}if(e<0||e>255){return""}if(!this.root.esc.color24bits.na&&!this.root.esc.color24bits.fb){return this.root.format(this.root.esc.color24bits.on,e,e,e)}if(!this.root.esc.color256.na&&!this.root.esc.color256.fb){e=Math.round(e*25/255);if(e<0||e>25){return""}if(e===0){r=16}else if(e===25){r=231}else{r=e+231}return this.root.format(this.root.esc.color256.on,r)}r=this.root.registerForRgb(e,e,e,0,15);return this.root.format(this.root.esc.color.on,r)}},bgColorGrayscale:{on:"%[bgColorGrayscale:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:function t(e){var r;if(typeof e!=="number"){return""}if(e<0||e>255){return""}if(!this.root.esc.bgColor24bits.na&&!this.root.esc.bgColor24bits.fb){return this.root.format(this.root.esc.bgColor24bits.on,e,e,e)}if(!this.root.esc.bgColor256.na&&!this.root.esc.bgColor256.fb){e=Math.round(e*25/255);if(e<0||e>25){return""}if(e===0){r=16}else if(e===25){r=231}else{r=e+231}return this.root.format(this.root.esc.bgColor256.on,r)}r=this.root.registerForRgb(e,e,e,0,15);return this.root.format(this.root.esc.bgColor.on,r)}}};function r(t,e,r){var i,n;if(typeof t==="string"){n=p.hexToRgba(t);t=n.r;e=n.g;r=n.b}if(typeof t!=="number"||isNaN(t)||typeof e!=="number"||isNaN(e)||typeof r!=="number"||isNaN(r)||t<0||t>255||e<0||e>255||r<0||r>255){return""}if(!this.root.esc.color24bits.na&&!this.root.esc.color24bits.fb){return this.root.format(this.root.esc.color24bits.on,t,e,r)}if(!this.root.esc.color256.na&&!this.root.esc.color256.fb){t=Math.round(t*5/255);e=Math.round(e*5/255);r=Math.round(r*5/255);i=16+t*36+e*6+r;return this.root.format(this.root.esc.color256.on,i)}i=this.root.registerForRgb(t,e,r,0,15);return this.root.format(this.root.esc.color.on,i)}function i(t,e,r){var i,n;if(typeof t==="string"){n=p.hexToRgba(t);t=n.r;e=n.g;r=n.b}if(typeof t!=="number"||isNaN(t)||typeof e!=="number"||isNaN(e)||typeof r!=="number"||isNaN(r)||t<0||t>255||e<0||e>255||r<0||r>255){return""}if(!this.root.esc.bgColor24bits.na&&!this.root.esc.bgColor24bits.fb){return this.root.format(this.root.esc.bgColor24bits.on,t,e,r)}if(!this.root.esc.bgColor256.na&&!this.root.esc.bgColor256.fb){t=Math.round(t*5/255);e=Math.round(e*5/255);r=Math.round(r*5/255);i=16+t*36+e*6+r;return this.root.format(this.root.esc.bgColor256.on,i)}i=this.root.registerForRgb(t,e,r,0,15);return this.root.format(this.root.esc.bgColor.on,i)}function c(){if(this.stdout.columns&&this.stdout.rows){this.width=this.stdout.columns;this.height=this.stdout.rows}this.emit("resize",this.width,this.height)}var d=Object.create(e.prototype);d.yesOrNo=m("./yesOrNo.js");d.inputField=m("./inputField.js");d.fileInput=m("./fileInput.js");d.singleRowMenu=d.singleLineMenu=m("./singleLineMenu.js");d.singleColumnMenu=m("./singleColumnMenu.js");d.gridMenu=m("./gridMenu.js");d.progressBar=m("./progressBar.js");d.bar=m("./bar.js");d.slowTyping=m("./slowTyping.js");d.createDocument=function(t){if(!t||typeof t!=="object"){t={}}t.outputDst=this;t.eventSource=this;return new p.Document(t)};d.createInlineElement=function(t,e){return p.Element.createInline(this,t,e)};d.table=function(t,e={}){return p.Element.createInline(this,p.TextTable,Object.assign({},e,{cellContents:t,fit:e.fit!==undefined?!!e.fit:true}))};d.spinner=function(t={}){if(typeof t==="string"){t={animation:t}}return p.Element.createInline(this,p.AnimatedText,t)};d.wrapColumn=function(...t){this.wrapOptions.continue=false;this.wrapOptions.offset=0;if(!t.length){return}if(t[0]&&typeof t[0]==="object"){Object.assign(this.wrapOptions,t[0]);return this.wrap}if(t.length===1){this.wrapOptions.x=1;this.wrapOptions.width=t[0];return this.wrap}this.wrapOptions.x=t[0];this.wrapOptions.width=t[1];return this.wrap};d.fullscreen=function(t){if(t===false){if(!this.state.fullscreen){return this}this.state.fullscreen=false;this.moveTo(1,this.height,"\n");this.alternateScreenBuffer(false);return this}if(!t){t={}}this.state.fullscreen=true;if(!t.noAlternate){this.alternateScreenBuffer(true)}this.clear()};function g(t){var e,r,i,n,s,o,a,u,l,f,h,c,d,p,g,y=false,b=0,m=t.length;if(this.shutdown){return}if(this.prependStdinChunk){t=w.concat([this.prependStdinChunk,t])}while(b<m){p=false;d=1;if(t[b]<=31||t[b]===127){for(e=Math.min(m,Math.max(this.rKeymapMaxSize,this.rKeymapStarterMaxSize));e>0;e--){i=t.slice(b);a=i.toString();n=t.slice(b,b+e);u=n.toString();if(this.rKeymap[e]&&this.rKeymap[e][u]){l=this.rKeymap[e][u];p=true;if(l.handler){g=l.handler.call(this,l.name,t.slice(b+e));d=e+g.eaten;if(!g.disable){this.emit(l.event,g.name,g.data)}}else if(l.event){d=e;this.emit(l.event,l.name,l.data,{code:n})}else{d=e;this.emit("key",l.name,l.matches,{isCharacter:false,code:n})}break}else if(this.rKeymapStarter[e]&&this.rKeymapStarter[e][u]){f=this.rKeymapStarter[e][u];for(r=0;r<f.length;r++){l=f[r];if(l.altEnder){h="^"+v.escape.regExp(l.starter)+"([ -~]*?)"+"("+v.escape.regExp(l.ender)+"|"+v.escape.regExp(l.altEnder)+")"}else{h="^"+v.escape.regExp(l.starter)+"([ -~]*?)"+v.escape.regExp(l.ender)}c=a.match(new RegExp(h),"g");if(c){p=true;g=l.handler.call(this,l.name,c[1]);d=c[0].length;this.emit(l.event,g.name,g.data);break}else if(l.accumulate){p=true;y=true;break}}if(p){break}}}if(!p){this.emit("unknown",t);break}}else if(t[b]>=128){if(t[b]<192){continue}else if(t[b]<224){d=2}else if(t[b]<240){d=3}else if(t[b]<248){d=4}else if(t[b]<252){d=5}else{d=6}i=t.slice(b,b+d);s=i.toString("utf8");if(d>2){o=v.unicode.firstCodePoint(s)}else{o=s.charCodeAt(0)}this.emit("key",s,[s],{isCharacter:true,codepoint:o,code:i})}else{s=String.fromCharCode(t[b]);this.emit("key",s,[s],{isCharacter:true,codepoint:t[b],code:t[b]})}b+=d}if(y){this.prependStdinChunk=t}else{this.prependStdinChunk=null}}d.grabInput=function(t,e){this.mouseButton(false);this.mouseDrag(false);this.mouseMotion(false);this.focusEvent(false);this.stdin.removeListener("data",this.onStdin);this.grabbing=false;this.mouseGrabbing=false;this.focusGrabbing=false;var r=()=>{this.stdin.pause();try{this.stdin.setRawMode(false)}catch(t){}};if(t===false){if(e){return l.resolveSafeTimeout(this.timeout/2).then(r)}r();return l.resolved}if(this.shutdown){return l.resolved}this.grabbing=true;if(!t){t={}}try{this.stdin.setRawMode(true)}catch(t){}this.stdin.on("data",this.onStdin);this.stdin.resume();if(t.mouse){this.mouseGrabbing=true;switch(t.mouse){case"button":this.mouseButton.mouseSGR();break;case"drag":this.mouseDrag.mouseSGR();break;case"motion":this.mouseMotion.mouseSGR();break}}if(t.focus){this.focusEvent();this.focusGrabbing=true}return l.resolved};d.processExit=function(t){this("\n");this.asyncCleanup().then(()=>b.exit(t))};d.asyncCleanup=async function(){if(this.shutdown){return}this.shutdown=true;this.styleReset();var t=this.grabbing;await this.waitStreamDone(this.stdout);if(!this.isTTY||!t){return}await l.resolveSafeTimeout(this.timeout/4);return this.grabInput(false,true)};d.waitStreamDone=function(t){if(!t._writableState.needDrain){return l.resolved}return l.onceEvent(t,"drain")};d.object2attr=function(t){var e=this.esc.styleReset.on;if(!t||typeof t!=="object"){t={}}if(typeof t.color==="string"){t.color=p.colorNameToIndex(t.color)}if(typeof t.color!=="number"||t.color<0||t.color>255){t.color=7}else{t.color=Math.floor(t.color)}e+=this.str.color(t.color);if(typeof t.bgColor==="string"){t.bgColor=p.colorNameToIndex(t.bgColor)}if(typeof t.bgColor!=="number"||t.bgColor<0||t.bgColor>255){t.bgColor=0}else{t.bgColor=Math.floor(t.bgColor)}e+=this.str.bgColor(t.bgColor);if(t.bold){e+=this.esc.bold.on}if(t.dim){e+=this.esc.dim.on}if(t.italic){e+=this.esc.italic.on}if(t.underline){e+=this.esc.underline.on}if(t.blink){e+=this.esc.blink.on}if(t.inverse){e+=this.esc.inverse.on}if(t.hidden){e+=this.esc.hidden.on}if(t.strike){e+=this.esc.strike.on}return e};d.eraseArea=function(t,e,r=1,i=1){t=Math.min(t,this.width);e=Math.min(e,this.height);var n,s=Math.min(t+r,this.width+1),o=Math.min(e+i,this.height+1),a=" ".repeat(s-t);for(n=e;n<o;n++){this.moveTo(t,n,a)}};d.getCursorLocation=function(i){var n=this.grabbing,s=false,t;if(this.shutdown){return l.resolved}if(this.esc.requestCursorLocation.na){t=new Error("Terminal is not capable");if(i){i(t);return l.resolved}return l.reject(t)}var o=new l;if(this.lock.getCursorLocation){this.once("unlock_getCursorLocation",()=>{this.getCursorLocation().then(t=>{if(i){i(undefined,t.x,t.y)}else{o.resolve(t)}},t=>{if(i){i(t)}else{o.reject(t)}})});return o}this.lock.getCursorLocation=true;var r=(t,e,r)=>{if(s){return}s=true;this.removeListener("terminal",a);if(!n){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}if(i){i(t)}else{o.reject(t)}return}if(i){i(undefined,e,r)}else{o.resolve({x:e,y:r})}};var a=(t,e)=>{if(t!=="CURSOR_LOCATION"){return}this.lock.getCursorLocation=false;this.emit("unlock_getCursorLocation");r(undefined,e.x,e.y)};if(!n){this.grabInput()}this.on("terminal",a);this.requestCursorLocation();l.resolveSafeTimeout(this.timeout).then(()=>{if(s){return}var t=new Error(".getCursorLocation() timed out");t.code="timeout";r(t)});return o};d.getColor=function(r,i){var n=this.grabbing,s=false,t;if(this.shutdown){return l.resolved}if(this.esc.requestColor.na){t=new Error("Terminal is not capable");if(i){i(t);return l.resolved}return l.reject(t)}var o=new l;var a=(t,e)=>{if(s){return}s=true;this.removeListener("terminal",u);if(!n){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}if(i){i(t)}else{o.reject(t)}return}if(i){i(undefined,e)}else{o.resolve(e)}};var u=(t,e)=>{if(t!=="COLOR_REGISTER"){return}if(e.register!==r){return}if(r<16){this.colorRegister[r]={r:e.r,g:e.g,b:e.b}}a(undefined,e)};if(!n){this.grabInput()}this.requestColor(r);this.on("terminal",u);l.resolveSafeTimeout(this.timeout).then(()=>{if(s){return}var t=new Error(".getColor() timed out");t.code="timeout";a(t)});return o};d.getPalette=function(e){var t,r=this.grabbing;if(this.shutdown){return l.resolved}if(!r){this.grabInput()}if(this.esc.requestColor.na){t=this.colorRegister.slice(0,16);if(e){e(undefined,t);return l.resolved}return l.resolve(t)}return l.concurrent(4,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],t=>this.getColor(t)).then(t=>{if(!r){this.grabInput(false)}if(e){e(undefined,t)}else{return t}},t=>{if(!r){this.grabInput(false)}if(e){e(t)}else{throw t}})};d.setColor=function(t,e,r,i,n){if(e&&typeof e==="object"){i=e.b;r=e.g;e=e.r;n=r}if(typeof t!=="number"||t<0||t>15){throw new Error("Bad register value")}if(!Array.isArray(n)){n=[]}if(typeof e!=="number"||e<0||e>255||typeof r!=="number"||r<0||r>255||typeof i!=="number"||i<0||i>255){throw new Error("Bad RGB value")}if(this.setColorLL.na){return}this.colorRegister[t]={r:e,g:r,b:i,names:n};this.setColorLL(t,e,r,i)};d.setPalette=function(e){var t;if(typeof e==="string"){try{e=m("./colorScheme/"+e+".json")}catch(t){throw new Error("[terminal] .setPalette(): color scheme not found: "+e)}}if(!Array.isArray(e)){throw new Error("[terminal] .setPalette(): argument #0 should be an Array of RGB Object or a built-in color scheme")}if(this.setColorLL.na){return}for(t=0;t<=15;t++){if(!e[t]||typeof e[t]!=="object"){continue}this.setColor(t,e[t])}};d.getClipboard=function(t="c"){var r=this.grabbing,i=false,e;if(this.shutdown){return l.resolved}if(this.esc.requestClipboard.na){e=m("./extClipboard.js");return e.getClipboard(t).catch(()=>"")}var n=new l;var s=(t,e)=>{if(i){return}i=true;this.removeListener("terminal",o);if(!r){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}n.reject(t);return}n.resolve(e)};var o=(t,e)=>{if(t!=="CLIPBOARD"){return}s(undefined,e.content)};if(!r){this.grabInput()}this.requestClipboard(t[0]);this.on("terminal",o);l.resolveSafeTimeout(this.timeout).then(()=>{if(i){return}var t=new Error(".getClipboard() timed out");t.code="timeout";s(t)});return n};d.setClipboard=async function(t,e="c"){var r;if(this.esc.setClipboardLL.na){r=m("./extClipboard.js");return r.setClipboard(t,e).catch(()=>undefined)}var i=w.from(t).toString("base64");this.setClipboardLL(e[0],i);return l.resolved};d.getTerminfo=function(r){var i=this.grabbing,n=false;if(this.shutdown){return l.resolved}if(this.esc.xtgettcapLL.na){return l.reject(new Error("Terminal is not capable"))}var s=new l;if(this.lock.getTerminfo){this.once("unlock_getTerminfo",()=>this.getTerminfo(r).propagate(s));return s}this.lock.getTerminfo=true;var o=(t,e)=>{if(n){return}n=true;this.removeListener("terminal",a);if(!i){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}s.reject(t);return}if(!e.valid||e.key!==r){s.resolve();return}s.resolve(e.value)};var a=(t,e)=>{if(t!=="TERMINFO"){return}this.lock.getTerminfo=false;this.emit("unlock_getTerminfo");o(undefined,e)};if(!i){this.grabInput()}this.on("terminal",a);this.xtgettcapLL(w.from(r).toString("hex"));l.resolveSafeTimeout(this.timeout).then(()=>{if(n){return}var t=new Error(".getTerminfo() timed out");t.code="timeout";o(t)});return s};var y=m("./colorScheme/default.json");(function t(){var e,r,i,n;for(e=16;e<232;e++){r=e-16;i=255/5;y[e]={r:Math.round(Math.floor(r/36)%6*i),g:Math.round(Math.floor(r/6)%6*i),b:Math.round(r%6*i),names:[]}}for(e=232;e<=255;e++){r=e-231;i=255/25;n=Math.round(r*i);y[e]={r:n,g:n,b:n,names:[]}}})();d.rgbForRegister=function(t){if(t<0||t>255){throw new Error("Bad register value")}return{r:this.colorRegister[t].r,g:this.colorRegister[t].g,b:this.colorRegister[t].b}};d.registerForRgb=function(t,e,r,i,n){if(t&&typeof t==="object"){n=r;i=e;r=t.b;e=t.g;t=t.r}if(typeof t!=="number"||t<0||t>255||typeof e!=="number"||e<0||e>255||typeof r!=="number"||r<0||r>255){throw new Error("Bad RGB value")}if(typeof n!=="number"||n<0||n>255){n=15}if(typeof i!=="number"||i<0||i>255){i=0}if(i>n){var s;s=n;n=i;i=s}return this._registerForRgb(t,e,r,i,n)};d._registerForRgb=function(t,e,r,i,n){var s,o,a=Infinity,u=[t,e,r];for(s=i;s<=n;s++){o=p.chroma.distance(u,this.colorRegister[s],"hcl");if(o<a){a=o;i=s}}return i};d.colorNameForRgb=function(t,e,r){return p.indexToColorName(this.registerForRgb(t,e,r,0,15))};d.colorNameForHex=function(t){var e=p.hexToRgba(t);return this.colorNameForRgb(e.r,e.g,e.b)};d.registerForRgbCache=function(t,e,r,i,n,s){var o=e+"-"+r+"-"+i;if(t[o]){return t[o]}return t[o]=this._registerForRgb(e,r,i,n,s)};d.drawCursor=function(){};d.put=function(t,e,...r){var i,n,s,o,a,u,l,f,h,c,d;if(!t){t={}}l=t.wrap===undefined?true:t.wrap;n=t.x||0;s=t.y||0;if(typeof n!=="number"||n<1){n=1}else if(n>this.width){n=this.width}else{n=Math.floor(n)}if(typeof s!=="number"||s<1){s=1}else if(s>this.height){s=this.height}else{s=Math.floor(s)}o=1;a=0;switch(t.direction){case"left":o=-1;break;case"up":o=0;a=-1;break;case"down":o=0;a=1;break;case null:case"none":o=0;a=0;break}if(typeof t.dx==="number"){o=t.dx}if(typeof t.dy==="number"){a=t.dy}d=o===1&&a===0;u=t.attr||this.esc.styleReset.on;if(u&&typeof u==="object"){u=this.object2attr(u)}if(typeof u!=="string"){u=this.esc.styleReset.on}if(typeof e!=="string"){if(e.toString){e=e.toString()}else{return}}if(r.length){e=v.format(e,...r)}e=p.stripControlChars(e);f=v.unicode.toArray(e);h=f.length;c=true;this.stdout.write(u);for(i=0;i<h;i++){if(c){this.moveTo(n,s)}this(f[i]);n+=o;s+=a;c=!d;if(n<0){if(!l){break}n=this.width-1;s--;c=true}else if(n>=this.width){if(!l){break}n=0;s++;c=true}if(s<0){break}else if(s>=this.height){break}}};d.drawNdarrayImage=function(t){var e,r=Math.min(t.shape[0],this.width),i,n=Math.ceil(t.shape[1]/2),s=t.shape[2]===4,o=this.support["256colors"]?255:15,a,u,l,f,h={};for(i=0;i<n;i++){for(e=0;e<r;e++){if(this.support.trueColor){l=s?t.get(e,i*2,3)/255:1;if(i*2+1<t.shape[1]){f=s?t.get(e,i*2+1,3)/255:1;this.noFormat(this.optimized.color24bits(Math.round(l*t.get(e,i*2,0)),Math.round(l*t.get(e,i*2,1)),Math.round(l*t.get(e,i*2,2)))+this.optimized.bgColor24bits(Math.round(f*t.get(e,i*2+1,0)),Math.round(f*t.get(e,i*2+1,1)),Math.round(f*t.get(e,i*2+1,2)))+"▀")}else{this.noFormat(this.optimized.color24bits(Math.round(l*t.get(e,i*2,0)),Math.round(l*t.get(e,i*2,1)),Math.round(l*t.get(e,i*2,2)))+this.optimized.bgColor24bits(0,0,0)+"▀")}}else{a=s&&t.get(e,i*2,3)<127?0:this.registerForRgbCache(h,t.get(e,i*2,0),t.get(e,i*2,1),t.get(e,i*2,2),0,o);if(i*2+1<t.shape[1]){u=s&&t.get(e,i*2+1,3)<127?0:this.registerForRgbCache(h,t.get(e,i*2+1,0),t.get(e,i*2+1,1),t.get(e,i*2+1,2),0,o);this.noFormat(this.optimized.color256[a]+this.optimized.bgColor256[u]+"▀")}else{this.noFormat(this.optimized.color256[a]+this.optimized.bgColor256[0]+"▀")}}}this.styleReset()("\n")}};d.drawImage=function(t,e,r){return p.image.load.call(this,d.drawNdarrayImage.bind(this),t,e,r)}}).call(this)}).call(this,m("_process"),m("buffer").Buffer)},{"./bar.js":8,"./colorScheme/default.json":10,"./extClipboard.js":37,"./fileInput.js":38,"./gridMenu.js":39,"./inputField.js":41,"./progressBar.js":44,"./singleColumnMenu.js":45,"./singleLineMenu.js":46,"./slowTyping.js":47,"./termkit.js":50,"./yesOrNo.js":57,_process:179,buffer:147,"nextgen-events":72,seventh:108,"string-kit":123,"tree-kit":134}],6:[function(t,e,r){"use strict";const i=t("fs");const u=t("string-kit");function n(t={}){this.ScreenBuffer=t.ScreenBuffer||t.dst&&t.dst.constructor||l.ScreenBuffer;this.dst=t.dst;this.palette=t.palette||this.dst&&this.dst.palette;this.width=t.width||Infinity;this.height=t.height||Infinity;this.dstClipRect=t.dstClipRect?new l.Rect(t.dstClipRect):null;this.x=t.x||0;this.y=t.y||0;this.firstLineRightShift=t.firstLineRightShift||0;this.cx=0;this.cy=0;this.ch=false;this.voidTextBuffer=null;this.defaultAttr=this.ScreenBuffer.prototype.DEFAULT_ATTR;this.voidAttr=this.ScreenBuffer.prototype.DEFAULT_ATTR;this.preserveMarkupFormat=this.ScreenBuffer.prototype.preserveMarkupFormat;this.markupToAttrObject=this.ScreenBuffer.prototype.markupToAttrObject;this.hidden=false;this.tabWidth=t.tabWidth||4;this.forceInBound=!!t.forceInBound;this.lineWrapWidth=t.lineWrapWidth||null;this.wordWrap=!!t.wordWrap;if(t.wordWrapWidth){this.lineWrapWidth=t.wordWrapWidth;this.wordWrap=true}this.selectionRegion=null;this.buffer=[[]];this.stateMachine=t.stateMachine||null;if(t.hidden){this.setHidden(t.hidden)}}e.exports=n;n.create=(...t)=>new n(...t);function h(t=" ",e=null,r=null){this.char=t||" ";this.filler=t===null;this.attr=e;this.misc=r}n.Cell=h;const l=t("./termkit.js");n.prototype.getText=function(){return this.buffer.map(t=>u.unicode.fromCells(t)).join("")};n.prototype.getCursorSplittedText=function(){var t,e,r="",i="";for(t=0;t<this.buffer.length;t++){e=this.buffer[t];if(t<this.cy){r+=u.unicode.fromCells(e)}else if(t>this.cy){i+=u.unicode.fromCells(e)}else{r+=u.unicode.fromCells(e.slice(0,this.cx));i+=u.unicode.fromCells(e.slice(this.cx))}}return[r,i]};n.prototype.setText=function(t,e,r){if(typeof e!=="boolean"&&typeof e!=="string"){r=e;e=false}var i=false,n=null;switch(e){case"ansi":n=l.parseAnsi;break;case"legacyAnsi":n=l.parseAnsi;i=true;break;case true:n=l.parseMarkup;break}if(r===undefined){r=this.defaultAttr}if(typeof r==="object"){r=this.object2attr(r)}this.buffer.length=0;t.split(/(?<=\n)/g).forEach(t=>{var e=this.buffer.length;this.buffer[e]=this.lineToCells(t,n,r,0,i);if(t[t.length-1]==="\n"){this.buffer[e].push(new h("\n",r))}if(this.lineWrapWidth){this.wrapLine(e)}})};n.prototype.lineToCells=function(t,e,r,i=0,n=false){var s=r,o,a;if(!e){return u.unicode.toCells(h,t,this.tabWidth,i,s)}s=r;o=this.ScreenBuffer.attr2object(s);a=[];e(t,l.markupOptions).forEach(t=>{if(typeof t==="string"){a.push(...u.unicode.toCells(h,t,this.tabWidth,i+a.length,s));return}if(t.markup.reset){s=t.markup.special?this.ScreenBuffer.DEFAULT_ATTR:r;o=this.ScreenBuffer.attr2object(s)}else{Object.assign(o,t.markup);if(o.defaultColor&&o.color!==undefined){delete o.defaultColor}if(o.bgDefaultColor&&o.bgColor!==undefined){delete o.bgDefaultColor}s=this.object2attr(o,undefined,n)}if(t.markup.raw){a.push(...u.unicode.toCells(h,t.markup.raw,this.tabWidth,i+a.length,s))}});return a};n.prototype.setHidden=function(t){this.hidden=typeof t==="string"&&t.length?t[0]:t?l.spChars.password:false};n.prototype.getHidden=function(){return this.hidden};n.prototype.setVoidTextBuffer=function(t=null){this.voidTextBuffer=t};n.prototype.getVoidTextBuffer=function(){return this.voidTextBuffer};n.prototype.getContentSize=function(){return{width:Math.max(1,...this.buffer.map(t=>t.length)),height:this.buffer.length}};n.prototype.getCursorOffset=function(){var t,e,r,i=0;for(e=0;e<this.cy;e++){r=this.buffer[e];if(!r){continue}for(t=0;t<r.length;t++){if(!r[t].filler){i++}}}r=this.buffer[this.cy];if(r){for(t=0;t<this.cx&&t<r.length;t++){if(!r[t].filler){i++}}}return i};n.prototype.setCursorOffset=function(t){var e;this.cy=this.cx=0;if(t<=0){return}while(this.cy<this.buffer.length){this.cx=0;e=this.buffer[this.cy];if(!e){continue}while(this.cx<e.length){if(e[this.cx].filler){this.cx++}else{t--;this.cx++;if(t<=0){if(this.cx===e.length&&e[e.length-1].char==="\n"){this.cx=0;this.cy++}return}}}this.cy++}};n.prototype.reTabLine=function(t=0){var e,r,i,n,s,o,a=t;if(this.buffer[this.cy]===undefined){this.buffer[this.cy]=[]}s=this.buffer[this.cy];o=s.slice(0,t);e=s.length;for(i=t;i<e;i++){r=s[i];if(r.char==="\t"){n=this.tabWidth-a%this.tabWidth-1;o.push(r);a+=1+n;while(n--){o.push(new h(null,r.attr,r.misc))}while(i+1<e&&s[i+1].filler){i++}}else{o.push(r);a++}}this.buffer[this.cy]=o};const y=new Set(["!","?",":",";","«","»",",",".","…"]);n.prototype.wrapLine=function(t=this.cy,e=this.lineWrapWidth,r=this.wordWrap){var i,n,s,o,a,u,l,f,h,c,d=this.cy===t;if(t>=this.buffer.length){return t}a=this.buffer[t];l=this.buffer[t-1];s=t?0:this.firstLineRightShift;u=e-s;if(!e||a.length&&a.length<=u&&a[a.length-1].char==="\n"&&(!l||!l.length||l[l.length-1].char==="\n")){return t+1}var p=[],g=[];for(n=t-1;n>=0;n--){a=this.buffer[n];if(a.length&&a[a.length-1].char==="\n"){t=n+1;break}else if(!n){t=0;break}}for(n=t;n<this.buffer.length;n++){a=this.buffer[n];p.push(...a);if(a.length&&a[a.length-1].char==="\n"){n++;break}}o=n;s=t?0:this.firstLineRightShift;if(d){c=0;for(n=t;n<this.cy;n++){c+=this.buffer[n].length}c+=this.cx}while(p.length){u=e-s;s=0;if(p.length<=u){g.push(p);if(p.length===u){g.push([])}break}if(!r){g.push(p.splice(0,u));continue}h=false;i=u;if(p[i].char===" "){while(i<p.length&&p[i].char===" "){i++}if(i>=p.length){g.push(p);break}if(i===u+1&&y.has(p[i].char)&&p[u-1].char!==" "){i=u-1}else{h=true}}if(!h){f=null;while(i>=0&&(p[i].char!==" "||y.has(f)&&i>0&&p[i-1].char!==" ")){f=p[i].char;i--}if(i<0){i=u}else{i++}}g.push(p.splice(0,i))}this.buffer.splice(t,o-t,...g);o=t+g.length;if(d){for(n=t;;n++){if(n>=o){if(n>0){n--}this.cy=n;this.cx=this.buffer[n]?this.buffer[n].length:0;break}if(!this.buffer[n]){this.cy=n;this.cx=0;break}if(c<this.buffer[n].length){this.cy=n;this.cx=c;break}c-=this.buffer[n].length}if(this.cx&&this.buffer[this.cy]&&this.buffer[this.cy][this.cx-1]&&this.buffer[this.cy][this.cx-1].char==="\n"){this.cy++;this.cx=0;if(!this.buffer[this.cy]){this.buffer[this.cy]=[]}}}return o};n.prototype.wrapAllLines=function(t=this.lineWrapWidth,e=this.wordWrap){var r=0;while(r<this.buffer.length){r=this.wrapLine(r,t,e)}};n.prototype.wordWrapLine=function(t=this.cy,e=this.lineWrapWidth){return this.wrapLine(t,e,true)};n.prototype.wordWrapAllLines=function(t=this.lineWrapWidth){var e=0;while(e<this.buffer.length){e=this.wrapLine(e,t,true)}};n.prototype.setDefaultAttr=function(t){if(t&&typeof t==="object"){t=this.object2attr(t)}else if(typeof t!=="number"){return}this.defaultAttr=t};n.prototype.setEmptyCellAttr=n.prototype.setVoidAttr=function(t){if(t===null){this.voidAttr=null}else if(t&&typeof t==="object"){t=this.object2attr(t)}else if(typeof t!=="number"){return}this.voidAttr=t};n.prototype.setAttrAt=function(t,e,r){if(t&&typeof t==="object"){t=this.object2attr(t)}else if(typeof t!=="number"){return}this.setAttrCodeAt(t,e,r)};n.prototype.setAttrCodeAt=function(t,e,r){if(!this.buffer[r]){this.buffer[r]=[]}if(!this.buffer[r][e]){this.buffer[r][e]=new h(" ",t)}else{this.buffer[r][e].attr=t}};const a={xmin:0,xmax:Infinity,ymin:0,ymax:Infinity};n.prototype.setAttrRegion=function(t,e){if(t&&typeof t==="object"){t=this.object2attr(t)}else if(typeof t!=="number"){return}this.setAttrCodeRegion(t,e)};n.prototype.setAttrCodeRegion=function(t,e=a){var r,i,n,s,o;o=Math.min(e.ymax,this.buffer.length-1);for(i=e.ymin;i<=o;i++){if(!this.buffer[i]){this.buffer[i]=[]}n=i===e.ymin?e.xmin:0;s=i===e.ymax?Math.min(e.xmax,this.buffer[i].length-1):this.buffer[i].length-1;for(r=n;r<=s;r++){this.buffer[i][r].attr=t}}};n.prototype.setSelectionRegion=function(t){if(this.selectionRegion){this.hilightSelection(false)}else{this.selectionRegion={}}if(t.xmin!==undefined&&t.ymin!==undefined){this.selectionRegion.xmin=t.xmin;this.selectionRegion.ymin=t.ymin}if(t.xmax!==undefined&&t.ymax!==undefined){this.selectionRegion.xmax=t.xmax;this.selectionRegion.ymax=t.ymax}this.hilightSelection()};n.prototype.resetSelectionRegion=function(){if(!this.selectionRegion){return}this.hilightSelection(false);this.selectionRegion=null};n.prototype.hilightSelection=function(t=true){var e,r,i,n,s,o=this.selectionRegion;if(!o||o.xmin===undefined||o.ymin===undefined||o.xmax===undefined||o.ymax===undefined){return}s=Math.min(o.ymax,this.buffer.length-1);for(r=o.ymin;r<=s;r++){if(!this.buffer[r]){this.buffer[r]=[]}i=r===o.ymin?o.xmin:0;n=r===o.ymax?Math.min(o.xmax,this.buffer[r].length-1):this.buffer[r].length-1;for(e=i;e<=n;e++){this.buffer[r][e].attr=t?this.ScreenBuffer.attrSelect(this.buffer[r][e].attr):this.ScreenBuffer.attrUnselect(this.buffer[r][e].attr)}}};n.prototype.getSelectionText=function(){var t,e,r,i,n,s,o="",a=this.selectionRegion;if(!a||a.xmin===undefined||a.ymin===undefined||a.xmax===undefined||a.ymax===undefined){return o}n=Math.min(a.ymax,this.buffer.length-1);for(e=a.ymin;e<=n;e++){if(!this.buffer[e]){this.buffer[e]=[]}r=e===a.ymin?a.xmin:0;i=e===a.ymax?Math.min(a.xmax,this.buffer[e].length-1):this.buffer[e].length-1;for(t=r;t<=i;t++){s=this.buffer[e][t];o+=s.filler?"":s.char}}return o};n.prototype.getMisc=function(){if(!this.buffer[this.cy]||!this.buffer[this.cy][this.cx]){return}if(!this.buffer[this.cy][this.cx].misc){this.buffer[this.cy][this.cx].misc={}}return this.buffer[this.cy][this.cx].misc};n.prototype.getMiscAt=function(t,e){if(!this.buffer[e]||!this.buffer[e][t]){return}if(!this.buffer[e][t].misc){this.buffer[e][t].misc={}}return this.buffer[e][t].misc};n.prototype.iterate=function(t,e){var r,i,n,s=0,o;if(typeof t==="function"){e=t;t={}}else if(!t||typeof t!=="object"){t={}}if(!this.buffer.length){return}for(i=0,n=this.buffer.length;i<n;i++){if(this.buffer[i]){o=this.buffer[i].length;for(r=0;r<o;r++){if(this.buffer[i][r].filler){continue}e({offset:s,x:r,y:i,text:this.buffer[i][r].char,attr:this.buffer[i][r].attr,misc:this.buffer[i][r].misc});s++}}}if(t.finalCall){e({offset:s+1,x:null,y:i,text:"",attr:null,misc:null})}};n.prototype.moveTo=function(t,e){this.cx=t>=0?t:0;this.cy=e>=0?e:0};n.prototype.move=function(t,e){this.moveTo(this.cx+t,this.cy+e)};n.prototype.moveToColumn=function(t){this.moveTo(t,this.cy)};n.prototype.moveToLine=n.prototype.moveToRow=function(t){this.moveTo(this.cx,t)};n.prototype.moveUp=function(){this.cy=this.cy>0?this.cy-1:0;if(this.forceInBound){this.moveInBound(true)}};n.prototype.moveDown=function(){this.cy++;if(this.forceInBound){this.moveInBound(true)}};n.prototype.moveLeft=function(){this.cx=this.cx>0?this.cx-1:0;if(this.forceInBound){this.moveInBound(true)}};n.prototype.moveRight=function(){this.cx++;if(this.forceInBound){this.moveInBound(true)}};n.prototype.moveForward=function(t,e){var r=this.cx,i=this.buffer[this.cy];if(e&&(!i||!i[this.cx]||!i[this.cx].filler)){return}for(;;){if(!i||this.cx+1>i.length||this.cx<i.length&&i[this.cx].char==="\n"){if(this.cy+1<this.buffer.length||!this.forceInBound){this.cy++;this.cx=0}else{this.cx=r}break}this.cx++;if(!i[this.cx]||!i[this.cx].filler&&(!t||t(i[this.cx].char))){break}}if(this.forceInBound){this.moveInBound()}};n.prototype.moveBackward=function(t,e){var r,i=this.buffer[this.cy];if(e&&(!i||!i[this.cx]||!i[this.cx].filler)){return}for(;;){r=i?i.length:0;if(this.cx>r){this.cx=r}else{this.cx--}if(this.cx<0){this.cy--;if(this.cy<0){this.cy=0;this.cx=0;break}this.moveToEndOfLine();break}if(!i||!i[this.cx]||(!i[this.cx].filler||i[this.cx].char!=="\n")&&(!t||t(i[this.cx].char))){break}}if(this.forceInBound){this.moveInBound()}};const s=new Set([" ","\t",".",",",";",":","!","?","/","\\","(",")","[","]","{","}","<",">","=","'",'"']);n.prototype.wordBoundary_=function(t,e){var r,i=false;if(e&&this.buffer[this.cy]&&this.buffer[this.cy][this.cx]){r=this.buffer[this.cy][this.cx].char;if(!s.has(r)){i=true}}this[t](t=>{if(s.has(t)){if(i){return true}return false}i=true;return false})};n.prototype.moveToEndOfWord=function(){return this.wordBoundary_("moveForward",true)};n.prototype.moveToStartOfWord=function(){var t,e=this.cx,r=this.cy;this.wordBoundary_("moveBackward");if(this.cx<e&&this.cy===r&&this.buffer[this.cy]&&this.buffer[this.cy][this.cx]){t=this.buffer[this.cy][this.cx].char;if(s.has(t)){this.moveForward()}}else if(this.cy<r&&e!==0&&this.buffer[r]&&this.buffer[r][0]){t=this.buffer[r][0].char;if(!s.has(t)){this.cx=0;this.cy=r}}};n.prototype.moveToStartOfLine=function(){this.cx=0};n.prototype.moveToEndOfLine=function(){var t=this.buffer[this.cy];if(!t){this.cx=0}else if(t.length&&t[t.length-1].char==="\n"){this.cx=t.length-1}else{this.cx=t.length}};n.prototype.moveToStartOfBuffer=function(){this.cx=this.cy=0};n.prototype.moveToEndOfBuffer=function(){this.cy=this.buffer.length?this.buffer.length-1:0;this.moveToEndOfLine()};n.prototype.moveInBound=function(t){var e=this.buffer[this.cy];if(this.cy>this.buffer.length){this.cy=this.buffer.length}if(t){return}if(!e){this.cx=0}else if(e.length&&e[e.length-1].char==="\n"){if(this.cx>e.length-1){this.cx=e.length-1}}else if(this.cx>e.length){this.cx=e.length}};n.prototype.insert=function(t,e,r){var i,n,s;if(!t){return}if(typeof e!=="boolean"&&typeof e!=="string"){r=e;e=false}var o=false,a=null;switch(e){case"ansi":a=l.parseAnsi;break;case"legacyAnsi":a=l.parseAnsi;o=true;break;case true:a=l.parseMarkup;break}i=t.split("\n");s=i.length;if(r&&typeof r==="object"){r=this.object2attr(r)}else if(typeof r!=="number"){r=this.defaultAttr}if(this.forceInBound){this.moveInBound()}this.inlineInsert(i[0],a,r);for(n=1;n<s;n++){this.newLine(true);this.inlineInsert(i[n],a,r)}};n.prototype.prepend=function(t,e,r){this.moveToStartOfBuffer();this.insert(t,e,r)};n.prototype.append=function(t,e,r){this.moveToEndOfBuffer();this.insert(t,e,r)};n.prototype.inlineInsert=function(t,e,r,i=false){var n,s,o,a,u,l,f;this.moveForward(undefined,true);f=this.lineToCells(t,e,r,this.cx,i);if(this.cy>=this.buffer.length){while(this.buffer.length<this.cy){this.buffer.push([new h("\n",this.defaultAttr)])}if(this.cy&&(!this.buffer[this.cy-1].length||this.buffer[this.cy-1][this.buffer[this.cy-1].length-1].char!=="\n")){this.buffer[this.cy-1].push(new h("\n",this.defaultAttr))}this.buffer[this.cy]=[]}n=this.buffer[this.cy];s=n.length;o=s&&n[s-1].char==="\n";if(this.cx===s){if(o){n.splice(s-1,0,new h(" ",this.defaultAttr),...f)}else{n.push(...f)}}else if(this.cx<s){n.splice(this.cx,0,...f)}else if(o){l=this.cx-s+1;a=n.pop();while(l--){n.push(new h(" ",this.defaultAttr))}n.push(...f,a)}else{l=this.cx-s;while(l--){n.push(new h(" ",this.defaultAttr))}n.push(...f)}u=this.indexOfCharInLine(n,"\t",this.cx);this.cx+=f.length;if(this.lineWrapWidth){this.wrapLine()}if(u!==-1){this.reTabLine(u)}};n.prototype.indexOfCharInLine=function(t,e,r=0){var i=t.length;for(;r<i;r++){if(t[r].char===e){return r}}return-1};n.prototype.delete=function(t){var e,r;if(t===undefined){t=1}if(this.forceInBound){this.moveInBound()}if(this.buffer[this.cy]&&this.buffer[this.cy][this.cx]&&this.buffer[this.cy][this.cx].filler){this.moveBackward(undefined,true);t--}while(t>0){e=this.buffer[this.cy];if(this.cy>=this.buffer.length||this.cy===this.buffer.length-1&&this.cx>=e.length){return}if(e){if(this.cx>e.length){this.cx=e.length}if(e[this.cx]&&e[this.cx].char!=="\n"){r=this.countInlineForward(t);if(r>0){e.splice(this.cx,r)}t-=r}}if(t>0){if(this.joinLine(true)){t--}}}if(this.lineWrapWidth){this.wrapLine()}this.reTabLine()};n.prototype.backDelete=function(t){var e,r,i;if(t===undefined){t=1}if(this.forceInBound){this.moveInBound()}if(this.buffer[this.cy]&&this.cx&&this.buffer[this.cy][this.cx-1]&&this.buffer[this.cy][this.cx-1].filler){this.moveBackward(undefined,true)}while(t>0){e=this.buffer[this.cy];if(this.cy===0&&this.cx===0){return}if(e){if(this.cx>e.length){if(e.length&&e[e.length-1].char==="\n"){this.cx=e.length-1}else{this.cx=e.length}t--}else if(this.cx&&this.cx===e.length&&e[e.length-1].char==="\n"){this.cx=e.length-1}r=this.countInlineBackward(t);if(r>0){e.splice(this.cx-r,r);this.cx-=r}t-=r}if(t>0){this.cy--;this.cx=e?e.length:0;if(this.joinLine(true)){t--}}}if(this.lineWrapWidth){this.wrapLine()}this.reTabLine(i)};n.prototype.countInlineBackward=function(t){var e,r;for(r=this.cx-1,e=0;r>=0&&e<t;r--,e++){if(this.buffer[this.cy][r]&&this.buffer[this.cy][r].filler){t++}}return e};n.prototype.countInlineForward=function(t){var e,r,i=this.buffer[this.cy].length;for(r=this.cx,e=0;r<i&&e<t;r++,e++){if(this.buffer[this.cy][r+1]&&this.buffer[this.cy][r+1].filler){t++}}return e};n.prototype.newLine=function(t){var e,r,i=[],n;if(!t&&this.forceInBound){this.moveInBound()}if(this.buffer[this.cy]===undefined){this.buffer[this.cy]=[]}e=this.buffer[this.cy];r=e.length;if(this.cx<r){i=e.slice(this.cx);e.length=this.cx}e.push(new h("\n",this.defaultAttr));this.buffer.splice(this.cy+1,0,i);this.cx=0;this.cy++;if(!t){if(this.lineWrapWidth){this.wrapLine()}n=this.indexOfCharInLine(e,"\t",this.cx);if(n!==-1){this.reTabLine(n)}}};n.prototype.joinLine=function(t){var e,r,i=false;if(!t&&this.forceInBound){this.moveInBound()}if(this.buffer[this.cy]===undefined){this.buffer[this.cy]=[]}if(this.buffer[this.cy+1]===undefined){this.buffer[this.cy+1]=[]}r=this.buffer[this.cy];if(r.length&&r[r.length-1].char==="\n"){r.length--;i=true}this.cx=r.length;r.splice(r.length,0,...this.buffer[this.cy+1]);this.buffer.splice(this.cy+1,1);if(!t){if(this.lineWrapWidth){this.wrapLine()}e=this.indexOfCharInLine(r,"\t",this.cx);if(e!==-1){this.reTabLine(e)}}return i};n.prototype.draw=function(t={}){var e={dst:t.dst||this.dst,offsetX:t.x!==undefined?Math.floor(t.x):Math.floor(this.x),offsetY:t.y!==undefined?Math.floor(t.y):Math.floor(this.y),dstClipRect:t.dstClipRect?new l.Rect(t.dstClipRect):this.dstClipRect,srcClipRect:t.srcClipRect?new l.Rect(t.srcClipRect):undefined,blending:t.blending,wrap:t.wrap,tile:t.tile};if(e.dst instanceof this.ScreenBuffer){this.blitter(e);if(t.cursor){e.dst.cx=this.cx+e.offsetX;e.dst.cy=this.cy+e.offsetY}}};n.prototype.drawCursor=function(t){if(!t||typeof t!=="object"){t={}}var e,r=t.dst||this.dst;if(r instanceof this.ScreenBuffer){e=this.cy?this.cx:this.cx+this.firstLineRightShift;if(!this.ch&&(this.dstClipRect||new l.Rect(this.dst)).isInside(e+this.x,this.cy+this.y)){r.cx=e+this.x;r.cy=this.cy+this.y;r.ch=false}else{r.ch=true}}};n.prototype.blitter=function(t){var e,r,i,n,s,o;r=new l.Rect(this);if(this.voidTextBuffer){n=this.voidTextBuffer.buffer;r.merge(new l.Rect(this.voidTextBuffer))}i=t.srcClipRect||new l.Rect(r);e={type:"line",context:{srcFirstLineRightShift:this.firstLineRightShift,srcBuffer:this.buffer,srcAltBuffer:n,dstBuffer:t.dst.buffer,forceChar:this.hidden,voidAttr:this.voidAttr,writeAttr:this.ScreenBuffer===l.ScreenBuffer?(t,e,r)=>{t.writeInt32BE(e,r)}:(t,e,r)=>{e.copy(t,r)}},dstRect:new l.Rect(t.dst),srcRect:r,dstClipRect:t.dstClipRect||new l.Rect(t.dst),srcClipRect:i,offsetX:t.offsetX,offsetY:t.offsetY,wrap:t.wrap,tile:t.tile,multiply:this.ScreenBuffer.prototype.ITEM_SIZE};o=this.blitterLineIterator.bind(this);if(t.wrap){s="wrapIterator"}else if(t.tile){s="tileIterator"}else{s="regionIterator"}l.Rect[s](e,o)};n.prototype.blitterLineIterator=function(t){var e,r,i,n,s,o,a,u,l;e=t.srcY?0:t.context.srcFirstLineRightShift;r=t.srcXmin-e;i=t.srcXmax-e;s=t.dstStart;o=t.context.srcBuffer[t.srcY];if(o){n=i;if(n>=o.length){n=o.length-1}for(;r<=n;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){if(r<0){continue}a=o[r];t.context.writeAttr(t.context.dstBuffer,a.attr,s);if(t.context.forceChar){t.context.dstBuffer.write(t.context.forceChar,s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}else if((l=a.char.charCodeAt(0))<32||l===127){t.context.dstBuffer.write(" ",s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}else{t.context.dstBuffer.write(a.char,s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}}if(t.context.srcAltBuffer){o=t.context.srcAltBuffer[t.srcY];if(o){n=i;if(n>=o.length){n=o.length-1}for(;r<=n;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){if(r<0){continue}a=o[r];t.context.writeAttr(t.context.dstBuffer,a.attr,s);if((l=a.char.charCodeAt(0))<32||l===127){t.context.dstBuffer.write(" ",s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}else{t.context.dstBuffer.write(a.char,s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}}}u=t.context.voidAttr;if(u!==null){for(;r<=i;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){t.context.writeAttr(t.context.dstBuffer,u,s);t.context.dstBuffer.write(" ",s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}};n.prototype.load=function(t,r){this.buffer[0]=[];this.buffer.length=1;i.readFile(t,(t,e)=>{if(t){r(t);return}this.setText(e.toString());r()})};n.prototype.save=function(t,e){i.writeFile(t,this.getText(),t=>{if(t){e(t);return}e()})};n.prototype.object2attr=function(t,e=this.palette?.colorNameToIndex,r=false){return this.ScreenBuffer.object2attr(t,e,r)};n.prototype.runStateMachine=function(){if(!this.stateMachine){return}this.stateMachine.reset();this.iterate({finalCall:true},t=>{t.textBuffer=this;this.stateMachine.pushEvent(t.text,t)})};const o={};n.TextMachineApi=o;o.style=(t,e)=>{if(t.x===null){return}if(!e.code){e.code=t.textBuffer.ScreenBuffer.object2attr(e)}t.textBuffer.setAttrCodeAt(e.code,t.x,t.y)};o.startingStyle=(t,e)=>{if(!t.startingContext||t.startingContext.x===null){return}if(!e.code){e.code=t.textBuffer.ScreenBuffer.object2attr(e)}t.textBuffer.setAttrCodeAt(e.code,t.startingContext.x,t.startingContext.y)};o.openingStyle=o.startingStyle;o.blockStyle=function(t,e){if(t.x===null||!t.startingContext||t.startingContext.x===null){return}if(!e.code){e.code=t.textBuffer.ScreenBuffer.object2attr(e)}t.textBuffer.setAttrCodeRegion(e.code,{xmin:t.startingContext.x,xmax:t.x,ymin:t.startingContext.y,ymax:t.y})};o.hint=function(t,e){var r;if(e[t.buffer]){r=t.textBuffer.getMiscAt(t.x,t.y);if(r){r.hint=e[t.buffer]}}}},{"./termkit.js":50,fs:136,"string-kit":123}],7:[function(t,e,r){"use strict";e.exports=function t(e,r,i,n,s){var o,a,u,l=[],f=r,h=false;if(!n){n=""}if(!s){s=""}for(o=0;o<e.length;o++){if(e[o].slice(0,r.length)===r){l.push(e[o])}}if(!l.length){return n+f+s}if(l.length===1){return n+l[0]+s}a=r.length;u=false;for(a=r.length;a<l[0].length;a++){for(o=1;o<l.length;o++){if(l[o][a]!==l[0][a]){u=true;break}}if(u){break}f+=l[0][a];h=true}if(i&&!h){l.prefix=n;l.postfix=s;return l}return n+f+s}},{}],8:[function(t,e,r){"use strict";const u=t("./spChars.js");e.exports=function(t,e){var r="",i="";e=e||{};if(isNaN(t)||t<0){t=0}else if(t>1){t=1}var n=e.innerSize||10;var s=Math.floor(t*n);var o=Math.round((t*n-s)*8);var a=e.barStyle||this.blue;i+="█".repeat(s);if(s<n){i+=u.enlargingBlock[o];i+=" ".repeat(n-s-1)}if(e.str){r+=this.str.inverse("▉");r+=a.str(i);r+=this.str("▏");return r}this.inverse("▉");a(i);this("▏");return this}},{"./spChars.js":48}],9:[function(e,r,t){(function(t){(function(){"use strict";r.exports=e("./termkit-no-lazy-require.js");t.IS_BROWSER=true}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./termkit-no-lazy-require.js":49}],10:[function(t,e,r){e.exports=[{r:0,g:0,b:0,names:["black"]},{r:180,g:0,b:0,names:["red"]},{r:0,g:180,b:0,names:["green"]},{r:180,g:180,b:0,names:["yellow"]},{r:0,g:0,b:180,names:["blue"]},{r:180,g:0,b:180,names:["magenta"]},{r:0,g:180,b:180,names:["cyan"]},{r:220,g:220,b:220,names:["white"]},{r:55,g:55,b:55,names:["brightBlack","gray","grey"]},{r:250,g:0,b:0,names:["brightRed"]},{r:0,g:250,b:0,names:["brightGreen"]},{r:250,g:250,b:0,names:["brightYellow"]},{r:0,g:0,b:250,names:["brightBlue"]},{r:250,g:0,b:250,names:["brightMagenta"]},{r:0,g:250,b:250,names:["brightCyan"]},{r:250,g:250,b:250,names:["brightWhite"]}]},{}],11:[function(t,e,r){e.exports=[{r:0,g:0,b:0,names:["black"]},{r:204,g:0,b:0,names:["red"]},{r:78,g:154,b:6,names:["green"]},{r:196,g:160,b:0,names:["yellow"]},{r:52,g:101,b:164,names:["blue"]},{r:117,g:80,b:123,names:["magenta"]},{r:6,g:152,b:154,names:["cyan"]},{r:211,g:215,b:207,names:["white"]},{r:85,g:87,b:83,names:["brightBlack","gray","grey"]},{r:239,g:41,b:41,names:["brightRed"]},{r:138,g:226,b:52,names:["brightGreen"]},{r:252,g:233,b:79,names:["brightYellow"]},{r:114,g:159,b:207,names:["brightBlue"]},{r:173,g:127,b:168,names:["brightMagenta"]},{r:52,g:226,b:226,names:["brightCyan"]},{r:238,g:238,b:236,names:["brightWhite"]}]},{}],12:[function(t,e,r){(function(p){(function(){"use strict";const e=t("seventh");const o=t("child_process").exec;const h=t("path");const c=t("os");const n=t("./termkit.js");r.guessTerminal=function(t){var e,r;var i=!!p.env.SSH_CONNECTION;var n=!!p.stdout.isTTY;if(!n&&!t){return{isTTY:n,isSSH:i,appId:"none",safe:true,generic:"none"}}var s=c.platform();var o=p.env.TERM&&p.env.TERM.match(/256/)||p.env.COLORTERM&&p.env.COLORTERM.match(/256/);var a=p.env.COLORTERM&&p.env.COLORTERM.match(/^(truecolor|24bits?)$/);var u=p.env.COLORTERM&&!a?p.env.COLORTERM:p.env.TERM_PROGRAM?p.env.TERM_PROGRAM:p.env.TERM;if(s==="darwin"){u=h.parse(u).name}var l=u!==p.env.TERM||p.env.TERM&&p.env.TERM!=="xterm"&&p.env.TERM!=="xterm-256color";var f=u;switch(u){case"xterm":case"xterm-256color":if(l){break}if(a){u=f="xterm-truecolor"}if(p.env.VTE_VERSION){r=parseInt(p.env.VTE_VERSION,10);if(r>=3803){u=o||a?"gnome-256color":"gnome";l=true;break}}if(s==="darwin"){u="osx-256color";break}for(e in p.env){if(e.match(/KONSOLE/)){u=o||a?"konsole-256color":"konsole";l=true;break}}break;case"linux":case"aterm":case"kuake":case"tilda":case"terminology":case"wterm":case"mrxvt":break;case"gnome":case"gnome-256color":case"gnome-terminal":case"gnome-terminal-256color":case"terminator":case"guake":u=o||a?"gnome-256color":"gnome";break;case"konsole":u=o||a?"konsole-256color":"konsole";break;case"rxvt":case"rxvt-xpm":case"rxvt-unicode-256color":case"urxvt256c":case"urxvt256c-ml":case"rxvt-unicode":case"urxvt":case"urxvt-ml":if(p.env.TERM==="rxvt"){u="rxvt-256color"}else{u=o||a?"rxvt-256color":"rxvt"}break;case"xfce":case"xfce-terminal":case"xfce4-terminal":u="xfce";break;case"eterm":case"Eterm":u=o||a?"eterm-256color":"eterm";break;case"atomic-terminal":u="atomic-terminal";break;case"xterm-kitty":case"kitty":u="kitty";break;case"iTerm":case"iterm":case"iTerm2":case"iterm2":case"Terminal":case"terminal":case"Apple_Terminal":u="osx-256color";break;default:if(!u){f="unknown"}else{f=u=f.toLowerCase()}break}return{isTTY:n,isSSH:i,appId:u,safe:l,generic:l?u:f}};function d(t){var n,s;return new e((r,i)=>{o("ps -h -o ppid -p "+t,(t,e)=>{if(t){i(t);return}n=parseInt(e.match(/[0-9]+/gm)[0],10);if(!n){i(new Error("Couldn't get parent PID"));return}o("ps -h -o comm -p "+n,(t,e)=>{if(t){i(t);return}s=e.trim();r({pid:n,appName:s})})})})}r.getParentTerminalInfo=async function(e){var t,r,i,n=[],s,o=p.pid;if(p.env.SSH_CONNECTION){r=new Error("SSH connection detected, .getParentTerminalInfo() is useless in this context.");if(e){e(r);return}throw r}var a=c.platform();var u=p.env.TERM&&p.env.TERM.match(/256/)||p.env.COLORTERM&&p.env.COLORTERM.match(/256/);var l=p.env.COLORTERM&&p.env.COLORTERM.match(/^(truecolor|24bits?)$/);try{t=true;while(t){({appName:i,pid:o}=await d(o));if(a==="darwin"){i=h.parse(i).name}n.push(i);t=false;switch(i){case"linux":case"xterm":case"konsole":case"gnome-terminal":case"aterm":case"guake":case"kuake":case"tilda":case"terminology":case"wterm":case"mrxvt":s=u||l?i+"-256color":i;break;case"atomic-terminal":s=i;break;case"login":i="linux";s=i;break;case"terminator":s=u||l?"gnome-256color":"gnome";break;case"rxvt":case"urxvt256c":case"urxvt256c-ml":s="rxvt-256color";break;case"urxvt":case"urxvt-ml":s="rxvt";break;case"xfce4-terminal":s="xfce";break;case"gnome-terminal-":i="gnome-terminal";s=u||l?"gnome-256color":"gnome";break;case"Eterm":case"eterm":i="Eterm";s=u||l?"eterm-256color":"eterm";break;case"kitty":i=s="kitty";break;case"iTerm":case"iTerm2":case"Terminal":s="osx-256color";break;default:if(i.match(/gnome-terminal/)){i="gnome-terminal";s=u||l?"gnome-256color":"gnome";break}if(!o||o===1){throw new Error("Terminal not found, app names: "+n.join(", "))}t=true}}}catch(t){if(e){e(t);return}throw t}var f={appId:s,appName:i,pid:o,safe:true};if(e){e(undefined,f);return}return f};r.getDetectedTerminal=async function(t){var e,r,i=n.guessTerminal();if(i.safe||i.isSSH){e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:i.safe?i.appId:undefined,isTTY:i.isTTY,isSSH:i.isSSH,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch});if(t){t(undefined,e)}return e}try{r=await n.getParentTerminalInfo();e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:r.appId,appName:r.appName,isTTY:i.isTTY,isSSH:i.isSSH,pid:r.pid,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch})}catch(t){e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:i.safe?i.appId:undefined,isTTY:i.isTTY,isSSH:i.isSSH,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch})}if(t){t(undefined,e)}return e}}).call(this)}).call(this,t("_process"))},{"./termkit.js":50,_process:179,child_process:136,os:166,path:178,seventh:108}],13:[function(t,e,r){"use strict";const i=t("./Text.js");const n=t("../spChars.js");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;t.attr=t.attr||{};if(Array.isArray(t.animation)){this.animation=t.animation}else if(typeof t.animation==="string"){this.animation=n.animation[t.animation]||n.animation.lineSpinner;if(t.contentHasMarkup!==false){t.contentHasMarkup=true}}else{this.animation=n.animation.lineSpinner}this.animation=this.animation.map(t=>Array.isArray(t)?t:[t]);this.isAnimated=false;this.frameDuration=t.frameDuration||150;this.animationSpeed=t.animationSpeed||1;this.frame=t.frame||0;this.autoUpdateTimer=null;this.autoUpdate=this.autoUpdate.bind(this);t.content=this.animation[this.frame];i.call(this,t);if(this.elementType==="AnimatedText"&&!t.noDraw){this.draw();this.animate()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="AnimatedText";s.prototype.inlineCursorRestoreAfterDraw=true;s.prototype.animate=function(t=1){this.isAnimated=!!t;this.animationSpeed=+t||0;if(!this.isAnimated){if(this.autoUpdateTimer){clearTimeout(this.autoUpdateTimer)}this.autoUpdateTimer=null;return}if(!this.autoUpdateTimer){this.autoUpdateTimer=setTimeout(()=>this.autoUpdate(),this.frameDuration/this.animationSpeed)}};s.prototype.autoUpdate=function(){this.frame=(this.frame+1)%this.animation.length;this.content=this.animation[this.frame];this.draw();this.autoUpdateTimer=setTimeout(()=>this.autoUpdate(),this.frameDuration/this.animationSpeed)}},{"../spChars.js":48,"./Text.js":32}],14:[function(t,e,r){"use strict";const d=t("./Element.js");const i=t("../spChars.js").bar;function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;d.call(this,t);this.minValue=+t.minValue||0;this.maxValue=t.maxValue!==undefined?+t.maxValue||0:1;this.value=+t.value||0;if(this.value<this.minValue){this.value=this.minValue}else if(this.value>this.maxValue){this.value=this.maxValue}this.borderAttr=t.borderAttr||{bold:true};this.bodyAttr=t.bodyAttr||{color:"blue"};this.barChars=i.classic;if(typeof t.barChars==="object"){this.barChars=t.barChars}else if(typeof t.barChars==="string"&&i[t.barChars]){this.barChars=i[t.barChars]}this.overTextFullAttr=t.overTextFullAttr||{bgColor:"blue"};this.overTextEmptyAttr=t.overTextEmptyAttr||{bgColor:"default"};if(this.elementType==="Bar"&&!t.noDraw){this.draw()}}e.exports=n;n.prototype=Object.create(d.prototype);n.prototype.constructor=n;n.prototype.elementType="Bar";n.prototype.preDrawSelf=function(){var t,e,r,i,n,s,o=0,a,u=0,l=false,f=null,h=this.outputWidth-2,c=(this.value-this.minValue)/(this.maxValue-this.minValue);if(!c||c<0){c=0}else if(c>1){c=1}r=Math.floor(c*h);n=c*h-r;if(this.content){if(n<.5){s=d.truncateContent(this.content,r,this.contentHasMarkup);o=d.getLastTruncateWidth();if(o<this.contentWidth){l=true}}else{s=d.truncateContent(this.content,r+1,this.contentHasMarkup);o=d.getLastTruncateWidth();if(o<this.contentWidth||o===r+1){l=true;r++}}}if(!l&&r<h){if(this.barChars.body.length<=2){if(n>=.5){r++}}else if(this.barChars.body.length===3){f=this.barChars.body[1]}else if(this.barChars.body.length===4){f=this.barChars.body[n<.5?1:2]}else{t=Math.floor(1.5+n*(this.barChars.body.length-3));f=this.barChars.body[t]}}i=h-r-(f?1:0);if(this.content&&o<this.contentWidth){a=d.truncateContent(this.content.slice(s.length),i,this.contentHasMarkup);u=d.getLastTruncateWidth()}e=this.outputX;this.outputDst.put({x:e++,y:this.outputY,attr:this.borderAttr,markup:true},this.barChars.border[0]);if(o){this.outputDst.put({x:e,y:this.outputY,attr:this.overTextFullAttr,markup:true},s);e+=o}if(r-o>0){this.outputDst.put({x:e,y:this.outputY,attr:this.bodyAttr,markup:true},this.barChars.body[0].repeat(r-o));e+=r-o}if(f){this.outputDst.put({x:e++,y:this.outputY,attr:this.bodyAttr,markup:true},f)}if(u){this.outputDst.put({x:e,y:this.outputY,attr:this.overTextEmptyAttr,markup:true},a);e+=u}if(i-u>0){this.outputDst.put({x:e,y:this.outputY,attr:this.bodyAttr,markup:true},this.barChars.body[this.barChars.body.length-1].repeat(i-u));e+=i-u}this.outputDst.put({x:e,y:this.outputY,attr:this.borderAttr,markup:true},this.barChars.border[1])};n.prototype.getValue=function(){return this.value};n.prototype.setValue=function(t,e){this.value=+t||0;if(this.value<this.minValue){this.value=this.minValue}else if(this.value>this.maxValue){this.value=this.maxValue}if(!e){this.draw()}}},{"../spChars.js":48,"./Element.js":23}],15:[function(s,o,t){(function(n){(function(){"use strict";const e=s("tree-kit");const r=s("./Element.js");const t=s("./Button.js");function i(t={}){r.call(this,t);this.backgroundAttr=t.backgroundAttr||{bgColor:"white",color:"black"};this.contentEllipsis=t.contentEllipsis||"…";this.previousPageContent=t.previousPageContent||"«";this.previousPageContentHasMarkup=!!t.previousPageContentHasMarkup;this.nextPageContent=t.nextPageContent||"»";this.nextPageContentHasMarkup=!!t.nextPageContentHasMarkup;this.itemsDef=t.items||[];this.previousPageDef=t.previousPage;this.nextPageDef=t.nextPage;this.masterDef=t.master;this.separatorDef=t.separator;this.buttons=[];this.focusChild=null;this.page=0;this.maxPage=0;this.hasSubmenu=!!t.submenu;this.isSubmenu=!!t.isSubmenu;this.submenu=null;this.submenuParentButton=null;this.submenuOptions=null;if(this.hasSubmenu){this.submenuOptions=e.extend(null,{},t,{internal:true,parent:null,items:null});if(t.submenu&&typeof t.submenu==="object"){Object.assign(this.submenuOptions,t.submenu)}}this.onButtonSubmit=this.onButtonSubmit.bind(this);this.onButtonToggle=this.onButtonToggle.bind(this);this.onButtonFocus=this.onButtonFocus.bind(this);this.onButtonBlinked=this.onButtonBlinked.bind(this);this.onSubmenuSubmit=this.onSubmenuSubmit.bind(this);this.onKey=this.onKey.bind(this);this.onWheel=this.onWheel.bind(this);this.onFocus=this.onFocus.bind(this);this.buttonBlurAttr=t.buttonBlurAttr||this.defaultOptions.buttonBlurAttr||{bgColor:"black",color:"white",bold:true};this.buttonEvenBlurAttr=t.buttonEvenBlurAttr||null;this.buttonFocusAttr=t.buttonFocusAttr||this.defaultOptions.buttonFocusAttr||{bgColor:"white",color:"black",bold:true};this.buttonDisabledAttr=t.buttonDisabledAttr||this.defaultOptions.buttonDisabledAttr||{bgColor:"black",color:"brightBlack",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||this.defaultOptions.buttonSubmittedAttr||{bgColor:"brightBlack",color:"brightWhite",bold:true};this.turnedOnBlurAttr=t.turnedOnBlurAttr||this.defaultOptions.turnedOnBlurAttr||{bgColor:"cyan"};this.turnedOnFocusAttr=t.turnedOnFocusAttr||this.defaultOptions.turnedOnFocusAttr||{bgColor:"brightCyan",bold:true};this.turnedOffBlurAttr=t.turnedOffBlurAttr||this.defaultOptions.turnedOffBlurAttr||{bgColor:"gray",dim:true};this.turnedOffFocusAttr=t.turnedOffFocusAttr||this.defaultOptions.turnedOffFocusAttr||{bgColor:"white",color:"black",bold:true};this.blurLeftPadding=t.blurLeftPadding||t.leftPadding||"";this.blurRightPadding=t.blurRightPadding||t.rightPadding||"";this.focusLeftPadding=t.focusLeftPadding||t.leftPadding||"";this.focusRightPadding=t.focusRightPadding||t.rightPadding||"";this.disabledLeftPadding=t.disabledLeftPadding||t.leftPadding||"";this.disabledRightPadding=t.disabledRightPadding||t.rightPadding||"";this.submittedLeftPadding=t.submittedLeftPadding||t.leftPadding||"";this.submittedRightPadding=t.submittedRightPadding||t.rightPadding||"";this.turnedOnFocusLeftPadding=t.turnedOnFocusLeftPadding||t.turnedOnLeftPadding||t.leftPadding||"";this.turnedOnFocusRightPadding=t.turnedOnFocusRightPadding||t.turnedOnRightPadding||t.rightPadding||"";this.turnedOffFocusLeftPadding=t.turnedOffFocusLeftPadding||t.turnedOffLeftPadding||t.leftPadding||"";this.turnedOffFocusRightPadding=t.turnedOffFocusRightPadding||t.turnedOffRightPadding||t.rightPadding||"";this.turnedOnBlurLeftPadding=t.turnedOnBlurLeftPadding||t.turnedOnLeftPadding||t.leftPadding||"";this.turnedOnBlurRightPadding=t.turnedOnBlurRightPadding||t.turnedOnRightPadding||t.rightPadding||"";this.turnedOffBlurLeftPadding=t.turnedOffBlurLeftPadding||t.turnedOffLeftPadding||t.leftPadding||"";this.turnedOffBlurRightPadding=t.turnedOffBlurRightPadding||t.turnedOffRightPadding||t.rightPadding||"";this.paddingHasMarkup=!!t.paddingHasMarkup;if(t.keyBindings){this.keyBindings=t.keyBindings}if(t.buttonKeyBindings){this.buttonKeyBindings=t.buttonKeyBindings}if(t.buttonActionKeyBindings){this.buttonActionKeyBindings=t.buttonActionKeyBindings}if(t.toggleButtonKeyBindings){this.toggleButtonKeyBindings=t.toggleButtonKeyBindings}if(t.toggleButtonActionKeyBindings){this.toggleButtonActionKeyBindings=t.toggleButtonActionKeyBindings}this.on("key",this.onKey);this.on("wheel",this.onWheel);this.on("focus",this.onFocus)}o.exports=i;i.prototype=Object.create(r.prototype);i.prototype.constructor=i;i.prototype.elementType="BaseMenu";i.prototype.needInput=true;i.prototype.destroy=function(t,e=false){if(this.destroyed){return}if(this.submenu){this.submenu.destroy(true)}this.off("key",this.onKey);this.off("wheel",this.onWheel);this.off("focus",this.onFocus);r.prototype.destroy.call(this,t,e)};i.prototype.previousPage=function(t){var e;if(this.maxPage&&this.page>0){this.page--;this.initPage();this.focusChild=this.children[this.children.length-2];e=this.document.giveFocusTo_(this.focusChild,t);if(!e){this.document.focusPrevious()}this.updateDraw()}};i.prototype.nextPage=function(t){var e;if(this.maxPage&&this.page<this.maxPage){this.page++;this.initPage();this.focusChild=this.children[1];e=this.document.giveFocusTo_(this.focusChild,t);if(!e){this.document.focusNext()}this.updateDraw()}};i.prototype.toPage=function(t,e){var r;if(this.maxPage&&t!==this.page){this.page=t;this.initPage();this.focusChild=this.children[1];r=this.document.giveFocusTo_(this.focusChild,e);if(!r){this.document.focusNext()}this.updateDraw()}};i.prototype.focusValue=function(e,t,r=false){var i,n,s;n=this.itemsDef.find(t=>!t.disabled&&t.value===e);if(!n){return}if(this.page!==n.page||r){this.page=n.page;this.initPage()}s=this.buttons.find(t=>t.def===n);if(!s){return}this.focusChild=s;i=this.document.giveFocusTo_(this.focusChild,t);if(!i){this.document.focusNext()}this.draw()};i.prototype.setItem=function(e,t){var r,i;r=this.itemsDef.find(t=>t.value===e);if(!r){return false}Object.assign(r,t);i=this.focusChild&&this.focusChild.value;this.initChildren(true);if(i!==undefined){this.focusValue(i,"refocus",true)}else{this.initPage();this.draw()}return true};i.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"previous":this.focusChild=this.focusPreviousChild(!this.maxPage);if(this.focusChild===this.children[0]&&this.maxPage&&this.page>0){this.previousPage("backCycle")}break;case"next":this.focusChild=this.focusNextChild(!this.maxPage);if(this.focusChild===this.children[this.children.length-1]&&this.maxPage&&this.page<this.maxPage){this.nextPage("cycle")}break;case"previousPage":if(this.maxPage&&this.page>0){this.previousPage("backCycle")}break;case"nextPage":if(this.maxPage&&this.page<this.maxPage){this.nextPage("cycle")}break;case"firstPage":if(this.maxPage&&this.page!==0){this.toPage(0,"backCycle")}break;case"lastPage":if(this.maxPage&&this.page!==this.maxPage){this.toPage(this.maxPage,"cycle")}break;case"parentMenu":if(this.isSubmenu){let t=this.parent;if(this.parent.submenuOptions.hideParent){this.parent.closeSubmenu()}t.document.giveFocusTo(t)}break;case"submenu":if(this.hasSubmenu&&this.focusChild?.def?.items){this.openSubmenu(this.focusChild.value,this.focusChild);if(this.submenu){this.document.giveFocusTo(this.submenu)}}break;default:return}return true};i.prototype.onWheel=function(t){if(t.yDirection<0){this.previousPage("backCycle")}else if(t.yDirection>0){this.nextPage("cycle")}};i.prototype.onFocus=function(t,e){if(e==="cycle"||e==="backCycle"){return}if(t){n.nextTick(()=>{if(this.focusChild&&!this.focusChild.destroyed){this.document.giveFocusTo(this.focusChild,"delegate")}else{this.focusChild=this.focusNextChild()}})}};i.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;default:if(this.hasSubmenu&&r.def.items){if(this.submenuOptions.openOn==="parentSubmit"){this.openSubmenu(r.value,r)}if(this.submenu){this.document.giveFocusTo(this.submenu)}}else{this.emit("submit",t,e,this)}}};i.prototype.onButtonBlinked=function(t,e,r){switch(r.internalRole){case"previousPage":case"nextPage":break;default:if(this.hasSubmenu&&r.def.items){if(this.submenuOptions.openOn==="parentBlinked"){this.openSubmenu(r.value,r)}}else{this.emit("blinked",t,e,this)}}};i.prototype.onButtonFocus=function(t,e,r){switch(r.internalRole){case"previousPage":case"nextPage":break;default:if(t&&this.hasSubmenu&&r.def.items&&this.submenuOptions.openOn==="parentFocus"){this.openSubmenu(r.value,r)}this.emit("itemFocus",r.value,t,r)}};i.prototype.onSubmenuSubmit=function(t,e,r){r.once("blinked",(t,e,r)=>{if(this.submenuOptions.closeOn==="childSubmit"){this.closeSubmenu();this.document.giveFocusTo(this.submenuParentButton||this)}this.emit("blinked",t,e,this)});this.emit("submit",t,e,this)};i.prototype.openSubmenu=function(e,r=null){var t,i,n,s,o=r?this.itemsDef.find(t=>t===r.def):this.itemsDef.find(t=>t.value===e);if(!o||!o.items||!o.items.length){return}if(this.submenu){if(this.submenu.def===o){return}this.closeSubmenu()}this.submenuParentButton=r;switch(this.submenuOptions.disposition){case"overwrite":t=this.outputX;i=this.outputY;n=this.submenuOptions.width;s=this.submenuOptions.height;break;case"right":default:t=this.outputX+this.outputWidth;i=this.outputY;n=this.submenuOptions.width||this.outputWidth;break}if(this.submenuOptions.hideParent){this.children.forEach(t=>t.hidden=true)}this.submenu=new this.constructor(Object.assign({},this.submenuOptions,{internal:true,parent:this,isSubmenu:true,def:o,outputX:t,outputY:i,outputWidth:n,outputHeight:s,items:o.items,noDraw:true}));this.redraw();if(this.submenuOptions.focusOnOpen){this.document.giveFocusTo(this.submenu)}this.submenu.on("submit",this.onSubmenuSubmit);this.submenu.on("itemFocus",(...t)=>this.emit("itemFocus",...t))};i.prototype.closeSubmenu=function(){if(!this.submenu){return false}if(this.submenuOptions.hideParent){this.children.forEach(t=>t.hidden=false)}this.submenu.destroy();this.submenu=null;return true};i.prototype.defaultOptions={};i.prototype.keyBindings={};i.prototype.buttonKeyBindings={};i.prototype.buttonActionKeyBindings={};i.prototype.toggleButtonKeyBindings={};i.prototype.toggleButtonActionKeyBindings={};i.prototype.initPage=function(){};i.prototype.onButtonToggle=function(){};i.prototype.childUseParentKeyValue=false}).call(this)}).call(this,s("_process"))},{"./Button.js":16,"./Element.js":23,_process:179,"tree-kit":134}],16:[function(t,e,r){"use strict";const n=t("./Element.js");const i=t("./Text.js");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!Array.isArray(t.content)){t.content=[t.content||""]}this.blurContent=t.blurContent?Array.isArray(t.blurContent)?t.blurContent:[t.blurContent]:t.content;this.focusContent=t.focusContent?Array.isArray(t.focusContent)?t.focusContent:[t.focusContent]:t.content;this.disabledContent=t.disabledContent?Array.isArray(t.disabledContent)?t.disabledContent:[t.disabledContent]:t.content;this.submittedContent=t.submittedContent?Array.isArray(t.submittedContent)?t.submittedContent:[t.submittedContent]:t.content;this.turnedOnBlurContent=t.turnedOnBlurContent?Array.isArray(t.turnedOnBlurContent)?t.turnedOnBlurContent:[t.turnedOnBlurContent]:t.turnedOnContent?Array.isArray(t.turnedOnContent)?t.turnedOnContent:[t.turnedOnContent]:t.content;this.turnedOffBlurContent=t.turnedOffBlurContent?Array.isArray(t.turnedOffBlurContent)?t.turnedOffBlurContent:[t.turnedOffBlurContent]:t.turnedOffContent?Array.isArray(t.turnedOffContent)?t.turnedOffContent:[t.turnedOffContent]:t.content;this.turnedOnFocusContent=t.turnedOnFocusContent?Array.isArray(t.turnedOnFocusContent)?t.turnedOnFocusContent:[t.turnedOnFocusContent]:t.turnedOnContent?Array.isArray(t.turnedOnContent)?t.turnedOnContent:[t.turnedOnContent]:t.content;this.turnedOffFocusContent=t.turnedOffFocusContent?Array.isArray(t.turnedOffFocusContent)?t.turnedOffFocusContent:[t.turnedOffFocusContent]:t.turnedOffContent?Array.isArray(t.turnedOffContent)?t.turnedOffContent:[t.turnedOffContent]:t.content;this.blurLeftPadding=t.blurLeftPadding||t.leftPadding||"";this.blurRightPadding=t.blurRightPadding||t.rightPadding||"";this.focusLeftPadding=t.focusLeftPadding||t.leftPadding||"";this.focusRightPadding=t.focusRightPadding||t.rightPadding||"";this.disabledLeftPadding=t.disabledLeftPadding||t.leftPadding||"";this.disabledRightPadding=t.disabledRightPadding||t.rightPadding||"";this.submittedLeftPadding=t.submittedLeftPadding||t.leftPadding||"";this.submittedRightPadding=t.submittedRightPadding||t.rightPadding||"";this.turnedOnBlurLeftPadding=t.turnedOnBlurLeftPadding||t.turnedOnLeftPadding||t.leftPadding||"";this.turnedOnBlurRightPadding=t.turnedOnBlurRightPadding||t.turnedOnRightPadding||t.rightPadding||"";this.turnedOffBlurLeftPadding=t.turnedOffBlurLeftPadding||t.turnedOffLeftPadding||t.leftPadding||"";this.turnedOffBlurRightPadding=t.turnedOffBlurRightPadding||t.turnedOffRightPadding||t.rightPadding||"";this.turnedOnFocusLeftPadding=t.turnedOnFocusLeftPadding||t.turnedOnLeftPadding||t.leftPadding||"";this.turnedOnFocusRightPadding=t.turnedOnFocusRightPadding||t.turnedOnRightPadding||t.rightPadding||"";this.turnedOffFocusLeftPadding=t.turnedOffFocusLeftPadding||t.turnedOffLeftPadding||t.leftPadding||"";this.turnedOffFocusRightPadding=t.turnedOffFocusRightPadding||t.turnedOffRightPadding||t.rightPadding||"";this.paddingHasMarkup=!!t.paddingHasMarkup;this.internalRole=t.internalRole||null;delete t.width;delete t.height;i.call(this,t);if(this.setContent===s.prototype.setContent){this.setContent(t.content||"",t.contentHasMarkup,true,true)}this.blurAttr=t.blurAttr||{bgColor:"brightBlack"};this.focusAttr=t.focusAttr||{bgColor:"blue"};this.disabledAttr=t.disabledAttr||{bgColor:"black",color:"brightBlack"};this.submittedAttr=t.submittedAttr||{bgColor:"brightBlue"};this.turnedOnBlurAttr=t.turnedOnBlurAttr||{bgColor:"cyan"};this.turnedOnFocusAttr=t.turnedOnFocusAttr||{bgColor:"brightCyan",bold:true};this.turnedOffBlurAttr=t.turnedOffBlurAttr||{bgColor:"gray",dim:true};this.turnedOffFocusAttr=t.turnedOffFocusAttr||{bgColor:"white",color:"black",bold:true};this.disabled=!!t.disabled;this.submitted=!!t.submitted;this.submitOnce=!!t.submitOnce;this.attr=null;this.leftPadding=null;this.rightPadding=null;this.updateStatus();this.onKey=this.onKey.bind(this);this.onShortcut=this.onShortcut.bind(this);this.onFocus=this.onFocus.bind(this);this.onClick=this.onClick.bind(this);this.onRightClick=this.onRightClick.bind(this);this.onMiddleClick=this.onMiddleClick.bind(this);this.onHover=this.onHover.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}if(t.actionKeyBindings){this.actionKeyBindings=t.actionKeyBindings}this.on("key",this.onKey);this.on("shortcut",this.onShortcut);this.on("focus",this.onFocus);this.on("click",this.onClick);this.on("rightClick",this.onRightClick);this.on("middleClick",this.onMiddleClick);this.on("hover",this.onHover);if(this.elementType==="Button"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="Button";s.prototype.needInput=true;s.prototype.keyBindings={ENTER:"submit",KP_ENTER:"submit",ALT_ENTER:"submit"};s.prototype.actionKeyBindings={};s.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("shortcut",this.onShortcut);this.off("focus",this.onFocus);this.off("click",this.onClick);this.off("hover",this.onHover);n.prototype.destroy.call(this,t,e)};s.prototype.setContent=function(t,e,r=false,i=false){n.prototype.setContent.call(this,t,e,true,true);this.blurContent=this.focusContent=this.disabledContent=this.submittedContent=this.turnedOnBlurContent=this.turnedOffBlurContent=this.turnedOnFocusContent=this.turnedOffFocusContent=this.content;if(!i&&this.resizeOnContent){this.resizeOnContent()}if(!r){this.redraw()}};s.prototype.computeRequiredWidth=function(){return Math.max(n.computeContentWidth(this.blurLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.focusLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.disabledLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.submittedLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOnFocusLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOffFocusLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOnBlurLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOffBlurLeftPadding,this.paddingHasMarkup))+Math.max(n.computeContentWidth(this.blurRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.focusRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.disabledRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.submittedRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOnFocusRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOffFocusRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOnBlurRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOffBlurRightPadding,this.paddingHasMarkup))+Math.max(n.computeContentWidth(this.blurContent,this.contentHasMarkup),n.computeContentWidth(this.focusContent,this.contentHasMarkup),n.computeContentWidth(this.disabledContent,this.contentHasMarkup),n.computeContentWidth(this.submittedContent,this.contentHasMarkup),n.computeContentWidth(this.turnedOnFocusContent,this.contentHasMarkup),n.computeContentWidth(this.turnedOffFocusContent,this.contentHasMarkup),n.computeContentWidth(this.turnedOnBlurContent,this.contentHasMarkup),n.computeContentWidth(this.turnedOffBlurContent,this.contentHasMarkup))||1};s.prototype.drawSelfCursor=function(){this.outputDst.moveTo(this.outputX,this.outputY);this.outputDst.drawCursor()};s.prototype.blink=function(t=null,e=4){if(e){if(e%2){this.attr=this.focusAttr}else{this.attr=this.blurAttr}this.draw();setTimeout(()=>this.blink(t,e-1),80)}else{this.updateStatus();this.draw();this.emit("blinked",this.value,t,this)}};s.prototype.onFocus=function(t,e){this.hasFocus=t;this.updateStatus();this.draw()};s.prototype.updateStatus=function(){if(this.disabled){this.attr=this.disabledAttr;this.content=this.disabledContent;this.leftPadding=this.disabledLeftPadding;this.rightPadding=this.disabledRightPadding}else if(this.submitted){this.attr=this.submittedAttr;this.content=this.submittedContent;this.leftPadding=this.submittedLeftPadding;this.rightPadding=this.submittedRightPadding}else if(this.hasFocus){this.attr=this.focusAttr;this.content=this.focusContent;this.leftPadding=this.focusLeftPadding;this.rightPadding=this.focusRightPadding}else{this.attr=this.blurAttr;this.content=this.blurContent;this.leftPadding=this.blurLeftPadding;this.rightPadding=this.blurRightPadding}};s.prototype.submit=function(t){if(this.submitOnce){this.submitted=true}this.emit("submit",this.value,t,this);this.blink(t)};s.prototype.unsubmit=function(){this.submitted=false;this.updateStatus()};s.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"submit":if(this.disabled||this.submitted){break}this.submit(this.actionKeyBindings[t]);break;default:return}return true};s.prototype.onHover=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"hover")};s.prototype.onClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.click)};s.prototype.onRightClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.rightClick)};s.prototype.onMiddleClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.middleClick)};s.prototype.onShortcut=function(){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit()}},{"./Element.js":23,"./Text.js":32}],17:[function(t,e,r){"use strict";const f=t("./Element.js");const i=t("./BaseMenu.js");const l=t("./Button.js");const h=t("./ToggleButton.js");function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;this.onParentResize=this.onParentResize.bind(this);if(!t.outputWidth&&!t.width){if(t.parent){t.outputWidth=Math.min(t.parent.inputWidth,t.parent.outputWidth)}else if(t.inlineTerm){t.outputWidth=t.inlineTerm.width}}this.buttonsMaxWidth=0;this.buttonPaddingWidth=0;this.buttonSymbolWidth=0;this.pageHeight=0;this.pageItemsDef=null;if(!t.multiLineItems){t.height=t.items&&t.items.length}i.call(this,t);this.maxHeight=this.autoHeight&&this.outputDst?Math.round(this.outputDst.height*this.autoHeight):t.maxHeight?t.maxHeight:t.pageMaxHeight?t.pageMaxHeight:this.strictInline?this.inlineTerm.height:Infinity;this.on("parentResize",this.onParentResize);this.multiLineItems=!!t.multiLineItems;this.initChildren();if(this.elementType==="ColumnMenu"&&!t.noDraw){this.draw()}}e.exports=n;n.prototype=Object.create(i.prototype);n.prototype.constructor=n;n.prototype.elementType="ColumnMenu";n.prototype.inlineNewLine=true;n.prototype.ButtonClass=l;n.prototype.defaultOptions={buttonBlurAttr:{bgColor:"black",color:"white",bold:true},buttonEvenBlurAttr:null,buttonFocusAttr:{bgColor:"white",color:"black",bold:true},buttonDisabledAttr:{bgColor:"black",color:"gray",bold:true},buttonSubmittedAttr:{bgColor:"gray",color:"brightWhite",bold:true},turnedOnBlurAttr:{bgColor:"cyan"},turnedOnFocusAttr:{bgColor:"brightCyan",bold:true},turnedOffBlurAttr:{bgColor:"gray",dim:true},turnedOffFocusAttr:{bgColor:"white",color:"black",bold:true}};n.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("focus",this.onFocus);this.off("parentResize",this.onParentResize);f.prototype.destroy.call(this,t,e)};n.prototype.keyBindings={UP:"previous",DOWN:"next",PAGE_UP:"previousPage",PAGE_DOWN:"nextPage",HOME:"firstPage",END:"lastPage",ALT_ENTER:"submit",ESCAPE:"parentMenu",LEFT:"parentMenu",RIGHT:"submenu"};n.prototype.buttonKeyBindings={ENTER:"submit",KP_ENTER:"submit"};n.prototype.toggleButtonKeyBindings={ENTER:"toggle",KP_ENTER:"toggle"};n.prototype.initChildren=function(t=false){this.pageItemsDef=[];this.buttonPaddingWidth=Math.max(f.computeContentWidth(this.blurLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.focusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.disabledLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.submittedLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnFocusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffFocusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnBlurLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffBlurLeftPadding,this.paddingHasMarkup))+Math.max(f.computeContentWidth(this.blurRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.focusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.disabledRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.submittedRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnFocusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffFocusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnBlurRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffBlurRightPadding,this.paddingHasMarkup));if(this.buttonPaddingWidth>this.outputWidth){return}var a=f.computeContentWidth(this.contentEllipsis,false);this.previousPageDef=Object.assign({content:"▲",internalRole:"previousPage"},this.previousPageDef);this.previousPageDef.contentHasMarkup=this.previousPageDef.contentHasMarkup||this.previousPageDef.markup;this.previousPageDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.previousPageDef.content,this.previousPageDef.contentHasMarkup);this.previousPageDef.buttonContent=this.previousPageDef.content;this.nextPageDef=Object.assign({content:"▼",internalRole:"nextPage"},this.nextPageDef);this.nextPageDef.contentHasMarkup=this.nextPageDef.contentHasMarkup||this.nextPageDef.markup;this.nextPageDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.nextPageDef.content,this.nextPageDef.contentHasMarkup);this.nextPageDef.buttonContent=this.nextPageDef.content;if(this.masterDef){this.masterDef=Object.assign({content:"column-menu",internalRole:"master"},this.masterDef);this.masterDef.contentHasMarkup=this.masterDef.contentHasMarkup||this.masterDef.markup;this.masterDef.buttonContent=this.masterDef.content;if(this.masterDef.symbol){this.buttonSymbolWidth=1+f.computeContentWidth(this.masterDef.symbol);this.masterDef.buttonContent+=" "+this.masterDef.symbol}this.masterDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.masterDef.buttonContent,this.masterDef.contentHasMarkup)}this.buttonsMaxWidth=Math.max(this.buttonsMaxWidth,this.previousPageDef.width,this.nextPageDef.width,this.masterDef?this.masterDef.width:0);var u=0,l=0;this.itemsDef.forEach((t,e)=>{t.contentHasMarkup=t.contentHasMarkup||t.markup;t.buttonContent=t.content;t.buttonBlurContent=t.blurContent;t.buttonFocusContent=t.focusContent;t.buttonDisabledContent=t.disabledContent;t.buttonSubmittedContent=t.submittedContent;t.buttonTurnedOnBlurContent=t.turnedOnBlurContent;t.buttonTurnedOffBlurContent=t.turnedOffBlurContent;t.buttonTurnedOnFocusContent=t.turnedOnFocusContent;t.buttonTurnedOffFocusContent=t.turnedOffFocusContent;var r=f.computeContentWidth(t.content,t.contentHasMarkup),i=1,n=e===this.itemsDef.length-1,s=Math.max(1,!n?this.maxHeight-1:this.maxHeight),o=this.buttonPaddingWidth+r-this.outputWidth;if(o>0){if(this.multiLineItems){t.buttonContent=f.wordWrapContent(t.content,this.outputWidth-this.buttonPaddingWidth,t.contentHasMarkup);r=this.outputWidth-this.buttonPaddingWidth;i=t.buttonContent.length}else{t.buttonContent=f.truncateContent(t.content,r-o-a,t.contentHasMarkup)+this.contentEllipsis;r=f.computeContentWidth(t.buttonContent,t.contentHasMarkup)}}if(e&&l+i>s){u++;l=1;if(l+i>s&&i>1){i=s-l;t.buttonContent.length=i;t.buttonContent[i-1]=f.truncateContent(t.buttonContent[i-1].trimRight(),r-a,t.contentHasMarkup)+this.contentEllipsis}}l+=i;t.width=this.buttonPaddingWidth+r;t.page=u;if(t.width+this.buttonSymbolWidth>this.buttonsMaxWidth){this.buttonsMaxWidth=t.width+this.buttonSymbolWidth}if(!this.pageItemsDef[u]){this.pageItemsDef[u]=[]}this.pageItemsDef[u].push(t)});this.maxPage=u;if(this.separatorDef){this.separatorDef=Object.assign({content:"-",disabled:true,internalRole:"separator"},this.separatorDef);this.separatorDef.width=f.computeContentWidth(this.separatorDef.content,this.separatorDef.contentHasMarkup);if(this.separatorDef.contentRepeat&&this.separatorDef.width<this.buttonsMaxWidth-this.buttonPaddingWidth){this.separatorDef.content=this.separatorDef.content.repeat(Math.floor((this.buttonsMaxWidth-this.buttonPaddingWidth)/this.separatorDef.width));this.separatorDef.width=f.computeContentWidth(this.separatorDef.content,this.separatorDef.contentHasMarkup)}this.separatorDef.width+=this.buttonPaddingWidth;this.separatorDef.buttonContent=this.separatorDef.content}if(this.masterDef&&this.masterDef.width<this.buttonsMaxWidth){this.masterDef.buttonContent=this.masterDef.content+" "+" ".repeat(this.buttonsMaxWidth-this.masterDef.width)+this.masterDef.symbol;this.masterDef.width=this.buttonsMaxWidth}if(!this.pageItemsDef.length){this.pageItemsDef.push([])}this.pageItemsDef.forEach((t,e)=>{if(e){t.unshift(this.previousPageDef)}if(e<this.pageItemsDef.length-1){t.push(this.nextPageDef)}if(this.separatorDef){t.unshift(this.separatorDef)}if(this.masterDef){t.unshift(this.masterDef)}});if(this.outputWidth>this.buttonsMaxWidth){this.outputWidth=this.buttonsMaxWidth}if(this.elementType==="ColumnMenu"&&!t){this.initPage()}};n.prototype.initPage=function(t=this.page){var a=0,u=0;if(!this.pageItemsDef[t]){return}this.buttons.forEach(t=>t.destroy(false,true));this.buttons.length=0;this.pageItemsDef[t].forEach((t,e)=>{var r,i,n,s,o;if(!Array.isArray(t.buttonContent)){t.buttonContent=[t.buttonContent+" ".repeat(this.buttonsMaxWidth-t.width)]}r=t.internalRole?l:this.ButtonClass;i=r===h||r.prototype instanceof h;n=t.key;s=this.childUseParentKeyValue&&n&&this.value&&typeof this.value==="object"?this.value[n]:t.value;if(e%2){o=t.blurAttr||this.buttonBlurAttr}else{o=t.evenBlurAttr||t.blurAttr||this.buttonEvenBlurAttr||this.buttonBlurAttr}this.buttons[e]=new r({internal:true,parent:this,childId:e,internalRole:t.internalRole,contentHasMarkup:t.contentHasMarkup,content:t.buttonContent,blurContent:t.buttonBlurContent,focusContent:t.buttonFocusContent,disabledContent:t.buttonDisabledContent,submittedContent:t.buttonSubmittedContent,turnedOnBlurContent:t.buttonTurnedOnBlurContent,turnedOffBlurContent:t.buttonTurnedOffBlurContent,turnedOnFocusContent:t.buttonTurnedOnFocusContent,turnedOffFocusContent:t.buttonTurnedOffFocusContent,disabled:t.disabled,def:t,key:n,value:s,outputX:this.outputX+a,outputY:this.outputY+u,blurAttr:o,focusAttr:t.focusAttr||this.buttonFocusAttr,disabledAttr:t.disabledAttr||this.buttonDisabledAttr,submittedAttr:t.submittedAttr||this.buttonSubmittedAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.turnedOnFocusAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.turnedOffFocusAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.turnedOnBlurAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.turnedOffBlurAttr,blurLeftPadding:this.blurLeftPadding,blurRightPadding:this.blurRightPadding,focusLeftPadding:this.focusLeftPadding,focusRightPadding:this.focusRightPadding,disabledLeftPadding:this.disabledLeftPadding,disabledRightPadding:this.disabledRightPadding,submittedLeftPadding:this.submittedLeftPadding,submittedRightPadding:this.submittedRightPadding,turnedOnFocusLeftPadding:this.turnedOnFocusLeftPadding,turnedOnFocusRightPadding:this.turnedOnFocusRightPadding,turnedOffFocusLeftPadding:this.turnedOffFocusLeftPadding,turnedOffFocusRightPadding:this.turnedOffFocusRightPadding,turnedOnBlurLeftPadding:this.turnedOnBlurLeftPadding,turnedOnBlurRightPadding:this.turnedOnBlurRightPadding,turnedOffBlurLeftPadding:this.turnedOffBlurLeftPadding,turnedOffBlurRightPadding:this.turnedOffBlurRightPadding,paddingHasMarkup:this.paddingHasMarkup,keyBindings:i?this.toggleButtonKeyBindings:this.buttonKeyBindings,actionKeyBindings:i?this.toggleButtonActionKeyBindings:this.buttonActionKeyBindings,shortcuts:t.shortcuts,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);this.buttons[e].on("blinked",this.onButtonBlinked);this.buttons[e].on("focus",this.onButtonFocus);if(i){this.buttons[e].on("toggle",this.onButtonToggle)}u+=this.buttons[e].outputHeight});if(u<this.outputHeight){this.needRedraw=true}this.pageHeight=this.outputHeight=u};n.prototype.onParentResize=function(){if(!this.autoWidth&&!this.autoHeight){return}if(this.autoWidth){this.outputWidth=Math.round(this.outputDst.width*this.autoWidth)}if(this.autoHeight){this.maxHeight=Math.round(this.outputDst.height*this.autoHeight)}this.initChildren(true);this.page=0;this.initPage();this.draw()}},{"./BaseMenu.js":15,"./Button.js":16,"./Element.js":23,"./ToggleButton.js":35}],18:[function(t,e,r){"use strict";const i=t("./ColumnMenu.js");const n=t("./ToggleButton.js");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(t.value&&typeof t.value==="object"){this.setValue(t.value,true)}else{this.value={}}i.call(this,t);if(this.elementType==="ColumnMenuMulti"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="ColumnMenuMulti";s.prototype.ButtonClass=n;s.prototype.childUseParentKeyValue=true;s.prototype.initChildren=function(t=false){i.prototype.initChildren.call(this);if(this.elementType==="ColumnMenuMulti"&&!t){this.initPage()}};s.prototype.setValue=function(e,t){if(!e||typeof e!=="object"){return}if(Array.isArray(e)||e instanceof Set){this.value={};for(let t of e){if(t&&typeof t==="string"){this.value[t]=true}}}else{this.value=e}if(!this.buttons){return}this.buttons.forEach(t=>{if(t.internalRole||!t.key||!(t instanceof n)){return}t.setValue(this.value[t.key])});if(!t){this.draw()}};s.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"previous":this.focusChild=this.focusPreviousChild(!this.maxPage);if(this.focusChild===this.children[0]&&this.maxPage&&this.page>0){this.previousPage("backCycle")}break;case"next":this.focusChild=this.focusNextChild(!this.maxPage);if(this.focusChild===this.children[this.children.length-1]&&this.maxPage&&this.page<this.maxPage){this.nextPage("cycle")}break;case"previousPage":if(this.maxPage&&this.page>0){this.previousPage("backCycle")}break;case"nextPage":if(this.maxPage&&this.page<this.maxPage){this.nextPage("cycle")}break;case"firstPage":if(this.maxPage&&this.page!==0){this.toPage(0,"backCycle")}break;case"lastPage":if(this.maxPage&&this.page!==this.maxPage){this.toPage(this.maxPage,"cycle")}break;case"submit":this.emit("submit",this.value,undefined,this);break;default:return}return true};s.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;default:this.emit("submit",this.value,e,this)}};s.prototype.onButtonToggle=function(t,e,r){if(!r.key){return}if(t){this.value[r.key]=true}else{delete this.value[r.key]}this.emit("itemToggle",r.key,t,r)}},{"./ColumnMenu.js":17,"./ToggleButton.js":35}],19:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("../ScreenBuffer.js");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onKey=this.onKey.bind(this);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}this.palette=t.palette||this.document&&this.document.palette;this.object2attr=t=>n.object2attr(t,this.palette&&this.palette.colorNameToIndex);this.scrollable=!!t.scrollable;this.hasVScrollBar=this.scrollable&&!!t.vScrollBar;this.hasHScrollBar=this.scrollable&&!!t.hScrollBar;this.scrollX=t.scrollX||0;this.scrollY=t.scrollY||0;this.vScrollBarSlider=null;this.hScrollBarSlider=null;this.movable=!!t.movable;this.viewportX=this.outputX+this.containerBorderSize;this.viewportY=this.outputY+this.containerBorderSize;this.viewportWidth=this.outputWidth-this.containerBorderSize*2;this.viewportHeight=this.outputHeight-this.containerBorderSize*2;this.inputX=t.inputX||this.viewportX+this.scrollX;this.inputY=t.inputY||this.viewportY+this.scrollY;this.inputWidth=t.inputWidth||this.viewportWidth;this.inputHeight=t.inputHeight||this.viewportHeight;this.inputDst=new n({dst:this.outputDst,x:this.inputX,y:this.inputY,width:this.inputWidth,height:this.inputHeight,palette:this.palette});this.deltaDraw=false;this.backgroundAttr=t.backgroundAttr||{bgColor:"default"};this.on("key",this.onKey);this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.initChildren();if(this.elementType==="Container"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="Container";s.prototype.isContainer=true;s.prototype.containerBorderSize=0;const o=t("../termkit.js");s.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("click",this.onClick);this.off("drag",this.onDrag);this.off("wheel",this.onWheel);i.prototype.destroy.call(this,t,e)};s.prototype.keyBindings={UP:"tinyScrollUp",DOWN:"tinyScrollDown",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown"," ":"scrollDown",HOME:"scrollTop",END:"scrollBottom",LEFT:"scrollLeft",RIGHT:"scrollRight"};s.prototype.initChildren=function(){if(this.hasVScrollBar){this.vScrollBarSlider=new o.Slider({internal:true,parent:this,x:this.viewportWidth-1,y:0,height:this.viewportHeight,isVertical:true,valueToRate:t=>-t/Math.max(1,this.inputHeight-this.viewportHeight),rateToValue:t=>-t*Math.max(1,this.inputHeight-this.viewportHeight),noDraw:true});this.vScrollBarSlider.on("slideStep",t=>this.scroll(0,-t*Math.ceil(this.viewportHeight/2)));this.vScrollBarSlider.on("slide",t=>this.scrollTo(null,t))}if(this.hasHScrollBar){this.hScrollBarSlider=new o.Slider({internal:true,parent:this,x:0,y:this.inputWidth-this.containerBorderSize*2-1,width:this.viewportWidth-this.hasVScrollBar,valueToRate:t=>-t/Math.max(1,this.inputWidth-this.viewportWidth),rateToValue:t=>-t*Math.max(1,this.inputWidth-this.viewportWidth),noDraw:true});this.hScrollBarSlider.on("slideStep",t=>this.scroll(-t*Math.ceil(this.viewportWidth/2),0));this.hScrollBarSlider.on("slide",t=>this.scrollTo(t,null))}};s.prototype.resizeViewport=function(t){this.viewportWidth=t.width;this.viewportHeight=t.height};s.prototype.resizeInput=function(e){if(!e.x){e.x=0}if(!e.y){e.y=0}this.inputDst.resize(e);this.inputWidth=this.inputDst.width;this.inputHeight=this.inputDst.height;this.children.forEach(t=>t.emit("parentResize",e))};s.prototype.resize=function(e){if(!e.x){e.x=0}if(!e.y){e.y=0}this.inputDst.resize(e);this.viewportWidth=this.inputWidth=this.inputDst.width;this.viewportHeight=this.inputHeight=this.inputDst.height;this.children.forEach(t=>t.emit("parentResize",e))};s.prototype.move=function(t,e,r=false){return this.moveTo(this.outputX+t,this.outputY+e,r)};s.prototype.moveTo=function(t,e,r=false){this.outputX=t;this.outputY=e;this.viewportX=this.outputX+this.containerBorderSize;this.viewportY=this.outputY+this.containerBorderSize;this.inputDst.x=this.inputX=this.viewportX+this.scrollX;this.inputDst.y=this.inputY=this.viewportY+this.scrollY;if(!r){this.redraw()}};s.prototype.scroll=function(t,e,r=false){return this.scrollTo(t?this.scrollX+t:null,e?this.scrollY+e:null,r)};s.prototype.scrollToTop=function(t=false){return this.scrollTo(null,0,t)};s.prototype.scrollToBottom=function(t=false){return this.scrollTo(null,this.viewportHeight-this.inputHeight,t)};s.prototype.scrollTo=function(t,e,r=false){if(!this.scrollable){return}if(t!==undefined&&t!==null){this.scrollX=Math.min(0,Math.max(Math.round(t),this.viewportWidth-this.inputWidth+1));this.inputDst.x=this.inputX=this.viewportX+this.scrollX}if(e!==undefined&&e!==null){this.scrollY=Math.min(0,Math.max(Math.round(e),this.viewportHeight-this.inputHeight));this.inputDst.y=this.inputY=this.viewportY+this.scrollY}if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true);this.vScrollBarSlider.setSizeAndPosition({y:-this.scrollY})}if(this.hScrollBarSlider){this.hScrollBarSlider.setValue(this.scrollX,true)}if(!r){this.draw()}};s.prototype.preDrawSelf=function(){this.inputDst.fill({char:" ",attr:this.backgroundAttr})};s.prototype.postDrawSelf=function(){this.inputDst.draw({dst:this.outputDst,delta:this.deltaDraw,inline:this.strictInline,x:this.inputX,y:this.inputY,dstClipRect:{x:this.viewportX,y:this.viewportY,width:this.viewportWidth,height:this.viewportHeight}})};s.prototype.drawSelfCursor=function(t){if(t){this.restoreCursor()}else{this.inputDst.drawCursor()}};s.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"tinyScrollUp":this.scroll(0,Math.ceil(this.viewportHeight/5));break;case"tinyScrollDown":this.scroll(0,-Math.ceil(this.viewportHeight/5));break;case"scrollUp":this.scroll(0,Math.ceil(this.viewportHeight/2));break;case"scrollDown":this.scroll(0,-Math.ceil(this.viewportHeight/2));break;case"scrollLeft":this.scroll(Math.ceil(this.viewportWidth/2),0);break;case"scrollRight":this.scroll(-Math.ceil(this.viewportWidth/2),0);break;case"scrollTop":this.scrollToTop();break;case"scrollBottom":this.scrollToBottom();break;default:return}return true};s.prototype.onClick=function(t){if(this.scrollable&&!this.hasFocus){this.document.giveFocusTo(this,"select")}};s.prototype.onWheel=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(this.scrollable){this.scroll(0,-t.yDirection*Math.ceil(this.viewportHeight/5))}};s.prototype.onDrag=function(t){if(!this.movable||!t.dx&&!t.dy){return}this.move(t.dx,t.dy)}},{"../ScreenBuffer.js":3,"../termkit.js":50,"./Element.js":23}],20:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Container.js");const s=t("seventh");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.inlineTerm){t.outputX=1;t.outputY=1;t.outputWidth=t.outputDst.width;t.outputHeight=t.outputDst.height}this.strictInlineSupport=!!t.strictInline;this.noInput=!!t.noInput;n.call(this,t);this.parent=null;this.document=this;this.deltaDraw=!this.strictInline;this.id="_document"+"_"+a++;this.eventSource=t.eventSource;this.focusElement=null;this.hoverElement=null;this.clickOutCandidates=new Set;this.motionData={motion:false,xFrom:null,yFrom:null,x:null,y:null,dx:null,dy:null};this.draggingData={dragging:false,xFrom:null,yFrom:null,x:null,y:null,dx:null,dy:null,element:null,localDx:null,localDy:null};this.elements={};this.onEventSourceKey=this.onEventSourceKey.bind(this);this.onEventSourceMouse=this.onEventSourceMouse.bind(this);this.onEventSourceResize=this.onEventSourceResize.bind(this);if(!this.strictInline&&!this.noInput){this.eventSource.grabInput({mouse:"motion"})}this.elementByShortcut={};this.setClipboard=s.debounceUpdate(async(t,e)=>{if(!this.outputDst.setClipboard){return}await this.outputDst.setClipboard(t,e);await s.resolveTimeout(500)});this.getClipboard=s.debounceDelay(500,async t=>{if(!this.outputDst.getClipboard){return""}return this.outputDst.getClipboard(t)});this.eventSource.on("key",this.onEventSourceKey);this.eventSource.on("mouse",this.onEventSourceMouse);this.eventSource.on("resize",this.onEventSourceResize);if(this.elementType==="Document"&&!t.noDraw){this.draw()}}e.exports=o;o.prototype=Object.create(n.prototype);o.prototype.constructor=o;o.prototype.elementType="Document";o.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.eventSource.off("key",this.onEventSourceKey);this.eventSource.off("mouse",this.onEventSourceMouse);this.eventSource.off("resize",this.onEventSourceResize);i.prototype.destroy.call(this,t,e);this.eventSource=null;this.setClipboard=null;this.getClipboard=null};o.prototype.keyBindings=Object.assign({},n.prototype.keyBindings,{TAB:"focusNext",SHIFT_TAB:"focusPrevious"});var a=0;o.prototype.assignId=function(t,e){if(!e||typeof e!=="string"||e[0]==="_"||this.elements[e]){e="_"+t.elementType+"_"+a++}t.id=e;this.elements[e]=t};o.prototype.unassignId=function(t,e){t.id=null;delete this.elements[e]};o.prototype.giveFocusTo=function(t,e){if(!(t instanceof i)){throw new TypeError(""+t+" is not an instance of Element.")}if(!e){e="direct"}if(this.isAncestorOf(t)){return this.giveFocusTo_(t,e)}};o.prototype.giveFocusTo_=function(t,e){var r,i;if(this.focusElement!==t){if(this.focusElement){this.focusElement.emit("focus",false,e,this.focusElement)}this.focusElement=t;this.focusElement.emit("focus",true,e,this.focusElement)}i=!this.focusElement.disabled&&(this.focusElement.listenerCount("focus")||this.focusElement.listenerCount("key"));if(i){r=this.focusElement;while(r){if(r.listenerCount("clickOut")){this.clickOutCandidates.add(r)}r=r.parent}}return i};o.prototype.focusNext=function(){var t,e,r,i;if(!this.focusElement||!this.isAncestorOf(this.focusElement)){r=this}else{r=this.focusElement}if(r===this&&!this.children.length){return}e=r;for(;;){if(r.children.length&&!r.noChildFocus){r=r.children[0];if(!r.hidden){i=this.giveFocusTo_(r,"cycle")}}else if(r.parent){for(;;){t=r.parent.children.indexOf(r);if(t+1<r.parent.children.length){r=r.parent.children[t+1];if(!r.hidden){i=this.giveFocusTo_(r,"cycle");break}}else if(r.parent.parent){r=r.parent}else{if(e===r.parent){return}r=r.parent.children[0];if(!r.hidden){i=this.giveFocusTo_(r,"cycle");break}}}}else{return}if(e===r||!r.hidden&&i){break}}};o.prototype.focusPrevious=function(){var t,e,r,i;if(!this.focusElement||!this.isAncestorOf(this.focusElement)){r=this}else{r=this.focusElement}e=r;for(;;){if(r.parent){t=r.parent.children.indexOf(r);if(t-1>=0){r=r.parent.children[t-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else if(r.parent.parent){r=r.parent;if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else{if(e===r.parent){return}r=r.parent.children[r.parent.children.length-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}}else if(r.children.length){r=r.children[r.children.length-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else{return}if(e===r||!r.hidden&&i){break}}};o.prototype.onEventSourceKey=function(t,e,r){if(this.focusElement){this.bubblingEvent(this.focusElement,t,e,r)}else{this.defaultKeyHandling(t,e,r)}};o.prototype.bubblingEvent=function(r,i,n,s){if(r!==this){r.emit("key",i,n,s,(t,e)=>{if(!t){if(r.parent){this.bubblingEvent(r.parent,i,n,s)}else{this.defaultKeyHandling(i,n,s)}}})}else{this.defaultKeyHandling(i,n,s)}};o.prototype.defaultKeyHandling=function(t,e,r){switch(this.keyBindings[t]){case"focusNext":this.focusNext();break;case"focusPrevious":this.focusPrevious();break;default:if(this.elementByShortcut[t]&&this.elementByShortcut[t].document===this){this.elementByShortcut[t].emit("shortcut",t,e,r)}else{this.emit("key",t,e,r)}break}};o.prototype.createShortcuts=function(e,...t){if(e.document!==this){return}t.forEach(t=>this.elementByShortcut[t]=e)};o.prototype.removeElementShortcuts=function(e){for(let t in this.elementByShortcut){if(this.elementByShortcut[t]===e){this.elementByShortcut[t]=null}}};o.prototype.onEventSourceMouse=function(t,e){var r;switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":this.mouseClick(e);break;case"MOUSE_MOTION":this.mouseMotion(e);break;case"MOUSE_DRAG":this.mouseDrag(e);break;case"MOUSE_RIGHT_BUTTON_PRESSED":this.mouseClick(e,"rightClick");break;case"MOUSE_MIDDLE_BUTTON_PRESSED":this.mouseClick(e,"middleClick");break;case"MOUSE_WHEEL_UP":e.yDirection=-1;this.mouseWheel(e);break;case"MOUSE_WHEEL_DOWN":e.yDirection=1;this.mouseWheel(e);break;case"MOUSE_LEFT_BUTTON_RELEASED":if(this.draggingData.dragging){this.mouseDragEnd(e)}break}};const u=t=>t.listenerCount("click")||t.listenerCount("clickOut")||t.listenerCount("rightClick")||t.listenerCount("middleClick")||t.listenerCount("dragStart")||t.listenerCount("drag")||t.listenerCount("dragEnd")||t.listenerCount("hover")||t.listenerCount("leave")||t.listenerCount("enter");o.prototype.mouseClick=function(t,e="click"){var r=this.childrenAt(t.x-this.outputX,t.y-this.outputY,u);if(!r.length){if(this.clickOutCandidates.size){for(let t of this.clickOutCandidates){if(t.document===this){t.emit("clickOut")}}this.clickOutCandidates.clear()}return}if(this.clickOutCandidates.size){for(let t of this.clickOutCandidates){if(t.document===this&&t!==r[0].element&&!t.isAncestorOf(r[0].element)){t.emit("clickOut")}}this.clickOutCandidates.clear()}r[0].element.emit(e,{x:r[0].x,y:r[0].y},r[0].element)};o.prototype.mouseMotionStart=function(t){var e;this.motionData.motion=true;this.motionData.xFrom=t.xFrom;this.motionData.yFrom=t.yFrom;this.motionData.x=t.xFrom;this.motionData.y=t.yFrom};o.prototype.mouseMotionEnd=function(){this.motionData.motion=false};o.prototype.mouseMotion=function(t,e=null){var r=false;if(!this.motionData.motion){r=true;this.mouseMotionStart(t)}this.motionData.dx=t.x-this.motionData.x;this.motionData.dy=t.y-this.motionData.y;this.motionData.x=t.x;this.motionData.y=t.y;if(!r&&!this.motionData.dx&&!this.motionData.dy){return}var i=this.childrenAt(t.x-this.outputX,t.y-this.outputY,u);if(!i.length){if(this.hoverElement){this.hoverElement.emit("leave");this.hoverElement=null}return}if(i[0]!==e){i[0].element.emit("hover",{x:i[0].x,y:i[0].y},i[0].element)}i.forEach(t=>{if(t.element.listenerCount("clickOut")){this.clickOutCandidates.add(t.element)}});if(i[0].element!==this.hoverElement){if(this.hoverElement){this.hoverElement.emit("leave")}this.hoverElement=i[0].element;this.hoverElement.emit("enter")}};o.prototype.mouseDragStart=function(t){var e;this.draggingData.dragging=true;this.draggingData.xFrom=t.xFrom;this.draggingData.yFrom=t.yFrom;this.draggingData.x=t.xFrom;this.draggingData.y=t.yFrom;e=this.childrenAt(t.xFrom-this.outputX,t.yFrom-this.outputY,u);if(!e.length){if(this.hoverElement){this.hoverElement.emit("leave");this.hoverElement=null}return}this.draggingData.element=e[0].element;this.draggingData.localDx=e[0].x-t.xFrom;this.draggingData.localDy=e[0].y-t.yFrom;e[0].element.emit("dragStart",{x:e[0].x,y:e[0].y},e[0].element)};o.prototype.mouseDragEnd=function(t){if(this.draggingData.element){this.draggingData.element.emit("dragEnd",{xFrom:this.draggingData.xFrom+this.draggingData.localDx,yFrom:this.draggingData.yFrom+this.draggingData.localDy,x:this.draggingData.x+this.draggingData.localDx,y:this.draggingData.y+this.draggingData.localDy},this.draggingData.element)}this.draggingData.dragging=false};o.prototype.mouseDrag=function(t){var e=false;if(!this.draggingData.dragging){e=true;this.mouseDragStart(t)}this.draggingData.dx=t.x-this.draggingData.x;this.draggingData.dy=t.y-this.draggingData.y;this.draggingData.x=t.x;this.draggingData.y=t.y;if(!e&&!this.draggingData.dx&&!this.draggingData.dy){return}if(this.draggingData.element){this.draggingData.element.emit("drag",{xFrom:this.draggingData.xFrom+this.draggingData.localDx,yFrom:this.draggingData.yFrom+this.draggingData.localDy,x:t.x+this.draggingData.localDx,y:t.y+this.draggingData.localDy,dx:this.draggingData.dx,dy:this.draggingData.dy},this.draggingData.element)}this.mouseMotion(t,this.draggingData.element)};o.prototype.mouseWheel=function(t){var e=this.childrenAt(t.x-this.outputX,t.y-this.outputY,t=>t.listenerCount("wheel"));if(!e.length){return}e[0].element.emit("wheel",{x:e[0].x,y:e[0].y,yDirection:t.yDirection},e[0].element)};o.prototype.onEventSourceResize=function(t,e){if(this.inlineTerm){return}this.resize({x:0,y:0,width:t,height:e});this.outputWidth=t;this.outputHeight=e;this.draw()}},{"./Container.js":19,"./Element.js":23,seventh:108}],21:[function(t,e,r){"use strict";const i=t("./RowMenu.js");const o=t("./ColumnMenu.js");function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;var e,r;i.call(this,t);this.initPage();this.columnMenu=null;this.columnButtonFocusAttr=t.buttonFocusAttr||{bgColor:"blue",color:"white",bold:true};this.columnButtonBlurAttr=t.buttonBlurAttr||{bgColor:"brightBlack",color:"white",bold:true};this.clearColumnMenuOnSubmit=!!t.clearColumnMenuOnSubmit;this.onClickOut=this.onClickOut.bind(this);this.onButtonFocus=this.onButtonFocus.bind(this);this.onButtonSubmit=this.onButtonSubmit.bind(this);this.onColumnMenuSubmit=this.onColumnMenuSubmit.bind(this);this.on("clickOut",this.onClickOut);for(e=0,r=this.buttons.length;e<r;e++){this.buttons[e].on("focus",this.onButtonFocus)}if(this.elementType==="DropDownMenu"&&!t.noDraw){this.draw()}}e.exports=n;n.prototype=Object.create(i.prototype);n.prototype.constructor=n;n.prototype.elementType="DropDownMenu";n.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("clickOut",this.onClickOut);i.prototype.destroy.call(this,t,e)};n.prototype.keyBindings={LEFT:"previous",RIGHT:"next",ESCAPE:"clearColumnMenu",UP:"clearColumnMenu",DOWN:"dropDown",ENTER:"submit",KP_ENTER:"submit",ALT_ENTER:"submit"};n.prototype.dropDown=function(t,e,r,i,n){var s=this.itemsDef[t].items;if(this.columnMenu){if(this.columnMenu.index===t){return}this.clearColumnMenu()}if(!s||!s.length){if(i&&this.itemsDef[t].topSubmit){this.emit("submit",i,n,this)}return}this.columnMenu=new o({internal:true,parent:this.children[t],x:e,y:r,width:this.outputWidth-e,leftPadding:" ",rightPadding:" ",items:s,buttonFocusAttr:this.columnButtonFocusAttr,buttonBlurAttr:this.columnButtonBlurAttr});this.columnMenu.on("submit",this.onColumnMenuSubmit)};n.prototype.clearColumnMenu=function(){if(!this.columnMenu){return false}this.columnMenu.destroy();this.columnMenu=null;return true};n.prototype.setDropDownItem=function(e,r,t){var i=this.itemsDef.find(t=>t.value===e);if(!i){return false}var n=i.items&&i.items.find(t=>t.value===r);if(!n){return false}this.clearColumnMenu();Object.assign(n,t);return true};n.prototype.onClickOut=function(t,e,r){this.clearColumnMenu()};n.prototype.onButtonSubmit=function(t,e,r){this.dropDown(r.childId,r.outputX,r.outputY+1,t,e)};n.prototype.onButtonFocus=function(t,e,r){if(t){this.dropDown(r.childId,r.outputX,r.outputY+1)}};n.prototype.onColumnMenuSubmit=function(t,e,r){r.once("blinked",(t,e,r)=>{if(this.clearColumnMenuOnSubmit){this.clearColumnMenu()}this.emit("blinked",t,e,this)});this.emit("submit",t,e,this)};n.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"previous":this.focusChild=this.focusPreviousChild();break;case"next":this.focusChild=this.focusNextChild();break;case"dropDown":if(this.columnMenu){this.columnMenu.focusNextChild()}break;case"clearColumnMenu":return this.clearColumnMenu();default:return}return true}},{"./ColumnMenu.js":17,"./RowMenu.js":28}],22:[function(t,e,r){"use strict";const i=t("./TextBox.js");const n=t("string-kit");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(t.value){t.content=t.value}i.call(this,t);this.onKey=this.onKey.bind(this);this.onFocus=this.onFocus.bind(this);this.onMiddleClick=this.onMiddleClick.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}this.extraScrolling=t.extraScrolling!==undefined?!!t.extraScrolling:true;this.updateStatus();this.on("key",this.onKey);this.on("focus",this.onFocus);this.on("middleClick",this.onMiddleClick);if(this.elementType==="EditableTextBox"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="EditableTextBox";s.prototype.needInput=true;s.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("focus",this.onFocus);this.off("middleClick",this.onMiddleClick);i.prototype.destroy.call(this,t,e)};s.prototype.keyBindings={ENTER:"newLine",KP_ENTER:"newLine",BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",UP:"up",DOWN:"down",HOME:"startOfLine",END:"endOfLine",TAB:"tab",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown",CTRL_O:"copyClipboard",CTRL_P:"pasteClipboard"};s.prototype.drawSelfCursor=function(){this.textBuffer.drawCursor()};s.prototype.getValue=i.prototype.getContent;s.prototype.setValue=function(t,e){return i.prototype.setContent.call(t,false,e)};s.prototype.onKey=function(t,e,r){var i;if(r&&r.isCharacter){this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();this.autoScrollAndDraw()}else{switch(this.keyBindings[t]){case"newLine":this.textBuffer.newLine();this.textBuffer.runStateMachine();this.autoScrollAndDraw();break;case"backDelete":this.textBuffer.backDelete();this.textBuffer.runStateMachine();this.autoScrollAndDraw();break;case"delete":this.textBuffer.delete();this.textBuffer.runStateMachine();this.autoScrollAndDraw();break;case"backward":this.textBuffer.moveBackward();this.autoScrollAndDrawCursor();break;case"forward":this.textBuffer.moveForward();this.autoScrollAndDrawCursor();break;case"startOfWord":this.textBuffer.moveToStartOfWord();this.autoScrollAndDrawCursor();break;case"endOfWord":this.textBuffer.moveToEndOfWord();this.autoScrollAndDrawCursor();break;case"startOfLine":this.textBuffer.moveToColumn(0);this.autoScrollAndDrawCursor();break;case"endOfLine":this.textBuffer.moveToEndOfLine();this.autoScrollAndDrawCursor();break;case"down":this.textBuffer.moveDown();this.autoScrollAndDrawCursor();break;case"up":this.textBuffer.moveUp();this.autoScrollAndDrawCursor();break;case"left":this.textBuffer.moveLeft();this.autoScrollAndDrawCursor();break;case"right":this.textBuffer.moveRight();this.autoScrollAndDrawCursor();break;case"tab":this.textBuffer.insert("\t",this.textAttr);this.textBuffer.runStateMachine();this.autoScrollAndDraw();break;case"scrollUp":i=Math.ceil(this.outputHeight/2);this.textBuffer.move(0,-i);this.scroll(0,i);break;case"scrollDown":i=-Math.ceil(this.outputHeight/2);this.textBuffer.move(0,-i);this.scroll(0,i);break;case"pasteClipboard":if(this.document){this.document.getClipboard().then(t=>{if(t){this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();this.autoScrollAndDraw()}}).catch(()=>undefined)}break;case"copyClipboard":if(this.document){this.document.setClipboard(this.textBuffer.getSelectionText()).catch(()=>undefined)}break;default:return}}return true};s.prototype.onFocus=function(t,e){this.hasFocus=t;this.updateStatus();this.draw()};s.prototype.onClick=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}else{this.textBuffer.moveTo(t.x-this.scrollX,t.y-this.scrollY);this.drawCursor()}};s.prototype.onMiddleClick=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(this.document){this.document.getClipboard("primary").then(t=>{if(t){this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();this.autoScrollAndDraw()}}).catch(()=>undefined)}};s.prototype.updateStatus=function(){}},{"./TextBox.js":33,"string-kit":123}],23:[function(t,e,r){"use strict";const n=t("../misc.js");const s=t("string-kit");const i=t("nextgen-events");function o(t={}){this.setInterruptible(true);this.parent=t.parent&&t.parent.elementType?t.parent:null;this.document=null;this.destroyed=false;this.inlineTerm=t.inlineTerm||null;this.strictInline=!!(this.inlineTerm&&this.strictInlineSupport&&(t.strictInline||t.strictInline===undefined));this.restoreCursorAfterDraw=!!(this.inlineTerm&&this.inlineCursorRestoreAfterDraw&&!this.strictInline);this.outputDst=t.outputDst||t.parent&&t.parent.inputDst,this.inputDst=null;this.label=t.label||"";this.key=t.key||null;if(this.value===undefined){this.value=t.value===undefined?null:t.value}this.childId=t.childId===undefined?null:t.childId;this.def=t.def||null;this.hidden=!!t.hidden;this.disabled=!!t.disabled;this.content="";this.contentHasMarkup=false;this.contentWidth=0;if(this.setContent===o.prototype.setContent){this.setContent(t.content||"",t.contentHasMarkup,true,true)}this.meta=t.meta;this.autoWidth=+t.autoWidth||0;this.autoHeight=+t.autoHeight||0;this.outputX=t.outputX||t.x||0;this.outputY=t.outputY||t.y||0;this.savedZIndex=this.zIndex=t.zIndex||t.z||0;this.interceptTempZIndex=!!t.interceptTempZIndex;this.outputWidth=this.autoWidth&&this.outputDst?Math.round(this.outputDst.width*this.autoWidth):t.outputWidth?t.outputWidth:t.width?t.width:this.strictInline?this.inlineTerm.width:1;this.outputHeight=this.autoHeight&&this.outputDst?Math.round(this.outputDst.height*this.autoHeight):t.outputHeight?t.outputHeight:t.height?t.height:this.strictInline?this.inlineTerm.height:1;this.needRedraw=false;this.savedCursorX=0;this.savedCursorY=0;this.hasFocus=false;this.children=[];this.zChildren=[];this.inputDst=this.outputDst;this.inputX=this.outputX;this.inputY=this.outputY;this.inputWidth=this.outputWidth;this.inputHeight=this.outputHeight;if(this.parent){this.parent.attach(this,t.id)}if(t.shortcuts&&this.document){if(Array.isArray(t.shortcuts)){this.document.createShortcuts(this,...t.shortcuts)}else{this.document.createShortcuts(this,t.shortcuts)}}}e.exports=o;o.prototype=Object.create(i.prototype);o.prototype.constructor=o;o.prototype.elementType="Element";const u=t("../termkit.js");o.prototype.destroy=function(t=false,e=false){if(this.destroyed){return}var r,i,n=this.document;for(r=0,i=this.children.length;r<i;r++){this.children[r].destroy(true)}this.children.length=0;this.zChildren.length=0;this.document.removeElementShortcuts(this);if(!t){this.detach(e);if(this.inlineTerm&&n!==this){n.destroy()}}else{delete this.document.elements[this.id];this.id=null;this.parent=null;this.document=null}this.destroyed=true};o.prototype.show=function(t=false){if(!this.hidden){return this}this.hidden=false;if(!t){this.redraw()}return this};o.prototype.hide=function(t=false){if(this.hidden){return this}this.hidden=true;if(!t){this.redraw(true)}return this};o.prototype.clear=function(){var t,e;for(t=0,e=this.children.length;t<e;t++){this.children[t].destroy(true)}this.children.length=0;this.zChildren.length=0;this.draw()};o.prototype.attach=function(t,e){if(this.children.indexOf(t)===-1){t.parent=this;this.children.push(t);this.zInsert(t);t.outputDst=this.inputDst;if(!t.inputDst){t.inputDst=t.outputDst}if(this.document!==t.document){t.recursiveFixAttachment(this.document,e)}}return this};o.prototype.attachTo=function(t,e){if(t.elementType){t.attach(this,e)}return this};o.prototype.recursiveFixAttachment=function(t,e=this.id){var r,i;if(t){t.assignId(this,e)}else if(this.document){this.document.unassignId(this,this.id)}else{this.id=null}this.document=t||null;if(this.parent){this.outputDst=this.parent.inputDst;if(!this.inputDst){this.inputDst=this.outputDst}}for(r=0,i=this.children.length;r<i;r++){this.children[r].recursiveFixAttachment(t)}};o.prototype.detach=function(t=false){var e,r=this.parent;if(!r){return}e=r.children.indexOf(this);if(e>=0){r.children.splice(e,1)}e=r.zChildren.indexOf(this);if(e>=0){r.zChildren.splice(e,1)}delete this.document.elements[this.id];this.parent=null;this.recursiveFixAttachment(null);if(!t){r.document.draw()}return this};o.prototype.resizeToContent=function(){this.outputWidth=this.contentWidth;this.outputHeight=this.contentHeight};o.prototype.zSort=function(){this.zChildren.sort((t,e)=>t.zIndex-e.zIndex)};o.prototype.zInsert=function(t){var e,r=this.zChildren.length;while(r--){e=this.zChildren[r];if(t.zIndex>=e.zIndex){this.zChildren[r+1]=t;return}this.zChildren[r+1]=e}this.zChildren[0]=t};o.prototype.updateZ=o.prototype.updateZIndex=function(t){this.savedZIndex=this.zIndex=t;this.parent.zSort()};o.prototype.topZ=function(){if(this.parent.interceptTempZIndex){return this.parent.topZ()}if(!this.parent.zChildren.length){return}this.zIndex=this.parent.zChildren[this.parent.zChildren.length-1].zIndex+1;this.parent.zSort()};o.prototype.bottomZ=function(){if(this.parent.interceptTempZIndex){return this.parent.bottomZ()}if(!this.parent.zChildren.length){return}this.zIndex=this.parent.zChildren[0].zIndex-1;this.parent.zSort()};o.prototype.restoreZ=function(){if(this.parent.interceptTempZIndex){return this.parent.restoreZ()}this.zIndex=this.savedZIndex;this.parent.zSort()};o.computeContentWidth=(t,e)=>{if(Array.isArray(t)){return e==="ansi"||e==="legacyAnsi"?Math.max(...t.map(t=>n.ansiWidth(t))):e?Math.max(...t.map(t=>n.markupWidth(t))):Math.max(...t.map(t=>s.unicode.width(t)))}return e==="ansi"||e==="legacyAnsi"?n.ansiWidth(t):e?n.markupWidth(t):s.unicode.width(t)};var a=0;o.getLastTruncateWidth=()=>a;o.truncateContent=(t,e,r)=>{var i;if(r==="ansi"||r==="legacyAnsi"){i=n.truncateAnsiString(t,e);a=n.getLastTruncateWidth()}else if(r){i=n.truncateMarkupString(t,e);a=n.getLastTruncateWidth()}else{i=s.unicode.truncateWidth(t,e);a=s.unicode.getLastTruncateWidth()}return i};o.wordwrapContent=o.wordWrapContent=(t,e,r)=>r==="ansi"||r==="legacyAnsi"?n.wordWrapAnsi(t,e):r?n.wordWrapMarkup(t,e):s.wordwrap(t,{width:e,fill:true,noJoin:true});o.prototype.setContent=function(t,e,r=false,i=false){if(this.forceContentArray&&!Array.isArray(t)){t=[t||""]}this.content=t;this.contentHasMarkup=e;this.contentWidth=o.computeContentWidth(t,this.contentHasMarkup);if(!i&&this.resizeOnContent){this.resizeOnContent()}if(!r){this.redraw()}};o.prototype.isAncestorOf=function(t){var e=t;for(;;){if(e===this){return true}else if(!e.parent){return false}else if(e.parent.children.indexOf(e)===-1){e.parent=null;return false}e=e.parent}};o.prototype.getParentContainer=function(){var t=this;for(;;){if(!t.parent){return null}if(t.parent.isContainer){return t.parent}t=t.parent}};o.prototype.getFocusBranchIndex=function(){var t,e;if(!this.document.focusElement){return null}e=this.document.focusElement;for(;;){if(e===this){return null}else if(!e.parent){return null}if(e.parent===this){t=e.parent.children.indexOf(e);if(t===-1){e.parent=null;return null}return t}e=e.parent}};o.prototype.focusNextChild=function(t=true){var e,r,i;if(!this.children.length||!this.document){return null}if(!this.document.focusElement||(e=this.getFocusBranchIndex())===null){e=this.children.length-1}r=e;for(;;){e++;if(e>=this.children.length){if(t){e=0}else{e=this.children.length-1;break}}i=this.document.giveFocusTo_(this.children[e],"cycle");if(i||r===e){break}}return this.children[e]};o.prototype.focusPreviousChild=function(t=true){var e,r,i;if(!this.children.length||!this.document){return null}if(!this.document.focusElement||(e=this.getFocusBranchIndex())===null){e=0}r=e;for(;;){e--;if(e<0){if(t){e=this.children.length-1}else{e=0;break}}i=this.document.giveFocusTo_(this.children[e],"backCycle");if(i||r===e){break}}return this.children[e]};o.prototype.childrenAt=function(t,e,r=null,i=[]){var n,s;n=this.zChildren.length;while(n--){s=this.zChildren[n];if(s.hidden){continue}if(t>=s.outputX&&t<=s.outputX+s.outputWidth-1&&e>=s.outputY&&e<=s.outputY+s.outputHeight-1){if(s.isContainer){s.childrenAt(t-s.inputX,e-s.inputY,r,i)}else{s.childrenAt(t,e,r,i)}if(!r||r(s)){i.push({element:s,x:t-s.outputX,y:e-s.outputY})}}else if(!s.isContainer){s.childrenAt(t,e,r,i)}}return i};o.prototype.saveCursor=function(){if(this.inputDst){this.savedCursorX=this.inputDst.cx;this.savedCursorY=this.inputDst.cy}else if(this.outputDst){this.savedCursorX=this.outputDst.cx;this.savedCursorY=this.outputDst.cy}return this};o.prototype.restoreCursor=function(){if(this.inputDst){this.inputDst.cx=this.savedCursorX;this.inputDst.cy=this.savedCursorY;this.inputDst.drawCursor()}else if(this.outputDst){this.outputDst.cx=this.savedCursorX;this.outputDst.cy=this.savedCursorY;this.outputDst.drawCursor()}return this};o.prototype.draw=function(t=false){if(!this.document||this.hidden){return this}if(!t){if(this.restoreCursorAfterDraw){this.inlineTerm.saveCursor()}else if(!this.strictInline){this.saveCursor()}}this.descendantDraw();this.ascendantDraw();if(!t){if(this.restoreCursorAfterDraw){this.inlineTerm.restoreCursor()}else if(!this.strictInline){this.drawCursor()}}return this};o.prototype.redraw=function(t=false){if(!this.document||this.hidden&&!t){return this}var e=this.getParentContainer();if(!e){this.draw()}else{e.draw()}return this};o.prototype.updateDraw=function(){if(this.needRedraw){this.redraw()}else{this.draw()}this.needRedraw=false};o.prototype.descendantDraw=function(t){var e,r;if(this.hidden){return this}if(this.preDrawSelf){this.preDrawSelf(!t)}for(e=0,r=this.zChildren.length;e<r;e++){this.zChildren[e].descendantDraw(true)}if(t&&this.postDrawSelf){this.postDrawSelf(!t)}return this};o.prototype.ascendantDraw=function(){var t;if(this.postDrawSelf&&!this.hidden){this.postDrawSelf(true)}t=this;while(t.parent&&t.outputDst!==t.document.outputDst){t=t.parent;if(t.outputDst!==t.inputDst&&t.postDrawSelf&&!t.hidden){t.postDrawSelf(false)}}return this};o.prototype.drawCursor=function(){var t;if(this.drawSelfCursor&&!this.hidden){this.drawSelfCursor(true)}t=this;while(t.outputDst!==t.document.outputDst&&t.parent){t=t.parent;if(t.drawSelfCursor&&!t.hidden){t.drawSelfCursor(false)}}return this};o.createInline=async function(e,t,r){r=!r?{}:r.internal?r:Object.create(r);r.internal=true;r.inlineTerm=e;var i,n={x:r.outputX||r.x,y:r.outputY||r.y};r.x=r.y=r.outputX=r.outputY=0;var s=new t(r);if(n.x===undefined||n.y===undefined){if(s.strictInline){n.x=n.y=1}else{i=await e.getCursorLocation();if(n.x===undefined){n.x=i.x;if(i.x>1&&s.inlineNewLine){n.x=1;if(n.y===undefined){n.y=i.y+1}}}if(n.y===undefined){n.y=i.y}}}if(!s.strictInline){let t=n.y+s.outputHeight-e.height;if(t>0){e.scrollUp(t);e.up(t);n.y-=t}}if(s.inlineResizeToContent){s.resizeToContent()}var o={internal:true,inlineTerm:e,strictInline:s.strictInline,noInput:s.strictInline||!s.needInput,outputX:n.x,outputY:n.y,outputWidth:s.outputWidth,outputHeight:s.outputHeight,outputDst:e,eventSource:e,noDraw:true};var a=new u.Document(o);a.attach(s);s.on("resize",()=>{throw new Error("not coded!")});s.draw(true);e.styleReset();if(s.staticInline){s.destroy(undefined,true)}return s};o.prototype.isContainer=false;o.prototype.forceContentArray=false;o.prototype.noChildFocus=false;o.prototype.computeBoundingBoxes=null;o.prototype.resizeOnContent=null;o.prototype.preDrawSelf=null;o.prototype.postDrawSelf=null;o.prototype.drawSelfCursor=null;o.prototype.getValue=()=>null;o.prototype.setValue=()=>undefined;o.prototype.strictInlineSupport=false;o.prototype.staticInline=false;o.prototype.inlineCursorRestoreAfterDraw=false;o.prototype.needInput=false},{"../misc.js":42,"../termkit.js":50,"nextgen-events":72,"string-kit":123}],24:[function(e,i,t){(function(r){(function(){"use strict";const o=e("./Element.js");const a=e("./LabeledInput.js");const u=e("./Button.js");function t(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.outputWidth&&!t.width){t.outputWidth=78}o.call(this,t);this.submitValue=null;this.inputsDef=t.inputs||[];this.labeledInputs=[];this.buttonsDef=t.buttons||[];this.buttons=[];this.focusChild=null;this.onButtonSubmit=this.onButtonSubmit.bind(this);this.onKey=this.onKey.bind(this);this.onFocus=this.onFocus.bind(this);this.textAttr=t.textAttr||null;this.voidAttr=t.voidAttr||t.emptyAttr||null;this.labelFocusAttr=t.labelFocusAttr||null;this.labelBlurAttr=t.labelBlurAttr||null;this.buttonFocusAttr=t.buttonFocusAttr||null;this.buttonBlurAttr=t.buttonBlurAttr||null;this.turnedOnBlurAttr=t.turnedOnBlurAttr||null;this.turnedOnFocusAttr=t.turnedOnFocusAttr||null;this.turnedOffBlurAttr=t.turnedOffBlurAttr||null;this.turnedOffFocusAttr=t.turnedOffFocusAttr||null;if(t.keyBindings){this.keyBindings=t.keyBindings}if(t.textInputKeyBindings){this.textInputKeyBindings=t.textInputKeyBindings}this.initChildren();this.on("key",this.onKey);this.on("focus",this.onFocus);if(this.elementType==="Form"&&!t.noDraw){this.draw()}}i.exports=t;t.prototype=Object.create(o.prototype);t.prototype.constructor=t;t.prototype.elementType="Form";t.prototype.needInput=true;t.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("focus",this.onFocus);o.prototype.destroy.call(this,t,e)};t.prototype.keyBindings={LEFT:"previous",RIGHT:"next",UP:"previous",DOWN:"next",ENTER:"next",KP_ENTER:"next",ALT_ENTER:"next"};t.prototype.textInputKeyBindings={};t.prototype.selectInputKeyBindings={};t.prototype.selectMultiInputKeyBindings={};t.prototype.initChildren=function(){var n=0,r=0,s=0,e=0,i=0;this.inputsDef.forEach(t=>{t.labelWidth=o.computeContentWidth(t.label,t.labelHasMarkup);if(t.labelWidth>n){n=t.labelWidth}});this.inputsDef.forEach((t,e)=>{var r=1,i=t.label+" ".repeat(n-t.labelWidth);switch(t.type){case"select":this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,value:t.value,items:t.items,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,buttonBlurAttr:t.buttonBlurAttr||this.buttonBlurAttr,buttonFocusAttr:t.buttonFocusAttr||this.buttonFocusAttr,buttonDisabledAttr:t.buttonDisabledAttr||this.buttonDisabledAttr,buttonSubmittedAttr:t.buttonSubmittedAttr||this.buttonSubmittedAttr,keyBindings:this.selectInputKeyBindings,noDraw:true});break;case"select-multi":case"selectMulti":this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,value:t.value,items:t.items,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,buttonBlurAttr:t.buttonBlurAttr||this.buttonBlurAttr,buttonFocusAttr:t.buttonFocusAttr||this.buttonFocusAttr,buttonDisabledAttr:t.buttonDisabledAttr||this.buttonDisabledAttr,buttonSubmittedAttr:t.buttonSubmittedAttr||this.buttonSubmittedAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.turnedOnBlurAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.turnedOnFocusAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.turnedOffBlurAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.turnedOffFocusAttr,keyBindings:this.selectInputKeyBindings,noDraw:true});break;case"text":default:t.type="text";if(t.height){r=t.height}this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,lineWrap:!!t.lineWrap,wordWrap:!!t.wordWrap,scrollable:!!t.scrollable,vScrollBar:!!t.vScrollBar,hScrollBar:!!t.hScrollBar,hiddenContent:t.hiddenContent,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,textAttr:t.textAttr||this.textAttr,voidAttr:t.voidAttr||t.emptyAttr||this.voidAttr,keyBindings:this.textInputKeyBindings,allowNewLine:r>1,noDraw:true});break}s+=r});if(!this.buttonsDef.length){this.buttonsDef.push({content:"Submit",value:"submit"})}this.buttonsDef.forEach(t=>{t.contentWidth=o.computeContentWidth(t.content,t.contentHasMarkup);e+=t.contentWidth});i=Math.floor((this.outputWidth-e)/(this.buttonsDef.length+1));r=i;s++;this.buttonsDef.forEach((t,e)=>{this.buttons[e]=new u({internal:true,parent:this,content:t.content,value:t.value,outputX:this.outputX+r,outputY:this.outputY+s,focusAttr:t.focusAttr||this.buttonFocusAttr,blurAttr:t.blurAttr||this.buttonBlurAttr,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);r+=t.contentWidth+i})};t.prototype.getValue=function(){var e={};this.labeledInputs.forEach(t=>{e[t.key]=t.getValue()});return{submit:this.submitValue,fields:e}};t.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"previous":this.focusChild=this.focusPreviousChild();break;case"next":this.focusChild=this.focusNextChild();break;default:return}return true};t.prototype.onFocus=function(t,e){if(e==="cycle"||e==="backCycle"){return}if(t){r.nextTick(()=>{if(this.focusChild){this.document.giveFocusTo(this.focusChild,"delegate")}else{this.focusChild=this.focusNextChild()}})}};t.prototype.onButtonSubmit=function(t,e){this.submitValue=t;this.emit("submit",this.getValue(),e,this)}}).call(this)}).call(this,e("_process"))},{"./Button.js":16,"./Element.js":23,"./LabeledInput.js":26,_process:179}],25:[function(t,e,r){"use strict";const i=t("seventh");const n=t("./TextBox.js");const s=t("./EditableTextBox.js");const o=t("./RowMenu.js");const a=t("string-kit");const u=t("../autoComplete.js");function l(e){e=!e?{}:e.internal?e:Object.create(e);e.internal=true;if(e.value){e.content=e.value}e.outputHeight=1;e.scrollable=e.hasVScrollBar=e.hasHScrollBar=e.extraScrolling=false;e.scrollX=e.scrollY=0;e.lineWrap=true;this.onAutoCompleteMenuSubmit=this.onAutoCompleteMenuSubmit.bind(this);this.onAutoCompleteMenuCancel=this.onAutoCompleteMenuCancel.bind(this);this.promptTextBox=null;if(e.prompt){this.promptTextBox=new n(Object.assign({textAttr:e.textAttr},e.prompt,{internal:true,outputX:e.outputX||e.x,outputY:e.outputY||e.y,outputWidth:e.outputWidth||e.width,outputHeight:e.outputHeight||e.height,lineWrap:e.lineWrap,wordWrap:e.wordWrap||e.wordwrap}));this.promptTextBox.textBuffer.setVoidAttr(null);let t=this.promptTextBox.getContentSize();this.promptTextBox.setSizeAndPosition(t);if(t.height>1){e.outputY=(e.outputY||e.y)+t.height-1;e.firstLineRightShift=this.promptTextBox.textBuffer.buffer[this.promptTextBox.textBuffer.buffer.length-1].length}else{e.firstLineRightShift=t.width}}s.call(this,e);this.history=e.history;this.contentArray=e.history?[...e.history,this.content]:[this.content];this.contentIndex=this.contentArray.length-1;this.disabled=!!e.disabled;this.submitted=!!e.submitted;this.cancelable=!!e.cancelable;this.canceled=!!e.canceled;this.autoComplete=e.autoComplete;this.useAutoCompleteHint=!!(this.autoComplete&&(e.useAutoCompleteHint||e.autoCompleteHint));this.useAutoCompleteMenu=!!(this.autoComplete&&(e.useAutoCompleteMenu||e.autoCompleteMenu));this.autoCompleteMenu=null;this.autoCompleteLeftPart=null;this.autoCompleteRightPart=null;this.menuOptions=Object.assign({},this.defaultMenuOptions,e.menu);this.placeholder=e.placeholder;this.placeholderHasMarkup=e.placeholderHasMarkup;if(this.placeholder){this.setAltContent(this.placeholder,this.placeholderHasMarkup)}if(this.promptTextBox){this.attach(this.promptTextBox)}if(this.elementType==="InlineInput"&&!e.noDraw){this.draw()}}e.exports=l;l.prototype=Object.create(s.prototype);l.prototype.constructor=l;l.prototype.elementType="InlineInput";l.prototype.useAltTextBuffer=true;l.prototype.defaultMenuOptions={buttonBlurAttr:{bgColor:"default",color:"default"},buttonFocusAttr:{bgColor:"green",color:"blue",dim:true},buttonDisabledAttr:{bgColor:"white",color:"brightBlack"},buttonSubmittedAttr:{bgColor:"brightWhite",color:"brightBlack"},buttonSeparatorAttr:{bgColor:"default"},backgroundAttr:{bgColor:"default"},justify:true,keyBindings:Object.assign({},o.prototype.keyBindings,{TAB:"next",SHIFT_TAB:"previous"})};l.prototype.keyBindings={ENTER:"submit",KP_ENTER:"submit",ESCAPE:"cancel",TAB:"autoComplete",CTRL_R:"historyAutoComplete",UP:"historyPrevious",DOWN:"historyNext",BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",HOME:"startOfLine",END:"endOfLine",CTRL_O:"copyClipboard",CTRL_P:"pasteClipboard"};l.prototype.preDrawSelf=function(){s.prototype.preDrawSelf.call(this)};l.prototype.autoResizeAndDraw=function(t=false){var e=Math.max(this.textBuffer.buffer.length,this.altTextBuffer&&this.altTextBuffer.buffer.length||0);if(e>this.outputHeight){this.setSizeAndPosition({outputHeight:e})}if(!t){this.draw()}else{this.drawCursor()}};l.prototype.autoResizeAndDrawCursor=function(){return this.autoResizeAndDraw(true)};l.prototype.runAutoCompleteHint=async function(t){var e;var[r,i]=this.textBuffer.getCursorSplittedText();if(i){this.altTextBuffer.setText("")}else{if(Array.isArray(t)){e=u(t,r,false)}else if(typeof t==="function"){e=await t(r,false)}else{return}if(Array.isArray(e)){if(!e.length){return}e=e[0]}if(e===r){this.altTextBuffer.setText("")}else{this.altTextBuffer.setText(e)}}this.autoResizeAndDraw()};l.prototype.runAutoComplete=async function(t){var e;[this.autoCompleteLeftPart,this.autoCompleteRightPart]=this.textBuffer.getCursorSplittedText();if(Array.isArray(t)){e=u(t,this.autoCompleteLeftPart,this.useAutoCompleteMenu)}else if(typeof t==="function"){e=await t(this.autoCompleteLeftPart,this.useAutoCompleteMenu)}else{return}if(Array.isArray(e)){if(!e.length){return}if(this.useAutoCompleteMenu){this.runAutoCompleteMenu(e);return}e=e[0]}this.runAutoCompleted(e)};l.prototype.runAutoCompleted=async function(t){this.textBuffer.setText(t+this.autoCompleteRightPart);this.textBuffer.setCursorOffset(t.length);this.textBuffer.runStateMachine();this.autoResizeAndDraw()};l.prototype.runAutoCompleteMenu=async function(t){if(!t||!t.length){return}if(this.autoCompleteMenu){this.autoCompleteMenu.destroy()}this.autoCompleteMenu=new o(Object.assign({},this.menuOptions,{internal:true,parent:this,x:this.outputX,y:this.outputY+this.outputHeight,outputWidth:this.outputWidth,items:t.map(t=>({value:t,content:t}))}));this.document.giveFocusTo(this.autoCompleteMenu);this.autoCompleteMenu.once("submit",this.onAutoCompleteMenuSubmit);this.autoCompleteMenu.once("cancel",this.onAutoCompleteMenuCancel)};l.prototype.onAutoCompleteMenuSubmit=function(t){this.autoCompleteMenu.destroy();this.autoCompleteMenu=null;this.document.giveFocusTo(this);this.runAutoCompleted(t)};l.prototype.onAutoCompleteMenuCancel=function(){this.autoCompleteMenu.destroy();this.autoCompleteMenu=null;this.document.giveFocusTo(this)};l.prototype.onKey=function(t,e,r){if(this.autoCompleteMenu){this.autoCompleteMenu.emit("cancel")}if(r&&r.isCharacter){if(this.placeholder){this.placeholder=null;this.setAltContent("",false,true)}this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}}else{switch(this.keyBindings[t]){case"submit":if(this.disabled||this.submitted||this.canceled){break}this.emit("submit",this.getValue(),undefined,this);break;case"cancel":if(!this.cancelable||this.disabled||this.canceled){break}this.emit("cancel",this);break;case"autoComplete":if(!this.autoComplete){break}this.runAutoComplete(this.autoComplete);break;case"historyAutoComplete":if(!this.autoComplete){break}this.runAutoComplete(this.history);break;case"historyPrevious":if(this.contentIndex<=0){break}this.contentArray[this.contentIndex]=this.getContent();this.contentIndex--;this.setContent(this.contentArray[this.contentIndex]);this.textBuffer.runStateMachine();this.autoResizeAndDraw();break;case"historyNext":if(this.contentIndex>=this.contentArray.length-1){break}this.contentArray[this.contentIndex]=this.getContent();this.contentIndex++;this.setContent(this.contentArray[this.contentIndex]);this.textBuffer.runStateMachine();this.autoResizeAndDraw();break;case"backDelete":this.textBuffer.backDelete();this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}break;case"delete":this.textBuffer.delete();this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}break;case"backward":this.textBuffer.moveBackward();this.autoResizeAndDrawCursor();break;case"forward":this.textBuffer.moveForward();this.autoResizeAndDrawCursor();break;case"startOfWord":this.textBuffer.moveToStartOfWord();this.autoResizeAndDrawCursor();break;case"endOfWord":this.textBuffer.moveToEndOfWord();this.autoResizeAndDrawCursor();break;case"startOfLine":this.textBuffer.moveToColumn(0);this.autoResizeAndDrawCursor();break;case"endOfLine":this.textBuffer.moveToEndOfLine();this.autoResizeAndDrawCursor();break;case"left":this.textBuffer.moveLeft();this.autoResizeAndDrawCursor();break;case"right":this.textBuffer.moveRight();this.autoResizeAndDrawCursor();break;case"pasteClipboard":if(this.document){this.document.getClipboard().then(t=>{if(t){this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}}}).catch(()=>undefined)}break;case"copyClipboard":if(this.document){this.document.setClipboard(this.textBuffer.getSelectionText()).catch(()=>undefined)}break;default:return}}return true}},{"../autoComplete.js":7,"./EditableTextBox.js":22,"./RowMenu.js":28,"./TextBox.js":33,seventh:108,"string-kit":123}],26:[function(u,l,t){(function(a){(function(){"use strict";const r=u("./Element.js");const e=u("./Text.js");const i=u("./EditableTextBox.js");const n=u("./SelectList.js");const s=u("./SelectListMulti.js");const t=u("string-kit");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;r.call(this,t);this.hiddenContent=t.hiddenContent;this.hasInputFocus=false;this.interceptTempZIndex=true;this.labelFocusAttr=t.labelFocusAttr||{bold:true};this.labelBlurAttr=t.labelBlurAttr||{dim:true};this.buttonBlurAttr=t.buttonBlurAttr||{bgColor:"cyan",color:"white",bold:true};this.buttonFocusAttr=t.buttonFocusAttr||{bgColor:"brightCyan",color:"black",bold:true};this.buttonDisabledAttr=t.buttonDisabledAttr||{bgColor:"cyan",color:"gray",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||{bgColor:"brightCyan",color:"brightWhite",bold:true};this.turnedOnBlurAttr=t.turnedOnBlurAttr||{bgColor:"cyan"};this.turnedOnFocusAttr=t.turnedOnFocusAttr||{bgColor:"brightCyan",bold:true};this.turnedOffBlurAttr=t.turnedOffBlurAttr||{bgColor:"gray",dim:true};this.turnedOffFocusAttr=t.turnedOffFocusAttr||{bgColor:"white",color:"black",bold:true};this.textAttr=t.textAttr||{bgColor:"blue"};this.voidAttr=t.voidAttr||t.emptyAttr||{bgColor:"blue"};if(t.keyBindings){this.keyBindings=t.keyBindings}if(this.label){this.labelText=new e({internal:true,parent:this,content:this.label,x:this.outputX,y:this.outputY,height:1,attr:this.labelBlurAttr,leftPadding:this.labelBlurLeftPadding,rightPadding:this.labelBlurRightPadding,noDraw:true})}this.inputType=t.type||"text";this.onKey=this.onKey.bind(this);this.onFocus=this.onFocus.bind(this);this.onClick=this.onClick.bind(this);this.onInputSubmit=this.onInputSubmit.bind(this);this.initInput(t);this.updateStatus();this.on("key",this.onKey);this.on("focus",this.onFocus);this.on("click",this.onClick);if(this.elementType==="LabeledInput"&&!t.noDraw){this.draw()}}l.exports=o;o.prototype=Object.create(r.prototype);o.prototype.constructor=o;o.prototype.elementType="LabeledInput";o.prototype.needInput=true;o.prototype.noChildFocus=true;o.prototype.propagateZ=true;o.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("focus",this.onFocus);this.off("click",this.onClick);if(this.input){this.off("submit",this.onInputSubmit)}r.prototype.destroy.call(this,t,e)};o.prototype.keyBindings={ENTER:"submit",KP_ENTER:"submit",ALT_ENTER:"submit"};o.prototype.editableTextBoxKeyBindings={BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",HOME:"startOfLine",END:"endOfLine",CTRL_O:"copyClipboard",CTRL_P:"pasteClipboard"};o.prototype.multiLineEditableTextBoxKeyBindings=Object.assign({},o.prototype.editableTextBoxKeyBindings,{ENTER:"newLine",KP_ENTER:"newLine",UP:"up",DOWN:"down",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown",CTRL_O:"copyClipboard",CTRL_P:"pasteClipboard"});o.prototype.selectListKeyBindings={UP:"previous",DOWN:"next",ENTER:"submit",KP_ENTER:"submit"};o.prototype.selectListMultiKeyBindings={UP:"previous",DOWN:"next",ENTER:"submit",KP_ENTER:"submit"};o.prototype.initInput=function(t){switch(this.inputType){case"text":this.initTextInput(t);break;case"select":this.initSelectInput(t);break;case"selectMulti":this.initSelectMultiInput(t);break;default:throw new Error("Unknown input type: "+this.inputType)}this.input.on("focus",this.onChildFocus.bind(this))};o.prototype.initTextInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else if(t.allowNewLine){this.inputKeyBindings=this.multiLineEditableTextBoxKeyBindings}else{this.inputKeyBindings=this.editableTextBoxKeyBindings}this.input=new i({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),height:this.outputHeight,lineWrap:!!t.lineWrap,wordWrap:!!t.wordWrap,scrollable:!!t.scrollable,vScrollBar:!!t.vScrollBar,hScrollBar:!!t.hScrollBar,hiddenContent:this.hiddenContent,textAttr:this.textAttr,voidAttr:this.voidAttr,keyBindings:this.inputKeyBindings,noDraw:true})};o.prototype.initSelectInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else{this.inputKeyBindings=this.selectListKeyBindings}this.input=new n({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),items:t.items,buttonBlurAttr:this.buttonBlurAttr,buttonFocusAttr:this.buttonFocusAttr,buttonDisabledAttr:this.buttonDisabledAttr,buttonSubmittedAttr:this.buttonSubmittedAttr,keyBindings:this.inputKeyBindings,noDraw:true});this.input.on("submit",this.onInputSubmit)};o.prototype.initSelectMultiInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else{this.inputKeyBindings=this.selectListMultiKeyBindings}this.input=new s({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),items:t.items,buttonBlurAttr:this.buttonBlurAttr,buttonFocusAttr:this.buttonFocusAttr,buttonDisabledAttr:this.buttonDisabledAttr,buttonSubmittedAttr:this.buttonSubmittedAttr,turnedOnBlurAttr:this.turnedOnBlurAttr,turnedOnFocusAttr:this.turnedOnFocusAttr,turnedOffBlurAttr:this.turnedOffBlurAttr,turnedOffFocusAttr:this.turnedOffFocusAttr,keyBindings:this.inputKeyBindings,noDraw:true});this.input.on("submit",this.onInputSubmit)};o.prototype.updateStatus=function(){if(this.hasFocus||this.hasInputFocus){if(this.labelText){this.labelText.attr=this.labelFocusAttr;this.labelText.leftPadding=this.labelFocusLeftPadding;this.labelText.rightPadding=this.labelFocusRightPadding}}else if(this.labelText){this.labelText.attr=this.labelBlurAttr;this.labelText.leftPadding=this.labelBlurLeftPadding;this.labelText.rightPadding=this.labelBlurRightPadding}};o.prototype.getValue=function(){return this.input.getValue()};o.prototype.setValue=function(t,e){return this.input.setValue(t,e)};o.prototype.getContent=function(){return this.input.getContent()};o.prototype.setContent=function(t,e,r){return this.input.setContent(t,e,r)};o.prototype.drawSelfCursor=function(){if(this.input.drawSelfCursor){this.input.drawSelfCursor()}};o.prototype.onKey=function(t,e,r){if(this.input.emit("key",t,e,r).interrupt){return true}switch(this.keyBindings[t]){case"submit":this.emit("submit",this.getValue(),undefined,this);break;default:return}return true};o.prototype.onInputSubmit=function(t){this.emit("submit",this.getValue(),undefined,this)};o.prototype.onFocus=function(t,e){this.hasFocus=t;if(e==="delegate"){return}if(t&&e!=="backCycle"&&this.input){a.nextTick(()=>{this.document.giveFocusTo(this.input,"delegate")})}else{this.updateStatus();if(this.labelText){this.labelText.draw()}}};o.prototype.onChildFocus=function(t,e){this.hasInputFocus=t;this.updateStatus();if(this.labelText){this.labelText.draw()}};o.prototype.onClick=function(t){this.document.giveFocusTo(this,"select")}}).call(this)}).call(this,u("_process"))},{"./EditableTextBox.js":22,"./Element.js":23,"./SelectList.js":29,"./SelectListMulti.js":30,"./Text.js":32,_process:179,"string-kit":123}],27:[function(t,e,r){"use strict";const i=t("./Element.js");const u=t("./Container.js");const n=t("../spChars.js").box;function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onParentResize=this.onParentResize.bind(this);this.layoutDef=t.layout;this.computed={};this.boxesContainer={};this.boxChars=n.light;if(t.boxChars){if(typeof t.boxChars==="object"){this.boxChars=t.boxChars}else if(typeof t.boxChars==="string"&&n[t.boxChars]){this.boxChars=n[t.boxChars]}}this.on("parentResize",this.onParentResize);this.computeBoundingBoxes();if(this.elementType==="Layout"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="Layout";s.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("parentResize",this.onParentResize);i.prototype.destroy.call(this,t,e)};s.prototype.computeBoundingBoxes=function(){var t=this.computed={};var e=this.layoutDef;var r={width_:this.outputDst.width,height_:this.outputDst.height,dx_:this.outputDst.width-1,dy_:this.outputDst.height-1,xmin_:0,ymin_:0};var i={offsetX:this.layoutDef.x||0,offsetY:this.layoutDef.y||0,remainingDx:r.dx_,remainingDy:r.dy_};this.computeBoundingBoxes_(e,t,r,i)};s.prototype.computeBoundingBoxes_=function(t,e,r,i){var n,s,o=false;this.computeDxDy(t,e,r,i);e.xmin_=r.xmin_+i.offsetX;e.xmax_=e.xmin_+e.dx_;e.ymin_=r.ymin_+i.offsetY;e.ymax_=e.ymin_+e.dy_;if(e.xmax_>r.xmax_){e.xmax_=r.xmax_;e.dx_=e.xmax_-e.xmin_}if(e.ymax_>r.ymax_){e.ymax_=r.ymax_;e.dy_=e.ymax_-e.ymin_}e.width_=e.dx_+1;e.height_=e.dy_+1;e.columns=[];e.rows=[];s={offsetX:0,offsetY:0,remainingDx:e.dx_,remainingDy:e.dy_,autoDxCount:0,autoDyCount:0};if(t.columns&&t.columns.length){for(n=0;n<t.columns.length;n++){e.columns[n]={};this.computeDxDy(t.columns[n],e.columns[n],e,s,true);if(e.columns[n].dx_!==undefined){s.remainingDx-=e.columns[n].dx_}else{s.autoDxCount++}}for(n=0;n<t.columns.length;n++){this.computeBoundingBoxes_(t.columns[n],e.columns[n],e,s);s.offsetX=e.columns[n].xmax_-e.xmin_}o=true}else if(t.rows&&t.rows.length){for(n=0;n<t.rows.length;n++){e.rows[n]={};this.computeDxDy(t.rows[n],e.rows[n],e,s,true);if(e.rows[n].dy_!==undefined){s.remainingDy-=e.rows[n].dy_}else{s.autoDyCount++}}for(n=0;n<t.rows.length;n++){this.computeBoundingBoxes_(t.rows[n],e.rows[n],e,s);s.offsetY=e.rows[n].ymax_-e.ymin_}o=true}e.width_=e.dx_+1;e.height_=e.dy_+1;this.round(e);if(!o){if(this.boxesContainer[t.id]){if(this.boxesContainer[t.id].width!==e.width-2||this.boxesContainer[t.id].height!==e.height-2){this.boxesContainer[t.id].resize({x:0,y:0,width:e.width-2,height:e.height-2})}this.boxesContainer[t.id].moveTo(e.xmin+1,e.ymin+1,true)}else{var a=new u({internal:true,id:t.id,parent:this,outputDst:this.outputDst,outputX:e.xmin+1,outputY:e.ymin+1,outputWidth:e.width-2,outputHeight:e.height-2});t.id=a.id;this.boxesContainer[t.id]=a}}};s.prototype.computeDxDy=function(t,e,r,i,n){if(n||e.dx_===undefined){if(t.width!==undefined){e.dx_=Math.max(0,Math.min(r.dx_,t.width-1))}else if(t.widthPercent!==undefined){e.dx_=Math.max(0,Math.min(r.dx_,r.dx_*t.widthPercent/100))}else if(!n){e.dx_=Math.max(0,i.remainingDx/(i.autoDxCount||1))}}if(n||e.dy_===undefined){if(t.height!==undefined){e.dy_=Math.max(0,Math.min(r.dy_,t.height-1))}else if(t.heightPercent!==undefined){e.dy_=Math.max(0,Math.min(r.dy_,r.dy_*t.heightPercent/100))}else if(!n){e.dy_=Math.max(0,i.remainingDy/(i.autoDyCount||1))}}};s.prototype.round=function(t){t.xmin=Math.round(t.xmin_);t.xmax=Math.round(t.xmax_);t.ymin=Math.round(t.ymin_);t.ymax=Math.round(t.ymax_);t.dx=t.xmax-t.xmin;t.dy=t.ymax-t.ymin;t.width=t.dx+1;t.height=t.dy+1};s.prototype.preDrawSelf=function(){var t,e={};this.outputDst.put({x:this.computed.xmin,y:this.computed.ymin},this.boxChars.topLeft+this.boxChars.horizontal.repeat(this.computed.dx-1)+this.boxChars.topRight);this.outputDst.put({x:this.computed.xmin,y:this.computed.ymax},this.boxChars.bottomLeft+this.boxChars.horizontal.repeat(this.computed.dx-1)+this.boxChars.bottomRight);for(t=this.computed.ymin+1;t<this.computed.ymax;t++){this.outputDst.put({x:this.computed.xmin,y:t},this.boxChars.vertical);this.outputDst.put({x:this.computed.xmax,y:t},this.boxChars.vertical)}this.drawRecursive(this.computed,e)};s.prototype.drawRecursive=function(t,e){var r;if(t.columns.length){for(r=0;r<t.columns.length;r++){this.drawColumn(t.columns[r],e,r===t.columns.length-1)}}else if(t.rows.length){for(r=0;r<t.rows.length;r++){this.drawRow(t.rows[r],e,r===t.rows.length-1)}}};s.prototype.drawColumn=function(t,e,r){var i;if(!r){this.drawTee(t.xmax,t.ymin,"top",e);this.drawTee(t.xmax,t.ymax,"bottom",e);for(i=t.ymin+1;i<t.ymax;i++){this.outputDst.put({x:t.xmax,y:i},this.boxChars.vertical)}}this.drawRecursive(t,e)};s.prototype.drawTee=function(t,e,r,i){var n=t+":"+e;if(!i[n]){this.outputDst.put({x:t,y:e},this.boxChars[r+"Tee"]);i[n]=r}else if(i[n]!==r){this.outputDst.put({x:t,y:e},this.boxChars.cross)}};s.prototype.drawRow=function(t,e,r){if(!r){this.drawTee(t.xmin,t.ymax,"left",e);this.drawTee(t.xmax,t.ymax,"right",e);this.outputDst.put({x:t.xmin+1,y:t.ymax},this.boxChars.horizontal.repeat(t.dx-1))}this.drawRecursive(t,e)};s.prototype.onParentResize=function(){this.computeBoundingBoxes()}},{"../spChars.js":48,"./Container.js":19,"./Element.js":23}],28:[function(t,e,r){"use strict";const l=t("./Element.js");const i=t("./BaseMenu.js");const d=t("./Button.js");const p=t("./ToggleButton.js");const n=t("../misc.js");const s=t("string-kit");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.outputWidth&&!t.width){t.outputWidth=Math.min(t.parent.inputWidth,t.parent.outputWidth)}this.buttonPaddingWidth=0;this.buttonSymbolWidth=0;this.pageItemsDef=[];i.call(this,t);this.justify=!!t.justify;this.separator=t.separator||t.buttonSeparator||" ";this.separatorHasMarkup=!!(t.separatorHasMarkup||t.buttonSeparatorHasMarkup);this.separatorAttr=Object.assign({},this.backgroundAttr,t.separatorAttr||t.buttonSeparatorAttr);this.separatorWidth=0;this.initChildren();if(this.elementType==="RowMenu"&&!t.noDraw){this.draw()}}e.exports=o;o.prototype=Object.create(i.prototype);o.prototype.constructor=o;o.prototype.elementType="RowMenu";o.prototype.inlineNewLine=true;o.prototype.ButtonClass=d;o.prototype.defaultOptions={buttonBlurAttr:{bgColor:"white",color:"black"},buttonFocusAttr:{bgColor:"green",color:"blue",dim:true},buttonDisabledAttr:{bgColor:"white",color:"brightBlack"},buttonSubmittedAttr:{bgColor:"brightWhite",color:"brightBlack"}};o.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("focus",this.onFocus);l.prototype.destroy.call(this,t,e)};o.prototype.keyBindings={LEFT:"previous",RIGHT:"next",PAGE_UP:"previousPage",PAGE_DOWN:"nextPage",HOME:"firstPage",END:"lastPage",ALT_ENTER:"submit"};o.prototype.buttonKeyBindings={ENTER:"submit",KP_ENTER:"submit"};o.prototype.toggleButtonKeyBindings={ENTER:"toggle",KP_ENTER:"toggle"};o.prototype.initChildren=function(t=false){if(!this.itemsDef.length){return}this.buttonPaddingWidth=Math.max(l.computeContentWidth(this.blurLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.focusLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.disabledLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.submittedLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOnFocusLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOffFocusLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOnBlurLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOffBlurLeftPadding,this.paddingHasMarkup))+Math.max(l.computeContentWidth(this.blurRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.focusRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.disabledRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.submittedRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOnFocusRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOffFocusRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOnBlurRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOffBlurRightPadding,this.paddingHasMarkup));if(this.buttonPaddingWidth>this.outputWidth){return}var s=l.computeContentWidth(this.contentEllipsis,false);this.separatorWidth=l.computeContentWidth(this.separator,this.separatorHasMarkup);this.previousPageDef=Object.assign({content:"◀",internalRole:"previousPage"},this.previousPageDef);this.previousPageDef.contentHasMarkup=this.previousPageDef.contentHasMarkup||this.previousPageDef.markup;this.previousPageDef.width=this.buttonPaddingWidth+l.computeContentWidth(this.previousPageDef.content,this.previousPageDef.contentHasMarkup);this.previousPageDef.buttonContent=this.previousPageDef.content;this.nextPageDef=Object.assign({content:"▶",internalRole:"nextPage"},this.nextPageDef);this.nextPageDef.contentHasMarkup=this.nextPageDef.contentHasMarkup||this.nextPageDef.markup;this.nextPageDef.width=this.buttonPaddingWidth+l.computeContentWidth(this.nextPageDef.content,this.nextPageDef.contentHasMarkup);this.nextPageDef.buttonContent=this.nextPageDef.content;var o=0,a=0,u=0;this.itemsDef.forEach((t,e)=>{t.buttonContent=t.content;t.contentHasMarkup=t.contentHasMarkup||t.markup;var r=l.computeContentWidth(t.content,t.contentHasMarkup),i=e===this.itemsDef.length-1;t.width=r+this.buttonPaddingWidth+this.buttonSymbolWidth;var n=a+t.width+(u?this.separatorWidth:0)+(i?0:this.nextPageDef.width+this.separatorWidth)-this.outputWidth;if(n>0){if(u){o++;u=0;a=this.previousPageDef.width+this.separatorWidth;n=a+t.width+(i?0:this.nextPageDef.width+this.separatorWidth)-this.outputWidth}if(n>0){t.buttonContent=l.truncateContent(t.content,r-n-s,t.contentHasMarkup)+this.contentEllipsis;r=l.computeContentWidth(t.buttonContent,t.contentHasMarkup)}}t.page=o;a+=t.width+(u?this.separatorWidth:0);u++;if(!this.pageItemsDef[o]){this.pageItemsDef[o]=[]}this.pageItemsDef[o].push(t)});this.maxPage=o;if(!this.pageItemsDef.length){this.pageItemsDef.push([])}this.pageItemsDef.forEach((t,e)=>{if(e){t.unshift(this.previousPageDef)}if(e<this.pageItemsDef.length-1){t.push(this.nextPageDef)}t.buttonsWidth=t.reduce((t,e)=>t+e.width,0);t.buttonsAndSeparatorsWidth=t.buttonsWidth+(t.length-1)*this.separatorWidth;t.justifyWidth=Math.max(0,this.justify?(this.outputWidth-t.buttonsAndSeparatorsWidth)/(t.length-1):0)});if(this.elementType==="RowMenu"&&!t){this.initPage()}};o.prototype.initPage=function(t=this.page){var l=this.pageItemsDef[t],f=0,h=0,c=0;if(!l){return}this.buttons.forEach(t=>t.destroy(false,true));this.buttons.length=0;l.forEach((t,e)=>{var r,i,n,s,o;r=t.internalRole?d:this.ButtonClass;i=r===p||r.prototype instanceof p;n=t.key;s=this.childUseParentKeyValue&&n&&this.value&&typeof this.value==="object"?this.value[n]:t.value;if(e%2){o=t.blurAttr||this.buttonBlurAttr}else{o=t.evenBlurAttr||t.blurAttr||this.buttonEvenBlurAttr||this.buttonBlurAttr}this.buttons[e]=new r({internal:true,parent:this,childId:e,internalRole:t.internalRole,content:t.buttonContent,contentHasMarkup:t.contentHasMarkup,disabled:t.disabled,def:t,key:n,value:s,outputX:this.outputX+h,outputY:this.outputY+c,blurAttr:o,focusAttr:t.focusAttr||this.buttonFocusAttr,disabledAttr:t.disabledAttr||this.buttonDisabledAttr,submittedAttr:t.submittedAttr||this.buttonSubmittedAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.turnedOnFocusAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.turnedOffFocusAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.turnedOnBlurAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.turnedOffBlurAttr,blurLeftPadding:this.blurLeftPadding,blurRightPadding:this.blurRightPadding,focusLeftPadding:this.focusLeftPadding,focusRightPadding:this.focusRightPadding,disabledLeftPadding:this.disabledLeftPadding,disabledRightPadding:this.disabledRightPadding,submittedLeftPadding:this.submittedLeftPadding,submittedRightPadding:this.submittedRightPadding,turnedOnFocusLeftPadding:this.turnedOnFocusLeftPadding,turnedOnFocusRightPadding:this.turnedOnFocusRightPadding,turnedOffFocusLeftPadding:this.turnedOffFocusLeftPadding,turnedOffFocusRightPadding:this.turnedOffFocusRightPadding,turnedOnBlurLeftPadding:this.turnedOnBlurLeftPadding,turnedOnBlurRightPadding:this.turnedOnBlurRightPadding,turnedOffBlurLeftPadding:this.turnedOffBlurLeftPadding,turnedOffBlurRightPadding:this.turnedOffBlurRightPadding,paddingHasMarkup:this.paddingHasMarkup,keyBindings:i?this.toggleButtonKeyBindings:this.buttonKeyBindings,actionKeyBindings:i?this.toggleButtonActionKeyBindings:this.buttonActionKeyBindings,shortcuts:t.shortcuts,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);this.buttons[e].on("focus",this.onButtonFocus);this.buttons[e].on("blinked",this.onButtonBlinked);if(i){this.buttons[e].on("toggle",this.onButtonToggle)}var a=l.justifyWidth+f;var u=Math.round(a);f=a-u;h+=this.buttons[e].outputWidth+this.separatorWidth+u})};o.prototype.preDrawSelf=function(){this.outputDst.put({x:this.outputX,y:this.outputY,attr:this.backgroundAttr}," ".repeat(this.outputWidth));if(this.separator){let t,e,r;for(t=0;t<this.buttons.length-1;t++){e=this.buttons[t];r=this.buttons[t+1];this.outputDst.put({x:Math.round(e.outputX+e.outputWidth+r.outputX)/2,y:this.outputY,attr:this.separatorAttr},this.separator)}}}},{"../misc.js":42,"./BaseMenu.js":15,"./Button.js":16,"./Element.js":23,"./ToggleButton.js":35,"string-kit":123}],29:[function(t,e,r){"use strict";const s=t("./Element.js");const i=t("./BaseMenu.js");const n=t("./ColumnMenu.js");const o=t("./Button.js");function a(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.master||typeof t.master!=="object"){t.master=Object.assign({},this.defaultOptions.master)}else{t.master=Object.assign({},this.defaultOptions.master,t.master)}if(t.content){t.master.content=t.content}if(!t.separator||typeof t.separator!=="object"){t.separator=Object.assign({},this.defaultOptions.separator)}else{t.separator=Object.assign({},this.defaultOptions.separator,t.separator)}n.call(this,t);this.showMenu=false;this.zIndexRef=this.zIndex;if(t.value!==undefined&&this.setValue(t.value,true)){this.toggle(this.showMenu,t.noDraw)}else{this.initPage();this.toggle(this.showMenu,t.noDraw)}this.onClickOut=this.onClickOut.bind(this);this.on("clickOut",this.onClickOut);if(this.elementType==="SelectList"&&!t.noDraw){this.draw()}}e.exports=a;a.prototype=Object.create(n.prototype);a.prototype.constructor=a;a.prototype.elementType="SelectList";a.prototype.defaultOptions={buttonBlurAttr:{bgColor:"gray",color:"white",bold:true},buttonFocusAttr:{bgColor:"white",color:"black",bold:true},buttonDisabledAttr:{bgColor:"gray",color:"white",bold:true,dim:true},buttonSubmittedAttr:{bgColor:"gray",color:"brightWhite",bold:true},turnedOnBlurAttr:{bgColor:"cyan"},turnedOnFocusAttr:{bgColor:"brightCyan",bold:true},turnedOffBlurAttr:{bgColor:"gray",dim:true},turnedOffFocusAttr:{bgColor:"white",color:"black",bold:true},master:{content:"select-list",symbol:"▼",internalRole:"toggle"},separator:{content:"-",contentRepeat:true,internalRole:"separator"}};a.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("clickOut",this.onClickOut);n.prototype.destroy.call(this,t,e)};a.prototype.toggle=function(t=null,e=false){var r,i;if(t===null){this.showMenu=!this.showMenu}else{this.showMenu=!!t}for(r=1,i=this.buttons.length;r<i;r++){this.buttons[r].hidden=!this.showMenu}this.outputHeight=this.showMenu?this.pageHeight:1;if(this.showMenu){this.topZ()}else{this.restoreZ()}if(e){return}if(t){for(r=1,i=this.buttons.length;r<i;r++){if(this.buttons[r].value===this.value){this.document.giveFocusTo(this.buttons[r]);break}}}else{this.document.giveFocusTo(this.buttons[0])}this.redraw()};a.prototype.select=function(t,e){var r,i=1+this.buttonSymbolWidth,n=t.content;if(Array.isArray(n)){n=n[0]||""}r=s.computeContentWidth(n,t.contentHasMarkup)+this.buttonPaddingWidth+this.buttonSymbolWidth;if(r>this.buttonsMaxWidth){this.masterDef.buttonContent=s.truncateContent(n,this.buttonsMaxWidth-this.buttonSymbolWidth,t.contentHasMarkup)+" "+this.masterDef.symbol}else if(r<this.buttonsMaxWidth){this.masterDef.buttonContent=n+" ".repeat(this.buttonsMaxWidth-r)+" "+this.masterDef.symbol}else{this.masterDef.buttonContent=n+" "+this.masterDef.symbol}this.masterDef.contentHasMarkup=t.contentHasMarkup;this.masterDef.width=this.buttonsMaxWidth;this.value=this.masterDef.value=t.value;if(t.page!==undefined){this.page=t.page}this.initPage();if(e){return}this.toggle(false)};a.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;case"toggle":this.toggle();break;default:this.select(r);this.emit("submit",t,e,this)}};a.prototype.setValue=function(e,t){var r=this.itemsDef.find(t=>t.value===e);if(!r){return false}this.select(r,t);return true};a.prototype.onClickOut=function(){this.toggle(false)};a.prototype.getValue=function(){return this.value}},{"./BaseMenu.js":15,"./Button.js":16,"./ColumnMenu.js":17,"./Element.js":23}],30:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./BaseMenu.js");const s=t("./ColumnMenuMulti.js");const o=t("./Button.js");function a(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.master||typeof t.master!=="object"){t.master=Object.assign({},this.defaultOptions.master)}else{t.master=Object.assign({},this.defaultOptions.master,t.master)}if(t.content){t.master.content=t.content}if(!t.separator||typeof t.separator!=="object"){t.separator=Object.assign({},this.defaultOptions.separator)}else{t.separator=Object.assign({},this.defaultOptions.separator,t.separator)}s.call(this,t);this.showMenu=false;this.zIndexRef=this.zIndex;this.initPage();this.toggle(this.showMenu,t.noDraw);this.onClickOut=this.onClickOut.bind(this);this.on("clickOut",this.onClickOut);if(this.elementType==="SelectListMulti"&&!t.noDraw){this.draw()}}e.exports=a;a.prototype=Object.create(s.prototype);a.prototype.constructor=a;a.prototype.elementType="SelectListMulti";a.prototype.defaultOptions={buttonBlurAttr:{bgColor:"gray",color:"white",bold:true},buttonFocusAttr:{bgColor:"white",color:"black",bold:true},buttonDisabledAttr:{bgColor:"gray",color:"white",bold:true,dim:true},buttonSubmittedAttr:{bgColor:"gray",color:"brightWhite",bold:true},turnedOnBlurAttr:{bgColor:"cyan"},turnedOnFocusAttr:{bgColor:"brightCyan",bold:true},turnedOffBlurAttr:{bgColor:"gray",dim:true},turnedOffFocusAttr:{bgColor:"white",color:"black",bold:true},master:{content:"select-list-multi",symbol:"▼",internalRole:"toggle"},separator:{content:"-",contentRepeat:true,internalRole:"separator"}};a.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("clickOut",this.onClickOut);s.prototype.destroy.call(this,t,e)};a.prototype.toggle=function(t=null,e=false){var r,i;if(t===null){this.showMenu=!this.showMenu}else{this.showMenu=!!t}for(r=1,i=this.buttons.length;r<i;r++){this.buttons[r].hidden=!this.showMenu}this.outputHeight=this.showMenu?this.pageHeight:1;if(this.showMenu){this.topZ()}else{this.restoreZ()}if(e){return}this.document.giveFocusTo(this.buttons[0]);this.redraw()};a.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;case"toggle":this.toggle();if(!this.showMenu){this.emit("submit",this.value,e,this)}break;default:this.emit("submit",this.value,e,this)}};a.prototype.onClickOut=function(){if(this.showMenu){this.toggle(false);this.emit("submit",this.value,undefined,this)}};a.prototype.getValue=function(){return this.value}},{"./BaseMenu.js":15,"./Button.js":16,"./ColumnMenuMulti.js":18,"./Element.js":23}],31:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Button.js");const s=t=>t;function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);this.onButtonSubmit=this.onButtonSubmit.bind(this);this.isVertical=!!t.isVertical;this.slideRate=0;this.handleOffset=0;this.rateToValue=typeof t.rateToValue==="function"?t.rateToValue:s;this.valueToRate=typeof t.valueToRate==="function"?t.valueToRate:s;this.buttonBlurAttr=t.buttonBlurAttr||{bgColor:"black",color:"white",bold:true};this.buttonFocusAttr=t.buttonFocusAttr||{bgColor:"white",color:"black",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||{bgColor:"gray",color:"brightWhite",bold:true};this.backwardSymbol=t.backwardSymbol||(this.isVertical?"▲":"◀");this.forwardSymbol=t.forwardSymbol||(this.isVertical?"▼":"▶");this.handleAttr=t.handleAttr||{bgColor:"brightWhite",color:"black"};this.handleSymbol=t.handleSymbol||"◆";this.barAttr=t.barAttr||{bgColor:"gray",color:"brightWhite"};this.barSymbol=t.barSymbol||" ";this.backwardButton=this.forwardButton=null;this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.initChildren();if(this.elementType==="Slider"&&!t.noDraw){this.draw()}}e.exports=o;o.prototype=Object.create(i.prototype);o.prototype.constructor=o;o.prototype.elementType="Slider";o.prototype.needInput=true;o.prototype.keyBindings={UP:"backward",DOWN:"forward",LEFT:"backward",RIGHT:"forward",PAGE_UP:"backward",PAGE_DOWN:"forward"," ":"forward",HOME:"start",END:"end"};o.prototype.buttonKeyBindings={ENTER:"submit",KP_ENTER:"submit"};o.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("click",this.onClick);this.off("drag",this.onDrag);this.off("wheel",this.onWheel);i.prototype.destroy.call(this,t,e)};o.prototype.initChildren=function(){this.backwardButton=new n({internal:true,parent:this,internalRole:"backward",content:this.backwardSymbol,outputX:this.outputX,outputY:this.outputY,blurAttr:this.buttonBlurAttr,focusAttr:this.buttonFocusAttr,submittedAttr:this.buttonSubmittedAttr,keyBindings:this.buttonKeyBindings,noDraw:true});this.backwardButton.on("submit",this.onButtonSubmit);this.forwardButton=new n({internal:true,parent:this,internalRole:"forward",content:this.forwardSymbol,outputX:this.isVertical?this.outputX:this.outputX+this.outputWidth-1,outputY:this.isVertical?this.outputY+this.outputHeight-1:this.outputY,blurAttr:this.buttonBlurAttr,focusAttr:this.buttonFocusAttr,submittedAttr:this.buttonSubmittedAttr,keyBindings:this.buttonKeyBindings,noDraw:true});this.forwardButton.on("submit",this.onButtonSubmit);this.computeHandleOffset()};o.prototype.setSizeAndPosition=function(t){this.outputX=t.outputX!==undefined?t.outputX:t.x!==undefined?t.x:this.outputX||0;this.outputY=t.outputY!==undefined?t.outputY:t.y!==undefined?t.y:this.outputY||0;this.outputWidth=t.outputWidth!==undefined?t.outputWidth:t.width!==undefined?t.width:this.outputWidth||1;this.outputHeight=t.outputHeight!==undefined?t.outputHeight:t.height!==undefined?t.height:this.outputHeight||1;this.backwardButton.outputX=this.outputX;this.backwardButton.outputY=this.outputY;this.forwardButton.outputX=this.isVertical?this.outputX:this.outputX+this.outputWidth-1;this.forwardButton.outputY=this.isVertical?this.outputY+this.outputHeight-1:this.outputY};o.prototype.preDrawSelf=function(){return this.isVertical?this.preDrawSelfVertical():this.preDrawSelfHorizontal()};o.prototype.preDrawSelfVertical=function(){var t=0,e=this.outputY+1,r=this.outputY+this.outputHeight-2;for(;e<=r;e++,t++){if(t===this.handleOffset){this.outputDst.put({x:this.outputX,y:e,attr:this.handleAttr},this.handleSymbol)}else{this.outputDst.put({x:this.outputX,y:e,attr:this.barAttr},this.barSymbol)}}};o.prototype.preDrawSelfHorizontal=function(){var t=0,e=this.outputX+1,r=this.outputX+this.outputWidth-2;for(;e<=r;e++,t++){if(t===this.handleOffset){this.outputDst.put({x:e,y:this.outputY,attr:this.handleAttr},this.handleSymbol)}else{this.outputDst.put({x:e,y:this.outputY,attr:this.barAttr},this.barSymbol)}}};o.prototype.postDrawSelf=function(){if(this.isVertical){this.outputDst.moveTo(this.outputX,this.outputY+this.handleOffset+1)}else{this.outputDst.moveTo(this.outputX+this.handleOffset+1,this.outputY)}};o.prototype.computeHandleOffset=function(){var t=(this.isVertical?this.outputHeight:this.outputWidth)-3;this.handleOffset=Math.round(t*this.slideRate)};o.prototype.setHandleOffset=function(t,e=false){var r=(this.isVertical?this.outputHeight:this.outputWidth)-3;this.handleOffset=Math.max(0,Math.min(r,Math.round(t||0)));this.slideRate=Math.max(0,Math.min(1,this.handleOffset/r||0));if(!e){this.emit("slide",this.getValue());this.draw()}};o.prototype.setSlideRate=function(t,e=false){this.slideRate=Math.max(0,Math.min(1,t||0));this.computeHandleOffset();if(!e){this.emit("slide",this.getValue());this.draw()}};o.prototype.getHandleOffset=function(){return this.handleOffset};o.prototype.getSlideRate=function(){return this.slideRate};o.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"backward":this.emit("slideStep",-1);break;case"forward":this.emit("slideStep",1);break}};o.prototype.getValue=function(){return this.rateToValue(this.slideRate)};o.prototype.setValue=function(t,e){return this.setSlideRate(this.valueToRate(t),e)};o.prototype.onClick=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}this.setHandleOffset((this.isVertical?t.y:t.x)-1)};o.prototype.onDrag=function(t){this.setHandleOffset((this.isVertical?t.y:t.x)-1)};o.prototype.onWheel=function(t){this.emit("slideStep",t.yDirection)}},{"./Button.js":16,"./Element.js":23}],32:[function(t,e,r){"use strict";const i=t("./Element.js");function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;this.attr=t.attr||{bgColor:"brightBlack"};this.leftPadding=t.leftPadding||"";this.rightPadding=t.rightPadding||"";if(!Array.isArray(t.content)){t.content=[t.content||""]}this.content=t.content;this.contentHasMarkup=t.contentHasMarkup;if(!t.width){t.width=this.computeRequiredWidth()}t.height=this.computeRequiredHeight();i.call(this,t);if(this.elementType==="Text"&&!t.noDraw){this.draw()}}e.exports=n;n.prototype=Object.create(i.prototype);n.prototype.constructor=n;n.prototype.elementType="Text";n.prototype.forceContentArray=true;n.prototype.computeRequiredWidth=function(){return i.computeContentWidth(this.leftPadding,this.paddingHasMarkup)+i.computeContentWidth(this.rightPadding,this.paddingHasMarkup)+(this.animation?Math.max(...this.animation.map(t=>i.computeContentWidth(t,this.contentHasMarkup))):i.computeContentWidth(this.content,this.contentHasMarkup)||1)};n.prototype.computeRequiredHeight=function(){return this.animation?Math.max(...this.animation.map(t=>t.length)):this.content.length};n.prototype.resizeOnContent=function(){this.width=this.computeRequiredWidth(this.content,this.contentHasMarkup);this.height=this.computeRequiredHeight(this.content,this.contentHasMarkup)};n.prototype.postDrawSelf=function(){if(!this.outputDst){return this}var t,e,r,i;for(r=0;r<this.outputHeight;r++){i=this.content[r]||"";this.outputDst.cx=this.outputX;this.outputDst.cy=this.outputY+r;if(this.leftPadding){this.outputDst.put({attr:this.attr,markup:this.paddingHasMarkup},this.leftPadding)}e=this.outputDst.put({attr:this.attr,resumeAttr:e,markup:this.contentHasMarkup},i);if(this.rightPadding){this.outputDst.put({attr:this.attr,markup:this.paddingHasMarkup},this.rightPadding)}if(this.outputDst.cx<this.outputDst.width-1){t=this.outputX+this.outputWidth-this.outputDst.cx;if(t>0){this.outputDst.put({attr:this.attr}," ".repeat(t))}}}}},{"./Element.js":23}],33:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Slider.js");const s=t("../ScreenBuffer.js");const o=t("../TextBuffer.js");const a=t("../Rect.js");const u=t("string-kit");function l(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onKey=this.onKey.bind(this);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);this.onParentResize=this.onParentResize.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}this.textAttr=t.textAttr||t.attr||{bgColor:"default"};this.altTextAttr=t.altTextAttr||Object.assign({},this.textAttr,{color:"gray",italic:true});this.voidAttr=t.voidAttr||t.emptyAttr||t.attr||{bgColor:"default"};this.scrollable=!!t.scrollable;this.hasVScrollBar=this.scrollable&&!!t.vScrollBar;this.hasHScrollBar=this.scrollable&&!!t.hScrollBar;this.scrollX=t.scrollX||0;this.scrollY=t.scrollY||0;this.extraScrolling=!!t.extraScrolling;this.firstLineRightShift=t.firstLineRightShift||0;this.wordWrap=!!(t.wordWrap||t.wordwrap);this.lineWrap=!!(t.lineWrap||this.wordWrap);this.hiddenContent=t.hiddenContent;this.stateMachine=t.stateMachine;this.textAreaWidth=this.hasVScrollBar?this.outputWidth-1:this.outputWidth;this.textAreaHeight=this.hasHScrollBar?this.outputHeight-1:this.outputHeight;this.textBuffer=null;this.altTextBuffer=null;this.vScrollBarSlider=null;this.hScrollBarSlider=null;this.on("key",this.onKey);this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.on("parentResize",this.onParentResize);this.initChildren();if(this.setContent===l.prototype.setContent){this.setContent(t.content,t.contentHasMarkup,true)}if(this.elementType==="TextBox"&&!t.noDraw){this.draw()}}e.exports=l;l.prototype=Object.create(i.prototype);l.prototype.constructor=l;l.prototype.elementType="TextBox";l.prototype.strictInlineSupport=true;l.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("click",this.onClick);this.off("drag",this.onDrag);this.off("wheel",this.onWheel);this.off("parentResize",this.onParentResize);i.prototype.destroy.call(this,t,e)};l.prototype.keyBindings={UP:"tinyScrollUp",DOWN:"tinyScrollDown",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown"," ":"scrollDown",HOME:"scrollTop",END:"scrollBottom",LEFT:"scrollLeft",RIGHT:"scrollRight",CTRL_O:"copyClipboard"};l.prototype.initChildren=function(){this.textBuffer=new o({dst:this.outputDst,x:this.outputX,y:this.outputY,firstLineRightShift:this.firstLineRightShift,lineWrapWidth:this.lineWrap?this.textAreaWidth:null,wordWrap:this.wordWrap,dstClipRect:{x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight},hidden:this.hiddenContent,forceInBound:true,stateMachine:this.stateMachine});this.setAttr(undefined,undefined,true);if(this.useAltTextBuffer){this.altTextBuffer=new o({firstLineRightShift:this.firstLineRightShift,lineWrapWidth:this.lineWrap?this.textAreaWidth:null,wordWrap:this.wordWrap,dstClipRect:{x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight}});this.setAltAttr();this.textBuffer.setVoidTextBuffer(this.altTextBuffer)}if(this.hasVScrollBar){this.vScrollBarSlider=new n({internal:true,parent:this,x:this.outputX+this.outputWidth-1,y:this.outputY,height:this.outputHeight,isVertical:true,valueToRate:t=>-t/Math.max(1,this.textBuffer.buffer.length-this.textAreaHeight),rateToValue:t=>-t*Math.max(1,this.textBuffer.buffer.length-this.textAreaHeight),noDraw:true});this.vScrollBarSlider.on("slideStep",t=>this.scroll(0,-t*Math.ceil(this.textAreaHeight/2)));this.vScrollBarSlider.on("slide",t=>this.scrollTo(null,t))}if(this.hasHScrollBar){this.hScrollBarSlider=new n({internal:true,parent:this,x:this.outputX,y:this.outputY+this.outputHeight-1,width:this.outputWidth-this.hasVScrollBar,valueToRate:t=>{var e=this.textBuffer.getContentSize().width;return-t/Math.max(1,e-this.textAreaWidth)},rateToValue:t=>{var e=this.textBuffer.getContentSize().width;return-t*Math.max(1,e-this.textAreaWidth)},noDraw:true});this.hScrollBarSlider.on("slideStep",t=>this.scroll(-t*Math.ceil(this.textAreaWidth/2),0));this.hScrollBarSlider.on("slide",t=>this.scrollTo(t,null))}};l.prototype.setSizeAndPosition=function(t){this.outputX=t.outputX!==undefined?t.outputX:t.x!==undefined?t.x:this.outputX||0;this.outputY=t.outputY!==undefined?t.outputY:t.y!==undefined?t.y:this.outputY||0;this.outputWidth=t.outputWidth!==undefined?t.outputWidth:t.width!==undefined?t.width:this.outputWidth||1;this.outputHeight=t.outputHeight!==undefined?t.outputHeight:t.height!==undefined?t.height:this.outputHeight||1;this.textAreaWidth=this.hasVScrollBar?this.outputWidth-1:this.outputWidth;this.textAreaHeight=this.hasHScrollBar?this.outputHeight-1:this.outputHeight;this.textBuffer.lineWrapWidth=this.lineWrap?this.textAreaWidth:null;if(this.altTextBuffer){this.altTextBuffer.lineWrapWidth=this.lineWrap?this.textAreaWidth:null}this.textBuffer.x=this.outputX;this.textBuffer.y=this.outputY;this.textBuffer.dstClipRect=new a({x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight});if(this.lineWrap){this.textBuffer.wrapAllLines();if(this.altTextBuffer){this.altTextBuffer.wrapAllLines()}}if(this.vScrollBarSlider){this.vScrollBarSlider.setSizeAndPosition({outputX:this.outputX+this.outputWidth-1,outputY:this.outputY,outputHeight:this.outputHeight})}if(this.hScrollBarSlider){this.hScrollBarSlider.setSizeAndPosition({outputX:this.outputX,outputY:this.outputY+this.outputHeight-1,outputWidth:this.hasVScrollBar?this.outputWidth-1:this.outputWidth})}};l.prototype.preDrawSelf=function(){this.textBuffer.draw({dst:this.outputDst})};l.prototype.scroll=function(t,e,r=false){return this.scrollTo(t?this.scrollX+t:null,e?this.scrollY+e:null,r)};l.prototype.scrollToTop=function(t=false){return this.scrollTo(null,0,t)};l.prototype.scrollToBottom=function(t=false){return this.scrollTo(null,this.textAreaHeight-this.textBuffer.buffer.length,t)};l.prototype.scrollTo=function(t,e,r=false){if(!this.scrollable){return}if(t!==undefined&&t!==null){this.scrollX=Math.min(0,Math.max(Math.round(t),(this.extraScrolling?1:this.textAreaWidth)-this.textBuffer.getContentSize().width+1));this.textBuffer.x=this.outputX+this.scrollX}if(e!==undefined&&e!==null){this.scrollY=Math.min(0,Math.max(Math.round(e),(this.extraScrolling?1:this.textAreaHeight)-this.textBuffer.buffer.length));this.textBuffer.y=this.outputY+this.scrollY}if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true)}if(this.hScrollBarSlider){this.hScrollBarSlider.setValue(this.scrollX,true)}if(!r){this.draw()}};l.prototype.autoScrollAndDraw=function(t=false){var e,r;if(this.textBuffer.cx-1<-this.scrollX&&this.scrollX!==0){e=-Math.max(0,this.textBuffer.cx-1)}else if(this.textBuffer.cx>this.textAreaWidth-this.scrollX-1){e=this.textAreaWidth-1-this.textBuffer.cx}if(this.textBuffer.cy<-this.scrollY){r=-this.textBuffer.cy}else if(this.textBuffer.cy>this.textAreaHeight-this.scrollY-1){r=this.textAreaHeight-1-this.textBuffer.cy}if(e!==undefined||r!==undefined){this.scrollTo(e,r)}else if(!t){this.draw()}else{this.drawCursor()}};l.prototype.autoScrollAndDrawCursor=function(){return this.autoScrollAndDraw(true)};l.prototype.setAttr=function(t=this.textAttr,e=this.voidAttr,r=false,i=false){this.textAttr=t;this.voidAttr=e;this.textBuffer.setDefaultAttr(this.textAttr);this.textBuffer.setVoidAttr(this.voidAttr);if(!i){this.setContent(this.content,this.contentHasMarkup,r)}};l.prototype.setAltAttr=function(t=this.altTextAttr){this.altTextAttr=t;this.altTextBuffer.setDefaultAttr(this.altTextAttr);this.altTextBuffer.setVoidAttr(this.voidAttr)};l.prototype.getContentSize=function(){return this.textBuffer.getContentSize()};l.prototype.getContent=function(){return this.textBuffer.getText()};l.prototype.setContent=function(t,e,r){var i;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}this.content=t;this.contentHasMarkup=e;this.textBuffer.setText(this.content,this.contentHasMarkup,this.textAttr);if(this.stateMachine){this.textBuffer.runStateMachine()}this.textBuffer.moveToEndOfBuffer();if(!r){this.drawCursor();this.redraw()}};l.prototype.getAltContent=function(){if(!this.altTextBuffer){return null}return this.altTextBuffer.getText()};l.prototype.setAltContent=function(t,e,r){if(!this.altTextBuffer){return}var i;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}this.altTextBuffer.setText(t,e,this.altTextAttr);if(!r){this.drawCursor();this.redraw()}};l.prototype.prependContent=function(t,e){return this.addContent(t,"prepend",e)};l.prototype.appendContent=function(t,e){return this.addContent(t,"append",e)};l.prototype.appendLog=function(t,e){return this.addContent(t,"appendLog",e)};l.prototype.addContent=function(t,e,r){var i,n=false;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}switch(e){case"prepend":this.content=t+this.content;this.textBuffer.prepend(t,this.contentHasMarkup,this.textAttr);break;case"appendLog":n=this.textBuffer.buffer.length<=this.textAreaHeight||this.scrollY<=this.textAreaHeight-this.textBuffer.buffer.length;t="\n"+t;this.content+=t;this.textBuffer.append(t,this.contentHasMarkup,this.textAttr);break;case"append":default:this.content+=t;this.textBuffer.append(t,this.contentHasMarkup,this.textAttr);break}if(this.stateMachine){this.textBuffer.runStateMachine()}this.textBuffer.moveToEndOfBuffer();if(n){this.scrollToBottom(r)}else if(!r){if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true)}this.drawCursor();this.draw()}};l.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"tinyScrollUp":this.scroll(0,Math.ceil(this.textAreaHeight/5));break;case"tinyScrollDown":this.scroll(0,-Math.ceil(this.textAreaHeight/5));break;case"scrollUp":this.scroll(0,Math.ceil(this.textAreaHeight/2));break;case"scrollDown":this.scroll(0,-Math.ceil(this.textAreaHeight/2));break;case"scrollLeft":this.scroll(Math.ceil(this.textAreaWidth/2),0);break;case"scrollRight":this.scroll(-Math.ceil(this.textAreaWidth/2),0);break;case"scrollTop":this.scrollToTop();break;case"scrollBottom":this.scrollToBottom();break;case"copyClipboard":if(this.document){this.document.setClipboard(this.textBuffer.getSelectionText()).catch(()=>undefined)}break;default:return}return true};l.prototype.onClick=function(t){if(this.scrollable&&!this.hasFocus){this.document.giveFocusTo(this,"select")}};l.prototype.onWheel=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(this.scrollable){this.scroll(0,-t.yDirection*Math.ceil(this.textAreaHeight/5))}};l.prototype.onDrag=function(t){var e,r,i,n;if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(t.yFrom<t.y||t.yFrom===t.y&&t.xFrom<=t.x){r=t.yFrom;n=t.y;e=t.xFrom;i=t.x}else{r=t.y;n=t.yFrom;e=t.x;i=t.xFrom}this.textBuffer.setSelectionRegion({xmin:e-this.scrollX,xmax:i-this.scrollX,ymin:r-this.scrollY,ymax:n-this.scrollY});if(this.document){this.document.setClipboard(this.textBuffer.getSelectionText(),"primary").catch(()=>undefined)}this.draw()};l.prototype.onParentResize=function(){if(!this.autoWidth&&!this.autoHeight){return}var t={};if(this.autoWidth){t.outputWidth=Math.round(this.outputDst.width*this.autoWidth)}if(this.autoHeight){t.outputHeight=Math.round(this.outputDst.height*this.autoHeight)}this.setSizeAndPosition(t);this.draw()}},{"../Rect.js":2,"../ScreenBuffer.js":3,"../TextBuffer.js":6,"./Element.js":23,"./Slider.js":31,"string-kit":123}],34:[function(t,e,r){"use strict";const i=t("./Element.js");const o=t("./TextBox.js");const n=t("../spChars.js").box;function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.cellContents=t.cellContents;this.contentHasMarkup=t.contentHasMarkup;this.textBoxes=null;this.rowCount=0;this.columnCount=0;this.rowHeights=[];this.columnWidths=[];this.textAttr=t.textAttr||{bgColor:"default"};this.voidAttr=t.voidAttr||t.emptyAttr||null;this.firstRowTextAttr=t.firstRowTextAttr||null;this.firstRowVoidAttr=t.firstRowVoidAttr||null;this.evenRowTextAttr=t.evenRowTextAttr||null;this.evenRowVoidAttr=t.evenRowVoidAttr||null;this.firstColumnTextAttr=t.firstColumnTextAttr||null;this.firstColumnVoidAttr=t.firstColumnVoidAttr||null;this.evenColumnTextAttr=t.evenColumnTextAttr||null;this.evenColumnVoidAttr=t.evenColumnVoidAttr||null;this.firstCellTextAttr=t.firstCellTextAttr||null;this.firstCellVoidAttr=t.firstCellVoidAttr||null;this.evenCellTextAttr=t.evenCellTextAttr||null;this.evenCellVoidAttr=t.evenCellVoidAttr||null;this.checkerEvenCellTextAttr=t.checkerEvenCellTextAttr||null;this.checkerEvenCellVoidAttr=t.checkerEvenCellVoidAttr||null;this.expandToWidth=t.expandToWidth!==undefined?!!t.expandToWidth:!!t.fit;this.shrinkToWidth=t.shrinkToWidth!==undefined?!!t.shrinkToWidth:!!t.fit;this.expandToHeight=t.expandToHeight!==undefined?!!t.expandToHeight:!t.height?false:!!t.fit;this.shrinkToHeight=t.shrinkToHeight!==undefined?!!t.shrinkToHeight:!t.height?false:!!t.fit;this.wordWrap=t.wordWrap!==undefined||t.wordwrap!==undefined?!!(t.wordWrap||t.wordwrap):!!t.fit;this.lineWrap=this.wordWrap||(t.lineWrap!==undefined?!!t.lineWrap:!!t.fit);this.hasBorder=t.hasBorder!==undefined?!!t.hasBorder:true;this.borderAttr=t.borderAttr||this.textAttr;this.borderChars=n.light;if(typeof t.borderChars==="object"){this.borderChars=n.__fix__(t.borderChars)}else if(typeof t.borderChars==="string"&&n[t.borderChars]){this.borderChars=n[t.borderChars]}if(t.textBoxKeyBindings){this.textBoxKeyBindings=t.textBoxKeyBindings}this.initChildren();this.computeCells();if(this.elementType==="TextTable"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="TextTable";s.prototype.strictInlineSupport=true;s.prototype.staticInline=true;s.prototype.inlineResizeToContent=true;s.prototype.textBoxKeyBindings=o.prototype.keyBindings;s.prototype.setCellContent=function(t,e,r,i=false,n=false){var s=this.textBoxes[e]&&this.textBoxes[e][t];if(!s){return}this.cellContents[e][t]=r;s.setContent(r,this.contentHasMarkup,true);if(!n){this.computeCells();if(!i){this.draw()}}else{if(!i){s.draw()}}};s.prototype.setCellAttr=function(t,e,r,i,n=false){var s=this.textBoxes[e]&&this.textBoxes[e][t];if(!s){return}if(i===undefined){i=r}s.setAttr(r,i,n)};s.prototype.resetCellAttr=function(t,e,r=false){var i=this.textBoxes[e]&&this.textBoxes[e][t];if(!i){return}var n=this.getTextAttrForCell(t,e),s=this.getVoidAttrForCell(t,e,n);i.setAttr(n,s,r)};s.prototype.setRowAttr=function(e,r,i,t=false){for(let t=0;t<this.columnCount;t++){this.setCellAttr(t,e,r,i,true)}if(!t){this.draw()}};s.prototype.resetRowAttr=function(e,t=false){for(let t=0;t<this.columnCount;t++){this.resetCellAttr(t,e,true)}if(!t){this.draw()}};s.prototype.setColumnAttr=function(e,r,i,t=false){for(let t=0;t<this.rowCount;t++){this.setCellAttr(e,t,r,i,true)}if(!t){this.draw()}};s.prototype.resetColumnAttr=function(e,t=false){for(let t=0;t<this.rowCount;t++){this.resetCellAttr(e,t,true)}if(!t){this.draw()}};s.prototype.setTableAttr=function(r,i,t=false){for(let e=0;e<this.rowCount;e++){for(let t=0;t<this.columnCount;t++){this.setCellAttr(t,e,r,i,true)}}if(!t){this.draw()}};s.prototype.resetTableAttr=function(t=false){for(let e=0;e<this.rowCount;e++){for(let t=0;t<this.columnCount;t++){this.resetCellAttr(t,e,true)}}if(!t){this.draw()}};s.prototype.getTextAttrForCell=function(t,e){return this.firstCellTextAttr&&!t&&!e?this.firstCellTextAttr:this.firstRowTextAttr&&!e?this.firstRowTextAttr:this.firstColumnTextAttr&&!t?this.firstColumnTextAttr:this.evenCellTextAttr&&!(t%2)&&!(e%2)?this.evenCellTextAttr:this.checkerEvenCellTextAttr&&!((t+e)%2)?this.checkerEvenCellTextAttr:this.evenRowTextAttr&&!(e%2)?this.evenRowTextAttr:this.evenColumnTextAttr&&!(e%2)?this.evenColumnTextAttr:this.textAttr};s.prototype.getVoidAttrForCell=function(t,e,r){return this.firstCellVoidAttr&&!t&&!e?this.firstCellVoidAttr:this.firstRowVoidAttr&&!e?this.firstRowVoidAttr:this.firstColumnVoidAttr&&!t?this.firstColumnVoidAttr:this.evenCellVoidAttr&&!(t%2)&&!(e%2)?this.evenCellVoidAttr:this.checkerEvenCellVoidAttr&&!((t+e)%2)?this.checkerEvenCellVoidAttr:this.evenRowVoidAttr&&!(e%2)?this.evenRowVoidAttr:this.evenColumnVoidAttr&&!(e%2)?this.evenColumnVoidAttr:this.voidAttr||r};s.prototype.initChildren=function(){var t,e,r,i;this.rowCount=this.cellContents.length;this.columnCount=0;this.textBoxes=[];var n=0,s=0;for(t of this.cellContents){this.textBoxes[s]=[];n=0;for(e of t){if(n>=this.columnCount){this.columnCount=n+1}r=this.getTextAttrForCell(n,s);i=this.getVoidAttrForCell(n,s,r);this.textBoxes[s][n]=new o({internal:true,parent:this,content:e,contentHasMarkup:this.contentHasMarkup,x:this.outputX,y:this.outputY,width:this.outputWidth,height:this.outputHeight,lineWrap:this.lineWrap,wordWrap:this.wordWrap,textAttr:r,voidAttr:i,keyBindings:this.textBoxKeyBindings,noDraw:true});n++}s++}};s.prototype.computeCells=function(){var t=this.computeColumnWidths();if(t){this.textBoxesWordWrap()}this.computeRowHeights();this.textBoxesSizeAndPosition()};s.prototype.computeColumnWidths=function(){var t,e,r,i,n;this.contentWidth=+this.hasBorder;for(t=0;t<this.columnCount;t++){i=0;for(e=0;e<this.rowCount;e++){r=this.textBoxes[e][t];if(!r){continue}n=r.getContentSize().width||1;if(n>i){i=n}}this.columnWidths[t]=i;this.contentWidth+=i+this.hasBorder}if(this.expandToWidth&&this.contentWidth<this.outputWidth){this.expand(this.contentWidth,this.outputWidth,this.columnWidths)}else if(this.shrinkToWidth&&this.contentWidth>this.outputWidth){this.shrink(this.contentWidth,this.outputWidth,this.columnWidths);return true}return false};s.prototype.computeRowHeights=function(){var t,e,r,i,n;this.contentHeight=+this.hasBorder;for(e=0;e<this.rowCount;e++){i=0;for(t=0;t<this.columnCount;t++){r=this.textBoxes[e][t];if(!r){continue}n=r.getContentSize().height||1;if(n>i){i=n}}this.rowHeights[e]=i;this.contentHeight+=i+this.hasBorder}if(this.expandToHeight&&this.contentHeight<this.outputHeight){this.expand(this.contentHeight,this.outputHeight,this.rowHeights)}else if(this.shrinkToHeight&&this.contentHeight>this.outputHeight){this.shrink(this.contentHeight,this.outputHeight,this.rowHeights);return true}};s.prototype.expand=function(t,e,r){var i,n=0,s=0,o=r.length,a=e-(this.hasBorder?o+1:0);if(a<=0){return}var u=t-(this.hasBorder?o+1:0),l=a/u;for(i=0;i<o;i++){n=r[i]*l+s;r[i]=Math.max(1,Math.round(n));s=n-r[i]}};s.prototype.shrink=function(t,e,r){var i,n,s=0,o=[],a=r.length,u,l,f,h=t-e;while(h>0){n=0;s=0;o.length=0;for(i=0;i<a;i++){if(r[i]>n){s=n;n=r[i];o.length=0;o.push(i)}else if(r[i]===n){o.push(i)}else if(r[i]>s){s=r[i]}}if(!n){return}u=Math.min(n-s,h/o.length);l=Math.floor(u);if(l>=0){for(let t of o){r[t]-=l;h-=l}}if(l!==u){f=h%o.length;for(let t=0;t<o.length&&t<f;t++){r[o[t]]--}h-=f}}};s.prototype.textBoxesWordWrap=function(){var t,e,r;for(e=0;e<this.rowCount;e++){for(t=0;t<this.columnCount;t++){r=this.textBoxes[e][t];if(r){r.setSizeAndPosition({outputX:this.outputX,outputY:this.outputY,outputWidth:this.columnWidths[t],outputHeight:this.outputHeight})}}}};s.prototype.textBoxesSizeAndPosition=function(){var t,e,r,i,n;i=this.outputY+this.hasBorder;for(e=0;e<this.rowCount;e++){r=this.outputX+this.hasBorder;for(t=0;t<this.columnCount;t++){n=this.textBoxes[e][t];if(n){n.setSizeAndPosition({outputX:r,outputY:i,outputWidth:this.columnWidths[t],outputHeight:this.rowHeights[e]})}r+=this.columnWidths[t]+this.hasBorder}i+=this.rowHeights[e]+this.hasBorder}};s.prototype.preDrawSelf=function(){if(!this.hasBorder){return}var t,e,r,i;i=this.outputY;for(e=0;e<this.rowHeights.length;e++){r=this.outputX;for(t=0;t<this.columnWidths.length;t++){this.outputDst.put({x:r,y:i,attr:this.borderAttr},e?t?this.borderChars.cross:this.borderChars.leftTee:t?this.borderChars.topTee:this.borderChars.topLeft);this.outputDst.put({x:r,y:i+1,direction:"down",attr:this.borderAttr},this.borderChars.vertical.repeat(this.rowHeights[e]));r++;this.outputDst.put({x:r,y:i,attr:this.borderAttr},this.borderChars.horizontal.repeat(this.columnWidths[t]));r+=this.columnWidths[t]}this.outputDst.put({x:r,y:i,attr:this.borderAttr},e?this.borderChars.rightTee:this.borderChars.topRight);this.outputDst.put({x:r,y:i+1,direction:"down",attr:this.borderAttr},this.borderChars.vertical.repeat(this.rowHeights[e]));i+=this.rowHeights[e]+1}r=this.outputX;for(t=0;t<this.columnWidths.length;t++){this.outputDst.put({x:r,y:i,attr:this.borderAttr},t?this.borderChars.bottomTee:this.borderChars.bottomLeft);r++;this.outputDst.put({x:r,y:i,attr:this.borderAttr},this.borderChars.horizontal.repeat(this.columnWidths[t]));r+=this.columnWidths[t]}this.outputDst.put({x:r,y:i,attr:this.borderAttr},this.borderChars.bottomRight)}},{"../spChars.js":48,"./Element.js":23,"./TextBox.js":33}],35:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Text.js");const s=t("./Button.js");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;s.call(this,t);this.value=!!t.value;this.key=t.key||null;if(this.elementType==="ToggleButton"&&!t.noDraw){this.draw()}}e.exports=o;o.prototype=Object.create(s.prototype);o.prototype.constructor=o;o.prototype.elementType="ToggleButton";o.prototype.keyBindings={ENTER:"toggle",KP_ENTER:"toggle",ALT_ENTER:"submit"};o.prototype.blink=function(){};o.prototype.setValue=function(t,e){t=!!t;if(this.value===t){return}this.value=t;this.updateStatus();this.emit("toggle",this.value,undefined,this);this.emit(this.value?"turnOn":"turnOff",this.value,undefined,this);if(!e){this.draw()}};o.prototype.toggle=function(t){this.setValue(!this.value,t)};o.prototype.updateStatus=function(){if(this.disabled){this.attr=this.disabledAttr;this.leftPadding=this.disabledLeftPadding;this.rightPadding=this.disabledRightPadding}else if(this.hasFocus){if(this.value){this.attr=this.turnedOnFocusAttr;this.leftPadding=this.turnedOnFocusLeftPadding;this.rightPadding=this.turnedOnFocusRightPadding}else{this.attr=this.turnedOffFocusAttr;this.leftPadding=this.turnedOffFocusLeftPadding;this.rightPadding=this.turnedOffFocusRightPadding}}else if(this.value){this.attr=this.turnedOnBlurAttr;this.leftPadding=this.turnedOnBlurLeftPadding;this.rightPadding=this.turnedOnBlurRightPadding}else{this.attr=this.turnedOffBlurAttr;this.leftPadding=this.turnedOffBlurLeftPadding;this.rightPadding=this.turnedOffBlurRightPadding}};o.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"toggle":if(this.disabled){break}this.toggle();break;case"submit":if(this.disabled){break}this.emit("submit",this.key?{[this.key]:this.value}:this.value,this.actionKeyBindings[t],this);break;default:return}return true};o.prototype.onHover=function(t){if(this.disabled){return}this.document.giveFocusTo(this,"hover")};o.prototype.onClick=function(t){if(this.disabled){return}this.document.giveFocusTo(this,"select");this.toggle()};o.prototype.onShortcut=function(){if(this.disabled){return}this.document.giveFocusTo(this,"select");this.toggle()}},{"./Button.js":16,"./Element.js":23,"./Text.js":32}],36:[function(t,e,r){"use strict";const n=t("./Element.js");const s=t("./Container.js");const i=t("../spChars.js").box;function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(t.movable===undefined){t.movable=true}if(t.title){t.content=t.title}if(t.titleHasMarkup){t.contentHasMarkup=t.titleHasMarkup}s.call(this,t);this.boxChars=i.double;if(t.boxChars){if(typeof t.boxChars==="object"){this.boxChars=t.boxChars}else if(typeof t.boxChars==="string"&&i[t.boxChars]){this.boxChars=i[t.boxChars]}}if(this.elementType==="Window"&&!t.noDraw){this.draw()}}e.exports=o;o.prototype=Object.create(s.prototype);o.prototype.constructor=o;o.prototype.elementType="Window";o.prototype.containerBorderSize=1;o.prototype.preDrawSelf=function(){var t,e,r,i=this.outputWidth-8;if(this.content&&i>=1){e=n.truncateContent(this.content,i,this.contentHasMarkup);r=n.getLastTruncateWidth();this.outputDst.put({x:this.outputX,y:this.outputY,markup:this.contentHasMarkup},this.boxChars.topLeft+this.boxChars.horizontal+"["+e+"]"+this.boxChars.horizontal.repeat(this.outputWidth-5-r)+this.boxChars.topRight)}else{this.outputDst.put({x:this.outputX,y:this.outputY},this.boxChars.topLeft+this.boxChars.horizontal.repeat(this.outputWidth-2)+this.boxChars.topRight)}this.outputDst.put({x:this.outputX,y:this.outputY+this.outputHeight-1},this.boxChars.bottomLeft+this.boxChars.horizontal.repeat(this.outputWidth-2)+this.boxChars.bottomRight);for(t=this.outputY+1;t<this.outputY+this.outputHeight-1;t++){this.outputDst.put({x:this.outputX,y:t},this.boxChars.vertical);this.outputDst.put({x:this.outputX+this.outputWidth-1,y:t},this.boxChars.vertical)}s.prototype.preDrawSelf.call(this)}},{"../spChars.js":48,"./Container.js":19,"./Element.js":23}],37:[function(n,t,u){(function(i){(function(){"use strict";const s=n("seventh");const t=n("string-kit");n("./patches.js");const e=n("child_process").execAsync;const r=n("child_process").execFileAsync;const o=n("child_process").spawn;const a={c:"clipboard",p:"primary",s:"secondary"};if(i.platform==="linux"){u.getClipboard=async t=>{var e=a[t[0]]||"clipboard";return await r("xclip",["-o","-selection",e])};u.setClipboard=async(t,e)=>{var r=new s;var i=a[e[0]]||"clipboard";var n=o("xclip",["-i","-selection",i]);n.on("error",t=>{r.reject(t)});n.on("exit",t=>{if(t!==0){r.reject(t)}else{r.resolve()}});n.stdin.end(t);return r}}else{u.getClipboard=()=>s.reject(new Error("No clipboard manipulation program found"));u.setClipboard=()=>s.reject(new Error("No clipboard manipulation program found"))}}).call(this)}).call(this,n("_process"))},{"./patches.js":43,_process:179,child_process:136,seventh:108,"string-kit":123}],38:[function(t,e,r){(function(s){(function(){"use strict";var o=t("seventh");var u=t("./autoComplete.js");var l=t("fs");var f=t("path");e.exports=function t(r,i){if(typeof r==="function"){i=r;r={}}if(!r||typeof r!=="object"){r={}}var a;var n=new o;if(r.baseDir){a=f.resolve(r.baseDir);if(!f.isAbsolute(a)){l.realpath(r.baseDir,(t,e)=>{if(t){if(i){i(t)}else{n.reject(t)}return}r.baseDir=e;this.fileInput(r).then(t=>{if(i){i(t)}else{n.resolve(t)}},t=>{if(i){i(t)}else{n.reject(t)}})});return n}}else{a=s.cwd()}if(a[a.length-1]!=="/"){a+="/"}var e=async function t(e){var r,i,n,s,o;if(e[e.length-1]==="/"){r=e;i=""}else{r=f.dirname(e);r=r==="."?"":r+"/";i=f.basename(e)}if(f.isAbsolute(e)){n=r}else{n=a+r}try{s=await h(n)}catch(t){return e}if(!Array.isArray(s)||!s.length){return e}o=u(s,i,true);if(Array.isArray(o)){o.prefix=r}else{o=f.normalize(r+o)}return o};r=Object.assign({},r,{autoComplete:e,autoCompleteMenu:true,minLength:1});this.inputField(r).promise.then(t=>{if(!t&&typeof t!=="string"){t=undefined}else{t=f.resolve(f.isAbsolute(t)?t:a+t)}if(i){i(undefined,t)}else{n.resolve(t)}},t=>{if(i){i(t)}else{n.reject(t)}});return n};function h(s){var r=new o;if(s[s.length-1]!=="/"){s+="/"}l.readdir(s,(t,e)=>{if(t){r.reject(t);return}o.map(e,n=>{return new o((r,i)=>{l.lstat(s+n,(t,e)=>{if(t){i(t);return}if(e.isDirectory()){n+="/"}r(n)})})}).toPromise(r)});return r}}).call(this)}).call(this,t("_process"))},{"./autoComplete.js":7,_process:179,fs:136,path:178,seventh:108}],39:[function(t,e,r){"use strict";var x=t("seventh");var C={ENTER:"submit",KP_ENTER:"submit",UP:"previous",DOWN:"next",LEFT:"previousColumn",RIGHT:"nextColumn",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last"};e.exports=function t(e,n,i){if(arguments.length<1){throw new Error("[terminal] gridMenu() needs at least an array of menuItems argument")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] gridMenu(): argument #0 should be a non-empty array")}if(typeof n==="function"){i=n;n={}}else if(!n||typeof n!=="object"){n={}}if(!n.style){n.style=this}if(!n.selectedStyle){n.selectedStyle=this.inverse}if(n.leftPadding===undefined){n.leftPadding=" "}if(n.selectedLeftPadding===undefined){n.selectedLeftPadding=" "}if(n.rightPadding===undefined){n.rightPadding=" "}if(n.selectedRightPadding===undefined){n.selectedRightPadding=" "}if(!n.x){n.x=1}if(!n.y){this("\n")}else{this.moveTo(n.x,n.y)}if(!n.width){n.width=this.width-n.x+1}if(!n.itemMaxWidth){n.itemMaxWidth=Math.floor((n.width-1)/3)}var s=n.keyBindings||C;if(!this.grabbing){this.grabInput()}var o={},a=0,u=false,l=false,r=0,f=0,h,c,d,p;p=Math.max(n.leftPadding.length,n.selectedLeftPadding.length)+Math.max(n.rightPadding.length,n.selectedRightPadding.length);e=e.map(t=>{if(typeof t!=="string"){t=""+t}r=Math.max(r,t.length);return t});r=Math.min(r,n.itemMaxWidth-p);f=r+p;c=Math.floor(n.width/f);d=Math.ceil(e.length/c);h=e.map((t,e)=>({offsetY:e%d,offsetX:n.x-1+Math.floor(e/d)*f,index:e,text:t,displayText:t.length>r?t.slice(0,r-1)+"…":t+" ".repeat(r-t.length)}));var g=(t,e)=>{if(l){return}l=true;u=true;this.removeListener("key",v);this.removeListener("mouse",w);this.moveTo(1,o.y+d);if(t){if(i){i(t)}else{_.promise.reject(t)}return}var r=e!==undefined?e:{selectedIndex:a,selectedText:h[a].text,x:1+h[a].offsetX,y:o.y+h[a].offsetY};if(i){i(undefined,r)}else{_.promise.resolve(r)}};var y=()=>{for(var t=0;t<h.length;t++){b(t)}m()};var b=t=>{var e=h[t];this.moveTo(1+e.offsetX,o.y+e.offsetY);if(t===a){n.selectedStyle.noFormat(n.selectedLeftPadding);n.selectedStyle.noFormat(e.displayText);n.selectedStyle.noFormat(n.selectedRightPadding)}else{n.style.noFormat(n.leftPadding);n.style.noFormat(e.displayText);n.style.noFormat(n.rightPadding)}};var m=()=>{this.moveTo(1+h[a].offsetX,o.y+h[a].offsetY)};var v=(t,e,r)=>{if(u){return}var i=a;switch(s[t]){case"submit":g();break;case"previous":if(a>0){a--;b(a);b(a+1);m()}break;case"next":if(a<h.length-1){a++;b(a-1);b(a);m()}break;case"previousColumn":if(a>=d){a-=d;b(i);b(a);m()}break;case"nextColumn":if(a<h.length-d){a+=d;b(i);b(a);m()}break;case"cyclePrevious":a--;if(a<0){a=h.length-1}b(i);b(a);m();break;case"cycleNext":a++;if(a>=h.length){a=0}b(i);b(a);m();break;case"first":if(a!==0){a=0;b(i);b(a);m()}break;case"last":if(a!==h.length-1){a=h.length-1;b(i);b(a);m()}break;default:if(n.exitOnUnexpectedKey){g(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break}};var w=(t,e)=>{if(u){return}if(e.y<o.y||e.y>=o.y+d){return}var r,i=false,n=a;for(r=0;r<h.length;r++){if(e.y===o.y+h[r].offsetY&&e.x>=1+h[r].offsetX&&e.x<1+h[r].offsetX+f){i=true;if(a!==r){a=r;b(n);b(a);m()}break}}if(i&&t==="MOUSE_LEFT_BUTTON_PRESSED"){g()}};this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}o.x=e;o.y=r;var i=o.y+d-this.height;if(i>0){this("\n".repeat(i));o.y-=i}y();this.on("key",v);if(this.mouseGrabbing){this.on("mouse",w)}});var _={};_.promise=new x;return _}},{seventh:108}],40:[function(l,e,t){(function(t){(function(){"use strict";const _=l("ndarray");const r=l("seventh");const u={};e.exports=u;var i;if(t.IS_BROWSER){i=l("@cronvel/get-pixels")}u.load=function t(n,e,s,o){if(!i){try{i=l("get-pixels")}catch(t){i=l("@cronvel/get-pixels")}}if(typeof s==="function"){o=s;s={}}else if(!s||typeof s!=="object"){s={}}var a=new r;i(e,(t,e)=>{if(t){var r=new Error("Bad image URL: "+t);r.code=t.code;r.parent=t;if(o){o(r)}else{a.reject(r)}return}if(e.shape.length===4){e=e.pick(0,null,null,null)}if(s.shrink){e=u.shrinkNdarrayImage(e,s.shrink)}var i=n(e,s);if(o){o(undefined,i)}else{a.resolve(i)}});return a};u.shrinkNdarrayImage=function t(e,r){var i=Math.min(r.width/e.shape[0],r.height/e.shape[1]);if(i>=1){return e}var n=Math.ceil(e.shape[0]*i);var s=Math.ceil(e.shape[1]*i);var o,a,u,l,f,h,c,d,p,g,y,b,m,v=e.shape[2]===4;var w=_(new Uint8Array(n*s*e.shape[2]),[n,s,e.shape[2]]);for(o=0;o<n;o++){for(a=0;a<s;a++){l=Math.ceil(o/i);f=Math.min(Math.ceil((o+1)/i-1),e.shape[0]-1);c=Math.ceil(a/i);d=Math.min(Math.ceil((a+1)/i-1),e.shape[1]-1);m=p=g=y=b=0;for(u=l;u<=f;u++){for(h=c;h<=d;h++){p+=e.get(u,h,0);g+=e.get(u,h,1);y+=e.get(u,h,2);if(v){b+=e.get(u,h,3)}m++}}w.set(o,a,0,Math.round(p/m));w.set(o,a,1,Math.round(g/m));w.set(o,a,2,Math.round(y/m));if(v){w.set(o,a,3,Math.round(b/m))}}}return w}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"@cronvel/get-pixels":58,"get-pixels":136,ndarray:71,seventh:108}],41:[function(t,e,r){"use strict";const L=t("nextgen-events");const D=t("seventh");const F=t("string-kit");const W=t("./autoComplete.js");const H={ENTER:"submit",KP_ENTER:"submit",ESCAPE:"cancel",BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",UP:"historyPrevious",DOWN:"historyNext",HOME:"startOfInput",END:"endOfInput",TAB:"autoComplete",CTRL_R:"autoCompleteUsingHistory",CTRL_LEFT:"previousWord",CTRL_RIGHT:"nextWord",ALT_D:"deleteNextWord",CTRL_W:"deletePreviousWord",CTRL_U:"deleteAllBefore",CTRL_K:"deleteAllAfter"};const N=/\S+/g;e.exports=function t(c,i){if(typeof c==="function"){i=c;c={}}else if(!c||typeof c!=="object"){c={}}if(c.echo===undefined){c.echo=true}if(typeof c.maxLength!=="number"){c.maxLength=Infinity}if(typeof c.minLength!=="number"){c.minLength=0}if(c.echoChar&&typeof c.echoChar!=="string"){c.echoChar="•"}if(c.autoCompleteMenu){if(typeof c.autoCompleteMenu!=="object"){c.autoCompleteMenu={}}c.autoCompleteMenu.exitOnUnexpectedKey=true;delete c.autoCompleteMenu.y}var d=c.keyBindings||H;if(c.tokenRegExp&&(!(c.tokenRegExp instanceof RegExp)||!c.tokenRegExp.flags.includes("g"))){throw new Error(".inputField(): if set, the 'tokenRegExp' option should be a RegExp with the 'g' flag")}if(!this.grabbing){this.grabInput()}var n,p=false,g=false,s=false,y=c.cursorPosition!==undefined?c.cursorPosition:-1,b=!!c.echo,m={},v={},w={},o={},_=[],x,C=c.tokenHook||c.autoCompleteHint,a=[],k=false;var T={style:c.style||this,hintStyle:c.hintStyle||this.brightBlack,tokenRegExp:c.tokenRegExp||N,autoComplete:c.autoComplete,autoCompleteMenu:c.autoCompleteMenu,autoCompleteHint:!!c.autoCompleteHint};if(Array.isArray(c.history)){_=c.history.map(t=>F.unicode.toArray(t).slice(0,c.maxLength))}if(c.default&&typeof c.default==="string"){_.push(F.unicode.toArray(c.default).slice(0,c.maxLength))}else{_.push([])}var e=()=>{x=_.length-1;y=r(y);if(c.y!==undefined){c.x=c.x||1;this.moveTo.eraseLineAfter(c.x,c.y);u(c.x,c.y)}else{this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n> ");e=3;r=this.height}u(e,r)})}};var u=(t,e)=>{m.x=v.x=w.x=t;m.y=v.y=w.y=e;if(_[x].length){E();A()}this.on("key",j);n.emit("ready")};var S=(t,e)=>{if(s){return}s=true;p=true;this.removeListener("key",j);if(t==="abort"){return}this.styleReset();if(t){if(i){i(t)}else{n.promise.reject(t)}return}var r;if(typeof e==="string"){r=e}else if(e){r=e.join("")}if(i){i(undefined,r)}else{n.promise.resolve(r)}};var E=()=>{var t,e=F.unicode.arrayWidth(_[x]),r=F.unicode.arrayWidth(a);v=f(e);o=f(e+r);if(o.y>this.height){t=o.y-this.height;T.style.noFormat("\n".repeat(t));m.y-=t;v.y-=t;o.y-=t}l()};var l=()=>{w=f(F.unicode.arrayWidth(_[x],y))};var f=t=>{return{x:1+(m.x+t-1)%this.width,y:m.y+Math.floor((m.x+t-1)/this.width)}};var r=t=>{if(typeof t!=="number"||isNaN(t)){return _[x].length}if(t<0){t=_[x].length+1+t}if(t<0){t=0}else if(t>=_[x].length){t=_[x].length}return t};var A=(t,e)=>{var r,i;t=t||0;if(!T.autoCompleteHint&&e){this.moveTo(v.x,v.y);T.style.noFormat.eraseLineAfter("")}this.moveTo(m.x,m.y);if(c.tokenHook){I(_[x].join(""))}else if(c.echoChar){T.style.noFormat(c.echoChar.repeat(_[x].length))}else{T.style.noFormat(_[x].join(""))}i=O();if(t>0){for(r=1;r<=t;r++){this.moveTo(1,v.y+r);T.style.noFormat.eraseLineAfter("")}}if(!i&&(w.y<v.y||v.x===this.width)){this.moveTo(v.x,v.y);T.style.noFormat.eraseLineAfter("")}this.moveTo(w.x,w.y)};var h=()=>{if(!n.hasState("ready")){n.once("ready",h);return}this.moveTo(w.x,w.y)};var R=()=>{if(g){return}g=true};var B=()=>{if(!g){return}g=false;if(n.hasState("ready")){A()}};var O=()=>{if(!T.autoCompleteHint){return false}var t=v.y;this.moveTo(v.x,v.y);T.style.noFormat.eraseLineAfter("");while(t<o.y){t++;this.moveTo(1,t);T.style.noFormat.eraseLineAfter("")}this.moveTo(w.x,w.y);return true};var P=r=>{g=true;this.singleLineMenu(r,T.autoCompleteMenu,(t,e)=>{g=false;if(t){return}if(e.selectedText){if(r.prefix){e.selectedText=r.prefix+e.selectedText}if(r.postfix){e.selectedText+=r.postfix}e.selectedText=F.unicode.toArray(e.selectedText).slice(0,c.maxLength);_[x]=e.selectedText.concat(_[x].slice(y,c.maxLength+y-e.selectedText.length));y=e.selectedText.length}if(b){this.column.eraseLineAfter(1);if(v.y>=this.height&&m.y>1){m.y--}E();A();this.moveTo(w.x,w.y)}if(e.unexpectedKey&&e.unexpectedKey!=="TAB"){j(e.unexpectedKey,undefined,e.unexpectedKeyData)}}).on("highlight",t=>n.emit("highlight",t))};var I=t=>{var e,r,i=0,n=[],s,o;T.style=c.style||this;T.hintStyle=c.hintStyle||this.brightBlack;T.tokenRegExp=c.tokenRegExp||N;T.autoComplete=c.autoComplete;T.autoCompleteMenu=c.autoCompleteMenu;T.autoCompleteHint=!!c.autoCompleteHint;T.tokenRegExp.lastIndex=0;if(c.tokenResetHook){c.tokenResetHook(this,T)}while((e=T.tokenRegExp.exec(t))!==null){r=T.tokenRegExp.lastIndex;if(e.index>i){T.style.noFormat(t.slice(i,e.index))}o=e.index+e[0].length===t.length;s=c.tokenHook(e[0],o,n,this,T);if(typeof s==="function"){s.noFormat(e[0])}else if(typeof s==="string"){this.noFormat(s)}else{T.style.noFormat(e[0])}n.push(e[0]);i=e.index+e[0].length;T.tokenRegExp.lastIndex=r}if(i<t.length){T.style.noFormat(t.slice(i))}};var M=()=>{if(!T.autoComplete||!T.autoCompleteHint||y<_[x].length){return}var r,t=_[x].join("");var i=()=>{if(Array.isArray(r)){return}a=F.unicode.toArray(r.slice(t.length)).slice(0,c.maxLength-_[x].length);E();this.moveTo(v.x,v.y);T.hintStyle.noFormat(a.join(""));this.moveTo(w.x,w.y)};if(Array.isArray(T.autoComplete)){r=W(T.autoComplete,t,T.autoCompleteMenu)}else if(typeof T.autoComplete==="function"){if(T.autoComplete.length===2){T.autoComplete(t,(t,e)=>{if(t){S(t);return}r=e;i()});return}r=T.autoComplete(t);if(D.isThenable(r)){r.then(t=>{r=t;i()},t=>{S(t)});return}}i()};var j=(t,e,r)=>{if(p||g){return}var i,n,s,o,a,u,l,f=y;if(k){k=false;l="ALT_"+t.toUpperCase();if(r){r.isCharacter=false}if(d[l]){t=l}}if(r&&r.isCharacter){if(_[x].length>=c.maxLength){return}_[x].splice(y,0,t);y++;if(b){if(y===_[x].length&&!C){T.style.noFormat(c.echoChar||t);E()}else{E();A();if(T.autoCompleteHint){M()}}}}else{switch(d[t]){case"submit":if(_[x].length<c.minLength){break}O();S(undefined,_[x]);break;case"cancel":if(c.cancelable){S()}break;case"meta":k=true;break;case"backDelete":if(_[x].length&&y>0){a=_[x][y-1];_[x].splice(y-1,1);y--;if(b){if(w.y<v.y||w.x===1||C){E();A(undefined,true);if(T.autoCompleteHint){M()}}else{E();if(F.unicode.isFullWidth(a)){this.left(2);this.delete(2)}else{this.left(1);this.delete(1)}}}}break;case"delete":if(_[x].length&&y<_[x].length){a=_[x][y];_[x].splice(y,1);if(b){if(w.y<v.y||C){E();A(undefined,true);if(T.autoCompleteHint){M()}}else{E();this.delete(F.unicode.isFullWidth(a)?2:1)}}}break;case"deleteAllBefore":if(_[x].length&&y>0){_[x].splice(0,y);y=0;if(b){E();A(undefined,true)}}break;case"deleteAllAfter":if(_[x].length&&y<_[x].length){_[x].splice(y,_[x].length-y);if(b){E();A(undefined,true);if(T.autoCompleteHint){M()}}}break;case"backward":if(_[x].length&&y>0){if(T.autoCompleteHint&&y===_[x].length){O()}y--;if(b){E();this.moveTo(w.x,w.y)}}break;case"forward":if(_[x].length&&y<_[x].length){y++;if(b){E();this.moveTo(w.x,w.y)}if(T.autoCompleteHint&&y===_[x].length){M()}}break;case"deletePreviousWord":if(_[x].length&&y>0){if(T.autoCompleteHint&&y===_[x].length){O()}u=y--;while(y>0&&_[x][y]===" "){y--}while(y>0&&_[x][y-1]!==" "){y--}_[x].splice(y,u-y);if(b){E();this.moveTo(w.x,w.y);A(undefined,true)}}break;case"deleteNextWord":if(_[x].length&&y<_[x].length){u=y;while(y<_[x].length&&_[x][y]===" "){y++}while(y<_[x].length&&_[x][y]!==" "){y++}while(y<_[x].length&&_[x][y]===" "){y++}_[x].splice(u,y-u);y=Math.min(_[x].length,u);if(b){E();this.moveTo(w.x,w.y);A(undefined,true)}if(T.autoCompleteHint&&y===_[x].length){M()}}break;case"previousWord":if(_[x].length&&y>0){if(T.autoCompleteHint&&y===_[x].length){O()}y--;while(y>0&&_[x][y]===" "){y--}while(y>0&&_[x][y-1]!==" "){y--}if(b){E();this.moveTo(w.x,w.y)}}break;case"nextWord":if(_[x].length&&y<_[x].length){while(y<_[x].length&&_[x][y]===" "){y++}while(y<_[x].length&&_[x][y]!==" "){y++}if(b){E();this.moveTo(w.x,w.y)}if(T.autoCompleteHint&&y===_[x].length){M()}}break;case"startOfInput":if(T.autoCompleteHint&&y===_[x].length){O()}y=0;if(b){E();this.moveTo(w.x,w.y)}break;case"endOfInput":y=_[x].length;if(b){E();this.moveTo(w.x,w.y)}if(T.autoCompleteHint&&f!==_[x].length){M()}break;case"historyNext":if(x<_.length-1){x++;y=_[x].length;if(b){o=v.y-m.y;E();o-=v.y-m.y;A(o,true);this.moveTo(w.x,w.y)}}break;case"historyPrevious":if(x>0){x--;y=_[x].length;if(b){o=v.y-m.y;E();o-=v.y-m.y;A(o,true);this.moveTo(w.x,w.y)}}break;case"autoCompleteUsingHistory":case"autoComplete":n=d[t]==="autoCompleteUsingHistory"?c.history:T.autoComplete;if(!n){break}i=_[x].slice(0,y);var h=()=>{if(Array.isArray(s)){if(T.autoCompleteMenu){P(s)}return}i=F.unicode.toArray(s).slice(0,c.maxLength);_[x]=i.concat(_[x].slice(y,c.maxLength+y-i.length));y=i.length;if(b){E();A()}};if(Array.isArray(n)){s=W(n,i.join(""),T.autoCompleteMenu)}else if(typeof n==="function"){if(n.length===2){n(i.join(""),(t,e)=>{if(t){S(t);return}s=e;h()});return}s=n(i.join(""));if(D.isThenable(s)){s.then(t=>{s=t;h()},t=>{S(t)});return}}h();break}}};n=Object.create(L.prototype);n.defineStates("ready");Object.defineProperty(n,"ready",{get:function(){return this.hasState("ready")}});n.widgetType="inputField";n.abort=()=>{if(p){return}S("abort")};n.stop=()=>{if(p){return}S(undefined,_[x])};n.pause=R;n.resume=B;n.focus=t=>{if(t){B()}else{R()}};n.getInput=()=>_[x].join("");n.value=n.getInput;n.getPosition=()=>({x:m.x,y:m.y});n.hide=()=>{if(!n.hasState("ready")){n.once("ready",n.hide);return}var t,e;for(t=m.x,e=m.y;e<=v.y;t=1,e++){this.moveTo.eraseLineAfter(t,e)}b=false};n.show=()=>{if(!n.hasState("ready")){n.once("ready",n.show);return}b=true;A()};n.redraw=()=>{if(!n.hasState("ready")){n.once("ready",n.redraw);return}A(undefined,true)};n.redrawCursor=()=>{if(!n.hasState("ready")){n.once("ready",n.redrawCursor);return}h()};n.getCursorPosition=()=>y;n.setCursorPosition=t=>{t=r(t);if(t!==y){if(T.autoCompleteHint&&y===_[x].length){O()}y=t;if(b){E();this.moveTo(w.x,w.y)}if(T.autoCompleteHint&&y===_[x].length){M()}}};n.rebase=(t,e)=>{if(!n.hasState("ready")){n.once("ready",n.rebase);return}var i=(t,e)=>{m.x=t;m.y=e;if(c.echo){b=true;E();A()}n.emit("rebased")};if(t!==undefined&&e!==undefined){i(t,e);return}b=false;this.getCursorLocation((t,e,r)=>{if(t){return}i(e,r)})};n.promise=new D;e();return n}},{"./autoComplete.js":7,"nextgen-events":72,seventh:108,"string-kit":123}],42:[function(t,e,r){"use strict";const s=t("string-kit");const i={};e.exports=i;const n={black:0,red:1,green:2,yellow:3,blue:4,magenta:5,violet:5,cyan:6,white:7,grey:8,gray:8,brightblack:8,brightred:9,brightgreen:10,brightyellow:11,brightblue:12,brightmagenta:13,brightviolet:13,brightcyan:14,brightwhite:15};i.colorNameToIndex=t=>n[t.toLowerCase()];const o=["black","red","green","yellow","blue","magenta","cyan","white","gray","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"];i.indexToColorName=t=>o[t];i.hexToRgba=t=>{if(t[0]==="#"){t=t.slice(1)}if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:t.length>6?parseInt(t.slice(6,8),16):255}};i.color2index=i.colorNameToIndex;i.index2color=i.indexToColorName;i.hexToColor=i.hexToRgba;i.stripControlChars=(t,e)=>{if(e){return t.replace(/[\x00-\x09\x0b-\x1f\x7f]/g,"")}return t.replace(/[\x00-\x1f\x7f]/g,"")};const a=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;const u=/([\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><])|([^\u001b\u009b]+)/g;i.stripEscapeSequences=t=>t.replace(a,"");i.ansiWidth=i.stringWidth=t=>{var e,r=0;u.lastIndex=0;while(e=u.exec(t)){if(e[2]){r+=s.unicode.width(e[2])}}return r};var l=0;i.getLastTruncateWidth=()=>l;i.truncateAnsiString=i.truncateString=(t,e)=>{var r,i=0;l=0;u.lastIndex=0;while(r=u.exec(t)){if(r[2]){i+=s.unicode.width(r[2]);if(i>=e){if(i===e){return t.slice(0,r.index+r[2].length)}return t.slice(0,r.index)+s.unicode.truncateWidth(r[2],e-l)}l=i}}return t};i.markupWidth=t=>{return s.unicode.width(t.replace(/\^\[[^\]]*]|\^(.)/g,(t,e)=>{if(e===" "||e==="^"){return e}return""}))};i.truncateMarkupString=(t,e)=>{var r=0,i,n=s.unicode.toArray(t);l=0;while(r<n.length){if(n[r]==="^"){r++;if(n[r]==="["){while(r<n.length&&n[r]!=="]"){r++}r++;continue}if(n[r]!==" "&&n[r]!=="^"){r++;continue}}i=s.unicode.isFullWidth(n[r])?2:1;if(l+i>e){n.length=r;return n.join("")}l+=i;r++}return t};i.escapeSequenceSkipFn=(t,e)=>{var r;if(t[e]!==""){return e}e++;if(t[e]!=="["){return e}e++;for(;e<t.length;e++){r=t[e].charCodeAt(0);if(r>=65&&r<=90||r>=97&&r<=122){e++;break}}return e};i.wordWrapAnsi=(t,e)=>s.wordwrap(t,{width:e,noJoin:true,fill:true,regroupFn:t=>{var r="",i=false,n=[];t.forEach(t=>{var e;if(i){r+=t;e=t.charCodeAt(0);if(e>=65&&e<=90||e>=97&&e<=122){n.push(r);r="";i=false}}else if(r){r+=t;if(t==="["){i=true}else{n.push(r);r=""}}else if(t===""){r=t}else{n.push(t)}});return n},charWidthFn:t=>{if(t[0]===""){return 0}return s.unicode.charWidth(t)}});i.wordwrapMarkup=i.wordWrapMarkup=(t,e)=>s.wordwrap(t,{width:e,noJoin:true,fill:true,regroupFn:t=>{var e="",r=false,i=[];t.forEach(t=>{if(r){e+=t;if(t==="]"){i.push(e);e="";r=false}}else if(e){e+=t;if(t==="["){r=true}else{i.push(e);e=""}}else if(t==="^"){e=t}else{i.push(t)}});return i},charWidthFn:t=>{if(t[0]==="^"&&t[1]){if(t[1]==="^"||t[1]===" "){return 1}return 0}return s.unicode.charWidth(t)}});i.preserveMarkupFormat=s.createFormatter({argumentSanitizer:t=>t.replace(/[\x00-\x1f\x7f^]/g,t=>t==="^"?"^^":""),noMarkup:true});i.markupOptions={complexMarkupAliases:{c:"color",fg:"color",bg:"bgColor"},shiftMarkup:{"#":"background"},markup:{":":{reset:true}," ":{reset:true,raw:" "},";":{reset:true,special:true},"-":{dim:true},"+":{bold:true},_:{underline:true},"/":{italic:true},"!":{inverse:true},k:{color:0},r:{color:1},g:{color:2},y:{color:3},b:{color:4},m:{color:5},c:{color:6},w:{color:7},K:{color:8},R:{color:9},G:{color:10},Y:{color:11},B:{color:12},M:{color:13},C:{color:14},W:{color:15}},shiftedMarkup:{background:{":":{reset:true,defaultColor:true,bgDefaultColor:true}," ":{reset:true,defaultColor:true,bgDefaultColor:true,raw:" "},";":{reset:true,special:true,defaultColor:true,bgDefaultColor:true},k:{bgColor:0},r:{bgColor:1},g:{bgColor:2},y:{bgColor:3},b:{bgColor:4},m:{bgColor:5},c:{bgColor:6},w:{bgColor:7},K:{bgColor:8},R:{bgColor:9},G:{bgColor:10},Y:{bgColor:11},B:{bgColor:12},M:{bgColor:13},C:{bgColor:14},W:{bgColor:15}}}};const f=/\^\[([^\]]*)]|\^(.)|([^^]+)/g;i.parseMarkup=(t,i)=>{var e,r,n,s,o=i.markup,a=[];f.lastIndex=0;while(s=f.exec(t)){[,e,r,n]=s;if(e){var u={};e.split(",").forEach(t=>{var[e,r]=t.split(":");if(i.complexMarkupAliases[e]){e=i.complexMarkupAliases[e]}u[e]=r||true});a.push({markup:u})}else if(n){a.push(n)}else if(r==="^"){a.push("^")}else if(i.shiftMarkup[r]){o=i.shiftedMarkup[i.shiftMarkup[r]];continue}else if(o[r]){a.push({markup:o[r]})}o=i.markup}return a};const h={0:{reset:true},1:{bold:true},2:{dim:true},22:{bold:false,dim:false},3:{italic:true},23:{italic:false},4:{underline:true},24:{underline:false},5:{blink:true},25:{blink:false},7:{inverse:true},27:{inverse:false},8:{hidden:true},28:{hidden:false},9:{strike:true},29:{strike:false},30:{color:0},31:{color:1},32:{color:2},33:{color:3},34:{color:4},35:{color:5},36:{color:6},37:{color:7},"39:":{defaultColor:true},90:{color:8},91:{color:9},92:{color:10},93:{color:11},94:{color:12},95:{color:13},96:{color:14},97:{color:15},40:{bgColor:0},41:{bgColor:1},42:{bgColor:2},43:{bgColor:3},44:{bgColor:4},45:{bgColor:5},46:{bgColor:6},47:{bgColor:7},"49:":{bgDefaultColor:true},100:{bgColor:8},101:{bgColor:9},102:{bgColor:10},103:{bgColor:11},104:{bgColor:12},105:{bgColor:13},106:{bgColor:14},107:{bgColor:15}};const c=/\x1b\[([0-9;]+)m|(.[^\x1b]*)/g;i.parseAnsi=t=>{var e,r,i,n=[];c.lastIndex=0;while(e=c.exec(t)){[,r,i]=e;if(i){n.push(i)}else{r.split(";").forEach(t=>{if(h[t]){n.push({markup:h[t]})}})}}return n}},{"string-kit":123}],43:[function(t,e,r){"use strict";const i=t("seventh");i.promisifyNodeApi(t("child_process"))},{child_process:136,seventh:108}],44:[function(t,e,r){"use strict";e.exports=function t(c){if(!c||typeof c!=="object"){c={}}var e={},d,p=false,g=false,y,r=0,b=[],m,v,w,_,x,C,n,i,k,T=0,S=0,s=0,l=0,f,E,h,A,R,B,O;R=h=(new Date).getTime();k=["|","/","-","\\"];c.syncMode=!!c.syncMode;_=c.width||this.width-1;if(!c.barBracketStyle){if(c.barStyle){c.barBracketStyle=c.barStyle}else{c.barBracketStyle=this.blue}}if(!c.barStyle){c.barStyle=this.cyan}if(!c.percentStyle){c.percentStyle=this.yellow}if(!c.etaStyle){c.etaStyle=this.bold}if(!c.itemStyle){c.itemStyle=this.dim}if(!c.titleStyle){c.titleStyle=this.bold}if(!c.barChar){c.barChar="="}else{c.barChar=c.barChar[0]}if(!c.barHeadChar){c.barHeadChar=">"}else{c.barHeadChar=c.barHeadChar[0]}if(typeof c.maxRefreshTime!=="number"){c.maxRefreshTime=500}if(typeof c.minRefreshTime!=="number"){c.minRefreshTime=100}if(typeof c.items==="number"){y=c.items}if(y&&typeof c.itemSize!=="number"){c.itemSize=Math.round(_/3)}m=" ".repeat(c.itemSize);if(c.title&&typeof c.title==="string"){v=c.title;if(typeof c.titleSize!=="number"){c.titleSize=Math.round(Math.min(c.title.length+1,_/3))}}w=" ".repeat(c.titleSize);O="           ";var P=t=>{var e="",r,i,n,s,o,a,u;if(d>=1){e=" done"}else if(d>0){r=(new Date).getTime()-h;i=(new Date).getTime()-R;if(!t&&l>1){a=(new Date).getTime()-f;s=i/l;o=d/l;if(a<s){u=d+o*a/s}else{u=d+o}if(u>.99){u=.99}}else{u=d}n=i*((1-u)/u)/1e3;e=" in ";if(n<10){e+=Math.round(n*10)/10+"s"}else if(n<120){e+=Math.round(n)+"s"}else if(n<7200){e+=Math.round(n/60)+"min"}else if(n<172800){e+=Math.round(n/3600)+"hours"}else if(n<31536e3){e+=Math.round(n/86400)+"days"}else{e="few years"}}else{R=(new Date).getTime()}e=(e+O).slice(0,O.length);B=e;return e};var I=t=>{var e,r,i=m,n=w,s,o,a,u="",l="",f="",h="";if(!p||g){return}e=(new Date).getTime();if((!d||d<1)&&E&&e<E+c.minRefreshTime){if(!c.syncMode){if(A){clearTimeout(A)}A=setTimeout(I.bind(this,t),E+c.minRefreshTime-e)}return}this.saveCursor();if(x===null){this.column(C)}else{this.moveTo(C,x)}s=_-2;if(c.percent){s-=4;f=("   "+Math.round((d||0)*100)+"%").slice(-4)}if(c.eta){h=P(t);s-=h.length}s-=c.itemSize||0;if(y){if(!b.length){i=""}else if(b.length===1){i=" "+b[0]}else{r=S++%b.length;i=" ["+(r+1)+"/"+b.length+"] "+b[r]}if(i.length>m.length){i=i.slice(0,m.length-1)+"…"}else if(i.length<m.length){i=(i+m).slice(0,m.length)}}s-=c.titleSize||0;if(v){n=v;if(n.length>=w.length){n=n.slice(0,w.length-2)+"… "}else{n=(n+w).slice(0,w.length)}}o=d===undefined?1:Math.round(s*Math.max(Math.min(d,1),0));a=s-o;if(o){if(d===undefined){u=k[++T%k.length]}else{u+=c.barChar.repeat(o-1);u+=c.barHeadChar}}l+=" ".repeat(a);c.titleStyle(n);if(f){c.percentStyle(f)}if(d===undefined){this(" ")}else{c.barBracketStyle("[")}c.barStyle(u);this(l);if(d===undefined){this(" ")}else{c.barBracketStyle("]")}c.etaStyle(h);c.itemStyle(i);this.restoreCursor();if(!c.syncMode){if(A){clearTimeout(A)}if(!d||d<1){A=setTimeout(I,c.maxRefreshTime)}}E=e};if(c.syncMode||c.inline||c.y){i=_;if(c.y){C=+c.x||1;x=+c.y||1}else{C=1;x=null}n=Math.min(C+_,this.width);_=n-C;if(_!==i){if(c.titleSize){c.titleSize=Math.floor(c.titleSize*_/i)}if(c.itemSize){c.itemSize=Math.floor(c.itemSize*_/i)}}p=true;I()}else{this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}var i=_;C=e;n=Math.min(e+_,this.width);x=r;_=n-C;if(_!==i){if(c.titleSize){c.titleSize=Math.floor(c.titleSize*_/i)}if(c.itemSize){c.itemSize=Math.floor(c.itemSize*_/i)}}p=true;I()})}e.startItem=t=>{b.push(t);if(b.length===1){if(d>=1){I();return}if(c.syncMode){I()}else{if(A){clearTimeout(A)}A=setTimeout(I,0)}}};e.itemDone=t=>{var e;r++;if(y){d=r/y}else{d=undefined}f=(new Date).getTime();s++;l++;e=b.indexOf(t);if(e>=0){b.splice(e,1)}if(d>=1){I(true);return}if(c.syncMode){I()}else{if(A){clearTimeout(A)}A=setTimeout(I.bind(this,true),0)}};e.update=t=>{if(!t){t={}}else if(typeof t==="number"){t={progress:t}}if("progress"in t){if(typeof t.progress!=="number"){d=undefined}else{d=t.progress;if(d>1){d=1}else if(d<0){d=0}if(d>0){l++}f=(new Date).getTime();s++}}if(typeof t.items==="number"){y=t.items;if(y){d=r/y}if(typeof c.itemSize!=="number"){c.itemSize=Math.round(_/3);m=" ".repeat(c.itemSize)}}if(typeof t.title==="string"){v=t.title;if(typeof c.titleSize!=="number"){c.titleSize=Math.round(_/3);w=" ".repeat(c.titleSize)}}if(d>=1){I(true);return}if(c.syncMode){I()}else{if(A){clearTimeout(A)}A=setTimeout(I.bind(this,true),0)}};e.pause=e.stop=()=>{g=true};e.resume=()=>{if(g){g=false;I()}};e.reset=()=>{R=h=(new Date).getTime();r=0;d=undefined;b.length=0;T=S=s=l=0;I()};return e}},{}],45:[function(t,e,r){"use strict";const D=t("./termkit");const F=D.stringWidth;const W=t("string-kit");const H=t("nextgen-events");const N=t("seventh");const U={ENTER:"submit",KP_ENTER:"submit",UP:"previous",DOWN:"next",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last",BACKSPACE:"cancel",DELETE:"cancel",ESCAPE:"escape"};e.exports=function t(e,s,n){if(arguments.length<1){throw new Error("[terminal] singleColumnMenu() needs at least an array of menuItems")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] singleColumnMenu(): argument #0 should be a non-empty array")}if(typeof s==="function"){n=s;s={}}else if(!s||typeof s!=="object"){s={}}if(!s.style){s.style=this}if(!s.selectedStyle){s.selectedStyle=this.inverse}if(!s.submittedStyle){s.submittedStyle=this.bgGray.bold}if(!s.disabledStyle){s.disabledStyle=this.dim}if(!s.disabledSelectedStyle){s.disabledSelectedStyle=this.bgGray.dim}if(!s.disabledSubmittedStyle){s.disabledSubmittedStyle=this.bgGray}if(s.leftPadding===undefined){s.leftPadding=" "}if(s.selectedLeftPadding===undefined){s.selectedLeftPadding=s.leftPadding}if(s.submittedLeftPadding===undefined){s.submittedLeftPadding=s.leftPadding}if(typeof s.extraLines!=="number"||s.extraLines<0){s.extraLines=1}if(!s.itemMaxWidth){s.itemMaxWidth=this.width-1}if(!s.unsubmittableIndexes){s.unsubmittableIndexes=[]}var o=s.selectedIndex||0;var a=s.submitted?s.selectedIndex:null;var u=!!s.paused;var l=s.keyBindings||U;if(!this.grabbing){this.grabInput()}var f={},h={},i,c,d,p,g=0,r=0,y=0,b,m=false,v=false;var w=()=>{_(e);if(s.y!==undefined){this.moveTo(1,s.y);x(1,s.y)}else{this("\n");this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}x(e,r)})}};var _=t=>{i=0;d=Math.max(F(s.leftPadding),F(s.selectedLeftPadding));t=t.map(t=>{if(typeof t!=="string"){t=""+t}i=Math.max(i,F(t));return t});if(!s.oneLineItem&&i>s.itemMaxWidth-d){c=Math.min(i+d,this.width);p=t.map((t,e)=>{var r,i,n=s.itemMaxWidth-d;i=W.wordwrap(t,{width:n,noJoin:true,fill:true,skipFn:D.escapeSequenceSkipFn});r={offsetY:g,index:e,text:t,displayText:i};g+=i.length;return r});r=g}else{i=Math.min(i,s.itemMaxWidth-d);c=Math.min(i+d,this.width);p=t.map((t,e)=>{var r=F(t);return{offsetY:e,index:e,text:t,displayText:[r>i?t.slice(0,i-1)+"…":t+" ".repeat(i-r)]}});r=p.length}};var x=(t,e)=>{if(m){return}k(t,e);E();this.on("key",j);if(this.mouseGrabbing){this.on("mouse",L)}b.emit("ready");C()};var C=()=>{var t=p[o];b.emit("highlight",{highlightedIndex:t.index,highlightedText:t.text,submitted:a!==null,x:1,y:f.y+t.offsetY})};var k=(t,e)=>{f.x=t;f.y=e;h.x=1;h.y=e+r;y=f.y+r-(s.scrollRegionBottom||this.height)-1+s.extraLines;if(y>0){this("\n".repeat(y));f.y-=y;h.y-=y}};var T=(t,e,r)=>{if(v){return}v=true;m=true;this.removeListener("key",j);this.removeListener("mouse",L);if(t==="abort"){return}if(b.hasState("ready")){if(r){S()}else{this.moveTo(1,h.y)}}if(t){if(n){n(t)}else{b.promise.reject(t)}return}var i=e!==undefined?e:{selectedIndex:o,selectedText:p[o].text,submitted:a!==null,x:1,y:f.y+p[o].offsetY};if(n){n(undefined,i)}else{b.promise.resolve(i)}};var S=()=>{if(!b.hasState("ready")){b.once("ready",S);return}var t,e;for(t=f.x,e=f.y;e<=h.y;t=1,e++){this.moveTo.eraseLineAfter(t,e)}this.moveTo(1,f.y)};var E=()=>{for(var t=0;t<p.length;t++){A(t)}R()};var A=r=>{var i=p[r];i.displayText.forEach((t,e)=>{this.moveTo(1,f.y+i.offsetY+e);if(u||s.unsubmittableIndexes[r]){if(r===a){if(e){s.disabledSubmittedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.disabledSubmittedStyle.forceStyleOnReset.noFormat(s.submittedLeftPadding)}s.disabledSubmittedStyle.forceStyleOnReset.noFormat(t)}else if(r===o){if(e){s.disabledSelectedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.disabledSelectedStyle.forceStyleOnReset.noFormat(s.selectedLeftPadding)}s.disabledSelectedStyle.forceStyleOnReset.noFormat(t)}else{s.disabledStyle.forceStyleOnReset.noFormat(s.leftPadding);s.disabledStyle.forceStyleOnReset.noFormat(t)}}else if(r===a){if(e){s.submittedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.submittedStyle.forceStyleOnReset.noFormat(s.submittedLeftPadding)}s.submittedStyle.forceStyleOnReset.noFormat(t)}else if(r===o){if(e){s.selectedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.selectedStyle.forceStyleOnReset.noFormat(s.selectedLeftPadding)}s.selectedStyle.forceStyleOnReset.noFormat(t)}else{s.style.forceStyleOnReset.noFormat(s.leftPadding);s.style.forceStyleOnReset.noFormat(t)}})};var R=()=>{this.moveTo(1,f.y+p[o].offsetY)};var B=t=>{var e=o;if(o!==t&&t>=0&&t<p.length){o=t;if(b.hasState("ready")){A(e);A(o);R();C()}}};var O=()=>{if(a!==null||s.unsubmittableIndexes[o]){return}a=o;if(b.hasState("ready")){A(a);R()}b.emit("submit",{selectedIndex:a,selectedText:p[a].text,submitted:true,x:1,y:f.y+p[a].offsetY});if(!s.continueOnSubmit){T()}};var P=()=>{var t=a;if(a===null){return}a=null;A(t);R();b.emit("cancel")};var I=()=>{if(u){return}u=true;if(b.hasState("ready")){E()}};var M=()=>{if(!u){return}u=false;if(b.hasState("ready")){E()}};var j=(t,e,r)=>{if(m||u){return}var i=o;switch(l[t]){case"submit":O();break;case"previous":if(a!==null){return}if(o>0){o--;A(o);A(o+1);R();C()}break;case"next":if(a!==null){return}if(o<p.length-1){o++;A(o-1);A(o);R();C()}break;case"cyclePrevious":if(a!==null){return}o--;if(o<0){o=p.length-1}A(i);A(o);R();C();break;case"cycleNext":if(a!==null){return}o++;if(o>=p.length){o=0}A(i);A(o);R();C();break;case"first":if(a!==null){return}if(o!==0){o=0;A(i);A(o);R();C()}break;case"last":if(a!==null){return}if(o!==p.length-1){o=p.length-1;A(i);A(o);R();C()}break;case"cancel":P();break;case"escape":if(s.cancelable){T(undefined,{canceled:true})}if(s.exitOnUnexpectedKey){T(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break;default:if(s.exitOnUnexpectedKey){T(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break}};var L=(t,e)=>{if(m||u||a!==null){return}if(e.y<f.y||e.y>=h.y){return}var r,i,n,s=false;for(r=0;r<p.length;r++){i=f.y+p[r].offsetY;n=f.y+p[r].offsetY+p[r].displayText.length-1;if(e.y>=i&&e.y<=n&&e.x<1+c){s=true;B(r);break}}if(s&&t==="MOUSE_LEFT_BUTTON_PRESSED"){O()}};b=Object.create(H.prototype);b.defineStates("ready");b.abort=()=>{if(m){return}T("abort")};b.stop=t=>{if(m){return}T(undefined,undefined,t)};b.select=B;b.submit=O;b.cancel=P;b.erase=S;b.pause=I;b.resume=M;b.focus=t=>{if(t){M()}else{I()}};b.getState=()=>({selectedIndex:o,selectedText:p[o].text,submitted:a!==null,start:f,end:h,x:1,y:f.y+p[o].offsetY});b.getPosition=()=>({x:f.x,y:f.y});b.hide=()=>{if(!b.hasState("ready")){b.once("ready",b.hide);return}S()};b.show=()=>{if(!b.hasState("ready")){b.once("ready",b.show);return}E()};b.redraw=()=>{if(!b.hasState("ready")){b.once("ready",b.redraw);return}E()};b.redrawCursor=()=>{if(!b.hasState("ready")){b.once("ready",b.redrawCursor);return}R()};b.rebase=()=>{if(!b.hasState("ready")){b.once("ready",b.rebase);return}var i=u;u=true;this.getCursorLocation((t,e,r)=>{if(t){return}u=i;k(e,r);E();b.emit("rebased")})};b.promise=new N;w();return b}},{"./termkit":50,"nextgen-events":72,seventh:108,"string-kit":123}],46:[function(t,e,r){"use strict";const C=t("./termkit");const k=C.stringWidth;const T=t("nextgen-events");const S=t("seventh");const E={ENTER:"submit",KP_ENTER:"submit",LEFT:"previous",RIGHT:"next",UP:"previousPage",DOWN:"nextPage",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last",ESCAPE:"escape"};e.exports=function t(e,h,n){if(arguments.length<1){throw new Error("[terminal] singleLineMenu() needs at least an array of menuItems")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] singleLineMenu(): argument #0 should be a non-empty array")}if(typeof h==="function"){n=h;h={}}else if(!h||typeof h!=="object"){h={}}if(h.separator===undefined){h.separator="  "}if(h.nextPageHint===undefined){h.nextPageHint=" » "}if(h.previousPageHint===undefined){h.previousPageHint=" « "}if(!h.style){h.style=this}if(!h.selectedStyle){h.selectedStyle=this.dim.blue.bgGreen}if(!h.y){this("\n")}else{this.moveTo(1,h.y)}var s=h.keyBindings||E;if(!this.grabbing){this.grabInput()}var c=e.map(t=>typeof t==="string"?t:""+t);var d=h.selectedIndex=h.selectedIndex||0;var a={},p=0,u=false,g=[],o=false;var y=k(h.nextPageHint),b=k(h.previousPageHint),m=k(h.separator);var i=()=>{var t,e,r,i=0,n=1,s,o=true,a,u,l,f=this.width-y;g=[[]];for(t=0;t<c.length;t++){if(i>=g.length){g.push([])}e=k(c[t]);s=n+e+m;if(s>f){if(o){e=f-n;r=C.truncateString(c[t],e-1)+"…";if(t===h.selectedIndex){p=i;d=g[i].length}g[i].push({index:t,text:c[t],displayText:r,displayTextWidth:e,x:n})}else{t--}i++;n=1+b;o=true;continue}if(t===h.selectedIndex){p=i;d=g[i].length}g[i].push({index:t,text:c[t],displayText:c[t],displayTextWidth:e,x:n});n=s;o=false}for(i=0;i<g.length;i++){a=g[i][g[i].length-1];u=a.x+a.displayTextWidth-1;if(i<g.length-1){u+=y}g[i].x=1;if(u<this.width){if(h.align==="right"){l=this.width-u}else if(h.align==="center"){l=Math.floor((this.width-u)/2)}else{l=0}g[i].x+=l;if(l){g[i].forEach(t=>t.x+=l)}}}};var l=(t,e)=>{if(o){return}o=true;u=true;this.removeListener("key",w);this.removeListener("mouse",_);if(t){if(n){n(t)}else{x.promise.reject(t)}return}var r=g[p];var i=e!==undefined?e:{selectedIndex:r[d].index,selectedText:r[d].text,x:r[d].x,y:a.y};if(n){n(undefined,i)}else{x.promise.resolve(i)}};var f=()=>{var t,e,r=g[p],i=r.x;this.moveTo.eraseLineAfter(1,a.y);if(h.fillIn&&i>1){h.style.noFormat(" ".repeat(i-1))}else{this.column(i)}if(p){h.style.forceStyleOnReset.noFormat(h.previousPageHint);i+=b}for(t=0;t<r.length;t++){if(t){h.style.forceStyleOnReset.noFormat(h.separator);i+=m}if(t===d){h.selectedStyle.forceStyleOnReset.noFormat(r[t].displayText);e=i}else{h.style.forceStyleOnReset.noFormat(r[t].displayText)}i+=r[t].displayTextWidth}if(p<g.length-1){h.style.forceStyleOnReset.noFormat(h.nextPageHint);i+=y}if(h.fillIn&&i<this.width){h.style.noFormat(" ".repeat(this.width-i))}this.column(e)};var v=()=>{var t=g[p][d];x.emit("highlight",{highlightedIndex:t.index,highlightedText:t.text,x:t.x,y:a.y})};var w=(t,e,r)=>{if(u){return}var i=false,n=g[p];switch(s[t]){case"submit":l();break;case"previous":if(d>0){d--;i=true}else if(p>0){p--;d=g[p].length-1;i=true}break;case"next":if(d<n.length-1){d++;i=true}else if(p<g.length-1){p++;d=0;i=true}break;case"cycleNext":if(p===g.length-1&&d===n.length-1){p=0;d=0;i=true}else if(d<n.length-1){d++;i=true}else if(p<g.length-1){p++;d=0;i=true}break;case"cyclePrevious":if(p===0&&d===0){p=g.length-1;d=g[p].length-1;i=true}else if(d>0){d--;i=true}else if(p>0){p--;d=g[p].length-1;i=true}break;case"first":if(p!==0||d!==0){p=0;d=0;i=true}break;case"last":if(p!==g.length-1||d!==g[p].length-1){p=g.length-1;d=g[p].length-1;i=true}break;case"previousPage":if(p>0){p--;d=0;i=true}break;case"nextPage":if(p<g.length-1){p++;d=0;i=true}break;case"escape":if(h.cancelable){l(undefined,{canceled:true})}if(h.exitOnUnexpectedKey){l(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break;default:if(h.exitOnUnexpectedKey){l(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break}if(i){f();v()}};var _=(t,e)=>{if(u){return}if(e.y!==a.y){return}var r,i,n,s=false,o=g[p];if(t==="MOUSE_LEFT_BUTTON_PRESSED"){if(p>0&&e.x>=1&&e.x<1+b){p--;d=0;f();v();return}n=o[o.length-1].x+o[o.length-1].displayTextWidth;if(p<g.length-1&&e.x>=n&&e.x<n+y){p++;d=0;f();v();return}}for(r=0;r<o.length;r++){i=o[r];if(e.x>=i.x&&e.x<i.x+i.displayTextWidth){s=true;if(d!==r){d=r;f();v()}break}}if(s&&t==="MOUSE_LEFT_BUTTON_PRESSED"){l()}};var x=Object.create(T.prototype);x.promise=new S;this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}a.x=e;a.y=r;i();f();v();this.on("key",w);if(this.mouseGrabbing){this.on("mouse",_)}});return x}},{"./termkit":50,"nextgen-events":72,seventh:108}],47:[function(t,e,r){"use strict";var l=t("seventh");e.exports=function t(e,r,i){if(typeof e!=="string"){throw new TypeError("[terminal] slowTyping(): argument #0 should be a string")}if(typeof r==="function"){i=r;r={}}if(!r||typeof r!=="object"){r={}}if(!r.style){r.style=this.green}if(!r.delay){r.delay=150}if(!r.flashStyle){r.flashStyle=this.bold.brightGreen}if(!r.flashDelay){r.flashDelay=100}var n,s,o=new l;var a=()=>{if(s){clearTimeout(s);s=null;u()}if(n===undefined){n=0}else if(n>=e.length){if(i){i()}else{o.resolve()}return}else{if(r.flashStyle&&e[n].match(/\S/)){r.flashStyle(e[n]);s=setTimeout(u,r.flashDelay)}else{r.style(e[n])}n++}setTimeout(a,(.2+Math.random()*1.8)*r.delay)};var u=()=>{this.left(1);r.style(e[n-1]);s=null};a();return o}},{seventh:108}],48:[function(t,e,r){"use strict";const i="⠀⠁⠂⠃⠄⠅⠆⠇⡀⡁⡂⡃⡄⡅⡆⡇⠈⠉⠊⠋⠌⠍⠎⠏⡈⡉⡊⡋⡌⡍⡎⡏⠐⠑⠒⠓⠔⠕⠖⠗⡐⡑⡒⡓⡔⡕⡖⡗⠘⠙⠚⠛⠜⠝⠞⠟⡘⡙⡚⡛⡜⡝⡞⡟⠠⠡⠢⠣⠤⠥⠦⠧⡠⡡⡢⡣⡤⡥⡦⡧⠨⠩⠪⠫⠬⠭⠮⠯⡨⡩⡪⡫⡬⡭⡮⡯⠰⠱⠲⠳⠴⠵⠶⠷⡰⡱⡲⡳⡴⡵⡶⡷⠸⠹⠺⠻⠼⠽⠾⠿⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⣀⣁⣂⣃⣄⣅⣆⣇⢈⢉⢊⢋⢌⢍⢎⢏⣈⣉⣊⣋⣌⣍⣎⣏⢐⢑⢒⢓⢔⢕⢖⢗⣐⣑⣒⣓⣔⣕⣖⣗⢘⢙⢚⢛⢜⢝⢞⢟⣘⣙⣚⣛⣜⣝⣞⣟⢠⢡⢢⢣⢤⢥⢦⢧⣠⣡⣢⣣⣤⣥⣦⣧⢨⢩⢪⢫⢬⢭⢮⢯⣨⣩⣪⣫⣬⣭⣮⣯⢰⢱⢲⢳⢴⢵⢶⢷⣰⣱⣲⣳⣴⣵⣶⣷⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿".split("");const n=[" ","▁","▂","▃","▄","▅","▆","▇","█"];const s=[" ","▏","▎","▍","▌","▋","▊","▉","█"];e.exports={password:"●",forwardSingleQuote:"´",overscore:"¯",multiply:"×",divide:"÷",up:"↑",down:"↓",left:"←",right:"→",leftAndRight:"↔",upAndDown:"↕",upLeft:"↖",upRight:"↗",downRight:"↘",downLeft:"↙",upLeftAndDownRight:"⤡",upRightAndDownLeft:"⤢",northWest:"↖",northEast:"↗",southEast:"↘",southWest:"↙",northWestAndSouthEast:"⤡",northEastAndSouthWest:"⤢",fullBlock:"█",upperHalfBlock:"▀",lowerHalfBlock:"▄",growingBlock:n,enlargingBlock:s,bitDots:i,bar:{classic:{border:["[","]"],body:["="," "]},classicWithArrow:{border:["[","]"],body:["=",">"," "]},classicWithHalf:{border:["[","]"],body:["="," ","-","="," "]},solid:{border:["^!▉","▏"],body:["█",...s," "]}},box:{__fix__:t=>({vertical:t.vertical||" ",horizontal:t.horizontal||" ",topLeft:t.topLeft||" ",topRight:t.topRight||" ",bottomLeft:t.bottomLeft||" ",bottomRight:t.bottomRight||" ",topTee:t.topTee||" ",bottomTee:t.bottomTee||" ",leftTee:t.leftTee||" ",rightTee:t.rightTee||" ",cross:t.cross||" "}),plain:{vertical:"█",horizontal:"█",topLeft:"█",topRight:"█",bottomLeft:"█",bottomRight:"█",topTee:"█",bottomTee:"█",leftTee:"█",rightTee:"█",cross:"█"},empty:{vertical:" ",horizontal:" ",topLeft:" ",topRight:" ",bottomLeft:" ",bottomRight:" ",topTee:" ",bottomTee:" ",leftTee:" ",rightTee:" ",cross:" "},ascii:{vertical:"|",horizontal:"-",topLeft:"|",topRight:"|",bottomLeft:"|",bottomRight:"|",topTee:"-",bottomTee:"-",leftTee:"|",rightTee:"|",cross:"+"},light:{vertical:"│",horizontal:"─",topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"},lightRounded:{vertical:"│",horizontal:"─",topLeft:"╭",topRight:"╮",bottomLeft:"╰",bottomRight:"╯",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"},heavy:{vertical:"┃",horizontal:"━",topLeft:"┏",topRight:"┓",bottomLeft:"┗",bottomRight:"┛",topTee:"┳",bottomTee:"┻",leftTee:"┣",rightTee:"┫",cross:"╋"},double:{vertical:"║",horizontal:"═",topLeft:"╔",topRight:"╗",bottomLeft:"╚",bottomRight:"╝",topTee:"╦",bottomTee:"╩",leftTee:"╠",rightTee:"╣",cross:"╬"},dotted:{vertical:"┊",horizontal:"┄",topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"}},animation:{asciiSpinner:["│","/","-","\\"],lineSpinner:["│","/","─","\\"],dotSpinner:[i[7],i[19],i[49],i[112],i[224],i[200],i[140],i[14]],bitDots:i,impulse:["∙∙∙","●∙∙","∙●∙","∙∙●","∙●∙","●∙∙","∙∙∙","∙∙∙"],unboxing:[" ","▁","▂","▃","▄","▅","▆","▇","█","▉","▊","▋","▌","▍","▎","▏"],"unboxing-color":["^r^#^b ","^r^#^b▁","^r^#^b▂","^r^#^b▃","^r^#^b▄","^r^#^b▅","^r^#^b▆","^r^#^b▇","^r^#^m█","^r^#^m▉","^r^#^m▊","^r^#^m▋","^r^#^m▌","^r^#^m▍","^r^#^m▎","^r^#^m▏","^m^#^y█","^m^#^y▇","^m^#^y▆","^m^#^y▅","^m^#^y▄","^m^#^y▃","^m^#^y▂","^m^#^y▁","^b^#^y ","^b^#^y▏","^b^#^y▎","^b^#^y▍","^b^#^y▌","^b^#^y▋","^b^#^y▊","^b^#^y▉"]},blackSquare:"■",whiteSquare:"□",blackCircle:"●",whiteCircle:"○",blackUpTriangle:"▲",whiteUpTriangle:"△",blackDownTriangle:"▼",whiteDownTriangle:"▽",blackLeftTriangle:"◀",whiteLeftTriangle:"◁",blackRightTriangle:"▶",whiteRightTriangle:"▷",blackDiamond:"◆",whiteDiamond:"◇",blackStar:"★",whiteStar:"☆",spadeSuit:"♠",heartSuit:"♥",diamondSuit:"♦",clubSuit:"♣",powerline:{branch:"",line:"",readOnly:"",rightTriangleSeparator:"",rightArrowSeparator:"",leftTriangleSeparator:"",leftArrowSeparator:""}}},{}],49:[function(e,r,t){(function(n){(function(){"use strict";const i={};r.exports=i;const t=e("lazyness")(e);i.globalConfig={};i.tty=e("./tty.js");if(n.env.TERM==="linux"){i.tty.getPath()}Object.assign(i,e("./misc.js"));Object.assign(i,e("./detectTerminal.js"));i.Terminal=e("./Terminal.js");i.createTerminal=i.Terminal.create;if(n.platform==="win32"){e("./windows.js")(i)}i.image=e("./image.js");i.Palette=e("./Palette.js");i.Rect=e("./Rect.js");i.ScreenBuffer=e("./ScreenBuffer.js");i.ScreenBufferHD=e("./ScreenBufferHD.js");i.TextBuffer=e("./TextBuffer.js");i.Vte=e("./vte/Vte.js");i.autoComplete=e("./autoComplete.js");i.spChars=e("./spChars.js");i.Element=e("./document/Element.js");i.Document=e("./document/Document.js");i.Container=e("./document/Container.js");i.Text=e("./document/Text.js");i.AnimatedText=e("./document/AnimatedText.js");i.Button=e("./document/Button.js");i.ToggleButton=e("./document/ToggleButton.js");i.TextBox=e("./document/TextBox.js");i.EditableTextBox=e("./document/EditableTextBox.js");i.Slider=e("./document/Slider.js");i.Bar=e("./document/Bar.js");i.LabeledInput=e("./document/LabeledInput.js");i.InlineInput=e("./document/InlineInput.js");i.Form=e("./document/Form.js");i.RowMenu=e("./document/RowMenu.js");i.ColumnMenu=e("./document/ColumnMenu.js");i.ColumnMenuMulti=e("./document/ColumnMenuMulti.js");i.SelectList=e("./document/SelectList.js");i.SelectListMulti=e("./document/SelectListMulti.js");i.DropDownMenu=e("./document/DropDownMenu.js");i.TextTable=e("./document/TextTable.js");i.Layout=e("./document/Layout.js");i.Window=e("./document/Window.js");i.chroma=e("chroma-js");t.properties(i,{terminal:()=>{var t=i.guessTerminal();return i.createTerminal({stdin:n.stdin,stdout:n.stdout,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:t.isTTY,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})},realTerminal:()=>{var t=i.guessTerminal(true);var e=i.tty.getInput();var r=i.tty.getOutput();return i.createTerminal({stdin:e,stdout:r,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:true,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})}},true)}).call(this)}).call(this,e("_process"))},{"./Palette.js":1,"./Rect.js":2,"./ScreenBuffer.js":3,"./ScreenBufferHD.js":4,"./Terminal.js":5,"./TextBuffer.js":6,"./autoComplete.js":7,"./detectTerminal.js":12,"./document/AnimatedText.js":13,"./document/Bar.js":14,"./document/Button.js":16,"./document/ColumnMenu.js":17,"./document/ColumnMenuMulti.js":18,"./document/Container.js":19,"./document/Document.js":20,"./document/DropDownMenu.js":21,"./document/EditableTextBox.js":22,"./document/Element.js":23,"./document/Form.js":24,"./document/InlineInput.js":25,"./document/LabeledInput.js":26,"./document/Layout.js":27,"./document/RowMenu.js":28,"./document/SelectList.js":29,"./document/SelectListMulti.js":30,"./document/Slider.js":31,"./document/Text.js":32,"./document/TextBox.js":33,"./document/TextTable.js":34,"./document/ToggleButton.js":35,"./document/Window.js":36,"./image.js":40,"./misc.js":42,"./spChars.js":48,"./tty.js":51,"./vte/Vte.js":53,"./windows.js":56,_process:179,"chroma-js":59,lazyness:68}],50:[function(s,o,t){(function(n,r){(function(){"use strict";const t=s("path");if(n.browser||s.cache[t.join(r,"termkit-no-lazy-require.js")]){console.log("using termkit-no-lazy-require.js");o.exports=s("./termkit-no-lazy-require.js");return}const i={};o.exports=i;const e=s("lazyness")(s);i.globalConfig={};e.requireProperty(i,"tty","./tty.js");if(n.env.TERM==="linux"){i.tty.getPath()}Object.assign(i,s("./misc.js"));Object.assign(i,s("./detectTerminal.js"));i.Terminal=s("./Terminal.js");i.createTerminal=i.Terminal.create;if(n.platform==="win32"){s("./windows.js")(i)}e.requireProperties(i,{image:"./image.js",Palette:"./Palette.js",Rect:"./Rect.js",ScreenBuffer:"./ScreenBuffer.js",ScreenBufferHD:"./ScreenBufferHD.js",TextBuffer:"./TextBuffer.js",Vte:"./vte/Vte.js",autoComplete:"./autoComplete.js",spChars:"./spChars.js",Element:"./document/Element.js",Document:"./document/Document.js",Container:"./document/Container.js",Text:"./document/Text.js",AnimatedText:"./document/AnimatedText.js",Button:"./document/Button.js",ToggleButton:"./document/ToggleButton.js",TextBox:"./document/TextBox.js",EditableTextBox:"./document/EditableTextBox.js",Slider:"./document/Slider.js",Bar:"./document/Bar.js",LabeledInput:"./document/LabeledInput.js",InlineInput:"./document/InlineInput.js",Form:"./document/Form.js",RowMenu:"./document/RowMenu.js",ColumnMenu:"./document/ColumnMenu.js",ColumnMenuMulti:"./document/ColumnMenuMulti.js",SelectList:"./document/SelectList.js",SelectListMulti:"./document/SelectListMulti.js",DropDownMenu:"./document/DropDownMenu.js",TextTable:"./document/TextTable.js",Layout:"./document/Layout.js",Window:"./document/Window.js",chroma:"chroma-js"});e.properties(i,{terminal:()=>{var t=i.guessTerminal();return i.createTerminal({stdin:n.stdin,stdout:n.stdout,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:t.isTTY,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})},realTerminal:()=>{var t=i.guessTerminal(true);var e=i.tty.getInput();var r=i.tty.getOutput();return i.createTerminal({stdin:e,stdout:r,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:true,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})}},true)}).call(this)}).call(this,s("_process"),"/lib")},{"./Terminal.js":5,"./detectTerminal.js":12,"./misc.js":42,"./termkit-no-lazy-require.js":49,"./windows.js":56,_process:179,lazyness:68,path:178}],51:[function(e,r,t){(function(l){(function(){"use strict";var a=e("child_process").execSync;var i=e("fs");var n=e("tty");var t={};r.exports=t;var u;t.getPath=function t(e){var r,i,n,s,o;if(!e){e=0}if(e===0||e===l.stdin){if(u){return u}r=true}try{n=a("tty",{stdio:[e,null,null]}).toString()}catch(t){n=t.stdout.toString()}n=n.trim();o=n.match(/\/dev\/tty([0-9]*)/);s=o?o[1]||null:null;i={path:n,index:s};if(r){u=i}return i};t.getInput=function t(){var e,r;e=i.openSync("/dev/tty","r");if(!n.isatty(e)){throw new Error("Input file descriptor is not a TTY.")}r=new n.ReadStream(e);r._type="tty";return r};t.getOutput=function t(){var e,r;e=i.openSync("/dev/tty","w");if(!n.isatty(e)){throw new Error("Output file descriptor is not a TTY.")}r=new n.WriteStream(e);r._type="tty";if(r._handle&&r._handle.unref){r._handle.unref()}if(r._refreshSize){l.on("SIGWINCH",()=>{r._refreshSize()})}return r}}).call(this)}).call(this,e("_process"))},{_process:179,child_process:136,fs:136,tty:198}],52:[function(r,n,t){(function(S){(function(){"use strict";const g=r("./fromOutputSequence.js");const y=r("string-kit");const t=r("nextgen-events");const i=r("seventh");function e(t={}){}n.exports=e;e.prototype=Object.create(t.prototype);e.prototype.constructor=e;async function b(t,e=1){var r;r=t.read(e);while(r===null){await i.onceEventOrError(t,"readable",["close","end"]);r=t.read(e)}return r}function m(t){return t>=65&&t<=90||t>=97&&t<=122}function v(t){var e=t.toString(16);e=e.length>1?"\\x"+e:"\\x0"+e;return e}function w(t){if(t<=31||t===127){return v(t)}return String.fromCharCode(t)}function _(r,t){if(!t||!t.length){return r}r=Array.from(r);t.forEach((t,e)=>{if(t!==undefined&&r[e]===undefined){r[e]=t}});return r}const x=new Set("(",")","*","+","-",".","/"," ","#","%");const C=new Set("?",">","<");const k=new Set(" ","$","#",'"',"'","*");const T=new Set("?");e.prototype.streamToEvent=async function(t){var e,r,i,n,s,o,a,u,l,f,h,c,d,p=S.alloc(6);for(;;){e=(await b(t))[0];if(e<=31||e===127){r=v(e);if(e===27){e=(await b(t))[0];if(e===91){a="";while(!m(e=(await b(t))[0])){a+=String.fromCharCode(e)}o=String.fromCharCode(e);a=a?a.split(";"):[];l=true;if(a.length&&C.has(a[0][0])){o=a[0][0]+o;a[0]=a[0].slice(1)}if(a.length&&k.has(a[a.length-1][a[a.length-1]-1])){o=a[a.length-1][a[a.length-1]-1]+o;a[a.length-1]=a[a.length-1].slice(0,-1)}h=g.CSI[o];console.error(">>>>>>>>>> CSI parsing:",o,a);if(h){if(h.subTree&&a.length){d=h;for(u=0;u<a.length;u++){c=d.subTree[a[u]];if(c){if(c.subTree){d=c;continue}f=c.event||d.event||h.event;if(f!=="none"){this.emit(f,c.subType||d.subType||h.subType,c.arg!==undefined?c.arg:d.arg!==undefined?d.arg:h.arg,c.extraArgs||d.extraArgs||h.extraArgs||_(a.slice(u+1),c.defaultExtraArgs))}l=false;if(c.continue){d=h;continue}}else{l=true}break}}else if(h.event){if(h.event!=="none"){this.emit(h.event,h.subType,h.arg,h.extraArgs||_(a,h.defaultExtraArgs))}l=false}}if(l){this.emit("CSI",o,a)}continue}else if(e===93){a="";for(;;){e=(await b(t))[0];if(e===7){break}if(e===27){e=(await b(t))[0];if(e===92){break}a+=String.fromCharCode(27)}a+=String.fromCharCode(e)}a=a?a.split(";"):[];o=a.shift();if(T.has(a[a.length-1])){o+=a.pop()}l=true;h=g.OSC[o];if(h){if(h.subTree){for(u=0;u<a.length;u++){c=h.subTree[a[u]];if(c){f=c.event||h.event;if(f!=="none"){this.emit(f,c.subType||h.subType,a.slice(u+1))}l=false}else{l=true}break}}else if(h.event){if(h.event!=="none"){this.emit(h.event,h.subType,a)}l=false}}if(l){this.emit("OSC",o,a)}continue}else{o=w(e);a=null;if(x.has(o)){a=[w((await b(t))[0])]}l=true;h=g.ESC[o];if(h){if(h.event!=="none"){this.emit(h.event,h.subType,h.arg,a||h.extraArgs)}l=false}if(l){this.emit("ESC",o,a)}continue}}else if(g.control[r]){h=g.control[r];if(h.event!=="none"){this.emit(h.event,h.subType,h.arg,h.extraArgs)}continue}else{this.emit("control",r);continue}}if(e>=128){if(e<192){continue}else if(e<224){n=2}else if(e<240){n=3}else if(e<248){n=4}else if(e<252){n=5}else{n=6}p[0]=e;p[1]=p[2]=p[3]=p[4]=p[5]=0;(await b(t,n-1)).copy(p,1);i=p.toString("utf8");s=y.unicode.firstCodePoint(i);this.emit("char",i,s)}else{i=String.fromCharCode(e);this.emit("char",i,e)}}}}).call(this)}).call(this,r("buffer").Buffer)},{"./fromOutputSequence.js":54,buffer:147,"nextgen-events":72,seventh:108,"string-kit":123}],53:[function(s,t,e){"use strict";const r=s("../ScreenBuffer.js");const i=s("../Rect.js");const n=s("string-kit");const o=s("./toInputSequence.js");const a=s("./SequencesReader.js");const u=s("nextgen-events");const l=s("seventh");const f=s("child_process").spawn;const h=(...t)=>console.error("[31m",...t,"[m");const c=(...t)=>console.error(...t);function d(t={}){this.width=Math.floor(t.width)||(t.dst?t.dst.width:80);this.height=Math.floor(t.height)||(t.dst?t.dst.height:25);this.palette=t.palette||this.dst&&this.dst.palette;this.screenBuffer=new r(Object.assign({},t,this,{wrap:true}));this.screenBuffer.setClearAttr({defaultColor:true,bgDefaultColor:true});this.cx=0;this.cy=0;this.savedCx=0;this.savedCy=0;this.attr=0;this.resetAttr();this.scrollingRegion=null;this.tabWidth=8;this.mouseEvent=null;this.focusEvent=false;this.mouseIsDragging=false;this.eventInput=t.eventInput;this.childSequencesReader=new a;this.childProcess=null;this.onEventInputKey=this.onEventInputKey.bind(this);this.onEventInputMouse=this.onEventInputMouse.bind(this);this.onEventInputTerminal=this.onEventInputTerminal.bind(this);this.onChildOutputReset=this.onChildOutputReset.bind(this);this.onChildOutputChar=this.onChildOutputChar.bind(this);this.onChildOutputCursor=this.onChildOutputCursor.bind(this);this.onChildOutputEdit=this.onChildOutputEdit.bind(this);this.onChildOutputAttr=this.onChildOutputAttr.bind(this);this.onChildOutputPalette=this.onChildOutputPalette.bind(this);this.onChildOutputCursorAttr=this.onChildOutputCursorAttr.bind(this);this.onChildOutputBell=this.onChildOutputBell.bind(this);this.onChildOutputDevice=this.onChildOutputDevice.bind(this);this.onChildOutputSystem=this.onChildOutputSystem.bind(this);this.onChildOutputControl=this.onChildOutputControl.bind(this);this.onChildOutputESC=this.onChildOutputESC.bind(this);this.onChildOutputCSI=this.onChildOutputCSI.bind(this);this.onChildOutputOSC=this.onChildOutputOSC.bind(this);this.drawDebounce=l.debounce(this.drawDelay.bind(this))}t.exports=d;d.prototype=Object.create(u.prototype);d.prototype.constructor=d;d.prototype.run=function(e,r){var t,i,n=new l;if(this.childProcess){return}this.start();try{t=s("child_pty");i=t.spawn(e,r,{columns:this.width,rows:this.height})}catch(t){h("'child_pty' optional dependency not found, using regular child_process.spawn()");i=f(e,r)}this.childProcess=i;this.on("input",t=>i.stdin.write(t));this.childSequencesReader.streamToEvent(i.stdout);i.on("close",t=>{this.childProcess=null;n.resolve()});return n};d.prototype.start=function(){if(this.eventInput){this.eventInput.on("key",this.onEventInputKey);this.eventInput.on("mouse",this.onEventInputMouse);this.eventInput.on("terminal",this.onEventInputTerminal)}this.childSequencesReader.on("reset",this.onChildOutputReset);this.childSequencesReader.on("char",this.onChildOutputChar);this.childSequencesReader.on("cursor",this.onChildOutputCursor);this.childSequencesReader.on("edit",this.onChildOutputEdit);this.childSequencesReader.on("attr",this.onChildOutputAttr);this.childSequencesReader.on("palette",this.onChildOutputPalette);this.childSequencesReader.on("cursorAttr",this.onChildOutputCursorAttr);this.childSequencesReader.on("bell",this.onChildOutputBell);this.childSequencesReader.on("device",this.onChildOutputDevice);this.childSequencesReader.on("system",this.onChildOutputSystem);this.childSequencesReader.on("control",this.onChildOutputControl);this.childSequencesReader.on("ESC",this.onChildOutputESC);this.childSequencesReader.on("CSI",this.onChildOutputCSI);this.childSequencesReader.on("OSC",this.onChildOutputOSC)};d.prototype.draw=function(){var t=this.screenBuffer.draw({delta:true});this.screenBuffer.drawCursor();c("draw stats:",t)};d.prototype.redraw=function(){var t=this.screenBuffer.draw({delta:false});this.screenBuffer.drawCursor();c("redraw stats:",t)};d.prototype.drawDelay=async function(){await l.resolveNextTick();this.draw()};d.prototype.putChar=function(t){var e=t.charCodeAt(0);c("putChar:",e<=31||e===127?"(ctrl)":t,e>=16?"\\x"+e.toString(16):"\\x0"+e.toString(16),"at:",this.cx,this.cy);this.screenBuffer.put({x:this.cx,y:this.cy,attr:this.attr},t);this.cx++;if(this.cx>=this.width){this.newLine()}else{this.drawDebounce()}};d.prototype.moveCursorTo=function(t,e,r=false){if(r){if(t!==undefined){this.cx=t}if(e!==undefined){this.cy=e}}else{if(t!==undefined){this.cx=t-1}if(e!==undefined){this.cy=e-1}}if(this.cx<0){this.cx=0}else if(this.cx>=this.width-1){this.cx=this.width-1}if(this.cy<0){this.cy=0}else if(this.cy>=this.height-1){this.cy=this.height-1}this.screenBuffer.cx=this.cx;this.screenBuffer.cy=this.cy;this.screenBuffer.drawCursor()};d.prototype.moveCursor=function(t,e){this.moveCursorTo(this.cx+t,this.cy+e,true)};d.prototype.nextTab=function(){this.moveCursorTo(Math.ceil((this.cx+1)/this.tabWidth)*this.tabWidth,undefined,true)};d.prototype.vScroll=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}c("################### vScroll:",t,r,i);this.screenBuffer.vScroll(t,this.attr,r,i,true);if(!e){this.drawDebounce()}};d.prototype.lineFeed=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}this.screenBuffer.cy=++this.cy;if(t){this.screenBuffer.cx=this.cx=0}if(this.cy>i){this.screenBuffer.cy=this.cy=i;this.vScroll(-1,e);if(!e){this.screenBuffer.drawCursor()}}else if(!e){this.drawDebounce()}};d.prototype.newLine=function(t){return this.lineFeed(true,t)};d.prototype.reverseLineFeed=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}this.screenBuffer.cy=--this.cy;if(t){this.screenBuffer.cx=this.cx=0}if(this.cy<r){this.screenBuffer.cy=this.cy=r;this.vScroll(1,e);if(!e){this.screenBuffer.drawCursor()}}else if(!e){this.drawDebounce()}};d.prototype.eraseLine=function(t,e){if(t==="after"){this.screenBuffer.fill({region:{xmin:this.cx,xmax:this.width-1,ymin:this.cy,ymax:this.cy},attr:this.attr})}else if(t==="before"){this.screenBuffer.fill({region:{xmin:0,xmax:this.cx,ymin:this.cy,ymax:this.cy},attr:this.attr})}else{this.screenBuffer.fill({region:{xmin:0,xmax:this.width-1,ymin:this.cy,ymax:this.cy},attr:this.attr})}if(!e){this.drawDebounce()}};d.prototype.eraseDisplay=function(t,e){if(t==="after"){this.screenBuffer.fill({region:{xmin:this.cx,xmax:this.width-1,ymin:this.cy,ymax:this.cy},attr:this.attr});this.screenBuffer.fill({region:{xmin:0,xmax:this.width-1,ymin:this.cy+1,ymax:this.height-1},attr:this.attr})}else if(t==="before"){this.screenBuffer.fill({region:{xmin:0,xmax:this.width-1,ymin:0,ymax:this.cy-1},attr:this.attr});this.screenBuffer.fill({region:{xmin:0,xmax:this.cx,ymin:this.cy,ymax:this.cy},attr:this.attr})}else{this.screenBuffer.fill({attr:this.attr})}if(!e){this.drawDebounce()}};d.prototype.backDelete=function(t=1){if(t>this.cx){t=this.cx}if(t<=0){return}this.screenBuffer.copyRegion({xmin:this.cx,ymin:this.cy,xmax:this.width-1,ymax:this.cy},{x:this.cx-t,y:this.cy});this.cx-=t;this.screenBuffer.fill({region:{xmin:this.width-t,ymin:this.cy,xmax:this.width-1,ymax:this.cy},attr:this.attr}," ");this.screenBuffer.cx=this.cx;this.drawDebounce()};d.prototype.delete=function(t=1){if(t>this.width-this.cx){t=this.width-this.cx}if(t<=0){return}if(this.cx+t<this.width){this.screenBuffer.copyRegion({xmin:this.cx+t,ymin:this.cy,xmax:this.width-1,ymax:this.cy},{x:this.cx,y:this.cy});c("delete:",t,"copy region:",{xmin:this.cx+t,ymin:this.cy,xmax:this.width-1,ymax:this.cy},{x:this.cx,y:this.cy})}this.screenBuffer.fill({region:{xmin:this.width-t,ymin:this.cy,xmax:this.width-1,ymax:this.cy},attr:this.attr}," ");c("delete:",t,"fill region:",{xmin:this.width-t,ymin:this.cy,xmax:this.width-1,ymax:this.cy});this.drawDebounce()};d.prototype.erase=function(t=1){if(t>this.width-this.cx){t=this.width-this.cx}if(t<=0){return}this.screenBuffer.fill({region:{xmin:this.cx,ymin:this.cy,xmax:this.cx+t-1,ymax:this.cy},attr:this.attr}," ");c("erase:",t,"fill region:",{xmin:this.cx,ymin:this.cy,xmax:this.cx+t-1,ymax:this.cy});this.drawDebounce()};d.prototype.deleteLine=function(t=1){if(t>this.height-this.cy){t=this.height-this.cy}if(t<=0){return}if(this.cy+t<this.height){this.screenBuffer.copyRegion({xmin:0,ymin:this.cy+t,xmax:this.width-1,ymax:this.height-1},{x:0,y:this.cy});c("deleteLine:",t,"copy region:",{xmin:0,ymin:this.cy+t,xmax:this.width-1,ymax:this.height-1},{x:0,y:this.cy})}this.screenBuffer.fill({region:{xmin:0,ymin:this.height-t,xmax:this.width-1,ymax:this.height-1},attr:this.attr}," ");c("deleteLine:",t,"fill region:",{xmin:0,ymin:this.height-t,xmax:this.width-1,ymax:this.height-1});this.cx=this.screenBuffer.cx=0;this.drawDebounce()};d.prototype.insertLine=function(t=1){if(t>this.height-this.cy){t=this.height-this.cy}if(t<=0){return}if(this.cy+t<this.height){this.screenBuffer.copyRegion({xmin:0,ymin:this.cy,xmax:this.width-1,ymax:this.height-t},{x:0,y:this.cy+t});c("insertLine:",t,"copy region:",{xmin:0,ymin:this.cy+t,xmax:this.width-1,ymax:this.height-1},{x:0,y:this.cy})}this.screenBuffer.fill({region:{xmin:0,ymin:this.cy,xmax:this.width-1,ymax:this.cy+t},attr:this.attr}," ");c("insertLine:",t,"fill region:",{xmin:0,ymin:this.height-t,xmax:this.width-1,ymax:this.height-1});this.cx=this.screenBuffer.cx=0;this.drawDebounce()};d.prototype.resetAttr=function(){this.attr=this.screenBuffer.DEFAULT_ATTR};d.prototype.setAttr=function(t){this.attr=this.screenBuffer.object2attr(t)};d.prototype.addAttr=function(t){this.attr=this.screenBuffer.attrAndObject(this.attr,t)};d.prototype.setVScrollingRegion=function(t=null,e=null,r=false){c("########################### setVScrollingRegion:",t,e,r);if(t===null||e===null){this.scrollingRegion=null}else if(r){this.scrollingRegion=new i(0,Math.max(0,t),this.width-1,Math.min(this.height-1,e))}else{this.scrollingRegion=new i(0,Math.max(0,t-1),this.width-1,Math.min(this.height-1,e-1))}c("########################### setVScrollingRegion region:",this.scrollingRegion)};d.prototype.emitCursorLocation=function(t){this.emit("input",n.format(o.reports[t?"cursorLocationDecVariant":"cursorLocation"],this.cx,this.cy))};d.prototype.emitScreenSize=function(t){this.emit("input",n.format(o.reports.screenSize,this.width,this.height))};d.prototype.emitFocus=function(t){this.emit("input",o.reports[t?"focusIn":"focusOut"])};d.prototype.emitRegisterColor=function(t){h("emitRegisterColor",t);var e=this.screenBuffer.palette.getRgb(t);h("emitRegisterColor >>> ",e);if(!e){return}this.emit("input",n.format(o.reports.registerColor,t,e.r,e.g,e.b))};d.prototype.emitMouseSGR=function(t,e){var r=0,i=false;if(e.shift){r|=4}if(e.alt){r|=8}if(e.ctrl){r|=16}switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":break;case"MOUSE_MIDDLE_BUTTON_PRESSED":r|=1;break;case"MOUSE_RIGHT_BUTTON_PRESSED":r|=2;break;case"MOUSE_OTHER_BUTTON_PRESSED":r|=3;break;case"MOUSE_LEFT_BUTTON_RELEASED":i=true;break;case"MOUSE_MIDDLE_BUTTON_RELEASED":r|=1;i=true;break;case"MOUSE_RIGHT_BUTTON_RELEASED":r|=2;i=true;break;case"MOUSE_OTHER_BUTTON_RELEASED":r|=3;i=true;break;case"MOUSE_WHEEL_UP":r|=64;break;case"MOUSE_WHEEL_DOWN":r|=65;break;case"MOUSE_MOTION":r|=32;break}this.emit("input","[<"+r+";"+e.x+";"+e.y+(i?"m":"M"))};d.prototype.onEventInputKey=function(t,e,r){c("onEventInputKey:",t);if(r.isCharacter){this.emit("input",t)}else if(o.specialKeys[t]){this.emit("input",o.specialKeys[t])}};d.prototype.onEventInputMouse=function(t,e){if(!this.mouseEvent){return}if(this.eventInput===this.screenBuffer.dst){e.x-=this.screenBuffer.x-1;e.y-=this.screenBuffer.y-1}switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":case"MOUSE_MIDDLE_BUTTON_PRESSED":case"MOUSE_RIGHT_BUTTON_PRESSED":case"MOUSE_OTHER_BUTTON_PRESSED":this.mouseIsDragging=true;this.emitMouseSGR(t,e);break;case"MOUSE_LEFT_BUTTON_RELEASED":case"MOUSE_MIDDLE_BUTTON_RELEASED":case"MOUSE_RIGHT_BUTTON_RELEASED":case"MOUSE_OTHER_BUTTON_RELEASED":this.mouseIsDragging=false;this.emitMouseSGR(t,e);break;case"MOUSE_WHEEL_UP":case"MOUSE_WHEEL_DOWN":this.emitMouseSGR(t,e);break;case"MOUSE_MOTION":if(this.mouseEvent==="motion"||this.mouseEvent==="drag"&&this.mouseIsDragging){this.emitMouseSGR(t,e)}break}};d.prototype.onEventInputTerminal=function(t,e){switch(t){case"FOCUS_IN":if(this.focusEvent){this.emitFocus(true)}break;case"FOCUS_OUT":if(this.focusEvent){this.emitFocus(false)}break}};d.prototype.onChildOutputReset=function(){h("full reset")};d.prototype.onChildOutputChar=function(t,e){this.putChar(t)};d.prototype.onChildOutputCursor=function(t,e,r){c("cursor:",t,e,r);var i=r&&r[0]?+r[0]:undefined;var n=r&&r[1]?+r[1]:undefined;switch(t){case"lineFeed":return this.lineFeed();case"carriageReturn":return this.moveCursorTo(0,undefined,true);case"tab":return this.nextTab();case"move":this.moveCursor(i,n);break;case"up":this.moveCursor(0,-i);break;case"down":this.moveCursor(0,i);break;case"right":this.moveCursor(i,0);break;case"left":this.moveCursor(-i,0);break;case"moveToYX":this.moveCursorTo(n,i);break;case"column":this.moveCursorTo(i);break;case"row":this.moveCursorTo(undefined,i);break;case"previousLine":this.moveCursor(-this.cx,-i);break;case"nextLine":this.moveCursor(-this.cx,i);break;case"save":this.savedCx=this.cx;this.savedCy=this.cy;break;case"restore":this.moveCursorTo(this.savedCx,this.savedCy,true);break;default:h("Unknown/unsupported cursor action",t,e,r)}};d.prototype.onChildOutputEdit=function(t,e,r){var i=r&&r[0]?+r[0]:undefined;var n=r&&r[1]?+r[1]:undefined;switch(t){case"backDelete":c("backDelete",i);return this.backDelete(i);case"delete":c("delete",i);return this.delete(i);case"erase":c("erase",e);this.erase(e);break;case"deleteLine":c("deleteLine",i);this.deleteLine(i);break;case"insertLine":c("insertLine",i);this.insertLine(i);break;case"eraseLine":c("eraseLine",e);this.eraseLine(e);break;case"eraseDisplay":c("eraseDisplay",e);this.eraseDisplay(e);break;case"reverseLineFeed":c("reverseLineFeed");this.reverseLineFeed(e);break;case"vScrollingRegion":c("vScrollingRegion",i,n);this.setVScrollingRegion(i,n);break;case"vScrollUp":c("vScrollUp",i);this.vScroll(-i);break;case"vScrollDown":c("vScrollDown",i);this.vScroll(i);break;default:h("Unknown/unsupported edit action",t,e,r)}};d.prototype.onChildOutputAttr=function(t,e,r){switch(t){case"reset":c("ATTR reset");this.resetAttr();break;case"bold":c("ATTR bold:",e);this.addAttr({bold:e});break;case"dim":c("ATTR dim:",e);this.addAttr({dim:e});break;case"italic":c("ATTR italic:",e);this.addAttr({italic:e});break;case"underline":c("ATTR underline:",e);this.addAttr({underline:e});break;case"blink":c("ATTR blink:",e);this.addAttr({blink:e});break;case"inverse":c("ATTR inverse:",e);this.addAttr({inverse:e});break;case"hidden":c("ATTR hidden:",e);this.addAttr({hidden:e});break;case"strike":c("ATTR strike:",e);this.addAttr({strike:e});break;case"noDimNoBold":c("ATTR noDimNoBold");this.addAttr({bold:false,dim:false});break;case"color":c("ATTR color:",e);this.addAttr({color:e});break;case"color256":c("ATTR color256:",r);this.addAttr({color:+r[0]});break;case"colorRgb":c("ATTR colorRgb:",r,"not supported ATM");break;case"bgColor":c("ATTR bgColor:",e);this.addAttr({bgColor:e});break;case"bgColor256":c("ATTR bgColor256:",r);this.addAttr({bgColor:+r[0]});break;case"bgColorRgb":c("ATTR bgColorRgb:",r,"not supported ATM");break;default:h("Unknown/unsupported ATTR",t,e,r)}};d.prototype.onChildOutputPalette=function(t,e){h("Palette command:",t,e);var r=e&&e[0]?+e[0]:undefined;switch(t){case"getColor":if(!isNaN(r)){this.emitRegisterColor(r)}break}};d.prototype.onChildOutputCursorAttr=function(t,e){h("Cursor ATTR command:",t,e)};d.prototype.onChildOutputBell=function(){h("bell")};d.prototype.onChildOutputDevice=function(t,e,r){h("Device command:",t,e,r);switch(t){case"mouseButton":this.mouseEvent=e?"button":null;break;case"mouseDrag":this.mouseEvent=e?"drag":null;break;case"mouseMotion":this.mouseEvent=e?"motion":null;break;case"focusEvent":this.focusEvent=!!e;break;case"cursorLocation":this.emitCursorLocation(e);break;case"screenSize":this.emitScreenSize(e);break;default:h("Unknown/unsupported device command",t,e,r)}};d.prototype.onChildOutputSystem=function(t,e){h("System command:",t,e)};d.prototype.onChildOutputControl=function(t){h("control",t)};d.prototype.onChildOutputESC=function(t,e){h("ESC -- type:",t,e)};d.prototype.onChildOutputCSI=function(t,e){h("CSI -- type:",t,", args:",e)};d.prototype.onChildOutputOSC=function(t,e){h("OSC -- type:",t,", args:",e)}},{"../Rect.js":2,"../ScreenBuffer.js":3,"./SequencesReader.js":52,"./toInputSequence.js":55,child_process:136,child_pty:136,"nextgen-events":72,seventh:108,"string-kit":123}],54:[function(t,e,r){"use strict";r.control={"\\x07":{event:"bell"},"\\x08":{event:"cursor",subType:"left",extraArgs:[1]},"\\x09":{event:"cursor",subType:"tab"},"\\x0a":{event:"cursor",subType:"lineFeed"},"\\x0d":{event:"cursor",subType:"carriageReturn"},"\\x7f":{event:"none"}};r.ESC={7:{event:"cursor",subType:"save"},8:{event:"cursor",subType:"restore"},c:{event:"reset"},M:{event:"edit",subType:"reverseLineFeed"}};r.CSI={A:{event:"cursor",subType:"up",defaultExtraArgs:[1]},B:{event:"cursor",subType:"down",defaultExtraArgs:[1]},C:{event:"cursor",subType:"right",defaultExtraArgs:[1]},D:{event:"cursor",subType:"left",defaultExtraArgs:[1]},E:{event:"cursor",subType:"nextLine",defaultExtraArgs:[1]},F:{event:"cursor",subType:"previousLine",defaultExtraArgs:[1]},G:{event:"cursor",subType:"column"},H:{event:"cursor",subType:"moveToYX",defaultExtraArgs:[1,1]},J:{event:"edit",subType:"eraseDisplay",arg:"after",subTree:{0:{arg:"after"},1:{arg:"before"},2:{arg:"display"}}},K:{event:"edit",subType:"eraseLine",arg:"after",subTree:{0:{arg:"after"},1:{arg:"before"},2:{arg:"line"}}},L:{event:"edit",subType:"insertLine",defaultExtraArgs:[1]},M:{event:"edit",subType:"deleteLine",defaultExtraArgs:[1]},P:{event:"edit",subType:"delete",defaultExtraArgs:[1]},S:{event:"edit",subType:"vScrollUp",defaultExtraArgs:[1]},T:{event:"edit",subType:"vScrollDown",defaultExtraArgs:[1]},X:{event:"edit",subType:"erase",defaultExtraArgs:[1]},d:{event:"cursor",subType:"row"},"?h":{event:"device",arg:true,subTree:{1e3:{subType:"mouseButton",continue:true},1002:{subType:"mouseDrag",continue:true},1003:{subType:"mouseMotion",continue:true},1004:{subType:"focusEvent",continue:true},1006:{event:"none",continue:true}}},"?l":{event:"device",arg:false,subTree:null},n:{event:"device",subTree:{6:{subType:"cursorLocation"}}},"?n":{event:"device",subTree:{6:{subType:"cursorLocation",arg:true}}},m:{event:"attr",subType:"reset",subTree:{0:{subType:"reset",continue:true},1:{subType:"bold",arg:true,continue:true},2:{subType:"dim",arg:true,continue:true},3:{subType:"italic",arg:true,continue:true},4:{subType:"underline",arg:true,continue:true},5:{subType:"blink",arg:true,continue:true},7:{subType:"inverse",arg:true,continue:true},8:{subType:"hidden",arg:true,continue:true},9:{subType:"strike",arg:true,continue:true},21:{subType:"bold",arg:false,continue:true},22:{subType:"noDimNoBold",continue:true},23:{subType:"italic",arg:false,continue:true},24:{subType:"underline",arg:false,continue:true},25:{subType:"blink",arg:false,continue:true},27:{subType:"inverse",arg:false,continue:true},28:{subType:"hidden",arg:false,continue:true},29:{subType:"strike",arg:false,continue:true},30:{subType:"color",arg:"black",continue:true},31:{subType:"color",arg:"red",continue:true},32:{subType:"color",arg:"green",continue:true},33:{subType:"color",arg:"yellow",continue:true},34:{subType:"color",arg:"blue",continue:true},35:{subType:"color",arg:"magenta",continue:true},36:{subType:"color",arg:"cyan",continue:true},37:{subType:"color",arg:"white",continue:true},38:{subTree:{2:{subType:"colorRgb"},5:{subType:"color256"}}},39:{subType:"color",arg:"default",continue:true},40:{subType:"bgColor",arg:"black",continue:true},41:{subType:"bgColor",arg:"red",continue:true},42:{subType:"bgColor",arg:"green",continue:true},43:{subType:"bgColor",arg:"yellow",continue:true},44:{subType:"bgColor",arg:"blue",continue:true},45:{subType:"bgColor",arg:"magenta",continue:true},46:{subType:"bgColor",arg:"cyan",continue:true},47:{subType:"bgColor",arg:"white",continue:true},48:{subTree:{2:{subType:"bgColorRgb"},5:{subType:"bgColor256"}}},49:{subType:"bgColor",arg:"default",continue:true},90:{subType:"color",arg:"gray",continue:true},91:{subType:"color",arg:"brightRed",continue:true},92:{subType:"color",arg:"brightGreen",continue:true},93:{subType:"color",arg:"brightYellow",continue:true},94:{subType:"color",arg:"brightBlue",continue:true},95:{subType:"color",arg:"brightMagenta",continue:true},96:{subType:"color",arg:"brightCyan",continue:true},97:{subType:"color",arg:"brightWhite",continue:true},100:{subType:"bgColor",arg:"gray",continue:true},101:{subType:"bgColor",arg:"brightRed",continue:true},102:{subType:"bgColor",arg:"brightGreen",continue:true},103:{subType:"bgColor",arg:"brightYellow",continue:true},104:{subType:"bgColor",arg:"brightBlue",continue:true},105:{subType:"bgColor",arg:"brightMagenta",continue:true},106:{subType:"bgColor",arg:"brightCyan",continue:true},107:{subType:"bgColor",arg:"brightWhite",continue:true}}},r:{event:"edit",subType:"vScrollingRegion"},t:{event:"device",subTree:{18:{subType:"screenSize"}}}};r.CSI["?l"].subTree=r.CSI["?h"].subTree;r.OSC={0:{event:"system",subType:"setWindowTitle"},1:{event:"system",subType:"setIconName"},2:{event:"system",subType:"setWindowTitle"},4:{event:"palette",subType:"setColor"},"4?":{event:"palette",subType:"getColor"},7:{event:"system",subType:"setCwd"},9:{event:"system",subType:"notify"},10:{event:"palette",subType:"setDefaultColor"},11:{event:"palette",subType:"setDefaultBgColor"},12:{event:"cursorAttr",subType:"setColor"},17:{event:"palette",subType:"setHighlightBgColor"},50:{event:"cursorAttr",subType:"setShape"},104:{event:"palette",subType:"resetColor"},110:{event:"palette",subType:"resetDefaultColor"},111:{event:"palette",subType:"resetDefaultBgColor"},112:{event:"cursorAttr",subType:"resetColor"},117:{event:"palette",subType:"resetHighlightBgColor"},777:{event:"system",subTree:{notify:{subType:"notify"}}}}},{}],55:[function(t,e,r){"use strict";r.specialKeys={ESCAPE:"",TAB:"\t",ENTER:"\r",SHIFT_TAB:"[Z",ALT_TAB:"\t",ALT_ENTER:"\r",UP:"OA",DOWN:"OB",RIGHT:"OC",LEFT:"OD",SHIFT_UP:"[1;2A",SHIFT_DOWN:"[1;2B",SHIFT_RIGHT:"[1;2C",SHIFT_LEFT:"[1;2D",ALT_UP:"[1;3A",ALT_DOWN:"[1;3B",ALT_RIGHT:"[1;3C",ALT_LEFT:"[1;3D",CTRL_UP:"[1;5A",CTRL_DOWN:"[1;5B",CTRL_RIGHT:"[1;5C",CTRL_LEFT:"[1;5D",BACKSPACE:"",INSERT:"[2~",DELETE:"[3~",HOME:"[1~",END:"[4~",PAGE_UP:"[5~",PAGE_DOWN:"[6~",CTRL_BACKSPACE:"\b",CTRL_INSERT:"[2;5~",CTRL_DELETE:"[3;5~",CTRL_HOME:"[1;5~",CTRL_END:"[4;5~",CTRL_PAGE_UP:"[5;5~",CTRL_PAGE_DOWN:"[6;5~",SHIFT_INSERT:"[2;2~",SHIFT_DELETE:"[3;2~",SHIFT_HOME:"[1;2~",SHIFT_END:"[4;2~",SHIFT_PAGE_UP:"[5;2~",SHIFT_PAGE_DOWN:"[6;2~",ALT_BACKSPACE:"",ALT_INSERT:"[2;3~",ALT_DELETE:"[3;3~",ALT_HOME:"[1;3~",ALT_END:"[4;3~",ALT_PAGE_UP:"[5;3~",ALT_PAGE_DOWN:"[6;3~",F1:"OP",F2:"OQ",F3:"OR",F4:"OS",F5:"[15~",F6:"[17~",F7:"[18~",F8:"[19~",F9:"[20~",F10:"[21~",F11:"[23~",F12:"[24~",SHIFT_F1:"O1;2P",SHIFT_F2:"O1;2Q",SHIFT_F3:"O1;2R",SHIFT_F4:"O1;2S",SHIFT_F5:"[15;2~",SHIFT_F6:"[17;2~",SHIFT_F7:"[18;2~",SHIFT_F8:"[19;2~",SHIFT_F9:"[20;2~",SHIFT_F10:"[21;2~",SHIFT_F11:"[23;2~",SHIFT_F12:"[24;2~",CTRL_F1:"O1;5P",CTRL_F2:"O1;5Q",CTRL_F3:"O1;5R",CTRL_F4:"O1;5S",CTRL_F5:"[15;5~",CTRL_F6:"[17;5~",CTRL_F7:"[18;5~",CTRL_F8:"[19;5~",CTRL_F9:"[20;5~",CTRL_F10:"[21;5~",CTRL_F11:"[23;5~",CTRL_F12:"[24;5~",CTRL_SHIFT_F1:"O1;6P",CTRL_SHIFT_F2:"O1;6Q",CTRL_SHIFT_F3:"O1;6R",CTRL_SHIFT_F4:"O1;6S",CTRL_SHIFT_F5:"[15;6~",CTRL_SHIFT_F6:"[17;6~",CTRL_SHIFT_F7:"[18;6~",CTRL_SHIFT_F8:"[19;6~",CTRL_SHIFT_F9:"[20;6~",CTRL_SHIFT_F10:"[21;6~",CTRL_SHIFT_F11:"[23;6~",CTRL_SHIFT_F12:"[24;6~",NUL:"\0",ALT_SPACE:" ",CTRL_ALT_SPACE:"\0"};for(let t=1;t<=26;t++){r.specialKeys["CTRL_"+String.fromCharCode(64+t)]=String.fromCharCode(t);r.specialKeys["ALT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(96+t);r.specialKeys["CTRL_ALT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(t);r.specialKeys["ALT_SHIFT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(64+t)}r.reports={cursorLocation:"[%+1u;%-1uR",cursorLocationDecVariant:"[?%+1u;%-1uR",screenSize:"[8;%+1u;%-1ut",focusIn:"[I",focusOut:"[O",registerColor:"]4;%u;rgb:%x/%x/%x"}},{}],56:[function(t,e,r){"use strict";e.exports=function(t){t.globalConfig.preferProcessSigwinch=true}},{}],57:[function(t,e,r){"use strict";var s=t("seventh");e.exports=function t(e,r){if(typeof e==="function"){r=e;e=undefined}if(!e||typeof e!=="object"){e={yes:["y","Y"],no:["n","N"],echoYes:"yes",echoNo:"no"}}if(typeof e.yes==="string"){e.yes=[e.yes]}if(!Array.isArray(e.yes)){e.yes=["y","Y"]}if(typeof e.no==="string"){e.no=[e.no]}if(!Array.isArray(e.no)){e.no=["n","N"]}if(!this.grabbing){this.grabInput()}var i=t=>{if(e.yes.indexOf(t)!==-1){if(e.echoYes){this(e.echoYes)}this.removeListener("key",i);if(r){r(undefined,true)}else{n.promise.resolve(true)}}else if(e.no.indexOf(t)!==-1){if(e.echoNo){this(e.echoNo)}this.removeListener("key",i);if(r){r(undefined,false)}else{n.promise.resolve(false)}}};this.on("key",i);var n={};n.abort=()=>{this.removeListener("key",i)};n.promise=new s;return n}},{seventh:108}],58:[function(t,r,e){(function(g){(function(){"use strict";var a=t("ndarray");var i=t("pngjs").PNG;var s=t("jpeg-js");var u=t("ndarray-pack");var l=t("omggif").GifReader;var f=t("node-bitmap");var e=t("fs");var o=t("path").extname;function n(t,r){var e=new i;e.parse(t,function(t,e){if(t){r(t);return}r(null,a(new Uint8Array(e.data),[e.width|0,e.height|0,4],[4,4*e.width|0,1],0))})}function h(t,e){var r;try{r=s.decode(t)}catch(t){e(t);return}if(!r){e(new Error("Error decoding jpeg"));return}var i=[r.height,r.width,4];var n=a(r.data,i);e(null,n.transpose(1,0))}function c(t,e){var r,i,n,s;try{r=new l(t)}catch(t){e(t);return}if(r.numFrames()>0){i=[r.numFrames(),r.height,r.width,4];n=new Uint8Array(i[0]*i[1]*i[2]*i[3]);s=a(n,i);try{for(var o=0;o<r.numFrames();++o){r.decodeAndBlitFrameRGBA(o,n.subarray(s.index(o,0,0,0),s.index(o+1,0,0,0)))}}catch(t){e(t);return}e(null,s.transpose(0,2,1))}else{i=[r.height,r.width,4];n=new Uint8Array(i[0]*i[1]*i[2]);s=a(n,i);try{r.decodeAndBlitFrameRGBA(0,n)}catch(t){e(t);return}e(null,s.transpose(1,0))}}function d(t,e){var r=new f(t);try{r.init()}catch(t){e(t);return}var i=r.getData();var n=[i.getHeight(),i.getWidth(),4];var s=new Uint8Array(n[0]*n[1]*n[2]);var o=a(s,n);u(i,o);e(null,o.transpose(1,0))}function p(t,e,r){switch(t){case"png":n(e,r);break;case"jpg":case"jpeg":h(e,r);break;case"gif":c(e,r);break;case"bmp":d(e,r);break;default:r(new Error("Unsupported file type: "+t))}}r.exports=function t(r,i,n){if(!n){n=i;i=""}if(g.isBuffer(r)){if(!i){n(new Error("Invalid file type"));return}p(i,r,n)}else{e.readFile(r,function(t,e){if(t){n(t);return}i=i||o(r).toLowerCase().substr(1);if(!i){n(new Error("Invalid file type"));return}p(i,e,n)})}}}).call(this)}).call(this,{isBuffer:t("../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js")})},{"../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js":162,fs:136,"jpeg-js":65,ndarray:71,"ndarray-pack":69,"node-bitmap":75,omggif:77,path:178,pngjs:97}],59:[function(t,r,i){(function(t,e){typeof i==="object"&&typeof r!=="undefined"?r.exports=e():typeof n==="function"&&n.amd?n(e):t.chroma=e()})(this,function(){"use strict";var r=function(t,e,r){if(e===void 0)e=0;if(r===void 0)r=1;return t<e?e:t>r?r:t};var t=function(t){t._clipped=false;t._unclipped=t.slice(0);for(var e=0;e<=3;e++){if(e<3){if(t[e]<0||t[e]>255){t._clipped=true}t[e]=r(t[e],0,255)}else if(e===3){t[e]=r(t[e],0,1)}}return t};var e={};for(var i=0,n=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];i<n.length;i+=1){var s=n[i];e["[object "+s+"]"]=s.toLowerCase()}var U=function(t){return e[Object.prototype.toString.call(t)]||"object"};var o=function(e,t){if(t===void 0)t=null;if(e.length>=3){return Array.prototype.slice.call(e)}if(U(e[0])=="object"&&t){return t.split("").filter(function(t){return e[0][t]!==undefined}).map(function(t){return e[0][t]})}return e[0]};var a=function(t){if(t.length<2){return null}var e=t.length-1;if(U(t[e])=="string"){return t[e].toLowerCase()}return null};var u=Math.PI;var l={clip_rgb:t,limit:r,type:U,unpack:o,last:a,PI:u,TWOPI:u*2,PITHIRD:u/3,DEG2RAD:u/180,RAD2DEG:180/u};var p={format:{},autodetect:[]};var f=l.last;var h=l.clip_rgb;var c=l.type;var d=function t(){var e=[],r=arguments.length;while(r--)e[r]=arguments[r];var i=this;if(c(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor){return e[0]}var n=f(e);var s=false;if(!n){s=true;if(!p.sorted){p.autodetect=p.autodetect.sort(function(t,e){return e.p-t.p});p.sorted=true}for(var o=0,a=p.autodetect;o<a.length;o+=1){var u=a[o];n=u.test.apply(u,e);if(n){break}}}if(p.format[n]){var l=p.format[n].apply(null,s?e:e.slice(0,-1));i._rgb=h(l)}else{throw new Error("unknown format: "+e)}if(i._rgb.length===3){i._rgb.push(1)}};d.prototype.toString=function t(){if(c(this.hex)=="function"){return this.hex()}return"["+this._rgb.join(",")+"]"};var R=d;var g=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(g.Color,[null].concat(t)))};g.Color=R;g.version="2.1.2";var S=g;var y=l.unpack;var b=Math.max;var m=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=y(t,"rgb");var i=r[0];var n=r[1];var s=r[2];i=i/255;n=n/255;s=s/255;var o=1-b(i,b(n,s));var a=o<1?1/(1-o):0;var u=(1-i-o)*a;var l=(1-n-o)*a;var f=(1-s-o)*a;return[u,l,f,o]};var v=m;var w=l.unpack;var _=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=w(t,"cmyk");var r=t[0];var i=t[1];var n=t[2];var s=t[3];var o=t.length>4?t[4]:1;if(s===1){return[0,0,0,o]}return[r>=1?0:255*(1-r)*(1-s),i>=1?0:255*(1-i)*(1-s),n>=1?0:255*(1-n)*(1-s),o]};var x=_;var C=l.unpack;var k=l.type;R.prototype.cmyk=function(){return v(this._rgb)};S.cmyk=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["cmyk"])))};p.format.cmyk=x;p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=C(t,"cmyk");if(k(t)==="array"&&t.length===4){return"cmyk"}}});var T=l.unpack;var E=l.last;var A=function(t){return Math.round(t*100)/100};var B=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=T(t,"hsla");var i=E(t)||"lsa";r[0]=A(r[0]||0);r[1]=A(r[1]*100)+"%";r[2]=A(r[2]*100)+"%";if(i==="hsla"||r.length>3&&r[3]<1){r[3]=r.length>3?r[3]:1;i="hsla"}else{r.length=3}return i+"("+r.join(",")+")"};var O=B;var P=l.unpack;var I=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=P(t,"rgba");var r=t[0];var i=t[1];var n=t[2];r/=255;i/=255;n/=255;var s=Math.min(r,i,n);var o=Math.max(r,i,n);var a=(o+s)/2;var u,l;if(o===s){u=0;l=Number.NaN}else{u=a<.5?(o-s)/(o+s):(o-s)/(2-o-s)}if(r==o){l=(i-n)/(o-s)}else if(i==o){l=2+(n-r)/(o-s)}else if(n==o){l=4+(r-i)/(o-s)}l*=60;if(l<0){l+=360}if(t.length>3&&t[3]!==undefined){return[l,u,a,t[3]]}return[l,u,a]};var M=I;var j=l.unpack;var L=l.last;var D=Math.round;var F=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=j(t,"rgba");var i=L(t)||"rgb";if(i.substr(0,3)=="hsl"){return O(M(r),i)}r[0]=D(r[0]);r[1]=D(r[1]);r[2]=D(r[2]);if(i==="rgba"||r.length>3&&r[3]<1){r[3]=r.length>3?r[3]:1;i="rgba"}return i+"("+r.slice(0,i==="rgb"?3:4).join(",")+")"};var W=F;var H=l.unpack;var N=Math.round;var z=function(){var t;var e=[],r=arguments.length;while(r--)e[r]=arguments[r];e=H(e,"hsl");var i=e[0];var n=e[1];var s=e[2];var o,a,u;if(n===0){o=a=u=s*255}else{var l=[0,0,0];var f=[0,0,0];var h=s<.5?s*(1+n):s+n-s*n;var c=2*s-h;var d=i/360;l[0]=d+1/3;l[1]=d;l[2]=d-1/3;for(var p=0;p<3;p++){if(l[p]<0){l[p]+=1}if(l[p]>1){l[p]-=1}if(6*l[p]<1){f[p]=c+(h-c)*6*l[p]}else if(2*l[p]<1){f[p]=h}else if(3*l[p]<2){f[p]=c+(h-c)*(2/3-l[p])*6}else{f[p]=c}}t=[N(f[0]*255),N(f[1]*255),N(f[2]*255)],o=t[0],a=t[1],u=t[2]}if(e.length>3){return[o,a,u,e[3]]}return[o,a,u,1]};var Y=z;var V=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/;var G=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/;var Z=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;var K=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;var X=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;var q=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;var J=Math.round;var $=function(t){t=t.toLowerCase().trim();var e;if(p.format.named){try{return p.format.named(t)}catch(t){}}if(e=t.match(V)){var r=e.slice(1,4);for(var i=0;i<3;i++){r[i]=+r[i]}r[3]=1;return r}if(e=t.match(G)){var n=e.slice(1,5);for(var s=0;s<4;s++){n[s]=+n[s]}return n}if(e=t.match(Z)){var o=e.slice(1,4);for(var a=0;a<3;a++){o[a]=J(o[a]*2.55)}o[3]=1;return o}if(e=t.match(K)){var u=e.slice(1,5);for(var l=0;l<3;l++){u[l]=J(u[l]*2.55)}u[3]=+u[3];return u}if(e=t.match(X)){var f=e.slice(1,4);f[1]*=.01;f[2]*=.01;var h=Y(f);h[3]=1;return h}if(e=t.match(q)){var c=e.slice(1,4);c[1]*=.01;c[2]*=.01;var d=Y(c);d[3]=+e[4];return d}};$.test=function(t){return V.test(t)||G.test(t)||Z.test(t)||K.test(t)||X.test(t)||q.test(t)};var Q=$;var tt=l.type;R.prototype.css=function(t){return W(this._rgb,t)};S.css=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["css"])))};p.format.css=Q;p.autodetect.push({p:5,test:function(t){var e=[],r=arguments.length-1;while(r-- >0)e[r]=arguments[r+1];if(!e.length&&tt(t)==="string"&&Q.test(t)){return"css"}}});var et=l.unpack;p.format.gl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=et(t,"rgba");r[0]*=255;r[1]*=255;r[2]*=255;return r};S.gl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["gl"])))};R.prototype.gl=function(){var t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};var rt=l.unpack;var it=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=rt(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=Math.min(i,n,s);var a=Math.max(i,n,s);var u=a-o;var l=u*100/255;var f=o/(255-u)*100;var h;if(u===0){h=Number.NaN}else{if(i===a){h=(n-s)/u}if(n===a){h=2+(s-i)/u}if(s===a){h=4+(i-n)/u}h*=60;if(h<0){h+=360}}return[h,l,f]};var nt=it;var st=l.unpack;var ot=Math.floor;var at=function(){var t,e,r,i,n,s;var o=[],a=arguments.length;while(a--)o[a]=arguments[a];o=st(o,"hcg");var u=o[0];var l=o[1];var f=o[2];var h,c,d;f=f*255;var p=l*255;if(l===0){h=c=d=f}else{if(u===360){u=0}if(u>360){u-=360}if(u<0){u+=360}u/=60;var g=ot(u);var y=u-g;var b=f*(1-l);var m=b+p*(1-y);var v=b+p*y;var w=b+p;switch(g){case 0:t=[w,v,b],h=t[0],c=t[1],d=t[2];break;case 1:e=[m,w,b],h=e[0],c=e[1],d=e[2];break;case 2:r=[b,w,v],h=r[0],c=r[1],d=r[2];break;case 3:i=[b,m,w],h=i[0],c=i[1],d=i[2];break;case 4:n=[v,b,w],h=n[0],c=n[1],d=n[2];break;case 5:s=[w,b,m],h=s[0],c=s[1],d=s[2];break}}return[h,c,d,o.length>3?o[3]:1]};var ut=at;var lt=l.unpack;var ft=l.type;R.prototype.hcg=function(){return nt(this._rgb)};S.hcg=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hcg"])))};p.format.hcg=ut;p.autodetect.push({p:1,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=lt(t,"hcg");if(ft(t)==="array"&&t.length===3){return"hcg"}}});var ht=l.unpack;var ct=l.last;var dt=Math.round;var pt=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=ht(t,"rgba");var i=r[0];var n=r[1];var s=r[2];var o=r[3];var a=ct(t)||"auto";if(o===undefined){o=1}if(a==="auto"){a=o<1?"rgba":"rgb"}i=dt(i);n=dt(n);s=dt(s);var u=i<<16|n<<8|s;var l="000000"+u.toString(16);l=l.substr(l.length-6);var f="0"+dt(o*255).toString(16);f=f.substr(f.length-2);switch(a.toLowerCase()){case"rgba":return"#"+l+f;case"argb":return"#"+f+l;default:return"#"+l}};var gt=pt;var yt=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;var bt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;var mt=function(t){if(t.match(yt)){if(t.length===4||t.length===7){t=t.substr(1)}if(t.length===3){t=t.split("");t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}var e=parseInt(t,16);var r=e>>16;var i=e>>8&255;var n=e&255;return[r,i,n,1]}if(t.match(bt)){if(t.length===5||t.length===9){t=t.substr(1)}if(t.length===4){t=t.split("");t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]}var s=parseInt(t,16);var o=s>>24&255;var a=s>>16&255;var u=s>>8&255;var l=Math.round((s&255)/255*100)/100;return[o,a,u,l]}throw new Error("unknown hex color: "+t)};var vt=mt;var wt=l.type;R.prototype.hex=function(t){return gt(this._rgb,t)};S.hex=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hex"])))};p.format.hex=vt;p.autodetect.push({p:4,test:function(t){var e=[],r=arguments.length-1;while(r-- >0)e[r]=arguments[r+1];if(!e.length&&wt(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0){return"hex"}}});var _t=l.unpack;var xt=l.TWOPI;var Ct=Math.min;var kt=Math.sqrt;var Tt=Math.acos;var St=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=_t(t,"rgb");var i=r[0];var n=r[1];var s=r[2];i/=255;n/=255;s/=255;var o;var a=Ct(i,n,s);var u=(i+n+s)/3;var l=u>0?1-a/u:0;if(l===0){o=NaN}else{o=(i-n+(i-s))/2;o/=kt((i-n)*(i-n)+(i-s)*(n-s));o=Tt(o);if(s>n){o=xt-o}o/=xt}return[o*360,l,u]};var Et=St;var At=l.unpack;var Rt=l.limit;var Bt=l.TWOPI;var Ot=l.PITHIRD;var Pt=Math.cos;var It=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=At(t,"hsi");var r=t[0];var i=t[1];var n=t[2];var s,o,a;if(isNaN(r)){r=0}if(isNaN(i)){i=0}if(r>360){r-=360}if(r<0){r+=360}r/=360;if(r<1/3){a=(1-i)/3;s=(1+i*Pt(Bt*r)/Pt(Ot-Bt*r))/3;o=1-(a+s)}else if(r<2/3){r-=1/3;s=(1-i)/3;o=(1+i*Pt(Bt*r)/Pt(Ot-Bt*r))/3;a=1-(s+o)}else{r-=2/3;o=(1-i)/3;a=(1+i*Pt(Bt*r)/Pt(Ot-Bt*r))/3;s=1-(o+a)}s=Rt(n*s*3);o=Rt(n*o*3);a=Rt(n*a*3);return[s*255,o*255,a*255,t.length>3?t[3]:1]};var Mt=It;var jt=l.unpack;var Lt=l.type;R.prototype.hsi=function(){return Et(this._rgb)};S.hsi=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hsi"])))};p.format.hsi=Mt;p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=jt(t,"hsi");if(Lt(t)==="array"&&t.length===3){return"hsi"}}});var Dt=l.unpack;var Ft=l.type;R.prototype.hsl=function(){return M(this._rgb)};S.hsl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hsl"])))};p.format.hsl=Y;p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Dt(t,"hsl");if(Ft(t)==="array"&&t.length===3){return"hsl"}}});var Wt=l.unpack;var Ht=Math.min;var Nt=Math.max;var Ut=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Wt(t,"rgb");var r=t[0];var i=t[1];var n=t[2];var s=Ht(r,i,n);var o=Nt(r,i,n);var a=o-s;var u,l,f;f=o/255;if(o===0){u=Number.NaN;l=0}else{l=a/o;if(r===o){u=(i-n)/a}if(i===o){u=2+(n-r)/a}if(n===o){u=4+(r-i)/a}u*=60;if(u<0){u+=360}}return[u,l,f]};var zt=Ut;var Yt=l.unpack;var Vt=Math.floor;var Gt=function(){var t,e,r,i,n,s;var o=[],a=arguments.length;while(a--)o[a]=arguments[a];o=Yt(o,"hsv");var u=o[0];var l=o[1];var f=o[2];var h,c,d;f*=255;if(l===0){h=c=d=f}else{if(u===360){u=0}if(u>360){u-=360}if(u<0){u+=360}u/=60;var p=Vt(u);var g=u-p;var y=f*(1-l);var b=f*(1-l*g);var m=f*(1-l*(1-g));switch(p){case 0:t=[f,m,y],h=t[0],c=t[1],d=t[2];break;case 1:e=[b,f,y],h=e[0],c=e[1],d=e[2];break;case 2:r=[y,f,m],h=r[0],c=r[1],d=r[2];break;case 3:i=[y,b,f],h=i[0],c=i[1],d=i[2];break;case 4:n=[m,y,f],h=n[0],c=n[1],d=n[2];break;case 5:s=[f,y,b],h=s[0],c=s[1],d=s[2];break}}return[h,c,d,o.length>3?o[3]:1]};var Zt=Gt;var Kt=l.unpack;var Xt=l.type;R.prototype.hsv=function(){return zt(this._rgb)};S.hsv=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hsv"])))};p.format.hsv=Zt;p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Kt(t,"hsv");if(Xt(t)==="array"&&t.length===3){return"hsv"}}});var qt={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452};var Jt=l.unpack;var $t=Math.pow;var Qt=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Jt(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=re(i,n,s);var a=o[0];var u=o[1];var l=o[2];var f=116*u-16;return[f<0?0:f,500*(a-u),200*(u-l)]};var te=function(t){if((t/=255)<=.04045){return t/12.92}return $t((t+.055)/1.055,2.4)};var ee=function(t){if(t>qt.t3){return $t(t,1/3)}return t/qt.t2+qt.t0};var re=function(t,e,r){t=te(t);e=te(e);r=te(r);var i=ee((.4124564*t+.3575761*e+.1804375*r)/qt.Xn);var n=ee((.2126729*t+.7151522*e+.072175*r)/qt.Yn);var s=ee((.0193339*t+.119192*e+.9503041*r)/qt.Zn);return[i,n,s]};var ie=Qt;var ne=l.unpack;var se=Math.pow;var oe=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=ne(t,"lab");var r=t[0];var i=t[1];var n=t[2];var s,o,a,u,l,f;o=(r+16)/116;s=isNaN(i)?o:o+i/500;a=isNaN(n)?o:o-n/200;o=qt.Yn*ue(o);s=qt.Xn*ue(s);a=qt.Zn*ue(a);u=ae(3.2404542*s-1.5371385*o-.4985314*a);l=ae(-.969266*s+1.8760108*o+.041556*a);f=ae(.0556434*s-.2040259*o+1.0572252*a);return[u,l,f,t.length>3?t[3]:1]};var ae=function(t){return 255*(t<=.00304?12.92*t:1.055*se(t,1/2.4)-.055)};var ue=function(t){return t>qt.t1?t*t*t:qt.t2*(t-qt.t0)};var le=oe;var fe=l.unpack;var he=l.type;R.prototype.lab=function(){return ie(this._rgb)};S.lab=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["lab"])))};p.format.lab=le;p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=fe(t,"lab");if(he(t)==="array"&&t.length===3){return"lab"}}});var ce=l.unpack;var de=l.RAD2DEG;var pe=Math.sqrt;var ge=Math.atan2;var ye=Math.round;var be=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=ce(t,"lab");var i=r[0];var n=r[1];var s=r[2];var o=pe(n*n+s*s);var a=(ge(s,n)*de+360)%360;if(ye(o*1e4)===0){a=Number.NaN}return[i,o,a]};var me=be;var ve=l.unpack;var we=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=ve(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=ie(i,n,s);var a=o[0];var u=o[1];var l=o[2];return me(a,u,l)};var _e=we;var xe=l.unpack;var Ce=l.DEG2RAD;var ke=Math.sin;var Te=Math.cos;var Se=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=xe(t,"lch");var i=r[0];var n=r[1];var s=r[2];if(isNaN(s)){s=0}s=s*Ce;return[i,Te(s)*n,ke(s)*n]};var Ee=Se;var Ae=l.unpack;var Re=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Ae(t,"lch");var r=t[0];var i=t[1];var n=t[2];var s=Ee(r,i,n);var o=s[0];var a=s[1];var u=s[2];var l=le(o,a,u);var f=l[0];var h=l[1];var c=l[2];return[f,h,c,t.length>3?t[3]:1]};var Be=Re;var Oe=l.unpack;var Pe=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Oe(t,"hcl").reverse();return Be.apply(void 0,r)};var Ie=Pe;var Me=l.unpack;var je=l.type;R.prototype.lch=function(){return _e(this._rgb)};R.prototype.hcl=function(){return _e(this._rgb).reverse()};S.lch=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["lch"])))};S.hcl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hcl"])))};p.format.lch=Be;p.format.hcl=Ie;["lch","hcl"].forEach(function(r){return p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Me(t,r);if(je(t)==="array"&&t.length===3){return r}}})});var Le={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var De=Le;var Fe=l.type;R.prototype.name=function(){var t=gt(this._rgb,"rgb");for(var e=0,r=Object.keys(De);e<r.length;e+=1){var i=r[e];if(De[i]===t){return i.toLowerCase()}}return t};p.format.named=function(t){t=t.toLowerCase();if(De[t]){return vt(De[t])}throw new Error("unknown color name: "+t)};p.autodetect.push({p:5,test:function(t){var e=[],r=arguments.length-1;while(r-- >0)e[r]=arguments[r+1];if(!e.length&&Fe(t)==="string"&&De[t.toLowerCase()]){return"named"}}});var We=l.unpack;var He=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=We(t,"rgb");var i=r[0];var n=r[1];var s=r[2];return(i<<16)+(n<<8)+s};var Ne=He;var Ue=l.type;var ze=function(t){if(Ue(t)=="number"&&t>=0&&t<=16777215){var e=t>>16;var r=t>>8&255;var i=t&255;return[e,r,i,1]}throw new Error("unknown num color: "+t)};var Ye=ze;var Ve=l.type;R.prototype.num=function(){return Ne(this._rgb)};S.num=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["num"])))};p.format.num=Ye;p.autodetect.push({p:5,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];if(t.length===1&&Ve(t[0])==="number"&&t[0]>=0&&t[0]<=16777215){return"num"}}});var Ge=l.unpack;var Ze=l.type;var Ke=Math.round;R.prototype.rgb=function(t){if(t===void 0)t=true;if(t===false){return this._rgb.slice(0,3)}return this._rgb.slice(0,3).map(Ke)};R.prototype.rgba=function(r){if(r===void 0)r=true;return this._rgb.slice(0,4).map(function(t,e){return e<3?r===false?t:Ke(t):t})};S.rgb=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["rgb"])))};p.format.rgb=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Ge(t,"rgba");if(r[3]===undefined){r[3]=1}return r};p.autodetect.push({p:3,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Ge(t,"rgba");if(Ze(t)==="array"&&(t.length===3||t.length===4&&Ze(t[3])=="number"&&t[3]>=0&&t[3]<=1)){return"rgb"}}});var Xe=Math.log;var qe=function(t){var e=t/100;var r,i,n;if(e<66){r=255;i=-155.25485562709179-.44596950469579133*(i=e-2)+104.49216199393888*Xe(i);n=e<20?0:-254.76935184120902+.8274096064007395*(n=e-10)+115.67994401066147*Xe(n)}else{r=351.97690566805693+.114206453784165*(r=e-55)-40.25366309332127*Xe(r);i=325.4494125711974+.07943456536662342*(i=e-50)-28.0852963507957*Xe(i);n=255}return[r,i,n,1]};var Je=qe;var $e=l.unpack;var Qe=Math.round;var tr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=$e(t,"rgb");var i=r[0],n=r[2];var s=1e3;var o=4e4;var a=.4;var u;while(o-s>a){u=(o+s)*.5;var l=Je(u);if(l[2]/l[0]>=n/i){o=u}else{s=u}}return Qe(u)};var er=tr;R.prototype.temp=R.prototype.kelvin=R.prototype.temperature=function(){return er(this._rgb)};S.temp=S.kelvin=S.temperature=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["temp"])))};p.format.temp=p.format.kelvin=p.format.temperature=Je;var rr=l.type;R.prototype.alpha=function(t,e){if(e===void 0)e=false;if(t!==undefined&&rr(t)==="number"){if(e){this._rgb[3]=t;return this}return new R([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb")}return this._rgb[3]};R.prototype.clipped=function(){return this._rgb._clipped||false};R.prototype.darken=function(t){if(t===void 0)t=1;var e=this;var r=e.lab();r[0]-=qt.Kn*t;return new R(r,"lab").alpha(e.alpha(),true)};R.prototype.brighten=function(t){if(t===void 0)t=1;return this.darken(-t)};R.prototype.darker=R.prototype.darken;R.prototype.brighter=R.prototype.brighten;R.prototype.get=function(t){var e=t.split(".");var r=e[0];var i=e[1];var n=this[r]();if(i){var s=r.indexOf(i);if(s>-1){return n[s]}throw new Error("unknown channel "+i+" in mode "+r)}else{return n}};var ir=l.type;var nr=Math.pow;var sr=1e-7;var or=20;R.prototype.luminance=function(n){if(n!==undefined&&ir(n)==="number"){if(n===0){return new R([0,0,0,this._rgb[3]],"rgb")}if(n===1){return new R([255,255,255,this._rgb[3]],"rgb")}var t=this.luminance();var s="rgb";var o=or;var a=function(t,e){var r=t.interpolate(e,.5,s);var i=r.luminance();if(Math.abs(n-i)<sr||!o--){return r}return i>n?a(t,r):a(r,e)};var e=(t>n?a(new R([0,0,0]),this):a(this,new R([255,255,255]))).rgb();return new R(e.concat([this._rgb[3]]))}return ar.apply(void 0,this._rgb.slice(0,3))};var ar=function(t,e,r){t=ur(t);e=ur(e);r=ur(r);return.2126*t+.7152*e+.0722*r};var ur=function(t){t/=255;return t<=.03928?t/12.92:nr((t+.055)/1.055,2.4)};var lr={};var fr=l.type;var hr=function(t,e,r){if(r===void 0)r=.5;var i=[],n=arguments.length-3;while(n-- >0)i[n]=arguments[n+3];var s=i[0]||"lrgb";if(!lr[s]&&!i.length){s=Object.keys(lr)[0]}if(!lr[s]){throw new Error("interpolation mode "+s+" is not defined")}if(fr(t)!=="object"){t=new R(t)}if(fr(e)!=="object"){e=new R(e)}return lr[s](t,e,r).alpha(t.alpha()+r*(e.alpha()-t.alpha()))};R.prototype.mix=R.prototype.interpolate=function(t,e){if(e===void 0)e=.5;var r=[],i=arguments.length-2;while(i-- >0)r[i]=arguments[i+2];return hr.apply(void 0,[this,t,e].concat(r))};R.prototype.premultiply=function(t){if(t===void 0)t=false;var e=this._rgb;var r=e[3];if(t){this._rgb=[e[0]*r,e[1]*r,e[2]*r,r];return this}else{return new R([e[0]*r,e[1]*r,e[2]*r,r],"rgb")}};R.prototype.saturate=function(t){if(t===void 0)t=1;var e=this;var r=e.lch();r[1]+=qt.Kn*t;if(r[1]<0){r[1]=0}return new R(r,"lch").alpha(e.alpha(),true)};R.prototype.desaturate=function(t){if(t===void 0)t=1;return this.saturate(-t)};var cr=l.type;R.prototype.set=function(t,e,r){if(r===void 0)r=false;var i=t.split(".");var n=i[0];var s=i[1];var o=this[n]();if(s){var a=n.indexOf(s);if(a>-1){if(cr(e)=="string"){switch(e.charAt(0)){case"+":o[a]+=+e;break;case"-":o[a]+=+e;break;case"*":o[a]*=+e.substr(1);break;case"/":o[a]/=+e.substr(1);break;default:o[a]=+e}}else if(cr(e)==="number"){o[a]=e}else{throw new Error("unsupported value for Color.set")}var u=new R(o,n);if(r){this._rgb=u._rgb;return this}return u}throw new Error("unknown channel "+s+" in mode "+n)}else{return o}};var dr=function(t,e,r){var i=t._rgb;var n=e._rgb;return new R(i[0]+r*(n[0]-i[0]),i[1]+r*(n[1]-i[1]),i[2]+r*(n[2]-i[2]),"rgb")};lr.rgb=dr;var pr=Math.sqrt;var gr=Math.pow;var yr=function(t,e,r){var i=t._rgb;var n=i[0];var s=i[1];var o=i[2];var a=e._rgb;var u=a[0];var l=a[1];var f=a[2];return new R(pr(gr(n,2)*(1-r)+gr(u,2)*r),pr(gr(s,2)*(1-r)+gr(l,2)*r),pr(gr(o,2)*(1-r)+gr(f,2)*r),"rgb")};lr.lrgb=yr;var br=function(t,e,r){var i=t.lab();var n=e.lab();return new R(i[0]+r*(n[0]-i[0]),i[1]+r*(n[1]-i[1]),i[2]+r*(n[2]-i[2]),"lab")};lr.lab=br;var mr=function(t,e,r,i){var n,s;var o,a;if(i==="hsl"){o=t.hsl();a=e.hsl()}else if(i==="hsv"){o=t.hsv();a=e.hsv()}else if(i==="hcg"){o=t.hcg();a=e.hcg()}else if(i==="hsi"){o=t.hsi();a=e.hsi()}else if(i==="lch"||i==="hcl"){i="hcl";o=t.hcl();a=e.hcl()}var u,l,f,h,c,d;if(i.substr(0,1)==="h"){n=o,u=n[0],f=n[1],c=n[2];s=a,l=s[0],h=s[1],d=s[2]}var p,g,y,b;if(!isNaN(u)&&!isNaN(l)){if(l>u&&l-u>180){b=l-(u+360)}else if(l<u&&u-l>180){b=l+360-u}else{b=l-u}g=u+r*b}else if(!isNaN(u)){g=u;if((d==1||d==0)&&i!="hsv"){p=f}}else if(!isNaN(l)){g=l;if((c==1||c==0)&&i!="hsv"){p=h}}else{g=Number.NaN}if(p===undefined){p=f+r*(h-f)}y=c+r*(d-c);return new R([g,p,y],i)};var vr=function(t,e,r){return mr(t,e,r,"lch")};lr.lch=vr;lr.hcl=vr;var wr=function(t,e,r){var i=t.num();var n=e.num();return new R(i+r*(n-i),"num")};lr.num=wr;var _r=function(t,e,r){return mr(t,e,r,"hcg")};lr.hcg=_r;var xr=function(t,e,r){return mr(t,e,r,"hsi")};lr.hsi=xr;var Cr=function(t,e,r){return mr(t,e,r,"hsl")};lr.hsl=Cr;var kr=function(t,e,r){return mr(t,e,r,"hsv")};lr.hsv=kr;var Tr=l.clip_rgb;var Sr=Math.pow;var Er=Math.sqrt;var Ar=Math.PI;var Rr=Math.cos;var Br=Math.sin;var Or=Math.atan2;var Pr=function(t,s,o){if(s===void 0)s="lrgb";if(o===void 0)o=null;var e=t.length;if(!o){o=Array.from(new Array(e)).map(function(){return 1})}var r=e/o.reduce(function(t,e){return t+e});o.forEach(function(t,e){o[e]*=r});t=t.map(function(t){return new R(t)});if(s==="lrgb"){return Ir(t,o)}var i=t.shift();var a=i.get(s);var u=[];var l=0;var f=0;for(var n=0;n<a.length;n++){a[n]=(a[n]||0)*o[0];u.push(isNaN(a[n])?0:o[0]);if(s.charAt(n)==="h"&&!isNaN(a[n])){var h=a[n]/180*Ar;l+=Rr(h)*o[0];f+=Br(h)*o[0]}}var c=i.alpha()*o[0];t.forEach(function(t,e){var r=t.get(s);c+=t.alpha()*o[e+1];for(var i=0;i<a.length;i++){if(!isNaN(r[i])){u[i]+=o[e+1];if(s.charAt(i)==="h"){var n=r[i]/180*Ar;l+=Rr(n)*o[e+1];f+=Br(n)*o[e+1]}else{a[i]+=r[i]*o[e+1]}}}});for(var d=0;d<a.length;d++){if(s.charAt(d)==="h"){var p=Or(f/u[d],l/u[d])/Ar*180;while(p<0){p+=360}while(p>=360){p-=360}a[d]=p}else{a[d]=a[d]/u[d]}}c/=e;return new R(a,s).alpha(c>.99999?1:c,true)};var Ir=function(t,e){var r=t.length;var i=[0,0,0,0];for(var n=0;n<t.length;n++){var s=t[n];var o=e[n]/r;var a=s._rgb;i[0]+=Sr(a[0],2)*o;i[1]+=Sr(a[1],2)*o;i[2]+=Sr(a[2],2)*o;i[3]+=a[3]*o}i[0]=Er(i[0]);i[1]=Er(i[1]);i[2]=Er(i[2]);if(i[3]>.9999999){i[3]=1}return new R(Tr(i))};var Mr=l.type;var jr=Math.pow;var Lr=function(l){var u="rgb";var f=S("#ccc");var e=0;var h=[0,1];var c=[];var d=[0,0];var p=false;var g=[];var r=false;var y=0;var b=1;var i=false;var m={};var v=true;var w=1;var n=function(t){t=t||["#fff","#000"];if(t&&Mr(t)==="string"&&S.brewer&&S.brewer[t.toLowerCase()]){t=S.brewer[t.toLowerCase()]}if(Mr(t)==="array"){if(t.length===1){t=[t[0],t[0]]}t=t.slice(0);for(var e=0;e<t.length;e++){t[e]=S(t[e])}c.length=0;for(var r=0;r<t.length;r++){c.push(r/(t.length-1))}}s();return g=t};var _=function(t){if(p!=null){var e=p.length-1;var r=0;while(r<e&&t>=p[r]){r++}return r-1}return 0};var x=function(t){return t};var C=function(t){return t};var k=function(t,e){var r,i;if(e==null){e=false}if(isNaN(t)||t===null){return f}if(!e){if(p&&p.length>2){var n=_(t);i=n/(p.length-2)}else if(b!==y){i=(t-y)/(b-y)}else{i=1}}else{i=t}i=C(i);if(!e){i=x(i)}if(w!==1){i=jr(i,w)}i=d[0]+i*(1-d[0]-d[1]);i=Math.min(1,Math.max(0,i));var s=Math.floor(i*1e4);if(v&&m[s]){r=m[s]}else{if(Mr(g)==="array"){for(var o=0;o<c.length;o++){var a=c[o];if(i<=a){r=g[o];break}if(i>=a&&o===c.length-1){r=g[o];break}if(i>a&&i<c[o+1]){i=(i-a)/(c[o+1]-a);r=S.interpolate(g[o],g[o+1],i,u);break}}}else if(Mr(g)==="function"){r=g(i)}if(v){m[s]=r}}return r};var s=function(){return m={}};n(l);var T=function(t){var e=S(k(t));if(r&&e[r]){return e[r]()}else{return e}};T.classes=function(t){if(t!=null){if(Mr(t)==="array"){p=t;h=[t[0],t[t.length-1]]}else{var e=S.analyze(h);if(t===0){p=[e.min,e.max]}else{p=S.limits(e,"e",t)}}return T}return p};T.domain=function(r){if(!arguments.length){return h}y=r[0];b=r[r.length-1];c=[];var t=g.length;if(r.length===t&&y!==b){for(var e=0,i=Array.from(r);e<i.length;e+=1){var n=i[e];c.push((n-y)/(b-y))}}else{for(var s=0;s<t;s++){c.push(s/(t-1))}if(r.length>2){var o=r.map(function(t,e){return e/(r.length-1)});var a=r.map(function(t){return(t-y)/(b-y)});if(!a.every(function(t,e){return o[e]===t})){C=function(t){if(t<=0||t>=1){return t}var e=0;while(t>=a[e+1]){e++}var r=(t-a[e])/(a[e+1]-a[e]);var i=o[e]+r*(o[e+1]-o[e]);return i}}}}h=[y,b];return T};T.mode=function(t){if(!arguments.length){return u}u=t;s();return T};T.range=function(t,e){n(t,e);return T};T.out=function(t){r=t;return T};T.spread=function(t){if(!arguments.length){return e}e=t;return T};T.correctLightness=function(t){if(t==null){t=true}i=t;s();if(i){x=function(t){var e=k(0,true).lab()[0];var r=k(1,true).lab()[0];var i=e>r;var n=k(t,true).lab()[0];var s=e+(r-e)*t;var o=n-s;var a=0;var u=1;var l=20;while(Math.abs(o)>.01&&l-- >0){(function(){if(i){o*=-1}if(o<0){a=t;t+=(u-t)*.5}else{u=t;t+=(a-t)*.5}n=k(t,true).lab()[0];return o=n-s})()}return t}}else{x=function(t){return t}}return T};T.padding=function(t){if(t!=null){if(Mr(t)==="number"){t=[t,t]}d=t;return T}else{return d}};T.colors=function(e,r){if(arguments.length<2){r="hex"}var t=[];if(arguments.length===0){t=g.slice(0)}else if(e===1){t=[T(.5)]}else if(e>1){var i=h[0];var n=h[1]-i;t=Dr(0,e,false).map(function(t){return T(i+t/(e-1)*n)})}else{l=[];var s=[];if(p&&p.length>2){for(var o=1,a=p.length,u=1<=a;u?o<a:o>a;u?o++:o--){s.push((p[o-1]+p[o])*.5)}}else{s=h}t=s.map(function(t){return T(t)})}if(S[r]){t=t.map(function(t){return t[r]()})}return t};T.cache=function(t){if(t!=null){v=t;return T}else{return v}};T.gamma=function(t){if(t!=null){w=t;return T}else{return w}};T.nodata=function(t){if(t!=null){f=S(t);return T}else{return f}};return T};function Dr(t,e,r){var i=[];var n=t<e;var s=!r?e:n?e+1:e-1;for(var o=t;n?o<s:o>s;n?o++:o--){i.push(o)}return i}var Fr=function(t){var e,r,i;var n,s,o,a;t=t.map(function(t){return new R(t)});if(t.length===2){e=t.map(function(t){return t.lab()}),s=e[0],o=e[1];n=function(e){var t=[0,1,2].map(function(t){return s[t]+e*(o[t]-s[t])});return new R(t,"lab")}}else if(t.length===3){r=t.map(function(t){return t.lab()}),s=r[0],o=r[1],a=r[2];n=function(e){var t=[0,1,2].map(function(t){return(1-e)*(1-e)*s[t]+2*(1-e)*e*o[t]+e*e*a[t]});return new R(t,"lab")}}else if(t.length===4){var u;i=t.map(function(t){return t.lab()}),s=i[0],o=i[1],a=i[2],u=i[3];n=function(e){var t=[0,1,2].map(function(t){return(1-e)*(1-e)*(1-e)*s[t]+3*(1-e)*(1-e)*e*o[t]+3*(1-e)*e*e*a[t]+e*e*e*u[t]});return new R(t,"lab")}}else if(t.length===5){var l=Fr(t.slice(0,3));var f=Fr(t.slice(2,5));n=function(t){if(t<.5){return l(t*2)}else{return f((t-.5)*2)}}}return n};var Wr=function(t){var e=Fr(t);e.scale=function(){return Lr(e)};return e};var Hr=function(t,e,r){if(!Hr[r]){throw new Error("unknown blend mode "+r)}return Hr[r](t,e)};var Nr=function(n){return function(t,e){var r=S(e).rgb();var i=S(t).rgb();return S.rgb(n(r,i))}};var Ur=function(i){return function(t,e){var r=[];r[0]=i(t[0],e[0]);r[1]=i(t[1],e[1]);r[2]=i(t[2],e[2]);return r}};var zr=function(t){return t};var Yr=function(t,e){return t*e/255};var Vr=function(t,e){return t>e?e:t};var Gr=function(t,e){return t>e?t:e};var Zr=function(t,e){return 255*(1-(1-t/255)*(1-e/255))};var Kr=function(t,e){return e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255))};var Xr=function(t,e){return 255*(1-(1-e/255)/(t/255))};var qr=function(t,e){if(t===255){return 255}t=255*(e/255)/(1-t/255);return t>255?255:t};Hr.normal=Nr(Ur(zr));Hr.multiply=Nr(Ur(Yr));Hr.screen=Nr(Ur(Zr));Hr.overlay=Nr(Ur(Kr));Hr.darken=Nr(Ur(Vr));Hr.lighten=Nr(Ur(Gr));Hr.dodge=Nr(Ur(qr));Hr.burn=Nr(Ur(Xr));var Jr=Hr;var $r=l.type;var Qr=l.clip_rgb;var ti=l.TWOPI;var ei=Math.pow;var ri=Math.sin;var ii=Math.cos;var ni=function(f,h,c,d,p){if(f===void 0)f=300;if(h===void 0)h=-1.5;if(c===void 0)c=1;if(d===void 0)d=1;if(p===void 0)p=[0,1];var g=0,y;if($r(p)==="array"){y=p[1]-p[0]}else{y=0;p=[p,p]}var e=function(t){var e=ti*((f+120)/360+h*t);var r=ei(p[0]+y*t,d);var i=g!==0?c[0]+t*g:c;var n=i*r*(1-r)/2;var s=ii(e);var o=ri(e);var a=r+n*(-.14861*s+1.78277*o);var u=r+n*(-.29227*s-.90649*o);var l=r+n*(+1.97294*s);return S(Qr([a*255,u*255,l*255,1]))};e.start=function(t){if(t==null){return f}f=t;return e};e.rotations=function(t){if(t==null){return h}h=t;return e};e.gamma=function(t){if(t==null){return d}d=t;return e};e.hue=function(t){if(t==null){return c}c=t;if($r(c)==="array"){g=c[1]-c[0];if(g===0){c=c[1]}}else{g=0}return e};e.lightness=function(t){if(t==null){return p}if($r(t)==="array"){p=t;y=t[1]-t[0]}else{p=[t,t];y=0}return e};e.scale=function(){return S.scale(e)};e.hue(c);return e};var si="0123456789abcdef";var oi=Math.floor;var ai=Math.random;var ui=function(){var t="#";for(var e=0;e<6;e++){t+=si.charAt(oi(ai()*16))}return new R(t,"hex")};var li=Math.log;var fi=Math.pow;var hi=Math.floor;var ci=Math.abs;var di=function(t,e){if(e===void 0)e=null;var r={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};if(U(t)==="object"){t=Object.values(t)}t.forEach(function(t){if(e&&U(t)==="object"){t=t[e]}if(t!==undefined&&t!==null&&!isNaN(t)){r.values.push(t);r.sum+=t;if(t<r.min){r.min=t}if(t>r.max){r.max=t}r.count+=1}});r.domain=[r.min,r.max];r.limits=function(t,e){return pi(r,t,e)};return r};var pi=function(t,e,r){if(e===void 0)e="equal";if(r===void 0)r=7;if(U(t)=="array"){t=di(t)}var i=t.min;var n=t.max;var s=t.values.sort(function(t,e){return t-e});if(r===1){return[i,n]}var o=[];if(e.substr(0,1)==="c"){o.push(i);o.push(n)}if(e.substr(0,1)==="e"){o.push(i);for(var a=1;a<r;a++){o.push(i+a/r*(n-i))}o.push(n)}else if(e.substr(0,1)==="l"){if(i<=0){throw new Error("Logarithmic scales are only possible for values > 0")}var u=Math.LOG10E*li(i);var l=Math.LOG10E*li(n);o.push(i);for(var f=1;f<r;f++){o.push(fi(10,u+f/r*(l-u)))}o.push(n)}else if(e.substr(0,1)==="q"){o.push(i);for(var h=1;h<r;h++){var c=(s.length-1)*h/r;var d=hi(c);if(d===c){o.push(s[d])}else{var p=c-d;o.push(s[d]*(1-p)+s[d+1]*p)}}o.push(n)}else if(e.substr(0,1)==="k"){var g;var y=s.length;var b=new Array(y);var m=new Array(r);var v=true;var w=0;var _=null;_=[];_.push(i);for(var x=1;x<r;x++){_.push(i+x/r*(n-i))}_.push(n);while(v){for(var C=0;C<r;C++){m[C]=0}for(var k=0;k<y;k++){var T=s[k];var S=Number.MAX_VALUE;var E=void 0;for(var A=0;A<r;A++){var R=ci(_[A]-T);if(R<S){S=R;E=A}m[E]++;b[k]=E}}var B=new Array(r);for(var O=0;O<r;O++){B[O]=null}for(var P=0;P<y;P++){g=b[P];if(B[g]===null){B[g]=s[P]}else{B[g]+=s[P]}}for(var I=0;I<r;I++){B[I]*=1/m[I]}v=false;for(var M=0;M<r;M++){if(B[M]!==_[M]){v=true;break}}_=B;w++;if(w>200){v=false}}var j={};for(var L=0;L<r;L++){j[L]=[]}for(var D=0;D<y;D++){g=b[D];j[g].push(s[D])}var F=[];for(var W=0;W<r;W++){F.push(j[W][0]);F.push(j[W][j[W].length-1])}F=F.sort(function(t,e){return t-e});o.push(F[0]);for(var H=1;H<F.length;H+=2){var N=F[H];if(!isNaN(N)&&o.indexOf(N)===-1){o.push(N)}}}return o};var gi={analyze:di,limits:pi};var yi=function(t,e){t=new R(t);e=new R(e);var r=t.luminance();var i=e.luminance();return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)};var bi=Math.sqrt;var mi=Math.atan2;var vi=Math.abs;var wi=Math.cos;var _i=Math.PI;var xi=function(t,e,r,i){if(r===void 0)r=1;if(i===void 0)i=1;t=new R(t);e=new R(e);var n=Array.from(t.lab());var s=n[0];var o=n[1];var a=n[2];var u=Array.from(e.lab());var l=u[0];var f=u[1];var h=u[2];var c=bi(o*o+a*a);var d=bi(f*f+h*h);var p=s<16?.511:.040975*s/(1+.01765*s);var g=.0638*c/(1+.0131*c)+.638;var y=c<1e-6?0:mi(a,o)*180/_i;while(y<0){y+=360}while(y>=360){y-=360}var b=y>=164&&y<=345?.56+vi(.2*wi(_i*(y+168)/180)):.36+vi(.4*wi(_i*(y+35)/180));var m=c*c*c*c;var v=bi(m/(m+1900));var w=g*(v*b+1-v);var _=s-l;var x=c-d;var C=o-f;var k=a-h;var T=C*C+k*k-x*x;var S=_/(r*p);var E=x/(i*g);var A=w;return bi(S*S+E*E+T/(A*A))};var Ci=function(t,e,r){if(r===void 0)r="lab";t=new R(t);e=new R(e);var i=t.get(r);var n=e.get(r);var s=0;for(var o in i){var a=(i[o]||0)-(n[o]||0);s+=a*a}return Math.sqrt(s)};var ki=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];try{new(Function.prototype.bind.apply(R,[null].concat(t)));return true}catch(t){return false}};var Ti={cool:function t(){return Lr([S.hsl(180,1,.9),S.hsl(250,.7,.4)])},hot:function t(){return Lr(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")}};var Si={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(var Ei=0,Ai=Object.keys(Si);Ei<Ai.length;Ei+=1){var Ri=Ai[Ei];Si[Ri.toLowerCase()]=Si[Ri]}var Bi=Si;S.average=Pr;S.bezier=Wr;S.blend=Jr;S.cubehelix=ni;S.mix=S.interpolate=hr;S.random=ui;S.scale=Lr;S.analyze=gi.analyze;S.contrast=yi;S.deltaE=xi;S.distance=Ci;S.limits=gi.limits;S.valid=ki;S.scales=Ti;S.colors=De;S.brewer=Bi;var Oi=S;return Oi})},{}],60:[function(t,e,r){"use strict";var s=t("./lib/thunk.js");function o(){this.argTypes=[];this.shimArgs=[];this.arrayArgs=[];this.arrayBlockIndices=[];this.scalarArgs=[];this.offsetArgs=[];this.offsetArgIndex=[];this.indexArgs=[];this.shapeArgs=[];this.funcName="";this.pre=null;this.body=null;this.post=null;this.debug=false}function i(t){var e=new o;e.pre=t.pre;e.body=t.body;e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i<r.length;++i){var n=r[i];if(n==="array"||typeof n==="object"&&n.blockIndices){e.argTypes[i]="array";e.arrayArgs.push(i);e.arrayBlockIndices.push(n.blockIndices?n.blockIndices:0);e.shimArgs.push("array"+i);if(i<e.pre.args.length&&e.pre.args[i].count>0){throw new Error("cwise: pre() block may not reference array args")}if(i<e.post.args.length&&e.post.args[i].count>0){throw new Error("cwise: post() block may not reference array args")}}else if(n==="scalar"){e.scalarArgs.push(i);e.shimArgs.push("scalar"+i)}else if(n==="index"){e.indexArgs.push(i);if(i<e.pre.args.length&&e.pre.args[i].count>0){throw new Error("cwise: pre() block may not reference array index")}if(i<e.body.args.length&&e.body.args[i].lvalue){throw new Error("cwise: body() block may not write to array index")}if(i<e.post.args.length&&e.post.args[i].count>0){throw new Error("cwise: post() block may not reference array index")}}else if(n==="shape"){e.shapeArgs.push(i);if(i<e.pre.args.length&&e.pre.args[i].lvalue){throw new Error("cwise: pre() block may not write to array shape")}if(i<e.body.args.length&&e.body.args[i].lvalue){throw new Error("cwise: body() block may not write to array shape")}if(i<e.post.args.length&&e.post.args[i].lvalue){throw new Error("cwise: post() block may not write to array shape")}}else if(typeof n==="object"&&n.offset){e.argTypes[i]="offset";e.offsetArgs.push({array:n.array,offset:n.offset});e.offsetArgIndex.push(i)}else{throw new Error("cwise: Unknown argument type "+r[i])}}if(e.arrayArgs.length<=0){throw new Error("cwise: No array arguments specified")}if(e.pre.args.length>r.length){throw new Error("cwise: Too many arguments in pre() block")}if(e.body.args.length>r.length){throw new Error("cwise: Too many arguments in body() block")}if(e.post.args.length>r.length){throw new Error("cwise: Too many arguments in post() block")}e.debug=!!t.printCode||!!t.debug;e.funcName=t.funcName||"cwise";e.blockSize=t.blockSize||64;return s(e)}e.exports=i},{"./lib/thunk.js":62}],61:[function(t,e,r){"use strict";var k=t("uniq");function T(t,e,r){var i=t.length,n=e.arrayArgs.length,s=e.indexArgs.length>0,o=[],a=[],u=0,l=0,f,h;for(f=0;f<i;++f){a.push(["i",f,"=0"].join(""))}for(h=0;h<n;++h){for(f=0;f<i;++f){l=u;u=t[f];if(f===0){a.push(["d",h,"s",f,"=t",h,"p",u].join(""))}else{a.push(["d",h,"s",f,"=(t",h,"p",u,"-s",l,"*t",h,"p",l,")"].join(""))}}}if(a.length>0){o.push("var "+a.join(","))}for(f=i-1;f>=0;--f){u=t[f];o.push(["for(i",f,"=0;i",f,"<s",u,";++i",f,"){"].join(""))}o.push(r);for(f=0;f<i;++f){l=u;u=t[f];for(h=0;h<n;++h){o.push(["p",h,"+=d",h,"s",f].join(""))}if(s){if(f>0){o.push(["index[",l,"]-=s",l].join(""))}o.push(["++index[",u,"]"].join(""))}o.push("}")}return o.join("\n")}function S(t,e,r,i){var n=e.length,s=r.arrayArgs.length,o=r.blockSize,a=r.indexArgs.length>0,u=[];for(var l=0;l<s;++l){u.push(["var offset",l,"=p",l].join(""))}for(var l=t;l<n;++l){u.push(["for(var j"+l+"=SS[",e[l],"]|0;j",l,">0;){"].join(""));u.push(["if(j",l,"<",o,"){"].join(""));u.push(["s",e[l],"=j",l].join(""));u.push(["j",l,"=0"].join(""));u.push(["}else{s",e[l],"=",o].join(""));u.push(["j",l,"-=",o,"}"].join(""));if(a){u.push(["index[",e[l],"]=j",l].join(""))}}for(var l=0;l<s;++l){var f=["offset"+l];for(var h=t;h<n;++h){f.push(["j",h,"*t",l,"p",e[h]].join(""))}u.push(["p",l,"=(",f.join("+"),")"].join(""))}u.push(T(e,r,i));for(var l=t;l<n;++l){u.push("}")}return u.join("\n")}function E(t){var e=0,r=t[0].length;while(e<r){for(var i=1;i<t.length;++i){if(t[i][e]!==t[0][e]){return e}}++e}return e}function A(t,e,r){var i=t.body;var n=[];var s=[];for(var o=0;o<t.args.length;++o){var a=t.args[o];if(a.count<=0){continue}var u=new RegExp(a.name,"g");var l="";var f=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case"offset":var h=e.offsetArgIndex.indexOf(o);var c=e.offsetArgs[h];f=c.array;l="+q"+h;case"array":l="p"+f+l;var d="l"+o;var p="a"+f;if(e.arrayBlockIndices[f]===0){if(a.count===1){if(r[f]==="generic"){if(a.lvalue){n.push(["var ",d,"=",p,".get(",l,")"].join(""));i=i.replace(u,d);s.push([p,".set(",l,",",d,")"].join(""))}else{i=i.replace(u,[p,".get(",l,")"].join(""))}}else{i=i.replace(u,[p,"[",l,"]"].join(""))}}else if(r[f]==="generic"){n.push(["var ",d,"=",p,".get(",l,")"].join(""));i=i.replace(u,d);if(a.lvalue){s.push([p,".set(",l,",",d,")"].join(""))}}else{n.push(["var ",d,"=",p,"[",l,"]"].join(""));i=i.replace(u,d);if(a.lvalue){s.push([p,"[",l,"]=",d].join(""))}}}else{var g=[a.name],y=[l];for(var b=0;b<Math.abs(e.arrayBlockIndices[f]);b++){g.push("\\s*\\[([^\\]]+)\\]");y.push("$"+(b+1)+"*t"+f+"b"+b)}u=new RegExp(g.join(""),"g");l=y.join("+");if(r[f]==="generic"){throw new Error("cwise: Generic arrays not supported in combination with blocks!")}else{i=i.replace(u,[p,"[",l,"]"].join(""))}}break;case"scalar":i=i.replace(u,"Y"+e.scalarArgs.indexOf(o));break;case"index":i=i.replace(u,"index");break;case"shape":i=i.replace(u,"shape");break}}return[n.join("\n"),i,s.join("\n")].join("\n").trim()}function R(t){var e=new Array(t.length);var r=true;for(var i=0;i<t.length;++i){var n=t[i];var s=n.match(/\d+/);if(!s){s=""}else{s=s[0]}if(n.charAt(0)===0){e[i]="u"+n.charAt(1)+s}else{e[i]=n.charAt(0)+s}if(i>0){r=r&&e[i]===e[i-1]}}if(r){return e[0]}return e.join("")}function i(t,e){var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0;var i=new Array(t.arrayArgs.length);var n=new Array(t.arrayArgs.length);for(var s=0;s<t.arrayArgs.length;++s){n[s]=e[2*s];i[s]=e[2*s+1]}var o=[],a=[];var u=[],l=[];var f=[];for(var s=0;s<t.arrayArgs.length;++s){if(t.arrayBlockIndices[s]<0){u.push(0);l.push(r);o.push(r);a.push(r+t.arrayBlockIndices[s])}else{u.push(t.arrayBlockIndices[s]);l.push(t.arrayBlockIndices[s]+r);o.push(0);a.push(t.arrayBlockIndices[s])}var h=[];for(var c=0;c<i[s].length;c++){if(u[s]<=i[s][c]&&i[s][c]<l[s]){h.push(i[s][c]-u[s])}}f.push(h)}var d=["SS"];var p=["'use strict'"];var g=[];for(var c=0;c<r;++c){g.push(["s",c,"=SS[",c,"]"].join(""))}for(var s=0;s<t.arrayArgs.length;++s){d.push("a"+s);d.push("t"+s);d.push("p"+s);for(var c=0;c<r;++c){g.push(["t",s,"p",c,"=t",s,"[",u[s]+c,"]"].join(""))}for(var c=0;c<Math.abs(t.arrayBlockIndices[s]);++c){g.push(["t",s,"b",c,"=t",s,"[",o[s]+c,"]"].join(""))}}for(var s=0;s<t.scalarArgs.length;++s){d.push("Y"+s)}if(t.shapeArgs.length>0){g.push("shape=SS.slice(0)")}if(t.indexArgs.length>0){var y=new Array(r);for(var s=0;s<r;++s){y[s]="0"}g.push(["index=[",y.join(","),"]"].join(""))}for(var s=0;s<t.offsetArgs.length;++s){var b=t.offsetArgs[s];var m=[];for(var c=0;c<b.offset.length;++c){if(b.offset[c]===0){continue}else if(b.offset[c]===1){m.push(["t",b.array,"p",c].join(""))}else{m.push([b.offset[c],"*t",b.array,"p",c].join(""))}}if(m.length===0){g.push("q"+s+"=0")}else{g.push(["q",s,"=",m.join("+")].join(""))}}var v=k([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));g=g.concat(v);if(g.length>0){p.push("var "+g.join(","))}for(var s=0;s<t.arrayArgs.length;++s){p.push("p"+s+"|=0")}if(t.pre.body.length>3){p.push(A(t.pre,t,n))}var w=A(t.body,t,n);var _=E(f);if(_<r){p.push(S(_,f[0],t,w))}else{p.push(T(f[0],t,w))}if(t.post.body.length>3){p.push(A(t.post,t,n))}if(t.debug){console.log("-----Generated cwise routine for ",e,":\n"+p.join("\n")+"\n----------")}var x=[t.funcName||"unnamed","_cwise_loop_",i[0].join("s"),"m",_,R(n)].join("");var C=new Function(["function ",x,"(",d.join(","),"){",p.join("\n"),"} return ",x].join(""));return C()}e.exports=i},{uniq:135}],62:[function(t,e,r){"use strict";var c=t("./compile.js");function i(t){var e=["'use strict'","var CACHED={}"];var r=[];var i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));var n=[];var s=[];var o=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")];var a=[],u=[];for(var l=0;l<t.arrayArgs.length;++l){var f=t.arrayArgs[l];r.push(["t",f,"=array",f,".dtype,","r",f,"=array",f,".order"].join(""));n.push("t"+f);n.push("r"+f);s.push("t"+f);s.push("r"+f+".join()");o.push("array"+f+".data");o.push("array"+f+".stride");o.push("array"+f+".offset|0");if(l>0){a.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[l])));u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[l])+"]")}}if(t.arrayArgs.length>1){e.push("if (!("+a.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')");e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {");e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')");e.push("}")}for(var l=0;l<t.scalarArgs.length;++l){o.push("scalar"+t.scalarArgs[l])}r.push(["type=[",s.join(","),"].join()"].join(""));r.push("proc=CACHED[type]");e.push("var "+r.join(","));e.push(["if(!proc){","CACHED[type]=proc=compile([",n.join(","),"])}","return proc(",o.join(","),")}"].join(""));if(t.debug){console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------")}var h=new Function("compile",e.join("\n"));return h(c.bind(undefined,t))}e.exports=i},{"./compile.js":61}],63:[function(t,e,r){"use strict";function i(t){var e=new Array(t);for(var r=0;r<t;++r){e[r]=r}return e}e.exports=i},{}],64:[function(t,e,r){e.exports=function(t){return t!=null&&(i(t)||n(t)||!!t._isBuffer)};function i(t){return!!t.constructor&&typeof t.constructor.isBuffer==="function"&&t.constructor.isBuffer(t)}function n(t){return typeof t.readFloatLE==="function"&&typeof t.slice==="function"&&i(t.slice(0,0))}},{}],65:[function(t,e,r){var i=t("./lib/encoder"),n=t("./lib/decoder");e.exports={encode:i,decode:n}},{"./lib/decoder":66,"./lib/encoder":67}],66:[function(t,e,r){(function(f){(function(){var l=function t(){"use strict";var $=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);var v=4017;var w=799;var _=3406;var x=2276;var C=1567;var k=3784;var T=5793;var S=2896;function e(){}function Q(t,e){var r=0,i=[],n,s,o=16;while(o>0&&!t[o-1])o--;i.push({children:[],index:0});var a=i[0],u;for(n=0;n<o;n++){for(s=0;s<t[n];s++){a=i.pop();a.children[a.index]=e[r];while(a.index>0){if(i.length===0)throw new Error("Could not recreate Huffman Table");a=i.pop()}a.index++;i.push(a);while(i.length<=n){i.push(u={children:[],index:0});a.children[a.index]=u.children;a=u}r++}if(n+1<o){i.push(u={children:[],index:0});a.children[a.index]=u.children;a=u}}return i[0].children}function tt(e,r,t,i,n,l,f,s,h,c){var o=t.precision;var a=t.samplesPerLine;var u=t.scanLines;var d=t.mcusPerLine;var p=t.progressive;var g=t.maxH,y=t.maxV;var b=r,m=0,v=0;function w(){if(v>0){v--;return m>>v&1}m=e[r++];if(m==255){var t=e[r++];if(t){throw new Error("unexpected marker: "+(m<<8|t).toString(16))}}v=7;return m>>>7}function _(t){var e=t,r;while((r=w())!==null){e=e[r];if(typeof e==="number")return e;if(typeof e!=="object")throw new Error("invalid huffman sequence")}return null}function x(t){var e=0;while(t>0){var r=w();if(r===null)return;e=e<<1|r;t--}return e}function C(t){var e=x(t);if(e>=1<<t-1)return e;return e+(-1<<t)+1}function k(t,e){var r=_(t.huffmanTableDC);var i=r===0?0:C(r);e[0]=t.pred+=i;var n=1;while(n<64){var s=_(t.huffmanTableAC);var o=s&15,a=s>>4;if(o===0){if(a<15)break;n+=16;continue}n+=a;var u=$[n];e[u]=C(o);n++}}function T(t,e){var r=_(t.huffmanTableDC);var i=r===0?0:C(r)<<h;e[0]=t.pred+=i}function S(t,e){e[0]|=w()<<h}var E=0;function A(t,e){if(E>0){E--;return}var r=l,i=f;while(r<=i){var n=_(t.huffmanTableAC);var s=n&15,o=n>>4;if(s===0){if(o<15){E=x(o)+(1<<o)-1;break}r+=16;continue}r+=o;var a=$[r];e[a]=C(s)*(1<<h);r++}}var R=0,B;function O(t,e){var r=l,i=f,n=0;while(r<=i){var s=$[r];var o=e[s]<0?-1:1;switch(R){case 0:var a=_(t.huffmanTableAC);var u=a&15,n=a>>4;if(u===0){if(n<15){E=x(n)+(1<<n);R=4}else{n=16;R=1}}else{if(u!==1)throw new Error("invalid ACn encoding");B=C(u);R=n?2:3}continue;case 1:case 2:if(e[s])e[s]+=(w()<<h)*o;else{n--;if(n===0)R=R==2?3:0}break;case 3:if(e[s])e[s]+=(w()<<h)*o;else{e[s]=B<<h;R=0}break;case 4:if(e[s])e[s]+=(w()<<h)*o;break}r++}if(R===4){E--;if(E===0)R=0}}function P(t,e,r,i,n){var s=r/d|0;var o=r%d;var a=s*t.v+i;var u=o*t.h+n;if(t.blocks[a]===undefined&&c.tolerantDecoding)return;e(t,t.blocks[a][u])}function I(t,e,r){var i=r/t.blocksPerLine|0;var n=r%t.blocksPerLine;if(t.blocks[i]===undefined&&c.tolerantDecoding)return;e(t,t.blocks[i][n])}var M=i.length;var j,L,D,F,W;var H;if(p){if(l===0)H=s===0?T:S;else H=s===0?A:O}else{H=k}var N=0,U;var z;if(M==1){z=i[0].blocksPerLine*i[0].blocksPerColumn}else{z=d*t.mcusPerColumn}if(!n)n=z;var Y,V;while(N<z){for(L=0;L<M;L++)i[L].pred=0;E=0;if(M==1){j=i[0];for(W=0;W<n;W++){I(j,H,N);N++}}else{for(W=0;W<n;W++){for(L=0;L<M;L++){j=i[L];Y=j.h;V=j.v;for(D=0;D<V;D++){for(F=0;F<Y;F++){P(j,H,N,D,F)}}}N++;if(N===z)break}}if(N===z){do{if(e[r]===255){if(e[r+1]!==0){break}}r+=1}while(r<e.length-2)}v=0;U=e[r]<<8|e[r+1];if(U<65280){throw new Error("marker was not found")}if(U>=65488&&U<=65495){r+=2}else break}return r-b}function et(t,m){var e=[];var r=m.blocksPerLine;var i=m.blocksPerColumn;var n=r<<3;var s=new Int32Array(64),o=new Uint8Array(64);function a(t,e,r){var i=m.quantizationTable;var n,s,o,a,u,l,f,h,c;var d=r;var p;for(p=0;p<64;p++)d[p]=t[p]*i[p];for(p=0;p<8;++p){var g=8*p;if(d[1+g]==0&&d[2+g]==0&&d[3+g]==0&&d[4+g]==0&&d[5+g]==0&&d[6+g]==0&&d[7+g]==0){c=T*d[0+g]+512>>10;d[0+g]=c;d[1+g]=c;d[2+g]=c;d[3+g]=c;d[4+g]=c;d[5+g]=c;d[6+g]=c;d[7+g]=c;continue}n=T*d[0+g]+128>>8;s=T*d[4+g]+128>>8;o=d[2+g];a=d[6+g];u=S*(d[1+g]-d[7+g])+128>>8;h=S*(d[1+g]+d[7+g])+128>>8;l=d[3+g]<<4;f=d[5+g]<<4;c=n-s+1>>1;n=n+s+1>>1;s=c;c=o*k+a*C+128>>8;o=o*C-a*k+128>>8;a=c;c=u-f+1>>1;u=u+f+1>>1;f=c;c=h+l+1>>1;l=h-l+1>>1;h=c;c=n-a+1>>1;n=n+a+1>>1;a=c;c=s-o+1>>1;s=s+o+1>>1;o=c;c=u*x+h*_+2048>>12;u=u*_-h*x+2048>>12;h=c;c=l*w+f*v+2048>>12;l=l*v-f*w+2048>>12;f=c;d[0+g]=n+h;d[7+g]=n-h;d[1+g]=s+f;d[6+g]=s-f;d[2+g]=o+l;d[5+g]=o-l;d[3+g]=a+u;d[4+g]=a-u}for(p=0;p<8;++p){var y=p;if(d[1*8+y]==0&&d[2*8+y]==0&&d[3*8+y]==0&&d[4*8+y]==0&&d[5*8+y]==0&&d[6*8+y]==0&&d[7*8+y]==0){c=T*r[p+0]+8192>>14;d[0*8+y]=c;d[1*8+y]=c;d[2*8+y]=c;d[3*8+y]=c;d[4*8+y]=c;d[5*8+y]=c;d[6*8+y]=c;d[7*8+y]=c;continue}n=T*d[0*8+y]+2048>>12;s=T*d[4*8+y]+2048>>12;o=d[2*8+y];a=d[6*8+y];u=S*(d[1*8+y]-d[7*8+y])+2048>>12;h=S*(d[1*8+y]+d[7*8+y])+2048>>12;l=d[3*8+y];f=d[5*8+y];c=n-s+1>>1;n=n+s+1>>1;s=c;c=o*k+a*C+2048>>12;o=o*C-a*k+2048>>12;a=c;c=u-f+1>>1;u=u+f+1>>1;f=c;c=h+l+1>>1;l=h-l+1>>1;h=c;c=n-a+1>>1;n=n+a+1>>1;a=c;c=s-o+1>>1;s=s+o+1>>1;o=c;c=u*x+h*_+2048>>12;u=u*_-h*x+2048>>12;h=c;c=l*w+f*v+2048>>12;l=l*v-f*w+2048>>12;f=c;d[0*8+y]=n+h;d[7*8+y]=n-h;d[1*8+y]=s+f;d[6*8+y]=s-f;d[2*8+y]=o+l;d[5*8+y]=o-l;d[3*8+y]=a+u;d[4*8+y]=a-u}for(p=0;p<64;++p){var b=128+(d[p]+8>>4);e[p]=b<0?0:b>255?255:b}}rt(n*i*8);var u,l;for(var f=0;f<i;f++){var h=f<<3;for(u=0;u<8;u++)e.push(new Uint8Array(n));for(var c=0;c<r;c++){a(m.blocks[f][c],o,s);var d=0,p=c<<3;for(l=0;l<8;l++){var g=e[h+l];for(u=0;u<8;u++)g[p+u]=o[d++]}}}return e}function R(t){return t<0?0:t>255?255:t}e.prototype={load:function t(e){var r=new XMLHttpRequest;r.open("GET",e,true);r.responseType="arraybuffer";r.onload=function(){var t=new Uint8Array(r.response||r.mozResponseArrayBuffer);this.parse(t);if(this.onload)this.onload()}.bind(this);r.send(null)},parse:function t(r){var e=this.opts.maxResolutionInMP*1e3*1e3;var i=0,n=r.length;function s(){var t=r[i]<<8|r[i+1];i+=2;return t}function o(){var t=s();var e=r.subarray(i,i+t-2);i+=e.length;return e}function a(t){var e=0,r=0;var i,n;for(n in t.components){if(t.components.hasOwnProperty(n)){i=t.components[n];if(e<i.h)e=i.h;if(r<i.v)r=i.v}}var s=Math.ceil(t.samplesPerLine/8/e);var o=Math.ceil(t.scanLines/8/r);for(n in t.components){if(t.components.hasOwnProperty(n)){i=t.components[n];var a=Math.ceil(Math.ceil(t.samplesPerLine/8)*i.h/e);var u=Math.ceil(Math.ceil(t.scanLines/8)*i.v/r);var l=s*i.h;var f=o*i.v;var h=f*l;var c=[];rt(h*256);for(var d=0;d<f;d++){var p=[];for(var g=0;g<l;g++)p.push(new Int32Array(64));c.push(p)}i.blocksPerLine=a;i.blocksPerColumn=u;i.blocks=c}}t.maxH=e;t.maxV=r;t.mcusPerLine=s;t.mcusPerColumn=o}var u=null;var l=null;var f=null;var h,c;var d=[],p=[];var g=[],y=[];var b=s();this.comments=[];if(b!=65496){throw new Error("SOI not found")}b=s();while(b!=65497){var m,v,w;switch(b){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var _=o();if(b===65534){var x=String.fromCharCode.apply(null,_);this.comments.push(x)}if(b===65504){if(_[0]===74&&_[1]===70&&_[2]===73&&_[3]===70&&_[4]===0){u={version:{major:_[5],minor:_[6]},densityUnits:_[7],xDensity:_[8]<<8|_[9],yDensity:_[10]<<8|_[11],thumbWidth:_[12],thumbHeight:_[13],thumbData:_.subarray(14,14+3*_[12]*_[13])}}}if(b===65505){if(_[0]===69&&_[1]===120&&_[2]===105&&_[3]===102&&_[4]===0){this.exifBuffer=_.subarray(5,_.length)}}if(b===65518){if(_[0]===65&&_[1]===100&&_[2]===111&&_[3]===98&&_[4]===101&&_[5]===0){l={version:_[6],flags0:_[7]<<8|_[8],flags1:_[9]<<8|_[10],transformCode:_[11]}}}break;case 65499:var C=s();var k=C+i-2;while(i<k){var T=r[i++];rt(64*4);var S=new Int32Array(64);if(T>>4===0){for(v=0;v<64;v++){var E=$[v];S[E]=r[i++]}}else if(T>>4===1){for(v=0;v<64;v++){var E=$[v];S[E]=s()}}else throw new Error("DQT: invalid table spec");d[T&15]=S}break;case 65472:case 65473:case 65474:s();h={};h.extended=b===65473;h.progressive=b===65474;h.precision=r[i++];h.scanLines=s();h.samplesPerLine=s();h.components={};h.componentsOrder=[];var A=h.scanLines*h.samplesPerLine;if(A>e){var R=Math.ceil((A-e)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${R}MP`)}var B=r[i++],O;var P=0,I=0;for(m=0;m<B;m++){O=r[i];var M=r[i+1]>>4;var j=r[i+1]&15;var L=r[i+2];h.componentsOrder.push(O);h.components[O]={h:M,v:j,quantizationIdx:L};i+=3}a(h);p.push(h);break;case 65476:var D=s();for(m=2;m<D;){var F=r[i++];var W=new Uint8Array(16);var H=0;for(v=0;v<16;v++,i++){H+=W[v]=r[i]}rt(16+H);var N=new Uint8Array(H);for(v=0;v<H;v++,i++)N[v]=r[i];m+=17+H;(F>>4===0?y:g)[F&15]=Q(W,N)}break;case 65501:s();c=s();break;case 65498:var U=s();var z=r[i++];var Y=[],V;for(m=0;m<z;m++){V=h.components[r[i++]];var G=r[i++];V.huffmanTableDC=y[G>>4];V.huffmanTableAC=g[G&15];Y.push(V)}var Z=r[i++];var K=r[i++];var X=r[i++];var q=tt(r,i,h,Y,c,Z,K,X>>4,X&15,this.opts);i+=q;break;case 65535:if(r[i]!==255){i--}break;default:if(r[i-3]==255&&r[i-2]>=192&&r[i-2]<=254){i-=3;break}throw new Error("unknown JPEG marker "+b.toString(16))}b=s()}if(p.length!=1)throw new Error("only single frame JPEGs supported");for(var m=0;m<p.length;m++){var J=p[m].components;for(var v in J){J[v].quantizationTable=d[J[v].quantizationIdx];delete J[v].quantizationIdx}}this.width=h.samplesPerLine;this.height=h.scanLines;this.jfif=u;this.adobe=l;this.components=[];for(var m=0;m<h.componentsOrder.length;m++){var V=h.components[h.componentsOrder[m]];this.components.push({lines:et(h,V),scaleX:V.h/h.maxH,scaleY:V.v/h.maxV})}},getData:function t(e,r){var i=this.width/e,n=this.height/r;var s,o,a,u;var l,f,h,c;var d,p;var g=0;var y,b,m,v,w,_,x,C,k,T;var S;var E=e*r*this.components.length;rt(E);var A=new Uint8Array(E);switch(this.components.length){case 1:s=this.components[0];for(p=0;p<r;p++){l=s.lines[0|p*s.scaleY*n];for(d=0;d<e;d++){y=l[0|d*s.scaleX*i];A[g++]=y}}break;case 2:s=this.components[0];o=this.components[1];for(p=0;p<r;p++){l=s.lines[0|p*s.scaleY*n];f=o.lines[0|p*o.scaleY*n];for(d=0;d<e;d++){y=l[0|d*s.scaleX*i];A[g++]=y;y=f[0|d*o.scaleX*i];A[g++]=y}}break;case 3:S=true;if(this.adobe&&this.adobe.transformCode)S=true;else if(typeof this.opts.colorTransform!=="undefined")S=!!this.opts.colorTransform;s=this.components[0];o=this.components[1];a=this.components[2];for(p=0;p<r;p++){l=s.lines[0|p*s.scaleY*n];f=o.lines[0|p*o.scaleY*n];h=a.lines[0|p*a.scaleY*n];for(d=0;d<e;d++){if(!S){C=l[0|d*s.scaleX*i];k=f[0|d*o.scaleX*i];T=h[0|d*a.scaleX*i]}else{y=l[0|d*s.scaleX*i];b=f[0|d*o.scaleX*i];m=h[0|d*a.scaleX*i];C=R(y+1.402*(m-128));k=R(y-.3441363*(b-128)-.71413636*(m-128));T=R(y+1.772*(b-128))}A[g++]=C;A[g++]=k;A[g++]=T}}break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");S=false;if(this.adobe&&this.adobe.transformCode)S=true;else if(typeof this.opts.colorTransform!=="undefined")S=!!this.opts.colorTransform;s=this.components[0];o=this.components[1];a=this.components[2];u=this.components[3];for(p=0;p<r;p++){l=s.lines[0|p*s.scaleY*n];f=o.lines[0|p*o.scaleY*n];h=a.lines[0|p*a.scaleY*n];c=u.lines[0|p*u.scaleY*n];for(d=0;d<e;d++){if(!S){w=l[0|d*s.scaleX*i];_=f[0|d*o.scaleX*i];x=h[0|d*a.scaleX*i];v=c[0|d*u.scaleX*i]}else{y=l[0|d*s.scaleX*i];b=f[0|d*o.scaleX*i];m=h[0|d*a.scaleX*i];v=c[0|d*u.scaleX*i];w=255-R(y+1.402*(m-128));_=255-R(y-.3441363*(b-128)-.71413636*(m-128));x=255-R(y+1.772*(b-128))}A[g++]=255-w;A[g++]=255-_;A[g++]=255-x;A[g++]=255-v}}break;default:throw new Error("Unsupported color mode")}return A},copyToImageData:function t(e,r){var i=e.width,n=e.height;var s=e.data;var o=this.getData(i,n);var a=0,u=0,l,f;var h,c,d,p,g,y,b;switch(this.components.length){case 1:for(f=0;f<n;f++){for(l=0;l<i;l++){h=o[a++];s[u++]=h;s[u++]=h;s[u++]=h;if(r){s[u++]=255}}}break;case 3:for(f=0;f<n;f++){for(l=0;l<i;l++){g=o[a++];y=o[a++];b=o[a++];s[u++]=g;s[u++]=y;s[u++]=b;if(r){s[u++]=255}}}break;case 4:for(f=0;f<n;f++){for(l=0;l<i;l++){d=o[a++];p=o[a++];h=o[a++];c=o[a++];g=255-R(d*(1-c/255)+c);y=255-R(p*(1-c/255)+c);b=255-R(h*(1-c/255)+c);s[u++]=g;s[u++]=y;s[u++]=b;if(r){s[u++]=255}}}break;default:throw new Error("Unsupported color mode")}}};var i=0;var n=0;function rt(t=0){var e=i+t;if(e>n){var r=Math.ceil((e-n)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}i=e}e.resetMaxMemoryUsage=function(t){i=0;n=t};e.getBytesAllocated=function(){return i};e.requestMemoryAllocation=rt;return e}();if(typeof e!=="undefined"){e.exports=t}else if(typeof window!=="undefined"){window["jpeg-js"]=window["jpeg-js"]||{};window["jpeg-js"].decode=t}function t(t,e={}){var r={colorTransform:undefined,useTArray:false,formatAsRGBA:true,tolerantDecoding:true,maxResolutionInMP:100,maxMemoryUsageInMB:512};var i={...r,...e};var n=new Uint8Array(t);var s=new l;s.opts=i;l.resetMaxMemoryUsage(i.maxMemoryUsageInMB*1024*1024);s.parse(n);var o=i.formatAsRGBA?4:3;var a=s.width*s.height*o;try{l.requestMemoryAllocation(a);var u={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:i.useTArray?new Uint8Array(a):new f(a)};if(s.comments.length>0){u["comments"]=s.comments}}catch(t){if(t instanceof RangeError){throw new Error("Could not allocate enough memory for the image. "+"Required: "+a)}else{throw t}}s.copyToImageData(u,i.formatAsRGBA);return u}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:147}],67:[function(t,et,e){(function(tt){(function(){var $=$||function(t){return new tt(t).toString("base64")};function n(r){var t=this;var e=Math.round;var h=Math.floor;var c=new Array(64);var d=new Array(64);var k=new Array(64);var T=new Array(64);var S;var E;var A;var R;var w=new Array(65535);var _=new Array(65535);var Q=new Array(64);var x=new Array(64);var B=[];var O=0;var P=7;var I=new Array(64);var M=new Array(64);var j=new Array(64);var i=new Array(256);var L=new Array(2048);var n;var C=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63];var u=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0];var l=[0,1,2,3,4,5,6,7,8,9,10,11];var f=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125];var p=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250];var g=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0];var y=[0,1,2,3,4,5,6,7,8,9,10,11];var b=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119];var m=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function s(t){var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99];for(var r=0;r<64;r++){var i=h((e[r]*t+50)/100);if(i<1){i=1}else if(i>255){i=255}c[C[r]]=i}var n=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99];for(var s=0;s<64;s++){var o=h((n[s]*t+50)/100);if(o<1){o=1}else if(o>255){o=255}d[C[s]]=o}var a=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379];var u=0;for(var l=0;l<8;l++){for(var f=0;f<8;f++){k[u]=1/(c[C[u]]*a[l]*a[f]*8);T[u]=1/(d[C[u]]*a[l]*a[f]*8);u++}}}function o(t,e){var r=0;var i=0;var n=new Array;for(var s=1;s<=16;s++){for(var o=1;o<=t[s];o++){n[e[i]]=[];n[e[i]][0]=r;n[e[i]][1]=s;i++;r++}r*=2}return n}function a(){S=o(u,l);E=o(g,y);A=o(f,p);R=o(b,m)}function v(){var t=1;var e=2;for(var r=1;r<=15;r++){for(var i=t;i<e;i++){_[32767+i]=r;w[32767+i]=[];w[32767+i][1]=r;w[32767+i][0]=i}for(var n=-(e-1);n<=-t;n++){_[32767+n]=r;w[32767+n]=[];w[32767+n][1]=r;w[32767+n][0]=e-1+n}t<<=1;e<<=1}}function D(){for(var t=0;t<256;t++){L[t]=19595*t;L[t+256>>0]=38470*t;L[t+512>>0]=7471*t+32768;L[t+768>>0]=-11059*t;L[t+1024>>0]=-21709*t;L[t+1280>>0]=32768*t+8421375;L[t+1536>>0]=-27439*t;L[t+1792>>0]=-5329*t}}function F(t){var e=t[0];var r=t[1]-1;while(r>=0){if(e&1<<r){O|=1<<P}r--;P--;if(P<0){if(O==255){W(255);W(0)}else{W(O)}P=7;O=0}}}function W(t){B.push(t)}function H(t){W(t>>8&255);W(t&255)}function N(t,e){var r,i,n,s,o,a,u,l;var f=0;var h;var c=8;var d=64;for(h=0;h<c;++h){r=t[f];i=t[f+1];n=t[f+2];s=t[f+3];o=t[f+4];a=t[f+5];u=t[f+6];l=t[f+7];var p=r+l;var g=r-l;var y=i+u;var b=i-u;var m=n+a;var v=n-a;var w=s+o;var _=s-o;var x=p+w;var C=p-w;var k=y+m;var T=y-m;t[f]=x+k;t[f+4]=x-k;var S=(T+C)*.707106781;t[f+2]=C+S;t[f+6]=C-S;x=_+v;k=v+b;T=b+g;var E=(x-T)*.382683433;var A=.5411961*x+E;var R=1.306562965*T+E;var B=k*.707106781;var O=g+B;var P=g-B;t[f+5]=P+A;t[f+3]=P-A;t[f+1]=O+R;t[f+7]=O-R;f+=8}f=0;for(h=0;h<c;++h){r=t[f];i=t[f+8];n=t[f+16];s=t[f+24];o=t[f+32];a=t[f+40];u=t[f+48];l=t[f+56];var I=r+l;var M=r-l;var j=i+u;var L=i-u;var D=n+a;var F=n-a;var W=s+o;var H=s-o;var N=I+W;var U=I-W;var z=j+D;var Y=j-D;t[f]=N+z;t[f+32]=N-z;var V=(Y+U)*.707106781;t[f+16]=U+V;t[f+48]=U-V;N=H+F;z=F+L;Y=L+M;var G=(N-Y)*.382683433;var Z=.5411961*N+G;var K=1.306562965*Y+G;var X=z*.707106781;var q=M+X;var J=M-X;t[f+40]=J+Z;t[f+24]=J-Z;t[f+8]=q+K;t[f+56]=q-K;f++}var $;for(h=0;h<d;++h){$=t[h]*e[h];Q[h]=$>0?$+.5|0:$-.5|0}return Q}function U(){H(65504);H(16);W(74);W(70);W(73);W(70);W(0);W(1);W(1);W(0);H(1);H(1);W(0);W(0)}function z(t){if(!t)return;H(65505);if(t[0]===69&&t[1]===120&&t[2]===105&&t[3]===102){H(t.length+2)}else{H(t.length+5+2);W(69);W(120);W(105);W(102);W(0)}for(var e=0;e<t.length;e++){W(t[e])}}function Y(t,e){H(65472);H(17);W(8);H(e);H(t);W(3);W(1);W(17);W(0);W(2);W(17);W(1);W(3);W(17);W(1)}function V(){H(65499);H(132);W(0);for(var t=0;t<64;t++){W(c[t])}W(1);for(var e=0;e<64;e++){W(d[e])}}function G(){H(65476);H(418);W(0);for(var t=0;t<16;t++){W(u[t+1])}for(var e=0;e<=11;e++){W(l[e])}W(16);for(var r=0;r<16;r++){W(f[r+1])}for(var i=0;i<=161;i++){W(p[i])}W(1);for(var n=0;n<16;n++){W(g[n+1])}for(var s=0;s<=11;s++){W(y[s])}W(17);for(var o=0;o<16;o++){W(b[o+1])}for(var a=0;a<=161;a++){W(m[a])}}function Z(){H(65498);H(12);W(3);W(1);W(0);W(2);W(17);W(3);W(17);W(0);W(63);W(0)}function K(t,e,r,i,n){var s=n[0];var o=n[240];var a;var u=16;var l=63;var f=64;var h=N(t,e);for(var c=0;c<f;++c){x[C[c]]=h[c]}var d=x[0]-r;r=x[0];if(d==0){F(i[0])}else{a=32767+d;F(i[_[a]]);F(w[a])}var p=63;for(;p>0&&x[p]==0;p--){}if(p==0){F(s);return r}var g=1;var y;while(g<=p){var b=g;for(;x[g]==0&&g<=p;++g){}var m=g-b;if(m>=u){y=m>>4;for(var v=1;v<=y;++v)F(o);m=m&15}a=32767+x[g];F(n[(m<<4)+_[a]]);F(w[a]);g++}if(p!=l){F(s)}return r}function X(){var t=String.fromCharCode;for(var e=0;e<256;e++){i[e]=t(e)}}this.encode=function(t,e){var r=(new Date).getTime();if(e)q(e);B=new Array;O=0;P=7;H(65496);U();z(t.exifBuffer);V();Y(t.width,t.height);G();Z();var i=0;var n=0;var s=0;O=0;P=7;this.encode.displayName="_encode_";var o=t.data;var a=t.width;var u=t.height;var l=a*4;var f=a*3;var h,c=0;var d,p,g;var y,b,m,v,w;while(c<u){h=0;while(h<l){y=l*c+h;b=y;m=-1;v=0;for(w=0;w<64;w++){v=w>>3;m=(w&7)*4;b=y+v*l+m;if(c+v>=u){b-=l*(c+1+v-u)}if(h+m>=l){b-=h+m-l+4}d=o[b++];p=o[b++];g=o[b++];I[w]=(L[d]+L[p+256>>0]+L[g+512>>0]>>16)-128;M[w]=(L[d+768>>0]+L[p+1024>>0]+L[g+1280>>0]>>16)-128;j[w]=(L[d+1280>>0]+L[p+1536>>0]+L[g+1792>>0]>>16)-128}i=K(I,k,i,S,A);n=K(M,T,n,E,R);s=K(j,T,s,E,R);h+=32}c+=8}if(P>=0){var _=[];_[1]=P+1;_[0]=(1<<P+1)-1;F(_)}H(65497);if(typeof et==="undefined")return new Uint8Array(B);return new tt(B);var x="data:image/jpeg;base64,"+$(B.join(""));B=[];var C=(new Date).getTime()-r;return x};function q(t){if(t<=0){t=1}if(t>100){t=100}if(n==t)return;var e=0;if(t<50){e=Math.floor(5e3/t)}else{e=Math.floor(200-t*2)}s(e);n=t}function J(){var t=(new Date).getTime();if(!r)r=50;X();a();v();D();q(r);var e=(new Date).getTime()-t}J()}if(typeof et!=="undefined"){et.exports=t}else if(typeof window!=="undefined"){window["jpeg-js"]=window["jpeg-js"]||{};window["jpeg-js"].encode=t}function t(t,e){if(typeof e==="undefined")e=50;var r=new n(e);var i=r.encode(t,e);return{data:i,width:t.width,height:t.height}}function e(t){var e=typeof t=="string"?document.getElementById(t):t;var r=document.createElement("canvas");r.width=e.width;r.height=e.height;var i=r.getContext("2d");i.drawImage(e,0,0);return i.getImageData(0,0,r.width,r.height)}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:147}],68:[function(t,e,r){"use strict";function s(t){if(!this||!(this instanceof s)){return new s(t)}this.require=t}e.exports=s;s.property=(e,r,i,n)=>{Object.defineProperty(e,r,{configurable:true,enumerable:!!n,get:function(){var t=i(e,r);Object.defineProperty(e,r,{configurable:true,enumerable:!!n,writable:false,value:t});return t}});return e};s.prototype.property=s.property;s.properties=(e,r,i)=>{Object.keys(r).forEach(t=>{s.property(e,t,r[t],i)});return e};s.prototype.properties=s.properties;s.instanceProperty=(t,e,r,i)=>{Object.defineProperty(t,e,{configurable:true,enumerable:!!i,get:function(){var t=r(this,e);Object.defineProperty(this,e,{configurable:true,enumerable:!!i,writable:false,value:t});return t}});return t};s.prototype.instanceProperty=s.instanceProperty;s.instanceProperties=(e,r,i)=>{Object.keys(r).forEach(t=>{s.property(e,t,r[t],i)});return e};s.prototype.instanceProperties=s.instanceProperties;s.value=t=>{var e=true,r;return function(){if(e){r=t();e=false}return r}};s.prototype.value=s.value;s.require=function(i,n){var s=true,o;return new Proxy(()=>{},{construct:(t,e)=>{if(s){o=i(n);s=false}return Reflect.construct(o,e)},apply:(t,e,r)=>{if(s){o=i(n);s=false}return Reflect.apply(o,e,r)},get:(t,e)=>{if(s){o=i(n);s=false}return Reflect.get(o,e)}})};s.prototype.require=function(t){return s.require(this.require,t)};s.requireProperty=function(e,r,i,n,s){Object.defineProperty(r,i,{configurable:true,enumerable:!!s,get:function(){var t=e(n);Object.defineProperty(r,i,{configurable:true,enumerable:!!s,writable:false,value:t});return t}});return r};s.prototype.requireProperty=function(t,e,r,i){return s.requireProperty(this.require,t,e,r,i)};s.requireProperties=function(e,r,i,n){Object.keys(i).forEach(t=>{s.requireProperty(e,r,t,i[t],n)});return r};s.prototype.requireProperties=function(t,e,r){return s.requireProperties(this.require,t,e,r)}},{}],69:[function(t,e,r){"use strict";var o=t("ndarray");var a=t("./doConvert.js");e.exports=function t(e,r){var i=[],n=e,s=1;while(Array.isArray(n)){i.push(n.length);s*=n.length;n=n[0]}if(i.length===0){return o()}if(!r){r=o(new Float64Array(s),i)}a(r,e);return r}},{"./doConvert.js":70,ndarray:71}],70:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:true,rvalue:false,count:1},{name:"_inline_1_arg1_",lvalue:false,rvalue:true,count:1},{name:"_inline_1_arg2_",lvalue:false,rvalue:true,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":60}],71:[function(t,e,r){var y=t("iota-array");var i=t("is-buffer");var n=typeof Float64Array!=="undefined";function s(t,e){return t[0]-e[0]}function b(){var t=this.stride;var e=new Array(t.length);var r;for(r=0;r<e.length;++r){e[r]=[Math.abs(t[r]),r]}e.sort(s);var i=new Array(e.length);for(r=0;r<i.length;++r){i[r]=e[r][1]}return i}function f(t,e){var r=["View",e,"d",t].join("");if(e<0){r="View_Nil"+t}var i=t==="generic";if(e===-1){var n="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}";var s=new Function(n);return s()}else if(e===0){var n="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(i?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(i?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}";var s=new Function("TrivialArray",n);return s(m[t][0])}var n=["'use strict'"];var o=y(e);var a=o.map(function(t){return"i"+t});var u="this.offset+"+o.map(function(t){return"this.stride["+t+"]*i"+t}).join("+");var l=o.map(function(t){return"b"+t}).join(",");var f=o.map(function(t){return"c"+t}).join(",");n.push("function "+r+"(a,"+l+","+f+",d){this.data=a","this.shape=["+l+"]","this.stride=["+f+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e);n.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+o.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})");if(e===1){n.push("proto.order=[0]")}else{n.push("Object.defineProperty(proto,'order',{get:");if(e<4){n.push("function "+r+"_order(){");if(e===2){n.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})")}else if(e===3){n.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")}}else{n.push("ORDER})")}}n.push("proto.set=function "+r+"_set("+a.join(",")+",v){");if(i){n.push("return this.data.set("+u+",v)}")}else{n.push("return this.data["+u+"]=v}")}n.push("proto.get=function "+r+"_get("+a.join(",")+"){");if(i){n.push("return this.data.get("+u+")}")}else{n.push("return this.data["+u+"]}")}n.push("proto.index=function "+r+"_index(",a.join(),"){return "+u+"}");n.push("proto.hi=function "+r+"_hi("+a.join(",")+"){return new "+r+"(this.data,"+o.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+o.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var h=o.map(function(t){return"a"+t+"=this.shape["+t+"]"});var c=o.map(function(t){return"c"+t+"=this.stride["+t+"]"});n.push("proto.lo=function "+r+"_lo("+a.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+c.join(","));for(var d=0;d<e;++d){n.push("if(typeof i"+d+"==='number'&&i"+d+">=0){d=i"+d+"|0;b+=c"+d+"*d;a"+d+"-=d}")}n.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"c"+t}).join(",")+",b)}");n.push("proto.step=function "+r+"_step("+a.join(",")+"){var "+o.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+o.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var d=0;d<e;++d){n.push("if(typeof i"+d+"==='number'){d=i"+d+"|0;if(d<0){c+=b"+d+"*(a"+d+"-1);a"+d+"=ceil(-a"+d+"/d)}else{a"+d+"=ceil(a"+d+"/d)}b"+d+"*=d}")}n.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"b"+t}).join(",")+",c)}");var p=new Array(e);var g=new Array(e);for(var d=0;d<e;++d){p[d]="a[i"+d+"]";g[d]="b[i"+d+"]"}n.push("proto.transpose=function "+r+"_transpose("+a+"){"+a.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+p.join(",")+","+g.join(",")+",this.offset)}");n.push("proto.pick=function "+r+"_pick("+a+"){var a=[],b=[],c=this.offset");for(var d=0;d<e;++d){n.push("if(typeof i"+d+"==='number'&&i"+d+">=0){c=(c+this.stride["+d+"]*i"+d+")|0}else{a.push(this.shape["+d+"]);b.push(this.stride["+d+"])}")}n.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}");n.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map(function(t){return"shape["+t+"]"}).join(",")+","+o.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var s=new Function("CTOR_LIST","ORDER",n.join("\n"));return s(m[t],b)}function h(t){if(i(t)){return"buffer"}if(n){switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}}if(Array.isArray(t)){return"array"}return"generic"}var m={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};(function(){for(var t in m){m[t].push(f(t,-1))}});function o(t,e,r,i){if(t===undefined){var n=m.array[0];return n([])}else if(typeof t==="number"){t=[t]}if(e===undefined){e=[t.length]}var s=e.length;if(r===undefined){r=new Array(s);for(var o=s-1,a=1;o>=0;--o){r[o]=a;a*=e[o]}}if(i===undefined){i=0;for(var o=0;o<s;++o){if(r[o]<0){i-=(e[o]-1)*r[o]}}}var u=h(t);var l=m[u];while(l.length<=s+1){l.push(f(u,l.length-1))}var n=l[s+1];return n(t,e,r,i)}e.exports=o},{"iota-array":63,"is-buffer":64}],72:[function(i,n,t){(function(s,t,e){(function(){"use strict";const r=s.browser?window.setImmediate:s.nextTick;if(!t.__NEXTGEN_EVENTS__){t.__NEXTGEN_EVENTS__={recursions:0}}var l=t.__NEXTGEN_EVENTS__;function f(){}n.exports=f;f.prototype.__prototypeUID__="nextgen-events/NextGenEvents";f.prototype.__prototypeVersion__=i("../package.json").version;f.SYNC=-Infinity;f.DESYNC=-1;f.defaultMaxListeners=Infinity;f.init=function(){Object.defineProperty(this,"__ngev",{configurable:true,value:new f.Internal})};f.Internal=function(r){this.nice=f.SYNC;this.interruptible=false;this.contexts={};this.desync=e;this.depth=0;this.states={};this.stateGroups={};this.listeners={error:[],interrupt:[],newListener:[],removeListener:[]};this.hasListenerPriority=false;this.maxListeners=f.defaultMaxListeners;if(r){this.nice=r.nice;this.interruptible=r.interruptible;Object.assign(this.states,r.states),Object.assign(this.stateGroups,r.stateGroups),Object.keys(r.listeners).forEach(t=>{this.listeners[t]=r.listeners[t].slice()});Object.keys(r.contexts).forEach(t=>{var e=r.contexts[t];this.contexts[t]={nice:e.nice,ready:true,status:e.status,serial:e.serial,scopes:{}}})}};f.initFrom=function(t){if(!t.__ngev){f.init.call(t)}Object.defineProperty(this,"__ngev",{configurable:true,value:new f.Internal(t.__ngev)})};f.mergeListeners=function(s){if(!this.__ngev){f.init.call(this)}var t=this.__ngev.listeners;this.__ngev.listeners={};Object.keys(t).forEach(t=>{this.__ngev.listeners[t]=[]});s.forEach(t=>{if(!t.__ngev){f.init.call(t)}Object.keys(t.__ngev.listeners).forEach(t=>{if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}})});Object.keys(this.__ngev.listeners).forEach(e=>{var r,i,n=[];if(t[e]){t[e].forEach(t=>{for(r=0,i=s.length;r<i;r++){if(!s[r].__ngev.listeners[e]||s[r].__ngev.listeners[e].indexOf(t)===-1){n.push(t);break}}})}s.forEach(t=>{t.__ngev.listeners[e].forEach(t=>{if(this.__ngev.listeners[e].indexOf(t)===-1&&n.indexOf(t)===-1){this.__ngev.listeners[e].push(t)}})})})};f.filterOutCallback=function(t,e){return t!==e};f.prototype.addListener=function(t,e,r){var i,n;if(!this.__ngev){f.init.call(this)}if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}if(!t||typeof t!=="string"){throw new TypeError(".addListener(): argument #0 should be a non-empty string")}if(typeof e==="function"){i={};if(!r||typeof r!=="object"){r={}}}else if(r===true&&e&&typeof e==="object"){r=i=e;e=undefined}else{r=e;if(!r||typeof r!=="object"){throw new TypeError(".addListener(): a function or an object with a 'fn' property which value is a function should be provided")}e=undefined;i={}}i.fn=e||r.fn;i.id=r.id!==undefined?r.id:i.fn;if(r.unique){if(this.__ngev.listeners[t].find(t=>t.id===i.id)){return}}i.once=!!r.once;i.async=!!r.async;i.eventObject=!!r.eventObject;i.nice=r.nice!==undefined?Math.floor(r.nice):f.SYNC;i.priority=+r.priority||0;i.context=r.context&&(typeof r.context==="string"||typeof r.context==="object")?r.context:null;if(typeof i.fn!=="function"){throw new TypeError(".addListener(): a function or an object with a 'fn' property which value is a function should be provided")}if(typeof i.context==="string"){i.context=this.__ngev.contexts[i.context]||this.addListenerContext(i.context)}i.event=t;if(this.__ngev.listeners.newListener.length){n=this.__ngev.listeners.newListener.slice();this.__ngev.listeners[t].push(i);f.emitEvent({emitter:this,name:"newListener",args:[[i]],listeners:n});if(this.__ngev.states[t]){f.emitToOneListener(this.__ngev.states[t],i)}return this}this.__ngev.listeners[t].push(i);if(this.__ngev.hasListenerPriority){this.__ngev.listeners[t].sort((t,e)=>e.priority-t.priority)}if(this.__ngev.listeners[t].length===this.__ngev.maxListeners+1){s.emitWarning("Possible NextGenEvents memory leak detected. "+this.__ngev.listeners[t].length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit",{type:"MaxListenersExceededWarning"})}if(this.__ngev.states[t]){f.emitToOneListener(this.__ngev.states[t],i)}return this};f.prototype.on=f.prototype.addListener;f.prototype.once=function(t,e,r){if(e&&typeof e==="object"){e.once=true}else if(r&&typeof r==="object"){r.once=true}else{r={once:true}}return this.addListener(t,e,r)};f.prototype.waitFor=function(t){return new Promise(e=>{this.addListener(t,t=>e(t),{once:true})})};f.prototype.waitForAll=function(t){return new Promise(e=>{this.addListener(t,(...t)=>e(t),{once:true})})};f.prototype.removeListener=function(t,e){if(!t||typeof t!=="string"){throw new TypeError(".removeListener(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}var r=this.__ngev.listeners[t];if(!r||!r.length){return this}var i,n,s=0,o=r.length,a=this.__ngev.listeners.removeListener.length;if(a){n=[]}for(i=0;i<o;i++){if(r[i].id===e){s++;if(a){n.push(r[i])}}else if(s){r[i-s]=r[i]}}if(s){r.length-=s}if(a&&n.length){this.emit("removeListener",n)}return this};f.prototype.off=f.prototype.removeListener;f.prototype.removeAllListeners=function(t){var e;if(!this.__ngev){f.init.call(this)}if(t){if(!t||typeof t!=="string"){throw new TypeError(".removeAllListeners(): argument #0 should be undefined or a non-empty string")}if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}e=this.__ngev.listeners[t];this.__ngev.listeners[t]=[];if(e.length&&this.__ngev.listeners.removeListener.length){this.emit("removeListener",e)}}else{this.__ngev.listeners={error:[],interrupt:[],newListener:[],removeListener:[]}}return this};f.listenerWrapper=function(t,e,r,i,n){var s,o,a=e.master||e,u=!!e.master||e.emitter.__ngev.interruptible;if(a.interrupt){return}if(t.async){if(r){r.ready=!i}if(n<0){if(l.recursions>=-n){e.emitter.__ngev.desync(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC));return}}else{setTimeout(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC),n);return}o=t=>{a.listenersDone++;if(t&&u&&!a.interrupt&&e.name!=="interrupt"){a.interrupt=t;if(a.callback){f.emitCallback(e)}e.emitter.emit("interrupt",a.interrupt)}else if(a.listenersDone>=a.listeners.length&&a.callback){f.emitCallback(e)}if(i){f.processScopeQueue(r,true,true)}};if(t.eventObject){t.fn(e,o)}else{s=t.fn(...e.args,o)}}else{if(n<0){if(l.recursions>=-n){e.emitter.__ngev.desync(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC));return}}else{setTimeout(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC),n);return}if(t.eventObject){t.fn(e)}else{s=t.fn(...e.args)}a.listenersDone++}if(s&&u&&!a.interrupt&&e.name!=="interrupt"){a.interrupt=s;if(a.callback){f.emitCallback(e)}e.emitter.emit("interrupt",a.interrupt)}else if(a.listenersDone>=a.listeners.length&&a.callback){f.emitCallback(e)}};var h=0;f.prototype.emit=function(...t){var e=f.createEvent(this,...t);return f.emitEvent(e)};f.prototype.emitIfListener=function(...t){var e=typeof t[0]==="number"?t[1]:t[0];if(!this.__ngev||!this.__ngev.listeners[e]||!this.__ngev.listeners[e].length){return null}var r=f.createEvent(this,...t);return f.emitEvent(r)};f.prototype.waitForEmit=function(...t){return new Promise(e=>{this.emit(...t,t=>e(t))})};f.createEvent=function(t,...e){var r={emitter:t,interrupt:null,master:null,sync:true};if(typeof e[0]==="number"){r.nice=Math.floor(e[0]);r.name=e[1];if(!r.name||typeof r.name!=="string"){throw new TypeError(".emit(): when argument #0 is a number, argument #1 should be a non-empty string")}if(typeof e[e.length-1]==="function"){r.callback=e[e.length-1];r.args=e.slice(2,-1)}else{r.args=e.slice(2)}}else{r.name=e[0];if(!r.name||typeof r.name!=="string"){throw new TypeError(".emit(): argument #0 should be an number or a non-empty string")}if(typeof e[e.length-1]==="function"){r.callback=e[e.length-1];r.args=e.slice(1,-1)}else{r.args=e.slice(1)}}return r};f.emitEvent=function(t){var e=t.emitter,r,i,n=0,s,o;if(!e.__ngev){f.init.call(e)}s=e.__ngev.states[t.name];if(s!==undefined){if(s&&t.args.length===s.args.length&&t.args.every((t,e)=>t===s.args[e])){return}e.__ngev.stateGroups[t.name].forEach(t=>{e.__ngev.states[t]=null});e.__ngev.states[t.name]=t}if(!e.__ngev.listeners[t.name]){e.__ngev.listeners[t.name]=[]}t.id=h++;t.listenersDone=0;if(t.nice===undefined||t.nice===null){t.nice=e.__ngev.nice}if(!t.listeners){t.listeners=e.__ngev.listeners[t.name].slice()}l.recursions++;t.depth=e.__ngev.depth++;o=[];try{for(r=0,i=t.listeners.length;r<i;r++){n++;f.emitToOneListener(t,t.listeners[r],o)}}catch(t){l.recursions--;e.__ngev.depth--;throw t}l.recursions--;if(!t.callback){e.__ngev.depth--}if(o.length&&e.__ngev.listeners.removeListener.length){e.emit("removeListener",o)}if(!n){if(t.name==="error"){if(t.args[0]){throw t.args[0]}else{throw Error("Uncaught, unspecified 'error' event.")}}if(t.callback){f.emitCallback(t)}}t.sync=false;return t};f.emitIntricatedEvents=function(t,e){var r,i,n=0,s;if(!Array.isArray(t)){throw new TypeError(".emitCorrelatedEvents() argument should be an array")}var o=[],a={nice:f.DESYNC,ready:true,status:f.CONTEXT_ENABLED,serial:true,scopes:{}},u={sync:false,nice:f.DESYNC,context:a,interrupt:null,listeners:o,listenersDone:0,depth:0,callback:e};t.forEach(t=>{var e=f.createEvent(...t);e.master=u;if(!e.emitter.__ngev){f.init.call(e.emitter)}if(!e.emitter.__ngev.listeners[e.name]){e.emitter.__ngev.listeners[e.name]=[]}e.listeners=e.emitter.__ngev.listeners[e.name].slice();e.id=h++;e.listeners.forEach(t=>o.push({event:e,listener:t}))});o.sort((t,e)=>e.listener.priority-t.listener.priority);l.recursions++;s=[];try{for(r=0,i=o.length;r<i;r++){n++;f.emitToOneListener(o[r].event,o[r].listener,s)}}catch(t){l.recursions--;throw t}l.recursions--;if(!n&&u.callback){f.emitCallback(event)}u.sync=false};f.emitToOneListener=function(t,e,r){var i=t.emitter,n=t.master||t,s=t.master?t.master.context:e.context,o,a,u,l=false;if(s){if(s.status===f.CONTEXT_DISABLED){return}u=Math.max(n.nice,e.nice,s.nice);a=s.serial;o=f.getContextScope(s,n.depth)}else{u=Math.max(n.nice,e.nice)}if(e.once){i.__ngev.listeners[t.name]=i.__ngev.listeners[t.name].filter(f.filterOutCallback.bind(undefined,e));if(r){r.push(e)}else{l=true}}if(s&&(s.status===f.CONTEXT_QUEUED||!o.ready)){o.queue.push({event:t,listener:e,nice:u})}else{f.listenerWrapper(e,t,o,a,u)}if(l&&i.__ngev.listeners.removeListener.length){i.emit("removeListener",[e])}};f.emitCallback=function(t){var e;if(t.master){e=t.master.callback;delete t.master.callback;if(t.master.sync){r(()=>e(t.master.interrupt,t))}else{e(t.master.interrupt,t)}return}e=t.callback;delete t.callback;if(t.sync&&t.emitter.__ngev.nice!==f.SYNC){t.emitter.__ngev.desync(()=>{t.emitter.__ngev.depth--;e(t.interrupt,t)})}else{t.emitter.__ngev.depth--;e(t.interrupt,t)}};f.prototype.listeners=function(t){if(!t||typeof t!=="string"){throw new TypeError(".listeners(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}return this.__ngev.listeners[t].slice()};f.listenerCount=function(t,e){if(!t||!(t instanceof f)){throw new TypeError(".listenerCount(): argument #0 should be an instance of NextGenEvents")}return t.listenerCount(e)};f.prototype.listenerCount=function(t){if(!t||typeof t!=="string"){throw new TypeError(".listenerCount(): argument #1 should be a non-empty string")}if(!this.__ngev||!this.__ngev.listeners[t]){return 0}return this.__ngev.listeners[t].length};f.prototype.setNice=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.nice=Math.floor(+t||0)};f.prototype.desyncUseNextTick=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.desync=t?r:e};f.prototype.setInterruptible=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.interruptible=!!t};f.prototype.setListenerPriority=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.hasListenerPriority=!!t};f.share=function(t,e){if(!(t instanceof f)||!(e instanceof f)){throw new TypeError("NextGenEvents.share() arguments should be instances of NextGenEvents")}if(!t.__ngev){f.init.call(t)}Object.defineProperty(e,"__ngev",{configurable:true,value:t.__ngev})};f.reset=function(t){Object.defineProperty(t,"__ngev",{configurable:true,value:null})};f.prototype.getMaxListeners=function(){if(!this.__ngev){f.init.call(this)}return this.__ngev.maxListeners};f.prototype.setMaxListeners=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.maxListeners=typeof t==="number"&&!Number.isNaN(t)?Math.floor(t):f.defaultMaxListeners;return this};f.noop=()=>undefined;f.prototype.defineStates=function(...e){if(!this.__ngev){f.init.call(this)}e.forEach(t=>{this.__ngev.states[t]=null;this.__ngev.stateGroups[t]=e})};f.prototype.hasState=function(t){if(!this.__ngev){f.init.call(this)}return!!this.__ngev.states[t]};f.prototype.getAllStates=function(){if(!this.__ngev){f.init.call(this)}return Object.keys(this.__ngev.states).filter(t=>this.__ngev.states[t])};f.groupAddListener=function(t,e,r,i){if(typeof r!=="function"){i=r;r=undefined}if(!i||typeof i!=="object"){i={}}r=r||i.fn;delete i.fn;i.id=i.id||r;t.forEach(t=>{t.addListener(e,r.bind(undefined,t),i)})};f.groupOn=f.groupAddListener;f.groupOnce=function(t,e,r,i){if(r&&typeof r==="object"){r.once=true}else if(i&&typeof i==="object"){i.once=true}else{i={once:true}}return this.groupAddListener(t,e,r,i)};f.groupWaitFor=function(t,e){return Promise.all(t.map(t=>t.waitFor(e)))};f.groupWaitForAll=function(t,e){return Promise.all(t.map(t=>t.waitForAll(e)))};f.groupOnceFirst=function(e,r,i,n){var s,o=false;if(typeof i!=="function"){n=i;i=undefined}if(!n||typeof n!=="object"){n={}}i=i||n.fn;delete n.fn;n.id=n.id||i;s=(...t)=>{if(o){return}o=true;f.groupRemoveListener(e,r,n.id);i(...t)};e.forEach(t=>{t.once(r,s.bind(undefined,t),n)})};f.groupWaitForFirst=function(t,r){return new Promise(e=>{f.groupOnceFirst(t,r,t=>e(t))})};f.groupWaitForFirstAll=function(t,r){return new Promise(e=>{f.groupOnceFirst(t,r,(...t)=>e(t))})};f.groupOnceLast=function(t,e,r,i){var n,s=false,o=t.length;if(typeof r!=="function"){i=r;r=undefined}if(!i||typeof i!=="object"){i={}}r=r||i.fn;delete i.fn;i.id=i.id||r;n=(...t)=>{if(s){return}if(--o){return}s=true;r(...t)};t.forEach(t=>{t.once(e,n.bind(undefined,t),i)})};f.groupWaitForLast=function(t,r){return new Promise(e=>{f.groupOnceLast(t,r,t=>e(t))})};f.groupWaitForLastAll=function(t,r){return new Promise(e=>{f.groupOnceLast(t,r,(...t)=>e(t))})};f.groupRemoveListener=function(t,e,r){t.forEach(t=>{t.removeListener(e,r)})};f.groupOff=f.groupRemoveListener;f.groupRemoveAllListeners=function(t,e){t.forEach(t=>{t.removeAllListeners(e)})};f.groupEmit=function(t,...e){var r,i,n=1,s,o=t.length,a,u,l=false;if(typeof e[e.length-1]==="function"){s=-1;a=e[e.length-1];u=t=>{if(l){return}if(t){l=true;a(t)}else if(!--o){l=true;a()}}}if(typeof e[0]==="number"){n=2;i=typeof e[0]}r=e[n-1];e=e.slice(n,s);t.forEach(t=>{f.emitEvent({emitter:t,name:r,args:e,nice:i,callback:u})})};f.groupWaitForEmit=function(t,...r){return new Promise(e=>{f.groupEmit(t,...r,t=>e(t))})};f.groupDefineStates=function(t,...e){t.forEach(t=>{t.defineStates(...e)})};f.groupGlobalOnce=f.groupOnceFirst;f.groupGlobalOnceAll=f.groupOnceLast;f.CONTEXT_ENABLED=0;f.CONTEXT_DISABLED=1;f.CONTEXT_QUEUED=2;f.prototype.addListenerContext=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".addListenerContext(): argument #0 should be a non-empty string")}if(!e||typeof e!=="object"){e={}}var r=this.__ngev.contexts[t];if(!r){r=this.__ngev.contexts[t]={nice:f.SYNC,ready:true,status:f.CONTEXT_ENABLED,serial:false,scopes:{}}}if(e.nice!==undefined){r.nice=Math.floor(e.nice)}if(e.status!==undefined){r.status=e.status}if(e.serial!==undefined){r.serial=!!e.serial}return r};f.prototype.getListenerContext=function(t){return this.__ngev.contexts[t]};f.getContextScope=function(t,e){var r=t.scopes[e];if(!r){r=t.scopes[e]={ready:true,queue:[]}}return r};f.prototype.disableListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".disableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].status=f.CONTEXT_DISABLED;return this};f.prototype.enableListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".enableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}var e=this.__ngev.contexts[t];e.status=f.CONTEXT_ENABLED;Object.values(e.scopes).forEach(t=>{if(t.queue.length>0){f.processScopeQueue(t,e.serial)}});return this};f.prototype.queueListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".queueListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].status=f.CONTEXT_QUEUED;return this};f.prototype.serializeListenerContext=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".serializeListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].serial=e===undefined?true:!!e;return this};f.prototype.setListenerContextNice=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".setListenerContextNice(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].nice=Math.floor(e);return this};f.prototype.destroyListenerContext=function(t){var e,r,i,n,s,o=[];if(!t||typeof t!=="string"){throw new TypeError(".disableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}i=this.__ngev.contexts[t];if(!i){return}for(n in this.__ngev.listeners){s=null;r=this.__ngev.listeners[n].length;for(e=0;e<r;e++){if(this.__ngev.listeners[n][e].context===i){s=[];o.push(this.__ngev.listeners[n][e])}else if(s){s.push(this.__ngev.listeners[n][e])}}if(s){this.__ngev.listeners[n]=s}}delete this.__ngev.contexts[t];if(o.length&&this.__ngev.listeners.removeListener.length){this.emit("removeListener",o)}return this};f.processScopeQueue=function(t,e,r){var i,n,s,o;if(r){t.ready=true}l.recursions++;while(t.ready&&t.queue.length){i=t.queue.shift();n=i.event;s=n.master||n;o=n.emitter;if(s.interrupt){continue}f.listenerWrapper(i.listener,n,t,e,i.nice)}l.recursions--};f.on=f.prototype.on;f.once=f.prototype.once;f.off=f.prototype.off;if(t.AsyncTryCatch){f.prototype.asyncTryCatchId=t.AsyncTryCatch.NextGenEvents.length;t.AsyncTryCatch.NextGenEvents.push(f);if(t.AsyncTryCatch.substituted){t.AsyncTryCatch.substitute()}}f.Proxy=i("./Proxy.js")}).call(this)}).call(this,i("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},i("timers").setImmediate)},{"../package.json":74,"./Proxy.js":73,_process:179,timers:197}],73:[function(t,e,r){"use strict";function i(){this.localServices={};this.remoteServices={};this.nextAckId=1}e.exports=i;var s=t("./NextGenEvents.js");var o="NextGenEvents/message";function n(){}i.create=(...t)=>new i(...t);i.prototype.addLocalService=function(t,e,r){this.localServices[t]=a.create(this,t,e,r);return this.localServices[t]};i.prototype.addRemoteService=function(t){this.remoteServices[t]=u.create(this,t);return this.remoteServices[t]};i.prototype.destroy=function(){Object.keys(this.localServices).forEach(t=>{this.localServices[t].destroy();delete this.localServices[t]});Object.keys(this.remoteServices).forEach(t=>{this.remoteServices[t].destroy();delete this.remoteServices[t]});this.receive=this.send=n};i.prototype.push=function(t){if(t.__type!==o||!t.service||typeof t.service!=="string"||!t.event||typeof t.event!=="string"||!t.method){return}switch(t.method){case"event":return this.remoteServices[t.service]&&this.remoteServices[t.service].receiveEvent(t);case"ackEmit":return this.remoteServices[t.service]&&this.remoteServices[t.service].receiveAckEmit(t);case"emit":return this.localServices[t.service]&&this.localServices[t.service].receiveEmit(t);case"listen":return this.localServices[t.service]&&this.localServices[t.service].receiveListen(t);case"ignore":return this.localServices[t.service]&&this.localServices[t.service].receiveIgnore(t);case"ackEvent":return this.localServices[t.service]&&this.localServices[t.service].receiveAckEvent(t);default:return}};i.prototype.receive=function(t){this.push(t)};i.prototype.send=function(){throw new Error("The send() method of the Proxy MUST be extended/overwritten")};function a(t,e,r,i){return a.create(t,e,r,i)}i.LocalService=a;a.create=function(t,e,r,i){var n=Object.create(a.prototype,{proxy:{value:t,enumerable:true},id:{value:e,enumerable:true},emitter:{value:r,writable:true,enumerable:true},internalEvents:{value:Object.create(s.prototype),writable:true,enumerable:true},events:{value:{},enumerable:true},canListen:{value:!!i.listen,writable:true,enumerable:true},canEmit:{value:!!i.emit,writable:true,enumerable:true},canAck:{value:!!i.ack,writable:true,enumerable:true},canRpc:{value:!!i.rpc,writable:true,enumerable:true},destroyed:{value:false,writable:true,enumerable:true}});return n};a.prototype.destroy=function(){Object.keys(this.events).forEach(t=>{this.emitter.off(t,this.events[t]);delete this.events[t]});this.emitter=null;this.destroyed=true};a.prototype.receiveEmit=function(e){if(this.destroyed||!this.canEmit||e.ack&&!this.canAck){return}var t={emitter:this.emitter,name:e.event,args:e.args||[]};if(e.ack){t.callback=t=>{this.proxy.send({__type:o,service:this.id,method:"ackEmit",ack:e.ack,event:e.event,interruption:t})}}s.emitEvent(t)};a.prototype.receiveListen=function(t){if(this.destroyed||!this.canListen||t.ack&&!this.canAck){return}if(t.ack){if(this.events[t.event]){if(this.events[t.event].ack){return}this.emitter.off(t.event,this.events[t.event])}this.events[t.event]=a.forwardWithAck.bind(this);this.events[t.event].ack=true;this.emitter.on(t.event,this.events[t.event],{eventObject:true,async:true})}else{if(this.events[t.event]){if(!this.events[t.event].ack){return}this.emitter.off(t.event,this.events[t.event])}this.events[t.event]=a.forward.bind(this);this.events[t.event].ack=false;this.emitter.on(t.event,this.events[t.event],{eventObject:true})}};a.prototype.receiveIgnore=function(t){if(this.destroyed||!this.canListen){return}if(!this.events[t.event]){return}this.emitter.off(t.event,this.events[t.event]);this.events[t.event]=null};a.prototype.receiveAckEvent=function(t){if(this.destroyed||!this.canListen||!this.canAck||!t.ack||!this.events[t.event]||!this.events[t.event].ack){return}this.internalEvents.emit("ack",t)};a.forward=function(t){if(this.destroyed){return}this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,args:t.args})};a.forward.ack=false;a.forwardWithAck=function(t,e){if(this.destroyed){return}if(!t.callback){this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,args:t.args});e();return}var r=false;var i=this.proxy.nextAckId++;var n=t=>{if(r||t.ack!==i){return}r=true;this.internalEvents.off("ack",n);e()};this.internalEvents.on("ack",n);this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,ack:i,args:t.args})};a.forwardWithAck.ack=true;function u(t,e){return u.create(t,e)}i.RemoteService=u;var l=1;var f=2;u.create=function(t,e){var r=Object.create(u.prototype,{proxy:{value:t,enumerable:true},id:{value:e,enumerable:true},emitter:{value:Object.create(s.prototype),writable:true,enumerable:true},internalEvents:{value:Object.create(s.prototype),writable:true,enumerable:true},events:{value:{},enumerable:true},destroyed:{value:false,writable:true,enumerable:true}});return r};u.prototype.destroy=function(){this.emitter.removeAllListeners();this.emitter=null;Object.keys(this.events).forEach(t=>{delete this.events[t]});this.destroyed=true};u.prototype.emit=function(t,...e){if(this.destroyed){return}var r,i,n;if(typeof t==="number"){throw new TypeError("Cannot emit with a nice value on a remote service")}if(typeof e[e.length-1]!=="function"){this.proxy.send({__type:o,service:this.id,method:"emit",event:t,args:e});return}r=e.pop();i=this.proxy.nextAckId++;n=false;var s=t=>{if(n||t.ack!==i){return}n=true;this.internalEvents.off("ack",s);r(t.interruption)};this.internalEvents.on("ack",s);this.proxy.send({__type:o,service:this.id,method:"emit",ack:i,event:t,args:e})};u.prototype.addListener=function(t,e,r){if(this.destroyed){return}if(typeof e!=="function"){r=e;e=undefined}if(!r||typeof r!=="object"){r={}}r.fn=e||r.fn;this.emitter.addListener(t,r);if(!this.emitter.__ngev.listeners[t]||!this.emitter.__ngev.listeners[t].length){return}if(r.async&&this.events[t]!==f){this.events[t]=f;this.proxy.send({__type:o,service:this.id,method:"listen",ack:true,event:t})}else if(!r.async&&!this.events[t]){this.events[t]=l;this.proxy.send({__type:o,service:this.id,method:"listen",event:t})}};u.prototype.on=u.prototype.addListener;u.prototype.once=s.prototype.once;u.prototype.removeListener=function(t,e){if(this.destroyed){return}this.emitter.removeListener(t,e);if((!this.emitter.__ngev.listeners[t]||!this.emitter.__ngev.listeners[t].length)&&this.events[t]){this.events[t]=0;this.proxy.send({__type:o,service:this.id,method:"ignore",event:t})}};u.prototype.off=u.prototype.removeListener;u.prototype.receiveEvent=function(t){if(this.destroyed||!this.events[t.event]){return}var e={emitter:this.emitter,name:t.event,args:t.args||[]};if(t.ack){e.callback=()=>{this.proxy.send({__type:o,service:this.id,method:"ackEvent",ack:t.ack,event:t.event})}}s.emitEvent(e);var r=e.name;if(!this.emitter.__ngev.listeners[r]||!this.emitter.__ngev.listeners[r].length){this.events[r]=0;this.proxy.send({__type:o,service:this.id,method:"ignore",event:r})}};u.prototype.receiveAckEmit=function(t){if(this.destroyed||!t.ack||this.events[t.event]!==f){return}this.internalEvents.emit("ack",t)}},{"./NextGenEvents.js":72}],74:[function(t,e,r){e.exports={name:"nextgen-events",version:"1.5.2",description:"The next generation of events handling for javascript! New: abstract away the network!",main:"lib/NextGenEvents.js",engines:{node:">=6.0.0"},directories:{test:"test",bench:"bench"},dependencies:{},devDependencies:{browserify:"^17.0.0","uglify-js-es6":"^2.8.9",ws:"^7.4.6"},scripts:{test:"tea-time -R dot"},repository:{type:"git",url:"https://github.com/cronvel/nextgen-events.git"},keywords:["events","async","emit","listener","context","series","serialize","namespace","proxy","network"],author:"Cédric Ronvel",license:"MIT",bugs:{url:"https://github.com/cronvel/nextgen-events/issues"},config:{"tea-time":{coverDir:["lib"]}},copyright:{title:"Next-Gen Events",years:[2015,2021],owner:"Cédric Ronvel"}}},{}],75:[function(t,e,r){e.exports=t("./lib/bitmap")},{"./lib/bitmap":76}],76:[function(t,e,r){(function(o){(function(){var t=e.exports=r=function(t){this.buffer=t;this.initialized=false;this.fileHeader=null;this.infoHeader=null;this.coreHeader=null;this.colorPalette=null;this.dataPos=-1};t.prototype.CORE_TYPE_WINDOWS_V3=40;t.prototype.CORE_TYPE_WINDOWS_V4=108;t.prototype.CORE_TYPE_WINDOWS_V5=124;t.prototype.CORE_TYPE_OS2_V1=12;t.prototype.CORE_TYPE_OS2_V2=64;t.prototype.BITMAPCOREHEADER=t.prototype.CORE_TYPE_OS2_V1;t.prototype.BITMAPINFOHEADER=t.prototype.CORE_TYPE_WINDOWS_V3;t.prototype.BITMAPINFOHEADER2=t.prototype.CORE_TYPE_OS2_V2;t.prototype.BITMAPV4HEADER=t.prototype.CORE_TYPE_WINDOWS_V4;t.prototype.BITMAPV5HEADER=t.prototype.CORE_TYPE_WINDOWS_V5;t.prototype.COMPRESSION_BI_RGB=0;t.prototype.COMPRESSION_BI_RLE8=1;t.prototype.COMPRESSION_BI_RLE4=2;t.prototype.COMPRESSION_BI_BITFIELDS=3;t.prototype.COMPRESSION_BI_JPEG=4;t.prototype.COMPRESSION_BI_PNG=5;t.prototype.BITCOUNT_2=1;t.prototype.BITCOUNT_16=4;t.prototype.BITCOUNT_256=8;t.prototype.BITCOUNT_16bit=16;t.prototype.BITCOUNT_24bit=24;t.prototype.BITCOUNT_32bit=32;t.prototype.init=function(){this.readFileHeader();this.readInfoHeader();this.readCoreHeader();this.readColorPalette();this.initDataPos();this.initialized=true};t.prototype.checkInit=function(){if(!this.initialized){throw new Error("not initialized")}};t.prototype.isBitmap=function(){this.checkInit();if("BM"==this.fileHeader.bfType){return true}return false};t.prototype.getData=function(){this.checkInit();if(this.COMPRESSION_BI_RGB!==this.coreHeader.__copmression__){throw new Error("not supported compression: "+this.coreHeader.__copmression__)}var t=this.coreHeader.__bitCount__;var e=this.getWidth();var r=this.getHeight();var i=e*t/8;if(0!=i%4){i=(i/4+1)*4}var n=[];var s=this.dataPos;for(var o=0;o<r;++o){var a=s+i*(r-(o+1));var u=this.buffer.slice(a,a+i);var l=this.mapColor(u,t);n.push(l)}return n};t.prototype.getWidth=function(){this.checkInit();return this.coreHeader.__width__};t.prototype.getHeight=function(){this.checkInit();return this.coreHeader.__height__};t.prototype.read=function(t,e,r){var i=[];for(var n=e,s=e+r;n<s;++n){i.push(t.readInt8(n))}return new o(i)};t.prototype.readFileHeader=function(){var t=this.read(this.buffer,0,2);var e=this.read(this.buffer,2,4);var r=this.read(this.buffer,6,2);var i=this.read(this.buffer,8,2);var n=this.read(this.buffer,10,4);this.fileHeader={bfType:t.toString("ascii"),_bfType:t,bfSize:e.readUInt16LE(0),_bfSize:e,bfReserved1:0,bfReserved2:0,bfOffBits:n.readUInt16LE(0),_bfOffBits:n}};t.prototype.readInfoHeader=function(){this.infoHeader=this.read(this.buffer,14,4)};t.prototype.readCoreHeader=function(){var t=this.infoHeader.readUInt16LE(0);switch(t){case this.BITMAPCOREHEADER:return this.readCoreHeaderOS2_V1();case this.BITMAPINFOHEADER2:return this.readCoreHeaderOS2_V2();case this.BITMAPV4HEADER:return this.readCoreHeaderWINDOWS_V4();case this.BITMAPV5HEADER:return this.readCoreHeaderWINDOWS_V5();case this.BITMAPINFOHEADER:return this.readCoreHeaderWINDOWS_V3();default:throw new Error("unknown coreType: "+t)}};t.prototype.readCoreHeaderWINDOWS_V3=function(){var t=this.read(this.buffer,18,4);var e=this.read(this.buffer,22,4);var r=this.read(this.buffer,26,2);var i=this.read(this.buffer,28,2);var n=this.read(this.buffer,30,4);var s=this.read(this.buffer,34,4);var o=this.read(this.buffer,38,4);var a=this.read(this.buffer,42,4);var u=this.read(this.buffer,46,4);var l=this.read(this.buffer,50,4);this.coreHeader={__copmression__:n.readUInt16LE(0),__bitCount__:i.readUInt8(0),__width__:t.readUInt16LE(0),__height__:e.readUInt16LE(0),biWidth:t.readUInt16LE(0),_biWidth:t,biHeight:e.readUInt16LE(0),_biHeight:e,biPlanes:r.readUInt8(0),_biPlanes:r,biBitCount:i.readUInt8(0),_biBitCount:i,biCopmression:n.readUInt16LE(0),_biCopmression:n,biSizeImage:s.readUInt16LE(0),_biSizeImage:s,biXPixPerMeter:o.readUInt16LE(0),_biXPixPerMeter:o,biYPixPerMeter:a.readUInt16LE(0),_biYPixPerMeter:a,biClrUsed:u.readUInt16LE(0),_biClrUsed:u,biCirImportant:l.readUInt16LE(0),_biCirImportant:l}};t.prototype.readCoreHeaderWINDOWS_V4=function(){throw new Error("not yet impl");var t=this.read(this.buffer,18,4);var e=this.read(this.buffer,22,4);var r=this.read(this.buffer,26,2);var i=this.read(this.buffer,28,2);var n=this.read(this.buffer,30,4);var s=this.read(this.buffer,34,4);var o=this.read(this.buffer,38,4);var a=this.read(this.buffer,42,4);var u=this.read(this.buffer,46,4);var l=this.read(this.buffer,50,4);var f=this.read(this.buffer,54,4);var h=this.read(this.buffer,58,4);var c=this.read(this.buffer,62,4);var d=this.read(this.buffer,66,4);var p=this.read(this.buffer,70,4);var g=this.read(this.buffer,106,36);var y=this.read(this.buffer,110,4);var b=this.read(this.buffer,114,4);var m=this.read(this.buffer,118,4);this.coreHeader={__compression__:n.readUInt16LE(0),__bitCount__:i.readUInt8(0),__width__:t.readUInt16LE(0),__height__:e.readUInt16LE(0),bV4Width:t.readUInt16LE(0),_bV4Width:t,bV4Height:e.readUInt16LE(0),_bV4Height:e,bV4Planes:r.readUInt8(0),_bV4Planes:r,bV4BitCount:i.readUInt8(0),_bV4BitCount:i,bV4Compression:n.readUInt16LE(0),_bV4Compression:n,bV4SizeImage:s.readUInt16LE(0),_bV4SizeImage:s,bV4XPelsPerMeter:o.readUInt16LE(0),_bV4XPelsPerMeter:o,bV4YPelsPerMeter:a.readUInt16LE(0),_bV4YPelsPerMeter:a,bV4ClrUsed:u.readUInt16LE(0),_bV4ClrUsed:u,bV4ClrImportant:l.readUInt16LE(0),_bV4ClrImportant:l,bV4RedMask:f.readUInt16LE(0),_bV4RedMask:f,bV4GreenMask:h.readUInt16LE(0),_bV4GreenMask:h,bV4BlueMask:c.readUInt16LE(0),_bV4BlueMask:c,bV4AlphaMask:d.readUInt16LE(0),_bV4AlphaMask:d,bV4CSType:p.readUInt16LE(0),_bV4CSType:p,bV4Endpoints:null,_bV4Endpoints:g,bV4GammaRed:y.readUInt16LE(0),_bV4GammaRed:y,bV4GammaGreen:b.readUInt16LE(0),_bV4GammaGreen:b,bV4GammaBlue:m.readUInt16LE(0),_bV4GammaBlue:m}};t.prototype.readCoreHeaderWINDOWS_V5=function(){throw new Error("not yet impl");var t=this.read(this.buffer,18,4);var e=this.read(this.buffer,22,4);var r=this.read(this.buffer,26,2);var i=this.read(this.buffer,28,2);var n=this.read(this.buffer,30,4);var s=this.read(this.buffer,34,4);var o=this.read(this.buffer,38,4);var a=this.read(this.buffer,42,4);var u=this.read(this.buffer,46,4);var l=this.read(this.buffer,50,4);var f=this.read(this.buffer,54,4);var h=this.read(this.buffer,58,4);var c=this.read(this.buffer,62,4);var d=this.read(this.buffer,66,4);var p=this.read(this.buffer,70,4);var g=this.read(this.buffer,106,36);var y=this.read(this.buffer,110,4);var b=this.read(this.buffer,114,4);var m=this.read(this.buffer,118,4);var v=this.read(this.buffer,122,4);var w=this.read(this.buffer,126,4);var _=this.read(this.buffer,130,4);var x=this.read(this.buffer,134,4);this.coreHeader={__compression__:n.readUInt16LE(0),__bitCount__:i.readUInt8(0),__width__:t.readUInt16LE(0),__height__:e.readUInt16LE(0),bV5Width:t.readUInt16LE(0),_bV5Width:t,bV5Height:e.readUInt16LE(0),_bV5Height:e,bV5Planes:r.readUInt8(0),_bV5Planes:r,bV5BitCount:i.readUInt8(0),_bV5BitCount:i,bV5Compression:n.readUInt16LE(0),_bV5Compression:n,bV5SizeImage:s.readUInt16LE(0),_bV5SizeImage:s,bV5XPelsPerMeter:o.readUInt16LE(0),_bV5XPelsPerMeter:o,bV5YPelsPerMeter:a.readUInt16LE(0),_bV5YPelsPerMeter:a,bV5ClrUsed:u.readUInt16LE(0),_bV5ClrUsed:u,bV5ClrImportant:l.readUInt16LE(0),_bV5ClrImportant:l,bV5RedMask:f.readUInt16LE(0),_bV5RedMask:f,bV5GreenMask:h.readUInt16LE(0),_bV5GreenMask:h,bV5BlueMask:c.readUInt16LE(0),_bV5BlueMask:c,bV5AlphaMask:d.readUInt16LE(0),_bV5AlphaMask:d,bV5CSType:p.readUInt16LE(0),_bV5CSType:p,bV5Endpoints:null,_bV5Endpoints:g,bV5GammaRed:y.readUInt16LE(0),_bV5GammaRed:y,bV5GammaGreen:b.readUInt16LE(0),_bV5GammaGreen:b,bV5GammaBlue:m.readUInt16LE(0),_bV5GammaBlue:m,bV5Intent:v.readUInt16LE(0),_bV5Intent:v,bV5ProfileData:w.readUInt16LE(0),_bV5ProfileData:w,bV5ProfileSize:_.readUInt16LE(0),_bV5ProfileSize:_,bV5Reserved:0,_bV5Reserved:x}};t.prototype.readCoreHeaderOS2_V1=function(){throw new Error("not yet impl");var t=this.read(this.buffer,18,2);var e=this.read(this.buffer,20,2);var r=this.read(this.buffer,22,2);var i=this.read(this.buffer,24,2);this.coreHeader={__compression__:0,__bitCount__:i.readUInt8(0),__width__:t.readUInt8(0),__height__:e.readUInt8(0),bcWidth:t.readUInt8(0),_bcWidth:t,bcHeight:e.readUInt8(0),_bcHeight:e,bcPlanes:r.readUInt8(0),_bcPlanes:r,bcBitCount:i.readUInt8(0),_bcBitCount:i}};t.prototype.readCoreHeaderOS2_V2=function(){throw new Error("not yet impl");var t=this.read(this.buffer,18,4);var e=this.read(this.buffer,22,4);var r=this.read(this.buffer,26,2);var i=this.read(this.buffer,28,2);var n=this.read(this.buffer,30,4);var s=this.read(this.buffer,34,4);var o=this.read(this.buffer,38,4);var a=this.read(this.buffer,42,4);var u=this.read(this.buffer,46,4);var l=this.read(this.buffer,50,4);var f=this.read(this.buffer,54,2);var h=this.read(this.buffer,56,2);var c=this.read(this.buffer,58,2);var d=this.read(this.buffer,60,2);var p=this.read(this.buffer,62,4);var g=this.read(this.buffer,66,4);var y=this.read(this.buffer,70,4);var b=this.read(this.buffer,74,4);this.coreHeader={__compression__:n.readUInt16LE(0),__bitCount__:i.readUInt8(0),__width__:t.readUInt16LE(0),__height__:e.readUInt16LE(0),cx:t.readUInt16LE(0),_cx:t,cy:e.readUInt16LE(0),_cy:e,cPlanes:r.readUInt8(0),_cPlanes:r,cBitCount:i.readUInt8(0),_cBitCount:i,ulCompression:n.readUInt16LE(0),_ulCompression:n,cbImage:s.readUInt16LE(0),_cbImage:s,cxResolution:o.readUInt16LE(0),_cxResolution:o,cyResolution:a.readUInt16LE(0),_cyResolution:a,cclrUsed:u.readUInt16LE(0),_cclrUsed:u,cclrImportant:l.readUInt16LE(0),_cclrImportant:l,usUnits:f.readUInt8(0),_usUnits:f,usReserved:h.readUInt8(0),_usReserved:h,usRecording:c.readUInt8(0),_usRecording:c,usRendering:d.readUInt8(0),_usRendering:d,cSize1:p.readUInt16LE(0),_cSize1:p,cSize2:g.readUInt16LE(0),_cSize1:p,ulColorEncoding:y.readUInt16LE(0),_ulColorEncoding:y,ulIdentifier:b.readUInt16LE(0),_ulIdentifier:b}};t.prototype.readColorPalette=function(){var t=this.coreHeader.__bitCount__;if(this.BITCOUNT_16bit==t){return}if(this.BITCOUNT_24bit==t){return}if(this.BITCOUNT_32bit==t){return}var e=this.infoHeader.readUInt16LE(0);switch(e){case this.BITMAPCOREHEADER:return this.readColorPalette_RGBTRIPLE(t,26);case this.BITMAPINFOHEADER2:return this.readColorPalette_RGBTRIPLE(t,78);case this.BITMAPV4HEADER:return this.readColorPalette_RGBQUAD(t,122);case this.BITMAPV5HEADER:return this.readColorPalette_RGBQUAD(t,138);case this.BITMAPINFOHEADER:return this.readColorPalette_RGBQUAD(t,54);default:throw new Error("unknown colorPalette: "+e+","+t)}};t.prototype.readColorPalette_RGBTRIPLE=function(t,e){throw new Error("not yet impl")};t.prototype.readColorPalette_RGBQUAD=function(t,e){if(this.BITCOUNT_2==t){return this.readRGBQUAD(1<<this.BITCOUNT_2,e)}if(this.BITCOUNT_16==t){return this.readRGBQUAD(1<<this.BITCOUNT_16,e)}if(this.BITCOUNT_256==t){return this.readRGBQUAD(1<<this.BITCOUNT_256,e)}throw new Error("unknown bitCount: "+t)};t.prototype.readRGBQUAD=function(t,e){var r=[];for(var i=e,n=e+4*t;i<n;i+=4){r.push({rgbBlue:this.read(this.buffer,i,1).readUInt8(0),rgbGreen:this.read(this.buffer,i+1,1).readUInt8(0),rgbRed:this.read(this.buffer,i+2,1).readUInt8(0),rgbReserved:this.read(this.buffer,i+3,1).readUInt8(0)})}this.colorPalette=r};t.prototype.initDataPos=function(){var t=this.coreHeader.__bitCount__;var e=true;if(this.BITCOUNT_16bit==t){e=true}if(this.BITCOUNT_24bit==t){e=true}if(this.BITCOUNT_32bit==t){e=true}var r=this.infoHeader.readUInt16LE(0);switch(r){case this.BITMAPCOREHEADER:this.dataPos=26;if(e){this.dataPos=this.dataPos+3*(1<<t)}break;case this.BITMAPINFOHEADER2:this.dataPos=78;if(e){this.dataPos=this.dataPos+3*(1<<t)}break;case this.BITMAPV4HEADER:this.dataPos=122;if(e){this.dataPos=this.dataPos+4*(1<<t)}break;case this.BITMAPV5HEADER:this.dataPos=138;if(e){this.dataPos=this.dataPos+4*(1<<t)}case this.BITMAPINFOHEADER:this.dataPos=54;if(e){this.dataPos=this.dataPos+4*(1<<t)}break;default:throw new Error("unknown colorPalette: "+r+","+t)}};t.prototype.mapRGBA=function(t,e,r,i){var n=[];var s=function(t){var e=t.toString(16);if(t<15){return"0"+e}return e};n.push(s(t));n.push(s(e));n.push(s(r));return"#"+n.join("")};t.prototype.mapColor=function(t,e){var r,i,n,s;var o=t.length;var a=[];if(this.BITCOUNT_2==e){for(var u=0;u<o;++u){var l=t[u];var f=l.toString(2);f=new Array(8-f.length).join("0")+f;for(var h=0;h<f.length;++h){var c=parseInt(f.substring(h,h+1),10);var d=this.colorPalette[c];a.push(this.mapRGBA(d.rgbRed,d.rgbGreen,d.rgbBlue,-1))}}return a}if(this.BITCOUNT_16==e){for(var u=0;u<o;u+=2){var p=t.readUInt8(u);var g=t.readUInt8(u+1);var y=[p,g];y.forEach(function(t){var e=this.colorPalette[t];a.push(this.mapRGBA(e.rgbRed,e.rgbGreen,e.rgbBlue,-1))})}return a}if(this.BITCOUNT_256==e){for(var u=0;u<o;++u){var c=t.readUInt16LE(u);var d=this.colorPalette[c];a.push(this.mapRGBA(d.rgbRed,d.rgbGreen,d.rgbBlue,-1))}return a}if(this.BITCOUNT_16bit==e){for(var u=0;u<o;u+=3){r=t[u];i=t[u+1];n=t[u+2];a.push(this.mapRGBA(n,i,r,-1))}return a}if(this.BITCOUNT_24bit==e){for(var u=0;u<o;u+=3){r=t[u];i=t[u+1];n=t[u+2];a.push(this.mapRGBA(n,i,r,-1))}return a}if(this.BITCOUNT_32bit==e){for(var u=0;u<o;u+=4){r=t[u];i=t[u+1];n=t[u+2];s=t[u+3];a.push(this.mapRGBA(n,i,r,s))}return a}throw new Error("unknown bitCount: "+e)}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:147}],77:[function(t,e,r){"use strict";function i(b,t,e,r){var m=0;var r=r===undefined?{}:r;var i=r.loop===undefined?null:r.loop;var v=r.palette===undefined?null:r.palette;if(t<=0||e<=0||t>65535||e>65535)throw new Error("Width/Height invalid.");function w(t){var e=t.length;if(e<2||e>256||e&e-1){throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.")}return e}b[m++]=71;b[m++]=73;b[m++]=70;b[m++]=56;b[m++]=57;b[m++]=97;var n=0;var s=0;if(v!==null){var o=w(v);while(o>>=1)++n;o=1<<n;--n;if(r.background!==undefined){s=r.background;if(s>=o)throw new Error("Background index out of range.");if(s===0)throw new Error("Background index explicitly passed as 0.")}}b[m++]=t&255;b[m++]=t>>8&255;b[m++]=e&255;b[m++]=e>>8&255;b[m++]=(v!==null?128:0)|n;b[m++]=s;b[m++]=0;if(v!==null){for(var a=0,u=v.length;a<u;++a){var l=v[a];b[m++]=l>>16&255;b[m++]=l>>8&255;b[m++]=l&255}}if(i!==null){if(i<0||i>65535)throw new Error("Loop count invalid.");b[m++]=33;b[m++]=255;b[m++]=11;b[m++]=78;b[m++]=69;b[m++]=84;b[m++]=83;b[m++]=67;b[m++]=65;b[m++]=80;b[m++]=69;b[m++]=50;b[m++]=46;b[m++]=48;b[m++]=3;b[m++]=1;b[m++]=i&255;b[m++]=i>>8&255;b[m++]=0}var _=false;this.addFrame=function(t,e,r,i,n,s){if(_===true){--m;_=false}s=s===undefined?{}:s;if(t<0||e<0||t>65535||e>65535)throw new Error("x/y invalid.");if(r<=0||i<=0||r>65535||i>65535)throw new Error("Width/Height invalid.");if(n.length<r*i)throw new Error("Not enough pixels for the frame size.");var o=true;var a=s.palette;if(a===undefined||a===null){o=false;a=v}if(a===undefined||a===null)throw new Error("Must supply either a local or global palette.");var u=w(a);var l=0;while(u>>=1)++l;u=1<<l;var f=s.delay===undefined?0:s.delay;var h=s.disposal===undefined?0:s.disposal;if(h<0||h>3)throw new Error("Disposal out of range.");var c=false;var d=0;if(s.transparent!==undefined&&s.transparent!==null){c=true;d=s.transparent;if(d<0||d>=u)throw new Error("Transparent color index.")}if(h!==0||c||f!==0){b[m++]=33;b[m++]=249;b[m++]=4;b[m++]=h<<2|(c===true?1:0);b[m++]=f&255;b[m++]=f>>8&255;b[m++]=d;b[m++]=0}b[m++]=44;b[m++]=t&255;b[m++]=t>>8&255;b[m++]=e&255;b[m++]=e>>8&255;b[m++]=r&255;b[m++]=r>>8&255;b[m++]=i&255;b[m++]=i>>8&255;b[m++]=o===true?128|l-1:0;if(o===true){for(var p=0,g=a.length;p<g;++p){var y=a[p];b[m++]=y>>16&255;b[m++]=y>>8&255;b[m++]=y&255}}m=x(b,m,l<2?2:l,n);return m};this.end=function(){if(_===false){b[m++]=59;_=true}return m};this.getOutputBuffer=function(){return b};this.setOutputBuffer=function(t){b=t};this.getOutputBufferPosition=function(){return m};this.setOutputBufferPosition=function(t){m=t}}function x(e,r,t,i){e[r++]=t;var n=r++;var s=1<<t;var o=s-1;var a=s+1;var u=a+1;var l=t+1;var f=0;var h=0;function c(t){while(f>=t){e[r++]=h&255;h>>=8;f-=8;if(r===n+256){e[n]=255;n=r++}}}function d(t){h|=t<<f;f+=l;c(8)}var p=i[0]&o;var g={};d(s);for(var y=1,b=i.length;y<b;++y){var m=i[y]&o;var v=p<<8|m;var w=g[v];if(w===undefined){h|=p<<f;f+=l;while(f>=8){e[r++]=h&255;h>>=8;f-=8;if(r===n+256){e[n]=255;n=r++}}if(u===4096){d(s);u=a+1;l=t+1;g={}}else{if(u>=1<<l)++l;g[v]=u++}p=m}else{p=w}}d(p);d(a);c(1);if(n+1===r){e[n]=0}else{e[n]=r-n-1;e[r++]=0}return r}function n(_){var t=0;if(_[t++]!==71||_[t++]!==73||_[t++]!==70||_[t++]!==56||(_[t++]+1&253)!==56||_[t++]!==97){throw new Error("Invalid GIF 87a/89a header.")}var x=_[t++]|_[t++]<<8;var e=_[t++]|_[t++]<<8;var r=_[t++];var i=r>>7;var n=r&7;var s=1<<n+1;var o=_[t++];_[t++];var a=null;var u=null;if(i){a=t;u=s;t+=s*3}var l=true;var f=[];var h=0;var c=null;var d=0;var p=null;this.width=x;this.height=e;while(l&&t<_.length){switch(_[t++]){case 33:switch(_[t++]){case 255:if(_[t]!==11||_[t+1]==78&&_[t+2]==69&&_[t+3]==84&&_[t+4]==83&&_[t+5]==67&&_[t+6]==65&&_[t+7]==80&&_[t+8]==69&&_[t+9]==50&&_[t+10]==46&&_[t+11]==48&&_[t+12]==3&&_[t+13]==1&&_[t+16]==0){t+=14;p=_[t++]|_[t++]<<8;t++}else{t+=12;while(true){var g=_[t++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;t+=g}}break;case 249:if(_[t++]!==4||_[t+4]!==0)throw new Error("Invalid graphics extension block.");var y=_[t++];h=_[t++]|_[t++]<<8;c=_[t++];if((y&1)===0)c=null;d=y>>2&7;t++;break;case 254:while(true){var g=_[t++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;t+=g}break;default:throw new Error("Unknown graphic control label: 0x"+_[t-1].toString(16))}break;case 44:var b=_[t++]|_[t++]<<8;var m=_[t++]|_[t++]<<8;var v=_[t++]|_[t++]<<8;var w=_[t++]|_[t++]<<8;var C=_[t++];var k=C>>7;var T=C>>6&1;var S=C&7;var E=1<<S+1;var A=a;var R=u;var B=false;if(k){var B=true;A=t;R=E;t+=E*3}var O=t;t++;while(true){var g=_[t++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;t+=g}f.push({x:b,y:m,width:v,height:w,has_local_palette:B,palette_offset:A,palette_size:R,data_offset:O,data_length:t-O,transparent_index:c,interlaced:!!T,delay:h,disposal:d});break;case 59:l=false;break;default:throw new Error("Unknown gif block: 0x"+_[t-1].toString(16));break}}this.numFrames=function(){return f.length};this.loopCount=function(){return p};this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]};this.decodeAndBlitFrameBGRA=function(t,e){var r=this.frameInfo(t);var i=r.width*r.height;var n=new Uint8Array(i);P(_,r.data_offset,n,i);var s=r.palette_offset;var o=r.transparent_index;if(o===null)o=256;var a=r.width;var u=x-a;var l=a;var f=(r.y*x+r.x)*4;var h=((r.y+r.height)*x+r.x)*4;var c=f;var d=u*4;if(r.interlaced===true){d+=x*4*7}var p=8;for(var g=0,y=n.length;g<y;++g){var b=n[g];if(l===0){c+=d;l=a;if(c>=h){d=u*4+x*4*(p-1);c=f+(a+u)*(p<<1);p>>=1}}if(b===o){c+=4}else{var m=_[s+b*3];var v=_[s+b*3+1];var w=_[s+b*3+2];e[c++]=w;e[c++]=v;e[c++]=m;e[c++]=255}--l}};this.decodeAndBlitFrameRGBA=function(t,e){var r=this.frameInfo(t);var i=r.width*r.height;var n=new Uint8Array(i);P(_,r.data_offset,n,i);var s=r.palette_offset;var o=r.transparent_index;if(o===null)o=256;var a=r.width;var u=x-a;var l=a;var f=(r.y*x+r.x)*4;var h=((r.y+r.height)*x+r.x)*4;var c=f;var d=u*4;if(r.interlaced===true){d+=x*4*7}var p=8;for(var g=0,y=n.length;g<y;++g){var b=n[g];if(l===0){c+=d;l=a;if(c>=h){d=u*4+x*4*(p-1);c=f+(a+u)*(p<<1);p>>=1}}if(b===o){c+=4}else{var m=_[s+b*3];var v=_[s+b*3+1];var w=_[s+b*3+2];e[c++]=m;e[c++]=v;e[c++]=w;e[c++]=255}--l}}}function P(t,e,r,i){var n=t[e++];var s=1<<n;var o=s+1;var a=o+1;var u=n+1;var l=(1<<u)-1;var f=0;var h=0;var c=0;var d=t[e++];var p=new Int32Array(4096);var g=null;while(true){while(f<16){if(d===0)break;h|=t[e++]<<f;f+=8;if(d===1){d=t[e++]}else{--d}}if(f<u)break;var y=h&l;h>>=u;f-=u;if(y===s){a=o+1;u=n+1;l=(1<<u)-1;g=null;continue}else if(y===o){break}var b=y<a?y:g;var m=0;var v=b;while(v>s){v=p[v]>>8;++m}var w=v;var _=c+m+(b!==y?1:0);if(_>i){console.log("Warning, gif stream longer than expected.");return}r[c++]=w;c+=m;var x=c;if(b!==y)r[c++]=w;v=b;while(m--){v=p[v];r[--x]=v&255;v>>=8}if(g!==null&&a<4096){p[a++]=g<<8|w;if(a>=l+1&&u<12){++u;l=l<<1|1}}g=y}if(c!==i){console.log("Warning, gif stream shorter than expected.")}return r}try{r.GifWriter=i;r.GifReader=n}catch(t){}},{}],78:[function(t,e,r){(function(b){(function(){"use strict";let d=t("./interlace");let f=[function(){},function(t,e,r,i){if(i===e.length){throw new Error("Ran out of data")}let n=e[i];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=255},function(t,e,r,i){if(i+1>=e.length){throw new Error("Ran out of data")}let n=e[i];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=e[i+1]},function(t,e,r,i){if(i+2>=e.length){throw new Error("Ran out of data")}t[r]=e[i];t[r+1]=e[i+1];t[r+2]=e[i+2];t[r+3]=255},function(t,e,r,i){if(i+3>=e.length){throw new Error("Ran out of data")}t[r]=e[i];t[r+1]=e[i+1];t[r+2]=e[i+2];t[r+3]=e[i+3]}];let h=[function(){},function(t,e,r,i){let n=e[0];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=i},function(t,e,r){let i=e[0];t[r]=i;t[r+1]=i;t[r+2]=i;t[r+3]=e[1]},function(t,e,r,i){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=i},function(t,e,r){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=e[3]}];function p(l,f){let h=[];let c=0;function r(){if(c===l.length){throw new Error("Ran out of data")}let t=l[c];c++;let e,r,i,n,s,o,a,u;switch(f){default:throw new Error("unrecognised depth");case 16:a=l[c];c++;h.push((t<<8)+a);break;case 4:a=t&15;u=t>>4;h.push(u,a);break;case 2:s=t&3;o=t>>2&3;a=t>>4&3;u=t>>6&3;h.push(u,a,o,s);break;case 1:e=t&1;r=t>>1&1;i=t>>2&1;n=t>>3&1;s=t>>4&1;o=t>>5&1;a=t>>6&1;u=t>>7&1;h.push(u,a,o,s,n,i,r,e);break}}return{get:function(t){while(h.length<t){r()}let e=h.slice(0,t);h=h.slice(t);return e},resetAfterLine:function(){h.length=0},end:function(){if(c!==l.length){throw new Error("extra data found")}}}}function g(t,i,n,s,o,a){let u=t.width;let e=t.height;let l=t.index;for(let r=0;r<e;r++){for(let e=0;e<u;e++){let t=n(e,r,l);f[s](i,o,t,a);a+=s}}return a}function y(t,n,s,o,a,u){let e=t.width;let r=t.height;let l=t.index;for(let i=0;i<r;i++){for(let r=0;r<e;r++){let t=a.get(o);let e=s(r,i,l);h[o](n,t,e,u)}a.resetAfterLine()}}r.dataToBitMap=function(e,t){let r=t.width;let i=t.height;let n=t.depth;let s=t.bpp;let o=t.interlace;let a;if(n!==8){a=p(e,n)}let u;if(n<=8){u=b.alloc(r*i*4)}else{u=new Uint16Array(r*i*4)}let l=Math.pow(2,n)-1;let f=0;let h;let c;if(o){h=d.getImagePasses(r,i);c=d.getInterlaceIterator(r,i)}else{let e=0;c=function(){let t=e;e+=4;return t};h=[{width:r,height:i}]}for(let t=0;t<h.length;t++){if(n===8){f=g(h[t],u,c,s,e,f)}else{y(h[t],u,c,s,a,l)}}if(n===8){if(f!==e.length){throw new Error("extra data found")}}else{a.end()}return u}}).call(this)}).call(this,t("buffer").Buffer)},{"./interlace":88,buffer:147}],79:[function(e,r,t){(function(t){(function(){"use strict";let g=e("./constants");r.exports=function(e,r,i,n){let s=[g.COLORTYPE_COLOR_ALPHA,g.COLORTYPE_ALPHA].indexOf(n.colorType)!==-1;if(n.colorType===n.inputColorType){let t=function(){let t=new ArrayBuffer(2);new DataView(t).setInt16(0,256,true);return new Int16Array(t)[0]!==256}();if(n.bitDepth===8||n.bitDepth===16&&t){return e}}let o=n.bitDepth!==16?e:new Uint16Array(e.buffer);let a=255;let u=g.COLORTYPE_TO_BPP_MAP[n.inputColorType];if(u===4&&!n.inputHasAlpha){u=3}let l=g.COLORTYPE_TO_BPP_MAP[n.colorType];if(n.bitDepth===16){a=65535;l*=2}let f=t.alloc(r*i*l);let h=0;let c=0;let d=n.bgColor||{};if(d.red===undefined){d.red=a}if(d.green===undefined){d.green=a}if(d.blue===undefined){d.blue=a}function p(){let t;let e;let r;let i=a;switch(n.inputColorType){case g.COLORTYPE_COLOR_ALPHA:i=o[h+3];t=o[h];e=o[h+1];r=o[h+2];break;case g.COLORTYPE_COLOR:t=o[h];e=o[h+1];r=o[h+2];break;case g.COLORTYPE_ALPHA:i=o[h+1];t=o[h];e=t;r=t;break;case g.COLORTYPE_GRAYSCALE:t=o[h];e=t;r=t;break;default:throw new Error("input color type:"+n.inputColorType+" is not supported at present")}if(n.inputHasAlpha){if(!s){i/=a;t=Math.min(Math.max(Math.round((1-i)*d.red+i*t),0),a);e=Math.min(Math.max(Math.round((1-i)*d.green+i*e),0),a);r=Math.min(Math.max(Math.round((1-i)*d.blue+i*r),0),a)}}return{red:t,green:e,blue:r,alpha:i}}for(let t=0;t<i;t++){for(let t=0;t<r;t++){let e=p(o,h);switch(n.colorType){case g.COLORTYPE_COLOR_ALPHA:case g.COLORTYPE_COLOR:if(n.bitDepth===8){f[c]=e.red;f[c+1]=e.green;f[c+2]=e.blue;if(s){f[c+3]=e.alpha}}else{f.writeUInt16BE(e.red,c);f.writeUInt16BE(e.green,c+2);f.writeUInt16BE(e.blue,c+4);if(s){f.writeUInt16BE(e.alpha,c+6)}}break;case g.COLORTYPE_ALPHA:case g.COLORTYPE_GRAYSCALE:{let t=(e.red+e.green+e.blue)/3;if(n.bitDepth===8){f[c]=t;if(s){f[c+1]=e.alpha}}else{f.writeUInt16BE(t,c);if(s){f.writeUInt16BE(e.alpha,c+2)}}break}default:throw new Error("unrecognised color Type "+n.colorType)}h+=u;c+=l}}return f}}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":81,buffer:147}],80:[function(n,s,t){(function(i,o){(function(){"use strict";let t=n("util");let e=n("stream");let r=s.exports=function(){e.call(this);this._buffers=[];this._buffered=0;this._reads=[];this._paused=false;this._encoding="utf8";this.writable=true};t.inherits(r,e);r.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e});i.nextTick(function(){this._process();if(this._paused&&this._reads&&this._reads.length>0){this._paused=false;this.emit("drain")}}.bind(this))};r.prototype.write=function(t,e){if(!this.writable){this.emit("error",new Error("Stream not writable"));return false}let r;if(o.isBuffer(t)){r=t}else{r=o.from(t,e||this._encoding)}this._buffers.push(r);this._buffered+=r.length;this._process();if(this._reads&&this._reads.length===0){this._paused=true}return this.writable&&!this._paused};r.prototype.end=function(t,e){if(t){this.write(t,e)}this.writable=false;if(!this._buffers){return}if(this._buffers.length===0){this._end()}else{this._buffers.push(null);this._process()}};r.prototype.destroySoon=r.prototype.end;r.prototype._end=function(){if(this._reads.length>0){this.emit("error",new Error("Unexpected end of input"))}this.destroy()};r.prototype.destroy=function(){if(!this._buffers){return}this.writable=false;this._reads=null;this._buffers=null;this.emit("close")};r.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];if(e.length>t.length){this._buffered-=t.length;this._buffers[0]=e.slice(t.length);t.func.call(this,e.slice(0,t.length))}else{this._buffered-=e.length;this._buffers.shift();t.func.call(this,e)}};r.prototype._processRead=function(r){this._reads.shift();let i=0;let n=0;let s=o.alloc(r.length);while(i<r.length){let t=this._buffers[n++];let e=Math.min(t.length,r.length-i);t.copy(s,i,0,e);i+=e;if(e!==t.length){this._buffers[--n]=t.slice(e)}}if(n>0){this._buffers.splice(0,n)}this._buffered-=r.length;r.func.call(this,s)};r.prototype._process=function(){try{while(this._buffered>0&&this._reads&&this._reads.length>0){let t=this._reads[0];if(t.allowLess){this._processReadAllowingLess(t)}else if(this._buffered>=t.length){this._processRead(t)}else{break}}if(this._buffers&&!this.writable){this._end()}}catch(t){this.emit("error",t)}}}).call(this)}).call(this,n("_process"),n("buffer").Buffer)},{_process:179,buffer:147,stream:181,util:202}],81:[function(t,e,r){"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},{}],82:[function(t,e,r){"use strict";let i=[];(function(){for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++){if(e&1){e=3988292384^e>>>1}else{e=e>>>1}}i[t]=e}})();let n=e.exports=function(){this._crc=-1};n.prototype.write=function(e){for(let t=0;t<e.length;t++){this._crc=i[(this._crc^e[t])&255]^this._crc>>>8}return true};n.prototype.crc32=function(){return this._crc^-1};n.crc32=function(e){let r=-1;for(let t=0;t<e.length;t++){r=i[(r^e[t])&255]^r>>>8}return r^-1}},{}],83:[function(f,g,t){(function(p){(function(){"use strict";let h=f("./paeth-predictor");function t(e,r,i,n,s){for(let t=0;t<i;t++){n[s+t]=e[r+t]}}function e(e,r,t){let i=0;let n=r+t;for(let t=r;t<n;t++){i+=Math.abs(e[t])}return i}function r(i,n,t,s,o,a){for(let r=0;r<t;r++){let t=r>=a?i[n+r-a]:0;let e=i[n+r]-t;s[o+r]=e}}function i(i,n,t,s){let o=0;for(let r=0;r<t;r++){let t=r>=s?i[n+r-s]:0;let e=i[n+r]-t;o+=Math.abs(e)}return o}function n(i,n,s,o,a){for(let r=0;r<s;r++){let t=n>0?i[n+r-s]:0;let e=i[n+r]-t;o[a+r]=e}}function s(i,n,s){let o=0;let t=n+s;for(let r=n;r<t;r++){let t=n>0?i[r-s]:0;let e=i[r]-t;o+=Math.abs(e)}return o}function o(n,s,o,a,u,l){for(let i=0;i<o;i++){let t=i>=l?n[s+i-l]:0;let e=s>0?n[s+i-o]:0;let r=n[s+i]-(t+e>>1);a[u+i]=r}}function a(n,s,o,a){let u=0;for(let i=0;i<o;i++){let t=i>=a?n[s+i-a]:0;let e=s>0?n[s+i-o]:0;let r=n[s+i]-(t+e>>1);u+=Math.abs(r)}return u}function u(s,o,a,u,l,f){for(let n=0;n<a;n++){let t=n>=f?s[o+n-f]:0;let e=o>0?s[o+n-a]:0;let r=o>0&&n>=f?s[o+n-(a+f)]:0;let i=s[o+n]-h(t,e,r);u[l+n]=i}}function l(s,o,a,u){let l=0;for(let n=0;n<a;n++){let t=n>=u?s[o+n-u]:0;let e=o>0?s[o+n-a]:0;let r=o>0&&n>=u?s[o+n-(a+u)]:0;let i=s[o+n]-h(t,e,r);l+=Math.abs(i)}return l}let c={0:t,1:r,2:n,3:o,4:u};let d={0:e,1:i,2:s,3:a,4:l};g.exports=function(i,t,e,r,n){let s;if(!("filterType"in r)||r.filterType===-1){s=[0,1,2,3,4]}else if(typeof r.filterType==="number"){s=[r.filterType]}else{throw new Error("unrecognised filter types")}if(r.bitDepth===16){n*=2}let o=t*n;let a=0;let u=0;let l=p.alloc((o+1)*e);let f=s[0];for(let t=0;t<e;t++){if(s.length>1){let r=Infinity;for(let e=0;e<s.length;e++){let t=d[s[e]](i,u,o,n);if(t<r){f=s[e];r=t}}}l[a]=f;a++;c[f](i,u,o,l,a,n);a+=o;u+=o}return l}}).call(this)}).call(this,f("buffer").Buffer)},{"./paeth-predictor":92,buffer:147}],84:[function(r,o,t){(function(s){(function(){"use strict";let t=r("util");let i=r("./chunkstream");let n=r("./filter-parse");let e=o.exports=function(t){i.call(this);let e=[];let r=this;this._filter=new n(t,{read:this.read.bind(this),write:function(t){e.push(t)},complete:function(){r.emit("complete",s.concat(e))}});this._filter.start()};t.inherits(e,i)}).call(this)}).call(this,r("buffer").Buffer)},{"./chunkstream":80,"./filter-parse":86,buffer:147,util:202}],85:[function(t,e,r){(function(a){(function(){"use strict";let s=t("./sync-reader");let o=t("./filter-parse");r.process=function(t,e){let r=[];let i=new s(t);let n=new o(e,{read:i.read.bind(i),write:function(t){r.push(t)},complete:function(){}});n.start();i.process();return a.concat(r)}}).call(this)}).call(this,t("buffer").Buffer)},{"./filter-parse":86,"./sync-reader":99,buffer:147}],86:[function(e,r,t){(function(s){(function(){"use strict";let a=e("./interlace");let h=e("./paeth-predictor");function u(t,e,r){let i=t*e;if(r!==8){i=Math.ceil(i/(8/r))}return i}let t=r.exports=function(t,e){let r=t.width;let i=t.height;let n=t.interlace;let s=t.bpp;let o=t.depth;this.read=e.read;this.write=e.write;this.complete=e.complete;this._imageIndex=0;this._images=[];if(n){let e=a.getImagePasses(r,i);for(let t=0;t<e.length;t++){this._images.push({byteWidth:u(e[t].width,s,o),height:e[t].height,lineIndex:0})}}else{this._images.push({byteWidth:u(r,s,o),height:i,lineIndex:0})}if(o===8){this._xComparison=s}else if(o===16){this._xComparison=s*2}else{this._xComparison=1}};t.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};t.prototype._unFilterType1=function(i,n,t){let s=this._xComparison;let o=s-1;for(let r=0;r<t;r++){let t=i[1+r];let e=r>o?n[r-s]:0;n[r]=t+e}};t.prototype._unFilterType2=function(i,n,t){let s=this._lastLine;for(let r=0;r<t;r++){let t=i[1+r];let e=s?s[r]:0;n[r]=t+e}};t.prototype._unFilterType3=function(s,o,t){let a=this._xComparison;let u=a-1;let l=this._lastLine;for(let n=0;n<t;n++){let t=s[1+n];let e=l?l[n]:0;let r=n>u?o[n-a]:0;let i=Math.floor((r+e)/2);o[n]=t+i}};t.prototype._unFilterType4=function(o,a,t){let u=this._xComparison;let l=u-1;let f=this._lastLine;for(let s=0;s<t;s++){let t=o[1+s];let e=f?f[s]:0;let r=s>l?a[s-u]:0;let i=s>l&&f?f[s-u]:0;let n=h(r,e,i);a[s]=t+n}};t.prototype._reverseFilterLine=function(t){let e=t[0];let r;let i=this._images[this._imageIndex];let n=i.byteWidth;if(e===0){r=t.slice(1,n+1)}else{r=s.alloc(n);switch(e){case 1:this._unFilterType1(t,r,n);break;case 2:this._unFilterType2(t,r,n);break;case 3:this._unFilterType3(t,r,n);break;case 4:this._unFilterType4(t,r,n);break;default:throw new Error("Unrecognised filter type - "+e)}}this.write(r);i.lineIndex++;if(i.lineIndex>=i.height){this._lastLine=null;this._imageIndex++;i=this._images[this._imageIndex]}else{this._lastLine=r}if(i){this.read(i.byteWidth+1,this._reverseFilterLine.bind(this))}else{this._lastLine=null;this.complete()}}}).call(this)}).call(this,e("buffer").Buffer)},{"./interlace":88,"./paeth-predictor":92,buffer:147}],87:[function(t,e,r){(function(c){(function(){"use strict";function l(r,i,e,n,s){let o=0;for(let t=0;t<n;t++){for(let t=0;t<e;t++){let e=s[r[o]];if(!e){throw new Error("index "+r[o]+" not in palette")}for(let t=0;t<4;t++){i[o+t]=e[t]}o+=4}}}function f(e,r,i,n,s){let o=0;for(let t=0;t<n;t++){for(let t=0;t<i;t++){let t=false;if(s.length===1){if(s[0]===e[o]){t=true}}else if(s[0]===e[o]&&s[1]===e[o+1]&&s[2]===e[o+2]){t=true}if(t){for(let t=0;t<4;t++){r[o+t]=0}}o+=4}}}function h(e,r,i,n,t){let s=255;let o=Math.pow(2,t)-1;let a=0;for(let t=0;t<n;t++){for(let t=0;t<i;t++){for(let t=0;t<4;t++){r[a+t]=Math.floor(e[a+t]*s/o+.5)}a+=4}}}e.exports=function(t,e){let r=e.depth;let i=e.width;let n=e.height;let s=e.colorType;let o=e.transColor;let a=e.palette;let u=t;if(s===3){l(t,u,i,n,a)}else{if(o){f(t,u,i,n,o)}if(r!==8){if(r===16){u=c.alloc(i*n*4)}h(t,u,i,n,r)}}return u}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:147}],88:[function(t,e,r){"use strict";let l=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];r.getImagePasses=function(t,e){let n=[];let s=t%8;let o=e%8;let a=(t-s)/8;let u=(e-o)/8;for(let t=0;t<l.length;t++){let e=l[t];let r=a*e.x.length;let i=u*e.y.length;for(let t=0;t<e.x.length;t++){if(e.x[t]<s){r++}else{break}}for(let t=0;t<e.y.length;t++){if(e.y[t]<o){i++}else{break}}if(r>0&&i>0){n.push({width:r,height:i,index:t})}}return n};r.getInterlaceIterator=function(a){return function(t,e,r){let i=t%l[r].x.length;let n=(t-i)/l[r].x.length*8+l[r].x[i];let s=e%l[r].y.length;let o=(e-s)/l[r].y.length*8+l[r].y[s];return n*4+o*a*4}}},{}],89:[function(n,a,t){(function(o){(function(){"use strict";let t=n("util");let r=n("stream");let s=n("./constants");let i=n("./packer");let e=a.exports=function(t){r.call(this);let e=t||{};this._packer=new i(e);this._deflate=this._packer.createDeflate();this.readable=true};t.inherits(e,r);e.prototype.pack=function(t,e,r,i){this.emit("data",o.from(s.PNG_SIGNATURE));this.emit("data",this._packer.packIHDR(e,r));if(i){this.emit("data",this._packer.packGAMA(i))}let n=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error"));this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this));this._deflate.on("end",function(){this.emit("data",this._packer.packIEND());this.emit("end")}.bind(this));this._deflate.end(n)}}).call(this)}).call(this,n("buffer").Buffer)},{"./constants":81,"./packer":91,buffer:147,stream:181,util:202}],90:[function(t,e,r){(function(h){(function(){"use strict";let a=true;let u=t("zlib");if(!u.deflateSync){a=false}let l=t("./constants");let f=t("./packer");e.exports=function(t,e){if(!a){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}let r=e||{};let i=new f(r);let n=[];n.push(h.from(l.PNG_SIGNATURE));n.push(i.packIHDR(t.width,t.height));if(t.gamma){n.push(i.packGAMA(t.gamma))}let s=i.filterData(t.data,t.width,t.height);let o=u.deflateSync(s,i.getDeflateOptions());s=null;if(!o||!o.length){throw new Error("bad png - invalid compressed data response")}n.push(i.packIDAT(o));n.push(i.packIEND());return h.concat(n)}}).call(this)}).call(this,t("buffer").Buffer)},{"./constants":81,"./packer":91,buffer:147,zlib:146}],91:[function(r,i,t){(function(s){(function(){"use strict";let o=r("./constants");let n=r("./crc");let a=r("./bitpacker");let u=r("./filter-pack");let e=r("zlib");let t=i.exports=function(t){this._options=t;t.deflateChunkSize=t.deflateChunkSize||32*1024;t.deflateLevel=t.deflateLevel!=null?t.deflateLevel:9;t.deflateStrategy=t.deflateStrategy!=null?t.deflateStrategy:3;t.inputHasAlpha=t.inputHasAlpha!=null?t.inputHasAlpha:true;t.deflateFactory=t.deflateFactory||e.createDeflate;t.bitDepth=t.bitDepth||8;t.colorType=typeof t.colorType==="number"?t.colorType:o.COLORTYPE_COLOR_ALPHA;t.inputColorType=typeof t.inputColorType==="number"?t.inputColorType:o.COLORTYPE_COLOR_ALPHA;if([o.COLORTYPE_GRAYSCALE,o.COLORTYPE_COLOR,o.COLORTYPE_COLOR_ALPHA,o.COLORTYPE_ALPHA].indexOf(t.colorType)===-1){throw new Error("option color type:"+t.colorType+" is not supported at present")}if([o.COLORTYPE_GRAYSCALE,o.COLORTYPE_COLOR,o.COLORTYPE_COLOR_ALPHA,o.COLORTYPE_ALPHA].indexOf(t.inputColorType)===-1){throw new Error("option input color type:"+t.inputColorType+" is not supported at present")}if(t.bitDepth!==8&&t.bitDepth!==16){throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")}};t.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};t.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};t.prototype.filterData=function(t,e,r){let i=a(t,e,r,this._options);let n=o.COLORTYPE_TO_BPP_MAP[this._options.colorType];let s=u(i,e,r,this._options,n);return s};t.prototype._packChunk=function(t,e){let r=e?e.length:0;let i=s.alloc(r+12);i.writeUInt32BE(r,0);i.writeUInt32BE(t,4);if(e){e.copy(i,8)}i.writeInt32BE(n.crc32(i.slice(4,i.length-4)),i.length-4);return i};t.prototype.packGAMA=function(t){let e=s.alloc(4);e.writeUInt32BE(Math.floor(t*o.GAMMA_DIVISION),0);return this._packChunk(o.TYPE_gAMA,e)};t.prototype.packIHDR=function(t,e){let r=s.alloc(13);r.writeUInt32BE(t,0);r.writeUInt32BE(e,4);r[8]=this._options.bitDepth;r[9]=this._options.colorType;r[10]=0;r[11]=0;r[12]=0;return this._packChunk(o.TYPE_IHDR,r)};t.prototype.packIDAT=function(t){return this._packChunk(o.TYPE_IDAT,t)};t.prototype.packIEND=function(){return this._packChunk(o.TYPE_IEND,null)}}).call(this)}).call(this,r("buffer").Buffer)},{"./bitpacker":79,"./constants":81,"./crc":82,"./filter-pack":83,buffer:147,zlib:146}],92:[function(t,e,r){"use strict";e.exports=function t(e,r,i){let n=e+r-i;let s=Math.abs(n-e);let o=Math.abs(n-r);let a=Math.abs(n-i);if(s<=o&&s<=a){return e}if(o<=a){return r}return i}},{}],93:[function(t,e,r){"use strict";let i=t("util");let o=t("zlib");let n=t("./chunkstream");let s=t("./filter-parse-async");let a=t("./parser");let u=t("./bitmapper");let l=t("./format-normaliser");let f=e.exports=function(t){n.call(this);this._parser=new a(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)});this._options=t;this.writable=true;this._parser.start()};i.inherits(f,n);f.prototype._handleError=function(t){this.emit("error",t);this.writable=false;this.destroy();if(this._inflate&&this._inflate.destroy){this._inflate.destroy()}if(this._filter){this._filter.destroy();this._filter.on("error",function(){})}this.errord=true};f.prototype._inflateData=function(t){if(!this._inflate){if(this._bitmapInfo.interlace){this._inflate=o.createInflate();this._inflate.on("error",this.emit.bind(this,"error"));this._filter.on("complete",this._complete.bind(this));this._inflate.pipe(this._filter)}else{let t=(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1;let e=t*this._bitmapInfo.height;let r=Math.max(e,o.Z_MIN_CHUNK);this._inflate=o.createInflate({chunkSize:r});let i=e;let n=this.emit.bind(this,"error");this._inflate.on("error",function(t){if(!i){return}n(t)});this._filter.on("complete",this._complete.bind(this));let s=this._filter.write.bind(this._filter);this._inflate.on("data",function(t){if(!i){return}if(t.length>i){t=t.slice(0,i)}i-=t.length;s(t)});this._inflate.on("end",this._filter.end.bind(this._filter))}}this._inflate.write(t)};f.prototype._handleMetaData=function(t){this._metaData=t;this._bitmapInfo=Object.create(t);this._filter=new s(this._bitmapInfo)};f.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};f.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};f.prototype._simpleTransparency=function(){this._metaData.alpha=true};f.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};f.prototype._finished=function(){if(this.errord){return}if(!this._inflate){this.emit("error","No Inflate block")}else{this._inflate.end()}};f.prototype._complete=function(e){if(this.errord){return}let r;try{let t=u.dataToBitMap(e,this._bitmapInfo);r=l(t,this._bitmapInfo);t=null}catch(t){this._handleError(t);return}this.emit("parsed",r)}},{"./bitmapper":78,"./chunkstream":80,"./filter-parse-async":84,"./format-normaliser":87,"./parser":95,util:202,zlib:146}],94:[function(t,e,r){(function(A){(function(){"use strict";let w=true;let _=t("zlib");let x=t("./sync-inflate");if(!_.deflateSync){w=false}let C=t("./sync-reader");let k=t("./filter-parse-sync");let T=t("./parser");let S=t("./bitmapper");let E=t("./format-normaliser");e.exports=function(t,e){if(!w){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}let r;function i(t){r=t}let n;function s(t){n=t}function o(t){n.transColor=t}function a(t){n.palette=t}function u(){n.alpha=true}let l;function f(t){l=t}let h=[];function c(t){h.push(t)}let d=new C(t);let p=new T(e,{read:d.read.bind(d),error:i,metadata:s,gamma:f,palette:a,transColor:o,inflateData:c,simpleTransparency:u});p.start();d.process();if(r){throw r}let g=A.concat(h);h.length=0;let y;if(n.interlace){y=_.inflateSync(g)}else{let t=(n.width*n.bpp*n.depth+7>>3)+1;let e=t*n.height;y=x(g,{chunkSize:e,maxLength:e})}g=null;if(!y||!y.length){throw new Error("bad png - invalid inflate data response")}let b=k.process(y,n);g=null;let m=S.dataToBitMap(b,n);b=null;let v=E(m,n);n.data=v;n.gamma=l||0;return n}}).call(this)}).call(this,t("buffer").Buffer)},{"./bitmapper":78,"./filter-parse-sync":85,"./format-normaliser":87,"./parser":95,"./sync-inflate":98,"./sync-reader":99,buffer:147,zlib:146}],95:[function(e,r,t){(function(o){(function(){"use strict";let l=e("./constants");let s=e("./crc");let t=r.exports=function(t,e){this._options=t;t.checkCRC=t.checkCRC!==false;this._hasIHDR=false;this._hasIEND=false;this._emittedHeadersFinished=false;this._palette=[];this._colorType=0;this._chunks={};this._chunks[l.TYPE_IHDR]=this._handleIHDR.bind(this);this._chunks[l.TYPE_IEND]=this._handleIEND.bind(this);this._chunks[l.TYPE_IDAT]=this._handleIDAT.bind(this);this._chunks[l.TYPE_PLTE]=this._handlePLTE.bind(this);this._chunks[l.TYPE_tRNS]=this._handleTRNS.bind(this);this._chunks[l.TYPE_gAMA]=this._handleGAMA.bind(this);this.read=e.read;this.error=e.error;this.metadata=e.metadata;this.gamma=e.gamma;this.transColor=e.transColor;this.palette=e.palette;this.parsed=e.parsed;this.inflateData=e.inflateData;this.finished=e.finished;this.simpleTransparency=e.simpleTransparency;this.headersFinished=e.headersFinished||function(){}};t.prototype.start=function(){this.read(l.PNG_SIGNATURE.length,this._parseSignature.bind(this))};t.prototype._parseSignature=function(e){let r=l.PNG_SIGNATURE;for(let t=0;t<r.length;t++){if(e[t]!==r[t]){this.error(new Error("Invalid file signature"));return}}this.read(8,this._parseChunkBegin.bind(this))};t.prototype._parseChunkBegin=function(e){let t=e.readUInt32BE(0);let r=e.readUInt32BE(4);let i="";for(let t=4;t<8;t++){i+=String.fromCharCode(e[t])}let n=Boolean(e[4]&32);if(!this._hasIHDR&&r!==l.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}this._crc=new s;this._crc.write(o.from(i));if(this._chunks[r]){return this._chunks[r](t)}if(!n){this.error(new Error("Unsupported critical chunk type "+i));return}this.read(t+4,this._skipChunk.bind(this))};t.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};t.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};t.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0);let r=this._crc.crc32();if(this._options.checkCRC&&r!==e){this.error(new Error("Crc error - "+e+" - "+r));return}if(!this._hasIEND){this.read(8,this._parseChunkBegin.bind(this))}};t.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))};t.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0);let r=t.readUInt32BE(4);let i=t[8];let n=t[9];let s=t[10];let o=t[11];let a=t[12];if(i!==8&&i!==4&&i!==2&&i!==1&&i!==16){this.error(new Error("Unsupported bit depth "+i));return}if(!(n in l.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(s!==0){this.error(new Error("Unsupported compression method"));return}if(o!==0){this.error(new Error("Unsupported filter method"));return}if(a!==0&&a!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=n;let u=l.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=true;this.metadata({width:e,height:r,depth:i,interlace:Boolean(a),palette:Boolean(n&l.COLORTYPE_PALETTE),color:Boolean(n&l.COLORTYPE_COLOR),alpha:Boolean(n&l.COLORTYPE_ALPHA),bpp:u,colorType:n});this._handleChunkEnd()};t.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))};t.prototype._parsePLTE=function(e){this._crc.write(e);let r=Math.floor(e.length/3);for(let t=0;t<r;t++){this._palette.push([e[t*3],e[t*3+1],e[t*3+2],255])}this.palette(this._palette);this._handleChunkEnd()};t.prototype._handleTRNS=function(t){this.simpleTransparency();this.read(t,this._parseTRNS.bind(this))};t.prototype._parseTRNS=function(e){this._crc.write(e);if(this._colorType===l.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(e.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let t=0;t<e.length;t++){this._palette[t][3]=e[t]}this.palette(this._palette)}if(this._colorType===l.COLORTYPE_GRAYSCALE){this.transColor([e.readUInt16BE(0)])}if(this._colorType===l.COLORTYPE_COLOR){this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)])}this._handleChunkEnd()};t.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))};t.prototype._parseGAMA=function(t){this._crc.write(t);this.gamma(t.readUInt32BE(0)/l.GAMMA_DIVISION);this._handleChunkEnd()};t.prototype._handleIDAT=function(t){if(!this._emittedHeadersFinished){this._emittedHeadersFinished=true;this.headersFinished()}this.read(-t,this._parseIDAT.bind(this,t))};t.prototype._parseIDAT=function(t,e){this._crc.write(e);if(this._colorType===l.COLORTYPE_PALETTE_COLOR&&this._palette.length===0){throw new Error("Expected palette not found")}this.inflateData(e);let r=t-e.length;if(r>0){this._handleIDAT(r)}else{this._handleChunkEnd()}};t.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};t.prototype._parseIEND=function(t){this._crc.write(t);this._hasIEND=true;this._handleChunkEnd();if(this.finished){this.finished()}}}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":81,"./crc":82,buffer:147}],96:[function(t,e,r){"use strict";let i=t("./parser-sync");let n=t("./packer-sync");r.read=function(t,e){return i(t,e||{})};r.write=function(t,e){return n(t,e)}},{"./packer-sync":90,"./parser-sync":94}],97:[function(u,t,l){(function(s,o){(function(){"use strict";let t=u("util");let e=u("stream");let r=u("./parser-async");let i=u("./packer-async");let n=u("./png-sync");let a=l.PNG=function(t){e.call(this);t=t||{};this.width=t.width|0;this.height=t.height|0;this.data=this.width>0&&this.height>0?o.alloc(4*this.width*this.height):null;if(t.fill&&this.data){this.data.fill(0)}this.gamma=0;this.readable=this.writable=true;this._parser=new r(t);this._parser.on("error",this.emit.bind(this,"error"));this._parser.on("close",this._handleClose.bind(this));this._parser.on("metadata",this._metadata.bind(this));this._parser.on("gamma",this._gamma.bind(this));this._parser.on("parsed",function(t){this.data=t;this.emit("parsed",t)}.bind(this));this._packer=new i(t);this._packer.on("data",this.emit.bind(this,"data"));this._packer.on("end",this.emit.bind(this,"end"));this._parser.on("close",this._handleClose.bind(this));this._packer.on("error",this.emit.bind(this,"error"))};t.inherits(a,e);a.sync=n;a.prototype.pack=function(){if(!this.data||!this.data.length){this.emit("error","No data provided");return this}s.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this));return this};a.prototype.parse=function(t,i){if(i){let e,r;e=function(t){this.removeListener("error",r);this.data=t;i(null,this)}.bind(this);r=function(t){this.removeListener("parsed",e);i(t,null)}.bind(this);this.once("parsed",e);this.once("error",r)}this.end(t);return this};a.prototype.write=function(t){this._parser.write(t);return true};a.prototype.end=function(t){this._parser.end(t)};a.prototype._metadata=function(t){this.width=t.width;this.height=t.height;this.emit("metadata",t)};a.prototype._gamma=function(t){this.gamma=t};a.prototype._handleClose=function(){if(!this._parser.writable&&!this._packer.readable){this.emit("close")}};a.bitblt=function(e,r,i,n,s,o,a,u){i|=0;n|=0;s|=0;o|=0;a|=0;u|=0;if(i>e.width||n>e.height||i+s>e.width||n+o>e.height){throw new Error("bitblt reading outside image")}if(a>r.width||u>r.height||a+s>r.width||u+o>r.height){throw new Error("bitblt writing outside image")}for(let t=0;t<o;t++){e.data.copy(r.data,(u+t)*r.width+a<<2,(n+t)*e.width+i<<2,(n+t)*e.width+i+s<<2)}};a.prototype.bitblt=function(t,e,r,i,n,s,o){a.bitblt(this,t,e,r,i,n,s,o);return this};a.adjustGamma=function(i){if(i.gamma){for(let e=0;e<i.height;e++){for(let t=0;t<i.width;t++){let r=i.width*e+t<<2;for(let e=0;e<3;e++){let t=i.data[r+e]/255;t=Math.pow(t,1/2.2/i.gamma);i.data[r+e]=Math.round(t*255)}}}i.gamma=0}};a.prototype.adjustGamma=function(){a.adjustGamma(this)}}).call(this)}).call(this,u("_process"),u("buffer").Buffer)},{"./packer-async":89,"./parser-async":93,"./png-sync":96,_process:179,buffer:147,stream:181,util:202}],98:[function(o,a,u){(function(s,m){(function(){"use strict";let p=o("assert").ok;let g=o("zlib");let t=o("util");let y=o("buffer").kMaxLength;function r(t){if(!(this instanceof r)){return new r(t)}if(t&&t.chunkSize<g.Z_MIN_CHUNK){t.chunkSize=g.Z_MIN_CHUNK}g.Inflate.call(this,t);this._offset=this._offset===undefined?this._outOffset:this._offset;this._buffer=this._buffer||this._outBuffer;if(t&&t.maxLength!=null){this._maxLength=t.maxLength}}function e(t){return new r(t)}function b(t,e){if(e){s.nextTick(e)}if(!t._handle){return}t._handle.close();t._handle=null}r.prototype._processChunk=function(t,e,r){if(typeof r==="function"){return g.Inflate._processChunk.call(this,t,e,r)}let i=this;let n=t&&t.length;let s=this._chunkSize-this._offset;let o=this._maxLength;let a=0;let u=[];let l=0;let f;this.on("error",function(t){f=t});function h(t,e){if(i._hadError){return}let r=s-e;p(r>=0,"have should not go down");if(r>0){let t=i._buffer.slice(i._offset,i._offset+r);i._offset+=r;if(t.length>o){t=t.slice(0,o)}u.push(t);l+=t.length;o-=t.length;if(o===0){return false}}if(e===0||i._offset>=i._chunkSize){s=i._chunkSize;i._offset=0;i._buffer=m.allocUnsafe(i._chunkSize)}if(e===0){a+=n-t;n=t;return true}return false}p(this._handle,"zlib binding closed");let c;do{c=this._handle.writeSync(e,t,a,n,this._buffer,this._offset,s);c=c||this._writeState}while(!this._hadError&&h(c[0],c[1]));if(this._hadError){throw f}if(l>=y){b(this);throw new RangeError("Cannot create final Buffer. It would be larger than 0x"+y.toString(16)+" bytes")}let d=m.concat(u,l);b(this);return d};t.inherits(r,g.Inflate);function i(t,e){if(typeof e==="string"){e=m.from(e)}if(!(e instanceof m)){throw new TypeError("Not a string or buffer")}let r=t._finishFlushFlag;if(r==null){r=g.Z_FINISH}return t._processChunk(e,r)}function n(t,e){return i(new r(e),t)}a.exports=u=n;u.Inflate=r;u.createInflate=e;u.inflateSync=n}).call(this)}).call(this,o("_process"),o("buffer").Buffer)},{_process:179,assert:138,buffer:147,util:202,zlib:146}],99:[function(t,e,r){"use strict";let i=e.exports=function(t){this._buffer=t;this._reads=[]};i.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})};i.prototype.process=function(){while(this._reads.length>0&&this._buffer.length){let e=this._reads[0];if(this._buffer.length&&(this._buffer.length>=e.length||e.allowLess)){this._reads.shift();let t=this._buffer;this._buffer=t.slice(e.length);e.func.call(this,t.slice(0,e.length))}else{break}}if(this._reads.length>0){return new Error("There are some read requests waitng on finished stream")}if(this._buffer.length>0){return new Error("unrecognised content at end of stream")}}},{}],100:[function(t,e,r){(function(m,t){(function(){(function(r,i){"use strict";if(r.setImmediate){return}var n=1;var s={};var o=false;var a=r.document;var u;function t(t){if(typeof t!=="function"){t=new Function(""+t)}var e=new Array(arguments.length-1);for(var r=0;r<e.length;r++){e[r]=arguments[r+1]}var i={callback:t,args:e};s[n]=i;u(n);return n++}function l(t){delete s[t]}function f(t){var e=t.callback;var r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(i,r);break}}function h(t){if(o){setTimeout(h,0,t)}else{var e=s[t];if(e){o=true;try{f(e)}finally{l(t);o=false}}}}function e(){u=function(t){m.nextTick(function(){h(t)})}}function c(){if(r.postMessage&&!r.importScripts){var t=true;var e=r.onmessage;r.onmessage=function(){t=false};r.postMessage("","*");r.onmessage=e;return t}}function d(){var e="setImmediate$"+Math.random()+"$";var t=function(t){if(t.source===r&&typeof t.data==="string"&&t.data.indexOf(e)===0){h(+t.data.slice(e.length))}};if(r.addEventListener){r.addEventListener("message",t,false)}else{r.attachEvent("onmessage",t)}u=function(t){r.postMessage(e+t,"*")}}function p(){var e=new MessageChannel;e.port1.onmessage=function(t){var e=t.data;h(e)};u=function(t){e.port2.postMessage(t)}}function g(){var r=a.documentElement;u=function(t){var e=a.createElement("script");e.onreadystatechange=function(){h(t);e.onreadystatechange=null;r.removeChild(e);e=null};r.appendChild(e)}}function y(){u=function(t){setTimeout(h,0,t)}}var b=Object.getPrototypeOf&&Object.getPrototypeOf(r);b=b&&b.setTimeout?b:r;if({}.toString.call(r.process)==="[object process]"){e()}else if(c()){d()}else if(r.MessageChannel){p()}else if(a&&"onreadystatechange"in a.createElement("script")){g()}else{y()}b.setImmediate=t;b.clearImmediate=l})(typeof self==="undefined"?typeof t==="undefined"?this:t:self)}).call(this)}).call(this,t("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{_process:179}],101:[function(t,e,r){"use strict";const n=t("./seventh.js");function i(t,e=4){this.jobRunner=t;this.jobs=new Map;this.pendingJobs=new Map;this.runningJobs=new Map;this.errorJobs=new Map;this.jobsDone=new Map;this.concurrency=+e||1;this.isQueueRunning=true;this.isLoopRunning=false;this.canLoopAgain=false;this.ready=n.resolved;this.startTime=null;this.endTime=null;this.drained=n.resolved;this.idle=n.resolved}n.Queue=i;function s(t,e=null,r=undefined){this.id=t;this.dependencies=e===null?null:[...e];this.data=r===undefined?t:r;this.error=null;this.startTime=null;this.endTime=null}i.Job=s;i.prototype.setConcurrency=function(t){this.concurrency=+t||1};i.prototype.stop=i.prototype.pause=function(){this.isQueueRunning=false};i.prototype.has=function(t){return this.jobs.has(t)};i.prototype.add=i.prototype.addJob=function(t,e,r=null){if(this.jobs.has(t)){return false}var i=new s(t,r,e);this.jobs.set(t,i);this.pendingJobs.set(t,i);this.canLoopAgain=true;if(this.isQueueRunning&&!this.isLoopRunning){this.run()}if(this.drained.isSettled()){this.drained=new n}return i};i.prototype.addBatch=i.prototype.addJobBatch=function(t){var e,r;for(e of t){if(this.jobs.has(e)){return false}r=new s(e);this.jobs.set(e,r);this.pendingJobs.set(e,r)}this.canLoopAgain=true;if(this.isQueueRunning&&!this.isLoopRunning){this.run()}if(this.drained.isSettled()){this.drained=new n}};i.prototype.run=i.prototype.resume=async function(){var t;this.isQueueRunning=true;if(this.isLoopRunning){return}this.isLoopRunning=true;if(!this.startTime){this.startTime=Date.now()}do{this.canLoopAgain=false;for(t of this.pendingJobs.values()){if(t.dependencies&&t.dependencies.some(t=>!this.jobsDone.has(t))){continue}if(this.idle.isSettled()){this.idle=new n}this.canLoopAgain=true;await this.ready;if(!this.isQueueRunning){this.finishRun();return}this.runJob(t)}}while(this.canLoopAgain);this.finishRun()};i.prototype.finishRun=function(){this.isLoopRunning=false;if(!this.pendingJobs.size){this.drained.resolve()}if(!this.runningJobs.size){this.endTime=Date.now();this.idle.resolve()}};i.prototype.runJob=async function(e){this.pendingJobs.delete(e.id);this.runningJobs.set(e.id,e);if(this.runningJobs.size>=this.concurrency){this.ready=new n}try{e.startTime=Date.now();await this.jobRunner(e.data);e.endTime=Date.now();this.jobsDone.set(e.id,e);this.canLoopAgain=true}catch(t){e.endTime=Date.now();e.error=t;this.errorJobs.set(e.id,e)}this.runningJobs.delete(e.id);if(this.runningJobs.size<this.concurrency){this.ready.resolve()}if(!this.isLoopRunning){if(this.isQueueRunning&&this.pendingJobs.size){this.run()}else{this.finishRun()}}};i.prototype.getJobTimes=function(){var t,e={};for(t of this.jobsDone.values()){e[t.id]=t.endTime-t.startTime}return e};i.prototype.getStats=function(){var t,e=0,r={pending:this.pendingJobs.size,running:this.runningJobs.size,failed:this.errorJobs.size,done:this.jobsDone.size,averageJobTime:null,queueTime:null};if(this.jobsDone.size){for(t of this.jobsDone.values()){e+=t.endTime-t.startTime}r.averageJobTime=e/this.jobsDone.size}if(this.endTime){r.queueTime=this.endTime-this.startTime}return r}},{"./seventh.js":108}],102:[function(t,e,r){"use strict";const o=t("./seventh.js");o.promisifyNodeApi=(i,n,s,t,e)=>{var r;n=n||"Async";s=s||"AsyncAll";t=t||(t=>t[0]!=="_"&&!t.endsWith("Sync"));if(e){r=[];for(let t in i){if(typeof i[t]==="function"){r.push(t)}}}else{r=Object.keys(i)}r.filter(e=>{if(typeof i[e]!=="function"){return false}for(let t in i[e].prototype){return false}return t(e,i)}).forEach(t=>{const e=t+n;const r=t+s;if(!i[e]){i[e]=o.promisify(i[t],i)}if(!i[r]){i[r]=o.promisifyAll(i[t],i)}})};o.promisifyAnyNodeApi=(t,e,r,i)=>{o.promisifyNodeApi(t,e,r,i,true)}},{"./seventh.js":108}],103:[function(t,e,r){"use strict";const p=t("./seventh.js");const f={};function h(){}p.all=t=>{var r=-1,i=false,n=0,s=Infinity,o,a=[],u=new p;for(o of t){if(i){break}r++;(()=>{const e=r;p.resolve(o).then(t=>{if(i){return}a[e]=t;n++;if(n>=s){i=true;u._resolveValue(a)}},t=>{if(i){return}i=true;u.reject(t)})})()}s=r+1;if(!s){u._resolveValue(a)}return u};p._allArray=t=>{var e=t.length;if(!e){p._resolveValue([])}var r,i={settled:false,count:0,length:e,values:[],allPromise:new p};for(r=0;!i.settled&&r<e;r++){p._allArrayOne(t[r],r,i)}return i.allPromise};p._allArrayOne=(t,e,r)=>{p._bareThen(t,t=>{if(r.settled){return}r.values[e]=t;r.count++;if(r.count>=r.length){r.settled=true;r.allPromise._resolveValue(r.values)}},t=>{if(r.settled){return}r.settled=true;r.allPromise.reject(t)})};p.every=p.map=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}return r(t,e)}).then(t=>{if(n){return}u[e]=t;s++;if(s>=o){n=true;l._resolveValue(u)}},t=>{if(n){return}n=true;l.reject(t)})})()}o=i+1;if(!o){l._resolveValue(u)}return l};p.any=t=>{var r=-1,i=false,n=0,s=Infinity,o,a=[],u=new p;for(o of t){if(i){break}r++;(()=>{const e=r;p.resolve(o).then(t=>{if(i){return}i=true;u._resolveValue(t)},t=>{if(i){return}a[e]=t;n++;if(n>=s){i=true;u.reject(a)}})})()}s=r+1;if(!s){u.reject(new RangeError("Promise.any(): empty array"))}return u};p.some=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}return r(t,e)}).then(t=>{if(n){return}n=true;l._resolveValue(t)},t=>{if(n){return}u[e]=t;s++;if(s>=o){n=true;l.reject(u)}})})()}o=i+1;if(!o){l.reject(new RangeError("Promise.any(): empty array"))}return l};p.filter=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}u[e]=t;return r(t,e)}).then(t=>{if(n){return}s++;if(!t){u[e]=f}if(s>=o){n=true;u=u.filter(t=>t!==f);l._resolveValue(u)}},t=>{if(n){return}n=true;l.reject(t)})})()}o=i+1;if(!o){l._resolveValue(u)}else if(s>=o){n=true;u=u.filter(t=>t!==f);l._resolveValue(u)}return l};p.foreach=p.forEach=function(t,i,e){var n=-1,s=arguments.length>=3,o=t[Symbol.iterator](),a=new p,u=p.resolve(e);if(p.warnUnhandledRejection){p._handleAll(t)}var l=()=>{u.then(e=>{let{value:t,done:r}=o.next();n++;if(r){a.resolve(e)}else{u=p.resolve(t).then(s?t=>i(e,t,n):t=>i(t,n));l()}},t=>{a.reject(t);for(;;){let{value:t,done:e}=o.next();if(e){break}if(p.isThenable(t)){t.then(h,h)}}})};l();return a};p.reduce=(t,e,r)=>{return p.forEach(t,e,r)};p.mapObject=(t,r)=>{var i=false,n=0,e,s,o=Object.keys(t),a=o.length,u,l={},f=new p;for(e=0;!i&&e<a;e++){s=o[e];u=t[s];(()=>{const e=s;p.resolve(u).then(t=>{if(i){return}return r(t,e)}).then(t=>{if(i){return}l[e]=t;n++;if(n>=a){i=true;f._resolveValue(l)}},t=>{if(i){return}i=true;f.reject(t)})})()}if(!a){f._resolveValue(l)}return f};p.concurrent=(r,t,i)=>{var n=-1,s=false,o=0,a=0,u=Infinity,l,e=false,f=[],h=t[Symbol.iterator](),c=new p;if(p.warnUnhandledRejection){p._handleAll(t)}r=+r||1;const d=()=>{while(!e&&o<r){({value:l,done:e}=h.next());if(e){u=n+1;if(a>=u){s=true;c._resolveValue(f);return}break}if(s){break}n++;(()=>{const e=n;o++;p.resolve(l).then(t=>{if(s){return}return i(t,e)}).then(t=>{if(s){return}f[e]=t;a++;o--;if(a>=u){s=true;c._resolveValue(f);return}if(o<r){d();return}},t=>{if(s){return}s=true;c.reject(t)})})()}};d();if(n<0){c._resolveValue(f)}return c};p.race=t=>{var e=false,r,i=new p;for(r of t){if(e){break}p.resolve(r).then(t=>{if(e){return}e=true;i._resolveValue(t)},t=>{if(e){return}e=true;i.reject(t)})}return i}},{"./seventh.js":108}],104:[function(o,a,t){(function(e,r,s){(function(){"use strict";const t=r.Promise;var i;if(!e.browser){i=e.nextTick}else{o("setimmediate");i=s}function n(t){this.fn=t;this._then=n._dormantThen;this.value=null;this.thenHandlers=null;this.handledRejection=null;if(this.fn){this._exec()}}a.exports=n;n.Native=t;n.warnUnhandledRejection=true;n.prototype._exec=function(){this._then=n._pendingThen;try{this.fn(t=>{this.resolve(t)},t=>{this.reject(t)})}catch(t){this.reject(t)}};n.prototype.resolve=n.prototype.fulfill=function(t){if(this._then.settled){return this}if(n.isThenable(t)){this._execThenPromise(t);return this}return this._resolveValue(t)};n.prototype._resolveValue=function(t){this._then=n._fulfilledThen;this.value=t;if(this.thenHandlers&&this.thenHandlers.length){this._execFulfillHandlers()}return this};n.prototype._execThenPromise=function(t){try{t.then(t=>{this.resolve(t)},t=>{this.reject(t)})}catch(t){this.reject(t)}};n.prototype.reject=function(t){if(this._then.settled){return this}this._then=n._rejectedThen;this.value=t;if(this.thenHandlers&&this.thenHandlers.length){this._execRejectionHandlers()}else if(n.warnUnhandledRejection&&!this.handledRejection){this._unhandledRejection()}return this};n.prototype._execFulfillHandlers=function(){var t,e=this.thenHandlers.length;for(t=0;t<e;t+=3){if(this.thenHandlers[t+1]){this._execOneFulfillHandler(this.thenHandlers[t],this.thenHandlers[t+1])}else{this.thenHandlers[t].resolve(this.value)}}};n.prototype._execOneFulfillHandler=function(e,t){try{e.resolve(t(this.value))}catch(t){e.reject(t)}};n.prototype._execRejectionHandlers=function(){var t,e=this.thenHandlers.length;for(t=0;t<e;t+=3){if(this.thenHandlers[t+2]){this._execOneRejectHandler(this.thenHandlers[t],this.thenHandlers[t+2])}else{this.thenHandlers[t].reject(this.value)}}};n.prototype._execOneRejectHandler=function(e,t){try{e.resolve(t(this.value))}catch(t){e.reject(t)}};n.prototype.resolveTimeout=n.prototype.fulfillTimeout=function(t,e){setTimeout(()=>this.resolve(e),t)};n.prototype.rejectTimeout=function(t,e){setTimeout(()=>this.reject(e),t)};n._dormantThen=function(t,e){if(this.fn){this._exec();return this._then(t,e)}var r=new n;if(!this.thenHandlers){this.thenHandlers=[r,t,e]}else{this.thenHandlers[this.thenHandlers.length]=r;this.thenHandlers[this.thenHandlers.length]=t;this.thenHandlers[this.thenHandlers.length]=e}return r};n._dormantThen.settled=false;n._pendingThen=function(t,e){var r=new n;if(!this.thenHandlers){this.thenHandlers=[r,t,e]}else{this.thenHandlers[this.thenHandlers.length]=r;this.thenHandlers[this.thenHandlers.length]=t;this.thenHandlers[this.thenHandlers.length]=e}return r};n._pendingThen.settled=false;n._fulfilledThen=function(t){if(!t){return this}var e=new n;i(()=>{try{e.resolve(t(this.value))}catch(t){e.reject(t)}});return e};n._fulfilledThen.settled=true;n._rejectedThen=function(t,e){if(!e){return this}this.handledRejection=true;var r=new n;i(()=>{try{r.resolve(e(this.value))}catch(t){r.reject(t)}});return r};n._rejectedThen.settled=true;n.prototype.then=function(t,e){return this._then(t,e)};n.prototype.catch=function(t=()=>undefined){return this._then(undefined,t)};n.prototype.finally=function(t){return this._then(t,t)};n.prototype.tap=n.prototype.tapThen=function(t){this._then(t,undefined);return this};n.prototype.tapCatch=function(t){this._then(undefined,t);return this};n.prototype.tapFinally=function(t){this._then(t,t);return this};n.prototype.fatal=function(){this._then(undefined,t=>{i(()=>{throw t})})};n.prototype.done=function(t,e){this._then(t,e).fatal();return this};n.prototype.callback=function(e){this._then(t=>{e(undefined,t)},t=>{e(t)}).fatal();return this};n.prototype.callbackAll=function(e){this._then(t=>{if(Array.isArray(t)){e(undefined,...t)}else{e(undefined,t)}},t=>{e(t)}).fatal();return this};n.callback=function(t){return new n((r,i)=>{t((t,e)=>{if(t){i(t)}else{r(e)}})})};n.callbackAll=function(t){return new n((r,i)=>{t((t,...e)=>{if(t){i(t)}else{r(e)}})})};n.prototype.toPromise=n.prototype.propagate=function(e){this._then(t=>{e.resolve(t)},t=>{e.reject(t)});return this};n.propagate=function(t,e){t.then(t=>{e.resolve(t)},t=>{e.reject(t)});return t};n.finally=function(t,e){return t.then(e,e)};n.resolve=n.fulfill=function(t){if(n.isThenable(t)){return n.fromThenable(t)}return n._resolveValue(t)};n._resolveValue=function(t){var e=new n;e._then=n._fulfilledThen;e.value=t;return e};n.reject=function(t){var e=new n;e._then=n._rejectedThen;e.value=t;return e};n.resolveTimeout=n.fulfillTimeout=function(e,r){return new n(t=>setTimeout(()=>t(r),e))};n.rejectTimeout=function(r,i){return new n((t,e)=>setTimeout(()=>e(i),r))};n.resolveNextTick=n.fulfillNextTick=function(e){return new n(t=>i(()=>t(e)))};n.rejectNextTick=function(r){return new n((t,e)=>i(()=>e(r)))};n.dormant=function(t){var e=new n;e.fn=t;return e};n.try=function(t){try{return n.resolve(t())}catch(t){return n.reject(t)}};n.isThenable=function(t){return t&&typeof t==="object"&&typeof t.then==="function"};n.fromThenable=function(t){if(t instanceof n){return t}return new n((e,r)=>{t.then(t=>{e(t)},t=>{r(t)})})};n._bareThen=function(t,e,r){if(t&&typeof t==="object"){if(t instanceof n){if(t._then===n._fulfilledThen){e(t.value)}else if(t._then===n._rejectedThen){r(t.value)}else{t._then(e,r)}}else if(typeof t.then==="function"){t.then(e,r)}else{e(t)}}else{e(t)}};n._handleAll=function(t){var e;for(e of t){if(n.isThenable(e)){e.handledRejection=true}}};n.prototype._unhandledRejection=function(){this.handledRejection=false;const e=t=>setTimeout(t,0);if(this.value instanceof Error){e(()=>{if(this.handledRejection===false){this.value.message="Unhandled promise rejection: "+this.value.message;console.error(this.value)}})}else{let t=new Error("Unhandled promise rejection");e(()=>{if(this.handledRejection===false){console.error(t);console.error("Rejection reason:",this.value)}})}};n.prototype.isSettled=function(){return this._then.settled};n.prototype.getStatus=function(){switch(this._then){case n._dormantThen:return"dormant";case n._pendingThen:return"pending";case n._fulfilledThen:return"fulfilled";case n._rejectedThen:return"rejected"}};n.prototype.inspect=function(){switch(this._then){case n._dormantThen:return"Promise { <DORMANT> }";case n._pendingThen:return"Promise { <PENDING> }";case n._fulfilledThen:return"Promise { <FULFILLED> "+this.value+" }";case n._rejectedThen:return"Promise { <REJECTED> "+this.value+" }"}};n.resolved=n.dummy=n.resolve();if(e.browser){n.prototype.resolveAtAnimationFrame=function(t){window.requestAnimationFrame(()=>this.resolve(t))};n.prototype.rejectAtAnimationFrame=function(t){window.requestAnimationFrame(()=>this.reject(t))};n.resolveAtAnimationFrame=function(e){return new n(t=>window.requestAnimationFrame(()=>t(e)))};n.rejectAtAnimationFrame=function(r){return new n((t,e)=>window.requestAnimationFrame(()=>e(r)))}}}).call(this)}).call(this,o("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},o("timers").setImmediate)},{_process:179,setimmediate:100,timers:197}],105:[function(t,e,r){"use strict";const l=t("./seventh.js");l.promisifyAll=(e,n)=>{if(n){return(...t)=>{return new l((r,i)=>{e.call(n,...t,(t,...e)=>{if(t){if(e.length&&t instanceof Error){t.args=e}i(t)}else{r(e)}})})}}return function(...t){return new l((r,i)=>{e.call(this,...t,(t,...e)=>{if(t){if(e.length&&t instanceof Error){t.args=e}i(t)}else{r(e)}})})}};l.promisify=(e,n)=>{if(n){return(...t)=>{return new l((r,i)=>{e.call(n,...t,(t,e)=>{if(t){if(e!==undefined&&t instanceof Error){t.arg=e}i(t)}else{r(e)}})})}}return function(...t){return new l((r,i)=>{e.call(this,...t,(t,e)=>{if(t){if(e!==undefined&&t instanceof Error){t.arg=e}i(t)}else{r(e)}})})}};l.returnValueInterceptor=(r,i,n)=>{return function(...t){var e=i.call(n||this,...t);r(e);return e}};l.once=(e,r)=>{var i=false;var n;return function(...t){if(!i){i=true;n=e.call(r||this,...t)}return n}};l.serialize=(r,i)=>{var n=new l.resolve;return function(...t){var e=new l;n.finally(()=>{l.propagate(r.call(i||this,...t),e)});n=e;return e}};l.debounce=(e,r)=>{var i=null;const n=()=>{i=null};return function(...t){if(i){return i}i=e.call(r||this,...t);l.finally(i,n);return i}};l.debounceDelay=(t,e,r)=>{var i=null;const n=()=>{setTimeout(()=>i=null,t)};return function(...t){if(i){return i}i=e.call(r||this,...t);l.finally(i,n);return i}};l.debounceUpdate=(r,i)=>{var n=null;var s=null;var o=null;const a=()=>{var t,e;n=null;if(s){t=s;s=null;e=o;o=null;n=r.call(...t);l.propagate(n,e);l.finally(n,a);return n}};return function(...t){var e=i||this;if(n){if(!o){o=new l}s=[e,...t];return o}n=r.call(e,...t);l.finally(n,a);return n}};l.NO_DELAY={};l.BATCH_NO_DELAY={};l.debounceSync=(s,o)=>{var r=new Map;const a=t=>{var e=r.get(t);if(!e){e={inProgress:null,inProgressIsFull:null,last:null,lastTime:null,lastFullSync:null,lastFullSyncTime:null,nextFullSyncPromise:null,nextFullSyncWith:null,noDelayBatches:new Set};r.set(t,e)}return e};const u=(t,e)=>{var r,i,n,s=new Date;t.inProgress=null;if(e>=2){t.lastFullSyncTime=t.lastTime=s}else if(e>=1){t.lastTime=s}if(t.nextFullSyncWith){if(o.delay&&t.lastFullSyncTime&&(r=s-t.lastFullSyncTime-o.delay)<0){t.inProgress=l.resolveTimeout(-r+1);t.inProgress.finally(()=>u(t,0));return t.nextFullSyncPromise}i=t.nextFullSyncWith;t.nextFullSyncWith=null;n=t.nextFullSyncPromise;t.nextFullSyncPromise=null;t.lastFullSync=t.last=t.inProgress=o.fn.call(...i);l.propagate(t.inProgress,n);l.finally(t.inProgress,()=>u(t,2));return t.inProgress}};const t=function(t,...e){var r=false,i=s.thisBinding||this,n=a(t);if(e[0]===l.NO_DELAY){r=true;e.shift()}else if(e[0]===l.BATCH_NO_DELAY){e.shift();let t=e.shift();if(!n.noDelayBatches.has(t)){n.noDelayBatches.add(t);r=true}}if(n.inProgress){return n.inProgress}if(!r&&s.delay&&n.lastTime&&new Date-n.lastTime<s.delay){if(typeof s.onDebounce==="function"){s.onDebounce(t,...e)}return n.last}n.last=n.inProgress=s.fn.call(i,t,...e);n.inProgressIsFull=false;l.finally(n.inProgress,()=>u(n,1));return n.inProgress};const e=function(t,...e){var r,i=false,n=o.thisBinding||this,s=a(t);if(e[0]===l.NO_DELAY){i=true;e.shift()}else if(e[0]===l.BATCH_NO_DELAY){e.shift();let t=e.shift();if(!s.noDelayBatches.has(t)){s.noDelayBatches.add(t);i=true}}if(!s.inProgress&&!i&&o.delay&&s.lastFullSyncTime&&(r=new Date-s.lastFullSyncTime-o.delay)<0){s.inProgress=l.resolveTimeout(-r+1);l.finally(s.inProgress,()=>u(s,0))}if(s.inProgress){if(!s.nextFullSyncPromise){s.nextFullSyncPromise=new l}s.nextFullSyncWith=[n,t,...e];return s.nextFullSyncPromise}s.lastFullSync=s.last=s.inProgress=o.fn.call(n,t,...e);l.finally(s.inProgress,()=>u(s,2));return s.inProgress};return[t,e]};l.timeout=(r,i,n)=>{return function(...t){var e=i.call(n||this,...t);setTimeout(()=>e.reject(new Error("Timeout")),r);return e}};l.variableTimeout=(i,n)=>{return function(t,...e){var r=i.call(n||this,...e);setTimeout(()=>r.reject(new Error("Timeout")),t);return r}}},{"./seventh.js":108}],106:[function(t,e,r){(function(o){(function(){"use strict";const n=t("./seventh.js");var s=false;n.asyncExit=function(r,i){if(s){return}s=true;var t=o.listeners("asyncExit");if(!t.length){o.exit(r);return}if(i===undefined){i=1e3}const e=e=>{if(e.length<3){e(r,i);return n.dummy}return new n(t=>{e(r,i,()=>{t()})})};n.map(t,e).finally(()=>o.exit(r));setTimeout(()=>o.exit(r),i)};n.resolveSafeTimeout=function(e,r){return new n(t=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>t(r),0)},e/2)},e/2)},0)})}}).call(this)}).call(this,t("_process"))},{"./seventh.js":108,_process:179}],107:[function(t,e,r){"use strict";const i=t("./seventh.js");i.parasite=()=>{var t=["tap","tapCatch","finally","fatal","done","callback","callbackAll"];t.forEach(t=>i.Native.prototype[t]=i.prototype[t]);i.Native.prototype._then=i.Native.prototype.then}},{"./seventh.js":108}],108:[function(t,e,r){"use strict";const i=t("./core.js");e.exports=i;t("./batch.js");t("./wrapper.js");t("./decorators.js");t("./Queue.js");t("./api.js");t("./parasite.js");t("./misc.js")},{"./Queue.js":101,"./api.js":102,"./batch.js":103,"./core.js":104,"./decorators.js":105,"./misc.js":106,"./parasite.js":107,"./wrapper.js":109}],109:[function(t,e,r){"use strict";const l=t("./seventh.js");l.timeLimit=(r,i)=>{return new l((t,e)=>{if(typeof i==="function"){i=i()}l.resolve(i).then(t,e);setTimeout(()=>e(new Error("Timeout")),r)})};l.retry=(t,e)=>{var r=t.retries||1,i=t.coolDown||0,n=t.raiseFactor||1,s=t.maxCoolDown||Infinity,o=t.timeout||0,a=t.catch||null;const u=()=>{return(o?l.timeLimit(o,e):e()).catch(t=>{if(!r--){throw t}var e=i;i=Math.min(i*n,s);if(a){return l.resolve(a(t)).then(()=>l.resolveTimeout(e).then(u))}return l.resolveTimeout(e).then(u)})};return u()};l.onceEvent=(e,r)=>{return new l(t=>e.once(r,t))};l.onceEventAll=(t,r)=>{return new l(e=>t.once(r,(...t)=>e(t)))};l.onceEventOrError=(a,u,t,r=false)=>{return new l((e,i)=>{var n;var s=(...t)=>{a.removeListener("error",o);if(n){for(let t in n){a.removeListener(t,n[t])}}e(r?t:t[0])};var o=t=>{a.removeListener(u,s);if(n){for(let t in n){a.removeListener(t,n[t])}}i(t)};a.once(u,s);a.once("error",o);if(t){if(!Array.isArray(t)){t=[t]}n={};t.forEach(r=>{var t=(...t)=>{a.removeListener("error",o);a.removeListener(u,s);var e=new Error("Received an excluded event: "+r);e.event=r;e.eventArgs=t;i(e)};a.once(r,t);n[r]=t})}})};l.onceEventAllOrError=(t,e,r)=>{return l.onceEventOrError(t,e,r,true)}},{"./seventh.js":108}],110:[function(t,e,r){"use strict";function i(t,e=".",r=""){this.sign=1;this.digits=[];this.exposant=0;this.special=null;this.decimalSeparator=e;this.groupSeparator=r;this.set(t)}e.exports=i;i.prototype.set=function(t){var e,r,i,n,s,o,a,u,l;t=+t;if(!Number.isFinite(t)){this.special=t;return null}t=""+t;e=t.match(/(-)?([0-9]+)(?:.([0-9]+))?(?:e([+-][0-9]+))?/);if(!e){throw new Error("Unexpected error")}this.sign=e[1]?-1:1;this.exposant=e[2].length+(parseInt(e[4],10)||0);a=0;u=false;l=0;for(s=0,o=e[2].length;s<o;s++){n=+e[2][s];if(n!==0){u=true;this.digits[a]=n;a++;l=a}else if(u){this.digits[a]=n;a++}else{this.exposant--}}if(e[3]){for(s=0,o=e[3].length;s<o;s++){n=+e[3][s];if(n!==0){u=true;this.digits[a]=n;a++;l=a}else if(u){this.digits[a]=n;a++}else{this.exposant--}}}if(l!==a){this.digits.length=l}};i.prototype.toNumber=function(){if(this.special!==null){return this.special}return parseFloat((this.sign<0?"-":"")+"0."+this.digits.join("")+"e"+this.exposant)};i.prototype.toString=function(...t){if(this.special!==null){return""+this.special}if(this.exposant>20||this.exposant<-20){return this.toScientificString(...t)}return this.toNoExpString(...t)};i.prototype.toExponential=i.prototype.toExponentialString=function(){if(this.special!==null){return""+this.special}var t=this.sign<0?"-":"";if(!this.digits.length){return t+"0"}t+=this.digits[0];if(this.digits.length>1){t+=this.decimalSeparator+this.digits.join("").slice(1)}t+="e"+(this.exposant>0?"+":"")+(this.exposant-1);return t};const n=["⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"];const s="⁺";const o="⁻";const a="0".charCodeAt(0);i.prototype.toScientific=i.prototype.toScientificString=function(){if(this.special!==null){return""+this.special}var t=this.sign<0?"-":"";if(!this.digits.length){return t+"0"}t+=this.digits[0];if(this.digits.length>1){t+=this.decimalSeparator+this.digits.join("").slice(1)}var e=(this.exposant<=0?o:"")+(""+Math.abs(this.exposant-1)).split("").map(t=>n[t.charCodeAt(0)-a]).join("");t+=" × 10"+e;return t};i.prototype.toNoExp=i.prototype.toNoExpString=function(t=1,e=0,r=false,i=false,n=this.exposant){if(this.special!==null){return""+this.special}var s=[],o=[],a=this.sign<0?"-":i?"+":"";if(!this.digits.length){h(s,0,t);if(e&&!r){h(o,0,e)}}else if(n<=0){h(s,0,t);h(o,0,-n);c(o,this.digits);if(e&&this.digits.length-n<e){h(o,0,e-this.digits.length+n)}}else if(n>=this.digits.length){if(n<t){h(s,0,t-n)}c(s,this.digits);h(s,0,n-this.digits.length);if(e&&!r){h(o,0,e)}}else{if(n<t){h(s,0,t-n)}c(s,this.digits,0,n);c(o,this.digits,n);if(e&&this.digits.length-n<e&&(!r||this.digits.length-n>0)){h(o,0,e-this.digits.length+n)}}a+=this.groupSeparator?this.groupDigits(s,this.groupSeparator):s.join("");if(o.length){a+=this.decimalSeparator+(this.decimalGroupSeparator?this.groupDigits(o,this.decimalGroupSeparator):o.join(""))}return a};const u=["","k","M","G","T","P","E","Z","Y"];const l=["","m","µ","n","p","f","a","z","y"];i.prototype.toMetric=i.prototype.toMetricString=function(t=1,e=0,r=false,i=false){if(this.special!==null){return""+this.special}if(!this.digits.length){return this.sign>0?"0":"-0"}var n="",s;if(this.exposant>0){s=1+(this.exposant-1)%3;n=u[Math.floor((this.exposant-1)/3)];if(n===undefined){return this.toScientificString()}}else{s=3- -this.exposant%3;n=l[1+Math.floor(-this.exposant/3)];if(n===undefined){return this.toScientificString()}}return this.toNoExpString(t,e,r,i,s)+n};i.prototype.precision=function(r){if(this.special!==null||r>=this.digits.length){return this}if(r<0){this.digits.length=0;return this}if(this.digits[r]>=5){let t=r-1,e=false;for(;t>=0;t--){if(this.digits[t]<9){this.digits[t]++;e=true;break}else{this.digits[t]=0}}if(!e){this.exposant++;this.digits[0]=1;this.digits.length=1}else{this.digits.length=t+1}}else{this.digits.length=r;this.removeTrailingZero()}return this};i.prototype.round=function(t=0){var e=this.exposant+t;return this.precision(e)};i.prototype.removeTrailingZero=function(){var t=this.digits.length-1;while(t>=0&&this.digits[t]===0){t--}this.digits.length=t+1};const f=3;i.prototype.groupDigits=function(t,e,r=false){var i="",n=r?0:f-t.length%f,s=0,o=t.length;for(;s<o;s++){i+=s&&(s+n)%f===0?e+t[s]:t[s]}return i};function h(t,e,r){while(r--){t[t.length]=e}return t}function c(e,r,i=0,n=r.length){for(let t=i;t<n;t++){e[e.length]=r[t]}return e}},{}],111:[function(t,e,r){"use strict";e.exports={reset:"[0m",bold:"[1m",dim:"[2m",italic:"[3m",underline:"[4m",inverse:"[7m",defaultColor:"[39m",black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m",grey:"[90m",gray:"[90m",brightBlack:"[90m",brightRed:"[91m",brightGreen:"[92m",brightYellow:"[93m",brightBlue:"[94m",brightMagenta:"[95m",brightCyan:"[96m",brightWhite:"[97m",defaultBgColor:"[49m",bgBlack:"[40m",bgRed:"[41m",bgGreen:"[42m",bgYellow:"[43m",bgBlue:"[44m",bgMagenta:"[45m",bgCyan:"[46m",bgWhite:"[47m",bgGrey:"[100m",bgGray:"[100m",bgBrightBlack:"[100m",bgBrightRed:"[101m",bgBrightGreen:"[102m",bgBrightYellow:"[103m",bgBrightBlue:"[104m",bgBrightMagenta:"[105m",bgBrightCyan:"[106m",bgBrightWhite:"[107m"}},{}],112:[function(t,e,r){"use strict";var i={};e.exports=i;i.toCamelCase=function(t,n=false){if(!t||typeof t!=="string"){return""}return t.replace(/^[\s_-]*([^\s_-]+)|[\s_-]+([^\s_-]?)([^\s_-]*)/g,(t,e,r,i)=>{if(n){if(e){return e}if(!r){return""}return r.toUpperCase()+i}if(e){return e.toLowerCase()}if(!r){return""}return r.toUpperCase()+i.toLowerCase()})};i.camelCaseToSeparated=function(t,i=" "){if(!t||typeof t!=="string"){return""}return t.replace(/^([A-Z])|([A-Z])/g,(t,e,r)=>{if(e){return e.toLowerCase()}return i+r.toLowerCase()})};i.camelCaseToDash=i.camelCaseToDashed=t=>i.camelCaseToSeparated(t,"-")},{}],113:[function(t,e,r){"use strict";r.regExp=r.regExpPattern=t=>t.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1");r.regExpReplacement=t=>t.replace(/\$/g,"$$$$");r.format=t=>t.replace(/%/g,"%%");r.jsSingleQuote=t=>r.control(t).replace(/'/g,"\\'");r.jsDoubleQuote=t=>r.control(t).replace(/"/g,'\\"');r.shellArg=t=>"'"+t.replace(/'/g,"'\\''")+"'";var i={"\r":"\\r","\n":"\\n","\t":"\\t","":"\\x7f"};r.control=(t,r=false)=>t.replace(/[\x00-\x1f\x7f]/g,t=>{if(r&&(t==="\n"||t==="\t")){return t}if(i[t]!==undefined){return i[t]}var e=t.charCodeAt(0).toString(16);if(e.length%2){e="0"+e}return"\\x"+e});var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};r.html=t=>t.replace(/[&<>]/g,t=>n[t]);r.htmlAttr=t=>t.replace(/[&<>"]/g,t=>n[t]);r.htmlSpecialChars=t=>t.replace(/[&<>"']/g,t=>n[t]);r.unicodePercentEncode=t=>t.replace(/[\x00-\x1f\u0100-\uffff\x7f%]/g,t=>{try{return encodeURI(t)}catch(t){return""}});r.httpHeaderValue=t=>r.unicodePercentEncode(t)},{}],114:[function(T,t,S){(function(k){(function(){"use strict";const c=T("./inspect.js").inspect;const d=T("./inspect.js").inspectError;const e=T("./escape.js");const t=T("./ansi.js");const s=T("./unicode.js");const i=T("./naturalSort.js");const n=T("./StringNumber.js");S.formatMethod=function(...p){var t=p[0];if(typeof t!=="string"){if(!t){t=""}else if(typeof t.toString==="function"){t=t.toString()}else{t=""}}var g,y=1,b=p.length,m=false,v=null,w=[];if(this.markupReset&&this.startingMarkupReset){t=(typeof this.markupReset==="function"?this.markupReset(w):this.markupReset)+t}t=t.replace(/\^(.?)|(%%)|%([+-]?)([0-9]*)(?:\[([^\]]*)\])?([a-zA-Z])/g,(t,e,r,i,n,s,o)=>{var a,u,l,f,h,c,d=[];if(r){return"%"}if(e){if(this.noMarkup){return"^"+e}if(e==="^"){return"^"}if(this.shiftMarkup&&this.shiftMarkup[e]){v=this.shiftMarkup[e];return""}if(v){if(!this.shiftedMarkup||!this.shiftedMarkup[v]||!this.shiftedMarkup[v][e]){return""}m=true;if(typeof this.shiftedMarkup[v][e]==="function"){a=this.shiftedMarkup[v][e](w)}else{a=this.shiftedMarkup[v][e];w.push(a)}v=null}else{if(!this.markup||!this.markup[e]){return""}m=true;if(typeof this.markup[e]==="function"){a=this.markup[e](w)}else{a=this.markup[e];w.push(a)}}return a}if(n){n=parseInt(n,10);if(i){if(i==="+"){n=y+n}else if(i==="-"){n=y-n}}}else{n=y}y++;if(n>=b||n<1){g=undefined}else{g=p[n]}if(_[o]){a=_[o](g,s,this);if(this.argumentSanitizer&&!_[o].noSanitize){a=this.argumentSanitizer(a)}if(s&&!_[o].noCommonModeArg){a=x(a,s)}return a}if(o==="F"){y--;if(s===undefined){return""}l=s.split(":");f=l[0];h=l[1];if(!f){return""}if(h&&(c=h.match(/%([+-]?)([0-9]*)[a-zA-Z]/g))){for(u=0;u<c.length;u++){i=c[u][1];n=c[u][2];if(n){n=parseInt(n,10);if(i){if(i==="+"){n=y+n}else if(i==="-"){n=y-n}}}else{n=y}y++;if(n>=b||n<1){d[u]=undefined}else{d[u]=p[n]}}}if(!this||!this.fn||typeof this.fn[f]!=="function"){return""}return this.fn[f].apply(this,d)}return""});if(m&&this.markupReset&&this.endingMarkupReset){t+=typeof this.markupReset==="function"?this.markupReset(w):this.markupReset}if(this.extraArguments){for(;y<b;y++){g=p[y];if(g===null||g===undefined){continue}else if(typeof g==="string"){t+=g}else if(typeof g==="number"){t+=g}else if(typeof g.toString==="function"){t+=g.toString()}}}return t};const _={};_.s=t=>{if(typeof t==="string"){return t}if(t===null||t===undefined||t===true||t===false){return"("+t+")"}if(typeof t==="number"){return""+t}if(typeof t.toString==="function"){return t.toString()}return"("+t+")"};_.r=t=>_.s(t);_.r.noSanitize=true;_.S=(t,e,r)=>{var i=t=>S.markupMethod.call(r,r.argumentSanitizer?r.argumentSanitizer(t):t);if(typeof t==="string"){return i(t)}if(t===null||t===undefined||t===true||t===false){return"("+t+")"}if(typeof t==="number"){return""+t}if(typeof t.toString==="function"){return i(t.toString())}return i("("+t+")")};_.S.noSanitize=true;_.S.noCommonModeArg=true;_.N=(t,e)=>{if(typeof t==="string"){return t}if(t===null||t===undefined||t===true||t===false){return""+t}if(typeof t==="number"){return _.f(t,".3g ")}if(Array.isArray(t)){t=t.map(t=>_.N(t,true));if(e){return"["+t.join(",")+"]"}return t.join(", ")}if(k.isBuffer(t)){t=[...t].map(t=>{t=t.toString(16);if(t.length===1){t="0"+t}return t});return"<"+t.join(" ")+">"}var r=Object.getPrototypeOf(t);if(r===null||r===Object.prototype){t=Object.entries(t).sort(i).map(t=>t[0]+": "+_.N(t[1],true));if(e){return"{"+t.join(", ")+"}"}return t.join(", ")}if(typeof t.inspect==="function"){return t.inspect()}if(typeof t.toString==="function"){return t.toString()}return"("+t+")"};_.n=t=>_.N(t,true);_.f=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)};_.f.noSanitize=true;_.P=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}t*=100;var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null||!r.precision){i.round(r.rounding||0)}if(r.precision){i.precision(r.precision)}return i.toNoExpString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)+"%"};_.P.noSanitize=true;_.p=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}t=(t-1)*100;var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null||!r.precision){i.round(r.rounding||0)}if(r.precision){i.precision(r.precision)}return i.toNoExpString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal,true)+"%"};_.p.noSanitize=true;_.k=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"0"}var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision||r.rounding===null){i.precision(r.precision||3)}return i.toMetricString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)};_.k.noSanitize=true;_.e=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toExponential()};_.e.noSanitize=true;_.K=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toScientific()};_.K.noSanitize=true;_.d=_.i=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.floor(t)}return"0"};_.i.noSanitize=true;_.u=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0)}return"0"};_.u.noSanitize=true;_.U=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),1)}return"1"};_.U.noSanitize=true;_.m=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"(NaN)"}var e="";if(t<0){e="-";t=-t}var r=w(t),i=t-r;if(!i){return e+r+"°"}var n=w(i*60),s=w(i*3600-n*60);if(s){return e+r+"°"+(""+n).padStart(2,"0")+"′"+(""+s).padStart(2,"0")+"″"}return e+r+"°"+(""+n).padStart(2,"0")+"′"};_.m.noSanitize=true;_.t=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"(NaN)"}var e=Math.floor(t/1e3);if(e<60){return e+"s"}var r=Math.floor(e/60);e=e%60;if(r<60){return r+"min"+(""+e).padStart(2,"0")+"s"}var i=Math.floor(r/60);r=r%60;return i+"h"+(""+r).padStart(2,"0")+"min"+(""+e).padStart(2,"0")+"s"};_.t.noSanitize=true;_.h=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(16)}return"0"};_.h.noSanitize=true;_.x=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"00"}var e=""+Math.max(Math.floor(t),0).toString(16);if(e.length%2){e="0"+e}return e};_.x.noSanitize=true;_.o=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(8)}return"0"};_.o.noSanitize=true;_.b=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(2)}return"0"};_.b.noSanitize=true;_.X=t=>{if(typeof t==="string"){t=k.from(t)}else if(!k.isBuffer(t)){return""}return t.toString("hex")};_.X.noSanitize=true;_.z=t=>{if(typeof t==="string"){t=k.from(t)}else if(!k.isBuffer(t)){return""}return t.toString("base64")};_.Z=t=>{if(typeof t==="string"){t=k.from(t)}else if(!k.isBuffer(t)){return""}return t.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/[=]{1,2}$/g,"")};const o={};_.I=(t,e,r)=>y(t,e,r,o);_.I.noSanitize=true;const a={noFunc:true,enumOnly:true,noDescriptor:true,useInspect:true,useInspectPropertyBlackList:true};_.Y=(t,e,r)=>y(t,e,r,a);_.Y.noSanitize=true;const u={minimal:true,noIndex:true};_.O=(t,e,r)=>y(t,e,r,u);_.O.noSanitize=true;const l={};_.E=(t,e,r)=>y(t,e,r,l,true);_.E.noSanitize=true;_.J=t=>t===undefined?"null":JSON.stringify(t);_.D=()=>"";_.D.noSanitize=true;var r={argumentSanitizer:t=>e.control(t,true),extraArguments:true,color:false,noMarkup:false,endingMarkupReset:true,startingMarkupReset:false,markupReset:t.reset,shiftMarkup:{"#":"background"},markup:{":":t.reset," ":t.reset+" ","-":t.dim,"+":t.bold,_:t.underline,"/":t.italic,"!":t.inverse,b:t.blue,B:t.brightBlue,c:t.cyan,C:t.brightCyan,g:t.green,G:t.brightGreen,k:t.black,K:t.brightBlack,m:t.magenta,M:t.brightMagenta,r:t.red,R:t.brightRed,w:t.white,W:t.brightWhite,y:t.yellow,Y:t.brightYellow},shiftedMarkup:{background:{":":t.reset," ":t.reset+" ",b:t.bgBlue,B:t.bgBrightBlue,c:t.bgCyan,C:t.bgBrightCyan,g:t.bgGreen,G:t.bgBrightGreen,k:t.bgBlack,K:t.bgBrightBlack,m:t.bgMagenta,M:t.bgBrightMagenta,r:t.bgRed,R:t.bgBrightRed,w:t.bgWhite,W:t.bgBrightWhite,y:t.bgYellow,Y:t.bgBrightYellow}}};S.createFormatter=t=>S.formatMethod.bind(Object.assign({},r,t));S.format=S.formatMethod.bind(r);S.format.default=r;S.format.modes=_;S.markupMethod=function(t){if(typeof t!=="string"){if(!t){t=""}else if(typeof t.toString==="function"){t=t.toString()}else{t=""}}var i=false,n=null,s=[];if(this.markupReset&&this.startingMarkupReset){t=(typeof this.markupReset==="function"?this.markupReset(s):this.markupReset)+t}t=t.replace(/\^(.?)/g,(t,e)=>{var r;if(e==="^"){return"^"}if(this.shiftMarkup&&this.shiftMarkup[e]){n=this.shiftMarkup[e];return""}if(n){if(!this.shiftedMarkup||!this.shiftedMarkup[n]||!this.shiftedMarkup[n][e]){return""}i=true;if(typeof this.shiftedMarkup[n][e]==="function"){r=this.shiftedMarkup[n][e](s)}else{r=this.shiftedMarkup[n][e];s.push(r)}n=null}else{if(!this.markup||!this.markup[e]){return""}i=true;if(typeof this.markup[e]==="function"){r=this.markup[e](s)}else{r=this.markup[e];s.push(r)}}return r});if(i&&this.markupReset&&this.endingMarkupReset){t+=typeof this.markupReset==="function"?this.markupReset(s):this.markupReset}return t};S.createMarkup=t=>S.markupMethod.bind(Object.assign({},r,t));S.markup=S.markupMethod.bind(r);S.format.count=function(t){var e,r,i,n=1,s=0;if(typeof t!=="string"){return 0}var o=/%([+-]?)([0-9]*)(?:\[([^\]]*)\])?([a-zA-EG-Z])/g;while((e=o.exec(t))!==null){i=e[1];r=e[2];if(r){r=parseInt(r,10);if(i){if(i==="+"){r=n+r}else if(i==="-"){r=n-r}}}else{r=n}n++;if(s<r){s=r}}return s};S.format.hasFormatting=function(t){if(t.search(/\^(.?)|(%%)|%([+-]?)([0-9]*)(?:\[([^\]]*)\])?([a-zA-Z])/)!==-1){return true}return false};const f=/([a-zA-Z])(.[^a-zA-Z]*)/g;const p=/([a-zA-Z]|^)(.[^a-zA-Z]*)/g;function x(e,t){var r,i,n;f.lastIndex=0;while(r=f.exec(t)){[,i,n]=r;if(i==="L"){let t=s.width(e);n=+n||1;if(t>n){e=s.truncateWidth(e,n-1).trim()+"…";t=s.width(e)}if(t<n){e=" ".repeat(n-t)+e}}else if(i==="R"){let t=s.width(e);n=+n||1;if(t>n){e=s.truncateWidth(e,n-1).trim()+"…";t=s.width(e)}if(t<n){e=e+" ".repeat(n-t)}}}return e}const h={leftPadding:1,rightPadding:0,rightPaddingOnlyIfDecimal:false,rounding:null,precision:null,groupSeparator:""};function g(t){var e,r,i,n;h.leftPadding=1;h.rightPadding=0;h.rightPaddingOnlyIfDecimal=false;h.rounding=null;h.precision=null;h.groupSeparator="";if(t){p.lastIndex=0;while(e=p.exec(t)){[,r,i]=e;if(r==="z"){h.leftPadding=+i}else if(r==="g"){h.groupSeparator=i||" "}else if(!r){if(i==="g"){h.groupSeparator=" "}else if(i[0]==="."){n=i[i.length-1];if(n==="!"){h.rounding=h.rightPadding=parseInt(i.slice(1,-1),10)||0}else if(n==="?"){h.rounding=h.rightPadding=parseInt(i.slice(1,-1),10)||0;h.rightPaddingOnlyIfDecimal=true}else{h.rounding=parseInt(i.slice(1),10)||0}}else if(i[i.length-1]==="."){h.rounding=-parseInt(i.slice(0,-1),10)||0}else{h.precision=parseInt(i,10)||null}}}}return h}function y(t,e,r,i,n=false){var s,o,a,u,l,f=3,h=r&&r.color?"color":"none";if(e){p.lastIndex=0;while(s=p.exec(e)){[,o,a]=s;if(o==="c"){if(a==="+"){h="color"}else if(a==="-"){h="none"}}else if(o==="l"){u=parseInt(a,10)||undefined}else if(o==="s"){l=parseInt(a,10)||undefined}else if(!o){f=parseInt(a,10)||1}}}if(n){return d(Object.assign({depth:f,style:h,outputMaxLength:u,maxLength:l},i),t)}return c(Object.assign({depth:f,style:h,outputMaxLength:u,maxLength:l},i),t)}const b=1e-10;const m=Math.round(1/b);function v(t){return Math.round(t*m)/m}function w(t){return Math.floor(t+b)}function C(t,e){return v(e*Math.round(t*(1/e)))}}).call(this)}).call(this,T("buffer").Buffer)},{"./StringNumber.js":110,"./ansi.js":111,"./escape.js":113,"./inspect.js":116,"./naturalSort.js":120,"./unicode.js":125,buffer:147}],115:[function(t,e,r){"use strict";const x={};e.exports=x;x.score=(t,e)=>{if(t===e){return 1}if(t.length===0||e.length===0){return 0}return Math.max(0,1-x.levenshtein(t,e)/e.length)};const C=0;const k=.88;const _=.9;x.bestMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n,s,o,a,u=-1,l=null;for(n=0,s=e.length;n<s;n++){a=e[n];o=x.score(t,a);if(o===1){return r.indexOf?n:a}if(o>i){i=o;l=a;u=n}}return r.indexOf?u:l};x.topMatch=(r,t,e={})=>{var i=e.scoreLimit||C,n=e.deltaRate||_,s,o,a;a=t.map((t,e)=>({pattern:t,index:e,score:x.score(r,t)}));a.sort((t,e)=>e.score-t.score);if(a[0].score<=i){return[]}i=Math.max(i,a[0].score*n);for(s=1,o=a.length;s<o;s++){if(a[s].score<i){a.length=s;break}}return e.indexOf?a.map(t=>t.index):a.map(t=>t.pattern)};const i=new Set(["a","an","the","this","that","those","some","of","in","on","at","my","your","her","his","its","our","their"]);function T(t,e=i){return t.split(/[ '"/|,:_-]+/g).filter(t=>t&&!e.has(t))}x.bestTokenMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n=r.tokenDisparityPenalty||k,s,o,a,u,l,f,h,c,d,p,g=i,y,b,m=T(t),v,w=-1,_=null;if(!m.length||!e.length){return r.indexOf?w:_}for(s=0,o=e.length;s<o;s++){h=e[s];c=T(h);p=0;for(a=0,u=m.length;a<u;a++){y=m[a];v=0;for(l=0,f=c.length;l<f;l++){d=c[l];b=x.score(y,d);if(b>v){v=b;if(b===1){break}}}p+=v}p/=m.length;if(m.length!==c.length){p*=n**Math.abs(c.length-m.length)}if(p>g){g=p;_=h;w=s}}return r.indexOf?w:_};x.topTokenMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n=r.tokenDisparityPenalty||k,s=r.deltaRate||_,o,a,u,l,f,h,c,d,p,g,y,b,m=T(t),v,w=[];if(!m.length||!e.length){return[]}for(o=0,a=e.length;o<a;o++){c=e[o];d=T(c);g=0;for(u=0,l=m.length;u<l;u++){y=m[u];v=0;for(f=0,h=d.length;f<h;f++){p=d[f];b=x.score(y,p);if(b>v){v=b;if(b===1){break}}}g+=v}g/=m.length;if(m.length!==d.length){g*=n**Math.abs(d.length-m.length)}w.push({pattern:c,index:o,score:g})}w.sort((t,e)=>e.score-t.score);if(w[0].score<=i){return[]}i=Math.max(i,w[0].score*s);for(o=1,a=w.length;o<a;o++){if(w[o].score<i){w.length=o;break}}return r.indexOf?w.map(t=>t.index):w.map(t=>t.pattern)};const h=[];const c=[];x.levenshtein=(e,r)=>{if(e===r){return 0}if(e.length>r.length){let t=e;e=r;r=t}let t=e.length;let i=r.length;while(t>0&&e.charCodeAt(t-1)===r.charCodeAt(i-1)){t--;i--}let n=0;while(n<t&&e.charCodeAt(n)===r.charCodeAt(n)){n++}t-=n;i-=n;if(t===0){return i}let s;let o;let a;let u;let l=0;let f=0;while(l<t){c[l]=e.charCodeAt(n+l);h[l]=++l}while(f<i){s=r.charCodeAt(n+f);a=f++;o=f;for(l=0;l<t;l++){u=s===c[l]?a:a+1;a=h[l];o=h[l]=a>o?u>o?o+1:u:u>a?a+1:u}}return o}},{}],116:[function(e,t,r){(function(A,h){(function(){"use strict";const x=e("./escape.js");const n=e("./ansi.js");const C={};const k=new Set([Object,Array]);function o(t,e){if(arguments.length<2){e=t;t={}}else if(!t||typeof t!=="object"){t={}}var r={depth:0,ancestors:[]};if(!t.style){t.style=f.none}else if(typeof t.style==="string"){t.style=f[t.style]}if(t.depth===undefined){t.depth=3}if(t.maxLength===undefined){t.maxLength=250}if(t.outputMaxLength===undefined){t.outputMaxLength=5e3}if(t.nofunc){t.noFunc=true}if(t.minimal){t.noFunc=true;t.noDescriptor=true;t.noType=true;t.noArrayProperty=true;t.enumOnly=true;t.proto=false;t.funcDetails=false}if(t.minimalPlusConstructor){t.noFunc=true;t.noDescriptor=true;t.noTypeButConstructor=true;t.noArrayProperty=true;t.enumOnly=true;t.proto=false;t.funcDetails=false}var i=T(r,t,e);if(i.length>t.outputMaxLength){i=t.style.truncate(i,t.outputMaxLength)}return i}function T(e,r,t){var i,n,s,o,a,u,l,f,h,c,d,p,g,y,b="",m="",v="",w,_;h=typeof t;d=r.style.tab.repeat(e.depth);if(h==="function"&&r.noFunc){return""}if(e.key!==undefined){if(e.descriptor){v=[];if(!e.descriptor.configurable){v.push("-conf")}if(!e.descriptor.enumerable){v.push("-enum")}if(!e.descriptor.writable){v.push("-w")}if(v.length){v=v.join(" ")}else{v=""}}if(e.keyIsProperty){if(S(e.key)){m='"'+r.style.key(e.key)+'": '}else{m=r.style.key(e.key)+": "}}else if(!r.noIndex){m=r.style.index(e.key)}if(v){v=" "+r.style.type(v)}}c=e.noPre?"":d+m;if(t===undefined){b+=c+r.style.constant("undefined")+v+r.style.newline}else if(t===C){b+=c+r.style.constant("[empty]")+v+r.style.newline}else if(t===null){b+=c+r.style.constant("null")+v+r.style.newline}else if(t===false){b+=c+r.style.constant("false")+v+r.style.newline}else if(t===true){b+=c+r.style.constant("true")+v+r.style.newline}else if(h==="number"){b+=c+r.style.number(t.toString())+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("number"))+v+r.style.newline}else if(h==="string"){if(t.length>r.maxLength){b+=c+'"'+r.style.string(x.control(t.slice(0,r.maxLength-1)))+'…"'+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("string")+r.style.length("("+t.length+" - TRUNCATED)"))+v+r.style.newline}else{b+=c+'"'+r.style.string(x.control(t))+'"'+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("string")+r.style.length("("+t.length+")"))+v+r.style.newline}}else if(A.isBuffer(t)){b+=c+r.style.inspect(t.inspect())+(r.noType?"":" "+r.style.type("Buffer")+r.style.length("("+t.length+")"))+v+r.style.newline}else if(h==="object"||h==="function"){n=s="";g=false;if(h==="function"){g=true;n=" "+r.style.funcName(t.name?t.name:"(anonymous)");s=r.style.length("("+t.length+")")}p=false;if(Array.isArray(t)){p=true;s=r.style.length("("+t.length+")")}if(!t.constructor){l="(no constructor)"}else if(!t.constructor.name){l="(anonymous)"}else{l=t.constructor.name}u=!t.constructor||k.has(t.constructor);l=r.style.constructorName(l);o=Object.getPrototypeOf(t);b+=c;if(!r.noType&&(!r.noTypeButConstructor||!u)){if(e.forceType&&!r.noType&&!r.noTypeButConstructor){b+=r.style.type(e.forceType)}else if(r.noTypeButConstructor){b+=l}else{b+=l+n+s+" "+r.style.type(h)+v}if(!g||r.funcDetails){b+=" "}}if(p&&r.noArrayProperty){a=[...Array(t.length).keys()]}else{a=Object.getOwnPropertyNames(t)}if(r.sort){a.sort()}y=E(t,e,r);if(r.protoBlackList&&r.protoBlackList.has(o)){b+=r.style.limit("[skip]")+r.style.newline}else if(y!==undefined){if(typeof y==="string"){b+="=> "+y+r.style.newline}else{b+="=> "+T({depth:e.depth,ancestors:e.ancestors,noPre:true},r,y)}}else if(g&&!r.funcDetails){b+=r.style.newline}else if(!a.length&&!r.proto){b+=(p?"[]":"{}")+r.style.newline}else if(e.depth>=r.depth){b+=r.style.limit("[depth limit]")+r.style.newline}else if(e.ancestors.indexOf(t)!==-1){b+=r.style.limit("[circular]")+r.style.newline}else{b+=(p?"[":"{")+r.style.newline;_=e.ancestors.slice();_.push(t);for(i=0;i<a.length&&b.length<r.outputMaxLength;i++){if(!p&&(r.propertyBlackList&&r.propertyBlackList.has(a[i])||r.useInspectPropertyBlackList&&t.inspectPropertyBlackList instanceof Set&&t.inspectPropertyBlackList.has(a[i]))){continue}if(p&&r.noArrayProperty&&!(a[i]in t)){b+=T({depth:e.depth+1,ancestors:_,key:a[i],keyIsProperty:false},r,C)}else{try{w=Object.getOwnPropertyDescriptor(t,a[i]);if(!w.enumerable&&r.enumOnly){continue}f=!p||!w.enumerable||isNaN(a[i]);if(!r.noDescriptor&&w&&(w.get||w.set)){b+=T({depth:e.depth+1,ancestors:_,key:a[i],keyIsProperty:f,descriptor:w,forceType:"getter/setter"},r,{get:w.get,set:w.set})}else{b+=T({depth:e.depth+1,ancestors:_,key:a[i],keyIsProperty:f,descriptor:r.noDescriptor?undefined:w},r,t[a[i]])}}catch(t){b+=T({depth:e.depth+1,ancestors:_,key:a[i],keyIsProperty:f,descriptor:r.noDescriptor?undefined:w},r,t)}}if(i<a.length-1){b+=r.style.comma}}if(r.proto){b+=T({depth:e.depth+1,ancestors:_,key:"__proto__",keyIsProperty:true},r,o)}b+=d+(p?"]":"}");b+=r.style.newline}}if(e.depth===0){if(r.style.trim){b=b.trim()}if(r.style==="html"){b=x.html(b)}}return b}r.inspect=o;function S(t){if(!t.length){return true}return false}var a=["pending","fulfilled","rejected"];function E(i,n,s){if(typeof i.constructor!=="function"){return}if(i instanceof String){return i.toString()}if(i instanceof RegExp){return i.toString()}if(i instanceof Date){return i.toString()+" ["+i.getTime()+"]"}if(typeof Set==="function"&&i instanceof Set){return Array.from(i)}if(typeof Map==="function"&&i instanceof Map){return Array.from(i)}if(i instanceof Promise){if(h&&h.binding&&h.binding("util")&&h.binding("util").getPromiseDetails){let t=h.binding("util").getPromiseDetails(i);let e=a[t[0]];let r="Promise <"+e+">";if(e==="fulfilled"){r+=" "+T({depth:n.depth,ancestors:n.ancestors,noPre:true},s,t[1])}else if(e==="rejected"){if(t[1]instanceof Error){r+=" "+u({style:s.style,noErrorStack:true},t[1])}else{r+=" "+T({depth:n.depth,ancestors:n.ancestors,noPre:true},s,t[1])}}return r}}if(i._bsontype){return i.toString()}if(s.useInspect&&typeof i.inspect==="function"){return i.inspect()}return}function u(t,e){var r="",i,n,s;if(arguments.length<2){e=t;t={}}else if(!t||typeof t!=="object"){t={}}if(!(e instanceof Error)){return"inspectError(): it's not an error, using regular variable inspection: "+o(t,e)}if(!t.style){t.style=f.none}else if(typeof t.style==="string"){t.style=f[t.style]}if(e.stack&&!t.noErrorStack){i=l(t,e.stack)}n=e.type||e.constructor.name;s=e.code||e.name||e.errno||e.number;r+=t.style.errorType(n)+(s?" ["+t.style.errorType(s)+"]":"")+": ";r+=t.style.errorMessage(e.message)+"\n";if(i){r+=t.style.errorStack(i)+"\n"}if(e.from){r+=t.style.newline+t.style.errorFromMessage("From error:")+t.style.newline+u(t,e.from)}return r}r.inspectError=u;function l(u,t){if(arguments.length<2){t=u;u={}}else if(!u||typeof u!=="object"){u={}}if(!u.style){u.style=f.none}else if(typeof u.style==="string"){u.style=f[u.style]}if(!t){return}if((u.browser||h.browser)&&t.indexOf("@")!==-1){t=t.replace(/[</]*(?=@)/g,"").replace(/^\s*([^@]*)\s*@\s*([^\n]*)(?::([0-9]+):([0-9]+))?$/gm,(t,e,r,i,n)=>{return u.style.errorStack("    at ")+(e?u.style.errorStackMethod(e)+" ":"")+u.style.errorStack("(")+(r?u.style.errorStackFile(r):u.style.errorStack("unknown"))+(i?u.style.errorStack(":")+u.style.errorStackLine(i):"")+(n?u.style.errorStack(":")+u.style.errorStackColumn(n):"")+u.style.errorStack(")")})}else{t=t.replace(/^[^\n]*\n/,"");t=t.replace(/^\s*(at)\s+(?:(?:(async|new)\s+)?([^\s:()[\]\n]+(?:\([^)]+\))?)\s)?(?:\[as ([^\s:()[\]\n]+)\]\s)?(?:\(?([^:()[\]\n]+):([0-9]+):([0-9]+)\)?)?$/gm,(t,e,r,i,n,s,o,a)=>{return u.style.errorStack("    at ")+(r?u.style.errorStackKeyword(r)+" ":"")+(i?u.style.errorStackMethod(i)+" ":"")+(n?u.style.errorStack("[as ")+u.style.errorStackMethodAs(n)+u.style.errorStack("] "):"")+u.style.errorStack("(")+(s?u.style.errorStackFile(s):u.style.errorStack("unknown"))+(o?u.style.errorStack(":")+u.style.errorStackLine(o):"")+(a?u.style.errorStack(":")+u.style.errorStackColumn(a):"")+u.style.errorStack(")")})}return t}r.inspectStack=l;var f={};var t=t=>t;f.none={trim:false,tab:"    ",newline:"\n",comma:"",limit:t,type:t=>"<"+t+">",constant:t,funcName:t,constructorName:t=>"<"+t+">",length:t,key:t,index:t=>"["+t+"] ",number:t,inspect:t,string:t,errorType:t,errorMessage:t,errorStack:t,errorStackKeyword:t,errorStackMethod:t,errorStackMethodAs:t,errorStackFile:t,errorStackLine:t,errorStackColumn:t,errorFromMessage:t,truncate:(t,e)=>t.slice(0,e-1)+"…"};f.inline=Object.assign({},f.none,{trim:true,tab:"",newline:" ",comma:", ",length:()=>"",index:()=>""});f.color=Object.assign({},f.none,{limit:t=>n.bold+n.brightRed+t+n.reset,type:t=>n.italic+n.brightBlack+t+n.reset,constant:t=>n.cyan+t+n.reset,funcName:t=>n.italic+n.magenta+t+n.reset,constructorName:t=>n.magenta+t+n.reset,length:t=>n.italic+n.brightBlack+t+n.reset,key:t=>n.green+t+n.reset,index:t=>n.blue+"["+t+"]"+n.reset+" ",number:t=>n.cyan+t+n.reset,inspect:t=>n.cyan+t+n.reset,string:t=>n.blue+t+n.reset,errorType:t=>n.red+n.bold+t+n.reset,errorMessage:t=>n.red+n.italic+t+n.reset,errorStack:t=>n.brightBlack+t+n.reset,errorStackKeyword:t=>n.italic+n.bold+t+n.reset,errorStackMethod:t=>n.brightYellow+t+n.reset,errorStackMethodAs:t=>n.yellow+t+n.reset,errorStackFile:t=>n.brightCyan+t+n.reset,errorStackLine:t=>n.blue+t+n.reset,errorStackColumn:t=>n.magenta+t+n.reset,errorFromMessage:t=>n.yellow+n.underline+t+n.reset,truncate:(t,e)=>{var r=n.gray+"…"+n.reset;t=t.slice(0,e-r.length);var i=t.lastIndexOf("");if(i>=t.length-6){t=t.slice(0,i)}return t+r}});f.html=Object.assign({},f.none,{tab:"&nbsp;&nbsp;&nbsp;&nbsp;",newline:"<br />",limit:t=>'<span style="color:red">'+t+"</span>",type:t=>'<i style="color:gray">'+t+"</i>",constant:t=>'<span style="color:cyan">'+t+"</span>",funcName:t=>'<i style="color:magenta">'+t+"</i>",constructorName:t=>'<span style="color:magenta">'+t+"</span>",length:t=>'<i style="color:gray">'+t+"</i>",key:t=>'<span style="color:green">'+t+"</span>",index:t=>'<span style="color:blue">['+t+"]</span> ",number:t=>'<span style="color:cyan">'+t+"</span>",inspect:t=>'<span style="color:cyan">'+t+"</span>",string:t=>'<span style="color:blue">'+t+"</span>",errorType:t=>'<span style="color:red">'+t+"</span>",errorMessage:t=>'<span style="color:red">'+t+"</span>",errorStack:t=>'<span style="color:gray">'+t+"</span>",errorStackKeyword:t=>"<i>"+t+"</i>",errorStackMethod:t=>'<span style="color:yellow">'+t+"</span>",errorStackMethodAs:t=>'<span style="color:yellow">'+t+"</span>",errorStackFile:t=>'<span style="color:cyan">'+t+"</span>",errorStackLine:t=>'<span style="color:blue">'+t+"</span>",errorStackColumn:t=>'<span style="color:gray">'+t+"</span>",errorFromMessage:t=>'<span style="color:yellow">'+t+"</span>"})}).call(this)}).call(this,{isBuffer:e("../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js")},e("_process"))},{"../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js":162,"./ansi.js":111,"./escape.js":113,_process:179}],117:[function(t,e,r){e.exports={"߀":"0","́":""," ":" ","Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ɓ":"B","ｃ":"C","Ⓒ":"C","Ｃ":"C","Ꜿ":"C","Ḉ":"C","Ç":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ɗ":"D","Ɖ":"D","ᴅ":"D","Ꝺ":"D","Ð":"Dh","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","ɛ":"E","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","ᴇ":"E","ꝼ":"F","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","ɢ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","ȷ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","ϻ":"M","Ꞥ":"N","Ƞ":"N","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ɲ":"N","Ꞑ":"N","ᴎ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Þ":"Th","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ɑ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","Ƃ":"b","ⓒ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c",C:"c","Ć":"c","Ĉ":"c","Ċ":"c","Č":"c","Ƈ":"c","Ȼ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","Ƌ":"d","Ꮷ":"d","ԁ":"d","Ɦ":"d","ð":"dh","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ﬀ":"ff","ﬁ":"fi","ﬂ":"fl","ﬃ":"ffi","ﬄ":"ffl","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ꝿ":"g","ᵹ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ɭ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ԉ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ɔ":"o","ᴑ":"o","œ":"oe","ƣ":"oi","ꝏ":"oo","ȣ":"ou","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ρ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ʂ":"s","ß":"ss","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","þ":"th","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z"}},{}],118:[function(t,e,r){"use strict";var i=t("./latinize-map.json");e.exports=function(t){return t.replace(/[^\u0000-\u007e]/g,t=>{return i[t]||t})}},{"./latinize-map.json":117}],119:[function(t,e,r){"use strict";r.resize=function(t,e){if(t.length===e){return t}else if(t.length>e){return t.slice(0,e)}return t+" ".repeat(e-t.length)};r.occurrenceCount=function(t,e,r=false){if(!t||!e){return 0}var i=0,n=0,s=r?1:e.length;while((n=t.indexOf(e,n))!==-1){i++;n+=s}return i}},{}],120:[function(t,e,r){"use strict";const _=1;const x=2;const C=3;const k=4;const T=5;function S(t,e){if(E(e)){return x}if(e<=31||e===127){return _}if(A(e)){return k}if(t.toUpperCase()!==t.toLowerCase()){return C}return T}function E(t){if(t===32||t===9||t===160||t===45||t===95){return true}return false}function A(t){if(t>=48&&t<=57){return true}return false}function i(t,e){t=""+t;e=""+e;var r,i,n,s,o,a,u,l=t.trim(),f=l.length,h,c,d,p,g,y,b,m=e.trim(),v=m.length,w=0;for(r=h=0;r<f&&h<v;r++,h++){n=l[r];d=m[h];s=l.charCodeAt(r);p=m.charCodeAt(h);o=S(n,s);g=S(d,p);if(o!==g){return o-g}switch(o){case x:while(E(l.charCodeAt(r+1))){r++}while(E(m.charCodeAt(h+1))){h++}break;case _:case T:if(s!==p){return s-p}break;case C:a=n.toLowerCase();y=d.toLowerCase();if(a!==y){return a>y?1:-1}if(!w&&n!==d){w=n!==a?-1:1}break;case k:i=r+1;while(A(l.charCodeAt(i))){i++}u=parseFloat(l.slice(r,i));c=h+1;while(A(m.charCodeAt(c))){c++}b=parseFloat(m.slice(h,c));if(u!==b){return u-b}if(!w&&i-r!==c-h){w=i-r-(c-h)}r=i-1;h=c-1;break}}if(w){return w}return f-r-(v-h)||f-v||t.length-e.length}e.exports=i},{}],121:[function(t,e,r){"use strict";var i={};e.exports=i;i.repeat=function(t){if(this===null){throw new TypeError("can't convert "+this+" to object")}var e=""+this;t=+t;if(t!==t){t=0}if(t<0){throw new RangeError("repeat count must be non-negative")}if(t===Infinity){throw new RangeError("repeat count must be less than infinity")}t=Math.floor(t);if(e.length===0||t===0){return""}if(e.length*t>=1<<28){throw new RangeError("repeat count must not overflow maximum string size")}var r="";for(;;){if((t&1)===1){r+=e}t>>>=1;if(t===0){break}e+=e}return r}},{}],122:[function(t,e,r){"use strict";var n=t("./escape.js");r.regexp={};r.regexp.array2alternatives=function t(e){var r,i=e.slice();i.sort((t,e)=>{return e.length-t.length});for(r=0;r<i.length;r++){i[r]=n.regExpPattern(i[r])}return i.join("|")}},{"./escape.js":113}],123:[function(t,e,r){"use strict";const i={};e.exports=i;var n;var s=t("./polyfill.js");for(n in s){i[n]=function(t,...e){return s[n].call(t,...e)}}Object.assign(i,{escape:t("./escape.js")},{ansi:t("./ansi.js")},{unicode:t("./unicode.js")});Object.assign(i,t("./format.js"),t("./misc.js"),t("./inspect.js"),t("./regexp.js"),t("./camel.js"),{latinize:t("./latinize.js"),toTitleCase:t("./toTitleCase.js"),wordwrap:t("./wordwrap.js"),naturalSort:t("./naturalSort.js"),fuzzy:t("./fuzzy.js"),StringNumber:t("./StringNumber.js")});i.installPolyfills=function t(){var e;for(e in s){if(!String.prototype[e]){String.prototype[e]=s[e]}}}},{"./StringNumber.js":110,"./ansi.js":111,"./camel.js":112,"./escape.js":113,"./format.js":114,"./fuzzy.js":115,"./inspect.js":116,"./latinize.js":118,"./misc.js":119,"./naturalSort.js":120,"./polyfill.js":121,"./regexp.js":122,"./toTitleCase.js":124,"./unicode.js":125,"./wordwrap.js":126}],124:[function(t,e,r){"use strict";e.exports=function t(e,r){if(!e||typeof e!=="string"){return""}r=r||{};return e.replace(/[^\s_-]+/g,t=>{if(r.zealous){if(r.preserveAllCaps&&t===t.toUpperCase()){return t}return t[0].toUpperCase()+t.slice(1).toLowerCase()}return t[0].toUpperCase()+t.slice(1)})}},{}],125:[function(t,e,r){"use strict";const h={};e.exports=h;h.encode=t=>String.fromCodePoint(...t);h.decode=t=>{var e,r,i=0,n=[],s=t.length;while(i<s){e=t.charCodeAt(i++);if(e>=55296&&e<=56319&&i<s){r=t.charCodeAt(i++);if((r&64512)===56320){n.push(((e&1023)<<10)+(r&1023)+65536)}else{n.push(e);i--}}else{n.push(e)}}return n};h.firstCodePoint=t=>{var e,r=t.charCodeAt(0);if(r>=55296&&r<=56319&&t.length>=2){e=t.charCodeAt(1);if((e&64512)===56320){return((r&1023)<<10)+(e&1023)+65536}}return r};h.firstChar=t=>{var e,r=t.charCodeAt(0);if(r>=55296&&r<=56319&&t.length>=2){e=t.charCodeAt(1);if((e&64512)===56320){return t.slice(0,2)}}return t[0]};h.toArray=t=>{var e,r,i=0,n=[],s=t.length;while(i<s){e=t.charCodeAt(i++);if(e>=55296&&e<=56319&&i<s){r=t.charCodeAt(i++);if((r&64512)===56320){n.push(t.slice(i-2,i))}else{n.push(t[i-2]);i--}}else{n.push(t[i-1])}}return n};h.toCells=(t,e,r=4,i=0,...n)=>{var s,o,a=0,u=[],l,f=e.length;while(a<f){s=e.charCodeAt(a++);if(s===10){i=0}else if(s===9){l=r-i%r-1;u.push(new t("\t",...n));i+=1+l;while(l--){u.push(new t(null,...n))}}else if(s>=55296&&s<=56319&&a<f){o=e.charCodeAt(a++);if((o&64512)===56320){s=((s&1023)<<10)+(o&1023)+65536;u.push(new t(e.slice(a-2,a),...n));i++;if(h.codePointWidth(s)===2){i++;u.push(new t(null,...n))}}else{a--}}else{u.push(new t(e[a-1],...n));i++;if(h.codePointWidth(s)===2){u.push(new t(null,...n));i++}}}return u};h.fromCells=t=>{return t.map(t=>t.filler?"":t.char).join("")};h.length=t=>{var e,r,i=0,n=0,s=t.length;while(i<s){e=t.charCodeAt(i++);if(e>=55296&&e<=56319&&i<s){r=t.charCodeAt(i++);if((r&64512)!==56320){i--}}n++}return n};h.width=t=>{var e=0;h.decode(t).forEach(t=>e+=h.codePointWidth(t));return e};h.arrayWidth=(t,e)=>{var r,i=0;if(e===undefined){e=t.length}for(r=0;r<e;r++){i+=h.isFullWidth(t[r])?2:1}return i};var u=0;h.getLastTruncateWidth=()=>u;h.widthLimit=h.truncateWidth=(t,e)=>{var r,i,n,s=0,o=0,a=t.length;u=0;while(s<a){r=t.charCodeAt(s++);if(r>=55296&&r<=56319&&s<a){i=t.charCodeAt(s++);if((i&64512)===56320){r=((r&1023)<<10)+(i&1023)+65536}else{s--}}n=h.codePointWidth(r);if(u+n>e){return t.slice(0,o)}u+=n;o=s}return t};h.surrogatePair=t=>{var e=t.charCodeAt(0);if(e<55296||e>=57344){return 0}else if(e<56320){return 1}return-1};h.isFullWidth=t=>{if(t.length<=1){return h.isFullWidthCodePoint(t.codePointAt(0))}return h.isFullWidthCodePoint(h.firstCodePoint(t))};h.charWidth=t=>{if(t.length<=1){return h.codePointWidth(t.codePointAt(0))}return h.codePointWidth(h.firstCodePoint(t))};h.codePointWidth=t=>{if(t>=4352&&(t<=4447||9001===t||9002===t||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141)){return 2}return 1};h.isFullWidthCodePoint=t=>h.codePointWidth(t)===2;h.toFullWidth=t=>{return String.fromCodePoint(...h.decode(t).map(t=>t>=33&&t<=126?65280+t-32:t))}},{}],126:[function(t,e,r){"use strict";const w=t("./unicode.js");const _={"!":true,"?":true,":":true,";":true};e.exports=function t(e,r){var i=0,n,s,o,a,u,l,f,h,c,d,p=true,g=w.toArray(e),y=false,b,m=[];if(typeof r!=="object"){r={width:r}}if(!r.width||typeof r.width!=="number"||r.width<=0){r.width=80}o=r.offset?r.width-r.offset:r.width;if(typeof r.glue!=="string"){r.glue="\n"}if(r.regroupFn){g=r.regroupFn(g);d=r.charWidthFn||w.width}else{d=r.charWidthFn||w.charWidth}l=g.length;var v=()=>{if(!p||y){while(g[i]===" "){i++}if(y&&g[i]==="\n"){p=true;i++}}if(i>=l){return null}p=false;y=false;c=false;n=f=i;u=h=0;for(;;){if(n>=l){return g.slice(i,n).join("")}if(g[n]==="\n"){p=true;a=g.slice(i,n++).join("");if(r.fill){a+=" ".repeat(o-u)}return a}if(r.skipFn){s=r.skipFn(g,n);if(s!==n){n=s;continue}}if(g[n]===" "&&!c&&!_[g[n+1]]){f=n;h=u}else{c=false}u+=d(g[n]);if(u>o){y=true;if(f!==i){n=f}else if(o<r.width){n=i;return""}a=g.slice(i,n).join("");if(r.fill){a+=" ".repeat(o-h)}return a}n++}};while(i<l&&(b=v())!==null){m.push(b);i=n;o=r.width}if(p){m.push("")}if(!r.noTrim&&!r.fill){m=m.map((t,e)=>e===m.length-1?t:t.trimRight())}if(!r.noJoin){m=m.join(r.glue)}if(r.updateOffset){r.offset=u}return m}},{"./unicode.js":125}],127:[function(t,e,r){"use strict";function c(t,e){var r=Object.getPrototypeOf(t);if(c.opaque.has(r)){return c.opaque.get(r)(t)}var i,n,s,o,a,u,l=[{source:t,target:Array.isArray(t)?[]:Object.create(r)}],f=l[0].target,h=new Map;h.set(t,f);while(o=l.shift()){s=Object.getOwnPropertyNames(o.source);for(i=0;i<s.length;i++){n=Object.getOwnPropertyDescriptor(o.source,s[i]);if(!n.value||typeof n.value!=="object"){Object.defineProperty(o.target,s[i],n);continue}a=n.value;if(e){if(h.has(a)){n.value=h.get(a);Object.defineProperty(o.target,s[i],n);continue}}u=Object.getPrototypeOf(n.value);if(c.opaque.has(u)){n.value=c.opaque.get(u)(n.value);Object.defineProperty(o.target,s[i],n);continue}n.value=Array.isArray(a)?[]:Object.create(u);if(e){h.set(a,n.value)}Object.defineProperty(o.target,s[i],n);l.push({source:a,target:n.value})}}return f}e.exports=c;c.opaque=new Map;c.opaque.set(Date.prototype,t=>new Date(t))},{}],128:[function(t,e,r){"use strict";function p(t,e,r){var i,n,s,o,a,u,l,f,h,c,d;u=typeof t;l=typeof e;if(!t||u!=="object"&&u!=="function"||!e||l!=="object"&&l!=="function"){throw new Error("[tree] diff() needs objects as argument #0 and #1")}if(!r||typeof r!=="object"){r={}}f=r.depth||0;if(!f){r.diffObject={};if(!r.path){r.path=""}if(!r.pathSeparator){r.pathSeparator="."}}h=r.diffObject;if(Array.isArray(t)){d=true;c=t.length}else{d=false;o=Object.keys(t);c=o.length}for(i=0;i<c;i++){n=d?i:o[i];s=r.path+r.pathSeparator+n;if(!Object.prototype.hasOwnProperty.call(e,n)){h[s]={path:s,message:"does not exist in right-hand side"};continue}u=typeof t[n];l=typeof e[n];if(u!==l){h[s]={path:s,message:"different typeof: "+u+" - "+l};continue}if(u==="object"||u==="function"){if(!t[n]){if(e[n]){h[s]={path:s,message:"different type: null - Object"}}continue}if(!e[n]){h[s]={path:s,message:"different type: Object - null"};continue}if(Array.isArray(t[n])&&!Array.isArray(e[n])){h[s]={path:s,message:"different type: Array - Object"};continue}if(!Array.isArray(t[n])&&Array.isArray(e[n])){h[s]={path:s,message:"different type: Object - Array"};continue}p(t[n],e[n],{path:s,pathSeparator:r.pathSeparator,depth:f+1,diffObject:h});continue}if(t[n]!==e[n]){h[s]={path:s,message:"different value: "+t[n]+" - "+e[n]};continue}}if(Array.isArray(e)){d=true;c=e.length}else{d=false;a=Object.keys(e);c=a.length}for(i=0;i<c;i++){n=d?i:a[i];s=r.path+r.pathSeparator+n;if(!Object.prototype.hasOwnProperty.call(t,n)){h[s]={path:s,message:"does not exist in left-hand side"};continue}}return Object.keys(h).length?h:null}r.diff=p},{}],129:[function(t,e,r){"use strict";const i={};e.exports=i;const n=[];const a="This would cause prototype pollution";function o(t){if(Array.isArray(t)){return t}if(!t){return n}if(typeof t==="string"){return t[t.length-1]==="."?t.slice(0,-1).split("."):t.split(".")}throw new TypeError("[tree.dotPath]: the path argument should be a string or an array")}function s(t,e,r=0){var i,n,s,o=t;for(i=0,n=e.length+r;i<n;i++){s=e[i];if(typeof s==="object"||s==="__proto__"||typeof o==="function"){throw new Error(a)}if(!o||typeof o!=="object"){return undefined}o=o[s]}return o}function u(t,e){var r,i,n,s=t;for(r=0,i=e.length-1;r<i;r++){n=e[r];if(typeof n==="object"||n==="__proto__"||typeof s[n]==="function"){throw new Error(a)}if(!s[n]||typeof s[n]!=="object"){s[n]={}}s=s[n]}return s}i.get=(t,e)=>s(t,o(e));i.set=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);s[n]=r;return r};i.define=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!(n in s)){s[n]=r}return r};i.inc=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(typeof s[n]==="number"){s[n]++}else if(!s[n]||typeof s[n]!=="object"){s[n]=1}return r};i.dec=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(typeof s[n]==="number"){s[n]--}else if(!s[n]||typeof s[n]!=="object"){s[n]=-1}return r};i.concat=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=r}else if(Array.isArray(s[n])&&Array.isArray(r)){s[n]=s[n].concat(r)}return r};i.insert=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=r}else if(Array.isArray(s[n])&&Array.isArray(r)){s[n]=r.concat(s[n])}return r};i.delete=(t,e)=>{var r=o(e),i=r[r.length-1];if(typeof i==="object"||i==="__proto__"){throw new Error(a)}var n=s(t,r,-1);if(!n||typeof n!=="object"){return false}return delete n[i]};i.autoPush=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(s[n]===undefined){s[n]=r}else if(Array.isArray(s[n])){s[n].push(r)}else{s[n]=[s[n],r]}return s[n]};i.append=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=[r]}else if(Array.isArray(s[n])){s[n].push(r)}return s[n]};i.prepend=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=[r]}else if(Array.isArray(s[n])){s[n].unshift(r)}return s[n]}},{}],130:[function(t,e,r){"use strict";function i(t,e,...r){var i,n,s=false,o=r.length;if(!o){return e}if(!t||typeof t!=="object"){t={}}var a={depth:0,prefix:""};if(t.deep){if(Array.isArray(t.deep)){t.deep=new Set(t.deep)}else if(!(t.deep instanceof Set)){t.deep=true}}if(t.immutables){if(Array.isArray(t.immutables)){t.immutables=new Set(t.immutables)}else if(!(t.immutables instanceof Set)){delete t.immutables}}if(!t.maxDepth&&t.deep&&!t.circular){t.maxDepth=100}if(t.deepFunc){t.deep=true}if(t.flat){t.deep=true;t.proto=false;t.inherit=false;t.unflat=false;if(typeof t.flat!=="string"){t.flat="."}}if(t.unflat){t.deep=false;t.proto=false;t.inherit=false;t.flat=false;if(typeof t.unflat!=="string"){t.unflat="."}}if(t.inherit){t.own=true;t.proto=false}else if(t.proto){t.own=true}if(!e||typeof e!=="object"&&typeof e!=="function"){s=true}if(!t.skipRoot&&(t.inherit||t.proto)){for(i=o-1;i>=0;i--){n=r[i];if(n&&(typeof n==="object"||typeof n==="function")){if(t.inherit){if(s){e=Object.create(n)}else{Object.setPrototypeOf(e,n)}}else if(t.proto){if(s){e=Object.create(Object.getPrototypeOf(n))}else{Object.setPrototypeOf(e,Object.getPrototypeOf(n))}}break}}}else if(s){e={}}a.references={sources:[],targets:[]};for(i=0;i<o;i++){n=r[i];if(!n||typeof n!=="object"&&typeof n!=="function"){continue}v(a,t,e,n,t.mask<=i+1)}return e}e.exports=i;function v(t,e,r,i,n){var s,o,a,u,l,f,h,c,d,p,g,y,b,m=-1;if(e.maxDepth&&t.depth>e.maxDepth){throw new Error("[tree] extend(): max depth reached("+e.maxDepth+")")}if(e.circular){t.references.sources.push(i);t.references.targets.push(r)}if(e.own){if(e.nonEnum){u=Object.getOwnPropertyNames(i)}else{u=Object.keys(i)}}else{u=i}for(l in u){if(e.own){l=u[l]}if(l==="__proto__"){continue}if(e.descriptor){d=Object.getOwnPropertyDescriptor(i,l);f=d.value}else{f=i[l]}g=r;p=t.prefix+l;if(e.nofunc&&typeof f==="function"){continue}if(e.unflat&&t.depth===0){a=l.split(e.unflat);o=a.length-1;if(o){for(s=0;s<o;s++){if(!g[a[s]]||typeof g[a[s]]!=="object"&&typeof g[a[s]]!=="function"){g[a[s]]={}}g=g[a[s]]}p=t.prefix+a[o]}}y=g[p];b=y&&(typeof y==="object"||typeof y==="function");h=f&&(typeof f==="object"||typeof f==="function");if(e.deep&&f&&(typeof f==="object"||e.deepFunc&&typeof f==="function")&&(!e.descriptor||!d.get)&&((c=Object.getPrototypeOf(f))||true)&&(!(e.deep instanceof Set)||e.deep.has(c))&&(!e.immutables||!e.immutables.has(c))&&(!e.preserve||b)&&(!n||b)){if(e.circular){m=t.references.sources.indexOf(f)}if(e.flat){if(m>=0){continue}v({depth:t.depth+1,prefix:t.prefix+l+e.flat,references:t.references},e,g,f,n)}else{if(m>=0){y=t.references.targets[m];if(e.descriptor){Object.defineProperty(g,p,{value:y,enumerable:d.enumerable,writable:d.writable,configurable:d.configurable})}else{g[p]=y}continue}if(!b||!Object.prototype.hasOwnProperty.call(g,p)){if(Array.isArray(f)){y=[]}else if(e.proto){y=Object.create(c)}else if(e.inherit){y=Object.create(f)}else{y={}}if(e.descriptor){Object.defineProperty(g,p,{value:y,enumerable:d.enumerable,writable:d.writable,configurable:d.configurable})}else{g[p]=y}}else if(e.proto&&Object.getPrototypeOf(y)!==c){Object.setPrototypeOf(y,c)}else if(e.inherit&&Object.getPrototypeOf(y)!==f){Object.setPrototypeOf(y,f)}if(e.circular){t.references.sources.push(f);t.references.targets.push(y)}v({depth:t.depth+1,prefix:"",references:t.references},e,y,f,n)}}else if(n&&(y===undefined||b||h)){continue}else if(e.preserve&&y!==undefined){continue}else if(!e.inherit){if(e.descriptor){Object.defineProperty(g,p,d)}else{g[p]=y=f}}if(e.move){delete i[l]}}}},{}],131:[function(t,e,r){"use strict";r.defineLazyProperty=function t(e,r,i){Object.defineProperty(e,r,{configurable:true,enumerable:true,get:function(){var t=i();Object.defineProperty(e,r,{configurable:true,enumerable:true,writable:false,value:t});return t}})}},{}],132:[function(t,e,r){"use strict";const g=t("./tree.js");const i=t("util");const y={};e.exports=y;y.Mask=function t(){throw new Error("Cannot create a tree.Mask() directly")};const n={clone:false,path:"<object>",pathSeparator:"."};y.createMask=function t(e,r){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .createMask() : Argument #1 should be an object")}if(r!==null&&typeof r==="object"){r=g.extend(null,{},n,r)}else{r=n}var i=Object.create(y.Mask.prototype,{__options__:{value:r,writable:true}});g.extend(null,i,e);return i};y.Mask.prototype.applyTo=function t(e,r,i){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .applyTo() : Argument #1 should be an object")}if(i){r=g.extend(null,{mask:this,options:this.__options__,path:this.__options__.path},r)}else if(r===undefined){r={mask:this,options:this.__options__,path:this.__options__.path}}var n,s,o,a,u,l,f=Object.keys(r.mask),h,c,d,p;if(Array.isArray(e)){o=[]}else{o={}}for(a=0;a<f.length;a++){u=f[a];l=r.mask[u];if(u==="*"){p=Object.keys(e);for(h=0;h<p.length;h++){c=p[h];d=e[c];s=r.path+r.options.pathSeparator+c;if(l!==null&&typeof l==="object"){if(d!==null&&typeof d==="object"){if(d instanceof y.Mask){o[c]=d.applyTo(d,{path:s},true)}else{o[c]=this.applyTo(d,g.extend(null,{},r,{mask:l,path:s}))}}else if(typeof r.options.leaf==="function"){o[c]=this.applyTo({},g.extend(null,{},r,{mask:l,path:s}))}}else if(l!==null&&typeof r.options.leaf==="function"){n=r.options.leaf(e,c,l,s);if(!(n instanceof Error)){o[c]=n}}else if(r.options.clone&&(d!==null&&typeof d==="object")){o[c]=g.extend({deep:true},{},d)}else{o[c]=d}}continue}s=r.path+r.options.pathSeparator+u;if(l!==null&&typeof l==="object"){if(Object.prototype.hasOwnProperty.call(e,u)&&e[u]!==null&&typeof e[u]==="object"){if(e.key instanceof y.Mask){o[u]=e.key.applyTo(e[u],{path:s},true)}else{o[u]=this.applyTo(e[u],g.extend(null,{},r,{mask:l,path:s}))}}else if(r.options.leaf){o[u]=this.applyTo({},g.extend(null,{},r,{mask:l,path:s}))}}else if(Object.prototype.hasOwnProperty.call(e,u)){if(l!==undefined&&typeof r.options.leaf==="function"){n=r.options.leaf(e,u,l,s);if(!(n instanceof Error)){o[u]=n}}else if(r.options.clone&&(e[u]!==null&&typeof e[u]==="object")){o[u]=g.extend({deep:true},{},e[u])}else{o[u]=e[u]}}else if(l!==undefined&&typeof r.options.leaf==="function"){n=r.options.leaf(e,u,l,s);if(!(n instanceof Error)){o[u]=n}}}return o};y.InverseMask=function t(){throw new Error("Cannot create a tree.InverseMask() directly")};i.inherits(y.InverseMask,y.Mask);y.createInverseMask=function t(e,r){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .createInverseMask() : Argument #1 should be an object")}if(r!==null&&typeof r==="object"){r=g.extend(null,{},n,r)}else{r=n}var i=Object.create(y.InverseMask.prototype,{__options__:{value:r,writable:true}});g.extend(null,i,e);return i};y.InverseMask.prototype.applyTo=function t(e,r,i){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .applyTo() : Argument #1 should be an object")}if(i){r=g.extend(null,{mask:this,options:this.__options__,path:this.__options__.path},r)}else if(r===undefined){r={mask:this,options:this.__options__,path:this.__options__.path}}var n,s,o,a,u,l=Object.keys(r.mask),f,h,c,d;if(Array.isArray(e)){s=g.extend({deep:true},[],e)}else{s=g.extend({deep:true},{},e)}for(o=0;o<l.length;o++){a=l[o];u=r.mask[a];if(a==="*"){d=Object.keys(e);for(f=0;f<d.length;f++){h=d[f];c=e[h];n=r.path+r.options.pathSeparator+h;if(u!==null&&typeof u==="object"){if(c!==null&&typeof c==="object"){if(c instanceof y.Mask){s[h]=c.applyTo(c,{path:n},true)}else{s[h]=this.applyTo(c,g.extend(null,{},r,{mask:u,path:n}))}}}else{delete s[h]}}continue}n=r.path+r.options.pathSeparator+a;if(u!==null&&typeof u==="object"){if(Object.prototype.hasOwnProperty.call(e,a)&&e[a]!==null&&typeof e[a]==="object"){if(e.key instanceof y.Mask){s[a]=e.key.applyTo(e[a],{path:n},true)}else{s[a]=this.applyTo(e[a],g.extend(null,{},r,{mask:u,path:n}))}}}else if(Object.prototype.hasOwnProperty.call(e,a)){delete s[a]}}return s}},{"./tree.js":134,util:202}],133:[function(t,e,r){"use strict";const i={};e.exports=i;const d="This would cause prototype pollution";i.op=function(t,e,r,i){var n,s,o,a,u,l=false,f=false,h,c=true;if(!e||typeof e!=="object"){return}if(typeof r==="string"){if(r){s=r.match(/([.#[\]]|[^.#[\]]+)/g)}else{s=[""]}if(s[0]==="."){s.unshift("")}if(s[s.length-1]==="."){s.push("")}}else if(Array.isArray(r)){s=r;f=true}else{throw new TypeError("[tree.path] ."+t+"(): the path argument should be a string or an array")}switch(t){case"get":case"delete":h=false;break;case"set":case"define":case"inc":case"dec":case"append":case"prepend":case"concat":case"insert":case"autoPush":h=true;break;default:throw new TypeError("[tree.path] .op(): wrong type of operation '"+t+"'")}a=e;o=s.length-1;for(n=0;n<=o;n++){if(f){if(u===undefined){u=s[n];if(typeof u==="object"||u==="__proto__"){throw new Error(d)}continue}if(typeof a[u]==="function"){throw new Error(d)}if(!a[u]||typeof a[u]!=="object"){if(!h){return undefined}a[u]={}}a=a[u];u=s[n];if(typeof u==="object"||u==="__proto__"){throw new Error(d)}continue}else if(s[n]==="."){l=false;if(u===undefined){if(!c){c=true;continue}u=""}if(typeof a[u]==="function"){throw new Error(d)}if(!a[u]||typeof a[u]!=="object"){if(!h){return undefined}a[u]={}}a=a[u];c=true;continue}else if(s[n]==="#"||s[n]==="["){l=true;c=false;if(u===undefined){if(!Array.isArray(a)){return undefined}continue}if(typeof a[u]==="function"){throw new Error(d)}if(!a[u]||!Array.isArray(a[u])){if(!h){return undefined}a[u]=[]}a=a[u];continue}else if(s[n]==="]"){c=false;continue}c=false;if(!l){u=s[n];if(typeof u==="object"||u==="__proto__"){throw new Error(d)}continue}switch(s[n]){case"length":u="length";break;case"first":u=0;break;case"last":u=a.length-1;if(u<0){u=0}break;case"next":if(!h){return undefined}u=a.length;break;case"insert":if(!h){return undefined}a.unshift(undefined);u=0;break;default:u=parseInt(s[n],10)}}switch(t){case"get":return a[u];case"delete":if(l&&typeof u==="number"){a.splice(u,1)}else{delete a[u]}return;case"set":a[u]=i;return a[u];case"define":if(!(u in a)){a[u]=i}return a[u];case"inc":if(typeof a[u]==="number"){a[u]++}else if(!a[u]||typeof a[u]!=="object"){a[u]=1}return a[u];case"dec":if(typeof a[u]==="number"){a[u]--}else if(!a[u]||typeof a[u]!=="object"){a[u]=-1}return a[u];case"append":if(!a[u]){a[u]=[i]}else if(Array.isArray(a[u])){a[u].push(i)}return a[u];case"prepend":if(!a[u]){a[u]=[i]}else if(Array.isArray(a[u])){a[u].unshift(i)}return a[u];case"concat":if(!a[u]){a[u]=i}else if(Array.isArray(a[u])&&Array.isArray(i)){a[u]=a[u].concat(i)}return a[u];case"insert":if(!a[u]){a[u]=i}else if(Array.isArray(a[u])&&Array.isArray(i)){a[u]=i.concat(a[u])}return a[u];case"autoPush":if(a[u]===undefined){a[u]=i}else if(Array.isArray(a[u])){a[u].push(i)}else{a[u]=[a[u],i]}return a[u]}};i.get=i.op.bind(undefined,"get");i.delete=i.op.bind(undefined,"delete");i.set=i.op.bind(undefined,"set");i.define=i.op.bind(undefined,"define");i.inc=i.op.bind(undefined,"inc");i.dec=i.op.bind(undefined,"dec");i.append=i.op.bind(undefined,"append");i.prepend=i.op.bind(undefined,"prepend");i.concat=i.op.bind(undefined,"concat");i.insert=i.op.bind(undefined,"insert");i.autoPush=i.op.bind(undefined,"autoPush");i.prototype={get:function(t){return i.get(this,t)},delete:function(t){return i.delete(this,t)},set:function(t,e){return i.set(this,t,e)},define:function(t,e){return i.define(this,t,e)},inc:function(t,e){return i.inc(this,t,e)},dec:function(t,e){return i.dec(this,t,e)},append:function(t,e){return i.append(this,t,e)},prepend:function(t,e){return i.prepend(this,t,e)},concat:function(t,e){return i.concat(this,t,e)},insert:function(t,e){return i.insert(this,t,e)},autoPush:function(t,e){return i.autoPush(this,t,e)}};i.upgrade=function(t){Object.defineProperties(t,{get:{value:i.op.bind(undefined,"get",t)},delete:{value:i.op.bind(undefined,"delete",t)},set:{value:i.op.bind(undefined,"set",t)},define:{value:i.op.bind(undefined,"define",t)},inc:{value:i.op.bind(undefined,"inc",t)},dec:{value:i.op.bind(undefined,"dec",t)},append:{value:i.op.bind(undefined,"append",t)},prepend:{value:i.op.bind(undefined,"prepend",t)},concat:{value:i.op.bind(undefined,"concat",t)},insert:{value:i.op.bind(undefined,"insert",t)},autoPush:{value:i.op.bind(undefined,"autoPush",t)}})}},{}],134:[function(t,e,r){"use strict";const i={};e.exports=i;Object.assign(i,{extend:t("./extend.js"),clone:t("./clone.js"),path:t("./path.js"),dotPath:t("./dotPath.js")},t("./lazy.js"),t("./diff.js"),t("./mask.js"))},{"./clone.js":127,"./diff.js":128,"./dotPath.js":129,"./extend.js":130,"./lazy.js":131,"./mask.js":132,"./path.js":133}],135:[function(t,e,r){"use strict";function i(t,e){var r=1,i=t.length,n=t[0],s=t[0];for(var o=1;o<i;++o){s=n;n=t[o];if(e(n,s)){if(o===r){r++;continue}t[r++]=n}}t.length=r;return t}function n(t){var e=1,r=t.length,i=t[0],n=t[0];for(var s=1;s<r;++s,n=i){n=i;i=t[s];if(i!==n){if(s===e){e++;continue}t[e++]=i}}t.length=e;return t}function s(t,e,r){if(t.length===0){return t}if(e){if(!r){t.sort(e)}return i(t,e)}if(!r){t.sort()}return n(t)}e.exports=s},{}],136:[function(t,e,r){},{}],137:[function(t,e,r){e.exports=function(t,e,r){if(t.filter)return t.filter(e,r);if(void 0===t||null===t)throw new TypeError;if("function"!=typeof e)throw new TypeError;var i=[];for(var n=0;n<t.length;n++){if(!o.call(t,n))continue;var s=t[n];if(e.call(r,s,n,t))i.push(s)}return i};var o=Object.prototype.hasOwnProperty},{}],138:[function(E,A,t){(function(S){(function(){"use strict";var t=E("object-assign");function s(t,e){if(t===e){return 0}var r=t.length;var i=e.length;for(var n=0,s=Math.min(r,i);n<s;++n){if(t[n]!==e[n]){r=t[n];i=e[n];break}}if(r<i){return-1}if(i<r){return 1}return 0}function o(t){if(S.Buffer&&typeof S.Buffer.isBuffer==="function"){return S.Buffer.isBuffer(t)}return!!(t!=null&&t._isBuffer)}var f=E("util/");var i=Object.prototype.hasOwnProperty;var h=Array.prototype.slice;var n=function(){return function t(){}.name==="foo"}();function a(t){return Object.prototype.toString.call(t)}function u(t){if(o(t)){return false}if(typeof S.ArrayBuffer!=="function"){return false}if(typeof ArrayBuffer.isView==="function"){return ArrayBuffer.isView(t)}if(!t){return false}if(t instanceof DataView){return true}if(t.buffer&&t.buffer instanceof ArrayBuffer){return true}return false}var l=A.exports=y;var c=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(!f.isFunction(t)){return}if(n){return t.name}var e=t.toString();var r=e.match(c);return r&&r[1]}l.AssertionError=function t(e){this.name="AssertionError";this.actual=e.actual;this.expected=e.expected;this.operator=e.operator;if(e.message){this.message=e.message;this.generatedMessage=false}else{this.message=p(this);this.generatedMessage=true}var r=e.stackStartFunction||g;if(Error.captureStackTrace){Error.captureStackTrace(this,r)}else{var i=new Error;if(i.stack){var n=i.stack;var s=d(r);var o=n.indexOf("\n"+s);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}};f.inherits(l.AssertionError,Error);function e(t,e){if(typeof t==="string"){return t.length<e?t:t.slice(0,e)}else{return t}}function r(t){if(n||!f.isFunction(t)){return f.inspect(t)}var e=d(t);var r=e?": "+e:"";return"[Function"+r+"]"}function p(t){return e(r(t.actual),128)+" "+t.operator+" "+e(r(t.expected),128)}function g(t,e,r,i,n){throw new l.AssertionError({message:r,actual:t,expected:e,operator:i,stackStartFunction:n})}l.fail=g;function y(t,e){if(!t)g(t,true,e,"==",l.ok)}l.ok=y;l.equal=function t(e,r,i){if(e!=r)g(e,r,i,"==",l.equal)};l.notEqual=function t(e,r,i){if(e==r){g(e,r,i,"!=",l.notEqual)}};l.deepEqual=function t(e,r,i){if(!b(e,r,false)){g(e,r,i,"deepEqual",l.deepEqual)}};l.deepStrictEqual=function t(e,r,i){if(!b(e,r,true)){g(e,r,i,"deepStrictEqual",l.deepStrictEqual)}};function b(t,e,r,i){if(t===e){return true}else if(o(t)&&o(e)){return s(t,e)===0}else if(f.isDate(t)&&f.isDate(e)){return t.getTime()===e.getTime()}else if(f.isRegExp(t)&&f.isRegExp(e)){return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase}else if((t===null||typeof t!=="object")&&(e===null||typeof e!=="object")){return r?t===e:t==e}else if(u(t)&&u(e)&&a(t)===a(e)&&!(t instanceof Float32Array||t instanceof Float64Array)){return s(new Uint8Array(t.buffer),new Uint8Array(e.buffer))===0}else if(o(t)!==o(e)){return false}else{i=i||{actual:[],expected:[]};var n=i.actual.indexOf(t);if(n!==-1){if(n===i.expected.indexOf(e)){return true}}i.actual.push(t);i.expected.push(e);return v(t,e,r,i)}}function m(t){return Object.prototype.toString.call(t)=="[object Arguments]"}function v(t,e,r,i){if(t===null||t===undefined||e===null||e===undefined)return false;if(f.isPrimitive(t)||f.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return false;var n=m(t);var s=m(e);if(n&&!s||!n&&s)return false;if(n){t=h.call(t);e=h.call(e);return b(t,e,r)}var o=T(t);var a=T(e);var u,l;if(o.length!==a.length)return false;o.sort();a.sort();for(l=o.length-1;l>=0;l--){if(o[l]!==a[l])return false}for(l=o.length-1;l>=0;l--){u=o[l];if(!b(t[u],e[u],r,i))return false}return true}l.notDeepEqual=function t(e,r,i){if(b(e,r,false)){g(e,r,i,"notDeepEqual",l.notDeepEqual)}};l.notDeepStrictEqual=w;function w(t,e,r){if(b(t,e,true)){g(t,e,r,"notDeepStrictEqual",w)}}l.strictEqual=function t(e,r,i){if(e!==r){g(e,r,i,"===",l.strictEqual)}};l.notStrictEqual=function t(e,r,i){if(e===r){g(e,r,i,"!==",l.notStrictEqual)}};function _(t,e){if(!t||!e){return false}if(Object.prototype.toString.call(e)=="[object RegExp]"){return e.test(t)}try{if(t instanceof e){return true}}catch(t){}if(Error.isPrototypeOf(e)){return false}return e.call({},t)===true}function x(t){var e;try{t()}catch(t){e=t}return e}function C(t,e,r,i){var n;if(typeof e!=="function"){throw new TypeError('"block" argument must be a function')}if(typeof r==="string"){i=r;r=null}n=x(e);i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:".");if(t&&!n){g(n,r,"Missing expected exception"+i)}var s=typeof i==="string";var o=!t&&f.isError(n);var a=!t&&n&&!r;if(o&&s&&_(n,r)||a){g(n,r,"Got unwanted exception"+i)}if(t&&n&&r&&!_(n,r)||!t&&n){throw n}}l.throws=function(t,e,r){C(true,t,e,r)};l.doesNotThrow=function(t,e,r){C(false,t,e,r)};l.ifError=function(t){if(t)throw t};function k(t,e){if(!t)g(t,true,e,"==",k)}l.strict=t(k,l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual});l.strict.strict=l.strict;var T=Object.keys||function(t){var e=[];for(var r in t){if(i.call(t,r))e.push(r)}return e}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"object-assign":165,"util/":141}],139:[function(t,e,r){if(typeof Object.create==="function"){e.exports=function t(e,r){e.super_=r;e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{e.exports=function t(e,r){e.super_=r;var i=function(){};i.prototype=r.prototype;e.prototype=new i;e.prototype.constructor=e}}},{}],140:[function(t,e,r){e.exports=function t(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],141:[function(M,t,j){(function(P,I){(function(){var a=/%[sdj%]/g;j.format=function(t){if(!_(t)){var e=[];for(var r=0;r<arguments.length;r++){e.push(u(arguments[r]))}return e.join(" ")}var r=1;var i=arguments;var n=i.length;var s=String(t).replace(a,function(t){if(t==="%%")return"%";if(r>=n)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}});for(var o=i[r];r<n;o=i[++r]){if(l(o)||!c(o)){s+=" "+o}else{s+=" "+u(o)}}return s};j.deprecate=function(t,e){if(h(I.process)){return function(){return j.deprecate(t,e).apply(this,arguments)}}if(P.noDeprecation===true){return t}var r=false;function i(){if(!r){if(P.throwDeprecation){throw new Error(e)}else if(P.traceDeprecation){console.trace(e)}else{console.error(e)}r=true}return t.apply(this,arguments)}return i};var t={};var i;j.debuglog=function(e){if(h(i))i=P.env.NODE_DEBUG||"";e=e.toUpperCase();if(!t[e]){if(new RegExp("\\b"+e+"\\b","i").test(i)){var r=P.pid;t[e]=function(){var t=j.format.apply(j,arguments);console.error("%s %d: %s",e,r,t)}}else{t[e]=function(){}}}return t[e]};function u(t,e){var r={seen:[],stylize:s};if(arguments.length>=3)r.depth=arguments[2];if(arguments.length>=4)r.colors=arguments[3];if(o(e)){r.showHidden=e}else if(e){j._extend(r,e)}if(h(r.showHidden))r.showHidden=false;if(h(r.depth))r.depth=2;if(h(r.colors))r.colors=false;if(h(r.customInspect))r.customInspect=true;if(r.colors)r.stylize=n;return p(r,t,r.depth)}j.inspect=u;u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(t,e){var r=u.styles[e];if(r){return"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m"}else{return t}}function s(t,e){return t}function d(t){var r={};t.forEach(function(t,e){r[t]=true});return r}function p(e,r,i){if(e.customInspect&&r&&T(r.inspect)&&r.inspect!==j.inspect&&!(r.constructor&&r.constructor.prototype===r)){var t=r.inspect(i,e);if(!_(t)){t=p(e,t,i)}return t}var n=g(e,r);if(n){return n}var s=Object.keys(r);var o=d(s);if(e.showHidden){s=Object.getOwnPropertyNames(r)}if(k(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return y(r)}if(s.length===0){if(T(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(x(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}if(C(r)){return e.stylize(Date.prototype.toString.call(r),"date")}if(k(r)){return y(r)}}var u="",l=false,f=["{","}"];if(w(r)){l=true;f=["[","]"]}if(T(r)){var h=r.name?": "+r.name:"";u=" [Function"+h+"]"}if(x(r)){u=" "+RegExp.prototype.toString.call(r)}if(C(r)){u=" "+Date.prototype.toUTCString.call(r)}if(k(r)){u=" "+y(r)}if(s.length===0&&(!l||r.length==0)){return f[0]+u+f[1]}if(i<0){if(x(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(r);var c;if(l){c=b(e,r,i,o,s)}else{c=s.map(function(t){return m(e,r,i,o,t,l)})}e.seen.pop();return v(c,u,f)}function g(t,e){if(h(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(f(e))return t.stylize(""+e,"number");if(o(e))return t.stylize(""+e,"boolean");if(l(e))return t.stylize("null","null")}function y(t){return"["+Error.prototype.toString.call(t)+"]"}function b(e,r,i,n,t){var s=[];for(var o=0,a=r.length;o<a;++o){if(O(r,String(o))){s.push(m(e,r,i,n,String(o),true))}else{s.push("")}}t.forEach(function(t){if(!t.match(/^\d+$/)){s.push(m(e,r,i,n,t,true))}});return s}function m(t,e,r,i,n,s){var o,a,u;u=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]};if(u.get){if(u.set){a=t.stylize("[Getter/Setter]","special")}else{a=t.stylize("[Getter]","special")}}else{if(u.set){a=t.stylize("[Setter]","special")}}if(!O(i,n)){o="["+n+"]"}if(!a){if(t.seen.indexOf(u.value)<0){if(l(r)){a=p(t,u.value,null)}else{a=p(t,u.value,r-1)}if(a.indexOf("\n")>-1){if(s){a=a.split("\n").map(function(t){return"  "+t}).join("\n").substr(2)}else{a="\n"+a.split("\n").map(function(t){return"   "+t}).join("\n")}}}else{a=t.stylize("[Circular]","special")}}if(h(o)){if(s&&n.match(/^\d+$/)){return a}o=JSON.stringify(""+n);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=t.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=t.stylize(o,"string")}}return o+": "+a}function v(t,e,r){var i=0;var n=t.reduce(function(t,e){i++;if(e.indexOf("\n")>=0)i++;return t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60){return r[0]+(e===""?"":e+"\n ")+" "+t.join(",\n  ")+" "+r[1]}return r[0]+e+" "+t.join(", ")+" "+r[1]}function w(t){return Array.isArray(t)}j.isArray=w;function o(t){return typeof t==="boolean"}j.isBoolean=o;function l(t){return t===null}j.isNull=l;function e(t){return t==null}j.isNullOrUndefined=e;function f(t){return typeof t==="number"}j.isNumber=f;function _(t){return typeof t==="string"}j.isString=_;function r(t){return typeof t==="symbol"}j.isSymbol=r;function h(t){return t===void 0}j.isUndefined=h;function x(t){return c(t)&&E(t)==="[object RegExp]"}j.isRegExp=x;function c(t){return typeof t==="object"&&t!==null}j.isObject=c;function C(t){return c(t)&&E(t)==="[object Date]"}j.isDate=C;function k(t){return c(t)&&(E(t)==="[object Error]"||t instanceof Error)}j.isError=k;function T(t){return typeof t==="function"}j.isFunction=T;function S(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}j.isPrimitive=S;j.isBuffer=M("./support/isBuffer");function E(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(){var t=new Date;var e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),R[t.getMonth()],e].join(" ")}j.log=function(){console.log("%s - %s",B(),j.format.apply(j,arguments))};j.inherits=M("inherits");j._extend=function(t,e){if(!e||!c(e))return t;var r=Object.keys(e);var i=r.length;while(i--){t[r[i]]=e[r[i]]}return t};function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}).call(this)}).call(this,M("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":140,_process:179,inherits:139}],142:[function(t,i,e){(function(r){(function(){"use strict";var e=t("array-filter");i.exports=function t(){return e(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],function(t){return typeof r[t]==="function"})}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"array-filter":137}],143:[function(t,e,r){"use strict";r.byteLength=o;r.toByteArray=a;r.fromByteArray=g;var u=[];var l=[];var f=typeof Uint8Array!=="undefined"?Uint8Array:Array;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var n=0,s=i.length;n<s;++n){u[n]=i[n];l[i.charCodeAt(n)]=n}l["-".charCodeAt(0)]=62;l["_".charCodeAt(0)]=63;function h(t){var e=t.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var r=t.indexOf("=");if(r===-1)r=e;var i=r===e?0:4-r%4;return[r,i]}function o(t){var e=h(t);var r=e[0];var i=e[1];return(r+i)*3/4-i}function c(t,e,r){return(e+r)*3/4-r}function a(t){var e;var r=h(t);var i=r[0];var n=r[1];var s=new f(c(t,i,n));var o=0;var a=n>0?i-4:i;var u;for(u=0;u<a;u+=4){e=l[t.charCodeAt(u)]<<18|l[t.charCodeAt(u+1)]<<12|l[t.charCodeAt(u+2)]<<6|l[t.charCodeAt(u+3)];s[o++]=e>>16&255;s[o++]=e>>8&255;s[o++]=e&255}if(n===2){e=l[t.charCodeAt(u)]<<2|l[t.charCodeAt(u+1)]>>4;s[o++]=e&255}if(n===1){e=l[t.charCodeAt(u)]<<10|l[t.charCodeAt(u+1)]<<4|l[t.charCodeAt(u+2)]>>2;s[o++]=e>>8&255;s[o++]=e&255}return s}function d(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[t&63]}function p(t,e,r){var i;var n=[];for(var s=e;s<r;s+=3){i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255);n.push(d(i))}return n.join("")}function g(t){var e;var r=t.length;var i=r%3;var n=[];var s=16383;for(var o=0,a=r-i;o<a;o+=s){n.push(p(t,o,o+s>a?a:o+s))}if(i===1){e=t[r-1];n.push(u[e>>2]+u[e<<4&63]+"==")}else if(i===2){e=(t[r-2]<<8)+t[r-1];n.push(u[e>>10]+u[e>>4&63]+u[e<<2&63]+"=")}return n.join("")}},{}],144:[function(t,e,r){arguments[4][136][0].apply(r,arguments)},{dup:136}],145:[function(u,t,c){(function(f,h){(function(){"use strict";var l=u("assert");var s=u("pako/lib/zlib/zstream");var o=u("pako/lib/zlib/deflate.js");var a=u("pako/lib/zlib/inflate.js");var t=u("pako/lib/zlib/constants");for(var e in t){c[e]=t[e]}c.NONE=0;c.DEFLATE=1;c.INFLATE=2;c.GZIP=3;c.GUNZIP=4;c.DEFLATERAW=5;c.INFLATERAW=6;c.UNZIP=7;var r=31;var i=139;function n(t){if(typeof t!=="number"||t<c.DEFLATE||t>c.UNZIP){throw new TypeError("Bad argument")}this.dictionary=null;this.err=0;this.flush=0;this.init_done=false;this.level=0;this.memLevel=0;this.mode=t;this.strategy=0;this.windowBits=0;this.write_in_progress=false;this.pending_close=false;this.gzip_id_bytes_read=0}n.prototype.close=function(){if(this.write_in_progress){this.pending_close=true;return}this.pending_close=false;l(this.init_done,"close before init");l(this.mode<=c.UNZIP);if(this.mode===c.DEFLATE||this.mode===c.GZIP||this.mode===c.DEFLATERAW){o.deflateEnd(this.strm)}else if(this.mode===c.INFLATE||this.mode===c.GUNZIP||this.mode===c.INFLATERAW||this.mode===c.UNZIP){a.inflateEnd(this.strm)}this.mode=c.NONE;this.dictionary=null};n.prototype.write=function(t,e,r,i,n,s,o){return this._write(true,t,e,r,i,n,s,o)};n.prototype.writeSync=function(t,e,r,i,n,s,o){return this._write(false,t,e,r,i,n,s,o)};n.prototype._write=function(t,e,r,i,n,s,o,a){l.equal(arguments.length,8);l(this.init_done,"write before init");l(this.mode!==c.NONE,"already finalized");l.equal(false,this.write_in_progress,"write already in progress");l.equal(false,this.pending_close,"close is pending");this.write_in_progress=true;l.equal(false,e===undefined,"must provide flush value");this.write_in_progress=true;if(e!==c.Z_NO_FLUSH&&e!==c.Z_PARTIAL_FLUSH&&e!==c.Z_SYNC_FLUSH&&e!==c.Z_FULL_FLUSH&&e!==c.Z_FINISH&&e!==c.Z_BLOCK){throw new Error("Invalid flush value")}if(r==null){r=h.alloc(0);n=0;i=0}this.strm.avail_in=n;this.strm.input=r;this.strm.next_in=i;this.strm.avail_out=a;this.strm.output=s;this.strm.next_out=o;this.flush=e;if(!t){this._process();if(this._checkError()){return this._afterSync()}return}var u=this;f.nextTick(function(){u._process();u._after()});return this};n.prototype._afterSync=function(){var t=this.strm.avail_out;var e=this.strm.avail_in;this.write_in_progress=false;return[e,t]};n.prototype._process=function(){var t=null;switch(this.mode){case c.DEFLATE:case c.GZIP:case c.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case c.UNZIP:if(this.strm.avail_in>0){t=this.strm.next_in}switch(this.gzip_id_bytes_read){case 0:if(t===null){break}if(this.strm.input[t]===r){this.gzip_id_bytes_read=1;t++;if(this.strm.avail_in===1){break}}else{this.mode=c.INFLATE;break}case 1:if(t===null){break}if(this.strm.input[t]===i){this.gzip_id_bytes_read=2;this.mode=c.GUNZIP}else{this.mode=c.INFLATE}break;default:throw new Error("invalid number of gzip magic number bytes read")}case c.INFLATE:case c.GUNZIP:case c.INFLATERAW:this.err=a.inflate(this.strm,this.flush);if(this.err===c.Z_NEED_DICT&&this.dictionary){this.err=a.inflateSetDictionary(this.strm,this.dictionary);if(this.err===c.Z_OK){this.err=a.inflate(this.strm,this.flush)}else if(this.err===c.Z_DATA_ERROR){this.err=c.Z_NEED_DICT}}while(this.strm.avail_in>0&&this.mode===c.GUNZIP&&this.err===c.Z_STREAM_END&&this.strm.next_in[0]!==0){this.reset();this.err=a.inflate(this.strm,this.flush)}break;default:throw new Error("Unknown mode "+this.mode)}};n.prototype._checkError=function(){switch(this.err){case c.Z_OK:case c.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===c.Z_FINISH){this._error("unexpected end of file");return false}break;case c.Z_STREAM_END:break;case c.Z_NEED_DICT:if(this.dictionary==null){this._error("Missing dictionary")}else{this._error("Bad dictionary")}return false;default:this._error("Zlib error");return false}return true};n.prototype._after=function(){if(!this._checkError()){return}var t=this.strm.avail_out;var e=this.strm.avail_in;this.write_in_progress=false;this.callback(e,t);if(this.pending_close){this.close()}};n.prototype._error=function(t){if(this.strm.msg){t=this.strm.msg}this.onerror(t,this.err);this.write_in_progress=false;if(this.pending_close){this.close()}};n.prototype.init=function(t,e,r,i,n){l(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])");l(t>=8&&t<=15,"invalid windowBits");l(e>=-1&&e<=9,"invalid compression level");l(r>=1&&r<=9,"invalid memlevel");l(i===c.Z_FILTERED||i===c.Z_HUFFMAN_ONLY||i===c.Z_RLE||i===c.Z_FIXED||i===c.Z_DEFAULT_STRATEGY,"invalid strategy");this._init(e,t,r,i,n);this._setDictionary()};n.prototype.params=function(){throw new Error("deflateParams Not supported")};n.prototype.reset=function(){this._reset();this._setDictionary()};n.prototype._init=function(t,e,r,i,n){this.level=t;this.windowBits=e;this.memLevel=r;this.strategy=i;this.flush=c.Z_NO_FLUSH;this.err=c.Z_OK;if(this.mode===c.GZIP||this.mode===c.GUNZIP){this.windowBits+=16}if(this.mode===c.UNZIP){this.windowBits+=32}if(this.mode===c.DEFLATERAW||this.mode===c.INFLATERAW){this.windowBits=-1*this.windowBits}this.strm=new s;switch(this.mode){case c.DEFLATE:case c.GZIP:case c.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,c.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case c.INFLATE:case c.GUNZIP:case c.INFLATERAW:case c.UNZIP:this.err=a.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(this.err!==c.Z_OK){this._error("Init error")}this.dictionary=n;this.write_in_progress=false;this.init_done=true};n.prototype._setDictionary=function(){if(this.dictionary==null){return}this.err=c.Z_OK;switch(this.mode){case c.DEFLATE:case c.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary);break;default:break}if(this.err!==c.Z_OK){this._error("Failed to set dictionary")}};n.prototype._reset=function(){this.err=c.Z_OK;switch(this.mode){case c.DEFLATE:case c.DEFLATERAW:case c.GZIP:this.err=o.deflateReset(this.strm);break;case c.INFLATE:case c.INFLATERAW:case c.GUNZIP:this.err=a.inflateReset(this.strm);break;default:break}if(this.err!==c.Z_OK){this._error("Failed to reset stream")}};c.Zlib=n}).call(this)}).call(this,u("_process"),u("buffer").Buffer)},{_process:179,assert:138,buffer:147,"pako/lib/zlib/constants":169,"pako/lib/zlib/deflate.js":171,"pako/lib/zlib/inflate.js":173,"pako/lib/zlib/zstream":177}],146:[function(A,t,R){(function(E){(function(){"use strict";var y=A("buffer").Buffer;var o=A("stream").Transform;var a=A("./binding");var t=A("util");var b=A("assert").ok;var m=A("buffer").kMaxLength;var v="Cannot create final Buffer. It would be larger "+"than 0x"+m.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8;a.Z_MAX_WINDOWBITS=15;a.Z_DEFAULT_WINDOWBITS=15;a.Z_MIN_CHUNK=64;a.Z_MAX_CHUNK=Infinity;a.Z_DEFAULT_CHUNK=16*1024;a.Z_MIN_MEMLEVEL=1;a.Z_MAX_MEMLEVEL=9;a.Z_DEFAULT_MEMLEVEL=8;a.Z_MIN_LEVEL=-1;a.Z_MAX_LEVEL=9;a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;var e=Object.keys(a);for(var r=0;r<e.length;r++){var i=e[r];if(i.match(/^Z/)){Object.defineProperty(R,i,{enumerable:true,value:a[i],writable:false})}}var n={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR};var s=Object.keys(n);for(var u=0;u<s.length;u++){var l=s[u];n[n[l]]=l}Object.defineProperty(R,"codes",{enumerable:true,value:Object.freeze(n),writable:false});R.Deflate=c;R.Inflate=d;R.Gzip=p;R.Gunzip=g;R.DeflateRaw=w;R.InflateRaw=_;R.Unzip=x;R.createDeflate=function(t){return new c(t)};R.createInflate=function(t){return new d(t)};R.createDeflateRaw=function(t){return new w(t)};R.createInflateRaw=function(t){return new _(t)};R.createGzip=function(t){return new p(t)};R.createGunzip=function(t){return new g(t)};R.createUnzip=function(t){return new x(t)};R.deflate=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new c(e),t,r)};R.deflateSync=function(t,e){return h(new c(e),t)};R.gzip=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new p(e),t,r)};R.gzipSync=function(t,e){return h(new p(e),t)};R.deflateRaw=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new w(e),t,r)};R.deflateRawSync=function(t,e){return h(new w(e),t)};R.unzip=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new x(e),t,r)};R.unzipSync=function(t,e){return h(new x(e),t)};R.inflate=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new d(e),t,r)};R.inflateSync=function(t,e){return h(new d(e),t)};R.gunzip=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new g(e),t,r)};R.gunzipSync=function(t,e){return h(new g(e),t)};R.inflateRaw=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new _(e),t,r)};R.inflateRawSync=function(t,e){return h(new _(e),t)};function f(r,t,i){var n=[];var s=0;r.on("error",o);r.on("end",a);r.end(t);e();function e(){var t;while(null!==(t=r.read())){n.push(t);s+=t.length}r.once("readable",e)}function o(t){r.removeListener("end",a);r.removeListener("readable",e);i(t)}function a(){var t;var e=null;if(s>=m){e=new RangeError(v)}else{t=y.concat(n,s)}n=[];r.close();i(e,t)}}function h(t,e){if(typeof e==="string")e=y.from(e);if(!y.isBuffer(e))throw new TypeError("Not a string or buffer");var r=t._finishFlushFlag;return t._processChunk(e,r)}function c(t){if(!(this instanceof c))return new c(t);k.call(this,t,a.DEFLATE)}function d(t){if(!(this instanceof d))return new d(t);k.call(this,t,a.INFLATE)}function p(t){if(!(this instanceof p))return new p(t);k.call(this,t,a.GZIP)}function g(t){if(!(this instanceof g))return new g(t);k.call(this,t,a.GUNZIP)}function w(t){if(!(this instanceof w))return new w(t);k.call(this,t,a.DEFLATERAW)}function _(t){if(!(this instanceof _))return new _(t);k.call(this,t,a.INFLATERAW)}function x(t){if(!(this instanceof x))return new x(t);k.call(this,t,a.UNZIP)}function C(t){return t===a.Z_NO_FLUSH||t===a.Z_PARTIAL_FLUSH||t===a.Z_SYNC_FLUSH||t===a.Z_FULL_FLUSH||t===a.Z_FINISH||t===a.Z_BLOCK}function k(t,e){var r=this;this._opts=t=t||{};this._chunkSize=t.chunkSize||R.Z_DEFAULT_CHUNK;o.call(this,t);if(t.flush&&!C(t.flush)){throw new Error("Invalid flush flag: "+t.flush)}if(t.finishFlush&&!C(t.finishFlush)){throw new Error("Invalid flush flag: "+t.finishFlush)}this._flushFlag=t.flush||a.Z_NO_FLUSH;this._finishFlushFlag=typeof t.finishFlush!=="undefined"?t.finishFlush:a.Z_FINISH;if(t.chunkSize){if(t.chunkSize<R.Z_MIN_CHUNK||t.chunkSize>R.Z_MAX_CHUNK){throw new Error("Invalid chunk size: "+t.chunkSize)}}if(t.windowBits){if(t.windowBits<R.Z_MIN_WINDOWBITS||t.windowBits>R.Z_MAX_WINDOWBITS){throw new Error("Invalid windowBits: "+t.windowBits)}}if(t.level){if(t.level<R.Z_MIN_LEVEL||t.level>R.Z_MAX_LEVEL){throw new Error("Invalid compression level: "+t.level)}}if(t.memLevel){if(t.memLevel<R.Z_MIN_MEMLEVEL||t.memLevel>R.Z_MAX_MEMLEVEL){throw new Error("Invalid memLevel: "+t.memLevel)}}if(t.strategy){if(t.strategy!=R.Z_FILTERED&&t.strategy!=R.Z_HUFFMAN_ONLY&&t.strategy!=R.Z_RLE&&t.strategy!=R.Z_FIXED&&t.strategy!=R.Z_DEFAULT_STRATEGY){throw new Error("Invalid strategy: "+t.strategy)}}if(t.dictionary){if(!y.isBuffer(t.dictionary)){throw new Error("Invalid dictionary: it should be a Buffer instance")}}this._handle=new a.Zlib(e);var i=this;this._hadError=false;this._handle.onerror=function(t,e){T(i);i._hadError=true;var r=new Error(t);r.errno=e;r.code=R.codes[e];i.emit("error",r)};var n=R.Z_DEFAULT_COMPRESSION;if(typeof t.level==="number")n=t.level;var s=R.Z_DEFAULT_STRATEGY;if(typeof t.strategy==="number")s=t.strategy;this._handle.init(t.windowBits||R.Z_DEFAULT_WINDOWBITS,n,t.memLevel||R.Z_DEFAULT_MEMLEVEL,s,t.dictionary);this._buffer=y.allocUnsafe(this._chunkSize);this._offset=0;this._level=n;this._strategy=s;this.once("end",this.close);Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:true,enumerable:true})}t.inherits(k,o);k.prototype.params=function(t,e,r){if(t<R.Z_MIN_LEVEL||t>R.Z_MAX_LEVEL){throw new RangeError("Invalid compression level: "+t)}if(e!=R.Z_FILTERED&&e!=R.Z_HUFFMAN_ONLY&&e!=R.Z_RLE&&e!=R.Z_FIXED&&e!=R.Z_DEFAULT_STRATEGY){throw new TypeError("Invalid strategy: "+e)}if(this._level!==t||this._strategy!==e){var i=this;this.flush(a.Z_SYNC_FLUSH,function(){b(i._handle,"zlib binding closed");i._handle.params(t,e);if(!i._hadError){i._level=t;i._strategy=e;if(r)r()}})}else{E.nextTick(r)}};k.prototype.reset=function(){b(this._handle,"zlib binding closed");return this._handle.reset()};k.prototype._flush=function(t){this._transform(y.alloc(0),"",t)};k.prototype.flush=function(t,e){var r=this;var i=this._writableState;if(typeof t==="function"||t===undefined&&!e){e=t;t=a.Z_FULL_FLUSH}if(i.ended){if(e)E.nextTick(e)}else if(i.ending){if(e)this.once("end",e)}else if(i.needDrain){if(e){this.once("drain",function(){return r.flush(t,e)})}}else{this._flushFlag=t;this.write(y.alloc(0),"",e)}};k.prototype.close=function(t){T(this,t);E.nextTick(S,this)};function T(t,e){if(e)E.nextTick(e);if(!t._handle)return;t._handle.close();t._handle=null}function S(t){t.emit("close")}k.prototype._transform=function(t,e,r){var i;var n=this._writableState;var s=n.ending||n.ended;var o=s&&(!t||n.length===t.length);if(t!==null&&!y.isBuffer(t))return r(new Error("invalid input"));if(!this._handle)return r(new Error("zlib binding closed"));if(o)i=this._finishFlushFlag;else{i=this._flushFlag;if(t.length>=n.length){this._flushFlag=this._opts.flush||a.Z_NO_FLUSH}}this._processChunk(t,i,r)};k.prototype._processChunk=function(s,o,a){var u=s&&s.length;var l=this._chunkSize-this._offset;var f=0;var h=this;var c=typeof a==="function";if(!c){var d=[];var p=0;var e;this.on("error",function(t){e=t});b(this._handle,"zlib binding closed");do{var t=this._handle.writeSync(o,s,f,u,this._buffer,this._offset,l)}while(!this._hadError&&g(t[0],t[1]));if(this._hadError){throw e}if(p>=m){T(this);throw new RangeError(v)}var r=y.concat(d,p);T(this);return r}b(this._handle,"zlib binding closed");var i=this._handle.write(o,s,f,u,this._buffer,this._offset,l);i.buffer=s;i.callback=g;function g(t,e){if(this){this.buffer=null;this.callback=null}if(h._hadError)return;var r=l-e;b(r>=0,"have should not go down");if(r>0){var i=h._buffer.slice(h._offset,h._offset+r);h._offset+=r;if(c){h.push(i)}else{d.push(i);p+=i.length}}if(e===0||h._offset>=h._chunkSize){l=h._chunkSize;h._offset=0;h._buffer=y.allocUnsafe(h._chunkSize)}if(e===0){f+=u-t;u=t;if(!c)return true;var n=h._handle.write(o,s,f,u,h._buffer,h._offset,h._chunkSize);n.callback=g;n.buffer=s;return}if(!c)return false;a()}};t.inherits(c,k);t.inherits(d,k);t.inherits(p,k);t.inherits(g,k);t.inherits(w,k);t.inherits(_,k);t.inherits(x,k)}).call(this)}).call(this,A("_process"))},{"./binding":145,_process:179,assert:138,buffer:147,stream:181,util:202}],147:[function(q,t,J){(function(t){(function(){"use strict";var i=q("base64-js");var s=q("ieee754");J.Buffer=c;J.SlowBuffer=e;J.INSPECT_MAX_BYTES=50;var r=2147483647;J.kMaxLength=r;c.TYPED_ARRAY_SUPPORT=t();if(!c.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function t(){try{var t=new Uint8Array(1);t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return t.foo()===42}catch(t){return false}}Object.defineProperty(c.prototype,"parent",{enumerable:true,get:function(){if(!c.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(c.prototype,"offset",{enumerable:true,get:function(){if(!c.isBuffer(this))return undefined;return this.byteOffset}});function o(t){if(t>r){throw new RangeError('The value "'+t+'" is invalid for option "size"')}var e=new Uint8Array(t);e.__proto__=c.prototype;return e}function c(t,e,r){if(typeof t==="number"){if(typeof e==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return l(t)}return n(t,e,r)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&c[Symbol.species]===c){Object.defineProperty(c,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}c.poolSize=8192;function n(t,e,r){if(typeof t==="string"){return f(t,e)}if(ArrayBuffer.isView(t)){return h(t)}if(t==null){throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof t)}if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer)){return d(t,e,r)}if(typeof t==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var i=t.valueOf&&t.valueOf();if(i!=null&&i!==t){return c.from(i,e,r)}var n=p(t);if(n)return n;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]==="function"){return c.from(t[Symbol.toPrimitive]("string"),e,r)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof t)}c.from=function(t,e,r){return n(t,e,r)};c.prototype.__proto__=Uint8Array.prototype;c.__proto__=Uint8Array;function a(t){if(typeof t!=="number"){throw new TypeError('"size" argument must be of type number')}else if(t<0){throw new RangeError('The value "'+t+'" is invalid for option "size"')}}function u(t,e,r){a(t);if(t<=0){return o(t)}if(e!==undefined){return typeof r==="string"?o(t).fill(e,r):o(t).fill(e)}return o(t)}c.alloc=function(t,e,r){return u(t,e,r)};function l(t){a(t);return o(t<0?0:g(t)|0)}c.allocUnsafe=function(t){return l(t)};c.allocUnsafeSlow=function(t){return l(t)};function f(t,e){if(typeof e!=="string"||e===""){e="utf8"}if(!c.isEncoding(e)){throw new TypeError("Unknown encoding: "+e)}var r=y(t,e)|0;var i=o(r);var n=i.write(t,e);if(n!==r){i=i.slice(0,n)}return i}function h(t){var e=t.length<0?0:g(t.length)|0;var r=o(e);for(var i=0;i<e;i+=1){r[i]=t[i]&255}return r}function d(t,e,r){if(e<0||t.byteLength<e){throw new RangeError('"offset" is outside of buffer bounds')}if(t.byteLength<e+(r||0)){throw new RangeError('"length" is outside of buffer bounds')}var i;if(e===undefined&&r===undefined){i=new Uint8Array(t)}else if(r===undefined){i=new Uint8Array(t,e)}else{i=new Uint8Array(t,e,r)}i.__proto__=c.prototype;return i}function p(t){if(c.isBuffer(t)){var e=g(t.length)|0;var r=o(e);if(r.length===0){return r}t.copy(r,0,0,e);return r}if(t.length!==undefined){if(typeof t.length!=="number"||X(t.length)){return o(0)}return h(t)}if(t.type==="Buffer"&&Array.isArray(t.data)){return h(t.data)}}function g(t){if(t>=r){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+r.toString(16)+" bytes")}return t|0}function e(t){if(+t!=t){t=0}return c.alloc(+t)}c.isBuffer=function t(e){return e!=null&&e._isBuffer===true&&e!==c.prototype};c.compare=function t(e,r){if(K(e,Uint8Array))e=c.from(e,e.offset,e.byteLength);if(K(r,Uint8Array))r=c.from(r,r.offset,r.byteLength);if(!c.isBuffer(e)||!c.isBuffer(r)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(e===r)return 0;var i=e.length;var n=r.length;for(var s=0,o=Math.min(i,n);s<o;++s){if(e[s]!==r[s]){i=e[s];n=r[s];break}}if(i<n)return-1;if(n<i)return 1;return 0};c.isEncoding=function t(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};c.concat=function t(e,r){if(!Array.isArray(e)){throw new TypeError('"list" argument must be an Array of Buffers')}if(e.length===0){return c.alloc(0)}var i;if(r===undefined){r=0;for(i=0;i<e.length;++i){r+=e[i].length}}var n=c.allocUnsafe(r);var s=0;for(i=0;i<e.length;++i){var o=e[i];if(K(o,Uint8Array)){o=c.from(o)}if(!c.isBuffer(o)){throw new TypeError('"list" argument must be an Array of Buffers')}o.copy(n,s);s+=o.length}return n};function y(t,e){if(c.isBuffer(t)){return t.length}if(ArrayBuffer.isView(t)||K(t,ArrayBuffer)){return t.byteLength}if(typeof t!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof t)}var r=t.length;var i=arguments.length>2&&arguments[2]===true;if(!i&&r===0)return 0;var n=false;for(;;){switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n){return i?-1:z(t).length}e=(""+e).toLowerCase();n=true}}}c.byteLength=y;function b(t,e,r){var i=false;if(e===undefined||e<0){e=0}if(e>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;e>>>=0;if(r<=e){return""}if(!t)t="utf8";while(true){switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase();i=true}}}c.prototype._isBuffer=true;function m(t,e,r){var i=t[e];t[e]=t[r];t[r]=i}c.prototype.swap16=function t(){var e=this.length;if(e%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r<e;r+=2){m(this,r,r+1)}return this};c.prototype.swap32=function t(){var e=this.length;if(e%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var r=0;r<e;r+=4){m(this,r,r+3);m(this,r+1,r+2)}return this};c.prototype.swap64=function t(){var e=this.length;if(e%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var r=0;r<e;r+=8){m(this,r,r+7);m(this,r+1,r+6);m(this,r+2,r+5);m(this,r+3,r+4)}return this};c.prototype.toString=function t(){var e=this.length;if(e===0)return"";if(arguments.length===0)return A(this,0,e);return b.apply(this,arguments)};c.prototype.toLocaleString=c.prototype.toString;c.prototype.equals=function t(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return c.compare(this,e)===0};c.prototype.inspect=function t(){var e="";var r=J.INSPECT_MAX_BYTES;e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim();if(this.length>r)e+=" ... ";return"<Buffer "+e+">"};c.prototype.compare=function t(e,r,i,n,s){if(K(e,Uint8Array)){e=c.from(e,e.offset,e.byteLength)}if(!c.isBuffer(e)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof e)}if(r===undefined){r=0}if(i===undefined){i=e?e.length:0}if(n===undefined){n=0}if(s===undefined){s=this.length}if(r<0||i>e.length||n<0||s>this.length){throw new RangeError("out of range index")}if(n>=s&&r>=i){return 0}if(n>=s){return-1}if(r>=i){return 1}r>>>=0;i>>>=0;n>>>=0;s>>>=0;if(this===e)return 0;var o=s-n;var a=i-r;var u=Math.min(o,a);var l=this.slice(n,s);var f=e.slice(r,i);for(var h=0;h<u;++h){if(l[h]!==f[h]){o=l[h];a=f[h];break}}if(o<a)return-1;if(a<o)return 1;return 0};function v(t,e,r,i,n){if(t.length===0)return-1;if(typeof r==="string"){i=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(X(r)){r=n?0:t.length-1}if(r<0)r=t.length+r;if(r>=t.length){if(n)return-1;else r=t.length-1}else if(r<0){if(n)r=0;else return-1}if(typeof e==="string"){e=c.from(e,i)}if(c.isBuffer(e)){if(e.length===0){return-1}return w(t,e,r,i,n)}else if(typeof e==="number"){e=e&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(n){return Uint8Array.prototype.indexOf.call(t,e,r)}else{return Uint8Array.prototype.lastIndexOf.call(t,e,r)}}return w(t,[e],r,i,n)}throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,i,n){var s=1;var o=t.length;var a=e.length;if(i!==undefined){i=String(i).toLowerCase();if(i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le"){if(t.length<2||e.length<2){return-1}s=2;o/=2;a/=2;r/=2}}function u(t,e){if(s===1){return t[e]}else{return t.readUInt16BE(e*s)}}var l;if(n){var f=-1;for(l=r;l<o;l++){if(u(t,l)===u(e,f===-1?0:l-f)){if(f===-1)f=l;if(l-f+1===a)return f*s}else{if(f!==-1)l-=l-f;f=-1}}}else{if(r+a>o)r=o-a;for(l=r;l>=0;l--){var h=true;for(var c=0;c<a;c++){if(u(t,l+c)!==u(e,c)){h=false;break}}if(h)return l}}return-1}c.prototype.includes=function t(e,r,i){return this.indexOf(e,r,i)!==-1};c.prototype.indexOf=function t(e,r,i){return v(this,e,r,i,true)};c.prototype.lastIndexOf=function t(e,r,i){return v(this,e,r,i,false)};function _(t,e,r,i){r=Number(r)||0;var n=t.length-r;if(!i){i=n}else{i=Number(i);if(i>n){i=n}}var s=e.length;if(i>s/2){i=s/2}for(var o=0;o<i;++o){var a=parseInt(e.substr(o*2,2),16);if(X(a))return o;t[r+o]=a}return o}function x(t,e,r,i){return Z(z(e,t.length-r),t,r,i)}function C(t,e,r,i){return Z(Y(e),t,r,i)}function k(t,e,r,i){return C(t,e,r,i)}function T(t,e,r,i){return Z(G(e),t,r,i)}function S(t,e,r,i){return Z(V(e,t.length-r),t,r,i)}c.prototype.write=function t(e,r,i,n){if(r===undefined){n="utf8";i=this.length;r=0}else if(i===undefined&&typeof r==="string"){n=r;i=this.length;r=0}else if(isFinite(r)){r=r>>>0;if(isFinite(i)){i=i>>>0;if(n===undefined)n="utf8"}else{n=i;i=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var s=this.length-r;if(i===undefined||i>s)i=s;if(e.length>0&&(i<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!n)n="utf8";var o=false;for(;;){switch(n){case"hex":return _(this,e,r,i);case"utf8":case"utf-8":return x(this,e,r,i);case"ascii":return C(this,e,r,i);case"latin1":case"binary":return k(this,e,r,i);case"base64":return T(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();o=true}}};c.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function E(t,e,r){if(e===0&&r===t.length){return i.fromByteArray(t)}else{return i.fromByteArray(t.slice(e,r))}}function A(t,e,r){r=Math.min(t.length,r);var i=[];var n=e;while(n<r){var s=t[n];var o=null;var a=s>239?4:s>223?3:s>191?2:1;if(n+a<=r){var u,l,f,h;switch(a){case 1:if(s<128){o=s}break;case 2:u=t[n+1];if((u&192)===128){h=(s&31)<<6|u&63;if(h>127){o=h}}break;case 3:u=t[n+1];l=t[n+2];if((u&192)===128&&(l&192)===128){h=(s&15)<<12|(u&63)<<6|l&63;if(h>2047&&(h<55296||h>57343)){o=h}}break;case 4:u=t[n+1];l=t[n+2];f=t[n+3];if((u&192)===128&&(l&192)===128&&(f&192)===128){h=(s&15)<<18|(u&63)<<12|(l&63)<<6|f&63;if(h>65535&&h<1114112){o=h}}}}if(o===null){o=65533;a=1}else if(o>65535){o-=65536;i.push(o>>>10&1023|55296);o=56320|o&1023}i.push(o);n+=a}return B(i)}var R=4096;function B(t){var e=t.length;if(e<=R){return String.fromCharCode.apply(String,t)}var r="";var i=0;while(i<e){r+=String.fromCharCode.apply(String,t.slice(i,i+=R))}return r}function O(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n){i+=String.fromCharCode(t[n]&127)}return i}function P(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n){i+=String.fromCharCode(t[n])}return i}function I(t,e,r){var i=t.length;if(!e||e<0)e=0;if(!r||r<0||r>i)r=i;var n="";for(var s=e;s<r;++s){n+=U(t[s])}return n}function M(t,e,r){var i=t.slice(e,r);var n="";for(var s=0;s<i.length;s+=2){n+=String.fromCharCode(i[s]+i[s+1]*256)}return n}c.prototype.slice=function t(e,r){var i=this.length;e=~~e;r=r===undefined?i:~~r;if(e<0){e+=i;if(e<0)e=0}else if(e>i){e=i}if(r<0){r+=i;if(r<0)r=0}else if(r>i){r=i}if(r<e)r=e;var n=this.subarray(e,r);n.__proto__=c.prototype;return n};function j(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)j(e,r,this.length);var n=this[e];var s=1;var o=0;while(++o<r&&(s*=256)){n+=this[e+o]*s}return n};c.prototype.readUIntBE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i){j(e,r,this.length)}var n=this[e+--r];var s=1;while(r>0&&(s*=256)){n+=this[e+--r]*s}return n};c.prototype.readUInt8=function t(e,r){e=e>>>0;if(!r)j(e,1,this.length);return this[e]};c.prototype.readUInt16LE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);return this[e]|this[e+1]<<8};c.prototype.readUInt16BE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);return this[e]<<8|this[e+1]};c.prototype.readUInt32LE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};c.prototype.readUInt32BE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};c.prototype.readIntLE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)j(e,r,this.length);var n=this[e];var s=1;var o=0;while(++o<r&&(s*=256)){n+=this[e+o]*s}s*=128;if(n>=s)n-=Math.pow(2,8*r);return n};c.prototype.readIntBE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)j(e,r,this.length);var n=r;var s=1;var o=this[e+--n];while(n>0&&(s*=256)){o+=this[e+--n]*s}s*=128;if(o>=s)o-=Math.pow(2,8*r);return o};c.prototype.readInt8=function t(e,r){e=e>>>0;if(!r)j(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};c.prototype.readInt16LE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);var i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};c.prototype.readInt16BE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);var i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};c.prototype.readInt32LE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};c.prototype.readInt32BE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};c.prototype.readFloatLE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return s.read(this,e,true,23,4)};c.prototype.readFloatBE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return s.read(this,e,false,23,4)};c.prototype.readDoubleLE=function t(e,r){e=e>>>0;if(!r)j(e,8,this.length);return s.read(this,e,true,52,8)};c.prototype.readDoubleBE=function t(e,r){e=e>>>0;if(!r)j(e,8,this.length);return s.read(this,e,false,52,8)};function L(t,e,r,i,n,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}c.prototype.writeUIntLE=function t(e,r,i,n){e=+e;r=r>>>0;i=i>>>0;if(!n){var s=Math.pow(2,8*i)-1;L(this,e,r,i,s,0)}var o=1;var a=0;this[r]=e&255;while(++a<i&&(o*=256)){this[r+a]=e/o&255}return r+i};c.prototype.writeUIntBE=function t(e,r,i,n){e=+e;r=r>>>0;i=i>>>0;if(!n){var s=Math.pow(2,8*i)-1;L(this,e,r,i,s,0)}var o=i-1;var a=1;this[r+o]=e&255;while(--o>=0&&(a*=256)){this[r+o]=e/a&255}return r+i};c.prototype.writeUInt8=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,1,255,0);this[r]=e&255;return r+1};c.prototype.writeUInt16LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,65535,0);this[r]=e&255;this[r+1]=e>>>8;return r+2};c.prototype.writeUInt16BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,65535,0);this[r]=e>>>8;this[r+1]=e&255;return r+2};c.prototype.writeUInt32LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,4294967295,0);this[r+3]=e>>>24;this[r+2]=e>>>16;this[r+1]=e>>>8;this[r]=e&255;return r+4};c.prototype.writeUInt32BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,4294967295,0);this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255;return r+4};c.prototype.writeIntLE=function t(e,r,i,n){e=+e;r=r>>>0;if(!n){var s=Math.pow(2,8*i-1);L(this,e,r,i,s-1,-s)}var o=0;var a=1;var u=0;this[r]=e&255;while(++o<i&&(a*=256)){if(e<0&&u===0&&this[r+o-1]!==0){u=1}this[r+o]=(e/a>>0)-u&255}return r+i};c.prototype.writeIntBE=function t(e,r,i,n){e=+e;r=r>>>0;if(!n){var s=Math.pow(2,8*i-1);L(this,e,r,i,s-1,-s)}var o=i-1;var a=1;var u=0;this[r+o]=e&255;while(--o>=0&&(a*=256)){if(e<0&&u===0&&this[r+o+1]!==0){u=1}this[r+o]=(e/a>>0)-u&255}return r+i};c.prototype.writeInt8=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,1,127,-128);if(e<0)e=255+e+1;this[r]=e&255;return r+1};c.prototype.writeInt16LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,32767,-32768);this[r]=e&255;this[r+1]=e>>>8;return r+2};c.prototype.writeInt16BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,32767,-32768);this[r]=e>>>8;this[r+1]=e&255;return r+2};c.prototype.writeInt32LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,2147483647,-2147483648);this[r]=e&255;this[r+1]=e>>>8;this[r+2]=e>>>16;this[r+3]=e>>>24;return r+4};c.prototype.writeInt32BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255;return r+4};function D(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,i,n){e=+e;r=r>>>0;if(!n){D(t,e,r,4,34028234663852886e22,-34028234663852886e22)}s.write(t,e,r,i,23,4);return r+4}c.prototype.writeFloatLE=function t(e,r,i){return F(this,e,r,true,i)};c.prototype.writeFloatBE=function t(e,r,i){return F(this,e,r,false,i)};function W(t,e,r,i,n){e=+e;r=r>>>0;if(!n){D(t,e,r,8,17976931348623157e292,-17976931348623157e292)}s.write(t,e,r,i,52,8);return r+8}c.prototype.writeDoubleLE=function t(e,r,i){return W(this,e,r,true,i)};c.prototype.writeDoubleBE=function t(e,r,i){return W(this,e,r,false,i)};c.prototype.copy=function t(e,r,i,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(!i)i=0;if(!n&&n!==0)n=this.length;if(r>=e.length)r=e.length;if(!r)r=0;if(n>0&&n<i)n=i;if(n===i)return 0;if(e.length===0||this.length===0)return 0;if(r<0){throw new RangeError("targetStart out of bounds")}if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-r<n-i){n=e.length-r+i}var s=n-i;if(this===e&&typeof Uint8Array.prototype.copyWithin==="function"){this.copyWithin(r,i,n)}else if(this===e&&i<r&&r<n){for(var o=s-1;o>=0;--o){e[o+r]=this[o+i]}}else{Uint8Array.prototype.set.call(e,this.subarray(i,n),r)}return s};c.prototype.fill=function t(e,r,i,n){if(typeof e==="string"){if(typeof r==="string"){n=r;r=0;i=this.length}else if(typeof i==="string"){n=i;i=this.length}if(n!==undefined&&typeof n!=="string"){throw new TypeError("encoding must be a string")}if(typeof n==="string"&&!c.isEncoding(n)){throw new TypeError("Unknown encoding: "+n)}if(e.length===1){var s=e.charCodeAt(0);if(n==="utf8"&&s<128||n==="latin1"){e=s}}}else if(typeof e==="number"){e=e&255}if(r<0||this.length<r||this.length<i){throw new RangeError("Out of range index")}if(i<=r){return this}r=r>>>0;i=i===undefined?this.length:i>>>0;if(!e)e=0;var o;if(typeof e==="number"){for(o=r;o<i;++o){this[o]=e}}else{var a=c.isBuffer(e)?e:c.from(e,n);var u=a.length;if(u===0){throw new TypeError('The value "'+e+'" is invalid for argument "value"')}for(o=0;o<i-r;++o){this[o+r]=a[o%u]}}return this};var H=/[^+/0-9A-Za-z-_]/g;function N(t){t=t.split("=")[0];t=t.trim().replace(H,"");if(t.length<2)return"";while(t.length%4!==0){t=t+"="}return t}function U(t){if(t<16)return"0"+t.toString(16);return t.toString(16)}function z(t,e){e=e||Infinity;var r;var i=t.length;var n=null;var s=[];for(var o=0;o<i;++o){r=t.charCodeAt(o);if(r>55295&&r<57344){if(!n){if(r>56319){if((e-=3)>-1)s.push(239,191,189);continue}else if(o+1===i){if((e-=3)>-1)s.push(239,191,189);continue}n=r;continue}if(r<56320){if((e-=3)>-1)s.push(239,191,189);n=r;continue}r=(n-55296<<10|r-56320)+65536}else if(n){if((e-=3)>-1)s.push(239,191,189)}n=null;if(r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return s}function Y(t){var e=[];for(var r=0;r<t.length;++r){e.push(t.charCodeAt(r)&255)}return e}function V(t,e){var r,i,n;var s=[];for(var o=0;o<t.length;++o){if((e-=2)<0)break;r=t.charCodeAt(o);i=r>>8;n=r%256;s.push(n);s.push(i)}return s}function G(t){return i.toByteArray(N(t))}function Z(t,e,r,i){for(var n=0;n<i;++n){if(n+r>=e.length||n>=t.length)break;e[n+r]=t[n]}return n}function K(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function X(t){return t!==t}}).call(this)}).call(this,q("buffer").Buffer)},{"base64-js":143,buffer:147,ieee754:159}],148:[function(t,e,r){"use strict";var n=t("get-intrinsic");var s=t("./");var o=s(n("String.prototype.indexOf"));e.exports=function t(e,r){var i=n(e,!!r);if(typeof i==="function"&&o(e,".prototype.")>-1){return s(i)}return i}},{"./":149,"get-intrinsic":155}],149:[function(t,e,r){"use strict";var n=t("function-bind");var i=t("get-intrinsic");var s=i("%Function.prototype.apply%");var o=i("%Function.prototype.call%");var a=i("%Reflect.apply%",true)||n.call(o,s);var u=i("%Object.getOwnPropertyDescriptor%",true);var l=i("%Object.defineProperty%",true);var f=i("%Math.max%");if(l){try{l({},"a",{value:1})}catch(t){l=null}}e.exports=function t(e){var r=a(n,o,arguments);if(u&&l){var i=u(r,"length");if(i.configurable){l(r,"length",{value:1+f(0,e.length-(arguments.length-1))})}}return r};var h=function t(){return a(n,s,arguments)};if(l){l(e.exports,"apply",{value:h})}else{e.exports.apply=h}},{"function-bind":154,"get-intrinsic":155}],150:[function(t,e,r){"use strict";var i=t("get-intrinsic");var n=i("%Object.getOwnPropertyDescriptor%");if(n){try{n([],"length")}catch(t){n=null}}e.exports=n},{"get-intrinsic":155}],151:[function(t,e,r){"use strict";var i=typeof Reflect==="object"?Reflect:null;var h=i&&typeof i.apply==="function"?i.apply:function t(e,r,i){return Function.prototype.apply.call(e,r,i)};var n;if(i&&typeof i.ownKeys==="function"){n=i.ownKeys}else if(Object.getOwnPropertySymbols){n=function t(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}}else{n=function t(e){return Object.getOwnPropertyNames(e)}}function u(t){if(console&&console.warn)console.warn(t)}var s=Number.isNaN||function t(e){return e!==e};function o(){o.init.call(this)}e.exports=o;e.exports.once=w;o.EventEmitter=o;o.prototype._events=undefined;o.prototype._eventsCount=0;o.prototype._maxListeners=undefined;var a=10;function l(t){if(typeof t!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:true,get:function(){return a},set:function(t){if(typeof t!=="number"||t<0||s(t)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".")}a=t}});o.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};o.prototype.setMaxListeners=function t(e){if(typeof e!=="number"||e<0||s(e)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".")}this._maxListeners=e;return this};function f(t){if(t._maxListeners===undefined)return o.defaultMaxListeners;return t._maxListeners}o.prototype.getMaxListeners=function t(){return f(this)};o.prototype.emit=function t(e){var r=[];for(var i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error";var s=this._events;if(s!==undefined)n=n&&s.error===undefined;else if(!n)return false;if(n){var o;if(r.length>0)o=r[0];if(o instanceof Error){throw o}var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));a.context=o;throw a}var u=s[e];if(u===undefined)return false;if(typeof u==="function"){h(u,this,r)}else{var l=u.length;var f=b(u,l);for(var i=0;i<l;++i)h(f[i],this,r)}return true};function c(t,e,r,i){var n;var s;var o;l(r);s=t._events;if(s===undefined){s=t._events=Object.create(null);t._eventsCount=0}else{if(s.newListener!==undefined){t.emit("newListener",e,r.listener?r.listener:r);s=t._events}o=s[e]}if(o===undefined){o=s[e]=r;++t._eventsCount}else{if(typeof o==="function"){o=s[e]=i?[r,o]:[o,r]}else if(i){o.unshift(r)}else{o.push(r)}n=f(t);if(n>0&&o.length>n&&!o.warned){o.warned=true;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");a.name="MaxListenersExceededWarning";a.emitter=t;a.type=e;a.count=o.length;u(a)}}return t}o.prototype.addListener=function t(e,r){return c(this,e,r,false)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function t(e,r){return c(this,e,r,true)};function d(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function p(t,e,r){var i={fired:false,wrapFn:undefined,target:t,type:e,listener:r};var n=d.bind(i);n.listener=r;i.wrapFn=n;return n}o.prototype.once=function t(e,r){l(r);this.on(e,p(this,e,r));return this};o.prototype.prependOnceListener=function t(e,r){l(r);this.prependListener(e,p(this,e,r));return this};o.prototype.removeListener=function t(e,r){var i,n,s,o,a;l(r);n=this._events;if(n===undefined)return this;i=n[e];if(i===undefined)return this;if(i===r||i.listener===r){if(--this._eventsCount===0)this._events=Object.create(null);else{delete n[e];if(n.removeListener)this.emit("removeListener",e,i.listener||r)}}else if(typeof i!=="function"){s=-1;for(o=i.length-1;o>=0;o--){if(i[o]===r||i[o].listener===r){a=i[o].listener;s=o;break}}if(s<0)return this;if(s===0)i.shift();else{m(i,s)}if(i.length===1)n[e]=i[0];if(n.removeListener!==undefined)this.emit("removeListener",e,a||r)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function t(e){var r,i,n;i=this._events;if(i===undefined)return this;if(i.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(i[e]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete i[e]}return this}if(arguments.length===0){var s=Object.keys(i);var o;for(n=0;n<s.length;++n){o=s[n];if(o==="removeListener")continue;this.removeAllListeners(o)}this.removeAllListeners("removeListener");this._events=Object.create(null);this._eventsCount=0;return this}r=i[e];if(typeof r==="function"){this.removeListener(e,r)}else if(r!==undefined){for(n=r.length-1;n>=0;n--){this.removeListener(e,r[n])}}return this};function g(t,e,r){var i=t._events;if(i===undefined)return[];var n=i[e];if(n===undefined)return[];if(typeof n==="function")return r?[n.listener||n]:[n];return r?v(n):b(n,n.length)}o.prototype.listeners=function t(e){return g(this,e,true)};o.prototype.rawListeners=function t(e){return g(this,e,false)};o.listenerCount=function(t,e){if(typeof t.listenerCount==="function"){return t.listenerCount(e)}else{return y.call(t,e)}};o.prototype.listenerCount=y;function y(t){var e=this._events;if(e!==undefined){var r=e[t];if(typeof r==="function"){return 1}else if(r!==undefined){return r.length}}return 0}o.prototype.eventNames=function t(){return this._eventsCount>0?n(this._events):[]};function b(t,e){var r=new Array(e);for(var i=0;i<e;++i)r[i]=t[i];return r}function m(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function v(t){var e=new Array(t.length);for(var r=0;r<e.length;++r){e[r]=t[r].listener||t[r]}return e}function w(n,s){return new Promise(function(t,r){function i(){if(e!==undefined){n.removeListener("error",e)}t([].slice.call(arguments))}var e;if(s!=="error"){e=function t(e){n.removeListener(s,i);r(e)};n.once("error",e)}n.once(s,i)})}},{}],152:[function(t,e,r){var a=Object.prototype.hasOwnProperty;var u=Object.prototype.toString;e.exports=function t(e,r,i){if(u.call(r)!=="[object Function]"){throw new TypeError("iterator must be a function")}var n=e.length;if(n===+n){for(var s=0;s<n;s++){r.call(i,e[s],s,e)}}else{for(var o in e){if(a.call(e,o)){r.call(i,e[o],o,e)}}}}},{}],153:[function(t,e,r){"use strict";var f="Function.prototype.bind called on incompatible ";var h=Array.prototype.slice;var c=Object.prototype.toString;var d="[object Function]";e.exports=function t(e){var r=this;if(typeof r!=="function"||c.call(r)!==d){throw new TypeError(f+r)}var i=h.call(arguments,1);var n;var s=function(){if(this instanceof n){var t=r.apply(this,i.concat(h.call(arguments)));if(Object(t)===t){return t}return this}else{return r.apply(e,i.concat(h.call(arguments)))}};var o=Math.max(0,r.length-i.length);var a=[];for(var u=0;u<o;u++){a.push("$"+u)}n=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(s);if(r.prototype){var l=function t(){};l.prototype=r.prototype;n.prototype=new l;l.prototype=null}return n}},{}],154:[function(t,e,r){"use strict";var i=t("./implementation");e.exports=Function.prototype.bind||i},{"./implementation":153}],155:[function(t,e,r){"use strict";var y;var b=SyntaxError;var i=Function;var m=TypeError;var s=function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}};var v=Object.getOwnPropertyDescriptor;if(v){try{v({},"")}catch(t){v=null}}var n=function(){throw new m};var o=v?function(){try{arguments.callee;return n}catch(t){try{return v(arguments,"callee").get}catch(t){return n}}}():n;var a=t("has-symbols")();var u=Object.getPrototypeOf||function(t){return t.__proto__};var l={};var f=typeof Uint8Array==="undefined"?y:u(Uint8Array);var w={"%AggregateError%":typeof AggregateError==="undefined"?y:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer==="undefined"?y:ArrayBuffer,"%ArrayIteratorPrototype%":a?u([][Symbol.iterator]()):y,"%AsyncFromSyncIteratorPrototype%":y,"%AsyncFunction%":l,"%AsyncGenerator%":l,"%AsyncGeneratorFunction%":l,"%AsyncIteratorPrototype%":l,"%Atomics%":typeof Atomics==="undefined"?y:Atomics,"%BigInt%":typeof BigInt==="undefined"?y:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView==="undefined"?y:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array==="undefined"?y:Float32Array,"%Float64Array%":typeof Float64Array==="undefined"?y:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry==="undefined"?y:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":l,"%Int8Array%":typeof Int8Array==="undefined"?y:Int8Array,"%Int16Array%":typeof Int16Array==="undefined"?y:Int16Array,"%Int32Array%":typeof Int32Array==="undefined"?y:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":a?u(u([][Symbol.iterator]())):y,"%JSON%":typeof JSON==="object"?JSON:y,"%Map%":typeof Map==="undefined"?y:Map,"%MapIteratorPrototype%":typeof Map==="undefined"||!a?y:u((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise==="undefined"?y:Promise,"%Proxy%":typeof Proxy==="undefined"?y:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect==="undefined"?y:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set==="undefined"?y:Set,"%SetIteratorPrototype%":typeof Set==="undefined"||!a?y:u((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer==="undefined"?y:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":a?u(""[Symbol.iterator]()):y,"%Symbol%":a?Symbol:y,"%SyntaxError%":b,"%ThrowTypeError%":o,"%TypedArray%":f,"%TypeError%":m,"%Uint8Array%":typeof Uint8Array==="undefined"?y:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray==="undefined"?y:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array==="undefined"?y:Uint16Array,"%Uint32Array%":typeof Uint32Array==="undefined"?y:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap==="undefined"?y:WeakMap,"%WeakRef%":typeof WeakRef==="undefined"?y:WeakRef,"%WeakSet%":typeof WeakSet==="undefined"?y:WeakSet};var h=function t(e){var r;if(e==="%AsyncFunction%"){r=s("async function () {}")}else if(e==="%GeneratorFunction%"){r=s("function* () {}")}else if(e==="%AsyncGeneratorFunction%"){r=s("async function* () {}")}else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");if(i){r=i.prototype}}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");if(n){r=u(n.prototype)}}w[e]=r;return r};var c={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]};var d=t("function-bind");var _=t("has");var x=d.call(Function.call,Array.prototype.concat);var C=d.call(Function.apply,Array.prototype.splice);var p=d.call(Function.call,String.prototype.replace);var k=d.call(Function.call,String.prototype.slice);var g=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;var T=/\\(\\)?/g;var S=function t(e){var r=k(e,0,1);var i=k(e,-1);if(r==="%"&&i!=="%"){throw new b("invalid intrinsic syntax, expected closing `%`")}else if(i==="%"&&r!=="%"){throw new b("invalid intrinsic syntax, expected opening `%`")}var n=[];p(e,g,function(t,e,r,i){n[n.length]=r?p(i,T,"$1"):e||t});return n};var E=function t(e,r){var i=e;var n;if(_(c,i)){n=c[i];i="%"+n[0]+"%"}if(_(w,i)){var s=w[i];if(s===l){s=h(i)}if(typeof s==="undefined"&&!r){throw new m("intrinsic "+e+" exists, but is not available. Please file an issue!")}return{alias:n,name:i,value:s}}throw new b("intrinsic "+e+" does not exist!")};e.exports=function t(e,r){if(typeof e!=="string"||e.length===0){throw new m("intrinsic name must be a non-empty string")}if(arguments.length>1&&typeof r!=="boolean"){throw new m('"allowMissing" argument must be a boolean')}var i=S(e);var n=i.length>0?i[0]:"";var s=E("%"+n+"%",r);var o=s.name;var a=s.value;var u=false;var l=s.alias;if(l){n=l[0];C(i,x([0,1],l))}for(var f=1,h=true;f<i.length;f+=1){var c=i[f];var d=k(c,0,1);var p=k(c,-1);if((d==='"'||d==="'"||d==="`"||(p==='"'||p==="'"||p==="`"))&&d!==p){throw new b("property names with quotes must have matching quotes")}if(c==="constructor"||!h){u=true}n+="."+c;o="%"+n+"%";if(_(w,o)){a=w[o]}else if(a!=null){if(!(c in a)){if(!r){throw new m("base intrinsic for "+e+" exists, but the property is not available.")}return void y}if(v&&f+1>=i.length){var g=v(a,c);h=!!g;if(h&&"get"in g&&!("originalValue"in g.get)){a=g.get}else{a=a[c]}}else{h=_(a,c);a=a[c]}if(h&&!u){w[o]=a}}}return a}},{"function-bind":154,has:158,"has-symbols":156}],156:[function(i,n,t){(function(t){(function(){"use strict";var e=t.Symbol;var r=i("./shams");n.exports=function t(){if(typeof e!=="function"){return false}if(typeof Symbol!=="function"){return false}if(typeof e("foo")!=="symbol"){return false}if(typeof Symbol("bar")!=="symbol"){return false}return r()}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./shams":157}],157:[function(t,e,r){"use strict";e.exports=function t(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function"){return false}if(typeof Symbol.iterator==="symbol"){return true}var e={};var r=Symbol("test");var i=Object(r);if(typeof r==="string"){return false}if(Object.prototype.toString.call(r)!=="[object Symbol]"){return false}if(Object.prototype.toString.call(i)!=="[object Symbol]"){return false}var n=42;e[r]=n;for(r in e){return false}if(typeof Object.keys==="function"&&Object.keys(e).length!==0){return false}if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(e).length!==0){return false}var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r){return false}if(!Object.prototype.propertyIsEnumerable.call(e,r)){return false}if(typeof Object.getOwnPropertyDescriptor==="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==n||o.enumerable!==true){return false}}return true}},{}],158:[function(t,e,r){"use strict";var i=t("function-bind");e.exports=i.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":154}],159:[function(t,e,r){r.read=function(t,e,r,i,n){var s,o;var a=n*8-i-1;var u=(1<<a)-1;var l=u>>1;var f=-7;var h=r?n-1:0;var c=r?-1:1;var d=t[e+h];h+=c;s=d&(1<<-f)-1;d>>=-f;f+=a;for(;f>0;s=s*256+t[e+h],h+=c,f-=8){}o=s&(1<<-f)-1;s>>=-f;f+=i;for(;f>0;o=o*256+t[e+h],h+=c,f-=8){}if(s===0){s=1-l}else if(s===u){return o?NaN:(d?-1:1)*Infinity}else{o=o+Math.pow(2,i);s=s-l}return(d?-1:1)*o*Math.pow(2,s-i)};r.write=function(t,e,r,i,n,s){var o,a,u;var l=s*8-n-1;var f=(1<<l)-1;var h=f>>1;var c=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:s-1;var p=i?1:-1;var g=e<0||e===0&&1/e<0?1:0;e=Math.abs(e);if(isNaN(e)||e===Infinity){a=isNaN(e)?1:0;o=f}else{o=Math.floor(Math.log(e)/Math.LN2);if(e*(u=Math.pow(2,-o))<1){o--;u*=2}if(o+h>=1){e+=c/u}else{e+=c*Math.pow(2,1-h)}if(e*u>=2){o++;u/=2}if(o+h>=f){a=0;o=f}else if(o+h>=1){a=(e*u-1)*Math.pow(2,n);o=o+h}else{a=e*Math.pow(2,h-1)*Math.pow(2,n);o=0}}for(;n>=8;t[r+d]=a&255,d+=p,a/=256,n-=8){}o=o<<n|a;l+=n;for(;l>0;t[r+d]=o&255,d+=p,o/=256,l-=8){}t[r+d-p]|=g*128}},{}],160:[function(t,e,r){if(typeof Object.create==="function"){e.exports=function t(e,r){if(r){e.super_=r;e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function t(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype;e.prototype=new i;e.prototype.constructor=e}}}},{}],161:[function(t,e,r){"use strict";var i=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var n=t("call-bind/callBound");var s=n("Object.prototype.toString");var o=function t(e){if(i&&e&&typeof e==="object"&&Symbol.toStringTag in e){return false}return s(e)==="[object Arguments]"};var a=function t(e){if(o(e)){return true}return e!==null&&typeof e==="object"&&typeof e.length==="number"&&e.length>=0&&s(e)!=="[object Array]"&&s(e.callee)==="[object Function]"};var u=function(){return o(arguments)}();o.isLegacyArguments=a;e.exports=u?o:a},{"call-bind/callBound":148}],162:[function(t,e,r){arguments[4][64][0].apply(r,arguments)},{dup:64}],163:[function(t,e,r){"use strict";var i=Object.prototype.toString;var n=Function.prototype.toString;var s=/^\s*(?:function)?\*/;var o=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var a=Object.getPrototypeOf;var u=function(){if(!o){return false}try{return Function("return function*() {}")()}catch(t){}};var l=u();var f=a&&l?a(l):false;e.exports=function t(e){if(typeof e!=="function"){return false}if(s.test(n.call(e))){return true}if(!o){var r=i.call(e);return r==="[object GeneratorFunction]"}return a&&a(e)===f}},{}],164:[function(p,g,t){(function(d){(function(){"use strict";var e=p("foreach");var t=p("available-typed-arrays");var r=p("call-bind/callBound");var i=r("Object.prototype.toString");var n=p("has-symbols")();var s=n&&typeof Symbol.toStringTag==="symbol";var o=t();var a=r("Array.prototype.indexOf",true)||function t(e,r){for(var i=0;i<e.length;i+=1){if(e[i]===r){return i}}return-1};var u=r("String.prototype.slice");var l={};var f=p("es-abstract/helpers/getOwnPropertyDescriptor");var h=Object.getPrototypeOf;if(s&&f&&h){e(o,function(t){var e=new d[t];if(!(Symbol.toStringTag in e)){throw new EvalError("this engine has support for Symbol.toStringTag, but "+t+" does not have the property! Please report this.")}var r=h(e);var i=f(r,Symbol.toStringTag);if(!i){var n=h(r);i=f(n,Symbol.toStringTag)}l[t]=i.get})}var c=function t(r){var i=false;e(l,function(t,e){if(!i){try{i=t.call(r)===e}catch(t){}}});return i};g.exports=function t(e){if(!e||typeof e!=="object"){return false}if(!s){var r=u(i(e),8,-1);return a(o,r)>-1}if(!f){return false}return c(e)}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"available-typed-arrays":142,"call-bind/callBound":148,"es-abstract/helpers/getOwnPropertyDescriptor":150,foreach:152,"has-symbols":156}],165:[function(t,e,r){"use strict";var u=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty;var f=Object.prototype.propertyIsEnumerable;function h(t){if(t===null||t===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(t)}function i(){try{if(!Object.assign){return false}var t=new String("abc");t[5]="de";if(Object.getOwnPropertyNames(t)[0]==="5"){return false}var e={};for(var r=0;r<10;r++){e["_"+String.fromCharCode(r)]=r}var i=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if(i.join("")!=="0123456789"){return false}var n={};"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t});if(Object.keys(Object.assign({},n)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(t){return false}}e.exports=i()?Object.assign:function(t,e){var r;var i=h(t);var n;for(var s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var o in r){if(l.call(r,o)){i[o]=r[o]}}if(u){n=u(r);for(var a=0;a<n.length;a++){if(f.call(r,n[a])){i[n[a]]=r[n[a]]}}}}return i}},{}],166:[function(t,e,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n";r.homedir=function(){return"/"}},{}],167:[function(t,e,r){"use strict";var i=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.assign=function(t){var e=Array.prototype.slice.call(arguments,1);while(e.length){var r=e.shift();if(!r){continue}if(typeof r!=="object"){throw new TypeError(r+"must be non-object")}for(var i in r){if(n(r,i)){t[i]=r[i]}}}return t};r.shrinkBuf=function(t,e){if(t.length===e){return t}if(t.subarray){return t.subarray(0,e)}t.length=e;return t};var s={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var s=0;s<i;s++){t[n+s]=e[r+s]}},flattenChunks:function(t){var e,r,i,n,s,o;i=0;for(e=0,r=t.length;e<r;e++){i+=t[e].length}o=new Uint8Array(i);n=0;for(e=0,r=t.length;e<r;e++){s=t[e];o.set(s,n);n+=s.length}return o}};var o={arraySet:function(t,e,r,i,n){for(var s=0;s<i;s++){t[n+s]=e[r+s]}},flattenChunks:function(t){return[].concat.apply([],t)}};r.setTyped=function(t){if(t){r.Buf8=Uint8Array;r.Buf16=Uint16Array;r.Buf32=Int32Array;r.assign(r,s)}else{r.Buf8=Array;r.Buf16=Array;r.Buf32=Array;r.assign(r,o)}};r.setTyped(i)},{}],168:[function(t,e,r){"use strict";function i(t,e,r,i){var n=t&65535|0,s=t>>>16&65535|0,o=0;while(r!==0){o=r>2e3?2e3:r;r-=o;do{n=n+e[i++]|0;s=s+n|0}while(--o);n%=65521;s%=65521}return n|s<<16|0}e.exports=i},{}],169:[function(t,e,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],170:[function(t,e,r){"use strict";function i(){var t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++){t=t&1?3988292384^t>>>1:t>>>1}e[r]=t}return e}var a=i();function n(t,e,r,i){var n=a,s=i+r;t^=-1;for(var o=i;o<s;o++){t=t>>>8^n[(t^e[o])&255]}return t^-1}e.exports=n},{}],171:[function(t,e,r){"use strict";var h=t("../utils/common");var l=t("./trees");var c=t("./adler32");var f=t("./crc32");var i=t("./messages");var d=0;var p=1;var g=3;var y=4;var b=5;var m=0;var v=1;var w=-2;var n=-3;var _=-5;var u=-1;var s=1;var x=2;var C=3;var k=4;var o=0;var a=2;var T=8;var S=9;var E=15;var A=8;var R=29;var B=256;var O=B+1+R;var P=30;var I=19;var M=2*O+1;var j=15;var L=3;var D=258;var F=D+L+1;var W=32;var H=42;var N=69;var U=73;var z=91;var Y=103;var V=113;var G=666;var Z=1;var K=2;var X=3;var q=4;var J=3;function $(t,e){t.msg=i[e];return e}function Q(t){return(t<<1)-(t>4?9:0)}function tt(t){var e=t.length;while(--e>=0){t[e]=0}}function et(t){var e=t.state;var r=e.pending;if(r>t.avail_out){r=t.avail_out}if(r===0){return}h.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out);t.next_out+=r;e.pending_out+=r;t.total_out+=r;t.avail_out-=r;e.pending-=r;if(e.pending===0){e.pending_out=0}}function rt(t,e){l._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e);t.block_start=t.strstart;et(t.strm)}function it(t,e){t.pending_buf[t.pending++]=e}function nt(t,e){t.pending_buf[t.pending++]=e>>>8&255;t.pending_buf[t.pending++]=e&255}function st(t,e,r,i){var n=t.avail_in;if(n>i){n=i}if(n===0){return 0}t.avail_in-=n;h.arraySet(e,t.input,t.next_in,n,r);if(t.state.wrap===1){t.adler=c(t.adler,e,n,r)}else if(t.state.wrap===2){t.adler=f(t.adler,e,n,r)}t.next_in+=n;t.total_in+=n;return n}function ot(t,e){var r=t.max_chain_length;var i=t.strstart;var n;var s;var o=t.prev_length;var a=t.nice_match;var u=t.strstart>t.w_size-F?t.strstart-(t.w_size-F):0;var l=t.window;var f=t.w_mask;var h=t.prev;var c=t.strstart+D;var d=l[i+o-1];var p=l[i+o];if(t.prev_length>=t.good_match){r>>=2}if(a>t.lookahead){a=t.lookahead}do{n=e;if(l[n+o]!==p||l[n+o-1]!==d||l[n]!==l[i]||l[++n]!==l[i+1]){continue}i+=2;n++;do{}while(l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&i<c);s=D-(c-i);i=c-D;if(s>o){t.match_start=e;o=s;if(s>=a){break}d=l[i+o-1];p=l[i+o]}}while((e=h[e&f])>u&&--r!==0);if(o<=t.lookahead){return o}return t.lookahead}function at(t){var e=t.w_size;var r,i,n,s,o;do{s=t.window_size-t.lookahead-t.strstart;if(t.strstart>=e+(e-F)){h.arraySet(t.window,t.window,e,e,0);t.match_start-=e;t.strstart-=e;t.block_start-=e;i=t.hash_size;r=i;do{n=t.head[--r];t.head[r]=n>=e?n-e:0}while(--i);i=e;r=i;do{n=t.prev[--r];t.prev[r]=n>=e?n-e:0}while(--i);s+=e}if(t.strm.avail_in===0){break}i=st(t.strm,t.window,t.strstart+t.lookahead,s);t.lookahead+=i;if(t.lookahead+t.insert>=L){o=t.strstart-t.insert;t.ins_h=t.window[o];t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;while(t.insert){t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+L-1])&t.hash_mask;t.prev[o&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=o;o++;t.insert--;if(t.lookahead+t.insert<L){break}}}}while(t.lookahead<F&&t.strm.avail_in!==0)}function ut(t,e){var r=65535;if(r>t.pending_buf_size-5){r=t.pending_buf_size-5}for(;;){if(t.lookahead<=1){at(t);if(t.lookahead===0&&e===d){return Z}if(t.lookahead===0){break}}t.strstart+=t.lookahead;t.lookahead=0;var i=t.block_start+r;if(t.strstart===0||t.strstart>=i){t.lookahead=t.strstart-i;t.strstart=i;rt(t,false);if(t.strm.avail_out===0){return Z}}if(t.strstart-t.block_start>=t.w_size-F){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=0;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.strstart>t.block_start){rt(t,false);if(t.strm.avail_out===0){return Z}}return Z}function lt(t,e){var r;var i;for(;;){if(t.lookahead<F){at(t);if(t.lookahead<F&&e===d){return Z}if(t.lookahead===0){break}}r=0;if(t.lookahead>=L){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+L-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}if(r!==0&&t.strstart-r<=t.w_size-F){t.match_length=ot(t,r)}if(t.match_length>=L){i=l._tr_tally(t,t.strstart-t.match_start,t.match_length-L);t.lookahead-=t.match_length;if(t.match_length<=t.max_lazy_match&&t.lookahead>=L){t.match_length--;do{t.strstart++;t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+L-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}while(--t.match_length!==0);t.strstart++}else{t.strstart+=t.match_length;t.match_length=0;t.ins_h=t.window[t.strstart];t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask}}else{i=l._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(i){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=t.strstart<L-1?t.strstart:L-1;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.last_lit){rt(t,false);if(t.strm.avail_out===0){return Z}}return K}function ft(t,e){var r;var i;var n;for(;;){if(t.lookahead<F){at(t);if(t.lookahead<F&&e===d){return Z}if(t.lookahead===0){break}}r=0;if(t.lookahead>=L){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+L-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}t.prev_length=t.match_length;t.prev_match=t.match_start;t.match_length=L-1;if(r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-F){t.match_length=ot(t,r);if(t.match_length<=5&&(t.strategy===s||t.match_length===L&&t.strstart-t.match_start>4096)){t.match_length=L-1}}if(t.prev_length>=L&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-L;i=l._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-L);t.lookahead-=t.prev_length-1;t.prev_length-=2;do{if(++t.strstart<=n){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+L-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}}while(--t.prev_length!==0);t.match_available=0;t.match_length=L-1;t.strstart++;if(i){rt(t,false);if(t.strm.avail_out===0){return Z}}}else if(t.match_available){i=l._tr_tally(t,0,t.window[t.strstart-1]);if(i){rt(t,false)}t.strstart++;t.lookahead--;if(t.strm.avail_out===0){return Z}}else{t.match_available=1;t.strstart++;t.lookahead--}}if(t.match_available){i=l._tr_tally(t,0,t.window[t.strstart-1]);t.match_available=0}t.insert=t.strstart<L-1?t.strstart:L-1;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.last_lit){rt(t,false);if(t.strm.avail_out===0){return Z}}return K}function ht(t,e){var r;var i;var n,s;var o=t.window;for(;;){if(t.lookahead<=D){at(t);if(t.lookahead<=D&&e===d){return Z}if(t.lookahead===0){break}}t.match_length=0;if(t.lookahead>=L&&t.strstart>0){n=t.strstart-1;i=o[n];if(i===o[++n]&&i===o[++n]&&i===o[++n]){s=t.strstart+D;do{}while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&n<s);t.match_length=D-(s-n);if(t.match_length>t.lookahead){t.match_length=t.lookahead}}}if(t.match_length>=L){r=l._tr_tally(t,1,t.match_length-L);t.lookahead-=t.match_length;t.strstart+=t.match_length;t.match_length=0}else{r=l._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(r){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=0;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.last_lit){rt(t,false);if(t.strm.avail_out===0){return Z}}return K}function ct(t,e){var r;for(;;){if(t.lookahead===0){at(t);if(t.lookahead===0){if(e===d){return Z}break}}t.match_length=0;r=l._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++;if(r){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=0;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.last_lit){rt(t,false);if(t.strm.avail_out===0){return Z}}return K}function dt(t,e,r,i,n){this.good_length=t;this.max_lazy=e;this.nice_length=r;this.max_chain=i;this.func=n}var pt;pt=[new dt(0,0,0,0,ut),new dt(4,4,8,4,lt),new dt(4,5,16,8,lt),new dt(4,6,32,32,lt),new dt(4,4,16,16,ft),new dt(8,16,32,32,ft),new dt(8,16,128,128,ft),new dt(8,32,128,256,ft),new dt(32,128,258,1024,ft),new dt(32,258,258,4096,ft)];function gt(t){t.window_size=2*t.w_size;tt(t.head);t.max_lazy_match=pt[t.level].max_lazy;t.good_match=pt[t.level].good_length;t.nice_match=pt[t.level].nice_length;t.max_chain_length=pt[t.level].max_chain;t.strstart=0;t.block_start=0;t.lookahead=0;t.insert=0;t.match_length=t.prev_length=L-1;t.match_available=0;t.ins_h=0}function yt(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=T;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new h.Buf16(M*2);this.dyn_dtree=new h.Buf16((2*P+1)*2);this.bl_tree=new h.Buf16((2*I+1)*2);tt(this.dyn_ltree);tt(this.dyn_dtree);tt(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new h.Buf16(j+1);this.heap=new h.Buf16(2*O+1);tt(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new h.Buf16(2*O+1);tt(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function bt(t){var e;if(!t||!t.state){return $(t,w)}t.total_in=t.total_out=0;t.data_type=a;e=t.state;e.pending=0;e.pending_out=0;if(e.wrap<0){e.wrap=-e.wrap}e.status=e.wrap?H:V;t.adler=e.wrap===2?0:1;e.last_flush=d;l._tr_init(e);return m}function mt(t){var e=bt(t);if(e===m){gt(t.state)}return e}function vt(t,e){if(!t||!t.state){return w}if(t.state.wrap!==2){return w}t.state.gzhead=e;return m}function wt(t,e,r,i,n,s){if(!t){return w}var o=1;if(e===u){e=6}if(i<0){o=0;i=-i}else if(i>15){o=2;i-=16}if(n<1||n>S||r!==T||i<8||i>15||e<0||e>9||s<0||s>k){return $(t,w)}if(i===8){i=9}var a=new yt;t.state=a;a.strm=t;a.wrap=o;a.gzhead=null;a.w_bits=i;a.w_size=1<<a.w_bits;a.w_mask=a.w_size-1;a.hash_bits=n+7;a.hash_size=1<<a.hash_bits;a.hash_mask=a.hash_size-1;a.hash_shift=~~((a.hash_bits+L-1)/L);a.window=new h.Buf8(a.w_size*2);a.head=new h.Buf16(a.hash_size);a.prev=new h.Buf16(a.w_size);a.lit_bufsize=1<<n+6;a.pending_buf_size=a.lit_bufsize*4;a.pending_buf=new h.Buf8(a.pending_buf_size);a.d_buf=1*a.lit_bufsize;a.l_buf=(1+2)*a.lit_bufsize;a.level=e;a.strategy=s;a.method=r;return mt(t)}function _t(t,e){return wt(t,e,T,E,A,o)}function xt(t,e){var r,i;var n,s;if(!t||!t.state||e>b||e<0){return t?$(t,w):w}i=t.state;if(!t.output||!t.input&&t.avail_in!==0||i.status===G&&e!==y){return $(t,t.avail_out===0?_:w)}i.strm=t;r=i.last_flush;i.last_flush=e;if(i.status===H){if(i.wrap===2){t.adler=0;it(i,31);it(i,139);it(i,8);if(!i.gzhead){it(i,0);it(i,0);it(i,0);it(i,0);it(i,0);it(i,i.level===9?2:i.strategy>=x||i.level<2?4:0);it(i,J);i.status=V}else{it(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(!i.gzhead.extra?0:4)+(!i.gzhead.name?0:8)+(!i.gzhead.comment?0:16));it(i,i.gzhead.time&255);it(i,i.gzhead.time>>8&255);it(i,i.gzhead.time>>16&255);it(i,i.gzhead.time>>24&255);it(i,i.level===9?2:i.strategy>=x||i.level<2?4:0);it(i,i.gzhead.os&255);if(i.gzhead.extra&&i.gzhead.extra.length){it(i,i.gzhead.extra.length&255);it(i,i.gzhead.extra.length>>8&255)}if(i.gzhead.hcrc){t.adler=f(t.adler,i.pending_buf,i.pending,0)}i.gzindex=0;i.status=N}}else{var o=T+(i.w_bits-8<<4)<<8;var a=-1;if(i.strategy>=x||i.level<2){a=0}else if(i.level<6){a=1}else if(i.level===6){a=2}else{a=3}o|=a<<6;if(i.strstart!==0){o|=W}o+=31-o%31;i.status=V;nt(i,o);if(i.strstart!==0){nt(i,t.adler>>>16);nt(i,t.adler&65535)}t.adler=1}}if(i.status===N){if(i.gzhead.extra){n=i.pending;while(i.gzindex<(i.gzhead.extra.length&65535)){if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}et(t);n=i.pending;if(i.pending===i.pending_buf_size){break}}it(i,i.gzhead.extra[i.gzindex]&255);i.gzindex++}if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(i.gzindex===i.gzhead.extra.length){i.gzindex=0;i.status=U}}else{i.status=U}}if(i.status===U){if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}et(t);n=i.pending;if(i.pending===i.pending_buf_size){s=1;break}}if(i.gzindex<i.gzhead.name.length){s=i.gzhead.name.charCodeAt(i.gzindex++)&255}else{s=0}it(i,s)}while(s!==0);if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(s===0){i.gzindex=0;i.status=z}}else{i.status=z}}if(i.status===z){if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}et(t);n=i.pending;if(i.pending===i.pending_buf_size){s=1;break}}if(i.gzindex<i.gzhead.comment.length){s=i.gzhead.comment.charCodeAt(i.gzindex++)&255}else{s=0}it(i,s)}while(s!==0);if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(s===0){i.status=Y}}else{i.status=Y}}if(i.status===Y){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size){et(t)}if(i.pending+2<=i.pending_buf_size){it(i,t.adler&255);it(i,t.adler>>8&255);t.adler=0;i.status=V}}else{i.status=V}}if(i.pending!==0){et(t);if(t.avail_out===0){i.last_flush=-1;return m}}else if(t.avail_in===0&&Q(e)<=Q(r)&&e!==y){return $(t,_)}if(i.status===G&&t.avail_in!==0){return $(t,_)}if(t.avail_in!==0||i.lookahead!==0||e!==d&&i.status!==G){var u=i.strategy===x?ct(i,e):i.strategy===C?ht(i,e):pt[i.level].func(i,e);if(u===X||u===q){i.status=G}if(u===Z||u===X){if(t.avail_out===0){i.last_flush=-1}return m}if(u===K){if(e===p){l._tr_align(i)}else if(e!==b){l._tr_stored_block(i,0,0,false);if(e===g){tt(i.head);if(i.lookahead===0){i.strstart=0;i.block_start=0;i.insert=0}}}et(t);if(t.avail_out===0){i.last_flush=-1;return m}}}if(e!==y){return m}if(i.wrap<=0){return v}if(i.wrap===2){it(i,t.adler&255);it(i,t.adler>>8&255);it(i,t.adler>>16&255);it(i,t.adler>>24&255);it(i,t.total_in&255);it(i,t.total_in>>8&255);it(i,t.total_in>>16&255);it(i,t.total_in>>24&255)}else{nt(i,t.adler>>>16);nt(i,t.adler&65535)}et(t);if(i.wrap>0){i.wrap=-i.wrap}return i.pending!==0?m:v}function Ct(t){var e;if(!t||!t.state){return w}e=t.state.status;if(e!==H&&e!==N&&e!==U&&e!==z&&e!==Y&&e!==V&&e!==G){return $(t,w)}t.state=null;return e===V?$(t,n):m}function kt(t,e){var r=e.length;var i;var n,s;var o;var a;var u;var l;var f;if(!t||!t.state){return w}i=t.state;o=i.wrap;if(o===2||o===1&&i.status!==H||i.lookahead){return w}if(o===1){t.adler=c(t.adler,e,r,0)}i.wrap=0;if(r>=i.w_size){if(o===0){tt(i.head);i.strstart=0;i.block_start=0;i.insert=0}f=new h.Buf8(i.w_size);h.arraySet(f,e,r-i.w_size,i.w_size,0);e=f;r=i.w_size}a=t.avail_in;u=t.next_in;l=t.input;t.avail_in=r;t.next_in=0;t.input=e;at(i);while(i.lookahead>=L){n=i.strstart;s=i.lookahead-(L-1);do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+L-1])&i.hash_mask;i.prev[n&i.w_mask]=i.head[i.ins_h];i.head[i.ins_h]=n;n++}while(--s);i.strstart=n;i.lookahead=L-1;at(i)}i.strstart+=i.lookahead;i.block_start=i.strstart;i.insert=i.lookahead;i.lookahead=0;i.match_length=i.prev_length=L-1;i.match_available=0;t.next_in=u;t.input=l;t.avail_in=a;i.wrap=o;return m}r.deflateInit=_t;r.deflateInit2=wt;r.deflateReset=mt;r.deflateResetKeep=bt;r.deflateSetHeader=vt;r.deflate=xt;r.deflateEnd=Ct;r.deflateSetDictionary=kt;r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":167,"./adler32":168,"./crc32":170,"./messages":175,"./trees":176}],172:[function(t,e,r){"use strict";var A=30;var R=12;e.exports=function t(e,r){var i;var n;var s;var o;var a;var u;var l;var f;var h;var c;var d;var p;var g;var y;var b;var m;var v;var w;var _;var x;var C;var k;var T;var S,E;i=e.state;n=e.next_in;S=e.input;s=n+(e.avail_in-5);o=e.next_out;E=e.output;a=o-(r-e.avail_out);u=o+(e.avail_out-257);l=i.dmax;f=i.wsize;h=i.whave;c=i.wnext;d=i.window;p=i.hold;g=i.bits;y=i.lencode;b=i.distcode;m=(1<<i.lenbits)-1;v=(1<<i.distbits)-1;t:do{if(g<15){p+=S[n++]<<g;g+=8;p+=S[n++]<<g;g+=8}w=y[p&m];e:for(;;){_=w>>>24;p>>>=_;g-=_;_=w>>>16&255;if(_===0){E[o++]=w&65535}else if(_&16){x=w&65535;_&=15;if(_){if(g<_){p+=S[n++]<<g;g+=8}x+=p&(1<<_)-1;p>>>=_;g-=_}if(g<15){p+=S[n++]<<g;g+=8;p+=S[n++]<<g;g+=8}w=b[p&v];r:for(;;){_=w>>>24;p>>>=_;g-=_;_=w>>>16&255;if(_&16){C=w&65535;_&=15;if(g<_){p+=S[n++]<<g;g+=8;if(g<_){p+=S[n++]<<g;g+=8}}C+=p&(1<<_)-1;if(C>l){e.msg="invalid distance too far back";i.mode=A;break t}p>>>=_;g-=_;_=o-a;if(C>_){_=C-_;if(_>h){if(i.sane){e.msg="invalid distance too far back";i.mode=A;break t}}k=0;T=d;if(c===0){k+=f-_;if(_<x){x-=_;do{E[o++]=d[k++]}while(--_);k=o-C;T=E}}else if(c<_){k+=f+c-_;_-=c;if(_<x){x-=_;do{E[o++]=d[k++]}while(--_);k=0;if(c<x){_=c;x-=_;do{E[o++]=d[k++]}while(--_);k=o-C;T=E}}}else{k+=c-_;if(_<x){x-=_;do{E[o++]=d[k++]}while(--_);k=o-C;T=E}}while(x>2){E[o++]=T[k++];E[o++]=T[k++];E[o++]=T[k++];x-=3}if(x){E[o++]=T[k++];if(x>1){E[o++]=T[k++]}}}else{k=o-C;do{E[o++]=E[k++];E[o++]=E[k++];E[o++]=E[k++];x-=3}while(x>2);if(x){E[o++]=E[k++];if(x>1){E[o++]=E[k++]}}}}else if((_&64)===0){w=b[(w&65535)+(p&(1<<_)-1)];continue r}else{e.msg="invalid distance code";i.mode=A;break t}break}}else if((_&64)===0){w=y[(w&65535)+(p&(1<<_)-1)];continue e}else if(_&32){i.mode=R;break t}else{e.msg="invalid literal/length code";i.mode=A;break t}break}}while(n<s&&o<u);x=g>>3;n-=x;g-=x<<3;p&=(1<<g)-1;e.next_in=n;e.next_out=o;e.avail_in=n<s?5+(s-n):5-(n-s);e.avail_out=o<u?257+(u-o):257-(o-u);i.hold=p;i.bits=g;return}},{}],173:[function(t,e,r){"use strict";var R=t("../utils/common");var B=t("./adler32");var O=t("./crc32");var P=t("./inffast");var I=t("./inftrees");var M=0;var j=1;var L=2;var D=4;var F=5;var W=6;var H=0;var N=1;var U=2;var z=-2;var Y=-3;var V=-4;var G=-5;var Z=8;var K=1;var X=2;var q=3;var J=4;var $=5;var Q=6;var tt=7;var et=8;var rt=9;var it=10;var nt=11;var st=12;var ot=13;var at=14;var ut=15;var lt=16;var ft=17;var ht=18;var ct=19;var dt=20;var pt=21;var gt=22;var yt=23;var bt=24;var mt=25;var vt=26;var wt=27;var _t=28;var xt=29;var Ct=30;var kt=31;var Tt=32;var i=852;var n=592;var s=15;var o=s;function St(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function a(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new R.Buf16(320);this.work=new R.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function u(t){var e;if(!t||!t.state){return z}e=t.state;t.total_in=t.total_out=e.total=0;t.msg="";if(e.wrap){t.adler=e.wrap&1}e.mode=K;e.last=0;e.havedict=0;e.dmax=32768;e.head=null;e.hold=0;e.bits=0;e.lencode=e.lendyn=new R.Buf32(i);e.distcode=e.distdyn=new R.Buf32(n);e.sane=1;e.back=-1;return H}function l(t){var e;if(!t||!t.state){return z}e=t.state;e.wsize=0;e.whave=0;e.wnext=0;return u(t)}function f(t,e){var r;var i;if(!t||!t.state){return z}i=t.state;if(e<0){r=0;e=-e}else{r=(e>>4)+1;if(e<48){e&=15}}if(e&&(e<8||e>15)){return z}if(i.window!==null&&i.wbits!==e){i.window=null}i.wrap=r;i.wbits=e;return l(t)}function h(t,e){var r;var i;if(!t){return z}i=new a;t.state=i;i.window=null;r=f(t,e);if(r!==H){t.state=null}return r}function c(t){return h(t,o)}var d=true;var p,g;function Et(t){if(d){var e;p=new R.Buf32(512);g=new R.Buf32(32);e=0;while(e<144){t.lens[e++]=8}while(e<256){t.lens[e++]=9}while(e<280){t.lens[e++]=7}while(e<288){t.lens[e++]=8}I(j,t.lens,0,288,p,0,t.work,{bits:9});e=0;while(e<32){t.lens[e++]=5}I(L,t.lens,0,32,g,0,t.work,{bits:5});d=false}t.lencode=p;t.lenbits=9;t.distcode=g;t.distbits=5}function At(t,e,r,i){var n;var s=t.state;if(s.window===null){s.wsize=1<<s.wbits;s.wnext=0;s.whave=0;s.window=new R.Buf8(s.wsize)}if(i>=s.wsize){R.arraySet(s.window,e,r-s.wsize,s.wsize,0);s.wnext=0;s.whave=s.wsize}else{n=s.wsize-s.wnext;if(n>i){n=i}R.arraySet(s.window,e,r-i,n,s.wnext);i-=n;if(i){R.arraySet(s.window,e,r-i,i,0);s.wnext=i;s.whave=s.wsize}else{s.wnext+=n;if(s.wnext===s.wsize){s.wnext=0}if(s.whave<s.wsize){s.whave+=n}}}return 0}function y(t,e){var r;var i,n;var s;var o;var a,u;var l;var f;var h,c;var d;var p;var g;var y=0;var b,m,v;var w,_,x;var C;var k;var T=new R.Buf8(4);var S;var E;var A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0){return z}r=t.state;if(r.mode===st){r.mode=ot}o=t.next_out;n=t.output;u=t.avail_out;s=t.next_in;i=t.input;a=t.avail_in;l=r.hold;f=r.bits;h=a;c=u;k=H;t:for(;;){switch(r.mode){case K:if(r.wrap===0){r.mode=ot;break}while(f<16){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(r.wrap&2&&l===35615){r.check=0;T[0]=l&255;T[1]=l>>>8&255;r.check=O(r.check,T,2,0);l=0;f=0;r.mode=X;break}r.flags=0;if(r.head){r.head.done=false}if(!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){t.msg="incorrect header check";r.mode=Ct;break}if((l&15)!==Z){t.msg="unknown compression method";r.mode=Ct;break}l>>>=4;f-=4;C=(l&15)+8;if(r.wbits===0){r.wbits=C}else if(C>r.wbits){t.msg="invalid window size";r.mode=Ct;break}r.dmax=1<<C;t.adler=r.check=1;r.mode=l&512?it:st;l=0;f=0;break;case X:while(f<16){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.flags=l;if((r.flags&255)!==Z){t.msg="unknown compression method";r.mode=Ct;break}if(r.flags&57344){t.msg="unknown header flags set";r.mode=Ct;break}if(r.head){r.head.text=l>>8&1}if(r.flags&512){T[0]=l&255;T[1]=l>>>8&255;r.check=O(r.check,T,2,0)}l=0;f=0;r.mode=q;case q:while(f<32){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(r.head){r.head.time=l}if(r.flags&512){T[0]=l&255;T[1]=l>>>8&255;T[2]=l>>>16&255;T[3]=l>>>24&255;r.check=O(r.check,T,4,0)}l=0;f=0;r.mode=J;case J:while(f<16){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(r.head){r.head.xflags=l&255;r.head.os=l>>8}if(r.flags&512){T[0]=l&255;T[1]=l>>>8&255;r.check=O(r.check,T,2,0)}l=0;f=0;r.mode=$;case $:if(r.flags&1024){while(f<16){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.length=l;if(r.head){r.head.extra_len=l}if(r.flags&512){T[0]=l&255;T[1]=l>>>8&255;r.check=O(r.check,T,2,0)}l=0;f=0}else if(r.head){r.head.extra=null}r.mode=Q;case Q:if(r.flags&1024){d=r.length;if(d>a){d=a}if(d){if(r.head){C=r.head.extra_len-r.length;if(!r.head.extra){r.head.extra=new Array(r.head.extra_len)}R.arraySet(r.head.extra,i,s,d,C)}if(r.flags&512){r.check=O(r.check,i,d,s)}a-=d;s+=d;r.length-=d}if(r.length){break t}}r.length=0;r.mode=tt;case tt:if(r.flags&2048){if(a===0){break t}d=0;do{C=i[s+d++];if(r.head&&C&&r.length<65536){r.head.name+=String.fromCharCode(C)}}while(C&&d<a);if(r.flags&512){r.check=O(r.check,i,d,s)}a-=d;s+=d;if(C){break t}}else if(r.head){r.head.name=null}r.length=0;r.mode=et;case et:if(r.flags&4096){if(a===0){break t}d=0;do{C=i[s+d++];if(r.head&&C&&r.length<65536){r.head.comment+=String.fromCharCode(C)}}while(C&&d<a);if(r.flags&512){r.check=O(r.check,i,d,s)}a-=d;s+=d;if(C){break t}}else if(r.head){r.head.comment=null}r.mode=rt;case rt:if(r.flags&512){while(f<16){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(l!==(r.check&65535)){t.msg="header crc mismatch";r.mode=Ct;break}l=0;f=0}if(r.head){r.head.hcrc=r.flags>>9&1;r.head.done=true}t.adler=r.check=0;r.mode=st;break;case it:while(f<32){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}t.adler=r.check=St(l);l=0;f=0;r.mode=nt;case nt:if(r.havedict===0){t.next_out=o;t.avail_out=u;t.next_in=s;t.avail_in=a;r.hold=l;r.bits=f;return U}t.adler=r.check=1;r.mode=st;case st:if(e===F||e===W){break t}case ot:if(r.last){l>>>=f&7;f-=f&7;r.mode=wt;break}while(f<3){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.last=l&1;l>>>=1;f-=1;switch(l&3){case 0:r.mode=at;break;case 1:Et(r);r.mode=dt;if(e===W){l>>>=2;f-=2;break t}break;case 2:r.mode=ft;break;case 3:t.msg="invalid block type";r.mode=Ct}l>>>=2;f-=2;break;case at:l>>>=f&7;f-=f&7;while(f<32){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if((l&65535)!==(l>>>16^65535)){t.msg="invalid stored block lengths";r.mode=Ct;break}r.length=l&65535;l=0;f=0;r.mode=ut;if(e===W){break t}case ut:r.mode=lt;case lt:d=r.length;if(d){if(d>a){d=a}if(d>u){d=u}if(d===0){break t}R.arraySet(n,i,s,d,o);a-=d;s+=d;u-=d;o+=d;r.length-=d;break}r.mode=st;break;case ft:while(f<14){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.nlen=(l&31)+257;l>>>=5;f-=5;r.ndist=(l&31)+1;l>>>=5;f-=5;r.ncode=(l&15)+4;l>>>=4;f-=4;if(r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols";r.mode=Ct;break}r.have=0;r.mode=ht;case ht:while(r.have<r.ncode){while(f<3){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.lens[A[r.have++]]=l&7;l>>>=3;f-=3}while(r.have<19){r.lens[A[r.have++]]=0}r.lencode=r.lendyn;r.lenbits=7;S={bits:r.lenbits};k=I(M,r.lens,0,19,r.lencode,0,r.work,S);r.lenbits=S.bits;if(k){t.msg="invalid code lengths set";r.mode=Ct;break}r.have=0;r.mode=ct;case ct:while(r.have<r.nlen+r.ndist){for(;;){y=r.lencode[l&(1<<r.lenbits)-1];b=y>>>24;m=y>>>16&255;v=y&65535;if(b<=f){break}if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(v<16){l>>>=b;f-=b;r.lens[r.have++]=v}else{if(v===16){E=b+2;while(f<E){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}l>>>=b;f-=b;if(r.have===0){t.msg="invalid bit length repeat";r.mode=Ct;break}C=r.lens[r.have-1];d=3+(l&3);l>>>=2;f-=2}else if(v===17){E=b+3;while(f<E){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}l>>>=b;f-=b;C=0;d=3+(l&7);l>>>=3;f-=3}else{E=b+7;while(f<E){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}l>>>=b;f-=b;C=0;d=11+(l&127);l>>>=7;f-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat";r.mode=Ct;break}while(d--){r.lens[r.have++]=C}}}if(r.mode===Ct){break}if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block";r.mode=Ct;break}r.lenbits=9;S={bits:r.lenbits};k=I(j,r.lens,0,r.nlen,r.lencode,0,r.work,S);r.lenbits=S.bits;if(k){t.msg="invalid literal/lengths set";r.mode=Ct;break}r.distbits=6;r.distcode=r.distdyn;S={bits:r.distbits};k=I(L,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S);r.distbits=S.bits;if(k){t.msg="invalid distances set";r.mode=Ct;break}r.mode=dt;if(e===W){break t}case dt:r.mode=pt;case pt:if(a>=6&&u>=258){t.next_out=o;t.avail_out=u;t.next_in=s;t.avail_in=a;r.hold=l;r.bits=f;P(t,c);o=t.next_out;n=t.output;u=t.avail_out;s=t.next_in;i=t.input;a=t.avail_in;l=r.hold;f=r.bits;if(r.mode===st){r.back=-1}break}r.back=0;for(;;){y=r.lencode[l&(1<<r.lenbits)-1];b=y>>>24;m=y>>>16&255;v=y&65535;if(b<=f){break}if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(m&&(m&240)===0){w=b;_=m;x=v;for(;;){y=r.lencode[x+((l&(1<<w+_)-1)>>w)];b=y>>>24;m=y>>>16&255;v=y&65535;if(w+b<=f){break}if(a===0){break t}a--;l+=i[s++]<<f;f+=8}l>>>=w;f-=w;r.back+=w}l>>>=b;f-=b;r.back+=b;r.length=v;if(m===0){r.mode=vt;break}if(m&32){r.back=-1;r.mode=st;break}if(m&64){t.msg="invalid literal/length code";r.mode=Ct;break}r.extra=m&15;r.mode=gt;case gt:if(r.extra){E=r.extra;while(f<E){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.length+=l&(1<<r.extra)-1;l>>>=r.extra;f-=r.extra;r.back+=r.extra}r.was=r.length;r.mode=yt;case yt:for(;;){y=r.distcode[l&(1<<r.distbits)-1];b=y>>>24;m=y>>>16&255;v=y&65535;if(b<=f){break}if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if((m&240)===0){w=b;_=m;x=v;for(;;){y=r.distcode[x+((l&(1<<w+_)-1)>>w)];b=y>>>24;m=y>>>16&255;v=y&65535;if(w+b<=f){break}if(a===0){break t}a--;l+=i[s++]<<f;f+=8}l>>>=w;f-=w;r.back+=w}l>>>=b;f-=b;r.back+=b;if(m&64){t.msg="invalid distance code";r.mode=Ct;break}r.offset=v;r.extra=m&15;r.mode=bt;case bt:if(r.extra){E=r.extra;while(f<E){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.offset+=l&(1<<r.extra)-1;l>>>=r.extra;f-=r.extra;r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back";r.mode=Ct;break}r.mode=mt;case mt:if(u===0){break t}d=c-u;if(r.offset>d){d=r.offset-d;if(d>r.whave){if(r.sane){t.msg="invalid distance too far back";r.mode=Ct;break}}if(d>r.wnext){d-=r.wnext;p=r.wsize-d}else{p=r.wnext-d}if(d>r.length){d=r.length}g=r.window}else{g=n;p=o-r.offset;d=r.length}if(d>u){d=u}u-=d;r.length-=d;do{n[o++]=g[p++]}while(--d);if(r.length===0){r.mode=pt}break;case vt:if(u===0){break t}n[o++]=r.length;u--;r.mode=pt;break;case wt:if(r.wrap){while(f<32){if(a===0){break t}a--;l|=i[s++]<<f;f+=8}c-=u;t.total_out+=c;r.total+=c;if(c){t.adler=r.check=r.flags?O(r.check,n,c,o-c):B(r.check,n,c,o-c)}c=u;if((r.flags?l:St(l))!==r.check){t.msg="incorrect data check";r.mode=Ct;break}l=0;f=0}r.mode=_t;case _t:if(r.wrap&&r.flags){while(f<32){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(l!==(r.total&4294967295)){t.msg="incorrect length check";r.mode=Ct;break}l=0;f=0}r.mode=xt;case xt:k=N;break t;case Ct:k=Y;break t;case kt:return V;case Tt:default:return z}}t.next_out=o;t.avail_out=u;t.next_in=s;t.avail_in=a;r.hold=l;r.bits=f;if(r.wsize||c!==t.avail_out&&r.mode<Ct&&(r.mode<wt||e!==D)){if(At(t,t.output,t.next_out,c-t.avail_out)){r.mode=kt;return V}}h-=t.avail_in;c-=t.avail_out;t.total_in+=h;t.total_out+=c;r.total+=c;if(r.wrap&&c){t.adler=r.check=r.flags?O(r.check,n,c,t.next_out-c):B(r.check,n,c,t.next_out-c)}t.data_type=r.bits+(r.last?64:0)+(r.mode===st?128:0)+(r.mode===dt||r.mode===ut?256:0);if((h===0&&c===0||e===D)&&k===H){k=G}return k}function b(t){if(!t||!t.state){return z}var e=t.state;if(e.window){e.window=null}t.state=null;return H}function m(t,e){var r;if(!t||!t.state){return z}r=t.state;if((r.wrap&2)===0){return z}r.head=e;e.done=false;return H}function v(t,e){var r=e.length;var i;var n;var s;if(!t||!t.state){return z}i=t.state;if(i.wrap!==0&&i.mode!==nt){return z}if(i.mode===nt){n=1;n=B(n,e,r,0);if(n!==i.check){return Y}}s=At(t,e,r,r);if(s){i.mode=kt;return V}i.havedict=1;return H}r.inflateReset=l;r.inflateReset2=f;r.inflateResetKeep=u;r.inflateInit=c;r.inflateInit2=h;r.inflate=y;r.inflateEnd=b;r.inflateGetHeader=m;r.inflateSetDictionary=v;r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":167,"./adler32":168,"./crc32":170,"./inffast":172,"./inftrees":174}],174:[function(t,e,r){"use strict";var j=t("../utils/common");var L=15;var D=852;var F=592;var W=0;var H=1;var N=2;var U=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0];var z=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78];var Y=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0];var V=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function t(e,r,i,n,s,o,a,u){var l=u.bits;var f=0;var h=0;var c=0,d=0;var p=0;var g=0;var y=0;var b=0;var m=0;var v=0;var w;var _;var x;var C;var k;var T=null;var S=0;var E;var A=new j.Buf16(L+1);var R=new j.Buf16(L+1);var B=null;var O=0;var P,I,M;for(f=0;f<=L;f++){A[f]=0}for(h=0;h<n;h++){A[r[i+h]]++}p=l;for(d=L;d>=1;d--){if(A[d]!==0){break}}if(p>d){p=d}if(d===0){s[o++]=1<<24|64<<16|0;s[o++]=1<<24|64<<16|0;u.bits=1;return 0}for(c=1;c<d;c++){if(A[c]!==0){break}}if(p<c){p=c}b=1;for(f=1;f<=L;f++){b<<=1;b-=A[f];if(b<0){return-1}}if(b>0&&(e===W||d!==1)){return-1}R[1]=0;for(f=1;f<L;f++){R[f+1]=R[f]+A[f]}for(h=0;h<n;h++){if(r[i+h]!==0){a[R[r[i+h]]++]=h}}if(e===W){T=B=a;E=19}else if(e===H){T=U;S-=257;B=z;O-=257;E=256}else{T=Y;B=V;E=-1}v=0;h=0;f=c;k=o;g=p;y=0;x=-1;m=1<<p;C=m-1;if(e===H&&m>D||e===N&&m>F){return 1}for(;;){P=f-y;if(a[h]<E){I=0;M=a[h]}else if(a[h]>E){I=B[O+a[h]];M=T[S+a[h]]}else{I=32+64;M=0}w=1<<f-y;_=1<<g;c=_;do{_-=w;s[k+(v>>y)+_]=P<<24|I<<16|M|0}while(_!==0);w=1<<f-1;while(v&w){w>>=1}if(w!==0){v&=w-1;v+=w}else{v=0}h++;if(--A[f]===0){if(f===d){break}f=r[i+a[h]]}if(f>p&&(v&C)!==x){if(y===0){y=p}k+=c;g=f-y;b=1<<g;while(g+y<d){b-=A[g+y];if(b<=0){break}g++;b<<=1}m+=1<<g;if(e===H&&m>D||e===N&&m>F){return 1}x=v&C;s[x]=p<<24|g<<16|k-o|0}}if(v!==0){s[k+v]=f-y<<24|64<<16|0}u.bits=p;return 0}},{"../utils/common":167}],175:[function(t,e,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],176:[function(t,e,r){"use strict";var n=t("../utils/common");var a=4;var i=0;var s=1;var u=2;function o(t){var e=t.length;while(--e>=0){t[e]=0}}var l=0;var f=1;var h=2;var c=3;var d=258;var p=29;var g=256;var y=g+1+p;var b=30;var m=19;var v=2*y+1;var w=15;var _=16;var x=7;var C=256;var k=16;var T=17;var S=18;var E=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var A=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var O=512;var P=new Array((y+2)*2);o(P);var I=new Array(b*2);o(I);var M=new Array(O);o(M);var j=new Array(d-c+1);o(j);var L=new Array(p);o(L);var D=new Array(b);o(D);function F(t,e,r,i,n){this.static_tree=t;this.extra_bits=e;this.extra_base=r;this.elems=i;this.max_length=n;this.has_stree=t&&t.length}var W;var H;var N;function U(t,e){this.dyn_tree=t;this.max_code=0;this.stat_desc=e}function z(t){return t<256?M[t]:M[256+(t>>>7)]}function Y(t,e){t.pending_buf[t.pending++]=e&255;t.pending_buf[t.pending++]=e>>>8&255}function V(t,e,r){if(t.bi_valid>_-r){t.bi_buf|=e<<t.bi_valid&65535;Y(t,t.bi_buf);t.bi_buf=e>>_-t.bi_valid;t.bi_valid+=r-_}else{t.bi_buf|=e<<t.bi_valid&65535;t.bi_valid+=r}}function G(t,e,r){V(t,r[e*2],r[e*2+1])}function Z(t,e){var r=0;do{r|=t&1;t>>>=1;r<<=1}while(--e>0);return r>>>1}function K(t){if(t.bi_valid===16){Y(t,t.bi_buf);t.bi_buf=0;t.bi_valid=0}else if(t.bi_valid>=8){t.pending_buf[t.pending++]=t.bi_buf&255;t.bi_buf>>=8;t.bi_valid-=8}}function X(t,e){var r=e.dyn_tree;var i=e.max_code;var n=e.stat_desc.static_tree;var s=e.stat_desc.has_stree;var o=e.stat_desc.extra_bits;var a=e.stat_desc.extra_base;var u=e.stat_desc.max_length;var l;var f,h;var c;var d;var p;var g=0;for(c=0;c<=w;c++){t.bl_count[c]=0}r[t.heap[t.heap_max]*2+1]=0;for(l=t.heap_max+1;l<v;l++){f=t.heap[l];c=r[r[f*2+1]*2+1]+1;if(c>u){c=u;g++}r[f*2+1]=c;if(f>i){continue}t.bl_count[c]++;d=0;if(f>=a){d=o[f-a]}p=r[f*2];t.opt_len+=p*(c+d);if(s){t.static_len+=p*(n[f*2+1]+d)}}if(g===0){return}do{c=u-1;while(t.bl_count[c]===0){c--}t.bl_count[c]--;t.bl_count[c+1]+=2;t.bl_count[u]--;g-=2}while(g>0);for(c=u;c!==0;c--){f=t.bl_count[c];while(f!==0){h=t.heap[--l];if(h>i){continue}if(r[h*2+1]!==c){t.opt_len+=(c-r[h*2+1])*r[h*2];r[h*2+1]=c}f--}}}function q(t,e,r){var i=new Array(w+1);var n=0;var s;var o;for(s=1;s<=w;s++){i[s]=n=n+r[s-1]<<1}for(o=0;o<=e;o++){var a=t[o*2+1];if(a===0){continue}t[o*2]=Z(i[a]++,a)}}function J(){var t;var e;var r;var i;var n;var s=new Array(w+1);r=0;for(i=0;i<p-1;i++){L[i]=r;for(t=0;t<1<<E[i];t++){j[r++]=i}}j[r-1]=i;n=0;for(i=0;i<16;i++){D[i]=n;for(t=0;t<1<<A[i];t++){M[n++]=i}}n>>=7;for(;i<b;i++){D[i]=n<<7;for(t=0;t<1<<A[i]-7;t++){M[256+n++]=i}}for(e=0;e<=w;e++){s[e]=0}t=0;while(t<=143){P[t*2+1]=8;t++;s[8]++}while(t<=255){P[t*2+1]=9;t++;s[9]++}while(t<=279){P[t*2+1]=7;t++;s[7]++}while(t<=287){P[t*2+1]=8;t++;s[8]++}q(P,y+1,s);for(t=0;t<b;t++){I[t*2+1]=5;I[t*2]=Z(t,5)}W=new F(P,E,g+1,y,w);H=new F(I,A,0,b,w);N=new F(new Array(0),R,0,m,x)}function $(t){var e;for(e=0;e<y;e++){t.dyn_ltree[e*2]=0}for(e=0;e<b;e++){t.dyn_dtree[e*2]=0}for(e=0;e<m;e++){t.bl_tree[e*2]=0}t.dyn_ltree[C*2]=1;t.opt_len=t.static_len=0;t.last_lit=t.matches=0}function Q(t){if(t.bi_valid>8){Y(t,t.bi_buf)}else if(t.bi_valid>0){t.pending_buf[t.pending++]=t.bi_buf}t.bi_buf=0;t.bi_valid=0}function tt(t,e,r,i){Q(t);if(i){Y(t,r);Y(t,~r)}n.arraySet(t.pending_buf,t.window,e,r,t.pending);t.pending+=r}function et(t,e,r,i){var n=e*2;var s=r*2;return t[n]<t[s]||t[n]===t[s]&&i[e]<=i[r]}function rt(t,e,r){var i=t.heap[r];var n=r<<1;while(n<=t.heap_len){if(n<t.heap_len&&et(e,t.heap[n+1],t.heap[n],t.depth)){n++}if(et(e,i,t.heap[n],t.depth)){break}t.heap[r]=t.heap[n];r=n;n<<=1}t.heap[r]=i}function it(t,e,r){var i;var n;var s=0;var o;var a;if(t.last_lit!==0){do{i=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1];n=t.pending_buf[t.l_buf+s];s++;if(i===0){G(t,n,e)}else{o=j[n];G(t,o+g+1,e);a=E[o];if(a!==0){n-=L[o];V(t,n,a)}i--;o=z(i);G(t,o,r);a=A[o];if(a!==0){i-=D[o];V(t,i,a)}}}while(s<t.last_lit)}G(t,C,e)}function nt(t,e){var r=e.dyn_tree;var i=e.stat_desc.static_tree;var n=e.stat_desc.has_stree;var s=e.stat_desc.elems;var o,a;var u=-1;var l;t.heap_len=0;t.heap_max=v;for(o=0;o<s;o++){if(r[o*2]!==0){t.heap[++t.heap_len]=u=o;t.depth[o]=0}else{r[o*2+1]=0}}while(t.heap_len<2){l=t.heap[++t.heap_len]=u<2?++u:0;r[l*2]=1;t.depth[l]=0;t.opt_len--;if(n){t.static_len-=i[l*2+1]}}e.max_code=u;for(o=t.heap_len>>1;o>=1;o--){rt(t,r,o)}l=s;do{o=t.heap[1];t.heap[1]=t.heap[t.heap_len--];rt(t,r,1);a=t.heap[1];t.heap[--t.heap_max]=o;t.heap[--t.heap_max]=a;r[l*2]=r[o*2]+r[a*2];t.depth[l]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1;r[o*2+1]=r[a*2+1]=l;t.heap[1]=l++;rt(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1];X(t,e);q(r,u,t.bl_count)}function st(t,e,r){var i;var n=-1;var s;var o=e[0*2+1];var a=0;var u=7;var l=4;if(o===0){u=138;l=3}e[(r+1)*2+1]=65535;for(i=0;i<=r;i++){s=o;o=e[(i+1)*2+1];if(++a<u&&s===o){continue}else if(a<l){t.bl_tree[s*2]+=a}else if(s!==0){if(s!==n){t.bl_tree[s*2]++}t.bl_tree[k*2]++}else if(a<=10){t.bl_tree[T*2]++}else{t.bl_tree[S*2]++}a=0;n=s;if(o===0){u=138;l=3}else if(s===o){u=6;l=3}else{u=7;l=4}}}function ot(t,e,r){var i;var n=-1;var s;var o=e[0*2+1];var a=0;var u=7;var l=4;if(o===0){u=138;l=3}for(i=0;i<=r;i++){s=o;o=e[(i+1)*2+1];if(++a<u&&s===o){continue}else if(a<l){do{G(t,s,t.bl_tree)}while(--a!==0)}else if(s!==0){if(s!==n){G(t,s,t.bl_tree);a--}G(t,k,t.bl_tree);V(t,a-3,2)}else if(a<=10){G(t,T,t.bl_tree);V(t,a-3,3)}else{G(t,S,t.bl_tree);V(t,a-11,7)}a=0;n=s;if(o===0){u=138;l=3}else if(s===o){u=6;l=3}else{u=7;l=4}}}function at(t){var e;st(t,t.dyn_ltree,t.l_desc.max_code);st(t,t.dyn_dtree,t.d_desc.max_code);nt(t,t.bl_desc);for(e=m-1;e>=3;e--){if(t.bl_tree[B[e]*2+1]!==0){break}}t.opt_len+=3*(e+1)+5+5+4;return e}function ut(t,e,r,i){var n;V(t,e-257,5);V(t,r-1,5);V(t,i-4,4);for(n=0;n<i;n++){V(t,t.bl_tree[B[n]*2+1],3)}ot(t,t.dyn_ltree,e-1);ot(t,t.dyn_dtree,r-1)}function lt(t){var e=4093624447;var r;for(r=0;r<=31;r++,e>>>=1){if(e&1&&t.dyn_ltree[r*2]!==0){return i}}if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0){return s}for(r=32;r<g;r++){if(t.dyn_ltree[r*2]!==0){return s}}return i}var ft=false;function ht(t){if(!ft){J();ft=true}t.l_desc=new U(t.dyn_ltree,W);t.d_desc=new U(t.dyn_dtree,H);t.bl_desc=new U(t.bl_tree,N);t.bi_buf=0;t.bi_valid=0;$(t)}function ct(t,e,r,i){V(t,(l<<1)+(i?1:0),3);tt(t,e,r,true)}function dt(t){V(t,f<<1,3);G(t,C,P);K(t)}function pt(t,e,r,i){var n,s;var o=0;if(t.level>0){if(t.strm.data_type===u){t.strm.data_type=lt(t)}nt(t,t.l_desc);nt(t,t.d_desc);o=at(t);n=t.opt_len+3+7>>>3;s=t.static_len+3+7>>>3;if(s<=n){n=s}}else{n=s=r+5}if(r+4<=n&&e!==-1){ct(t,e,r,i)}else if(t.strategy===a||s===n){V(t,(f<<1)+(i?1:0),3);it(t,P,I)}else{V(t,(h<<1)+(i?1:0),3);ut(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1);it(t,t.dyn_ltree,t.dyn_dtree)}$(t);if(i){Q(t)}}function gt(t,e,r){t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255;t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255;t.pending_buf[t.l_buf+t.last_lit]=r&255;t.last_lit++;if(e===0){t.dyn_ltree[r*2]++}else{t.matches++;e--;t.dyn_ltree[(j[r]+g+1)*2]++;t.dyn_dtree[z(e)*2]++}return t.last_lit===t.lit_bufsize-1}r._tr_init=ht;r._tr_stored_block=ct;r._tr_flush_block=pt;r._tr_tally=gt;r._tr_align=dt},{"../utils/common":167}],177:[function(t,e,r){"use strict";function i(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}e.exports=i},{}],178:[function(t,e,r){(function(a){(function(){"use strict";function g(t){if(typeof t!=="string"){throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}}function o(t,e){var r="";var i=0;var n=-1;var s=0;var o;for(var a=0;a<=t.length;++a){if(a<t.length)o=t.charCodeAt(a);else if(o===47)break;else o=47;if(o===47){if(n===a-1||s===1){}else if(n!==a-1&&s===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var u=r.lastIndexOf("/");if(u!==r.length-1){if(u===-1){r="";i=0}else{r=r.slice(0,u);i=r.length-1-r.lastIndexOf("/")}n=a;s=0;continue}}else if(r.length===2||r.length===1){r="";i=0;n=a;s=0;continue}}if(e){if(r.length>0)r+="/..";else r="..";i=2}}else{if(r.length>0)r+="/"+t.slice(n+1,a);else r=t.slice(n+1,a);i=a-n-1}n=a;s=0}else if(o===46&&s!==-1){++s}else{s=-1}}return r}function r(t,e){var r=e.dir||e.root;var i=e.base||(e.name||"")+(e.ext||"");if(!r){return i}if(r===e.root){return r+i}return r+t+i}var y={resolve:function t(){var e="";var r=false;var i;for(var n=arguments.length-1;n>=-1&&!r;n--){var s;if(n>=0)s=arguments[n];else{if(i===undefined)i=a.cwd();s=i}g(s);if(s.length===0){continue}e=s+"/"+e;r=s.charCodeAt(0)===47}e=o(e,!r);if(r){if(e.length>0)return"/"+e;else return"/"}else if(e.length>0){return e}else{return"."}},normalize:function t(e){g(e);if(e.length===0)return".";var r=e.charCodeAt(0)===47;var i=e.charCodeAt(e.length-1)===47;e=o(e,!r);if(e.length===0&&!r)e=".";if(e.length>0&&i)e+="/";if(r)return"/"+e;return e},isAbsolute:function t(e){g(e);return e.length>0&&e.charCodeAt(0)===47},join:function t(){if(arguments.length===0)return".";var e;for(var r=0;r<arguments.length;++r){var i=arguments[r];g(i);if(i.length>0){if(e===undefined)e=i;else e+="/"+i}}if(e===undefined)return".";return y.normalize(e)},relative:function t(e,r){g(e);g(r);if(e===r)return"";e=y.resolve(e);r=y.resolve(r);if(e===r)return"";var i=1;for(;i<e.length;++i){if(e.charCodeAt(i)!==47)break}var n=e.length;var s=n-i;var o=1;for(;o<r.length;++o){if(r.charCodeAt(o)!==47)break}var a=r.length;var u=a-o;var l=s<u?s:u;var f=-1;var h=0;for(;h<=l;++h){if(h===l){if(u>l){if(r.charCodeAt(o+h)===47){return r.slice(o+h+1)}else if(h===0){return r.slice(o+h)}}else if(s>l){if(e.charCodeAt(i+h)===47){f=h}else if(h===0){f=0}}break}var c=e.charCodeAt(i+h);var d=r.charCodeAt(o+h);if(c!==d)break;else if(c===47)f=h}var p="";for(h=i+f+1;h<=n;++h){if(h===n||e.charCodeAt(h)===47){if(p.length===0)p+="..";else p+="/.."}}if(p.length>0)return p+r.slice(o+f);else{o+=f;if(r.charCodeAt(o)===47)++o;return r.slice(o)}},_makeLong:function t(e){return e},dirname:function t(e){g(e);if(e.length===0)return".";var r=e.charCodeAt(0);var i=r===47;var n=-1;var s=true;for(var o=e.length-1;o>=1;--o){r=e.charCodeAt(o);if(r===47){if(!s){n=o;break}}else{s=false}}if(n===-1)return i?"/":".";if(i&&n===1)return"//";return e.slice(0,n)},basename:function t(e,r){if(r!==undefined&&typeof r!=="string")throw new TypeError('"ext" argument must be a string');g(e);var i=0;var n=-1;var s=true;var o;if(r!==undefined&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1;var u=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!s){i=o+1;break}}else{if(u===-1){s=false;u=o+1}if(a>=0){if(l===r.charCodeAt(a)){if(--a===-1){n=o}}else{a=-1;n=u}}}}if(i===n)n=u;else if(n===-1)n=e.length;return e.slice(i,n)}else{for(o=e.length-1;o>=0;--o){if(e.charCodeAt(o)===47){if(!s){i=o+1;break}}else if(n===-1){s=false;n=o+1}}if(n===-1)return"";return e.slice(i,n)}},extname:function t(e){g(e);var r=-1;var i=0;var n=-1;var s=true;var o=0;for(var a=e.length-1;a>=0;--a){var u=e.charCodeAt(a);if(u===47){if(!s){i=a+1;break}continue}if(n===-1){s=false;n=a+1}if(u===46){if(r===-1)r=a;else if(o!==1)o=1}else if(r!==-1){o=-1}}if(r===-1||n===-1||o===0||o===1&&r===n-1&&r===i+1){return""}return e.slice(r,n)},format:function t(e){if(e===null||typeof e!=="object"){throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e)}return r("/",e)},parse:function t(e){g(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0);var n=i===47;var s;if(n){r.root="/";s=1}else{s=0}var o=-1;var a=0;var u=-1;var l=true;var f=e.length-1;var h=0;for(;f>=s;--f){i=e.charCodeAt(f);if(i===47){if(!l){a=f+1;break}continue}if(u===-1){l=false;u=f+1}if(i===46){if(o===-1)o=f;else if(h!==1)h=1}else if(o!==-1){h=-1}}if(o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1){if(u!==-1){if(a===0&&n)r.base=r.name=e.slice(1,u);else r.base=r.name=e.slice(a,u)}}else{if(a===0&&n){r.name=e.slice(1,o);r.base=e.slice(1,u)}else{r.name=e.slice(a,o);r.base=e.slice(a,u)}r.ext=e.slice(o,u)}if(a>0)r.dir=e.slice(0,a-1);else if(n)r.dir="/";return r},sep:"/",delimiter:":",win32:null,posix:null};y.posix=y;e.exports=y}).call(this)}).call(this,t("_process"))},{_process:179}],179:[function(t,e,r){var i=e.exports={};var n;var s;function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){n=setTimeout}else{n=o}}catch(t){n=o}try{if(typeof clearTimeout==="function"){s=clearTimeout}else{s=a}}catch(t){s=a}})();function u(e){if(n===setTimeout){return setTimeout(e,0)}if((n===o||!n)&&setTimeout){n=setTimeout;return setTimeout(e,0)}try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function l(e){if(s===clearTimeout){return clearTimeout(e)}if((s===a||!s)&&clearTimeout){s=clearTimeout;return clearTimeout(e)}try{return s(e)}catch(t){try{return s.call(null,e)}catch(t){return s.call(this,e)}}}var f=[];var h=false;var c;var d=-1;function p(){if(!h||!c){return}h=false;if(c.length){f=c.concat(f)}else{d=-1}if(f.length){g()}}function g(){if(h){return}var t=u(p);h=true;var e=f.length;while(e){c=f;f=[];while(++d<e){if(c){c[d].run()}}d=-1;e=f.length}c=null;h=false;l(t)}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1){for(var r=1;r<arguments.length;r++){e[r-1]=arguments[r]}}f.push(new y(t,e));if(f.length===1&&!h){u(g)}};function y(t,e){this.fun=t;this.array=e}y.prototype.run=function(){this.fun.apply(null,this.array)};i.title="browser";i.browser=true;i.env={};i.argv=[];i.version="";i.versions={};function b(){}i.on=b;i.addListener=b;i.once=b;i.off=b;i.removeListener=b;i.removeAllListeners=b;i.emit=b;i.prependListener=b;i.prependOnceListener=b;i.listeners=function(t){return[]};i.binding=function(t){throw new Error("process.binding is not supported")};i.cwd=function(){return"/"};i.chdir=function(t){throw new Error("process.chdir is not supported")};i.umask=function(){return 0}},{}],180:[function(t,e,r){var i=t("buffer");var n=i.Buffer;function s(t,e){for(var r in t){e[r]=t[r]}}if(n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow){e.exports=i}else{s(i,r);r.Buffer=o}function o(t,e,r){return n(t,e,r)}o.prototype=Object.create(n.prototype);s(n,o);o.from=function(t,e,r){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return n(t,e,r)};o.alloc=function(t,e,r){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var i=n(t);if(e!==undefined){if(typeof r==="string"){i.fill(e,r)}else{i.fill(e)}}else{i.fill(0)}return i};o.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return n(t)};o.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return i.SlowBuffer(t)}},{buffer:147}],181:[function(t,e,r){e.exports=n;var f=t("events").EventEmitter;var i=t("inherits");i(n,f);n.Readable=t("readable-stream/lib/_stream_readable.js");n.Writable=t("readable-stream/lib/_stream_writable.js");n.Duplex=t("readable-stream/lib/_stream_duplex.js");n.Transform=t("readable-stream/lib/_stream_transform.js");n.PassThrough=t("readable-stream/lib/_stream_passthrough.js");n.finished=t("readable-stream/lib/internal/streams/end-of-stream.js");n.pipeline=t("readable-stream/lib/internal/streams/pipeline.js");n.Stream=n;function n(){f.call(this)}n.prototype.pipe=function(e,t){var r=this;function i(t){if(e.writable){if(false===e.write(t)&&r.pause){r.pause()}}}r.on("data",i);function n(){if(r.readable&&r.resume){r.resume()}}e.on("drain",n);if(!e._isStdio&&(!t||t.end!==false)){r.on("end",o);r.on("close",a)}var s=false;function o(){if(s)return;s=true;e.end()}function a(){if(s)return;s=true;if(typeof e.destroy==="function")e.destroy()}function u(t){l();if(f.listenerCount(this,"error")===0){throw t}}r.on("error",u);e.on("error",u);function l(){r.removeListener("data",i);e.removeListener("drain",n);r.removeListener("end",o);r.removeListener("close",a);r.removeListener("error",u);e.removeListener("error",u);r.removeListener("end",l);r.removeListener("close",l);e.removeListener("close",l)}r.on("end",l);r.on("close",l);e.on("close",l);e.emit("pipe",r);return e}},{events:151,inherits:160,"readable-stream/lib/_stream_duplex.js":183,"readable-stream/lib/_stream_passthrough.js":184,"readable-stream/lib/_stream_readable.js":185,"readable-stream/lib/_stream_transform.js":186,"readable-stream/lib/_stream_writable.js":187,"readable-stream/lib/internal/streams/end-of-stream.js":191,"readable-stream/lib/internal/streams/pipeline.js":193}],182:[function(t,e,r){"use strict";function s(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;t.__proto__=e}var o={};function i(t,i,e){if(!e){e=Error}function n(t,e,r){if(typeof i==="string"){return i}else{return i(t,e,r)}}var r=function(i){s(t,i);function t(t,e,r){return i.call(this,n(t,e,r))||this}return t}(e);r.prototype.name=e.name;r.prototype.code=t;o[t]=r}function a(t,e){if(Array.isArray(t)){var r=t.length;t=t.map(function(t){return String(t)});if(r>2){return"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]}else if(r===2){return"one of ".concat(e," ").concat(t[0]," or ").concat(t[1])}else{return"of ".concat(e," ").concat(t[0])}}else{return"of ".concat(e," ").concat(String(t))}}function u(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function l(t,e,r){if(r===undefined||r>t.length){r=t.length}return t.substring(r-e.length,r)===e}function f(t,e,r){if(typeof r!=="number"){r=0}if(r+e.length>t.length){return false}else{return t.indexOf(e,r)!==-1}}i("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);i("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;if(typeof e==="string"&&u(e,"not ")){i="must not be";e=e.replace(/^not /,"")}else{i="must be"}var n;if(l(t," argument")){n="The ".concat(t," ").concat(i," ").concat(a(e,"type"))}else{var s=f(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(a(e,"type"))}n+=". Received type ".concat(typeof r);return n},TypeError);i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");i("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});i("ERR_STREAM_PREMATURE_CLOSE","Premature close");i("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});i("ERR_MULTIPLE_CALLBACK","Callback called multiple times");i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");i("ERR_STREAM_WRITE_AFTER_END","write after end");i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);i("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.codes=o},{}],183:[function(f,h,t){(function(l){(function(){"use strict";var t=Object.keys||function(t){var e=[];for(var r in t){e.push(r)}return e};h.exports=o;var e=f("./_stream_readable");var r=f("./_stream_writable");f("inherits")(o,e);{var i=t(r.prototype);for(var n=0;n<i.length;n++){var s=i[n];if(!o.prototype[s])o.prototype[s]=r.prototype[s]}}function o(t){if(!(this instanceof o))return new o(t);e.call(this,t);r.call(this,t);this.allowHalfOpen=true;if(t){if(t.readable===false)this.readable=false;if(t.writable===false)this.writable=false;if(t.allowHalfOpen===false){this.allowHalfOpen=false;this.once("end",a)}}}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:false,get:function t(){return this._writableState.highWaterMark}});Object.defineProperty(o.prototype,"writableBuffer",{enumerable:false,get:function t(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(o.prototype,"writableLength",{enumerable:false,get:function t(){return this._writableState.length}});function a(){if(this._writableState.ended)return;l.nextTick(u,this)}function u(t){t.end()}Object.defineProperty(o.prototype,"destroyed",{enumerable:false,get:function t(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function t(e){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=e;this._writableState.destroyed=e}})}).call(this)}).call(this,f("_process"))},{"./_stream_readable":185,"./_stream_writable":187,_process:179,inherits:160}],184:[function(t,e,r){"use strict";e.exports=n;var i=t("./_stream_transform");t("inherits")(n,i);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}n.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":186,inherits:160}],185:[function(q,J,t){(function(K,X){(function(){"use strict";J.exports=S;var i;S.ReadableState=T;var t=q("events").EventEmitter;var y=function t(e,r){return e.listeners(r).length};var n=q("./internal/streams/stream");var a=q("buffer").Buffer;var e=X.Uint8Array||function(){};function u(t){return a.from(t)}function s(t){return a.isBuffer(t)||t instanceof e}var r=q("util");var b;if(r&&r.debuglog){b=r.debuglog("stream")}else{b=function t(){}}var o=q("./internal/streams/buffer_list");var l=q("./internal/streams/destroy");var f=q("./internal/streams/state"),h=f.getHighWaterMark;var c=q("../errors").codes,d=c.ERR_INVALID_ARG_TYPE,p=c.ERR_STREAM_PUSH_AFTER_EOF,g=c.ERR_METHOD_NOT_IMPLEMENTED,m=c.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var v;var w;var _;q("inherits")(S,n);var x=l.errorOrDestroy;var C=["error","close","destroy","pause","resume"];function k(t,e,r){if(typeof t.prependListener==="function")return t.prependListener(e,r);if(!t._events||!t._events[e])t.on(e,r);else if(Array.isArray(t._events[e]))t._events[e].unshift(r);else t._events[e]=[r,t._events[e]]}function T(t,e,r){i=i||q("./_stream_duplex");t=t||{};if(typeof r!=="boolean")r=e instanceof i;this.objectMode=!!t.objectMode;if(r)this.objectMode=this.objectMode||!!t.readableObjectMode;this.highWaterMark=h(this,t,"readableHighWaterMark",r);this.buffer=new o;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.destroyed=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!v)v=q("string_decoder/").StringDecoder;this.decoder=new v(t.encoding);this.encoding=t.encoding}}function S(t){i=i||q("./_stream_duplex");if(!(this instanceof S))return new S(t);var e=this instanceof i;this._readableState=new T(t,this,e);this.readable=true;if(t){if(typeof t.read==="function")this._read=t.read;if(typeof t.destroy==="function")this._destroy=t.destroy}n.call(this)}Object.defineProperty(S.prototype,"destroyed",{enumerable:false,get:function t(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function t(e){if(!this._readableState){return}this._readableState.destroyed=e}});S.prototype.destroy=l.destroy;S.prototype._undestroy=l.undestroy;S.prototype._destroy=function(t,e){e(t)};S.prototype.push=function(t,e){var r=this._readableState;var i;if(!r.objectMode){if(typeof t==="string"){e=e||r.defaultEncoding;if(e!==r.encoding){t=a.from(t,e);e=""}i=true}}else{i=true}return E(this,t,e,false,i)};S.prototype.unshift=function(t){return E(this,t,null,true,false)};function E(t,e,r,i,n){b("readableAddChunk",e);var s=t._readableState;if(e===null){s.reading=false;I(t,s)}else{var o;if(!n)o=R(s,e);if(o){x(t,o)}else if(s.objectMode||e&&e.length>0){if(typeof e!=="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==a.prototype){e=u(e)}if(i){if(s.endEmitted)x(t,new m);else A(t,s,e,true)}else if(s.ended){x(t,new p)}else if(s.destroyed){return false}else{s.reading=false;if(s.decoder&&!r){e=s.decoder.write(e);if(s.objectMode||e.length!==0)A(t,s,e,false);else L(t,s)}else{A(t,s,e,false)}}}else if(!i){s.reading=false;L(t,s)}}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function A(t,e,r,i){if(e.flowing&&e.length===0&&!e.sync){e.awaitDrain=0;t.emit("data",r)}else{e.length+=e.objectMode?1:r.length;if(i)e.buffer.unshift(r);else e.buffer.push(r);if(e.needReadable)M(t)}L(t,e)}function R(t,e){var r;if(!s(e)&&typeof e!=="string"&&e!==undefined&&!t.objectMode){r=new d("chunk",["string","Buffer","Uint8Array"],e)}return r}S.prototype.isPaused=function(){return this._readableState.flowing===false};S.prototype.setEncoding=function(t){if(!v)v=q("string_decoder/").StringDecoder;var e=new v(t);this._readableState.decoder=e;this._readableState.encoding=this._readableState.decoder.encoding;var r=this._readableState.buffer.head;var i="";while(r!==null){i+=e.write(r.data);r=r.next}this._readableState.buffer.clear();if(i!=="")this._readableState.buffer.push(i);this._readableState.length=i.length;return this};var B=1073741824;function O(t){if(t>=B){t=B}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function P(t,e){if(t<=0||e.length===0&&e.ended)return 0;if(e.objectMode)return 1;if(t!==t){if(e.flowing&&e.length)return e.buffer.head.data.length;else return e.length}if(t>e.highWaterMark)e.highWaterMark=O(t);if(t<=e.length)return t;if(!e.ended){e.needReadable=true;return 0}return e.length}S.prototype.read=function(t){b("read",t);t=parseInt(t,10);var e=this._readableState;var r=t;if(t!==0)e.emittedReadable=false;if(t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended)){b("read: emitReadable",e.length,e.ended);if(e.length===0&&e.ended)V(this);else M(this);return null}t=P(t,e);if(t===0&&e.ended){if(e.length===0)V(this);return null}var i=e.needReadable;b("need readable",i);if(e.length===0||e.length-t<e.highWaterMark){i=true;b("length less than watermark",i)}if(e.ended||e.reading){i=false;b("reading or ended",i)}else if(i){b("do read");e.reading=true;e.sync=true;if(e.length===0)e.needReadable=true;this._read(e.highWaterMark);e.sync=false;if(!e.reading)t=P(r,e)}var n;if(t>0)n=Y(t,e);else n=null;if(n===null){e.needReadable=e.length<=e.highWaterMark;t=0}else{e.length-=t;e.awaitDrain=0}if(e.length===0){if(!e.ended)e.needReadable=true;if(r!==t&&e.ended)V(this)}if(n!==null)this.emit("data",n);return n};function I(t,e){b("onEofChunk");if(e.ended)return;if(e.decoder){var r=e.decoder.end();if(r&&r.length){e.buffer.push(r);e.length+=e.objectMode?1:r.length}}e.ended=true;if(e.sync){M(t)}else{e.needReadable=false;if(!e.emittedReadable){e.emittedReadable=true;j(t)}}}function M(t){var e=t._readableState;b("emitReadable",e.needReadable,e.emittedReadable);e.needReadable=false;if(!e.emittedReadable){b("emitReadable",e.flowing);e.emittedReadable=true;K.nextTick(j,t)}}function j(t){var e=t._readableState;b("emitReadable_",e.destroyed,e.length,e.ended);if(!e.destroyed&&(e.length||e.ended)){t.emit("readable");e.emittedReadable=false}e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark;z(t)}function L(t,e){if(!e.readingMore){e.readingMore=true;K.nextTick(D,t,e)}}function D(t,e){while(!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0)){var r=e.length;b("maybeReadMore read 0");t.read(0);if(r===e.length)break}e.readingMore=false}S.prototype._read=function(t){x(this,new g("_read()"))};S.prototype.pipe=function(r,t){var i=this;var n=this._readableState;switch(n.pipesCount){case 0:n.pipes=r;break;case 1:n.pipes=[n.pipes,r];break;default:n.pipes.push(r);break}n.pipesCount+=1;b("pipe count=%d opts=%j",n.pipesCount,t);var e=(!t||t.end!==false)&&r!==K.stdout&&r!==K.stderr;var s=e?a:g;if(n.endEmitted)K.nextTick(s);else i.once("end",s);r.on("unpipe",o);function o(t,e){b("onunpipe");if(t===i){if(e&&e.hasUnpiped===false){e.hasUnpiped=true;f()}}}function a(){b("onend");r.end()}var u=F(i);r.on("drain",u);var l=false;function f(){b("cleanup");r.removeListener("close",d);r.removeListener("finish",p);r.removeListener("drain",u);r.removeListener("error",c);r.removeListener("unpipe",o);i.removeListener("end",a);i.removeListener("end",g);i.removeListener("data",h);l=true;if(n.awaitDrain&&(!r._writableState||r._writableState.needDrain))u()}i.on("data",h);function h(t){b("ondata");var e=r.write(t);b("dest.write",e);if(e===false){if((n.pipesCount===1&&n.pipes===r||n.pipesCount>1&&Z(n.pipes,r)!==-1)&&!l){b("false write response, pause",n.awaitDrain);n.awaitDrain++}i.pause()}}function c(t){b("onerror",t);g();r.removeListener("error",c);if(y(r,"error")===0)x(r,t)}k(r,"error",c);function d(){r.removeListener("finish",p);g()}r.once("close",d);function p(){b("onfinish");r.removeListener("close",d);g()}r.once("finish",p);function g(){b("unpipe");i.unpipe(r)}r.emit("pipe",i);if(!n.flowing){b("pipe resume");i.resume()}return r};function F(r){return function t(){var e=r._readableState;b("pipeOnDrain",e.awaitDrain);if(e.awaitDrain)e.awaitDrain--;if(e.awaitDrain===0&&y(r,"data")){e.flowing=true;z(r)}}}S.prototype.unpipe=function(t){var e=this._readableState;var r={hasUnpiped:false};if(e.pipesCount===0)return this;if(e.pipesCount===1){if(t&&t!==e.pipes)return this;if(!t)t=e.pipes;e.pipes=null;e.pipesCount=0;e.flowing=false;if(t)t.emit("unpipe",this,r);return this}if(!t){var i=e.pipes;var n=e.pipesCount;e.pipes=null;e.pipesCount=0;e.flowing=false;for(var s=0;s<n;s++){i[s].emit("unpipe",this,{hasUnpiped:false})}return this}var o=Z(e.pipes,t);if(o===-1)return this;e.pipes.splice(o,1);e.pipesCount-=1;if(e.pipesCount===1)e.pipes=e.pipes[0];t.emit("unpipe",this,r);return this};S.prototype.on=function(t,e){var r=n.prototype.on.call(this,t,e);var i=this._readableState;if(t==="data"){i.readableListening=this.listenerCount("readable")>0;if(i.flowing!==false)this.resume()}else if(t==="readable"){if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.flowing=false;i.emittedReadable=false;b("on readable",i.length,i.reading);if(i.length){M(this)}else if(!i.reading){K.nextTick(H,this)}}}return r};S.prototype.addListener=S.prototype.on;S.prototype.removeListener=function(t,e){var r=n.prototype.removeListener.call(this,t,e);if(t==="readable"){K.nextTick(W,this)}return r};S.prototype.removeAllListeners=function(t){var e=n.prototype.removeAllListeners.apply(this,arguments);if(t==="readable"||t===undefined){K.nextTick(W,this)}return e};function W(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0;if(e.resumeScheduled&&!e.paused){e.flowing=true}else if(t.listenerCount("data")>0){t.resume()}}function H(t){b("readable nexttick read 0");t.read(0)}S.prototype.resume=function(){var t=this._readableState;if(!t.flowing){b("resume");t.flowing=!t.readableListening;N(this,t)}t.paused=false;return this};function N(t,e){if(!e.resumeScheduled){e.resumeScheduled=true;K.nextTick(U,t,e)}}function U(t,e){b("resume",e.reading);if(!e.reading){t.read(0)}e.resumeScheduled=false;t.emit("resume");z(t);if(e.flowing&&!e.reading)t.read(0)}S.prototype.pause=function(){b("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){b("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function z(t){var e=t._readableState;b("flow",e.flowing);while(e.flowing&&t.read()!==null){}}S.prototype.wrap=function(r){var i=this;var n=this._readableState;var s=false;r.on("end",function(){b("wrapped end");if(n.decoder&&!n.ended){var t=n.decoder.end();if(t&&t.length)i.push(t)}i.push(null)});r.on("data",function(t){b("wrapped data");if(n.decoder)t=n.decoder.write(t);if(n.objectMode&&(t===null||t===undefined))return;else if(!n.objectMode&&(!t||!t.length))return;var e=i.push(t);if(!e){s=true;r.pause()}});for(var t in r){if(this[t]===undefined&&typeof r[t]==="function"){this[t]=function t(e){return function t(){return r[e].apply(r,arguments)}}(t)}}for(var e=0;e<C.length;e++){r.on(C[e],this.emit.bind(this,C[e]))}this._read=function(t){b("wrapped _read",t);if(s){s=false;r.resume()}};return this};if(typeof Symbol==="function"){S.prototype[Symbol.asyncIterator]=function(){if(w===undefined){w=q("./internal/streams/async_iterator")}return w(this)}}Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:false,get:function t(){return this._readableState.highWaterMark}});Object.defineProperty(S.prototype,"readableBuffer",{enumerable:false,get:function t(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(S.prototype,"readableFlowing",{enumerable:false,get:function t(){return this._readableState.flowing},set:function t(e){if(this._readableState){this._readableState.flowing=e}}});S._fromList=Y;Object.defineProperty(S.prototype,"readableLength",{enumerable:false,get:function t(){return this._readableState.length}});function Y(t,e){if(e.length===0)return null;var r;if(e.objectMode)r=e.buffer.shift();else if(!t||t>=e.length){if(e.decoder)r=e.buffer.join("");else if(e.buffer.length===1)r=e.buffer.first();else r=e.buffer.concat(e.length);e.buffer.clear()}else{r=e.buffer.consume(t,e.decoder)}return r}function V(t){var e=t._readableState;b("endReadable",e.endEmitted);if(!e.endEmitted){e.ended=true;K.nextTick(G,e,t)}}function G(t,e){b("endReadableNT",t.endEmitted,t.length);if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end");if(t.autoDestroy){var r=e._writableState;if(!r||r.autoDestroy&&r.finished){e.destroy()}}}}if(typeof Symbol==="function"){S.from=function(t,e){if(_===undefined){_=q("./internal/streams/from")}return _(S,t,e)}}function Z(t,e){for(var r=0,i=t.length;r<i;r++){if(t[r]===e)return r}return-1}}).call(this)}).call(this,q("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../errors":182,"./_stream_duplex":183,"./internal/streams/async_iterator":188,"./internal/streams/buffer_list":189,"./internal/streams/destroy":190,"./internal/streams/from":192,"./internal/streams/state":194,"./internal/streams/stream":195,_process:179,buffer:147,events:151,inherits:160,"string_decoder/":196,util:144}],186:[function(t,e,r){"use strict";e.exports=f;var i=t("../errors").codes,n=i.ERR_METHOD_NOT_IMPLEMENTED,s=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0;var u=t("./_stream_duplex");t("inherits")(f,u);function l(t,e){var r=this._transformState;r.transforming=false;var i=r.writecb;if(i===null){return this.emit("error",new s)}r.writechunk=null;r.writecb=null;if(e!=null)this.push(e);i(t);var n=this._readableState;n.reading=false;if(n.needReadable||n.length<n.highWaterMark){this._read(n.highWaterMark)}}function f(t){if(!(this instanceof f))return new f(t);u.call(this,t);this._transformState={afterTransform:l.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(t){if(typeof t.transform==="function")this._transform=t.transform;if(typeof t.flush==="function")this._flush=t.flush}this.on("prefinish",h)}function h(){var r=this;if(typeof this._flush==="function"&&!this._readableState.destroyed){this._flush(function(t,e){c(r,t,e)})}else{c(this,null,null)}}f.prototype.push=function(t,e){this._transformState.needTransform=false;return u.prototype.push.call(this,t,e)};f.prototype._transform=function(t,e,r){r(new n("_transform()"))};f.prototype._write=function(t,e,r){var i=this._transformState;i.writecb=r;i.writechunk=t;i.writeencoding=e;if(!i.transforming){var n=this._readableState;if(i.needTransform||n.needReadable||n.length<n.highWaterMark)this._read(n.highWaterMark)}};f.prototype._read=function(t){var e=this._transformState;if(e.writechunk!==null&&!e.transforming){e.transforming=true;this._transform(e.writechunk,e.writeencoding,e.afterTransform)}else{e.needTransform=true}};f.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,function(t){e(t)})};function c(t,e,r){if(e)return t.emit("error",e);if(r!=null)t.push(r);if(t._writableState.length)throw new a;if(t._transformState.transforming)throw new o;return t.push(null)}},{"../errors":182,"./_stream_duplex":183,inherits:160}],187:[function(V,G,t){(function(z,Y){(function(){"use strict";G.exports=T;function t(t,e,r){this.chunk=t;this.encoding=e;this.callback=r;this.next=null}function c(t){var e=this;this.next=null;this.entry=null;this.finish=function(){U(e,t)}}var n;T.WritableState=C;var e={deprecate:V("util-deprecate")};var r=V("./internal/streams/stream");var o=V("buffer").Buffer;var i=Y.Uint8Array||function(){};function a(t){return o.from(t)}function u(t){return o.isBuffer(t)||t instanceof i}var s=V("./internal/streams/destroy");var l=V("./internal/streams/state"),f=l.getHighWaterMark;var h=V("../errors").codes,d=h.ERR_INVALID_ARG_TYPE,p=h.ERR_METHOD_NOT_IMPLEMENTED,g=h.ERR_MULTIPLE_CALLBACK,y=h.ERR_STREAM_CANNOT_PIPE,b=h.ERR_STREAM_DESTROYED,m=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,w=h.ERR_UNKNOWN_ENCODING;var _=s.errorOrDestroy;V("inherits")(T,r);function x(){}function C(t,e,r){n=n||V("./_stream_duplex");t=t||{};if(typeof r!=="boolean")r=e instanceof n;this.objectMode=!!t.objectMode;if(r)this.objectMode=this.objectMode||!!t.writableObjectMode;this.highWaterMark=f(this,t,"writableHighWaterMark",r);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var i=t.decodeStrings===false;this.decodeStrings=!i;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(t){I(e,t)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new c(this)}C.prototype.getBuffer=function t(){var e=this.bufferedRequest;var r=[];while(e){r.push(e);e=e.next}return r};(function(){try{Object.defineProperty(C.prototype,"buffer",{get:e.deprecate(function t(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(t){}})();var k;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){k=Function.prototype[Symbol.hasInstance];Object.defineProperty(T,Symbol.hasInstance,{value:function t(e){if(k.call(this,e))return true;if(this!==T)return false;return e&&e._writableState instanceof C}})}else{k=function t(e){return e instanceof this}}function T(t){n=n||V("./_stream_duplex");var e=this instanceof n;if(!e&&!k.call(T,this))return new T(t);this._writableState=new C(t,this,e);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev;if(typeof t.destroy==="function")this._destroy=t.destroy;if(typeof t.final==="function")this._final=t.final}r.call(this)}T.prototype.pipe=function(){_(this,new y)};function S(t,e){var r=new v;_(t,r);z.nextTick(e,r)}function E(t,e,r,i){var n;if(r===null){n=new m}else if(typeof r!=="string"&&!e.objectMode){n=new d("chunk",["string","Buffer"],r)}if(n){_(t,n);z.nextTick(i,n);return false}return true}T.prototype.write=function(t,e,r){var i=this._writableState;var n=false;var s=!i.objectMode&&u(t);if(s&&!o.isBuffer(t)){t=a(t)}if(typeof e==="function"){r=e;e=null}if(s)e="buffer";else if(!e)e=i.defaultEncoding;if(typeof r!=="function")r=x;if(i.ending)S(this,r);else if(s||E(this,i,t,r)){i.pendingcb++;n=R(this,i,s,t,e,r)}return n};T.prototype.cork=function(){this._writableState.corked++};T.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest)L(this,t)}};T.prototype.setDefaultEncoding=function t(e){if(typeof e==="string")e=e.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(T.prototype,"writableBuffer",{enumerable:false,get:function t(){return this._writableState&&this._writableState.getBuffer()}});function A(t,e,r){if(!t.objectMode&&t.decodeStrings!==false&&typeof e==="string"){e=o.from(e,r)}return e}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:false,get:function t(){return this._writableState.highWaterMark}});function R(t,e,r,i,n,s){if(!r){var o=A(e,i,n);if(i!==o){r=true;n="buffer";i=o}}var a=e.objectMode?1:i.length;e.length+=a;var u=e.length<e.highWaterMark;if(!u)e.needDrain=true;if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null};if(l){l.next=e.lastBufferedRequest}else{e.bufferedRequest=e.lastBufferedRequest}e.bufferedRequestCount+=1}else{B(t,e,false,a,i,n,s)}return u}function B(t,e,r,i,n,s,o){e.writelen=i;e.writecb=o;e.writing=true;e.sync=true;if(e.destroyed)e.onwrite(new b("write"));else if(r)t._writev(n,e.onwrite);else t._write(n,s,e.onwrite);e.sync=false}function O(t,e,r,i,n){--e.pendingcb;if(r){z.nextTick(n,i);z.nextTick(H,t,e);t._writableState.errorEmitted=true;_(t,i)}else{n(i);t._writableState.errorEmitted=true;_(t,i);H(t,e)}}function P(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}function I(t,e){var r=t._writableState;var i=r.sync;var n=r.writecb;if(typeof n!=="function")throw new g;P(r);if(e)O(t,r,i,e,n);else{var s=D(r)||t.destroyed;if(!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest){L(t,r)}if(i){z.nextTick(M,t,r,s,n)}else{M(t,r,s,n)}}}function M(t,e,r,i){if(!r)j(t,e);e.pendingcb--;i();H(t,e)}function j(t,e){if(e.length===0&&e.needDrain){e.needDrain=false;t.emit("drain")}}function L(t,e){e.bufferProcessing=true;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount;var n=new Array(i);var s=e.corkedRequestsFree;s.entry=r;var o=0;var a=true;while(r){n[o]=r;if(!r.isBuf)a=false;r=r.next;o+=1}n.allBuffers=a;B(t,e,true,e.length,n,"",s.finish);e.pendingcb++;e.lastBufferedRequest=null;if(s.next){e.corkedRequestsFree=s.next;s.next=null}else{e.corkedRequestsFree=new c(e)}e.bufferedRequestCount=0}else{while(r){var u=r.chunk;var l=r.encoding;var f=r.callback;var h=e.objectMode?1:u.length;B(t,e,false,h,u,l,f);r=r.next;e.bufferedRequestCount--;if(e.writing){break}}if(r===null)e.lastBufferedRequest=null}e.bufferedRequest=r;e.bufferProcessing=false}T.prototype._write=function(t,e,r){r(new p("_write()"))};T.prototype._writev=null;T.prototype.end=function(t,e,r){var i=this._writableState;if(typeof t==="function"){r=t;t=null;e=null}else if(typeof e==="function"){r=e;e=null}if(t!==null&&t!==undefined)this.write(t,e);if(i.corked){i.corked=1;this.uncork()}if(!i.ending)N(this,i,r);return this};Object.defineProperty(T.prototype,"writableLength",{enumerable:false,get:function t(){return this._writableState.length}});function D(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function F(e,r){e._final(function(t){r.pendingcb--;if(t){_(e,t)}r.prefinished=true;e.emit("prefinish");H(e,r)})}function W(t,e){if(!e.prefinished&&!e.finalCalled){if(typeof t._final==="function"&&!e.destroyed){e.pendingcb++;e.finalCalled=true;z.nextTick(F,t,e)}else{e.prefinished=true;t.emit("prefinish")}}}function H(t,e){var r=D(e);if(r){W(t,e);if(e.pendingcb===0){e.finished=true;t.emit("finish");if(e.autoDestroy){var i=t._readableState;if(!i||i.autoDestroy&&i.endEmitted){t.destroy()}}}}return r}function N(t,e,r){e.ending=true;H(t,e);if(r){if(e.finished)z.nextTick(r);else t.once("finish",r)}e.ended=true;t.writable=false}function U(t,e,r){var i=t.entry;t.entry=null;while(i){var n=i.callback;e.pendingcb--;n(r);i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(T.prototype,"destroyed",{enumerable:false,get:function t(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function t(e){if(!this._writableState){return}this._writableState.destroyed=e}});T.prototype.destroy=s.destroy;T.prototype._undestroy=s.undestroy;T.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,V("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../errors":182,"./_stream_duplex":183,"./internal/streams/destroy":190,"./internal/streams/state":194,"./internal/streams/stream":195,_process:179,buffer:147,inherits:160,"util-deprecate":199}],188:[function(m,v,t){(function(b){(function(){"use strict";var t;function i(t,e,r){if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}var s=m("./end-of-stream");var o=Symbol("lastResolve");var a=Symbol("lastReject");var u=Symbol("error");var l=Symbol("ended");var f=Symbol("lastPromise");var h=Symbol("handlePromise");var c=Symbol("stream");function d(t,e){return{value:t,done:e}}function e(t){var e=t[o];if(e!==null){var r=t[c].read();if(r!==null){t[f]=null;t[o]=null;t[a]=null;e(d(r,false))}}}function p(t){b.nextTick(e,t)}function g(r,i){return function(t,e){r.then(function(){if(i[l]){t(d(undefined,true));return}i[h](t,e)},e)}}var r=Object.getPrototypeOf(function(){});var y=Object.setPrototypeOf((t={get stream(){return this[c]},next:function t(){var r=this;var e=this[u];if(e!==null){return Promise.reject(e)}if(this[l]){return Promise.resolve(d(undefined,true))}if(this[c].destroyed){return new Promise(function(t,e){b.nextTick(function(){if(r[u]){e(r[u])}else{t(d(undefined,true))}})})}var i=this[f];var n;if(i){n=new Promise(g(i,this))}else{var s=this[c].read();if(s!==null){return Promise.resolve(d(s,false))}n=new Promise(this[h])}this[f]=n;return n}},i(t,Symbol.asyncIterator,function(){return this}),i(t,"return",function t(){var i=this;return new Promise(function(e,r){i[c].destroy(null,function(t){if(t){r(t);return}e(d(undefined,true))})})}),t),r);var n=function t(e){var r;var n=Object.create(y,(r={},i(r,c,{value:e,writable:true}),i(r,o,{value:null,writable:true}),i(r,a,{value:null,writable:true}),i(r,u,{value:null,writable:true}),i(r,l,{value:e._readableState.endEmitted,writable:true}),i(r,h,{value:function t(e,r){var i=n[c].read();if(i){n[f]=null;n[o]=null;n[a]=null;e(d(i,false))}else{n[o]=e;n[a]=r}},writable:true}),r));n[f]=null;s(e,function(t){if(t&&t.code!=="ERR_STREAM_PREMATURE_CLOSE"){var e=n[a];if(e!==null){n[f]=null;n[o]=null;n[a]=null;e(t)}n[u]=t;return}var r=n[o];if(r!==null){n[f]=null;n[o]=null;n[a]=null;r(d(undefined,true))}n[l]=true});e.on("readable",p.bind(null,n));return n};v.exports=n}).call(this)}).call(this,m("_process"))},{"./end-of-stream":191,_process:179}],189:[function(t,e,r){"use strict";function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);if(t)i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable});r.push.apply(r,i)}return r}function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};if(t%2){i(Object(r),true).forEach(function(t){s(e,t,r[t])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}}return e}function s(t,e,r){if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function o(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function a(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(t,i.key,i)}}function u(t,e,r){if(e)a(t.prototype,e);if(r)a(t,r);return t}var l=t("buffer"),f=l.Buffer;var h=t("util"),c=h.inspect;var d=c&&c.custom||"inspect";function p(t,e,r){f.prototype.copy.call(t,e,r)}e.exports=function(){function t(){o(this,t);this.head=null;this.tail=null;this.length=0}u(t,[{key:"push",value:function t(e){var r={data:e,next:null};if(this.length>0)this.tail.next=r;else this.head=r;this.tail=r;++this.length}},{key:"unshift",value:function t(e){var r={data:e,next:this.head};if(this.length===0)this.tail=r;this.head=r;++this.length}},{key:"shift",value:function t(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function t(){this.head=this.tail=null;this.length=0}},{key:"join",value:function t(e){if(this.length===0)return"";var r=this.head;var i=""+r.data;while(r=r.next){i+=e+r.data}return i}},{key:"concat",value:function t(e){if(this.length===0)return f.alloc(0);var r=f.allocUnsafe(e>>>0);var i=this.head;var n=0;while(i){p(i.data,r,n);n+=i.data.length;i=i.next}return r}},{key:"consume",value:function t(e,r){var i;if(e<this.head.data.length){i=this.head.data.slice(0,e);this.head.data=this.head.data.slice(e)}else if(e===this.head.data.length){i=this.shift()}else{i=r?this._getString(e):this._getBuffer(e)}return i}},{key:"first",value:function t(){return this.head.data}},{key:"_getString",value:function t(e){var r=this.head;var i=1;var n=r.data;e-=n.length;while(r=r.next){var s=r.data;var o=e>s.length?s.length:e;if(o===s.length)n+=s;else n+=s.slice(0,e);e-=o;if(e===0){if(o===s.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=s.slice(o)}break}++i}this.length-=i;return n}},{key:"_getBuffer",value:function t(e){var r=f.allocUnsafe(e);var i=this.head;var n=1;i.data.copy(r);e-=i.data.length;while(i=i.next){var s=i.data;var o=e>s.length?s.length:e;s.copy(r,r.length-e,0,o);e-=o;if(e===0){if(o===s.length){++n;if(i.next)this.head=i.next;else this.head=this.tail=null}else{this.head=i;i.data=s.slice(o)}break}++n}this.length-=n;return r}},{key:d,value:function t(e,r){return c(this,n({},r,{depth:0,customInspect:false}))}}]);return t}()},{buffer:147,util:144}],190:[function(t,i,e){(function(u){(function(){"use strict";function t(t,e){var r=this;var i=this._readableState&&this._readableState.destroyed;var n=this._writableState&&this._writableState.destroyed;if(i||n){if(e){e(t)}else if(t){if(!this._writableState){u.nextTick(a,this,t)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;u.nextTick(a,this,t)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,function(t){if(!e&&t){if(!r._writableState){u.nextTick(s,r,t)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;u.nextTick(s,r,t)}else{u.nextTick(o,r)}}else if(e){u.nextTick(o,r);e(t)}else{u.nextTick(o,r)}});return this}function s(t,e){a(t,e);o(t)}function o(t){if(t._writableState&&!t._writableState.emitClose)return;if(t._readableState&&!t._readableState.emitClose)return;t.emit("close")}function e(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function a(t,e){t.emit("error",e)}function r(t,e){var r=t._readableState;var i=t._writableState;if(r&&r.autoDestroy||i&&i.autoDestroy)t.destroy(e);else t.emit("error",e)}i.exports={destroy:t,undestroy:e,errorOrDestroy:r}}).call(this)}).call(this,t("_process"))},{_process:179}],191:[function(t,e,r){"use strict";var d=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function p(i){var n=false;return function(){if(n)return;n=true;for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}i.apply(this,e)}}function g(){}function y(t){return t.setHeader&&typeof t.abort==="function"}function b(r,t,i){if(typeof t==="function")return b(r,null,t);if(!t)t={};i=p(i||g);var n=t.readable||t.readable!==false&&r.readable;var s=t.writable||t.writable!==false&&r.writable;var e=function t(){if(!r.writable)a()};var o=r._writableState&&r._writableState.finished;var a=function t(){s=false;o=true;if(!n)i.call(r)};var u=r._readableState&&r._readableState.endEmitted;var l=function t(){n=false;u=true;if(!s)i.call(r)};var f=function t(e){i.call(r,e)};var h=function t(){var e;if(n&&!u){if(!r._readableState||!r._readableState.ended)e=new d;return i.call(r,e)}if(s&&!o){if(!r._writableState||!r._writableState.ended)e=new d;return i.call(r,e)}};var c=function t(){r.req.on("finish",a)};if(y(r)){r.on("complete",a);r.on("abort",h);if(r.req)c();else r.on("request",c)}else if(s&&!r._writableState){r.on("end",e);r.on("close",e)}r.on("end",l);r.on("finish",a);if(t.error!==false)r.on("error",f);r.on("close",h);return function(){r.removeListener("complete",a);r.removeListener("abort",h);r.removeListener("request",c);if(r.req)r.req.removeListener("finish",a);r.removeListener("end",e);r.removeListener("close",e);r.removeListener("finish",a);r.removeListener("end",l);r.removeListener("error",f);r.removeListener("close",h)}}e.exports=b},{"../../../errors":182}],192:[function(t,e,r){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],193:[function(o,t,e){"use strict";var a;function u(t){var e=false;return function(){if(e)return;e=true;t.apply(void 0,arguments)}}var r=o("../../../errors").codes,i=r.ERR_MISSING_ARGS,l=r.ERR_STREAM_DESTROYED;function n(t){if(t)throw t}function f(t){return t.setHeader&&typeof t.abort==="function"}function h(e,t,r,i){i=u(i);var n=false;e.on("close",function(){n=true});if(a===undefined)a=o("./end-of-stream");a(e,{readable:t,writable:r},function(t){if(t)return i(t);n=true;i()});var s=false;return function(t){if(n)return;if(s)return;s=true;if(f(e))return e.abort();if(typeof e.destroy==="function")return e.destroy();i(t||new l("pipe"))}}function c(t){t()}function d(t,e){return t.pipe(e)}function p(t){if(!t.length)return n;if(typeof t[t.length-1]!=="function")return n;return t.pop()}function s(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var s=p(n);if(Array.isArray(n[0]))n=n[0];if(n.length<2){throw new i("streams")}var o;var a=n.map(function(t,e){var r=e<n.length-1;var i=e>0;return h(t,r,i,function(t){if(!o)o=t;if(t)a.forEach(c);if(r)return;a.forEach(c);s(o)})});return n.reduce(d)}t.exports=s},{"../../../errors":182,"./end-of-stream":191}],194:[function(t,e,r){"use strict";var o=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;function a(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function i(t,e,r,i){var n=a(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new o(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}e.exports={getHighWaterMark:i}},{"../../../errors":182}],195:[function(t,e,r){e.exports=t("events").EventEmitter},{events:151}],196:[function(t,e,r){"use strict";var i=t("safe-buffer").Buffer;var n=i.isEncoding||function(t){t=""+t;switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function s(t){if(!t)return"utf8";var e;while(true){switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase();e=true}}}function o(t){var e=s(t);if(typeof e!=="string"&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}r.StringDecoder=a;function a(t){this.encoding=o(t);var e;switch(this.encoding){case"utf16le":this.text=p;this.end=g;e=4;break;case"utf8":this.fillLast=h;e=4;break;case"base64":this.text=y;this.end=b;e=3;break;default:this.write=m;this.end=v;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=i.allocUnsafe(e)}a.prototype.write=function(t){if(t.length===0)return"";var e;var r;if(this.lastNeed){e=this.fillLast(t);if(e===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r<t.length)return e?e+this.text(t,r):this.text(t,r);return e||""};a.prototype.end=d;a.prototype.text=c;a.prototype.fillLast=function(t){if(this.lastNeed<=t.length){t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length);this.lastNeed-=t.length};function u(t){if(t<=127)return 0;else if(t>>5===6)return 2;else if(t>>4===14)return 3;else if(t>>3===30)return 4;return t>>6===2?-1:-2}function l(t,e,r){var i=e.length-1;if(i<r)return 0;var n=u(e[i]);if(n>=0){if(n>0)t.lastNeed=n-1;return n}if(--i<r||n===-2)return 0;n=u(e[i]);if(n>=0){if(n>0)t.lastNeed=n-2;return n}if(--i<r||n===-2)return 0;n=u(e[i]);if(n>=0){if(n>0){if(n===2)n=0;else t.lastNeed=n-3}return n}return 0}function f(t,e,r){if((e[0]&192)!==128){t.lastNeed=0;return"�"}if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128){t.lastNeed=1;return"�"}if(t.lastNeed>2&&e.length>2){if((e[2]&192)!==128){t.lastNeed=2;return"�"}}}}function h(t){var e=this.lastTotal-this.lastNeed;var r=f(this,t,e);if(r!==undefined)return r;if(this.lastNeed<=t.length){t.copy(this.lastChar,e,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,e,0,t.length);this.lastNeed-=t.length}function c(t,e){var r=l(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);t.copy(this.lastChar,0,i);return t.toString("utf8",e,i)}function d(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+"�";return e}function p(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=t[t.length-1];return t.toString("utf16le",e,t.length-1)}function g(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function y(t,e){var r=(t.length-e)%3;if(r===0)return t.toString("base64",e);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=t[t.length-1]}else{this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1]}return t.toString("base64",e,t.length-r)}function b(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+this.lastChar.toString("base64",0,3-this.lastNeed);return e}function m(t){return t.toString(this.encoding)}function v(t){return t&&t.length?this.write(t):""}},{"safe-buffer":180}],197:[function(u,t,l){(function(i,a){(function(){var t=u("process/browser.js").nextTick;var e=Function.prototype.apply;var n=Array.prototype.slice;var s={};var o=0;l.setTimeout=function(){return new r(e.call(setTimeout,window,arguments),clearTimeout)};l.setInterval=function(){return new r(e.call(setInterval,window,arguments),clearInterval)};l.clearTimeout=l.clearInterval=function(t){t.close()};function r(t,e){this._id=t;this._clearFn=e}r.prototype.unref=r.prototype.ref=function(){};r.prototype.close=function(){this._clearFn.call(window,this._id)};l.enroll=function(t,e){clearTimeout(t._idleTimeoutId);t._idleTimeout=e};l.unenroll=function(t){clearTimeout(t._idleTimeoutId);t._idleTimeout=-1};l._unrefActive=l.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;if(t>=0){e._idleTimeoutId=setTimeout(function t(){if(e._onTimeout)e._onTimeout()},t)}};l.setImmediate=typeof i==="function"?i:function(e){var r=o++;var i=arguments.length<2?false:n.call(arguments,1);s[r]=true;t(function t(){if(s[r]){if(i){e.apply(null,i)}else{e.call(null)}l.clearImmediate(r)}});return r};l.clearImmediate=typeof a==="function"?a:function(t){delete s[t]}}).call(this)}).call(this,u("timers").setImmediate,u("timers").clearImmediate)},{"process/browser.js":179,timers:197}],198:[function(t,e,r){r.isatty=function(){return false};function i(){throw new Error("tty.ReadStream is not implemented")}r.ReadStream=i;function n(){throw new Error("tty.WriteStream is not implemented")}r.WriteStream=n},{}],199:[function(t,e,r){(function(r){(function(){e.exports=t;function t(t,e){if(n("noDeprecation")){return t}var r=false;function i(){if(!r){if(n("throwDeprecation")){throw new Error(e)}else if(n("traceDeprecation")){console.trace(e)}else{console.warn(e)}r=true}return t.apply(this,arguments)}return i}function n(t){try{if(!r.localStorage)return false}catch(t){return false}var e=r.localStorage[t];if(null==e)return false;return String(e).toLowerCase()==="true"}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],200:[function(t,e,r){arguments[4][140][0].apply(r,arguments)},{dup:140}],201:[function(t,e,r){"use strict";var i=t("is-arguments");var n=t("is-generator-function");var s=t("which-typed-array");var o=t("is-typed-array");function a(t){return t.call.bind(t)}var u=typeof BigInt!=="undefined";var l=typeof Symbol!=="undefined";var f=a(Object.prototype.toString);var h=a(Number.prototype.valueOf);var c=a(String.prototype.valueOf);var d=a(Boolean.prototype.valueOf);if(u){var p=a(BigInt.prototype.valueOf)}if(l){var g=a(Symbol.prototype.valueOf)}function y(t,e){if(typeof t!=="object"){return false}try{e(t);return true}catch(t){return false}}r.isArgumentsObject=i;r.isGeneratorFunction=n;r.isTypedArray=o;function b(t){return typeof Promise!=="undefined"&&t instanceof Promise||t!==null&&typeof t==="object"&&typeof t.then==="function"&&typeof t.catch==="function"}r.isPromise=b;function m(t){if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){return ArrayBuffer.isView(t)}return o(t)||N(t)}r.isArrayBufferView=m;function v(t){return s(t)==="Uint8Array"}r.isUint8Array=v;function w(t){return s(t)==="Uint8ClampedArray"}r.isUint8ClampedArray=w;function _(t){return s(t)==="Uint16Array"}r.isUint16Array=_;function x(t){return s(t)==="Uint32Array"}r.isUint32Array=x;function C(t){return s(t)==="Int8Array"}r.isInt8Array=C;function k(t){return s(t)==="Int16Array"}r.isInt16Array=k;function T(t){return s(t)==="Int32Array"}r.isInt32Array=T;function S(t){return s(t)==="Float32Array"}r.isFloat32Array=S;function E(t){return s(t)==="Float64Array"}r.isFloat64Array=E;function A(t){return s(t)==="BigInt64Array"}r.isBigInt64Array=A;function R(t){return s(t)==="BigUint64Array"}r.isBigUint64Array=R;function B(t){return f(t)==="[object Map]"}B.working=typeof Map!=="undefined"&&B(new Map);function O(t){if(typeof Map==="undefined"){return false}return B.working?B(t):t instanceof Map}r.isMap=O;function P(t){return f(t)==="[object Set]"}P.working=typeof Set!=="undefined"&&P(new Set);function I(t){if(typeof Set==="undefined"){return false}return P.working?P(t):t instanceof Set}r.isSet=I;function M(t){return f(t)==="[object WeakMap]"}M.working=typeof WeakMap!=="undefined"&&M(new WeakMap);function j(t){if(typeof WeakMap==="undefined"){return false}return M.working?M(t):t instanceof WeakMap}r.isWeakMap=j;function L(t){return f(t)==="[object WeakSet]"}L.working=typeof WeakSet!=="undefined"&&L(new WeakSet);function D(t){return L(t)}r.isWeakSet=D;function F(t){return f(t)==="[object ArrayBuffer]"}F.working=typeof ArrayBuffer!=="undefined"&&F(new ArrayBuffer);function W(t){if(typeof ArrayBuffer==="undefined"){return false}return F.working?F(t):t instanceof ArrayBuffer}r.isArrayBuffer=W;function H(t){return f(t)==="[object DataView]"}H.working=typeof ArrayBuffer!=="undefined"&&typeof DataView!=="undefined"&&H(new DataView(new ArrayBuffer(1),0,1));function N(t){if(typeof DataView==="undefined"){return false}return H.working?H(t):t instanceof DataView}r.isDataView=N;function U(t){return f(t)==="[object SharedArrayBuffer]"}U.working=typeof SharedArrayBuffer!=="undefined"&&U(new SharedArrayBuffer);function z(t){if(typeof SharedArrayBuffer==="undefined"){return false}return U.working?U(t):t instanceof SharedArrayBuffer}r.isSharedArrayBuffer=z;function Y(t){return f(t)==="[object AsyncFunction]"}r.isAsyncFunction=Y;function V(t){return f(t)==="[object Map Iterator]"}r.isMapIterator=V;function G(t){return f(t)==="[object Set Iterator]"}r.isSetIterator=G;function Z(t){return f(t)==="[object Generator]"}r.isGeneratorObject=Z;function K(t){return f(t)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=K;function X(t){return y(t,h)}r.isNumberObject=X;function q(t){return y(t,c)}r.isStringObject=q;function J(t){return y(t,d)}r.isBooleanObject=J;function $(t){return u&&y(t,p)}r.isBigIntObject=$;function Q(t){return l&&y(t,g)}r.isSymbolObject=Q;function tt(t){return X(t)||q(t)||J(t)||$(t)||Q(t)}r.isBoxedPrimitive=tt;function et(t){return typeof Uint8Array!=="undefined"&&(W(t)||z(t))}r.isAnyArrayBuffer=et;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(r,t,{enumerable:false,value:function(){throw new Error(t+" is not supported in userland")}})})},{"is-arguments":161,"is-generator-function":163,"is-typed-array":164,"which-typed-array":203}],202:[function(F,t,W){(function(D){(function(){var r=Object.getOwnPropertyDescriptors||function t(e){var r=Object.keys(e);var i={};for(var n=0;n<r.length;n++){i[r[n]]=Object.getOwnPropertyDescriptor(e,r[n])}return i};var a=/%[sdj%]/g;W.format=function(t){if(!_(t)){var e=[];for(var r=0;r<arguments.length;r++){e.push(u(arguments[r]))}return e.join(" ")}var r=1;var i=arguments;var n=i.length;var s=String(t).replace(a,function(t){if(t==="%%")return"%";if(r>=n)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}});for(var o=i[r];r<n;o=i[++r]){if(l(o)||!k(o)){s+=" "+o}else{s+=" "+u(o)}}return s};W.deprecate=function(t,e){if(typeof D!=="undefined"&&D.noDeprecation===true){return t}if(typeof D==="undefined"){return function(){return W.deprecate(t,e).apply(this,arguments)}}var r=false;function i(){if(!r){if(D.throwDeprecation){throw new Error(e)}else if(D.traceDeprecation){console.trace(e)}else{console.error(e)}r=true}return t.apply(this,arguments)}return i};var t={};var i=/^$/;if(D.env.NODE_DEBUG){var e=D.env.NODE_DEBUG;e=e.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase();i=new RegExp("^"+e+"$","i")}W.debuglog=function(e){e=e.toUpperCase();if(!t[e]){if(i.test(e)){var r=D.pid;t[e]=function(){var t=W.format.apply(W,arguments);console.error("%s %d: %s",e,r,t)}}else{t[e]=function(){}}}return t[e]};function u(t,e){var r={seen:[],stylize:s};if(arguments.length>=3)r.depth=arguments[2];if(arguments.length>=4)r.colors=arguments[3];if(o(e)){r.showHidden=e}else if(e){W._extend(r,e)}if(x(r.showHidden))r.showHidden=false;if(x(r.depth))r.depth=2;if(x(r.colors))r.colors=false;if(x(r.customInspect))r.customInspect=true;if(r.colors)r.stylize=n;return p(r,t,r.depth)}W.inspect=u;u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(t,e){var r=u.styles[e];if(r){return"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m"}else{return t}}function s(t,e){return t}function d(t){var r={};t.forEach(function(t,e){r[t]=true});return r}function p(e,r,i){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==W.inspect&&!(r.constructor&&r.constructor.prototype===r)){var t=r.inspect(i,e);if(!_(t)){t=p(e,t,i)}return t}var n=g(e,r);if(n){return n}var s=Object.keys(r);var o=d(s);if(e.showHidden){s=Object.getOwnPropertyNames(r)}if(S(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return y(r)}if(s.length===0){if(E(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(C(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}if(T(r)){return e.stylize(Date.prototype.toString.call(r),"date")}if(S(r)){return y(r)}}var u="",l=false,f=["{","}"];if(w(r)){l=true;f=["[","]"]}if(E(r)){var h=r.name?": "+r.name:"";u=" [Function"+h+"]"}if(C(r)){u=" "+RegExp.prototype.toString.call(r)}if(T(r)){u=" "+Date.prototype.toUTCString.call(r)}if(S(r)){u=" "+y(r)}if(s.length===0&&(!l||r.length==0)){return f[0]+u+f[1]}if(i<0){if(C(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(r);var c;if(l){c=b(e,r,i,o,s)}else{c=s.map(function(t){return m(e,r,i,o,t,l)})}e.seen.pop();return v(c,u,f)}function g(t,e){if(x(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(h(e))return t.stylize(""+e,"number");if(o(e))return t.stylize(""+e,"boolean");if(l(e))return t.stylize("null","null")}function y(t){return"["+Error.prototype.toString.call(t)+"]"}function b(e,r,i,n,t){var s=[];for(var o=0,a=r.length;o<a;++o){if(I(r,String(o))){s.push(m(e,r,i,n,String(o),true))}else{s.push("")}}t.forEach(function(t){if(!t.match(/^\d+$/)){s.push(m(e,r,i,n,t,true))}});return s}function m(t,e,r,i,n,s){var o,a,u;u=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]};if(u.get){if(u.set){a=t.stylize("[Getter/Setter]","special")}else{a=t.stylize("[Getter]","special")}}else{if(u.set){a=t.stylize("[Setter]","special")}}if(!I(i,n)){o="["+n+"]"}if(!a){if(t.seen.indexOf(u.value)<0){if(l(r)){a=p(t,u.value,null)}else{a=p(t,u.value,r-1)}if(a.indexOf("\n")>-1){if(s){a=a.split("\n").map(function(t){return"  "+t}).join("\n").substr(2)}else{a="\n"+a.split("\n").map(function(t){return"   "+t}).join("\n")}}}else{a=t.stylize("[Circular]","special")}}if(x(o)){if(s&&n.match(/^\d+$/)){return a}o=JSON.stringify(""+n);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=t.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=t.stylize(o,"string")}}return o+": "+a}function v(t,e,r){var i=0;var n=t.reduce(function(t,e){i++;if(e.indexOf("\n")>=0)i++;return t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60){return r[0]+(e===""?"":e+"\n ")+" "+t.join(",\n  ")+" "+r[1]}return r[0]+e+" "+t.join(", ")+" "+r[1]}W.types=F("./support/types");function w(t){return Array.isArray(t)}W.isArray=w;function o(t){return typeof t==="boolean"}W.isBoolean=o;function l(t){return t===null}W.isNull=l;function f(t){return t==null}W.isNullOrUndefined=f;function h(t){return typeof t==="number"}W.isNumber=h;function _(t){return typeof t==="string"}W.isString=_;function c(t){return typeof t==="symbol"}W.isSymbol=c;function x(t){return t===void 0}W.isUndefined=x;function C(t){return k(t)&&R(t)==="[object RegExp]"}W.isRegExp=C;W.types.isRegExp=C;function k(t){return typeof t==="object"&&t!==null}W.isObject=k;function T(t){return k(t)&&R(t)==="[object Date]"}W.isDate=T;W.types.isDate=T;function S(t){return k(t)&&(R(t)==="[object Error]"||t instanceof Error)}W.isError=S;W.types.isNativeError=S;function E(t){return typeof t==="function"}W.isFunction=E;function A(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}W.isPrimitive=A;W.isBuffer=F("./support/isBuffer");function R(t){return Object.prototype.toString.call(t)}function B(t){return t<10?"0"+t.toString(10):t.toString(10)}var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var t=new Date;var e=[B(t.getHours()),B(t.getMinutes()),B(t.getSeconds())].join(":");return[t.getDate(),O[t.getMonth()],e].join(" ")}W.log=function(){console.log("%s - %s",P(),W.format.apply(W,arguments))};W.inherits=F("inherits");W._extend=function(t,e){if(!e||!k(e))return t;var r=Object.keys(e);var i=r.length;while(i--){t[r[i]]=e[r[i]]}return t};function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var M=typeof Symbol!=="undefined"?Symbol("util.promisify.custom"):undefined;W.promisify=function t(s){if(typeof s!=="function")throw new TypeError('The "original" argument must be of type Function');if(M&&s[M]){var e=s[M];if(typeof e!=="function"){throw new TypeError('The "util.promisify.custom" argument must be of type Function')}Object.defineProperty(e,M,{value:e,enumerable:false,writable:false,configurable:true});return e}function e(){var r,i;var t=new Promise(function(t,e){r=t;i=e});var e=[];for(var n=0;n<arguments.length;n++){e.push(arguments[n])}e.push(function(t,e){if(t){i(t)}else{r(e)}});try{s.apply(this,e)}catch(t){i(t)}return t}Object.setPrototypeOf(e,Object.getPrototypeOf(s));if(M)Object.defineProperty(e,M,{value:e,enumerable:false,writable:false,configurable:true});return Object.defineProperties(e,r(s))};W.promisify.custom=M;function j(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t;t=r}return e(t)}function L(s){if(typeof s!=="function"){throw new TypeError('The "original" argument must be of type Function')}function t(){var t=[];for(var e=0;e<arguments.length;e++){t.push(arguments[e])}var r=t.pop();if(typeof r!=="function"){throw new TypeError("The last argument must be of type Function")}var i=this;var n=function(){return r.apply(i,arguments)};s.apply(this,t).then(function(t){D.nextTick(n.bind(null,null,t))},function(t){D.nextTick(j.bind(null,t,n))})}Object.setPrototypeOf(t,Object.getPrototypeOf(s));Object.defineProperties(t,r(s));return t}W.callbackify=L}).call(this)}).call(this,F("_process"))},{"./support/isBuffer":200,"./support/types":201,_process:179,inherits:160}],203:[function(p,g,t){(function(d){(function(){"use strict";var e=p("foreach");var t=p("available-typed-arrays");var r=p("call-bind/callBound");var i=r("Object.prototype.toString");var n=p("has-symbols")();var s=n&&typeof Symbol.toStringTag==="symbol";var o=t();var a=r("String.prototype.slice");var u={};var l=p("es-abstract/helpers/getOwnPropertyDescriptor");var f=Object.getPrototypeOf;if(s&&l&&f){e(o,function(t){if(typeof d[t]==="function"){var e=new d[t];if(!(Symbol.toStringTag in e)){throw new EvalError("this engine has support for Symbol.toStringTag, but "+t+" does not have the property! Please report this.")}var r=f(e);var i=l(r,Symbol.toStringTag);if(!i){var n=f(r);i=l(n,Symbol.toStringTag)}u[t]=i.get}})}var h=function t(i){var n=false;e(u,function(t,e){if(!n){try{var r=t.call(i);if(r===e){n=r}}catch(t){}}});return n};var c=p("is-typed-array");g.exports=function t(e){if(!c(e)){return false}if(!s){return a(i(e),8,-1)}return h(e)}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"available-typed-arrays":142,"call-bind/callBound":148,"es-abstract/helpers/getOwnPropertyDescriptor":150,foreach:152,"has-symbols":156,"is-typed-array":164}]},{},[9])(9)});
// width of a string with a markup, without control chars
	return string.unicode.width( str.replace( /\^\[[^\]]*]|\^(.)/g , ( match , second ) => {
  "version": "2.1.7",

Fixed code:
v2.1.8
------

Fix a possible ReDoS



## Reporting a Vulnerability

If you think you have found a vulnerability, _please report responsibly_.
Don't create GitHub issues for security issues.
Instead, send an email to cedric dot ronvel at gmail dot com and I will look into it as soon as possible.

**A note for bounty hunters:** I should mention that I *usually* prefer to fix security issues by myself,
because it could involve rethinking API or fixing it / working around it in a way only an official maintainer can do it.
I want to avoid people getting frustrated: **don't work on a fix before getting in touch with me**.
// Width of a string with a markup, without control chars
	// Fix a possible ReDoS, the regex:   /\^\[[^\]]*]|\^(.)/g   was replaced by:   /\^\[[^^[\]]*]|\^(.)/g
	// The exploit was possible with a string like: '^['.repeat(bigNumber)
	return string.unicode.width( str.replace( /\^\[[^^[\]]*]|\^(.)/g , ( match , second ) => {
(function(t){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=t()}else if(typeof define==="function"&&define.amd){define([],t)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.TerminalKit=t()}})(function(){var n,t,e;return function(){function f(s,o,a){function u(r,t){if(!o[r]){if(!s[r]){var e="function"==typeof require&&require;if(!t&&e)return e(r,!0);if(l)return l(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=o[r]={exports:{}};s[r][0].call(n.exports,function(t){var e=s[r][1][t];return u(e||t)},n,n.exports,f,s,o,a)}return o[r].exports}for(var l="function"==typeof require&&require,t=0;t<a.length;t++)u(a[t]);return u}return f}()({1:[function(t,e,r){"use strict";const l=t("./termkit.js");const i=[{names:["red"],code:"#e32322"},{names:["orange"],code:"#f18e1c"},{names:["gold","yellow-orange","amber"],code:"#fdc60b"},{names:["yellow"],code:"#f4e500"},{names:["chartreuse","yellow-green"],code:"#8cbb26"},{names:["green"],code:"#25ad28"},{names:["turquoise","turquoise-green"],code:"#1bc17d"},{names:["cyan","turquoise-blue"],code:"#0dc0cd"},{names:["blue"],code:"#2a60b0"},{names:["indigo"],code:"#3b3ba2"},{names:["violet","purple"],code:"#713795"},{names:["magenta"],code:"#bd0a7d"}];const n=[{names:["crimson"],code:"#dc143c"},{names:["vermilion","cinnabar"],code:"#e34234"},{names:["brown"],code:"#a52a2a"},{names:["bronze"],code:"#cd7f32"},{names:["coquelicot"],code:"#ff3800"},{names:["coral-pink"],code:"#f88379"},{names:["see-green"],code:"#2e8b57"},{names:["medium-spring-green"],code:"#00fa9a"},{names:["olivine"],code:"#9ab973"},{names:["royal-blue"],code:"#4169e1"},{names:["purple"],code:"#800080"},{names:["lavender-purple"],code:"#967bb6"},{names:["pink"],code:"#ffc0cb"}];const s={black:0,red:1,green:2,yellow:3,blue:4,magenta:5,violet:5,cyan:6,white:7,grey:8,gray:8,"bright-black":8,"bright-red":9,"bright-green":10,"bright-yellow":11,"bright-blue":12,"bright-magenta":13,"bright-violet":13,"bright-cyan":14,"bright-white":15};function o(t={}){this.term=t.term||l.terminal;this.system=!!t.system;this.adaptivePaletteDef=this.system?null:t.adaptivePaletteDef||i;this.extraPaletteDef=this.system?null:t.extraPaletteDef||n;this.escape=[];this.bgEscape=[];this.chromaColors=[];this.colorIndex={};this.colorNameToIndex=this.colorNameToIndex.bind(this);this.generate()}e.exports=o;o.prototype.colorNameToIndex=function(t){t=t.toLowerCase();return this.colorIndex[t]||l.colorNameToIndex(t)};o.prototype.generate=function(){this.generateDefaultMapping();this.generateAnsiColorNames();this.generateAdaptive();this.generateExtra();this.generateGrayscale()};o.prototype.generateDefaultMapping=function(){var t;for(t=0;t<256;t++){this.escape[t]=this.term.str.color256(t);this.bgEscape[t]=this.term.str.bgColor256(t)}};o.prototype.generateAnsiColorNames=function(){var t,e;for(t in s){e=t.replace(/-/g,"");this.colorIndex[t]=s[t];if(e!==t){this.colorIndex[e]=s[t]}}};o.prototype.generateAdaptive=function(){if(this.system){return}var t,e,r,i,n,s,o,a,u;n=this.adaptivePaletteDef.map(t=>l.chroma(t.code));i=16;for(r=0;r>=-2;r--){if(r>0){o="!".repeat(r)}else if(r<0){o="~".repeat(-r)}else{o=""}for(e=2;e>=-3;e--){if(e>0){a="+".repeat(e)}else if(e<0){a="-".repeat(-e)}else{a=""}u=o+a;for(t=0;t<12;t++){s=this.clStep(n[t],r,e);this.addColor(i,s,this.adaptivePaletteDef[t].names,"@",u);i++}}}};o.prototype.generateExtra=function(){if(this.system){return}var t,e;e=232;for(t=0;t<13&&t<this.extraPaletteDef.length;t++){this.addColor(e,l.chroma(this.extraPaletteDef[t].code),this.extraPaletteDef[t].names,"*");e++}};const a=[["black"],["darkest-gray"],["darker-gray"],["dark-gray"],["dark-medium-gray"],["medium-gray","gray"],["light-medium-gray"],["light-gray"],["lighter-gray"],["lightest-gray"],["white"]];o.prototype.generateGrayscale=function(){if(this.system){return}var t,e,r;e=245;for(t=0;t<=10;t++){r=l.chroma(0,0,10*t,"hcl");this.addColor(e,r,a[t],"@");e++}};o.prototype.getRgb=function(t){var e=this.chromaColors[t];if(!e){return null}var[r,i,n]=e.rgb();return{r:r,g:i,b:n}};o.prototype.addColor=function(r,t,e,i="",n=""){var s,[o,a,u]=t.rgb();this.chromaColors[r]=t;if(this.term.support.trueColor){this.escape[r]=this.term.str.colorRgb(o,a,u);this.bgEscape[r]=this.term.str.bgColorRgb(o,a,u)}else if(this.term.support["256colors"]){s=this.term.registerForRgb({r:o,g:a,b:u},o===a&&a===u?232:0,255);this.escape[r]=this.term.str.color256(s);this.bgEscape[r]=this.term.str.bgColor256(s)}else{s=this.term.registerForRgb({r:o,g:a,b:u},0,15);this.escape[r]=this.term.str.color256(s);this.bgEscape[r]=this.term.str.bgColor256(s)}e.forEach(t=>{var e=i+t.replace(/-/g,"")+n;t=i+t+n;this.colorIndex[t]=r;if(e!==t){this.colorIndex[e]=r}})};const f=1.1;o.prototype.clStep=function(t,e,r,i=true){var n,s,o,a,u,l;if(!e&&!r){return t}n=t.get("hcl.c");s=t.get("hcl.l");n*=(e>0?1.6:1.7)**e;s*=(r>0?1.2:1.35)**r;t=t.set("hcl.c",n).set("hcl.l",s);if(!i||!t.clipped){return t}l=Math.abs(r)>=e;for(;;){o=t._rgb._unclipped;o.length=3;if(o.every(t=>t>-5&&t<260)){return t}u=[...o].sort();if(u[2]>=256){a=(u[0]+u[1]+u[2])/3;if(l){n=t.get("hcl.c");n/=f;t=t.set("hcl.c",n)}else{s=t.get("hcl.l");s/=f;t=t.set("hcl.l",s)}if(a>255){return t}}else if(u[1]<0){a=(u[0]+u[1]+u[2])/3;if(l){n=t.get("hcl.c");n/=f;t=t.set("hcl.c",n)}else{s=t.get("hcl.l");s*=f;t=t.set("hcl.l",s)}if(a<0){return t}}else{return t}}}},{"./termkit.js":50}],2:[function(t,e,r){"use strict";const s=t("./termkit.js");function d(t,e,r,i){var n=t;this.xmin=0;this.xmax=0;this.ymin=0;this.ymax=0;this.width=0;this.height=0;this.isNull=true;if(n&&(typeof n==="object"||typeof n==="function")){if(n instanceof s.Terminal){this.set({xmin:1,ymin:1,xmax:n.width,ymax:n.height})}else if(n instanceof s.ScreenBuffer){this.set({xmin:0,ymin:0,xmax:n.width-1,ymax:n.height-1})}else if(n instanceof s.TextBuffer){this.set({xmin:0,ymin:0,xmax:n.width-1,ymax:n.height-1})}else if(n instanceof d){this.set(n)}else if(n.xmin!==undefined||n.ymin!==undefined||n.xmax!==undefined||n.ymax!==undefined){this.set({xmin:n.xmin!==undefined?n.xmin:0,ymin:n.ymin!==undefined?n.ymin:0,xmax:n.xmax!==undefined?n.xmax:1,ymax:n.ymax!==undefined?n.ymax:1})}else if(n.x!==undefined||n.y!==undefined||n.width!==undefined||n.height!==undefined){this.set({xmin:n.x!==undefined?n.x:0,ymin:n.y!==undefined?n.y:0,xmax:n.width!==undefined?n.x+n.width-1:1,ymax:n.height!==undefined?n.y+n.height-1:1})}}else{this.set({xmin:t!==undefined?t:0,ymin:e!==undefined?e:0,xmax:r!==undefined?r:1,ymax:i!==undefined?i:1})}}e.exports=d;d.create=(...t)=>new d(...t);d.prototype.set=function(t){if(t.xmin!==undefined){this.xmin=Math.floor(t.xmin)}if(t.xmax!==undefined){this.xmax=Math.floor(t.xmax)}if(t.ymin!==undefined){this.ymin=Math.floor(t.ymin)}if(t.ymax!==undefined){this.ymax=Math.floor(t.ymax)}this.width=this.xmax-this.xmin+1;this.height=this.ymax-this.ymin+1;this.isNull=this.xmin>this.xmax||this.ymin>this.ymax};d.prototype.setSize=function(t){if(t.width!==undefined){this.width=Math.floor(t.width);this.xmax=this.xmin+this.width-1}if(t.height!==undefined){this.height=Math.floor(t.height);this.ymax=this.ymin+this.height-1}this.isNull=this.xmin>this.xmax||this.ymin>this.ymax};d.prototype.isInside=function(t,e){return t>=this.xmin&&t<=this.xmax&&e>=this.ymin&&e<=this.ymax};d.prototype.clip=function(t,e,r,i){var n=this;e=e||0;r=r||0;n.set({xmin:Math.max(n.xmin,t.xmin-e),ymin:Math.max(n.ymin,t.ymin-r),xmax:Math.min(n.xmax,t.xmax-e),ymax:Math.min(n.ymax,t.ymax-r)});if(i){t.set({xmin:Math.max(t.xmin,n.xmin+e),ymin:Math.max(t.ymin,n.ymin+r),xmax:Math.min(t.xmax,n.xmax+e),ymax:Math.min(t.ymax,n.ymax+r)})}return this};d.prototype.merge=function(t){this.set({xmin:Math.min(this.xmin,t.xmin),ymin:Math.min(this.ymin,t.ymin),xmax:Math.max(this.xmax,t.xmax),ymax:Math.max(this.ymax,t.ymax)});return this};d.wrappingRect=function(t){var e=[],r,i,n,s;r={srcRect:new d(t.srcRect),dstRect:new d(t.dstRect),offsetX:t.offsetX,offsetY:t.offsetY};if(t.wrapOnly!=="y"){r.offsetX=r.offsetX%t.dstRect.width;if(r.offsetX<0){r.offsetX+=t.dstRect.width}}if(t.wrapOnly!=="x"){r.offsetY=r.offsetY%t.dstRect.height;if(r.offsetY<0){r.offsetY+=t.dstRect.height}}r.srcRect.clip(r.dstRect,r.offsetX,r.offsetY,true);if(!r.srcRect.isNull){e.push(r)}if(r.srcRect.width<t.srcRect.width&&t.wrapOnly!=="y"){i={srcRect:new d(t.srcRect),dstRect:new d(t.dstRect),offsetX:r.offsetX-t.dstRect.width,offsetY:r.offsetY};i.srcRect.clip(i.dstRect,i.offsetX,i.offsetY,true);if(!i.srcRect.isNull){e.push(i)}}if(r.srcRect.height<t.srcRect.height&&t.wrapOnly!=="x"){n={srcRect:new d(t.srcRect),dstRect:new d(t.dstRect),offsetX:r.offsetX,offsetY:r.offsetY-t.dstRect.height};n.srcRect.clip(n.dstRect,n.offsetX,n.offsetY,true);if(!n.srcRect.isNull){e.push(n)}}if(i&&n){s={srcRect:new d(t.srcRect),dstRect:new d(t.dstRect),offsetX:r.offsetX-t.dstRect.width,offsetY:r.offsetY-t.dstRect.height};s.srcRect.clip(s.dstRect,s.offsetX,s.offsetY,true);if(!s.srcRect.isNull){e.push(s)}}return e};d.regionIterator=function(t,e){var r,i,n,s,o,a,u,l,f;if(!t.multiply){t.multiply=1}if(!t.offsetX){t.offsetX=0}if(!t.offsetY){t.offsetY=0}if(t.dstClipRect){t.dstClipRect.clip(t.dstRect)}else{t.dstClipRect=new d(t.dstRect)}if(t.srcClipRect){t.srcClipRect.clip(t.srcRect)}else{t.srcClipRect=new d(t.srcRect)}t.srcClipRect.clip(t.dstClipRect,t.offsetX,t.offsetY,true);if(t.dstRect.isNull||t.srcClipRect.isNull||t.dstClipRect.isNull){return}switch(t.type){case"line":for(i=0;i<t.srcClipRect.height;i++){s=t.srcClipRect.ymin+i;a=t.dstClipRect.ymin+i;e({context:t.context,srcXmin:t.srcClipRect.xmin,srcXmax:t.srcClipRect.xmax,srcY:s,srcStart:(s*t.srcRect.width+t.srcClipRect.xmin)*t.multiply,srcEnd:(s*t.srcRect.width+t.srcClipRect.xmax+1)*t.multiply,dstXmin:t.dstClipRect.xmin,dstXmax:t.dstClipRect.xmax,dstY:a,dstStart:(a*t.dstRect.width+t.dstClipRect.xmin)*t.multiply,dstEnd:(a*t.dstRect.width+t.dstClipRect.xmax+1)*t.multiply})}break;case"reversedLine":for(i=t.srcClipRect.height-1;i>=0;i--){s=t.srcClipRect.ymin+i;a=t.dstClipRect.ymin+i;e({context:t.context,srcXmin:t.srcClipRect.xmin,srcXmax:t.srcClipRect.xmax,srcY:s,srcStart:(s*t.srcRect.width+t.srcClipRect.xmin)*t.multiply,srcEnd:(s*t.srcRect.width+t.srcClipRect.xmax+1)*t.multiply,dstXmin:t.dstClipRect.xmin,dstXmax:t.dstClipRect.xmax,dstY:a,dstStart:(a*t.dstRect.width+t.dstClipRect.xmin)*t.multiply,dstEnd:(a*t.dstRect.width+t.dstClipRect.xmax+1)*t.multiply})}break;case"cell":for(i=0;i<t.srcClipRect.height;i++){for(r=0;r<t.srcClipRect.width;r++){n=t.srcClipRect.xmin+r;s=t.srcClipRect.ymin+i;o=t.dstClipRect.xmin+r;a=t.dstClipRect.ymin+i;u=(s*t.srcRect.width+n)*t.multiply;l=(a*t.dstRect.width+o)*t.multiply;f=e({context:t.context,srcX:n,srcY:s,srcStart:u,srcEnd:u+t.multiply,dstX:o,dstY:a,dstStart:l,dstEnd:l+t.multiply,startOfBlitLine:!r,endOfBlitLine:r===t.srcClipRect.width-1});if(f){r++}}}break}};d.tileIterator=function(t,e){var r,i,n,s,o,a,u,l,f,h,c;if(!t.multiply){t.multiply=1}if(!t.offsetX){t.offsetX=0}if(!t.offsetY){t.offsetY=0}if(t.dstClipRect){t.dstClipRect.clip(t.dstRect)}else{t.dstClipRect=new d(t.dstRect)}if(t.srcClipRect){t.srcClipRect.clip(t.srcRect)}else{t.srcClipRect=new d(t.srcRect)}switch(t.type){case"cell":for(a=0;a<t.dstClipRect.height;a++){i=(a-t.offsetY)%t.srcClipRect.height;if(i<0){i+=t.srcClipRect.height}for(o=0;o<t.dstClipRect.width;o++){r=(o-t.offsetX)%t.srcClipRect.width;if(r<0){r+=t.srcClipRect.width}n=t.srcClipRect.xmin+r;s=t.srcClipRect.ymin+i;u=t.dstClipRect.xmin+o;l=t.dstClipRect.ymin+a;h=(s*t.srcRect.width+n)*t.multiply;c=(l*t.dstRect.width+u)*t.multiply;e({context:t.context,srcX:n,srcY:s,srcStart:h,srcEnd:h+t.multiply,dstX:u,dstY:l,dstStart:c,dstEnd:c+t.multiply})}}break;case"line":for(a=0;a<t.dstClipRect.height;a++){i=(a-t.offsetY)%t.srcClipRect.height;if(i<0){i+=t.srcClipRect.height}o=0;while(o<t.dstClipRect.width){r=(o-t.offsetX)%t.srcClipRect.width;if(r<0){r+=t.srcClipRect.width}f=Math.min(t.srcClipRect.width-r,t.dstClipRect.width-o);n=t.srcClipRect.xmin+r;s=t.srcClipRect.ymin+i;u=t.dstClipRect.xmin+o;l=t.dstClipRect.ymin+a;h=(s*t.srcRect.width+n)*t.multiply;c=(l*t.dstRect.width+u)*t.multiply;e({context:t.context,srcXmin:n,srcXmax:n+f-1,srcY:s,srcStart:h,srcEnd:h+f*t.multiply,dstXmin:u,dstXmax:u+f-1,dstY:l,dstStart:c,dstEnd:c+f*t.multiply});o+=f}}break}};d.wrapIterator=function(t,e){var r,i;i=d.wrappingRect({dstRect:t.dstClipRect,srcRect:t.srcClipRect,offsetX:t.offsetX,offsetY:t.offsetY,wrapOnly:t.wrap});for(r=0;r<i.length;r++){t.dstClipRect=i[r].dstRect;t.srcClipRect=i[r].srcRect;t.offsetX=i[r].offsetX;t.offsetY=i[r].offsetY;d.regionIterator(t,e)}}},{"./termkit.js":50}],3:[function(r,M,t){(function(I){(function(){"use strict";const t=r("./misc.js");const o=r("fs");const b=r("string-kit");const e=r("nextgen-events");function d(t={}){this.dst=t.dst;this.inline=!!t.inline;this.width=Math.floor(t.width)||(t.dst?t.dst.width:1);this.height=Math.floor(t.height)||(t.dst?t.dst.height:1);this.x=t.x!==undefined?t.x:t.dst&&t.dst instanceof m.Terminal?1:0;this.y=t.y!==undefined?t.y:t.dst&&t.dst instanceof m.Terminal?1:0;this.cx=0;this.cy=0;this.ch=false;this.lastCh=null;this.lastBuffer=null;this.lastBufferUpToDate=false;this.blending=t.blending||false;this.wrap=!!t.wrap;this.buffer=I.allocUnsafe(this.width*this.height*this.ITEM_SIZE);this.palette=t.palette||this.dst&&this.dst.palette;if(!t.noFill){this.fill()}}M.exports=d;d.prototype=Object.create(e.prototype);d.prototype.constructor=d;d.prototype.bitsPerColor=8;d.create=(...t)=>new d(...t);const m=r("./termkit.js");const h=m.Rect;d.createFromString=function(t,e){var r,i,n,s,o,a,u,l,f;if(!t){t={}}if(typeof e!=="string"){if(!e.toString){throw new Error("[terminal] ScreenBuffer.createFromDataString(): argument #1 should be a string or provide a .toString() method.")}e=e.toString()}e=m.stripControlChars(e,true).split("\n");a=0;u=e.length;s=t.attr!==undefined?t.attr:d.prototype.DEFAULT_ATTR;if(s&&typeof s==="object"&&!s.BYTES_PER_ELEMENT){s=d.object2attr(s)}o=s;if(t.transparencyChar){if(!t.transparencyType){o|=T}else{o|=t.transparencyType&T}}for(i=0;i<e.length;i++){l=b.unicode.width(e[i]);if(l>a){a=l}}f=new d({width:a,height:u});for(i=0;i<e.length;i++){if(!t.transparencyChar){f.put({x:0,y:i,attr:s},e[i])}else{n=e[i].length;for(r=0;r<n;r++){if(e[i][r]===t.transparencyChar){f.put({x:r,y:i,attr:o},e[i][r])}else{f.put({x:r,y:i,attr:s},e[i][r])}}}}return f};d.createFromChars=d.createFromString;d.prototype.setClearAttr=function(t){this.CLEAR_ATTR=this.object2attr(t);this.CLEAR_BUFFER=I.allocUnsafe(this.ITEM_SIZE);if(I.isBuffer(this.CLEAR_ATTR)){this.CLEAR_ATTR.copy(this.CLEAR_BUFFER)}else{this.CLEAR_BUFFER.writeInt32BE(this.CLEAR_ATTR,0)}this.CLEAR_BUFFER.write(" \0\0\0",this.ATTR_SIZE)};d.prototype.fill=function(t){var e,r,i,n,s,o,a,u,l=this.CLEAR_BUFFER,f=this.buffer;if(t&&typeof t==="object"){if(t.char||t.attr){l=I.allocUnsafe(this.ITEM_SIZE);r=t.attr!==undefined?t.attr:this.DEFAULT_ATTR;if(r&&typeof r==="object"&&!r.BYTES_PER_ELEMENT){r=this.object2attr(r)}this.writeAttr(l,r,0);i=t.char&&typeof t.char==="string"?t.char:" ";i=b.unicode.firstChar(m.stripControlChars(i));this.writeChar(l,i,0)}else if(t.clearBuffer){l=t.clearBuffer}if(t.buffer){f=t.buffer}n=t.start?Math.floor(t.start/this.ITEM_SIZE):0;s=t.end?Math.floor(t.end/this.ITEM_SIZE):f.length/this.ITEM_SIZE;o=t.region?t.region:null}else{n=0;s=f.length/this.ITEM_SIZE}if(o){a=new h(0,0,0,0);u=new h(o);u.clip(new h(this));if(u.isNull){return}h.tileIterator({type:"line",context:{srcBuffer:l,dstBuffer:this.buffer},srcRect:a,dstRect:new h(this),dstClipRect:u,multiply:this.ITEM_SIZE},this.blitterLineIterator.bind(this))}else{for(e=n;e<s;e++){l.copy(f,e*this.ITEM_SIZE)}}};d.prototype.clear=d.prototype.fill;d.prototype.preserveMarkupFormat=t.preserveMarkupFormat;d.prototype.markupOptions=t.markupOptions;d.prototype.put=function(u,t,...e){var r,i,l,f,h,c,d,p,n,g,s,y;if(!u){u={}}y=u.wrap!==undefined?u.wrap:this.wrap;l=h=Math.floor(u.x!==undefined?u.x:this.cx);f=c=Math.floor(u.y!==undefined?u.y:this.cy);d=1;p=0;switch(u.direction){case"left":d=-1;break;case"up":d=0;p=-1;break;case"down":d=0;p=1;break;case null:case"none":d=0;p=0;break}if(typeof u.dx==="number"){d=u.dx}if(typeof u.dy==="number"){p=u.dy}g=u.attr!==undefined?u.attr:this.DEFAULT_ATTR;if(g&&typeof g==="object"&&!g.BYTES_PER_ELEMENT){g=this.object2attr(g)}n=g;if(u.resumeAttr!==undefined){g=u.resumeAttr}if(typeof t!=="string"){if(t.toString){t=t.toString()}else{return}}if(e.length){t=u.markup===true?this.preserveMarkupFormat(t,...e):b.format(t,...e)}i=false;r=null;switch(u.markup){case"ansi":r=m.parseAnsi;break;case"legacyAnsi":r=m.parseAnsi;i=true;break;case true:r=m.parseMarkup;break}var o=t=>{var e,r,i,n,s=b.unicode.toArray(t),o,a=s.length;for(o=0;o<a;o++){r=(c*this.width+h)*this.ITEM_SIZE;i=s[o];n=i.charCodeAt(0);if(n<32||n===127){if(u.newLine&&(n===10||n===13)){if(d){h=l;c++}else{c=f;h++}continue}else{i=" ";n=32}}e=b.unicode.isFullWidth(i);if(e){if(h+e*d>=0&&h+e*(d||1)<this.width&&c>=0&&c<this.height){if(d<0){r-=this.ITEM_SIZE}if(this.hasTrailingFullWidth(this.buffer,r)&&h){this.removeFullWidth(this.buffer,r-this.ITEM_SIZE)}this.writeAttr(this.buffer,g,r,this.LEADING_FULLWIDTH);this.writeChar(this.buffer,i,r);r+=this.ITEM_SIZE;if(this.hasLeadingFullWidth(this.buffer,r)&&h<this.width-1){this.removeFullWidth(this.buffer,r+this.ITEM_SIZE)}this.writeAttr(this.buffer,g,r,this.TRAILING_FULLWIDTH);this.writeChar(this.buffer," ",r)}}else if(h>=0&&h<this.width&&c>=0&&c<this.height){if(this.hasLeadingFullWidth(this.buffer,r)&&h<this.width-1){this.removeFullWidth(this.buffer,r+this.ITEM_SIZE)}else if(this.hasTrailingFullWidth(this.buffer,r)&&h){this.removeFullWidth(this.buffer,r-this.ITEM_SIZE)}this.writeAttr(this.buffer,g,r);this.writeChar(this.buffer,i,r)}h+=d*(1+e);c+=p;if(y){if(h<0){h=this.width-1;c--}else if(h>=this.width){h=0;c++}}}};if(!u.markup){o(t)}else{s=this.attr2object(g);r(t,this.markupOptions).forEach(t=>{if(typeof t==="string"){o(t)}else{if(t.markup.reset){g=t.markup.special?this.DEFAULT_ATTR:n;s=this.attr2object(g)}else{Object.assign(s,t.markup);if(s.defaultColor&&s.color){delete s.defaultColor}if(s.bgDefaultColor&&s.bgColor){delete s.bgDefaultColor}g=this.object2attr(s,undefined,i)}if(t.markup.raw){o(t.markup.raw)}}})}this.cx=h;this.cy=c;return g};d.prototype.get=function(t){var e,r,i;if(!t){t={}}e=t.x!==undefined?t.x:this.cx;r=t.y!==undefined?t.y:this.cy;if(typeof e!=="number"||e<0||e>=this.width){return null}e=Math.floor(e);if(typeof r!=="number"||r<0||r>=this.height){return null}r=Math.floor(r);i=(r*this.width+e)*this.ITEM_SIZE;return{attr:this.attr2object(this.readAttr(this.buffer,i)),char:this.readChar(this.buffer,i)}};d.prototype.resize=function(t){t=new h(t);var e=-t.xmin,r=-t.ymin;var i=new h({xmin:0,ymin:0,xmax:t.width-1,ymax:t.height-1});t.clip(new h(this));if(i.isNull){return false}var n=I.allocUnsafe(i.width*i.height*this.ITEM_SIZE);this.fill({buffer:n});h.regionIterator({type:"line",context:{srcBuffer:this.buffer,dstBuffer:n},dstRect:i,dstClipRect:new h(i),srcRect:new h(this),srcClipRect:t,offsetX:e,offsetY:r,multiply:this.ITEM_SIZE},this.blitterLineIterator.bind(this));this.width=i.width;this.height=i.height;this.buffer=n;this.lastBuffer=null;this.emit("resize",this.width,this.height);return true};d.prototype.draw=function(t){if(!t||typeof t!=="object"){t={}}var e={dst:t.dst||this.dst,inline:t.inline!==undefined?!!t.inline:this.inline,offsetX:t.x!==undefined?Math.floor(t.x):Math.floor(this.x),offsetY:t.y!==undefined?Math.floor(t.y):Math.floor(this.y),dstClipRect:t.dstClipRect?new h(t.dstClipRect):undefined,srcClipRect:t.srcClipRect?new h(t.srcClipRect):undefined,delta:t.delta,blending:t.blending!==undefined?t.blending:this.blending,wrap:t.wrap,tile:t.tile};if(e.dst instanceof d){return this.blitter(e)}else if(e.dst instanceof m.Terminal){return this.terminalBlitter(e)}};d.prototype.moveTo=function(t,e){this.cx=Math.max(0,Math.min(t,this.width-1));this.cy=Math.max(0,Math.min(e,this.height-1))};d.prototype.drawCursor=function(t){if(!t||typeof t!=="object"){t={}}var e=t.dst||this.dst;if(e instanceof d){if(this.ch){e.ch=true}else{e.ch=false;e.moveTo(this.cx+this.x,this.cy+this.y)}}else if(e instanceof m.Terminal){if(this.ch){if(this.ch!==this.lastCh){e.hideCursor()}}else{if(this.ch!==this.lastCh){e.hideCursor(false)}e.moveTo(Math.max(1,Math.min(this.cx+this.x,e.width)),Math.max(1,Math.min(this.cy+this.y,e.height)))}this.lastCh=this.ch}};d.prototype.blitter=function(t){var e,r,i;e={type:"line",context:{srcBuffer:this.buffer,dstBuffer:t.dst.buffer,blending:t.blending},dstRect:new h(t.dst),srcRect:new h(this),dstClipRect:t.dstClipRect||new h(t.dst),srcClipRect:t.srcClipRect||new h(this),offsetX:t.offsetX,offsetY:t.offsetY,wrap:t.wrap,tile:t.tile,multiply:this.ITEM_SIZE};r="regionIterator";i=this.blitterLineIterator.bind(this);if(t.blending){e.type="cell";i=this.blitterCellBlendingIterator.bind(this)}if(t.wrap){r="wrapIterator"}else if(t.tile){r="tileIterator"}else{r="regionIterator"}h[r](e,i)};d.prototype.blitterLineIterator=function(t){if(t.dstStart>=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart,t.srcStart,t.srcEnd);this.removeLeadingFullWidth(t.context.dstBuffer,t.dstEnd-this.ITEM_SIZE);if(t.dstEnd<t.context.dstBuffer.length){this.removeTrailingFullWidth(t.context.dstBuffer,t.dstEnd)}};d.prototype.blitterCellBlendingIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart),r=e&T;if(r===T){return}if(t.startOfBlitLine&&t.dstStart>=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}if(t.endOfBlitLine&&t.dstEnd<t.context.dstBuffer.length){this.removeTrailingFullWidth(t.context.dstBuffer,t.dstEnd)}if(r===i&&!(t.endOfBlitLine||!(e&s))){t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart,t.srcStart,t.srcEnd);return}if(!(r&a)){t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart+3,t.srcStart+3,t.srcStart+4)}if(!(r&u)){t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart+2,t.srcStart+2,t.srcStart+3)}if(!(r&C)){t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart+1,t.srcStart+1,t.srcStart+2)}if(!(r&k)){if(t.endOfBlitLine&&e&s){this.writeChar(t.context.dstBuffer," ",t.dstStart)}else{t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart+this.ATTR_SIZE,t.srcStart+this.ATTR_SIZE,t.srcEnd)}}};d.prototype.terminalBlitter=function(t){var e,r,i,n;n={srcBuffer:this.buffer,blending:t.blending,term:t.dst,inline:t.inline,deltaEscapeSequence:t.dst.support.deltaEscapeSequence,rawTerm:t.dst.raw,lastAttr:null,sequence:"",cells:0,moves:0,attrs:0,writes:0};e={type:"line",context:n,dstRect:new h(t.dst),srcRect:new h(this),dstClipRect:t.dstClipRect,srcClipRect:t.srcClipRect,offsetX:t.offsetX,offsetY:t.offsetY,multiply:this.ITEM_SIZE};if(t.inline){e.dstRect.setSize({height:Infinity})}if(t.delta&&!t.inline){if(!this.lastBuffer||this.lastBuffer.length!==this.buffer.length){this.lastBuffer=I.from(this.buffer);i=this.terminalBlitterLineIterator.bind(this)}else if(this.lastBufferUpToDate){n.srcLastBuffer=this.lastBuffer;i=this.terminalBlitterCellIterator.bind(this);e.type="cell"}else{this.buffer.copy(this.lastBuffer);i=this.terminalBlitterLineIterator.bind(this)}this.lastBufferUpToDate=true}else{this.lastBufferUpToDate=false;i=this.terminalBlitterLineIterator.bind(this)}if(t.wrap){r="wrapIterator"}else if(t.tile){r="tileIterator"}else{r="regionIterator"}h[r](e,i);if(n.sequence.length){n.rawTerm(n.sequence);n.writes++}return{cells:n.cells,moves:n.moves,attrs:n.attrs,writes:n.writes}};d.prototype.terminalBlitterLineIterator=function(t){var e,r;if(!t.context.inline){t.context.sequence+=t.context.term.optimized.moveTo(t.dstXmin,t.dstY);t.context.moves++}for(e=t.srcStart;e<t.srcEnd;e+=this.ITEM_SIZE){r=this.readAttr(t.context.srcBuffer,e);if((r&T)===T){t.context.sequence+=t.context.term.optimized.right;continue}else if(r&A){continue}if((r&n)!==(t.context.lastAttr&n)){t.context.sequence+=t.context.lastAttr===null||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,r):this.generateDeltaEscapeSequence(t.context.term,r,t.context.lastAttr);t.context.lastAttr=r}t.context.sequence+=this.readChar(t.context.srcBuffer,e);t.context.cells++}if(t.context.inline){t.context.sequence+=t.context.term.optimized.styleReset+"\n";t.context.attrs++;t.context.lastAttr=null}if(t.context.sequence.length>O){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}};d.prototype.terminalBlitterCellIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);if(t.context.srcLastBuffer){if(e===this.readAttr(t.context.srcLastBuffer,t.srcStart)&&this.readChar(t.context.srcBuffer,t.srcStart)===this.readChar(t.context.srcLastBuffer,t.srcStart)){return}t.context.srcBuffer.copy(t.context.srcLastBuffer,t.srcStart,t.srcStart,t.srcEnd)}if((e&T)===T||e&A){return}t.context.cells++;if(t.dstX!==t.context.cx||t.dstY!==t.context.cy){t.context.sequence+=t.context.term.optimized.moveTo(t.dstX,t.dstY);t.context.moves++}if((e&n)!==(t.context.lastAttr&n)){t.context.sequence+=t.context.lastAttr===null||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,e):this.generateDeltaEscapeSequence(t.context.term,e,t.context.lastAttr);t.context.lastAttr=e;t.context.attrs++}t.context.sequence+=this.readChar(t.context.srcBuffer,t.srcStart);if(t.context.sequence.length>O){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}t.context.cy=t.dstY;if(e&s){t.context.cx=t.dstX+2;return true}t.context.cx=t.dstX+1};d.fromNdarrayImage=function(t,e){var r=e.terminal||m.terminal;var i,n=t.shape[0],s,o=Math.ceil(t.shape[1]/2),a=t.shape[2]===4,u=r.support["256colors"]?255:15,l,f,h={};var c=new d({width:n,height:o,blending:true,noFill:true});for(i=0;i<n;i++){for(s=0;s<o;s++){l=r.registerForRgbCache(h,t.get(i,s*2,0),t.get(i,s*2,1),t.get(i,s*2,2),0,u,1);if(s*2+1<t.shape[1]){f=r.registerForRgbCache(h,t.get(i,s*2+1,0),t.get(i,s*2+1,1),t.get(i,s*2+1,2),0,u,1);c.put({x:i,y:s,attr:{color:l,fgTransparency:a&&t.get(i,s*2,3)<127,bgColor:f,bgTransparency:a&&t.get(i,s*2+1,3)<127}},"▀")}else{c.put({x:i,y:s,attr:{color:l,fgTransparency:a&&t.get(i,s*2,3)<127,bgTransparency:true}},"▀")}}}return c};d.loadImage=m.image.load.bind(d,d.fromNdarrayImage);d.prototype.dumpChars=function(){var t,e,r,i="";for(t=0;t<this.height;t++){for(e=0;e<this.width;e++){r=(t*this.width+e)*this.ITEM_SIZE;i+=this.readChar(this.buffer,r)}i+="\n"}return i};d.prototype.dump=function(){var t,e,r,i="",n;for(t=0;t<this.height;t++){for(e=0;e<this.width;e++){r=(t*this.width+e)*this.ITEM_SIZE;n=this.readChar(this.buffer,r);i+=n+(b.unicode.isFullWidth(n)?" ":"  ");i+=b.format("%x%x%x%x ",this.buffer.readUInt8(r),this.buffer.readUInt8(r+1),this.buffer.readUInt8(r+2),this.buffer.readUInt8(r+3))}i+="\n"}return i};d.prototype.readAttr=function(t,e){return t.readInt32BE(e)};d.prototype.writeAttr=function(t,e,r,i=0){return t.writeInt32BE(e|i,r)};d.prototype.hasLeadingFullWidth=function(t,e){return!!(t.readInt32BE(e)&s)};d.prototype.hasTrailingFullWidth=function(t,e){return!!(t.readInt32BE(e)&A)};d.prototype.removeLeadingFullWidth=function(t,e){var r=t.readInt32BE(e);if(!(r&s)){return}r^=s;t.writeInt32BE(r,e);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};d.prototype.removeTrailingFullWidth=function(t,e){var r=t.readInt32BE(e);if(!(r&A)){return}r^=A;t.writeInt32BE(r,e);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};d.prototype.removeFullWidth=function(t,e){var r=t.readInt32BE(e);if(!(r&R)){return}r=r&B;t.writeInt32BE(r,e);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};d.prototype.readChar=function(t,e){var r;e+=this.ATTR_SIZE;if(t[e]<128){r=1}else if(t[e]<192){return"\0"}else if(t[e]<224){r=2}else if(t[e]<240){r=3}else if(t[e]<248){r=4}else if(t[e]<252){r=5}else{r=6}if(r>this.CHAR_SIZE){return"\0"}return t.toString("utf8",e,e+r)};d.prototype.writeChar=function(t,e,r){return t.write(e,r+this.ATTR_SIZE,this.CHAR_SIZE)};d.prototype.generateEscapeSequence=function(t,e){var r=this.palette||t.palette;var i=t.optimized.styleReset+(e&S?t.optimized.defaultColor:r.escape[e&255])+(e&E?t.optimized.bgDefaultColor:r.bgEscape[e>>>8&255]);if(e&f){i+=t.optimized.bold}if(e&c){i+=t.optimized.dim}if(e&p){i+=t.optimized.italic}if(e&g){i+=t.optimized.underline}if(e&y){i+=t.optimized.blink}if(e&v){i+=t.optimized.inverse}if(e&w){i+=t.optimized.hidden}if(e&_){i+=t.optimized.strike}return i};d.prototype.generateDeltaEscapeSequence=function(t,e,r){var i=this.palette||t.palette;var n="",s=e&255,o=r&255,a=e>>>8&255,u=r>>>8&255;if(e&S){if(!(r&S)){n+=t.optimized.defaultColor}}else if(s!==o||r&S){n+=i.escape[s]}if(e&E){if(!(r&E)){n+=t.optimized.bgDefaultColor}}else if(a!==u||r&E){n+=i.bgEscape[a]}if((e&l)!==(r&l)){if((e&x)!==(r&x)){if(r&f&&!(e&f)||r&c&&!(e&c)){n+=t.optimized.noBold;if(e&f){n+=t.optimized.bold}if(e&c){n+=t.optimized.dim}}else{if(e&f&&!(r&f)){n+=t.optimized.bold}if(e&c&&!(r&c)){n+=t.optimized.dim}}}if((e&p)!==(r&p)){n+=e&p?t.optimized.italic:t.optimized.noItalic}if((e&g)!==(r&g)){n+=e&g?t.optimized.underline:t.optimized.noUnderline}if((e&y)!==(r&y)){n+=e&y?t.optimized.blink:t.optimized.noBlink}if((e&v)!==(r&v)){n+=e&v?t.optimized.inverse:t.optimized.noInverse}if((e&w)!==(r&w)){n+=e&w?t.optimized.hidden:t.optimized.noHidden}if((e&_)!==(r&_)){n+=e&_?t.optimized.strike:t.optimized.noStrike}}return n};d.prototype.vScroll=function(t,e,r,i,n){if(!t){return}if(typeof e==="boolean"){n=e;e=r=i=undefined}if(e===undefined||e===null){e=this.DEFAULT_ATTR}else if(e&&typeof e==="object"&&!e.BYTES_PER_ELEMENT){e=this.object2attr(e)}if(r===undefined||r===null){r=0;i=this.height-1}else{if(r<0){r=0}if(i>this.height-1){i=this.height-1}}var s=t*this.width*this.ITEM_SIZE,o=r*this.width*this.ITEM_SIZE,a=(i+1)*this.width*this.ITEM_SIZE;if(s>0){this.buffer.copy(this.buffer,o+s,o,a-s);this.fill({start:o,end:o+s})}else{this.buffer.copy(this.buffer,o,o-s,a);this.fill({start:a+s,end:a})}if(n&&this.dst instanceof m.Terminal){if(this.lastBufferUpToDate&&this.lastBuffer){if(s>0){this.lastBuffer.copy(this.lastBuffer,o+s,o,a-s);this.fill({buffer:this.lastBuffer,start:o,end:o+s})}else{this.lastBuffer.copy(this.lastBuffer,o,o-s,a);this.fill({buffer:this.lastBuffer,start:a+s,end:a})}}this.dst.scrollingRegion(this.y+r,this.y+i);if(t>0){this.dst.scrollDown(t)}else{this.dst.scrollUp(-t)}this.dst.resetScrollingRegion()}};d.prototype.copyRegion=function(t,e,r,i){var n=new h(this),s=new h(t),o=new h(e);o.setSize(s);s.clip(n);o.clip(n);if(s.isNull){return}if(!o.isNull){h.regionIterator({type:o.ymin-s.ymin>0?"reversedLine":"line",context:{srcBuffer:this.buffer,dstBuffer:this.buffer},srcRect:new h(this),srcClipRect:s,dstRect:new h(this),dstClipRect:o,offsetX:o.xmin-s.xmin,offsetY:o.ymin-s.ymin,multiply:this.ITEM_SIZE},this.blitterLineIterator.bind(this))}if(r){throw new Error("Move is not coded ATM")}};d.attr2object=function(t){var e={};if(t&S){e.color=0;e.defaultColor=true}else{e.color=t&255}if(t&E){e.bgColor=0;e.bgDefaultColor=true}else{e.bgColor=t>>>8&255}if(t&f){e.bold=true}if(t&c){e.dim=true}if(t&p){e.italic=true}if(t&g){e.underline=true}if(t&y){e.blink=true}if(t&v){e.inverse=true}if(t&w){e.hidden=true}if(t&_){e.strike=true}if(t&a){e.fgTransparency=true}if(t&u){e.bgTransparency=true}if(t&C){e.styleTransparency=true}if(t&k){e.charTransparency=true}if((t&T)===T){e.transparency=true}return e};d.prototype.attr2object=d.attr2object;d.object2attr=function(t,e,r=false){var i=0,n=false,s=false;if(!t||typeof t!=="object"){t={}}e=e||m.colorNameToIndex;if(t.bold){if(r){n=true}else{i|=f}}if(t.dim){i|=c}if(t.italic){i|=p}if(t.underline){i|=g}if(t.blink){if(r){s=true}else{i|=y}}if(t.inverse){i|=v}if(t.hidden){i|=w}if(t.strike){i|=_}if(typeof t.color==="string"){if(t.color==="default"){t.color=0;t.defaultColor=true}else{t.color=e(t.color)}}if(typeof t.color!=="number"||t.color<0||t.color>255){t.color=0;t.defaultColor=true}else{t.color=Math.floor(t.color);if(r&&t.color<=15){if(n&&t.color<=7){t.color+=8}else if(!n&&t.color>=8){t.color-=8}}}i+=t.color;if(typeof t.bgColor==="string"){if(t.bgColor==="default"){t.bgColor=0;t.bgDefaultColor=true}else{t.bgColor=e(t.bgColor)}}if(typeof t.bgColor!=="number"||t.bgColor<0||t.bgColor>255){t.bgColor=0;t.bgDefaultColor=true}else{t.bgColor=Math.floor(t.bgColor);if(r&&t.bgColor<=15){if(s&&t.bgColor<=7){t.bgColor+=8}else if(!s&&t.bgColor>=8){t.bgColor-=8}}}i+=t.bgColor<<8;if(t.defaultColor){i|=S}if(t.bgDefaultColor){i|=E}if(t.transparency){i|=T}if(t.fgTransparency){i|=a}if(t.bgTransparency){i|=u}if(t.styleTransparency){i|=C}if(t.charTransparency){i|=k}return i};d.prototype.object2attr=function(t,e=this.palette&&this.palette.colorNameToIndex,r=false){return d.object2attr(t,e,r)};d.attrAndObject=function(t,e,r){if(!e||typeof e!=="object"){return t}r=r||m.colorNameToIndex;if(e.defaultColor||e.color==="default"){t-=t&255;t|=S}else if(typeof e.color==="string"){t=t-(t&255)+r(e.color);if(t&S){t^=S}}else if(typeof e.color==="number"&&e.color>=0&&e.color<=255){t=t-(t&255)+e.color;if(t&S){t^=S}}if(e.bgDefaultColor||e.bgColor==="default"){t-=(t>>>8&255)<<8;t|=E}else if(typeof e.bgColor==="string"){t=t-((t>>>8&255)<<8)+(r(e.bgColor)<<8);if(t&E){t^=E}}else if(typeof e.bgColor==="number"&&e.bgColor>=0&&e.bgColor<=255){t=t-((t>>>8&255)<<8)+(e.bgColor<<8);if(t&E){t^=E}}if(e.bold===true){t|=f}else if(e.bold===false){t&=~f}if(e.dim===true){t|=c}else if(e.dim===false){t&=~c}if(e.italic===true){t|=p}else if(e.italic===false){t&=~p}if(e.underline===true){t|=g}else if(e.underline===false){t&=~g}if(e.blink===true){t|=y}else if(e.blink===false){t&=~y}if(e.inverse===true){t|=v}else if(e.inverse===false){t&=~v}if(e.hidden===true){t|=w}else if(e.hidden===false){t&=~w}if(e.strike===true){t|=_}else if(e.strike===false){t&=~_}if(e.transparency===true){t|=T}else if(e.transparency===false){t&=~T}if(e.fgTransparency===true){t|=a}else if(e.fgTransparency===false){t&=~a}if(e.bgTransparency===true){t|=u}else if(e.bgTransparency===false){t&=~u}if(e.styleTransparency===true){t|=C}else if(e.styleTransparency===false){t&=~C}if(e.charTransparency===true){t|=k}else if(e.charTransparency===false){t&=~k}return t};d.prototype.attrAndObject=function(t,e){return d.attrAndObject(t,e,this.palette&&this.palette.colorNameToIndex)};d.attrSelect=d.prototype.attrSelect=t=>t|v;d.attrUnselect=d.prototype.attrUnselect=t=>t&~v;const i=0;const l=255<<16;const f=1<<16;const c=2<<16;const p=4<<16;const g=8<<16;const y=16<<16;const v=32<<16;const w=64<<16;const _=128<<16;const x=f|c;const a=1<<24;const u=2<<24;const C=4<<24;const k=8<<24;const T=a|u|C|k;const S=16<<24;const E=32<<24;const n=255+(255<<8)+(255<<16)+T+S+E;const s=64<<24;const A=128<<24;const R=s|A;const B=~R;const O=1e4;const P=40;d.prototype.ATTR_SIZE=4;d.prototype.CHAR_SIZE=4;d.prototype.ITEM_SIZE=d.prototype.ATTR_SIZE+d.prototype.CHAR_SIZE;d.DEFAULT_ATTR=d.prototype.DEFAULT_ATTR=d.object2attr({defaultColor:true,bgDefaultColor:true});d.prototype.CLEAR_ATTR=d.object2attr({defaultColor:true,bgDefaultColor:true,transparency:true});d.prototype.CLEAR_BUFFER=I.allocUnsafe(d.prototype.ITEM_SIZE);d.prototype.CLEAR_BUFFER.writeInt32BE(d.prototype.CLEAR_ATTR,0);d.prototype.CLEAR_BUFFER.write(" \0\0\0",d.prototype.ATTR_SIZE);d.prototype.LEADING_FULLWIDTH=s;d.prototype.TRAILING_FULLWIDTH=A;d.loadSyncV1=function(t){var e,r,i,n,s;e=o.readFileSync(t);if(e.length<P){throw new Error("No header found: this is not a ScreenBuffer file")}if(e[0]!==83||e[1]!==66){throw new Error("Magic number mismatch: this is not a ScreenBuffer file")}r=e.readUInt16BE(4);i=e.readUInt16BE(6);n=P+r*i*d.prototype.ITEM_SIZE;if(e.length!==n){throw new Error("Bad file size: this is not a ScreenBuffer file")}s=new d({width:r,height:i});e.copy(s.buffer,0,P);return s};d.prototype.saveSyncV1=function(t){var e;e=I.allocUnsafe(P+this.buffer.length);e.fill(0,0,P);e[0]=83;e[1]=66;e.writeUInt16BE(this.width,4);e.writeUInt16BE(this.height,6);this.buffer.copy(e,P);o.writeFileSync(t,e)};d.loadSyncV2=function(t){var e,r,i,n;r=o.readFileSync(t);if(r.length<3||r.toString("ascii",0,3)!=="SB\n"){throw new Error("Magic number mismatch: this is not a ScreenBuffer file")}for(e=3;e<r.length;e++){if(r[e]===10){break}}if(e===r.length){throw new Error("No header found: this is not a ScreenBuffer file")}try{i=JSON.parse(r.toString("utf8",3,e))}catch(t){throw new Error("No correct one-lined JSON header found: this is not a ScreenBuffer file")}if(i.version===undefined||i.width===undefined||i.height===undefined){throw new Error("Missing mandatory header data, this is a corrupted or obsolete ScreenBuffer file")}if(i.bitsPerColor&&i.bitsPerColor!==d.prototype.bitsPerColor){throw new Error("Bad Bits Per Color: "+i.bitsPerColor+" (should be "+d.prototype.bitsPerColor+")")}if(r.length!==e+1+i.width*i.height*d.prototype.ITEM_SIZE){throw new Error("Bad file size: this is a corrupted ScreenBuffer file")}n=new d({width:i.width,height:i.height});r.copy(n.buffer,0,e+1);return n};d.prototype.saveSyncV2=function(t){var e,r;r={version:2,width:this.width,height:this.height,bpp:this.bpp};r="SB\n"+JSON.stringify(r)+"\n";e=I.allocUnsafe(r.length+this.buffer.length);e.write(r);this.buffer.copy(e,r.length);o.writeFileSync(t,e)};d.loadSync=d.loadSyncV2;d.prototype.saveSync=d.prototype.saveSyncV2}).call(this)}).call(this,r("buffer").Buffer)},{"./misc.js":42,"./termkit.js":50,buffer:147,fs:136,"nextgen-events":72,"string-kit":123}],4:[function(H,N,t){(function(W){(function(){"use strict";const e=H("./ScreenBuffer.js");const s=H("fs");const h=H("string-kit");function c(t={}){e.call(this,t)}N.exports=c;const d=H("./termkit.js");c.prototype=Object.create(e.prototype);c.prototype.constructor=c;c.prototype.bitsPerColor=24;c.create=(...t)=>new c(...t);c.createFromString=function(t,e){var r,i,n,s,o,a,u,l,f;if(!t){t={}}if(typeof e!=="string"){if(!e.toString){throw new Error("[terminal] ScreenBufferHD.createFromDataString(): argument #1 should be a string or provide a .toString() method.")}e=e.toString()}e=d.stripControlChars(e,true).split("\n");a=0;u=e.length;s=t.attr!==undefined?t.attr:c.prototype.DEFAULT_ATTR;if(s&&typeof s==="object"&&!s.BYTES_PER_ELEMENT){s=c.object2attr(s)}o=s;if(t.transparencyChar){if(!t.transparencyType){o|=c.prototype.TRANSPARENCY}else{o|=t.transparencyType&c.prototype.TRANSPARENCY}}for(i=0;i<e.length;i++){l=h.unicode.width(e[i]);if(l>a){a=l}}f=new c({width:a,height:u});for(i=0;i<e.length;i++){if(!t.transparencyChar){f.put({x:0,y:i,attr:s},e[i])}else{n=e[i].length;for(r=0;r<n;r++){if(e[i][r]===t.transparencyChar){f.put({x:r,y:i,attr:o},e[i][r])}else{f.put({x:r,y:i,attr:s},e[i][r])}}}}return f};c.createFromChars=c.createFromString;var t=H("./colorScheme/gnome.json").map(t=>({color:{r:t.r,g:t.g,b:t.b}}));var r=t.map(t=>({bgColor:{r:t.r,g:t.g,b:t.b}}));c.prototype.markupToAttrObject={normal:{"-":{dim:true},"+":{bold:true},_:{underline:true},"/":{italic:true},"!":{inverse:true},k:t[0],r:t[1],g:t[2],y:t[3],b:t[4],m:t[5],c:t[6],w:t[7],K:t[8],R:t[9],G:t[10],Y:t[11],B:t[12],M:t[13],C:t[14],W:t[15]},background:{k:r[0],r:r[1],g:r[2],y:r[3],b:r[4],m:r[5],c:r[6],w:r[7],K:r[8],R:r[9],G:r[10],Y:r[11],B:r[12],M:r[13],C:r[14],W:r[15]}};c.prototype.blitterCellBlendingIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);var r=c.blendFn.normal;var i=1;var n=false;if(typeof t.context.blending==="object"){if(t.context.blending.fn){r=t.context.blending.fn}if(t.context.blending.opacity!==undefined){i=t.context.blending.opacity}if(t.context.blending.blendSrcFgWithDstBg){n=true}}if(e[v]&O&&e[v]&P&&(!i||e[f]===0&&e[b]===0)){return}if(t.startOfBlitLine&&t.dstStart>=this.ITEM_SIZE){this.removeLeadingFullWidth(t.context.dstBuffer,t.dstStart-this.ITEM_SIZE)}if(t.endOfBlitLine&&t.dstEnd<t.context.dstBuffer.length){this.removeTrailingFullWidth(t.context.dstBuffer,t.dstEnd)}if(!(e[v]&O)&&!(e[v]&P)&&e[f]===255&&e[b]===255&&i===1&&r===c.blendFn.normal&&!(t.endOfBlitLine||!(e[v]&M))){t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart,t.srcStart,t.srcEnd);return}var s;if(e[f]){s=i*e[f]/255;if(n){t.context.dstBuffer[t.dstStart+a]=o(t.context.srcBuffer[t.srcStart+a],t.context.dstBuffer[t.dstStart+p],s,r);t.context.dstBuffer[t.dstStart+u]=o(t.context.srcBuffer[t.srcStart+u],t.context.dstBuffer[t.dstStart+g],s,r);t.context.dstBuffer[t.dstStart+l]=o(t.context.srcBuffer[t.srcStart+l],t.context.dstBuffer[t.dstStart+y],s,r);t.context.dstBuffer[t.dstStart+f]=o(t.context.srcBuffer[t.srcStart+f],t.context.dstBuffer[t.dstStart+b],i,c.blendFn.screen)}else{t.context.dstBuffer[t.dstStart+a]=o(t.context.srcBuffer[t.srcStart+a],t.context.dstBuffer[t.dstStart+a],s,r);t.context.dstBuffer[t.dstStart+u]=o(t.context.srcBuffer[t.srcStart+u],t.context.dstBuffer[t.dstStart+u],s,r);t.context.dstBuffer[t.dstStart+l]=o(t.context.srcBuffer[t.srcStart+l],t.context.dstBuffer[t.dstStart+l],s,r);t.context.dstBuffer[t.dstStart+f]=o(t.context.srcBuffer[t.srcStart+f],t.context.dstBuffer[t.dstStart+f],i,c.blendFn.screen)}}if(e[b]){s=i*e[b]/255;t.context.dstBuffer[t.dstStart+p]=o(t.context.srcBuffer[t.srcStart+p],t.context.dstBuffer[t.dstStart+p],s,r);t.context.dstBuffer[t.dstStart+g]=o(t.context.srcBuffer[t.srcStart+g],t.context.dstBuffer[t.dstStart+g],s,r);t.context.dstBuffer[t.dstStart+y]=o(t.context.srcBuffer[t.srcStart+y],t.context.dstBuffer[t.dstStart+y],s,r);t.context.dstBuffer[t.dstStart+b]=o(t.context.srcBuffer[t.srcStart+b],t.context.dstBuffer[t.dstStart+b],i,c.blendFn.screen)}if(!(e[v]&O)){t.context.dstBuffer[t.dstStart+m]=t.context.srcBuffer[t.srcStart+m]}if(!(e[v]&P)){if(t.endOfBlitLine&&e[v]&M){this.writeChar(t.context.dstBuffer," ",t.dstStart)}else{t.context.srcBuffer.copy(t.context.dstBuffer,t.dstStart+this.ATTR_SIZE,t.srcStart+this.ATTR_SIZE,t.srcEnd)}}};function o(t,e,r,i){return Math.round(i(t,e)*r+e*(1-r))}c.blendFn={normal:t=>t,multiply:(t,e)=>255*(t/255*(e/255)),screen:(t,e)=>255*(1-(1-t/255)*(1-e/255)),overlay:(t,e)=>e<=127?255*(2*(t/255)*(e/255)):255*(1-2*(1-t/255)*(1-e/255)),hardLight:(t,e)=>t<=127?255*(2*(t/255)*(e/255)):255*(1-2*(1-t/255)*(1-e/255)),softLight:(t,e)=>{t/=255;e/=255;return 255*((1-2*t)*e*e+2*t*e)}};function i(t,e){if(t.readUInt32BE(w)!==e.readUInt32BE(w)){return false}if(t.readUInt32BE(_)!==e.readUInt32BE(_)){return false}if(t[m]!==e[m]){return false}if((t[v]&I)!==(e[v]&I)){return false}return true}c.prototype.terminalBlitterLineIterator=function(t){var e,r;if(!t.context.inline){t.context.sequence+=t.context.term.optimized.moveTo(t.dstXmin,t.dstY);t.context.moves++}for(e=t.srcStart;e<t.srcEnd;e+=this.ITEM_SIZE){r=this.readAttr(t.context.srcBuffer,e);if(r[v]&j){continue}if(!t.context.lastAttr||!i(r,t.context.lastAttr)){t.context.sequence+=!t.context.lastAttr||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,r):this.generateDeltaEscapeSequence(t.context.term,r,t.context.lastAttr);t.context.lastAttr=r;t.context.attrs++}t.context.sequence+=this.readChar(t.context.srcBuffer,e);t.context.cells++}if(t.context.inline){t.context.sequence+=t.context.term.optimized.styleReset+"\n";t.context.attrs++;t.context.lastAttr=null}if(t.context.sequence.length>F){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}};c.prototype.terminalBlitterCellIterator=function(t){var e=this.readAttr(t.context.srcBuffer,t.srcStart);if(t.context.srcLastBuffer){if(i(e,this.readAttr(t.context.srcLastBuffer,t.srcStart))&&this.readChar(t.context.srcBuffer,t.srcStart)===this.readChar(t.context.srcLastBuffer,t.srcStart)){return}t.context.srcBuffer.copy(t.context.srcLastBuffer,t.srcStart,t.srcStart,t.srcEnd)}if(e[v]&j){return}t.context.cells++;if(t.dstX!==t.context.cx||t.dstY!==t.context.cy){t.context.sequence+=t.context.term.optimized.moveTo(t.dstX,t.dstY);t.context.moves++}if(!t.context.lastAttr||!i(e,t.context.lastAttr)){t.context.sequence+=!t.context.lastAttr||!t.context.deltaEscapeSequence?this.generateEscapeSequence(t.context.term,e):this.generateDeltaEscapeSequence(t.context.term,e,t.context.lastAttr);t.context.lastAttr=e;t.context.attrs++}t.context.sequence+=this.readChar(t.context.srcBuffer,t.srcStart);if(t.context.sequence.length>F){t.context.rawTerm(t.context.sequence);t.context.sequence="";t.context.writes++}t.context.cy=t.dstY;if(e&M){t.context.cx=t.dstX+2;return true}t.context.cx=t.dstX+1};c.fromNdarrayImage=function(t){var e,r=t.shape[0],i,n=Math.ceil(t.shape[1]/2),s=t.shape[2]===4;var o=new c({width:r,height:n,blending:true,noFill:true});for(e=0;e<r;e++){for(i=0;i<n;i++){if(i*2+1<t.shape[1]){o.put({x:e,y:i,attr:{color:{r:t.get(e,i*2,0),g:t.get(e,i*2,1),b:t.get(e,i*2,2),a:s?t.get(e,i*2,3):255},bgColor:{r:t.get(e,i*2+1,0),g:t.get(e,i*2+1,1),b:t.get(e,i*2+1,2),a:s?t.get(e,i*2+1,3):255}}},"▀")}else{o.put({x:e,y:i,attr:{color:{r:t.get(e,i*2,0),g:t.get(e,i*2,1),b:t.get(e,i*2,2),a:s?t.get(e,i*2,3):255},bgColor:{r:0,g:0,b:0,a:0}}},"▀")}}}return o};c.loadImage=d.image.load.bind(c,c.fromNdarrayImage);c.prototype.dump=function(){var t,e,r,i="",n;for(t=0;t<this.height;t++){for(e=0;e<this.width;e++){r=(t*this.width+e)*this.ITEM_SIZE;n=this.readChar(this.buffer,r);i+=n+(h.unicode.isFullWidth(n)?" ":"  ");i+=h.format("%x%x%x%x %x%x%x%x %x%x ",this.buffer.readUInt8(r),this.buffer.readUInt8(r+1),this.buffer.readUInt8(r+2),this.buffer.readUInt8(r+3),this.buffer.readUInt8(r+4),this.buffer.readUInt8(r+5),this.buffer.readUInt8(r+6),this.buffer.readUInt8(r+7),this.buffer.readUInt8(r+8),this.buffer.readUInt8(r+9))}i+="\n"}return i};c.prototype.readAttr=function(t,e){return t.slice(e,e+this.ATTR_SIZE)};c.prototype.writeAttr=function(t,e,r,i=0){if(!i){return e.copy(t,r)}e.copy(t,r);return t.writeUInt8(e[v]|i,r+v)};c.prototype.hasLeadingFullWidth=function(t,e){return!!(t.readUInt8(e+v)&M)};c.prototype.hasTrailingFullWidth=function(t,e){return!!(t.readUInt8(e+v)&j)};c.prototype.removeLeadingFullWidth=function(t,e){var r=t.readUInt8(e+v);if(!(r&M)){return}r^=M;t.writeUInt8(r,e+v);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};c.prototype.removeTrailingFullWidth=function(t,e){var r=t.readUInt8(e+v);if(!(r&j)){return}r^=j;t.writeUInt8(r,e+v);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};c.prototype.removeFullWidth=function(t,e){var r=t.readUInt8(e+v);if(!(r&L)){return}r=r&D;t.writeUInt8(r,e+v);t.write(" ",e+this.ATTR_SIZE,this.CHAR_SIZE)};c.prototype.attrLeadingFullWidth=function(t){t.writeUInt8(t[v]|M,v);return t};c.prototype.attrTrailingFullWidth=function(t){t.writeUInt8(t[v]|j,v);return t};c.prototype.readChar=function(t,e){var r;e+=this.ATTR_SIZE;if(t[e]<128){r=1}else if(t[e]<192){return"\0"}else if(t[e]<224){r=2}else if(t[e]<240){r=3}else if(t[e]<248){r=4}else if(t[e]<252){r=5}else{r=6}if(r>this.CHAR_SIZE){return"\0"}return t.toString("utf8",e,e+r)};c.prototype.writeChar=function(t,e,r){return t.write(e,r+this.ATTR_SIZE,this.CHAR_SIZE)};c.prototype.generateEscapeSequence=function(t,e){var r=t.optimized.styleReset+t.optimized.color24bits(e[a],e[u],e[l])+t.optimized.bgColor24bits(e[p],e[g],e[y]);var i=e[m];if(i&x){r+=t.optimized.bold}if(i&C){r+=t.optimized.dim}if(i&k){r+=t.optimized.italic}if(i&T){r+=t.optimized.underline}if(i&S){r+=t.optimized.blink}if(i&E){r+=t.optimized.inverse}if(i&A){r+=t.optimized.hidden}if(i&R){r+=t.optimized.strike}return r};c.prototype.generateDeltaEscapeSequence=function(t,e,r){var i="";if(e[a]!==r[a]||e[u]!==r[u]||e[l]!==r[l]){i+=t.optimized.color24bits(e[a],e[u],e[l])}if(e[p]!==r[p]||e[g]!==r[g]||e[y]!==r[y]){i+=t.optimized.bgColor24bits(e[p],e[g],e[y])}var n=e[m];var s=r[m];if(n!==s){if((n&B)!==(s&B)){if(s&x&&!(n&x)||s&C&&!(n&C)){i+=t.optimized.noBold;if(n&x){i+=t.optimized.bold}if(n&C){i+=t.optimized.dim}}else{if(n&x&&!(s&x)){i+=t.optimized.bold}if(n&C&&!(s&C)){i+=t.optimized.dim}}}if((n&k)!==(s&k)){i+=n&k?t.optimized.italic:t.optimized.noItalic}if((n&T)!==(s&T)){i+=n&T?t.optimized.underline:t.optimized.noUnderline}if((n&S)!==(s&S)){i+=n&S?t.optimized.blink:t.optimized.noBlink}if((n&E)!==(s&E)){i+=n&E?t.optimized.inverse:t.optimized.noInverse}if((n&A)!==(s&A)){i+=n&A?t.optimized.hidden:t.optimized.noHidden}if((n&R)!==(s&R)){i+=n&R?t.optimized.strike:t.optimized.noStrike}}return i};c.attr2object=function(t){var e={color:{},bgColor:{}};e.color.r=t[a];e.color.g=t[u];e.color.b=t[l];e.color.a=t[f];e.bgColor.r=t[p];e.bgColor.g=t[g];e.bgColor.b=t[y];e.bgColor.a=t[b];e.bold=!!(t[m]&x);e.dim=!!(t[m]&C);e.italic=!!(t[m]&k);e.underline=!!(t[m]&T);e.blink=!!(t[m]&S);e.inverse=!!(t[m]&E);e.hidden=!!(t[m]&A);e.strike=!!(t[m]&R);e.styleTransparency=!!(t[v]&O);e.charTransparency=!!(t[v]&P);return e};c.prototype.attr2object=c.attr2object;c.object2attr=function(t){var e=W.allocUnsafe(c.prototype.ATTR_SIZE);if(!t||typeof t!=="object"){t={}}e[v]=0;if(t.color&&typeof t.color==="object"){e[a]=+t.color.r||0;e[u]=+t.color.g||0;e[l]=+t.color.b||0;e[f]=t.color.a!==undefined?+t.color.a||0:255}else{e[a]=0;e[u]=0;e[l]=0;e[f]=255}if(t.bgColor&&typeof t.bgColor==="object"){e[p]=+t.bgColor.r||0;e[g]=+t.bgColor.g||0;e[y]=+t.bgColor.b||0;e[b]=t.bgColor.a!==undefined?+t.bgColor.a||0:255}else{e[p]=0;e[g]=0;e[y]=0;e[b]=255}if(t.styleTransparency){e[v]|=O}if(t.charTransparency){e[v]|=P}e[m]=0;if(t.bold){e[m]|=x}if(t.dim){e[m]|=C}if(t.italic){e[m]|=k}if(t.underline){e[m]|=T}if(t.blink){e[m]|=S}if(t.inverse){e[m]|=E}if(t.hidden){e[m]|=A}if(t.strike){e[m]|=R}return e};c.prototype.object2attr=c.object2attr;c.attrAndObject=function(t,e){if(!e||typeof e!=="object"){return t}if(e.color&&typeof e.color==="object"){if(e.color.r!==undefined){t[a]=+e.color.r||0}if(e.color.g!==undefined){t[u]=+e.color.g||0}if(e.color.b!==undefined){t[l]=+e.color.b||0}if(e.color.a!==undefined){t[f]=+e.color.a||0}}if(e.bgColor&&typeof e.bgColor==="object"){if(e.bgColor.r!==undefined){t[p]=+e.bgColor.r||0}if(e.bgColor.g!==undefined){t[g]=+e.bgColor.g||0}if(e.bgColor.b!==undefined){t[y]=+e.bgColor.b||0}if(e.bgColor.a!==undefined){t[b]=+e.bgColor.a||0}}if(e.styleTransparency===true){t[v]|=O}else if(e.styleTransparency===false){t[v]&=~O}if(e.charTransparency===true){t[v]|=P}else if(e.charTransparency===false){t[v]&=~P}if(e.bold===true){t[m]|=x}else if(e.bold===false){t[m]&=~x}if(e.dim===true){t[m]|=C}else if(e.dim===false){t[m]&=~C}if(e.italic===true){t[m]|=k}else if(e.italic===false){t[m]&=~k}if(e.underline===true){t[m]|=T}else if(e.underline===false){t[m]&=~T}if(e.blink===true){t[m]|=S}else if(e.blink===false){t[m]&=~S}if(e.inverse===true){t[m]|=E}else if(e.inverse===false){t[m]&=~E}if(e.hidden===true){t[m]|=A}else if(e.hidden===false){t[m]&=~A}if(e.strike===true){t[m]|=R}else if(e.strike===false){t[m]&=~R}return t};c.prototype.attrAndObject=c.attrAndObject;c.attrSelect=c.prototype.attrSelect=t=>{t[m]|=E;return t};c.attrUnselect=c.prototype.attrUnselect=t=>{t[m]&=~E;return t};const n=0;const a=0;const u=1;const l=2;const f=3;const p=4;const g=5;const y=6;const b=7;const m=8;const v=9;const w=0;const _=4;const x=1;const C=2;const k=4;const T=8;const S=16;const E=32;const A=64;const R=128;const B=x|C;const O=4;const P=8;const I=O|P;const M=64;const j=128;const L=M|j;const D=255^L;const F=1e4;c.prototype.ATTR_SIZE=10;c.prototype.CHAR_SIZE=4;c.prototype.ITEM_SIZE=c.prototype.ATTR_SIZE+c.prototype.CHAR_SIZE;c.DEFAULT_ATTR=c.prototype.DEFAULT_ATTR=c.object2attr({color:{r:255,g:255,b:255,a:255},bgColor:{r:0,g:0,b:0,a:255}});c.prototype.CLEAR_ATTR=c.object2attr({color:{r:255,g:255,b:255,a:0},bgColor:{r:0,g:0,b:0,a:0},charTransparency:true,styleTransparency:true});c.prototype.CLEAR_BUFFER=W.allocUnsafe(c.prototype.ITEM_SIZE);c.prototype.CLEAR_ATTR.copy(c.prototype.CLEAR_BUFFER);c.prototype.CLEAR_BUFFER.write(" \0\0\0",c.prototype.ATTR_SIZE);c.prototype.LEADING_FULLWIDTH=M;c.prototype.TRAILING_FULLWIDTH=j;c.loadSyncV2=function(t){var e,r,i,n;r=s.readFileSync(t);if(r.length<3||r.toString("ascii",0,3)!=="SB\n"){throw new Error("Magic number mismatch: this is not a ScreenBufferHD file")}for(e=3;e<r.length;e++){if(r[e]===10){break}}if(e===r.length){throw new Error("No header found: this is not a ScreenBufferHD file")}try{i=JSON.parse(r.toString("utf8",3,e))}catch(t){throw new Error("No correct one-lined JSON header found: this is not a ScreenBufferHD file")}if(i.version===undefined||i.width===undefined||i.height===undefined){throw new Error("Missing mandatory header data, this is a corrupted or obsolete ScreenBufferHD file")}if(i.bitsPerColor&&i.bitsPerColor!==c.prototype.bitsPerColor){throw new Error("Bad Bits Per Color: "+i.bitsPerColor+" (should be "+c.prototype.bitsPerColor+")")}if(r.length!==e+1+i.width*i.height*c.prototype.ITEM_SIZE){throw new Error("Bad file size: this is a corrupted ScreenBufferHD file")}n=new c({width:i.width,height:i.height});r.copy(n.buffer,0,e+1);return n};c.prototype.saveSyncV2=function(t){var e,r;r={version:2,width:this.width,height:this.height};r="SB\n"+JSON.stringify(r)+"\n";e=W.allocUnsafe(r.length+this.buffer.length);e.write(r);this.buffer.copy(e,r.length);s.writeFileSync(t,e)};c.loadSync=c.loadSyncV2;c.prototype.saveSync=c.prototype.saveSyncV2}).call(this)}).call(this,H("buffer").Buffer)},{"./ScreenBuffer.js":3,"./colorScheme/gnome.json":11,"./termkit.js":50,buffer:147,fs:136,"string-kit":123}],5:[function(m,n,t){(function(b,w){(function(){"use strict";const a=m("tree-kit");const v=m("string-kit");const t=m("nextgen-events");const l=m("seventh");const p=m("./termkit.js");function e(...t){return e.create(...t)}e.prototype=Object.create(t.prototype);e.prototype.constructor=e;n.exports=e;e.create=function(t){if(!t||typeof t!=="object"){t={}}if(!t.stdin){t.stdin=b.stdin}if(!t.stdout){t.stdout=b.stdout}if(!t.stderr){t.stderr=b.stderr}if(typeof t.generic!=="string"){t.generic="xterm"}var e;var r;var i=Object.create(d);var n={on:"",off:"",params:0,out:t.stdout};var o=f.bind(undefined,n);Object.setPrototypeOf(o,i);o.apply=Function.prototype.apply;o.call=Function.prototype.call;n.root=o;o.root=o;o.options=n;o.stdin=t.stdin;o.stdout=t.stdout;o.stderr=t.stderr;o.generic=t.generic;o.appId=t.appId;o.appName=t.appName;o.isTTY=t.isTTY===undefined?true:!!t.isTTY;o.isSSH=!!t.isSSH;o.pid=t.pid;o.grabbing=false;o.mouseGrabbing=false;o.focusGrabbing=false;o.timeout=o.isSSH?500:200;o.shutdown=false;o.raw=o.stdout.write.bind(o.stdout);o.onStdin=g.bind(o);o.prependStdinChunk=null;o.lock={};o.wrapOptions={x:1,width:null,continue:false,offset:0};o.width=undefined;o.height=undefined;c.call(o);if(t.preferProcessSigwinch){b.on("SIGWINCH",c.bind(o))}else if(o.stdout.isTTY){o.stdout.on("resize",c.bind(o))}else if(t.processSigwinch){b.on("SIGWINCH",c.bind(o))}o.state={fullscreen:false,button:{left:null,middle:null,right:null,other:null}};if(o.appId){try{o.termconfigFile=o.appId+".js";r=m("./termconfig/"+o.termconfigFile)}catch(t){}}if(!r){try{o.termconfigFile=o.generic+".generic.js";r=m("./termconfig/"+o.termconfigFile)}catch(t){try{o.termconfigFile=o.generic+".js";r=m("./termconfig/"+o.termconfigFile)}catch(t){o.termconfigFile="xterm.generic.js";r=m("./termconfig/"+o.termconfigFile)}}}o.esc=a.extend({deep:true},{},r.esc);o.support=a.extend({deep:true},{},r.support);a.extend(null,o.esc,h,{gray:o.esc.brightBlack,grey:o.esc.brightBlack,bgGray:o.esc.bgBrightBlack,bgGrey:o.esc.bgBrightBlack});o.handler=a.extend(null,{},r.handler);o.keymap=a.extend({deep:true},{},r.keymap);o.colorRegister=a.extend({deep:true},[],y,r.colorRegister);o.escHandler={root:o};o.escOffHandler={root:o};o.rKeymap=[];o.rKeymapMaxSize=-1;o.rKeymapStarter=[];o.rKeymapStarterMaxSize=-1;Object.keys(o.keymap).forEach(t=>{var e,r,i,n,s=o.keymap[t];if(!Array.isArray(s)){s=[s];o.keymap[t]=s}for(r=0;r<s.length;r++){n=s[r];if(typeof n==="object"){i=n;i.name=t;n=i.code}else{i={code:n,name:t,matches:[t]};o.keymap[t][r]={code:n}}if(i.handler&&typeof i.handler!=="function"){o.keymap[t][r].handler=o.handler[i.handler]}if(n){if(n.length>o.rKeymapMaxSize){for(e=o.rKeymapMaxSize+1;e<=n.length;e++){o.rKeymap[e]={}}o.rKeymapMaxSize=n.length}if(o.rKeymap[n.length][n]){o.rKeymap[n.length][n].matches.push(t)}else{o.rKeymap[n.length][n]=i;o.rKeymap[n.length][n].matches=[t]}}else{if(!i.starter||!i.ender||!i.handler){continue}if(i.starter.length>o.rKeymapStarterMaxSize){for(e=o.rKeymapStarterMaxSize+1;e<=i.starter.length;e++){o.rKeymapStarter[e]={}}o.rKeymapStarterMaxSize=i.starter.length}if(o.rKeymapStarter[i.starter.length][i.starter]){o.rKeymapStarter[i.starter.length][i.starter].push(t)}else{o.rKeymapStarter[i.starter.length][i.starter]=[i]}}}});Object.keys(o.esc).forEach(r=>{if(!o.esc[r]||typeof o.esc[r]!=="object"){console.error("Bad escape sequence entry '"+r+"' using termconfig: '"+o.termconfigFile+"'.");return}if(typeof o.esc[r].on==="function"){o.esc[r].on=o.esc[r].on.call(o)}if(typeof o.esc[r].off==="function"){o.esc[r].off=o.esc[r].off.call(o)}if(o.esc[r].handler){if(typeof o.esc[r].handler==="function"){o.escHandler[r]=o.esc[r].handler.bind(o)}else{o.escHandler[r]=o.handler[o.esc[r].handler]}}if(o.esc[r].offHandler){if(typeof o.esc[r].offHandler==="function"){o.escOffHandler[r]=o.esc[r].offHandler.bind(o)}else{o.escOffHandler[r]=o.handler[o.esc[r].offHandler]}}Object.defineProperty(i,r,{configurable:true,get:function(){var t,e;e=Object.assign({},this.options);e.on+=this.root.esc[r].on||"";e.off=(this.root.esc[r].off||"")+e.off;e.params+=v.format.count(this.root.esc[r].on);if(!e.onHasFormatting&&(e.params||typeof this.root.esc[r].on==="string"&&v.format.hasFormatting(this.root.esc[r].on))){e.onHasFormatting=true}if(!e.offHasFormatting&&(typeof this.root.esc[r].off==="string"&&v.format.hasFormatting(this.root.esc[r].off))){e.offHasFormatting=true}if(this.root.esc[r].err){e.err=true;e.out=this.root.stderr}if(this.root.esc[r].str){e.str=true}if(this.root.esc[r].bind){e.bind=true}if(this.root.esc[r].forceStyleOnReset){e.forceStyleOnReset=true}if(this.root.esc[r].noFormat){e.noFormat=true}if(this.root.esc[r].markupOnly){e.markupOnly=true}if(this.root.esc[r].wrap){e.wrap=true}t=f.bind(undefined,e);Object.setPrototypeOf(t,i);t.apply=Function.prototype.apply;t.root=this.root||this;t.options=e;Object.defineProperty(this,r,{value:t,configurable:true});return t}})});o.resetString="";o.setResetString=function(t){o.resetString=v.markupMethod.call(o.formatConfig.rawMarkupConfig,t)};var s=t=>o.str.styleReset()+o.resetString+t;o.formatConfig={fn:{},endingMarkupReset:true,markupReset:s.bind(undefined,""),shiftMarkup:{"#":"background"},markup:{":":s.bind(undefined,"")," ":s.bind(undefined," "),"-":o.str.dim(),"+":o.str.bold(),_:o.str.underline(),"/":o.str.italic(),"!":o.str.inverse(),b:o.str.blue(),B:o.str.brightBlue(),c:o.str.cyan(),C:o.str.brightCyan(),g:o.str.green(),G:o.str.brightGreen(),k:o.str.black(),K:o.str.brightBlack(),m:o.str.magenta(),M:o.str.brightMagenta(),r:o.str.red(),R:o.str.brightRed(),w:o.str.white(),W:o.str.brightWhite(),y:o.str.yellow(),Y:o.str.brightYellow()},shiftedMarkup:{background:{":":s.bind(undefined,"")," ":s.bind(undefined," "),b:o.str.bgBlue(),B:o.str.bgBrightBlue(),c:o.str.bgCyan(),C:o.str.bgBrightCyan(),g:o.str.bgGreen(),G:o.str.bgBrightGreen(),k:o.str.bgBlack(),K:o.str.bgBrightBlack(),m:o.str.bgMagenta(),M:o.str.bgBrightMagenta(),r:o.str.bgRed(),R:o.str.bgBrightRed(),w:o.str.bgWhite(),W:o.str.bgBrightWhite(),y:o.str.bgYellow(),Y:o.str.bgBrightYellow()}}};o.formatConfig.rawMarkupConfig=Object.create(o.formatConfig);o.formatConfig.rawMarkupConfig.startingMarkupReset=false;o.formatConfig.rawMarkupConfig.endingMarkupReset=false;for(e in o.escHandler){o.formatConfig.fn[e]=o.escHandler[e]}for(e in o.escOffHandler){o.formatConfig.fn[e+"_off"]=o.escOffHandler[e]}o.format=v.createFormatter(o.formatConfig);o.markup=v.createMarkup(o.formatConfig);o.options=n;u(o);b.on("exit",()=>{if(o.shutdown){return}o.shutdown=true;o.styleReset();o.grabInput(false)});b.on("asyncExit",(t,e,r)=>{o.asyncCleanup().then(r)});b.once("beforeExit",()=>{o.asyncCleanup()});o.palette=new p.Palette({system:true,term:o});return o};function u(t){var e;t.optimized={};t.optimized.styleReset=t.str.styleReset();t.optimized.bold=t.str.bold();t.optimized.dim=t.str.dim();t.optimized.italic=t.str.italic();t.optimized.underline=t.str.underline();t.optimized.blink=t.str.blink();t.optimized.inverse=t.str.inverse();t.optimized.hidden=t.str.hidden();t.optimized.strike=t.str.strike();t.optimized.noBold=t.str.bold(false);t.optimized.noDim=t.str.dim(false);t.optimized.noItalic=t.str.italic(false);t.optimized.noUnderline=t.str.underline(false);t.optimized.noBlink=t.str.blink(false);t.optimized.noInverse=t.str.inverse(false);t.optimized.noHidden=t.str.hidden(false);t.optimized.noStrike=t.str.strike(false);t.optimized.color256=[];t.optimized.bgColor256=[];for(e=0;e<=255;e++){t.optimized.color256[e]=t.str.color256(e);t.optimized.bgColor256[e]=t.str.bgColor256(e)}t.optimized.defaultColor=t.str.defaultColor();t.optimized.bgDefaultColor=t.str.bgDefaultColor();t.optimized.moveTo=t.esc.moveTo.optimized||t.str.moveTo;t.optimized.right=t.str.right(1);t.optimized.color24bits=t.esc.color24bits.optimized||t.str.color24bits;t.optimized.bgColor24bits=t.esc.bgColor24bits.optimized||t.str.bgColor24bits}function f(t,...e){var r,i,n;if(t.bounded){e=t.bounded.concat(e)}if(t.bind){i=Object.assign({},t,{bind:false,bounded:e});r=f.bind(this,i);Object.setPrototypeOf(r,Object.getPrototypeOf(t.root));r.apply=Function.prototype.apply;r.root=t.root;r.options=i;return r}var s=[t.on],o,a,u;var l=e[t.params];if(t.params){s=s.concat(e.slice(0,t.params))}if(l===undefined||l===true){a=t.onHasFormatting?t.root.format(...s):t.on;if(t.str){return a}t.out.write(a);return t.root}if(l===null||l===false){u=t.offHasFormatting?t.root.format(t.off):t.off;if(t.str){return u}t.out.write(u);return t.root}if(typeof l!=="string"){if(typeof l.toString==="function"){l=l.toString()}else{l=""}}a=t.onHasFormatting?t.root.format(...s):t.on;if(t.markupOnly){l=t.root.markup(...e.slice(t.params))}else if(!t.noFormat){l=t.root.format(...e.slice(t.params))}if(t.wrap){if(t.root.wrapOptions.x&&t.root.wrapOptions.x>1){n={width:t.root.wrapOptions.width||t.root.width-t.root.wrapOptions.x+1,glue:"\n"+t.root.str.column(t.root.wrapOptions.x),offset:t.root.wrapOptions.offset,updateOffset:true,skipFn:p.escapeSequenceSkipFn};l=v.wordwrap(l,n);if(!t.root.wrapOptions.continue){l=t.root.str.column(t.root.wrapOptions.x)+l}t.root.wrapOptions.continue=true;t.root.wrapOptions.offset=n.offset}else{n={width:t.root.wrapOptions.width||t.root.width,glue:"\n",offset:t.root.wrapOptions.offset,updateOffset:true,skipFn:p.escapeSequenceSkipFn};l=v.wordwrap(l,n);t.root.wrapOptions.continue=true;t.root.wrapOptions.offset=n.offset}}else{t.root.wrapOptions.continue=false;t.root.wrapOptions.offset=0}u=t.offHasFormatting?t.root.format(t.off):t.off;if(t.forceStyleOnReset){l=l.replace(new RegExp(v.escape.regExp(t.root.optimized.styleReset),"g"),t.root.optimized.styleReset+a)}if(t.root.resetString){o=t.root.resetString+a+l+u+t.root.resetString}else{o=a+l+u}if(t.crlf){o=o.replace(/\n/g,"\r\n")}if(t.str){return o}t.out.write(o);return t.root}var h={error:{err:true},str:{str:true},attr:{attr:true},bindArgs:{bind:true},forceStyleOnReset:{forceStyleOnReset:true},noFormat:{noFormat:true},markupOnly:{markupOnly:true},wrap:{wrap:true},move:{on:"%[move:%a%a]F",handler:function t(e,r){var i="";if(e){if(e>0){i+=this.root.format(this.root.esc.right.on,e)}else{i+=this.root.format(this.root.esc.left.on,-e)}}if(r){if(r>0){i+=this.root.format(this.root.esc.down.on,r)}else{i+=this.root.format(this.root.esc.up.on,-r)}}return i}},color:{on:"%[color:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:function t(e){if(typeof e==="string"){e=p.colorNameToIndex(e)}if(typeof e!=="number"){return""}e=Math.floor(e);if(e<0||e>15){return""}if(e<=7){return this.root.format(this.root.esc.darkColor.on,e)}return this.root.format(this.root.esc.brightColor.on,e-8)}},bgColor:{on:"%[bgColor:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:function t(e){if(typeof e==="string"){e=p.colorNameToIndex(e)}if(typeof e!=="number"){return""}e=Math.floor(e);if(e<0||e>15){return""}if(e<=7){return this.root.format(this.root.esc.bgDarkColor.on,e)}return this.root.format(this.root.esc.bgBrightColor.on,e-8)}},colorRgb:{on:"%[colorRgb:%a%a%a]F",off:function(){return this.root.esc.defaultColor.on},handler:r},bgColorRgb:{on:"%[bgColorRgb:%a%a%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:i},colorRgbHex:{on:"%[colorRgbHex:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:r},bgColorRgbHex:{on:"%[bgColorRgbHex:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:i},colorGrayscale:{on:"%[colorGrayscale:%a]F",off:function(){return this.root.esc.defaultColor.on},handler:function t(e){var r;if(typeof e!=="number"){return""}if(e<0||e>255){return""}if(!this.root.esc.color24bits.na&&!this.root.esc.color24bits.fb){return this.root.format(this.root.esc.color24bits.on,e,e,e)}if(!this.root.esc.color256.na&&!this.root.esc.color256.fb){e=Math.round(e*25/255);if(e<0||e>25){return""}if(e===0){r=16}else if(e===25){r=231}else{r=e+231}return this.root.format(this.root.esc.color256.on,r)}r=this.root.registerForRgb(e,e,e,0,15);return this.root.format(this.root.esc.color.on,r)}},bgColorGrayscale:{on:"%[bgColorGrayscale:%a]F",off:function(){return this.root.esc.bgDefaultColor.on},handler:function t(e){var r;if(typeof e!=="number"){return""}if(e<0||e>255){return""}if(!this.root.esc.bgColor24bits.na&&!this.root.esc.bgColor24bits.fb){return this.root.format(this.root.esc.bgColor24bits.on,e,e,e)}if(!this.root.esc.bgColor256.na&&!this.root.esc.bgColor256.fb){e=Math.round(e*25/255);if(e<0||e>25){return""}if(e===0){r=16}else if(e===25){r=231}else{r=e+231}return this.root.format(this.root.esc.bgColor256.on,r)}r=this.root.registerForRgb(e,e,e,0,15);return this.root.format(this.root.esc.bgColor.on,r)}}};function r(t,e,r){var i,n;if(typeof t==="string"){n=p.hexToRgba(t);t=n.r;e=n.g;r=n.b}if(typeof t!=="number"||isNaN(t)||typeof e!=="number"||isNaN(e)||typeof r!=="number"||isNaN(r)||t<0||t>255||e<0||e>255||r<0||r>255){return""}if(!this.root.esc.color24bits.na&&!this.root.esc.color24bits.fb){return this.root.format(this.root.esc.color24bits.on,t,e,r)}if(!this.root.esc.color256.na&&!this.root.esc.color256.fb){t=Math.round(t*5/255);e=Math.round(e*5/255);r=Math.round(r*5/255);i=16+t*36+e*6+r;return this.root.format(this.root.esc.color256.on,i)}i=this.root.registerForRgb(t,e,r,0,15);return this.root.format(this.root.esc.color.on,i)}function i(t,e,r){var i,n;if(typeof t==="string"){n=p.hexToRgba(t);t=n.r;e=n.g;r=n.b}if(typeof t!=="number"||isNaN(t)||typeof e!=="number"||isNaN(e)||typeof r!=="number"||isNaN(r)||t<0||t>255||e<0||e>255||r<0||r>255){return""}if(!this.root.esc.bgColor24bits.na&&!this.root.esc.bgColor24bits.fb){return this.root.format(this.root.esc.bgColor24bits.on,t,e,r)}if(!this.root.esc.bgColor256.na&&!this.root.esc.bgColor256.fb){t=Math.round(t*5/255);e=Math.round(e*5/255);r=Math.round(r*5/255);i=16+t*36+e*6+r;return this.root.format(this.root.esc.bgColor256.on,i)}i=this.root.registerForRgb(t,e,r,0,15);return this.root.format(this.root.esc.bgColor.on,i)}function c(){if(this.stdout.columns&&this.stdout.rows){this.width=this.stdout.columns;this.height=this.stdout.rows}this.emit("resize",this.width,this.height)}var d=Object.create(e.prototype);d.yesOrNo=m("./yesOrNo.js");d.inputField=m("./inputField.js");d.fileInput=m("./fileInput.js");d.singleRowMenu=d.singleLineMenu=m("./singleLineMenu.js");d.singleColumnMenu=m("./singleColumnMenu.js");d.gridMenu=m("./gridMenu.js");d.progressBar=m("./progressBar.js");d.bar=m("./bar.js");d.slowTyping=m("./slowTyping.js");d.createDocument=function(t){if(!t||typeof t!=="object"){t={}}t.outputDst=this;t.eventSource=this;return new p.Document(t)};d.createInlineElement=function(t,e){return p.Element.createInline(this,t,e)};d.table=function(t,e={}){return p.Element.createInline(this,p.TextTable,Object.assign({},e,{cellContents:t,fit:e.fit!==undefined?!!e.fit:true}))};d.spinner=function(t={}){if(typeof t==="string"){t={animation:t}}return p.Element.createInline(this,p.AnimatedText,t)};d.wrapColumn=function(...t){this.wrapOptions.continue=false;this.wrapOptions.offset=0;if(!t.length){return}if(t[0]&&typeof t[0]==="object"){Object.assign(this.wrapOptions,t[0]);return this.wrap}if(t.length===1){this.wrapOptions.x=1;this.wrapOptions.width=t[0];return this.wrap}this.wrapOptions.x=t[0];this.wrapOptions.width=t[1];return this.wrap};d.fullscreen=function(t){if(t===false){if(!this.state.fullscreen){return this}this.state.fullscreen=false;this.moveTo(1,this.height,"\n");this.alternateScreenBuffer(false);return this}if(!t){t={}}this.state.fullscreen=true;if(!t.noAlternate){this.alternateScreenBuffer(true)}this.clear()};function g(t){var e,r,i,n,s,o,a,u,l,f,h,c,d,p,g,y=false,b=0,m=t.length;if(this.shutdown){return}if(this.prependStdinChunk){t=w.concat([this.prependStdinChunk,t])}while(b<m){p=false;d=1;if(t[b]<=31||t[b]===127){for(e=Math.min(m,Math.max(this.rKeymapMaxSize,this.rKeymapStarterMaxSize));e>0;e--){i=t.slice(b);a=i.toString();n=t.slice(b,b+e);u=n.toString();if(this.rKeymap[e]&&this.rKeymap[e][u]){l=this.rKeymap[e][u];p=true;if(l.handler){g=l.handler.call(this,l.name,t.slice(b+e));d=e+g.eaten;if(!g.disable){this.emit(l.event,g.name,g.data)}}else if(l.event){d=e;this.emit(l.event,l.name,l.data,{code:n})}else{d=e;this.emit("key",l.name,l.matches,{isCharacter:false,code:n})}break}else if(this.rKeymapStarter[e]&&this.rKeymapStarter[e][u]){f=this.rKeymapStarter[e][u];for(r=0;r<f.length;r++){l=f[r];if(l.altEnder){h="^"+v.escape.regExp(l.starter)+"([ -~]*?)"+"("+v.escape.regExp(l.ender)+"|"+v.escape.regExp(l.altEnder)+")"}else{h="^"+v.escape.regExp(l.starter)+"([ -~]*?)"+v.escape.regExp(l.ender)}c=a.match(new RegExp(h),"g");if(c){p=true;g=l.handler.call(this,l.name,c[1]);d=c[0].length;this.emit(l.event,g.name,g.data);break}else if(l.accumulate){p=true;y=true;break}}if(p){break}}}if(!p){this.emit("unknown",t);break}}else if(t[b]>=128){if(t[b]<192){continue}else if(t[b]<224){d=2}else if(t[b]<240){d=3}else if(t[b]<248){d=4}else if(t[b]<252){d=5}else{d=6}i=t.slice(b,b+d);s=i.toString("utf8");if(d>2){o=v.unicode.firstCodePoint(s)}else{o=s.charCodeAt(0)}this.emit("key",s,[s],{isCharacter:true,codepoint:o,code:i})}else{s=String.fromCharCode(t[b]);this.emit("key",s,[s],{isCharacter:true,codepoint:t[b],code:t[b]})}b+=d}if(y){this.prependStdinChunk=t}else{this.prependStdinChunk=null}}d.grabInput=function(t,e){this.mouseButton(false);this.mouseDrag(false);this.mouseMotion(false);this.focusEvent(false);this.stdin.removeListener("data",this.onStdin);this.grabbing=false;this.mouseGrabbing=false;this.focusGrabbing=false;var r=()=>{this.stdin.pause();try{this.stdin.setRawMode(false)}catch(t){}};if(t===false){if(e){return l.resolveSafeTimeout(this.timeout/2).then(r)}r();return l.resolved}if(this.shutdown){return l.resolved}this.grabbing=true;if(!t){t={}}try{this.stdin.setRawMode(true)}catch(t){}this.stdin.on("data",this.onStdin);this.stdin.resume();if(t.mouse){this.mouseGrabbing=true;switch(t.mouse){case"button":this.mouseButton.mouseSGR();break;case"drag":this.mouseDrag.mouseSGR();break;case"motion":this.mouseMotion.mouseSGR();break}}if(t.focus){this.focusEvent();this.focusGrabbing=true}return l.resolved};d.processExit=function(t){this("\n");this.asyncCleanup().then(()=>b.exit(t))};d.asyncCleanup=async function(){if(this.shutdown){return}this.shutdown=true;this.styleReset();var t=this.grabbing;await this.waitStreamDone(this.stdout);if(!this.isTTY||!t){return}await l.resolveSafeTimeout(this.timeout/4);return this.grabInput(false,true)};d.waitStreamDone=function(t){if(!t._writableState.needDrain){return l.resolved}return l.onceEvent(t,"drain")};d.object2attr=function(t){var e=this.esc.styleReset.on;if(!t||typeof t!=="object"){t={}}if(typeof t.color==="string"){t.color=p.colorNameToIndex(t.color)}if(typeof t.color!=="number"||t.color<0||t.color>255){t.color=7}else{t.color=Math.floor(t.color)}e+=this.str.color(t.color);if(typeof t.bgColor==="string"){t.bgColor=p.colorNameToIndex(t.bgColor)}if(typeof t.bgColor!=="number"||t.bgColor<0||t.bgColor>255){t.bgColor=0}else{t.bgColor=Math.floor(t.bgColor)}e+=this.str.bgColor(t.bgColor);if(t.bold){e+=this.esc.bold.on}if(t.dim){e+=this.esc.dim.on}if(t.italic){e+=this.esc.italic.on}if(t.underline){e+=this.esc.underline.on}if(t.blink){e+=this.esc.blink.on}if(t.inverse){e+=this.esc.inverse.on}if(t.hidden){e+=this.esc.hidden.on}if(t.strike){e+=this.esc.strike.on}return e};d.eraseArea=function(t,e,r=1,i=1){t=Math.min(t,this.width);e=Math.min(e,this.height);var n,s=Math.min(t+r,this.width+1),o=Math.min(e+i,this.height+1),a=" ".repeat(s-t);for(n=e;n<o;n++){this.moveTo(t,n,a)}};d.getCursorLocation=function(i){var n=this.grabbing,s=false,t;if(this.shutdown){return l.resolved}if(this.esc.requestCursorLocation.na){t=new Error("Terminal is not capable");if(i){i(t);return l.resolved}return l.reject(t)}var o=new l;if(this.lock.getCursorLocation){this.once("unlock_getCursorLocation",()=>{this.getCursorLocation().then(t=>{if(i){i(undefined,t.x,t.y)}else{o.resolve(t)}},t=>{if(i){i(t)}else{o.reject(t)}})});return o}this.lock.getCursorLocation=true;var r=(t,e,r)=>{if(s){return}s=true;this.removeListener("terminal",a);if(!n){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}if(i){i(t)}else{o.reject(t)}return}if(i){i(undefined,e,r)}else{o.resolve({x:e,y:r})}};var a=(t,e)=>{if(t!=="CURSOR_LOCATION"){return}this.lock.getCursorLocation=false;this.emit("unlock_getCursorLocation");r(undefined,e.x,e.y)};if(!n){this.grabInput()}this.on("terminal",a);this.requestCursorLocation();l.resolveSafeTimeout(this.timeout).then(()=>{if(s){return}var t=new Error(".getCursorLocation() timed out");t.code="timeout";r(t)});return o};d.getColor=function(r,i){var n=this.grabbing,s=false,t;if(this.shutdown){return l.resolved}if(this.esc.requestColor.na){t=new Error("Terminal is not capable");if(i){i(t);return l.resolved}return l.reject(t)}var o=new l;var a=(t,e)=>{if(s){return}s=true;this.removeListener("terminal",u);if(!n){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}if(i){i(t)}else{o.reject(t)}return}if(i){i(undefined,e)}else{o.resolve(e)}};var u=(t,e)=>{if(t!=="COLOR_REGISTER"){return}if(e.register!==r){return}if(r<16){this.colorRegister[r]={r:e.r,g:e.g,b:e.b}}a(undefined,e)};if(!n){this.grabInput()}this.requestColor(r);this.on("terminal",u);l.resolveSafeTimeout(this.timeout).then(()=>{if(s){return}var t=new Error(".getColor() timed out");t.code="timeout";a(t)});return o};d.getPalette=function(e){var t,r=this.grabbing;if(this.shutdown){return l.resolved}if(!r){this.grabInput()}if(this.esc.requestColor.na){t=this.colorRegister.slice(0,16);if(e){e(undefined,t);return l.resolved}return l.resolve(t)}return l.concurrent(4,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],t=>this.getColor(t)).then(t=>{if(!r){this.grabInput(false)}if(e){e(undefined,t)}else{return t}},t=>{if(!r){this.grabInput(false)}if(e){e(t)}else{throw t}})};d.setColor=function(t,e,r,i,n){if(e&&typeof e==="object"){i=e.b;r=e.g;e=e.r;n=r}if(typeof t!=="number"||t<0||t>15){throw new Error("Bad register value")}if(!Array.isArray(n)){n=[]}if(typeof e!=="number"||e<0||e>255||typeof r!=="number"||r<0||r>255||typeof i!=="number"||i<0||i>255){throw new Error("Bad RGB value")}if(this.setColorLL.na){return}this.colorRegister[t]={r:e,g:r,b:i,names:n};this.setColorLL(t,e,r,i)};d.setPalette=function(e){var t;if(typeof e==="string"){try{e=m("./colorScheme/"+e+".json")}catch(t){throw new Error("[terminal] .setPalette(): color scheme not found: "+e)}}if(!Array.isArray(e)){throw new Error("[terminal] .setPalette(): argument #0 should be an Array of RGB Object or a built-in color scheme")}if(this.setColorLL.na){return}for(t=0;t<=15;t++){if(!e[t]||typeof e[t]!=="object"){continue}this.setColor(t,e[t])}};d.getClipboard=function(t="c"){var r=this.grabbing,i=false,e;if(this.shutdown){return l.resolved}if(this.esc.requestClipboard.na){e=m("./extClipboard.js");return e.getClipboard(t).catch(()=>"")}var n=new l;var s=(t,e)=>{if(i){return}i=true;this.removeListener("terminal",o);if(!r){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}n.reject(t);return}n.resolve(e)};var o=(t,e)=>{if(t!=="CLIPBOARD"){return}s(undefined,e.content)};if(!r){this.grabInput()}this.requestClipboard(t[0]);this.on("terminal",o);l.resolveSafeTimeout(this.timeout).then(()=>{if(i){return}var t=new Error(".getClipboard() timed out");t.code="timeout";s(t)});return n};d.setClipboard=async function(t,e="c"){var r;if(this.esc.setClipboardLL.na){r=m("./extClipboard.js");return r.setClipboard(t,e).catch(()=>undefined)}var i=w.from(t).toString("base64");this.setClipboardLL(e[0],i);return l.resolved};d.getTerminfo=function(r){var i=this.grabbing,n=false;if(this.shutdown){return l.resolved}if(this.esc.xtgettcapLL.na){return l.reject(new Error("Terminal is not capable"))}var s=new l;if(this.lock.getTerminfo){this.once("unlock_getTerminfo",()=>this.getTerminfo(r).propagate(s));return s}this.lock.getTerminfo=true;var o=(t,e)=>{if(n){return}n=true;this.removeListener("terminal",a);if(!i){this.grabInput(false)}if(t){if(this.shutdown){t.code="shutdown"}s.reject(t);return}if(!e.valid||e.key!==r){s.resolve();return}s.resolve(e.value)};var a=(t,e)=>{if(t!=="TERMINFO"){return}this.lock.getTerminfo=false;this.emit("unlock_getTerminfo");o(undefined,e)};if(!i){this.grabInput()}this.on("terminal",a);this.xtgettcapLL(w.from(r).toString("hex"));l.resolveSafeTimeout(this.timeout).then(()=>{if(n){return}var t=new Error(".getTerminfo() timed out");t.code="timeout";o(t)});return s};var y=m("./colorScheme/default.json");(function t(){var e,r,i,n;for(e=16;e<232;e++){r=e-16;i=255/5;y[e]={r:Math.round(Math.floor(r/36)%6*i),g:Math.round(Math.floor(r/6)%6*i),b:Math.round(r%6*i),names:[]}}for(e=232;e<=255;e++){r=e-231;i=255/25;n=Math.round(r*i);y[e]={r:n,g:n,b:n,names:[]}}})();d.rgbForRegister=function(t){if(t<0||t>255){throw new Error("Bad register value")}return{r:this.colorRegister[t].r,g:this.colorRegister[t].g,b:this.colorRegister[t].b}};d.registerForRgb=function(t,e,r,i,n){if(t&&typeof t==="object"){n=r;i=e;r=t.b;e=t.g;t=t.r}if(typeof t!=="number"||t<0||t>255||typeof e!=="number"||e<0||e>255||typeof r!=="number"||r<0||r>255){throw new Error("Bad RGB value")}if(typeof n!=="number"||n<0||n>255){n=15}if(typeof i!=="number"||i<0||i>255){i=0}if(i>n){var s;s=n;n=i;i=s}return this._registerForRgb(t,e,r,i,n)};d._registerForRgb=function(t,e,r,i,n){var s,o,a=Infinity,u=[t,e,r];for(s=i;s<=n;s++){o=p.chroma.distance(u,this.colorRegister[s],"hcl");if(o<a){a=o;i=s}}return i};d.colorNameForRgb=function(t,e,r){return p.indexToColorName(this.registerForRgb(t,e,r,0,15))};d.colorNameForHex=function(t){var e=p.hexToRgba(t);return this.colorNameForRgb(e.r,e.g,e.b)};d.registerForRgbCache=function(t,e,r,i,n,s){var o=e+"-"+r+"-"+i;if(t[o]){return t[o]}return t[o]=this._registerForRgb(e,r,i,n,s)};d.drawCursor=function(){};d.put=function(t,e,...r){var i,n,s,o,a,u,l,f,h,c,d;if(!t){t={}}l=t.wrap===undefined?true:t.wrap;n=t.x||0;s=t.y||0;if(typeof n!=="number"||n<1){n=1}else if(n>this.width){n=this.width}else{n=Math.floor(n)}if(typeof s!=="number"||s<1){s=1}else if(s>this.height){s=this.height}else{s=Math.floor(s)}o=1;a=0;switch(t.direction){case"left":o=-1;break;case"up":o=0;a=-1;break;case"down":o=0;a=1;break;case null:case"none":o=0;a=0;break}if(typeof t.dx==="number"){o=t.dx}if(typeof t.dy==="number"){a=t.dy}d=o===1&&a===0;u=t.attr||this.esc.styleReset.on;if(u&&typeof u==="object"){u=this.object2attr(u)}if(typeof u!=="string"){u=this.esc.styleReset.on}if(typeof e!=="string"){if(e.toString){e=e.toString()}else{return}}if(r.length){e=v.format(e,...r)}e=p.stripControlChars(e);f=v.unicode.toArray(e);h=f.length;c=true;this.stdout.write(u);for(i=0;i<h;i++){if(c){this.moveTo(n,s)}this(f[i]);n+=o;s+=a;c=!d;if(n<0){if(!l){break}n=this.width-1;s--;c=true}else if(n>=this.width){if(!l){break}n=0;s++;c=true}if(s<0){break}else if(s>=this.height){break}}};d.drawNdarrayImage=function(t){var e,r=Math.min(t.shape[0],this.width),i,n=Math.ceil(t.shape[1]/2),s=t.shape[2]===4,o=this.support["256colors"]?255:15,a,u,l,f,h={};for(i=0;i<n;i++){for(e=0;e<r;e++){if(this.support.trueColor){l=s?t.get(e,i*2,3)/255:1;if(i*2+1<t.shape[1]){f=s?t.get(e,i*2+1,3)/255:1;this.noFormat(this.optimized.color24bits(Math.round(l*t.get(e,i*2,0)),Math.round(l*t.get(e,i*2,1)),Math.round(l*t.get(e,i*2,2)))+this.optimized.bgColor24bits(Math.round(f*t.get(e,i*2+1,0)),Math.round(f*t.get(e,i*2+1,1)),Math.round(f*t.get(e,i*2+1,2)))+"▀")}else{this.noFormat(this.optimized.color24bits(Math.round(l*t.get(e,i*2,0)),Math.round(l*t.get(e,i*2,1)),Math.round(l*t.get(e,i*2,2)))+this.optimized.bgColor24bits(0,0,0)+"▀")}}else{a=s&&t.get(e,i*2,3)<127?0:this.registerForRgbCache(h,t.get(e,i*2,0),t.get(e,i*2,1),t.get(e,i*2,2),0,o);if(i*2+1<t.shape[1]){u=s&&t.get(e,i*2+1,3)<127?0:this.registerForRgbCache(h,t.get(e,i*2+1,0),t.get(e,i*2+1,1),t.get(e,i*2+1,2),0,o);this.noFormat(this.optimized.color256[a]+this.optimized.bgColor256[u]+"▀")}else{this.noFormat(this.optimized.color256[a]+this.optimized.bgColor256[0]+"▀")}}}this.styleReset()("\n")}};d.drawImage=function(t,e,r){return p.image.load.call(this,d.drawNdarrayImage.bind(this),t,e,r)}}).call(this)}).call(this,m("_process"),m("buffer").Buffer)},{"./bar.js":8,"./colorScheme/default.json":10,"./extClipboard.js":37,"./fileInput.js":38,"./gridMenu.js":39,"./inputField.js":41,"./progressBar.js":44,"./singleColumnMenu.js":45,"./singleLineMenu.js":46,"./slowTyping.js":47,"./termkit.js":50,"./yesOrNo.js":57,_process:179,buffer:147,"nextgen-events":72,seventh:108,"string-kit":123,"tree-kit":134}],6:[function(t,e,r){"use strict";const i=t("fs");const u=t("string-kit");function n(t={}){this.ScreenBuffer=t.ScreenBuffer||t.dst&&t.dst.constructor||l.ScreenBuffer;this.dst=t.dst;this.palette=t.palette||this.dst&&this.dst.palette;this.width=t.width||Infinity;this.height=t.height||Infinity;this.dstClipRect=t.dstClipRect?new l.Rect(t.dstClipRect):null;this.x=t.x||0;this.y=t.y||0;this.firstLineRightShift=t.firstLineRightShift||0;this.cx=0;this.cy=0;this.ch=false;this.voidTextBuffer=null;this.defaultAttr=this.ScreenBuffer.prototype.DEFAULT_ATTR;this.voidAttr=this.ScreenBuffer.prototype.DEFAULT_ATTR;this.preserveMarkupFormat=this.ScreenBuffer.prototype.preserveMarkupFormat;this.markupToAttrObject=this.ScreenBuffer.prototype.markupToAttrObject;this.hidden=false;this.tabWidth=t.tabWidth||4;this.forceInBound=!!t.forceInBound;this.lineWrapWidth=t.lineWrapWidth||null;this.wordWrap=!!t.wordWrap;if(t.wordWrapWidth){this.lineWrapWidth=t.wordWrapWidth;this.wordWrap=true}this.selectionRegion=null;this.buffer=[[]];this.stateMachine=t.stateMachine||null;if(t.hidden){this.setHidden(t.hidden)}}e.exports=n;n.create=(...t)=>new n(...t);function h(t=" ",e=null,r=null){this.char=t||" ";this.filler=t===null;this.attr=e;this.misc=r}n.Cell=h;const l=t("./termkit.js");n.prototype.getText=function(){return this.buffer.map(t=>u.unicode.fromCells(t)).join("")};n.prototype.getCursorSplittedText=function(){var t,e,r="",i="";for(t=0;t<this.buffer.length;t++){e=this.buffer[t];if(t<this.cy){r+=u.unicode.fromCells(e)}else if(t>this.cy){i+=u.unicode.fromCells(e)}else{r+=u.unicode.fromCells(e.slice(0,this.cx));i+=u.unicode.fromCells(e.slice(this.cx))}}return[r,i]};n.prototype.setText=function(t,e,r){if(typeof e!=="boolean"&&typeof e!=="string"){r=e;e=false}var i=false,n=null;switch(e){case"ansi":n=l.parseAnsi;break;case"legacyAnsi":n=l.parseAnsi;i=true;break;case true:n=l.parseMarkup;break}if(r===undefined){r=this.defaultAttr}if(typeof r==="object"){r=this.object2attr(r)}this.buffer.length=0;t.split(/(?<=\n)/g).forEach(t=>{var e=this.buffer.length;this.buffer[e]=this.lineToCells(t,n,r,0,i);if(t[t.length-1]==="\n"){this.buffer[e].push(new h("\n",r))}if(this.lineWrapWidth){this.wrapLine(e)}})};n.prototype.lineToCells=function(t,e,r,i=0,n=false){var s=r,o,a;if(!e){return u.unicode.toCells(h,t,this.tabWidth,i,s)}s=r;o=this.ScreenBuffer.attr2object(s);a=[];e(t,l.markupOptions).forEach(t=>{if(typeof t==="string"){a.push(...u.unicode.toCells(h,t,this.tabWidth,i+a.length,s));return}if(t.markup.reset){s=t.markup.special?this.ScreenBuffer.DEFAULT_ATTR:r;o=this.ScreenBuffer.attr2object(s)}else{Object.assign(o,t.markup);if(o.defaultColor&&o.color!==undefined){delete o.defaultColor}if(o.bgDefaultColor&&o.bgColor!==undefined){delete o.bgDefaultColor}s=this.object2attr(o,undefined,n)}if(t.markup.raw){a.push(...u.unicode.toCells(h,t.markup.raw,this.tabWidth,i+a.length,s))}});return a};n.prototype.setHidden=function(t){this.hidden=typeof t==="string"&&t.length?t[0]:t?l.spChars.password:false};n.prototype.getHidden=function(){return this.hidden};n.prototype.setVoidTextBuffer=function(t=null){this.voidTextBuffer=t};n.prototype.getVoidTextBuffer=function(){return this.voidTextBuffer};n.prototype.getContentSize=function(){return{width:Math.max(1,...this.buffer.map(t=>t.length)),height:this.buffer.length}};n.prototype.getCursorOffset=function(){var t,e,r,i=0;for(e=0;e<this.cy;e++){r=this.buffer[e];if(!r){continue}for(t=0;t<r.length;t++){if(!r[t].filler){i++}}}r=this.buffer[this.cy];if(r){for(t=0;t<this.cx&&t<r.length;t++){if(!r[t].filler){i++}}}return i};n.prototype.setCursorOffset=function(t){var e;this.cy=this.cx=0;if(t<=0){return}while(this.cy<this.buffer.length){this.cx=0;e=this.buffer[this.cy];if(!e){continue}while(this.cx<e.length){if(e[this.cx].filler){this.cx++}else{t--;this.cx++;if(t<=0){if(this.cx===e.length&&e[e.length-1].char==="\n"){this.cx=0;this.cy++}return}}}this.cy++}};n.prototype.reTabLine=function(t=0){var e,r,i,n,s,o,a=t;if(this.buffer[this.cy]===undefined){this.buffer[this.cy]=[]}s=this.buffer[this.cy];o=s.slice(0,t);e=s.length;for(i=t;i<e;i++){r=s[i];if(r.char==="\t"){n=this.tabWidth-a%this.tabWidth-1;o.push(r);a+=1+n;while(n--){o.push(new h(null,r.attr,r.misc))}while(i+1<e&&s[i+1].filler){i++}}else{o.push(r);a++}}this.buffer[this.cy]=o};const y=new Set(["!","?",":",";","«","»",",",".","…"]);n.prototype.wrapLine=function(t=this.cy,e=this.lineWrapWidth,r=this.wordWrap){var i,n,s,o,a,u,l,f,h,c,d=this.cy===t;if(t>=this.buffer.length){return t}a=this.buffer[t];l=this.buffer[t-1];s=t?0:this.firstLineRightShift;u=e-s;if(!e||a.length&&a.length<=u&&a[a.length-1].char==="\n"&&(!l||!l.length||l[l.length-1].char==="\n")){return t+1}var p=[],g=[];for(n=t-1;n>=0;n--){a=this.buffer[n];if(a.length&&a[a.length-1].char==="\n"){t=n+1;break}else if(!n){t=0;break}}for(n=t;n<this.buffer.length;n++){a=this.buffer[n];p.push(...a);if(a.length&&a[a.length-1].char==="\n"){n++;break}}o=n;s=t?0:this.firstLineRightShift;if(d){c=0;for(n=t;n<this.cy;n++){c+=this.buffer[n].length}c+=this.cx}while(p.length){u=e-s;s=0;if(p.length<=u){g.push(p);if(p.length===u){g.push([])}break}if(!r){g.push(p.splice(0,u));continue}h=false;i=u;if(p[i].char===" "){while(i<p.length&&p[i].char===" "){i++}if(i>=p.length){g.push(p);break}if(i===u+1&&y.has(p[i].char)&&p[u-1].char!==" "){i=u-1}else{h=true}}if(!h){f=null;while(i>=0&&(p[i].char!==" "||y.has(f)&&i>0&&p[i-1].char!==" ")){f=p[i].char;i--}if(i<0){i=u}else{i++}}g.push(p.splice(0,i))}this.buffer.splice(t,o-t,...g);o=t+g.length;if(d){for(n=t;;n++){if(n>=o){if(n>0){n--}this.cy=n;this.cx=this.buffer[n]?this.buffer[n].length:0;break}if(!this.buffer[n]){this.cy=n;this.cx=0;break}if(c<this.buffer[n].length){this.cy=n;this.cx=c;break}c-=this.buffer[n].length}if(this.cx&&this.buffer[this.cy]&&this.buffer[this.cy][this.cx-1]&&this.buffer[this.cy][this.cx-1].char==="\n"){this.cy++;this.cx=0;if(!this.buffer[this.cy]){this.buffer[this.cy]=[]}}}return o};n.prototype.wrapAllLines=function(t=this.lineWrapWidth,e=this.wordWrap){var r=0;while(r<this.buffer.length){r=this.wrapLine(r,t,e)}};n.prototype.wordWrapLine=function(t=this.cy,e=this.lineWrapWidth){return this.wrapLine(t,e,true)};n.prototype.wordWrapAllLines=function(t=this.lineWrapWidth){var e=0;while(e<this.buffer.length){e=this.wrapLine(e,t,true)}};n.prototype.setDefaultAttr=function(t){if(t&&typeof t==="object"){t=this.object2attr(t)}else if(typeof t!=="number"){return}this.defaultAttr=t};n.prototype.setEmptyCellAttr=n.prototype.setVoidAttr=function(t){if(t===null){this.voidAttr=null}else if(t&&typeof t==="object"){t=this.object2attr(t)}else if(typeof t!=="number"){return}this.voidAttr=t};n.prototype.setAttrAt=function(t,e,r){if(t&&typeof t==="object"){t=this.object2attr(t)}else if(typeof t!=="number"){return}this.setAttrCodeAt(t,e,r)};n.prototype.setAttrCodeAt=function(t,e,r){if(!this.buffer[r]){this.buffer[r]=[]}if(!this.buffer[r][e]){this.buffer[r][e]=new h(" ",t)}else{this.buffer[r][e].attr=t}};const a={xmin:0,xmax:Infinity,ymin:0,ymax:Infinity};n.prototype.setAttrRegion=function(t,e){if(t&&typeof t==="object"){t=this.object2attr(t)}else if(typeof t!=="number"){return}this.setAttrCodeRegion(t,e)};n.prototype.setAttrCodeRegion=function(t,e=a){var r,i,n,s,o;o=Math.min(e.ymax,this.buffer.length-1);for(i=e.ymin;i<=o;i++){if(!this.buffer[i]){this.buffer[i]=[]}n=i===e.ymin?e.xmin:0;s=i===e.ymax?Math.min(e.xmax,this.buffer[i].length-1):this.buffer[i].length-1;for(r=n;r<=s;r++){this.buffer[i][r].attr=t}}};n.prototype.setSelectionRegion=function(t){if(this.selectionRegion){this.hilightSelection(false)}else{this.selectionRegion={}}if(t.xmin!==undefined&&t.ymin!==undefined){this.selectionRegion.xmin=t.xmin;this.selectionRegion.ymin=t.ymin}if(t.xmax!==undefined&&t.ymax!==undefined){this.selectionRegion.xmax=t.xmax;this.selectionRegion.ymax=t.ymax}this.hilightSelection()};n.prototype.resetSelectionRegion=function(){if(!this.selectionRegion){return}this.hilightSelection(false);this.selectionRegion=null};n.prototype.hilightSelection=function(t=true){var e,r,i,n,s,o=this.selectionRegion;if(!o||o.xmin===undefined||o.ymin===undefined||o.xmax===undefined||o.ymax===undefined){return}s=Math.min(o.ymax,this.buffer.length-1);for(r=o.ymin;r<=s;r++){if(!this.buffer[r]){this.buffer[r]=[]}i=r===o.ymin?o.xmin:0;n=r===o.ymax?Math.min(o.xmax,this.buffer[r].length-1):this.buffer[r].length-1;for(e=i;e<=n;e++){this.buffer[r][e].attr=t?this.ScreenBuffer.attrSelect(this.buffer[r][e].attr):this.ScreenBuffer.attrUnselect(this.buffer[r][e].attr)}}};n.prototype.getSelectionText=function(){var t,e,r,i,n,s,o="",a=this.selectionRegion;if(!a||a.xmin===undefined||a.ymin===undefined||a.xmax===undefined||a.ymax===undefined){return o}n=Math.min(a.ymax,this.buffer.length-1);for(e=a.ymin;e<=n;e++){if(!this.buffer[e]){this.buffer[e]=[]}r=e===a.ymin?a.xmin:0;i=e===a.ymax?Math.min(a.xmax,this.buffer[e].length-1):this.buffer[e].length-1;for(t=r;t<=i;t++){s=this.buffer[e][t];o+=s.filler?"":s.char}}return o};n.prototype.getMisc=function(){if(!this.buffer[this.cy]||!this.buffer[this.cy][this.cx]){return}if(!this.buffer[this.cy][this.cx].misc){this.buffer[this.cy][this.cx].misc={}}return this.buffer[this.cy][this.cx].misc};n.prototype.getMiscAt=function(t,e){if(!this.buffer[e]||!this.buffer[e][t]){return}if(!this.buffer[e][t].misc){this.buffer[e][t].misc={}}return this.buffer[e][t].misc};n.prototype.iterate=function(t,e){var r,i,n,s=0,o;if(typeof t==="function"){e=t;t={}}else if(!t||typeof t!=="object"){t={}}if(!this.buffer.length){return}for(i=0,n=this.buffer.length;i<n;i++){if(this.buffer[i]){o=this.buffer[i].length;for(r=0;r<o;r++){if(this.buffer[i][r].filler){continue}e({offset:s,x:r,y:i,text:this.buffer[i][r].char,attr:this.buffer[i][r].attr,misc:this.buffer[i][r].misc});s++}}}if(t.finalCall){e({offset:s+1,x:null,y:i,text:"",attr:null,misc:null})}};n.prototype.moveTo=function(t,e){this.cx=t>=0?t:0;this.cy=e>=0?e:0};n.prototype.move=function(t,e){this.moveTo(this.cx+t,this.cy+e)};n.prototype.moveToColumn=function(t){this.moveTo(t,this.cy)};n.prototype.moveToLine=n.prototype.moveToRow=function(t){this.moveTo(this.cx,t)};n.prototype.moveUp=function(){this.cy=this.cy>0?this.cy-1:0;if(this.forceInBound){this.moveInBound(true)}};n.prototype.moveDown=function(){this.cy++;if(this.forceInBound){this.moveInBound(true)}};n.prototype.moveLeft=function(){this.cx=this.cx>0?this.cx-1:0;if(this.forceInBound){this.moveInBound(true)}};n.prototype.moveRight=function(){this.cx++;if(this.forceInBound){this.moveInBound(true)}};n.prototype.moveForward=function(t,e){var r=this.cx,i=this.buffer[this.cy];if(e&&(!i||!i[this.cx]||!i[this.cx].filler)){return}for(;;){if(!i||this.cx+1>i.length||this.cx<i.length&&i[this.cx].char==="\n"){if(this.cy+1<this.buffer.length||!this.forceInBound){this.cy++;this.cx=0}else{this.cx=r}break}this.cx++;if(!i[this.cx]||!i[this.cx].filler&&(!t||t(i[this.cx].char))){break}}if(this.forceInBound){this.moveInBound()}};n.prototype.moveBackward=function(t,e){var r,i=this.buffer[this.cy];if(e&&(!i||!i[this.cx]||!i[this.cx].filler)){return}for(;;){r=i?i.length:0;if(this.cx>r){this.cx=r}else{this.cx--}if(this.cx<0){this.cy--;if(this.cy<0){this.cy=0;this.cx=0;break}this.moveToEndOfLine();break}if(!i||!i[this.cx]||(!i[this.cx].filler||i[this.cx].char!=="\n")&&(!t||t(i[this.cx].char))){break}}if(this.forceInBound){this.moveInBound()}};const s=new Set([" ","\t",".",",",";",":","!","?","/","\\","(",")","[","]","{","}","<",">","=","'",'"']);n.prototype.wordBoundary_=function(t,e){var r,i=false;if(e&&this.buffer[this.cy]&&this.buffer[this.cy][this.cx]){r=this.buffer[this.cy][this.cx].char;if(!s.has(r)){i=true}}this[t](t=>{if(s.has(t)){if(i){return true}return false}i=true;return false})};n.prototype.moveToEndOfWord=function(){return this.wordBoundary_("moveForward",true)};n.prototype.moveToStartOfWord=function(){var t,e=this.cx,r=this.cy;this.wordBoundary_("moveBackward");if(this.cx<e&&this.cy===r&&this.buffer[this.cy]&&this.buffer[this.cy][this.cx]){t=this.buffer[this.cy][this.cx].char;if(s.has(t)){this.moveForward()}}else if(this.cy<r&&e!==0&&this.buffer[r]&&this.buffer[r][0]){t=this.buffer[r][0].char;if(!s.has(t)){this.cx=0;this.cy=r}}};n.prototype.moveToStartOfLine=function(){this.cx=0};n.prototype.moveToEndOfLine=function(){var t=this.buffer[this.cy];if(!t){this.cx=0}else if(t.length&&t[t.length-1].char==="\n"){this.cx=t.length-1}else{this.cx=t.length}};n.prototype.moveToStartOfBuffer=function(){this.cx=this.cy=0};n.prototype.moveToEndOfBuffer=function(){this.cy=this.buffer.length?this.buffer.length-1:0;this.moveToEndOfLine()};n.prototype.moveInBound=function(t){var e=this.buffer[this.cy];if(this.cy>this.buffer.length){this.cy=this.buffer.length}if(t){return}if(!e){this.cx=0}else if(e.length&&e[e.length-1].char==="\n"){if(this.cx>e.length-1){this.cx=e.length-1}}else if(this.cx>e.length){this.cx=e.length}};n.prototype.insert=function(t,e,r){var i,n,s;if(!t){return}if(typeof e!=="boolean"&&typeof e!=="string"){r=e;e=false}var o=false,a=null;switch(e){case"ansi":a=l.parseAnsi;break;case"legacyAnsi":a=l.parseAnsi;o=true;break;case true:a=l.parseMarkup;break}i=t.split("\n");s=i.length;if(r&&typeof r==="object"){r=this.object2attr(r)}else if(typeof r!=="number"){r=this.defaultAttr}if(this.forceInBound){this.moveInBound()}this.inlineInsert(i[0],a,r);for(n=1;n<s;n++){this.newLine(true);this.inlineInsert(i[n],a,r)}};n.prototype.prepend=function(t,e,r){this.moveToStartOfBuffer();this.insert(t,e,r)};n.prototype.append=function(t,e,r){this.moveToEndOfBuffer();this.insert(t,e,r)};n.prototype.inlineInsert=function(t,e,r,i=false){var n,s,o,a,u,l,f;this.moveForward(undefined,true);f=this.lineToCells(t,e,r,this.cx,i);if(this.cy>=this.buffer.length){while(this.buffer.length<this.cy){this.buffer.push([new h("\n",this.defaultAttr)])}if(this.cy&&(!this.buffer[this.cy-1].length||this.buffer[this.cy-1][this.buffer[this.cy-1].length-1].char!=="\n")){this.buffer[this.cy-1].push(new h("\n",this.defaultAttr))}this.buffer[this.cy]=[]}n=this.buffer[this.cy];s=n.length;o=s&&n[s-1].char==="\n";if(this.cx===s){if(o){n.splice(s-1,0,new h(" ",this.defaultAttr),...f)}else{n.push(...f)}}else if(this.cx<s){n.splice(this.cx,0,...f)}else if(o){l=this.cx-s+1;a=n.pop();while(l--){n.push(new h(" ",this.defaultAttr))}n.push(...f,a)}else{l=this.cx-s;while(l--){n.push(new h(" ",this.defaultAttr))}n.push(...f)}u=this.indexOfCharInLine(n,"\t",this.cx);this.cx+=f.length;if(this.lineWrapWidth){this.wrapLine()}if(u!==-1){this.reTabLine(u)}};n.prototype.indexOfCharInLine=function(t,e,r=0){var i=t.length;for(;r<i;r++){if(t[r].char===e){return r}}return-1};n.prototype.delete=function(t){var e,r;if(t===undefined){t=1}if(this.forceInBound){this.moveInBound()}if(this.buffer[this.cy]&&this.buffer[this.cy][this.cx]&&this.buffer[this.cy][this.cx].filler){this.moveBackward(undefined,true);t--}while(t>0){e=this.buffer[this.cy];if(this.cy>=this.buffer.length||this.cy===this.buffer.length-1&&this.cx>=e.length){return}if(e){if(this.cx>e.length){this.cx=e.length}if(e[this.cx]&&e[this.cx].char!=="\n"){r=this.countInlineForward(t);if(r>0){e.splice(this.cx,r)}t-=r}}if(t>0){if(this.joinLine(true)){t--}}}if(this.lineWrapWidth){this.wrapLine()}this.reTabLine()};n.prototype.backDelete=function(t){var e,r,i;if(t===undefined){t=1}if(this.forceInBound){this.moveInBound()}if(this.buffer[this.cy]&&this.cx&&this.buffer[this.cy][this.cx-1]&&this.buffer[this.cy][this.cx-1].filler){this.moveBackward(undefined,true)}while(t>0){e=this.buffer[this.cy];if(this.cy===0&&this.cx===0){return}if(e){if(this.cx>e.length){if(e.length&&e[e.length-1].char==="\n"){this.cx=e.length-1}else{this.cx=e.length}t--}else if(this.cx&&this.cx===e.length&&e[e.length-1].char==="\n"){this.cx=e.length-1}r=this.countInlineBackward(t);if(r>0){e.splice(this.cx-r,r);this.cx-=r}t-=r}if(t>0){this.cy--;this.cx=e?e.length:0;if(this.joinLine(true)){t--}}}if(this.lineWrapWidth){this.wrapLine()}this.reTabLine(i)};n.prototype.countInlineBackward=function(t){var e,r;for(r=this.cx-1,e=0;r>=0&&e<t;r--,e++){if(this.buffer[this.cy][r]&&this.buffer[this.cy][r].filler){t++}}return e};n.prototype.countInlineForward=function(t){var e,r,i=this.buffer[this.cy].length;for(r=this.cx,e=0;r<i&&e<t;r++,e++){if(this.buffer[this.cy][r+1]&&this.buffer[this.cy][r+1].filler){t++}}return e};n.prototype.newLine=function(t){var e,r,i=[],n;if(!t&&this.forceInBound){this.moveInBound()}if(this.buffer[this.cy]===undefined){this.buffer[this.cy]=[]}e=this.buffer[this.cy];r=e.length;if(this.cx<r){i=e.slice(this.cx);e.length=this.cx}e.push(new h("\n",this.defaultAttr));this.buffer.splice(this.cy+1,0,i);this.cx=0;this.cy++;if(!t){if(this.lineWrapWidth){this.wrapLine()}n=this.indexOfCharInLine(e,"\t",this.cx);if(n!==-1){this.reTabLine(n)}}};n.prototype.joinLine=function(t){var e,r,i=false;if(!t&&this.forceInBound){this.moveInBound()}if(this.buffer[this.cy]===undefined){this.buffer[this.cy]=[]}if(this.buffer[this.cy+1]===undefined){this.buffer[this.cy+1]=[]}r=this.buffer[this.cy];if(r.length&&r[r.length-1].char==="\n"){r.length--;i=true}this.cx=r.length;r.splice(r.length,0,...this.buffer[this.cy+1]);this.buffer.splice(this.cy+1,1);if(!t){if(this.lineWrapWidth){this.wrapLine()}e=this.indexOfCharInLine(r,"\t",this.cx);if(e!==-1){this.reTabLine(e)}}return i};n.prototype.draw=function(t={}){var e={dst:t.dst||this.dst,offsetX:t.x!==undefined?Math.floor(t.x):Math.floor(this.x),offsetY:t.y!==undefined?Math.floor(t.y):Math.floor(this.y),dstClipRect:t.dstClipRect?new l.Rect(t.dstClipRect):this.dstClipRect,srcClipRect:t.srcClipRect?new l.Rect(t.srcClipRect):undefined,blending:t.blending,wrap:t.wrap,tile:t.tile};if(e.dst instanceof this.ScreenBuffer){this.blitter(e);if(t.cursor){e.dst.cx=this.cx+e.offsetX;e.dst.cy=this.cy+e.offsetY}}};n.prototype.drawCursor=function(t){if(!t||typeof t!=="object"){t={}}var e,r=t.dst||this.dst;if(r instanceof this.ScreenBuffer){e=this.cy?this.cx:this.cx+this.firstLineRightShift;if(!this.ch&&(this.dstClipRect||new l.Rect(this.dst)).isInside(e+this.x,this.cy+this.y)){r.cx=e+this.x;r.cy=this.cy+this.y;r.ch=false}else{r.ch=true}}};n.prototype.blitter=function(t){var e,r,i,n,s,o;r=new l.Rect(this);if(this.voidTextBuffer){n=this.voidTextBuffer.buffer;r.merge(new l.Rect(this.voidTextBuffer))}i=t.srcClipRect||new l.Rect(r);e={type:"line",context:{srcFirstLineRightShift:this.firstLineRightShift,srcBuffer:this.buffer,srcAltBuffer:n,dstBuffer:t.dst.buffer,forceChar:this.hidden,voidAttr:this.voidAttr,writeAttr:this.ScreenBuffer===l.ScreenBuffer?(t,e,r)=>{t.writeInt32BE(e,r)}:(t,e,r)=>{e.copy(t,r)}},dstRect:new l.Rect(t.dst),srcRect:r,dstClipRect:t.dstClipRect||new l.Rect(t.dst),srcClipRect:i,offsetX:t.offsetX,offsetY:t.offsetY,wrap:t.wrap,tile:t.tile,multiply:this.ScreenBuffer.prototype.ITEM_SIZE};o=this.blitterLineIterator.bind(this);if(t.wrap){s="wrapIterator"}else if(t.tile){s="tileIterator"}else{s="regionIterator"}l.Rect[s](e,o)};n.prototype.blitterLineIterator=function(t){var e,r,i,n,s,o,a,u,l;e=t.srcY?0:t.context.srcFirstLineRightShift;r=t.srcXmin-e;i=t.srcXmax-e;s=t.dstStart;o=t.context.srcBuffer[t.srcY];if(o){n=i;if(n>=o.length){n=o.length-1}for(;r<=n;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){if(r<0){continue}a=o[r];t.context.writeAttr(t.context.dstBuffer,a.attr,s);if(t.context.forceChar){t.context.dstBuffer.write(t.context.forceChar,s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}else if((l=a.char.charCodeAt(0))<32||l===127){t.context.dstBuffer.write(" ",s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}else{t.context.dstBuffer.write(a.char,s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}}if(t.context.srcAltBuffer){o=t.context.srcAltBuffer[t.srcY];if(o){n=i;if(n>=o.length){n=o.length-1}for(;r<=n;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){if(r<0){continue}a=o[r];t.context.writeAttr(t.context.dstBuffer,a.attr,s);if((l=a.char.charCodeAt(0))<32||l===127){t.context.dstBuffer.write(" ",s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}else{t.context.dstBuffer.write(a.char,s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}}}u=t.context.voidAttr;if(u!==null){for(;r<=i;r++,s+=this.ScreenBuffer.prototype.ITEM_SIZE){t.context.writeAttr(t.context.dstBuffer,u,s);t.context.dstBuffer.write(" ",s+this.ScreenBuffer.prototype.ATTR_SIZE,this.ScreenBuffer.prototype.CHAR_SIZE)}}};n.prototype.load=function(t,r){this.buffer[0]=[];this.buffer.length=1;i.readFile(t,(t,e)=>{if(t){r(t);return}this.setText(e.toString());r()})};n.prototype.save=function(t,e){i.writeFile(t,this.getText(),t=>{if(t){e(t);return}e()})};n.prototype.object2attr=function(t,e=this.palette?.colorNameToIndex,r=false){return this.ScreenBuffer.object2attr(t,e,r)};n.prototype.runStateMachine=function(){if(!this.stateMachine){return}this.stateMachine.reset();this.iterate({finalCall:true},t=>{t.textBuffer=this;this.stateMachine.pushEvent(t.text,t)})};const o={};n.TextMachineApi=o;o.style=(t,e)=>{if(t.x===null){return}if(!e.code){e.code=t.textBuffer.ScreenBuffer.object2attr(e)}t.textBuffer.setAttrCodeAt(e.code,t.x,t.y)};o.startingStyle=(t,e)=>{if(!t.startingContext||t.startingContext.x===null){return}if(!e.code){e.code=t.textBuffer.ScreenBuffer.object2attr(e)}t.textBuffer.setAttrCodeAt(e.code,t.startingContext.x,t.startingContext.y)};o.openingStyle=o.startingStyle;o.blockStyle=function(t,e){if(t.x===null||!t.startingContext||t.startingContext.x===null){return}if(!e.code){e.code=t.textBuffer.ScreenBuffer.object2attr(e)}t.textBuffer.setAttrCodeRegion(e.code,{xmin:t.startingContext.x,xmax:t.x,ymin:t.startingContext.y,ymax:t.y})};o.hint=function(t,e){var r;if(e[t.buffer]){r=t.textBuffer.getMiscAt(t.x,t.y);if(r){r.hint=e[t.buffer]}}}},{"./termkit.js":50,fs:136,"string-kit":123}],7:[function(t,e,r){"use strict";e.exports=function t(e,r,i,n,s){var o,a,u,l=[],f=r,h=false;if(!n){n=""}if(!s){s=""}for(o=0;o<e.length;o++){if(e[o].slice(0,r.length)===r){l.push(e[o])}}if(!l.length){return n+f+s}if(l.length===1){return n+l[0]+s}a=r.length;u=false;for(a=r.length;a<l[0].length;a++){for(o=1;o<l.length;o++){if(l[o][a]!==l[0][a]){u=true;break}}if(u){break}f+=l[0][a];h=true}if(i&&!h){l.prefix=n;l.postfix=s;return l}return n+f+s}},{}],8:[function(t,e,r){"use strict";const u=t("./spChars.js");e.exports=function(t,e){var r="",i="";e=e||{};if(isNaN(t)||t<0){t=0}else if(t>1){t=1}var n=e.innerSize||10;var s=Math.floor(t*n);var o=Math.round((t*n-s)*8);var a=e.barStyle||this.blue;i+="█".repeat(s);if(s<n){i+=u.enlargingBlock[o];i+=" ".repeat(n-s-1)}if(e.str){r+=this.str.inverse("▉");r+=a.str(i);r+=this.str("▏");return r}this.inverse("▉");a(i);this("▏");return this}},{"./spChars.js":48}],9:[function(e,r,t){(function(t){(function(){"use strict";r.exports=e("./termkit-no-lazy-require.js");t.IS_BROWSER=true}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./termkit-no-lazy-require.js":49}],10:[function(t,e,r){e.exports=[{r:0,g:0,b:0,names:["black"]},{r:180,g:0,b:0,names:["red"]},{r:0,g:180,b:0,names:["green"]},{r:180,g:180,b:0,names:["yellow"]},{r:0,g:0,b:180,names:["blue"]},{r:180,g:0,b:180,names:["magenta"]},{r:0,g:180,b:180,names:["cyan"]},{r:220,g:220,b:220,names:["white"]},{r:55,g:55,b:55,names:["brightBlack","gray","grey"]},{r:250,g:0,b:0,names:["brightRed"]},{r:0,g:250,b:0,names:["brightGreen"]},{r:250,g:250,b:0,names:["brightYellow"]},{r:0,g:0,b:250,names:["brightBlue"]},{r:250,g:0,b:250,names:["brightMagenta"]},{r:0,g:250,b:250,names:["brightCyan"]},{r:250,g:250,b:250,names:["brightWhite"]}]},{}],11:[function(t,e,r){e.exports=[{r:0,g:0,b:0,names:["black"]},{r:204,g:0,b:0,names:["red"]},{r:78,g:154,b:6,names:["green"]},{r:196,g:160,b:0,names:["yellow"]},{r:52,g:101,b:164,names:["blue"]},{r:117,g:80,b:123,names:["magenta"]},{r:6,g:152,b:154,names:["cyan"]},{r:211,g:215,b:207,names:["white"]},{r:85,g:87,b:83,names:["brightBlack","gray","grey"]},{r:239,g:41,b:41,names:["brightRed"]},{r:138,g:226,b:52,names:["brightGreen"]},{r:252,g:233,b:79,names:["brightYellow"]},{r:114,g:159,b:207,names:["brightBlue"]},{r:173,g:127,b:168,names:["brightMagenta"]},{r:52,g:226,b:226,names:["brightCyan"]},{r:238,g:238,b:236,names:["brightWhite"]}]},{}],12:[function(t,e,r){(function(p){(function(){"use strict";const e=t("seventh");const o=t("child_process").exec;const h=t("path");const c=t("os");const n=t("./termkit.js");r.guessTerminal=function(t){var e,r;var i=!!p.env.SSH_CONNECTION;var n=!!p.stdout.isTTY;if(!n&&!t){return{isTTY:n,isSSH:i,appId:"none",safe:true,generic:"none"}}var s=c.platform();var o=p.env.TERM&&p.env.TERM.match(/256/)||p.env.COLORTERM&&p.env.COLORTERM.match(/256/);var a=p.env.COLORTERM&&p.env.COLORTERM.match(/^(truecolor|24bits?)$/);var u=p.env.COLORTERM&&!a?p.env.COLORTERM:p.env.TERM_PROGRAM?p.env.TERM_PROGRAM:p.env.TERM;if(s==="darwin"){u=h.parse(u).name}var l=u!==p.env.TERM||p.env.TERM&&p.env.TERM!=="xterm"&&p.env.TERM!=="xterm-256color";var f=u;switch(u){case"xterm":case"xterm-256color":if(l){break}if(a){u=f="xterm-truecolor"}if(p.env.VTE_VERSION){r=parseInt(p.env.VTE_VERSION,10);if(r>=3803){u=o||a?"gnome-256color":"gnome";l=true;break}}if(s==="darwin"){u="osx-256color";break}for(e in p.env){if(e.match(/KONSOLE/)){u=o||a?"konsole-256color":"konsole";l=true;break}}break;case"linux":case"aterm":case"kuake":case"tilda":case"terminology":case"wterm":case"mrxvt":break;case"gnome":case"gnome-256color":case"gnome-terminal":case"gnome-terminal-256color":case"terminator":case"guake":u=o||a?"gnome-256color":"gnome";break;case"konsole":u=o||a?"konsole-256color":"konsole";break;case"rxvt":case"rxvt-xpm":case"rxvt-unicode-256color":case"urxvt256c":case"urxvt256c-ml":case"rxvt-unicode":case"urxvt":case"urxvt-ml":if(p.env.TERM==="rxvt"){u="rxvt-256color"}else{u=o||a?"rxvt-256color":"rxvt"}break;case"xfce":case"xfce-terminal":case"xfce4-terminal":u="xfce";break;case"eterm":case"Eterm":u=o||a?"eterm-256color":"eterm";break;case"atomic-terminal":u="atomic-terminal";break;case"xterm-kitty":case"kitty":u="kitty";break;case"iTerm":case"iterm":case"iTerm2":case"iterm2":case"Terminal":case"terminal":case"Apple_Terminal":u="osx-256color";break;default:if(!u){f="unknown"}else{f=u=f.toLowerCase()}break}return{isTTY:n,isSSH:i,appId:u,safe:l,generic:l?u:f}};function d(t){var n,s;return new e((r,i)=>{o("ps -h -o ppid -p "+t,(t,e)=>{if(t){i(t);return}n=parseInt(e.match(/[0-9]+/gm)[0],10);if(!n){i(new Error("Couldn't get parent PID"));return}o("ps -h -o comm -p "+n,(t,e)=>{if(t){i(t);return}s=e.trim();r({pid:n,appName:s})})})})}r.getParentTerminalInfo=async function(e){var t,r,i,n=[],s,o=p.pid;if(p.env.SSH_CONNECTION){r=new Error("SSH connection detected, .getParentTerminalInfo() is useless in this context.");if(e){e(r);return}throw r}var a=c.platform();var u=p.env.TERM&&p.env.TERM.match(/256/)||p.env.COLORTERM&&p.env.COLORTERM.match(/256/);var l=p.env.COLORTERM&&p.env.COLORTERM.match(/^(truecolor|24bits?)$/);try{t=true;while(t){({appName:i,pid:o}=await d(o));if(a==="darwin"){i=h.parse(i).name}n.push(i);t=false;switch(i){case"linux":case"xterm":case"konsole":case"gnome-terminal":case"aterm":case"guake":case"kuake":case"tilda":case"terminology":case"wterm":case"mrxvt":s=u||l?i+"-256color":i;break;case"atomic-terminal":s=i;break;case"login":i="linux";s=i;break;case"terminator":s=u||l?"gnome-256color":"gnome";break;case"rxvt":case"urxvt256c":case"urxvt256c-ml":s="rxvt-256color";break;case"urxvt":case"urxvt-ml":s="rxvt";break;case"xfce4-terminal":s="xfce";break;case"gnome-terminal-":i="gnome-terminal";s=u||l?"gnome-256color":"gnome";break;case"Eterm":case"eterm":i="Eterm";s=u||l?"eterm-256color":"eterm";break;case"kitty":i=s="kitty";break;case"iTerm":case"iTerm2":case"Terminal":s="osx-256color";break;default:if(i.match(/gnome-terminal/)){i="gnome-terminal";s=u||l?"gnome-256color":"gnome";break}if(!o||o===1){throw new Error("Terminal not found, app names: "+n.join(", "))}t=true}}}catch(t){if(e){e(t);return}throw t}var f={appId:s,appName:i,pid:o,safe:true};if(e){e(undefined,f);return}return f};r.getDetectedTerminal=async function(t){var e,r,i=n.guessTerminal();if(i.safe||i.isSSH){e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:i.safe?i.appId:undefined,isTTY:i.isTTY,isSSH:i.isSSH,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch});if(t){t(undefined,e)}return e}try{r=await n.getParentTerminalInfo();e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:r.appId,appName:r.appName,isTTY:i.isTTY,isSSH:i.isSSH,pid:r.pid,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch})}catch(t){e=n.createTerminal({stdin:p.stdin,stdout:p.stdout,stderr:p.stderr,generic:p.env.TERM&&p.env.TERM.toLowerCase()||"unknown",appId:i.safe?i.appId:undefined,isTTY:i.isTTY,isSSH:i.isSSH,processSigwinch:true,preferProcessSigwinch:!!n.globalConfig.preferProcessSigwinch})}if(t){t(undefined,e)}return e}}).call(this)}).call(this,t("_process"))},{"./termkit.js":50,_process:179,child_process:136,os:166,path:178,seventh:108}],13:[function(t,e,r){"use strict";const i=t("./Text.js");const n=t("../spChars.js");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;t.attr=t.attr||{};if(Array.isArray(t.animation)){this.animation=t.animation}else if(typeof t.animation==="string"){this.animation=n.animation[t.animation]||n.animation.lineSpinner;if(t.contentHasMarkup!==false){t.contentHasMarkup=true}}else{this.animation=n.animation.lineSpinner}this.animation=this.animation.map(t=>Array.isArray(t)?t:[t]);this.isAnimated=false;this.frameDuration=t.frameDuration||150;this.animationSpeed=t.animationSpeed||1;this.frame=t.frame||0;this.autoUpdateTimer=null;this.autoUpdate=this.autoUpdate.bind(this);t.content=this.animation[this.frame];i.call(this,t);if(this.elementType==="AnimatedText"&&!t.noDraw){this.draw();this.animate()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="AnimatedText";s.prototype.inlineCursorRestoreAfterDraw=true;s.prototype.animate=function(t=1){this.isAnimated=!!t;this.animationSpeed=+t||0;if(!this.isAnimated){if(this.autoUpdateTimer){clearTimeout(this.autoUpdateTimer)}this.autoUpdateTimer=null;return}if(!this.autoUpdateTimer){this.autoUpdateTimer=setTimeout(()=>this.autoUpdate(),this.frameDuration/this.animationSpeed)}};s.prototype.autoUpdate=function(){this.frame=(this.frame+1)%this.animation.length;this.content=this.animation[this.frame];this.draw();this.autoUpdateTimer=setTimeout(()=>this.autoUpdate(),this.frameDuration/this.animationSpeed)}},{"../spChars.js":48,"./Text.js":32}],14:[function(t,e,r){"use strict";const d=t("./Element.js");const i=t("../spChars.js").bar;function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;d.call(this,t);this.minValue=+t.minValue||0;this.maxValue=t.maxValue!==undefined?+t.maxValue||0:1;this.value=+t.value||0;if(this.value<this.minValue){this.value=this.minValue}else if(this.value>this.maxValue){this.value=this.maxValue}this.borderAttr=t.borderAttr||{bold:true};this.bodyAttr=t.bodyAttr||{color:"blue"};this.barChars=i.classic;if(typeof t.barChars==="object"){this.barChars=t.barChars}else if(typeof t.barChars==="string"&&i[t.barChars]){this.barChars=i[t.barChars]}this.overTextFullAttr=t.overTextFullAttr||{bgColor:"blue"};this.overTextEmptyAttr=t.overTextEmptyAttr||{bgColor:"default"};if(this.elementType==="Bar"&&!t.noDraw){this.draw()}}e.exports=n;n.prototype=Object.create(d.prototype);n.prototype.constructor=n;n.prototype.elementType="Bar";n.prototype.preDrawSelf=function(){var t,e,r,i,n,s,o=0,a,u=0,l=false,f=null,h=this.outputWidth-2,c=(this.value-this.minValue)/(this.maxValue-this.minValue);if(!c||c<0){c=0}else if(c>1){c=1}r=Math.floor(c*h);n=c*h-r;if(this.content){if(n<.5){s=d.truncateContent(this.content,r,this.contentHasMarkup);o=d.getLastTruncateWidth();if(o<this.contentWidth){l=true}}else{s=d.truncateContent(this.content,r+1,this.contentHasMarkup);o=d.getLastTruncateWidth();if(o<this.contentWidth||o===r+1){l=true;r++}}}if(!l&&r<h){if(this.barChars.body.length<=2){if(n>=.5){r++}}else if(this.barChars.body.length===3){f=this.barChars.body[1]}else if(this.barChars.body.length===4){f=this.barChars.body[n<.5?1:2]}else{t=Math.floor(1.5+n*(this.barChars.body.length-3));f=this.barChars.body[t]}}i=h-r-(f?1:0);if(this.content&&o<this.contentWidth){a=d.truncateContent(this.content.slice(s.length),i,this.contentHasMarkup);u=d.getLastTruncateWidth()}e=this.outputX;this.outputDst.put({x:e++,y:this.outputY,attr:this.borderAttr,markup:true},this.barChars.border[0]);if(o){this.outputDst.put({x:e,y:this.outputY,attr:this.overTextFullAttr,markup:true},s);e+=o}if(r-o>0){this.outputDst.put({x:e,y:this.outputY,attr:this.bodyAttr,markup:true},this.barChars.body[0].repeat(r-o));e+=r-o}if(f){this.outputDst.put({x:e++,y:this.outputY,attr:this.bodyAttr,markup:true},f)}if(u){this.outputDst.put({x:e,y:this.outputY,attr:this.overTextEmptyAttr,markup:true},a);e+=u}if(i-u>0){this.outputDst.put({x:e,y:this.outputY,attr:this.bodyAttr,markup:true},this.barChars.body[this.barChars.body.length-1].repeat(i-u));e+=i-u}this.outputDst.put({x:e,y:this.outputY,attr:this.borderAttr,markup:true},this.barChars.border[1])};n.prototype.getValue=function(){return this.value};n.prototype.setValue=function(t,e){this.value=+t||0;if(this.value<this.minValue){this.value=this.minValue}else if(this.value>this.maxValue){this.value=this.maxValue}if(!e){this.draw()}}},{"../spChars.js":48,"./Element.js":23}],15:[function(s,o,t){(function(n){(function(){"use strict";const e=s("tree-kit");const r=s("./Element.js");const t=s("./Button.js");function i(t={}){r.call(this,t);this.backgroundAttr=t.backgroundAttr||{bgColor:"white",color:"black"};this.contentEllipsis=t.contentEllipsis||"…";this.previousPageContent=t.previousPageContent||"«";this.previousPageContentHasMarkup=!!t.previousPageContentHasMarkup;this.nextPageContent=t.nextPageContent||"»";this.nextPageContentHasMarkup=!!t.nextPageContentHasMarkup;this.itemsDef=t.items||[];this.previousPageDef=t.previousPage;this.nextPageDef=t.nextPage;this.masterDef=t.master;this.separatorDef=t.separator;this.buttons=[];this.focusChild=null;this.page=0;this.maxPage=0;this.hasSubmenu=!!t.submenu;this.isSubmenu=!!t.isSubmenu;this.submenu=null;this.submenuParentButton=null;this.submenuOptions=null;if(this.hasSubmenu){this.submenuOptions=e.extend(null,{},t,{internal:true,parent:null,items:null});if(t.submenu&&typeof t.submenu==="object"){Object.assign(this.submenuOptions,t.submenu)}}this.onButtonSubmit=this.onButtonSubmit.bind(this);this.onButtonToggle=this.onButtonToggle.bind(this);this.onButtonFocus=this.onButtonFocus.bind(this);this.onButtonBlinked=this.onButtonBlinked.bind(this);this.onSubmenuSubmit=this.onSubmenuSubmit.bind(this);this.onKey=this.onKey.bind(this);this.onWheel=this.onWheel.bind(this);this.onFocus=this.onFocus.bind(this);this.buttonBlurAttr=t.buttonBlurAttr||this.defaultOptions.buttonBlurAttr||{bgColor:"black",color:"white",bold:true};this.buttonEvenBlurAttr=t.buttonEvenBlurAttr||null;this.buttonFocusAttr=t.buttonFocusAttr||this.defaultOptions.buttonFocusAttr||{bgColor:"white",color:"black",bold:true};this.buttonDisabledAttr=t.buttonDisabledAttr||this.defaultOptions.buttonDisabledAttr||{bgColor:"black",color:"brightBlack",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||this.defaultOptions.buttonSubmittedAttr||{bgColor:"brightBlack",color:"brightWhite",bold:true};this.turnedOnBlurAttr=t.turnedOnBlurAttr||this.defaultOptions.turnedOnBlurAttr||{bgColor:"cyan"};this.turnedOnFocusAttr=t.turnedOnFocusAttr||this.defaultOptions.turnedOnFocusAttr||{bgColor:"brightCyan",bold:true};this.turnedOffBlurAttr=t.turnedOffBlurAttr||this.defaultOptions.turnedOffBlurAttr||{bgColor:"gray",dim:true};this.turnedOffFocusAttr=t.turnedOffFocusAttr||this.defaultOptions.turnedOffFocusAttr||{bgColor:"white",color:"black",bold:true};this.blurLeftPadding=t.blurLeftPadding||t.leftPadding||"";this.blurRightPadding=t.blurRightPadding||t.rightPadding||"";this.focusLeftPadding=t.focusLeftPadding||t.leftPadding||"";this.focusRightPadding=t.focusRightPadding||t.rightPadding||"";this.disabledLeftPadding=t.disabledLeftPadding||t.leftPadding||"";this.disabledRightPadding=t.disabledRightPadding||t.rightPadding||"";this.submittedLeftPadding=t.submittedLeftPadding||t.leftPadding||"";this.submittedRightPadding=t.submittedRightPadding||t.rightPadding||"";this.turnedOnFocusLeftPadding=t.turnedOnFocusLeftPadding||t.turnedOnLeftPadding||t.leftPadding||"";this.turnedOnFocusRightPadding=t.turnedOnFocusRightPadding||t.turnedOnRightPadding||t.rightPadding||"";this.turnedOffFocusLeftPadding=t.turnedOffFocusLeftPadding||t.turnedOffLeftPadding||t.leftPadding||"";this.turnedOffFocusRightPadding=t.turnedOffFocusRightPadding||t.turnedOffRightPadding||t.rightPadding||"";this.turnedOnBlurLeftPadding=t.turnedOnBlurLeftPadding||t.turnedOnLeftPadding||t.leftPadding||"";this.turnedOnBlurRightPadding=t.turnedOnBlurRightPadding||t.turnedOnRightPadding||t.rightPadding||"";this.turnedOffBlurLeftPadding=t.turnedOffBlurLeftPadding||t.turnedOffLeftPadding||t.leftPadding||"";this.turnedOffBlurRightPadding=t.turnedOffBlurRightPadding||t.turnedOffRightPadding||t.rightPadding||"";this.paddingHasMarkup=!!t.paddingHasMarkup;if(t.keyBindings){this.keyBindings=t.keyBindings}if(t.buttonKeyBindings){this.buttonKeyBindings=t.buttonKeyBindings}if(t.buttonActionKeyBindings){this.buttonActionKeyBindings=t.buttonActionKeyBindings}if(t.toggleButtonKeyBindings){this.toggleButtonKeyBindings=t.toggleButtonKeyBindings}if(t.toggleButtonActionKeyBindings){this.toggleButtonActionKeyBindings=t.toggleButtonActionKeyBindings}this.on("key",this.onKey);this.on("wheel",this.onWheel);this.on("focus",this.onFocus)}o.exports=i;i.prototype=Object.create(r.prototype);i.prototype.constructor=i;i.prototype.elementType="BaseMenu";i.prototype.needInput=true;i.prototype.destroy=function(t,e=false){if(this.destroyed){return}if(this.submenu){this.submenu.destroy(true)}this.off("key",this.onKey);this.off("wheel",this.onWheel);this.off("focus",this.onFocus);r.prototype.destroy.call(this,t,e)};i.prototype.previousPage=function(t){var e;if(this.maxPage&&this.page>0){this.page--;this.initPage();this.focusChild=this.children[this.children.length-2];e=this.document.giveFocusTo_(this.focusChild,t);if(!e){this.document.focusPrevious()}this.updateDraw()}};i.prototype.nextPage=function(t){var e;if(this.maxPage&&this.page<this.maxPage){this.page++;this.initPage();this.focusChild=this.children[1];e=this.document.giveFocusTo_(this.focusChild,t);if(!e){this.document.focusNext()}this.updateDraw()}};i.prototype.toPage=function(t,e){var r;if(this.maxPage&&t!==this.page){this.page=t;this.initPage();this.focusChild=this.children[1];r=this.document.giveFocusTo_(this.focusChild,e);if(!r){this.document.focusNext()}this.updateDraw()}};i.prototype.focusValue=function(e,t,r=false){var i,n,s;n=this.itemsDef.find(t=>!t.disabled&&t.value===e);if(!n){return}if(this.page!==n.page||r){this.page=n.page;this.initPage()}s=this.buttons.find(t=>t.def===n);if(!s){return}this.focusChild=s;i=this.document.giveFocusTo_(this.focusChild,t);if(!i){this.document.focusNext()}this.draw()};i.prototype.setItem=function(e,t){var r,i;r=this.itemsDef.find(t=>t.value===e);if(!r){return false}Object.assign(r,t);i=this.focusChild&&this.focusChild.value;this.initChildren(true);if(i!==undefined){this.focusValue(i,"refocus",true)}else{this.initPage();this.draw()}return true};i.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"previous":this.focusChild=this.focusPreviousChild(!this.maxPage);if(this.focusChild===this.children[0]&&this.maxPage&&this.page>0){this.previousPage("backCycle")}break;case"next":this.focusChild=this.focusNextChild(!this.maxPage);if(this.focusChild===this.children[this.children.length-1]&&this.maxPage&&this.page<this.maxPage){this.nextPage("cycle")}break;case"previousPage":if(this.maxPage&&this.page>0){this.previousPage("backCycle")}break;case"nextPage":if(this.maxPage&&this.page<this.maxPage){this.nextPage("cycle")}break;case"firstPage":if(this.maxPage&&this.page!==0){this.toPage(0,"backCycle")}break;case"lastPage":if(this.maxPage&&this.page!==this.maxPage){this.toPage(this.maxPage,"cycle")}break;case"parentMenu":if(this.isSubmenu){let t=this.parent;if(this.parent.submenuOptions.hideParent){this.parent.closeSubmenu()}t.document.giveFocusTo(t)}break;case"submenu":if(this.hasSubmenu&&this.focusChild?.def?.items){this.openSubmenu(this.focusChild.value,this.focusChild);if(this.submenu){this.document.giveFocusTo(this.submenu)}}break;default:return}return true};i.prototype.onWheel=function(t){if(t.yDirection<0){this.previousPage("backCycle")}else if(t.yDirection>0){this.nextPage("cycle")}};i.prototype.onFocus=function(t,e){if(e==="cycle"||e==="backCycle"){return}if(t){n.nextTick(()=>{if(this.focusChild&&!this.focusChild.destroyed){this.document.giveFocusTo(this.focusChild,"delegate")}else{this.focusChild=this.focusNextChild()}})}};i.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;default:if(this.hasSubmenu&&r.def.items){if(this.submenuOptions.openOn==="parentSubmit"){this.openSubmenu(r.value,r)}if(this.submenu){this.document.giveFocusTo(this.submenu)}}else{this.emit("submit",t,e,this)}}};i.prototype.onButtonBlinked=function(t,e,r){switch(r.internalRole){case"previousPage":case"nextPage":break;default:if(this.hasSubmenu&&r.def.items){if(this.submenuOptions.openOn==="parentBlinked"){this.openSubmenu(r.value,r)}}else{this.emit("blinked",t,e,this)}}};i.prototype.onButtonFocus=function(t,e,r){switch(r.internalRole){case"previousPage":case"nextPage":break;default:if(t&&this.hasSubmenu&&r.def.items&&this.submenuOptions.openOn==="parentFocus"){this.openSubmenu(r.value,r)}this.emit("itemFocus",r.value,t,r)}};i.prototype.onSubmenuSubmit=function(t,e,r){r.once("blinked",(t,e,r)=>{if(this.submenuOptions.closeOn==="childSubmit"){this.closeSubmenu();this.document.giveFocusTo(this.submenuParentButton||this)}this.emit("blinked",t,e,this)});this.emit("submit",t,e,this)};i.prototype.openSubmenu=function(e,r=null){var t,i,n,s,o=r?this.itemsDef.find(t=>t===r.def):this.itemsDef.find(t=>t.value===e);if(!o||!o.items||!o.items.length){return}if(this.submenu){if(this.submenu.def===o){return}this.closeSubmenu()}this.submenuParentButton=r;switch(this.submenuOptions.disposition){case"overwrite":t=this.outputX;i=this.outputY;n=this.submenuOptions.width;s=this.submenuOptions.height;break;case"right":default:t=this.outputX+this.outputWidth;i=this.outputY;n=this.submenuOptions.width||this.outputWidth;break}if(this.submenuOptions.hideParent){this.children.forEach(t=>t.hidden=true)}this.submenu=new this.constructor(Object.assign({},this.submenuOptions,{internal:true,parent:this,isSubmenu:true,def:o,outputX:t,outputY:i,outputWidth:n,outputHeight:s,items:o.items,noDraw:true}));this.redraw();if(this.submenuOptions.focusOnOpen){this.document.giveFocusTo(this.submenu)}this.submenu.on("submit",this.onSubmenuSubmit);this.submenu.on("itemFocus",(...t)=>this.emit("itemFocus",...t))};i.prototype.closeSubmenu=function(){if(!this.submenu){return false}if(this.submenuOptions.hideParent){this.children.forEach(t=>t.hidden=false)}this.submenu.destroy();this.submenu=null;return true};i.prototype.defaultOptions={};i.prototype.keyBindings={};i.prototype.buttonKeyBindings={};i.prototype.buttonActionKeyBindings={};i.prototype.toggleButtonKeyBindings={};i.prototype.toggleButtonActionKeyBindings={};i.prototype.initPage=function(){};i.prototype.onButtonToggle=function(){};i.prototype.childUseParentKeyValue=false}).call(this)}).call(this,s("_process"))},{"./Button.js":16,"./Element.js":23,_process:179,"tree-kit":134}],16:[function(t,e,r){"use strict";const n=t("./Element.js");const i=t("./Text.js");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!Array.isArray(t.content)){t.content=[t.content||""]}this.blurContent=t.blurContent?Array.isArray(t.blurContent)?t.blurContent:[t.blurContent]:t.content;this.focusContent=t.focusContent?Array.isArray(t.focusContent)?t.focusContent:[t.focusContent]:t.content;this.disabledContent=t.disabledContent?Array.isArray(t.disabledContent)?t.disabledContent:[t.disabledContent]:t.content;this.submittedContent=t.submittedContent?Array.isArray(t.submittedContent)?t.submittedContent:[t.submittedContent]:t.content;this.turnedOnBlurContent=t.turnedOnBlurContent?Array.isArray(t.turnedOnBlurContent)?t.turnedOnBlurContent:[t.turnedOnBlurContent]:t.turnedOnContent?Array.isArray(t.turnedOnContent)?t.turnedOnContent:[t.turnedOnContent]:t.content;this.turnedOffBlurContent=t.turnedOffBlurContent?Array.isArray(t.turnedOffBlurContent)?t.turnedOffBlurContent:[t.turnedOffBlurContent]:t.turnedOffContent?Array.isArray(t.turnedOffContent)?t.turnedOffContent:[t.turnedOffContent]:t.content;this.turnedOnFocusContent=t.turnedOnFocusContent?Array.isArray(t.turnedOnFocusContent)?t.turnedOnFocusContent:[t.turnedOnFocusContent]:t.turnedOnContent?Array.isArray(t.turnedOnContent)?t.turnedOnContent:[t.turnedOnContent]:t.content;this.turnedOffFocusContent=t.turnedOffFocusContent?Array.isArray(t.turnedOffFocusContent)?t.turnedOffFocusContent:[t.turnedOffFocusContent]:t.turnedOffContent?Array.isArray(t.turnedOffContent)?t.turnedOffContent:[t.turnedOffContent]:t.content;this.blurLeftPadding=t.blurLeftPadding||t.leftPadding||"";this.blurRightPadding=t.blurRightPadding||t.rightPadding||"";this.focusLeftPadding=t.focusLeftPadding||t.leftPadding||"";this.focusRightPadding=t.focusRightPadding||t.rightPadding||"";this.disabledLeftPadding=t.disabledLeftPadding||t.leftPadding||"";this.disabledRightPadding=t.disabledRightPadding||t.rightPadding||"";this.submittedLeftPadding=t.submittedLeftPadding||t.leftPadding||"";this.submittedRightPadding=t.submittedRightPadding||t.rightPadding||"";this.turnedOnBlurLeftPadding=t.turnedOnBlurLeftPadding||t.turnedOnLeftPadding||t.leftPadding||"";this.turnedOnBlurRightPadding=t.turnedOnBlurRightPadding||t.turnedOnRightPadding||t.rightPadding||"";this.turnedOffBlurLeftPadding=t.turnedOffBlurLeftPadding||t.turnedOffLeftPadding||t.leftPadding||"";this.turnedOffBlurRightPadding=t.turnedOffBlurRightPadding||t.turnedOffRightPadding||t.rightPadding||"";this.turnedOnFocusLeftPadding=t.turnedOnFocusLeftPadding||t.turnedOnLeftPadding||t.leftPadding||"";this.turnedOnFocusRightPadding=t.turnedOnFocusRightPadding||t.turnedOnRightPadding||t.rightPadding||"";this.turnedOffFocusLeftPadding=t.turnedOffFocusLeftPadding||t.turnedOffLeftPadding||t.leftPadding||"";this.turnedOffFocusRightPadding=t.turnedOffFocusRightPadding||t.turnedOffRightPadding||t.rightPadding||"";this.paddingHasMarkup=!!t.paddingHasMarkup;this.internalRole=t.internalRole||null;delete t.width;delete t.height;i.call(this,t);if(this.setContent===s.prototype.setContent){this.setContent(t.content||"",t.contentHasMarkup,true,true)}this.blurAttr=t.blurAttr||{bgColor:"brightBlack"};this.focusAttr=t.focusAttr||{bgColor:"blue"};this.disabledAttr=t.disabledAttr||{bgColor:"black",color:"brightBlack"};this.submittedAttr=t.submittedAttr||{bgColor:"brightBlue"};this.turnedOnBlurAttr=t.turnedOnBlurAttr||{bgColor:"cyan"};this.turnedOnFocusAttr=t.turnedOnFocusAttr||{bgColor:"brightCyan",bold:true};this.turnedOffBlurAttr=t.turnedOffBlurAttr||{bgColor:"gray",dim:true};this.turnedOffFocusAttr=t.turnedOffFocusAttr||{bgColor:"white",color:"black",bold:true};this.disabled=!!t.disabled;this.submitted=!!t.submitted;this.submitOnce=!!t.submitOnce;this.attr=null;this.leftPadding=null;this.rightPadding=null;this.updateStatus();this.onKey=this.onKey.bind(this);this.onShortcut=this.onShortcut.bind(this);this.onFocus=this.onFocus.bind(this);this.onClick=this.onClick.bind(this);this.onRightClick=this.onRightClick.bind(this);this.onMiddleClick=this.onMiddleClick.bind(this);this.onHover=this.onHover.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}if(t.actionKeyBindings){this.actionKeyBindings=t.actionKeyBindings}this.on("key",this.onKey);this.on("shortcut",this.onShortcut);this.on("focus",this.onFocus);this.on("click",this.onClick);this.on("rightClick",this.onRightClick);this.on("middleClick",this.onMiddleClick);this.on("hover",this.onHover);if(this.elementType==="Button"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="Button";s.prototype.needInput=true;s.prototype.keyBindings={ENTER:"submit",KP_ENTER:"submit",ALT_ENTER:"submit"};s.prototype.actionKeyBindings={};s.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("shortcut",this.onShortcut);this.off("focus",this.onFocus);this.off("click",this.onClick);this.off("hover",this.onHover);n.prototype.destroy.call(this,t,e)};s.prototype.setContent=function(t,e,r=false,i=false){n.prototype.setContent.call(this,t,e,true,true);this.blurContent=this.focusContent=this.disabledContent=this.submittedContent=this.turnedOnBlurContent=this.turnedOffBlurContent=this.turnedOnFocusContent=this.turnedOffFocusContent=this.content;if(!i&&this.resizeOnContent){this.resizeOnContent()}if(!r){this.redraw()}};s.prototype.computeRequiredWidth=function(){return Math.max(n.computeContentWidth(this.blurLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.focusLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.disabledLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.submittedLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOnFocusLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOffFocusLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOnBlurLeftPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOffBlurLeftPadding,this.paddingHasMarkup))+Math.max(n.computeContentWidth(this.blurRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.focusRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.disabledRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.submittedRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOnFocusRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOffFocusRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOnBlurRightPadding,this.paddingHasMarkup),n.computeContentWidth(this.turnedOffBlurRightPadding,this.paddingHasMarkup))+Math.max(n.computeContentWidth(this.blurContent,this.contentHasMarkup),n.computeContentWidth(this.focusContent,this.contentHasMarkup),n.computeContentWidth(this.disabledContent,this.contentHasMarkup),n.computeContentWidth(this.submittedContent,this.contentHasMarkup),n.computeContentWidth(this.turnedOnFocusContent,this.contentHasMarkup),n.computeContentWidth(this.turnedOffFocusContent,this.contentHasMarkup),n.computeContentWidth(this.turnedOnBlurContent,this.contentHasMarkup),n.computeContentWidth(this.turnedOffBlurContent,this.contentHasMarkup))||1};s.prototype.drawSelfCursor=function(){this.outputDst.moveTo(this.outputX,this.outputY);this.outputDst.drawCursor()};s.prototype.blink=function(t=null,e=4){if(e){if(e%2){this.attr=this.focusAttr}else{this.attr=this.blurAttr}this.draw();setTimeout(()=>this.blink(t,e-1),80)}else{this.updateStatus();this.draw();this.emit("blinked",this.value,t,this)}};s.prototype.onFocus=function(t,e){this.hasFocus=t;this.updateStatus();this.draw()};s.prototype.updateStatus=function(){if(this.disabled){this.attr=this.disabledAttr;this.content=this.disabledContent;this.leftPadding=this.disabledLeftPadding;this.rightPadding=this.disabledRightPadding}else if(this.submitted){this.attr=this.submittedAttr;this.content=this.submittedContent;this.leftPadding=this.submittedLeftPadding;this.rightPadding=this.submittedRightPadding}else if(this.hasFocus){this.attr=this.focusAttr;this.content=this.focusContent;this.leftPadding=this.focusLeftPadding;this.rightPadding=this.focusRightPadding}else{this.attr=this.blurAttr;this.content=this.blurContent;this.leftPadding=this.blurLeftPadding;this.rightPadding=this.blurRightPadding}};s.prototype.submit=function(t){if(this.submitOnce){this.submitted=true}this.emit("submit",this.value,t,this);this.blink(t)};s.prototype.unsubmit=function(){this.submitted=false;this.updateStatus()};s.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"submit":if(this.disabled||this.submitted){break}this.submit(this.actionKeyBindings[t]);break;default:return}return true};s.prototype.onHover=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"hover")};s.prototype.onClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.click)};s.prototype.onRightClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.rightClick)};s.prototype.onMiddleClick=function(t){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit(this.actionKeyBindings.middleClick)};s.prototype.onShortcut=function(){if(this.disabled||this.submitted){return}this.document.giveFocusTo(this,"select");this.submit()}},{"./Element.js":23,"./Text.js":32}],17:[function(t,e,r){"use strict";const f=t("./Element.js");const i=t("./BaseMenu.js");const l=t("./Button.js");const h=t("./ToggleButton.js");function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;this.onParentResize=this.onParentResize.bind(this);if(!t.outputWidth&&!t.width){if(t.parent){t.outputWidth=Math.min(t.parent.inputWidth,t.parent.outputWidth)}else if(t.inlineTerm){t.outputWidth=t.inlineTerm.width}}this.buttonsMaxWidth=0;this.buttonPaddingWidth=0;this.buttonSymbolWidth=0;this.pageHeight=0;this.pageItemsDef=null;if(!t.multiLineItems){t.height=t.items&&t.items.length}i.call(this,t);this.maxHeight=this.autoHeight&&this.outputDst?Math.round(this.outputDst.height*this.autoHeight):t.maxHeight?t.maxHeight:t.pageMaxHeight?t.pageMaxHeight:this.strictInline?this.inlineTerm.height:Infinity;this.on("parentResize",this.onParentResize);this.multiLineItems=!!t.multiLineItems;this.initChildren();if(this.elementType==="ColumnMenu"&&!t.noDraw){this.draw()}}e.exports=n;n.prototype=Object.create(i.prototype);n.prototype.constructor=n;n.prototype.elementType="ColumnMenu";n.prototype.inlineNewLine=true;n.prototype.ButtonClass=l;n.prototype.defaultOptions={buttonBlurAttr:{bgColor:"black",color:"white",bold:true},buttonEvenBlurAttr:null,buttonFocusAttr:{bgColor:"white",color:"black",bold:true},buttonDisabledAttr:{bgColor:"black",color:"gray",bold:true},buttonSubmittedAttr:{bgColor:"gray",color:"brightWhite",bold:true},turnedOnBlurAttr:{bgColor:"cyan"},turnedOnFocusAttr:{bgColor:"brightCyan",bold:true},turnedOffBlurAttr:{bgColor:"gray",dim:true},turnedOffFocusAttr:{bgColor:"white",color:"black",bold:true}};n.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("focus",this.onFocus);this.off("parentResize",this.onParentResize);f.prototype.destroy.call(this,t,e)};n.prototype.keyBindings={UP:"previous",DOWN:"next",PAGE_UP:"previousPage",PAGE_DOWN:"nextPage",HOME:"firstPage",END:"lastPage",ALT_ENTER:"submit",ESCAPE:"parentMenu",LEFT:"parentMenu",RIGHT:"submenu"};n.prototype.buttonKeyBindings={ENTER:"submit",KP_ENTER:"submit"};n.prototype.toggleButtonKeyBindings={ENTER:"toggle",KP_ENTER:"toggle"};n.prototype.initChildren=function(t=false){this.pageItemsDef=[];this.buttonPaddingWidth=Math.max(f.computeContentWidth(this.blurLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.focusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.disabledLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.submittedLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnFocusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffFocusLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnBlurLeftPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffBlurLeftPadding,this.paddingHasMarkup))+Math.max(f.computeContentWidth(this.blurRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.focusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.disabledRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.submittedRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnFocusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffFocusRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOnBlurRightPadding,this.paddingHasMarkup),f.computeContentWidth(this.turnedOffBlurRightPadding,this.paddingHasMarkup));if(this.buttonPaddingWidth>this.outputWidth){return}var a=f.computeContentWidth(this.contentEllipsis,false);this.previousPageDef=Object.assign({content:"▲",internalRole:"previousPage"},this.previousPageDef);this.previousPageDef.contentHasMarkup=this.previousPageDef.contentHasMarkup||this.previousPageDef.markup;this.previousPageDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.previousPageDef.content,this.previousPageDef.contentHasMarkup);this.previousPageDef.buttonContent=this.previousPageDef.content;this.nextPageDef=Object.assign({content:"▼",internalRole:"nextPage"},this.nextPageDef);this.nextPageDef.contentHasMarkup=this.nextPageDef.contentHasMarkup||this.nextPageDef.markup;this.nextPageDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.nextPageDef.content,this.nextPageDef.contentHasMarkup);this.nextPageDef.buttonContent=this.nextPageDef.content;if(this.masterDef){this.masterDef=Object.assign({content:"column-menu",internalRole:"master"},this.masterDef);this.masterDef.contentHasMarkup=this.masterDef.contentHasMarkup||this.masterDef.markup;this.masterDef.buttonContent=this.masterDef.content;if(this.masterDef.symbol){this.buttonSymbolWidth=1+f.computeContentWidth(this.masterDef.symbol);this.masterDef.buttonContent+=" "+this.masterDef.symbol}this.masterDef.width=this.buttonPaddingWidth+f.computeContentWidth(this.masterDef.buttonContent,this.masterDef.contentHasMarkup)}this.buttonsMaxWidth=Math.max(this.buttonsMaxWidth,this.previousPageDef.width,this.nextPageDef.width,this.masterDef?this.masterDef.width:0);var u=0,l=0;this.itemsDef.forEach((t,e)=>{t.contentHasMarkup=t.contentHasMarkup||t.markup;t.buttonContent=t.content;t.buttonBlurContent=t.blurContent;t.buttonFocusContent=t.focusContent;t.buttonDisabledContent=t.disabledContent;t.buttonSubmittedContent=t.submittedContent;t.buttonTurnedOnBlurContent=t.turnedOnBlurContent;t.buttonTurnedOffBlurContent=t.turnedOffBlurContent;t.buttonTurnedOnFocusContent=t.turnedOnFocusContent;t.buttonTurnedOffFocusContent=t.turnedOffFocusContent;var r=f.computeContentWidth(t.content,t.contentHasMarkup),i=1,n=e===this.itemsDef.length-1,s=Math.max(1,!n?this.maxHeight-1:this.maxHeight),o=this.buttonPaddingWidth+r-this.outputWidth;if(o>0){if(this.multiLineItems){t.buttonContent=f.wordWrapContent(t.content,this.outputWidth-this.buttonPaddingWidth,t.contentHasMarkup);r=this.outputWidth-this.buttonPaddingWidth;i=t.buttonContent.length}else{t.buttonContent=f.truncateContent(t.content,r-o-a,t.contentHasMarkup)+this.contentEllipsis;r=f.computeContentWidth(t.buttonContent,t.contentHasMarkup)}}if(e&&l+i>s){u++;l=1;if(l+i>s&&i>1){i=s-l;t.buttonContent.length=i;t.buttonContent[i-1]=f.truncateContent(t.buttonContent[i-1].trimRight(),r-a,t.contentHasMarkup)+this.contentEllipsis}}l+=i;t.width=this.buttonPaddingWidth+r;t.page=u;if(t.width+this.buttonSymbolWidth>this.buttonsMaxWidth){this.buttonsMaxWidth=t.width+this.buttonSymbolWidth}if(!this.pageItemsDef[u]){this.pageItemsDef[u]=[]}this.pageItemsDef[u].push(t)});this.maxPage=u;if(this.separatorDef){this.separatorDef=Object.assign({content:"-",disabled:true,internalRole:"separator"},this.separatorDef);this.separatorDef.width=f.computeContentWidth(this.separatorDef.content,this.separatorDef.contentHasMarkup);if(this.separatorDef.contentRepeat&&this.separatorDef.width<this.buttonsMaxWidth-this.buttonPaddingWidth){this.separatorDef.content=this.separatorDef.content.repeat(Math.floor((this.buttonsMaxWidth-this.buttonPaddingWidth)/this.separatorDef.width));this.separatorDef.width=f.computeContentWidth(this.separatorDef.content,this.separatorDef.contentHasMarkup)}this.separatorDef.width+=this.buttonPaddingWidth;this.separatorDef.buttonContent=this.separatorDef.content}if(this.masterDef&&this.masterDef.width<this.buttonsMaxWidth){this.masterDef.buttonContent=this.masterDef.content+" "+" ".repeat(this.buttonsMaxWidth-this.masterDef.width)+this.masterDef.symbol;this.masterDef.width=this.buttonsMaxWidth}if(!this.pageItemsDef.length){this.pageItemsDef.push([])}this.pageItemsDef.forEach((t,e)=>{if(e){t.unshift(this.previousPageDef)}if(e<this.pageItemsDef.length-1){t.push(this.nextPageDef)}if(this.separatorDef){t.unshift(this.separatorDef)}if(this.masterDef){t.unshift(this.masterDef)}});if(this.outputWidth>this.buttonsMaxWidth){this.outputWidth=this.buttonsMaxWidth}if(this.elementType==="ColumnMenu"&&!t){this.initPage()}};n.prototype.initPage=function(t=this.page){var a=0,u=0;if(!this.pageItemsDef[t]){return}this.buttons.forEach(t=>t.destroy(false,true));this.buttons.length=0;this.pageItemsDef[t].forEach((t,e)=>{var r,i,n,s,o;if(!Array.isArray(t.buttonContent)){t.buttonContent=[t.buttonContent+" ".repeat(this.buttonsMaxWidth-t.width)]}r=t.internalRole?l:this.ButtonClass;i=r===h||r.prototype instanceof h;n=t.key;s=this.childUseParentKeyValue&&n&&this.value&&typeof this.value==="object"?this.value[n]:t.value;if(e%2){o=t.blurAttr||this.buttonBlurAttr}else{o=t.evenBlurAttr||t.blurAttr||this.buttonEvenBlurAttr||this.buttonBlurAttr}this.buttons[e]=new r({internal:true,parent:this,childId:e,internalRole:t.internalRole,contentHasMarkup:t.contentHasMarkup,content:t.buttonContent,blurContent:t.buttonBlurContent,focusContent:t.buttonFocusContent,disabledContent:t.buttonDisabledContent,submittedContent:t.buttonSubmittedContent,turnedOnBlurContent:t.buttonTurnedOnBlurContent,turnedOffBlurContent:t.buttonTurnedOffBlurContent,turnedOnFocusContent:t.buttonTurnedOnFocusContent,turnedOffFocusContent:t.buttonTurnedOffFocusContent,disabled:t.disabled,def:t,key:n,value:s,outputX:this.outputX+a,outputY:this.outputY+u,blurAttr:o,focusAttr:t.focusAttr||this.buttonFocusAttr,disabledAttr:t.disabledAttr||this.buttonDisabledAttr,submittedAttr:t.submittedAttr||this.buttonSubmittedAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.turnedOnFocusAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.turnedOffFocusAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.turnedOnBlurAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.turnedOffBlurAttr,blurLeftPadding:this.blurLeftPadding,blurRightPadding:this.blurRightPadding,focusLeftPadding:this.focusLeftPadding,focusRightPadding:this.focusRightPadding,disabledLeftPadding:this.disabledLeftPadding,disabledRightPadding:this.disabledRightPadding,submittedLeftPadding:this.submittedLeftPadding,submittedRightPadding:this.submittedRightPadding,turnedOnFocusLeftPadding:this.turnedOnFocusLeftPadding,turnedOnFocusRightPadding:this.turnedOnFocusRightPadding,turnedOffFocusLeftPadding:this.turnedOffFocusLeftPadding,turnedOffFocusRightPadding:this.turnedOffFocusRightPadding,turnedOnBlurLeftPadding:this.turnedOnBlurLeftPadding,turnedOnBlurRightPadding:this.turnedOnBlurRightPadding,turnedOffBlurLeftPadding:this.turnedOffBlurLeftPadding,turnedOffBlurRightPadding:this.turnedOffBlurRightPadding,paddingHasMarkup:this.paddingHasMarkup,keyBindings:i?this.toggleButtonKeyBindings:this.buttonKeyBindings,actionKeyBindings:i?this.toggleButtonActionKeyBindings:this.buttonActionKeyBindings,shortcuts:t.shortcuts,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);this.buttons[e].on("blinked",this.onButtonBlinked);this.buttons[e].on("focus",this.onButtonFocus);if(i){this.buttons[e].on("toggle",this.onButtonToggle)}u+=this.buttons[e].outputHeight});if(u<this.outputHeight){this.needRedraw=true}this.pageHeight=this.outputHeight=u};n.prototype.onParentResize=function(){if(!this.autoWidth&&!this.autoHeight){return}if(this.autoWidth){this.outputWidth=Math.round(this.outputDst.width*this.autoWidth)}if(this.autoHeight){this.maxHeight=Math.round(this.outputDst.height*this.autoHeight)}this.initChildren(true);this.page=0;this.initPage();this.draw()}},{"./BaseMenu.js":15,"./Button.js":16,"./Element.js":23,"./ToggleButton.js":35}],18:[function(t,e,r){"use strict";const i=t("./ColumnMenu.js");const n=t("./ToggleButton.js");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(t.value&&typeof t.value==="object"){this.setValue(t.value,true)}else{this.value={}}i.call(this,t);if(this.elementType==="ColumnMenuMulti"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="ColumnMenuMulti";s.prototype.ButtonClass=n;s.prototype.childUseParentKeyValue=true;s.prototype.initChildren=function(t=false){i.prototype.initChildren.call(this);if(this.elementType==="ColumnMenuMulti"&&!t){this.initPage()}};s.prototype.setValue=function(e,t){if(!e||typeof e!=="object"){return}if(Array.isArray(e)||e instanceof Set){this.value={};for(let t of e){if(t&&typeof t==="string"){this.value[t]=true}}}else{this.value=e}if(!this.buttons){return}this.buttons.forEach(t=>{if(t.internalRole||!t.key||!(t instanceof n)){return}t.setValue(this.value[t.key])});if(!t){this.draw()}};s.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"previous":this.focusChild=this.focusPreviousChild(!this.maxPage);if(this.focusChild===this.children[0]&&this.maxPage&&this.page>0){this.previousPage("backCycle")}break;case"next":this.focusChild=this.focusNextChild(!this.maxPage);if(this.focusChild===this.children[this.children.length-1]&&this.maxPage&&this.page<this.maxPage){this.nextPage("cycle")}break;case"previousPage":if(this.maxPage&&this.page>0){this.previousPage("backCycle")}break;case"nextPage":if(this.maxPage&&this.page<this.maxPage){this.nextPage("cycle")}break;case"firstPage":if(this.maxPage&&this.page!==0){this.toPage(0,"backCycle")}break;case"lastPage":if(this.maxPage&&this.page!==this.maxPage){this.toPage(this.maxPage,"cycle")}break;case"submit":this.emit("submit",this.value,undefined,this);break;default:return}return true};s.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;default:this.emit("submit",this.value,e,this)}};s.prototype.onButtonToggle=function(t,e,r){if(!r.key){return}if(t){this.value[r.key]=true}else{delete this.value[r.key]}this.emit("itemToggle",r.key,t,r)}},{"./ColumnMenu.js":17,"./ToggleButton.js":35}],19:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("../ScreenBuffer.js");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onKey=this.onKey.bind(this);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}this.palette=t.palette||this.document&&this.document.palette;this.object2attr=t=>n.object2attr(t,this.palette&&this.palette.colorNameToIndex);this.scrollable=!!t.scrollable;this.hasVScrollBar=this.scrollable&&!!t.vScrollBar;this.hasHScrollBar=this.scrollable&&!!t.hScrollBar;this.scrollX=t.scrollX||0;this.scrollY=t.scrollY||0;this.vScrollBarSlider=null;this.hScrollBarSlider=null;this.movable=!!t.movable;this.viewportX=this.outputX+this.containerBorderSize;this.viewportY=this.outputY+this.containerBorderSize;this.viewportWidth=this.outputWidth-this.containerBorderSize*2;this.viewportHeight=this.outputHeight-this.containerBorderSize*2;this.inputX=t.inputX||this.viewportX+this.scrollX;this.inputY=t.inputY||this.viewportY+this.scrollY;this.inputWidth=t.inputWidth||this.viewportWidth;this.inputHeight=t.inputHeight||this.viewportHeight;this.inputDst=new n({dst:this.outputDst,x:this.inputX,y:this.inputY,width:this.inputWidth,height:this.inputHeight,palette:this.palette});this.deltaDraw=false;this.backgroundAttr=t.backgroundAttr||{bgColor:"default"};this.on("key",this.onKey);this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.initChildren();if(this.elementType==="Container"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="Container";s.prototype.isContainer=true;s.prototype.containerBorderSize=0;const o=t("../termkit.js");s.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("click",this.onClick);this.off("drag",this.onDrag);this.off("wheel",this.onWheel);i.prototype.destroy.call(this,t,e)};s.prototype.keyBindings={UP:"tinyScrollUp",DOWN:"tinyScrollDown",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown"," ":"scrollDown",HOME:"scrollTop",END:"scrollBottom",LEFT:"scrollLeft",RIGHT:"scrollRight"};s.prototype.initChildren=function(){if(this.hasVScrollBar){this.vScrollBarSlider=new o.Slider({internal:true,parent:this,x:this.viewportWidth-1,y:0,height:this.viewportHeight,isVertical:true,valueToRate:t=>-t/Math.max(1,this.inputHeight-this.viewportHeight),rateToValue:t=>-t*Math.max(1,this.inputHeight-this.viewportHeight),noDraw:true});this.vScrollBarSlider.on("slideStep",t=>this.scroll(0,-t*Math.ceil(this.viewportHeight/2)));this.vScrollBarSlider.on("slide",t=>this.scrollTo(null,t))}if(this.hasHScrollBar){this.hScrollBarSlider=new o.Slider({internal:true,parent:this,x:0,y:this.inputWidth-this.containerBorderSize*2-1,width:this.viewportWidth-this.hasVScrollBar,valueToRate:t=>-t/Math.max(1,this.inputWidth-this.viewportWidth),rateToValue:t=>-t*Math.max(1,this.inputWidth-this.viewportWidth),noDraw:true});this.hScrollBarSlider.on("slideStep",t=>this.scroll(-t*Math.ceil(this.viewportWidth/2),0));this.hScrollBarSlider.on("slide",t=>this.scrollTo(t,null))}};s.prototype.resizeViewport=function(t){this.viewportWidth=t.width;this.viewportHeight=t.height};s.prototype.resizeInput=function(e){if(!e.x){e.x=0}if(!e.y){e.y=0}this.inputDst.resize(e);this.inputWidth=this.inputDst.width;this.inputHeight=this.inputDst.height;this.children.forEach(t=>t.emit("parentResize",e))};s.prototype.resize=function(e){if(!e.x){e.x=0}if(!e.y){e.y=0}this.inputDst.resize(e);this.viewportWidth=this.inputWidth=this.inputDst.width;this.viewportHeight=this.inputHeight=this.inputDst.height;this.children.forEach(t=>t.emit("parentResize",e))};s.prototype.move=function(t,e,r=false){return this.moveTo(this.outputX+t,this.outputY+e,r)};s.prototype.moveTo=function(t,e,r=false){this.outputX=t;this.outputY=e;this.viewportX=this.outputX+this.containerBorderSize;this.viewportY=this.outputY+this.containerBorderSize;this.inputDst.x=this.inputX=this.viewportX+this.scrollX;this.inputDst.y=this.inputY=this.viewportY+this.scrollY;if(!r){this.redraw()}};s.prototype.scroll=function(t,e,r=false){return this.scrollTo(t?this.scrollX+t:null,e?this.scrollY+e:null,r)};s.prototype.scrollToTop=function(t=false){return this.scrollTo(null,0,t)};s.prototype.scrollToBottom=function(t=false){return this.scrollTo(null,this.viewportHeight-this.inputHeight,t)};s.prototype.scrollTo=function(t,e,r=false){if(!this.scrollable){return}if(t!==undefined&&t!==null){this.scrollX=Math.min(0,Math.max(Math.round(t),this.viewportWidth-this.inputWidth+1));this.inputDst.x=this.inputX=this.viewportX+this.scrollX}if(e!==undefined&&e!==null){this.scrollY=Math.min(0,Math.max(Math.round(e),this.viewportHeight-this.inputHeight));this.inputDst.y=this.inputY=this.viewportY+this.scrollY}if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true);this.vScrollBarSlider.setSizeAndPosition({y:-this.scrollY})}if(this.hScrollBarSlider){this.hScrollBarSlider.setValue(this.scrollX,true)}if(!r){this.draw()}};s.prototype.preDrawSelf=function(){this.inputDst.fill({char:" ",attr:this.backgroundAttr})};s.prototype.postDrawSelf=function(){this.inputDst.draw({dst:this.outputDst,delta:this.deltaDraw,inline:this.strictInline,x:this.inputX,y:this.inputY,dstClipRect:{x:this.viewportX,y:this.viewportY,width:this.viewportWidth,height:this.viewportHeight}})};s.prototype.drawSelfCursor=function(t){if(t){this.restoreCursor()}else{this.inputDst.drawCursor()}};s.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"tinyScrollUp":this.scroll(0,Math.ceil(this.viewportHeight/5));break;case"tinyScrollDown":this.scroll(0,-Math.ceil(this.viewportHeight/5));break;case"scrollUp":this.scroll(0,Math.ceil(this.viewportHeight/2));break;case"scrollDown":this.scroll(0,-Math.ceil(this.viewportHeight/2));break;case"scrollLeft":this.scroll(Math.ceil(this.viewportWidth/2),0);break;case"scrollRight":this.scroll(-Math.ceil(this.viewportWidth/2),0);break;case"scrollTop":this.scrollToTop();break;case"scrollBottom":this.scrollToBottom();break;default:return}return true};s.prototype.onClick=function(t){if(this.scrollable&&!this.hasFocus){this.document.giveFocusTo(this,"select")}};s.prototype.onWheel=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(this.scrollable){this.scroll(0,-t.yDirection*Math.ceil(this.viewportHeight/5))}};s.prototype.onDrag=function(t){if(!this.movable||!t.dx&&!t.dy){return}this.move(t.dx,t.dy)}},{"../ScreenBuffer.js":3,"../termkit.js":50,"./Element.js":23}],20:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Container.js");const s=t("seventh");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.inlineTerm){t.outputX=1;t.outputY=1;t.outputWidth=t.outputDst.width;t.outputHeight=t.outputDst.height}this.strictInlineSupport=!!t.strictInline;this.noInput=!!t.noInput;n.call(this,t);this.parent=null;this.document=this;this.deltaDraw=!this.strictInline;this.id="_document"+"_"+a++;this.eventSource=t.eventSource;this.focusElement=null;this.hoverElement=null;this.clickOutCandidates=new Set;this.motionData={motion:false,xFrom:null,yFrom:null,x:null,y:null,dx:null,dy:null};this.draggingData={dragging:false,xFrom:null,yFrom:null,x:null,y:null,dx:null,dy:null,element:null,localDx:null,localDy:null};this.elements={};this.onEventSourceKey=this.onEventSourceKey.bind(this);this.onEventSourceMouse=this.onEventSourceMouse.bind(this);this.onEventSourceResize=this.onEventSourceResize.bind(this);if(!this.strictInline&&!this.noInput){this.eventSource.grabInput({mouse:"motion"})}this.elementByShortcut={};this.setClipboard=s.debounceUpdate(async(t,e)=>{if(!this.outputDst.setClipboard){return}await this.outputDst.setClipboard(t,e);await s.resolveTimeout(500)});this.getClipboard=s.debounceDelay(500,async t=>{if(!this.outputDst.getClipboard){return""}return this.outputDst.getClipboard(t)});this.eventSource.on("key",this.onEventSourceKey);this.eventSource.on("mouse",this.onEventSourceMouse);this.eventSource.on("resize",this.onEventSourceResize);if(this.elementType==="Document"&&!t.noDraw){this.draw()}}e.exports=o;o.prototype=Object.create(n.prototype);o.prototype.constructor=o;o.prototype.elementType="Document";o.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.eventSource.off("key",this.onEventSourceKey);this.eventSource.off("mouse",this.onEventSourceMouse);this.eventSource.off("resize",this.onEventSourceResize);i.prototype.destroy.call(this,t,e);this.eventSource=null;this.setClipboard=null;this.getClipboard=null};o.prototype.keyBindings=Object.assign({},n.prototype.keyBindings,{TAB:"focusNext",SHIFT_TAB:"focusPrevious"});var a=0;o.prototype.assignId=function(t,e){if(!e||typeof e!=="string"||e[0]==="_"||this.elements[e]){e="_"+t.elementType+"_"+a++}t.id=e;this.elements[e]=t};o.prototype.unassignId=function(t,e){t.id=null;delete this.elements[e]};o.prototype.giveFocusTo=function(t,e){if(!(t instanceof i)){throw new TypeError(""+t+" is not an instance of Element.")}if(!e){e="direct"}if(this.isAncestorOf(t)){return this.giveFocusTo_(t,e)}};o.prototype.giveFocusTo_=function(t,e){var r,i;if(this.focusElement!==t){if(this.focusElement){this.focusElement.emit("focus",false,e,this.focusElement)}this.focusElement=t;this.focusElement.emit("focus",true,e,this.focusElement)}i=!this.focusElement.disabled&&(this.focusElement.listenerCount("focus")||this.focusElement.listenerCount("key"));if(i){r=this.focusElement;while(r){if(r.listenerCount("clickOut")){this.clickOutCandidates.add(r)}r=r.parent}}return i};o.prototype.focusNext=function(){var t,e,r,i;if(!this.focusElement||!this.isAncestorOf(this.focusElement)){r=this}else{r=this.focusElement}if(r===this&&!this.children.length){return}e=r;for(;;){if(r.children.length&&!r.noChildFocus){r=r.children[0];if(!r.hidden){i=this.giveFocusTo_(r,"cycle")}}else if(r.parent){for(;;){t=r.parent.children.indexOf(r);if(t+1<r.parent.children.length){r=r.parent.children[t+1];if(!r.hidden){i=this.giveFocusTo_(r,"cycle");break}}else if(r.parent.parent){r=r.parent}else{if(e===r.parent){return}r=r.parent.children[0];if(!r.hidden){i=this.giveFocusTo_(r,"cycle");break}}}}else{return}if(e===r||!r.hidden&&i){break}}};o.prototype.focusPrevious=function(){var t,e,r,i;if(!this.focusElement||!this.isAncestorOf(this.focusElement)){r=this}else{r=this.focusElement}e=r;for(;;){if(r.parent){t=r.parent.children.indexOf(r);if(t-1>=0){r=r.parent.children[t-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else if(r.parent.parent){r=r.parent;if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else{if(e===r.parent){return}r=r.parent.children[r.parent.children.length-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}}else if(r.children.length){r=r.children[r.children.length-1];while(r.children.length&&!r.noChildFocus){r=r.children[r.children.length-1]}if(!r.hidden){i=this.giveFocusTo_(r,"backCycle")}}else{return}if(e===r||!r.hidden&&i){break}}};o.prototype.onEventSourceKey=function(t,e,r){if(this.focusElement){this.bubblingEvent(this.focusElement,t,e,r)}else{this.defaultKeyHandling(t,e,r)}};o.prototype.bubblingEvent=function(r,i,n,s){if(r!==this){r.emit("key",i,n,s,(t,e)=>{if(!t){if(r.parent){this.bubblingEvent(r.parent,i,n,s)}else{this.defaultKeyHandling(i,n,s)}}})}else{this.defaultKeyHandling(i,n,s)}};o.prototype.defaultKeyHandling=function(t,e,r){switch(this.keyBindings[t]){case"focusNext":this.focusNext();break;case"focusPrevious":this.focusPrevious();break;default:if(this.elementByShortcut[t]&&this.elementByShortcut[t].document===this){this.elementByShortcut[t].emit("shortcut",t,e,r)}else{this.emit("key",t,e,r)}break}};o.prototype.createShortcuts=function(e,...t){if(e.document!==this){return}t.forEach(t=>this.elementByShortcut[t]=e)};o.prototype.removeElementShortcuts=function(e){for(let t in this.elementByShortcut){if(this.elementByShortcut[t]===e){this.elementByShortcut[t]=null}}};o.prototype.onEventSourceMouse=function(t,e){var r;switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":this.mouseClick(e);break;case"MOUSE_MOTION":this.mouseMotion(e);break;case"MOUSE_DRAG":this.mouseDrag(e);break;case"MOUSE_RIGHT_BUTTON_PRESSED":this.mouseClick(e,"rightClick");break;case"MOUSE_MIDDLE_BUTTON_PRESSED":this.mouseClick(e,"middleClick");break;case"MOUSE_WHEEL_UP":e.yDirection=-1;this.mouseWheel(e);break;case"MOUSE_WHEEL_DOWN":e.yDirection=1;this.mouseWheel(e);break;case"MOUSE_LEFT_BUTTON_RELEASED":if(this.draggingData.dragging){this.mouseDragEnd(e)}break}};const u=t=>t.listenerCount("click")||t.listenerCount("clickOut")||t.listenerCount("rightClick")||t.listenerCount("middleClick")||t.listenerCount("dragStart")||t.listenerCount("drag")||t.listenerCount("dragEnd")||t.listenerCount("hover")||t.listenerCount("leave")||t.listenerCount("enter");o.prototype.mouseClick=function(t,e="click"){var r=this.childrenAt(t.x-this.outputX,t.y-this.outputY,u);if(!r.length){if(this.clickOutCandidates.size){for(let t of this.clickOutCandidates){if(t.document===this){t.emit("clickOut")}}this.clickOutCandidates.clear()}return}if(this.clickOutCandidates.size){for(let t of this.clickOutCandidates){if(t.document===this&&t!==r[0].element&&!t.isAncestorOf(r[0].element)){t.emit("clickOut")}}this.clickOutCandidates.clear()}r[0].element.emit(e,{x:r[0].x,y:r[0].y},r[0].element)};o.prototype.mouseMotionStart=function(t){var e;this.motionData.motion=true;this.motionData.xFrom=t.xFrom;this.motionData.yFrom=t.yFrom;this.motionData.x=t.xFrom;this.motionData.y=t.yFrom};o.prototype.mouseMotionEnd=function(){this.motionData.motion=false};o.prototype.mouseMotion=function(t,e=null){var r=false;if(!this.motionData.motion){r=true;this.mouseMotionStart(t)}this.motionData.dx=t.x-this.motionData.x;this.motionData.dy=t.y-this.motionData.y;this.motionData.x=t.x;this.motionData.y=t.y;if(!r&&!this.motionData.dx&&!this.motionData.dy){return}var i=this.childrenAt(t.x-this.outputX,t.y-this.outputY,u);if(!i.length){if(this.hoverElement){this.hoverElement.emit("leave");this.hoverElement=null}return}if(i[0]!==e){i[0].element.emit("hover",{x:i[0].x,y:i[0].y},i[0].element)}i.forEach(t=>{if(t.element.listenerCount("clickOut")){this.clickOutCandidates.add(t.element)}});if(i[0].element!==this.hoverElement){if(this.hoverElement){this.hoverElement.emit("leave")}this.hoverElement=i[0].element;this.hoverElement.emit("enter")}};o.prototype.mouseDragStart=function(t){var e;this.draggingData.dragging=true;this.draggingData.xFrom=t.xFrom;this.draggingData.yFrom=t.yFrom;this.draggingData.x=t.xFrom;this.draggingData.y=t.yFrom;e=this.childrenAt(t.xFrom-this.outputX,t.yFrom-this.outputY,u);if(!e.length){if(this.hoverElement){this.hoverElement.emit("leave");this.hoverElement=null}return}this.draggingData.element=e[0].element;this.draggingData.localDx=e[0].x-t.xFrom;this.draggingData.localDy=e[0].y-t.yFrom;e[0].element.emit("dragStart",{x:e[0].x,y:e[0].y},e[0].element)};o.prototype.mouseDragEnd=function(t){if(this.draggingData.element){this.draggingData.element.emit("dragEnd",{xFrom:this.draggingData.xFrom+this.draggingData.localDx,yFrom:this.draggingData.yFrom+this.draggingData.localDy,x:this.draggingData.x+this.draggingData.localDx,y:this.draggingData.y+this.draggingData.localDy},this.draggingData.element)}this.draggingData.dragging=false};o.prototype.mouseDrag=function(t){var e=false;if(!this.draggingData.dragging){e=true;this.mouseDragStart(t)}this.draggingData.dx=t.x-this.draggingData.x;this.draggingData.dy=t.y-this.draggingData.y;this.draggingData.x=t.x;this.draggingData.y=t.y;if(!e&&!this.draggingData.dx&&!this.draggingData.dy){return}if(this.draggingData.element){this.draggingData.element.emit("drag",{xFrom:this.draggingData.xFrom+this.draggingData.localDx,yFrom:this.draggingData.yFrom+this.draggingData.localDy,x:t.x+this.draggingData.localDx,y:t.y+this.draggingData.localDy,dx:this.draggingData.dx,dy:this.draggingData.dy},this.draggingData.element)}this.mouseMotion(t,this.draggingData.element)};o.prototype.mouseWheel=function(t){var e=this.childrenAt(t.x-this.outputX,t.y-this.outputY,t=>t.listenerCount("wheel"));if(!e.length){return}e[0].element.emit("wheel",{x:e[0].x,y:e[0].y,yDirection:t.yDirection},e[0].element)};o.prototype.onEventSourceResize=function(t,e){if(this.inlineTerm){return}this.resize({x:0,y:0,width:t,height:e});this.outputWidth=t;this.outputHeight=e;this.draw()}},{"./Container.js":19,"./Element.js":23,seventh:108}],21:[function(t,e,r){"use strict";const i=t("./RowMenu.js");const o=t("./ColumnMenu.js");function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;var e,r;i.call(this,t);this.initPage();this.columnMenu=null;this.columnButtonFocusAttr=t.buttonFocusAttr||{bgColor:"blue",color:"white",bold:true};this.columnButtonBlurAttr=t.buttonBlurAttr||{bgColor:"brightBlack",color:"white",bold:true};this.clearColumnMenuOnSubmit=!!t.clearColumnMenuOnSubmit;this.onClickOut=this.onClickOut.bind(this);this.onButtonFocus=this.onButtonFocus.bind(this);this.onButtonSubmit=this.onButtonSubmit.bind(this);this.onColumnMenuSubmit=this.onColumnMenuSubmit.bind(this);this.on("clickOut",this.onClickOut);for(e=0,r=this.buttons.length;e<r;e++){this.buttons[e].on("focus",this.onButtonFocus)}if(this.elementType==="DropDownMenu"&&!t.noDraw){this.draw()}}e.exports=n;n.prototype=Object.create(i.prototype);n.prototype.constructor=n;n.prototype.elementType="DropDownMenu";n.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("clickOut",this.onClickOut);i.prototype.destroy.call(this,t,e)};n.prototype.keyBindings={LEFT:"previous",RIGHT:"next",ESCAPE:"clearColumnMenu",UP:"clearColumnMenu",DOWN:"dropDown",ENTER:"submit",KP_ENTER:"submit",ALT_ENTER:"submit"};n.prototype.dropDown=function(t,e,r,i,n){var s=this.itemsDef[t].items;if(this.columnMenu){if(this.columnMenu.index===t){return}this.clearColumnMenu()}if(!s||!s.length){if(i&&this.itemsDef[t].topSubmit){this.emit("submit",i,n,this)}return}this.columnMenu=new o({internal:true,parent:this.children[t],x:e,y:r,width:this.outputWidth-e,leftPadding:" ",rightPadding:" ",items:s,buttonFocusAttr:this.columnButtonFocusAttr,buttonBlurAttr:this.columnButtonBlurAttr});this.columnMenu.on("submit",this.onColumnMenuSubmit)};n.prototype.clearColumnMenu=function(){if(!this.columnMenu){return false}this.columnMenu.destroy();this.columnMenu=null;return true};n.prototype.setDropDownItem=function(e,r,t){var i=this.itemsDef.find(t=>t.value===e);if(!i){return false}var n=i.items&&i.items.find(t=>t.value===r);if(!n){return false}this.clearColumnMenu();Object.assign(n,t);return true};n.prototype.onClickOut=function(t,e,r){this.clearColumnMenu()};n.prototype.onButtonSubmit=function(t,e,r){this.dropDown(r.childId,r.outputX,r.outputY+1,t,e)};n.prototype.onButtonFocus=function(t,e,r){if(t){this.dropDown(r.childId,r.outputX,r.outputY+1)}};n.prototype.onColumnMenuSubmit=function(t,e,r){r.once("blinked",(t,e,r)=>{if(this.clearColumnMenuOnSubmit){this.clearColumnMenu()}this.emit("blinked",t,e,this)});this.emit("submit",t,e,this)};n.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"previous":this.focusChild=this.focusPreviousChild();break;case"next":this.focusChild=this.focusNextChild();break;case"dropDown":if(this.columnMenu){this.columnMenu.focusNextChild()}break;case"clearColumnMenu":return this.clearColumnMenu();default:return}return true}},{"./ColumnMenu.js":17,"./RowMenu.js":28}],22:[function(t,e,r){"use strict";const i=t("./TextBox.js");const n=t("string-kit");function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(t.value){t.content=t.value}i.call(this,t);this.onKey=this.onKey.bind(this);this.onFocus=this.onFocus.bind(this);this.onMiddleClick=this.onMiddleClick.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}this.extraScrolling=t.extraScrolling!==undefined?!!t.extraScrolling:true;this.updateStatus();this.on("key",this.onKey);this.on("focus",this.onFocus);this.on("middleClick",this.onMiddleClick);if(this.elementType==="EditableTextBox"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="EditableTextBox";s.prototype.needInput=true;s.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("focus",this.onFocus);this.off("middleClick",this.onMiddleClick);i.prototype.destroy.call(this,t,e)};s.prototype.keyBindings={ENTER:"newLine",KP_ENTER:"newLine",BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",UP:"up",DOWN:"down",HOME:"startOfLine",END:"endOfLine",TAB:"tab",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown",CTRL_O:"copyClipboard",CTRL_P:"pasteClipboard"};s.prototype.drawSelfCursor=function(){this.textBuffer.drawCursor()};s.prototype.getValue=i.prototype.getContent;s.prototype.setValue=function(t,e){return i.prototype.setContent.call(t,false,e)};s.prototype.onKey=function(t,e,r){var i;if(r&&r.isCharacter){this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();this.autoScrollAndDraw()}else{switch(this.keyBindings[t]){case"newLine":this.textBuffer.newLine();this.textBuffer.runStateMachine();this.autoScrollAndDraw();break;case"backDelete":this.textBuffer.backDelete();this.textBuffer.runStateMachine();this.autoScrollAndDraw();break;case"delete":this.textBuffer.delete();this.textBuffer.runStateMachine();this.autoScrollAndDraw();break;case"backward":this.textBuffer.moveBackward();this.autoScrollAndDrawCursor();break;case"forward":this.textBuffer.moveForward();this.autoScrollAndDrawCursor();break;case"startOfWord":this.textBuffer.moveToStartOfWord();this.autoScrollAndDrawCursor();break;case"endOfWord":this.textBuffer.moveToEndOfWord();this.autoScrollAndDrawCursor();break;case"startOfLine":this.textBuffer.moveToColumn(0);this.autoScrollAndDrawCursor();break;case"endOfLine":this.textBuffer.moveToEndOfLine();this.autoScrollAndDrawCursor();break;case"down":this.textBuffer.moveDown();this.autoScrollAndDrawCursor();break;case"up":this.textBuffer.moveUp();this.autoScrollAndDrawCursor();break;case"left":this.textBuffer.moveLeft();this.autoScrollAndDrawCursor();break;case"right":this.textBuffer.moveRight();this.autoScrollAndDrawCursor();break;case"tab":this.textBuffer.insert("\t",this.textAttr);this.textBuffer.runStateMachine();this.autoScrollAndDraw();break;case"scrollUp":i=Math.ceil(this.outputHeight/2);this.textBuffer.move(0,-i);this.scroll(0,i);break;case"scrollDown":i=-Math.ceil(this.outputHeight/2);this.textBuffer.move(0,-i);this.scroll(0,i);break;case"pasteClipboard":if(this.document){this.document.getClipboard().then(t=>{if(t){this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();this.autoScrollAndDraw()}}).catch(()=>undefined)}break;case"copyClipboard":if(this.document){this.document.setClipboard(this.textBuffer.getSelectionText()).catch(()=>undefined)}break;default:return}}return true};s.prototype.onFocus=function(t,e){this.hasFocus=t;this.updateStatus();this.draw()};s.prototype.onClick=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}else{this.textBuffer.moveTo(t.x-this.scrollX,t.y-this.scrollY);this.drawCursor()}};s.prototype.onMiddleClick=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(this.document){this.document.getClipboard("primary").then(t=>{if(t){this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();this.autoScrollAndDraw()}}).catch(()=>undefined)}};s.prototype.updateStatus=function(){}},{"./TextBox.js":33,"string-kit":123}],23:[function(t,e,r){"use strict";const n=t("../misc.js");const s=t("string-kit");const i=t("nextgen-events");function o(t={}){this.setInterruptible(true);this.parent=t.parent&&t.parent.elementType?t.parent:null;this.document=null;this.destroyed=false;this.inlineTerm=t.inlineTerm||null;this.strictInline=!!(this.inlineTerm&&this.strictInlineSupport&&(t.strictInline||t.strictInline===undefined));this.restoreCursorAfterDraw=!!(this.inlineTerm&&this.inlineCursorRestoreAfterDraw&&!this.strictInline);this.outputDst=t.outputDst||t.parent&&t.parent.inputDst,this.inputDst=null;this.label=t.label||"";this.key=t.key||null;if(this.value===undefined){this.value=t.value===undefined?null:t.value}this.childId=t.childId===undefined?null:t.childId;this.def=t.def||null;this.hidden=!!t.hidden;this.disabled=!!t.disabled;this.content="";this.contentHasMarkup=false;this.contentWidth=0;if(this.setContent===o.prototype.setContent){this.setContent(t.content||"",t.contentHasMarkup,true,true)}this.meta=t.meta;this.autoWidth=+t.autoWidth||0;this.autoHeight=+t.autoHeight||0;this.outputX=t.outputX||t.x||0;this.outputY=t.outputY||t.y||0;this.savedZIndex=this.zIndex=t.zIndex||t.z||0;this.interceptTempZIndex=!!t.interceptTempZIndex;this.outputWidth=this.autoWidth&&this.outputDst?Math.round(this.outputDst.width*this.autoWidth):t.outputWidth?t.outputWidth:t.width?t.width:this.strictInline?this.inlineTerm.width:1;this.outputHeight=this.autoHeight&&this.outputDst?Math.round(this.outputDst.height*this.autoHeight):t.outputHeight?t.outputHeight:t.height?t.height:this.strictInline?this.inlineTerm.height:1;this.needRedraw=false;this.savedCursorX=0;this.savedCursorY=0;this.hasFocus=false;this.children=[];this.zChildren=[];this.inputDst=this.outputDst;this.inputX=this.outputX;this.inputY=this.outputY;this.inputWidth=this.outputWidth;this.inputHeight=this.outputHeight;if(this.parent){this.parent.attach(this,t.id)}if(t.shortcuts&&this.document){if(Array.isArray(t.shortcuts)){this.document.createShortcuts(this,...t.shortcuts)}else{this.document.createShortcuts(this,t.shortcuts)}}}e.exports=o;o.prototype=Object.create(i.prototype);o.prototype.constructor=o;o.prototype.elementType="Element";const u=t("../termkit.js");o.prototype.destroy=function(t=false,e=false){if(this.destroyed){return}var r,i,n=this.document;for(r=0,i=this.children.length;r<i;r++){this.children[r].destroy(true)}this.children.length=0;this.zChildren.length=0;this.document.removeElementShortcuts(this);if(!t){this.detach(e);if(this.inlineTerm&&n!==this){n.destroy()}}else{delete this.document.elements[this.id];this.id=null;this.parent=null;this.document=null}this.destroyed=true};o.prototype.show=function(t=false){if(!this.hidden){return this}this.hidden=false;if(!t){this.redraw()}return this};o.prototype.hide=function(t=false){if(this.hidden){return this}this.hidden=true;if(!t){this.redraw(true)}return this};o.prototype.clear=function(){var t,e;for(t=0,e=this.children.length;t<e;t++){this.children[t].destroy(true)}this.children.length=0;this.zChildren.length=0;this.draw()};o.prototype.attach=function(t,e){if(this.children.indexOf(t)===-1){t.parent=this;this.children.push(t);this.zInsert(t);t.outputDst=this.inputDst;if(!t.inputDst){t.inputDst=t.outputDst}if(this.document!==t.document){t.recursiveFixAttachment(this.document,e)}}return this};o.prototype.attachTo=function(t,e){if(t.elementType){t.attach(this,e)}return this};o.prototype.recursiveFixAttachment=function(t,e=this.id){var r,i;if(t){t.assignId(this,e)}else if(this.document){this.document.unassignId(this,this.id)}else{this.id=null}this.document=t||null;if(this.parent){this.outputDst=this.parent.inputDst;if(!this.inputDst){this.inputDst=this.outputDst}}for(r=0,i=this.children.length;r<i;r++){this.children[r].recursiveFixAttachment(t)}};o.prototype.detach=function(t=false){var e,r=this.parent;if(!r){return}e=r.children.indexOf(this);if(e>=0){r.children.splice(e,1)}e=r.zChildren.indexOf(this);if(e>=0){r.zChildren.splice(e,1)}delete this.document.elements[this.id];this.parent=null;this.recursiveFixAttachment(null);if(!t){r.document.draw()}return this};o.prototype.resizeToContent=function(){this.outputWidth=this.contentWidth;this.outputHeight=this.contentHeight};o.prototype.zSort=function(){this.zChildren.sort((t,e)=>t.zIndex-e.zIndex)};o.prototype.zInsert=function(t){var e,r=this.zChildren.length;while(r--){e=this.zChildren[r];if(t.zIndex>=e.zIndex){this.zChildren[r+1]=t;return}this.zChildren[r+1]=e}this.zChildren[0]=t};o.prototype.updateZ=o.prototype.updateZIndex=function(t){this.savedZIndex=this.zIndex=t;this.parent.zSort()};o.prototype.topZ=function(){if(this.parent.interceptTempZIndex){return this.parent.topZ()}if(!this.parent.zChildren.length){return}this.zIndex=this.parent.zChildren[this.parent.zChildren.length-1].zIndex+1;this.parent.zSort()};o.prototype.bottomZ=function(){if(this.parent.interceptTempZIndex){return this.parent.bottomZ()}if(!this.parent.zChildren.length){return}this.zIndex=this.parent.zChildren[0].zIndex-1;this.parent.zSort()};o.prototype.restoreZ=function(){if(this.parent.interceptTempZIndex){return this.parent.restoreZ()}this.zIndex=this.savedZIndex;this.parent.zSort()};o.computeContentWidth=(t,e)=>{if(Array.isArray(t)){return e==="ansi"||e==="legacyAnsi"?Math.max(...t.map(t=>n.ansiWidth(t))):e?Math.max(...t.map(t=>n.markupWidth(t))):Math.max(...t.map(t=>s.unicode.width(t)))}return e==="ansi"||e==="legacyAnsi"?n.ansiWidth(t):e?n.markupWidth(t):s.unicode.width(t)};var a=0;o.getLastTruncateWidth=()=>a;o.truncateContent=(t,e,r)=>{var i;if(r==="ansi"||r==="legacyAnsi"){i=n.truncateAnsiString(t,e);a=n.getLastTruncateWidth()}else if(r){i=n.truncateMarkupString(t,e);a=n.getLastTruncateWidth()}else{i=s.unicode.truncateWidth(t,e);a=s.unicode.getLastTruncateWidth()}return i};o.wordwrapContent=o.wordWrapContent=(t,e,r)=>r==="ansi"||r==="legacyAnsi"?n.wordWrapAnsi(t,e):r?n.wordWrapMarkup(t,e):s.wordwrap(t,{width:e,fill:true,noJoin:true});o.prototype.setContent=function(t,e,r=false,i=false){if(this.forceContentArray&&!Array.isArray(t)){t=[t||""]}this.content=t;this.contentHasMarkup=e;this.contentWidth=o.computeContentWidth(t,this.contentHasMarkup);if(!i&&this.resizeOnContent){this.resizeOnContent()}if(!r){this.redraw()}};o.prototype.isAncestorOf=function(t){var e=t;for(;;){if(e===this){return true}else if(!e.parent){return false}else if(e.parent.children.indexOf(e)===-1){e.parent=null;return false}e=e.parent}};o.prototype.getParentContainer=function(){var t=this;for(;;){if(!t.parent){return null}if(t.parent.isContainer){return t.parent}t=t.parent}};o.prototype.getFocusBranchIndex=function(){var t,e;if(!this.document.focusElement){return null}e=this.document.focusElement;for(;;){if(e===this){return null}else if(!e.parent){return null}if(e.parent===this){t=e.parent.children.indexOf(e);if(t===-1){e.parent=null;return null}return t}e=e.parent}};o.prototype.focusNextChild=function(t=true){var e,r,i;if(!this.children.length||!this.document){return null}if(!this.document.focusElement||(e=this.getFocusBranchIndex())===null){e=this.children.length-1}r=e;for(;;){e++;if(e>=this.children.length){if(t){e=0}else{e=this.children.length-1;break}}i=this.document.giveFocusTo_(this.children[e],"cycle");if(i||r===e){break}}return this.children[e]};o.prototype.focusPreviousChild=function(t=true){var e,r,i;if(!this.children.length||!this.document){return null}if(!this.document.focusElement||(e=this.getFocusBranchIndex())===null){e=0}r=e;for(;;){e--;if(e<0){if(t){e=this.children.length-1}else{e=0;break}}i=this.document.giveFocusTo_(this.children[e],"backCycle");if(i||r===e){break}}return this.children[e]};o.prototype.childrenAt=function(t,e,r=null,i=[]){var n,s;n=this.zChildren.length;while(n--){s=this.zChildren[n];if(s.hidden){continue}if(t>=s.outputX&&t<=s.outputX+s.outputWidth-1&&e>=s.outputY&&e<=s.outputY+s.outputHeight-1){if(s.isContainer){s.childrenAt(t-s.inputX,e-s.inputY,r,i)}else{s.childrenAt(t,e,r,i)}if(!r||r(s)){i.push({element:s,x:t-s.outputX,y:e-s.outputY})}}else if(!s.isContainer){s.childrenAt(t,e,r,i)}}return i};o.prototype.saveCursor=function(){if(this.inputDst){this.savedCursorX=this.inputDst.cx;this.savedCursorY=this.inputDst.cy}else if(this.outputDst){this.savedCursorX=this.outputDst.cx;this.savedCursorY=this.outputDst.cy}return this};o.prototype.restoreCursor=function(){if(this.inputDst){this.inputDst.cx=this.savedCursorX;this.inputDst.cy=this.savedCursorY;this.inputDst.drawCursor()}else if(this.outputDst){this.outputDst.cx=this.savedCursorX;this.outputDst.cy=this.savedCursorY;this.outputDst.drawCursor()}return this};o.prototype.draw=function(t=false){if(!this.document||this.hidden){return this}if(!t){if(this.restoreCursorAfterDraw){this.inlineTerm.saveCursor()}else if(!this.strictInline){this.saveCursor()}}this.descendantDraw();this.ascendantDraw();if(!t){if(this.restoreCursorAfterDraw){this.inlineTerm.restoreCursor()}else if(!this.strictInline){this.drawCursor()}}return this};o.prototype.redraw=function(t=false){if(!this.document||this.hidden&&!t){return this}var e=this.getParentContainer();if(!e){this.draw()}else{e.draw()}return this};o.prototype.updateDraw=function(){if(this.needRedraw){this.redraw()}else{this.draw()}this.needRedraw=false};o.prototype.descendantDraw=function(t){var e,r;if(this.hidden){return this}if(this.preDrawSelf){this.preDrawSelf(!t)}for(e=0,r=this.zChildren.length;e<r;e++){this.zChildren[e].descendantDraw(true)}if(t&&this.postDrawSelf){this.postDrawSelf(!t)}return this};o.prototype.ascendantDraw=function(){var t;if(this.postDrawSelf&&!this.hidden){this.postDrawSelf(true)}t=this;while(t.parent&&t.outputDst!==t.document.outputDst){t=t.parent;if(t.outputDst!==t.inputDst&&t.postDrawSelf&&!t.hidden){t.postDrawSelf(false)}}return this};o.prototype.drawCursor=function(){var t;if(this.drawSelfCursor&&!this.hidden){this.drawSelfCursor(true)}t=this;while(t.outputDst!==t.document.outputDst&&t.parent){t=t.parent;if(t.drawSelfCursor&&!t.hidden){t.drawSelfCursor(false)}}return this};o.createInline=async function(e,t,r){r=!r?{}:r.internal?r:Object.create(r);r.internal=true;r.inlineTerm=e;var i,n={x:r.outputX||r.x,y:r.outputY||r.y};r.x=r.y=r.outputX=r.outputY=0;var s=new t(r);if(n.x===undefined||n.y===undefined){if(s.strictInline){n.x=n.y=1}else{i=await e.getCursorLocation();if(n.x===undefined){n.x=i.x;if(i.x>1&&s.inlineNewLine){n.x=1;if(n.y===undefined){n.y=i.y+1}}}if(n.y===undefined){n.y=i.y}}}if(!s.strictInline){let t=n.y+s.outputHeight-e.height;if(t>0){e.scrollUp(t);e.up(t);n.y-=t}}if(s.inlineResizeToContent){s.resizeToContent()}var o={internal:true,inlineTerm:e,strictInline:s.strictInline,noInput:s.strictInline||!s.needInput,outputX:n.x,outputY:n.y,outputWidth:s.outputWidth,outputHeight:s.outputHeight,outputDst:e,eventSource:e,noDraw:true};var a=new u.Document(o);a.attach(s);s.on("resize",()=>{throw new Error("not coded!")});s.draw(true);e.styleReset();if(s.staticInline){s.destroy(undefined,true)}return s};o.prototype.isContainer=false;o.prototype.forceContentArray=false;o.prototype.noChildFocus=false;o.prototype.computeBoundingBoxes=null;o.prototype.resizeOnContent=null;o.prototype.preDrawSelf=null;o.prototype.postDrawSelf=null;o.prototype.drawSelfCursor=null;o.prototype.getValue=()=>null;o.prototype.setValue=()=>undefined;o.prototype.strictInlineSupport=false;o.prototype.staticInline=false;o.prototype.inlineCursorRestoreAfterDraw=false;o.prototype.needInput=false},{"../misc.js":42,"../termkit.js":50,"nextgen-events":72,"string-kit":123}],24:[function(e,i,t){(function(r){(function(){"use strict";const o=e("./Element.js");const a=e("./LabeledInput.js");const u=e("./Button.js");function t(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.outputWidth&&!t.width){t.outputWidth=78}o.call(this,t);this.submitValue=null;this.inputsDef=t.inputs||[];this.labeledInputs=[];this.buttonsDef=t.buttons||[];this.buttons=[];this.focusChild=null;this.onButtonSubmit=this.onButtonSubmit.bind(this);this.onKey=this.onKey.bind(this);this.onFocus=this.onFocus.bind(this);this.textAttr=t.textAttr||null;this.voidAttr=t.voidAttr||t.emptyAttr||null;this.labelFocusAttr=t.labelFocusAttr||null;this.labelBlurAttr=t.labelBlurAttr||null;this.buttonFocusAttr=t.buttonFocusAttr||null;this.buttonBlurAttr=t.buttonBlurAttr||null;this.turnedOnBlurAttr=t.turnedOnBlurAttr||null;this.turnedOnFocusAttr=t.turnedOnFocusAttr||null;this.turnedOffBlurAttr=t.turnedOffBlurAttr||null;this.turnedOffFocusAttr=t.turnedOffFocusAttr||null;if(t.keyBindings){this.keyBindings=t.keyBindings}if(t.textInputKeyBindings){this.textInputKeyBindings=t.textInputKeyBindings}this.initChildren();this.on("key",this.onKey);this.on("focus",this.onFocus);if(this.elementType==="Form"&&!t.noDraw){this.draw()}}i.exports=t;t.prototype=Object.create(o.prototype);t.prototype.constructor=t;t.prototype.elementType="Form";t.prototype.needInput=true;t.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("focus",this.onFocus);o.prototype.destroy.call(this,t,e)};t.prototype.keyBindings={LEFT:"previous",RIGHT:"next",UP:"previous",DOWN:"next",ENTER:"next",KP_ENTER:"next",ALT_ENTER:"next"};t.prototype.textInputKeyBindings={};t.prototype.selectInputKeyBindings={};t.prototype.selectMultiInputKeyBindings={};t.prototype.initChildren=function(){var n=0,r=0,s=0,e=0,i=0;this.inputsDef.forEach(t=>{t.labelWidth=o.computeContentWidth(t.label,t.labelHasMarkup);if(t.labelWidth>n){n=t.labelWidth}});this.inputsDef.forEach((t,e)=>{var r=1,i=t.label+" ".repeat(n-t.labelWidth);switch(t.type){case"select":this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,value:t.value,items:t.items,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,buttonBlurAttr:t.buttonBlurAttr||this.buttonBlurAttr,buttonFocusAttr:t.buttonFocusAttr||this.buttonFocusAttr,buttonDisabledAttr:t.buttonDisabledAttr||this.buttonDisabledAttr,buttonSubmittedAttr:t.buttonSubmittedAttr||this.buttonSubmittedAttr,keyBindings:this.selectInputKeyBindings,noDraw:true});break;case"select-multi":case"selectMulti":this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,value:t.value,items:t.items,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,buttonBlurAttr:t.buttonBlurAttr||this.buttonBlurAttr,buttonFocusAttr:t.buttonFocusAttr||this.buttonFocusAttr,buttonDisabledAttr:t.buttonDisabledAttr||this.buttonDisabledAttr,buttonSubmittedAttr:t.buttonSubmittedAttr||this.buttonSubmittedAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.turnedOnBlurAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.turnedOnFocusAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.turnedOffBlurAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.turnedOffFocusAttr,keyBindings:this.selectInputKeyBindings,noDraw:true});break;case"text":default:t.type="text";if(t.height){r=t.height}this.labeledInputs[e]=new a({internal:true,parent:this,type:t.type,key:t.key,label:i,content:t.content,outputX:this.outputX,outputY:this.outputY+s,outputWidth:t.outputWidth||t.width||this.outputWidth,outputHeight:r,lineWrap:!!t.lineWrap,wordWrap:!!t.wordWrap,scrollable:!!t.scrollable,vScrollBar:!!t.vScrollBar,hScrollBar:!!t.hScrollBar,hiddenContent:t.hiddenContent,labelFocusAttr:t.labelFocusAttr||this.labelFocusAttr,labelBlurAttr:t.labelBlurAttr||this.labelBlurAttr,textAttr:t.textAttr||this.textAttr,voidAttr:t.voidAttr||t.emptyAttr||this.voidAttr,keyBindings:this.textInputKeyBindings,allowNewLine:r>1,noDraw:true});break}s+=r});if(!this.buttonsDef.length){this.buttonsDef.push({content:"Submit",value:"submit"})}this.buttonsDef.forEach(t=>{t.contentWidth=o.computeContentWidth(t.content,t.contentHasMarkup);e+=t.contentWidth});i=Math.floor((this.outputWidth-e)/(this.buttonsDef.length+1));r=i;s++;this.buttonsDef.forEach((t,e)=>{this.buttons[e]=new u({internal:true,parent:this,content:t.content,value:t.value,outputX:this.outputX+r,outputY:this.outputY+s,focusAttr:t.focusAttr||this.buttonFocusAttr,blurAttr:t.blurAttr||this.buttonBlurAttr,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);r+=t.contentWidth+i})};t.prototype.getValue=function(){var e={};this.labeledInputs.forEach(t=>{e[t.key]=t.getValue()});return{submit:this.submitValue,fields:e}};t.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"previous":this.focusChild=this.focusPreviousChild();break;case"next":this.focusChild=this.focusNextChild();break;default:return}return true};t.prototype.onFocus=function(t,e){if(e==="cycle"||e==="backCycle"){return}if(t){r.nextTick(()=>{if(this.focusChild){this.document.giveFocusTo(this.focusChild,"delegate")}else{this.focusChild=this.focusNextChild()}})}};t.prototype.onButtonSubmit=function(t,e){this.submitValue=t;this.emit("submit",this.getValue(),e,this)}}).call(this)}).call(this,e("_process"))},{"./Button.js":16,"./Element.js":23,"./LabeledInput.js":26,_process:179}],25:[function(t,e,r){"use strict";const i=t("seventh");const n=t("./TextBox.js");const s=t("./EditableTextBox.js");const o=t("./RowMenu.js");const a=t("string-kit");const u=t("../autoComplete.js");function l(e){e=!e?{}:e.internal?e:Object.create(e);e.internal=true;if(e.value){e.content=e.value}e.outputHeight=1;e.scrollable=e.hasVScrollBar=e.hasHScrollBar=e.extraScrolling=false;e.scrollX=e.scrollY=0;e.lineWrap=true;this.onAutoCompleteMenuSubmit=this.onAutoCompleteMenuSubmit.bind(this);this.onAutoCompleteMenuCancel=this.onAutoCompleteMenuCancel.bind(this);this.promptTextBox=null;if(e.prompt){this.promptTextBox=new n(Object.assign({textAttr:e.textAttr},e.prompt,{internal:true,outputX:e.outputX||e.x,outputY:e.outputY||e.y,outputWidth:e.outputWidth||e.width,outputHeight:e.outputHeight||e.height,lineWrap:e.lineWrap,wordWrap:e.wordWrap||e.wordwrap}));this.promptTextBox.textBuffer.setVoidAttr(null);let t=this.promptTextBox.getContentSize();this.promptTextBox.setSizeAndPosition(t);if(t.height>1){e.outputY=(e.outputY||e.y)+t.height-1;e.firstLineRightShift=this.promptTextBox.textBuffer.buffer[this.promptTextBox.textBuffer.buffer.length-1].length}else{e.firstLineRightShift=t.width}}s.call(this,e);this.history=e.history;this.contentArray=e.history?[...e.history,this.content]:[this.content];this.contentIndex=this.contentArray.length-1;this.disabled=!!e.disabled;this.submitted=!!e.submitted;this.cancelable=!!e.cancelable;this.canceled=!!e.canceled;this.autoComplete=e.autoComplete;this.useAutoCompleteHint=!!(this.autoComplete&&(e.useAutoCompleteHint||e.autoCompleteHint));this.useAutoCompleteMenu=!!(this.autoComplete&&(e.useAutoCompleteMenu||e.autoCompleteMenu));this.autoCompleteMenu=null;this.autoCompleteLeftPart=null;this.autoCompleteRightPart=null;this.menuOptions=Object.assign({},this.defaultMenuOptions,e.menu);this.placeholder=e.placeholder;this.placeholderHasMarkup=e.placeholderHasMarkup;if(this.placeholder){this.setAltContent(this.placeholder,this.placeholderHasMarkup)}if(this.promptTextBox){this.attach(this.promptTextBox)}if(this.elementType==="InlineInput"&&!e.noDraw){this.draw()}}e.exports=l;l.prototype=Object.create(s.prototype);l.prototype.constructor=l;l.prototype.elementType="InlineInput";l.prototype.useAltTextBuffer=true;l.prototype.defaultMenuOptions={buttonBlurAttr:{bgColor:"default",color:"default"},buttonFocusAttr:{bgColor:"green",color:"blue",dim:true},buttonDisabledAttr:{bgColor:"white",color:"brightBlack"},buttonSubmittedAttr:{bgColor:"brightWhite",color:"brightBlack"},buttonSeparatorAttr:{bgColor:"default"},backgroundAttr:{bgColor:"default"},justify:true,keyBindings:Object.assign({},o.prototype.keyBindings,{TAB:"next",SHIFT_TAB:"previous"})};l.prototype.keyBindings={ENTER:"submit",KP_ENTER:"submit",ESCAPE:"cancel",TAB:"autoComplete",CTRL_R:"historyAutoComplete",UP:"historyPrevious",DOWN:"historyNext",BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",HOME:"startOfLine",END:"endOfLine",CTRL_O:"copyClipboard",CTRL_P:"pasteClipboard"};l.prototype.preDrawSelf=function(){s.prototype.preDrawSelf.call(this)};l.prototype.autoResizeAndDraw=function(t=false){var e=Math.max(this.textBuffer.buffer.length,this.altTextBuffer&&this.altTextBuffer.buffer.length||0);if(e>this.outputHeight){this.setSizeAndPosition({outputHeight:e})}if(!t){this.draw()}else{this.drawCursor()}};l.prototype.autoResizeAndDrawCursor=function(){return this.autoResizeAndDraw(true)};l.prototype.runAutoCompleteHint=async function(t){var e;var[r,i]=this.textBuffer.getCursorSplittedText();if(i){this.altTextBuffer.setText("")}else{if(Array.isArray(t)){e=u(t,r,false)}else if(typeof t==="function"){e=await t(r,false)}else{return}if(Array.isArray(e)){if(!e.length){return}e=e[0]}if(e===r){this.altTextBuffer.setText("")}else{this.altTextBuffer.setText(e)}}this.autoResizeAndDraw()};l.prototype.runAutoComplete=async function(t){var e;[this.autoCompleteLeftPart,this.autoCompleteRightPart]=this.textBuffer.getCursorSplittedText();if(Array.isArray(t)){e=u(t,this.autoCompleteLeftPart,this.useAutoCompleteMenu)}else if(typeof t==="function"){e=await t(this.autoCompleteLeftPart,this.useAutoCompleteMenu)}else{return}if(Array.isArray(e)){if(!e.length){return}if(this.useAutoCompleteMenu){this.runAutoCompleteMenu(e);return}e=e[0]}this.runAutoCompleted(e)};l.prototype.runAutoCompleted=async function(t){this.textBuffer.setText(t+this.autoCompleteRightPart);this.textBuffer.setCursorOffset(t.length);this.textBuffer.runStateMachine();this.autoResizeAndDraw()};l.prototype.runAutoCompleteMenu=async function(t){if(!t||!t.length){return}if(this.autoCompleteMenu){this.autoCompleteMenu.destroy()}this.autoCompleteMenu=new o(Object.assign({},this.menuOptions,{internal:true,parent:this,x:this.outputX,y:this.outputY+this.outputHeight,outputWidth:this.outputWidth,items:t.map(t=>({value:t,content:t}))}));this.document.giveFocusTo(this.autoCompleteMenu);this.autoCompleteMenu.once("submit",this.onAutoCompleteMenuSubmit);this.autoCompleteMenu.once("cancel",this.onAutoCompleteMenuCancel)};l.prototype.onAutoCompleteMenuSubmit=function(t){this.autoCompleteMenu.destroy();this.autoCompleteMenu=null;this.document.giveFocusTo(this);this.runAutoCompleted(t)};l.prototype.onAutoCompleteMenuCancel=function(){this.autoCompleteMenu.destroy();this.autoCompleteMenu=null;this.document.giveFocusTo(this)};l.prototype.onKey=function(t,e,r){if(this.autoCompleteMenu){this.autoCompleteMenu.emit("cancel")}if(r&&r.isCharacter){if(this.placeholder){this.placeholder=null;this.setAltContent("",false,true)}this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}}else{switch(this.keyBindings[t]){case"submit":if(this.disabled||this.submitted||this.canceled){break}this.emit("submit",this.getValue(),undefined,this);break;case"cancel":if(!this.cancelable||this.disabled||this.canceled){break}this.emit("cancel",this);break;case"autoComplete":if(!this.autoComplete){break}this.runAutoComplete(this.autoComplete);break;case"historyAutoComplete":if(!this.autoComplete){break}this.runAutoComplete(this.history);break;case"historyPrevious":if(this.contentIndex<=0){break}this.contentArray[this.contentIndex]=this.getContent();this.contentIndex--;this.setContent(this.contentArray[this.contentIndex]);this.textBuffer.runStateMachine();this.autoResizeAndDraw();break;case"historyNext":if(this.contentIndex>=this.contentArray.length-1){break}this.contentArray[this.contentIndex]=this.getContent();this.contentIndex++;this.setContent(this.contentArray[this.contentIndex]);this.textBuffer.runStateMachine();this.autoResizeAndDraw();break;case"backDelete":this.textBuffer.backDelete();this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}break;case"delete":this.textBuffer.delete();this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}break;case"backward":this.textBuffer.moveBackward();this.autoResizeAndDrawCursor();break;case"forward":this.textBuffer.moveForward();this.autoResizeAndDrawCursor();break;case"startOfWord":this.textBuffer.moveToStartOfWord();this.autoResizeAndDrawCursor();break;case"endOfWord":this.textBuffer.moveToEndOfWord();this.autoResizeAndDrawCursor();break;case"startOfLine":this.textBuffer.moveToColumn(0);this.autoResizeAndDrawCursor();break;case"endOfLine":this.textBuffer.moveToEndOfLine();this.autoResizeAndDrawCursor();break;case"left":this.textBuffer.moveLeft();this.autoResizeAndDrawCursor();break;case"right":this.textBuffer.moveRight();this.autoResizeAndDrawCursor();break;case"pasteClipboard":if(this.document){this.document.getClipboard().then(t=>{if(t){this.textBuffer.insert(t,this.textAttr);this.textBuffer.runStateMachine();if(this.useAutoCompleteHint){this.runAutoCompleteHint(this.autoComplete)}else{this.autoResizeAndDraw()}}}).catch(()=>undefined)}break;case"copyClipboard":if(this.document){this.document.setClipboard(this.textBuffer.getSelectionText()).catch(()=>undefined)}break;default:return}}return true}},{"../autoComplete.js":7,"./EditableTextBox.js":22,"./RowMenu.js":28,"./TextBox.js":33,seventh:108,"string-kit":123}],26:[function(u,l,t){(function(a){(function(){"use strict";const r=u("./Element.js");const e=u("./Text.js");const i=u("./EditableTextBox.js");const n=u("./SelectList.js");const s=u("./SelectListMulti.js");const t=u("string-kit");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;r.call(this,t);this.hiddenContent=t.hiddenContent;this.hasInputFocus=false;this.interceptTempZIndex=true;this.labelFocusAttr=t.labelFocusAttr||{bold:true};this.labelBlurAttr=t.labelBlurAttr||{dim:true};this.buttonBlurAttr=t.buttonBlurAttr||{bgColor:"cyan",color:"white",bold:true};this.buttonFocusAttr=t.buttonFocusAttr||{bgColor:"brightCyan",color:"black",bold:true};this.buttonDisabledAttr=t.buttonDisabledAttr||{bgColor:"cyan",color:"gray",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||{bgColor:"brightCyan",color:"brightWhite",bold:true};this.turnedOnBlurAttr=t.turnedOnBlurAttr||{bgColor:"cyan"};this.turnedOnFocusAttr=t.turnedOnFocusAttr||{bgColor:"brightCyan",bold:true};this.turnedOffBlurAttr=t.turnedOffBlurAttr||{bgColor:"gray",dim:true};this.turnedOffFocusAttr=t.turnedOffFocusAttr||{bgColor:"white",color:"black",bold:true};this.textAttr=t.textAttr||{bgColor:"blue"};this.voidAttr=t.voidAttr||t.emptyAttr||{bgColor:"blue"};if(t.keyBindings){this.keyBindings=t.keyBindings}if(this.label){this.labelText=new e({internal:true,parent:this,content:this.label,x:this.outputX,y:this.outputY,height:1,attr:this.labelBlurAttr,leftPadding:this.labelBlurLeftPadding,rightPadding:this.labelBlurRightPadding,noDraw:true})}this.inputType=t.type||"text";this.onKey=this.onKey.bind(this);this.onFocus=this.onFocus.bind(this);this.onClick=this.onClick.bind(this);this.onInputSubmit=this.onInputSubmit.bind(this);this.initInput(t);this.updateStatus();this.on("key",this.onKey);this.on("focus",this.onFocus);this.on("click",this.onClick);if(this.elementType==="LabeledInput"&&!t.noDraw){this.draw()}}l.exports=o;o.prototype=Object.create(r.prototype);o.prototype.constructor=o;o.prototype.elementType="LabeledInput";o.prototype.needInput=true;o.prototype.noChildFocus=true;o.prototype.propagateZ=true;o.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("focus",this.onFocus);this.off("click",this.onClick);if(this.input){this.off("submit",this.onInputSubmit)}r.prototype.destroy.call(this,t,e)};o.prototype.keyBindings={ENTER:"submit",KP_ENTER:"submit",ALT_ENTER:"submit"};o.prototype.editableTextBoxKeyBindings={BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",CTRL_LEFT:"startOfWord",CTRL_RIGHT:"endOfWord",HOME:"startOfLine",END:"endOfLine",CTRL_O:"copyClipboard",CTRL_P:"pasteClipboard"};o.prototype.multiLineEditableTextBoxKeyBindings=Object.assign({},o.prototype.editableTextBoxKeyBindings,{ENTER:"newLine",KP_ENTER:"newLine",UP:"up",DOWN:"down",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown",CTRL_O:"copyClipboard",CTRL_P:"pasteClipboard"});o.prototype.selectListKeyBindings={UP:"previous",DOWN:"next",ENTER:"submit",KP_ENTER:"submit"};o.prototype.selectListMultiKeyBindings={UP:"previous",DOWN:"next",ENTER:"submit",KP_ENTER:"submit"};o.prototype.initInput=function(t){switch(this.inputType){case"text":this.initTextInput(t);break;case"select":this.initSelectInput(t);break;case"selectMulti":this.initSelectMultiInput(t);break;default:throw new Error("Unknown input type: "+this.inputType)}this.input.on("focus",this.onChildFocus.bind(this))};o.prototype.initTextInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else if(t.allowNewLine){this.inputKeyBindings=this.multiLineEditableTextBoxKeyBindings}else{this.inputKeyBindings=this.editableTextBoxKeyBindings}this.input=new i({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),height:this.outputHeight,lineWrap:!!t.lineWrap,wordWrap:!!t.wordWrap,scrollable:!!t.scrollable,vScrollBar:!!t.vScrollBar,hScrollBar:!!t.hScrollBar,hiddenContent:this.hiddenContent,textAttr:this.textAttr,voidAttr:this.voidAttr,keyBindings:this.inputKeyBindings,noDraw:true})};o.prototype.initSelectInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else{this.inputKeyBindings=this.selectListKeyBindings}this.input=new n({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),items:t.items,buttonBlurAttr:this.buttonBlurAttr,buttonFocusAttr:this.buttonFocusAttr,buttonDisabledAttr:this.buttonDisabledAttr,buttonSubmittedAttr:this.buttonSubmittedAttr,keyBindings:this.inputKeyBindings,noDraw:true});this.input.on("submit",this.onInputSubmit)};o.prototype.initSelectMultiInput=function(t){if(t.inputKeyBindings){this.inputKeyBindings=t.inputKeyBindings}else{this.inputKeyBindings=this.selectListMultiKeyBindings}this.input=new s({internal:true,parent:this,content:t.content,value:t.value,x:this.outputX+(this.labelText?this.labelText.outputWidth:0),y:this.outputY,width:this.outputWidth-(this.labelText?this.labelText.outputWidth:0),items:t.items,buttonBlurAttr:this.buttonBlurAttr,buttonFocusAttr:this.buttonFocusAttr,buttonDisabledAttr:this.buttonDisabledAttr,buttonSubmittedAttr:this.buttonSubmittedAttr,turnedOnBlurAttr:this.turnedOnBlurAttr,turnedOnFocusAttr:this.turnedOnFocusAttr,turnedOffBlurAttr:this.turnedOffBlurAttr,turnedOffFocusAttr:this.turnedOffFocusAttr,keyBindings:this.inputKeyBindings,noDraw:true});this.input.on("submit",this.onInputSubmit)};o.prototype.updateStatus=function(){if(this.hasFocus||this.hasInputFocus){if(this.labelText){this.labelText.attr=this.labelFocusAttr;this.labelText.leftPadding=this.labelFocusLeftPadding;this.labelText.rightPadding=this.labelFocusRightPadding}}else if(this.labelText){this.labelText.attr=this.labelBlurAttr;this.labelText.leftPadding=this.labelBlurLeftPadding;this.labelText.rightPadding=this.labelBlurRightPadding}};o.prototype.getValue=function(){return this.input.getValue()};o.prototype.setValue=function(t,e){return this.input.setValue(t,e)};o.prototype.getContent=function(){return this.input.getContent()};o.prototype.setContent=function(t,e,r){return this.input.setContent(t,e,r)};o.prototype.drawSelfCursor=function(){if(this.input.drawSelfCursor){this.input.drawSelfCursor()}};o.prototype.onKey=function(t,e,r){if(this.input.emit("key",t,e,r).interrupt){return true}switch(this.keyBindings[t]){case"submit":this.emit("submit",this.getValue(),undefined,this);break;default:return}return true};o.prototype.onInputSubmit=function(t){this.emit("submit",this.getValue(),undefined,this)};o.prototype.onFocus=function(t,e){this.hasFocus=t;if(e==="delegate"){return}if(t&&e!=="backCycle"&&this.input){a.nextTick(()=>{this.document.giveFocusTo(this.input,"delegate")})}else{this.updateStatus();if(this.labelText){this.labelText.draw()}}};o.prototype.onChildFocus=function(t,e){this.hasInputFocus=t;this.updateStatus();if(this.labelText){this.labelText.draw()}};o.prototype.onClick=function(t){this.document.giveFocusTo(this,"select")}}).call(this)}).call(this,u("_process"))},{"./EditableTextBox.js":22,"./Element.js":23,"./SelectList.js":29,"./SelectListMulti.js":30,"./Text.js":32,_process:179,"string-kit":123}],27:[function(t,e,r){"use strict";const i=t("./Element.js");const u=t("./Container.js");const n=t("../spChars.js").box;function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onParentResize=this.onParentResize.bind(this);this.layoutDef=t.layout;this.computed={};this.boxesContainer={};this.boxChars=n.light;if(t.boxChars){if(typeof t.boxChars==="object"){this.boxChars=t.boxChars}else if(typeof t.boxChars==="string"&&n[t.boxChars]){this.boxChars=n[t.boxChars]}}this.on("parentResize",this.onParentResize);this.computeBoundingBoxes();if(this.elementType==="Layout"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="Layout";s.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("parentResize",this.onParentResize);i.prototype.destroy.call(this,t,e)};s.prototype.computeBoundingBoxes=function(){var t=this.computed={};var e=this.layoutDef;var r={width_:this.outputDst.width,height_:this.outputDst.height,dx_:this.outputDst.width-1,dy_:this.outputDst.height-1,xmin_:0,ymin_:0};var i={offsetX:this.layoutDef.x||0,offsetY:this.layoutDef.y||0,remainingDx:r.dx_,remainingDy:r.dy_};this.computeBoundingBoxes_(e,t,r,i)};s.prototype.computeBoundingBoxes_=function(t,e,r,i){var n,s,o=false;this.computeDxDy(t,e,r,i);e.xmin_=r.xmin_+i.offsetX;e.xmax_=e.xmin_+e.dx_;e.ymin_=r.ymin_+i.offsetY;e.ymax_=e.ymin_+e.dy_;if(e.xmax_>r.xmax_){e.xmax_=r.xmax_;e.dx_=e.xmax_-e.xmin_}if(e.ymax_>r.ymax_){e.ymax_=r.ymax_;e.dy_=e.ymax_-e.ymin_}e.width_=e.dx_+1;e.height_=e.dy_+1;e.columns=[];e.rows=[];s={offsetX:0,offsetY:0,remainingDx:e.dx_,remainingDy:e.dy_,autoDxCount:0,autoDyCount:0};if(t.columns&&t.columns.length){for(n=0;n<t.columns.length;n++){e.columns[n]={};this.computeDxDy(t.columns[n],e.columns[n],e,s,true);if(e.columns[n].dx_!==undefined){s.remainingDx-=e.columns[n].dx_}else{s.autoDxCount++}}for(n=0;n<t.columns.length;n++){this.computeBoundingBoxes_(t.columns[n],e.columns[n],e,s);s.offsetX=e.columns[n].xmax_-e.xmin_}o=true}else if(t.rows&&t.rows.length){for(n=0;n<t.rows.length;n++){e.rows[n]={};this.computeDxDy(t.rows[n],e.rows[n],e,s,true);if(e.rows[n].dy_!==undefined){s.remainingDy-=e.rows[n].dy_}else{s.autoDyCount++}}for(n=0;n<t.rows.length;n++){this.computeBoundingBoxes_(t.rows[n],e.rows[n],e,s);s.offsetY=e.rows[n].ymax_-e.ymin_}o=true}e.width_=e.dx_+1;e.height_=e.dy_+1;this.round(e);if(!o){if(this.boxesContainer[t.id]){if(this.boxesContainer[t.id].width!==e.width-2||this.boxesContainer[t.id].height!==e.height-2){this.boxesContainer[t.id].resize({x:0,y:0,width:e.width-2,height:e.height-2})}this.boxesContainer[t.id].moveTo(e.xmin+1,e.ymin+1,true)}else{var a=new u({internal:true,id:t.id,parent:this,outputDst:this.outputDst,outputX:e.xmin+1,outputY:e.ymin+1,outputWidth:e.width-2,outputHeight:e.height-2});t.id=a.id;this.boxesContainer[t.id]=a}}};s.prototype.computeDxDy=function(t,e,r,i,n){if(n||e.dx_===undefined){if(t.width!==undefined){e.dx_=Math.max(0,Math.min(r.dx_,t.width-1))}else if(t.widthPercent!==undefined){e.dx_=Math.max(0,Math.min(r.dx_,r.dx_*t.widthPercent/100))}else if(!n){e.dx_=Math.max(0,i.remainingDx/(i.autoDxCount||1))}}if(n||e.dy_===undefined){if(t.height!==undefined){e.dy_=Math.max(0,Math.min(r.dy_,t.height-1))}else if(t.heightPercent!==undefined){e.dy_=Math.max(0,Math.min(r.dy_,r.dy_*t.heightPercent/100))}else if(!n){e.dy_=Math.max(0,i.remainingDy/(i.autoDyCount||1))}}};s.prototype.round=function(t){t.xmin=Math.round(t.xmin_);t.xmax=Math.round(t.xmax_);t.ymin=Math.round(t.ymin_);t.ymax=Math.round(t.ymax_);t.dx=t.xmax-t.xmin;t.dy=t.ymax-t.ymin;t.width=t.dx+1;t.height=t.dy+1};s.prototype.preDrawSelf=function(){var t,e={};this.outputDst.put({x:this.computed.xmin,y:this.computed.ymin},this.boxChars.topLeft+this.boxChars.horizontal.repeat(this.computed.dx-1)+this.boxChars.topRight);this.outputDst.put({x:this.computed.xmin,y:this.computed.ymax},this.boxChars.bottomLeft+this.boxChars.horizontal.repeat(this.computed.dx-1)+this.boxChars.bottomRight);for(t=this.computed.ymin+1;t<this.computed.ymax;t++){this.outputDst.put({x:this.computed.xmin,y:t},this.boxChars.vertical);this.outputDst.put({x:this.computed.xmax,y:t},this.boxChars.vertical)}this.drawRecursive(this.computed,e)};s.prototype.drawRecursive=function(t,e){var r;if(t.columns.length){for(r=0;r<t.columns.length;r++){this.drawColumn(t.columns[r],e,r===t.columns.length-1)}}else if(t.rows.length){for(r=0;r<t.rows.length;r++){this.drawRow(t.rows[r],e,r===t.rows.length-1)}}};s.prototype.drawColumn=function(t,e,r){var i;if(!r){this.drawTee(t.xmax,t.ymin,"top",e);this.drawTee(t.xmax,t.ymax,"bottom",e);for(i=t.ymin+1;i<t.ymax;i++){this.outputDst.put({x:t.xmax,y:i},this.boxChars.vertical)}}this.drawRecursive(t,e)};s.prototype.drawTee=function(t,e,r,i){var n=t+":"+e;if(!i[n]){this.outputDst.put({x:t,y:e},this.boxChars[r+"Tee"]);i[n]=r}else if(i[n]!==r){this.outputDst.put({x:t,y:e},this.boxChars.cross)}};s.prototype.drawRow=function(t,e,r){if(!r){this.drawTee(t.xmin,t.ymax,"left",e);this.drawTee(t.xmax,t.ymax,"right",e);this.outputDst.put({x:t.xmin+1,y:t.ymax},this.boxChars.horizontal.repeat(t.dx-1))}this.drawRecursive(t,e)};s.prototype.onParentResize=function(){this.computeBoundingBoxes()}},{"../spChars.js":48,"./Container.js":19,"./Element.js":23}],28:[function(t,e,r){"use strict";const l=t("./Element.js");const i=t("./BaseMenu.js");const d=t("./Button.js");const p=t("./ToggleButton.js");const n=t("../misc.js");const s=t("string-kit");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.outputWidth&&!t.width){t.outputWidth=Math.min(t.parent.inputWidth,t.parent.outputWidth)}this.buttonPaddingWidth=0;this.buttonSymbolWidth=0;this.pageItemsDef=[];i.call(this,t);this.justify=!!t.justify;this.separator=t.separator||t.buttonSeparator||" ";this.separatorHasMarkup=!!(t.separatorHasMarkup||t.buttonSeparatorHasMarkup);this.separatorAttr=Object.assign({},this.backgroundAttr,t.separatorAttr||t.buttonSeparatorAttr);this.separatorWidth=0;this.initChildren();if(this.elementType==="RowMenu"&&!t.noDraw){this.draw()}}e.exports=o;o.prototype=Object.create(i.prototype);o.prototype.constructor=o;o.prototype.elementType="RowMenu";o.prototype.inlineNewLine=true;o.prototype.ButtonClass=d;o.prototype.defaultOptions={buttonBlurAttr:{bgColor:"white",color:"black"},buttonFocusAttr:{bgColor:"green",color:"blue",dim:true},buttonDisabledAttr:{bgColor:"white",color:"brightBlack"},buttonSubmittedAttr:{bgColor:"brightWhite",color:"brightBlack"}};o.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("focus",this.onFocus);l.prototype.destroy.call(this,t,e)};o.prototype.keyBindings={LEFT:"previous",RIGHT:"next",PAGE_UP:"previousPage",PAGE_DOWN:"nextPage",HOME:"firstPage",END:"lastPage",ALT_ENTER:"submit"};o.prototype.buttonKeyBindings={ENTER:"submit",KP_ENTER:"submit"};o.prototype.toggleButtonKeyBindings={ENTER:"toggle",KP_ENTER:"toggle"};o.prototype.initChildren=function(t=false){if(!this.itemsDef.length){return}this.buttonPaddingWidth=Math.max(l.computeContentWidth(this.blurLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.focusLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.disabledLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.submittedLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOnFocusLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOffFocusLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOnBlurLeftPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOffBlurLeftPadding,this.paddingHasMarkup))+Math.max(l.computeContentWidth(this.blurRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.focusRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.disabledRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.submittedRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOnFocusRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOffFocusRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOnBlurRightPadding,this.paddingHasMarkup),l.computeContentWidth(this.turnedOffBlurRightPadding,this.paddingHasMarkup));if(this.buttonPaddingWidth>this.outputWidth){return}var s=l.computeContentWidth(this.contentEllipsis,false);this.separatorWidth=l.computeContentWidth(this.separator,this.separatorHasMarkup);this.previousPageDef=Object.assign({content:"◀",internalRole:"previousPage"},this.previousPageDef);this.previousPageDef.contentHasMarkup=this.previousPageDef.contentHasMarkup||this.previousPageDef.markup;this.previousPageDef.width=this.buttonPaddingWidth+l.computeContentWidth(this.previousPageDef.content,this.previousPageDef.contentHasMarkup);this.previousPageDef.buttonContent=this.previousPageDef.content;this.nextPageDef=Object.assign({content:"▶",internalRole:"nextPage"},this.nextPageDef);this.nextPageDef.contentHasMarkup=this.nextPageDef.contentHasMarkup||this.nextPageDef.markup;this.nextPageDef.width=this.buttonPaddingWidth+l.computeContentWidth(this.nextPageDef.content,this.nextPageDef.contentHasMarkup);this.nextPageDef.buttonContent=this.nextPageDef.content;var o=0,a=0,u=0;this.itemsDef.forEach((t,e)=>{t.buttonContent=t.content;t.contentHasMarkup=t.contentHasMarkup||t.markup;var r=l.computeContentWidth(t.content,t.contentHasMarkup),i=e===this.itemsDef.length-1;t.width=r+this.buttonPaddingWidth+this.buttonSymbolWidth;var n=a+t.width+(u?this.separatorWidth:0)+(i?0:this.nextPageDef.width+this.separatorWidth)-this.outputWidth;if(n>0){if(u){o++;u=0;a=this.previousPageDef.width+this.separatorWidth;n=a+t.width+(i?0:this.nextPageDef.width+this.separatorWidth)-this.outputWidth}if(n>0){t.buttonContent=l.truncateContent(t.content,r-n-s,t.contentHasMarkup)+this.contentEllipsis;r=l.computeContentWidth(t.buttonContent,t.contentHasMarkup)}}t.page=o;a+=t.width+(u?this.separatorWidth:0);u++;if(!this.pageItemsDef[o]){this.pageItemsDef[o]=[]}this.pageItemsDef[o].push(t)});this.maxPage=o;if(!this.pageItemsDef.length){this.pageItemsDef.push([])}this.pageItemsDef.forEach((t,e)=>{if(e){t.unshift(this.previousPageDef)}if(e<this.pageItemsDef.length-1){t.push(this.nextPageDef)}t.buttonsWidth=t.reduce((t,e)=>t+e.width,0);t.buttonsAndSeparatorsWidth=t.buttonsWidth+(t.length-1)*this.separatorWidth;t.justifyWidth=Math.max(0,this.justify?(this.outputWidth-t.buttonsAndSeparatorsWidth)/(t.length-1):0)});if(this.elementType==="RowMenu"&&!t){this.initPage()}};o.prototype.initPage=function(t=this.page){var l=this.pageItemsDef[t],f=0,h=0,c=0;if(!l){return}this.buttons.forEach(t=>t.destroy(false,true));this.buttons.length=0;l.forEach((t,e)=>{var r,i,n,s,o;r=t.internalRole?d:this.ButtonClass;i=r===p||r.prototype instanceof p;n=t.key;s=this.childUseParentKeyValue&&n&&this.value&&typeof this.value==="object"?this.value[n]:t.value;if(e%2){o=t.blurAttr||this.buttonBlurAttr}else{o=t.evenBlurAttr||t.blurAttr||this.buttonEvenBlurAttr||this.buttonBlurAttr}this.buttons[e]=new r({internal:true,parent:this,childId:e,internalRole:t.internalRole,content:t.buttonContent,contentHasMarkup:t.contentHasMarkup,disabled:t.disabled,def:t,key:n,value:s,outputX:this.outputX+h,outputY:this.outputY+c,blurAttr:o,focusAttr:t.focusAttr||this.buttonFocusAttr,disabledAttr:t.disabledAttr||this.buttonDisabledAttr,submittedAttr:t.submittedAttr||this.buttonSubmittedAttr,turnedOnFocusAttr:t.turnedOnFocusAttr||this.turnedOnFocusAttr,turnedOffFocusAttr:t.turnedOffFocusAttr||this.turnedOffFocusAttr,turnedOnBlurAttr:t.turnedOnBlurAttr||this.turnedOnBlurAttr,turnedOffBlurAttr:t.turnedOffBlurAttr||this.turnedOffBlurAttr,blurLeftPadding:this.blurLeftPadding,blurRightPadding:this.blurRightPadding,focusLeftPadding:this.focusLeftPadding,focusRightPadding:this.focusRightPadding,disabledLeftPadding:this.disabledLeftPadding,disabledRightPadding:this.disabledRightPadding,submittedLeftPadding:this.submittedLeftPadding,submittedRightPadding:this.submittedRightPadding,turnedOnFocusLeftPadding:this.turnedOnFocusLeftPadding,turnedOnFocusRightPadding:this.turnedOnFocusRightPadding,turnedOffFocusLeftPadding:this.turnedOffFocusLeftPadding,turnedOffFocusRightPadding:this.turnedOffFocusRightPadding,turnedOnBlurLeftPadding:this.turnedOnBlurLeftPadding,turnedOnBlurRightPadding:this.turnedOnBlurRightPadding,turnedOffBlurLeftPadding:this.turnedOffBlurLeftPadding,turnedOffBlurRightPadding:this.turnedOffBlurRightPadding,paddingHasMarkup:this.paddingHasMarkup,keyBindings:i?this.toggleButtonKeyBindings:this.buttonKeyBindings,actionKeyBindings:i?this.toggleButtonActionKeyBindings:this.buttonActionKeyBindings,shortcuts:t.shortcuts,noDraw:true});this.buttons[e].on("submit",this.onButtonSubmit);this.buttons[e].on("focus",this.onButtonFocus);this.buttons[e].on("blinked",this.onButtonBlinked);if(i){this.buttons[e].on("toggle",this.onButtonToggle)}var a=l.justifyWidth+f;var u=Math.round(a);f=a-u;h+=this.buttons[e].outputWidth+this.separatorWidth+u})};o.prototype.preDrawSelf=function(){this.outputDst.put({x:this.outputX,y:this.outputY,attr:this.backgroundAttr}," ".repeat(this.outputWidth));if(this.separator){let t,e,r;for(t=0;t<this.buttons.length-1;t++){e=this.buttons[t];r=this.buttons[t+1];this.outputDst.put({x:Math.round(e.outputX+e.outputWidth+r.outputX)/2,y:this.outputY,attr:this.separatorAttr},this.separator)}}}},{"../misc.js":42,"./BaseMenu.js":15,"./Button.js":16,"./Element.js":23,"./ToggleButton.js":35,"string-kit":123}],29:[function(t,e,r){"use strict";const s=t("./Element.js");const i=t("./BaseMenu.js");const n=t("./ColumnMenu.js");const o=t("./Button.js");function a(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.master||typeof t.master!=="object"){t.master=Object.assign({},this.defaultOptions.master)}else{t.master=Object.assign({},this.defaultOptions.master,t.master)}if(t.content){t.master.content=t.content}if(!t.separator||typeof t.separator!=="object"){t.separator=Object.assign({},this.defaultOptions.separator)}else{t.separator=Object.assign({},this.defaultOptions.separator,t.separator)}n.call(this,t);this.showMenu=false;this.zIndexRef=this.zIndex;if(t.value!==undefined&&this.setValue(t.value,true)){this.toggle(this.showMenu,t.noDraw)}else{this.initPage();this.toggle(this.showMenu,t.noDraw)}this.onClickOut=this.onClickOut.bind(this);this.on("clickOut",this.onClickOut);if(this.elementType==="SelectList"&&!t.noDraw){this.draw()}}e.exports=a;a.prototype=Object.create(n.prototype);a.prototype.constructor=a;a.prototype.elementType="SelectList";a.prototype.defaultOptions={buttonBlurAttr:{bgColor:"gray",color:"white",bold:true},buttonFocusAttr:{bgColor:"white",color:"black",bold:true},buttonDisabledAttr:{bgColor:"gray",color:"white",bold:true,dim:true},buttonSubmittedAttr:{bgColor:"gray",color:"brightWhite",bold:true},turnedOnBlurAttr:{bgColor:"cyan"},turnedOnFocusAttr:{bgColor:"brightCyan",bold:true},turnedOffBlurAttr:{bgColor:"gray",dim:true},turnedOffFocusAttr:{bgColor:"white",color:"black",bold:true},master:{content:"select-list",symbol:"▼",internalRole:"toggle"},separator:{content:"-",contentRepeat:true,internalRole:"separator"}};a.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("clickOut",this.onClickOut);n.prototype.destroy.call(this,t,e)};a.prototype.toggle=function(t=null,e=false){var r,i;if(t===null){this.showMenu=!this.showMenu}else{this.showMenu=!!t}for(r=1,i=this.buttons.length;r<i;r++){this.buttons[r].hidden=!this.showMenu}this.outputHeight=this.showMenu?this.pageHeight:1;if(this.showMenu){this.topZ()}else{this.restoreZ()}if(e){return}if(t){for(r=1,i=this.buttons.length;r<i;r++){if(this.buttons[r].value===this.value){this.document.giveFocusTo(this.buttons[r]);break}}}else{this.document.giveFocusTo(this.buttons[0])}this.redraw()};a.prototype.select=function(t,e){var r,i=1+this.buttonSymbolWidth,n=t.content;if(Array.isArray(n)){n=n[0]||""}r=s.computeContentWidth(n,t.contentHasMarkup)+this.buttonPaddingWidth+this.buttonSymbolWidth;if(r>this.buttonsMaxWidth){this.masterDef.buttonContent=s.truncateContent(n,this.buttonsMaxWidth-this.buttonSymbolWidth,t.contentHasMarkup)+" "+this.masterDef.symbol}else if(r<this.buttonsMaxWidth){this.masterDef.buttonContent=n+" ".repeat(this.buttonsMaxWidth-r)+" "+this.masterDef.symbol}else{this.masterDef.buttonContent=n+" "+this.masterDef.symbol}this.masterDef.contentHasMarkup=t.contentHasMarkup;this.masterDef.width=this.buttonsMaxWidth;this.value=this.masterDef.value=t.value;if(t.page!==undefined){this.page=t.page}this.initPage();if(e){return}this.toggle(false)};a.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;case"toggle":this.toggle();break;default:this.select(r);this.emit("submit",t,e,this)}};a.prototype.setValue=function(e,t){var r=this.itemsDef.find(t=>t.value===e);if(!r){return false}this.select(r,t);return true};a.prototype.onClickOut=function(){this.toggle(false)};a.prototype.getValue=function(){return this.value}},{"./BaseMenu.js":15,"./Button.js":16,"./ColumnMenu.js":17,"./Element.js":23}],30:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./BaseMenu.js");const s=t("./ColumnMenuMulti.js");const o=t("./Button.js");function a(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(!t.master||typeof t.master!=="object"){t.master=Object.assign({},this.defaultOptions.master)}else{t.master=Object.assign({},this.defaultOptions.master,t.master)}if(t.content){t.master.content=t.content}if(!t.separator||typeof t.separator!=="object"){t.separator=Object.assign({},this.defaultOptions.separator)}else{t.separator=Object.assign({},this.defaultOptions.separator,t.separator)}s.call(this,t);this.showMenu=false;this.zIndexRef=this.zIndex;this.initPage();this.toggle(this.showMenu,t.noDraw);this.onClickOut=this.onClickOut.bind(this);this.on("clickOut",this.onClickOut);if(this.elementType==="SelectListMulti"&&!t.noDraw){this.draw()}}e.exports=a;a.prototype=Object.create(s.prototype);a.prototype.constructor=a;a.prototype.elementType="SelectListMulti";a.prototype.defaultOptions={buttonBlurAttr:{bgColor:"gray",color:"white",bold:true},buttonFocusAttr:{bgColor:"white",color:"black",bold:true},buttonDisabledAttr:{bgColor:"gray",color:"white",bold:true,dim:true},buttonSubmittedAttr:{bgColor:"gray",color:"brightWhite",bold:true},turnedOnBlurAttr:{bgColor:"cyan"},turnedOnFocusAttr:{bgColor:"brightCyan",bold:true},turnedOffBlurAttr:{bgColor:"gray",dim:true},turnedOffFocusAttr:{bgColor:"white",color:"black",bold:true},master:{content:"select-list-multi",symbol:"▼",internalRole:"toggle"},separator:{content:"-",contentRepeat:true,internalRole:"separator"}};a.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("clickOut",this.onClickOut);s.prototype.destroy.call(this,t,e)};a.prototype.toggle=function(t=null,e=false){var r,i;if(t===null){this.showMenu=!this.showMenu}else{this.showMenu=!!t}for(r=1,i=this.buttons.length;r<i;r++){this.buttons[r].hidden=!this.showMenu}this.outputHeight=this.showMenu?this.pageHeight:1;if(this.showMenu){this.topZ()}else{this.restoreZ()}if(e){return}this.document.giveFocusTo(this.buttons[0]);this.redraw()};a.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"previousPage":this.previousPage();break;case"nextPage":this.nextPage();break;case"toggle":this.toggle();if(!this.showMenu){this.emit("submit",this.value,e,this)}break;default:this.emit("submit",this.value,e,this)}};a.prototype.onClickOut=function(){if(this.showMenu){this.toggle(false);this.emit("submit",this.value,undefined,this)}};a.prototype.getValue=function(){return this.value}},{"./BaseMenu.js":15,"./Button.js":16,"./ColumnMenuMulti.js":18,"./Element.js":23}],31:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Button.js");const s=t=>t;function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);this.onButtonSubmit=this.onButtonSubmit.bind(this);this.isVertical=!!t.isVertical;this.slideRate=0;this.handleOffset=0;this.rateToValue=typeof t.rateToValue==="function"?t.rateToValue:s;this.valueToRate=typeof t.valueToRate==="function"?t.valueToRate:s;this.buttonBlurAttr=t.buttonBlurAttr||{bgColor:"black",color:"white",bold:true};this.buttonFocusAttr=t.buttonFocusAttr||{bgColor:"white",color:"black",bold:true};this.buttonSubmittedAttr=t.buttonSubmittedAttr||{bgColor:"gray",color:"brightWhite",bold:true};this.backwardSymbol=t.backwardSymbol||(this.isVertical?"▲":"◀");this.forwardSymbol=t.forwardSymbol||(this.isVertical?"▼":"▶");this.handleAttr=t.handleAttr||{bgColor:"brightWhite",color:"black"};this.handleSymbol=t.handleSymbol||"◆";this.barAttr=t.barAttr||{bgColor:"gray",color:"brightWhite"};this.barSymbol=t.barSymbol||" ";this.backwardButton=this.forwardButton=null;this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.initChildren();if(this.elementType==="Slider"&&!t.noDraw){this.draw()}}e.exports=o;o.prototype=Object.create(i.prototype);o.prototype.constructor=o;o.prototype.elementType="Slider";o.prototype.needInput=true;o.prototype.keyBindings={UP:"backward",DOWN:"forward",LEFT:"backward",RIGHT:"forward",PAGE_UP:"backward",PAGE_DOWN:"forward"," ":"forward",HOME:"start",END:"end"};o.prototype.buttonKeyBindings={ENTER:"submit",KP_ENTER:"submit"};o.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("click",this.onClick);this.off("drag",this.onDrag);this.off("wheel",this.onWheel);i.prototype.destroy.call(this,t,e)};o.prototype.initChildren=function(){this.backwardButton=new n({internal:true,parent:this,internalRole:"backward",content:this.backwardSymbol,outputX:this.outputX,outputY:this.outputY,blurAttr:this.buttonBlurAttr,focusAttr:this.buttonFocusAttr,submittedAttr:this.buttonSubmittedAttr,keyBindings:this.buttonKeyBindings,noDraw:true});this.backwardButton.on("submit",this.onButtonSubmit);this.forwardButton=new n({internal:true,parent:this,internalRole:"forward",content:this.forwardSymbol,outputX:this.isVertical?this.outputX:this.outputX+this.outputWidth-1,outputY:this.isVertical?this.outputY+this.outputHeight-1:this.outputY,blurAttr:this.buttonBlurAttr,focusAttr:this.buttonFocusAttr,submittedAttr:this.buttonSubmittedAttr,keyBindings:this.buttonKeyBindings,noDraw:true});this.forwardButton.on("submit",this.onButtonSubmit);this.computeHandleOffset()};o.prototype.setSizeAndPosition=function(t){this.outputX=t.outputX!==undefined?t.outputX:t.x!==undefined?t.x:this.outputX||0;this.outputY=t.outputY!==undefined?t.outputY:t.y!==undefined?t.y:this.outputY||0;this.outputWidth=t.outputWidth!==undefined?t.outputWidth:t.width!==undefined?t.width:this.outputWidth||1;this.outputHeight=t.outputHeight!==undefined?t.outputHeight:t.height!==undefined?t.height:this.outputHeight||1;this.backwardButton.outputX=this.outputX;this.backwardButton.outputY=this.outputY;this.forwardButton.outputX=this.isVertical?this.outputX:this.outputX+this.outputWidth-1;this.forwardButton.outputY=this.isVertical?this.outputY+this.outputHeight-1:this.outputY};o.prototype.preDrawSelf=function(){return this.isVertical?this.preDrawSelfVertical():this.preDrawSelfHorizontal()};o.prototype.preDrawSelfVertical=function(){var t=0,e=this.outputY+1,r=this.outputY+this.outputHeight-2;for(;e<=r;e++,t++){if(t===this.handleOffset){this.outputDst.put({x:this.outputX,y:e,attr:this.handleAttr},this.handleSymbol)}else{this.outputDst.put({x:this.outputX,y:e,attr:this.barAttr},this.barSymbol)}}};o.prototype.preDrawSelfHorizontal=function(){var t=0,e=this.outputX+1,r=this.outputX+this.outputWidth-2;for(;e<=r;e++,t++){if(t===this.handleOffset){this.outputDst.put({x:e,y:this.outputY,attr:this.handleAttr},this.handleSymbol)}else{this.outputDst.put({x:e,y:this.outputY,attr:this.barAttr},this.barSymbol)}}};o.prototype.postDrawSelf=function(){if(this.isVertical){this.outputDst.moveTo(this.outputX,this.outputY+this.handleOffset+1)}else{this.outputDst.moveTo(this.outputX+this.handleOffset+1,this.outputY)}};o.prototype.computeHandleOffset=function(){var t=(this.isVertical?this.outputHeight:this.outputWidth)-3;this.handleOffset=Math.round(t*this.slideRate)};o.prototype.setHandleOffset=function(t,e=false){var r=(this.isVertical?this.outputHeight:this.outputWidth)-3;this.handleOffset=Math.max(0,Math.min(r,Math.round(t||0)));this.slideRate=Math.max(0,Math.min(1,this.handleOffset/r||0));if(!e){this.emit("slide",this.getValue());this.draw()}};o.prototype.setSlideRate=function(t,e=false){this.slideRate=Math.max(0,Math.min(1,t||0));this.computeHandleOffset();if(!e){this.emit("slide",this.getValue());this.draw()}};o.prototype.getHandleOffset=function(){return this.handleOffset};o.prototype.getSlideRate=function(){return this.slideRate};o.prototype.onButtonSubmit=function(t,e,r){switch(r.internalRole){case"backward":this.emit("slideStep",-1);break;case"forward":this.emit("slideStep",1);break}};o.prototype.getValue=function(){return this.rateToValue(this.slideRate)};o.prototype.setValue=function(t,e){return this.setSlideRate(this.valueToRate(t),e)};o.prototype.onClick=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}this.setHandleOffset((this.isVertical?t.y:t.x)-1)};o.prototype.onDrag=function(t){this.setHandleOffset((this.isVertical?t.y:t.x)-1)};o.prototype.onWheel=function(t){this.emit("slideStep",t.yDirection)}},{"./Button.js":16,"./Element.js":23}],32:[function(t,e,r){"use strict";const i=t("./Element.js");function n(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;this.attr=t.attr||{bgColor:"brightBlack"};this.leftPadding=t.leftPadding||"";this.rightPadding=t.rightPadding||"";if(!Array.isArray(t.content)){t.content=[t.content||""]}this.content=t.content;this.contentHasMarkup=t.contentHasMarkup;if(!t.width){t.width=this.computeRequiredWidth()}t.height=this.computeRequiredHeight();i.call(this,t);if(this.elementType==="Text"&&!t.noDraw){this.draw()}}e.exports=n;n.prototype=Object.create(i.prototype);n.prototype.constructor=n;n.prototype.elementType="Text";n.prototype.forceContentArray=true;n.prototype.computeRequiredWidth=function(){return i.computeContentWidth(this.leftPadding,this.paddingHasMarkup)+i.computeContentWidth(this.rightPadding,this.paddingHasMarkup)+(this.animation?Math.max(...this.animation.map(t=>i.computeContentWidth(t,this.contentHasMarkup))):i.computeContentWidth(this.content,this.contentHasMarkup)||1)};n.prototype.computeRequiredHeight=function(){return this.animation?Math.max(...this.animation.map(t=>t.length)):this.content.length};n.prototype.resizeOnContent=function(){this.width=this.computeRequiredWidth(this.content,this.contentHasMarkup);this.height=this.computeRequiredHeight(this.content,this.contentHasMarkup)};n.prototype.postDrawSelf=function(){if(!this.outputDst){return this}var t,e,r,i;for(r=0;r<this.outputHeight;r++){i=this.content[r]||"";this.outputDst.cx=this.outputX;this.outputDst.cy=this.outputY+r;if(this.leftPadding){this.outputDst.put({attr:this.attr,markup:this.paddingHasMarkup},this.leftPadding)}e=this.outputDst.put({attr:this.attr,resumeAttr:e,markup:this.contentHasMarkup},i);if(this.rightPadding){this.outputDst.put({attr:this.attr,markup:this.paddingHasMarkup},this.rightPadding)}if(this.outputDst.cx<this.outputDst.width-1){t=this.outputX+this.outputWidth-this.outputDst.cx;if(t>0){this.outputDst.put({attr:this.attr}," ".repeat(t))}}}}},{"./Element.js":23}],33:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Slider.js");const s=t("../ScreenBuffer.js");const o=t("../TextBuffer.js");const a=t("../Rect.js");const u=t("string-kit");function l(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.onKey=this.onKey.bind(this);this.onClick=this.onClick.bind(this);this.onDrag=this.onDrag.bind(this);this.onWheel=this.onWheel.bind(this);this.onParentResize=this.onParentResize.bind(this);if(t.keyBindings){this.keyBindings=t.keyBindings}this.textAttr=t.textAttr||t.attr||{bgColor:"default"};this.altTextAttr=t.altTextAttr||Object.assign({},this.textAttr,{color:"gray",italic:true});this.voidAttr=t.voidAttr||t.emptyAttr||t.attr||{bgColor:"default"};this.scrollable=!!t.scrollable;this.hasVScrollBar=this.scrollable&&!!t.vScrollBar;this.hasHScrollBar=this.scrollable&&!!t.hScrollBar;this.scrollX=t.scrollX||0;this.scrollY=t.scrollY||0;this.extraScrolling=!!t.extraScrolling;this.firstLineRightShift=t.firstLineRightShift||0;this.wordWrap=!!(t.wordWrap||t.wordwrap);this.lineWrap=!!(t.lineWrap||this.wordWrap);this.hiddenContent=t.hiddenContent;this.stateMachine=t.stateMachine;this.textAreaWidth=this.hasVScrollBar?this.outputWidth-1:this.outputWidth;this.textAreaHeight=this.hasHScrollBar?this.outputHeight-1:this.outputHeight;this.textBuffer=null;this.altTextBuffer=null;this.vScrollBarSlider=null;this.hScrollBarSlider=null;this.on("key",this.onKey);this.on("click",this.onClick);this.on("drag",this.onDrag);this.on("wheel",this.onWheel);this.on("parentResize",this.onParentResize);this.initChildren();if(this.setContent===l.prototype.setContent){this.setContent(t.content,t.contentHasMarkup,true)}if(this.elementType==="TextBox"&&!t.noDraw){this.draw()}}e.exports=l;l.prototype=Object.create(i.prototype);l.prototype.constructor=l;l.prototype.elementType="TextBox";l.prototype.strictInlineSupport=true;l.prototype.destroy=function(t,e=false){if(this.destroyed){return}this.off("key",this.onKey);this.off("click",this.onClick);this.off("drag",this.onDrag);this.off("wheel",this.onWheel);this.off("parentResize",this.onParentResize);i.prototype.destroy.call(this,t,e)};l.prototype.keyBindings={UP:"tinyScrollUp",DOWN:"tinyScrollDown",PAGE_UP:"scrollUp",PAGE_DOWN:"scrollDown"," ":"scrollDown",HOME:"scrollTop",END:"scrollBottom",LEFT:"scrollLeft",RIGHT:"scrollRight",CTRL_O:"copyClipboard"};l.prototype.initChildren=function(){this.textBuffer=new o({dst:this.outputDst,x:this.outputX,y:this.outputY,firstLineRightShift:this.firstLineRightShift,lineWrapWidth:this.lineWrap?this.textAreaWidth:null,wordWrap:this.wordWrap,dstClipRect:{x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight},hidden:this.hiddenContent,forceInBound:true,stateMachine:this.stateMachine});this.setAttr(undefined,undefined,true);if(this.useAltTextBuffer){this.altTextBuffer=new o({firstLineRightShift:this.firstLineRightShift,lineWrapWidth:this.lineWrap?this.textAreaWidth:null,wordWrap:this.wordWrap,dstClipRect:{x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight}});this.setAltAttr();this.textBuffer.setVoidTextBuffer(this.altTextBuffer)}if(this.hasVScrollBar){this.vScrollBarSlider=new n({internal:true,parent:this,x:this.outputX+this.outputWidth-1,y:this.outputY,height:this.outputHeight,isVertical:true,valueToRate:t=>-t/Math.max(1,this.textBuffer.buffer.length-this.textAreaHeight),rateToValue:t=>-t*Math.max(1,this.textBuffer.buffer.length-this.textAreaHeight),noDraw:true});this.vScrollBarSlider.on("slideStep",t=>this.scroll(0,-t*Math.ceil(this.textAreaHeight/2)));this.vScrollBarSlider.on("slide",t=>this.scrollTo(null,t))}if(this.hasHScrollBar){this.hScrollBarSlider=new n({internal:true,parent:this,x:this.outputX,y:this.outputY+this.outputHeight-1,width:this.outputWidth-this.hasVScrollBar,valueToRate:t=>{var e=this.textBuffer.getContentSize().width;return-t/Math.max(1,e-this.textAreaWidth)},rateToValue:t=>{var e=this.textBuffer.getContentSize().width;return-t*Math.max(1,e-this.textAreaWidth)},noDraw:true});this.hScrollBarSlider.on("slideStep",t=>this.scroll(-t*Math.ceil(this.textAreaWidth/2),0));this.hScrollBarSlider.on("slide",t=>this.scrollTo(t,null))}};l.prototype.setSizeAndPosition=function(t){this.outputX=t.outputX!==undefined?t.outputX:t.x!==undefined?t.x:this.outputX||0;this.outputY=t.outputY!==undefined?t.outputY:t.y!==undefined?t.y:this.outputY||0;this.outputWidth=t.outputWidth!==undefined?t.outputWidth:t.width!==undefined?t.width:this.outputWidth||1;this.outputHeight=t.outputHeight!==undefined?t.outputHeight:t.height!==undefined?t.height:this.outputHeight||1;this.textAreaWidth=this.hasVScrollBar?this.outputWidth-1:this.outputWidth;this.textAreaHeight=this.hasHScrollBar?this.outputHeight-1:this.outputHeight;this.textBuffer.lineWrapWidth=this.lineWrap?this.textAreaWidth:null;if(this.altTextBuffer){this.altTextBuffer.lineWrapWidth=this.lineWrap?this.textAreaWidth:null}this.textBuffer.x=this.outputX;this.textBuffer.y=this.outputY;this.textBuffer.dstClipRect=new a({x:this.outputX,y:this.outputY,width:this.textAreaWidth,height:this.textAreaHeight});if(this.lineWrap){this.textBuffer.wrapAllLines();if(this.altTextBuffer){this.altTextBuffer.wrapAllLines()}}if(this.vScrollBarSlider){this.vScrollBarSlider.setSizeAndPosition({outputX:this.outputX+this.outputWidth-1,outputY:this.outputY,outputHeight:this.outputHeight})}if(this.hScrollBarSlider){this.hScrollBarSlider.setSizeAndPosition({outputX:this.outputX,outputY:this.outputY+this.outputHeight-1,outputWidth:this.hasVScrollBar?this.outputWidth-1:this.outputWidth})}};l.prototype.preDrawSelf=function(){this.textBuffer.draw({dst:this.outputDst})};l.prototype.scroll=function(t,e,r=false){return this.scrollTo(t?this.scrollX+t:null,e?this.scrollY+e:null,r)};l.prototype.scrollToTop=function(t=false){return this.scrollTo(null,0,t)};l.prototype.scrollToBottom=function(t=false){return this.scrollTo(null,this.textAreaHeight-this.textBuffer.buffer.length,t)};l.prototype.scrollTo=function(t,e,r=false){if(!this.scrollable){return}if(t!==undefined&&t!==null){this.scrollX=Math.min(0,Math.max(Math.round(t),(this.extraScrolling?1:this.textAreaWidth)-this.textBuffer.getContentSize().width+1));this.textBuffer.x=this.outputX+this.scrollX}if(e!==undefined&&e!==null){this.scrollY=Math.min(0,Math.max(Math.round(e),(this.extraScrolling?1:this.textAreaHeight)-this.textBuffer.buffer.length));this.textBuffer.y=this.outputY+this.scrollY}if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true)}if(this.hScrollBarSlider){this.hScrollBarSlider.setValue(this.scrollX,true)}if(!r){this.draw()}};l.prototype.autoScrollAndDraw=function(t=false){var e,r;if(this.textBuffer.cx-1<-this.scrollX&&this.scrollX!==0){e=-Math.max(0,this.textBuffer.cx-1)}else if(this.textBuffer.cx>this.textAreaWidth-this.scrollX-1){e=this.textAreaWidth-1-this.textBuffer.cx}if(this.textBuffer.cy<-this.scrollY){r=-this.textBuffer.cy}else if(this.textBuffer.cy>this.textAreaHeight-this.scrollY-1){r=this.textAreaHeight-1-this.textBuffer.cy}if(e!==undefined||r!==undefined){this.scrollTo(e,r)}else if(!t){this.draw()}else{this.drawCursor()}};l.prototype.autoScrollAndDrawCursor=function(){return this.autoScrollAndDraw(true)};l.prototype.setAttr=function(t=this.textAttr,e=this.voidAttr,r=false,i=false){this.textAttr=t;this.voidAttr=e;this.textBuffer.setDefaultAttr(this.textAttr);this.textBuffer.setVoidAttr(this.voidAttr);if(!i){this.setContent(this.content,this.contentHasMarkup,r)}};l.prototype.setAltAttr=function(t=this.altTextAttr){this.altTextAttr=t;this.altTextBuffer.setDefaultAttr(this.altTextAttr);this.altTextBuffer.setVoidAttr(this.voidAttr)};l.prototype.getContentSize=function(){return this.textBuffer.getContentSize()};l.prototype.getContent=function(){return this.textBuffer.getText()};l.prototype.setContent=function(t,e,r){var i;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}this.content=t;this.contentHasMarkup=e;this.textBuffer.setText(this.content,this.contentHasMarkup,this.textAttr);if(this.stateMachine){this.textBuffer.runStateMachine()}this.textBuffer.moveToEndOfBuffer();if(!r){this.drawCursor();this.redraw()}};l.prototype.getAltContent=function(){if(!this.altTextBuffer){return null}return this.altTextBuffer.getText()};l.prototype.setAltContent=function(t,e,r){if(!this.altTextBuffer){return}var i;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}this.altTextBuffer.setText(t,e,this.altTextAttr);if(!r){this.drawCursor();this.redraw()}};l.prototype.prependContent=function(t,e){return this.addContent(t,"prepend",e)};l.prototype.appendContent=function(t,e){return this.addContent(t,"append",e)};l.prototype.appendLog=function(t,e){return this.addContent(t,"appendLog",e)};l.prototype.addContent=function(t,e,r){var i,n=false;if(typeof t!=="string"){if(t===null||t===undefined){t=""}else{t=""+t}}switch(e){case"prepend":this.content=t+this.content;this.textBuffer.prepend(t,this.contentHasMarkup,this.textAttr);break;case"appendLog":n=this.textBuffer.buffer.length<=this.textAreaHeight||this.scrollY<=this.textAreaHeight-this.textBuffer.buffer.length;t="\n"+t;this.content+=t;this.textBuffer.append(t,this.contentHasMarkup,this.textAttr);break;case"append":default:this.content+=t;this.textBuffer.append(t,this.contentHasMarkup,this.textAttr);break}if(this.stateMachine){this.textBuffer.runStateMachine()}this.textBuffer.moveToEndOfBuffer();if(n){this.scrollToBottom(r)}else if(!r){if(this.vScrollBarSlider){this.vScrollBarSlider.setValue(this.scrollY,true)}this.drawCursor();this.draw()}};l.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"tinyScrollUp":this.scroll(0,Math.ceil(this.textAreaHeight/5));break;case"tinyScrollDown":this.scroll(0,-Math.ceil(this.textAreaHeight/5));break;case"scrollUp":this.scroll(0,Math.ceil(this.textAreaHeight/2));break;case"scrollDown":this.scroll(0,-Math.ceil(this.textAreaHeight/2));break;case"scrollLeft":this.scroll(Math.ceil(this.textAreaWidth/2),0);break;case"scrollRight":this.scroll(-Math.ceil(this.textAreaWidth/2),0);break;case"scrollTop":this.scrollToTop();break;case"scrollBottom":this.scrollToBottom();break;case"copyClipboard":if(this.document){this.document.setClipboard(this.textBuffer.getSelectionText()).catch(()=>undefined)}break;default:return}return true};l.prototype.onClick=function(t){if(this.scrollable&&!this.hasFocus){this.document.giveFocusTo(this,"select")}};l.prototype.onWheel=function(t){if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(this.scrollable){this.scroll(0,-t.yDirection*Math.ceil(this.textAreaHeight/5))}};l.prototype.onDrag=function(t){var e,r,i,n;if(!this.hasFocus){this.document.giveFocusTo(this,"select")}if(t.yFrom<t.y||t.yFrom===t.y&&t.xFrom<=t.x){r=t.yFrom;n=t.y;e=t.xFrom;i=t.x}else{r=t.y;n=t.yFrom;e=t.x;i=t.xFrom}this.textBuffer.setSelectionRegion({xmin:e-this.scrollX,xmax:i-this.scrollX,ymin:r-this.scrollY,ymax:n-this.scrollY});if(this.document){this.document.setClipboard(this.textBuffer.getSelectionText(),"primary").catch(()=>undefined)}this.draw()};l.prototype.onParentResize=function(){if(!this.autoWidth&&!this.autoHeight){return}var t={};if(this.autoWidth){t.outputWidth=Math.round(this.outputDst.width*this.autoWidth)}if(this.autoHeight){t.outputHeight=Math.round(this.outputDst.height*this.autoHeight)}this.setSizeAndPosition(t);this.draw()}},{"../Rect.js":2,"../ScreenBuffer.js":3,"../TextBuffer.js":6,"./Element.js":23,"./Slider.js":31,"string-kit":123}],34:[function(t,e,r){"use strict";const i=t("./Element.js");const o=t("./TextBox.js");const n=t("../spChars.js").box;function s(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;i.call(this,t);this.cellContents=t.cellContents;this.contentHasMarkup=t.contentHasMarkup;this.textBoxes=null;this.rowCount=0;this.columnCount=0;this.rowHeights=[];this.columnWidths=[];this.textAttr=t.textAttr||{bgColor:"default"};this.voidAttr=t.voidAttr||t.emptyAttr||null;this.firstRowTextAttr=t.firstRowTextAttr||null;this.firstRowVoidAttr=t.firstRowVoidAttr||null;this.evenRowTextAttr=t.evenRowTextAttr||null;this.evenRowVoidAttr=t.evenRowVoidAttr||null;this.firstColumnTextAttr=t.firstColumnTextAttr||null;this.firstColumnVoidAttr=t.firstColumnVoidAttr||null;this.evenColumnTextAttr=t.evenColumnTextAttr||null;this.evenColumnVoidAttr=t.evenColumnVoidAttr||null;this.firstCellTextAttr=t.firstCellTextAttr||null;this.firstCellVoidAttr=t.firstCellVoidAttr||null;this.evenCellTextAttr=t.evenCellTextAttr||null;this.evenCellVoidAttr=t.evenCellVoidAttr||null;this.checkerEvenCellTextAttr=t.checkerEvenCellTextAttr||null;this.checkerEvenCellVoidAttr=t.checkerEvenCellVoidAttr||null;this.expandToWidth=t.expandToWidth!==undefined?!!t.expandToWidth:!!t.fit;this.shrinkToWidth=t.shrinkToWidth!==undefined?!!t.shrinkToWidth:!!t.fit;this.expandToHeight=t.expandToHeight!==undefined?!!t.expandToHeight:!t.height?false:!!t.fit;this.shrinkToHeight=t.shrinkToHeight!==undefined?!!t.shrinkToHeight:!t.height?false:!!t.fit;this.wordWrap=t.wordWrap!==undefined||t.wordwrap!==undefined?!!(t.wordWrap||t.wordwrap):!!t.fit;this.lineWrap=this.wordWrap||(t.lineWrap!==undefined?!!t.lineWrap:!!t.fit);this.hasBorder=t.hasBorder!==undefined?!!t.hasBorder:true;this.borderAttr=t.borderAttr||this.textAttr;this.borderChars=n.light;if(typeof t.borderChars==="object"){this.borderChars=n.__fix__(t.borderChars)}else if(typeof t.borderChars==="string"&&n[t.borderChars]){this.borderChars=n[t.borderChars]}if(t.textBoxKeyBindings){this.textBoxKeyBindings=t.textBoxKeyBindings}this.initChildren();this.computeCells();if(this.elementType==="TextTable"&&!t.noDraw){this.draw()}}e.exports=s;s.prototype=Object.create(i.prototype);s.prototype.constructor=s;s.prototype.elementType="TextTable";s.prototype.strictInlineSupport=true;s.prototype.staticInline=true;s.prototype.inlineResizeToContent=true;s.prototype.textBoxKeyBindings=o.prototype.keyBindings;s.prototype.setCellContent=function(t,e,r,i=false,n=false){var s=this.textBoxes[e]&&this.textBoxes[e][t];if(!s){return}this.cellContents[e][t]=r;s.setContent(r,this.contentHasMarkup,true);if(!n){this.computeCells();if(!i){this.draw()}}else{if(!i){s.draw()}}};s.prototype.setCellAttr=function(t,e,r,i,n=false){var s=this.textBoxes[e]&&this.textBoxes[e][t];if(!s){return}if(i===undefined){i=r}s.setAttr(r,i,n)};s.prototype.resetCellAttr=function(t,e,r=false){var i=this.textBoxes[e]&&this.textBoxes[e][t];if(!i){return}var n=this.getTextAttrForCell(t,e),s=this.getVoidAttrForCell(t,e,n);i.setAttr(n,s,r)};s.prototype.setRowAttr=function(e,r,i,t=false){for(let t=0;t<this.columnCount;t++){this.setCellAttr(t,e,r,i,true)}if(!t){this.draw()}};s.prototype.resetRowAttr=function(e,t=false){for(let t=0;t<this.columnCount;t++){this.resetCellAttr(t,e,true)}if(!t){this.draw()}};s.prototype.setColumnAttr=function(e,r,i,t=false){for(let t=0;t<this.rowCount;t++){this.setCellAttr(e,t,r,i,true)}if(!t){this.draw()}};s.prototype.resetColumnAttr=function(e,t=false){for(let t=0;t<this.rowCount;t++){this.resetCellAttr(e,t,true)}if(!t){this.draw()}};s.prototype.setTableAttr=function(r,i,t=false){for(let e=0;e<this.rowCount;e++){for(let t=0;t<this.columnCount;t++){this.setCellAttr(t,e,r,i,true)}}if(!t){this.draw()}};s.prototype.resetTableAttr=function(t=false){for(let e=0;e<this.rowCount;e++){for(let t=0;t<this.columnCount;t++){this.resetCellAttr(t,e,true)}}if(!t){this.draw()}};s.prototype.getTextAttrForCell=function(t,e){return this.firstCellTextAttr&&!t&&!e?this.firstCellTextAttr:this.firstRowTextAttr&&!e?this.firstRowTextAttr:this.firstColumnTextAttr&&!t?this.firstColumnTextAttr:this.evenCellTextAttr&&!(t%2)&&!(e%2)?this.evenCellTextAttr:this.checkerEvenCellTextAttr&&!((t+e)%2)?this.checkerEvenCellTextAttr:this.evenRowTextAttr&&!(e%2)?this.evenRowTextAttr:this.evenColumnTextAttr&&!(e%2)?this.evenColumnTextAttr:this.textAttr};s.prototype.getVoidAttrForCell=function(t,e,r){return this.firstCellVoidAttr&&!t&&!e?this.firstCellVoidAttr:this.firstRowVoidAttr&&!e?this.firstRowVoidAttr:this.firstColumnVoidAttr&&!t?this.firstColumnVoidAttr:this.evenCellVoidAttr&&!(t%2)&&!(e%2)?this.evenCellVoidAttr:this.checkerEvenCellVoidAttr&&!((t+e)%2)?this.checkerEvenCellVoidAttr:this.evenRowVoidAttr&&!(e%2)?this.evenRowVoidAttr:this.evenColumnVoidAttr&&!(e%2)?this.evenColumnVoidAttr:this.voidAttr||r};s.prototype.initChildren=function(){var t,e,r,i;this.rowCount=this.cellContents.length;this.columnCount=0;this.textBoxes=[];var n=0,s=0;for(t of this.cellContents){this.textBoxes[s]=[];n=0;for(e of t){if(n>=this.columnCount){this.columnCount=n+1}r=this.getTextAttrForCell(n,s);i=this.getVoidAttrForCell(n,s,r);this.textBoxes[s][n]=new o({internal:true,parent:this,content:e,contentHasMarkup:this.contentHasMarkup,x:this.outputX,y:this.outputY,width:this.outputWidth,height:this.outputHeight,lineWrap:this.lineWrap,wordWrap:this.wordWrap,textAttr:r,voidAttr:i,keyBindings:this.textBoxKeyBindings,noDraw:true});n++}s++}};s.prototype.computeCells=function(){var t=this.computeColumnWidths();if(t){this.textBoxesWordWrap()}this.computeRowHeights();this.textBoxesSizeAndPosition()};s.prototype.computeColumnWidths=function(){var t,e,r,i,n;this.contentWidth=+this.hasBorder;for(t=0;t<this.columnCount;t++){i=0;for(e=0;e<this.rowCount;e++){r=this.textBoxes[e][t];if(!r){continue}n=r.getContentSize().width||1;if(n>i){i=n}}this.columnWidths[t]=i;this.contentWidth+=i+this.hasBorder}if(this.expandToWidth&&this.contentWidth<this.outputWidth){this.expand(this.contentWidth,this.outputWidth,this.columnWidths)}else if(this.shrinkToWidth&&this.contentWidth>this.outputWidth){this.shrink(this.contentWidth,this.outputWidth,this.columnWidths);return true}return false};s.prototype.computeRowHeights=function(){var t,e,r,i,n;this.contentHeight=+this.hasBorder;for(e=0;e<this.rowCount;e++){i=0;for(t=0;t<this.columnCount;t++){r=this.textBoxes[e][t];if(!r){continue}n=r.getContentSize().height||1;if(n>i){i=n}}this.rowHeights[e]=i;this.contentHeight+=i+this.hasBorder}if(this.expandToHeight&&this.contentHeight<this.outputHeight){this.expand(this.contentHeight,this.outputHeight,this.rowHeights)}else if(this.shrinkToHeight&&this.contentHeight>this.outputHeight){this.shrink(this.contentHeight,this.outputHeight,this.rowHeights);return true}};s.prototype.expand=function(t,e,r){var i,n=0,s=0,o=r.length,a=e-(this.hasBorder?o+1:0);if(a<=0){return}var u=t-(this.hasBorder?o+1:0),l=a/u;for(i=0;i<o;i++){n=r[i]*l+s;r[i]=Math.max(1,Math.round(n));s=n-r[i]}};s.prototype.shrink=function(t,e,r){var i,n,s=0,o=[],a=r.length,u,l,f,h=t-e;while(h>0){n=0;s=0;o.length=0;for(i=0;i<a;i++){if(r[i]>n){s=n;n=r[i];o.length=0;o.push(i)}else if(r[i]===n){o.push(i)}else if(r[i]>s){s=r[i]}}if(!n){return}u=Math.min(n-s,h/o.length);l=Math.floor(u);if(l>=0){for(let t of o){r[t]-=l;h-=l}}if(l!==u){f=h%o.length;for(let t=0;t<o.length&&t<f;t++){r[o[t]]--}h-=f}}};s.prototype.textBoxesWordWrap=function(){var t,e,r;for(e=0;e<this.rowCount;e++){for(t=0;t<this.columnCount;t++){r=this.textBoxes[e][t];if(r){r.setSizeAndPosition({outputX:this.outputX,outputY:this.outputY,outputWidth:this.columnWidths[t],outputHeight:this.outputHeight})}}}};s.prototype.textBoxesSizeAndPosition=function(){var t,e,r,i,n;i=this.outputY+this.hasBorder;for(e=0;e<this.rowCount;e++){r=this.outputX+this.hasBorder;for(t=0;t<this.columnCount;t++){n=this.textBoxes[e][t];if(n){n.setSizeAndPosition({outputX:r,outputY:i,outputWidth:this.columnWidths[t],outputHeight:this.rowHeights[e]})}r+=this.columnWidths[t]+this.hasBorder}i+=this.rowHeights[e]+this.hasBorder}};s.prototype.preDrawSelf=function(){if(!this.hasBorder){return}var t,e,r,i;i=this.outputY;for(e=0;e<this.rowHeights.length;e++){r=this.outputX;for(t=0;t<this.columnWidths.length;t++){this.outputDst.put({x:r,y:i,attr:this.borderAttr},e?t?this.borderChars.cross:this.borderChars.leftTee:t?this.borderChars.topTee:this.borderChars.topLeft);this.outputDst.put({x:r,y:i+1,direction:"down",attr:this.borderAttr},this.borderChars.vertical.repeat(this.rowHeights[e]));r++;this.outputDst.put({x:r,y:i,attr:this.borderAttr},this.borderChars.horizontal.repeat(this.columnWidths[t]));r+=this.columnWidths[t]}this.outputDst.put({x:r,y:i,attr:this.borderAttr},e?this.borderChars.rightTee:this.borderChars.topRight);this.outputDst.put({x:r,y:i+1,direction:"down",attr:this.borderAttr},this.borderChars.vertical.repeat(this.rowHeights[e]));i+=this.rowHeights[e]+1}r=this.outputX;for(t=0;t<this.columnWidths.length;t++){this.outputDst.put({x:r,y:i,attr:this.borderAttr},t?this.borderChars.bottomTee:this.borderChars.bottomLeft);r++;this.outputDst.put({x:r,y:i,attr:this.borderAttr},this.borderChars.horizontal.repeat(this.columnWidths[t]));r+=this.columnWidths[t]}this.outputDst.put({x:r,y:i,attr:this.borderAttr},this.borderChars.bottomRight)}},{"../spChars.js":48,"./Element.js":23,"./TextBox.js":33}],35:[function(t,e,r){"use strict";const i=t("./Element.js");const n=t("./Text.js");const s=t("./Button.js");function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;s.call(this,t);this.value=!!t.value;this.key=t.key||null;if(this.elementType==="ToggleButton"&&!t.noDraw){this.draw()}}e.exports=o;o.prototype=Object.create(s.prototype);o.prototype.constructor=o;o.prototype.elementType="ToggleButton";o.prototype.keyBindings={ENTER:"toggle",KP_ENTER:"toggle",ALT_ENTER:"submit"};o.prototype.blink=function(){};o.prototype.setValue=function(t,e){t=!!t;if(this.value===t){return}this.value=t;this.updateStatus();this.emit("toggle",this.value,undefined,this);this.emit(this.value?"turnOn":"turnOff",this.value,undefined,this);if(!e){this.draw()}};o.prototype.toggle=function(t){this.setValue(!this.value,t)};o.prototype.updateStatus=function(){if(this.disabled){this.attr=this.disabledAttr;this.leftPadding=this.disabledLeftPadding;this.rightPadding=this.disabledRightPadding}else if(this.hasFocus){if(this.value){this.attr=this.turnedOnFocusAttr;this.leftPadding=this.turnedOnFocusLeftPadding;this.rightPadding=this.turnedOnFocusRightPadding}else{this.attr=this.turnedOffFocusAttr;this.leftPadding=this.turnedOffFocusLeftPadding;this.rightPadding=this.turnedOffFocusRightPadding}}else if(this.value){this.attr=this.turnedOnBlurAttr;this.leftPadding=this.turnedOnBlurLeftPadding;this.rightPadding=this.turnedOnBlurRightPadding}else{this.attr=this.turnedOffBlurAttr;this.leftPadding=this.turnedOffBlurLeftPadding;this.rightPadding=this.turnedOffBlurRightPadding}};o.prototype.onKey=function(t,e,r){switch(this.keyBindings[t]){case"toggle":if(this.disabled){break}this.toggle();break;case"submit":if(this.disabled){break}this.emit("submit",this.key?{[this.key]:this.value}:this.value,this.actionKeyBindings[t],this);break;default:return}return true};o.prototype.onHover=function(t){if(this.disabled){return}this.document.giveFocusTo(this,"hover")};o.prototype.onClick=function(t){if(this.disabled){return}this.document.giveFocusTo(this,"select");this.toggle()};o.prototype.onShortcut=function(){if(this.disabled){return}this.document.giveFocusTo(this,"select");this.toggle()}},{"./Button.js":16,"./Element.js":23,"./Text.js":32}],36:[function(t,e,r){"use strict";const n=t("./Element.js");const s=t("./Container.js");const i=t("../spChars.js").box;function o(t){t=!t?{}:t.internal?t:Object.create(t);t.internal=true;if(t.movable===undefined){t.movable=true}if(t.title){t.content=t.title}if(t.titleHasMarkup){t.contentHasMarkup=t.titleHasMarkup}s.call(this,t);this.boxChars=i.double;if(t.boxChars){if(typeof t.boxChars==="object"){this.boxChars=t.boxChars}else if(typeof t.boxChars==="string"&&i[t.boxChars]){this.boxChars=i[t.boxChars]}}if(this.elementType==="Window"&&!t.noDraw){this.draw()}}e.exports=o;o.prototype=Object.create(s.prototype);o.prototype.constructor=o;o.prototype.elementType="Window";o.prototype.containerBorderSize=1;o.prototype.preDrawSelf=function(){var t,e,r,i=this.outputWidth-8;if(this.content&&i>=1){e=n.truncateContent(this.content,i,this.contentHasMarkup);r=n.getLastTruncateWidth();this.outputDst.put({x:this.outputX,y:this.outputY,markup:this.contentHasMarkup},this.boxChars.topLeft+this.boxChars.horizontal+"["+e+"]"+this.boxChars.horizontal.repeat(this.outputWidth-5-r)+this.boxChars.topRight)}else{this.outputDst.put({x:this.outputX,y:this.outputY},this.boxChars.topLeft+this.boxChars.horizontal.repeat(this.outputWidth-2)+this.boxChars.topRight)}this.outputDst.put({x:this.outputX,y:this.outputY+this.outputHeight-1},this.boxChars.bottomLeft+this.boxChars.horizontal.repeat(this.outputWidth-2)+this.boxChars.bottomRight);for(t=this.outputY+1;t<this.outputY+this.outputHeight-1;t++){this.outputDst.put({x:this.outputX,y:t},this.boxChars.vertical);this.outputDst.put({x:this.outputX+this.outputWidth-1,y:t},this.boxChars.vertical)}s.prototype.preDrawSelf.call(this)}},{"../spChars.js":48,"./Container.js":19,"./Element.js":23}],37:[function(n,t,u){(function(i){(function(){"use strict";const s=n("seventh");const t=n("string-kit");n("./patches.js");const e=n("child_process").execAsync;const r=n("child_process").execFileAsync;const o=n("child_process").spawn;const a={c:"clipboard",p:"primary",s:"secondary"};if(i.platform==="linux"){u.getClipboard=async t=>{var e=a[t[0]]||"clipboard";return await r("xclip",["-o","-selection",e])};u.setClipboard=async(t,e)=>{var r=new s;var i=a[e[0]]||"clipboard";var n=o("xclip",["-i","-selection",i]);n.on("error",t=>{r.reject(t)});n.on("exit",t=>{if(t!==0){r.reject(t)}else{r.resolve()}});n.stdin.end(t);return r}}else{u.getClipboard=()=>s.reject(new Error("No clipboard manipulation program found"));u.setClipboard=()=>s.reject(new Error("No clipboard manipulation program found"))}}).call(this)}).call(this,n("_process"))},{"./patches.js":43,_process:179,child_process:136,seventh:108,"string-kit":123}],38:[function(t,e,r){(function(s){(function(){"use strict";var o=t("seventh");var u=t("./autoComplete.js");var l=t("fs");var f=t("path");e.exports=function t(r,i){if(typeof r==="function"){i=r;r={}}if(!r||typeof r!=="object"){r={}}var a;var n=new o;if(r.baseDir){a=f.resolve(r.baseDir);if(!f.isAbsolute(a)){l.realpath(r.baseDir,(t,e)=>{if(t){if(i){i(t)}else{n.reject(t)}return}r.baseDir=e;this.fileInput(r).then(t=>{if(i){i(t)}else{n.resolve(t)}},t=>{if(i){i(t)}else{n.reject(t)}})});return n}}else{a=s.cwd()}if(a[a.length-1]!=="/"){a+="/"}var e=async function t(e){var r,i,n,s,o;if(e[e.length-1]==="/"){r=e;i=""}else{r=f.dirname(e);r=r==="."?"":r+"/";i=f.basename(e)}if(f.isAbsolute(e)){n=r}else{n=a+r}try{s=await h(n)}catch(t){return e}if(!Array.isArray(s)||!s.length){return e}o=u(s,i,true);if(Array.isArray(o)){o.prefix=r}else{o=f.normalize(r+o)}return o};r=Object.assign({},r,{autoComplete:e,autoCompleteMenu:true,minLength:1});this.inputField(r).promise.then(t=>{if(!t&&typeof t!=="string"){t=undefined}else{t=f.resolve(f.isAbsolute(t)?t:a+t)}if(i){i(undefined,t)}else{n.resolve(t)}},t=>{if(i){i(t)}else{n.reject(t)}});return n};function h(s){var r=new o;if(s[s.length-1]!=="/"){s+="/"}l.readdir(s,(t,e)=>{if(t){r.reject(t);return}o.map(e,n=>{return new o((r,i)=>{l.lstat(s+n,(t,e)=>{if(t){i(t);return}if(e.isDirectory()){n+="/"}r(n)})})}).toPromise(r)});return r}}).call(this)}).call(this,t("_process"))},{"./autoComplete.js":7,_process:179,fs:136,path:178,seventh:108}],39:[function(t,e,r){"use strict";var x=t("seventh");var C={ENTER:"submit",KP_ENTER:"submit",UP:"previous",DOWN:"next",LEFT:"previousColumn",RIGHT:"nextColumn",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last"};e.exports=function t(e,n,i){if(arguments.length<1){throw new Error("[terminal] gridMenu() needs at least an array of menuItems argument")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] gridMenu(): argument #0 should be a non-empty array")}if(typeof n==="function"){i=n;n={}}else if(!n||typeof n!=="object"){n={}}if(!n.style){n.style=this}if(!n.selectedStyle){n.selectedStyle=this.inverse}if(n.leftPadding===undefined){n.leftPadding=" "}if(n.selectedLeftPadding===undefined){n.selectedLeftPadding=" "}if(n.rightPadding===undefined){n.rightPadding=" "}if(n.selectedRightPadding===undefined){n.selectedRightPadding=" "}if(!n.x){n.x=1}if(!n.y){this("\n")}else{this.moveTo(n.x,n.y)}if(!n.width){n.width=this.width-n.x+1}if(!n.itemMaxWidth){n.itemMaxWidth=Math.floor((n.width-1)/3)}var s=n.keyBindings||C;if(!this.grabbing){this.grabInput()}var o={},a=0,u=false,l=false,r=0,f=0,h,c,d,p;p=Math.max(n.leftPadding.length,n.selectedLeftPadding.length)+Math.max(n.rightPadding.length,n.selectedRightPadding.length);e=e.map(t=>{if(typeof t!=="string"){t=""+t}r=Math.max(r,t.length);return t});r=Math.min(r,n.itemMaxWidth-p);f=r+p;c=Math.floor(n.width/f);d=Math.ceil(e.length/c);h=e.map((t,e)=>({offsetY:e%d,offsetX:n.x-1+Math.floor(e/d)*f,index:e,text:t,displayText:t.length>r?t.slice(0,r-1)+"…":t+" ".repeat(r-t.length)}));var g=(t,e)=>{if(l){return}l=true;u=true;this.removeListener("key",v);this.removeListener("mouse",w);this.moveTo(1,o.y+d);if(t){if(i){i(t)}else{_.promise.reject(t)}return}var r=e!==undefined?e:{selectedIndex:a,selectedText:h[a].text,x:1+h[a].offsetX,y:o.y+h[a].offsetY};if(i){i(undefined,r)}else{_.promise.resolve(r)}};var y=()=>{for(var t=0;t<h.length;t++){b(t)}m()};var b=t=>{var e=h[t];this.moveTo(1+e.offsetX,o.y+e.offsetY);if(t===a){n.selectedStyle.noFormat(n.selectedLeftPadding);n.selectedStyle.noFormat(e.displayText);n.selectedStyle.noFormat(n.selectedRightPadding)}else{n.style.noFormat(n.leftPadding);n.style.noFormat(e.displayText);n.style.noFormat(n.rightPadding)}};var m=()=>{this.moveTo(1+h[a].offsetX,o.y+h[a].offsetY)};var v=(t,e,r)=>{if(u){return}var i=a;switch(s[t]){case"submit":g();break;case"previous":if(a>0){a--;b(a);b(a+1);m()}break;case"next":if(a<h.length-1){a++;b(a-1);b(a);m()}break;case"previousColumn":if(a>=d){a-=d;b(i);b(a);m()}break;case"nextColumn":if(a<h.length-d){a+=d;b(i);b(a);m()}break;case"cyclePrevious":a--;if(a<0){a=h.length-1}b(i);b(a);m();break;case"cycleNext":a++;if(a>=h.length){a=0}b(i);b(a);m();break;case"first":if(a!==0){a=0;b(i);b(a);m()}break;case"last":if(a!==h.length-1){a=h.length-1;b(i);b(a);m()}break;default:if(n.exitOnUnexpectedKey){g(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break}};var w=(t,e)=>{if(u){return}if(e.y<o.y||e.y>=o.y+d){return}var r,i=false,n=a;for(r=0;r<h.length;r++){if(e.y===o.y+h[r].offsetY&&e.x>=1+h[r].offsetX&&e.x<1+h[r].offsetX+f){i=true;if(a!==r){a=r;b(n);b(a);m()}break}}if(i&&t==="MOUSE_LEFT_BUTTON_PRESSED"){g()}};this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}o.x=e;o.y=r;var i=o.y+d-this.height;if(i>0){this("\n".repeat(i));o.y-=i}y();this.on("key",v);if(this.mouseGrabbing){this.on("mouse",w)}});var _={};_.promise=new x;return _}},{seventh:108}],40:[function(l,e,t){(function(t){(function(){"use strict";const _=l("ndarray");const r=l("seventh");const u={};e.exports=u;var i;if(t.IS_BROWSER){i=l("@cronvel/get-pixels")}u.load=function t(n,e,s,o){if(!i){try{i=l("get-pixels")}catch(t){i=l("@cronvel/get-pixels")}}if(typeof s==="function"){o=s;s={}}else if(!s||typeof s!=="object"){s={}}var a=new r;i(e,(t,e)=>{if(t){var r=new Error("Bad image URL: "+t);r.code=t.code;r.parent=t;if(o){o(r)}else{a.reject(r)}return}if(e.shape.length===4){e=e.pick(0,null,null,null)}if(s.shrink){e=u.shrinkNdarrayImage(e,s.shrink)}var i=n(e,s);if(o){o(undefined,i)}else{a.resolve(i)}});return a};u.shrinkNdarrayImage=function t(e,r){var i=Math.min(r.width/e.shape[0],r.height/e.shape[1]);if(i>=1){return e}var n=Math.ceil(e.shape[0]*i);var s=Math.ceil(e.shape[1]*i);var o,a,u,l,f,h,c,d,p,g,y,b,m,v=e.shape[2]===4;var w=_(new Uint8Array(n*s*e.shape[2]),[n,s,e.shape[2]]);for(o=0;o<n;o++){for(a=0;a<s;a++){l=Math.ceil(o/i);f=Math.min(Math.ceil((o+1)/i-1),e.shape[0]-1);c=Math.ceil(a/i);d=Math.min(Math.ceil((a+1)/i-1),e.shape[1]-1);m=p=g=y=b=0;for(u=l;u<=f;u++){for(h=c;h<=d;h++){p+=e.get(u,h,0);g+=e.get(u,h,1);y+=e.get(u,h,2);if(v){b+=e.get(u,h,3)}m++}}w.set(o,a,0,Math.round(p/m));w.set(o,a,1,Math.round(g/m));w.set(o,a,2,Math.round(y/m));if(v){w.set(o,a,3,Math.round(b/m))}}}return w}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"@cronvel/get-pixels":58,"get-pixels":136,ndarray:71,seventh:108}],41:[function(t,e,r){"use strict";const L=t("nextgen-events");const D=t("seventh");const F=t("string-kit");const W=t("./autoComplete.js");const H={ENTER:"submit",KP_ENTER:"submit",ESCAPE:"cancel",BACKSPACE:"backDelete",DELETE:"delete",LEFT:"backward",RIGHT:"forward",UP:"historyPrevious",DOWN:"historyNext",HOME:"startOfInput",END:"endOfInput",TAB:"autoComplete",CTRL_R:"autoCompleteUsingHistory",CTRL_LEFT:"previousWord",CTRL_RIGHT:"nextWord",ALT_D:"deleteNextWord",CTRL_W:"deletePreviousWord",CTRL_U:"deleteAllBefore",CTRL_K:"deleteAllAfter"};const N=/\S+/g;e.exports=function t(c,i){if(typeof c==="function"){i=c;c={}}else if(!c||typeof c!=="object"){c={}}if(c.echo===undefined){c.echo=true}if(typeof c.maxLength!=="number"){c.maxLength=Infinity}if(typeof c.minLength!=="number"){c.minLength=0}if(c.echoChar&&typeof c.echoChar!=="string"){c.echoChar="•"}if(c.autoCompleteMenu){if(typeof c.autoCompleteMenu!=="object"){c.autoCompleteMenu={}}c.autoCompleteMenu.exitOnUnexpectedKey=true;delete c.autoCompleteMenu.y}var d=c.keyBindings||H;if(c.tokenRegExp&&(!(c.tokenRegExp instanceof RegExp)||!c.tokenRegExp.flags.includes("g"))){throw new Error(".inputField(): if set, the 'tokenRegExp' option should be a RegExp with the 'g' flag")}if(!this.grabbing){this.grabInput()}var n,p=false,g=false,s=false,y=c.cursorPosition!==undefined?c.cursorPosition:-1,b=!!c.echo,m={},v={},w={},o={},_=[],x,C=c.tokenHook||c.autoCompleteHint,a=[],k=false;var T={style:c.style||this,hintStyle:c.hintStyle||this.brightBlack,tokenRegExp:c.tokenRegExp||N,autoComplete:c.autoComplete,autoCompleteMenu:c.autoCompleteMenu,autoCompleteHint:!!c.autoCompleteHint};if(Array.isArray(c.history)){_=c.history.map(t=>F.unicode.toArray(t).slice(0,c.maxLength))}if(c.default&&typeof c.default==="string"){_.push(F.unicode.toArray(c.default).slice(0,c.maxLength))}else{_.push([])}var e=()=>{x=_.length-1;y=r(y);if(c.y!==undefined){c.x=c.x||1;this.moveTo.eraseLineAfter(c.x,c.y);u(c.x,c.y)}else{this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n> ");e=3;r=this.height}u(e,r)})}};var u=(t,e)=>{m.x=v.x=w.x=t;m.y=v.y=w.y=e;if(_[x].length){E();A()}this.on("key",j);n.emit("ready")};var S=(t,e)=>{if(s){return}s=true;p=true;this.removeListener("key",j);if(t==="abort"){return}this.styleReset();if(t){if(i){i(t)}else{n.promise.reject(t)}return}var r;if(typeof e==="string"){r=e}else if(e){r=e.join("")}if(i){i(undefined,r)}else{n.promise.resolve(r)}};var E=()=>{var t,e=F.unicode.arrayWidth(_[x]),r=F.unicode.arrayWidth(a);v=f(e);o=f(e+r);if(o.y>this.height){t=o.y-this.height;T.style.noFormat("\n".repeat(t));m.y-=t;v.y-=t;o.y-=t}l()};var l=()=>{w=f(F.unicode.arrayWidth(_[x],y))};var f=t=>{return{x:1+(m.x+t-1)%this.width,y:m.y+Math.floor((m.x+t-1)/this.width)}};var r=t=>{if(typeof t!=="number"||isNaN(t)){return _[x].length}if(t<0){t=_[x].length+1+t}if(t<0){t=0}else if(t>=_[x].length){t=_[x].length}return t};var A=(t,e)=>{var r,i;t=t||0;if(!T.autoCompleteHint&&e){this.moveTo(v.x,v.y);T.style.noFormat.eraseLineAfter("")}this.moveTo(m.x,m.y);if(c.tokenHook){I(_[x].join(""))}else if(c.echoChar){T.style.noFormat(c.echoChar.repeat(_[x].length))}else{T.style.noFormat(_[x].join(""))}i=O();if(t>0){for(r=1;r<=t;r++){this.moveTo(1,v.y+r);T.style.noFormat.eraseLineAfter("")}}if(!i&&(w.y<v.y||v.x===this.width)){this.moveTo(v.x,v.y);T.style.noFormat.eraseLineAfter("")}this.moveTo(w.x,w.y)};var h=()=>{if(!n.hasState("ready")){n.once("ready",h);return}this.moveTo(w.x,w.y)};var R=()=>{if(g){return}g=true};var B=()=>{if(!g){return}g=false;if(n.hasState("ready")){A()}};var O=()=>{if(!T.autoCompleteHint){return false}var t=v.y;this.moveTo(v.x,v.y);T.style.noFormat.eraseLineAfter("");while(t<o.y){t++;this.moveTo(1,t);T.style.noFormat.eraseLineAfter("")}this.moveTo(w.x,w.y);return true};var P=r=>{g=true;this.singleLineMenu(r,T.autoCompleteMenu,(t,e)=>{g=false;if(t){return}if(e.selectedText){if(r.prefix){e.selectedText=r.prefix+e.selectedText}if(r.postfix){e.selectedText+=r.postfix}e.selectedText=F.unicode.toArray(e.selectedText).slice(0,c.maxLength);_[x]=e.selectedText.concat(_[x].slice(y,c.maxLength+y-e.selectedText.length));y=e.selectedText.length}if(b){this.column.eraseLineAfter(1);if(v.y>=this.height&&m.y>1){m.y--}E();A();this.moveTo(w.x,w.y)}if(e.unexpectedKey&&e.unexpectedKey!=="TAB"){j(e.unexpectedKey,undefined,e.unexpectedKeyData)}}).on("highlight",t=>n.emit("highlight",t))};var I=t=>{var e,r,i=0,n=[],s,o;T.style=c.style||this;T.hintStyle=c.hintStyle||this.brightBlack;T.tokenRegExp=c.tokenRegExp||N;T.autoComplete=c.autoComplete;T.autoCompleteMenu=c.autoCompleteMenu;T.autoCompleteHint=!!c.autoCompleteHint;T.tokenRegExp.lastIndex=0;if(c.tokenResetHook){c.tokenResetHook(this,T)}while((e=T.tokenRegExp.exec(t))!==null){r=T.tokenRegExp.lastIndex;if(e.index>i){T.style.noFormat(t.slice(i,e.index))}o=e.index+e[0].length===t.length;s=c.tokenHook(e[0],o,n,this,T);if(typeof s==="function"){s.noFormat(e[0])}else if(typeof s==="string"){this.noFormat(s)}else{T.style.noFormat(e[0])}n.push(e[0]);i=e.index+e[0].length;T.tokenRegExp.lastIndex=r}if(i<t.length){T.style.noFormat(t.slice(i))}};var M=()=>{if(!T.autoComplete||!T.autoCompleteHint||y<_[x].length){return}var r,t=_[x].join("");var i=()=>{if(Array.isArray(r)){return}a=F.unicode.toArray(r.slice(t.length)).slice(0,c.maxLength-_[x].length);E();this.moveTo(v.x,v.y);T.hintStyle.noFormat(a.join(""));this.moveTo(w.x,w.y)};if(Array.isArray(T.autoComplete)){r=W(T.autoComplete,t,T.autoCompleteMenu)}else if(typeof T.autoComplete==="function"){if(T.autoComplete.length===2){T.autoComplete(t,(t,e)=>{if(t){S(t);return}r=e;i()});return}r=T.autoComplete(t);if(D.isThenable(r)){r.then(t=>{r=t;i()},t=>{S(t)});return}}i()};var j=(t,e,r)=>{if(p||g){return}var i,n,s,o,a,u,l,f=y;if(k){k=false;l="ALT_"+t.toUpperCase();if(r){r.isCharacter=false}if(d[l]){t=l}}if(r&&r.isCharacter){if(_[x].length>=c.maxLength){return}_[x].splice(y,0,t);y++;if(b){if(y===_[x].length&&!C){T.style.noFormat(c.echoChar||t);E()}else{E();A();if(T.autoCompleteHint){M()}}}}else{switch(d[t]){case"submit":if(_[x].length<c.minLength){break}O();S(undefined,_[x]);break;case"cancel":if(c.cancelable){S()}break;case"meta":k=true;break;case"backDelete":if(_[x].length&&y>0){a=_[x][y-1];_[x].splice(y-1,1);y--;if(b){if(w.y<v.y||w.x===1||C){E();A(undefined,true);if(T.autoCompleteHint){M()}}else{E();if(F.unicode.isFullWidth(a)){this.left(2);this.delete(2)}else{this.left(1);this.delete(1)}}}}break;case"delete":if(_[x].length&&y<_[x].length){a=_[x][y];_[x].splice(y,1);if(b){if(w.y<v.y||C){E();A(undefined,true);if(T.autoCompleteHint){M()}}else{E();this.delete(F.unicode.isFullWidth(a)?2:1)}}}break;case"deleteAllBefore":if(_[x].length&&y>0){_[x].splice(0,y);y=0;if(b){E();A(undefined,true)}}break;case"deleteAllAfter":if(_[x].length&&y<_[x].length){_[x].splice(y,_[x].length-y);if(b){E();A(undefined,true);if(T.autoCompleteHint){M()}}}break;case"backward":if(_[x].length&&y>0){if(T.autoCompleteHint&&y===_[x].length){O()}y--;if(b){E();this.moveTo(w.x,w.y)}}break;case"forward":if(_[x].length&&y<_[x].length){y++;if(b){E();this.moveTo(w.x,w.y)}if(T.autoCompleteHint&&y===_[x].length){M()}}break;case"deletePreviousWord":if(_[x].length&&y>0){if(T.autoCompleteHint&&y===_[x].length){O()}u=y--;while(y>0&&_[x][y]===" "){y--}while(y>0&&_[x][y-1]!==" "){y--}_[x].splice(y,u-y);if(b){E();this.moveTo(w.x,w.y);A(undefined,true)}}break;case"deleteNextWord":if(_[x].length&&y<_[x].length){u=y;while(y<_[x].length&&_[x][y]===" "){y++}while(y<_[x].length&&_[x][y]!==" "){y++}while(y<_[x].length&&_[x][y]===" "){y++}_[x].splice(u,y-u);y=Math.min(_[x].length,u);if(b){E();this.moveTo(w.x,w.y);A(undefined,true)}if(T.autoCompleteHint&&y===_[x].length){M()}}break;case"previousWord":if(_[x].length&&y>0){if(T.autoCompleteHint&&y===_[x].length){O()}y--;while(y>0&&_[x][y]===" "){y--}while(y>0&&_[x][y-1]!==" "){y--}if(b){E();this.moveTo(w.x,w.y)}}break;case"nextWord":if(_[x].length&&y<_[x].length){while(y<_[x].length&&_[x][y]===" "){y++}while(y<_[x].length&&_[x][y]!==" "){y++}if(b){E();this.moveTo(w.x,w.y)}if(T.autoCompleteHint&&y===_[x].length){M()}}break;case"startOfInput":if(T.autoCompleteHint&&y===_[x].length){O()}y=0;if(b){E();this.moveTo(w.x,w.y)}break;case"endOfInput":y=_[x].length;if(b){E();this.moveTo(w.x,w.y)}if(T.autoCompleteHint&&f!==_[x].length){M()}break;case"historyNext":if(x<_.length-1){x++;y=_[x].length;if(b){o=v.y-m.y;E();o-=v.y-m.y;A(o,true);this.moveTo(w.x,w.y)}}break;case"historyPrevious":if(x>0){x--;y=_[x].length;if(b){o=v.y-m.y;E();o-=v.y-m.y;A(o,true);this.moveTo(w.x,w.y)}}break;case"autoCompleteUsingHistory":case"autoComplete":n=d[t]==="autoCompleteUsingHistory"?c.history:T.autoComplete;if(!n){break}i=_[x].slice(0,y);var h=()=>{if(Array.isArray(s)){if(T.autoCompleteMenu){P(s)}return}i=F.unicode.toArray(s).slice(0,c.maxLength);_[x]=i.concat(_[x].slice(y,c.maxLength+y-i.length));y=i.length;if(b){E();A()}};if(Array.isArray(n)){s=W(n,i.join(""),T.autoCompleteMenu)}else if(typeof n==="function"){if(n.length===2){n(i.join(""),(t,e)=>{if(t){S(t);return}s=e;h()});return}s=n(i.join(""));if(D.isThenable(s)){s.then(t=>{s=t;h()},t=>{S(t)});return}}h();break}}};n=Object.create(L.prototype);n.defineStates("ready");Object.defineProperty(n,"ready",{get:function(){return this.hasState("ready")}});n.widgetType="inputField";n.abort=()=>{if(p){return}S("abort")};n.stop=()=>{if(p){return}S(undefined,_[x])};n.pause=R;n.resume=B;n.focus=t=>{if(t){B()}else{R()}};n.getInput=()=>_[x].join("");n.value=n.getInput;n.getPosition=()=>({x:m.x,y:m.y});n.hide=()=>{if(!n.hasState("ready")){n.once("ready",n.hide);return}var t,e;for(t=m.x,e=m.y;e<=v.y;t=1,e++){this.moveTo.eraseLineAfter(t,e)}b=false};n.show=()=>{if(!n.hasState("ready")){n.once("ready",n.show);return}b=true;A()};n.redraw=()=>{if(!n.hasState("ready")){n.once("ready",n.redraw);return}A(undefined,true)};n.redrawCursor=()=>{if(!n.hasState("ready")){n.once("ready",n.redrawCursor);return}h()};n.getCursorPosition=()=>y;n.setCursorPosition=t=>{t=r(t);if(t!==y){if(T.autoCompleteHint&&y===_[x].length){O()}y=t;if(b){E();this.moveTo(w.x,w.y)}if(T.autoCompleteHint&&y===_[x].length){M()}}};n.rebase=(t,e)=>{if(!n.hasState("ready")){n.once("ready",n.rebase);return}var i=(t,e)=>{m.x=t;m.y=e;if(c.echo){b=true;E();A()}n.emit("rebased")};if(t!==undefined&&e!==undefined){i(t,e);return}b=false;this.getCursorLocation((t,e,r)=>{if(t){return}i(e,r)})};n.promise=new D;e();return n}},{"./autoComplete.js":7,"nextgen-events":72,seventh:108,"string-kit":123}],42:[function(t,e,r){"use strict";const s=t("string-kit");const i={};e.exports=i;const n={black:0,red:1,green:2,yellow:3,blue:4,magenta:5,violet:5,cyan:6,white:7,grey:8,gray:8,brightblack:8,brightred:9,brightgreen:10,brightyellow:11,brightblue:12,brightmagenta:13,brightviolet:13,brightcyan:14,brightwhite:15};i.colorNameToIndex=t=>n[t.toLowerCase()];const o=["black","red","green","yellow","blue","magenta","cyan","white","gray","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"];i.indexToColorName=t=>o[t];i.hexToRgba=t=>{if(t[0]==="#"){t=t.slice(1)}if(t.length===3){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:t.length>6?parseInt(t.slice(6,8),16):255}};i.color2index=i.colorNameToIndex;i.index2color=i.indexToColorName;i.hexToColor=i.hexToRgba;i.stripControlChars=(t,e)=>{if(e){return t.replace(/[\x00-\x09\x0b-\x1f\x7f]/g,"")}return t.replace(/[\x00-\x1f\x7f]/g,"")};const a=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;const u=/([\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><])|([^\u001b\u009b]+)/g;i.stripEscapeSequences=t=>t.replace(a,"");i.ansiWidth=i.stringWidth=t=>{var e,r=0;u.lastIndex=0;while(e=u.exec(t)){if(e[2]){r+=s.unicode.width(e[2])}}return r};var l=0;i.getLastTruncateWidth=()=>l;i.truncateAnsiString=i.truncateString=(t,e)=>{var r,i=0;l=0;u.lastIndex=0;while(r=u.exec(t)){if(r[2]){i+=s.unicode.width(r[2]);if(i>=e){if(i===e){return t.slice(0,r.index+r[2].length)}return t.slice(0,r.index)+s.unicode.truncateWidth(r[2],e-l)}l=i}}return t};i.markupWidth=t=>{return s.unicode.width(t.replace(/\^\[[^^[\]]*]|\^(.)/g,(t,e)=>{if(e===" "||e==="^"){return e}return""}))};i.truncateMarkupString=(t,e)=>{var r=0,i,n=s.unicode.toArray(t);l=0;while(r<n.length){if(n[r]==="^"){r++;if(n[r]==="["){while(r<n.length&&n[r]!=="]"){r++}r++;continue}if(n[r]!==" "&&n[r]!=="^"){r++;continue}}i=s.unicode.isFullWidth(n[r])?2:1;if(l+i>e){n.length=r;return n.join("")}l+=i;r++}return t};i.escapeSequenceSkipFn=(t,e)=>{var r;if(t[e]!==""){return e}e++;if(t[e]!=="["){return e}e++;for(;e<t.length;e++){r=t[e].charCodeAt(0);if(r>=65&&r<=90||r>=97&&r<=122){e++;break}}return e};i.wordWrapAnsi=(t,e)=>s.wordwrap(t,{width:e,noJoin:true,fill:true,regroupFn:t=>{var r="",i=false,n=[];t.forEach(t=>{var e;if(i){r+=t;e=t.charCodeAt(0);if(e>=65&&e<=90||e>=97&&e<=122){n.push(r);r="";i=false}}else if(r){r+=t;if(t==="["){i=true}else{n.push(r);r=""}}else if(t===""){r=t}else{n.push(t)}});return n},charWidthFn:t=>{if(t[0]===""){return 0}return s.unicode.charWidth(t)}});i.wordwrapMarkup=i.wordWrapMarkup=(t,e)=>s.wordwrap(t,{width:e,noJoin:true,fill:true,regroupFn:t=>{var e="",r=false,i=[];t.forEach(t=>{if(r){e+=t;if(t==="]"){i.push(e);e="";r=false}}else if(e){e+=t;if(t==="["){r=true}else{i.push(e);e=""}}else if(t==="^"){e=t}else{i.push(t)}});return i},charWidthFn:t=>{if(t[0]==="^"&&t[1]){if(t[1]==="^"||t[1]===" "){return 1}return 0}return s.unicode.charWidth(t)}});i.preserveMarkupFormat=s.createFormatter({argumentSanitizer:t=>t.replace(/[\x00-\x1f\x7f^]/g,t=>t==="^"?"^^":""),noMarkup:true});i.markupOptions={complexMarkupAliases:{c:"color",fg:"color",bg:"bgColor"},shiftMarkup:{"#":"background"},markup:{":":{reset:true}," ":{reset:true,raw:" "},";":{reset:true,special:true},"-":{dim:true},"+":{bold:true},_:{underline:true},"/":{italic:true},"!":{inverse:true},k:{color:0},r:{color:1},g:{color:2},y:{color:3},b:{color:4},m:{color:5},c:{color:6},w:{color:7},K:{color:8},R:{color:9},G:{color:10},Y:{color:11},B:{color:12},M:{color:13},C:{color:14},W:{color:15}},shiftedMarkup:{background:{":":{reset:true,defaultColor:true,bgDefaultColor:true}," ":{reset:true,defaultColor:true,bgDefaultColor:true,raw:" "},";":{reset:true,special:true,defaultColor:true,bgDefaultColor:true},k:{bgColor:0},r:{bgColor:1},g:{bgColor:2},y:{bgColor:3},b:{bgColor:4},m:{bgColor:5},c:{bgColor:6},w:{bgColor:7},K:{bgColor:8},R:{bgColor:9},G:{bgColor:10},Y:{bgColor:11},B:{bgColor:12},M:{bgColor:13},C:{bgColor:14},W:{bgColor:15}}}};const f=/\^\[([^\]]*)]|\^(.)|([^^]+)/g;i.parseMarkup=(t,i)=>{var e,r,n,s,o=i.markup,a=[];f.lastIndex=0;while(s=f.exec(t)){[,e,r,n]=s;if(e){var u={};e.split(",").forEach(t=>{var[e,r]=t.split(":");if(i.complexMarkupAliases[e]){e=i.complexMarkupAliases[e]}u[e]=r||true});a.push({markup:u})}else if(n){a.push(n)}else if(r==="^"){a.push("^")}else if(i.shiftMarkup[r]){o=i.shiftedMarkup[i.shiftMarkup[r]];continue}else if(o[r]){a.push({markup:o[r]})}o=i.markup}return a};const h={0:{reset:true},1:{bold:true},2:{dim:true},22:{bold:false,dim:false},3:{italic:true},23:{italic:false},4:{underline:true},24:{underline:false},5:{blink:true},25:{blink:false},7:{inverse:true},27:{inverse:false},8:{hidden:true},28:{hidden:false},9:{strike:true},29:{strike:false},30:{color:0},31:{color:1},32:{color:2},33:{color:3},34:{color:4},35:{color:5},36:{color:6},37:{color:7},"39:":{defaultColor:true},90:{color:8},91:{color:9},92:{color:10},93:{color:11},94:{color:12},95:{color:13},96:{color:14},97:{color:15},40:{bgColor:0},41:{bgColor:1},42:{bgColor:2},43:{bgColor:3},44:{bgColor:4},45:{bgColor:5},46:{bgColor:6},47:{bgColor:7},"49:":{bgDefaultColor:true},100:{bgColor:8},101:{bgColor:9},102:{bgColor:10},103:{bgColor:11},104:{bgColor:12},105:{bgColor:13},106:{bgColor:14},107:{bgColor:15}};const c=/\x1b\[([0-9;]+)m|(.[^\x1b]*)/g;i.parseAnsi=t=>{var e,r,i,n=[];c.lastIndex=0;while(e=c.exec(t)){[,r,i]=e;if(i){n.push(i)}else{r.split(";").forEach(t=>{if(h[t]){n.push({markup:h[t]})}})}}return n}},{"string-kit":123}],43:[function(t,e,r){"use strict";const i=t("seventh");i.promisifyNodeApi(t("child_process"))},{child_process:136,seventh:108}],44:[function(t,e,r){"use strict";e.exports=function t(c){if(!c||typeof c!=="object"){c={}}var e={},d,p=false,g=false,y,r=0,b=[],m,v,w,_,x,C,n,i,k,T=0,S=0,s=0,l=0,f,E,h,A,R,B,O;R=h=(new Date).getTime();k=["|","/","-","\\"];c.syncMode=!!c.syncMode;_=c.width||this.width-1;if(!c.barBracketStyle){if(c.barStyle){c.barBracketStyle=c.barStyle}else{c.barBracketStyle=this.blue}}if(!c.barStyle){c.barStyle=this.cyan}if(!c.percentStyle){c.percentStyle=this.yellow}if(!c.etaStyle){c.etaStyle=this.bold}if(!c.itemStyle){c.itemStyle=this.dim}if(!c.titleStyle){c.titleStyle=this.bold}if(!c.barChar){c.barChar="="}else{c.barChar=c.barChar[0]}if(!c.barHeadChar){c.barHeadChar=">"}else{c.barHeadChar=c.barHeadChar[0]}if(typeof c.maxRefreshTime!=="number"){c.maxRefreshTime=500}if(typeof c.minRefreshTime!=="number"){c.minRefreshTime=100}if(typeof c.items==="number"){y=c.items}if(y&&typeof c.itemSize!=="number"){c.itemSize=Math.round(_/3)}m=" ".repeat(c.itemSize);if(c.title&&typeof c.title==="string"){v=c.title;if(typeof c.titleSize!=="number"){c.titleSize=Math.round(Math.min(c.title.length+1,_/3))}}w=" ".repeat(c.titleSize);O="           ";var P=t=>{var e="",r,i,n,s,o,a,u;if(d>=1){e=" done"}else if(d>0){r=(new Date).getTime()-h;i=(new Date).getTime()-R;if(!t&&l>1){a=(new Date).getTime()-f;s=i/l;o=d/l;if(a<s){u=d+o*a/s}else{u=d+o}if(u>.99){u=.99}}else{u=d}n=i*((1-u)/u)/1e3;e=" in ";if(n<10){e+=Math.round(n*10)/10+"s"}else if(n<120){e+=Math.round(n)+"s"}else if(n<7200){e+=Math.round(n/60)+"min"}else if(n<172800){e+=Math.round(n/3600)+"hours"}else if(n<31536e3){e+=Math.round(n/86400)+"days"}else{e="few years"}}else{R=(new Date).getTime()}e=(e+O).slice(0,O.length);B=e;return e};var I=t=>{var e,r,i=m,n=w,s,o,a,u="",l="",f="",h="";if(!p||g){return}e=(new Date).getTime();if((!d||d<1)&&E&&e<E+c.minRefreshTime){if(!c.syncMode){if(A){clearTimeout(A)}A=setTimeout(I.bind(this,t),E+c.minRefreshTime-e)}return}this.saveCursor();if(x===null){this.column(C)}else{this.moveTo(C,x)}s=_-2;if(c.percent){s-=4;f=("   "+Math.round((d||0)*100)+"%").slice(-4)}if(c.eta){h=P(t);s-=h.length}s-=c.itemSize||0;if(y){if(!b.length){i=""}else if(b.length===1){i=" "+b[0]}else{r=S++%b.length;i=" ["+(r+1)+"/"+b.length+"] "+b[r]}if(i.length>m.length){i=i.slice(0,m.length-1)+"…"}else if(i.length<m.length){i=(i+m).slice(0,m.length)}}s-=c.titleSize||0;if(v){n=v;if(n.length>=w.length){n=n.slice(0,w.length-2)+"… "}else{n=(n+w).slice(0,w.length)}}o=d===undefined?1:Math.round(s*Math.max(Math.min(d,1),0));a=s-o;if(o){if(d===undefined){u=k[++T%k.length]}else{u+=c.barChar.repeat(o-1);u+=c.barHeadChar}}l+=" ".repeat(a);c.titleStyle(n);if(f){c.percentStyle(f)}if(d===undefined){this(" ")}else{c.barBracketStyle("[")}c.barStyle(u);this(l);if(d===undefined){this(" ")}else{c.barBracketStyle("]")}c.etaStyle(h);c.itemStyle(i);this.restoreCursor();if(!c.syncMode){if(A){clearTimeout(A)}if(!d||d<1){A=setTimeout(I,c.maxRefreshTime)}}E=e};if(c.syncMode||c.inline||c.y){i=_;if(c.y){C=+c.x||1;x=+c.y||1}else{C=1;x=null}n=Math.min(C+_,this.width);_=n-C;if(_!==i){if(c.titleSize){c.titleSize=Math.floor(c.titleSize*_/i)}if(c.itemSize){c.itemSize=Math.floor(c.itemSize*_/i)}}p=true;I()}else{this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}var i=_;C=e;n=Math.min(e+_,this.width);x=r;_=n-C;if(_!==i){if(c.titleSize){c.titleSize=Math.floor(c.titleSize*_/i)}if(c.itemSize){c.itemSize=Math.floor(c.itemSize*_/i)}}p=true;I()})}e.startItem=t=>{b.push(t);if(b.length===1){if(d>=1){I();return}if(c.syncMode){I()}else{if(A){clearTimeout(A)}A=setTimeout(I,0)}}};e.itemDone=t=>{var e;r++;if(y){d=r/y}else{d=undefined}f=(new Date).getTime();s++;l++;e=b.indexOf(t);if(e>=0){b.splice(e,1)}if(d>=1){I(true);return}if(c.syncMode){I()}else{if(A){clearTimeout(A)}A=setTimeout(I.bind(this,true),0)}};e.update=t=>{if(!t){t={}}else if(typeof t==="number"){t={progress:t}}if("progress"in t){if(typeof t.progress!=="number"){d=undefined}else{d=t.progress;if(d>1){d=1}else if(d<0){d=0}if(d>0){l++}f=(new Date).getTime();s++}}if(typeof t.items==="number"){y=t.items;if(y){d=r/y}if(typeof c.itemSize!=="number"){c.itemSize=Math.round(_/3);m=" ".repeat(c.itemSize)}}if(typeof t.title==="string"){v=t.title;if(typeof c.titleSize!=="number"){c.titleSize=Math.round(_/3);w=" ".repeat(c.titleSize)}}if(d>=1){I(true);return}if(c.syncMode){I()}else{if(A){clearTimeout(A)}A=setTimeout(I.bind(this,true),0)}};e.pause=e.stop=()=>{g=true};e.resume=()=>{if(g){g=false;I()}};e.reset=()=>{R=h=(new Date).getTime();r=0;d=undefined;b.length=0;T=S=s=l=0;I()};return e}},{}],45:[function(t,e,r){"use strict";const D=t("./termkit");const F=D.stringWidth;const W=t("string-kit");const H=t("nextgen-events");const N=t("seventh");const U={ENTER:"submit",KP_ENTER:"submit",UP:"previous",DOWN:"next",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last",BACKSPACE:"cancel",DELETE:"cancel",ESCAPE:"escape"};e.exports=function t(e,s,n){if(arguments.length<1){throw new Error("[terminal] singleColumnMenu() needs at least an array of menuItems")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] singleColumnMenu(): argument #0 should be a non-empty array")}if(typeof s==="function"){n=s;s={}}else if(!s||typeof s!=="object"){s={}}if(!s.style){s.style=this}if(!s.selectedStyle){s.selectedStyle=this.inverse}if(!s.submittedStyle){s.submittedStyle=this.bgGray.bold}if(!s.disabledStyle){s.disabledStyle=this.dim}if(!s.disabledSelectedStyle){s.disabledSelectedStyle=this.bgGray.dim}if(!s.disabledSubmittedStyle){s.disabledSubmittedStyle=this.bgGray}if(s.leftPadding===undefined){s.leftPadding=" "}if(s.selectedLeftPadding===undefined){s.selectedLeftPadding=s.leftPadding}if(s.submittedLeftPadding===undefined){s.submittedLeftPadding=s.leftPadding}if(typeof s.extraLines!=="number"||s.extraLines<0){s.extraLines=1}if(!s.itemMaxWidth){s.itemMaxWidth=this.width-1}if(!s.unsubmittableIndexes){s.unsubmittableIndexes=[]}var o=s.selectedIndex||0;var a=s.submitted?s.selectedIndex:null;var u=!!s.paused;var l=s.keyBindings||U;if(!this.grabbing){this.grabInput()}var f={},h={},i,c,d,p,g=0,r=0,y=0,b,m=false,v=false;var w=()=>{_(e);if(s.y!==undefined){this.moveTo(1,s.y);x(1,s.y)}else{this("\n");this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}x(e,r)})}};var _=t=>{i=0;d=Math.max(F(s.leftPadding),F(s.selectedLeftPadding));t=t.map(t=>{if(typeof t!=="string"){t=""+t}i=Math.max(i,F(t));return t});if(!s.oneLineItem&&i>s.itemMaxWidth-d){c=Math.min(i+d,this.width);p=t.map((t,e)=>{var r,i,n=s.itemMaxWidth-d;i=W.wordwrap(t,{width:n,noJoin:true,fill:true,skipFn:D.escapeSequenceSkipFn});r={offsetY:g,index:e,text:t,displayText:i};g+=i.length;return r});r=g}else{i=Math.min(i,s.itemMaxWidth-d);c=Math.min(i+d,this.width);p=t.map((t,e)=>{var r=F(t);return{offsetY:e,index:e,text:t,displayText:[r>i?t.slice(0,i-1)+"…":t+" ".repeat(i-r)]}});r=p.length}};var x=(t,e)=>{if(m){return}k(t,e);E();this.on("key",j);if(this.mouseGrabbing){this.on("mouse",L)}b.emit("ready");C()};var C=()=>{var t=p[o];b.emit("highlight",{highlightedIndex:t.index,highlightedText:t.text,submitted:a!==null,x:1,y:f.y+t.offsetY})};var k=(t,e)=>{f.x=t;f.y=e;h.x=1;h.y=e+r;y=f.y+r-(s.scrollRegionBottom||this.height)-1+s.extraLines;if(y>0){this("\n".repeat(y));f.y-=y;h.y-=y}};var T=(t,e,r)=>{if(v){return}v=true;m=true;this.removeListener("key",j);this.removeListener("mouse",L);if(t==="abort"){return}if(b.hasState("ready")){if(r){S()}else{this.moveTo(1,h.y)}}if(t){if(n){n(t)}else{b.promise.reject(t)}return}var i=e!==undefined?e:{selectedIndex:o,selectedText:p[o].text,submitted:a!==null,x:1,y:f.y+p[o].offsetY};if(n){n(undefined,i)}else{b.promise.resolve(i)}};var S=()=>{if(!b.hasState("ready")){b.once("ready",S);return}var t,e;for(t=f.x,e=f.y;e<=h.y;t=1,e++){this.moveTo.eraseLineAfter(t,e)}this.moveTo(1,f.y)};var E=()=>{for(var t=0;t<p.length;t++){A(t)}R()};var A=r=>{var i=p[r];i.displayText.forEach((t,e)=>{this.moveTo(1,f.y+i.offsetY+e);if(u||s.unsubmittableIndexes[r]){if(r===a){if(e){s.disabledSubmittedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.disabledSubmittedStyle.forceStyleOnReset.noFormat(s.submittedLeftPadding)}s.disabledSubmittedStyle.forceStyleOnReset.noFormat(t)}else if(r===o){if(e){s.disabledSelectedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.disabledSelectedStyle.forceStyleOnReset.noFormat(s.selectedLeftPadding)}s.disabledSelectedStyle.forceStyleOnReset.noFormat(t)}else{s.disabledStyle.forceStyleOnReset.noFormat(s.leftPadding);s.disabledStyle.forceStyleOnReset.noFormat(t)}}else if(r===a){if(e){s.submittedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.submittedStyle.forceStyleOnReset.noFormat(s.submittedLeftPadding)}s.submittedStyle.forceStyleOnReset.noFormat(t)}else if(r===o){if(e){s.selectedStyle.forceStyleOnReset.noFormat(s.leftPadding)}else{s.selectedStyle.forceStyleOnReset.noFormat(s.selectedLeftPadding)}s.selectedStyle.forceStyleOnReset.noFormat(t)}else{s.style.forceStyleOnReset.noFormat(s.leftPadding);s.style.forceStyleOnReset.noFormat(t)}})};var R=()=>{this.moveTo(1,f.y+p[o].offsetY)};var B=t=>{var e=o;if(o!==t&&t>=0&&t<p.length){o=t;if(b.hasState("ready")){A(e);A(o);R();C()}}};var O=()=>{if(a!==null||s.unsubmittableIndexes[o]){return}a=o;if(b.hasState("ready")){A(a);R()}b.emit("submit",{selectedIndex:a,selectedText:p[a].text,submitted:true,x:1,y:f.y+p[a].offsetY});if(!s.continueOnSubmit){T()}};var P=()=>{var t=a;if(a===null){return}a=null;A(t);R();b.emit("cancel")};var I=()=>{if(u){return}u=true;if(b.hasState("ready")){E()}};var M=()=>{if(!u){return}u=false;if(b.hasState("ready")){E()}};var j=(t,e,r)=>{if(m||u){return}var i=o;switch(l[t]){case"submit":O();break;case"previous":if(a!==null){return}if(o>0){o--;A(o);A(o+1);R();C()}break;case"next":if(a!==null){return}if(o<p.length-1){o++;A(o-1);A(o);R();C()}break;case"cyclePrevious":if(a!==null){return}o--;if(o<0){o=p.length-1}A(i);A(o);R();C();break;case"cycleNext":if(a!==null){return}o++;if(o>=p.length){o=0}A(i);A(o);R();C();break;case"first":if(a!==null){return}if(o!==0){o=0;A(i);A(o);R();C()}break;case"last":if(a!==null){return}if(o!==p.length-1){o=p.length-1;A(i);A(o);R();C()}break;case"cancel":P();break;case"escape":if(s.cancelable){T(undefined,{canceled:true})}if(s.exitOnUnexpectedKey){T(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break;default:if(s.exitOnUnexpectedKey){T(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break}};var L=(t,e)=>{if(m||u||a!==null){return}if(e.y<f.y||e.y>=h.y){return}var r,i,n,s=false;for(r=0;r<p.length;r++){i=f.y+p[r].offsetY;n=f.y+p[r].offsetY+p[r].displayText.length-1;if(e.y>=i&&e.y<=n&&e.x<1+c){s=true;B(r);break}}if(s&&t==="MOUSE_LEFT_BUTTON_PRESSED"){O()}};b=Object.create(H.prototype);b.defineStates("ready");b.abort=()=>{if(m){return}T("abort")};b.stop=t=>{if(m){return}T(undefined,undefined,t)};b.select=B;b.submit=O;b.cancel=P;b.erase=S;b.pause=I;b.resume=M;b.focus=t=>{if(t){M()}else{I()}};b.getState=()=>({selectedIndex:o,selectedText:p[o].text,submitted:a!==null,start:f,end:h,x:1,y:f.y+p[o].offsetY});b.getPosition=()=>({x:f.x,y:f.y});b.hide=()=>{if(!b.hasState("ready")){b.once("ready",b.hide);return}S()};b.show=()=>{if(!b.hasState("ready")){b.once("ready",b.show);return}E()};b.redraw=()=>{if(!b.hasState("ready")){b.once("ready",b.redraw);return}E()};b.redrawCursor=()=>{if(!b.hasState("ready")){b.once("ready",b.redrawCursor);return}R()};b.rebase=()=>{if(!b.hasState("ready")){b.once("ready",b.rebase);return}var i=u;u=true;this.getCursorLocation((t,e,r)=>{if(t){return}u=i;k(e,r);E();b.emit("rebased")})};b.promise=new N;w();return b}},{"./termkit":50,"nextgen-events":72,seventh:108,"string-kit":123}],46:[function(t,e,r){"use strict";const C=t("./termkit");const k=C.stringWidth;const T=t("nextgen-events");const S=t("seventh");const E={ENTER:"submit",KP_ENTER:"submit",LEFT:"previous",RIGHT:"next",UP:"previousPage",DOWN:"nextPage",TAB:"cycleNext",SHIFT_TAB:"cyclePrevious",HOME:"first",END:"last",ESCAPE:"escape"};e.exports=function t(e,h,n){if(arguments.length<1){throw new Error("[terminal] singleLineMenu() needs at least an array of menuItems")}if(!Array.isArray(e)||!e.length){throw new TypeError("[terminal] singleLineMenu(): argument #0 should be a non-empty array")}if(typeof h==="function"){n=h;h={}}else if(!h||typeof h!=="object"){h={}}if(h.separator===undefined){h.separator="  "}if(h.nextPageHint===undefined){h.nextPageHint=" » "}if(h.previousPageHint===undefined){h.previousPageHint=" « "}if(!h.style){h.style=this}if(!h.selectedStyle){h.selectedStyle=this.dim.blue.bgGreen}if(!h.y){this("\n")}else{this.moveTo(1,h.y)}var s=h.keyBindings||E;if(!this.grabbing){this.grabInput()}var c=e.map(t=>typeof t==="string"?t:""+t);var d=h.selectedIndex=h.selectedIndex||0;var a={},p=0,u=false,g=[],o=false;var y=k(h.nextPageHint),b=k(h.previousPageHint),m=k(h.separator);var i=()=>{var t,e,r,i=0,n=1,s,o=true,a,u,l,f=this.width-y;g=[[]];for(t=0;t<c.length;t++){if(i>=g.length){g.push([])}e=k(c[t]);s=n+e+m;if(s>f){if(o){e=f-n;r=C.truncateString(c[t],e-1)+"…";if(t===h.selectedIndex){p=i;d=g[i].length}g[i].push({index:t,text:c[t],displayText:r,displayTextWidth:e,x:n})}else{t--}i++;n=1+b;o=true;continue}if(t===h.selectedIndex){p=i;d=g[i].length}g[i].push({index:t,text:c[t],displayText:c[t],displayTextWidth:e,x:n});n=s;o=false}for(i=0;i<g.length;i++){a=g[i][g[i].length-1];u=a.x+a.displayTextWidth-1;if(i<g.length-1){u+=y}g[i].x=1;if(u<this.width){if(h.align==="right"){l=this.width-u}else if(h.align==="center"){l=Math.floor((this.width-u)/2)}else{l=0}g[i].x+=l;if(l){g[i].forEach(t=>t.x+=l)}}}};var l=(t,e)=>{if(o){return}o=true;u=true;this.removeListener("key",w);this.removeListener("mouse",_);if(t){if(n){n(t)}else{x.promise.reject(t)}return}var r=g[p];var i=e!==undefined?e:{selectedIndex:r[d].index,selectedText:r[d].text,x:r[d].x,y:a.y};if(n){n(undefined,i)}else{x.promise.resolve(i)}};var f=()=>{var t,e,r=g[p],i=r.x;this.moveTo.eraseLineAfter(1,a.y);if(h.fillIn&&i>1){h.style.noFormat(" ".repeat(i-1))}else{this.column(i)}if(p){h.style.forceStyleOnReset.noFormat(h.previousPageHint);i+=b}for(t=0;t<r.length;t++){if(t){h.style.forceStyleOnReset.noFormat(h.separator);i+=m}if(t===d){h.selectedStyle.forceStyleOnReset.noFormat(r[t].displayText);e=i}else{h.style.forceStyleOnReset.noFormat(r[t].displayText)}i+=r[t].displayTextWidth}if(p<g.length-1){h.style.forceStyleOnReset.noFormat(h.nextPageHint);i+=y}if(h.fillIn&&i<this.width){h.style.noFormat(" ".repeat(this.width-i))}this.column(e)};var v=()=>{var t=g[p][d];x.emit("highlight",{highlightedIndex:t.index,highlightedText:t.text,x:t.x,y:a.y})};var w=(t,e,r)=>{if(u){return}var i=false,n=g[p];switch(s[t]){case"submit":l();break;case"previous":if(d>0){d--;i=true}else if(p>0){p--;d=g[p].length-1;i=true}break;case"next":if(d<n.length-1){d++;i=true}else if(p<g.length-1){p++;d=0;i=true}break;case"cycleNext":if(p===g.length-1&&d===n.length-1){p=0;d=0;i=true}else if(d<n.length-1){d++;i=true}else if(p<g.length-1){p++;d=0;i=true}break;case"cyclePrevious":if(p===0&&d===0){p=g.length-1;d=g[p].length-1;i=true}else if(d>0){d--;i=true}else if(p>0){p--;d=g[p].length-1;i=true}break;case"first":if(p!==0||d!==0){p=0;d=0;i=true}break;case"last":if(p!==g.length-1||d!==g[p].length-1){p=g.length-1;d=g[p].length-1;i=true}break;case"previousPage":if(p>0){p--;d=0;i=true}break;case"nextPage":if(p<g.length-1){p++;d=0;i=true}break;case"escape":if(h.cancelable){l(undefined,{canceled:true})}if(h.exitOnUnexpectedKey){l(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break;default:if(h.exitOnUnexpectedKey){l(undefined,{unexpectedKey:t,unexpectedKeyData:r})}break}if(i){f();v()}};var _=(t,e)=>{if(u){return}if(e.y!==a.y){return}var r,i,n,s=false,o=g[p];if(t==="MOUSE_LEFT_BUTTON_PRESSED"){if(p>0&&e.x>=1&&e.x<1+b){p--;d=0;f();v();return}n=o[o.length-1].x+o[o.length-1].displayTextWidth;if(p<g.length-1&&e.x>=n&&e.x<n+y){p++;d=0;f();v();return}}for(r=0;r<o.length;r++){i=o[r];if(e.x>=i.x&&e.x<i.x+i.displayTextWidth){s=true;if(d!==r){d=r;f();v()}break}}if(s&&t==="MOUSE_LEFT_BUTTON_PRESSED"){l()}};var x=Object.create(T.prototype);x.promise=new S;this.getCursorLocation((t,e,r)=>{if(t){this.row.eraseLineAfter(this.height)("\n");e=1;r=this.height}a.x=e;a.y=r;i();f();v();this.on("key",w);if(this.mouseGrabbing){this.on("mouse",_)}});return x}},{"./termkit":50,"nextgen-events":72,seventh:108}],47:[function(t,e,r){"use strict";var l=t("seventh");e.exports=function t(e,r,i){if(typeof e!=="string"){throw new TypeError("[terminal] slowTyping(): argument #0 should be a string")}if(typeof r==="function"){i=r;r={}}if(!r||typeof r!=="object"){r={}}if(!r.style){r.style=this.green}if(!r.delay){r.delay=150}if(!r.flashStyle){r.flashStyle=this.bold.brightGreen}if(!r.flashDelay){r.flashDelay=100}var n,s,o=new l;var a=()=>{if(s){clearTimeout(s);s=null;u()}if(n===undefined){n=0}else if(n>=e.length){if(i){i()}else{o.resolve()}return}else{if(r.flashStyle&&e[n].match(/\S/)){r.flashStyle(e[n]);s=setTimeout(u,r.flashDelay)}else{r.style(e[n])}n++}setTimeout(a,(.2+Math.random()*1.8)*r.delay)};var u=()=>{this.left(1);r.style(e[n-1]);s=null};a();return o}},{seventh:108}],48:[function(t,e,r){"use strict";const i="⠀⠁⠂⠃⠄⠅⠆⠇⡀⡁⡂⡃⡄⡅⡆⡇⠈⠉⠊⠋⠌⠍⠎⠏⡈⡉⡊⡋⡌⡍⡎⡏⠐⠑⠒⠓⠔⠕⠖⠗⡐⡑⡒⡓⡔⡕⡖⡗⠘⠙⠚⠛⠜⠝⠞⠟⡘⡙⡚⡛⡜⡝⡞⡟⠠⠡⠢⠣⠤⠥⠦⠧⡠⡡⡢⡣⡤⡥⡦⡧⠨⠩⠪⠫⠬⠭⠮⠯⡨⡩⡪⡫⡬⡭⡮⡯⠰⠱⠲⠳⠴⠵⠶⠷⡰⡱⡲⡳⡴⡵⡶⡷⠸⠹⠺⠻⠼⠽⠾⠿⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⣀⣁⣂⣃⣄⣅⣆⣇⢈⢉⢊⢋⢌⢍⢎⢏⣈⣉⣊⣋⣌⣍⣎⣏⢐⢑⢒⢓⢔⢕⢖⢗⣐⣑⣒⣓⣔⣕⣖⣗⢘⢙⢚⢛⢜⢝⢞⢟⣘⣙⣚⣛⣜⣝⣞⣟⢠⢡⢢⢣⢤⢥⢦⢧⣠⣡⣢⣣⣤⣥⣦⣧⢨⢩⢪⢫⢬⢭⢮⢯⣨⣩⣪⣫⣬⣭⣮⣯⢰⢱⢲⢳⢴⢵⢶⢷⣰⣱⣲⣳⣴⣵⣶⣷⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿".split("");const n=[" ","▁","▂","▃","▄","▅","▆","▇","█"];const s=[" ","▏","▎","▍","▌","▋","▊","▉","█"];e.exports={password:"●",forwardSingleQuote:"´",overscore:"¯",multiply:"×",divide:"÷",up:"↑",down:"↓",left:"←",right:"→",leftAndRight:"↔",upAndDown:"↕",upLeft:"↖",upRight:"↗",downRight:"↘",downLeft:"↙",upLeftAndDownRight:"⤡",upRightAndDownLeft:"⤢",northWest:"↖",northEast:"↗",southEast:"↘",southWest:"↙",northWestAndSouthEast:"⤡",northEastAndSouthWest:"⤢",fullBlock:"█",upperHalfBlock:"▀",lowerHalfBlock:"▄",growingBlock:n,enlargingBlock:s,bitDots:i,bar:{classic:{border:["[","]"],body:["="," "]},classicWithArrow:{border:["[","]"],body:["=",">"," "]},classicWithHalf:{border:["[","]"],body:["="," ","-","="," "]},solid:{border:["^!▉","▏"],body:["█",...s," "]}},box:{__fix__:t=>({vertical:t.vertical||" ",horizontal:t.horizontal||" ",topLeft:t.topLeft||" ",topRight:t.topRight||" ",bottomLeft:t.bottomLeft||" ",bottomRight:t.bottomRight||" ",topTee:t.topTee||" ",bottomTee:t.bottomTee||" ",leftTee:t.leftTee||" ",rightTee:t.rightTee||" ",cross:t.cross||" "}),plain:{vertical:"█",horizontal:"█",topLeft:"█",topRight:"█",bottomLeft:"█",bottomRight:"█",topTee:"█",bottomTee:"█",leftTee:"█",rightTee:"█",cross:"█"},empty:{vertical:" ",horizontal:" ",topLeft:" ",topRight:" ",bottomLeft:" ",bottomRight:" ",topTee:" ",bottomTee:" ",leftTee:" ",rightTee:" ",cross:" "},ascii:{vertical:"|",horizontal:"-",topLeft:"|",topRight:"|",bottomLeft:"|",bottomRight:"|",topTee:"-",bottomTee:"-",leftTee:"|",rightTee:"|",cross:"+"},light:{vertical:"│",horizontal:"─",topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"},lightRounded:{vertical:"│",horizontal:"─",topLeft:"╭",topRight:"╮",bottomLeft:"╰",bottomRight:"╯",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"},heavy:{vertical:"┃",horizontal:"━",topLeft:"┏",topRight:"┓",bottomLeft:"┗",bottomRight:"┛",topTee:"┳",bottomTee:"┻",leftTee:"┣",rightTee:"┫",cross:"╋"},double:{vertical:"║",horizontal:"═",topLeft:"╔",topRight:"╗",bottomLeft:"╚",bottomRight:"╝",topTee:"╦",bottomTee:"╩",leftTee:"╠",rightTee:"╣",cross:"╬"},dotted:{vertical:"┊",horizontal:"┄",topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",topTee:"┬",bottomTee:"┴",leftTee:"├",rightTee:"┤",cross:"┼"}},animation:{asciiSpinner:["│","/","-","\\"],lineSpinner:["│","/","─","\\"],dotSpinner:[i[7],i[19],i[49],i[112],i[224],i[200],i[140],i[14]],bitDots:i,impulse:["∙∙∙","●∙∙","∙●∙","∙∙●","∙●∙","●∙∙","∙∙∙","∙∙∙"],unboxing:[" ","▁","▂","▃","▄","▅","▆","▇","█","▉","▊","▋","▌","▍","▎","▏"],"unboxing-color":["^r^#^b ","^r^#^b▁","^r^#^b▂","^r^#^b▃","^r^#^b▄","^r^#^b▅","^r^#^b▆","^r^#^b▇","^r^#^m█","^r^#^m▉","^r^#^m▊","^r^#^m▋","^r^#^m▌","^r^#^m▍","^r^#^m▎","^r^#^m▏","^m^#^y█","^m^#^y▇","^m^#^y▆","^m^#^y▅","^m^#^y▄","^m^#^y▃","^m^#^y▂","^m^#^y▁","^b^#^y ","^b^#^y▏","^b^#^y▎","^b^#^y▍","^b^#^y▌","^b^#^y▋","^b^#^y▊","^b^#^y▉"]},blackSquare:"■",whiteSquare:"□",blackCircle:"●",whiteCircle:"○",blackUpTriangle:"▲",whiteUpTriangle:"△",blackDownTriangle:"▼",whiteDownTriangle:"▽",blackLeftTriangle:"◀",whiteLeftTriangle:"◁",blackRightTriangle:"▶",whiteRightTriangle:"▷",blackDiamond:"◆",whiteDiamond:"◇",blackStar:"★",whiteStar:"☆",spadeSuit:"♠",heartSuit:"♥",diamondSuit:"♦",clubSuit:"♣",powerline:{branch:"",line:"",readOnly:"",rightTriangleSeparator:"",rightArrowSeparator:"",leftTriangleSeparator:"",leftArrowSeparator:""}}},{}],49:[function(e,r,t){(function(n){(function(){"use strict";const i={};r.exports=i;const t=e("lazyness")(e);i.globalConfig={};i.tty=e("./tty.js");if(n.env.TERM==="linux"){i.tty.getPath()}Object.assign(i,e("./misc.js"));Object.assign(i,e("./detectTerminal.js"));i.Terminal=e("./Terminal.js");i.createTerminal=i.Terminal.create;if(n.platform==="win32"){e("./windows.js")(i)}i.image=e("./image.js");i.Palette=e("./Palette.js");i.Rect=e("./Rect.js");i.ScreenBuffer=e("./ScreenBuffer.js");i.ScreenBufferHD=e("./ScreenBufferHD.js");i.TextBuffer=e("./TextBuffer.js");i.Vte=e("./vte/Vte.js");i.autoComplete=e("./autoComplete.js");i.spChars=e("./spChars.js");i.Element=e("./document/Element.js");i.Document=e("./document/Document.js");i.Container=e("./document/Container.js");i.Text=e("./document/Text.js");i.AnimatedText=e("./document/AnimatedText.js");i.Button=e("./document/Button.js");i.ToggleButton=e("./document/ToggleButton.js");i.TextBox=e("./document/TextBox.js");i.EditableTextBox=e("./document/EditableTextBox.js");i.Slider=e("./document/Slider.js");i.Bar=e("./document/Bar.js");i.LabeledInput=e("./document/LabeledInput.js");i.InlineInput=e("./document/InlineInput.js");i.Form=e("./document/Form.js");i.RowMenu=e("./document/RowMenu.js");i.ColumnMenu=e("./document/ColumnMenu.js");i.ColumnMenuMulti=e("./document/ColumnMenuMulti.js");i.SelectList=e("./document/SelectList.js");i.SelectListMulti=e("./document/SelectListMulti.js");i.DropDownMenu=e("./document/DropDownMenu.js");i.TextTable=e("./document/TextTable.js");i.Layout=e("./document/Layout.js");i.Window=e("./document/Window.js");i.chroma=e("chroma-js");t.properties(i,{terminal:()=>{var t=i.guessTerminal();return i.createTerminal({stdin:n.stdin,stdout:n.stdout,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:t.isTTY,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})},realTerminal:()=>{var t=i.guessTerminal(true);var e=i.tty.getInput();var r=i.tty.getOutput();return i.createTerminal({stdin:e,stdout:r,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:true,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})}},true)}).call(this)}).call(this,e("_process"))},{"./Palette.js":1,"./Rect.js":2,"./ScreenBuffer.js":3,"./ScreenBufferHD.js":4,"./Terminal.js":5,"./TextBuffer.js":6,"./autoComplete.js":7,"./detectTerminal.js":12,"./document/AnimatedText.js":13,"./document/Bar.js":14,"./document/Button.js":16,"./document/ColumnMenu.js":17,"./document/ColumnMenuMulti.js":18,"./document/Container.js":19,"./document/Document.js":20,"./document/DropDownMenu.js":21,"./document/EditableTextBox.js":22,"./document/Element.js":23,"./document/Form.js":24,"./document/InlineInput.js":25,"./document/LabeledInput.js":26,"./document/Layout.js":27,"./document/RowMenu.js":28,"./document/SelectList.js":29,"./document/SelectListMulti.js":30,"./document/Slider.js":31,"./document/Text.js":32,"./document/TextBox.js":33,"./document/TextTable.js":34,"./document/ToggleButton.js":35,"./document/Window.js":36,"./image.js":40,"./misc.js":42,"./spChars.js":48,"./tty.js":51,"./vte/Vte.js":53,"./windows.js":56,_process:179,"chroma-js":59,lazyness:68}],50:[function(s,o,t){(function(n,r){(function(){"use strict";const t=s("path");if(n.browser||s.cache[t.join(r,"termkit-no-lazy-require.js")]){console.log("using termkit-no-lazy-require.js");o.exports=s("./termkit-no-lazy-require.js");return}const i={};o.exports=i;const e=s("lazyness")(s);i.globalConfig={};e.requireProperty(i,"tty","./tty.js");if(n.env.TERM==="linux"){i.tty.getPath()}Object.assign(i,s("./misc.js"));Object.assign(i,s("./detectTerminal.js"));i.Terminal=s("./Terminal.js");i.createTerminal=i.Terminal.create;if(n.platform==="win32"){s("./windows.js")(i)}e.requireProperties(i,{image:"./image.js",Palette:"./Palette.js",Rect:"./Rect.js",ScreenBuffer:"./ScreenBuffer.js",ScreenBufferHD:"./ScreenBufferHD.js",TextBuffer:"./TextBuffer.js",Vte:"./vte/Vte.js",autoComplete:"./autoComplete.js",spChars:"./spChars.js",Element:"./document/Element.js",Document:"./document/Document.js",Container:"./document/Container.js",Text:"./document/Text.js",AnimatedText:"./document/AnimatedText.js",Button:"./document/Button.js",ToggleButton:"./document/ToggleButton.js",TextBox:"./document/TextBox.js",EditableTextBox:"./document/EditableTextBox.js",Slider:"./document/Slider.js",Bar:"./document/Bar.js",LabeledInput:"./document/LabeledInput.js",InlineInput:"./document/InlineInput.js",Form:"./document/Form.js",RowMenu:"./document/RowMenu.js",ColumnMenu:"./document/ColumnMenu.js",ColumnMenuMulti:"./document/ColumnMenuMulti.js",SelectList:"./document/SelectList.js",SelectListMulti:"./document/SelectListMulti.js",DropDownMenu:"./document/DropDownMenu.js",TextTable:"./document/TextTable.js",Layout:"./document/Layout.js",Window:"./document/Window.js",chroma:"chroma-js"});e.properties(i,{terminal:()=>{var t=i.guessTerminal();return i.createTerminal({stdin:n.stdin,stdout:n.stdout,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:t.isTTY,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})},realTerminal:()=>{var t=i.guessTerminal(true);var e=i.tty.getInput();var r=i.tty.getOutput();return i.createTerminal({stdin:e,stdout:r,stderr:n.stderr,generic:t.generic||"unknown",appId:t.safe?t.appId:undefined,isTTY:true,isSSH:t.isSSH,processSigwinch:true,preferProcessSigwinch:!!i.globalConfig.preferProcessSigwinch})}},true)}).call(this)}).call(this,s("_process"),"/lib")},{"./Terminal.js":5,"./detectTerminal.js":12,"./misc.js":42,"./termkit-no-lazy-require.js":49,"./windows.js":56,_process:179,lazyness:68,path:178}],51:[function(e,r,t){(function(l){(function(){"use strict";var a=e("child_process").execSync;var i=e("fs");var n=e("tty");var t={};r.exports=t;var u;t.getPath=function t(e){var r,i,n,s,o;if(!e){e=0}if(e===0||e===l.stdin){if(u){return u}r=true}try{n=a("tty",{stdio:[e,null,null]}).toString()}catch(t){n=t.stdout.toString()}n=n.trim();o=n.match(/\/dev\/tty([0-9]*)/);s=o?o[1]||null:null;i={path:n,index:s};if(r){u=i}return i};t.getInput=function t(){var e,r;e=i.openSync("/dev/tty","r");if(!n.isatty(e)){throw new Error("Input file descriptor is not a TTY.")}r=new n.ReadStream(e);r._type="tty";return r};t.getOutput=function t(){var e,r;e=i.openSync("/dev/tty","w");if(!n.isatty(e)){throw new Error("Output file descriptor is not a TTY.")}r=new n.WriteStream(e);r._type="tty";if(r._handle&&r._handle.unref){r._handle.unref()}if(r._refreshSize){l.on("SIGWINCH",()=>{r._refreshSize()})}return r}}).call(this)}).call(this,e("_process"))},{_process:179,child_process:136,fs:136,tty:198}],52:[function(r,n,t){(function(S){(function(){"use strict";const g=r("./fromOutputSequence.js");const y=r("string-kit");const t=r("nextgen-events");const i=r("seventh");function e(t={}){}n.exports=e;e.prototype=Object.create(t.prototype);e.prototype.constructor=e;async function b(t,e=1){var r;r=t.read(e);while(r===null){await i.onceEventOrError(t,"readable",["close","end"]);r=t.read(e)}return r}function m(t){return t>=65&&t<=90||t>=97&&t<=122}function v(t){var e=t.toString(16);e=e.length>1?"\\x"+e:"\\x0"+e;return e}function w(t){if(t<=31||t===127){return v(t)}return String.fromCharCode(t)}function _(r,t){if(!t||!t.length){return r}r=Array.from(r);t.forEach((t,e)=>{if(t!==undefined&&r[e]===undefined){r[e]=t}});return r}const x=new Set("(",")","*","+","-",".","/"," ","#","%");const C=new Set("?",">","<");const k=new Set(" ","$","#",'"',"'","*");const T=new Set("?");e.prototype.streamToEvent=async function(t){var e,r,i,n,s,o,a,u,l,f,h,c,d,p=S.alloc(6);for(;;){e=(await b(t))[0];if(e<=31||e===127){r=v(e);if(e===27){e=(await b(t))[0];if(e===91){a="";while(!m(e=(await b(t))[0])){a+=String.fromCharCode(e)}o=String.fromCharCode(e);a=a?a.split(";"):[];l=true;if(a.length&&C.has(a[0][0])){o=a[0][0]+o;a[0]=a[0].slice(1)}if(a.length&&k.has(a[a.length-1][a[a.length-1]-1])){o=a[a.length-1][a[a.length-1]-1]+o;a[a.length-1]=a[a.length-1].slice(0,-1)}h=g.CSI[o];console.error(">>>>>>>>>> CSI parsing:",o,a);if(h){if(h.subTree&&a.length){d=h;for(u=0;u<a.length;u++){c=d.subTree[a[u]];if(c){if(c.subTree){d=c;continue}f=c.event||d.event||h.event;if(f!=="none"){this.emit(f,c.subType||d.subType||h.subType,c.arg!==undefined?c.arg:d.arg!==undefined?d.arg:h.arg,c.extraArgs||d.extraArgs||h.extraArgs||_(a.slice(u+1),c.defaultExtraArgs))}l=false;if(c.continue){d=h;continue}}else{l=true}break}}else if(h.event){if(h.event!=="none"){this.emit(h.event,h.subType,h.arg,h.extraArgs||_(a,h.defaultExtraArgs))}l=false}}if(l){this.emit("CSI",o,a)}continue}else if(e===93){a="";for(;;){e=(await b(t))[0];if(e===7){break}if(e===27){e=(await b(t))[0];if(e===92){break}a+=String.fromCharCode(27)}a+=String.fromCharCode(e)}a=a?a.split(";"):[];o=a.shift();if(T.has(a[a.length-1])){o+=a.pop()}l=true;h=g.OSC[o];if(h){if(h.subTree){for(u=0;u<a.length;u++){c=h.subTree[a[u]];if(c){f=c.event||h.event;if(f!=="none"){this.emit(f,c.subType||h.subType,a.slice(u+1))}l=false}else{l=true}break}}else if(h.event){if(h.event!=="none"){this.emit(h.event,h.subType,a)}l=false}}if(l){this.emit("OSC",o,a)}continue}else{o=w(e);a=null;if(x.has(o)){a=[w((await b(t))[0])]}l=true;h=g.ESC[o];if(h){if(h.event!=="none"){this.emit(h.event,h.subType,h.arg,a||h.extraArgs)}l=false}if(l){this.emit("ESC",o,a)}continue}}else if(g.control[r]){h=g.control[r];if(h.event!=="none"){this.emit(h.event,h.subType,h.arg,h.extraArgs)}continue}else{this.emit("control",r);continue}}if(e>=128){if(e<192){continue}else if(e<224){n=2}else if(e<240){n=3}else if(e<248){n=4}else if(e<252){n=5}else{n=6}p[0]=e;p[1]=p[2]=p[3]=p[4]=p[5]=0;(await b(t,n-1)).copy(p,1);i=p.toString("utf8");s=y.unicode.firstCodePoint(i);this.emit("char",i,s)}else{i=String.fromCharCode(e);this.emit("char",i,e)}}}}).call(this)}).call(this,r("buffer").Buffer)},{"./fromOutputSequence.js":54,buffer:147,"nextgen-events":72,seventh:108,"string-kit":123}],53:[function(s,t,e){"use strict";const r=s("../ScreenBuffer.js");const i=s("../Rect.js");const n=s("string-kit");const o=s("./toInputSequence.js");const a=s("./SequencesReader.js");const u=s("nextgen-events");const l=s("seventh");const f=s("child_process").spawn;const h=(...t)=>console.error("[31m",...t,"[m");const c=(...t)=>console.error(...t);function d(t={}){this.width=Math.floor(t.width)||(t.dst?t.dst.width:80);this.height=Math.floor(t.height)||(t.dst?t.dst.height:25);this.palette=t.palette||this.dst&&this.dst.palette;this.screenBuffer=new r(Object.assign({},t,this,{wrap:true}));this.screenBuffer.setClearAttr({defaultColor:true,bgDefaultColor:true});this.cx=0;this.cy=0;this.savedCx=0;this.savedCy=0;this.attr=0;this.resetAttr();this.scrollingRegion=null;this.tabWidth=8;this.mouseEvent=null;this.focusEvent=false;this.mouseIsDragging=false;this.eventInput=t.eventInput;this.childSequencesReader=new a;this.childProcess=null;this.onEventInputKey=this.onEventInputKey.bind(this);this.onEventInputMouse=this.onEventInputMouse.bind(this);this.onEventInputTerminal=this.onEventInputTerminal.bind(this);this.onChildOutputReset=this.onChildOutputReset.bind(this);this.onChildOutputChar=this.onChildOutputChar.bind(this);this.onChildOutputCursor=this.onChildOutputCursor.bind(this);this.onChildOutputEdit=this.onChildOutputEdit.bind(this);this.onChildOutputAttr=this.onChildOutputAttr.bind(this);this.onChildOutputPalette=this.onChildOutputPalette.bind(this);this.onChildOutputCursorAttr=this.onChildOutputCursorAttr.bind(this);this.onChildOutputBell=this.onChildOutputBell.bind(this);this.onChildOutputDevice=this.onChildOutputDevice.bind(this);this.onChildOutputSystem=this.onChildOutputSystem.bind(this);this.onChildOutputControl=this.onChildOutputControl.bind(this);this.onChildOutputESC=this.onChildOutputESC.bind(this);this.onChildOutputCSI=this.onChildOutputCSI.bind(this);this.onChildOutputOSC=this.onChildOutputOSC.bind(this);this.drawDebounce=l.debounce(this.drawDelay.bind(this))}t.exports=d;d.prototype=Object.create(u.prototype);d.prototype.constructor=d;d.prototype.run=function(e,r){var t,i,n=new l;if(this.childProcess){return}this.start();try{t=s("child_pty");i=t.spawn(e,r,{columns:this.width,rows:this.height})}catch(t){h("'child_pty' optional dependency not found, using regular child_process.spawn()");i=f(e,r)}this.childProcess=i;this.on("input",t=>i.stdin.write(t));this.childSequencesReader.streamToEvent(i.stdout);i.on("close",t=>{this.childProcess=null;n.resolve()});return n};d.prototype.start=function(){if(this.eventInput){this.eventInput.on("key",this.onEventInputKey);this.eventInput.on("mouse",this.onEventInputMouse);this.eventInput.on("terminal",this.onEventInputTerminal)}this.childSequencesReader.on("reset",this.onChildOutputReset);this.childSequencesReader.on("char",this.onChildOutputChar);this.childSequencesReader.on("cursor",this.onChildOutputCursor);this.childSequencesReader.on("edit",this.onChildOutputEdit);this.childSequencesReader.on("attr",this.onChildOutputAttr);this.childSequencesReader.on("palette",this.onChildOutputPalette);this.childSequencesReader.on("cursorAttr",this.onChildOutputCursorAttr);this.childSequencesReader.on("bell",this.onChildOutputBell);this.childSequencesReader.on("device",this.onChildOutputDevice);this.childSequencesReader.on("system",this.onChildOutputSystem);this.childSequencesReader.on("control",this.onChildOutputControl);this.childSequencesReader.on("ESC",this.onChildOutputESC);this.childSequencesReader.on("CSI",this.onChildOutputCSI);this.childSequencesReader.on("OSC",this.onChildOutputOSC)};d.prototype.draw=function(){var t=this.screenBuffer.draw({delta:true});this.screenBuffer.drawCursor();c("draw stats:",t)};d.prototype.redraw=function(){var t=this.screenBuffer.draw({delta:false});this.screenBuffer.drawCursor();c("redraw stats:",t)};d.prototype.drawDelay=async function(){await l.resolveNextTick();this.draw()};d.prototype.putChar=function(t){var e=t.charCodeAt(0);c("putChar:",e<=31||e===127?"(ctrl)":t,e>=16?"\\x"+e.toString(16):"\\x0"+e.toString(16),"at:",this.cx,this.cy);this.screenBuffer.put({x:this.cx,y:this.cy,attr:this.attr},t);this.cx++;if(this.cx>=this.width){this.newLine()}else{this.drawDebounce()}};d.prototype.moveCursorTo=function(t,e,r=false){if(r){if(t!==undefined){this.cx=t}if(e!==undefined){this.cy=e}}else{if(t!==undefined){this.cx=t-1}if(e!==undefined){this.cy=e-1}}if(this.cx<0){this.cx=0}else if(this.cx>=this.width-1){this.cx=this.width-1}if(this.cy<0){this.cy=0}else if(this.cy>=this.height-1){this.cy=this.height-1}this.screenBuffer.cx=this.cx;this.screenBuffer.cy=this.cy;this.screenBuffer.drawCursor()};d.prototype.moveCursor=function(t,e){this.moveCursorTo(this.cx+t,this.cy+e,true)};d.prototype.nextTab=function(){this.moveCursorTo(Math.ceil((this.cx+1)/this.tabWidth)*this.tabWidth,undefined,true)};d.prototype.vScroll=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}c("################### vScroll:",t,r,i);this.screenBuffer.vScroll(t,this.attr,r,i,true);if(!e){this.drawDebounce()}};d.prototype.lineFeed=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}this.screenBuffer.cy=++this.cy;if(t){this.screenBuffer.cx=this.cx=0}if(this.cy>i){this.screenBuffer.cy=this.cy=i;this.vScroll(-1,e);if(!e){this.screenBuffer.drawCursor()}}else if(!e){this.drawDebounce()}};d.prototype.newLine=function(t){return this.lineFeed(true,t)};d.prototype.reverseLineFeed=function(t,e){var r=0,i=this.height-1;if(this.scrollingRegion&&this.cy>=this.scrollingRegion.ymin&&this.cy<=this.scrollingRegion.ymax){({ymin:r,ymax:i}=this.scrollingRegion)}this.screenBuffer.cy=--this.cy;if(t){this.screenBuffer.cx=this.cx=0}if(this.cy<r){this.screenBuffer.cy=this.cy=r;this.vScroll(1,e);if(!e){this.screenBuffer.drawCursor()}}else if(!e){this.drawDebounce()}};d.prototype.eraseLine=function(t,e){if(t==="after"){this.screenBuffer.fill({region:{xmin:this.cx,xmax:this.width-1,ymin:this.cy,ymax:this.cy},attr:this.attr})}else if(t==="before"){this.screenBuffer.fill({region:{xmin:0,xmax:this.cx,ymin:this.cy,ymax:this.cy},attr:this.attr})}else{this.screenBuffer.fill({region:{xmin:0,xmax:this.width-1,ymin:this.cy,ymax:this.cy},attr:this.attr})}if(!e){this.drawDebounce()}};d.prototype.eraseDisplay=function(t,e){if(t==="after"){this.screenBuffer.fill({region:{xmin:this.cx,xmax:this.width-1,ymin:this.cy,ymax:this.cy},attr:this.attr});this.screenBuffer.fill({region:{xmin:0,xmax:this.width-1,ymin:this.cy+1,ymax:this.height-1},attr:this.attr})}else if(t==="before"){this.screenBuffer.fill({region:{xmin:0,xmax:this.width-1,ymin:0,ymax:this.cy-1},attr:this.attr});this.screenBuffer.fill({region:{xmin:0,xmax:this.cx,ymin:this.cy,ymax:this.cy},attr:this.attr})}else{this.screenBuffer.fill({attr:this.attr})}if(!e){this.drawDebounce()}};d.prototype.backDelete=function(t=1){if(t>this.cx){t=this.cx}if(t<=0){return}this.screenBuffer.copyRegion({xmin:this.cx,ymin:this.cy,xmax:this.width-1,ymax:this.cy},{x:this.cx-t,y:this.cy});this.cx-=t;this.screenBuffer.fill({region:{xmin:this.width-t,ymin:this.cy,xmax:this.width-1,ymax:this.cy},attr:this.attr}," ");this.screenBuffer.cx=this.cx;this.drawDebounce()};d.prototype.delete=function(t=1){if(t>this.width-this.cx){t=this.width-this.cx}if(t<=0){return}if(this.cx+t<this.width){this.screenBuffer.copyRegion({xmin:this.cx+t,ymin:this.cy,xmax:this.width-1,ymax:this.cy},{x:this.cx,y:this.cy});c("delete:",t,"copy region:",{xmin:this.cx+t,ymin:this.cy,xmax:this.width-1,ymax:this.cy},{x:this.cx,y:this.cy})}this.screenBuffer.fill({region:{xmin:this.width-t,ymin:this.cy,xmax:this.width-1,ymax:this.cy},attr:this.attr}," ");c("delete:",t,"fill region:",{xmin:this.width-t,ymin:this.cy,xmax:this.width-1,ymax:this.cy});this.drawDebounce()};d.prototype.erase=function(t=1){if(t>this.width-this.cx){t=this.width-this.cx}if(t<=0){return}this.screenBuffer.fill({region:{xmin:this.cx,ymin:this.cy,xmax:this.cx+t-1,ymax:this.cy},attr:this.attr}," ");c("erase:",t,"fill region:",{xmin:this.cx,ymin:this.cy,xmax:this.cx+t-1,ymax:this.cy});this.drawDebounce()};d.prototype.deleteLine=function(t=1){if(t>this.height-this.cy){t=this.height-this.cy}if(t<=0){return}if(this.cy+t<this.height){this.screenBuffer.copyRegion({xmin:0,ymin:this.cy+t,xmax:this.width-1,ymax:this.height-1},{x:0,y:this.cy});c("deleteLine:",t,"copy region:",{xmin:0,ymin:this.cy+t,xmax:this.width-1,ymax:this.height-1},{x:0,y:this.cy})}this.screenBuffer.fill({region:{xmin:0,ymin:this.height-t,xmax:this.width-1,ymax:this.height-1},attr:this.attr}," ");c("deleteLine:",t,"fill region:",{xmin:0,ymin:this.height-t,xmax:this.width-1,ymax:this.height-1});this.cx=this.screenBuffer.cx=0;this.drawDebounce()};d.prototype.insertLine=function(t=1){if(t>this.height-this.cy){t=this.height-this.cy}if(t<=0){return}if(this.cy+t<this.height){this.screenBuffer.copyRegion({xmin:0,ymin:this.cy,xmax:this.width-1,ymax:this.height-t},{x:0,y:this.cy+t});c("insertLine:",t,"copy region:",{xmin:0,ymin:this.cy+t,xmax:this.width-1,ymax:this.height-1},{x:0,y:this.cy})}this.screenBuffer.fill({region:{xmin:0,ymin:this.cy,xmax:this.width-1,ymax:this.cy+t},attr:this.attr}," ");c("insertLine:",t,"fill region:",{xmin:0,ymin:this.height-t,xmax:this.width-1,ymax:this.height-1});this.cx=this.screenBuffer.cx=0;this.drawDebounce()};d.prototype.resetAttr=function(){this.attr=this.screenBuffer.DEFAULT_ATTR};d.prototype.setAttr=function(t){this.attr=this.screenBuffer.object2attr(t)};d.prototype.addAttr=function(t){this.attr=this.screenBuffer.attrAndObject(this.attr,t)};d.prototype.setVScrollingRegion=function(t=null,e=null,r=false){c("########################### setVScrollingRegion:",t,e,r);if(t===null||e===null){this.scrollingRegion=null}else if(r){this.scrollingRegion=new i(0,Math.max(0,t),this.width-1,Math.min(this.height-1,e))}else{this.scrollingRegion=new i(0,Math.max(0,t-1),this.width-1,Math.min(this.height-1,e-1))}c("########################### setVScrollingRegion region:",this.scrollingRegion)};d.prototype.emitCursorLocation=function(t){this.emit("input",n.format(o.reports[t?"cursorLocationDecVariant":"cursorLocation"],this.cx,this.cy))};d.prototype.emitScreenSize=function(t){this.emit("input",n.format(o.reports.screenSize,this.width,this.height))};d.prototype.emitFocus=function(t){this.emit("input",o.reports[t?"focusIn":"focusOut"])};d.prototype.emitRegisterColor=function(t){h("emitRegisterColor",t);var e=this.screenBuffer.palette.getRgb(t);h("emitRegisterColor >>> ",e);if(!e){return}this.emit("input",n.format(o.reports.registerColor,t,e.r,e.g,e.b))};d.prototype.emitMouseSGR=function(t,e){var r=0,i=false;if(e.shift){r|=4}if(e.alt){r|=8}if(e.ctrl){r|=16}switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":break;case"MOUSE_MIDDLE_BUTTON_PRESSED":r|=1;break;case"MOUSE_RIGHT_BUTTON_PRESSED":r|=2;break;case"MOUSE_OTHER_BUTTON_PRESSED":r|=3;break;case"MOUSE_LEFT_BUTTON_RELEASED":i=true;break;case"MOUSE_MIDDLE_BUTTON_RELEASED":r|=1;i=true;break;case"MOUSE_RIGHT_BUTTON_RELEASED":r|=2;i=true;break;case"MOUSE_OTHER_BUTTON_RELEASED":r|=3;i=true;break;case"MOUSE_WHEEL_UP":r|=64;break;case"MOUSE_WHEEL_DOWN":r|=65;break;case"MOUSE_MOTION":r|=32;break}this.emit("input","[<"+r+";"+e.x+";"+e.y+(i?"m":"M"))};d.prototype.onEventInputKey=function(t,e,r){c("onEventInputKey:",t);if(r.isCharacter){this.emit("input",t)}else if(o.specialKeys[t]){this.emit("input",o.specialKeys[t])}};d.prototype.onEventInputMouse=function(t,e){if(!this.mouseEvent){return}if(this.eventInput===this.screenBuffer.dst){e.x-=this.screenBuffer.x-1;e.y-=this.screenBuffer.y-1}switch(t){case"MOUSE_LEFT_BUTTON_PRESSED":case"MOUSE_MIDDLE_BUTTON_PRESSED":case"MOUSE_RIGHT_BUTTON_PRESSED":case"MOUSE_OTHER_BUTTON_PRESSED":this.mouseIsDragging=true;this.emitMouseSGR(t,e);break;case"MOUSE_LEFT_BUTTON_RELEASED":case"MOUSE_MIDDLE_BUTTON_RELEASED":case"MOUSE_RIGHT_BUTTON_RELEASED":case"MOUSE_OTHER_BUTTON_RELEASED":this.mouseIsDragging=false;this.emitMouseSGR(t,e);break;case"MOUSE_WHEEL_UP":case"MOUSE_WHEEL_DOWN":this.emitMouseSGR(t,e);break;case"MOUSE_MOTION":if(this.mouseEvent==="motion"||this.mouseEvent==="drag"&&this.mouseIsDragging){this.emitMouseSGR(t,e)}break}};d.prototype.onEventInputTerminal=function(t,e){switch(t){case"FOCUS_IN":if(this.focusEvent){this.emitFocus(true)}break;case"FOCUS_OUT":if(this.focusEvent){this.emitFocus(false)}break}};d.prototype.onChildOutputReset=function(){h("full reset")};d.prototype.onChildOutputChar=function(t,e){this.putChar(t)};d.prototype.onChildOutputCursor=function(t,e,r){c("cursor:",t,e,r);var i=r&&r[0]?+r[0]:undefined;var n=r&&r[1]?+r[1]:undefined;switch(t){case"lineFeed":return this.lineFeed();case"carriageReturn":return this.moveCursorTo(0,undefined,true);case"tab":return this.nextTab();case"move":this.moveCursor(i,n);break;case"up":this.moveCursor(0,-i);break;case"down":this.moveCursor(0,i);break;case"right":this.moveCursor(i,0);break;case"left":this.moveCursor(-i,0);break;case"moveToYX":this.moveCursorTo(n,i);break;case"column":this.moveCursorTo(i);break;case"row":this.moveCursorTo(undefined,i);break;case"previousLine":this.moveCursor(-this.cx,-i);break;case"nextLine":this.moveCursor(-this.cx,i);break;case"save":this.savedCx=this.cx;this.savedCy=this.cy;break;case"restore":this.moveCursorTo(this.savedCx,this.savedCy,true);break;default:h("Unknown/unsupported cursor action",t,e,r)}};d.prototype.onChildOutputEdit=function(t,e,r){var i=r&&r[0]?+r[0]:undefined;var n=r&&r[1]?+r[1]:undefined;switch(t){case"backDelete":c("backDelete",i);return this.backDelete(i);case"delete":c("delete",i);return this.delete(i);case"erase":c("erase",e);this.erase(e);break;case"deleteLine":c("deleteLine",i);this.deleteLine(i);break;case"insertLine":c("insertLine",i);this.insertLine(i);break;case"eraseLine":c("eraseLine",e);this.eraseLine(e);break;case"eraseDisplay":c("eraseDisplay",e);this.eraseDisplay(e);break;case"reverseLineFeed":c("reverseLineFeed");this.reverseLineFeed(e);break;case"vScrollingRegion":c("vScrollingRegion",i,n);this.setVScrollingRegion(i,n);break;case"vScrollUp":c("vScrollUp",i);this.vScroll(-i);break;case"vScrollDown":c("vScrollDown",i);this.vScroll(i);break;default:h("Unknown/unsupported edit action",t,e,r)}};d.prototype.onChildOutputAttr=function(t,e,r){switch(t){case"reset":c("ATTR reset");this.resetAttr();break;case"bold":c("ATTR bold:",e);this.addAttr({bold:e});break;case"dim":c("ATTR dim:",e);this.addAttr({dim:e});break;case"italic":c("ATTR italic:",e);this.addAttr({italic:e});break;case"underline":c("ATTR underline:",e);this.addAttr({underline:e});break;case"blink":c("ATTR blink:",e);this.addAttr({blink:e});break;case"inverse":c("ATTR inverse:",e);this.addAttr({inverse:e});break;case"hidden":c("ATTR hidden:",e);this.addAttr({hidden:e});break;case"strike":c("ATTR strike:",e);this.addAttr({strike:e});break;case"noDimNoBold":c("ATTR noDimNoBold");this.addAttr({bold:false,dim:false});break;case"color":c("ATTR color:",e);this.addAttr({color:e});break;case"color256":c("ATTR color256:",r);this.addAttr({color:+r[0]});break;case"colorRgb":c("ATTR colorRgb:",r,"not supported ATM");break;case"bgColor":c("ATTR bgColor:",e);this.addAttr({bgColor:e});break;case"bgColor256":c("ATTR bgColor256:",r);this.addAttr({bgColor:+r[0]});break;case"bgColorRgb":c("ATTR bgColorRgb:",r,"not supported ATM");break;default:h("Unknown/unsupported ATTR",t,e,r)}};d.prototype.onChildOutputPalette=function(t,e){h("Palette command:",t,e);var r=e&&e[0]?+e[0]:undefined;switch(t){case"getColor":if(!isNaN(r)){this.emitRegisterColor(r)}break}};d.prototype.onChildOutputCursorAttr=function(t,e){h("Cursor ATTR command:",t,e)};d.prototype.onChildOutputBell=function(){h("bell")};d.prototype.onChildOutputDevice=function(t,e,r){h("Device command:",t,e,r);switch(t){case"mouseButton":this.mouseEvent=e?"button":null;break;case"mouseDrag":this.mouseEvent=e?"drag":null;break;case"mouseMotion":this.mouseEvent=e?"motion":null;break;case"focusEvent":this.focusEvent=!!e;break;case"cursorLocation":this.emitCursorLocation(e);break;case"screenSize":this.emitScreenSize(e);break;default:h("Unknown/unsupported device command",t,e,r)}};d.prototype.onChildOutputSystem=function(t,e){h("System command:",t,e)};d.prototype.onChildOutputControl=function(t){h("control",t)};d.prototype.onChildOutputESC=function(t,e){h("ESC -- type:",t,e)};d.prototype.onChildOutputCSI=function(t,e){h("CSI -- type:",t,", args:",e)};d.prototype.onChildOutputOSC=function(t,e){h("OSC -- type:",t,", args:",e)}},{"../Rect.js":2,"../ScreenBuffer.js":3,"./SequencesReader.js":52,"./toInputSequence.js":55,child_process:136,child_pty:136,"nextgen-events":72,seventh:108,"string-kit":123}],54:[function(t,e,r){"use strict";r.control={"\\x07":{event:"bell"},"\\x08":{event:"cursor",subType:"left",extraArgs:[1]},"\\x09":{event:"cursor",subType:"tab"},"\\x0a":{event:"cursor",subType:"lineFeed"},"\\x0d":{event:"cursor",subType:"carriageReturn"},"\\x7f":{event:"none"}};r.ESC={7:{event:"cursor",subType:"save"},8:{event:"cursor",subType:"restore"},c:{event:"reset"},M:{event:"edit",subType:"reverseLineFeed"}};r.CSI={A:{event:"cursor",subType:"up",defaultExtraArgs:[1]},B:{event:"cursor",subType:"down",defaultExtraArgs:[1]},C:{event:"cursor",subType:"right",defaultExtraArgs:[1]},D:{event:"cursor",subType:"left",defaultExtraArgs:[1]},E:{event:"cursor",subType:"nextLine",defaultExtraArgs:[1]},F:{event:"cursor",subType:"previousLine",defaultExtraArgs:[1]},G:{event:"cursor",subType:"column"},H:{event:"cursor",subType:"moveToYX",defaultExtraArgs:[1,1]},J:{event:"edit",subType:"eraseDisplay",arg:"after",subTree:{0:{arg:"after"},1:{arg:"before"},2:{arg:"display"}}},K:{event:"edit",subType:"eraseLine",arg:"after",subTree:{0:{arg:"after"},1:{arg:"before"},2:{arg:"line"}}},L:{event:"edit",subType:"insertLine",defaultExtraArgs:[1]},M:{event:"edit",subType:"deleteLine",defaultExtraArgs:[1]},P:{event:"edit",subType:"delete",defaultExtraArgs:[1]},S:{event:"edit",subType:"vScrollUp",defaultExtraArgs:[1]},T:{event:"edit",subType:"vScrollDown",defaultExtraArgs:[1]},X:{event:"edit",subType:"erase",defaultExtraArgs:[1]},d:{event:"cursor",subType:"row"},"?h":{event:"device",arg:true,subTree:{1e3:{subType:"mouseButton",continue:true},1002:{subType:"mouseDrag",continue:true},1003:{subType:"mouseMotion",continue:true},1004:{subType:"focusEvent",continue:true},1006:{event:"none",continue:true}}},"?l":{event:"device",arg:false,subTree:null},n:{event:"device",subTree:{6:{subType:"cursorLocation"}}},"?n":{event:"device",subTree:{6:{subType:"cursorLocation",arg:true}}},m:{event:"attr",subType:"reset",subTree:{0:{subType:"reset",continue:true},1:{subType:"bold",arg:true,continue:true},2:{subType:"dim",arg:true,continue:true},3:{subType:"italic",arg:true,continue:true},4:{subType:"underline",arg:true,continue:true},5:{subType:"blink",arg:true,continue:true},7:{subType:"inverse",arg:true,continue:true},8:{subType:"hidden",arg:true,continue:true},9:{subType:"strike",arg:true,continue:true},21:{subType:"bold",arg:false,continue:true},22:{subType:"noDimNoBold",continue:true},23:{subType:"italic",arg:false,continue:true},24:{subType:"underline",arg:false,continue:true},25:{subType:"blink",arg:false,continue:true},27:{subType:"inverse",arg:false,continue:true},28:{subType:"hidden",arg:false,continue:true},29:{subType:"strike",arg:false,continue:true},30:{subType:"color",arg:"black",continue:true},31:{subType:"color",arg:"red",continue:true},32:{subType:"color",arg:"green",continue:true},33:{subType:"color",arg:"yellow",continue:true},34:{subType:"color",arg:"blue",continue:true},35:{subType:"color",arg:"magenta",continue:true},36:{subType:"color",arg:"cyan",continue:true},37:{subType:"color",arg:"white",continue:true},38:{subTree:{2:{subType:"colorRgb"},5:{subType:"color256"}}},39:{subType:"color",arg:"default",continue:true},40:{subType:"bgColor",arg:"black",continue:true},41:{subType:"bgColor",arg:"red",continue:true},42:{subType:"bgColor",arg:"green",continue:true},43:{subType:"bgColor",arg:"yellow",continue:true},44:{subType:"bgColor",arg:"blue",continue:true},45:{subType:"bgColor",arg:"magenta",continue:true},46:{subType:"bgColor",arg:"cyan",continue:true},47:{subType:"bgColor",arg:"white",continue:true},48:{subTree:{2:{subType:"bgColorRgb"},5:{subType:"bgColor256"}}},49:{subType:"bgColor",arg:"default",continue:true},90:{subType:"color",arg:"gray",continue:true},91:{subType:"color",arg:"brightRed",continue:true},92:{subType:"color",arg:"brightGreen",continue:true},93:{subType:"color",arg:"brightYellow",continue:true},94:{subType:"color",arg:"brightBlue",continue:true},95:{subType:"color",arg:"brightMagenta",continue:true},96:{subType:"color",arg:"brightCyan",continue:true},97:{subType:"color",arg:"brightWhite",continue:true},100:{subType:"bgColor",arg:"gray",continue:true},101:{subType:"bgColor",arg:"brightRed",continue:true},102:{subType:"bgColor",arg:"brightGreen",continue:true},103:{subType:"bgColor",arg:"brightYellow",continue:true},104:{subType:"bgColor",arg:"brightBlue",continue:true},105:{subType:"bgColor",arg:"brightMagenta",continue:true},106:{subType:"bgColor",arg:"brightCyan",continue:true},107:{subType:"bgColor",arg:"brightWhite",continue:true}}},r:{event:"edit",subType:"vScrollingRegion"},t:{event:"device",subTree:{18:{subType:"screenSize"}}}};r.CSI["?l"].subTree=r.CSI["?h"].subTree;r.OSC={0:{event:"system",subType:"setWindowTitle"},1:{event:"system",subType:"setIconName"},2:{event:"system",subType:"setWindowTitle"},4:{event:"palette",subType:"setColor"},"4?":{event:"palette",subType:"getColor"},7:{event:"system",subType:"setCwd"},9:{event:"system",subType:"notify"},10:{event:"palette",subType:"setDefaultColor"},11:{event:"palette",subType:"setDefaultBgColor"},12:{event:"cursorAttr",subType:"setColor"},17:{event:"palette",subType:"setHighlightBgColor"},50:{event:"cursorAttr",subType:"setShape"},104:{event:"palette",subType:"resetColor"},110:{event:"palette",subType:"resetDefaultColor"},111:{event:"palette",subType:"resetDefaultBgColor"},112:{event:"cursorAttr",subType:"resetColor"},117:{event:"palette",subType:"resetHighlightBgColor"},777:{event:"system",subTree:{notify:{subType:"notify"}}}}},{}],55:[function(t,e,r){"use strict";r.specialKeys={ESCAPE:"",TAB:"\t",ENTER:"\r",SHIFT_TAB:"[Z",ALT_TAB:"\t",ALT_ENTER:"\r",UP:"OA",DOWN:"OB",RIGHT:"OC",LEFT:"OD",SHIFT_UP:"[1;2A",SHIFT_DOWN:"[1;2B",SHIFT_RIGHT:"[1;2C",SHIFT_LEFT:"[1;2D",ALT_UP:"[1;3A",ALT_DOWN:"[1;3B",ALT_RIGHT:"[1;3C",ALT_LEFT:"[1;3D",CTRL_UP:"[1;5A",CTRL_DOWN:"[1;5B",CTRL_RIGHT:"[1;5C",CTRL_LEFT:"[1;5D",BACKSPACE:"",INSERT:"[2~",DELETE:"[3~",HOME:"[1~",END:"[4~",PAGE_UP:"[5~",PAGE_DOWN:"[6~",CTRL_BACKSPACE:"\b",CTRL_INSERT:"[2;5~",CTRL_DELETE:"[3;5~",CTRL_HOME:"[1;5~",CTRL_END:"[4;5~",CTRL_PAGE_UP:"[5;5~",CTRL_PAGE_DOWN:"[6;5~",SHIFT_INSERT:"[2;2~",SHIFT_DELETE:"[3;2~",SHIFT_HOME:"[1;2~",SHIFT_END:"[4;2~",SHIFT_PAGE_UP:"[5;2~",SHIFT_PAGE_DOWN:"[6;2~",ALT_BACKSPACE:"",ALT_INSERT:"[2;3~",ALT_DELETE:"[3;3~",ALT_HOME:"[1;3~",ALT_END:"[4;3~",ALT_PAGE_UP:"[5;3~",ALT_PAGE_DOWN:"[6;3~",F1:"OP",F2:"OQ",F3:"OR",F4:"OS",F5:"[15~",F6:"[17~",F7:"[18~",F8:"[19~",F9:"[20~",F10:"[21~",F11:"[23~",F12:"[24~",SHIFT_F1:"O1;2P",SHIFT_F2:"O1;2Q",SHIFT_F3:"O1;2R",SHIFT_F4:"O1;2S",SHIFT_F5:"[15;2~",SHIFT_F6:"[17;2~",SHIFT_F7:"[18;2~",SHIFT_F8:"[19;2~",SHIFT_F9:"[20;2~",SHIFT_F10:"[21;2~",SHIFT_F11:"[23;2~",SHIFT_F12:"[24;2~",CTRL_F1:"O1;5P",CTRL_F2:"O1;5Q",CTRL_F3:"O1;5R",CTRL_F4:"O1;5S",CTRL_F5:"[15;5~",CTRL_F6:"[17;5~",CTRL_F7:"[18;5~",CTRL_F8:"[19;5~",CTRL_F9:"[20;5~",CTRL_F10:"[21;5~",CTRL_F11:"[23;5~",CTRL_F12:"[24;5~",CTRL_SHIFT_F1:"O1;6P",CTRL_SHIFT_F2:"O1;6Q",CTRL_SHIFT_F3:"O1;6R",CTRL_SHIFT_F4:"O1;6S",CTRL_SHIFT_F5:"[15;6~",CTRL_SHIFT_F6:"[17;6~",CTRL_SHIFT_F7:"[18;6~",CTRL_SHIFT_F8:"[19;6~",CTRL_SHIFT_F9:"[20;6~",CTRL_SHIFT_F10:"[21;6~",CTRL_SHIFT_F11:"[23;6~",CTRL_SHIFT_F12:"[24;6~",NUL:"\0",ALT_SPACE:" ",CTRL_ALT_SPACE:"\0"};for(let t=1;t<=26;t++){r.specialKeys["CTRL_"+String.fromCharCode(64+t)]=String.fromCharCode(t);r.specialKeys["ALT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(96+t);r.specialKeys["CTRL_ALT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(t);r.specialKeys["ALT_SHIFT_"+String.fromCharCode(64+t)]=""+String.fromCharCode(64+t)}r.reports={cursorLocation:"[%+1u;%-1uR",cursorLocationDecVariant:"[?%+1u;%-1uR",screenSize:"[8;%+1u;%-1ut",focusIn:"[I",focusOut:"[O",registerColor:"]4;%u;rgb:%x/%x/%x"}},{}],56:[function(t,e,r){"use strict";e.exports=function(t){t.globalConfig.preferProcessSigwinch=true}},{}],57:[function(t,e,r){"use strict";var s=t("seventh");e.exports=function t(e,r){if(typeof e==="function"){r=e;e=undefined}if(!e||typeof e!=="object"){e={yes:["y","Y"],no:["n","N"],echoYes:"yes",echoNo:"no"}}if(typeof e.yes==="string"){e.yes=[e.yes]}if(!Array.isArray(e.yes)){e.yes=["y","Y"]}if(typeof e.no==="string"){e.no=[e.no]}if(!Array.isArray(e.no)){e.no=["n","N"]}if(!this.grabbing){this.grabInput()}var i=t=>{if(e.yes.indexOf(t)!==-1){if(e.echoYes){this(e.echoYes)}this.removeListener("key",i);if(r){r(undefined,true)}else{n.promise.resolve(true)}}else if(e.no.indexOf(t)!==-1){if(e.echoNo){this(e.echoNo)}this.removeListener("key",i);if(r){r(undefined,false)}else{n.promise.resolve(false)}}};this.on("key",i);var n={};n.abort=()=>{this.removeListener("key",i)};n.promise=new s;return n}},{seventh:108}],58:[function(t,r,e){(function(g){(function(){"use strict";var a=t("ndarray");var i=t("pngjs").PNG;var s=t("jpeg-js");var u=t("ndarray-pack");var l=t("omggif").GifReader;var f=t("node-bitmap");var e=t("fs");var o=t("path").extname;function n(t,r){var e=new i;e.parse(t,function(t,e){if(t){r(t);return}r(null,a(new Uint8Array(e.data),[e.width|0,e.height|0,4],[4,4*e.width|0,1],0))})}function h(t,e){var r;try{r=s.decode(t)}catch(t){e(t);return}if(!r){e(new Error("Error decoding jpeg"));return}var i=[r.height,r.width,4];var n=a(r.data,i);e(null,n.transpose(1,0))}function c(t,e){var r,i,n,s;try{r=new l(t)}catch(t){e(t);return}if(r.numFrames()>0){i=[r.numFrames(),r.height,r.width,4];n=new Uint8Array(i[0]*i[1]*i[2]*i[3]);s=a(n,i);try{for(var o=0;o<r.numFrames();++o){r.decodeAndBlitFrameRGBA(o,n.subarray(s.index(o,0,0,0),s.index(o+1,0,0,0)))}}catch(t){e(t);return}e(null,s.transpose(0,2,1))}else{i=[r.height,r.width,4];n=new Uint8Array(i[0]*i[1]*i[2]);s=a(n,i);try{r.decodeAndBlitFrameRGBA(0,n)}catch(t){e(t);return}e(null,s.transpose(1,0))}}function d(t,e){var r=new f(t);try{r.init()}catch(t){e(t);return}var i=r.getData();var n=[i.getHeight(),i.getWidth(),4];var s=new Uint8Array(n[0]*n[1]*n[2]);var o=a(s,n);u(i,o);e(null,o.transpose(1,0))}function p(t,e,r){switch(t){case"png":n(e,r);break;case"jpg":case"jpeg":h(e,r);break;case"gif":c(e,r);break;case"bmp":d(e,r);break;default:r(new Error("Unsupported file type: "+t))}}r.exports=function t(r,i,n){if(!n){n=i;i=""}if(g.isBuffer(r)){if(!i){n(new Error("Invalid file type"));return}p(i,r,n)}else{e.readFile(r,function(t,e){if(t){n(t);return}i=i||o(r).toLowerCase().substr(1);if(!i){n(new Error("Invalid file type"));return}p(i,e,n)})}}}).call(this)}).call(this,{isBuffer:t("../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js")})},{"../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js":162,fs:136,"jpeg-js":65,ndarray:71,"ndarray-pack":69,"node-bitmap":75,omggif:77,path:178,pngjs:97}],59:[function(t,r,i){(function(t,e){typeof i==="object"&&typeof r!=="undefined"?r.exports=e():typeof n==="function"&&n.amd?n(e):t.chroma=e()})(this,function(){"use strict";var r=function(t,e,r){if(e===void 0)e=0;if(r===void 0)r=1;return t<e?e:t>r?r:t};var t=function(t){t._clipped=false;t._unclipped=t.slice(0);for(var e=0;e<=3;e++){if(e<3){if(t[e]<0||t[e]>255){t._clipped=true}t[e]=r(t[e],0,255)}else if(e===3){t[e]=r(t[e],0,1)}}return t};var e={};for(var i=0,n=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];i<n.length;i+=1){var s=n[i];e["[object "+s+"]"]=s.toLowerCase()}var U=function(t){return e[Object.prototype.toString.call(t)]||"object"};var o=function(e,t){if(t===void 0)t=null;if(e.length>=3){return Array.prototype.slice.call(e)}if(U(e[0])=="object"&&t){return t.split("").filter(function(t){return e[0][t]!==undefined}).map(function(t){return e[0][t]})}return e[0]};var a=function(t){if(t.length<2){return null}var e=t.length-1;if(U(t[e])=="string"){return t[e].toLowerCase()}return null};var u=Math.PI;var l={clip_rgb:t,limit:r,type:U,unpack:o,last:a,PI:u,TWOPI:u*2,PITHIRD:u/3,DEG2RAD:u/180,RAD2DEG:180/u};var p={format:{},autodetect:[]};var f=l.last;var h=l.clip_rgb;var c=l.type;var d=function t(){var e=[],r=arguments.length;while(r--)e[r]=arguments[r];var i=this;if(c(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor){return e[0]}var n=f(e);var s=false;if(!n){s=true;if(!p.sorted){p.autodetect=p.autodetect.sort(function(t,e){return e.p-t.p});p.sorted=true}for(var o=0,a=p.autodetect;o<a.length;o+=1){var u=a[o];n=u.test.apply(u,e);if(n){break}}}if(p.format[n]){var l=p.format[n].apply(null,s?e:e.slice(0,-1));i._rgb=h(l)}else{throw new Error("unknown format: "+e)}if(i._rgb.length===3){i._rgb.push(1)}};d.prototype.toString=function t(){if(c(this.hex)=="function"){return this.hex()}return"["+this._rgb.join(",")+"]"};var R=d;var g=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(g.Color,[null].concat(t)))};g.Color=R;g.version="2.1.2";var S=g;var y=l.unpack;var b=Math.max;var m=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=y(t,"rgb");var i=r[0];var n=r[1];var s=r[2];i=i/255;n=n/255;s=s/255;var o=1-b(i,b(n,s));var a=o<1?1/(1-o):0;var u=(1-i-o)*a;var l=(1-n-o)*a;var f=(1-s-o)*a;return[u,l,f,o]};var v=m;var w=l.unpack;var _=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=w(t,"cmyk");var r=t[0];var i=t[1];var n=t[2];var s=t[3];var o=t.length>4?t[4]:1;if(s===1){return[0,0,0,o]}return[r>=1?0:255*(1-r)*(1-s),i>=1?0:255*(1-i)*(1-s),n>=1?0:255*(1-n)*(1-s),o]};var x=_;var C=l.unpack;var k=l.type;R.prototype.cmyk=function(){return v(this._rgb)};S.cmyk=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["cmyk"])))};p.format.cmyk=x;p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=C(t,"cmyk");if(k(t)==="array"&&t.length===4){return"cmyk"}}});var T=l.unpack;var E=l.last;var A=function(t){return Math.round(t*100)/100};var B=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=T(t,"hsla");var i=E(t)||"lsa";r[0]=A(r[0]||0);r[1]=A(r[1]*100)+"%";r[2]=A(r[2]*100)+"%";if(i==="hsla"||r.length>3&&r[3]<1){r[3]=r.length>3?r[3]:1;i="hsla"}else{r.length=3}return i+"("+r.join(",")+")"};var O=B;var P=l.unpack;var I=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=P(t,"rgba");var r=t[0];var i=t[1];var n=t[2];r/=255;i/=255;n/=255;var s=Math.min(r,i,n);var o=Math.max(r,i,n);var a=(o+s)/2;var u,l;if(o===s){u=0;l=Number.NaN}else{u=a<.5?(o-s)/(o+s):(o-s)/(2-o-s)}if(r==o){l=(i-n)/(o-s)}else if(i==o){l=2+(n-r)/(o-s)}else if(n==o){l=4+(r-i)/(o-s)}l*=60;if(l<0){l+=360}if(t.length>3&&t[3]!==undefined){return[l,u,a,t[3]]}return[l,u,a]};var M=I;var j=l.unpack;var L=l.last;var D=Math.round;var F=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=j(t,"rgba");var i=L(t)||"rgb";if(i.substr(0,3)=="hsl"){return O(M(r),i)}r[0]=D(r[0]);r[1]=D(r[1]);r[2]=D(r[2]);if(i==="rgba"||r.length>3&&r[3]<1){r[3]=r.length>3?r[3]:1;i="rgba"}return i+"("+r.slice(0,i==="rgb"?3:4).join(",")+")"};var W=F;var H=l.unpack;var N=Math.round;var z=function(){var t;var e=[],r=arguments.length;while(r--)e[r]=arguments[r];e=H(e,"hsl");var i=e[0];var n=e[1];var s=e[2];var o,a,u;if(n===0){o=a=u=s*255}else{var l=[0,0,0];var f=[0,0,0];var h=s<.5?s*(1+n):s+n-s*n;var c=2*s-h;var d=i/360;l[0]=d+1/3;l[1]=d;l[2]=d-1/3;for(var p=0;p<3;p++){if(l[p]<0){l[p]+=1}if(l[p]>1){l[p]-=1}if(6*l[p]<1){f[p]=c+(h-c)*6*l[p]}else if(2*l[p]<1){f[p]=h}else if(3*l[p]<2){f[p]=c+(h-c)*(2/3-l[p])*6}else{f[p]=c}}t=[N(f[0]*255),N(f[1]*255),N(f[2]*255)],o=t[0],a=t[1],u=t[2]}if(e.length>3){return[o,a,u,e[3]]}return[o,a,u,1]};var Y=z;var V=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/;var G=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/;var Z=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;var K=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;var X=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;var q=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;var J=Math.round;var $=function(t){t=t.toLowerCase().trim();var e;if(p.format.named){try{return p.format.named(t)}catch(t){}}if(e=t.match(V)){var r=e.slice(1,4);for(var i=0;i<3;i++){r[i]=+r[i]}r[3]=1;return r}if(e=t.match(G)){var n=e.slice(1,5);for(var s=0;s<4;s++){n[s]=+n[s]}return n}if(e=t.match(Z)){var o=e.slice(1,4);for(var a=0;a<3;a++){o[a]=J(o[a]*2.55)}o[3]=1;return o}if(e=t.match(K)){var u=e.slice(1,5);for(var l=0;l<3;l++){u[l]=J(u[l]*2.55)}u[3]=+u[3];return u}if(e=t.match(X)){var f=e.slice(1,4);f[1]*=.01;f[2]*=.01;var h=Y(f);h[3]=1;return h}if(e=t.match(q)){var c=e.slice(1,4);c[1]*=.01;c[2]*=.01;var d=Y(c);d[3]=+e[4];return d}};$.test=function(t){return V.test(t)||G.test(t)||Z.test(t)||K.test(t)||X.test(t)||q.test(t)};var Q=$;var tt=l.type;R.prototype.css=function(t){return W(this._rgb,t)};S.css=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["css"])))};p.format.css=Q;p.autodetect.push({p:5,test:function(t){var e=[],r=arguments.length-1;while(r-- >0)e[r]=arguments[r+1];if(!e.length&&tt(t)==="string"&&Q.test(t)){return"css"}}});var et=l.unpack;p.format.gl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=et(t,"rgba");r[0]*=255;r[1]*=255;r[2]*=255;return r};S.gl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["gl"])))};R.prototype.gl=function(){var t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};var rt=l.unpack;var it=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=rt(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=Math.min(i,n,s);var a=Math.max(i,n,s);var u=a-o;var l=u*100/255;var f=o/(255-u)*100;var h;if(u===0){h=Number.NaN}else{if(i===a){h=(n-s)/u}if(n===a){h=2+(s-i)/u}if(s===a){h=4+(i-n)/u}h*=60;if(h<0){h+=360}}return[h,l,f]};var nt=it;var st=l.unpack;var ot=Math.floor;var at=function(){var t,e,r,i,n,s;var o=[],a=arguments.length;while(a--)o[a]=arguments[a];o=st(o,"hcg");var u=o[0];var l=o[1];var f=o[2];var h,c,d;f=f*255;var p=l*255;if(l===0){h=c=d=f}else{if(u===360){u=0}if(u>360){u-=360}if(u<0){u+=360}u/=60;var g=ot(u);var y=u-g;var b=f*(1-l);var m=b+p*(1-y);var v=b+p*y;var w=b+p;switch(g){case 0:t=[w,v,b],h=t[0],c=t[1],d=t[2];break;case 1:e=[m,w,b],h=e[0],c=e[1],d=e[2];break;case 2:r=[b,w,v],h=r[0],c=r[1],d=r[2];break;case 3:i=[b,m,w],h=i[0],c=i[1],d=i[2];break;case 4:n=[v,b,w],h=n[0],c=n[1],d=n[2];break;case 5:s=[w,b,m],h=s[0],c=s[1],d=s[2];break}}return[h,c,d,o.length>3?o[3]:1]};var ut=at;var lt=l.unpack;var ft=l.type;R.prototype.hcg=function(){return nt(this._rgb)};S.hcg=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hcg"])))};p.format.hcg=ut;p.autodetect.push({p:1,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=lt(t,"hcg");if(ft(t)==="array"&&t.length===3){return"hcg"}}});var ht=l.unpack;var ct=l.last;var dt=Math.round;var pt=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=ht(t,"rgba");var i=r[0];var n=r[1];var s=r[2];var o=r[3];var a=ct(t)||"auto";if(o===undefined){o=1}if(a==="auto"){a=o<1?"rgba":"rgb"}i=dt(i);n=dt(n);s=dt(s);var u=i<<16|n<<8|s;var l="000000"+u.toString(16);l=l.substr(l.length-6);var f="0"+dt(o*255).toString(16);f=f.substr(f.length-2);switch(a.toLowerCase()){case"rgba":return"#"+l+f;case"argb":return"#"+f+l;default:return"#"+l}};var gt=pt;var yt=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;var bt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;var mt=function(t){if(t.match(yt)){if(t.length===4||t.length===7){t=t.substr(1)}if(t.length===3){t=t.split("");t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}var e=parseInt(t,16);var r=e>>16;var i=e>>8&255;var n=e&255;return[r,i,n,1]}if(t.match(bt)){if(t.length===5||t.length===9){t=t.substr(1)}if(t.length===4){t=t.split("");t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]}var s=parseInt(t,16);var o=s>>24&255;var a=s>>16&255;var u=s>>8&255;var l=Math.round((s&255)/255*100)/100;return[o,a,u,l]}throw new Error("unknown hex color: "+t)};var vt=mt;var wt=l.type;R.prototype.hex=function(t){return gt(this._rgb,t)};S.hex=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hex"])))};p.format.hex=vt;p.autodetect.push({p:4,test:function(t){var e=[],r=arguments.length-1;while(r-- >0)e[r]=arguments[r+1];if(!e.length&&wt(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0){return"hex"}}});var _t=l.unpack;var xt=l.TWOPI;var Ct=Math.min;var kt=Math.sqrt;var Tt=Math.acos;var St=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=_t(t,"rgb");var i=r[0];var n=r[1];var s=r[2];i/=255;n/=255;s/=255;var o;var a=Ct(i,n,s);var u=(i+n+s)/3;var l=u>0?1-a/u:0;if(l===0){o=NaN}else{o=(i-n+(i-s))/2;o/=kt((i-n)*(i-n)+(i-s)*(n-s));o=Tt(o);if(s>n){o=xt-o}o/=xt}return[o*360,l,u]};var Et=St;var At=l.unpack;var Rt=l.limit;var Bt=l.TWOPI;var Ot=l.PITHIRD;var Pt=Math.cos;var It=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=At(t,"hsi");var r=t[0];var i=t[1];var n=t[2];var s,o,a;if(isNaN(r)){r=0}if(isNaN(i)){i=0}if(r>360){r-=360}if(r<0){r+=360}r/=360;if(r<1/3){a=(1-i)/3;s=(1+i*Pt(Bt*r)/Pt(Ot-Bt*r))/3;o=1-(a+s)}else if(r<2/3){r-=1/3;s=(1-i)/3;o=(1+i*Pt(Bt*r)/Pt(Ot-Bt*r))/3;a=1-(s+o)}else{r-=2/3;o=(1-i)/3;a=(1+i*Pt(Bt*r)/Pt(Ot-Bt*r))/3;s=1-(o+a)}s=Rt(n*s*3);o=Rt(n*o*3);a=Rt(n*a*3);return[s*255,o*255,a*255,t.length>3?t[3]:1]};var Mt=It;var jt=l.unpack;var Lt=l.type;R.prototype.hsi=function(){return Et(this._rgb)};S.hsi=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hsi"])))};p.format.hsi=Mt;p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=jt(t,"hsi");if(Lt(t)==="array"&&t.length===3){return"hsi"}}});var Dt=l.unpack;var Ft=l.type;R.prototype.hsl=function(){return M(this._rgb)};S.hsl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hsl"])))};p.format.hsl=Y;p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Dt(t,"hsl");if(Ft(t)==="array"&&t.length===3){return"hsl"}}});var Wt=l.unpack;var Ht=Math.min;var Nt=Math.max;var Ut=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Wt(t,"rgb");var r=t[0];var i=t[1];var n=t[2];var s=Ht(r,i,n);var o=Nt(r,i,n);var a=o-s;var u,l,f;f=o/255;if(o===0){u=Number.NaN;l=0}else{l=a/o;if(r===o){u=(i-n)/a}if(i===o){u=2+(n-r)/a}if(n===o){u=4+(r-i)/a}u*=60;if(u<0){u+=360}}return[u,l,f]};var zt=Ut;var Yt=l.unpack;var Vt=Math.floor;var Gt=function(){var t,e,r,i,n,s;var o=[],a=arguments.length;while(a--)o[a]=arguments[a];o=Yt(o,"hsv");var u=o[0];var l=o[1];var f=o[2];var h,c,d;f*=255;if(l===0){h=c=d=f}else{if(u===360){u=0}if(u>360){u-=360}if(u<0){u+=360}u/=60;var p=Vt(u);var g=u-p;var y=f*(1-l);var b=f*(1-l*g);var m=f*(1-l*(1-g));switch(p){case 0:t=[f,m,y],h=t[0],c=t[1],d=t[2];break;case 1:e=[b,f,y],h=e[0],c=e[1],d=e[2];break;case 2:r=[y,f,m],h=r[0],c=r[1],d=r[2];break;case 3:i=[y,b,f],h=i[0],c=i[1],d=i[2];break;case 4:n=[m,y,f],h=n[0],c=n[1],d=n[2];break;case 5:s=[f,y,b],h=s[0],c=s[1],d=s[2];break}}return[h,c,d,o.length>3?o[3]:1]};var Zt=Gt;var Kt=l.unpack;var Xt=l.type;R.prototype.hsv=function(){return zt(this._rgb)};S.hsv=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hsv"])))};p.format.hsv=Zt;p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Kt(t,"hsv");if(Xt(t)==="array"&&t.length===3){return"hsv"}}});var qt={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452};var Jt=l.unpack;var $t=Math.pow;var Qt=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Jt(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=re(i,n,s);var a=o[0];var u=o[1];var l=o[2];var f=116*u-16;return[f<0?0:f,500*(a-u),200*(u-l)]};var te=function(t){if((t/=255)<=.04045){return t/12.92}return $t((t+.055)/1.055,2.4)};var ee=function(t){if(t>qt.t3){return $t(t,1/3)}return t/qt.t2+qt.t0};var re=function(t,e,r){t=te(t);e=te(e);r=te(r);var i=ee((.4124564*t+.3575761*e+.1804375*r)/qt.Xn);var n=ee((.2126729*t+.7151522*e+.072175*r)/qt.Yn);var s=ee((.0193339*t+.119192*e+.9503041*r)/qt.Zn);return[i,n,s]};var ie=Qt;var ne=l.unpack;var se=Math.pow;var oe=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=ne(t,"lab");var r=t[0];var i=t[1];var n=t[2];var s,o,a,u,l,f;o=(r+16)/116;s=isNaN(i)?o:o+i/500;a=isNaN(n)?o:o-n/200;o=qt.Yn*ue(o);s=qt.Xn*ue(s);a=qt.Zn*ue(a);u=ae(3.2404542*s-1.5371385*o-.4985314*a);l=ae(-.969266*s+1.8760108*o+.041556*a);f=ae(.0556434*s-.2040259*o+1.0572252*a);return[u,l,f,t.length>3?t[3]:1]};var ae=function(t){return 255*(t<=.00304?12.92*t:1.055*se(t,1/2.4)-.055)};var ue=function(t){return t>qt.t1?t*t*t:qt.t2*(t-qt.t0)};var le=oe;var fe=l.unpack;var he=l.type;R.prototype.lab=function(){return ie(this._rgb)};S.lab=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["lab"])))};p.format.lab=le;p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=fe(t,"lab");if(he(t)==="array"&&t.length===3){return"lab"}}});var ce=l.unpack;var de=l.RAD2DEG;var pe=Math.sqrt;var ge=Math.atan2;var ye=Math.round;var be=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=ce(t,"lab");var i=r[0];var n=r[1];var s=r[2];var o=pe(n*n+s*s);var a=(ge(s,n)*de+360)%360;if(ye(o*1e4)===0){a=Number.NaN}return[i,o,a]};var me=be;var ve=l.unpack;var we=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=ve(t,"rgb");var i=r[0];var n=r[1];var s=r[2];var o=ie(i,n,s);var a=o[0];var u=o[1];var l=o[2];return me(a,u,l)};var _e=we;var xe=l.unpack;var Ce=l.DEG2RAD;var ke=Math.sin;var Te=Math.cos;var Se=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=xe(t,"lch");var i=r[0];var n=r[1];var s=r[2];if(isNaN(s)){s=0}s=s*Ce;return[i,Te(s)*n,ke(s)*n]};var Ee=Se;var Ae=l.unpack;var Re=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Ae(t,"lch");var r=t[0];var i=t[1];var n=t[2];var s=Ee(r,i,n);var o=s[0];var a=s[1];var u=s[2];var l=le(o,a,u);var f=l[0];var h=l[1];var c=l[2];return[f,h,c,t.length>3?t[3]:1]};var Be=Re;var Oe=l.unpack;var Pe=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Oe(t,"hcl").reverse();return Be.apply(void 0,r)};var Ie=Pe;var Me=l.unpack;var je=l.type;R.prototype.lch=function(){return _e(this._rgb)};R.prototype.hcl=function(){return _e(this._rgb).reverse()};S.lch=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["lch"])))};S.hcl=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["hcl"])))};p.format.lch=Be;p.format.hcl=Ie;["lch","hcl"].forEach(function(r){return p.autodetect.push({p:2,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Me(t,r);if(je(t)==="array"&&t.length===3){return r}}})});var Le={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var De=Le;var Fe=l.type;R.prototype.name=function(){var t=gt(this._rgb,"rgb");for(var e=0,r=Object.keys(De);e<r.length;e+=1){var i=r[e];if(De[i]===t){return i.toLowerCase()}}return t};p.format.named=function(t){t=t.toLowerCase();if(De[t]){return vt(De[t])}throw new Error("unknown color name: "+t)};p.autodetect.push({p:5,test:function(t){var e=[],r=arguments.length-1;while(r-- >0)e[r]=arguments[r+1];if(!e.length&&Fe(t)==="string"&&De[t.toLowerCase()]){return"named"}}});var We=l.unpack;var He=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=We(t,"rgb");var i=r[0];var n=r[1];var s=r[2];return(i<<16)+(n<<8)+s};var Ne=He;var Ue=l.type;var ze=function(t){if(Ue(t)=="number"&&t>=0&&t<=16777215){var e=t>>16;var r=t>>8&255;var i=t&255;return[e,r,i,1]}throw new Error("unknown num color: "+t)};var Ye=ze;var Ve=l.type;R.prototype.num=function(){return Ne(this._rgb)};S.num=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["num"])))};p.format.num=Ye;p.autodetect.push({p:5,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];if(t.length===1&&Ve(t[0])==="number"&&t[0]>=0&&t[0]<=16777215){return"num"}}});var Ge=l.unpack;var Ze=l.type;var Ke=Math.round;R.prototype.rgb=function(t){if(t===void 0)t=true;if(t===false){return this._rgb.slice(0,3)}return this._rgb.slice(0,3).map(Ke)};R.prototype.rgba=function(r){if(r===void 0)r=true;return this._rgb.slice(0,4).map(function(t,e){return e<3?r===false?t:Ke(t):t})};S.rgb=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["rgb"])))};p.format.rgb=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=Ge(t,"rgba");if(r[3]===undefined){r[3]=1}return r};p.autodetect.push({p:3,test:function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];t=Ge(t,"rgba");if(Ze(t)==="array"&&(t.length===3||t.length===4&&Ze(t[3])=="number"&&t[3]>=0&&t[3]<=1)){return"rgb"}}});var Xe=Math.log;var qe=function(t){var e=t/100;var r,i,n;if(e<66){r=255;i=-155.25485562709179-.44596950469579133*(i=e-2)+104.49216199393888*Xe(i);n=e<20?0:-254.76935184120902+.8274096064007395*(n=e-10)+115.67994401066147*Xe(n)}else{r=351.97690566805693+.114206453784165*(r=e-55)-40.25366309332127*Xe(r);i=325.4494125711974+.07943456536662342*(i=e-50)-28.0852963507957*Xe(i);n=255}return[r,i,n,1]};var Je=qe;var $e=l.unpack;var Qe=Math.round;var tr=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=$e(t,"rgb");var i=r[0],n=r[2];var s=1e3;var o=4e4;var a=.4;var u;while(o-s>a){u=(o+s)*.5;var l=Je(u);if(l[2]/l[0]>=n/i){o=u}else{s=u}}return Qe(u)};var er=tr;R.prototype.temp=R.prototype.kelvin=R.prototype.temperature=function(){return er(this._rgb)};S.temp=S.kelvin=S.temperature=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];return new(Function.prototype.bind.apply(R,[null].concat(t,["temp"])))};p.format.temp=p.format.kelvin=p.format.temperature=Je;var rr=l.type;R.prototype.alpha=function(t,e){if(e===void 0)e=false;if(t!==undefined&&rr(t)==="number"){if(e){this._rgb[3]=t;return this}return new R([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb")}return this._rgb[3]};R.prototype.clipped=function(){return this._rgb._clipped||false};R.prototype.darken=function(t){if(t===void 0)t=1;var e=this;var r=e.lab();r[0]-=qt.Kn*t;return new R(r,"lab").alpha(e.alpha(),true)};R.prototype.brighten=function(t){if(t===void 0)t=1;return this.darken(-t)};R.prototype.darker=R.prototype.darken;R.prototype.brighter=R.prototype.brighten;R.prototype.get=function(t){var e=t.split(".");var r=e[0];var i=e[1];var n=this[r]();if(i){var s=r.indexOf(i);if(s>-1){return n[s]}throw new Error("unknown channel "+i+" in mode "+r)}else{return n}};var ir=l.type;var nr=Math.pow;var sr=1e-7;var or=20;R.prototype.luminance=function(n){if(n!==undefined&&ir(n)==="number"){if(n===0){return new R([0,0,0,this._rgb[3]],"rgb")}if(n===1){return new R([255,255,255,this._rgb[3]],"rgb")}var t=this.luminance();var s="rgb";var o=or;var a=function(t,e){var r=t.interpolate(e,.5,s);var i=r.luminance();if(Math.abs(n-i)<sr||!o--){return r}return i>n?a(t,r):a(r,e)};var e=(t>n?a(new R([0,0,0]),this):a(this,new R([255,255,255]))).rgb();return new R(e.concat([this._rgb[3]]))}return ar.apply(void 0,this._rgb.slice(0,3))};var ar=function(t,e,r){t=ur(t);e=ur(e);r=ur(r);return.2126*t+.7152*e+.0722*r};var ur=function(t){t/=255;return t<=.03928?t/12.92:nr((t+.055)/1.055,2.4)};var lr={};var fr=l.type;var hr=function(t,e,r){if(r===void 0)r=.5;var i=[],n=arguments.length-3;while(n-- >0)i[n]=arguments[n+3];var s=i[0]||"lrgb";if(!lr[s]&&!i.length){s=Object.keys(lr)[0]}if(!lr[s]){throw new Error("interpolation mode "+s+" is not defined")}if(fr(t)!=="object"){t=new R(t)}if(fr(e)!=="object"){e=new R(e)}return lr[s](t,e,r).alpha(t.alpha()+r*(e.alpha()-t.alpha()))};R.prototype.mix=R.prototype.interpolate=function(t,e){if(e===void 0)e=.5;var r=[],i=arguments.length-2;while(i-- >0)r[i]=arguments[i+2];return hr.apply(void 0,[this,t,e].concat(r))};R.prototype.premultiply=function(t){if(t===void 0)t=false;var e=this._rgb;var r=e[3];if(t){this._rgb=[e[0]*r,e[1]*r,e[2]*r,r];return this}else{return new R([e[0]*r,e[1]*r,e[2]*r,r],"rgb")}};R.prototype.saturate=function(t){if(t===void 0)t=1;var e=this;var r=e.lch();r[1]+=qt.Kn*t;if(r[1]<0){r[1]=0}return new R(r,"lch").alpha(e.alpha(),true)};R.prototype.desaturate=function(t){if(t===void 0)t=1;return this.saturate(-t)};var cr=l.type;R.prototype.set=function(t,e,r){if(r===void 0)r=false;var i=t.split(".");var n=i[0];var s=i[1];var o=this[n]();if(s){var a=n.indexOf(s);if(a>-1){if(cr(e)=="string"){switch(e.charAt(0)){case"+":o[a]+=+e;break;case"-":o[a]+=+e;break;case"*":o[a]*=+e.substr(1);break;case"/":o[a]/=+e.substr(1);break;default:o[a]=+e}}else if(cr(e)==="number"){o[a]=e}else{throw new Error("unsupported value for Color.set")}var u=new R(o,n);if(r){this._rgb=u._rgb;return this}return u}throw new Error("unknown channel "+s+" in mode "+n)}else{return o}};var dr=function(t,e,r){var i=t._rgb;var n=e._rgb;return new R(i[0]+r*(n[0]-i[0]),i[1]+r*(n[1]-i[1]),i[2]+r*(n[2]-i[2]),"rgb")};lr.rgb=dr;var pr=Math.sqrt;var gr=Math.pow;var yr=function(t,e,r){var i=t._rgb;var n=i[0];var s=i[1];var o=i[2];var a=e._rgb;var u=a[0];var l=a[1];var f=a[2];return new R(pr(gr(n,2)*(1-r)+gr(u,2)*r),pr(gr(s,2)*(1-r)+gr(l,2)*r),pr(gr(o,2)*(1-r)+gr(f,2)*r),"rgb")};lr.lrgb=yr;var br=function(t,e,r){var i=t.lab();var n=e.lab();return new R(i[0]+r*(n[0]-i[0]),i[1]+r*(n[1]-i[1]),i[2]+r*(n[2]-i[2]),"lab")};lr.lab=br;var mr=function(t,e,r,i){var n,s;var o,a;if(i==="hsl"){o=t.hsl();a=e.hsl()}else if(i==="hsv"){o=t.hsv();a=e.hsv()}else if(i==="hcg"){o=t.hcg();a=e.hcg()}else if(i==="hsi"){o=t.hsi();a=e.hsi()}else if(i==="lch"||i==="hcl"){i="hcl";o=t.hcl();a=e.hcl()}var u,l,f,h,c,d;if(i.substr(0,1)==="h"){n=o,u=n[0],f=n[1],c=n[2];s=a,l=s[0],h=s[1],d=s[2]}var p,g,y,b;if(!isNaN(u)&&!isNaN(l)){if(l>u&&l-u>180){b=l-(u+360)}else if(l<u&&u-l>180){b=l+360-u}else{b=l-u}g=u+r*b}else if(!isNaN(u)){g=u;if((d==1||d==0)&&i!="hsv"){p=f}}else if(!isNaN(l)){g=l;if((c==1||c==0)&&i!="hsv"){p=h}}else{g=Number.NaN}if(p===undefined){p=f+r*(h-f)}y=c+r*(d-c);return new R([g,p,y],i)};var vr=function(t,e,r){return mr(t,e,r,"lch")};lr.lch=vr;lr.hcl=vr;var wr=function(t,e,r){var i=t.num();var n=e.num();return new R(i+r*(n-i),"num")};lr.num=wr;var _r=function(t,e,r){return mr(t,e,r,"hcg")};lr.hcg=_r;var xr=function(t,e,r){return mr(t,e,r,"hsi")};lr.hsi=xr;var Cr=function(t,e,r){return mr(t,e,r,"hsl")};lr.hsl=Cr;var kr=function(t,e,r){return mr(t,e,r,"hsv")};lr.hsv=kr;var Tr=l.clip_rgb;var Sr=Math.pow;var Er=Math.sqrt;var Ar=Math.PI;var Rr=Math.cos;var Br=Math.sin;var Or=Math.atan2;var Pr=function(t,s,o){if(s===void 0)s="lrgb";if(o===void 0)o=null;var e=t.length;if(!o){o=Array.from(new Array(e)).map(function(){return 1})}var r=e/o.reduce(function(t,e){return t+e});o.forEach(function(t,e){o[e]*=r});t=t.map(function(t){return new R(t)});if(s==="lrgb"){return Ir(t,o)}var i=t.shift();var a=i.get(s);var u=[];var l=0;var f=0;for(var n=0;n<a.length;n++){a[n]=(a[n]||0)*o[0];u.push(isNaN(a[n])?0:o[0]);if(s.charAt(n)==="h"&&!isNaN(a[n])){var h=a[n]/180*Ar;l+=Rr(h)*o[0];f+=Br(h)*o[0]}}var c=i.alpha()*o[0];t.forEach(function(t,e){var r=t.get(s);c+=t.alpha()*o[e+1];for(var i=0;i<a.length;i++){if(!isNaN(r[i])){u[i]+=o[e+1];if(s.charAt(i)==="h"){var n=r[i]/180*Ar;l+=Rr(n)*o[e+1];f+=Br(n)*o[e+1]}else{a[i]+=r[i]*o[e+1]}}}});for(var d=0;d<a.length;d++){if(s.charAt(d)==="h"){var p=Or(f/u[d],l/u[d])/Ar*180;while(p<0){p+=360}while(p>=360){p-=360}a[d]=p}else{a[d]=a[d]/u[d]}}c/=e;return new R(a,s).alpha(c>.99999?1:c,true)};var Ir=function(t,e){var r=t.length;var i=[0,0,0,0];for(var n=0;n<t.length;n++){var s=t[n];var o=e[n]/r;var a=s._rgb;i[0]+=Sr(a[0],2)*o;i[1]+=Sr(a[1],2)*o;i[2]+=Sr(a[2],2)*o;i[3]+=a[3]*o}i[0]=Er(i[0]);i[1]=Er(i[1]);i[2]=Er(i[2]);if(i[3]>.9999999){i[3]=1}return new R(Tr(i))};var Mr=l.type;var jr=Math.pow;var Lr=function(l){var u="rgb";var f=S("#ccc");var e=0;var h=[0,1];var c=[];var d=[0,0];var p=false;var g=[];var r=false;var y=0;var b=1;var i=false;var m={};var v=true;var w=1;var n=function(t){t=t||["#fff","#000"];if(t&&Mr(t)==="string"&&S.brewer&&S.brewer[t.toLowerCase()]){t=S.brewer[t.toLowerCase()]}if(Mr(t)==="array"){if(t.length===1){t=[t[0],t[0]]}t=t.slice(0);for(var e=0;e<t.length;e++){t[e]=S(t[e])}c.length=0;for(var r=0;r<t.length;r++){c.push(r/(t.length-1))}}s();return g=t};var _=function(t){if(p!=null){var e=p.length-1;var r=0;while(r<e&&t>=p[r]){r++}return r-1}return 0};var x=function(t){return t};var C=function(t){return t};var k=function(t,e){var r,i;if(e==null){e=false}if(isNaN(t)||t===null){return f}if(!e){if(p&&p.length>2){var n=_(t);i=n/(p.length-2)}else if(b!==y){i=(t-y)/(b-y)}else{i=1}}else{i=t}i=C(i);if(!e){i=x(i)}if(w!==1){i=jr(i,w)}i=d[0]+i*(1-d[0]-d[1]);i=Math.min(1,Math.max(0,i));var s=Math.floor(i*1e4);if(v&&m[s]){r=m[s]}else{if(Mr(g)==="array"){for(var o=0;o<c.length;o++){var a=c[o];if(i<=a){r=g[o];break}if(i>=a&&o===c.length-1){r=g[o];break}if(i>a&&i<c[o+1]){i=(i-a)/(c[o+1]-a);r=S.interpolate(g[o],g[o+1],i,u);break}}}else if(Mr(g)==="function"){r=g(i)}if(v){m[s]=r}}return r};var s=function(){return m={}};n(l);var T=function(t){var e=S(k(t));if(r&&e[r]){return e[r]()}else{return e}};T.classes=function(t){if(t!=null){if(Mr(t)==="array"){p=t;h=[t[0],t[t.length-1]]}else{var e=S.analyze(h);if(t===0){p=[e.min,e.max]}else{p=S.limits(e,"e",t)}}return T}return p};T.domain=function(r){if(!arguments.length){return h}y=r[0];b=r[r.length-1];c=[];var t=g.length;if(r.length===t&&y!==b){for(var e=0,i=Array.from(r);e<i.length;e+=1){var n=i[e];c.push((n-y)/(b-y))}}else{for(var s=0;s<t;s++){c.push(s/(t-1))}if(r.length>2){var o=r.map(function(t,e){return e/(r.length-1)});var a=r.map(function(t){return(t-y)/(b-y)});if(!a.every(function(t,e){return o[e]===t})){C=function(t){if(t<=0||t>=1){return t}var e=0;while(t>=a[e+1]){e++}var r=(t-a[e])/(a[e+1]-a[e]);var i=o[e]+r*(o[e+1]-o[e]);return i}}}}h=[y,b];return T};T.mode=function(t){if(!arguments.length){return u}u=t;s();return T};T.range=function(t,e){n(t,e);return T};T.out=function(t){r=t;return T};T.spread=function(t){if(!arguments.length){return e}e=t;return T};T.correctLightness=function(t){if(t==null){t=true}i=t;s();if(i){x=function(t){var e=k(0,true).lab()[0];var r=k(1,true).lab()[0];var i=e>r;var n=k(t,true).lab()[0];var s=e+(r-e)*t;var o=n-s;var a=0;var u=1;var l=20;while(Math.abs(o)>.01&&l-- >0){(function(){if(i){o*=-1}if(o<0){a=t;t+=(u-t)*.5}else{u=t;t+=(a-t)*.5}n=k(t,true).lab()[0];return o=n-s})()}return t}}else{x=function(t){return t}}return T};T.padding=function(t){if(t!=null){if(Mr(t)==="number"){t=[t,t]}d=t;return T}else{return d}};T.colors=function(e,r){if(arguments.length<2){r="hex"}var t=[];if(arguments.length===0){t=g.slice(0)}else if(e===1){t=[T(.5)]}else if(e>1){var i=h[0];var n=h[1]-i;t=Dr(0,e,false).map(function(t){return T(i+t/(e-1)*n)})}else{l=[];var s=[];if(p&&p.length>2){for(var o=1,a=p.length,u=1<=a;u?o<a:o>a;u?o++:o--){s.push((p[o-1]+p[o])*.5)}}else{s=h}t=s.map(function(t){return T(t)})}if(S[r]){t=t.map(function(t){return t[r]()})}return t};T.cache=function(t){if(t!=null){v=t;return T}else{return v}};T.gamma=function(t){if(t!=null){w=t;return T}else{return w}};T.nodata=function(t){if(t!=null){f=S(t);return T}else{return f}};return T};function Dr(t,e,r){var i=[];var n=t<e;var s=!r?e:n?e+1:e-1;for(var o=t;n?o<s:o>s;n?o++:o--){i.push(o)}return i}var Fr=function(t){var e,r,i;var n,s,o,a;t=t.map(function(t){return new R(t)});if(t.length===2){e=t.map(function(t){return t.lab()}),s=e[0],o=e[1];n=function(e){var t=[0,1,2].map(function(t){return s[t]+e*(o[t]-s[t])});return new R(t,"lab")}}else if(t.length===3){r=t.map(function(t){return t.lab()}),s=r[0],o=r[1],a=r[2];n=function(e){var t=[0,1,2].map(function(t){return(1-e)*(1-e)*s[t]+2*(1-e)*e*o[t]+e*e*a[t]});return new R(t,"lab")}}else if(t.length===4){var u;i=t.map(function(t){return t.lab()}),s=i[0],o=i[1],a=i[2],u=i[3];n=function(e){var t=[0,1,2].map(function(t){return(1-e)*(1-e)*(1-e)*s[t]+3*(1-e)*(1-e)*e*o[t]+3*(1-e)*e*e*a[t]+e*e*e*u[t]});return new R(t,"lab")}}else if(t.length===5){var l=Fr(t.slice(0,3));var f=Fr(t.slice(2,5));n=function(t){if(t<.5){return l(t*2)}else{return f((t-.5)*2)}}}return n};var Wr=function(t){var e=Fr(t);e.scale=function(){return Lr(e)};return e};var Hr=function(t,e,r){if(!Hr[r]){throw new Error("unknown blend mode "+r)}return Hr[r](t,e)};var Nr=function(n){return function(t,e){var r=S(e).rgb();var i=S(t).rgb();return S.rgb(n(r,i))}};var Ur=function(i){return function(t,e){var r=[];r[0]=i(t[0],e[0]);r[1]=i(t[1],e[1]);r[2]=i(t[2],e[2]);return r}};var zr=function(t){return t};var Yr=function(t,e){return t*e/255};var Vr=function(t,e){return t>e?e:t};var Gr=function(t,e){return t>e?t:e};var Zr=function(t,e){return 255*(1-(1-t/255)*(1-e/255))};var Kr=function(t,e){return e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255))};var Xr=function(t,e){return 255*(1-(1-e/255)/(t/255))};var qr=function(t,e){if(t===255){return 255}t=255*(e/255)/(1-t/255);return t>255?255:t};Hr.normal=Nr(Ur(zr));Hr.multiply=Nr(Ur(Yr));Hr.screen=Nr(Ur(Zr));Hr.overlay=Nr(Ur(Kr));Hr.darken=Nr(Ur(Vr));Hr.lighten=Nr(Ur(Gr));Hr.dodge=Nr(Ur(qr));Hr.burn=Nr(Ur(Xr));var Jr=Hr;var $r=l.type;var Qr=l.clip_rgb;var ti=l.TWOPI;var ei=Math.pow;var ri=Math.sin;var ii=Math.cos;var ni=function(f,h,c,d,p){if(f===void 0)f=300;if(h===void 0)h=-1.5;if(c===void 0)c=1;if(d===void 0)d=1;if(p===void 0)p=[0,1];var g=0,y;if($r(p)==="array"){y=p[1]-p[0]}else{y=0;p=[p,p]}var e=function(t){var e=ti*((f+120)/360+h*t);var r=ei(p[0]+y*t,d);var i=g!==0?c[0]+t*g:c;var n=i*r*(1-r)/2;var s=ii(e);var o=ri(e);var a=r+n*(-.14861*s+1.78277*o);var u=r+n*(-.29227*s-.90649*o);var l=r+n*(+1.97294*s);return S(Qr([a*255,u*255,l*255,1]))};e.start=function(t){if(t==null){return f}f=t;return e};e.rotations=function(t){if(t==null){return h}h=t;return e};e.gamma=function(t){if(t==null){return d}d=t;return e};e.hue=function(t){if(t==null){return c}c=t;if($r(c)==="array"){g=c[1]-c[0];if(g===0){c=c[1]}}else{g=0}return e};e.lightness=function(t){if(t==null){return p}if($r(t)==="array"){p=t;y=t[1]-t[0]}else{p=[t,t];y=0}return e};e.scale=function(){return S.scale(e)};e.hue(c);return e};var si="0123456789abcdef";var oi=Math.floor;var ai=Math.random;var ui=function(){var t="#";for(var e=0;e<6;e++){t+=si.charAt(oi(ai()*16))}return new R(t,"hex")};var li=Math.log;var fi=Math.pow;var hi=Math.floor;var ci=Math.abs;var di=function(t,e){if(e===void 0)e=null;var r={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};if(U(t)==="object"){t=Object.values(t)}t.forEach(function(t){if(e&&U(t)==="object"){t=t[e]}if(t!==undefined&&t!==null&&!isNaN(t)){r.values.push(t);r.sum+=t;if(t<r.min){r.min=t}if(t>r.max){r.max=t}r.count+=1}});r.domain=[r.min,r.max];r.limits=function(t,e){return pi(r,t,e)};return r};var pi=function(t,e,r){if(e===void 0)e="equal";if(r===void 0)r=7;if(U(t)=="array"){t=di(t)}var i=t.min;var n=t.max;var s=t.values.sort(function(t,e){return t-e});if(r===1){return[i,n]}var o=[];if(e.substr(0,1)==="c"){o.push(i);o.push(n)}if(e.substr(0,1)==="e"){o.push(i);for(var a=1;a<r;a++){o.push(i+a/r*(n-i))}o.push(n)}else if(e.substr(0,1)==="l"){if(i<=0){throw new Error("Logarithmic scales are only possible for values > 0")}var u=Math.LOG10E*li(i);var l=Math.LOG10E*li(n);o.push(i);for(var f=1;f<r;f++){o.push(fi(10,u+f/r*(l-u)))}o.push(n)}else if(e.substr(0,1)==="q"){o.push(i);for(var h=1;h<r;h++){var c=(s.length-1)*h/r;var d=hi(c);if(d===c){o.push(s[d])}else{var p=c-d;o.push(s[d]*(1-p)+s[d+1]*p)}}o.push(n)}else if(e.substr(0,1)==="k"){var g;var y=s.length;var b=new Array(y);var m=new Array(r);var v=true;var w=0;var _=null;_=[];_.push(i);for(var x=1;x<r;x++){_.push(i+x/r*(n-i))}_.push(n);while(v){for(var C=0;C<r;C++){m[C]=0}for(var k=0;k<y;k++){var T=s[k];var S=Number.MAX_VALUE;var E=void 0;for(var A=0;A<r;A++){var R=ci(_[A]-T);if(R<S){S=R;E=A}m[E]++;b[k]=E}}var B=new Array(r);for(var O=0;O<r;O++){B[O]=null}for(var P=0;P<y;P++){g=b[P];if(B[g]===null){B[g]=s[P]}else{B[g]+=s[P]}}for(var I=0;I<r;I++){B[I]*=1/m[I]}v=false;for(var M=0;M<r;M++){if(B[M]!==_[M]){v=true;break}}_=B;w++;if(w>200){v=false}}var j={};for(var L=0;L<r;L++){j[L]=[]}for(var D=0;D<y;D++){g=b[D];j[g].push(s[D])}var F=[];for(var W=0;W<r;W++){F.push(j[W][0]);F.push(j[W][j[W].length-1])}F=F.sort(function(t,e){return t-e});o.push(F[0]);for(var H=1;H<F.length;H+=2){var N=F[H];if(!isNaN(N)&&o.indexOf(N)===-1){o.push(N)}}}return o};var gi={analyze:di,limits:pi};var yi=function(t,e){t=new R(t);e=new R(e);var r=t.luminance();var i=e.luminance();return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)};var bi=Math.sqrt;var mi=Math.atan2;var vi=Math.abs;var wi=Math.cos;var _i=Math.PI;var xi=function(t,e,r,i){if(r===void 0)r=1;if(i===void 0)i=1;t=new R(t);e=new R(e);var n=Array.from(t.lab());var s=n[0];var o=n[1];var a=n[2];var u=Array.from(e.lab());var l=u[0];var f=u[1];var h=u[2];var c=bi(o*o+a*a);var d=bi(f*f+h*h);var p=s<16?.511:.040975*s/(1+.01765*s);var g=.0638*c/(1+.0131*c)+.638;var y=c<1e-6?0:mi(a,o)*180/_i;while(y<0){y+=360}while(y>=360){y-=360}var b=y>=164&&y<=345?.56+vi(.2*wi(_i*(y+168)/180)):.36+vi(.4*wi(_i*(y+35)/180));var m=c*c*c*c;var v=bi(m/(m+1900));var w=g*(v*b+1-v);var _=s-l;var x=c-d;var C=o-f;var k=a-h;var T=C*C+k*k-x*x;var S=_/(r*p);var E=x/(i*g);var A=w;return bi(S*S+E*E+T/(A*A))};var Ci=function(t,e,r){if(r===void 0)r="lab";t=new R(t);e=new R(e);var i=t.get(r);var n=e.get(r);var s=0;for(var o in i){var a=(i[o]||0)-(n[o]||0);s+=a*a}return Math.sqrt(s)};var ki=function(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];try{new(Function.prototype.bind.apply(R,[null].concat(t)));return true}catch(t){return false}};var Ti={cool:function t(){return Lr([S.hsl(180,1,.9),S.hsl(250,.7,.4)])},hot:function t(){return Lr(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")}};var Si={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(var Ei=0,Ai=Object.keys(Si);Ei<Ai.length;Ei+=1){var Ri=Ai[Ei];Si[Ri.toLowerCase()]=Si[Ri]}var Bi=Si;S.average=Pr;S.bezier=Wr;S.blend=Jr;S.cubehelix=ni;S.mix=S.interpolate=hr;S.random=ui;S.scale=Lr;S.analyze=gi.analyze;S.contrast=yi;S.deltaE=xi;S.distance=Ci;S.limits=gi.limits;S.valid=ki;S.scales=Ti;S.colors=De;S.brewer=Bi;var Oi=S;return Oi})},{}],60:[function(t,e,r){"use strict";var s=t("./lib/thunk.js");function o(){this.argTypes=[];this.shimArgs=[];this.arrayArgs=[];this.arrayBlockIndices=[];this.scalarArgs=[];this.offsetArgs=[];this.offsetArgIndex=[];this.indexArgs=[];this.shapeArgs=[];this.funcName="";this.pre=null;this.body=null;this.post=null;this.debug=false}function i(t){var e=new o;e.pre=t.pre;e.body=t.body;e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i<r.length;++i){var n=r[i];if(n==="array"||typeof n==="object"&&n.blockIndices){e.argTypes[i]="array";e.arrayArgs.push(i);e.arrayBlockIndices.push(n.blockIndices?n.blockIndices:0);e.shimArgs.push("array"+i);if(i<e.pre.args.length&&e.pre.args[i].count>0){throw new Error("cwise: pre() block may not reference array args")}if(i<e.post.args.length&&e.post.args[i].count>0){throw new Error("cwise: post() block may not reference array args")}}else if(n==="scalar"){e.scalarArgs.push(i);e.shimArgs.push("scalar"+i)}else if(n==="index"){e.indexArgs.push(i);if(i<e.pre.args.length&&e.pre.args[i].count>0){throw new Error("cwise: pre() block may not reference array index")}if(i<e.body.args.length&&e.body.args[i].lvalue){throw new Error("cwise: body() block may not write to array index")}if(i<e.post.args.length&&e.post.args[i].count>0){throw new Error("cwise: post() block may not reference array index")}}else if(n==="shape"){e.shapeArgs.push(i);if(i<e.pre.args.length&&e.pre.args[i].lvalue){throw new Error("cwise: pre() block may not write to array shape")}if(i<e.body.args.length&&e.body.args[i].lvalue){throw new Error("cwise: body() block may not write to array shape")}if(i<e.post.args.length&&e.post.args[i].lvalue){throw new Error("cwise: post() block may not write to array shape")}}else if(typeof n==="object"&&n.offset){e.argTypes[i]="offset";e.offsetArgs.push({array:n.array,offset:n.offset});e.offsetArgIndex.push(i)}else{throw new Error("cwise: Unknown argument type "+r[i])}}if(e.arrayArgs.length<=0){throw new Error("cwise: No array arguments specified")}if(e.pre.args.length>r.length){throw new Error("cwise: Too many arguments in pre() block")}if(e.body.args.length>r.length){throw new Error("cwise: Too many arguments in body() block")}if(e.post.args.length>r.length){throw new Error("cwise: Too many arguments in post() block")}e.debug=!!t.printCode||!!t.debug;e.funcName=t.funcName||"cwise";e.blockSize=t.blockSize||64;return s(e)}e.exports=i},{"./lib/thunk.js":62}],61:[function(t,e,r){"use strict";var k=t("uniq");function T(t,e,r){var i=t.length,n=e.arrayArgs.length,s=e.indexArgs.length>0,o=[],a=[],u=0,l=0,f,h;for(f=0;f<i;++f){a.push(["i",f,"=0"].join(""))}for(h=0;h<n;++h){for(f=0;f<i;++f){l=u;u=t[f];if(f===0){a.push(["d",h,"s",f,"=t",h,"p",u].join(""))}else{a.push(["d",h,"s",f,"=(t",h,"p",u,"-s",l,"*t",h,"p",l,")"].join(""))}}}if(a.length>0){o.push("var "+a.join(","))}for(f=i-1;f>=0;--f){u=t[f];o.push(["for(i",f,"=0;i",f,"<s",u,";++i",f,"){"].join(""))}o.push(r);for(f=0;f<i;++f){l=u;u=t[f];for(h=0;h<n;++h){o.push(["p",h,"+=d",h,"s",f].join(""))}if(s){if(f>0){o.push(["index[",l,"]-=s",l].join(""))}o.push(["++index[",u,"]"].join(""))}o.push("}")}return o.join("\n")}function S(t,e,r,i){var n=e.length,s=r.arrayArgs.length,o=r.blockSize,a=r.indexArgs.length>0,u=[];for(var l=0;l<s;++l){u.push(["var offset",l,"=p",l].join(""))}for(var l=t;l<n;++l){u.push(["for(var j"+l+"=SS[",e[l],"]|0;j",l,">0;){"].join(""));u.push(["if(j",l,"<",o,"){"].join(""));u.push(["s",e[l],"=j",l].join(""));u.push(["j",l,"=0"].join(""));u.push(["}else{s",e[l],"=",o].join(""));u.push(["j",l,"-=",o,"}"].join(""));if(a){u.push(["index[",e[l],"]=j",l].join(""))}}for(var l=0;l<s;++l){var f=["offset"+l];for(var h=t;h<n;++h){f.push(["j",h,"*t",l,"p",e[h]].join(""))}u.push(["p",l,"=(",f.join("+"),")"].join(""))}u.push(T(e,r,i));for(var l=t;l<n;++l){u.push("}")}return u.join("\n")}function E(t){var e=0,r=t[0].length;while(e<r){for(var i=1;i<t.length;++i){if(t[i][e]!==t[0][e]){return e}}++e}return e}function A(t,e,r){var i=t.body;var n=[];var s=[];for(var o=0;o<t.args.length;++o){var a=t.args[o];if(a.count<=0){continue}var u=new RegExp(a.name,"g");var l="";var f=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case"offset":var h=e.offsetArgIndex.indexOf(o);var c=e.offsetArgs[h];f=c.array;l="+q"+h;case"array":l="p"+f+l;var d="l"+o;var p="a"+f;if(e.arrayBlockIndices[f]===0){if(a.count===1){if(r[f]==="generic"){if(a.lvalue){n.push(["var ",d,"=",p,".get(",l,")"].join(""));i=i.replace(u,d);s.push([p,".set(",l,",",d,")"].join(""))}else{i=i.replace(u,[p,".get(",l,")"].join(""))}}else{i=i.replace(u,[p,"[",l,"]"].join(""))}}else if(r[f]==="generic"){n.push(["var ",d,"=",p,".get(",l,")"].join(""));i=i.replace(u,d);if(a.lvalue){s.push([p,".set(",l,",",d,")"].join(""))}}else{n.push(["var ",d,"=",p,"[",l,"]"].join(""));i=i.replace(u,d);if(a.lvalue){s.push([p,"[",l,"]=",d].join(""))}}}else{var g=[a.name],y=[l];for(var b=0;b<Math.abs(e.arrayBlockIndices[f]);b++){g.push("\\s*\\[([^\\]]+)\\]");y.push("$"+(b+1)+"*t"+f+"b"+b)}u=new RegExp(g.join(""),"g");l=y.join("+");if(r[f]==="generic"){throw new Error("cwise: Generic arrays not supported in combination with blocks!")}else{i=i.replace(u,[p,"[",l,"]"].join(""))}}break;case"scalar":i=i.replace(u,"Y"+e.scalarArgs.indexOf(o));break;case"index":i=i.replace(u,"index");break;case"shape":i=i.replace(u,"shape");break}}return[n.join("\n"),i,s.join("\n")].join("\n").trim()}function R(t){var e=new Array(t.length);var r=true;for(var i=0;i<t.length;++i){var n=t[i];var s=n.match(/\d+/);if(!s){s=""}else{s=s[0]}if(n.charAt(0)===0){e[i]="u"+n.charAt(1)+s}else{e[i]=n.charAt(0)+s}if(i>0){r=r&&e[i]===e[i-1]}}if(r){return e[0]}return e.join("")}function i(t,e){var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0;var i=new Array(t.arrayArgs.length);var n=new Array(t.arrayArgs.length);for(var s=0;s<t.arrayArgs.length;++s){n[s]=e[2*s];i[s]=e[2*s+1]}var o=[],a=[];var u=[],l=[];var f=[];for(var s=0;s<t.arrayArgs.length;++s){if(t.arrayBlockIndices[s]<0){u.push(0);l.push(r);o.push(r);a.push(r+t.arrayBlockIndices[s])}else{u.push(t.arrayBlockIndices[s]);l.push(t.arrayBlockIndices[s]+r);o.push(0);a.push(t.arrayBlockIndices[s])}var h=[];for(var c=0;c<i[s].length;c++){if(u[s]<=i[s][c]&&i[s][c]<l[s]){h.push(i[s][c]-u[s])}}f.push(h)}var d=["SS"];var p=["'use strict'"];var g=[];for(var c=0;c<r;++c){g.push(["s",c,"=SS[",c,"]"].join(""))}for(var s=0;s<t.arrayArgs.length;++s){d.push("a"+s);d.push("t"+s);d.push("p"+s);for(var c=0;c<r;++c){g.push(["t",s,"p",c,"=t",s,"[",u[s]+c,"]"].join(""))}for(var c=0;c<Math.abs(t.arrayBlockIndices[s]);++c){g.push(["t",s,"b",c,"=t",s,"[",o[s]+c,"]"].join(""))}}for(var s=0;s<t.scalarArgs.length;++s){d.push("Y"+s)}if(t.shapeArgs.length>0){g.push("shape=SS.slice(0)")}if(t.indexArgs.length>0){var y=new Array(r);for(var s=0;s<r;++s){y[s]="0"}g.push(["index=[",y.join(","),"]"].join(""))}for(var s=0;s<t.offsetArgs.length;++s){var b=t.offsetArgs[s];var m=[];for(var c=0;c<b.offset.length;++c){if(b.offset[c]===0){continue}else if(b.offset[c]===1){m.push(["t",b.array,"p",c].join(""))}else{m.push([b.offset[c],"*t",b.array,"p",c].join(""))}}if(m.length===0){g.push("q"+s+"=0")}else{g.push(["q",s,"=",m.join("+")].join(""))}}var v=k([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));g=g.concat(v);if(g.length>0){p.push("var "+g.join(","))}for(var s=0;s<t.arrayArgs.length;++s){p.push("p"+s+"|=0")}if(t.pre.body.length>3){p.push(A(t.pre,t,n))}var w=A(t.body,t,n);var _=E(f);if(_<r){p.push(S(_,f[0],t,w))}else{p.push(T(f[0],t,w))}if(t.post.body.length>3){p.push(A(t.post,t,n))}if(t.debug){console.log("-----Generated cwise routine for ",e,":\n"+p.join("\n")+"\n----------")}var x=[t.funcName||"unnamed","_cwise_loop_",i[0].join("s"),"m",_,R(n)].join("");var C=new Function(["function ",x,"(",d.join(","),"){",p.join("\n"),"} return ",x].join(""));return C()}e.exports=i},{uniq:135}],62:[function(t,e,r){"use strict";var c=t("./compile.js");function i(t){var e=["'use strict'","var CACHED={}"];var r=[];var i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));var n=[];var s=[];var o=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")];var a=[],u=[];for(var l=0;l<t.arrayArgs.length;++l){var f=t.arrayArgs[l];r.push(["t",f,"=array",f,".dtype,","r",f,"=array",f,".order"].join(""));n.push("t"+f);n.push("r"+f);s.push("t"+f);s.push("r"+f+".join()");o.push("array"+f+".data");o.push("array"+f+".stride");o.push("array"+f+".offset|0");if(l>0){a.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[l])));u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[l])+"]")}}if(t.arrayArgs.length>1){e.push("if (!("+a.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')");e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {");e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')");e.push("}")}for(var l=0;l<t.scalarArgs.length;++l){o.push("scalar"+t.scalarArgs[l])}r.push(["type=[",s.join(","),"].join()"].join(""));r.push("proc=CACHED[type]");e.push("var "+r.join(","));e.push(["if(!proc){","CACHED[type]=proc=compile([",n.join(","),"])}","return proc(",o.join(","),")}"].join(""));if(t.debug){console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------")}var h=new Function("compile",e.join("\n"));return h(c.bind(undefined,t))}e.exports=i},{"./compile.js":61}],63:[function(t,e,r){"use strict";function i(t){var e=new Array(t);for(var r=0;r<t;++r){e[r]=r}return e}e.exports=i},{}],64:[function(t,e,r){e.exports=function(t){return t!=null&&(i(t)||n(t)||!!t._isBuffer)};function i(t){return!!t.constructor&&typeof t.constructor.isBuffer==="function"&&t.constructor.isBuffer(t)}function n(t){return typeof t.readFloatLE==="function"&&typeof t.slice==="function"&&i(t.slice(0,0))}},{}],65:[function(t,e,r){var i=t("./lib/encoder"),n=t("./lib/decoder");e.exports={encode:i,decode:n}},{"./lib/decoder":66,"./lib/encoder":67}],66:[function(t,e,r){(function(f){(function(){var l=function t(){"use strict";var $=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);var v=4017;var w=799;var _=3406;var x=2276;var C=1567;var k=3784;var T=5793;var S=2896;function e(){}function Q(t,e){var r=0,i=[],n,s,o=16;while(o>0&&!t[o-1])o--;i.push({children:[],index:0});var a=i[0],u;for(n=0;n<o;n++){for(s=0;s<t[n];s++){a=i.pop();a.children[a.index]=e[r];while(a.index>0){if(i.length===0)throw new Error("Could not recreate Huffman Table");a=i.pop()}a.index++;i.push(a);while(i.length<=n){i.push(u={children:[],index:0});a.children[a.index]=u.children;a=u}r++}if(n+1<o){i.push(u={children:[],index:0});a.children[a.index]=u.children;a=u}}return i[0].children}function tt(e,r,t,i,n,l,f,s,h,c){var o=t.precision;var a=t.samplesPerLine;var u=t.scanLines;var d=t.mcusPerLine;var p=t.progressive;var g=t.maxH,y=t.maxV;var b=r,m=0,v=0;function w(){if(v>0){v--;return m>>v&1}m=e[r++];if(m==255){var t=e[r++];if(t){throw new Error("unexpected marker: "+(m<<8|t).toString(16))}}v=7;return m>>>7}function _(t){var e=t,r;while((r=w())!==null){e=e[r];if(typeof e==="number")return e;if(typeof e!=="object")throw new Error("invalid huffman sequence")}return null}function x(t){var e=0;while(t>0){var r=w();if(r===null)return;e=e<<1|r;t--}return e}function C(t){var e=x(t);if(e>=1<<t-1)return e;return e+(-1<<t)+1}function k(t,e){var r=_(t.huffmanTableDC);var i=r===0?0:C(r);e[0]=t.pred+=i;var n=1;while(n<64){var s=_(t.huffmanTableAC);var o=s&15,a=s>>4;if(o===0){if(a<15)break;n+=16;continue}n+=a;var u=$[n];e[u]=C(o);n++}}function T(t,e){var r=_(t.huffmanTableDC);var i=r===0?0:C(r)<<h;e[0]=t.pred+=i}function S(t,e){e[0]|=w()<<h}var E=0;function A(t,e){if(E>0){E--;return}var r=l,i=f;while(r<=i){var n=_(t.huffmanTableAC);var s=n&15,o=n>>4;if(s===0){if(o<15){E=x(o)+(1<<o)-1;break}r+=16;continue}r+=o;var a=$[r];e[a]=C(s)*(1<<h);r++}}var R=0,B;function O(t,e){var r=l,i=f,n=0;while(r<=i){var s=$[r];var o=e[s]<0?-1:1;switch(R){case 0:var a=_(t.huffmanTableAC);var u=a&15,n=a>>4;if(u===0){if(n<15){E=x(n)+(1<<n);R=4}else{n=16;R=1}}else{if(u!==1)throw new Error("invalid ACn encoding");B=C(u);R=n?2:3}continue;case 1:case 2:if(e[s])e[s]+=(w()<<h)*o;else{n--;if(n===0)R=R==2?3:0}break;case 3:if(e[s])e[s]+=(w()<<h)*o;else{e[s]=B<<h;R=0}break;case 4:if(e[s])e[s]+=(w()<<h)*o;break}r++}if(R===4){E--;if(E===0)R=0}}function P(t,e,r,i,n){var s=r/d|0;var o=r%d;var a=s*t.v+i;var u=o*t.h+n;if(t.blocks[a]===undefined&&c.tolerantDecoding)return;e(t,t.blocks[a][u])}function I(t,e,r){var i=r/t.blocksPerLine|0;var n=r%t.blocksPerLine;if(t.blocks[i]===undefined&&c.tolerantDecoding)return;e(t,t.blocks[i][n])}var M=i.length;var j,L,D,F,W;var H;if(p){if(l===0)H=s===0?T:S;else H=s===0?A:O}else{H=k}var N=0,U;var z;if(M==1){z=i[0].blocksPerLine*i[0].blocksPerColumn}else{z=d*t.mcusPerColumn}if(!n)n=z;var Y,V;while(N<z){for(L=0;L<M;L++)i[L].pred=0;E=0;if(M==1){j=i[0];for(W=0;W<n;W++){I(j,H,N);N++}}else{for(W=0;W<n;W++){for(L=0;L<M;L++){j=i[L];Y=j.h;V=j.v;for(D=0;D<V;D++){for(F=0;F<Y;F++){P(j,H,N,D,F)}}}N++;if(N===z)break}}if(N===z){do{if(e[r]===255){if(e[r+1]!==0){break}}r+=1}while(r<e.length-2)}v=0;U=e[r]<<8|e[r+1];if(U<65280){throw new Error("marker was not found")}if(U>=65488&&U<=65495){r+=2}else break}return r-b}function et(t,m){var e=[];var r=m.blocksPerLine;var i=m.blocksPerColumn;var n=r<<3;var s=new Int32Array(64),o=new Uint8Array(64);function a(t,e,r){var i=m.quantizationTable;var n,s,o,a,u,l,f,h,c;var d=r;var p;for(p=0;p<64;p++)d[p]=t[p]*i[p];for(p=0;p<8;++p){var g=8*p;if(d[1+g]==0&&d[2+g]==0&&d[3+g]==0&&d[4+g]==0&&d[5+g]==0&&d[6+g]==0&&d[7+g]==0){c=T*d[0+g]+512>>10;d[0+g]=c;d[1+g]=c;d[2+g]=c;d[3+g]=c;d[4+g]=c;d[5+g]=c;d[6+g]=c;d[7+g]=c;continue}n=T*d[0+g]+128>>8;s=T*d[4+g]+128>>8;o=d[2+g];a=d[6+g];u=S*(d[1+g]-d[7+g])+128>>8;h=S*(d[1+g]+d[7+g])+128>>8;l=d[3+g]<<4;f=d[5+g]<<4;c=n-s+1>>1;n=n+s+1>>1;s=c;c=o*k+a*C+128>>8;o=o*C-a*k+128>>8;a=c;c=u-f+1>>1;u=u+f+1>>1;f=c;c=h+l+1>>1;l=h-l+1>>1;h=c;c=n-a+1>>1;n=n+a+1>>1;a=c;c=s-o+1>>1;s=s+o+1>>1;o=c;c=u*x+h*_+2048>>12;u=u*_-h*x+2048>>12;h=c;c=l*w+f*v+2048>>12;l=l*v-f*w+2048>>12;f=c;d[0+g]=n+h;d[7+g]=n-h;d[1+g]=s+f;d[6+g]=s-f;d[2+g]=o+l;d[5+g]=o-l;d[3+g]=a+u;d[4+g]=a-u}for(p=0;p<8;++p){var y=p;if(d[1*8+y]==0&&d[2*8+y]==0&&d[3*8+y]==0&&d[4*8+y]==0&&d[5*8+y]==0&&d[6*8+y]==0&&d[7*8+y]==0){c=T*r[p+0]+8192>>14;d[0*8+y]=c;d[1*8+y]=c;d[2*8+y]=c;d[3*8+y]=c;d[4*8+y]=c;d[5*8+y]=c;d[6*8+y]=c;d[7*8+y]=c;continue}n=T*d[0*8+y]+2048>>12;s=T*d[4*8+y]+2048>>12;o=d[2*8+y];a=d[6*8+y];u=S*(d[1*8+y]-d[7*8+y])+2048>>12;h=S*(d[1*8+y]+d[7*8+y])+2048>>12;l=d[3*8+y];f=d[5*8+y];c=n-s+1>>1;n=n+s+1>>1;s=c;c=o*k+a*C+2048>>12;o=o*C-a*k+2048>>12;a=c;c=u-f+1>>1;u=u+f+1>>1;f=c;c=h+l+1>>1;l=h-l+1>>1;h=c;c=n-a+1>>1;n=n+a+1>>1;a=c;c=s-o+1>>1;s=s+o+1>>1;o=c;c=u*x+h*_+2048>>12;u=u*_-h*x+2048>>12;h=c;c=l*w+f*v+2048>>12;l=l*v-f*w+2048>>12;f=c;d[0*8+y]=n+h;d[7*8+y]=n-h;d[1*8+y]=s+f;d[6*8+y]=s-f;d[2*8+y]=o+l;d[5*8+y]=o-l;d[3*8+y]=a+u;d[4*8+y]=a-u}for(p=0;p<64;++p){var b=128+(d[p]+8>>4);e[p]=b<0?0:b>255?255:b}}rt(n*i*8);var u,l;for(var f=0;f<i;f++){var h=f<<3;for(u=0;u<8;u++)e.push(new Uint8Array(n));for(var c=0;c<r;c++){a(m.blocks[f][c],o,s);var d=0,p=c<<3;for(l=0;l<8;l++){var g=e[h+l];for(u=0;u<8;u++)g[p+u]=o[d++]}}}return e}function R(t){return t<0?0:t>255?255:t}e.prototype={load:function t(e){var r=new XMLHttpRequest;r.open("GET",e,true);r.responseType="arraybuffer";r.onload=function(){var t=new Uint8Array(r.response||r.mozResponseArrayBuffer);this.parse(t);if(this.onload)this.onload()}.bind(this);r.send(null)},parse:function t(r){var e=this.opts.maxResolutionInMP*1e3*1e3;var i=0,n=r.length;function s(){var t=r[i]<<8|r[i+1];i+=2;return t}function o(){var t=s();var e=r.subarray(i,i+t-2);i+=e.length;return e}function a(t){var e=0,r=0;var i,n;for(n in t.components){if(t.components.hasOwnProperty(n)){i=t.components[n];if(e<i.h)e=i.h;if(r<i.v)r=i.v}}var s=Math.ceil(t.samplesPerLine/8/e);var o=Math.ceil(t.scanLines/8/r);for(n in t.components){if(t.components.hasOwnProperty(n)){i=t.components[n];var a=Math.ceil(Math.ceil(t.samplesPerLine/8)*i.h/e);var u=Math.ceil(Math.ceil(t.scanLines/8)*i.v/r);var l=s*i.h;var f=o*i.v;var h=f*l;var c=[];rt(h*256);for(var d=0;d<f;d++){var p=[];for(var g=0;g<l;g++)p.push(new Int32Array(64));c.push(p)}i.blocksPerLine=a;i.blocksPerColumn=u;i.blocks=c}}t.maxH=e;t.maxV=r;t.mcusPerLine=s;t.mcusPerColumn=o}var u=null;var l=null;var f=null;var h,c;var d=[],p=[];var g=[],y=[];var b=s();this.comments=[];if(b!=65496){throw new Error("SOI not found")}b=s();while(b!=65497){var m,v,w;switch(b){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var _=o();if(b===65534){var x=String.fromCharCode.apply(null,_);this.comments.push(x)}if(b===65504){if(_[0]===74&&_[1]===70&&_[2]===73&&_[3]===70&&_[4]===0){u={version:{major:_[5],minor:_[6]},densityUnits:_[7],xDensity:_[8]<<8|_[9],yDensity:_[10]<<8|_[11],thumbWidth:_[12],thumbHeight:_[13],thumbData:_.subarray(14,14+3*_[12]*_[13])}}}if(b===65505){if(_[0]===69&&_[1]===120&&_[2]===105&&_[3]===102&&_[4]===0){this.exifBuffer=_.subarray(5,_.length)}}if(b===65518){if(_[0]===65&&_[1]===100&&_[2]===111&&_[3]===98&&_[4]===101&&_[5]===0){l={version:_[6],flags0:_[7]<<8|_[8],flags1:_[9]<<8|_[10],transformCode:_[11]}}}break;case 65499:var C=s();var k=C+i-2;while(i<k){var T=r[i++];rt(64*4);var S=new Int32Array(64);if(T>>4===0){for(v=0;v<64;v++){var E=$[v];S[E]=r[i++]}}else if(T>>4===1){for(v=0;v<64;v++){var E=$[v];S[E]=s()}}else throw new Error("DQT: invalid table spec");d[T&15]=S}break;case 65472:case 65473:case 65474:s();h={};h.extended=b===65473;h.progressive=b===65474;h.precision=r[i++];h.scanLines=s();h.samplesPerLine=s();h.components={};h.componentsOrder=[];var A=h.scanLines*h.samplesPerLine;if(A>e){var R=Math.ceil((A-e)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${R}MP`)}var B=r[i++],O;var P=0,I=0;for(m=0;m<B;m++){O=r[i];var M=r[i+1]>>4;var j=r[i+1]&15;var L=r[i+2];h.componentsOrder.push(O);h.components[O]={h:M,v:j,quantizationIdx:L};i+=3}a(h);p.push(h);break;case 65476:var D=s();for(m=2;m<D;){var F=r[i++];var W=new Uint8Array(16);var H=0;for(v=0;v<16;v++,i++){H+=W[v]=r[i]}rt(16+H);var N=new Uint8Array(H);for(v=0;v<H;v++,i++)N[v]=r[i];m+=17+H;(F>>4===0?y:g)[F&15]=Q(W,N)}break;case 65501:s();c=s();break;case 65498:var U=s();var z=r[i++];var Y=[],V;for(m=0;m<z;m++){V=h.components[r[i++]];var G=r[i++];V.huffmanTableDC=y[G>>4];V.huffmanTableAC=g[G&15];Y.push(V)}var Z=r[i++];var K=r[i++];var X=r[i++];var q=tt(r,i,h,Y,c,Z,K,X>>4,X&15,this.opts);i+=q;break;case 65535:if(r[i]!==255){i--}break;default:if(r[i-3]==255&&r[i-2]>=192&&r[i-2]<=254){i-=3;break}throw new Error("unknown JPEG marker "+b.toString(16))}b=s()}if(p.length!=1)throw new Error("only single frame JPEGs supported");for(var m=0;m<p.length;m++){var J=p[m].components;for(var v in J){J[v].quantizationTable=d[J[v].quantizationIdx];delete J[v].quantizationIdx}}this.width=h.samplesPerLine;this.height=h.scanLines;this.jfif=u;this.adobe=l;this.components=[];for(var m=0;m<h.componentsOrder.length;m++){var V=h.components[h.componentsOrder[m]];this.components.push({lines:et(h,V),scaleX:V.h/h.maxH,scaleY:V.v/h.maxV})}},getData:function t(e,r){var i=this.width/e,n=this.height/r;var s,o,a,u;var l,f,h,c;var d,p;var g=0;var y,b,m,v,w,_,x,C,k,T;var S;var E=e*r*this.components.length;rt(E);var A=new Uint8Array(E);switch(this.components.length){case 1:s=this.components[0];for(p=0;p<r;p++){l=s.lines[0|p*s.scaleY*n];for(d=0;d<e;d++){y=l[0|d*s.scaleX*i];A[g++]=y}}break;case 2:s=this.components[0];o=this.components[1];for(p=0;p<r;p++){l=s.lines[0|p*s.scaleY*n];f=o.lines[0|p*o.scaleY*n];for(d=0;d<e;d++){y=l[0|d*s.scaleX*i];A[g++]=y;y=f[0|d*o.scaleX*i];A[g++]=y}}break;case 3:S=true;if(this.adobe&&this.adobe.transformCode)S=true;else if(typeof this.opts.colorTransform!=="undefined")S=!!this.opts.colorTransform;s=this.components[0];o=this.components[1];a=this.components[2];for(p=0;p<r;p++){l=s.lines[0|p*s.scaleY*n];f=o.lines[0|p*o.scaleY*n];h=a.lines[0|p*a.scaleY*n];for(d=0;d<e;d++){if(!S){C=l[0|d*s.scaleX*i];k=f[0|d*o.scaleX*i];T=h[0|d*a.scaleX*i]}else{y=l[0|d*s.scaleX*i];b=f[0|d*o.scaleX*i];m=h[0|d*a.scaleX*i];C=R(y+1.402*(m-128));k=R(y-.3441363*(b-128)-.71413636*(m-128));T=R(y+1.772*(b-128))}A[g++]=C;A[g++]=k;A[g++]=T}}break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");S=false;if(this.adobe&&this.adobe.transformCode)S=true;else if(typeof this.opts.colorTransform!=="undefined")S=!!this.opts.colorTransform;s=this.components[0];o=this.components[1];a=this.components[2];u=this.components[3];for(p=0;p<r;p++){l=s.lines[0|p*s.scaleY*n];f=o.lines[0|p*o.scaleY*n];h=a.lines[0|p*a.scaleY*n];c=u.lines[0|p*u.scaleY*n];for(d=0;d<e;d++){if(!S){w=l[0|d*s.scaleX*i];_=f[0|d*o.scaleX*i];x=h[0|d*a.scaleX*i];v=c[0|d*u.scaleX*i]}else{y=l[0|d*s.scaleX*i];b=f[0|d*o.scaleX*i];m=h[0|d*a.scaleX*i];v=c[0|d*u.scaleX*i];w=255-R(y+1.402*(m-128));_=255-R(y-.3441363*(b-128)-.71413636*(m-128));x=255-R(y+1.772*(b-128))}A[g++]=255-w;A[g++]=255-_;A[g++]=255-x;A[g++]=255-v}}break;default:throw new Error("Unsupported color mode")}return A},copyToImageData:function t(e,r){var i=e.width,n=e.height;var s=e.data;var o=this.getData(i,n);var a=0,u=0,l,f;var h,c,d,p,g,y,b;switch(this.components.length){case 1:for(f=0;f<n;f++){for(l=0;l<i;l++){h=o[a++];s[u++]=h;s[u++]=h;s[u++]=h;if(r){s[u++]=255}}}break;case 3:for(f=0;f<n;f++){for(l=0;l<i;l++){g=o[a++];y=o[a++];b=o[a++];s[u++]=g;s[u++]=y;s[u++]=b;if(r){s[u++]=255}}}break;case 4:for(f=0;f<n;f++){for(l=0;l<i;l++){d=o[a++];p=o[a++];h=o[a++];c=o[a++];g=255-R(d*(1-c/255)+c);y=255-R(p*(1-c/255)+c);b=255-R(h*(1-c/255)+c);s[u++]=g;s[u++]=y;s[u++]=b;if(r){s[u++]=255}}}break;default:throw new Error("Unsupported color mode")}}};var i=0;var n=0;function rt(t=0){var e=i+t;if(e>n){var r=Math.ceil((e-n)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}i=e}e.resetMaxMemoryUsage=function(t){i=0;n=t};e.getBytesAllocated=function(){return i};e.requestMemoryAllocation=rt;return e}();if(typeof e!=="undefined"){e.exports=t}else if(typeof window!=="undefined"){window["jpeg-js"]=window["jpeg-js"]||{};window["jpeg-js"].decode=t}function t(t,e={}){var r={colorTransform:undefined,useTArray:false,formatAsRGBA:true,tolerantDecoding:true,maxResolutionInMP:100,maxMemoryUsageInMB:512};var i={...r,...e};var n=new Uint8Array(t);var s=new l;s.opts=i;l.resetMaxMemoryUsage(i.maxMemoryUsageInMB*1024*1024);s.parse(n);var o=i.formatAsRGBA?4:3;var a=s.width*s.height*o;try{l.requestMemoryAllocation(a);var u={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:i.useTArray?new Uint8Array(a):new f(a)};if(s.comments.length>0){u["comments"]=s.comments}}catch(t){if(t instanceof RangeError){throw new Error("Could not allocate enough memory for the image. "+"Required: "+a)}else{throw t}}s.copyToImageData(u,i.formatAsRGBA);return u}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:147}],67:[function(t,et,e){(function(tt){(function(){var $=$||function(t){return new tt(t).toString("base64")};function n(r){var t=this;var e=Math.round;var h=Math.floor;var c=new Array(64);var d=new Array(64);var k=new Array(64);var T=new Array(64);var S;var E;var A;var R;var w=new Array(65535);var _=new Array(65535);var Q=new Array(64);var x=new Array(64);var B=[];var O=0;var P=7;var I=new Array(64);var M=new Array(64);var j=new Array(64);var i=new Array(256);var L=new Array(2048);var n;var C=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63];var u=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0];var l=[0,1,2,3,4,5,6,7,8,9,10,11];var f=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125];var p=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250];var g=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0];var y=[0,1,2,3,4,5,6,7,8,9,10,11];var b=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119];var m=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function s(t){var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99];for(var r=0;r<64;r++){var i=h((e[r]*t+50)/100);if(i<1){i=1}else if(i>255){i=255}c[C[r]]=i}var n=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99];for(var s=0;s<64;s++){var o=h((n[s]*t+50)/100);if(o<1){o=1}else if(o>255){o=255}d[C[s]]=o}var a=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379];var u=0;for(var l=0;l<8;l++){for(var f=0;f<8;f++){k[u]=1/(c[C[u]]*a[l]*a[f]*8);T[u]=1/(d[C[u]]*a[l]*a[f]*8);u++}}}function o(t,e){var r=0;var i=0;var n=new Array;for(var s=1;s<=16;s++){for(var o=1;o<=t[s];o++){n[e[i]]=[];n[e[i]][0]=r;n[e[i]][1]=s;i++;r++}r*=2}return n}function a(){S=o(u,l);E=o(g,y);A=o(f,p);R=o(b,m)}function v(){var t=1;var e=2;for(var r=1;r<=15;r++){for(var i=t;i<e;i++){_[32767+i]=r;w[32767+i]=[];w[32767+i][1]=r;w[32767+i][0]=i}for(var n=-(e-1);n<=-t;n++){_[32767+n]=r;w[32767+n]=[];w[32767+n][1]=r;w[32767+n][0]=e-1+n}t<<=1;e<<=1}}function D(){for(var t=0;t<256;t++){L[t]=19595*t;L[t+256>>0]=38470*t;L[t+512>>0]=7471*t+32768;L[t+768>>0]=-11059*t;L[t+1024>>0]=-21709*t;L[t+1280>>0]=32768*t+8421375;L[t+1536>>0]=-27439*t;L[t+1792>>0]=-5329*t}}function F(t){var e=t[0];var r=t[1]-1;while(r>=0){if(e&1<<r){O|=1<<P}r--;P--;if(P<0){if(O==255){W(255);W(0)}else{W(O)}P=7;O=0}}}function W(t){B.push(t)}function H(t){W(t>>8&255);W(t&255)}function N(t,e){var r,i,n,s,o,a,u,l;var f=0;var h;var c=8;var d=64;for(h=0;h<c;++h){r=t[f];i=t[f+1];n=t[f+2];s=t[f+3];o=t[f+4];a=t[f+5];u=t[f+6];l=t[f+7];var p=r+l;var g=r-l;var y=i+u;var b=i-u;var m=n+a;var v=n-a;var w=s+o;var _=s-o;var x=p+w;var C=p-w;var k=y+m;var T=y-m;t[f]=x+k;t[f+4]=x-k;var S=(T+C)*.707106781;t[f+2]=C+S;t[f+6]=C-S;x=_+v;k=v+b;T=b+g;var E=(x-T)*.382683433;var A=.5411961*x+E;var R=1.306562965*T+E;var B=k*.707106781;var O=g+B;var P=g-B;t[f+5]=P+A;t[f+3]=P-A;t[f+1]=O+R;t[f+7]=O-R;f+=8}f=0;for(h=0;h<c;++h){r=t[f];i=t[f+8];n=t[f+16];s=t[f+24];o=t[f+32];a=t[f+40];u=t[f+48];l=t[f+56];var I=r+l;var M=r-l;var j=i+u;var L=i-u;var D=n+a;var F=n-a;var W=s+o;var H=s-o;var N=I+W;var U=I-W;var z=j+D;var Y=j-D;t[f]=N+z;t[f+32]=N-z;var V=(Y+U)*.707106781;t[f+16]=U+V;t[f+48]=U-V;N=H+F;z=F+L;Y=L+M;var G=(N-Y)*.382683433;var Z=.5411961*N+G;var K=1.306562965*Y+G;var X=z*.707106781;var q=M+X;var J=M-X;t[f+40]=J+Z;t[f+24]=J-Z;t[f+8]=q+K;t[f+56]=q-K;f++}var $;for(h=0;h<d;++h){$=t[h]*e[h];Q[h]=$>0?$+.5|0:$-.5|0}return Q}function U(){H(65504);H(16);W(74);W(70);W(73);W(70);W(0);W(1);W(1);W(0);H(1);H(1);W(0);W(0)}function z(t){if(!t)return;H(65505);if(t[0]===69&&t[1]===120&&t[2]===105&&t[3]===102){H(t.length+2)}else{H(t.length+5+2);W(69);W(120);W(105);W(102);W(0)}for(var e=0;e<t.length;e++){W(t[e])}}function Y(t,e){H(65472);H(17);W(8);H(e);H(t);W(3);W(1);W(17);W(0);W(2);W(17);W(1);W(3);W(17);W(1)}function V(){H(65499);H(132);W(0);for(var t=0;t<64;t++){W(c[t])}W(1);for(var e=0;e<64;e++){W(d[e])}}function G(){H(65476);H(418);W(0);for(var t=0;t<16;t++){W(u[t+1])}for(var e=0;e<=11;e++){W(l[e])}W(16);for(var r=0;r<16;r++){W(f[r+1])}for(var i=0;i<=161;i++){W(p[i])}W(1);for(var n=0;n<16;n++){W(g[n+1])}for(var s=0;s<=11;s++){W(y[s])}W(17);for(var o=0;o<16;o++){W(b[o+1])}for(var a=0;a<=161;a++){W(m[a])}}function Z(){H(65498);H(12);W(3);W(1);W(0);W(2);W(17);W(3);W(17);W(0);W(63);W(0)}function K(t,e,r,i,n){var s=n[0];var o=n[240];var a;var u=16;var l=63;var f=64;var h=N(t,e);for(var c=0;c<f;++c){x[C[c]]=h[c]}var d=x[0]-r;r=x[0];if(d==0){F(i[0])}else{a=32767+d;F(i[_[a]]);F(w[a])}var p=63;for(;p>0&&x[p]==0;p--){}if(p==0){F(s);return r}var g=1;var y;while(g<=p){var b=g;for(;x[g]==0&&g<=p;++g){}var m=g-b;if(m>=u){y=m>>4;for(var v=1;v<=y;++v)F(o);m=m&15}a=32767+x[g];F(n[(m<<4)+_[a]]);F(w[a]);g++}if(p!=l){F(s)}return r}function X(){var t=String.fromCharCode;for(var e=0;e<256;e++){i[e]=t(e)}}this.encode=function(t,e){var r=(new Date).getTime();if(e)q(e);B=new Array;O=0;P=7;H(65496);U();z(t.exifBuffer);V();Y(t.width,t.height);G();Z();var i=0;var n=0;var s=0;O=0;P=7;this.encode.displayName="_encode_";var o=t.data;var a=t.width;var u=t.height;var l=a*4;var f=a*3;var h,c=0;var d,p,g;var y,b,m,v,w;while(c<u){h=0;while(h<l){y=l*c+h;b=y;m=-1;v=0;for(w=0;w<64;w++){v=w>>3;m=(w&7)*4;b=y+v*l+m;if(c+v>=u){b-=l*(c+1+v-u)}if(h+m>=l){b-=h+m-l+4}d=o[b++];p=o[b++];g=o[b++];I[w]=(L[d]+L[p+256>>0]+L[g+512>>0]>>16)-128;M[w]=(L[d+768>>0]+L[p+1024>>0]+L[g+1280>>0]>>16)-128;j[w]=(L[d+1280>>0]+L[p+1536>>0]+L[g+1792>>0]>>16)-128}i=K(I,k,i,S,A);n=K(M,T,n,E,R);s=K(j,T,s,E,R);h+=32}c+=8}if(P>=0){var _=[];_[1]=P+1;_[0]=(1<<P+1)-1;F(_)}H(65497);if(typeof et==="undefined")return new Uint8Array(B);return new tt(B);var x="data:image/jpeg;base64,"+$(B.join(""));B=[];var C=(new Date).getTime()-r;return x};function q(t){if(t<=0){t=1}if(t>100){t=100}if(n==t)return;var e=0;if(t<50){e=Math.floor(5e3/t)}else{e=Math.floor(200-t*2)}s(e);n=t}function J(){var t=(new Date).getTime();if(!r)r=50;X();a();v();D();q(r);var e=(new Date).getTime()-t}J()}if(typeof et!=="undefined"){et.exports=t}else if(typeof window!=="undefined"){window["jpeg-js"]=window["jpeg-js"]||{};window["jpeg-js"].encode=t}function t(t,e){if(typeof e==="undefined")e=50;var r=new n(e);var i=r.encode(t,e);return{data:i,width:t.width,height:t.height}}function e(t){var e=typeof t=="string"?document.getElementById(t):t;var r=document.createElement("canvas");r.width=e.width;r.height=e.height;var i=r.getContext("2d");i.drawImage(e,0,0);return i.getImageData(0,0,r.width,r.height)}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:147}],68:[function(t,e,r){"use strict";function s(t){if(!this||!(this instanceof s)){return new s(t)}this.require=t}e.exports=s;s.property=(e,r,i,n)=>{Object.defineProperty(e,r,{configurable:true,enumerable:!!n,get:function(){var t=i(e,r);Object.defineProperty(e,r,{configurable:true,enumerable:!!n,writable:false,value:t});return t}});return e};s.prototype.property=s.property;s.properties=(e,r,i)=>{Object.keys(r).forEach(t=>{s.property(e,t,r[t],i)});return e};s.prototype.properties=s.properties;s.instanceProperty=(t,e,r,i)=>{Object.defineProperty(t,e,{configurable:true,enumerable:!!i,get:function(){var t=r(this,e);Object.defineProperty(this,e,{configurable:true,enumerable:!!i,writable:false,value:t});return t}});return t};s.prototype.instanceProperty=s.instanceProperty;s.instanceProperties=(e,r,i)=>{Object.keys(r).forEach(t=>{s.property(e,t,r[t],i)});return e};s.prototype.instanceProperties=s.instanceProperties;s.value=t=>{var e=true,r;return function(){if(e){r=t();e=false}return r}};s.prototype.value=s.value;s.require=function(i,n){var s=true,o;return new Proxy(()=>{},{construct:(t,e)=>{if(s){o=i(n);s=false}return Reflect.construct(o,e)},apply:(t,e,r)=>{if(s){o=i(n);s=false}return Reflect.apply(o,e,r)},get:(t,e)=>{if(s){o=i(n);s=false}return Reflect.get(o,e)}})};s.prototype.require=function(t){return s.require(this.require,t)};s.requireProperty=function(e,r,i,n,s){Object.defineProperty(r,i,{configurable:true,enumerable:!!s,get:function(){var t=e(n);Object.defineProperty(r,i,{configurable:true,enumerable:!!s,writable:false,value:t});return t}});return r};s.prototype.requireProperty=function(t,e,r,i){return s.requireProperty(this.require,t,e,r,i)};s.requireProperties=function(e,r,i,n){Object.keys(i).forEach(t=>{s.requireProperty(e,r,t,i[t],n)});return r};s.prototype.requireProperties=function(t,e,r){return s.requireProperties(this.require,t,e,r)}},{}],69:[function(t,e,r){"use strict";var o=t("ndarray");var a=t("./doConvert.js");e.exports=function t(e,r){var i=[],n=e,s=1;while(Array.isArray(n)){i.push(n.length);s*=n.length;n=n[0]}if(i.length===0){return o()}if(!r){r=o(new Float64Array(s),i)}a(r,e);return r}},{"./doConvert.js":70,ndarray:71}],70:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:true,rvalue:false,count:1},{name:"_inline_1_arg1_",lvalue:false,rvalue:true,count:1},{name:"_inline_1_arg2_",lvalue:false,rvalue:true,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":60}],71:[function(t,e,r){var y=t("iota-array");var i=t("is-buffer");var n=typeof Float64Array!=="undefined";function s(t,e){return t[0]-e[0]}function b(){var t=this.stride;var e=new Array(t.length);var r;for(r=0;r<e.length;++r){e[r]=[Math.abs(t[r]),r]}e.sort(s);var i=new Array(e.length);for(r=0;r<i.length;++r){i[r]=e[r][1]}return i}function f(t,e){var r=["View",e,"d",t].join("");if(e<0){r="View_Nil"+t}var i=t==="generic";if(e===-1){var n="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}";var s=new Function(n);return s()}else if(e===0){var n="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(i?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(i?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}";var s=new Function("TrivialArray",n);return s(m[t][0])}var n=["'use strict'"];var o=y(e);var a=o.map(function(t){return"i"+t});var u="this.offset+"+o.map(function(t){return"this.stride["+t+"]*i"+t}).join("+");var l=o.map(function(t){return"b"+t}).join(",");var f=o.map(function(t){return"c"+t}).join(",");n.push("function "+r+"(a,"+l+","+f+",d){this.data=a","this.shape=["+l+"]","this.stride=["+f+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e);n.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+o.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})");if(e===1){n.push("proto.order=[0]")}else{n.push("Object.defineProperty(proto,'order',{get:");if(e<4){n.push("function "+r+"_order(){");if(e===2){n.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})")}else if(e===3){n.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")}}else{n.push("ORDER})")}}n.push("proto.set=function "+r+"_set("+a.join(",")+",v){");if(i){n.push("return this.data.set("+u+",v)}")}else{n.push("return this.data["+u+"]=v}")}n.push("proto.get=function "+r+"_get("+a.join(",")+"){");if(i){n.push("return this.data.get("+u+")}")}else{n.push("return this.data["+u+"]}")}n.push("proto.index=function "+r+"_index(",a.join(),"){return "+u+"}");n.push("proto.hi=function "+r+"_hi("+a.join(",")+"){return new "+r+"(this.data,"+o.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+o.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var h=o.map(function(t){return"a"+t+"=this.shape["+t+"]"});var c=o.map(function(t){return"c"+t+"=this.stride["+t+"]"});n.push("proto.lo=function "+r+"_lo("+a.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+c.join(","));for(var d=0;d<e;++d){n.push("if(typeof i"+d+"==='number'&&i"+d+">=0){d=i"+d+"|0;b+=c"+d+"*d;a"+d+"-=d}")}n.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"c"+t}).join(",")+",b)}");n.push("proto.step=function "+r+"_step("+a.join(",")+"){var "+o.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+o.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var d=0;d<e;++d){n.push("if(typeof i"+d+"==='number'){d=i"+d+"|0;if(d<0){c+=b"+d+"*(a"+d+"-1);a"+d+"=ceil(-a"+d+"/d)}else{a"+d+"=ceil(a"+d+"/d)}b"+d+"*=d}")}n.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"b"+t}).join(",")+",c)}");var p=new Array(e);var g=new Array(e);for(var d=0;d<e;++d){p[d]="a[i"+d+"]";g[d]="b[i"+d+"]"}n.push("proto.transpose=function "+r+"_transpose("+a+"){"+a.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+p.join(",")+","+g.join(",")+",this.offset)}");n.push("proto.pick=function "+r+"_pick("+a+"){var a=[],b=[],c=this.offset");for(var d=0;d<e;++d){n.push("if(typeof i"+d+"==='number'&&i"+d+">=0){c=(c+this.stride["+d+"]*i"+d+")|0}else{a.push(this.shape["+d+"]);b.push(this.stride["+d+"])}")}n.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}");n.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map(function(t){return"shape["+t+"]"}).join(",")+","+o.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var s=new Function("CTOR_LIST","ORDER",n.join("\n"));return s(m[t],b)}function h(t){if(i(t)){return"buffer"}if(n){switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}}if(Array.isArray(t)){return"array"}return"generic"}var m={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};(function(){for(var t in m){m[t].push(f(t,-1))}});function o(t,e,r,i){if(t===undefined){var n=m.array[0];return n([])}else if(typeof t==="number"){t=[t]}if(e===undefined){e=[t.length]}var s=e.length;if(r===undefined){r=new Array(s);for(var o=s-1,a=1;o>=0;--o){r[o]=a;a*=e[o]}}if(i===undefined){i=0;for(var o=0;o<s;++o){if(r[o]<0){i-=(e[o]-1)*r[o]}}}var u=h(t);var l=m[u];while(l.length<=s+1){l.push(f(u,l.length-1))}var n=l[s+1];return n(t,e,r,i)}e.exports=o},{"iota-array":63,"is-buffer":64}],72:[function(i,n,t){(function(s,t,e){(function(){"use strict";const r=s.browser?window.setImmediate:s.nextTick;if(!t.__NEXTGEN_EVENTS__){t.__NEXTGEN_EVENTS__={recursions:0}}var l=t.__NEXTGEN_EVENTS__;function f(){}n.exports=f;f.prototype.__prototypeUID__="nextgen-events/NextGenEvents";f.prototype.__prototypeVersion__=i("../package.json").version;f.SYNC=-Infinity;f.DESYNC=-1;f.defaultMaxListeners=Infinity;f.init=function(){Object.defineProperty(this,"__ngev",{configurable:true,value:new f.Internal})};f.Internal=function(r){this.nice=f.SYNC;this.interruptible=false;this.contexts={};this.desync=e;this.depth=0;this.states={};this.stateGroups={};this.listeners={error:[],interrupt:[],newListener:[],removeListener:[]};this.hasListenerPriority=false;this.maxListeners=f.defaultMaxListeners;if(r){this.nice=r.nice;this.interruptible=r.interruptible;Object.assign(this.states,r.states),Object.assign(this.stateGroups,r.stateGroups),Object.keys(r.listeners).forEach(t=>{this.listeners[t]=r.listeners[t].slice()});Object.keys(r.contexts).forEach(t=>{var e=r.contexts[t];this.contexts[t]={nice:e.nice,ready:true,status:e.status,serial:e.serial,scopes:{}}})}};f.initFrom=function(t){if(!t.__ngev){f.init.call(t)}Object.defineProperty(this,"__ngev",{configurable:true,value:new f.Internal(t.__ngev)})};f.mergeListeners=function(s){if(!this.__ngev){f.init.call(this)}var t=this.__ngev.listeners;this.__ngev.listeners={};Object.keys(t).forEach(t=>{this.__ngev.listeners[t]=[]});s.forEach(t=>{if(!t.__ngev){f.init.call(t)}Object.keys(t.__ngev.listeners).forEach(t=>{if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}})});Object.keys(this.__ngev.listeners).forEach(e=>{var r,i,n=[];if(t[e]){t[e].forEach(t=>{for(r=0,i=s.length;r<i;r++){if(!s[r].__ngev.listeners[e]||s[r].__ngev.listeners[e].indexOf(t)===-1){n.push(t);break}}})}s.forEach(t=>{t.__ngev.listeners[e].forEach(t=>{if(this.__ngev.listeners[e].indexOf(t)===-1&&n.indexOf(t)===-1){this.__ngev.listeners[e].push(t)}})})})};f.filterOutCallback=function(t,e){return t!==e};f.prototype.addListener=function(t,e,r){var i,n;if(!this.__ngev){f.init.call(this)}if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}if(!t||typeof t!=="string"){throw new TypeError(".addListener(): argument #0 should be a non-empty string")}if(typeof e==="function"){i={};if(!r||typeof r!=="object"){r={}}}else if(r===true&&e&&typeof e==="object"){r=i=e;e=undefined}else{r=e;if(!r||typeof r!=="object"){throw new TypeError(".addListener(): a function or an object with a 'fn' property which value is a function should be provided")}e=undefined;i={}}i.fn=e||r.fn;i.id=r.id!==undefined?r.id:i.fn;if(r.unique){if(this.__ngev.listeners[t].find(t=>t.id===i.id)){return}}i.once=!!r.once;i.async=!!r.async;i.eventObject=!!r.eventObject;i.nice=r.nice!==undefined?Math.floor(r.nice):f.SYNC;i.priority=+r.priority||0;i.context=r.context&&(typeof r.context==="string"||typeof r.context==="object")?r.context:null;if(typeof i.fn!=="function"){throw new TypeError(".addListener(): a function or an object with a 'fn' property which value is a function should be provided")}if(typeof i.context==="string"){i.context=this.__ngev.contexts[i.context]||this.addListenerContext(i.context)}i.event=t;if(this.__ngev.listeners.newListener.length){n=this.__ngev.listeners.newListener.slice();this.__ngev.listeners[t].push(i);f.emitEvent({emitter:this,name:"newListener",args:[[i]],listeners:n});if(this.__ngev.states[t]){f.emitToOneListener(this.__ngev.states[t],i)}return this}this.__ngev.listeners[t].push(i);if(this.__ngev.hasListenerPriority){this.__ngev.listeners[t].sort((t,e)=>e.priority-t.priority)}if(this.__ngev.listeners[t].length===this.__ngev.maxListeners+1){s.emitWarning("Possible NextGenEvents memory leak detected. "+this.__ngev.listeners[t].length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit",{type:"MaxListenersExceededWarning"})}if(this.__ngev.states[t]){f.emitToOneListener(this.__ngev.states[t],i)}return this};f.prototype.on=f.prototype.addListener;f.prototype.once=function(t,e,r){if(e&&typeof e==="object"){e.once=true}else if(r&&typeof r==="object"){r.once=true}else{r={once:true}}return this.addListener(t,e,r)};f.prototype.waitFor=function(t){return new Promise(e=>{this.addListener(t,t=>e(t),{once:true})})};f.prototype.waitForAll=function(t){return new Promise(e=>{this.addListener(t,(...t)=>e(t),{once:true})})};f.prototype.removeListener=function(t,e){if(!t||typeof t!=="string"){throw new TypeError(".removeListener(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}var r=this.__ngev.listeners[t];if(!r||!r.length){return this}var i,n,s=0,o=r.length,a=this.__ngev.listeners.removeListener.length;if(a){n=[]}for(i=0;i<o;i++){if(r[i].id===e){s++;if(a){n.push(r[i])}}else if(s){r[i-s]=r[i]}}if(s){r.length-=s}if(a&&n.length){this.emit("removeListener",n)}return this};f.prototype.off=f.prototype.removeListener;f.prototype.removeAllListeners=function(t){var e;if(!this.__ngev){f.init.call(this)}if(t){if(!t||typeof t!=="string"){throw new TypeError(".removeAllListeners(): argument #0 should be undefined or a non-empty string")}if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}e=this.__ngev.listeners[t];this.__ngev.listeners[t]=[];if(e.length&&this.__ngev.listeners.removeListener.length){this.emit("removeListener",e)}}else{this.__ngev.listeners={error:[],interrupt:[],newListener:[],removeListener:[]}}return this};f.listenerWrapper=function(t,e,r,i,n){var s,o,a=e.master||e,u=!!e.master||e.emitter.__ngev.interruptible;if(a.interrupt){return}if(t.async){if(r){r.ready=!i}if(n<0){if(l.recursions>=-n){e.emitter.__ngev.desync(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC));return}}else{setTimeout(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC),n);return}o=t=>{a.listenersDone++;if(t&&u&&!a.interrupt&&e.name!=="interrupt"){a.interrupt=t;if(a.callback){f.emitCallback(e)}e.emitter.emit("interrupt",a.interrupt)}else if(a.listenersDone>=a.listeners.length&&a.callback){f.emitCallback(e)}if(i){f.processScopeQueue(r,true,true)}};if(t.eventObject){t.fn(e,o)}else{s=t.fn(...e.args,o)}}else{if(n<0){if(l.recursions>=-n){e.emitter.__ngev.desync(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC));return}}else{setTimeout(f.listenerWrapper.bind(undefined,t,e,r,i,f.SYNC),n);return}if(t.eventObject){t.fn(e)}else{s=t.fn(...e.args)}a.listenersDone++}if(s&&u&&!a.interrupt&&e.name!=="interrupt"){a.interrupt=s;if(a.callback){f.emitCallback(e)}e.emitter.emit("interrupt",a.interrupt)}else if(a.listenersDone>=a.listeners.length&&a.callback){f.emitCallback(e)}};var h=0;f.prototype.emit=function(...t){var e=f.createEvent(this,...t);return f.emitEvent(e)};f.prototype.emitIfListener=function(...t){var e=typeof t[0]==="number"?t[1]:t[0];if(!this.__ngev||!this.__ngev.listeners[e]||!this.__ngev.listeners[e].length){return null}var r=f.createEvent(this,...t);return f.emitEvent(r)};f.prototype.waitForEmit=function(...t){return new Promise(e=>{this.emit(...t,t=>e(t))})};f.createEvent=function(t,...e){var r={emitter:t,interrupt:null,master:null,sync:true};if(typeof e[0]==="number"){r.nice=Math.floor(e[0]);r.name=e[1];if(!r.name||typeof r.name!=="string"){throw new TypeError(".emit(): when argument #0 is a number, argument #1 should be a non-empty string")}if(typeof e[e.length-1]==="function"){r.callback=e[e.length-1];r.args=e.slice(2,-1)}else{r.args=e.slice(2)}}else{r.name=e[0];if(!r.name||typeof r.name!=="string"){throw new TypeError(".emit(): argument #0 should be an number or a non-empty string")}if(typeof e[e.length-1]==="function"){r.callback=e[e.length-1];r.args=e.slice(1,-1)}else{r.args=e.slice(1)}}return r};f.emitEvent=function(t){var e=t.emitter,r,i,n=0,s,o;if(!e.__ngev){f.init.call(e)}s=e.__ngev.states[t.name];if(s!==undefined){if(s&&t.args.length===s.args.length&&t.args.every((t,e)=>t===s.args[e])){return}e.__ngev.stateGroups[t.name].forEach(t=>{e.__ngev.states[t]=null});e.__ngev.states[t.name]=t}if(!e.__ngev.listeners[t.name]){e.__ngev.listeners[t.name]=[]}t.id=h++;t.listenersDone=0;if(t.nice===undefined||t.nice===null){t.nice=e.__ngev.nice}if(!t.listeners){t.listeners=e.__ngev.listeners[t.name].slice()}l.recursions++;t.depth=e.__ngev.depth++;o=[];try{for(r=0,i=t.listeners.length;r<i;r++){n++;f.emitToOneListener(t,t.listeners[r],o)}}catch(t){l.recursions--;e.__ngev.depth--;throw t}l.recursions--;if(!t.callback){e.__ngev.depth--}if(o.length&&e.__ngev.listeners.removeListener.length){e.emit("removeListener",o)}if(!n){if(t.name==="error"){if(t.args[0]){throw t.args[0]}else{throw Error("Uncaught, unspecified 'error' event.")}}if(t.callback){f.emitCallback(t)}}t.sync=false;return t};f.emitIntricatedEvents=function(t,e){var r,i,n=0,s;if(!Array.isArray(t)){throw new TypeError(".emitCorrelatedEvents() argument should be an array")}var o=[],a={nice:f.DESYNC,ready:true,status:f.CONTEXT_ENABLED,serial:true,scopes:{}},u={sync:false,nice:f.DESYNC,context:a,interrupt:null,listeners:o,listenersDone:0,depth:0,callback:e};t.forEach(t=>{var e=f.createEvent(...t);e.master=u;if(!e.emitter.__ngev){f.init.call(e.emitter)}if(!e.emitter.__ngev.listeners[e.name]){e.emitter.__ngev.listeners[e.name]=[]}e.listeners=e.emitter.__ngev.listeners[e.name].slice();e.id=h++;e.listeners.forEach(t=>o.push({event:e,listener:t}))});o.sort((t,e)=>e.listener.priority-t.listener.priority);l.recursions++;s=[];try{for(r=0,i=o.length;r<i;r++){n++;f.emitToOneListener(o[r].event,o[r].listener,s)}}catch(t){l.recursions--;throw t}l.recursions--;if(!n&&u.callback){f.emitCallback(event)}u.sync=false};f.emitToOneListener=function(t,e,r){var i=t.emitter,n=t.master||t,s=t.master?t.master.context:e.context,o,a,u,l=false;if(s){if(s.status===f.CONTEXT_DISABLED){return}u=Math.max(n.nice,e.nice,s.nice);a=s.serial;o=f.getContextScope(s,n.depth)}else{u=Math.max(n.nice,e.nice)}if(e.once){i.__ngev.listeners[t.name]=i.__ngev.listeners[t.name].filter(f.filterOutCallback.bind(undefined,e));if(r){r.push(e)}else{l=true}}if(s&&(s.status===f.CONTEXT_QUEUED||!o.ready)){o.queue.push({event:t,listener:e,nice:u})}else{f.listenerWrapper(e,t,o,a,u)}if(l&&i.__ngev.listeners.removeListener.length){i.emit("removeListener",[e])}};f.emitCallback=function(t){var e;if(t.master){e=t.master.callback;delete t.master.callback;if(t.master.sync){r(()=>e(t.master.interrupt,t))}else{e(t.master.interrupt,t)}return}e=t.callback;delete t.callback;if(t.sync&&t.emitter.__ngev.nice!==f.SYNC){t.emitter.__ngev.desync(()=>{t.emitter.__ngev.depth--;e(t.interrupt,t)})}else{t.emitter.__ngev.depth--;e(t.interrupt,t)}};f.prototype.listeners=function(t){if(!t||typeof t!=="string"){throw new TypeError(".listeners(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}if(!this.__ngev.listeners[t]){this.__ngev.listeners[t]=[]}return this.__ngev.listeners[t].slice()};f.listenerCount=function(t,e){if(!t||!(t instanceof f)){throw new TypeError(".listenerCount(): argument #0 should be an instance of NextGenEvents")}return t.listenerCount(e)};f.prototype.listenerCount=function(t){if(!t||typeof t!=="string"){throw new TypeError(".listenerCount(): argument #1 should be a non-empty string")}if(!this.__ngev||!this.__ngev.listeners[t]){return 0}return this.__ngev.listeners[t].length};f.prototype.setNice=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.nice=Math.floor(+t||0)};f.prototype.desyncUseNextTick=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.desync=t?r:e};f.prototype.setInterruptible=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.interruptible=!!t};f.prototype.setListenerPriority=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.hasListenerPriority=!!t};f.share=function(t,e){if(!(t instanceof f)||!(e instanceof f)){throw new TypeError("NextGenEvents.share() arguments should be instances of NextGenEvents")}if(!t.__ngev){f.init.call(t)}Object.defineProperty(e,"__ngev",{configurable:true,value:t.__ngev})};f.reset=function(t){Object.defineProperty(t,"__ngev",{configurable:true,value:null})};f.prototype.getMaxListeners=function(){if(!this.__ngev){f.init.call(this)}return this.__ngev.maxListeners};f.prototype.setMaxListeners=function(t){if(!this.__ngev){f.init.call(this)}this.__ngev.maxListeners=typeof t==="number"&&!Number.isNaN(t)?Math.floor(t):f.defaultMaxListeners;return this};f.noop=()=>undefined;f.prototype.defineStates=function(...e){if(!this.__ngev){f.init.call(this)}e.forEach(t=>{this.__ngev.states[t]=null;this.__ngev.stateGroups[t]=e})};f.prototype.hasState=function(t){if(!this.__ngev){f.init.call(this)}return!!this.__ngev.states[t]};f.prototype.getAllStates=function(){if(!this.__ngev){f.init.call(this)}return Object.keys(this.__ngev.states).filter(t=>this.__ngev.states[t])};f.groupAddListener=function(t,e,r,i){if(typeof r!=="function"){i=r;r=undefined}if(!i||typeof i!=="object"){i={}}r=r||i.fn;delete i.fn;i.id=i.id||r;t.forEach(t=>{t.addListener(e,r.bind(undefined,t),i)})};f.groupOn=f.groupAddListener;f.groupOnce=function(t,e,r,i){if(r&&typeof r==="object"){r.once=true}else if(i&&typeof i==="object"){i.once=true}else{i={once:true}}return this.groupAddListener(t,e,r,i)};f.groupWaitFor=function(t,e){return Promise.all(t.map(t=>t.waitFor(e)))};f.groupWaitForAll=function(t,e){return Promise.all(t.map(t=>t.waitForAll(e)))};f.groupOnceFirst=function(e,r,i,n){var s,o=false;if(typeof i!=="function"){n=i;i=undefined}if(!n||typeof n!=="object"){n={}}i=i||n.fn;delete n.fn;n.id=n.id||i;s=(...t)=>{if(o){return}o=true;f.groupRemoveListener(e,r,n.id);i(...t)};e.forEach(t=>{t.once(r,s.bind(undefined,t),n)})};f.groupWaitForFirst=function(t,r){return new Promise(e=>{f.groupOnceFirst(t,r,t=>e(t))})};f.groupWaitForFirstAll=function(t,r){return new Promise(e=>{f.groupOnceFirst(t,r,(...t)=>e(t))})};f.groupOnceLast=function(t,e,r,i){var n,s=false,o=t.length;if(typeof r!=="function"){i=r;r=undefined}if(!i||typeof i!=="object"){i={}}r=r||i.fn;delete i.fn;i.id=i.id||r;n=(...t)=>{if(s){return}if(--o){return}s=true;r(...t)};t.forEach(t=>{t.once(e,n.bind(undefined,t),i)})};f.groupWaitForLast=function(t,r){return new Promise(e=>{f.groupOnceLast(t,r,t=>e(t))})};f.groupWaitForLastAll=function(t,r){return new Promise(e=>{f.groupOnceLast(t,r,(...t)=>e(t))})};f.groupRemoveListener=function(t,e,r){t.forEach(t=>{t.removeListener(e,r)})};f.groupOff=f.groupRemoveListener;f.groupRemoveAllListeners=function(t,e){t.forEach(t=>{t.removeAllListeners(e)})};f.groupEmit=function(t,...e){var r,i,n=1,s,o=t.length,a,u,l=false;if(typeof e[e.length-1]==="function"){s=-1;a=e[e.length-1];u=t=>{if(l){return}if(t){l=true;a(t)}else if(!--o){l=true;a()}}}if(typeof e[0]==="number"){n=2;i=typeof e[0]}r=e[n-1];e=e.slice(n,s);t.forEach(t=>{f.emitEvent({emitter:t,name:r,args:e,nice:i,callback:u})})};f.groupWaitForEmit=function(t,...r){return new Promise(e=>{f.groupEmit(t,...r,t=>e(t))})};f.groupDefineStates=function(t,...e){t.forEach(t=>{t.defineStates(...e)})};f.groupGlobalOnce=f.groupOnceFirst;f.groupGlobalOnceAll=f.groupOnceLast;f.CONTEXT_ENABLED=0;f.CONTEXT_DISABLED=1;f.CONTEXT_QUEUED=2;f.prototype.addListenerContext=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".addListenerContext(): argument #0 should be a non-empty string")}if(!e||typeof e!=="object"){e={}}var r=this.__ngev.contexts[t];if(!r){r=this.__ngev.contexts[t]={nice:f.SYNC,ready:true,status:f.CONTEXT_ENABLED,serial:false,scopes:{}}}if(e.nice!==undefined){r.nice=Math.floor(e.nice)}if(e.status!==undefined){r.status=e.status}if(e.serial!==undefined){r.serial=!!e.serial}return r};f.prototype.getListenerContext=function(t){return this.__ngev.contexts[t]};f.getContextScope=function(t,e){var r=t.scopes[e];if(!r){r=t.scopes[e]={ready:true,queue:[]}}return r};f.prototype.disableListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".disableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].status=f.CONTEXT_DISABLED;return this};f.prototype.enableListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".enableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}var e=this.__ngev.contexts[t];e.status=f.CONTEXT_ENABLED;Object.values(e.scopes).forEach(t=>{if(t.queue.length>0){f.processScopeQueue(t,e.serial)}});return this};f.prototype.queueListenerContext=function(t){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".queueListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].status=f.CONTEXT_QUEUED;return this};f.prototype.serializeListenerContext=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".serializeListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].serial=e===undefined?true:!!e;return this};f.prototype.setListenerContextNice=function(t,e){if(!this.__ngev){f.init.call(this)}if(!t||typeof t!=="string"){throw new TypeError(".setListenerContextNice(): argument #0 should be a non-empty string")}if(!this.__ngev.contexts[t]){this.addListenerContext(t)}this.__ngev.contexts[t].nice=Math.floor(e);return this};f.prototype.destroyListenerContext=function(t){var e,r,i,n,s,o=[];if(!t||typeof t!=="string"){throw new TypeError(".disableListenerContext(): argument #0 should be a non-empty string")}if(!this.__ngev){f.init.call(this)}i=this.__ngev.contexts[t];if(!i){return}for(n in this.__ngev.listeners){s=null;r=this.__ngev.listeners[n].length;for(e=0;e<r;e++){if(this.__ngev.listeners[n][e].context===i){s=[];o.push(this.__ngev.listeners[n][e])}else if(s){s.push(this.__ngev.listeners[n][e])}}if(s){this.__ngev.listeners[n]=s}}delete this.__ngev.contexts[t];if(o.length&&this.__ngev.listeners.removeListener.length){this.emit("removeListener",o)}return this};f.processScopeQueue=function(t,e,r){var i,n,s,o;if(r){t.ready=true}l.recursions++;while(t.ready&&t.queue.length){i=t.queue.shift();n=i.event;s=n.master||n;o=n.emitter;if(s.interrupt){continue}f.listenerWrapper(i.listener,n,t,e,i.nice)}l.recursions--};f.on=f.prototype.on;f.once=f.prototype.once;f.off=f.prototype.off;if(t.AsyncTryCatch){f.prototype.asyncTryCatchId=t.AsyncTryCatch.NextGenEvents.length;t.AsyncTryCatch.NextGenEvents.push(f);if(t.AsyncTryCatch.substituted){t.AsyncTryCatch.substitute()}}f.Proxy=i("./Proxy.js")}).call(this)}).call(this,i("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},i("timers").setImmediate)},{"../package.json":74,"./Proxy.js":73,_process:179,timers:197}],73:[function(t,e,r){"use strict";function i(){this.localServices={};this.remoteServices={};this.nextAckId=1}e.exports=i;var s=t("./NextGenEvents.js");var o="NextGenEvents/message";function n(){}i.create=(...t)=>new i(...t);i.prototype.addLocalService=function(t,e,r){this.localServices[t]=a.create(this,t,e,r);return this.localServices[t]};i.prototype.addRemoteService=function(t){this.remoteServices[t]=u.create(this,t);return this.remoteServices[t]};i.prototype.destroy=function(){Object.keys(this.localServices).forEach(t=>{this.localServices[t].destroy();delete this.localServices[t]});Object.keys(this.remoteServices).forEach(t=>{this.remoteServices[t].destroy();delete this.remoteServices[t]});this.receive=this.send=n};i.prototype.push=function(t){if(t.__type!==o||!t.service||typeof t.service!=="string"||!t.event||typeof t.event!=="string"||!t.method){return}switch(t.method){case"event":return this.remoteServices[t.service]&&this.remoteServices[t.service].receiveEvent(t);case"ackEmit":return this.remoteServices[t.service]&&this.remoteServices[t.service].receiveAckEmit(t);case"emit":return this.localServices[t.service]&&this.localServices[t.service].receiveEmit(t);case"listen":return this.localServices[t.service]&&this.localServices[t.service].receiveListen(t);case"ignore":return this.localServices[t.service]&&this.localServices[t.service].receiveIgnore(t);case"ackEvent":return this.localServices[t.service]&&this.localServices[t.service].receiveAckEvent(t);default:return}};i.prototype.receive=function(t){this.push(t)};i.prototype.send=function(){throw new Error("The send() method of the Proxy MUST be extended/overwritten")};function a(t,e,r,i){return a.create(t,e,r,i)}i.LocalService=a;a.create=function(t,e,r,i){var n=Object.create(a.prototype,{proxy:{value:t,enumerable:true},id:{value:e,enumerable:true},emitter:{value:r,writable:true,enumerable:true},internalEvents:{value:Object.create(s.prototype),writable:true,enumerable:true},events:{value:{},enumerable:true},canListen:{value:!!i.listen,writable:true,enumerable:true},canEmit:{value:!!i.emit,writable:true,enumerable:true},canAck:{value:!!i.ack,writable:true,enumerable:true},canRpc:{value:!!i.rpc,writable:true,enumerable:true},destroyed:{value:false,writable:true,enumerable:true}});return n};a.prototype.destroy=function(){Object.keys(this.events).forEach(t=>{this.emitter.off(t,this.events[t]);delete this.events[t]});this.emitter=null;this.destroyed=true};a.prototype.receiveEmit=function(e){if(this.destroyed||!this.canEmit||e.ack&&!this.canAck){return}var t={emitter:this.emitter,name:e.event,args:e.args||[]};if(e.ack){t.callback=t=>{this.proxy.send({__type:o,service:this.id,method:"ackEmit",ack:e.ack,event:e.event,interruption:t})}}s.emitEvent(t)};a.prototype.receiveListen=function(t){if(this.destroyed||!this.canListen||t.ack&&!this.canAck){return}if(t.ack){if(this.events[t.event]){if(this.events[t.event].ack){return}this.emitter.off(t.event,this.events[t.event])}this.events[t.event]=a.forwardWithAck.bind(this);this.events[t.event].ack=true;this.emitter.on(t.event,this.events[t.event],{eventObject:true,async:true})}else{if(this.events[t.event]){if(!this.events[t.event].ack){return}this.emitter.off(t.event,this.events[t.event])}this.events[t.event]=a.forward.bind(this);this.events[t.event].ack=false;this.emitter.on(t.event,this.events[t.event],{eventObject:true})}};a.prototype.receiveIgnore=function(t){if(this.destroyed||!this.canListen){return}if(!this.events[t.event]){return}this.emitter.off(t.event,this.events[t.event]);this.events[t.event]=null};a.prototype.receiveAckEvent=function(t){if(this.destroyed||!this.canListen||!this.canAck||!t.ack||!this.events[t.event]||!this.events[t.event].ack){return}this.internalEvents.emit("ack",t)};a.forward=function(t){if(this.destroyed){return}this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,args:t.args})};a.forward.ack=false;a.forwardWithAck=function(t,e){if(this.destroyed){return}if(!t.callback){this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,args:t.args});e();return}var r=false;var i=this.proxy.nextAckId++;var n=t=>{if(r||t.ack!==i){return}r=true;this.internalEvents.off("ack",n);e()};this.internalEvents.on("ack",n);this.proxy.send({__type:o,service:this.id,method:"event",event:t.name,ack:i,args:t.args})};a.forwardWithAck.ack=true;function u(t,e){return u.create(t,e)}i.RemoteService=u;var l=1;var f=2;u.create=function(t,e){var r=Object.create(u.prototype,{proxy:{value:t,enumerable:true},id:{value:e,enumerable:true},emitter:{value:Object.create(s.prototype),writable:true,enumerable:true},internalEvents:{value:Object.create(s.prototype),writable:true,enumerable:true},events:{value:{},enumerable:true},destroyed:{value:false,writable:true,enumerable:true}});return r};u.prototype.destroy=function(){this.emitter.removeAllListeners();this.emitter=null;Object.keys(this.events).forEach(t=>{delete this.events[t]});this.destroyed=true};u.prototype.emit=function(t,...e){if(this.destroyed){return}var r,i,n;if(typeof t==="number"){throw new TypeError("Cannot emit with a nice value on a remote service")}if(typeof e[e.length-1]!=="function"){this.proxy.send({__type:o,service:this.id,method:"emit",event:t,args:e});return}r=e.pop();i=this.proxy.nextAckId++;n=false;var s=t=>{if(n||t.ack!==i){return}n=true;this.internalEvents.off("ack",s);r(t.interruption)};this.internalEvents.on("ack",s);this.proxy.send({__type:o,service:this.id,method:"emit",ack:i,event:t,args:e})};u.prototype.addListener=function(t,e,r){if(this.destroyed){return}if(typeof e!=="function"){r=e;e=undefined}if(!r||typeof r!=="object"){r={}}r.fn=e||r.fn;this.emitter.addListener(t,r);if(!this.emitter.__ngev.listeners[t]||!this.emitter.__ngev.listeners[t].length){return}if(r.async&&this.events[t]!==f){this.events[t]=f;this.proxy.send({__type:o,service:this.id,method:"listen",ack:true,event:t})}else if(!r.async&&!this.events[t]){this.events[t]=l;this.proxy.send({__type:o,service:this.id,method:"listen",event:t})}};u.prototype.on=u.prototype.addListener;u.prototype.once=s.prototype.once;u.prototype.removeListener=function(t,e){if(this.destroyed){return}this.emitter.removeListener(t,e);if((!this.emitter.__ngev.listeners[t]||!this.emitter.__ngev.listeners[t].length)&&this.events[t]){this.events[t]=0;this.proxy.send({__type:o,service:this.id,method:"ignore",event:t})}};u.prototype.off=u.prototype.removeListener;u.prototype.receiveEvent=function(t){if(this.destroyed||!this.events[t.event]){return}var e={emitter:this.emitter,name:t.event,args:t.args||[]};if(t.ack){e.callback=()=>{this.proxy.send({__type:o,service:this.id,method:"ackEvent",ack:t.ack,event:t.event})}}s.emitEvent(e);var r=e.name;if(!this.emitter.__ngev.listeners[r]||!this.emitter.__ngev.listeners[r].length){this.events[r]=0;this.proxy.send({__type:o,service:this.id,method:"ignore",event:r})}};u.prototype.receiveAckEmit=function(t){if(this.destroyed||!t.ack||this.events[t.event]!==f){return}this.internalEvents.emit("ack",t)}},{"./NextGenEvents.js":72}],74:[function(t,e,r){e.exports={name:"nextgen-events",version:"1.5.2",description:"The next generation of events handling for javascript! New: abstract away the network!",main:"lib/NextGenEvents.js",engines:{node:">=6.0.0"},directories:{test:"test",bench:"bench"},dependencies:{},devDependencies:{browserify:"^17.0.0","uglify-js-es6":"^2.8.9",ws:"^7.4.6"},scripts:{test:"tea-time -R dot"},repository:{type:"git",url:"https://github.com/cronvel/nextgen-events.git"},keywords:["events","async","emit","listener","context","series","serialize","namespace","proxy","network"],author:"Cédric Ronvel",license:"MIT",bugs:{url:"https://github.com/cronvel/nextgen-events/issues"},config:{"tea-time":{coverDir:["lib"]}},copyright:{title:"Next-Gen Events",years:[2015,2021],owner:"Cédric Ronvel"}}},{}],75:[function(t,e,r){e.exports=t("./lib/bitmap")},{"./lib/bitmap":76}],76:[function(t,e,r){(function(o){(function(){var t=e.exports=r=function(t){this.buffer=t;this.initialized=false;this.fileHeader=null;this.infoHeader=null;this.coreHeader=null;this.colorPalette=null;this.dataPos=-1};t.prototype.CORE_TYPE_WINDOWS_V3=40;t.prototype.CORE_TYPE_WINDOWS_V4=108;t.prototype.CORE_TYPE_WINDOWS_V5=124;t.prototype.CORE_TYPE_OS2_V1=12;t.prototype.CORE_TYPE_OS2_V2=64;t.prototype.BITMAPCOREHEADER=t.prototype.CORE_TYPE_OS2_V1;t.prototype.BITMAPINFOHEADER=t.prototype.CORE_TYPE_WINDOWS_V3;t.prototype.BITMAPINFOHEADER2=t.prototype.CORE_TYPE_OS2_V2;t.prototype.BITMAPV4HEADER=t.prototype.CORE_TYPE_WINDOWS_V4;t.prototype.BITMAPV5HEADER=t.prototype.CORE_TYPE_WINDOWS_V5;t.prototype.COMPRESSION_BI_RGB=0;t.prototype.COMPRESSION_BI_RLE8=1;t.prototype.COMPRESSION_BI_RLE4=2;t.prototype.COMPRESSION_BI_BITFIELDS=3;t.prototype.COMPRESSION_BI_JPEG=4;t.prototype.COMPRESSION_BI_PNG=5;t.prototype.BITCOUNT_2=1;t.prototype.BITCOUNT_16=4;t.prototype.BITCOUNT_256=8;t.prototype.BITCOUNT_16bit=16;t.prototype.BITCOUNT_24bit=24;t.prototype.BITCOUNT_32bit=32;t.prototype.init=function(){this.readFileHeader();this.readInfoHeader();this.readCoreHeader();this.readColorPalette();this.initDataPos();this.initialized=true};t.prototype.checkInit=function(){if(!this.initialized){throw new Error("not initialized")}};t.prototype.isBitmap=function(){this.checkInit();if("BM"==this.fileHeader.bfType){return true}return false};t.prototype.getData=function(){this.checkInit();if(this.COMPRESSION_BI_RGB!==this.coreHeader.__copmression__){throw new Error("not supported compression: "+this.coreHeader.__copmression__)}var t=this.coreHeader.__bitCount__;var e=this.getWidth();var r=this.getHeight();var i=e*t/8;if(0!=i%4){i=(i/4+1)*4}var n=[];var s=this.dataPos;for(var o=0;o<r;++o){var a=s+i*(r-(o+1));var u=this.buffer.slice(a,a+i);var l=this.mapColor(u,t);n.push(l)}return n};t.prototype.getWidth=function(){this.checkInit();return this.coreHeader.__width__};t.prototype.getHeight=function(){this.checkInit();return this.coreHeader.__height__};t.prototype.read=function(t,e,r){var i=[];for(var n=e,s=e+r;n<s;++n){i.push(t.readInt8(n))}return new o(i)};t.prototype.readFileHeader=function(){var t=this.read(this.buffer,0,2);var e=this.read(this.buffer,2,4);var r=this.read(this.buffer,6,2);var i=this.read(this.buffer,8,2);var n=this.read(this.buffer,10,4);this.fileHeader={bfType:t.toString("ascii"),_bfType:t,bfSize:e.readUInt16LE(0),_bfSize:e,bfReserved1:0,bfReserved2:0,bfOffBits:n.readUInt16LE(0),_bfOffBits:n}};t.prototype.readInfoHeader=function(){this.infoHeader=this.read(this.buffer,14,4)};t.prototype.readCoreHeader=function(){var t=this.infoHeader.readUInt16LE(0);switch(t){case this.BITMAPCOREHEADER:return this.readCoreHeaderOS2_V1();case this.BITMAPINFOHEADER2:return this.readCoreHeaderOS2_V2();case this.BITMAPV4HEADER:return this.readCoreHeaderWINDOWS_V4();case this.BITMAPV5HEADER:return this.readCoreHeaderWINDOWS_V5();case this.BITMAPINFOHEADER:return this.readCoreHeaderWINDOWS_V3();default:throw new Error("unknown coreType: "+t)}};t.prototype.readCoreHeaderWINDOWS_V3=function(){var t=this.read(this.buffer,18,4);var e=this.read(this.buffer,22,4);var r=this.read(this.buffer,26,2);var i=this.read(this.buffer,28,2);var n=this.read(this.buffer,30,4);var s=this.read(this.buffer,34,4);var o=this.read(this.buffer,38,4);var a=this.read(this.buffer,42,4);var u=this.read(this.buffer,46,4);var l=this.read(this.buffer,50,4);this.coreHeader={__copmression__:n.readUInt16LE(0),__bitCount__:i.readUInt8(0),__width__:t.readUInt16LE(0),__height__:e.readUInt16LE(0),biWidth:t.readUInt16LE(0),_biWidth:t,biHeight:e.readUInt16LE(0),_biHeight:e,biPlanes:r.readUInt8(0),_biPlanes:r,biBitCount:i.readUInt8(0),_biBitCount:i,biCopmression:n.readUInt16LE(0),_biCopmression:n,biSizeImage:s.readUInt16LE(0),_biSizeImage:s,biXPixPerMeter:o.readUInt16LE(0),_biXPixPerMeter:o,biYPixPerMeter:a.readUInt16LE(0),_biYPixPerMeter:a,biClrUsed:u.readUInt16LE(0),_biClrUsed:u,biCirImportant:l.readUInt16LE(0),_biCirImportant:l}};t.prototype.readCoreHeaderWINDOWS_V4=function(){throw new Error("not yet impl");var t=this.read(this.buffer,18,4);var e=this.read(this.buffer,22,4);var r=this.read(this.buffer,26,2);var i=this.read(this.buffer,28,2);var n=this.read(this.buffer,30,4);var s=this.read(this.buffer,34,4);var o=this.read(this.buffer,38,4);var a=this.read(this.buffer,42,4);var u=this.read(this.buffer,46,4);var l=this.read(this.buffer,50,4);var f=this.read(this.buffer,54,4);var h=this.read(this.buffer,58,4);var c=this.read(this.buffer,62,4);var d=this.read(this.buffer,66,4);var p=this.read(this.buffer,70,4);var g=this.read(this.buffer,106,36);var y=this.read(this.buffer,110,4);var b=this.read(this.buffer,114,4);var m=this.read(this.buffer,118,4);this.coreHeader={__compression__:n.readUInt16LE(0),__bitCount__:i.readUInt8(0),__width__:t.readUInt16LE(0),__height__:e.readUInt16LE(0),bV4Width:t.readUInt16LE(0),_bV4Width:t,bV4Height:e.readUInt16LE(0),_bV4Height:e,bV4Planes:r.readUInt8(0),_bV4Planes:r,bV4BitCount:i.readUInt8(0),_bV4BitCount:i,bV4Compression:n.readUInt16LE(0),_bV4Compression:n,bV4SizeImage:s.readUInt16LE(0),_bV4SizeImage:s,bV4XPelsPerMeter:o.readUInt16LE(0),_bV4XPelsPerMeter:o,bV4YPelsPerMeter:a.readUInt16LE(0),_bV4YPelsPerMeter:a,bV4ClrUsed:u.readUInt16LE(0),_bV4ClrUsed:u,bV4ClrImportant:l.readUInt16LE(0),_bV4ClrImportant:l,bV4RedMask:f.readUInt16LE(0),_bV4RedMask:f,bV4GreenMask:h.readUInt16LE(0),_bV4GreenMask:h,bV4BlueMask:c.readUInt16LE(0),_bV4BlueMask:c,bV4AlphaMask:d.readUInt16LE(0),_bV4AlphaMask:d,bV4CSType:p.readUInt16LE(0),_bV4CSType:p,bV4Endpoints:null,_bV4Endpoints:g,bV4GammaRed:y.readUInt16LE(0),_bV4GammaRed:y,bV4GammaGreen:b.readUInt16LE(0),_bV4GammaGreen:b,bV4GammaBlue:m.readUInt16LE(0),_bV4GammaBlue:m}};t.prototype.readCoreHeaderWINDOWS_V5=function(){throw new Error("not yet impl");var t=this.read(this.buffer,18,4);var e=this.read(this.buffer,22,4);var r=this.read(this.buffer,26,2);var i=this.read(this.buffer,28,2);var n=this.read(this.buffer,30,4);var s=this.read(this.buffer,34,4);var o=this.read(this.buffer,38,4);var a=this.read(this.buffer,42,4);var u=this.read(this.buffer,46,4);var l=this.read(this.buffer,50,4);var f=this.read(this.buffer,54,4);var h=this.read(this.buffer,58,4);var c=this.read(this.buffer,62,4);var d=this.read(this.buffer,66,4);var p=this.read(this.buffer,70,4);var g=this.read(this.buffer,106,36);var y=this.read(this.buffer,110,4);var b=this.read(this.buffer,114,4);var m=this.read(this.buffer,118,4);var v=this.read(this.buffer,122,4);var w=this.read(this.buffer,126,4);var _=this.read(this.buffer,130,4);var x=this.read(this.buffer,134,4);this.coreHeader={__compression__:n.readUInt16LE(0),__bitCount__:i.readUInt8(0),__width__:t.readUInt16LE(0),__height__:e.readUInt16LE(0),bV5Width:t.readUInt16LE(0),_bV5Width:t,bV5Height:e.readUInt16LE(0),_bV5Height:e,bV5Planes:r.readUInt8(0),_bV5Planes:r,bV5BitCount:i.readUInt8(0),_bV5BitCount:i,bV5Compression:n.readUInt16LE(0),_bV5Compression:n,bV5SizeImage:s.readUInt16LE(0),_bV5SizeImage:s,bV5XPelsPerMeter:o.readUInt16LE(0),_bV5XPelsPerMeter:o,bV5YPelsPerMeter:a.readUInt16LE(0),_bV5YPelsPerMeter:a,bV5ClrUsed:u.readUInt16LE(0),_bV5ClrUsed:u,bV5ClrImportant:l.readUInt16LE(0),_bV5ClrImportant:l,bV5RedMask:f.readUInt16LE(0),_bV5RedMask:f,bV5GreenMask:h.readUInt16LE(0),_bV5GreenMask:h,bV5BlueMask:c.readUInt16LE(0),_bV5BlueMask:c,bV5AlphaMask:d.readUInt16LE(0),_bV5AlphaMask:d,bV5CSType:p.readUInt16LE(0),_bV5CSType:p,bV5Endpoints:null,_bV5Endpoints:g,bV5GammaRed:y.readUInt16LE(0),_bV5GammaRed:y,bV5GammaGreen:b.readUInt16LE(0),_bV5GammaGreen:b,bV5GammaBlue:m.readUInt16LE(0),_bV5GammaBlue:m,bV5Intent:v.readUInt16LE(0),_bV5Intent:v,bV5ProfileData:w.readUInt16LE(0),_bV5ProfileData:w,bV5ProfileSize:_.readUInt16LE(0),_bV5ProfileSize:_,bV5Reserved:0,_bV5Reserved:x}};t.prototype.readCoreHeaderOS2_V1=function(){throw new Error("not yet impl");var t=this.read(this.buffer,18,2);var e=this.read(this.buffer,20,2);var r=this.read(this.buffer,22,2);var i=this.read(this.buffer,24,2);this.coreHeader={__compression__:0,__bitCount__:i.readUInt8(0),__width__:t.readUInt8(0),__height__:e.readUInt8(0),bcWidth:t.readUInt8(0),_bcWidth:t,bcHeight:e.readUInt8(0),_bcHeight:e,bcPlanes:r.readUInt8(0),_bcPlanes:r,bcBitCount:i.readUInt8(0),_bcBitCount:i}};t.prototype.readCoreHeaderOS2_V2=function(){throw new Error("not yet impl");var t=this.read(this.buffer,18,4);var e=this.read(this.buffer,22,4);var r=this.read(this.buffer,26,2);var i=this.read(this.buffer,28,2);var n=this.read(this.buffer,30,4);var s=this.read(this.buffer,34,4);var o=this.read(this.buffer,38,4);var a=this.read(this.buffer,42,4);var u=this.read(this.buffer,46,4);var l=this.read(this.buffer,50,4);var f=this.read(this.buffer,54,2);var h=this.read(this.buffer,56,2);var c=this.read(this.buffer,58,2);var d=this.read(this.buffer,60,2);var p=this.read(this.buffer,62,4);var g=this.read(this.buffer,66,4);var y=this.read(this.buffer,70,4);var b=this.read(this.buffer,74,4);this.coreHeader={__compression__:n.readUInt16LE(0),__bitCount__:i.readUInt8(0),__width__:t.readUInt16LE(0),__height__:e.readUInt16LE(0),cx:t.readUInt16LE(0),_cx:t,cy:e.readUInt16LE(0),_cy:e,cPlanes:r.readUInt8(0),_cPlanes:r,cBitCount:i.readUInt8(0),_cBitCount:i,ulCompression:n.readUInt16LE(0),_ulCompression:n,cbImage:s.readUInt16LE(0),_cbImage:s,cxResolution:o.readUInt16LE(0),_cxResolution:o,cyResolution:a.readUInt16LE(0),_cyResolution:a,cclrUsed:u.readUInt16LE(0),_cclrUsed:u,cclrImportant:l.readUInt16LE(0),_cclrImportant:l,usUnits:f.readUInt8(0),_usUnits:f,usReserved:h.readUInt8(0),_usReserved:h,usRecording:c.readUInt8(0),_usRecording:c,usRendering:d.readUInt8(0),_usRendering:d,cSize1:p.readUInt16LE(0),_cSize1:p,cSize2:g.readUInt16LE(0),_cSize1:p,ulColorEncoding:y.readUInt16LE(0),_ulColorEncoding:y,ulIdentifier:b.readUInt16LE(0),_ulIdentifier:b}};t.prototype.readColorPalette=function(){var t=this.coreHeader.__bitCount__;if(this.BITCOUNT_16bit==t){return}if(this.BITCOUNT_24bit==t){return}if(this.BITCOUNT_32bit==t){return}var e=this.infoHeader.readUInt16LE(0);switch(e){case this.BITMAPCOREHEADER:return this.readColorPalette_RGBTRIPLE(t,26);case this.BITMAPINFOHEADER2:return this.readColorPalette_RGBTRIPLE(t,78);case this.BITMAPV4HEADER:return this.readColorPalette_RGBQUAD(t,122);case this.BITMAPV5HEADER:return this.readColorPalette_RGBQUAD(t,138);case this.BITMAPINFOHEADER:return this.readColorPalette_RGBQUAD(t,54);default:throw new Error("unknown colorPalette: "+e+","+t)}};t.prototype.readColorPalette_RGBTRIPLE=function(t,e){throw new Error("not yet impl")};t.prototype.readColorPalette_RGBQUAD=function(t,e){if(this.BITCOUNT_2==t){return this.readRGBQUAD(1<<this.BITCOUNT_2,e)}if(this.BITCOUNT_16==t){return this.readRGBQUAD(1<<this.BITCOUNT_16,e)}if(this.BITCOUNT_256==t){return this.readRGBQUAD(1<<this.BITCOUNT_256,e)}throw new Error("unknown bitCount: "+t)};t.prototype.readRGBQUAD=function(t,e){var r=[];for(var i=e,n=e+4*t;i<n;i+=4){r.push({rgbBlue:this.read(this.buffer,i,1).readUInt8(0),rgbGreen:this.read(this.buffer,i+1,1).readUInt8(0),rgbRed:this.read(this.buffer,i+2,1).readUInt8(0),rgbReserved:this.read(this.buffer,i+3,1).readUInt8(0)})}this.colorPalette=r};t.prototype.initDataPos=function(){var t=this.coreHeader.__bitCount__;var e=true;if(this.BITCOUNT_16bit==t){e=true}if(this.BITCOUNT_24bit==t){e=true}if(this.BITCOUNT_32bit==t){e=true}var r=this.infoHeader.readUInt16LE(0);switch(r){case this.BITMAPCOREHEADER:this.dataPos=26;if(e){this.dataPos=this.dataPos+3*(1<<t)}break;case this.BITMAPINFOHEADER2:this.dataPos=78;if(e){this.dataPos=this.dataPos+3*(1<<t)}break;case this.BITMAPV4HEADER:this.dataPos=122;if(e){this.dataPos=this.dataPos+4*(1<<t)}break;case this.BITMAPV5HEADER:this.dataPos=138;if(e){this.dataPos=this.dataPos+4*(1<<t)}case this.BITMAPINFOHEADER:this.dataPos=54;if(e){this.dataPos=this.dataPos+4*(1<<t)}break;default:throw new Error("unknown colorPalette: "+r+","+t)}};t.prototype.mapRGBA=function(t,e,r,i){var n=[];var s=function(t){var e=t.toString(16);if(t<15){return"0"+e}return e};n.push(s(t));n.push(s(e));n.push(s(r));return"#"+n.join("")};t.prototype.mapColor=function(t,e){var r,i,n,s;var o=t.length;var a=[];if(this.BITCOUNT_2==e){for(var u=0;u<o;++u){var l=t[u];var f=l.toString(2);f=new Array(8-f.length).join("0")+f;for(var h=0;h<f.length;++h){var c=parseInt(f.substring(h,h+1),10);var d=this.colorPalette[c];a.push(this.mapRGBA(d.rgbRed,d.rgbGreen,d.rgbBlue,-1))}}return a}if(this.BITCOUNT_16==e){for(var u=0;u<o;u+=2){var p=t.readUInt8(u);var g=t.readUInt8(u+1);var y=[p,g];y.forEach(function(t){var e=this.colorPalette[t];a.push(this.mapRGBA(e.rgbRed,e.rgbGreen,e.rgbBlue,-1))})}return a}if(this.BITCOUNT_256==e){for(var u=0;u<o;++u){var c=t.readUInt16LE(u);var d=this.colorPalette[c];a.push(this.mapRGBA(d.rgbRed,d.rgbGreen,d.rgbBlue,-1))}return a}if(this.BITCOUNT_16bit==e){for(var u=0;u<o;u+=3){r=t[u];i=t[u+1];n=t[u+2];a.push(this.mapRGBA(n,i,r,-1))}return a}if(this.BITCOUNT_24bit==e){for(var u=0;u<o;u+=3){r=t[u];i=t[u+1];n=t[u+2];a.push(this.mapRGBA(n,i,r,-1))}return a}if(this.BITCOUNT_32bit==e){for(var u=0;u<o;u+=4){r=t[u];i=t[u+1];n=t[u+2];s=t[u+3];a.push(this.mapRGBA(n,i,r,s))}return a}throw new Error("unknown bitCount: "+e)}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:147}],77:[function(t,e,r){"use strict";function i(b,t,e,r){var m=0;var r=r===undefined?{}:r;var i=r.loop===undefined?null:r.loop;var v=r.palette===undefined?null:r.palette;if(t<=0||e<=0||t>65535||e>65535)throw new Error("Width/Height invalid.");function w(t){var e=t.length;if(e<2||e>256||e&e-1){throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.")}return e}b[m++]=71;b[m++]=73;b[m++]=70;b[m++]=56;b[m++]=57;b[m++]=97;var n=0;var s=0;if(v!==null){var o=w(v);while(o>>=1)++n;o=1<<n;--n;if(r.background!==undefined){s=r.background;if(s>=o)throw new Error("Background index out of range.");if(s===0)throw new Error("Background index explicitly passed as 0.")}}b[m++]=t&255;b[m++]=t>>8&255;b[m++]=e&255;b[m++]=e>>8&255;b[m++]=(v!==null?128:0)|n;b[m++]=s;b[m++]=0;if(v!==null){for(var a=0,u=v.length;a<u;++a){var l=v[a];b[m++]=l>>16&255;b[m++]=l>>8&255;b[m++]=l&255}}if(i!==null){if(i<0||i>65535)throw new Error("Loop count invalid.");b[m++]=33;b[m++]=255;b[m++]=11;b[m++]=78;b[m++]=69;b[m++]=84;b[m++]=83;b[m++]=67;b[m++]=65;b[m++]=80;b[m++]=69;b[m++]=50;b[m++]=46;b[m++]=48;b[m++]=3;b[m++]=1;b[m++]=i&255;b[m++]=i>>8&255;b[m++]=0}var _=false;this.addFrame=function(t,e,r,i,n,s){if(_===true){--m;_=false}s=s===undefined?{}:s;if(t<0||e<0||t>65535||e>65535)throw new Error("x/y invalid.");if(r<=0||i<=0||r>65535||i>65535)throw new Error("Width/Height invalid.");if(n.length<r*i)throw new Error("Not enough pixels for the frame size.");var o=true;var a=s.palette;if(a===undefined||a===null){o=false;a=v}if(a===undefined||a===null)throw new Error("Must supply either a local or global palette.");var u=w(a);var l=0;while(u>>=1)++l;u=1<<l;var f=s.delay===undefined?0:s.delay;var h=s.disposal===undefined?0:s.disposal;if(h<0||h>3)throw new Error("Disposal out of range.");var c=false;var d=0;if(s.transparent!==undefined&&s.transparent!==null){c=true;d=s.transparent;if(d<0||d>=u)throw new Error("Transparent color index.")}if(h!==0||c||f!==0){b[m++]=33;b[m++]=249;b[m++]=4;b[m++]=h<<2|(c===true?1:0);b[m++]=f&255;b[m++]=f>>8&255;b[m++]=d;b[m++]=0}b[m++]=44;b[m++]=t&255;b[m++]=t>>8&255;b[m++]=e&255;b[m++]=e>>8&255;b[m++]=r&255;b[m++]=r>>8&255;b[m++]=i&255;b[m++]=i>>8&255;b[m++]=o===true?128|l-1:0;if(o===true){for(var p=0,g=a.length;p<g;++p){var y=a[p];b[m++]=y>>16&255;b[m++]=y>>8&255;b[m++]=y&255}}m=x(b,m,l<2?2:l,n);return m};this.end=function(){if(_===false){b[m++]=59;_=true}return m};this.getOutputBuffer=function(){return b};this.setOutputBuffer=function(t){b=t};this.getOutputBufferPosition=function(){return m};this.setOutputBufferPosition=function(t){m=t}}function x(e,r,t,i){e[r++]=t;var n=r++;var s=1<<t;var o=s-1;var a=s+1;var u=a+1;var l=t+1;var f=0;var h=0;function c(t){while(f>=t){e[r++]=h&255;h>>=8;f-=8;if(r===n+256){e[n]=255;n=r++}}}function d(t){h|=t<<f;f+=l;c(8)}var p=i[0]&o;var g={};d(s);for(var y=1,b=i.length;y<b;++y){var m=i[y]&o;var v=p<<8|m;var w=g[v];if(w===undefined){h|=p<<f;f+=l;while(f>=8){e[r++]=h&255;h>>=8;f-=8;if(r===n+256){e[n]=255;n=r++}}if(u===4096){d(s);u=a+1;l=t+1;g={}}else{if(u>=1<<l)++l;g[v]=u++}p=m}else{p=w}}d(p);d(a);c(1);if(n+1===r){e[n]=0}else{e[n]=r-n-1;e[r++]=0}return r}function n(_){var t=0;if(_[t++]!==71||_[t++]!==73||_[t++]!==70||_[t++]!==56||(_[t++]+1&253)!==56||_[t++]!==97){throw new Error("Invalid GIF 87a/89a header.")}var x=_[t++]|_[t++]<<8;var e=_[t++]|_[t++]<<8;var r=_[t++];var i=r>>7;var n=r&7;var s=1<<n+1;var o=_[t++];_[t++];var a=null;var u=null;if(i){a=t;u=s;t+=s*3}var l=true;var f=[];var h=0;var c=null;var d=0;var p=null;this.width=x;this.height=e;while(l&&t<_.length){switch(_[t++]){case 33:switch(_[t++]){case 255:if(_[t]!==11||_[t+1]==78&&_[t+2]==69&&_[t+3]==84&&_[t+4]==83&&_[t+5]==67&&_[t+6]==65&&_[t+7]==80&&_[t+8]==69&&_[t+9]==50&&_[t+10]==46&&_[t+11]==48&&_[t+12]==3&&_[t+13]==1&&_[t+16]==0){t+=14;p=_[t++]|_[t++]<<8;t++}else{t+=12;while(true){var g=_[t++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;t+=g}}break;case 249:if(_[t++]!==4||_[t+4]!==0)throw new Error("Invalid graphics extension block.");var y=_[t++];h=_[t++]|_[t++]<<8;c=_[t++];if((y&1)===0)c=null;d=y>>2&7;t++;break;case 254:while(true){var g=_[t++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;t+=g}break;default:throw new Error("Unknown graphic control label: 0x"+_[t-1].toString(16))}break;case 44:var b=_[t++]|_[t++]<<8;var m=_[t++]|_[t++]<<8;var v=_[t++]|_[t++]<<8;var w=_[t++]|_[t++]<<8;var C=_[t++];var k=C>>7;var T=C>>6&1;var S=C&7;var E=1<<S+1;var A=a;var R=u;var B=false;if(k){var B=true;A=t;R=E;t+=E*3}var O=t;t++;while(true){var g=_[t++];if(!(g>=0))throw Error("Invalid block size");if(g===0)break;t+=g}f.push({x:b,y:m,width:v,height:w,has_local_palette:B,palette_offset:A,palette_size:R,data_offset:O,data_length:t-O,transparent_index:c,interlaced:!!T,delay:h,disposal:d});break;case 59:l=false;break;default:throw new Error("Unknown gif block: 0x"+_[t-1].toString(16));break}}this.numFrames=function(){return f.length};this.loopCount=function(){return p};this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]};this.decodeAndBlitFrameBGRA=function(t,e){var r=this.frameInfo(t);var i=r.width*r.height;var n=new Uint8Array(i);P(_,r.data_offset,n,i);var s=r.palette_offset;var o=r.transparent_index;if(o===null)o=256;var a=r.width;var u=x-a;var l=a;var f=(r.y*x+r.x)*4;var h=((r.y+r.height)*x+r.x)*4;var c=f;var d=u*4;if(r.interlaced===true){d+=x*4*7}var p=8;for(var g=0,y=n.length;g<y;++g){var b=n[g];if(l===0){c+=d;l=a;if(c>=h){d=u*4+x*4*(p-1);c=f+(a+u)*(p<<1);p>>=1}}if(b===o){c+=4}else{var m=_[s+b*3];var v=_[s+b*3+1];var w=_[s+b*3+2];e[c++]=w;e[c++]=v;e[c++]=m;e[c++]=255}--l}};this.decodeAndBlitFrameRGBA=function(t,e){var r=this.frameInfo(t);var i=r.width*r.height;var n=new Uint8Array(i);P(_,r.data_offset,n,i);var s=r.palette_offset;var o=r.transparent_index;if(o===null)o=256;var a=r.width;var u=x-a;var l=a;var f=(r.y*x+r.x)*4;var h=((r.y+r.height)*x+r.x)*4;var c=f;var d=u*4;if(r.interlaced===true){d+=x*4*7}var p=8;for(var g=0,y=n.length;g<y;++g){var b=n[g];if(l===0){c+=d;l=a;if(c>=h){d=u*4+x*4*(p-1);c=f+(a+u)*(p<<1);p>>=1}}if(b===o){c+=4}else{var m=_[s+b*3];var v=_[s+b*3+1];var w=_[s+b*3+2];e[c++]=m;e[c++]=v;e[c++]=w;e[c++]=255}--l}}}function P(t,e,r,i){var n=t[e++];var s=1<<n;var o=s+1;var a=o+1;var u=n+1;var l=(1<<u)-1;var f=0;var h=0;var c=0;var d=t[e++];var p=new Int32Array(4096);var g=null;while(true){while(f<16){if(d===0)break;h|=t[e++]<<f;f+=8;if(d===1){d=t[e++]}else{--d}}if(f<u)break;var y=h&l;h>>=u;f-=u;if(y===s){a=o+1;u=n+1;l=(1<<u)-1;g=null;continue}else if(y===o){break}var b=y<a?y:g;var m=0;var v=b;while(v>s){v=p[v]>>8;++m}var w=v;var _=c+m+(b!==y?1:0);if(_>i){console.log("Warning, gif stream longer than expected.");return}r[c++]=w;c+=m;var x=c;if(b!==y)r[c++]=w;v=b;while(m--){v=p[v];r[--x]=v&255;v>>=8}if(g!==null&&a<4096){p[a++]=g<<8|w;if(a>=l+1&&u<12){++u;l=l<<1|1}}g=y}if(c!==i){console.log("Warning, gif stream shorter than expected.")}return r}try{r.GifWriter=i;r.GifReader=n}catch(t){}},{}],78:[function(t,e,r){(function(b){(function(){"use strict";let d=t("./interlace");let f=[function(){},function(t,e,r,i){if(i===e.length){throw new Error("Ran out of data")}let n=e[i];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=255},function(t,e,r,i){if(i+1>=e.length){throw new Error("Ran out of data")}let n=e[i];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=e[i+1]},function(t,e,r,i){if(i+2>=e.length){throw new Error("Ran out of data")}t[r]=e[i];t[r+1]=e[i+1];t[r+2]=e[i+2];t[r+3]=255},function(t,e,r,i){if(i+3>=e.length){throw new Error("Ran out of data")}t[r]=e[i];t[r+1]=e[i+1];t[r+2]=e[i+2];t[r+3]=e[i+3]}];let h=[function(){},function(t,e,r,i){let n=e[0];t[r]=n;t[r+1]=n;t[r+2]=n;t[r+3]=i},function(t,e,r){let i=e[0];t[r]=i;t[r+1]=i;t[r+2]=i;t[r+3]=e[1]},function(t,e,r,i){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=i},function(t,e,r){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=e[3]}];function p(l,f){let h=[];let c=0;function r(){if(c===l.length){throw new Error("Ran out of data")}let t=l[c];c++;let e,r,i,n,s,o,a,u;switch(f){default:throw new Error("unrecognised depth");case 16:a=l[c];c++;h.push((t<<8)+a);break;case 4:a=t&15;u=t>>4;h.push(u,a);break;case 2:s=t&3;o=t>>2&3;a=t>>4&3;u=t>>6&3;h.push(u,a,o,s);break;case 1:e=t&1;r=t>>1&1;i=t>>2&1;n=t>>3&1;s=t>>4&1;o=t>>5&1;a=t>>6&1;u=t>>7&1;h.push(u,a,o,s,n,i,r,e);break}}return{get:function(t){while(h.length<t){r()}let e=h.slice(0,t);h=h.slice(t);return e},resetAfterLine:function(){h.length=0},end:function(){if(c!==l.length){throw new Error("extra data found")}}}}function g(t,i,n,s,o,a){let u=t.width;let e=t.height;let l=t.index;for(let r=0;r<e;r++){for(let e=0;e<u;e++){let t=n(e,r,l);f[s](i,o,t,a);a+=s}}return a}function y(t,n,s,o,a,u){let e=t.width;let r=t.height;let l=t.index;for(let i=0;i<r;i++){for(let r=0;r<e;r++){let t=a.get(o);let e=s(r,i,l);h[o](n,t,e,u)}a.resetAfterLine()}}r.dataToBitMap=function(e,t){let r=t.width;let i=t.height;let n=t.depth;let s=t.bpp;let o=t.interlace;let a;if(n!==8){a=p(e,n)}let u;if(n<=8){u=b.alloc(r*i*4)}else{u=new Uint16Array(r*i*4)}let l=Math.pow(2,n)-1;let f=0;let h;let c;if(o){h=d.getImagePasses(r,i);c=d.getInterlaceIterator(r,i)}else{let e=0;c=function(){let t=e;e+=4;return t};h=[{width:r,height:i}]}for(let t=0;t<h.length;t++){if(n===8){f=g(h[t],u,c,s,e,f)}else{y(h[t],u,c,s,a,l)}}if(n===8){if(f!==e.length){throw new Error("extra data found")}}else{a.end()}return u}}).call(this)}).call(this,t("buffer").Buffer)},{"./interlace":88,buffer:147}],79:[function(e,r,t){(function(t){(function(){"use strict";let g=e("./constants");r.exports=function(e,r,i,n){let s=[g.COLORTYPE_COLOR_ALPHA,g.COLORTYPE_ALPHA].indexOf(n.colorType)!==-1;if(n.colorType===n.inputColorType){let t=function(){let t=new ArrayBuffer(2);new DataView(t).setInt16(0,256,true);return new Int16Array(t)[0]!==256}();if(n.bitDepth===8||n.bitDepth===16&&t){return e}}let o=n.bitDepth!==16?e:new Uint16Array(e.buffer);let a=255;let u=g.COLORTYPE_TO_BPP_MAP[n.inputColorType];if(u===4&&!n.inputHasAlpha){u=3}let l=g.COLORTYPE_TO_BPP_MAP[n.colorType];if(n.bitDepth===16){a=65535;l*=2}let f=t.alloc(r*i*l);let h=0;let c=0;let d=n.bgColor||{};if(d.red===undefined){d.red=a}if(d.green===undefined){d.green=a}if(d.blue===undefined){d.blue=a}function p(){let t;let e;let r;let i=a;switch(n.inputColorType){case g.COLORTYPE_COLOR_ALPHA:i=o[h+3];t=o[h];e=o[h+1];r=o[h+2];break;case g.COLORTYPE_COLOR:t=o[h];e=o[h+1];r=o[h+2];break;case g.COLORTYPE_ALPHA:i=o[h+1];t=o[h];e=t;r=t;break;case g.COLORTYPE_GRAYSCALE:t=o[h];e=t;r=t;break;default:throw new Error("input color type:"+n.inputColorType+" is not supported at present")}if(n.inputHasAlpha){if(!s){i/=a;t=Math.min(Math.max(Math.round((1-i)*d.red+i*t),0),a);e=Math.min(Math.max(Math.round((1-i)*d.green+i*e),0),a);r=Math.min(Math.max(Math.round((1-i)*d.blue+i*r),0),a)}}return{red:t,green:e,blue:r,alpha:i}}for(let t=0;t<i;t++){for(let t=0;t<r;t++){let e=p(o,h);switch(n.colorType){case g.COLORTYPE_COLOR_ALPHA:case g.COLORTYPE_COLOR:if(n.bitDepth===8){f[c]=e.red;f[c+1]=e.green;f[c+2]=e.blue;if(s){f[c+3]=e.alpha}}else{f.writeUInt16BE(e.red,c);f.writeUInt16BE(e.green,c+2);f.writeUInt16BE(e.blue,c+4);if(s){f.writeUInt16BE(e.alpha,c+6)}}break;case g.COLORTYPE_ALPHA:case g.COLORTYPE_GRAYSCALE:{let t=(e.red+e.green+e.blue)/3;if(n.bitDepth===8){f[c]=t;if(s){f[c+1]=e.alpha}}else{f.writeUInt16BE(t,c);if(s){f.writeUInt16BE(e.alpha,c+2)}}break}default:throw new Error("unrecognised color Type "+n.colorType)}h+=u;c+=l}}return f}}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":81,buffer:147}],80:[function(n,s,t){(function(i,o){(function(){"use strict";let t=n("util");let e=n("stream");let r=s.exports=function(){e.call(this);this._buffers=[];this._buffered=0;this._reads=[];this._paused=false;this._encoding="utf8";this.writable=true};t.inherits(r,e);r.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e});i.nextTick(function(){this._process();if(this._paused&&this._reads&&this._reads.length>0){this._paused=false;this.emit("drain")}}.bind(this))};r.prototype.write=function(t,e){if(!this.writable){this.emit("error",new Error("Stream not writable"));return false}let r;if(o.isBuffer(t)){r=t}else{r=o.from(t,e||this._encoding)}this._buffers.push(r);this._buffered+=r.length;this._process();if(this._reads&&this._reads.length===0){this._paused=true}return this.writable&&!this._paused};r.prototype.end=function(t,e){if(t){this.write(t,e)}this.writable=false;if(!this._buffers){return}if(this._buffers.length===0){this._end()}else{this._buffers.push(null);this._process()}};r.prototype.destroySoon=r.prototype.end;r.prototype._end=function(){if(this._reads.length>0){this.emit("error",new Error("Unexpected end of input"))}this.destroy()};r.prototype.destroy=function(){if(!this._buffers){return}this.writable=false;this._reads=null;this._buffers=null;this.emit("close")};r.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];if(e.length>t.length){this._buffered-=t.length;this._buffers[0]=e.slice(t.length);t.func.call(this,e.slice(0,t.length))}else{this._buffered-=e.length;this._buffers.shift();t.func.call(this,e)}};r.prototype._processRead=function(r){this._reads.shift();let i=0;let n=0;let s=o.alloc(r.length);while(i<r.length){let t=this._buffers[n++];let e=Math.min(t.length,r.length-i);t.copy(s,i,0,e);i+=e;if(e!==t.length){this._buffers[--n]=t.slice(e)}}if(n>0){this._buffers.splice(0,n)}this._buffered-=r.length;r.func.call(this,s)};r.prototype._process=function(){try{while(this._buffered>0&&this._reads&&this._reads.length>0){let t=this._reads[0];if(t.allowLess){this._processReadAllowingLess(t)}else if(this._buffered>=t.length){this._processRead(t)}else{break}}if(this._buffers&&!this.writable){this._end()}}catch(t){this.emit("error",t)}}}).call(this)}).call(this,n("_process"),n("buffer").Buffer)},{_process:179,buffer:147,stream:181,util:202}],81:[function(t,e,r){"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},{}],82:[function(t,e,r){"use strict";let i=[];(function(){for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++){if(e&1){e=3988292384^e>>>1}else{e=e>>>1}}i[t]=e}})();let n=e.exports=function(){this._crc=-1};n.prototype.write=function(e){for(let t=0;t<e.length;t++){this._crc=i[(this._crc^e[t])&255]^this._crc>>>8}return true};n.prototype.crc32=function(){return this._crc^-1};n.crc32=function(e){let r=-1;for(let t=0;t<e.length;t++){r=i[(r^e[t])&255]^r>>>8}return r^-1}},{}],83:[function(f,g,t){(function(p){(function(){"use strict";let h=f("./paeth-predictor");function t(e,r,i,n,s){for(let t=0;t<i;t++){n[s+t]=e[r+t]}}function e(e,r,t){let i=0;let n=r+t;for(let t=r;t<n;t++){i+=Math.abs(e[t])}return i}function r(i,n,t,s,o,a){for(let r=0;r<t;r++){let t=r>=a?i[n+r-a]:0;let e=i[n+r]-t;s[o+r]=e}}function i(i,n,t,s){let o=0;for(let r=0;r<t;r++){let t=r>=s?i[n+r-s]:0;let e=i[n+r]-t;o+=Math.abs(e)}return o}function n(i,n,s,o,a){for(let r=0;r<s;r++){let t=n>0?i[n+r-s]:0;let e=i[n+r]-t;o[a+r]=e}}function s(i,n,s){let o=0;let t=n+s;for(let r=n;r<t;r++){let t=n>0?i[r-s]:0;let e=i[r]-t;o+=Math.abs(e)}return o}function o(n,s,o,a,u,l){for(let i=0;i<o;i++){let t=i>=l?n[s+i-l]:0;let e=s>0?n[s+i-o]:0;let r=n[s+i]-(t+e>>1);a[u+i]=r}}function a(n,s,o,a){let u=0;for(let i=0;i<o;i++){let t=i>=a?n[s+i-a]:0;let e=s>0?n[s+i-o]:0;let r=n[s+i]-(t+e>>1);u+=Math.abs(r)}return u}function u(s,o,a,u,l,f){for(let n=0;n<a;n++){let t=n>=f?s[o+n-f]:0;let e=o>0?s[o+n-a]:0;let r=o>0&&n>=f?s[o+n-(a+f)]:0;let i=s[o+n]-h(t,e,r);u[l+n]=i}}function l(s,o,a,u){let l=0;for(let n=0;n<a;n++){let t=n>=u?s[o+n-u]:0;let e=o>0?s[o+n-a]:0;let r=o>0&&n>=u?s[o+n-(a+u)]:0;let i=s[o+n]-h(t,e,r);l+=Math.abs(i)}return l}let c={0:t,1:r,2:n,3:o,4:u};let d={0:e,1:i,2:s,3:a,4:l};g.exports=function(i,t,e,r,n){let s;if(!("filterType"in r)||r.filterType===-1){s=[0,1,2,3,4]}else if(typeof r.filterType==="number"){s=[r.filterType]}else{throw new Error("unrecognised filter types")}if(r.bitDepth===16){n*=2}let o=t*n;let a=0;let u=0;let l=p.alloc((o+1)*e);let f=s[0];for(let t=0;t<e;t++){if(s.length>1){let r=Infinity;for(let e=0;e<s.length;e++){let t=d[s[e]](i,u,o,n);if(t<r){f=s[e];r=t}}}l[a]=f;a++;c[f](i,u,o,l,a,n);a+=o;u+=o}return l}}).call(this)}).call(this,f("buffer").Buffer)},{"./paeth-predictor":92,buffer:147}],84:[function(r,o,t){(function(s){(function(){"use strict";let t=r("util");let i=r("./chunkstream");let n=r("./filter-parse");let e=o.exports=function(t){i.call(this);let e=[];let r=this;this._filter=new n(t,{read:this.read.bind(this),write:function(t){e.push(t)},complete:function(){r.emit("complete",s.concat(e))}});this._filter.start()};t.inherits(e,i)}).call(this)}).call(this,r("buffer").Buffer)},{"./chunkstream":80,"./filter-parse":86,buffer:147,util:202}],85:[function(t,e,r){(function(a){(function(){"use strict";let s=t("./sync-reader");let o=t("./filter-parse");r.process=function(t,e){let r=[];let i=new s(t);let n=new o(e,{read:i.read.bind(i),write:function(t){r.push(t)},complete:function(){}});n.start();i.process();return a.concat(r)}}).call(this)}).call(this,t("buffer").Buffer)},{"./filter-parse":86,"./sync-reader":99,buffer:147}],86:[function(e,r,t){(function(s){(function(){"use strict";let a=e("./interlace");let h=e("./paeth-predictor");function u(t,e,r){let i=t*e;if(r!==8){i=Math.ceil(i/(8/r))}return i}let t=r.exports=function(t,e){let r=t.width;let i=t.height;let n=t.interlace;let s=t.bpp;let o=t.depth;this.read=e.read;this.write=e.write;this.complete=e.complete;this._imageIndex=0;this._images=[];if(n){let e=a.getImagePasses(r,i);for(let t=0;t<e.length;t++){this._images.push({byteWidth:u(e[t].width,s,o),height:e[t].height,lineIndex:0})}}else{this._images.push({byteWidth:u(r,s,o),height:i,lineIndex:0})}if(o===8){this._xComparison=s}else if(o===16){this._xComparison=s*2}else{this._xComparison=1}};t.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};t.prototype._unFilterType1=function(i,n,t){let s=this._xComparison;let o=s-1;for(let r=0;r<t;r++){let t=i[1+r];let e=r>o?n[r-s]:0;n[r]=t+e}};t.prototype._unFilterType2=function(i,n,t){let s=this._lastLine;for(let r=0;r<t;r++){let t=i[1+r];let e=s?s[r]:0;n[r]=t+e}};t.prototype._unFilterType3=function(s,o,t){let a=this._xComparison;let u=a-1;let l=this._lastLine;for(let n=0;n<t;n++){let t=s[1+n];let e=l?l[n]:0;let r=n>u?o[n-a]:0;let i=Math.floor((r+e)/2);o[n]=t+i}};t.prototype._unFilterType4=function(o,a,t){let u=this._xComparison;let l=u-1;let f=this._lastLine;for(let s=0;s<t;s++){let t=o[1+s];let e=f?f[s]:0;let r=s>l?a[s-u]:0;let i=s>l&&f?f[s-u]:0;let n=h(r,e,i);a[s]=t+n}};t.prototype._reverseFilterLine=function(t){let e=t[0];let r;let i=this._images[this._imageIndex];let n=i.byteWidth;if(e===0){r=t.slice(1,n+1)}else{r=s.alloc(n);switch(e){case 1:this._unFilterType1(t,r,n);break;case 2:this._unFilterType2(t,r,n);break;case 3:this._unFilterType3(t,r,n);break;case 4:this._unFilterType4(t,r,n);break;default:throw new Error("Unrecognised filter type - "+e)}}this.write(r);i.lineIndex++;if(i.lineIndex>=i.height){this._lastLine=null;this._imageIndex++;i=this._images[this._imageIndex]}else{this._lastLine=r}if(i){this.read(i.byteWidth+1,this._reverseFilterLine.bind(this))}else{this._lastLine=null;this.complete()}}}).call(this)}).call(this,e("buffer").Buffer)},{"./interlace":88,"./paeth-predictor":92,buffer:147}],87:[function(t,e,r){(function(c){(function(){"use strict";function l(r,i,e,n,s){let o=0;for(let t=0;t<n;t++){for(let t=0;t<e;t++){let e=s[r[o]];if(!e){throw new Error("index "+r[o]+" not in palette")}for(let t=0;t<4;t++){i[o+t]=e[t]}o+=4}}}function f(e,r,i,n,s){let o=0;for(let t=0;t<n;t++){for(let t=0;t<i;t++){let t=false;if(s.length===1){if(s[0]===e[o]){t=true}}else if(s[0]===e[o]&&s[1]===e[o+1]&&s[2]===e[o+2]){t=true}if(t){for(let t=0;t<4;t++){r[o+t]=0}}o+=4}}}function h(e,r,i,n,t){let s=255;let o=Math.pow(2,t)-1;let a=0;for(let t=0;t<n;t++){for(let t=0;t<i;t++){for(let t=0;t<4;t++){r[a+t]=Math.floor(e[a+t]*s/o+.5)}a+=4}}}e.exports=function(t,e){let r=e.depth;let i=e.width;let n=e.height;let s=e.colorType;let o=e.transColor;let a=e.palette;let u=t;if(s===3){l(t,u,i,n,a)}else{if(o){f(t,u,i,n,o)}if(r!==8){if(r===16){u=c.alloc(i*n*4)}h(t,u,i,n,r)}}return u}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:147}],88:[function(t,e,r){"use strict";let l=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];r.getImagePasses=function(t,e){let n=[];let s=t%8;let o=e%8;let a=(t-s)/8;let u=(e-o)/8;for(let t=0;t<l.length;t++){let e=l[t];let r=a*e.x.length;let i=u*e.y.length;for(let t=0;t<e.x.length;t++){if(e.x[t]<s){r++}else{break}}for(let t=0;t<e.y.length;t++){if(e.y[t]<o){i++}else{break}}if(r>0&&i>0){n.push({width:r,height:i,index:t})}}return n};r.getInterlaceIterator=function(a){return function(t,e,r){let i=t%l[r].x.length;let n=(t-i)/l[r].x.length*8+l[r].x[i];let s=e%l[r].y.length;let o=(e-s)/l[r].y.length*8+l[r].y[s];return n*4+o*a*4}}},{}],89:[function(n,a,t){(function(o){(function(){"use strict";let t=n("util");let r=n("stream");let s=n("./constants");let i=n("./packer");let e=a.exports=function(t){r.call(this);let e=t||{};this._packer=new i(e);this._deflate=this._packer.createDeflate();this.readable=true};t.inherits(e,r);e.prototype.pack=function(t,e,r,i){this.emit("data",o.from(s.PNG_SIGNATURE));this.emit("data",this._packer.packIHDR(e,r));if(i){this.emit("data",this._packer.packGAMA(i))}let n=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error"));this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this));this._deflate.on("end",function(){this.emit("data",this._packer.packIEND());this.emit("end")}.bind(this));this._deflate.end(n)}}).call(this)}).call(this,n("buffer").Buffer)},{"./constants":81,"./packer":91,buffer:147,stream:181,util:202}],90:[function(t,e,r){(function(h){(function(){"use strict";let a=true;let u=t("zlib");if(!u.deflateSync){a=false}let l=t("./constants");let f=t("./packer");e.exports=function(t,e){if(!a){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}let r=e||{};let i=new f(r);let n=[];n.push(h.from(l.PNG_SIGNATURE));n.push(i.packIHDR(t.width,t.height));if(t.gamma){n.push(i.packGAMA(t.gamma))}let s=i.filterData(t.data,t.width,t.height);let o=u.deflateSync(s,i.getDeflateOptions());s=null;if(!o||!o.length){throw new Error("bad png - invalid compressed data response")}n.push(i.packIDAT(o));n.push(i.packIEND());return h.concat(n)}}).call(this)}).call(this,t("buffer").Buffer)},{"./constants":81,"./packer":91,buffer:147,zlib:146}],91:[function(r,i,t){(function(s){(function(){"use strict";let o=r("./constants");let n=r("./crc");let a=r("./bitpacker");let u=r("./filter-pack");let e=r("zlib");let t=i.exports=function(t){this._options=t;t.deflateChunkSize=t.deflateChunkSize||32*1024;t.deflateLevel=t.deflateLevel!=null?t.deflateLevel:9;t.deflateStrategy=t.deflateStrategy!=null?t.deflateStrategy:3;t.inputHasAlpha=t.inputHasAlpha!=null?t.inputHasAlpha:true;t.deflateFactory=t.deflateFactory||e.createDeflate;t.bitDepth=t.bitDepth||8;t.colorType=typeof t.colorType==="number"?t.colorType:o.COLORTYPE_COLOR_ALPHA;t.inputColorType=typeof t.inputColorType==="number"?t.inputColorType:o.COLORTYPE_COLOR_ALPHA;if([o.COLORTYPE_GRAYSCALE,o.COLORTYPE_COLOR,o.COLORTYPE_COLOR_ALPHA,o.COLORTYPE_ALPHA].indexOf(t.colorType)===-1){throw new Error("option color type:"+t.colorType+" is not supported at present")}if([o.COLORTYPE_GRAYSCALE,o.COLORTYPE_COLOR,o.COLORTYPE_COLOR_ALPHA,o.COLORTYPE_ALPHA].indexOf(t.inputColorType)===-1){throw new Error("option input color type:"+t.inputColorType+" is not supported at present")}if(t.bitDepth!==8&&t.bitDepth!==16){throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")}};t.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};t.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};t.prototype.filterData=function(t,e,r){let i=a(t,e,r,this._options);let n=o.COLORTYPE_TO_BPP_MAP[this._options.colorType];let s=u(i,e,r,this._options,n);return s};t.prototype._packChunk=function(t,e){let r=e?e.length:0;let i=s.alloc(r+12);i.writeUInt32BE(r,0);i.writeUInt32BE(t,4);if(e){e.copy(i,8)}i.writeInt32BE(n.crc32(i.slice(4,i.length-4)),i.length-4);return i};t.prototype.packGAMA=function(t){let e=s.alloc(4);e.writeUInt32BE(Math.floor(t*o.GAMMA_DIVISION),0);return this._packChunk(o.TYPE_gAMA,e)};t.prototype.packIHDR=function(t,e){let r=s.alloc(13);r.writeUInt32BE(t,0);r.writeUInt32BE(e,4);r[8]=this._options.bitDepth;r[9]=this._options.colorType;r[10]=0;r[11]=0;r[12]=0;return this._packChunk(o.TYPE_IHDR,r)};t.prototype.packIDAT=function(t){return this._packChunk(o.TYPE_IDAT,t)};t.prototype.packIEND=function(){return this._packChunk(o.TYPE_IEND,null)}}).call(this)}).call(this,r("buffer").Buffer)},{"./bitpacker":79,"./constants":81,"./crc":82,"./filter-pack":83,buffer:147,zlib:146}],92:[function(t,e,r){"use strict";e.exports=function t(e,r,i){let n=e+r-i;let s=Math.abs(n-e);let o=Math.abs(n-r);let a=Math.abs(n-i);if(s<=o&&s<=a){return e}if(o<=a){return r}return i}},{}],93:[function(t,e,r){"use strict";let i=t("util");let o=t("zlib");let n=t("./chunkstream");let s=t("./filter-parse-async");let a=t("./parser");let u=t("./bitmapper");let l=t("./format-normaliser");let f=e.exports=function(t){n.call(this);this._parser=new a(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)});this._options=t;this.writable=true;this._parser.start()};i.inherits(f,n);f.prototype._handleError=function(t){this.emit("error",t);this.writable=false;this.destroy();if(this._inflate&&this._inflate.destroy){this._inflate.destroy()}if(this._filter){this._filter.destroy();this._filter.on("error",function(){})}this.errord=true};f.prototype._inflateData=function(t){if(!this._inflate){if(this._bitmapInfo.interlace){this._inflate=o.createInflate();this._inflate.on("error",this.emit.bind(this,"error"));this._filter.on("complete",this._complete.bind(this));this._inflate.pipe(this._filter)}else{let t=(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1;let e=t*this._bitmapInfo.height;let r=Math.max(e,o.Z_MIN_CHUNK);this._inflate=o.createInflate({chunkSize:r});let i=e;let n=this.emit.bind(this,"error");this._inflate.on("error",function(t){if(!i){return}n(t)});this._filter.on("complete",this._complete.bind(this));let s=this._filter.write.bind(this._filter);this._inflate.on("data",function(t){if(!i){return}if(t.length>i){t=t.slice(0,i)}i-=t.length;s(t)});this._inflate.on("end",this._filter.end.bind(this._filter))}}this._inflate.write(t)};f.prototype._handleMetaData=function(t){this._metaData=t;this._bitmapInfo=Object.create(t);this._filter=new s(this._bitmapInfo)};f.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};f.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};f.prototype._simpleTransparency=function(){this._metaData.alpha=true};f.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};f.prototype._finished=function(){if(this.errord){return}if(!this._inflate){this.emit("error","No Inflate block")}else{this._inflate.end()}};f.prototype._complete=function(e){if(this.errord){return}let r;try{let t=u.dataToBitMap(e,this._bitmapInfo);r=l(t,this._bitmapInfo);t=null}catch(t){this._handleError(t);return}this.emit("parsed",r)}},{"./bitmapper":78,"./chunkstream":80,"./filter-parse-async":84,"./format-normaliser":87,"./parser":95,util:202,zlib:146}],94:[function(t,e,r){(function(A){(function(){"use strict";let w=true;let _=t("zlib");let x=t("./sync-inflate");if(!_.deflateSync){w=false}let C=t("./sync-reader");let k=t("./filter-parse-sync");let T=t("./parser");let S=t("./bitmapper");let E=t("./format-normaliser");e.exports=function(t,e){if(!w){throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0")}let r;function i(t){r=t}let n;function s(t){n=t}function o(t){n.transColor=t}function a(t){n.palette=t}function u(){n.alpha=true}let l;function f(t){l=t}let h=[];function c(t){h.push(t)}let d=new C(t);let p=new T(e,{read:d.read.bind(d),error:i,metadata:s,gamma:f,palette:a,transColor:o,inflateData:c,simpleTransparency:u});p.start();d.process();if(r){throw r}let g=A.concat(h);h.length=0;let y;if(n.interlace){y=_.inflateSync(g)}else{let t=(n.width*n.bpp*n.depth+7>>3)+1;let e=t*n.height;y=x(g,{chunkSize:e,maxLength:e})}g=null;if(!y||!y.length){throw new Error("bad png - invalid inflate data response")}let b=k.process(y,n);g=null;let m=S.dataToBitMap(b,n);b=null;let v=E(m,n);n.data=v;n.gamma=l||0;return n}}).call(this)}).call(this,t("buffer").Buffer)},{"./bitmapper":78,"./filter-parse-sync":85,"./format-normaliser":87,"./parser":95,"./sync-inflate":98,"./sync-reader":99,buffer:147,zlib:146}],95:[function(e,r,t){(function(o){(function(){"use strict";let l=e("./constants");let s=e("./crc");let t=r.exports=function(t,e){this._options=t;t.checkCRC=t.checkCRC!==false;this._hasIHDR=false;this._hasIEND=false;this._emittedHeadersFinished=false;this._palette=[];this._colorType=0;this._chunks={};this._chunks[l.TYPE_IHDR]=this._handleIHDR.bind(this);this._chunks[l.TYPE_IEND]=this._handleIEND.bind(this);this._chunks[l.TYPE_IDAT]=this._handleIDAT.bind(this);this._chunks[l.TYPE_PLTE]=this._handlePLTE.bind(this);this._chunks[l.TYPE_tRNS]=this._handleTRNS.bind(this);this._chunks[l.TYPE_gAMA]=this._handleGAMA.bind(this);this.read=e.read;this.error=e.error;this.metadata=e.metadata;this.gamma=e.gamma;this.transColor=e.transColor;this.palette=e.palette;this.parsed=e.parsed;this.inflateData=e.inflateData;this.finished=e.finished;this.simpleTransparency=e.simpleTransparency;this.headersFinished=e.headersFinished||function(){}};t.prototype.start=function(){this.read(l.PNG_SIGNATURE.length,this._parseSignature.bind(this))};t.prototype._parseSignature=function(e){let r=l.PNG_SIGNATURE;for(let t=0;t<r.length;t++){if(e[t]!==r[t]){this.error(new Error("Invalid file signature"));return}}this.read(8,this._parseChunkBegin.bind(this))};t.prototype._parseChunkBegin=function(e){let t=e.readUInt32BE(0);let r=e.readUInt32BE(4);let i="";for(let t=4;t<8;t++){i+=String.fromCharCode(e[t])}let n=Boolean(e[4]&32);if(!this._hasIHDR&&r!==l.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}this._crc=new s;this._crc.write(o.from(i));if(this._chunks[r]){return this._chunks[r](t)}if(!n){this.error(new Error("Unsupported critical chunk type "+i));return}this.read(t+4,this._skipChunk.bind(this))};t.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};t.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};t.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0);let r=this._crc.crc32();if(this._options.checkCRC&&r!==e){this.error(new Error("Crc error - "+e+" - "+r));return}if(!this._hasIEND){this.read(8,this._parseChunkBegin.bind(this))}};t.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))};t.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0);let r=t.readUInt32BE(4);let i=t[8];let n=t[9];let s=t[10];let o=t[11];let a=t[12];if(i!==8&&i!==4&&i!==2&&i!==1&&i!==16){this.error(new Error("Unsupported bit depth "+i));return}if(!(n in l.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(s!==0){this.error(new Error("Unsupported compression method"));return}if(o!==0){this.error(new Error("Unsupported filter method"));return}if(a!==0&&a!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=n;let u=l.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=true;this.metadata({width:e,height:r,depth:i,interlace:Boolean(a),palette:Boolean(n&l.COLORTYPE_PALETTE),color:Boolean(n&l.COLORTYPE_COLOR),alpha:Boolean(n&l.COLORTYPE_ALPHA),bpp:u,colorType:n});this._handleChunkEnd()};t.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))};t.prototype._parsePLTE=function(e){this._crc.write(e);let r=Math.floor(e.length/3);for(let t=0;t<r;t++){this._palette.push([e[t*3],e[t*3+1],e[t*3+2],255])}this.palette(this._palette);this._handleChunkEnd()};t.prototype._handleTRNS=function(t){this.simpleTransparency();this.read(t,this._parseTRNS.bind(this))};t.prototype._parseTRNS=function(e){this._crc.write(e);if(this._colorType===l.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(e.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let t=0;t<e.length;t++){this._palette[t][3]=e[t]}this.palette(this._palette)}if(this._colorType===l.COLORTYPE_GRAYSCALE){this.transColor([e.readUInt16BE(0)])}if(this._colorType===l.COLORTYPE_COLOR){this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)])}this._handleChunkEnd()};t.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))};t.prototype._parseGAMA=function(t){this._crc.write(t);this.gamma(t.readUInt32BE(0)/l.GAMMA_DIVISION);this._handleChunkEnd()};t.prototype._handleIDAT=function(t){if(!this._emittedHeadersFinished){this._emittedHeadersFinished=true;this.headersFinished()}this.read(-t,this._parseIDAT.bind(this,t))};t.prototype._parseIDAT=function(t,e){this._crc.write(e);if(this._colorType===l.COLORTYPE_PALETTE_COLOR&&this._palette.length===0){throw new Error("Expected palette not found")}this.inflateData(e);let r=t-e.length;if(r>0){this._handleIDAT(r)}else{this._handleChunkEnd()}};t.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};t.prototype._parseIEND=function(t){this._crc.write(t);this._hasIEND=true;this._handleChunkEnd();if(this.finished){this.finished()}}}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":81,"./crc":82,buffer:147}],96:[function(t,e,r){"use strict";let i=t("./parser-sync");let n=t("./packer-sync");r.read=function(t,e){return i(t,e||{})};r.write=function(t,e){return n(t,e)}},{"./packer-sync":90,"./parser-sync":94}],97:[function(u,t,l){(function(s,o){(function(){"use strict";let t=u("util");let e=u("stream");let r=u("./parser-async");let i=u("./packer-async");let n=u("./png-sync");let a=l.PNG=function(t){e.call(this);t=t||{};this.width=t.width|0;this.height=t.height|0;this.data=this.width>0&&this.height>0?o.alloc(4*this.width*this.height):null;if(t.fill&&this.data){this.data.fill(0)}this.gamma=0;this.readable=this.writable=true;this._parser=new r(t);this._parser.on("error",this.emit.bind(this,"error"));this._parser.on("close",this._handleClose.bind(this));this._parser.on("metadata",this._metadata.bind(this));this._parser.on("gamma",this._gamma.bind(this));this._parser.on("parsed",function(t){this.data=t;this.emit("parsed",t)}.bind(this));this._packer=new i(t);this._packer.on("data",this.emit.bind(this,"data"));this._packer.on("end",this.emit.bind(this,"end"));this._parser.on("close",this._handleClose.bind(this));this._packer.on("error",this.emit.bind(this,"error"))};t.inherits(a,e);a.sync=n;a.prototype.pack=function(){if(!this.data||!this.data.length){this.emit("error","No data provided");return this}s.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this));return this};a.prototype.parse=function(t,i){if(i){let e,r;e=function(t){this.removeListener("error",r);this.data=t;i(null,this)}.bind(this);r=function(t){this.removeListener("parsed",e);i(t,null)}.bind(this);this.once("parsed",e);this.once("error",r)}this.end(t);return this};a.prototype.write=function(t){this._parser.write(t);return true};a.prototype.end=function(t){this._parser.end(t)};a.prototype._metadata=function(t){this.width=t.width;this.height=t.height;this.emit("metadata",t)};a.prototype._gamma=function(t){this.gamma=t};a.prototype._handleClose=function(){if(!this._parser.writable&&!this._packer.readable){this.emit("close")}};a.bitblt=function(e,r,i,n,s,o,a,u){i|=0;n|=0;s|=0;o|=0;a|=0;u|=0;if(i>e.width||n>e.height||i+s>e.width||n+o>e.height){throw new Error("bitblt reading outside image")}if(a>r.width||u>r.height||a+s>r.width||u+o>r.height){throw new Error("bitblt writing outside image")}for(let t=0;t<o;t++){e.data.copy(r.data,(u+t)*r.width+a<<2,(n+t)*e.width+i<<2,(n+t)*e.width+i+s<<2)}};a.prototype.bitblt=function(t,e,r,i,n,s,o){a.bitblt(this,t,e,r,i,n,s,o);return this};a.adjustGamma=function(i){if(i.gamma){for(let e=0;e<i.height;e++){for(let t=0;t<i.width;t++){let r=i.width*e+t<<2;for(let e=0;e<3;e++){let t=i.data[r+e]/255;t=Math.pow(t,1/2.2/i.gamma);i.data[r+e]=Math.round(t*255)}}}i.gamma=0}};a.prototype.adjustGamma=function(){a.adjustGamma(this)}}).call(this)}).call(this,u("_process"),u("buffer").Buffer)},{"./packer-async":89,"./parser-async":93,"./png-sync":96,_process:179,buffer:147,stream:181,util:202}],98:[function(o,a,u){(function(s,m){(function(){"use strict";let p=o("assert").ok;let g=o("zlib");let t=o("util");let y=o("buffer").kMaxLength;function r(t){if(!(this instanceof r)){return new r(t)}if(t&&t.chunkSize<g.Z_MIN_CHUNK){t.chunkSize=g.Z_MIN_CHUNK}g.Inflate.call(this,t);this._offset=this._offset===undefined?this._outOffset:this._offset;this._buffer=this._buffer||this._outBuffer;if(t&&t.maxLength!=null){this._maxLength=t.maxLength}}function e(t){return new r(t)}function b(t,e){if(e){s.nextTick(e)}if(!t._handle){return}t._handle.close();t._handle=null}r.prototype._processChunk=function(t,e,r){if(typeof r==="function"){return g.Inflate._processChunk.call(this,t,e,r)}let i=this;let n=t&&t.length;let s=this._chunkSize-this._offset;let o=this._maxLength;let a=0;let u=[];let l=0;let f;this.on("error",function(t){f=t});function h(t,e){if(i._hadError){return}let r=s-e;p(r>=0,"have should not go down");if(r>0){let t=i._buffer.slice(i._offset,i._offset+r);i._offset+=r;if(t.length>o){t=t.slice(0,o)}u.push(t);l+=t.length;o-=t.length;if(o===0){return false}}if(e===0||i._offset>=i._chunkSize){s=i._chunkSize;i._offset=0;i._buffer=m.allocUnsafe(i._chunkSize)}if(e===0){a+=n-t;n=t;return true}return false}p(this._handle,"zlib binding closed");let c;do{c=this._handle.writeSync(e,t,a,n,this._buffer,this._offset,s);c=c||this._writeState}while(!this._hadError&&h(c[0],c[1]));if(this._hadError){throw f}if(l>=y){b(this);throw new RangeError("Cannot create final Buffer. It would be larger than 0x"+y.toString(16)+" bytes")}let d=m.concat(u,l);b(this);return d};t.inherits(r,g.Inflate);function i(t,e){if(typeof e==="string"){e=m.from(e)}if(!(e instanceof m)){throw new TypeError("Not a string or buffer")}let r=t._finishFlushFlag;if(r==null){r=g.Z_FINISH}return t._processChunk(e,r)}function n(t,e){return i(new r(e),t)}a.exports=u=n;u.Inflate=r;u.createInflate=e;u.inflateSync=n}).call(this)}).call(this,o("_process"),o("buffer").Buffer)},{_process:179,assert:138,buffer:147,util:202,zlib:146}],99:[function(t,e,r){"use strict";let i=e.exports=function(t){this._buffer=t;this._reads=[]};i.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})};i.prototype.process=function(){while(this._reads.length>0&&this._buffer.length){let e=this._reads[0];if(this._buffer.length&&(this._buffer.length>=e.length||e.allowLess)){this._reads.shift();let t=this._buffer;this._buffer=t.slice(e.length);e.func.call(this,t.slice(0,e.length))}else{break}}if(this._reads.length>0){return new Error("There are some read requests waitng on finished stream")}if(this._buffer.length>0){return new Error("unrecognised content at end of stream")}}},{}],100:[function(t,e,r){(function(m,t){(function(){(function(r,i){"use strict";if(r.setImmediate){return}var n=1;var s={};var o=false;var a=r.document;var u;function t(t){if(typeof t!=="function"){t=new Function(""+t)}var e=new Array(arguments.length-1);for(var r=0;r<e.length;r++){e[r]=arguments[r+1]}var i={callback:t,args:e};s[n]=i;u(n);return n++}function l(t){delete s[t]}function f(t){var e=t.callback;var r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(i,r);break}}function h(t){if(o){setTimeout(h,0,t)}else{var e=s[t];if(e){o=true;try{f(e)}finally{l(t);o=false}}}}function e(){u=function(t){m.nextTick(function(){h(t)})}}function c(){if(r.postMessage&&!r.importScripts){var t=true;var e=r.onmessage;r.onmessage=function(){t=false};r.postMessage("","*");r.onmessage=e;return t}}function d(){var e="setImmediate$"+Math.random()+"$";var t=function(t){if(t.source===r&&typeof t.data==="string"&&t.data.indexOf(e)===0){h(+t.data.slice(e.length))}};if(r.addEventListener){r.addEventListener("message",t,false)}else{r.attachEvent("onmessage",t)}u=function(t){r.postMessage(e+t,"*")}}function p(){var e=new MessageChannel;e.port1.onmessage=function(t){var e=t.data;h(e)};u=function(t){e.port2.postMessage(t)}}function g(){var r=a.documentElement;u=function(t){var e=a.createElement("script");e.onreadystatechange=function(){h(t);e.onreadystatechange=null;r.removeChild(e);e=null};r.appendChild(e)}}function y(){u=function(t){setTimeout(h,0,t)}}var b=Object.getPrototypeOf&&Object.getPrototypeOf(r);b=b&&b.setTimeout?b:r;if({}.toString.call(r.process)==="[object process]"){e()}else if(c()){d()}else if(r.MessageChannel){p()}else if(a&&"onreadystatechange"in a.createElement("script")){g()}else{y()}b.setImmediate=t;b.clearImmediate=l})(typeof self==="undefined"?typeof t==="undefined"?this:t:self)}).call(this)}).call(this,t("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{_process:179}],101:[function(t,e,r){"use strict";const n=t("./seventh.js");function i(t,e=4){this.jobRunner=t;this.jobs=new Map;this.pendingJobs=new Map;this.runningJobs=new Map;this.errorJobs=new Map;this.jobsDone=new Map;this.concurrency=+e||1;this.isQueueRunning=true;this.isLoopRunning=false;this.canLoopAgain=false;this.ready=n.resolved;this.startTime=null;this.endTime=null;this.drained=n.resolved;this.idle=n.resolved}n.Queue=i;function s(t,e=null,r=undefined){this.id=t;this.dependencies=e===null?null:[...e];this.data=r===undefined?t:r;this.error=null;this.startTime=null;this.endTime=null}i.Job=s;i.prototype.setConcurrency=function(t){this.concurrency=+t||1};i.prototype.stop=i.prototype.pause=function(){this.isQueueRunning=false};i.prototype.has=function(t){return this.jobs.has(t)};i.prototype.add=i.prototype.addJob=function(t,e,r=null){if(this.jobs.has(t)){return false}var i=new s(t,r,e);this.jobs.set(t,i);this.pendingJobs.set(t,i);this.canLoopAgain=true;if(this.isQueueRunning&&!this.isLoopRunning){this.run()}if(this.drained.isSettled()){this.drained=new n}return i};i.prototype.addBatch=i.prototype.addJobBatch=function(t){var e,r;for(e of t){if(this.jobs.has(e)){return false}r=new s(e);this.jobs.set(e,r);this.pendingJobs.set(e,r)}this.canLoopAgain=true;if(this.isQueueRunning&&!this.isLoopRunning){this.run()}if(this.drained.isSettled()){this.drained=new n}};i.prototype.run=i.prototype.resume=async function(){var t;this.isQueueRunning=true;if(this.isLoopRunning){return}this.isLoopRunning=true;if(!this.startTime){this.startTime=Date.now()}do{this.canLoopAgain=false;for(t of this.pendingJobs.values()){if(t.dependencies&&t.dependencies.some(t=>!this.jobsDone.has(t))){continue}if(this.idle.isSettled()){this.idle=new n}this.canLoopAgain=true;await this.ready;if(!this.isQueueRunning){this.finishRun();return}this.runJob(t)}}while(this.canLoopAgain);this.finishRun()};i.prototype.finishRun=function(){this.isLoopRunning=false;if(!this.pendingJobs.size){this.drained.resolve()}if(!this.runningJobs.size){this.endTime=Date.now();this.idle.resolve()}};i.prototype.runJob=async function(e){this.pendingJobs.delete(e.id);this.runningJobs.set(e.id,e);if(this.runningJobs.size>=this.concurrency){this.ready=new n}try{e.startTime=Date.now();await this.jobRunner(e.data);e.endTime=Date.now();this.jobsDone.set(e.id,e);this.canLoopAgain=true}catch(t){e.endTime=Date.now();e.error=t;this.errorJobs.set(e.id,e)}this.runningJobs.delete(e.id);if(this.runningJobs.size<this.concurrency){this.ready.resolve()}if(!this.isLoopRunning){if(this.isQueueRunning&&this.pendingJobs.size){this.run()}else{this.finishRun()}}};i.prototype.getJobTimes=function(){var t,e={};for(t of this.jobsDone.values()){e[t.id]=t.endTime-t.startTime}return e};i.prototype.getStats=function(){var t,e=0,r={pending:this.pendingJobs.size,running:this.runningJobs.size,failed:this.errorJobs.size,done:this.jobsDone.size,averageJobTime:null,queueTime:null};if(this.jobsDone.size){for(t of this.jobsDone.values()){e+=t.endTime-t.startTime}r.averageJobTime=e/this.jobsDone.size}if(this.endTime){r.queueTime=this.endTime-this.startTime}return r}},{"./seventh.js":108}],102:[function(t,e,r){"use strict";const o=t("./seventh.js");o.promisifyNodeApi=(i,n,s,t,e)=>{var r;n=n||"Async";s=s||"AsyncAll";t=t||(t=>t[0]!=="_"&&!t.endsWith("Sync"));if(e){r=[];for(let t in i){if(typeof i[t]==="function"){r.push(t)}}}else{r=Object.keys(i)}r.filter(e=>{if(typeof i[e]!=="function"){return false}for(let t in i[e].prototype){return false}return t(e,i)}).forEach(t=>{const e=t+n;const r=t+s;if(!i[e]){i[e]=o.promisify(i[t],i)}if(!i[r]){i[r]=o.promisifyAll(i[t],i)}})};o.promisifyAnyNodeApi=(t,e,r,i)=>{o.promisifyNodeApi(t,e,r,i,true)}},{"./seventh.js":108}],103:[function(t,e,r){"use strict";const p=t("./seventh.js");const f={};function h(){}p.all=t=>{var r=-1,i=false,n=0,s=Infinity,o,a=[],u=new p;for(o of t){if(i){break}r++;(()=>{const e=r;p.resolve(o).then(t=>{if(i){return}a[e]=t;n++;if(n>=s){i=true;u._resolveValue(a)}},t=>{if(i){return}i=true;u.reject(t)})})()}s=r+1;if(!s){u._resolveValue(a)}return u};p._allArray=t=>{var e=t.length;if(!e){p._resolveValue([])}var r,i={settled:false,count:0,length:e,values:[],allPromise:new p};for(r=0;!i.settled&&r<e;r++){p._allArrayOne(t[r],r,i)}return i.allPromise};p._allArrayOne=(t,e,r)=>{p._bareThen(t,t=>{if(r.settled){return}r.values[e]=t;r.count++;if(r.count>=r.length){r.settled=true;r.allPromise._resolveValue(r.values)}},t=>{if(r.settled){return}r.settled=true;r.allPromise.reject(t)})};p.every=p.map=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}return r(t,e)}).then(t=>{if(n){return}u[e]=t;s++;if(s>=o){n=true;l._resolveValue(u)}},t=>{if(n){return}n=true;l.reject(t)})})()}o=i+1;if(!o){l._resolveValue(u)}return l};p.any=t=>{var r=-1,i=false,n=0,s=Infinity,o,a=[],u=new p;for(o of t){if(i){break}r++;(()=>{const e=r;p.resolve(o).then(t=>{if(i){return}i=true;u._resolveValue(t)},t=>{if(i){return}a[e]=t;n++;if(n>=s){i=true;u.reject(a)}})})()}s=r+1;if(!s){u.reject(new RangeError("Promise.any(): empty array"))}return u};p.some=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}return r(t,e)}).then(t=>{if(n){return}n=true;l._resolveValue(t)},t=>{if(n){return}u[e]=t;s++;if(s>=o){n=true;l.reject(u)}})})()}o=i+1;if(!o){l.reject(new RangeError("Promise.any(): empty array"))}return l};p.filter=(t,r)=>{var i=-1,n=false,s=0,o=Infinity,a,u=[],l=new p;for(a of t){if(n){break}i++;(()=>{const e=i;p.resolve(a).then(t=>{if(n){return}u[e]=t;return r(t,e)}).then(t=>{if(n){return}s++;if(!t){u[e]=f}if(s>=o){n=true;u=u.filter(t=>t!==f);l._resolveValue(u)}},t=>{if(n){return}n=true;l.reject(t)})})()}o=i+1;if(!o){l._resolveValue(u)}else if(s>=o){n=true;u=u.filter(t=>t!==f);l._resolveValue(u)}return l};p.foreach=p.forEach=function(t,i,e){var n=-1,s=arguments.length>=3,o=t[Symbol.iterator](),a=new p,u=p.resolve(e);if(p.warnUnhandledRejection){p._handleAll(t)}var l=()=>{u.then(e=>{let{value:t,done:r}=o.next();n++;if(r){a.resolve(e)}else{u=p.resolve(t).then(s?t=>i(e,t,n):t=>i(t,n));l()}},t=>{a.reject(t);for(;;){let{value:t,done:e}=o.next();if(e){break}if(p.isThenable(t)){t.then(h,h)}}})};l();return a};p.reduce=(t,e,r)=>{return p.forEach(t,e,r)};p.mapObject=(t,r)=>{var i=false,n=0,e,s,o=Object.keys(t),a=o.length,u,l={},f=new p;for(e=0;!i&&e<a;e++){s=o[e];u=t[s];(()=>{const e=s;p.resolve(u).then(t=>{if(i){return}return r(t,e)}).then(t=>{if(i){return}l[e]=t;n++;if(n>=a){i=true;f._resolveValue(l)}},t=>{if(i){return}i=true;f.reject(t)})})()}if(!a){f._resolveValue(l)}return f};p.concurrent=(r,t,i)=>{var n=-1,s=false,o=0,a=0,u=Infinity,l,e=false,f=[],h=t[Symbol.iterator](),c=new p;if(p.warnUnhandledRejection){p._handleAll(t)}r=+r||1;const d=()=>{while(!e&&o<r){({value:l,done:e}=h.next());if(e){u=n+1;if(a>=u){s=true;c._resolveValue(f);return}break}if(s){break}n++;(()=>{const e=n;o++;p.resolve(l).then(t=>{if(s){return}return i(t,e)}).then(t=>{if(s){return}f[e]=t;a++;o--;if(a>=u){s=true;c._resolveValue(f);return}if(o<r){d();return}},t=>{if(s){return}s=true;c.reject(t)})})()}};d();if(n<0){c._resolveValue(f)}return c};p.race=t=>{var e=false,r,i=new p;for(r of t){if(e){break}p.resolve(r).then(t=>{if(e){return}e=true;i._resolveValue(t)},t=>{if(e){return}e=true;i.reject(t)})}return i}},{"./seventh.js":108}],104:[function(o,a,t){(function(e,r,s){(function(){"use strict";const t=r.Promise;var i;if(!e.browser){i=e.nextTick}else{o("setimmediate");i=s}function n(t){this.fn=t;this._then=n._dormantThen;this.value=null;this.thenHandlers=null;this.handledRejection=null;if(this.fn){this._exec()}}a.exports=n;n.Native=t;n.warnUnhandledRejection=true;n.prototype._exec=function(){this._then=n._pendingThen;try{this.fn(t=>{this.resolve(t)},t=>{this.reject(t)})}catch(t){this.reject(t)}};n.prototype.resolve=n.prototype.fulfill=function(t){if(this._then.settled){return this}if(n.isThenable(t)){this._execThenPromise(t);return this}return this._resolveValue(t)};n.prototype._resolveValue=function(t){this._then=n._fulfilledThen;this.value=t;if(this.thenHandlers&&this.thenHandlers.length){this._execFulfillHandlers()}return this};n.prototype._execThenPromise=function(t){try{t.then(t=>{this.resolve(t)},t=>{this.reject(t)})}catch(t){this.reject(t)}};n.prototype.reject=function(t){if(this._then.settled){return this}this._then=n._rejectedThen;this.value=t;if(this.thenHandlers&&this.thenHandlers.length){this._execRejectionHandlers()}else if(n.warnUnhandledRejection&&!this.handledRejection){this._unhandledRejection()}return this};n.prototype._execFulfillHandlers=function(){var t,e=this.thenHandlers.length;for(t=0;t<e;t+=3){if(this.thenHandlers[t+1]){this._execOneFulfillHandler(this.thenHandlers[t],this.thenHandlers[t+1])}else{this.thenHandlers[t].resolve(this.value)}}};n.prototype._execOneFulfillHandler=function(e,t){try{e.resolve(t(this.value))}catch(t){e.reject(t)}};n.prototype._execRejectionHandlers=function(){var t,e=this.thenHandlers.length;for(t=0;t<e;t+=3){if(this.thenHandlers[t+2]){this._execOneRejectHandler(this.thenHandlers[t],this.thenHandlers[t+2])}else{this.thenHandlers[t].reject(this.value)}}};n.prototype._execOneRejectHandler=function(e,t){try{e.resolve(t(this.value))}catch(t){e.reject(t)}};n.prototype.resolveTimeout=n.prototype.fulfillTimeout=function(t,e){setTimeout(()=>this.resolve(e),t)};n.prototype.rejectTimeout=function(t,e){setTimeout(()=>this.reject(e),t)};n._dormantThen=function(t,e){if(this.fn){this._exec();return this._then(t,e)}var r=new n;if(!this.thenHandlers){this.thenHandlers=[r,t,e]}else{this.thenHandlers[this.thenHandlers.length]=r;this.thenHandlers[this.thenHandlers.length]=t;this.thenHandlers[this.thenHandlers.length]=e}return r};n._dormantThen.settled=false;n._pendingThen=function(t,e){var r=new n;if(!this.thenHandlers){this.thenHandlers=[r,t,e]}else{this.thenHandlers[this.thenHandlers.length]=r;this.thenHandlers[this.thenHandlers.length]=t;this.thenHandlers[this.thenHandlers.length]=e}return r};n._pendingThen.settled=false;n._fulfilledThen=function(t){if(!t){return this}var e=new n;i(()=>{try{e.resolve(t(this.value))}catch(t){e.reject(t)}});return e};n._fulfilledThen.settled=true;n._rejectedThen=function(t,e){if(!e){return this}this.handledRejection=true;var r=new n;i(()=>{try{r.resolve(e(this.value))}catch(t){r.reject(t)}});return r};n._rejectedThen.settled=true;n.prototype.then=function(t,e){return this._then(t,e)};n.prototype.catch=function(t=()=>undefined){return this._then(undefined,t)};n.prototype.finally=function(t){return this._then(t,t)};n.prototype.tap=n.prototype.tapThen=function(t){this._then(t,undefined);return this};n.prototype.tapCatch=function(t){this._then(undefined,t);return this};n.prototype.tapFinally=function(t){this._then(t,t);return this};n.prototype.fatal=function(){this._then(undefined,t=>{i(()=>{throw t})})};n.prototype.done=function(t,e){this._then(t,e).fatal();return this};n.prototype.callback=function(e){this._then(t=>{e(undefined,t)},t=>{e(t)}).fatal();return this};n.prototype.callbackAll=function(e){this._then(t=>{if(Array.isArray(t)){e(undefined,...t)}else{e(undefined,t)}},t=>{e(t)}).fatal();return this};n.callback=function(t){return new n((r,i)=>{t((t,e)=>{if(t){i(t)}else{r(e)}})})};n.callbackAll=function(t){return new n((r,i)=>{t((t,...e)=>{if(t){i(t)}else{r(e)}})})};n.prototype.toPromise=n.prototype.propagate=function(e){this._then(t=>{e.resolve(t)},t=>{e.reject(t)});return this};n.propagate=function(t,e){t.then(t=>{e.resolve(t)},t=>{e.reject(t)});return t};n.finally=function(t,e){return t.then(e,e)};n.resolve=n.fulfill=function(t){if(n.isThenable(t)){return n.fromThenable(t)}return n._resolveValue(t)};n._resolveValue=function(t){var e=new n;e._then=n._fulfilledThen;e.value=t;return e};n.reject=function(t){var e=new n;e._then=n._rejectedThen;e.value=t;return e};n.resolveTimeout=n.fulfillTimeout=function(e,r){return new n(t=>setTimeout(()=>t(r),e))};n.rejectTimeout=function(r,i){return new n((t,e)=>setTimeout(()=>e(i),r))};n.resolveNextTick=n.fulfillNextTick=function(e){return new n(t=>i(()=>t(e)))};n.rejectNextTick=function(r){return new n((t,e)=>i(()=>e(r)))};n.dormant=function(t){var e=new n;e.fn=t;return e};n.try=function(t){try{return n.resolve(t())}catch(t){return n.reject(t)}};n.isThenable=function(t){return t&&typeof t==="object"&&typeof t.then==="function"};n.fromThenable=function(t){if(t instanceof n){return t}return new n((e,r)=>{t.then(t=>{e(t)},t=>{r(t)})})};n._bareThen=function(t,e,r){if(t&&typeof t==="object"){if(t instanceof n){if(t._then===n._fulfilledThen){e(t.value)}else if(t._then===n._rejectedThen){r(t.value)}else{t._then(e,r)}}else if(typeof t.then==="function"){t.then(e,r)}else{e(t)}}else{e(t)}};n._handleAll=function(t){var e;for(e of t){if(n.isThenable(e)){e.handledRejection=true}}};n.prototype._unhandledRejection=function(){this.handledRejection=false;const e=t=>setTimeout(t,0);if(this.value instanceof Error){e(()=>{if(this.handledRejection===false){this.value.message="Unhandled promise rejection: "+this.value.message;console.error(this.value)}})}else{let t=new Error("Unhandled promise rejection");e(()=>{if(this.handledRejection===false){console.error(t);console.error("Rejection reason:",this.value)}})}};n.prototype.isSettled=function(){return this._then.settled};n.prototype.getStatus=function(){switch(this._then){case n._dormantThen:return"dormant";case n._pendingThen:return"pending";case n._fulfilledThen:return"fulfilled";case n._rejectedThen:return"rejected"}};n.prototype.inspect=function(){switch(this._then){case n._dormantThen:return"Promise { <DORMANT> }";case n._pendingThen:return"Promise { <PENDING> }";case n._fulfilledThen:return"Promise { <FULFILLED> "+this.value+" }";case n._rejectedThen:return"Promise { <REJECTED> "+this.value+" }"}};n.resolved=n.dummy=n.resolve();if(e.browser){n.prototype.resolveAtAnimationFrame=function(t){window.requestAnimationFrame(()=>this.resolve(t))};n.prototype.rejectAtAnimationFrame=function(t){window.requestAnimationFrame(()=>this.reject(t))};n.resolveAtAnimationFrame=function(e){return new n(t=>window.requestAnimationFrame(()=>t(e)))};n.rejectAtAnimationFrame=function(r){return new n((t,e)=>window.requestAnimationFrame(()=>e(r)))}}}).call(this)}).call(this,o("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},o("timers").setImmediate)},{_process:179,setimmediate:100,timers:197}],105:[function(t,e,r){"use strict";const l=t("./seventh.js");l.promisifyAll=(e,n)=>{if(n){return(...t)=>{return new l((r,i)=>{e.call(n,...t,(t,...e)=>{if(t){if(e.length&&t instanceof Error){t.args=e}i(t)}else{r(e)}})})}}return function(...t){return new l((r,i)=>{e.call(this,...t,(t,...e)=>{if(t){if(e.length&&t instanceof Error){t.args=e}i(t)}else{r(e)}})})}};l.promisify=(e,n)=>{if(n){return(...t)=>{return new l((r,i)=>{e.call(n,...t,(t,e)=>{if(t){if(e!==undefined&&t instanceof Error){t.arg=e}i(t)}else{r(e)}})})}}return function(...t){return new l((r,i)=>{e.call(this,...t,(t,e)=>{if(t){if(e!==undefined&&t instanceof Error){t.arg=e}i(t)}else{r(e)}})})}};l.returnValueInterceptor=(r,i,n)=>{return function(...t){var e=i.call(n||this,...t);r(e);return e}};l.once=(e,r)=>{var i=false;var n;return function(...t){if(!i){i=true;n=e.call(r||this,...t)}return n}};l.serialize=(r,i)=>{var n=new l.resolve;return function(...t){var e=new l;n.finally(()=>{l.propagate(r.call(i||this,...t),e)});n=e;return e}};l.debounce=(e,r)=>{var i=null;const n=()=>{i=null};return function(...t){if(i){return i}i=e.call(r||this,...t);l.finally(i,n);return i}};l.debounceDelay=(t,e,r)=>{var i=null;const n=()=>{setTimeout(()=>i=null,t)};return function(...t){if(i){return i}i=e.call(r||this,...t);l.finally(i,n);return i}};l.debounceUpdate=(r,i)=>{var n=null;var s=null;var o=null;const a=()=>{var t,e;n=null;if(s){t=s;s=null;e=o;o=null;n=r.call(...t);l.propagate(n,e);l.finally(n,a);return n}};return function(...t){var e=i||this;if(n){if(!o){o=new l}s=[e,...t];return o}n=r.call(e,...t);l.finally(n,a);return n}};l.NO_DELAY={};l.BATCH_NO_DELAY={};l.debounceSync=(s,o)=>{var r=new Map;const a=t=>{var e=r.get(t);if(!e){e={inProgress:null,inProgressIsFull:null,last:null,lastTime:null,lastFullSync:null,lastFullSyncTime:null,nextFullSyncPromise:null,nextFullSyncWith:null,noDelayBatches:new Set};r.set(t,e)}return e};const u=(t,e)=>{var r,i,n,s=new Date;t.inProgress=null;if(e>=2){t.lastFullSyncTime=t.lastTime=s}else if(e>=1){t.lastTime=s}if(t.nextFullSyncWith){if(o.delay&&t.lastFullSyncTime&&(r=s-t.lastFullSyncTime-o.delay)<0){t.inProgress=l.resolveTimeout(-r+1);t.inProgress.finally(()=>u(t,0));return t.nextFullSyncPromise}i=t.nextFullSyncWith;t.nextFullSyncWith=null;n=t.nextFullSyncPromise;t.nextFullSyncPromise=null;t.lastFullSync=t.last=t.inProgress=o.fn.call(...i);l.propagate(t.inProgress,n);l.finally(t.inProgress,()=>u(t,2));return t.inProgress}};const t=function(t,...e){var r=false,i=s.thisBinding||this,n=a(t);if(e[0]===l.NO_DELAY){r=true;e.shift()}else if(e[0]===l.BATCH_NO_DELAY){e.shift();let t=e.shift();if(!n.noDelayBatches.has(t)){n.noDelayBatches.add(t);r=true}}if(n.inProgress){return n.inProgress}if(!r&&s.delay&&n.lastTime&&new Date-n.lastTime<s.delay){if(typeof s.onDebounce==="function"){s.onDebounce(t,...e)}return n.last}n.last=n.inProgress=s.fn.call(i,t,...e);n.inProgressIsFull=false;l.finally(n.inProgress,()=>u(n,1));return n.inProgress};const e=function(t,...e){var r,i=false,n=o.thisBinding||this,s=a(t);if(e[0]===l.NO_DELAY){i=true;e.shift()}else if(e[0]===l.BATCH_NO_DELAY){e.shift();let t=e.shift();if(!s.noDelayBatches.has(t)){s.noDelayBatches.add(t);i=true}}if(!s.inProgress&&!i&&o.delay&&s.lastFullSyncTime&&(r=new Date-s.lastFullSyncTime-o.delay)<0){s.inProgress=l.resolveTimeout(-r+1);l.finally(s.inProgress,()=>u(s,0))}if(s.inProgress){if(!s.nextFullSyncPromise){s.nextFullSyncPromise=new l}s.nextFullSyncWith=[n,t,...e];return s.nextFullSyncPromise}s.lastFullSync=s.last=s.inProgress=o.fn.call(n,t,...e);l.finally(s.inProgress,()=>u(s,2));return s.inProgress};return[t,e]};l.timeout=(r,i,n)=>{return function(...t){var e=i.call(n||this,...t);setTimeout(()=>e.reject(new Error("Timeout")),r);return e}};l.variableTimeout=(i,n)=>{return function(t,...e){var r=i.call(n||this,...e);setTimeout(()=>r.reject(new Error("Timeout")),t);return r}}},{"./seventh.js":108}],106:[function(t,e,r){(function(o){(function(){"use strict";const n=t("./seventh.js");var s=false;n.asyncExit=function(r,i){if(s){return}s=true;var t=o.listeners("asyncExit");if(!t.length){o.exit(r);return}if(i===undefined){i=1e3}const e=e=>{if(e.length<3){e(r,i);return n.dummy}return new n(t=>{e(r,i,()=>{t()})})};n.map(t,e).finally(()=>o.exit(r));setTimeout(()=>o.exit(r),i)};n.resolveSafeTimeout=function(e,r){return new n(t=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>{setTimeout(()=>t(r),0)},e/2)},e/2)},0)})}}).call(this)}).call(this,t("_process"))},{"./seventh.js":108,_process:179}],107:[function(t,e,r){"use strict";const i=t("./seventh.js");i.parasite=()=>{var t=["tap","tapCatch","finally","fatal","done","callback","callbackAll"];t.forEach(t=>i.Native.prototype[t]=i.prototype[t]);i.Native.prototype._then=i.Native.prototype.then}},{"./seventh.js":108}],108:[function(t,e,r){"use strict";const i=t("./core.js");e.exports=i;t("./batch.js");t("./wrapper.js");t("./decorators.js");t("./Queue.js");t("./api.js");t("./parasite.js");t("./misc.js")},{"./Queue.js":101,"./api.js":102,"./batch.js":103,"./core.js":104,"./decorators.js":105,"./misc.js":106,"./parasite.js":107,"./wrapper.js":109}],109:[function(t,e,r){"use strict";const l=t("./seventh.js");l.timeLimit=(r,i)=>{return new l((t,e)=>{if(typeof i==="function"){i=i()}l.resolve(i).then(t,e);setTimeout(()=>e(new Error("Timeout")),r)})};l.retry=(t,e)=>{var r=t.retries||1,i=t.coolDown||0,n=t.raiseFactor||1,s=t.maxCoolDown||Infinity,o=t.timeout||0,a=t.catch||null;const u=()=>{return(o?l.timeLimit(o,e):e()).catch(t=>{if(!r--){throw t}var e=i;i=Math.min(i*n,s);if(a){return l.resolve(a(t)).then(()=>l.resolveTimeout(e).then(u))}return l.resolveTimeout(e).then(u)})};return u()};l.onceEvent=(e,r)=>{return new l(t=>e.once(r,t))};l.onceEventAll=(t,r)=>{return new l(e=>t.once(r,(...t)=>e(t)))};l.onceEventOrError=(a,u,t,r=false)=>{return new l((e,i)=>{var n;var s=(...t)=>{a.removeListener("error",o);if(n){for(let t in n){a.removeListener(t,n[t])}}e(r?t:t[0])};var o=t=>{a.removeListener(u,s);if(n){for(let t in n){a.removeListener(t,n[t])}}i(t)};a.once(u,s);a.once("error",o);if(t){if(!Array.isArray(t)){t=[t]}n={};t.forEach(r=>{var t=(...t)=>{a.removeListener("error",o);a.removeListener(u,s);var e=new Error("Received an excluded event: "+r);e.event=r;e.eventArgs=t;i(e)};a.once(r,t);n[r]=t})}})};l.onceEventAllOrError=(t,e,r)=>{return l.onceEventOrError(t,e,r,true)}},{"./seventh.js":108}],110:[function(t,e,r){"use strict";function i(t,e=".",r=""){this.sign=1;this.digits=[];this.exposant=0;this.special=null;this.decimalSeparator=e;this.groupSeparator=r;this.set(t)}e.exports=i;i.prototype.set=function(t){var e,r,i,n,s,o,a,u,l;t=+t;if(!Number.isFinite(t)){this.special=t;return null}t=""+t;e=t.match(/(-)?([0-9]+)(?:.([0-9]+))?(?:e([+-][0-9]+))?/);if(!e){throw new Error("Unexpected error")}this.sign=e[1]?-1:1;this.exposant=e[2].length+(parseInt(e[4],10)||0);a=0;u=false;l=0;for(s=0,o=e[2].length;s<o;s++){n=+e[2][s];if(n!==0){u=true;this.digits[a]=n;a++;l=a}else if(u){this.digits[a]=n;a++}else{this.exposant--}}if(e[3]){for(s=0,o=e[3].length;s<o;s++){n=+e[3][s];if(n!==0){u=true;this.digits[a]=n;a++;l=a}else if(u){this.digits[a]=n;a++}else{this.exposant--}}}if(l!==a){this.digits.length=l}};i.prototype.toNumber=function(){if(this.special!==null){return this.special}return parseFloat((this.sign<0?"-":"")+"0."+this.digits.join("")+"e"+this.exposant)};i.prototype.toString=function(...t){if(this.special!==null){return""+this.special}if(this.exposant>20||this.exposant<-20){return this.toScientificString(...t)}return this.toNoExpString(...t)};i.prototype.toExponential=i.prototype.toExponentialString=function(){if(this.special!==null){return""+this.special}var t=this.sign<0?"-":"";if(!this.digits.length){return t+"0"}t+=this.digits[0];if(this.digits.length>1){t+=this.decimalSeparator+this.digits.join("").slice(1)}t+="e"+(this.exposant>0?"+":"")+(this.exposant-1);return t};const n=["⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"];const s="⁺";const o="⁻";const a="0".charCodeAt(0);i.prototype.toScientific=i.prototype.toScientificString=function(){if(this.special!==null){return""+this.special}var t=this.sign<0?"-":"";if(!this.digits.length){return t+"0"}t+=this.digits[0];if(this.digits.length>1){t+=this.decimalSeparator+this.digits.join("").slice(1)}var e=(this.exposant<=0?o:"")+(""+Math.abs(this.exposant-1)).split("").map(t=>n[t.charCodeAt(0)-a]).join("");t+=" × 10"+e;return t};i.prototype.toNoExp=i.prototype.toNoExpString=function(t=1,e=0,r=false,i=false,n=this.exposant){if(this.special!==null){return""+this.special}var s=[],o=[],a=this.sign<0?"-":i?"+":"";if(!this.digits.length){h(s,0,t);if(e&&!r){h(o,0,e)}}else if(n<=0){h(s,0,t);h(o,0,-n);c(o,this.digits);if(e&&this.digits.length-n<e){h(o,0,e-this.digits.length+n)}}else if(n>=this.digits.length){if(n<t){h(s,0,t-n)}c(s,this.digits);h(s,0,n-this.digits.length);if(e&&!r){h(o,0,e)}}else{if(n<t){h(s,0,t-n)}c(s,this.digits,0,n);c(o,this.digits,n);if(e&&this.digits.length-n<e&&(!r||this.digits.length-n>0)){h(o,0,e-this.digits.length+n)}}a+=this.groupSeparator?this.groupDigits(s,this.groupSeparator):s.join("");if(o.length){a+=this.decimalSeparator+(this.decimalGroupSeparator?this.groupDigits(o,this.decimalGroupSeparator):o.join(""))}return a};const u=["","k","M","G","T","P","E","Z","Y"];const l=["","m","µ","n","p","f","a","z","y"];i.prototype.toMetric=i.prototype.toMetricString=function(t=1,e=0,r=false,i=false){if(this.special!==null){return""+this.special}if(!this.digits.length){return this.sign>0?"0":"-0"}var n="",s;if(this.exposant>0){s=1+(this.exposant-1)%3;n=u[Math.floor((this.exposant-1)/3)];if(n===undefined){return this.toScientificString()}}else{s=3- -this.exposant%3;n=l[1+Math.floor(-this.exposant/3)];if(n===undefined){return this.toScientificString()}}return this.toNoExpString(t,e,r,i,s)+n};i.prototype.precision=function(r){if(this.special!==null||r>=this.digits.length){return this}if(r<0){this.digits.length=0;return this}if(this.digits[r]>=5){let t=r-1,e=false;for(;t>=0;t--){if(this.digits[t]<9){this.digits[t]++;e=true;break}else{this.digits[t]=0}}if(!e){this.exposant++;this.digits[0]=1;this.digits.length=1}else{this.digits.length=t+1}}else{this.digits.length=r;this.removeTrailingZero()}return this};i.prototype.round=function(t=0){var e=this.exposant+t;return this.precision(e)};i.prototype.removeTrailingZero=function(){var t=this.digits.length-1;while(t>=0&&this.digits[t]===0){t--}this.digits.length=t+1};const f=3;i.prototype.groupDigits=function(t,e,r=false){var i="",n=r?0:f-t.length%f,s=0,o=t.length;for(;s<o;s++){i+=s&&(s+n)%f===0?e+t[s]:t[s]}return i};function h(t,e,r){while(r--){t[t.length]=e}return t}function c(e,r,i=0,n=r.length){for(let t=i;t<n;t++){e[e.length]=r[t]}return e}},{}],111:[function(t,e,r){"use strict";e.exports={reset:"[0m",bold:"[1m",dim:"[2m",italic:"[3m",underline:"[4m",inverse:"[7m",defaultColor:"[39m",black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m",grey:"[90m",gray:"[90m",brightBlack:"[90m",brightRed:"[91m",brightGreen:"[92m",brightYellow:"[93m",brightBlue:"[94m",brightMagenta:"[95m",brightCyan:"[96m",brightWhite:"[97m",defaultBgColor:"[49m",bgBlack:"[40m",bgRed:"[41m",bgGreen:"[42m",bgYellow:"[43m",bgBlue:"[44m",bgMagenta:"[45m",bgCyan:"[46m",bgWhite:"[47m",bgGrey:"[100m",bgGray:"[100m",bgBrightBlack:"[100m",bgBrightRed:"[101m",bgBrightGreen:"[102m",bgBrightYellow:"[103m",bgBrightBlue:"[104m",bgBrightMagenta:"[105m",bgBrightCyan:"[106m",bgBrightWhite:"[107m"}},{}],112:[function(t,e,r){"use strict";var i={};e.exports=i;i.toCamelCase=function(t,n=false){if(!t||typeof t!=="string"){return""}return t.replace(/^[\s_-]*([^\s_-]+)|[\s_-]+([^\s_-]?)([^\s_-]*)/g,(t,e,r,i)=>{if(n){if(e){return e}if(!r){return""}return r.toUpperCase()+i}if(e){return e.toLowerCase()}if(!r){return""}return r.toUpperCase()+i.toLowerCase()})};i.camelCaseToSeparated=function(t,i=" "){if(!t||typeof t!=="string"){return""}return t.replace(/^([A-Z])|([A-Z])/g,(t,e,r)=>{if(e){return e.toLowerCase()}return i+r.toLowerCase()})};i.camelCaseToDash=i.camelCaseToDashed=t=>i.camelCaseToSeparated(t,"-")},{}],113:[function(t,e,r){"use strict";r.regExp=r.regExpPattern=t=>t.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1");r.regExpReplacement=t=>t.replace(/\$/g,"$$$$");r.format=t=>t.replace(/%/g,"%%");r.jsSingleQuote=t=>r.control(t).replace(/'/g,"\\'");r.jsDoubleQuote=t=>r.control(t).replace(/"/g,'\\"');r.shellArg=t=>"'"+t.replace(/'/g,"'\\''")+"'";var i={"\r":"\\r","\n":"\\n","\t":"\\t","":"\\x7f"};r.control=(t,r=false)=>t.replace(/[\x00-\x1f\x7f]/g,t=>{if(r&&(t==="\n"||t==="\t")){return t}if(i[t]!==undefined){return i[t]}var e=t.charCodeAt(0).toString(16);if(e.length%2){e="0"+e}return"\\x"+e});var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};r.html=t=>t.replace(/[&<>]/g,t=>n[t]);r.htmlAttr=t=>t.replace(/[&<>"]/g,t=>n[t]);r.htmlSpecialChars=t=>t.replace(/[&<>"']/g,t=>n[t]);r.unicodePercentEncode=t=>t.replace(/[\x00-\x1f\u0100-\uffff\x7f%]/g,t=>{try{return encodeURI(t)}catch(t){return""}});r.httpHeaderValue=t=>r.unicodePercentEncode(t)},{}],114:[function(T,t,S){(function(k){(function(){"use strict";const c=T("./inspect.js").inspect;const d=T("./inspect.js").inspectError;const e=T("./escape.js");const t=T("./ansi.js");const s=T("./unicode.js");const i=T("./naturalSort.js");const n=T("./StringNumber.js");S.formatMethod=function(...p){var t=p[0];if(typeof t!=="string"){if(!t){t=""}else if(typeof t.toString==="function"){t=t.toString()}else{t=""}}var g,y=1,b=p.length,m=false,v=null,w=[];if(this.markupReset&&this.startingMarkupReset){t=(typeof this.markupReset==="function"?this.markupReset(w):this.markupReset)+t}t=t.replace(/\^(.?)|(%%)|%([+-]?)([0-9]*)(?:\[([^\]]*)\])?([a-zA-Z])/g,(t,e,r,i,n,s,o)=>{var a,u,l,f,h,c,d=[];if(r){return"%"}if(e){if(this.noMarkup){return"^"+e}if(e==="^"){return"^"}if(this.shiftMarkup&&this.shiftMarkup[e]){v=this.shiftMarkup[e];return""}if(v){if(!this.shiftedMarkup||!this.shiftedMarkup[v]||!this.shiftedMarkup[v][e]){return""}m=true;if(typeof this.shiftedMarkup[v][e]==="function"){a=this.shiftedMarkup[v][e](w)}else{a=this.shiftedMarkup[v][e];w.push(a)}v=null}else{if(!this.markup||!this.markup[e]){return""}m=true;if(typeof this.markup[e]==="function"){a=this.markup[e](w)}else{a=this.markup[e];w.push(a)}}return a}if(n){n=parseInt(n,10);if(i){if(i==="+"){n=y+n}else if(i==="-"){n=y-n}}}else{n=y}y++;if(n>=b||n<1){g=undefined}else{g=p[n]}if(_[o]){a=_[o](g,s,this);if(this.argumentSanitizer&&!_[o].noSanitize){a=this.argumentSanitizer(a)}if(s&&!_[o].noCommonModeArg){a=x(a,s)}return a}if(o==="F"){y--;if(s===undefined){return""}l=s.split(":");f=l[0];h=l[1];if(!f){return""}if(h&&(c=h.match(/%([+-]?)([0-9]*)[a-zA-Z]/g))){for(u=0;u<c.length;u++){i=c[u][1];n=c[u][2];if(n){n=parseInt(n,10);if(i){if(i==="+"){n=y+n}else if(i==="-"){n=y-n}}}else{n=y}y++;if(n>=b||n<1){d[u]=undefined}else{d[u]=p[n]}}}if(!this||!this.fn||typeof this.fn[f]!=="function"){return""}return this.fn[f].apply(this,d)}return""});if(m&&this.markupReset&&this.endingMarkupReset){t+=typeof this.markupReset==="function"?this.markupReset(w):this.markupReset}if(this.extraArguments){for(;y<b;y++){g=p[y];if(g===null||g===undefined){continue}else if(typeof g==="string"){t+=g}else if(typeof g==="number"){t+=g}else if(typeof g.toString==="function"){t+=g.toString()}}}return t};const _={};_.s=t=>{if(typeof t==="string"){return t}if(t===null||t===undefined||t===true||t===false){return"("+t+")"}if(typeof t==="number"){return""+t}if(typeof t.toString==="function"){return t.toString()}return"("+t+")"};_.r=t=>_.s(t);_.r.noSanitize=true;_.S=(t,e,r)=>{var i=t=>S.markupMethod.call(r,r.argumentSanitizer?r.argumentSanitizer(t):t);if(typeof t==="string"){return i(t)}if(t===null||t===undefined||t===true||t===false){return"("+t+")"}if(typeof t==="number"){return""+t}if(typeof t.toString==="function"){return i(t.toString())}return i("("+t+")")};_.S.noSanitize=true;_.S.noCommonModeArg=true;_.N=(t,e)=>{if(typeof t==="string"){return t}if(t===null||t===undefined||t===true||t===false){return""+t}if(typeof t==="number"){return _.f(t,".3g ")}if(Array.isArray(t)){t=t.map(t=>_.N(t,true));if(e){return"["+t.join(",")+"]"}return t.join(", ")}if(k.isBuffer(t)){t=[...t].map(t=>{t=t.toString(16);if(t.length===1){t="0"+t}return t});return"<"+t.join(" ")+">"}var r=Object.getPrototypeOf(t);if(r===null||r===Object.prototype){t=Object.entries(t).sort(i).map(t=>t[0]+": "+_.N(t[1],true));if(e){return"{"+t.join(", ")+"}"}return t.join(", ")}if(typeof t.inspect==="function"){return t.inspect()}if(typeof t.toString==="function"){return t.toString()}return"("+t+")"};_.n=t=>_.N(t,true);_.f=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)};_.f.noSanitize=true;_.P=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}t*=100;var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null||!r.precision){i.round(r.rounding||0)}if(r.precision){i.precision(r.precision)}return i.toNoExpString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)+"%"};_.P.noSanitize=true;_.p=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}t=(t-1)*100;var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null||!r.precision){i.round(r.rounding||0)}if(r.precision){i.precision(r.precision)}return i.toNoExpString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal,true)+"%"};_.p.noSanitize=true;_.k=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"0"}var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision||r.rounding===null){i.precision(r.precision||3)}return i.toMetricString(r.leftPadding,r.rightPadding,r.rightPaddingOnlyIfDecimal)};_.k.noSanitize=true;_.e=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toExponential()};_.e.noSanitize=true;_.K=(t,e)=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){t=0}var r=g(e),i=new n(t,".",r.groupSeparator);if(r.rounding!==null){i.round(r.rounding)}if(r.precision){i.precision(r.precision)}return i.toScientific()};_.K.noSanitize=true;_.d=_.i=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.floor(t)}return"0"};_.i.noSanitize=true;_.u=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0)}return"0"};_.u.noSanitize=true;_.U=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),1)}return"1"};_.U.noSanitize=true;_.m=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"(NaN)"}var e="";if(t<0){e="-";t=-t}var r=w(t),i=t-r;if(!i){return e+r+"°"}var n=w(i*60),s=w(i*3600-n*60);if(s){return e+r+"°"+(""+n).padStart(2,"0")+"′"+(""+s).padStart(2,"0")+"″"}return e+r+"°"+(""+n).padStart(2,"0")+"′"};_.m.noSanitize=true;_.t=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"(NaN)"}var e=Math.floor(t/1e3);if(e<60){return e+"s"}var r=Math.floor(e/60);e=e%60;if(r<60){return r+"min"+(""+e).padStart(2,"0")+"s"}var i=Math.floor(r/60);r=r%60;return i+"h"+(""+r).padStart(2,"0")+"min"+(""+e).padStart(2,"0")+"s"};_.t.noSanitize=true;_.h=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(16)}return"0"};_.h.noSanitize=true;_.x=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"){return"00"}var e=""+Math.max(Math.floor(t),0).toString(16);if(e.length%2){e="0"+e}return e};_.x.noSanitize=true;_.o=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(8)}return"0"};_.o.noSanitize=true;_.b=t=>{if(typeof t==="string"){t=parseFloat(t)}if(typeof t==="number"){return""+Math.max(Math.floor(t),0).toString(2)}return"0"};_.b.noSanitize=true;_.X=t=>{if(typeof t==="string"){t=k.from(t)}else if(!k.isBuffer(t)){return""}return t.toString("hex")};_.X.noSanitize=true;_.z=t=>{if(typeof t==="string"){t=k.from(t)}else if(!k.isBuffer(t)){return""}return t.toString("base64")};_.Z=t=>{if(typeof t==="string"){t=k.from(t)}else if(!k.isBuffer(t)){return""}return t.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/[=]{1,2}$/g,"")};const o={};_.I=(t,e,r)=>y(t,e,r,o);_.I.noSanitize=true;const a={noFunc:true,enumOnly:true,noDescriptor:true,useInspect:true,useInspectPropertyBlackList:true};_.Y=(t,e,r)=>y(t,e,r,a);_.Y.noSanitize=true;const u={minimal:true,noIndex:true};_.O=(t,e,r)=>y(t,e,r,u);_.O.noSanitize=true;const l={};_.E=(t,e,r)=>y(t,e,r,l,true);_.E.noSanitize=true;_.J=t=>t===undefined?"null":JSON.stringify(t);_.D=()=>"";_.D.noSanitize=true;var r={argumentSanitizer:t=>e.control(t,true),extraArguments:true,color:false,noMarkup:false,endingMarkupReset:true,startingMarkupReset:false,markupReset:t.reset,shiftMarkup:{"#":"background"},markup:{":":t.reset," ":t.reset+" ","-":t.dim,"+":t.bold,_:t.underline,"/":t.italic,"!":t.inverse,b:t.blue,B:t.brightBlue,c:t.cyan,C:t.brightCyan,g:t.green,G:t.brightGreen,k:t.black,K:t.brightBlack,m:t.magenta,M:t.brightMagenta,r:t.red,R:t.brightRed,w:t.white,W:t.brightWhite,y:t.yellow,Y:t.brightYellow},shiftedMarkup:{background:{":":t.reset," ":t.reset+" ",b:t.bgBlue,B:t.bgBrightBlue,c:t.bgCyan,C:t.bgBrightCyan,g:t.bgGreen,G:t.bgBrightGreen,k:t.bgBlack,K:t.bgBrightBlack,m:t.bgMagenta,M:t.bgBrightMagenta,r:t.bgRed,R:t.bgBrightRed,w:t.bgWhite,W:t.bgBrightWhite,y:t.bgYellow,Y:t.bgBrightYellow}}};S.createFormatter=t=>S.formatMethod.bind(Object.assign({},r,t));S.format=S.formatMethod.bind(r);S.format.default=r;S.format.modes=_;S.markupMethod=function(t){if(typeof t!=="string"){if(!t){t=""}else if(typeof t.toString==="function"){t=t.toString()}else{t=""}}var i=false,n=null,s=[];if(this.markupReset&&this.startingMarkupReset){t=(typeof this.markupReset==="function"?this.markupReset(s):this.markupReset)+t}t=t.replace(/\^(.?)/g,(t,e)=>{var r;if(e==="^"){return"^"}if(this.shiftMarkup&&this.shiftMarkup[e]){n=this.shiftMarkup[e];return""}if(n){if(!this.shiftedMarkup||!this.shiftedMarkup[n]||!this.shiftedMarkup[n][e]){return""}i=true;if(typeof this.shiftedMarkup[n][e]==="function"){r=this.shiftedMarkup[n][e](s)}else{r=this.shiftedMarkup[n][e];s.push(r)}n=null}else{if(!this.markup||!this.markup[e]){return""}i=true;if(typeof this.markup[e]==="function"){r=this.markup[e](s)}else{r=this.markup[e];s.push(r)}}return r});if(i&&this.markupReset&&this.endingMarkupReset){t+=typeof this.markupReset==="function"?this.markupReset(s):this.markupReset}return t};S.createMarkup=t=>S.markupMethod.bind(Object.assign({},r,t));S.markup=S.markupMethod.bind(r);S.format.count=function(t){var e,r,i,n=1,s=0;if(typeof t!=="string"){return 0}var o=/%([+-]?)([0-9]*)(?:\[([^\]]*)\])?([a-zA-EG-Z])/g;while((e=o.exec(t))!==null){i=e[1];r=e[2];if(r){r=parseInt(r,10);if(i){if(i==="+"){r=n+r}else if(i==="-"){r=n-r}}}else{r=n}n++;if(s<r){s=r}}return s};S.format.hasFormatting=function(t){if(t.search(/\^(.?)|(%%)|%([+-]?)([0-9]*)(?:\[([^\]]*)\])?([a-zA-Z])/)!==-1){return true}return false};const f=/([a-zA-Z])(.[^a-zA-Z]*)/g;const p=/([a-zA-Z]|^)(.[^a-zA-Z]*)/g;function x(e,t){var r,i,n;f.lastIndex=0;while(r=f.exec(t)){[,i,n]=r;if(i==="L"){let t=s.width(e);n=+n||1;if(t>n){e=s.truncateWidth(e,n-1).trim()+"…";t=s.width(e)}if(t<n){e=" ".repeat(n-t)+e}}else if(i==="R"){let t=s.width(e);n=+n||1;if(t>n){e=s.truncateWidth(e,n-1).trim()+"…";t=s.width(e)}if(t<n){e=e+" ".repeat(n-t)}}}return e}const h={leftPadding:1,rightPadding:0,rightPaddingOnlyIfDecimal:false,rounding:null,precision:null,groupSeparator:""};function g(t){var e,r,i,n;h.leftPadding=1;h.rightPadding=0;h.rightPaddingOnlyIfDecimal=false;h.rounding=null;h.precision=null;h.groupSeparator="";if(t){p.lastIndex=0;while(e=p.exec(t)){[,r,i]=e;if(r==="z"){h.leftPadding=+i}else if(r==="g"){h.groupSeparator=i||" "}else if(!r){if(i==="g"){h.groupSeparator=" "}else if(i[0]==="."){n=i[i.length-1];if(n==="!"){h.rounding=h.rightPadding=parseInt(i.slice(1,-1),10)||0}else if(n==="?"){h.rounding=h.rightPadding=parseInt(i.slice(1,-1),10)||0;h.rightPaddingOnlyIfDecimal=true}else{h.rounding=parseInt(i.slice(1),10)||0}}else if(i[i.length-1]==="."){h.rounding=-parseInt(i.slice(0,-1),10)||0}else{h.precision=parseInt(i,10)||null}}}}return h}function y(t,e,r,i,n=false){var s,o,a,u,l,f=3,h=r&&r.color?"color":"none";if(e){p.lastIndex=0;while(s=p.exec(e)){[,o,a]=s;if(o==="c"){if(a==="+"){h="color"}else if(a==="-"){h="none"}}else if(o==="l"){u=parseInt(a,10)||undefined}else if(o==="s"){l=parseInt(a,10)||undefined}else if(!o){f=parseInt(a,10)||1}}}if(n){return d(Object.assign({depth:f,style:h,outputMaxLength:u,maxLength:l},i),t)}return c(Object.assign({depth:f,style:h,outputMaxLength:u,maxLength:l},i),t)}const b=1e-10;const m=Math.round(1/b);function v(t){return Math.round(t*m)/m}function w(t){return Math.floor(t+b)}function C(t,e){return v(e*Math.round(t*(1/e)))}}).call(this)}).call(this,T("buffer").Buffer)},{"./StringNumber.js":110,"./ansi.js":111,"./escape.js":113,"./inspect.js":116,"./naturalSort.js":120,"./unicode.js":125,buffer:147}],115:[function(t,e,r){"use strict";const x={};e.exports=x;x.score=(t,e)=>{if(t===e){return 1}if(t.length===0||e.length===0){return 0}return Math.max(0,1-x.levenshtein(t,e)/e.length)};const C=0;const k=.88;const _=.9;x.bestMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n,s,o,a,u=-1,l=null;for(n=0,s=e.length;n<s;n++){a=e[n];o=x.score(t,a);if(o===1){return r.indexOf?n:a}if(o>i){i=o;l=a;u=n}}return r.indexOf?u:l};x.topMatch=(r,t,e={})=>{var i=e.scoreLimit||C,n=e.deltaRate||_,s,o,a;a=t.map((t,e)=>({pattern:t,index:e,score:x.score(r,t)}));a.sort((t,e)=>e.score-t.score);if(a[0].score<=i){return[]}i=Math.max(i,a[0].score*n);for(s=1,o=a.length;s<o;s++){if(a[s].score<i){a.length=s;break}}return e.indexOf?a.map(t=>t.index):a.map(t=>t.pattern)};const i=new Set(["a","an","the","this","that","those","some","of","in","on","at","my","your","her","his","its","our","their"]);function T(t,e=i){return t.split(/[ '"/|,:_-]+/g).filter(t=>t&&!e.has(t))}x.bestTokenMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n=r.tokenDisparityPenalty||k,s,o,a,u,l,f,h,c,d,p,g=i,y,b,m=T(t),v,w=-1,_=null;if(!m.length||!e.length){return r.indexOf?w:_}for(s=0,o=e.length;s<o;s++){h=e[s];c=T(h);p=0;for(a=0,u=m.length;a<u;a++){y=m[a];v=0;for(l=0,f=c.length;l<f;l++){d=c[l];b=x.score(y,d);if(b>v){v=b;if(b===1){break}}}p+=v}p/=m.length;if(m.length!==c.length){p*=n**Math.abs(c.length-m.length)}if(p>g){g=p;_=h;w=s}}return r.indexOf?w:_};x.topTokenMatch=(t,e,r={})=>{var i=r.scoreLimit||C,n=r.tokenDisparityPenalty||k,s=r.deltaRate||_,o,a,u,l,f,h,c,d,p,g,y,b,m=T(t),v,w=[];if(!m.length||!e.length){return[]}for(o=0,a=e.length;o<a;o++){c=e[o];d=T(c);g=0;for(u=0,l=m.length;u<l;u++){y=m[u];v=0;for(f=0,h=d.length;f<h;f++){p=d[f];b=x.score(y,p);if(b>v){v=b;if(b===1){break}}}g+=v}g/=m.length;if(m.length!==d.length){g*=n**Math.abs(d.length-m.length)}w.push({pattern:c,index:o,score:g})}w.sort((t,e)=>e.score-t.score);if(w[0].score<=i){return[]}i=Math.max(i,w[0].score*s);for(o=1,a=w.length;o<a;o++){if(w[o].score<i){w.length=o;break}}return r.indexOf?w.map(t=>t.index):w.map(t=>t.pattern)};const h=[];const c=[];x.levenshtein=(e,r)=>{if(e===r){return 0}if(e.length>r.length){let t=e;e=r;r=t}let t=e.length;let i=r.length;while(t>0&&e.charCodeAt(t-1)===r.charCodeAt(i-1)){t--;i--}let n=0;while(n<t&&e.charCodeAt(n)===r.charCodeAt(n)){n++}t-=n;i-=n;if(t===0){return i}let s;let o;let a;let u;let l=0;let f=0;while(l<t){c[l]=e.charCodeAt(n+l);h[l]=++l}while(f<i){s=r.charCodeAt(n+f);a=f++;o=f;for(l=0;l<t;l++){u=s===c[l]?a:a+1;a=h[l];o=h[l]=a>o?u>o?o+1:u:u>a?a+1:u}}return o}},{}],116:[function(e,t,r){(function(A,h){(function(){"use strict";const x=e("./escape.js");const n=e("./ansi.js");const C={};const k=new Set([Object,Array]);function o(t,e){if(arguments.length<2){e=t;t={}}else if(!t||typeof t!=="object"){t={}}var r={depth:0,ancestors:[]};if(!t.style){t.style=f.none}else if(typeof t.style==="string"){t.style=f[t.style]}if(t.depth===undefined){t.depth=3}if(t.maxLength===undefined){t.maxLength=250}if(t.outputMaxLength===undefined){t.outputMaxLength=5e3}if(t.nofunc){t.noFunc=true}if(t.minimal){t.noFunc=true;t.noDescriptor=true;t.noType=true;t.noArrayProperty=true;t.enumOnly=true;t.proto=false;t.funcDetails=false}if(t.minimalPlusConstructor){t.noFunc=true;t.noDescriptor=true;t.noTypeButConstructor=true;t.noArrayProperty=true;t.enumOnly=true;t.proto=false;t.funcDetails=false}var i=T(r,t,e);if(i.length>t.outputMaxLength){i=t.style.truncate(i,t.outputMaxLength)}return i}function T(e,r,t){var i,n,s,o,a,u,l,f,h,c,d,p,g,y,b="",m="",v="",w,_;h=typeof t;d=r.style.tab.repeat(e.depth);if(h==="function"&&r.noFunc){return""}if(e.key!==undefined){if(e.descriptor){v=[];if(!e.descriptor.configurable){v.push("-conf")}if(!e.descriptor.enumerable){v.push("-enum")}if(!e.descriptor.writable){v.push("-w")}if(v.length){v=v.join(" ")}else{v=""}}if(e.keyIsProperty){if(S(e.key)){m='"'+r.style.key(e.key)+'": '}else{m=r.style.key(e.key)+": "}}else if(!r.noIndex){m=r.style.index(e.key)}if(v){v=" "+r.style.type(v)}}c=e.noPre?"":d+m;if(t===undefined){b+=c+r.style.constant("undefined")+v+r.style.newline}else if(t===C){b+=c+r.style.constant("[empty]")+v+r.style.newline}else if(t===null){b+=c+r.style.constant("null")+v+r.style.newline}else if(t===false){b+=c+r.style.constant("false")+v+r.style.newline}else if(t===true){b+=c+r.style.constant("true")+v+r.style.newline}else if(h==="number"){b+=c+r.style.number(t.toString())+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("number"))+v+r.style.newline}else if(h==="string"){if(t.length>r.maxLength){b+=c+'"'+r.style.string(x.control(t.slice(0,r.maxLength-1)))+'…"'+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("string")+r.style.length("("+t.length+" - TRUNCATED)"))+v+r.style.newline}else{b+=c+'"'+r.style.string(x.control(t))+'"'+(r.noType||r.noTypeButConstructor?"":" "+r.style.type("string")+r.style.length("("+t.length+")"))+v+r.style.newline}}else if(A.isBuffer(t)){b+=c+r.style.inspect(t.inspect())+(r.noType?"":" "+r.style.type("Buffer")+r.style.length("("+t.length+")"))+v+r.style.newline}else if(h==="object"||h==="function"){n=s="";g=false;if(h==="function"){g=true;n=" "+r.style.funcName(t.name?t.name:"(anonymous)");s=r.style.length("("+t.length+")")}p=false;if(Array.isArray(t)){p=true;s=r.style.length("("+t.length+")")}if(!t.constructor){l="(no constructor)"}else if(!t.constructor.name){l="(anonymous)"}else{l=t.constructor.name}u=!t.constructor||k.has(t.constructor);l=r.style.constructorName(l);o=Object.getPrototypeOf(t);b+=c;if(!r.noType&&(!r.noTypeButConstructor||!u)){if(e.forceType&&!r.noType&&!r.noTypeButConstructor){b+=r.style.type(e.forceType)}else if(r.noTypeButConstructor){b+=l}else{b+=l+n+s+" "+r.style.type(h)+v}if(!g||r.funcDetails){b+=" "}}if(p&&r.noArrayProperty){a=[...Array(t.length).keys()]}else{a=Object.getOwnPropertyNames(t)}if(r.sort){a.sort()}y=E(t,e,r);if(r.protoBlackList&&r.protoBlackList.has(o)){b+=r.style.limit("[skip]")+r.style.newline}else if(y!==undefined){if(typeof y==="string"){b+="=> "+y+r.style.newline}else{b+="=> "+T({depth:e.depth,ancestors:e.ancestors,noPre:true},r,y)}}else if(g&&!r.funcDetails){b+=r.style.newline}else if(!a.length&&!r.proto){b+=(p?"[]":"{}")+r.style.newline}else if(e.depth>=r.depth){b+=r.style.limit("[depth limit]")+r.style.newline}else if(e.ancestors.indexOf(t)!==-1){b+=r.style.limit("[circular]")+r.style.newline}else{b+=(p?"[":"{")+r.style.newline;_=e.ancestors.slice();_.push(t);for(i=0;i<a.length&&b.length<r.outputMaxLength;i++){if(!p&&(r.propertyBlackList&&r.propertyBlackList.has(a[i])||r.useInspectPropertyBlackList&&t.inspectPropertyBlackList instanceof Set&&t.inspectPropertyBlackList.has(a[i]))){continue}if(p&&r.noArrayProperty&&!(a[i]in t)){b+=T({depth:e.depth+1,ancestors:_,key:a[i],keyIsProperty:false},r,C)}else{try{w=Object.getOwnPropertyDescriptor(t,a[i]);if(!w.enumerable&&r.enumOnly){continue}f=!p||!w.enumerable||isNaN(a[i]);if(!r.noDescriptor&&w&&(w.get||w.set)){b+=T({depth:e.depth+1,ancestors:_,key:a[i],keyIsProperty:f,descriptor:w,forceType:"getter/setter"},r,{get:w.get,set:w.set})}else{b+=T({depth:e.depth+1,ancestors:_,key:a[i],keyIsProperty:f,descriptor:r.noDescriptor?undefined:w},r,t[a[i]])}}catch(t){b+=T({depth:e.depth+1,ancestors:_,key:a[i],keyIsProperty:f,descriptor:r.noDescriptor?undefined:w},r,t)}}if(i<a.length-1){b+=r.style.comma}}if(r.proto){b+=T({depth:e.depth+1,ancestors:_,key:"__proto__",keyIsProperty:true},r,o)}b+=d+(p?"]":"}");b+=r.style.newline}}if(e.depth===0){if(r.style.trim){b=b.trim()}if(r.style==="html"){b=x.html(b)}}return b}r.inspect=o;function S(t){if(!t.length){return true}return false}var a=["pending","fulfilled","rejected"];function E(i,n,s){if(typeof i.constructor!=="function"){return}if(i instanceof String){return i.toString()}if(i instanceof RegExp){return i.toString()}if(i instanceof Date){return i.toString()+" ["+i.getTime()+"]"}if(typeof Set==="function"&&i instanceof Set){return Array.from(i)}if(typeof Map==="function"&&i instanceof Map){return Array.from(i)}if(i instanceof Promise){if(h&&h.binding&&h.binding("util")&&h.binding("util").getPromiseDetails){let t=h.binding("util").getPromiseDetails(i);let e=a[t[0]];let r="Promise <"+e+">";if(e==="fulfilled"){r+=" "+T({depth:n.depth,ancestors:n.ancestors,noPre:true},s,t[1])}else if(e==="rejected"){if(t[1]instanceof Error){r+=" "+u({style:s.style,noErrorStack:true},t[1])}else{r+=" "+T({depth:n.depth,ancestors:n.ancestors,noPre:true},s,t[1])}}return r}}if(i._bsontype){return i.toString()}if(s.useInspect&&typeof i.inspect==="function"){return i.inspect()}return}function u(t,e){var r="",i,n,s;if(arguments.length<2){e=t;t={}}else if(!t||typeof t!=="object"){t={}}if(!(e instanceof Error)){return"inspectError(): it's not an error, using regular variable inspection: "+o(t,e)}if(!t.style){t.style=f.none}else if(typeof t.style==="string"){t.style=f[t.style]}if(e.stack&&!t.noErrorStack){i=l(t,e.stack)}n=e.type||e.constructor.name;s=e.code||e.name||e.errno||e.number;r+=t.style.errorType(n)+(s?" ["+t.style.errorType(s)+"]":"")+": ";r+=t.style.errorMessage(e.message)+"\n";if(i){r+=t.style.errorStack(i)+"\n"}if(e.from){r+=t.style.newline+t.style.errorFromMessage("From error:")+t.style.newline+u(t,e.from)}return r}r.inspectError=u;function l(u,t){if(arguments.length<2){t=u;u={}}else if(!u||typeof u!=="object"){u={}}if(!u.style){u.style=f.none}else if(typeof u.style==="string"){u.style=f[u.style]}if(!t){return}if((u.browser||h.browser)&&t.indexOf("@")!==-1){t=t.replace(/[</]*(?=@)/g,"").replace(/^\s*([^@]*)\s*@\s*([^\n]*)(?::([0-9]+):([0-9]+))?$/gm,(t,e,r,i,n)=>{return u.style.errorStack("    at ")+(e?u.style.errorStackMethod(e)+" ":"")+u.style.errorStack("(")+(r?u.style.errorStackFile(r):u.style.errorStack("unknown"))+(i?u.style.errorStack(":")+u.style.errorStackLine(i):"")+(n?u.style.errorStack(":")+u.style.errorStackColumn(n):"")+u.style.errorStack(")")})}else{t=t.replace(/^[^\n]*\n/,"");t=t.replace(/^\s*(at)\s+(?:(?:(async|new)\s+)?([^\s:()[\]\n]+(?:\([^)]+\))?)\s)?(?:\[as ([^\s:()[\]\n]+)\]\s)?(?:\(?([^:()[\]\n]+):([0-9]+):([0-9]+)\)?)?$/gm,(t,e,r,i,n,s,o,a)=>{return u.style.errorStack("    at ")+(r?u.style.errorStackKeyword(r)+" ":"")+(i?u.style.errorStackMethod(i)+" ":"")+(n?u.style.errorStack("[as ")+u.style.errorStackMethodAs(n)+u.style.errorStack("] "):"")+u.style.errorStack("(")+(s?u.style.errorStackFile(s):u.style.errorStack("unknown"))+(o?u.style.errorStack(":")+u.style.errorStackLine(o):"")+(a?u.style.errorStack(":")+u.style.errorStackColumn(a):"")+u.style.errorStack(")")})}return t}r.inspectStack=l;var f={};var t=t=>t;f.none={trim:false,tab:"    ",newline:"\n",comma:"",limit:t,type:t=>"<"+t+">",constant:t,funcName:t,constructorName:t=>"<"+t+">",length:t,key:t,index:t=>"["+t+"] ",number:t,inspect:t,string:t,errorType:t,errorMessage:t,errorStack:t,errorStackKeyword:t,errorStackMethod:t,errorStackMethodAs:t,errorStackFile:t,errorStackLine:t,errorStackColumn:t,errorFromMessage:t,truncate:(t,e)=>t.slice(0,e-1)+"…"};f.inline=Object.assign({},f.none,{trim:true,tab:"",newline:" ",comma:", ",length:()=>"",index:()=>""});f.color=Object.assign({},f.none,{limit:t=>n.bold+n.brightRed+t+n.reset,type:t=>n.italic+n.brightBlack+t+n.reset,constant:t=>n.cyan+t+n.reset,funcName:t=>n.italic+n.magenta+t+n.reset,constructorName:t=>n.magenta+t+n.reset,length:t=>n.italic+n.brightBlack+t+n.reset,key:t=>n.green+t+n.reset,index:t=>n.blue+"["+t+"]"+n.reset+" ",number:t=>n.cyan+t+n.reset,inspect:t=>n.cyan+t+n.reset,string:t=>n.blue+t+n.reset,errorType:t=>n.red+n.bold+t+n.reset,errorMessage:t=>n.red+n.italic+t+n.reset,errorStack:t=>n.brightBlack+t+n.reset,errorStackKeyword:t=>n.italic+n.bold+t+n.reset,errorStackMethod:t=>n.brightYellow+t+n.reset,errorStackMethodAs:t=>n.yellow+t+n.reset,errorStackFile:t=>n.brightCyan+t+n.reset,errorStackLine:t=>n.blue+t+n.reset,errorStackColumn:t=>n.magenta+t+n.reset,errorFromMessage:t=>n.yellow+n.underline+t+n.reset,truncate:(t,e)=>{var r=n.gray+"…"+n.reset;t=t.slice(0,e-r.length);var i=t.lastIndexOf("");if(i>=t.length-6){t=t.slice(0,i)}return t+r}});f.html=Object.assign({},f.none,{tab:"&nbsp;&nbsp;&nbsp;&nbsp;",newline:"<br />",limit:t=>'<span style="color:red">'+t+"</span>",type:t=>'<i style="color:gray">'+t+"</i>",constant:t=>'<span style="color:cyan">'+t+"</span>",funcName:t=>'<i style="color:magenta">'+t+"</i>",constructorName:t=>'<span style="color:magenta">'+t+"</span>",length:t=>'<i style="color:gray">'+t+"</i>",key:t=>'<span style="color:green">'+t+"</span>",index:t=>'<span style="color:blue">['+t+"]</span> ",number:t=>'<span style="color:cyan">'+t+"</span>",inspect:t=>'<span style="color:cyan">'+t+"</span>",string:t=>'<span style="color:blue">'+t+"</span>",errorType:t=>'<span style="color:red">'+t+"</span>",errorMessage:t=>'<span style="color:red">'+t+"</span>",errorStack:t=>'<span style="color:gray">'+t+"</span>",errorStackKeyword:t=>"<i>"+t+"</i>",errorStackMethod:t=>'<span style="color:yellow">'+t+"</span>",errorStackMethodAs:t=>'<span style="color:yellow">'+t+"</span>",errorStackFile:t=>'<span style="color:cyan">'+t+"</span>",errorStackLine:t=>'<span style="color:blue">'+t+"</span>",errorStackColumn:t=>'<span style="color:gray">'+t+"</span>",errorFromMessage:t=>'<span style="color:yellow">'+t+"</span>"})}).call(this)}).call(this,{isBuffer:e("../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js")},e("_process"))},{"../../../../../../../../opt/node-v14.15.4/lib/node_modules/browserify/node_modules/is-buffer/index.js":162,"./ansi.js":111,"./escape.js":113,_process:179}],117:[function(t,e,r){e.exports={"߀":"0","́":""," ":" ","Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ɓ":"B","ｃ":"C","Ⓒ":"C","Ｃ":"C","Ꜿ":"C","Ḉ":"C","Ç":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ɗ":"D","Ɖ":"D","ᴅ":"D","Ꝺ":"D","Ð":"Dh","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","ɛ":"E","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","ᴇ":"E","ꝼ":"F","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","ɢ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","ȷ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","ϻ":"M","Ꞥ":"N","Ƞ":"N","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ɲ":"N","Ꞑ":"N","ᴎ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Þ":"Th","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ɑ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","Ƃ":"b","ⓒ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c",C:"c","Ć":"c","Ĉ":"c","Ċ":"c","Č":"c","Ƈ":"c","Ȼ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","Ƌ":"d","Ꮷ":"d","ԁ":"d","Ɦ":"d","ð":"dh","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ﬀ":"ff","ﬁ":"fi","ﬂ":"fl","ﬃ":"ffi","ﬄ":"ffl","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ꝿ":"g","ᵹ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ɭ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ԉ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ɔ":"o","ᴑ":"o","œ":"oe","ƣ":"oi","ꝏ":"oo","ȣ":"ou","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ρ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ʂ":"s","ß":"ss","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","þ":"th","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z"}},{}],118:[function(t,e,r){"use strict";var i=t("./latinize-map.json");e.exports=function(t){return t.replace(/[^\u0000-\u007e]/g,t=>{return i[t]||t})}},{"./latinize-map.json":117}],119:[function(t,e,r){"use strict";r.resize=function(t,e){if(t.length===e){return t}else if(t.length>e){return t.slice(0,e)}return t+" ".repeat(e-t.length)};r.occurrenceCount=function(t,e,r=false){if(!t||!e){return 0}var i=0,n=0,s=r?1:e.length;while((n=t.indexOf(e,n))!==-1){i++;n+=s}return i}},{}],120:[function(t,e,r){"use strict";const _=1;const x=2;const C=3;const k=4;const T=5;function S(t,e){if(E(e)){return x}if(e<=31||e===127){return _}if(A(e)){return k}if(t.toUpperCase()!==t.toLowerCase()){return C}return T}function E(t){if(t===32||t===9||t===160||t===45||t===95){return true}return false}function A(t){if(t>=48&&t<=57){return true}return false}function i(t,e){t=""+t;e=""+e;var r,i,n,s,o,a,u,l=t.trim(),f=l.length,h,c,d,p,g,y,b,m=e.trim(),v=m.length,w=0;for(r=h=0;r<f&&h<v;r++,h++){n=l[r];d=m[h];s=l.charCodeAt(r);p=m.charCodeAt(h);o=S(n,s);g=S(d,p);if(o!==g){return o-g}switch(o){case x:while(E(l.charCodeAt(r+1))){r++}while(E(m.charCodeAt(h+1))){h++}break;case _:case T:if(s!==p){return s-p}break;case C:a=n.toLowerCase();y=d.toLowerCase();if(a!==y){return a>y?1:-1}if(!w&&n!==d){w=n!==a?-1:1}break;case k:i=r+1;while(A(l.charCodeAt(i))){i++}u=parseFloat(l.slice(r,i));c=h+1;while(A(m.charCodeAt(c))){c++}b=parseFloat(m.slice(h,c));if(u!==b){return u-b}if(!w&&i-r!==c-h){w=i-r-(c-h)}r=i-1;h=c-1;break}}if(w){return w}return f-r-(v-h)||f-v||t.length-e.length}e.exports=i},{}],121:[function(t,e,r){"use strict";var i={};e.exports=i;i.repeat=function(t){if(this===null){throw new TypeError("can't convert "+this+" to object")}var e=""+this;t=+t;if(t!==t){t=0}if(t<0){throw new RangeError("repeat count must be non-negative")}if(t===Infinity){throw new RangeError("repeat count must be less than infinity")}t=Math.floor(t);if(e.length===0||t===0){return""}if(e.length*t>=1<<28){throw new RangeError("repeat count must not overflow maximum string size")}var r="";for(;;){if((t&1)===1){r+=e}t>>>=1;if(t===0){break}e+=e}return r}},{}],122:[function(t,e,r){"use strict";var n=t("./escape.js");r.regexp={};r.regexp.array2alternatives=function t(e){var r,i=e.slice();i.sort((t,e)=>{return e.length-t.length});for(r=0;r<i.length;r++){i[r]=n.regExpPattern(i[r])}return i.join("|")}},{"./escape.js":113}],123:[function(t,e,r){"use strict";const i={};e.exports=i;var n;var s=t("./polyfill.js");for(n in s){i[n]=function(t,...e){return s[n].call(t,...e)}}Object.assign(i,{escape:t("./escape.js")},{ansi:t("./ansi.js")},{unicode:t("./unicode.js")});Object.assign(i,t("./format.js"),t("./misc.js"),t("./inspect.js"),t("./regexp.js"),t("./camel.js"),{latinize:t("./latinize.js"),toTitleCase:t("./toTitleCase.js"),wordwrap:t("./wordwrap.js"),naturalSort:t("./naturalSort.js"),fuzzy:t("./fuzzy.js"),StringNumber:t("./StringNumber.js")});i.installPolyfills=function t(){var e;for(e in s){if(!String.prototype[e]){String.prototype[e]=s[e]}}}},{"./StringNumber.js":110,"./ansi.js":111,"./camel.js":112,"./escape.js":113,"./format.js":114,"./fuzzy.js":115,"./inspect.js":116,"./latinize.js":118,"./misc.js":119,"./naturalSort.js":120,"./polyfill.js":121,"./regexp.js":122,"./toTitleCase.js":124,"./unicode.js":125,"./wordwrap.js":126}],124:[function(t,e,r){"use strict";e.exports=function t(e,r){if(!e||typeof e!=="string"){return""}r=r||{};return e.replace(/[^\s_-]+/g,t=>{if(r.zealous){if(r.preserveAllCaps&&t===t.toUpperCase()){return t}return t[0].toUpperCase()+t.slice(1).toLowerCase()}return t[0].toUpperCase()+t.slice(1)})}},{}],125:[function(t,e,r){"use strict";const h={};e.exports=h;h.encode=t=>String.fromCodePoint(...t);h.decode=t=>{var e,r,i=0,n=[],s=t.length;while(i<s){e=t.charCodeAt(i++);if(e>=55296&&e<=56319&&i<s){r=t.charCodeAt(i++);if((r&64512)===56320){n.push(((e&1023)<<10)+(r&1023)+65536)}else{n.push(e);i--}}else{n.push(e)}}return n};h.firstCodePoint=t=>{var e,r=t.charCodeAt(0);if(r>=55296&&r<=56319&&t.length>=2){e=t.charCodeAt(1);if((e&64512)===56320){return((r&1023)<<10)+(e&1023)+65536}}return r};h.firstChar=t=>{var e,r=t.charCodeAt(0);if(r>=55296&&r<=56319&&t.length>=2){e=t.charCodeAt(1);if((e&64512)===56320){return t.slice(0,2)}}return t[0]};h.toArray=t=>{var e,r,i=0,n=[],s=t.length;while(i<s){e=t.charCodeAt(i++);if(e>=55296&&e<=56319&&i<s){r=t.charCodeAt(i++);if((r&64512)===56320){n.push(t.slice(i-2,i))}else{n.push(t[i-2]);i--}}else{n.push(t[i-1])}}return n};h.toCells=(t,e,r=4,i=0,...n)=>{var s,o,a=0,u=[],l,f=e.length;while(a<f){s=e.charCodeAt(a++);if(s===10){i=0}else if(s===9){l=r-i%r-1;u.push(new t("\t",...n));i+=1+l;while(l--){u.push(new t(null,...n))}}else if(s>=55296&&s<=56319&&a<f){o=e.charCodeAt(a++);if((o&64512)===56320){s=((s&1023)<<10)+(o&1023)+65536;u.push(new t(e.slice(a-2,a),...n));i++;if(h.codePointWidth(s)===2){i++;u.push(new t(null,...n))}}else{a--}}else{u.push(new t(e[a-1],...n));i++;if(h.codePointWidth(s)===2){u.push(new t(null,...n));i++}}}return u};h.fromCells=t=>{return t.map(t=>t.filler?"":t.char).join("")};h.length=t=>{var e,r,i=0,n=0,s=t.length;while(i<s){e=t.charCodeAt(i++);if(e>=55296&&e<=56319&&i<s){r=t.charCodeAt(i++);if((r&64512)!==56320){i--}}n++}return n};h.width=t=>{var e=0;h.decode(t).forEach(t=>e+=h.codePointWidth(t));return e};h.arrayWidth=(t,e)=>{var r,i=0;if(e===undefined){e=t.length}for(r=0;r<e;r++){i+=h.isFullWidth(t[r])?2:1}return i};var u=0;h.getLastTruncateWidth=()=>u;h.widthLimit=h.truncateWidth=(t,e)=>{var r,i,n,s=0,o=0,a=t.length;u=0;while(s<a){r=t.charCodeAt(s++);if(r>=55296&&r<=56319&&s<a){i=t.charCodeAt(s++);if((i&64512)===56320){r=((r&1023)<<10)+(i&1023)+65536}else{s--}}n=h.codePointWidth(r);if(u+n>e){return t.slice(0,o)}u+=n;o=s}return t};h.surrogatePair=t=>{var e=t.charCodeAt(0);if(e<55296||e>=57344){return 0}else if(e<56320){return 1}return-1};h.isFullWidth=t=>{if(t.length<=1){return h.isFullWidthCodePoint(t.codePointAt(0))}return h.isFullWidthCodePoint(h.firstCodePoint(t))};h.charWidth=t=>{if(t.length<=1){return h.codePointWidth(t.codePointAt(0))}return h.codePointWidth(h.firstCodePoint(t))};h.codePointWidth=t=>{if(t>=4352&&(t<=4447||9001===t||9002===t||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141)){return 2}return 1};h.isFullWidthCodePoint=t=>h.codePointWidth(t)===2;h.toFullWidth=t=>{return String.fromCodePoint(...h.decode(t).map(t=>t>=33&&t<=126?65280+t-32:t))}},{}],126:[function(t,e,r){"use strict";const w=t("./unicode.js");const _={"!":true,"?":true,":":true,";":true};e.exports=function t(e,r){var i=0,n,s,o,a,u,l,f,h,c,d,p=true,g=w.toArray(e),y=false,b,m=[];if(typeof r!=="object"){r={width:r}}if(!r.width||typeof r.width!=="number"||r.width<=0){r.width=80}o=r.offset?r.width-r.offset:r.width;if(typeof r.glue!=="string"){r.glue="\n"}if(r.regroupFn){g=r.regroupFn(g);d=r.charWidthFn||w.width}else{d=r.charWidthFn||w.charWidth}l=g.length;var v=()=>{if(!p||y){while(g[i]===" "){i++}if(y&&g[i]==="\n"){p=true;i++}}if(i>=l){return null}p=false;y=false;c=false;n=f=i;u=h=0;for(;;){if(n>=l){return g.slice(i,n).join("")}if(g[n]==="\n"){p=true;a=g.slice(i,n++).join("");if(r.fill){a+=" ".repeat(o-u)}return a}if(r.skipFn){s=r.skipFn(g,n);if(s!==n){n=s;continue}}if(g[n]===" "&&!c&&!_[g[n+1]]){f=n;h=u}else{c=false}u+=d(g[n]);if(u>o){y=true;if(f!==i){n=f}else if(o<r.width){n=i;return""}a=g.slice(i,n).join("");if(r.fill){a+=" ".repeat(o-h)}return a}n++}};while(i<l&&(b=v())!==null){m.push(b);i=n;o=r.width}if(p){m.push("")}if(!r.noTrim&&!r.fill){m=m.map((t,e)=>e===m.length-1?t:t.trimRight())}if(!r.noJoin){m=m.join(r.glue)}if(r.updateOffset){r.offset=u}return m}},{"./unicode.js":125}],127:[function(t,e,r){"use strict";function c(t,e){var r=Object.getPrototypeOf(t);if(c.opaque.has(r)){return c.opaque.get(r)(t)}var i,n,s,o,a,u,l=[{source:t,target:Array.isArray(t)?[]:Object.create(r)}],f=l[0].target,h=new Map;h.set(t,f);while(o=l.shift()){s=Object.getOwnPropertyNames(o.source);for(i=0;i<s.length;i++){n=Object.getOwnPropertyDescriptor(o.source,s[i]);if(!n.value||typeof n.value!=="object"){Object.defineProperty(o.target,s[i],n);continue}a=n.value;if(e){if(h.has(a)){n.value=h.get(a);Object.defineProperty(o.target,s[i],n);continue}}u=Object.getPrototypeOf(n.value);if(c.opaque.has(u)){n.value=c.opaque.get(u)(n.value);Object.defineProperty(o.target,s[i],n);continue}n.value=Array.isArray(a)?[]:Object.create(u);if(e){h.set(a,n.value)}Object.defineProperty(o.target,s[i],n);l.push({source:a,target:n.value})}}return f}e.exports=c;c.opaque=new Map;c.opaque.set(Date.prototype,t=>new Date(t))},{}],128:[function(t,e,r){"use strict";function p(t,e,r){var i,n,s,o,a,u,l,f,h,c,d;u=typeof t;l=typeof e;if(!t||u!=="object"&&u!=="function"||!e||l!=="object"&&l!=="function"){throw new Error("[tree] diff() needs objects as argument #0 and #1")}if(!r||typeof r!=="object"){r={}}f=r.depth||0;if(!f){r.diffObject={};if(!r.path){r.path=""}if(!r.pathSeparator){r.pathSeparator="."}}h=r.diffObject;if(Array.isArray(t)){d=true;c=t.length}else{d=false;o=Object.keys(t);c=o.length}for(i=0;i<c;i++){n=d?i:o[i];s=r.path+r.pathSeparator+n;if(!Object.prototype.hasOwnProperty.call(e,n)){h[s]={path:s,message:"does not exist in right-hand side"};continue}u=typeof t[n];l=typeof e[n];if(u!==l){h[s]={path:s,message:"different typeof: "+u+" - "+l};continue}if(u==="object"||u==="function"){if(!t[n]){if(e[n]){h[s]={path:s,message:"different type: null - Object"}}continue}if(!e[n]){h[s]={path:s,message:"different type: Object - null"};continue}if(Array.isArray(t[n])&&!Array.isArray(e[n])){h[s]={path:s,message:"different type: Array - Object"};continue}if(!Array.isArray(t[n])&&Array.isArray(e[n])){h[s]={path:s,message:"different type: Object - Array"};continue}p(t[n],e[n],{path:s,pathSeparator:r.pathSeparator,depth:f+1,diffObject:h});continue}if(t[n]!==e[n]){h[s]={path:s,message:"different value: "+t[n]+" - "+e[n]};continue}}if(Array.isArray(e)){d=true;c=e.length}else{d=false;a=Object.keys(e);c=a.length}for(i=0;i<c;i++){n=d?i:a[i];s=r.path+r.pathSeparator+n;if(!Object.prototype.hasOwnProperty.call(t,n)){h[s]={path:s,message:"does not exist in left-hand side"};continue}}return Object.keys(h).length?h:null}r.diff=p},{}],129:[function(t,e,r){"use strict";const i={};e.exports=i;const n=[];const a="This would cause prototype pollution";function o(t){if(Array.isArray(t)){return t}if(!t){return n}if(typeof t==="string"){return t[t.length-1]==="."?t.slice(0,-1).split("."):t.split(".")}throw new TypeError("[tree.dotPath]: the path argument should be a string or an array")}function s(t,e,r=0){var i,n,s,o=t;for(i=0,n=e.length+r;i<n;i++){s=e[i];if(typeof s==="object"||s==="__proto__"||typeof o==="function"){throw new Error(a)}if(!o||typeof o!=="object"){return undefined}o=o[s]}return o}function u(t,e){var r,i,n,s=t;for(r=0,i=e.length-1;r<i;r++){n=e[r];if(typeof n==="object"||n==="__proto__"||typeof s[n]==="function"){throw new Error(a)}if(!s[n]||typeof s[n]!=="object"){s[n]={}}s=s[n]}return s}i.get=(t,e)=>s(t,o(e));i.set=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);s[n]=r;return r};i.define=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!(n in s)){s[n]=r}return r};i.inc=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(typeof s[n]==="number"){s[n]++}else if(!s[n]||typeof s[n]!=="object"){s[n]=1}return r};i.dec=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(typeof s[n]==="number"){s[n]--}else if(!s[n]||typeof s[n]!=="object"){s[n]=-1}return r};i.concat=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=r}else if(Array.isArray(s[n])&&Array.isArray(r)){s[n]=s[n].concat(r)}return r};i.insert=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=r}else if(Array.isArray(s[n])&&Array.isArray(r)){s[n]=r.concat(s[n])}return r};i.delete=(t,e)=>{var r=o(e),i=r[r.length-1];if(typeof i==="object"||i==="__proto__"){throw new Error(a)}var n=s(t,r,-1);if(!n||typeof n!=="object"){return false}return delete n[i]};i.autoPush=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(s[n]===undefined){s[n]=r}else if(Array.isArray(s[n])){s[n].push(r)}else{s[n]=[s[n],r]}return s[n]};i.append=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=[r]}else if(Array.isArray(s[n])){s[n].push(r)}return s[n]};i.prepend=(t,e,r)=>{if(!t||typeof t!=="object"){return undefined}var i=o(e),n=i[i.length-1];if(typeof n==="object"||n==="__proto__"){throw new Error(a)}var s=u(t,i);if(!s[n]){s[n]=[r]}else if(Array.isArray(s[n])){s[n].unshift(r)}return s[n]}},{}],130:[function(t,e,r){"use strict";function i(t,e,...r){var i,n,s=false,o=r.length;if(!o){return e}if(!t||typeof t!=="object"){t={}}var a={depth:0,prefix:""};if(t.deep){if(Array.isArray(t.deep)){t.deep=new Set(t.deep)}else if(!(t.deep instanceof Set)){t.deep=true}}if(t.immutables){if(Array.isArray(t.immutables)){t.immutables=new Set(t.immutables)}else if(!(t.immutables instanceof Set)){delete t.immutables}}if(!t.maxDepth&&t.deep&&!t.circular){t.maxDepth=100}if(t.deepFunc){t.deep=true}if(t.flat){t.deep=true;t.proto=false;t.inherit=false;t.unflat=false;if(typeof t.flat!=="string"){t.flat="."}}if(t.unflat){t.deep=false;t.proto=false;t.inherit=false;t.flat=false;if(typeof t.unflat!=="string"){t.unflat="."}}if(t.inherit){t.own=true;t.proto=false}else if(t.proto){t.own=true}if(!e||typeof e!=="object"&&typeof e!=="function"){s=true}if(!t.skipRoot&&(t.inherit||t.proto)){for(i=o-1;i>=0;i--){n=r[i];if(n&&(typeof n==="object"||typeof n==="function")){if(t.inherit){if(s){e=Object.create(n)}else{Object.setPrototypeOf(e,n)}}else if(t.proto){if(s){e=Object.create(Object.getPrototypeOf(n))}else{Object.setPrototypeOf(e,Object.getPrototypeOf(n))}}break}}}else if(s){e={}}a.references={sources:[],targets:[]};for(i=0;i<o;i++){n=r[i];if(!n||typeof n!=="object"&&typeof n!=="function"){continue}v(a,t,e,n,t.mask<=i+1)}return e}e.exports=i;function v(t,e,r,i,n){var s,o,a,u,l,f,h,c,d,p,g,y,b,m=-1;if(e.maxDepth&&t.depth>e.maxDepth){throw new Error("[tree] extend(): max depth reached("+e.maxDepth+")")}if(e.circular){t.references.sources.push(i);t.references.targets.push(r)}if(e.own){if(e.nonEnum){u=Object.getOwnPropertyNames(i)}else{u=Object.keys(i)}}else{u=i}for(l in u){if(e.own){l=u[l]}if(l==="__proto__"){continue}if(e.descriptor){d=Object.getOwnPropertyDescriptor(i,l);f=d.value}else{f=i[l]}g=r;p=t.prefix+l;if(e.nofunc&&typeof f==="function"){continue}if(e.unflat&&t.depth===0){a=l.split(e.unflat);o=a.length-1;if(o){for(s=0;s<o;s++){if(!g[a[s]]||typeof g[a[s]]!=="object"&&typeof g[a[s]]!=="function"){g[a[s]]={}}g=g[a[s]]}p=t.prefix+a[o]}}y=g[p];b=y&&(typeof y==="object"||typeof y==="function");h=f&&(typeof f==="object"||typeof f==="function");if(e.deep&&f&&(typeof f==="object"||e.deepFunc&&typeof f==="function")&&(!e.descriptor||!d.get)&&((c=Object.getPrototypeOf(f))||true)&&(!(e.deep instanceof Set)||e.deep.has(c))&&(!e.immutables||!e.immutables.has(c))&&(!e.preserve||b)&&(!n||b)){if(e.circular){m=t.references.sources.indexOf(f)}if(e.flat){if(m>=0){continue}v({depth:t.depth+1,prefix:t.prefix+l+e.flat,references:t.references},e,g,f,n)}else{if(m>=0){y=t.references.targets[m];if(e.descriptor){Object.defineProperty(g,p,{value:y,enumerable:d.enumerable,writable:d.writable,configurable:d.configurable})}else{g[p]=y}continue}if(!b||!Object.prototype.hasOwnProperty.call(g,p)){if(Array.isArray(f)){y=[]}else if(e.proto){y=Object.create(c)}else if(e.inherit){y=Object.create(f)}else{y={}}if(e.descriptor){Object.defineProperty(g,p,{value:y,enumerable:d.enumerable,writable:d.writable,configurable:d.configurable})}else{g[p]=y}}else if(e.proto&&Object.getPrototypeOf(y)!==c){Object.setPrototypeOf(y,c)}else if(e.inherit&&Object.getPrototypeOf(y)!==f){Object.setPrototypeOf(y,f)}if(e.circular){t.references.sources.push(f);t.references.targets.push(y)}v({depth:t.depth+1,prefix:"",references:t.references},e,y,f,n)}}else if(n&&(y===undefined||b||h)){continue}else if(e.preserve&&y!==undefined){continue}else if(!e.inherit){if(e.descriptor){Object.defineProperty(g,p,d)}else{g[p]=y=f}}if(e.move){delete i[l]}}}},{}],131:[function(t,e,r){"use strict";r.defineLazyProperty=function t(e,r,i){Object.defineProperty(e,r,{configurable:true,enumerable:true,get:function(){var t=i();Object.defineProperty(e,r,{configurable:true,enumerable:true,writable:false,value:t});return t}})}},{}],132:[function(t,e,r){"use strict";const g=t("./tree.js");const i=t("util");const y={};e.exports=y;y.Mask=function t(){throw new Error("Cannot create a tree.Mask() directly")};const n={clone:false,path:"<object>",pathSeparator:"."};y.createMask=function t(e,r){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .createMask() : Argument #1 should be an object")}if(r!==null&&typeof r==="object"){r=g.extend(null,{},n,r)}else{r=n}var i=Object.create(y.Mask.prototype,{__options__:{value:r,writable:true}});g.extend(null,i,e);return i};y.Mask.prototype.applyTo=function t(e,r,i){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .applyTo() : Argument #1 should be an object")}if(i){r=g.extend(null,{mask:this,options:this.__options__,path:this.__options__.path},r)}else if(r===undefined){r={mask:this,options:this.__options__,path:this.__options__.path}}var n,s,o,a,u,l,f=Object.keys(r.mask),h,c,d,p;if(Array.isArray(e)){o=[]}else{o={}}for(a=0;a<f.length;a++){u=f[a];l=r.mask[u];if(u==="*"){p=Object.keys(e);for(h=0;h<p.length;h++){c=p[h];d=e[c];s=r.path+r.options.pathSeparator+c;if(l!==null&&typeof l==="object"){if(d!==null&&typeof d==="object"){if(d instanceof y.Mask){o[c]=d.applyTo(d,{path:s},true)}else{o[c]=this.applyTo(d,g.extend(null,{},r,{mask:l,path:s}))}}else if(typeof r.options.leaf==="function"){o[c]=this.applyTo({},g.extend(null,{},r,{mask:l,path:s}))}}else if(l!==null&&typeof r.options.leaf==="function"){n=r.options.leaf(e,c,l,s);if(!(n instanceof Error)){o[c]=n}}else if(r.options.clone&&(d!==null&&typeof d==="object")){o[c]=g.extend({deep:true},{},d)}else{o[c]=d}}continue}s=r.path+r.options.pathSeparator+u;if(l!==null&&typeof l==="object"){if(Object.prototype.hasOwnProperty.call(e,u)&&e[u]!==null&&typeof e[u]==="object"){if(e.key instanceof y.Mask){o[u]=e.key.applyTo(e[u],{path:s},true)}else{o[u]=this.applyTo(e[u],g.extend(null,{},r,{mask:l,path:s}))}}else if(r.options.leaf){o[u]=this.applyTo({},g.extend(null,{},r,{mask:l,path:s}))}}else if(Object.prototype.hasOwnProperty.call(e,u)){if(l!==undefined&&typeof r.options.leaf==="function"){n=r.options.leaf(e,u,l,s);if(!(n instanceof Error)){o[u]=n}}else if(r.options.clone&&(e[u]!==null&&typeof e[u]==="object")){o[u]=g.extend({deep:true},{},e[u])}else{o[u]=e[u]}}else if(l!==undefined&&typeof r.options.leaf==="function"){n=r.options.leaf(e,u,l,s);if(!(n instanceof Error)){o[u]=n}}}return o};y.InverseMask=function t(){throw new Error("Cannot create a tree.InverseMask() directly")};i.inherits(y.InverseMask,y.Mask);y.createInverseMask=function t(e,r){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .createInverseMask() : Argument #1 should be an object")}if(r!==null&&typeof r==="object"){r=g.extend(null,{},n,r)}else{r=n}var i=Object.create(y.InverseMask.prototype,{__options__:{value:r,writable:true}});g.extend(null,i,e);return i};y.InverseMask.prototype.applyTo=function t(e,r,i){if(e===null||typeof e!=="object"){throw new TypeError("[tree] .applyTo() : Argument #1 should be an object")}if(i){r=g.extend(null,{mask:this,options:this.__options__,path:this.__options__.path},r)}else if(r===undefined){r={mask:this,options:this.__options__,path:this.__options__.path}}var n,s,o,a,u,l=Object.keys(r.mask),f,h,c,d;if(Array.isArray(e)){s=g.extend({deep:true},[],e)}else{s=g.extend({deep:true},{},e)}for(o=0;o<l.length;o++){a=l[o];u=r.mask[a];if(a==="*"){d=Object.keys(e);for(f=0;f<d.length;f++){h=d[f];c=e[h];n=r.path+r.options.pathSeparator+h;if(u!==null&&typeof u==="object"){if(c!==null&&typeof c==="object"){if(c instanceof y.Mask){s[h]=c.applyTo(c,{path:n},true)}else{s[h]=this.applyTo(c,g.extend(null,{},r,{mask:u,path:n}))}}}else{delete s[h]}}continue}n=r.path+r.options.pathSeparator+a;if(u!==null&&typeof u==="object"){if(Object.prototype.hasOwnProperty.call(e,a)&&e[a]!==null&&typeof e[a]==="object"){if(e.key instanceof y.Mask){s[a]=e.key.applyTo(e[a],{path:n},true)}else{s[a]=this.applyTo(e[a],g.extend(null,{},r,{mask:u,path:n}))}}}else if(Object.prototype.hasOwnProperty.call(e,a)){delete s[a]}}return s}},{"./tree.js":134,util:202}],133:[function(t,e,r){"use strict";const i={};e.exports=i;const d="This would cause prototype pollution";i.op=function(t,e,r,i){var n,s,o,a,u,l=false,f=false,h,c=true;if(!e||typeof e!=="object"){return}if(typeof r==="string"){if(r){s=r.match(/([.#[\]]|[^.#[\]]+)/g)}else{s=[""]}if(s[0]==="."){s.unshift("")}if(s[s.length-1]==="."){s.push("")}}else if(Array.isArray(r)){s=r;f=true}else{throw new TypeError("[tree.path] ."+t+"(): the path argument should be a string or an array")}switch(t){case"get":case"delete":h=false;break;case"set":case"define":case"inc":case"dec":case"append":case"prepend":case"concat":case"insert":case"autoPush":h=true;break;default:throw new TypeError("[tree.path] .op(): wrong type of operation '"+t+"'")}a=e;o=s.length-1;for(n=0;n<=o;n++){if(f){if(u===undefined){u=s[n];if(typeof u==="object"||u==="__proto__"){throw new Error(d)}continue}if(typeof a[u]==="function"){throw new Error(d)}if(!a[u]||typeof a[u]!=="object"){if(!h){return undefined}a[u]={}}a=a[u];u=s[n];if(typeof u==="object"||u==="__proto__"){throw new Error(d)}continue}else if(s[n]==="."){l=false;if(u===undefined){if(!c){c=true;continue}u=""}if(typeof a[u]==="function"){throw new Error(d)}if(!a[u]||typeof a[u]!=="object"){if(!h){return undefined}a[u]={}}a=a[u];c=true;continue}else if(s[n]==="#"||s[n]==="["){l=true;c=false;if(u===undefined){if(!Array.isArray(a)){return undefined}continue}if(typeof a[u]==="function"){throw new Error(d)}if(!a[u]||!Array.isArray(a[u])){if(!h){return undefined}a[u]=[]}a=a[u];continue}else if(s[n]==="]"){c=false;continue}c=false;if(!l){u=s[n];if(typeof u==="object"||u==="__proto__"){throw new Error(d)}continue}switch(s[n]){case"length":u="length";break;case"first":u=0;break;case"last":u=a.length-1;if(u<0){u=0}break;case"next":if(!h){return undefined}u=a.length;break;case"insert":if(!h){return undefined}a.unshift(undefined);u=0;break;default:u=parseInt(s[n],10)}}switch(t){case"get":return a[u];case"delete":if(l&&typeof u==="number"){a.splice(u,1)}else{delete a[u]}return;case"set":a[u]=i;return a[u];case"define":if(!(u in a)){a[u]=i}return a[u];case"inc":if(typeof a[u]==="number"){a[u]++}else if(!a[u]||typeof a[u]!=="object"){a[u]=1}return a[u];case"dec":if(typeof a[u]==="number"){a[u]--}else if(!a[u]||typeof a[u]!=="object"){a[u]=-1}return a[u];case"append":if(!a[u]){a[u]=[i]}else if(Array.isArray(a[u])){a[u].push(i)}return a[u];case"prepend":if(!a[u]){a[u]=[i]}else if(Array.isArray(a[u])){a[u].unshift(i)}return a[u];case"concat":if(!a[u]){a[u]=i}else if(Array.isArray(a[u])&&Array.isArray(i)){a[u]=a[u].concat(i)}return a[u];case"insert":if(!a[u]){a[u]=i}else if(Array.isArray(a[u])&&Array.isArray(i)){a[u]=i.concat(a[u])}return a[u];case"autoPush":if(a[u]===undefined){a[u]=i}else if(Array.isArray(a[u])){a[u].push(i)}else{a[u]=[a[u],i]}return a[u]}};i.get=i.op.bind(undefined,"get");i.delete=i.op.bind(undefined,"delete");i.set=i.op.bind(undefined,"set");i.define=i.op.bind(undefined,"define");i.inc=i.op.bind(undefined,"inc");i.dec=i.op.bind(undefined,"dec");i.append=i.op.bind(undefined,"append");i.prepend=i.op.bind(undefined,"prepend");i.concat=i.op.bind(undefined,"concat");i.insert=i.op.bind(undefined,"insert");i.autoPush=i.op.bind(undefined,"autoPush");i.prototype={get:function(t){return i.get(this,t)},delete:function(t){return i.delete(this,t)},set:function(t,e){return i.set(this,t,e)},define:function(t,e){return i.define(this,t,e)},inc:function(t,e){return i.inc(this,t,e)},dec:function(t,e){return i.dec(this,t,e)},append:function(t,e){return i.append(this,t,e)},prepend:function(t,e){return i.prepend(this,t,e)},concat:function(t,e){return i.concat(this,t,e)},insert:function(t,e){return i.insert(this,t,e)},autoPush:function(t,e){return i.autoPush(this,t,e)}};i.upgrade=function(t){Object.defineProperties(t,{get:{value:i.op.bind(undefined,"get",t)},delete:{value:i.op.bind(undefined,"delete",t)},set:{value:i.op.bind(undefined,"set",t)},define:{value:i.op.bind(undefined,"define",t)},inc:{value:i.op.bind(undefined,"inc",t)},dec:{value:i.op.bind(undefined,"dec",t)},append:{value:i.op.bind(undefined,"append",t)},prepend:{value:i.op.bind(undefined,"prepend",t)},concat:{value:i.op.bind(undefined,"concat",t)},insert:{value:i.op.bind(undefined,"insert",t)},autoPush:{value:i.op.bind(undefined,"autoPush",t)}})}},{}],134:[function(t,e,r){"use strict";const i={};e.exports=i;Object.assign(i,{extend:t("./extend.js"),clone:t("./clone.js"),path:t("./path.js"),dotPath:t("./dotPath.js")},t("./lazy.js"),t("./diff.js"),t("./mask.js"))},{"./clone.js":127,"./diff.js":128,"./dotPath.js":129,"./extend.js":130,"./lazy.js":131,"./mask.js":132,"./path.js":133}],135:[function(t,e,r){"use strict";function i(t,e){var r=1,i=t.length,n=t[0],s=t[0];for(var o=1;o<i;++o){s=n;n=t[o];if(e(n,s)){if(o===r){r++;continue}t[r++]=n}}t.length=r;return t}function n(t){var e=1,r=t.length,i=t[0],n=t[0];for(var s=1;s<r;++s,n=i){n=i;i=t[s];if(i!==n){if(s===e){e++;continue}t[e++]=i}}t.length=e;return t}function s(t,e,r){if(t.length===0){return t}if(e){if(!r){t.sort(e)}return i(t,e)}if(!r){t.sort()}return n(t)}e.exports=s},{}],136:[function(t,e,r){},{}],137:[function(t,e,r){e.exports=function(t,e,r){if(t.filter)return t.filter(e,r);if(void 0===t||null===t)throw new TypeError;if("function"!=typeof e)throw new TypeError;var i=[];for(var n=0;n<t.length;n++){if(!o.call(t,n))continue;var s=t[n];if(e.call(r,s,n,t))i.push(s)}return i};var o=Object.prototype.hasOwnProperty},{}],138:[function(E,A,t){(function(S){(function(){"use strict";var t=E("object-assign");function s(t,e){if(t===e){return 0}var r=t.length;var i=e.length;for(var n=0,s=Math.min(r,i);n<s;++n){if(t[n]!==e[n]){r=t[n];i=e[n];break}}if(r<i){return-1}if(i<r){return 1}return 0}function o(t){if(S.Buffer&&typeof S.Buffer.isBuffer==="function"){return S.Buffer.isBuffer(t)}return!!(t!=null&&t._isBuffer)}var f=E("util/");var i=Object.prototype.hasOwnProperty;var h=Array.prototype.slice;var n=function(){return function t(){}.name==="foo"}();function a(t){return Object.prototype.toString.call(t)}function u(t){if(o(t)){return false}if(typeof S.ArrayBuffer!=="function"){return false}if(typeof ArrayBuffer.isView==="function"){return ArrayBuffer.isView(t)}if(!t){return false}if(t instanceof DataView){return true}if(t.buffer&&t.buffer instanceof ArrayBuffer){return true}return false}var l=A.exports=y;var c=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(!f.isFunction(t)){return}if(n){return t.name}var e=t.toString();var r=e.match(c);return r&&r[1]}l.AssertionError=function t(e){this.name="AssertionError";this.actual=e.actual;this.expected=e.expected;this.operator=e.operator;if(e.message){this.message=e.message;this.generatedMessage=false}else{this.message=p(this);this.generatedMessage=true}var r=e.stackStartFunction||g;if(Error.captureStackTrace){Error.captureStackTrace(this,r)}else{var i=new Error;if(i.stack){var n=i.stack;var s=d(r);var o=n.indexOf("\n"+s);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}};f.inherits(l.AssertionError,Error);function e(t,e){if(typeof t==="string"){return t.length<e?t:t.slice(0,e)}else{return t}}function r(t){if(n||!f.isFunction(t)){return f.inspect(t)}var e=d(t);var r=e?": "+e:"";return"[Function"+r+"]"}function p(t){return e(r(t.actual),128)+" "+t.operator+" "+e(r(t.expected),128)}function g(t,e,r,i,n){throw new l.AssertionError({message:r,actual:t,expected:e,operator:i,stackStartFunction:n})}l.fail=g;function y(t,e){if(!t)g(t,true,e,"==",l.ok)}l.ok=y;l.equal=function t(e,r,i){if(e!=r)g(e,r,i,"==",l.equal)};l.notEqual=function t(e,r,i){if(e==r){g(e,r,i,"!=",l.notEqual)}};l.deepEqual=function t(e,r,i){if(!b(e,r,false)){g(e,r,i,"deepEqual",l.deepEqual)}};l.deepStrictEqual=function t(e,r,i){if(!b(e,r,true)){g(e,r,i,"deepStrictEqual",l.deepStrictEqual)}};function b(t,e,r,i){if(t===e){return true}else if(o(t)&&o(e)){return s(t,e)===0}else if(f.isDate(t)&&f.isDate(e)){return t.getTime()===e.getTime()}else if(f.isRegExp(t)&&f.isRegExp(e)){return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase}else if((t===null||typeof t!=="object")&&(e===null||typeof e!=="object")){return r?t===e:t==e}else if(u(t)&&u(e)&&a(t)===a(e)&&!(t instanceof Float32Array||t instanceof Float64Array)){return s(new Uint8Array(t.buffer),new Uint8Array(e.buffer))===0}else if(o(t)!==o(e)){return false}else{i=i||{actual:[],expected:[]};var n=i.actual.indexOf(t);if(n!==-1){if(n===i.expected.indexOf(e)){return true}}i.actual.push(t);i.expected.push(e);return v(t,e,r,i)}}function m(t){return Object.prototype.toString.call(t)=="[object Arguments]"}function v(t,e,r,i){if(t===null||t===undefined||e===null||e===undefined)return false;if(f.isPrimitive(t)||f.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return false;var n=m(t);var s=m(e);if(n&&!s||!n&&s)return false;if(n){t=h.call(t);e=h.call(e);return b(t,e,r)}var o=T(t);var a=T(e);var u,l;if(o.length!==a.length)return false;o.sort();a.sort();for(l=o.length-1;l>=0;l--){if(o[l]!==a[l])return false}for(l=o.length-1;l>=0;l--){u=o[l];if(!b(t[u],e[u],r,i))return false}return true}l.notDeepEqual=function t(e,r,i){if(b(e,r,false)){g(e,r,i,"notDeepEqual",l.notDeepEqual)}};l.notDeepStrictEqual=w;function w(t,e,r){if(b(t,e,true)){g(t,e,r,"notDeepStrictEqual",w)}}l.strictEqual=function t(e,r,i){if(e!==r){g(e,r,i,"===",l.strictEqual)}};l.notStrictEqual=function t(e,r,i){if(e===r){g(e,r,i,"!==",l.notStrictEqual)}};function _(t,e){if(!t||!e){return false}if(Object.prototype.toString.call(e)=="[object RegExp]"){return e.test(t)}try{if(t instanceof e){return true}}catch(t){}if(Error.isPrototypeOf(e)){return false}return e.call({},t)===true}function x(t){var e;try{t()}catch(t){e=t}return e}function C(t,e,r,i){var n;if(typeof e!=="function"){throw new TypeError('"block" argument must be a function')}if(typeof r==="string"){i=r;r=null}n=x(e);i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:".");if(t&&!n){g(n,r,"Missing expected exception"+i)}var s=typeof i==="string";var o=!t&&f.isError(n);var a=!t&&n&&!r;if(o&&s&&_(n,r)||a){g(n,r,"Got unwanted exception"+i)}if(t&&n&&r&&!_(n,r)||!t&&n){throw n}}l.throws=function(t,e,r){C(true,t,e,r)};l.doesNotThrow=function(t,e,r){C(false,t,e,r)};l.ifError=function(t){if(t)throw t};function k(t,e){if(!t)g(t,true,e,"==",k)}l.strict=t(k,l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual});l.strict.strict=l.strict;var T=Object.keys||function(t){var e=[];for(var r in t){if(i.call(t,r))e.push(r)}return e}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"object-assign":165,"util/":141}],139:[function(t,e,r){if(typeof Object.create==="function"){e.exports=function t(e,r){e.super_=r;e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{e.exports=function t(e,r){e.super_=r;var i=function(){};i.prototype=r.prototype;e.prototype=new i;e.prototype.constructor=e}}},{}],140:[function(t,e,r){e.exports=function t(e){return e&&typeof e==="object"&&typeof e.copy==="function"&&typeof e.fill==="function"&&typeof e.readUInt8==="function"}},{}],141:[function(M,t,j){(function(P,I){(function(){var a=/%[sdj%]/g;j.format=function(t){if(!_(t)){var e=[];for(var r=0;r<arguments.length;r++){e.push(u(arguments[r]))}return e.join(" ")}var r=1;var i=arguments;var n=i.length;var s=String(t).replace(a,function(t){if(t==="%%")return"%";if(r>=n)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}});for(var o=i[r];r<n;o=i[++r]){if(l(o)||!c(o)){s+=" "+o}else{s+=" "+u(o)}}return s};j.deprecate=function(t,e){if(h(I.process)){return function(){return j.deprecate(t,e).apply(this,arguments)}}if(P.noDeprecation===true){return t}var r=false;function i(){if(!r){if(P.throwDeprecation){throw new Error(e)}else if(P.traceDeprecation){console.trace(e)}else{console.error(e)}r=true}return t.apply(this,arguments)}return i};var t={};var i;j.debuglog=function(e){if(h(i))i=P.env.NODE_DEBUG||"";e=e.toUpperCase();if(!t[e]){if(new RegExp("\\b"+e+"\\b","i").test(i)){var r=P.pid;t[e]=function(){var t=j.format.apply(j,arguments);console.error("%s %d: %s",e,r,t)}}else{t[e]=function(){}}}return t[e]};function u(t,e){var r={seen:[],stylize:s};if(arguments.length>=3)r.depth=arguments[2];if(arguments.length>=4)r.colors=arguments[3];if(o(e)){r.showHidden=e}else if(e){j._extend(r,e)}if(h(r.showHidden))r.showHidden=false;if(h(r.depth))r.depth=2;if(h(r.colors))r.colors=false;if(h(r.customInspect))r.customInspect=true;if(r.colors)r.stylize=n;return p(r,t,r.depth)}j.inspect=u;u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(t,e){var r=u.styles[e];if(r){return"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m"}else{return t}}function s(t,e){return t}function d(t){var r={};t.forEach(function(t,e){r[t]=true});return r}function p(e,r,i){if(e.customInspect&&r&&T(r.inspect)&&r.inspect!==j.inspect&&!(r.constructor&&r.constructor.prototype===r)){var t=r.inspect(i,e);if(!_(t)){t=p(e,t,i)}return t}var n=g(e,r);if(n){return n}var s=Object.keys(r);var o=d(s);if(e.showHidden){s=Object.getOwnPropertyNames(r)}if(k(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return y(r)}if(s.length===0){if(T(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(x(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}if(C(r)){return e.stylize(Date.prototype.toString.call(r),"date")}if(k(r)){return y(r)}}var u="",l=false,f=["{","}"];if(w(r)){l=true;f=["[","]"]}if(T(r)){var h=r.name?": "+r.name:"";u=" [Function"+h+"]"}if(x(r)){u=" "+RegExp.prototype.toString.call(r)}if(C(r)){u=" "+Date.prototype.toUTCString.call(r)}if(k(r)){u=" "+y(r)}if(s.length===0&&(!l||r.length==0)){return f[0]+u+f[1]}if(i<0){if(x(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(r);var c;if(l){c=b(e,r,i,o,s)}else{c=s.map(function(t){return m(e,r,i,o,t,l)})}e.seen.pop();return v(c,u,f)}function g(t,e){if(h(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(f(e))return t.stylize(""+e,"number");if(o(e))return t.stylize(""+e,"boolean");if(l(e))return t.stylize("null","null")}function y(t){return"["+Error.prototype.toString.call(t)+"]"}function b(e,r,i,n,t){var s=[];for(var o=0,a=r.length;o<a;++o){if(O(r,String(o))){s.push(m(e,r,i,n,String(o),true))}else{s.push("")}}t.forEach(function(t){if(!t.match(/^\d+$/)){s.push(m(e,r,i,n,t,true))}});return s}function m(t,e,r,i,n,s){var o,a,u;u=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]};if(u.get){if(u.set){a=t.stylize("[Getter/Setter]","special")}else{a=t.stylize("[Getter]","special")}}else{if(u.set){a=t.stylize("[Setter]","special")}}if(!O(i,n)){o="["+n+"]"}if(!a){if(t.seen.indexOf(u.value)<0){if(l(r)){a=p(t,u.value,null)}else{a=p(t,u.value,r-1)}if(a.indexOf("\n")>-1){if(s){a=a.split("\n").map(function(t){return"  "+t}).join("\n").substr(2)}else{a="\n"+a.split("\n").map(function(t){return"   "+t}).join("\n")}}}else{a=t.stylize("[Circular]","special")}}if(h(o)){if(s&&n.match(/^\d+$/)){return a}o=JSON.stringify(""+n);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=t.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=t.stylize(o,"string")}}return o+": "+a}function v(t,e,r){var i=0;var n=t.reduce(function(t,e){i++;if(e.indexOf("\n")>=0)i++;return t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60){return r[0]+(e===""?"":e+"\n ")+" "+t.join(",\n  ")+" "+r[1]}return r[0]+e+" "+t.join(", ")+" "+r[1]}function w(t){return Array.isArray(t)}j.isArray=w;function o(t){return typeof t==="boolean"}j.isBoolean=o;function l(t){return t===null}j.isNull=l;function e(t){return t==null}j.isNullOrUndefined=e;function f(t){return typeof t==="number"}j.isNumber=f;function _(t){return typeof t==="string"}j.isString=_;function r(t){return typeof t==="symbol"}j.isSymbol=r;function h(t){return t===void 0}j.isUndefined=h;function x(t){return c(t)&&E(t)==="[object RegExp]"}j.isRegExp=x;function c(t){return typeof t==="object"&&t!==null}j.isObject=c;function C(t){return c(t)&&E(t)==="[object Date]"}j.isDate=C;function k(t){return c(t)&&(E(t)==="[object Error]"||t instanceof Error)}j.isError=k;function T(t){return typeof t==="function"}j.isFunction=T;function S(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}j.isPrimitive=S;j.isBuffer=M("./support/isBuffer");function E(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(){var t=new Date;var e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),R[t.getMonth()],e].join(" ")}j.log=function(){console.log("%s - %s",B(),j.format.apply(j,arguments))};j.inherits=M("inherits");j._extend=function(t,e){if(!e||!c(e))return t;var r=Object.keys(e);var i=r.length;while(i--){t[r[i]]=e[r[i]]}return t};function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}).call(this)}).call(this,M("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":140,_process:179,inherits:139}],142:[function(t,i,e){(function(r){(function(){"use strict";var e=t("array-filter");i.exports=function t(){return e(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],function(t){return typeof r[t]==="function"})}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"array-filter":137}],143:[function(t,e,r){"use strict";r.byteLength=o;r.toByteArray=a;r.fromByteArray=g;var u=[];var l=[];var f=typeof Uint8Array!=="undefined"?Uint8Array:Array;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var n=0,s=i.length;n<s;++n){u[n]=i[n];l[i.charCodeAt(n)]=n}l["-".charCodeAt(0)]=62;l["_".charCodeAt(0)]=63;function h(t){var e=t.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var r=t.indexOf("=");if(r===-1)r=e;var i=r===e?0:4-r%4;return[r,i]}function o(t){var e=h(t);var r=e[0];var i=e[1];return(r+i)*3/4-i}function c(t,e,r){return(e+r)*3/4-r}function a(t){var e;var r=h(t);var i=r[0];var n=r[1];var s=new f(c(t,i,n));var o=0;var a=n>0?i-4:i;var u;for(u=0;u<a;u+=4){e=l[t.charCodeAt(u)]<<18|l[t.charCodeAt(u+1)]<<12|l[t.charCodeAt(u+2)]<<6|l[t.charCodeAt(u+3)];s[o++]=e>>16&255;s[o++]=e>>8&255;s[o++]=e&255}if(n===2){e=l[t.charCodeAt(u)]<<2|l[t.charCodeAt(u+1)]>>4;s[o++]=e&255}if(n===1){e=l[t.charCodeAt(u)]<<10|l[t.charCodeAt(u+1)]<<4|l[t.charCodeAt(u+2)]>>2;s[o++]=e>>8&255;s[o++]=e&255}return s}function d(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[t&63]}function p(t,e,r){var i;var n=[];for(var s=e;s<r;s+=3){i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255);n.push(d(i))}return n.join("")}function g(t){var e;var r=t.length;var i=r%3;var n=[];var s=16383;for(var o=0,a=r-i;o<a;o+=s){n.push(p(t,o,o+s>a?a:o+s))}if(i===1){e=t[r-1];n.push(u[e>>2]+u[e<<4&63]+"==")}else if(i===2){e=(t[r-2]<<8)+t[r-1];n.push(u[e>>10]+u[e>>4&63]+u[e<<2&63]+"=")}return n.join("")}},{}],144:[function(t,e,r){arguments[4][136][0].apply(r,arguments)},{dup:136}],145:[function(u,t,c){(function(f,h){(function(){"use strict";var l=u("assert");var s=u("pako/lib/zlib/zstream");var o=u("pako/lib/zlib/deflate.js");var a=u("pako/lib/zlib/inflate.js");var t=u("pako/lib/zlib/constants");for(var e in t){c[e]=t[e]}c.NONE=0;c.DEFLATE=1;c.INFLATE=2;c.GZIP=3;c.GUNZIP=4;c.DEFLATERAW=5;c.INFLATERAW=6;c.UNZIP=7;var r=31;var i=139;function n(t){if(typeof t!=="number"||t<c.DEFLATE||t>c.UNZIP){throw new TypeError("Bad argument")}this.dictionary=null;this.err=0;this.flush=0;this.init_done=false;this.level=0;this.memLevel=0;this.mode=t;this.strategy=0;this.windowBits=0;this.write_in_progress=false;this.pending_close=false;this.gzip_id_bytes_read=0}n.prototype.close=function(){if(this.write_in_progress){this.pending_close=true;return}this.pending_close=false;l(this.init_done,"close before init");l(this.mode<=c.UNZIP);if(this.mode===c.DEFLATE||this.mode===c.GZIP||this.mode===c.DEFLATERAW){o.deflateEnd(this.strm)}else if(this.mode===c.INFLATE||this.mode===c.GUNZIP||this.mode===c.INFLATERAW||this.mode===c.UNZIP){a.inflateEnd(this.strm)}this.mode=c.NONE;this.dictionary=null};n.prototype.write=function(t,e,r,i,n,s,o){return this._write(true,t,e,r,i,n,s,o)};n.prototype.writeSync=function(t,e,r,i,n,s,o){return this._write(false,t,e,r,i,n,s,o)};n.prototype._write=function(t,e,r,i,n,s,o,a){l.equal(arguments.length,8);l(this.init_done,"write before init");l(this.mode!==c.NONE,"already finalized");l.equal(false,this.write_in_progress,"write already in progress");l.equal(false,this.pending_close,"close is pending");this.write_in_progress=true;l.equal(false,e===undefined,"must provide flush value");this.write_in_progress=true;if(e!==c.Z_NO_FLUSH&&e!==c.Z_PARTIAL_FLUSH&&e!==c.Z_SYNC_FLUSH&&e!==c.Z_FULL_FLUSH&&e!==c.Z_FINISH&&e!==c.Z_BLOCK){throw new Error("Invalid flush value")}if(r==null){r=h.alloc(0);n=0;i=0}this.strm.avail_in=n;this.strm.input=r;this.strm.next_in=i;this.strm.avail_out=a;this.strm.output=s;this.strm.next_out=o;this.flush=e;if(!t){this._process();if(this._checkError()){return this._afterSync()}return}var u=this;f.nextTick(function(){u._process();u._after()});return this};n.prototype._afterSync=function(){var t=this.strm.avail_out;var e=this.strm.avail_in;this.write_in_progress=false;return[e,t]};n.prototype._process=function(){var t=null;switch(this.mode){case c.DEFLATE:case c.GZIP:case c.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case c.UNZIP:if(this.strm.avail_in>0){t=this.strm.next_in}switch(this.gzip_id_bytes_read){case 0:if(t===null){break}if(this.strm.input[t]===r){this.gzip_id_bytes_read=1;t++;if(this.strm.avail_in===1){break}}else{this.mode=c.INFLATE;break}case 1:if(t===null){break}if(this.strm.input[t]===i){this.gzip_id_bytes_read=2;this.mode=c.GUNZIP}else{this.mode=c.INFLATE}break;default:throw new Error("invalid number of gzip magic number bytes read")}case c.INFLATE:case c.GUNZIP:case c.INFLATERAW:this.err=a.inflate(this.strm,this.flush);if(this.err===c.Z_NEED_DICT&&this.dictionary){this.err=a.inflateSetDictionary(this.strm,this.dictionary);if(this.err===c.Z_OK){this.err=a.inflate(this.strm,this.flush)}else if(this.err===c.Z_DATA_ERROR){this.err=c.Z_NEED_DICT}}while(this.strm.avail_in>0&&this.mode===c.GUNZIP&&this.err===c.Z_STREAM_END&&this.strm.next_in[0]!==0){this.reset();this.err=a.inflate(this.strm,this.flush)}break;default:throw new Error("Unknown mode "+this.mode)}};n.prototype._checkError=function(){switch(this.err){case c.Z_OK:case c.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===c.Z_FINISH){this._error("unexpected end of file");return false}break;case c.Z_STREAM_END:break;case c.Z_NEED_DICT:if(this.dictionary==null){this._error("Missing dictionary")}else{this._error("Bad dictionary")}return false;default:this._error("Zlib error");return false}return true};n.prototype._after=function(){if(!this._checkError()){return}var t=this.strm.avail_out;var e=this.strm.avail_in;this.write_in_progress=false;this.callback(e,t);if(this.pending_close){this.close()}};n.prototype._error=function(t){if(this.strm.msg){t=this.strm.msg}this.onerror(t,this.err);this.write_in_progress=false;if(this.pending_close){this.close()}};n.prototype.init=function(t,e,r,i,n){l(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])");l(t>=8&&t<=15,"invalid windowBits");l(e>=-1&&e<=9,"invalid compression level");l(r>=1&&r<=9,"invalid memlevel");l(i===c.Z_FILTERED||i===c.Z_HUFFMAN_ONLY||i===c.Z_RLE||i===c.Z_FIXED||i===c.Z_DEFAULT_STRATEGY,"invalid strategy");this._init(e,t,r,i,n);this._setDictionary()};n.prototype.params=function(){throw new Error("deflateParams Not supported")};n.prototype.reset=function(){this._reset();this._setDictionary()};n.prototype._init=function(t,e,r,i,n){this.level=t;this.windowBits=e;this.memLevel=r;this.strategy=i;this.flush=c.Z_NO_FLUSH;this.err=c.Z_OK;if(this.mode===c.GZIP||this.mode===c.GUNZIP){this.windowBits+=16}if(this.mode===c.UNZIP){this.windowBits+=32}if(this.mode===c.DEFLATERAW||this.mode===c.INFLATERAW){this.windowBits=-1*this.windowBits}this.strm=new s;switch(this.mode){case c.DEFLATE:case c.GZIP:case c.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,c.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case c.INFLATE:case c.GUNZIP:case c.INFLATERAW:case c.UNZIP:this.err=a.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(this.err!==c.Z_OK){this._error("Init error")}this.dictionary=n;this.write_in_progress=false;this.init_done=true};n.prototype._setDictionary=function(){if(this.dictionary==null){return}this.err=c.Z_OK;switch(this.mode){case c.DEFLATE:case c.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary);break;default:break}if(this.err!==c.Z_OK){this._error("Failed to set dictionary")}};n.prototype._reset=function(){this.err=c.Z_OK;switch(this.mode){case c.DEFLATE:case c.DEFLATERAW:case c.GZIP:this.err=o.deflateReset(this.strm);break;case c.INFLATE:case c.INFLATERAW:case c.GUNZIP:this.err=a.inflateReset(this.strm);break;default:break}if(this.err!==c.Z_OK){this._error("Failed to reset stream")}};c.Zlib=n}).call(this)}).call(this,u("_process"),u("buffer").Buffer)},{_process:179,assert:138,buffer:147,"pako/lib/zlib/constants":169,"pako/lib/zlib/deflate.js":171,"pako/lib/zlib/inflate.js":173,"pako/lib/zlib/zstream":177}],146:[function(A,t,R){(function(E){(function(){"use strict";var y=A("buffer").Buffer;var o=A("stream").Transform;var a=A("./binding");var t=A("util");var b=A("assert").ok;var m=A("buffer").kMaxLength;var v="Cannot create final Buffer. It would be larger "+"than 0x"+m.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8;a.Z_MAX_WINDOWBITS=15;a.Z_DEFAULT_WINDOWBITS=15;a.Z_MIN_CHUNK=64;a.Z_MAX_CHUNK=Infinity;a.Z_DEFAULT_CHUNK=16*1024;a.Z_MIN_MEMLEVEL=1;a.Z_MAX_MEMLEVEL=9;a.Z_DEFAULT_MEMLEVEL=8;a.Z_MIN_LEVEL=-1;a.Z_MAX_LEVEL=9;a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;var e=Object.keys(a);for(var r=0;r<e.length;r++){var i=e[r];if(i.match(/^Z/)){Object.defineProperty(R,i,{enumerable:true,value:a[i],writable:false})}}var n={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR};var s=Object.keys(n);for(var u=0;u<s.length;u++){var l=s[u];n[n[l]]=l}Object.defineProperty(R,"codes",{enumerable:true,value:Object.freeze(n),writable:false});R.Deflate=c;R.Inflate=d;R.Gzip=p;R.Gunzip=g;R.DeflateRaw=w;R.InflateRaw=_;R.Unzip=x;R.createDeflate=function(t){return new c(t)};R.createInflate=function(t){return new d(t)};R.createDeflateRaw=function(t){return new w(t)};R.createInflateRaw=function(t){return new _(t)};R.createGzip=function(t){return new p(t)};R.createGunzip=function(t){return new g(t)};R.createUnzip=function(t){return new x(t)};R.deflate=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new c(e),t,r)};R.deflateSync=function(t,e){return h(new c(e),t)};R.gzip=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new p(e),t,r)};R.gzipSync=function(t,e){return h(new p(e),t)};R.deflateRaw=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new w(e),t,r)};R.deflateRawSync=function(t,e){return h(new w(e),t)};R.unzip=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new x(e),t,r)};R.unzipSync=function(t,e){return h(new x(e),t)};R.inflate=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new d(e),t,r)};R.inflateSync=function(t,e){return h(new d(e),t)};R.gunzip=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new g(e),t,r)};R.gunzipSync=function(t,e){return h(new g(e),t)};R.inflateRaw=function(t,e,r){if(typeof e==="function"){r=e;e={}}return f(new _(e),t,r)};R.inflateRawSync=function(t,e){return h(new _(e),t)};function f(r,t,i){var n=[];var s=0;r.on("error",o);r.on("end",a);r.end(t);e();function e(){var t;while(null!==(t=r.read())){n.push(t);s+=t.length}r.once("readable",e)}function o(t){r.removeListener("end",a);r.removeListener("readable",e);i(t)}function a(){var t;var e=null;if(s>=m){e=new RangeError(v)}else{t=y.concat(n,s)}n=[];r.close();i(e,t)}}function h(t,e){if(typeof e==="string")e=y.from(e);if(!y.isBuffer(e))throw new TypeError("Not a string or buffer");var r=t._finishFlushFlag;return t._processChunk(e,r)}function c(t){if(!(this instanceof c))return new c(t);k.call(this,t,a.DEFLATE)}function d(t){if(!(this instanceof d))return new d(t);k.call(this,t,a.INFLATE)}function p(t){if(!(this instanceof p))return new p(t);k.call(this,t,a.GZIP)}function g(t){if(!(this instanceof g))return new g(t);k.call(this,t,a.GUNZIP)}function w(t){if(!(this instanceof w))return new w(t);k.call(this,t,a.DEFLATERAW)}function _(t){if(!(this instanceof _))return new _(t);k.call(this,t,a.INFLATERAW)}function x(t){if(!(this instanceof x))return new x(t);k.call(this,t,a.UNZIP)}function C(t){return t===a.Z_NO_FLUSH||t===a.Z_PARTIAL_FLUSH||t===a.Z_SYNC_FLUSH||t===a.Z_FULL_FLUSH||t===a.Z_FINISH||t===a.Z_BLOCK}function k(t,e){var r=this;this._opts=t=t||{};this._chunkSize=t.chunkSize||R.Z_DEFAULT_CHUNK;o.call(this,t);if(t.flush&&!C(t.flush)){throw new Error("Invalid flush flag: "+t.flush)}if(t.finishFlush&&!C(t.finishFlush)){throw new Error("Invalid flush flag: "+t.finishFlush)}this._flushFlag=t.flush||a.Z_NO_FLUSH;this._finishFlushFlag=typeof t.finishFlush!=="undefined"?t.finishFlush:a.Z_FINISH;if(t.chunkSize){if(t.chunkSize<R.Z_MIN_CHUNK||t.chunkSize>R.Z_MAX_CHUNK){throw new Error("Invalid chunk size: "+t.chunkSize)}}if(t.windowBits){if(t.windowBits<R.Z_MIN_WINDOWBITS||t.windowBits>R.Z_MAX_WINDOWBITS){throw new Error("Invalid windowBits: "+t.windowBits)}}if(t.level){if(t.level<R.Z_MIN_LEVEL||t.level>R.Z_MAX_LEVEL){throw new Error("Invalid compression level: "+t.level)}}if(t.memLevel){if(t.memLevel<R.Z_MIN_MEMLEVEL||t.memLevel>R.Z_MAX_MEMLEVEL){throw new Error("Invalid memLevel: "+t.memLevel)}}if(t.strategy){if(t.strategy!=R.Z_FILTERED&&t.strategy!=R.Z_HUFFMAN_ONLY&&t.strategy!=R.Z_RLE&&t.strategy!=R.Z_FIXED&&t.strategy!=R.Z_DEFAULT_STRATEGY){throw new Error("Invalid strategy: "+t.strategy)}}if(t.dictionary){if(!y.isBuffer(t.dictionary)){throw new Error("Invalid dictionary: it should be a Buffer instance")}}this._handle=new a.Zlib(e);var i=this;this._hadError=false;this._handle.onerror=function(t,e){T(i);i._hadError=true;var r=new Error(t);r.errno=e;r.code=R.codes[e];i.emit("error",r)};var n=R.Z_DEFAULT_COMPRESSION;if(typeof t.level==="number")n=t.level;var s=R.Z_DEFAULT_STRATEGY;if(typeof t.strategy==="number")s=t.strategy;this._handle.init(t.windowBits||R.Z_DEFAULT_WINDOWBITS,n,t.memLevel||R.Z_DEFAULT_MEMLEVEL,s,t.dictionary);this._buffer=y.allocUnsafe(this._chunkSize);this._offset=0;this._level=n;this._strategy=s;this.once("end",this.close);Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:true,enumerable:true})}t.inherits(k,o);k.prototype.params=function(t,e,r){if(t<R.Z_MIN_LEVEL||t>R.Z_MAX_LEVEL){throw new RangeError("Invalid compression level: "+t)}if(e!=R.Z_FILTERED&&e!=R.Z_HUFFMAN_ONLY&&e!=R.Z_RLE&&e!=R.Z_FIXED&&e!=R.Z_DEFAULT_STRATEGY){throw new TypeError("Invalid strategy: "+e)}if(this._level!==t||this._strategy!==e){var i=this;this.flush(a.Z_SYNC_FLUSH,function(){b(i._handle,"zlib binding closed");i._handle.params(t,e);if(!i._hadError){i._level=t;i._strategy=e;if(r)r()}})}else{E.nextTick(r)}};k.prototype.reset=function(){b(this._handle,"zlib binding closed");return this._handle.reset()};k.prototype._flush=function(t){this._transform(y.alloc(0),"",t)};k.prototype.flush=function(t,e){var r=this;var i=this._writableState;if(typeof t==="function"||t===undefined&&!e){e=t;t=a.Z_FULL_FLUSH}if(i.ended){if(e)E.nextTick(e)}else if(i.ending){if(e)this.once("end",e)}else if(i.needDrain){if(e){this.once("drain",function(){return r.flush(t,e)})}}else{this._flushFlag=t;this.write(y.alloc(0),"",e)}};k.prototype.close=function(t){T(this,t);E.nextTick(S,this)};function T(t,e){if(e)E.nextTick(e);if(!t._handle)return;t._handle.close();t._handle=null}function S(t){t.emit("close")}k.prototype._transform=function(t,e,r){var i;var n=this._writableState;var s=n.ending||n.ended;var o=s&&(!t||n.length===t.length);if(t!==null&&!y.isBuffer(t))return r(new Error("invalid input"));if(!this._handle)return r(new Error("zlib binding closed"));if(o)i=this._finishFlushFlag;else{i=this._flushFlag;if(t.length>=n.length){this._flushFlag=this._opts.flush||a.Z_NO_FLUSH}}this._processChunk(t,i,r)};k.prototype._processChunk=function(s,o,a){var u=s&&s.length;var l=this._chunkSize-this._offset;var f=0;var h=this;var c=typeof a==="function";if(!c){var d=[];var p=0;var e;this.on("error",function(t){e=t});b(this._handle,"zlib binding closed");do{var t=this._handle.writeSync(o,s,f,u,this._buffer,this._offset,l)}while(!this._hadError&&g(t[0],t[1]));if(this._hadError){throw e}if(p>=m){T(this);throw new RangeError(v)}var r=y.concat(d,p);T(this);return r}b(this._handle,"zlib binding closed");var i=this._handle.write(o,s,f,u,this._buffer,this._offset,l);i.buffer=s;i.callback=g;function g(t,e){if(this){this.buffer=null;this.callback=null}if(h._hadError)return;var r=l-e;b(r>=0,"have should not go down");if(r>0){var i=h._buffer.slice(h._offset,h._offset+r);h._offset+=r;if(c){h.push(i)}else{d.push(i);p+=i.length}}if(e===0||h._offset>=h._chunkSize){l=h._chunkSize;h._offset=0;h._buffer=y.allocUnsafe(h._chunkSize)}if(e===0){f+=u-t;u=t;if(!c)return true;var n=h._handle.write(o,s,f,u,h._buffer,h._offset,h._chunkSize);n.callback=g;n.buffer=s;return}if(!c)return false;a()}};t.inherits(c,k);t.inherits(d,k);t.inherits(p,k);t.inherits(g,k);t.inherits(w,k);t.inherits(_,k);t.inherits(x,k)}).call(this)}).call(this,A("_process"))},{"./binding":145,_process:179,assert:138,buffer:147,stream:181,util:202}],147:[function(q,t,J){(function(t){(function(){"use strict";var i=q("base64-js");var s=q("ieee754");J.Buffer=c;J.SlowBuffer=e;J.INSPECT_MAX_BYTES=50;var r=2147483647;J.kMaxLength=r;c.TYPED_ARRAY_SUPPORT=t();if(!c.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function t(){try{var t=new Uint8Array(1);t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return t.foo()===42}catch(t){return false}}Object.defineProperty(c.prototype,"parent",{enumerable:true,get:function(){if(!c.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(c.prototype,"offset",{enumerable:true,get:function(){if(!c.isBuffer(this))return undefined;return this.byteOffset}});function o(t){if(t>r){throw new RangeError('The value "'+t+'" is invalid for option "size"')}var e=new Uint8Array(t);e.__proto__=c.prototype;return e}function c(t,e,r){if(typeof t==="number"){if(typeof e==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return l(t)}return n(t,e,r)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&c[Symbol.species]===c){Object.defineProperty(c,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}c.poolSize=8192;function n(t,e,r){if(typeof t==="string"){return f(t,e)}if(ArrayBuffer.isView(t)){return h(t)}if(t==null){throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof t)}if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer)){return d(t,e,r)}if(typeof t==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var i=t.valueOf&&t.valueOf();if(i!=null&&i!==t){return c.from(i,e,r)}var n=p(t);if(n)return n;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]==="function"){return c.from(t[Symbol.toPrimitive]("string"),e,r)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof t)}c.from=function(t,e,r){return n(t,e,r)};c.prototype.__proto__=Uint8Array.prototype;c.__proto__=Uint8Array;function a(t){if(typeof t!=="number"){throw new TypeError('"size" argument must be of type number')}else if(t<0){throw new RangeError('The value "'+t+'" is invalid for option "size"')}}function u(t,e,r){a(t);if(t<=0){return o(t)}if(e!==undefined){return typeof r==="string"?o(t).fill(e,r):o(t).fill(e)}return o(t)}c.alloc=function(t,e,r){return u(t,e,r)};function l(t){a(t);return o(t<0?0:g(t)|0)}c.allocUnsafe=function(t){return l(t)};c.allocUnsafeSlow=function(t){return l(t)};function f(t,e){if(typeof e!=="string"||e===""){e="utf8"}if(!c.isEncoding(e)){throw new TypeError("Unknown encoding: "+e)}var r=y(t,e)|0;var i=o(r);var n=i.write(t,e);if(n!==r){i=i.slice(0,n)}return i}function h(t){var e=t.length<0?0:g(t.length)|0;var r=o(e);for(var i=0;i<e;i+=1){r[i]=t[i]&255}return r}function d(t,e,r){if(e<0||t.byteLength<e){throw new RangeError('"offset" is outside of buffer bounds')}if(t.byteLength<e+(r||0)){throw new RangeError('"length" is outside of buffer bounds')}var i;if(e===undefined&&r===undefined){i=new Uint8Array(t)}else if(r===undefined){i=new Uint8Array(t,e)}else{i=new Uint8Array(t,e,r)}i.__proto__=c.prototype;return i}function p(t){if(c.isBuffer(t)){var e=g(t.length)|0;var r=o(e);if(r.length===0){return r}t.copy(r,0,0,e);return r}if(t.length!==undefined){if(typeof t.length!=="number"||X(t.length)){return o(0)}return h(t)}if(t.type==="Buffer"&&Array.isArray(t.data)){return h(t.data)}}function g(t){if(t>=r){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+r.toString(16)+" bytes")}return t|0}function e(t){if(+t!=t){t=0}return c.alloc(+t)}c.isBuffer=function t(e){return e!=null&&e._isBuffer===true&&e!==c.prototype};c.compare=function t(e,r){if(K(e,Uint8Array))e=c.from(e,e.offset,e.byteLength);if(K(r,Uint8Array))r=c.from(r,r.offset,r.byteLength);if(!c.isBuffer(e)||!c.isBuffer(r)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(e===r)return 0;var i=e.length;var n=r.length;for(var s=0,o=Math.min(i,n);s<o;++s){if(e[s]!==r[s]){i=e[s];n=r[s];break}}if(i<n)return-1;if(n<i)return 1;return 0};c.isEncoding=function t(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};c.concat=function t(e,r){if(!Array.isArray(e)){throw new TypeError('"list" argument must be an Array of Buffers')}if(e.length===0){return c.alloc(0)}var i;if(r===undefined){r=0;for(i=0;i<e.length;++i){r+=e[i].length}}var n=c.allocUnsafe(r);var s=0;for(i=0;i<e.length;++i){var o=e[i];if(K(o,Uint8Array)){o=c.from(o)}if(!c.isBuffer(o)){throw new TypeError('"list" argument must be an Array of Buffers')}o.copy(n,s);s+=o.length}return n};function y(t,e){if(c.isBuffer(t)){return t.length}if(ArrayBuffer.isView(t)||K(t,ArrayBuffer)){return t.byteLength}if(typeof t!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof t)}var r=t.length;var i=arguments.length>2&&arguments[2]===true;if(!i&&r===0)return 0;var n=false;for(;;){switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n){return i?-1:z(t).length}e=(""+e).toLowerCase();n=true}}}c.byteLength=y;function b(t,e,r){var i=false;if(e===undefined||e<0){e=0}if(e>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;e>>>=0;if(r<=e){return""}if(!t)t="utf8";while(true){switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase();i=true}}}c.prototype._isBuffer=true;function m(t,e,r){var i=t[e];t[e]=t[r];t[r]=i}c.prototype.swap16=function t(){var e=this.length;if(e%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r<e;r+=2){m(this,r,r+1)}return this};c.prototype.swap32=function t(){var e=this.length;if(e%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var r=0;r<e;r+=4){m(this,r,r+3);m(this,r+1,r+2)}return this};c.prototype.swap64=function t(){var e=this.length;if(e%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var r=0;r<e;r+=8){m(this,r,r+7);m(this,r+1,r+6);m(this,r+2,r+5);m(this,r+3,r+4)}return this};c.prototype.toString=function t(){var e=this.length;if(e===0)return"";if(arguments.length===0)return A(this,0,e);return b.apply(this,arguments)};c.prototype.toLocaleString=c.prototype.toString;c.prototype.equals=function t(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return c.compare(this,e)===0};c.prototype.inspect=function t(){var e="";var r=J.INSPECT_MAX_BYTES;e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim();if(this.length>r)e+=" ... ";return"<Buffer "+e+">"};c.prototype.compare=function t(e,r,i,n,s){if(K(e,Uint8Array)){e=c.from(e,e.offset,e.byteLength)}if(!c.isBuffer(e)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof e)}if(r===undefined){r=0}if(i===undefined){i=e?e.length:0}if(n===undefined){n=0}if(s===undefined){s=this.length}if(r<0||i>e.length||n<0||s>this.length){throw new RangeError("out of range index")}if(n>=s&&r>=i){return 0}if(n>=s){return-1}if(r>=i){return 1}r>>>=0;i>>>=0;n>>>=0;s>>>=0;if(this===e)return 0;var o=s-n;var a=i-r;var u=Math.min(o,a);var l=this.slice(n,s);var f=e.slice(r,i);for(var h=0;h<u;++h){if(l[h]!==f[h]){o=l[h];a=f[h];break}}if(o<a)return-1;if(a<o)return 1;return 0};function v(t,e,r,i,n){if(t.length===0)return-1;if(typeof r==="string"){i=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(X(r)){r=n?0:t.length-1}if(r<0)r=t.length+r;if(r>=t.length){if(n)return-1;else r=t.length-1}else if(r<0){if(n)r=0;else return-1}if(typeof e==="string"){e=c.from(e,i)}if(c.isBuffer(e)){if(e.length===0){return-1}return w(t,e,r,i,n)}else if(typeof e==="number"){e=e&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(n){return Uint8Array.prototype.indexOf.call(t,e,r)}else{return Uint8Array.prototype.lastIndexOf.call(t,e,r)}}return w(t,[e],r,i,n)}throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,i,n){var s=1;var o=t.length;var a=e.length;if(i!==undefined){i=String(i).toLowerCase();if(i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le"){if(t.length<2||e.length<2){return-1}s=2;o/=2;a/=2;r/=2}}function u(t,e){if(s===1){return t[e]}else{return t.readUInt16BE(e*s)}}var l;if(n){var f=-1;for(l=r;l<o;l++){if(u(t,l)===u(e,f===-1?0:l-f)){if(f===-1)f=l;if(l-f+1===a)return f*s}else{if(f!==-1)l-=l-f;f=-1}}}else{if(r+a>o)r=o-a;for(l=r;l>=0;l--){var h=true;for(var c=0;c<a;c++){if(u(t,l+c)!==u(e,c)){h=false;break}}if(h)return l}}return-1}c.prototype.includes=function t(e,r,i){return this.indexOf(e,r,i)!==-1};c.prototype.indexOf=function t(e,r,i){return v(this,e,r,i,true)};c.prototype.lastIndexOf=function t(e,r,i){return v(this,e,r,i,false)};function _(t,e,r,i){r=Number(r)||0;var n=t.length-r;if(!i){i=n}else{i=Number(i);if(i>n){i=n}}var s=e.length;if(i>s/2){i=s/2}for(var o=0;o<i;++o){var a=parseInt(e.substr(o*2,2),16);if(X(a))return o;t[r+o]=a}return o}function x(t,e,r,i){return Z(z(e,t.length-r),t,r,i)}function C(t,e,r,i){return Z(Y(e),t,r,i)}function k(t,e,r,i){return C(t,e,r,i)}function T(t,e,r,i){return Z(G(e),t,r,i)}function S(t,e,r,i){return Z(V(e,t.length-r),t,r,i)}c.prototype.write=function t(e,r,i,n){if(r===undefined){n="utf8";i=this.length;r=0}else if(i===undefined&&typeof r==="string"){n=r;i=this.length;r=0}else if(isFinite(r)){r=r>>>0;if(isFinite(i)){i=i>>>0;if(n===undefined)n="utf8"}else{n=i;i=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var s=this.length-r;if(i===undefined||i>s)i=s;if(e.length>0&&(i<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!n)n="utf8";var o=false;for(;;){switch(n){case"hex":return _(this,e,r,i);case"utf8":case"utf-8":return x(this,e,r,i);case"ascii":return C(this,e,r,i);case"latin1":case"binary":return k(this,e,r,i);case"base64":return T(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();o=true}}};c.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function E(t,e,r){if(e===0&&r===t.length){return i.fromByteArray(t)}else{return i.fromByteArray(t.slice(e,r))}}function A(t,e,r){r=Math.min(t.length,r);var i=[];var n=e;while(n<r){var s=t[n];var o=null;var a=s>239?4:s>223?3:s>191?2:1;if(n+a<=r){var u,l,f,h;switch(a){case 1:if(s<128){o=s}break;case 2:u=t[n+1];if((u&192)===128){h=(s&31)<<6|u&63;if(h>127){o=h}}break;case 3:u=t[n+1];l=t[n+2];if((u&192)===128&&(l&192)===128){h=(s&15)<<12|(u&63)<<6|l&63;if(h>2047&&(h<55296||h>57343)){o=h}}break;case 4:u=t[n+1];l=t[n+2];f=t[n+3];if((u&192)===128&&(l&192)===128&&(f&192)===128){h=(s&15)<<18|(u&63)<<12|(l&63)<<6|f&63;if(h>65535&&h<1114112){o=h}}}}if(o===null){o=65533;a=1}else if(o>65535){o-=65536;i.push(o>>>10&1023|55296);o=56320|o&1023}i.push(o);n+=a}return B(i)}var R=4096;function B(t){var e=t.length;if(e<=R){return String.fromCharCode.apply(String,t)}var r="";var i=0;while(i<e){r+=String.fromCharCode.apply(String,t.slice(i,i+=R))}return r}function O(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n){i+=String.fromCharCode(t[n]&127)}return i}function P(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n){i+=String.fromCharCode(t[n])}return i}function I(t,e,r){var i=t.length;if(!e||e<0)e=0;if(!r||r<0||r>i)r=i;var n="";for(var s=e;s<r;++s){n+=U(t[s])}return n}function M(t,e,r){var i=t.slice(e,r);var n="";for(var s=0;s<i.length;s+=2){n+=String.fromCharCode(i[s]+i[s+1]*256)}return n}c.prototype.slice=function t(e,r){var i=this.length;e=~~e;r=r===undefined?i:~~r;if(e<0){e+=i;if(e<0)e=0}else if(e>i){e=i}if(r<0){r+=i;if(r<0)r=0}else if(r>i){r=i}if(r<e)r=e;var n=this.subarray(e,r);n.__proto__=c.prototype;return n};function j(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUIntLE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)j(e,r,this.length);var n=this[e];var s=1;var o=0;while(++o<r&&(s*=256)){n+=this[e+o]*s}return n};c.prototype.readUIntBE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i){j(e,r,this.length)}var n=this[e+--r];var s=1;while(r>0&&(s*=256)){n+=this[e+--r]*s}return n};c.prototype.readUInt8=function t(e,r){e=e>>>0;if(!r)j(e,1,this.length);return this[e]};c.prototype.readUInt16LE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);return this[e]|this[e+1]<<8};c.prototype.readUInt16BE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);return this[e]<<8|this[e+1]};c.prototype.readUInt32LE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};c.prototype.readUInt32BE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};c.prototype.readIntLE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)j(e,r,this.length);var n=this[e];var s=1;var o=0;while(++o<r&&(s*=256)){n+=this[e+o]*s}s*=128;if(n>=s)n-=Math.pow(2,8*r);return n};c.prototype.readIntBE=function t(e,r,i){e=e>>>0;r=r>>>0;if(!i)j(e,r,this.length);var n=r;var s=1;var o=this[e+--n];while(n>0&&(s*=256)){o+=this[e+--n]*s}s*=128;if(o>=s)o-=Math.pow(2,8*r);return o};c.prototype.readInt8=function t(e,r){e=e>>>0;if(!r)j(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};c.prototype.readInt16LE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);var i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};c.prototype.readInt16BE=function t(e,r){e=e>>>0;if(!r)j(e,2,this.length);var i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};c.prototype.readInt32LE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};c.prototype.readInt32BE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};c.prototype.readFloatLE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return s.read(this,e,true,23,4)};c.prototype.readFloatBE=function t(e,r){e=e>>>0;if(!r)j(e,4,this.length);return s.read(this,e,false,23,4)};c.prototype.readDoubleLE=function t(e,r){e=e>>>0;if(!r)j(e,8,this.length);return s.read(this,e,true,52,8)};c.prototype.readDoubleBE=function t(e,r){e=e>>>0;if(!r)j(e,8,this.length);return s.read(this,e,false,52,8)};function L(t,e,r,i,n,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}c.prototype.writeUIntLE=function t(e,r,i,n){e=+e;r=r>>>0;i=i>>>0;if(!n){var s=Math.pow(2,8*i)-1;L(this,e,r,i,s,0)}var o=1;var a=0;this[r]=e&255;while(++a<i&&(o*=256)){this[r+a]=e/o&255}return r+i};c.prototype.writeUIntBE=function t(e,r,i,n){e=+e;r=r>>>0;i=i>>>0;if(!n){var s=Math.pow(2,8*i)-1;L(this,e,r,i,s,0)}var o=i-1;var a=1;this[r+o]=e&255;while(--o>=0&&(a*=256)){this[r+o]=e/a&255}return r+i};c.prototype.writeUInt8=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,1,255,0);this[r]=e&255;return r+1};c.prototype.writeUInt16LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,65535,0);this[r]=e&255;this[r+1]=e>>>8;return r+2};c.prototype.writeUInt16BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,65535,0);this[r]=e>>>8;this[r+1]=e&255;return r+2};c.prototype.writeUInt32LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,4294967295,0);this[r+3]=e>>>24;this[r+2]=e>>>16;this[r+1]=e>>>8;this[r]=e&255;return r+4};c.prototype.writeUInt32BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,4294967295,0);this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255;return r+4};c.prototype.writeIntLE=function t(e,r,i,n){e=+e;r=r>>>0;if(!n){var s=Math.pow(2,8*i-1);L(this,e,r,i,s-1,-s)}var o=0;var a=1;var u=0;this[r]=e&255;while(++o<i&&(a*=256)){if(e<0&&u===0&&this[r+o-1]!==0){u=1}this[r+o]=(e/a>>0)-u&255}return r+i};c.prototype.writeIntBE=function t(e,r,i,n){e=+e;r=r>>>0;if(!n){var s=Math.pow(2,8*i-1);L(this,e,r,i,s-1,-s)}var o=i-1;var a=1;var u=0;this[r+o]=e&255;while(--o>=0&&(a*=256)){if(e<0&&u===0&&this[r+o+1]!==0){u=1}this[r+o]=(e/a>>0)-u&255}return r+i};c.prototype.writeInt8=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,1,127,-128);if(e<0)e=255+e+1;this[r]=e&255;return r+1};c.prototype.writeInt16LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,32767,-32768);this[r]=e&255;this[r+1]=e>>>8;return r+2};c.prototype.writeInt16BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,2,32767,-32768);this[r]=e>>>8;this[r+1]=e&255;return r+2};c.prototype.writeInt32LE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,2147483647,-2147483648);this[r]=e&255;this[r+1]=e>>>8;this[r+2]=e>>>16;this[r+3]=e>>>24;return r+4};c.prototype.writeInt32BE=function t(e,r,i){e=+e;r=r>>>0;if(!i)L(this,e,r,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255;return r+4};function D(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,i,n){e=+e;r=r>>>0;if(!n){D(t,e,r,4,34028234663852886e22,-34028234663852886e22)}s.write(t,e,r,i,23,4);return r+4}c.prototype.writeFloatLE=function t(e,r,i){return F(this,e,r,true,i)};c.prototype.writeFloatBE=function t(e,r,i){return F(this,e,r,false,i)};function W(t,e,r,i,n){e=+e;r=r>>>0;if(!n){D(t,e,r,8,17976931348623157e292,-17976931348623157e292)}s.write(t,e,r,i,52,8);return r+8}c.prototype.writeDoubleLE=function t(e,r,i){return W(this,e,r,true,i)};c.prototype.writeDoubleBE=function t(e,r,i){return W(this,e,r,false,i)};c.prototype.copy=function t(e,r,i,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(!i)i=0;if(!n&&n!==0)n=this.length;if(r>=e.length)r=e.length;if(!r)r=0;if(n>0&&n<i)n=i;if(n===i)return 0;if(e.length===0||this.length===0)return 0;if(r<0){throw new RangeError("targetStart out of bounds")}if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-r<n-i){n=e.length-r+i}var s=n-i;if(this===e&&typeof Uint8Array.prototype.copyWithin==="function"){this.copyWithin(r,i,n)}else if(this===e&&i<r&&r<n){for(var o=s-1;o>=0;--o){e[o+r]=this[o+i]}}else{Uint8Array.prototype.set.call(e,this.subarray(i,n),r)}return s};c.prototype.fill=function t(e,r,i,n){if(typeof e==="string"){if(typeof r==="string"){n=r;r=0;i=this.length}else if(typeof i==="string"){n=i;i=this.length}if(n!==undefined&&typeof n!=="string"){throw new TypeError("encoding must be a string")}if(typeof n==="string"&&!c.isEncoding(n)){throw new TypeError("Unknown encoding: "+n)}if(e.length===1){var s=e.charCodeAt(0);if(n==="utf8"&&s<128||n==="latin1"){e=s}}}else if(typeof e==="number"){e=e&255}if(r<0||this.length<r||this.length<i){throw new RangeError("Out of range index")}if(i<=r){return this}r=r>>>0;i=i===undefined?this.length:i>>>0;if(!e)e=0;var o;if(typeof e==="number"){for(o=r;o<i;++o){this[o]=e}}else{var a=c.isBuffer(e)?e:c.from(e,n);var u=a.length;if(u===0){throw new TypeError('The value "'+e+'" is invalid for argument "value"')}for(o=0;o<i-r;++o){this[o+r]=a[o%u]}}return this};var H=/[^+/0-9A-Za-z-_]/g;function N(t){t=t.split("=")[0];t=t.trim().replace(H,"");if(t.length<2)return"";while(t.length%4!==0){t=t+"="}return t}function U(t){if(t<16)return"0"+t.toString(16);return t.toString(16)}function z(t,e){e=e||Infinity;var r;var i=t.length;var n=null;var s=[];for(var o=0;o<i;++o){r=t.charCodeAt(o);if(r>55295&&r<57344){if(!n){if(r>56319){if((e-=3)>-1)s.push(239,191,189);continue}else if(o+1===i){if((e-=3)>-1)s.push(239,191,189);continue}n=r;continue}if(r<56320){if((e-=3)>-1)s.push(239,191,189);n=r;continue}r=(n-55296<<10|r-56320)+65536}else if(n){if((e-=3)>-1)s.push(239,191,189)}n=null;if(r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return s}function Y(t){var e=[];for(var r=0;r<t.length;++r){e.push(t.charCodeAt(r)&255)}return e}function V(t,e){var r,i,n;var s=[];for(var o=0;o<t.length;++o){if((e-=2)<0)break;r=t.charCodeAt(o);i=r>>8;n=r%256;s.push(n);s.push(i)}return s}function G(t){return i.toByteArray(N(t))}function Z(t,e,r,i){for(var n=0;n<i;++n){if(n+r>=e.length||n>=t.length)break;e[n+r]=t[n]}return n}function K(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function X(t){return t!==t}}).call(this)}).call(this,q("buffer").Buffer)},{"base64-js":143,buffer:147,ieee754:159}],148:[function(t,e,r){"use strict";var n=t("get-intrinsic");var s=t("./");var o=s(n("String.prototype.indexOf"));e.exports=function t(e,r){var i=n(e,!!r);if(typeof i==="function"&&o(e,".prototype.")>-1){return s(i)}return i}},{"./":149,"get-intrinsic":155}],149:[function(t,e,r){"use strict";var n=t("function-bind");var i=t("get-intrinsic");var s=i("%Function.prototype.apply%");var o=i("%Function.prototype.call%");var a=i("%Reflect.apply%",true)||n.call(o,s);var u=i("%Object.getOwnPropertyDescriptor%",true);var l=i("%Object.defineProperty%",true);var f=i("%Math.max%");if(l){try{l({},"a",{value:1})}catch(t){l=null}}e.exports=function t(e){var r=a(n,o,arguments);if(u&&l){var i=u(r,"length");if(i.configurable){l(r,"length",{value:1+f(0,e.length-(arguments.length-1))})}}return r};var h=function t(){return a(n,s,arguments)};if(l){l(e.exports,"apply",{value:h})}else{e.exports.apply=h}},{"function-bind":154,"get-intrinsic":155}],150:[function(t,e,r){"use strict";var i=t("get-intrinsic");var n=i("%Object.getOwnPropertyDescriptor%");if(n){try{n([],"length")}catch(t){n=null}}e.exports=n},{"get-intrinsic":155}],151:[function(t,e,r){"use strict";var i=typeof Reflect==="object"?Reflect:null;var h=i&&typeof i.apply==="function"?i.apply:function t(e,r,i){return Function.prototype.apply.call(e,r,i)};var n;if(i&&typeof i.ownKeys==="function"){n=i.ownKeys}else if(Object.getOwnPropertySymbols){n=function t(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}}else{n=function t(e){return Object.getOwnPropertyNames(e)}}function u(t){if(console&&console.warn)console.warn(t)}var s=Number.isNaN||function t(e){return e!==e};function o(){o.init.call(this)}e.exports=o;e.exports.once=w;o.EventEmitter=o;o.prototype._events=undefined;o.prototype._eventsCount=0;o.prototype._maxListeners=undefined;var a=10;function l(t){if(typeof t!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:true,get:function(){return a},set:function(t){if(typeof t!=="number"||t<0||s(t)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".")}a=t}});o.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};o.prototype.setMaxListeners=function t(e){if(typeof e!=="number"||e<0||s(e)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".")}this._maxListeners=e;return this};function f(t){if(t._maxListeners===undefined)return o.defaultMaxListeners;return t._maxListeners}o.prototype.getMaxListeners=function t(){return f(this)};o.prototype.emit=function t(e){var r=[];for(var i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error";var s=this._events;if(s!==undefined)n=n&&s.error===undefined;else if(!n)return false;if(n){var o;if(r.length>0)o=r[0];if(o instanceof Error){throw o}var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));a.context=o;throw a}var u=s[e];if(u===undefined)return false;if(typeof u==="function"){h(u,this,r)}else{var l=u.length;var f=b(u,l);for(var i=0;i<l;++i)h(f[i],this,r)}return true};function c(t,e,r,i){var n;var s;var o;l(r);s=t._events;if(s===undefined){s=t._events=Object.create(null);t._eventsCount=0}else{if(s.newListener!==undefined){t.emit("newListener",e,r.listener?r.listener:r);s=t._events}o=s[e]}if(o===undefined){o=s[e]=r;++t._eventsCount}else{if(typeof o==="function"){o=s[e]=i?[r,o]:[o,r]}else if(i){o.unshift(r)}else{o.push(r)}n=f(t);if(n>0&&o.length>n&&!o.warned){o.warned=true;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");a.name="MaxListenersExceededWarning";a.emitter=t;a.type=e;a.count=o.length;u(a)}}return t}o.prototype.addListener=function t(e,r){return c(this,e,r,false)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function t(e,r){return c(this,e,r,true)};function d(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function p(t,e,r){var i={fired:false,wrapFn:undefined,target:t,type:e,listener:r};var n=d.bind(i);n.listener=r;i.wrapFn=n;return n}o.prototype.once=function t(e,r){l(r);this.on(e,p(this,e,r));return this};o.prototype.prependOnceListener=function t(e,r){l(r);this.prependListener(e,p(this,e,r));return this};o.prototype.removeListener=function t(e,r){var i,n,s,o,a;l(r);n=this._events;if(n===undefined)return this;i=n[e];if(i===undefined)return this;if(i===r||i.listener===r){if(--this._eventsCount===0)this._events=Object.create(null);else{delete n[e];if(n.removeListener)this.emit("removeListener",e,i.listener||r)}}else if(typeof i!=="function"){s=-1;for(o=i.length-1;o>=0;o--){if(i[o]===r||i[o].listener===r){a=i[o].listener;s=o;break}}if(s<0)return this;if(s===0)i.shift();else{m(i,s)}if(i.length===1)n[e]=i[0];if(n.removeListener!==undefined)this.emit("removeListener",e,a||r)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function t(e){var r,i,n;i=this._events;if(i===undefined)return this;if(i.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(i[e]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete i[e]}return this}if(arguments.length===0){var s=Object.keys(i);var o;for(n=0;n<s.length;++n){o=s[n];if(o==="removeListener")continue;this.removeAllListeners(o)}this.removeAllListeners("removeListener");this._events=Object.create(null);this._eventsCount=0;return this}r=i[e];if(typeof r==="function"){this.removeListener(e,r)}else if(r!==undefined){for(n=r.length-1;n>=0;n--){this.removeListener(e,r[n])}}return this};function g(t,e,r){var i=t._events;if(i===undefined)return[];var n=i[e];if(n===undefined)return[];if(typeof n==="function")return r?[n.listener||n]:[n];return r?v(n):b(n,n.length)}o.prototype.listeners=function t(e){return g(this,e,true)};o.prototype.rawListeners=function t(e){return g(this,e,false)};o.listenerCount=function(t,e){if(typeof t.listenerCount==="function"){return t.listenerCount(e)}else{return y.call(t,e)}};o.prototype.listenerCount=y;function y(t){var e=this._events;if(e!==undefined){var r=e[t];if(typeof r==="function"){return 1}else if(r!==undefined){return r.length}}return 0}o.prototype.eventNames=function t(){return this._eventsCount>0?n(this._events):[]};function b(t,e){var r=new Array(e);for(var i=0;i<e;++i)r[i]=t[i];return r}function m(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function v(t){var e=new Array(t.length);for(var r=0;r<e.length;++r){e[r]=t[r].listener||t[r]}return e}function w(n,s){return new Promise(function(t,r){function i(){if(e!==undefined){n.removeListener("error",e)}t([].slice.call(arguments))}var e;if(s!=="error"){e=function t(e){n.removeListener(s,i);r(e)};n.once("error",e)}n.once(s,i)})}},{}],152:[function(t,e,r){var a=Object.prototype.hasOwnProperty;var u=Object.prototype.toString;e.exports=function t(e,r,i){if(u.call(r)!=="[object Function]"){throw new TypeError("iterator must be a function")}var n=e.length;if(n===+n){for(var s=0;s<n;s++){r.call(i,e[s],s,e)}}else{for(var o in e){if(a.call(e,o)){r.call(i,e[o],o,e)}}}}},{}],153:[function(t,e,r){"use strict";var f="Function.prototype.bind called on incompatible ";var h=Array.prototype.slice;var c=Object.prototype.toString;var d="[object Function]";e.exports=function t(e){var r=this;if(typeof r!=="function"||c.call(r)!==d){throw new TypeError(f+r)}var i=h.call(arguments,1);var n;var s=function(){if(this instanceof n){var t=r.apply(this,i.concat(h.call(arguments)));if(Object(t)===t){return t}return this}else{return r.apply(e,i.concat(h.call(arguments)))}};var o=Math.max(0,r.length-i.length);var a=[];for(var u=0;u<o;u++){a.push("$"+u)}n=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(s);if(r.prototype){var l=function t(){};l.prototype=r.prototype;n.prototype=new l;l.prototype=null}return n}},{}],154:[function(t,e,r){"use strict";var i=t("./implementation");e.exports=Function.prototype.bind||i},{"./implementation":153}],155:[function(t,e,r){"use strict";var y;var b=SyntaxError;var i=Function;var m=TypeError;var s=function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}};var v=Object.getOwnPropertyDescriptor;if(v){try{v({},"")}catch(t){v=null}}var n=function(){throw new m};var o=v?function(){try{arguments.callee;return n}catch(t){try{return v(arguments,"callee").get}catch(t){return n}}}():n;var a=t("has-symbols")();var u=Object.getPrototypeOf||function(t){return t.__proto__};var l={};var f=typeof Uint8Array==="undefined"?y:u(Uint8Array);var w={"%AggregateError%":typeof AggregateError==="undefined"?y:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer==="undefined"?y:ArrayBuffer,"%ArrayIteratorPrototype%":a?u([][Symbol.iterator]()):y,"%AsyncFromSyncIteratorPrototype%":y,"%AsyncFunction%":l,"%AsyncGenerator%":l,"%AsyncGeneratorFunction%":l,"%AsyncIteratorPrototype%":l,"%Atomics%":typeof Atomics==="undefined"?y:Atomics,"%BigInt%":typeof BigInt==="undefined"?y:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView==="undefined"?y:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array==="undefined"?y:Float32Array,"%Float64Array%":typeof Float64Array==="undefined"?y:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry==="undefined"?y:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":l,"%Int8Array%":typeof Int8Array==="undefined"?y:Int8Array,"%Int16Array%":typeof Int16Array==="undefined"?y:Int16Array,"%Int32Array%":typeof Int32Array==="undefined"?y:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":a?u(u([][Symbol.iterator]())):y,"%JSON%":typeof JSON==="object"?JSON:y,"%Map%":typeof Map==="undefined"?y:Map,"%MapIteratorPrototype%":typeof Map==="undefined"||!a?y:u((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise==="undefined"?y:Promise,"%Proxy%":typeof Proxy==="undefined"?y:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect==="undefined"?y:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set==="undefined"?y:Set,"%SetIteratorPrototype%":typeof Set==="undefined"||!a?y:u((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer==="undefined"?y:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":a?u(""[Symbol.iterator]()):y,"%Symbol%":a?Symbol:y,"%SyntaxError%":b,"%ThrowTypeError%":o,"%TypedArray%":f,"%TypeError%":m,"%Uint8Array%":typeof Uint8Array==="undefined"?y:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray==="undefined"?y:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array==="undefined"?y:Uint16Array,"%Uint32Array%":typeof Uint32Array==="undefined"?y:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap==="undefined"?y:WeakMap,"%WeakRef%":typeof WeakRef==="undefined"?y:WeakRef,"%WeakSet%":typeof WeakSet==="undefined"?y:WeakSet};var h=function t(e){var r;if(e==="%AsyncFunction%"){r=s("async function () {}")}else if(e==="%GeneratorFunction%"){r=s("function* () {}")}else if(e==="%AsyncGeneratorFunction%"){r=s("async function* () {}")}else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");if(i){r=i.prototype}}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");if(n){r=u(n.prototype)}}w[e]=r;return r};var c={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]};var d=t("function-bind");var _=t("has");var x=d.call(Function.call,Array.prototype.concat);var C=d.call(Function.apply,Array.prototype.splice);var p=d.call(Function.call,String.prototype.replace);var k=d.call(Function.call,String.prototype.slice);var g=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;var T=/\\(\\)?/g;var S=function t(e){var r=k(e,0,1);var i=k(e,-1);if(r==="%"&&i!=="%"){throw new b("invalid intrinsic syntax, expected closing `%`")}else if(i==="%"&&r!=="%"){throw new b("invalid intrinsic syntax, expected opening `%`")}var n=[];p(e,g,function(t,e,r,i){n[n.length]=r?p(i,T,"$1"):e||t});return n};var E=function t(e,r){var i=e;var n;if(_(c,i)){n=c[i];i="%"+n[0]+"%"}if(_(w,i)){var s=w[i];if(s===l){s=h(i)}if(typeof s==="undefined"&&!r){throw new m("intrinsic "+e+" exists, but is not available. Please file an issue!")}return{alias:n,name:i,value:s}}throw new b("intrinsic "+e+" does not exist!")};e.exports=function t(e,r){if(typeof e!=="string"||e.length===0){throw new m("intrinsic name must be a non-empty string")}if(arguments.length>1&&typeof r!=="boolean"){throw new m('"allowMissing" argument must be a boolean')}var i=S(e);var n=i.length>0?i[0]:"";var s=E("%"+n+"%",r);var o=s.name;var a=s.value;var u=false;var l=s.alias;if(l){n=l[0];C(i,x([0,1],l))}for(var f=1,h=true;f<i.length;f+=1){var c=i[f];var d=k(c,0,1);var p=k(c,-1);if((d==='"'||d==="'"||d==="`"||(p==='"'||p==="'"||p==="`"))&&d!==p){throw new b("property names with quotes must have matching quotes")}if(c==="constructor"||!h){u=true}n+="."+c;o="%"+n+"%";if(_(w,o)){a=w[o]}else if(a!=null){if(!(c in a)){if(!r){throw new m("base intrinsic for "+e+" exists, but the property is not available.")}return void y}if(v&&f+1>=i.length){var g=v(a,c);h=!!g;if(h&&"get"in g&&!("originalValue"in g.get)){a=g.get}else{a=a[c]}}else{h=_(a,c);a=a[c]}if(h&&!u){w[o]=a}}}return a}},{"function-bind":154,has:158,"has-symbols":156}],156:[function(i,n,t){(function(t){(function(){"use strict";var e=t.Symbol;var r=i("./shams");n.exports=function t(){if(typeof e!=="function"){return false}if(typeof Symbol!=="function"){return false}if(typeof e("foo")!=="symbol"){return false}if(typeof Symbol("bar")!=="symbol"){return false}return r()}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./shams":157}],157:[function(t,e,r){"use strict";e.exports=function t(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function"){return false}if(typeof Symbol.iterator==="symbol"){return true}var e={};var r=Symbol("test");var i=Object(r);if(typeof r==="string"){return false}if(Object.prototype.toString.call(r)!=="[object Symbol]"){return false}if(Object.prototype.toString.call(i)!=="[object Symbol]"){return false}var n=42;e[r]=n;for(r in e){return false}if(typeof Object.keys==="function"&&Object.keys(e).length!==0){return false}if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(e).length!==0){return false}var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r){return false}if(!Object.prototype.propertyIsEnumerable.call(e,r)){return false}if(typeof Object.getOwnPropertyDescriptor==="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==n||o.enumerable!==true){return false}}return true}},{}],158:[function(t,e,r){"use strict";var i=t("function-bind");e.exports=i.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":154}],159:[function(t,e,r){r.read=function(t,e,r,i,n){var s,o;var a=n*8-i-1;var u=(1<<a)-1;var l=u>>1;var f=-7;var h=r?n-1:0;var c=r?-1:1;var d=t[e+h];h+=c;s=d&(1<<-f)-1;d>>=-f;f+=a;for(;f>0;s=s*256+t[e+h],h+=c,f-=8){}o=s&(1<<-f)-1;s>>=-f;f+=i;for(;f>0;o=o*256+t[e+h],h+=c,f-=8){}if(s===0){s=1-l}else if(s===u){return o?NaN:(d?-1:1)*Infinity}else{o=o+Math.pow(2,i);s=s-l}return(d?-1:1)*o*Math.pow(2,s-i)};r.write=function(t,e,r,i,n,s){var o,a,u;var l=s*8-n-1;var f=(1<<l)-1;var h=f>>1;var c=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:s-1;var p=i?1:-1;var g=e<0||e===0&&1/e<0?1:0;e=Math.abs(e);if(isNaN(e)||e===Infinity){a=isNaN(e)?1:0;o=f}else{o=Math.floor(Math.log(e)/Math.LN2);if(e*(u=Math.pow(2,-o))<1){o--;u*=2}if(o+h>=1){e+=c/u}else{e+=c*Math.pow(2,1-h)}if(e*u>=2){o++;u/=2}if(o+h>=f){a=0;o=f}else if(o+h>=1){a=(e*u-1)*Math.pow(2,n);o=o+h}else{a=e*Math.pow(2,h-1)*Math.pow(2,n);o=0}}for(;n>=8;t[r+d]=a&255,d+=p,a/=256,n-=8){}o=o<<n|a;l+=n;for(;l>0;t[r+d]=o&255,d+=p,o/=256,l-=8){}t[r+d-p]|=g*128}},{}],160:[function(t,e,r){if(typeof Object.create==="function"){e.exports=function t(e,r){if(r){e.super_=r;e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function t(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype;e.prototype=new i;e.prototype.constructor=e}}}},{}],161:[function(t,e,r){"use strict";var i=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var n=t("call-bind/callBound");var s=n("Object.prototype.toString");var o=function t(e){if(i&&e&&typeof e==="object"&&Symbol.toStringTag in e){return false}return s(e)==="[object Arguments]"};var a=function t(e){if(o(e)){return true}return e!==null&&typeof e==="object"&&typeof e.length==="number"&&e.length>=0&&s(e)!=="[object Array]"&&s(e.callee)==="[object Function]"};var u=function(){return o(arguments)}();o.isLegacyArguments=a;e.exports=u?o:a},{"call-bind/callBound":148}],162:[function(t,e,r){arguments[4][64][0].apply(r,arguments)},{dup:64}],163:[function(t,e,r){"use strict";var i=Object.prototype.toString;var n=Function.prototype.toString;var s=/^\s*(?:function)?\*/;var o=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var a=Object.getPrototypeOf;var u=function(){if(!o){return false}try{return Function("return function*() {}")()}catch(t){}};var l=u();var f=a&&l?a(l):false;e.exports=function t(e){if(typeof e!=="function"){return false}if(s.test(n.call(e))){return true}if(!o){var r=i.call(e);return r==="[object GeneratorFunction]"}return a&&a(e)===f}},{}],164:[function(p,g,t){(function(d){(function(){"use strict";var e=p("foreach");var t=p("available-typed-arrays");var r=p("call-bind/callBound");var i=r("Object.prototype.toString");var n=p("has-symbols")();var s=n&&typeof Symbol.toStringTag==="symbol";var o=t();var a=r("Array.prototype.indexOf",true)||function t(e,r){for(var i=0;i<e.length;i+=1){if(e[i]===r){return i}}return-1};var u=r("String.prototype.slice");var l={};var f=p("es-abstract/helpers/getOwnPropertyDescriptor");var h=Object.getPrototypeOf;if(s&&f&&h){e(o,function(t){var e=new d[t];if(!(Symbol.toStringTag in e)){throw new EvalError("this engine has support for Symbol.toStringTag, but "+t+" does not have the property! Please report this.")}var r=h(e);var i=f(r,Symbol.toStringTag);if(!i){var n=h(r);i=f(n,Symbol.toStringTag)}l[t]=i.get})}var c=function t(r){var i=false;e(l,function(t,e){if(!i){try{i=t.call(r)===e}catch(t){}}});return i};g.exports=function t(e){if(!e||typeof e!=="object"){return false}if(!s){var r=u(i(e),8,-1);return a(o,r)>-1}if(!f){return false}return c(e)}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"available-typed-arrays":142,"call-bind/callBound":148,"es-abstract/helpers/getOwnPropertyDescriptor":150,foreach:152,"has-symbols":156}],165:[function(t,e,r){"use strict";var u=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty;var f=Object.prototype.propertyIsEnumerable;function h(t){if(t===null||t===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(t)}function i(){try{if(!Object.assign){return false}var t=new String("abc");t[5]="de";if(Object.getOwnPropertyNames(t)[0]==="5"){return false}var e={};for(var r=0;r<10;r++){e["_"+String.fromCharCode(r)]=r}var i=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if(i.join("")!=="0123456789"){return false}var n={};"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t});if(Object.keys(Object.assign({},n)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(t){return false}}e.exports=i()?Object.assign:function(t,e){var r;var i=h(t);var n;for(var s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var o in r){if(l.call(r,o)){i[o]=r[o]}}if(u){n=u(r);for(var a=0;a<n.length;a++){if(f.call(r,n[a])){i[n[a]]=r[n[a]]}}}}return i}},{}],166:[function(t,e,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n";r.homedir=function(){return"/"}},{}],167:[function(t,e,r){"use strict";var i=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.assign=function(t){var e=Array.prototype.slice.call(arguments,1);while(e.length){var r=e.shift();if(!r){continue}if(typeof r!=="object"){throw new TypeError(r+"must be non-object")}for(var i in r){if(n(r,i)){t[i]=r[i]}}}return t};r.shrinkBuf=function(t,e){if(t.length===e){return t}if(t.subarray){return t.subarray(0,e)}t.length=e;return t};var s={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var s=0;s<i;s++){t[n+s]=e[r+s]}},flattenChunks:function(t){var e,r,i,n,s,o;i=0;for(e=0,r=t.length;e<r;e++){i+=t[e].length}o=new Uint8Array(i);n=0;for(e=0,r=t.length;e<r;e++){s=t[e];o.set(s,n);n+=s.length}return o}};var o={arraySet:function(t,e,r,i,n){for(var s=0;s<i;s++){t[n+s]=e[r+s]}},flattenChunks:function(t){return[].concat.apply([],t)}};r.setTyped=function(t){if(t){r.Buf8=Uint8Array;r.Buf16=Uint16Array;r.Buf32=Int32Array;r.assign(r,s)}else{r.Buf8=Array;r.Buf16=Array;r.Buf32=Array;r.assign(r,o)}};r.setTyped(i)},{}],168:[function(t,e,r){"use strict";function i(t,e,r,i){var n=t&65535|0,s=t>>>16&65535|0,o=0;while(r!==0){o=r>2e3?2e3:r;r-=o;do{n=n+e[i++]|0;s=s+n|0}while(--o);n%=65521;s%=65521}return n|s<<16|0}e.exports=i},{}],169:[function(t,e,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],170:[function(t,e,r){"use strict";function i(){var t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++){t=t&1?3988292384^t>>>1:t>>>1}e[r]=t}return e}var a=i();function n(t,e,r,i){var n=a,s=i+r;t^=-1;for(var o=i;o<s;o++){t=t>>>8^n[(t^e[o])&255]}return t^-1}e.exports=n},{}],171:[function(t,e,r){"use strict";var h=t("../utils/common");var l=t("./trees");var c=t("./adler32");var f=t("./crc32");var i=t("./messages");var d=0;var p=1;var g=3;var y=4;var b=5;var m=0;var v=1;var w=-2;var n=-3;var _=-5;var u=-1;var s=1;var x=2;var C=3;var k=4;var o=0;var a=2;var T=8;var S=9;var E=15;var A=8;var R=29;var B=256;var O=B+1+R;var P=30;var I=19;var M=2*O+1;var j=15;var L=3;var D=258;var F=D+L+1;var W=32;var H=42;var N=69;var U=73;var z=91;var Y=103;var V=113;var G=666;var Z=1;var K=2;var X=3;var q=4;var J=3;function $(t,e){t.msg=i[e];return e}function Q(t){return(t<<1)-(t>4?9:0)}function tt(t){var e=t.length;while(--e>=0){t[e]=0}}function et(t){var e=t.state;var r=e.pending;if(r>t.avail_out){r=t.avail_out}if(r===0){return}h.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out);t.next_out+=r;e.pending_out+=r;t.total_out+=r;t.avail_out-=r;e.pending-=r;if(e.pending===0){e.pending_out=0}}function rt(t,e){l._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e);t.block_start=t.strstart;et(t.strm)}function it(t,e){t.pending_buf[t.pending++]=e}function nt(t,e){t.pending_buf[t.pending++]=e>>>8&255;t.pending_buf[t.pending++]=e&255}function st(t,e,r,i){var n=t.avail_in;if(n>i){n=i}if(n===0){return 0}t.avail_in-=n;h.arraySet(e,t.input,t.next_in,n,r);if(t.state.wrap===1){t.adler=c(t.adler,e,n,r)}else if(t.state.wrap===2){t.adler=f(t.adler,e,n,r)}t.next_in+=n;t.total_in+=n;return n}function ot(t,e){var r=t.max_chain_length;var i=t.strstart;var n;var s;var o=t.prev_length;var a=t.nice_match;var u=t.strstart>t.w_size-F?t.strstart-(t.w_size-F):0;var l=t.window;var f=t.w_mask;var h=t.prev;var c=t.strstart+D;var d=l[i+o-1];var p=l[i+o];if(t.prev_length>=t.good_match){r>>=2}if(a>t.lookahead){a=t.lookahead}do{n=e;if(l[n+o]!==p||l[n+o-1]!==d||l[n]!==l[i]||l[++n]!==l[i+1]){continue}i+=2;n++;do{}while(l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&i<c);s=D-(c-i);i=c-D;if(s>o){t.match_start=e;o=s;if(s>=a){break}d=l[i+o-1];p=l[i+o]}}while((e=h[e&f])>u&&--r!==0);if(o<=t.lookahead){return o}return t.lookahead}function at(t){var e=t.w_size;var r,i,n,s,o;do{s=t.window_size-t.lookahead-t.strstart;if(t.strstart>=e+(e-F)){h.arraySet(t.window,t.window,e,e,0);t.match_start-=e;t.strstart-=e;t.block_start-=e;i=t.hash_size;r=i;do{n=t.head[--r];t.head[r]=n>=e?n-e:0}while(--i);i=e;r=i;do{n=t.prev[--r];t.prev[r]=n>=e?n-e:0}while(--i);s+=e}if(t.strm.avail_in===0){break}i=st(t.strm,t.window,t.strstart+t.lookahead,s);t.lookahead+=i;if(t.lookahead+t.insert>=L){o=t.strstart-t.insert;t.ins_h=t.window[o];t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;while(t.insert){t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+L-1])&t.hash_mask;t.prev[o&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=o;o++;t.insert--;if(t.lookahead+t.insert<L){break}}}}while(t.lookahead<F&&t.strm.avail_in!==0)}function ut(t,e){var r=65535;if(r>t.pending_buf_size-5){r=t.pending_buf_size-5}for(;;){if(t.lookahead<=1){at(t);if(t.lookahead===0&&e===d){return Z}if(t.lookahead===0){break}}t.strstart+=t.lookahead;t.lookahead=0;var i=t.block_start+r;if(t.strstart===0||t.strstart>=i){t.lookahead=t.strstart-i;t.strstart=i;rt(t,false);if(t.strm.avail_out===0){return Z}}if(t.strstart-t.block_start>=t.w_size-F){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=0;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.strstart>t.block_start){rt(t,false);if(t.strm.avail_out===0){return Z}}return Z}function lt(t,e){var r;var i;for(;;){if(t.lookahead<F){at(t);if(t.lookahead<F&&e===d){return Z}if(t.lookahead===0){break}}r=0;if(t.lookahead>=L){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+L-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}if(r!==0&&t.strstart-r<=t.w_size-F){t.match_length=ot(t,r)}if(t.match_length>=L){i=l._tr_tally(t,t.strstart-t.match_start,t.match_length-L);t.lookahead-=t.match_length;if(t.match_length<=t.max_lazy_match&&t.lookahead>=L){t.match_length--;do{t.strstart++;t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+L-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}while(--t.match_length!==0);t.strstart++}else{t.strstart+=t.match_length;t.match_length=0;t.ins_h=t.window[t.strstart];t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask}}else{i=l._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(i){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=t.strstart<L-1?t.strstart:L-1;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.last_lit){rt(t,false);if(t.strm.avail_out===0){return Z}}return K}function ft(t,e){var r;var i;var n;for(;;){if(t.lookahead<F){at(t);if(t.lookahead<F&&e===d){return Z}if(t.lookahead===0){break}}r=0;if(t.lookahead>=L){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+L-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}t.prev_length=t.match_length;t.prev_match=t.match_start;t.match_length=L-1;if(r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-F){t.match_length=ot(t,r);if(t.match_length<=5&&(t.strategy===s||t.match_length===L&&t.strstart-t.match_start>4096)){t.match_length=L-1}}if(t.prev_length>=L&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-L;i=l._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-L);t.lookahead-=t.prev_length-1;t.prev_length-=2;do{if(++t.strstart<=n){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+L-1])&t.hash_mask;r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}}while(--t.prev_length!==0);t.match_available=0;t.match_length=L-1;t.strstart++;if(i){rt(t,false);if(t.strm.avail_out===0){return Z}}}else if(t.match_available){i=l._tr_tally(t,0,t.window[t.strstart-1]);if(i){rt(t,false)}t.strstart++;t.lookahead--;if(t.strm.avail_out===0){return Z}}else{t.match_available=1;t.strstart++;t.lookahead--}}if(t.match_available){i=l._tr_tally(t,0,t.window[t.strstart-1]);t.match_available=0}t.insert=t.strstart<L-1?t.strstart:L-1;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.last_lit){rt(t,false);if(t.strm.avail_out===0){return Z}}return K}function ht(t,e){var r;var i;var n,s;var o=t.window;for(;;){if(t.lookahead<=D){at(t);if(t.lookahead<=D&&e===d){return Z}if(t.lookahead===0){break}}t.match_length=0;if(t.lookahead>=L&&t.strstart>0){n=t.strstart-1;i=o[n];if(i===o[++n]&&i===o[++n]&&i===o[++n]){s=t.strstart+D;do{}while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&n<s);t.match_length=D-(s-n);if(t.match_length>t.lookahead){t.match_length=t.lookahead}}}if(t.match_length>=L){r=l._tr_tally(t,1,t.match_length-L);t.lookahead-=t.match_length;t.strstart+=t.match_length;t.match_length=0}else{r=l._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(r){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=0;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.last_lit){rt(t,false);if(t.strm.avail_out===0){return Z}}return K}function ct(t,e){var r;for(;;){if(t.lookahead===0){at(t);if(t.lookahead===0){if(e===d){return Z}break}}t.match_length=0;r=l._tr_tally(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++;if(r){rt(t,false);if(t.strm.avail_out===0){return Z}}}t.insert=0;if(e===y){rt(t,true);if(t.strm.avail_out===0){return X}return q}if(t.last_lit){rt(t,false);if(t.strm.avail_out===0){return Z}}return K}function dt(t,e,r,i,n){this.good_length=t;this.max_lazy=e;this.nice_length=r;this.max_chain=i;this.func=n}var pt;pt=[new dt(0,0,0,0,ut),new dt(4,4,8,4,lt),new dt(4,5,16,8,lt),new dt(4,6,32,32,lt),new dt(4,4,16,16,ft),new dt(8,16,32,32,ft),new dt(8,16,128,128,ft),new dt(8,32,128,256,ft),new dt(32,128,258,1024,ft),new dt(32,258,258,4096,ft)];function gt(t){t.window_size=2*t.w_size;tt(t.head);t.max_lazy_match=pt[t.level].max_lazy;t.good_match=pt[t.level].good_length;t.nice_match=pt[t.level].nice_length;t.max_chain_length=pt[t.level].max_chain;t.strstart=0;t.block_start=0;t.lookahead=0;t.insert=0;t.match_length=t.prev_length=L-1;t.match_available=0;t.ins_h=0}function yt(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=T;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new h.Buf16(M*2);this.dyn_dtree=new h.Buf16((2*P+1)*2);this.bl_tree=new h.Buf16((2*I+1)*2);tt(this.dyn_ltree);tt(this.dyn_dtree);tt(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new h.Buf16(j+1);this.heap=new h.Buf16(2*O+1);tt(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new h.Buf16(2*O+1);tt(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function bt(t){var e;if(!t||!t.state){return $(t,w)}t.total_in=t.total_out=0;t.data_type=a;e=t.state;e.pending=0;e.pending_out=0;if(e.wrap<0){e.wrap=-e.wrap}e.status=e.wrap?H:V;t.adler=e.wrap===2?0:1;e.last_flush=d;l._tr_init(e);return m}function mt(t){var e=bt(t);if(e===m){gt(t.state)}return e}function vt(t,e){if(!t||!t.state){return w}if(t.state.wrap!==2){return w}t.state.gzhead=e;return m}function wt(t,e,r,i,n,s){if(!t){return w}var o=1;if(e===u){e=6}if(i<0){o=0;i=-i}else if(i>15){o=2;i-=16}if(n<1||n>S||r!==T||i<8||i>15||e<0||e>9||s<0||s>k){return $(t,w)}if(i===8){i=9}var a=new yt;t.state=a;a.strm=t;a.wrap=o;a.gzhead=null;a.w_bits=i;a.w_size=1<<a.w_bits;a.w_mask=a.w_size-1;a.hash_bits=n+7;a.hash_size=1<<a.hash_bits;a.hash_mask=a.hash_size-1;a.hash_shift=~~((a.hash_bits+L-1)/L);a.window=new h.Buf8(a.w_size*2);a.head=new h.Buf16(a.hash_size);a.prev=new h.Buf16(a.w_size);a.lit_bufsize=1<<n+6;a.pending_buf_size=a.lit_bufsize*4;a.pending_buf=new h.Buf8(a.pending_buf_size);a.d_buf=1*a.lit_bufsize;a.l_buf=(1+2)*a.lit_bufsize;a.level=e;a.strategy=s;a.method=r;return mt(t)}function _t(t,e){return wt(t,e,T,E,A,o)}function xt(t,e){var r,i;var n,s;if(!t||!t.state||e>b||e<0){return t?$(t,w):w}i=t.state;if(!t.output||!t.input&&t.avail_in!==0||i.status===G&&e!==y){return $(t,t.avail_out===0?_:w)}i.strm=t;r=i.last_flush;i.last_flush=e;if(i.status===H){if(i.wrap===2){t.adler=0;it(i,31);it(i,139);it(i,8);if(!i.gzhead){it(i,0);it(i,0);it(i,0);it(i,0);it(i,0);it(i,i.level===9?2:i.strategy>=x||i.level<2?4:0);it(i,J);i.status=V}else{it(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(!i.gzhead.extra?0:4)+(!i.gzhead.name?0:8)+(!i.gzhead.comment?0:16));it(i,i.gzhead.time&255);it(i,i.gzhead.time>>8&255);it(i,i.gzhead.time>>16&255);it(i,i.gzhead.time>>24&255);it(i,i.level===9?2:i.strategy>=x||i.level<2?4:0);it(i,i.gzhead.os&255);if(i.gzhead.extra&&i.gzhead.extra.length){it(i,i.gzhead.extra.length&255);it(i,i.gzhead.extra.length>>8&255)}if(i.gzhead.hcrc){t.adler=f(t.adler,i.pending_buf,i.pending,0)}i.gzindex=0;i.status=N}}else{var o=T+(i.w_bits-8<<4)<<8;var a=-1;if(i.strategy>=x||i.level<2){a=0}else if(i.level<6){a=1}else if(i.level===6){a=2}else{a=3}o|=a<<6;if(i.strstart!==0){o|=W}o+=31-o%31;i.status=V;nt(i,o);if(i.strstart!==0){nt(i,t.adler>>>16);nt(i,t.adler&65535)}t.adler=1}}if(i.status===N){if(i.gzhead.extra){n=i.pending;while(i.gzindex<(i.gzhead.extra.length&65535)){if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}et(t);n=i.pending;if(i.pending===i.pending_buf_size){break}}it(i,i.gzhead.extra[i.gzindex]&255);i.gzindex++}if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(i.gzindex===i.gzhead.extra.length){i.gzindex=0;i.status=U}}else{i.status=U}}if(i.status===U){if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}et(t);n=i.pending;if(i.pending===i.pending_buf_size){s=1;break}}if(i.gzindex<i.gzhead.name.length){s=i.gzhead.name.charCodeAt(i.gzindex++)&255}else{s=0}it(i,s)}while(s!==0);if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(s===0){i.gzindex=0;i.status=z}}else{i.status=z}}if(i.status===z){if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}et(t);n=i.pending;if(i.pending===i.pending_buf_size){s=1;break}}if(i.gzindex<i.gzhead.comment.length){s=i.gzhead.comment.charCodeAt(i.gzindex++)&255}else{s=0}it(i,s)}while(s!==0);if(i.gzhead.hcrc&&i.pending>n){t.adler=f(t.adler,i.pending_buf,i.pending-n,n)}if(s===0){i.status=Y}}else{i.status=Y}}if(i.status===Y){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size){et(t)}if(i.pending+2<=i.pending_buf_size){it(i,t.adler&255);it(i,t.adler>>8&255);t.adler=0;i.status=V}}else{i.status=V}}if(i.pending!==0){et(t);if(t.avail_out===0){i.last_flush=-1;return m}}else if(t.avail_in===0&&Q(e)<=Q(r)&&e!==y){return $(t,_)}if(i.status===G&&t.avail_in!==0){return $(t,_)}if(t.avail_in!==0||i.lookahead!==0||e!==d&&i.status!==G){var u=i.strategy===x?ct(i,e):i.strategy===C?ht(i,e):pt[i.level].func(i,e);if(u===X||u===q){i.status=G}if(u===Z||u===X){if(t.avail_out===0){i.last_flush=-1}return m}if(u===K){if(e===p){l._tr_align(i)}else if(e!==b){l._tr_stored_block(i,0,0,false);if(e===g){tt(i.head);if(i.lookahead===0){i.strstart=0;i.block_start=0;i.insert=0}}}et(t);if(t.avail_out===0){i.last_flush=-1;return m}}}if(e!==y){return m}if(i.wrap<=0){return v}if(i.wrap===2){it(i,t.adler&255);it(i,t.adler>>8&255);it(i,t.adler>>16&255);it(i,t.adler>>24&255);it(i,t.total_in&255);it(i,t.total_in>>8&255);it(i,t.total_in>>16&255);it(i,t.total_in>>24&255)}else{nt(i,t.adler>>>16);nt(i,t.adler&65535)}et(t);if(i.wrap>0){i.wrap=-i.wrap}return i.pending!==0?m:v}function Ct(t){var e;if(!t||!t.state){return w}e=t.state.status;if(e!==H&&e!==N&&e!==U&&e!==z&&e!==Y&&e!==V&&e!==G){return $(t,w)}t.state=null;return e===V?$(t,n):m}function kt(t,e){var r=e.length;var i;var n,s;var o;var a;var u;var l;var f;if(!t||!t.state){return w}i=t.state;o=i.wrap;if(o===2||o===1&&i.status!==H||i.lookahead){return w}if(o===1){t.adler=c(t.adler,e,r,0)}i.wrap=0;if(r>=i.w_size){if(o===0){tt(i.head);i.strstart=0;i.block_start=0;i.insert=0}f=new h.Buf8(i.w_size);h.arraySet(f,e,r-i.w_size,i.w_size,0);e=f;r=i.w_size}a=t.avail_in;u=t.next_in;l=t.input;t.avail_in=r;t.next_in=0;t.input=e;at(i);while(i.lookahead>=L){n=i.strstart;s=i.lookahead-(L-1);do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+L-1])&i.hash_mask;i.prev[n&i.w_mask]=i.head[i.ins_h];i.head[i.ins_h]=n;n++}while(--s);i.strstart=n;i.lookahead=L-1;at(i)}i.strstart+=i.lookahead;i.block_start=i.strstart;i.insert=i.lookahead;i.lookahead=0;i.match_length=i.prev_length=L-1;i.match_available=0;t.next_in=u;t.input=l;t.avail_in=a;i.wrap=o;return m}r.deflateInit=_t;r.deflateInit2=wt;r.deflateReset=mt;r.deflateResetKeep=bt;r.deflateSetHeader=vt;r.deflate=xt;r.deflateEnd=Ct;r.deflateSetDictionary=kt;r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":167,"./adler32":168,"./crc32":170,"./messages":175,"./trees":176}],172:[function(t,e,r){"use strict";var A=30;var R=12;e.exports=function t(e,r){var i;var n;var s;var o;var a;var u;var l;var f;var h;var c;var d;var p;var g;var y;var b;var m;var v;var w;var _;var x;var C;var k;var T;var S,E;i=e.state;n=e.next_in;S=e.input;s=n+(e.avail_in-5);o=e.next_out;E=e.output;a=o-(r-e.avail_out);u=o+(e.avail_out-257);l=i.dmax;f=i.wsize;h=i.whave;c=i.wnext;d=i.window;p=i.hold;g=i.bits;y=i.lencode;b=i.distcode;m=(1<<i.lenbits)-1;v=(1<<i.distbits)-1;t:do{if(g<15){p+=S[n++]<<g;g+=8;p+=S[n++]<<g;g+=8}w=y[p&m];e:for(;;){_=w>>>24;p>>>=_;g-=_;_=w>>>16&255;if(_===0){E[o++]=w&65535}else if(_&16){x=w&65535;_&=15;if(_){if(g<_){p+=S[n++]<<g;g+=8}x+=p&(1<<_)-1;p>>>=_;g-=_}if(g<15){p+=S[n++]<<g;g+=8;p+=S[n++]<<g;g+=8}w=b[p&v];r:for(;;){_=w>>>24;p>>>=_;g-=_;_=w>>>16&255;if(_&16){C=w&65535;_&=15;if(g<_){p+=S[n++]<<g;g+=8;if(g<_){p+=S[n++]<<g;g+=8}}C+=p&(1<<_)-1;if(C>l){e.msg="invalid distance too far back";i.mode=A;break t}p>>>=_;g-=_;_=o-a;if(C>_){_=C-_;if(_>h){if(i.sane){e.msg="invalid distance too far back";i.mode=A;break t}}k=0;T=d;if(c===0){k+=f-_;if(_<x){x-=_;do{E[o++]=d[k++]}while(--_);k=o-C;T=E}}else if(c<_){k+=f+c-_;_-=c;if(_<x){x-=_;do{E[o++]=d[k++]}while(--_);k=0;if(c<x){_=c;x-=_;do{E[o++]=d[k++]}while(--_);k=o-C;T=E}}}else{k+=c-_;if(_<x){x-=_;do{E[o++]=d[k++]}while(--_);k=o-C;T=E}}while(x>2){E[o++]=T[k++];E[o++]=T[k++];E[o++]=T[k++];x-=3}if(x){E[o++]=T[k++];if(x>1){E[o++]=T[k++]}}}else{k=o-C;do{E[o++]=E[k++];E[o++]=E[k++];E[o++]=E[k++];x-=3}while(x>2);if(x){E[o++]=E[k++];if(x>1){E[o++]=E[k++]}}}}else if((_&64)===0){w=b[(w&65535)+(p&(1<<_)-1)];continue r}else{e.msg="invalid distance code";i.mode=A;break t}break}}else if((_&64)===0){w=y[(w&65535)+(p&(1<<_)-1)];continue e}else if(_&32){i.mode=R;break t}else{e.msg="invalid literal/length code";i.mode=A;break t}break}}while(n<s&&o<u);x=g>>3;n-=x;g-=x<<3;p&=(1<<g)-1;e.next_in=n;e.next_out=o;e.avail_in=n<s?5+(s-n):5-(n-s);e.avail_out=o<u?257+(u-o):257-(o-u);i.hold=p;i.bits=g;return}},{}],173:[function(t,e,r){"use strict";var R=t("../utils/common");var B=t("./adler32");var O=t("./crc32");var P=t("./inffast");var I=t("./inftrees");var M=0;var j=1;var L=2;var D=4;var F=5;var W=6;var H=0;var N=1;var U=2;var z=-2;var Y=-3;var V=-4;var G=-5;var Z=8;var K=1;var X=2;var q=3;var J=4;var $=5;var Q=6;var tt=7;var et=8;var rt=9;var it=10;var nt=11;var st=12;var ot=13;var at=14;var ut=15;var lt=16;var ft=17;var ht=18;var ct=19;var dt=20;var pt=21;var gt=22;var yt=23;var bt=24;var mt=25;var vt=26;var wt=27;var _t=28;var xt=29;var Ct=30;var kt=31;var Tt=32;var i=852;var n=592;var s=15;var o=s;function St(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function a(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new R.Buf16(320);this.work=new R.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function u(t){var e;if(!t||!t.state){return z}e=t.state;t.total_in=t.total_out=e.total=0;t.msg="";if(e.wrap){t.adler=e.wrap&1}e.mode=K;e.last=0;e.havedict=0;e.dmax=32768;e.head=null;e.hold=0;e.bits=0;e.lencode=e.lendyn=new R.Buf32(i);e.distcode=e.distdyn=new R.Buf32(n);e.sane=1;e.back=-1;return H}function l(t){var e;if(!t||!t.state){return z}e=t.state;e.wsize=0;e.whave=0;e.wnext=0;return u(t)}function f(t,e){var r;var i;if(!t||!t.state){return z}i=t.state;if(e<0){r=0;e=-e}else{r=(e>>4)+1;if(e<48){e&=15}}if(e&&(e<8||e>15)){return z}if(i.window!==null&&i.wbits!==e){i.window=null}i.wrap=r;i.wbits=e;return l(t)}function h(t,e){var r;var i;if(!t){return z}i=new a;t.state=i;i.window=null;r=f(t,e);if(r!==H){t.state=null}return r}function c(t){return h(t,o)}var d=true;var p,g;function Et(t){if(d){var e;p=new R.Buf32(512);g=new R.Buf32(32);e=0;while(e<144){t.lens[e++]=8}while(e<256){t.lens[e++]=9}while(e<280){t.lens[e++]=7}while(e<288){t.lens[e++]=8}I(j,t.lens,0,288,p,0,t.work,{bits:9});e=0;while(e<32){t.lens[e++]=5}I(L,t.lens,0,32,g,0,t.work,{bits:5});d=false}t.lencode=p;t.lenbits=9;t.distcode=g;t.distbits=5}function At(t,e,r,i){var n;var s=t.state;if(s.window===null){s.wsize=1<<s.wbits;s.wnext=0;s.whave=0;s.window=new R.Buf8(s.wsize)}if(i>=s.wsize){R.arraySet(s.window,e,r-s.wsize,s.wsize,0);s.wnext=0;s.whave=s.wsize}else{n=s.wsize-s.wnext;if(n>i){n=i}R.arraySet(s.window,e,r-i,n,s.wnext);i-=n;if(i){R.arraySet(s.window,e,r-i,i,0);s.wnext=i;s.whave=s.wsize}else{s.wnext+=n;if(s.wnext===s.wsize){s.wnext=0}if(s.whave<s.wsize){s.whave+=n}}}return 0}function y(t,e){var r;var i,n;var s;var o;var a,u;var l;var f;var h,c;var d;var p;var g;var y=0;var b,m,v;var w,_,x;var C;var k;var T=new R.Buf8(4);var S;var E;var A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0){return z}r=t.state;if(r.mode===st){r.mode=ot}o=t.next_out;n=t.output;u=t.avail_out;s=t.next_in;i=t.input;a=t.avail_in;l=r.hold;f=r.bits;h=a;c=u;k=H;t:for(;;){switch(r.mode){case K:if(r.wrap===0){r.mode=ot;break}while(f<16){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(r.wrap&2&&l===35615){r.check=0;T[0]=l&255;T[1]=l>>>8&255;r.check=O(r.check,T,2,0);l=0;f=0;r.mode=X;break}r.flags=0;if(r.head){r.head.done=false}if(!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){t.msg="incorrect header check";r.mode=Ct;break}if((l&15)!==Z){t.msg="unknown compression method";r.mode=Ct;break}l>>>=4;f-=4;C=(l&15)+8;if(r.wbits===0){r.wbits=C}else if(C>r.wbits){t.msg="invalid window size";r.mode=Ct;break}r.dmax=1<<C;t.adler=r.check=1;r.mode=l&512?it:st;l=0;f=0;break;case X:while(f<16){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.flags=l;if((r.flags&255)!==Z){t.msg="unknown compression method";r.mode=Ct;break}if(r.flags&57344){t.msg="unknown header flags set";r.mode=Ct;break}if(r.head){r.head.text=l>>8&1}if(r.flags&512){T[0]=l&255;T[1]=l>>>8&255;r.check=O(r.check,T,2,0)}l=0;f=0;r.mode=q;case q:while(f<32){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(r.head){r.head.time=l}if(r.flags&512){T[0]=l&255;T[1]=l>>>8&255;T[2]=l>>>16&255;T[3]=l>>>24&255;r.check=O(r.check,T,4,0)}l=0;f=0;r.mode=J;case J:while(f<16){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(r.head){r.head.xflags=l&255;r.head.os=l>>8}if(r.flags&512){T[0]=l&255;T[1]=l>>>8&255;r.check=O(r.check,T,2,0)}l=0;f=0;r.mode=$;case $:if(r.flags&1024){while(f<16){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.length=l;if(r.head){r.head.extra_len=l}if(r.flags&512){T[0]=l&255;T[1]=l>>>8&255;r.check=O(r.check,T,2,0)}l=0;f=0}else if(r.head){r.head.extra=null}r.mode=Q;case Q:if(r.flags&1024){d=r.length;if(d>a){d=a}if(d){if(r.head){C=r.head.extra_len-r.length;if(!r.head.extra){r.head.extra=new Array(r.head.extra_len)}R.arraySet(r.head.extra,i,s,d,C)}if(r.flags&512){r.check=O(r.check,i,d,s)}a-=d;s+=d;r.length-=d}if(r.length){break t}}r.length=0;r.mode=tt;case tt:if(r.flags&2048){if(a===0){break t}d=0;do{C=i[s+d++];if(r.head&&C&&r.length<65536){r.head.name+=String.fromCharCode(C)}}while(C&&d<a);if(r.flags&512){r.check=O(r.check,i,d,s)}a-=d;s+=d;if(C){break t}}else if(r.head){r.head.name=null}r.length=0;r.mode=et;case et:if(r.flags&4096){if(a===0){break t}d=0;do{C=i[s+d++];if(r.head&&C&&r.length<65536){r.head.comment+=String.fromCharCode(C)}}while(C&&d<a);if(r.flags&512){r.check=O(r.check,i,d,s)}a-=d;s+=d;if(C){break t}}else if(r.head){r.head.comment=null}r.mode=rt;case rt:if(r.flags&512){while(f<16){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(l!==(r.check&65535)){t.msg="header crc mismatch";r.mode=Ct;break}l=0;f=0}if(r.head){r.head.hcrc=r.flags>>9&1;r.head.done=true}t.adler=r.check=0;r.mode=st;break;case it:while(f<32){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}t.adler=r.check=St(l);l=0;f=0;r.mode=nt;case nt:if(r.havedict===0){t.next_out=o;t.avail_out=u;t.next_in=s;t.avail_in=a;r.hold=l;r.bits=f;return U}t.adler=r.check=1;r.mode=st;case st:if(e===F||e===W){break t}case ot:if(r.last){l>>>=f&7;f-=f&7;r.mode=wt;break}while(f<3){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.last=l&1;l>>>=1;f-=1;switch(l&3){case 0:r.mode=at;break;case 1:Et(r);r.mode=dt;if(e===W){l>>>=2;f-=2;break t}break;case 2:r.mode=ft;break;case 3:t.msg="invalid block type";r.mode=Ct}l>>>=2;f-=2;break;case at:l>>>=f&7;f-=f&7;while(f<32){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if((l&65535)!==(l>>>16^65535)){t.msg="invalid stored block lengths";r.mode=Ct;break}r.length=l&65535;l=0;f=0;r.mode=ut;if(e===W){break t}case ut:r.mode=lt;case lt:d=r.length;if(d){if(d>a){d=a}if(d>u){d=u}if(d===0){break t}R.arraySet(n,i,s,d,o);a-=d;s+=d;u-=d;o+=d;r.length-=d;break}r.mode=st;break;case ft:while(f<14){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.nlen=(l&31)+257;l>>>=5;f-=5;r.ndist=(l&31)+1;l>>>=5;f-=5;r.ncode=(l&15)+4;l>>>=4;f-=4;if(r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols";r.mode=Ct;break}r.have=0;r.mode=ht;case ht:while(r.have<r.ncode){while(f<3){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.lens[A[r.have++]]=l&7;l>>>=3;f-=3}while(r.have<19){r.lens[A[r.have++]]=0}r.lencode=r.lendyn;r.lenbits=7;S={bits:r.lenbits};k=I(M,r.lens,0,19,r.lencode,0,r.work,S);r.lenbits=S.bits;if(k){t.msg="invalid code lengths set";r.mode=Ct;break}r.have=0;r.mode=ct;case ct:while(r.have<r.nlen+r.ndist){for(;;){y=r.lencode[l&(1<<r.lenbits)-1];b=y>>>24;m=y>>>16&255;v=y&65535;if(b<=f){break}if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(v<16){l>>>=b;f-=b;r.lens[r.have++]=v}else{if(v===16){E=b+2;while(f<E){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}l>>>=b;f-=b;if(r.have===0){t.msg="invalid bit length repeat";r.mode=Ct;break}C=r.lens[r.have-1];d=3+(l&3);l>>>=2;f-=2}else if(v===17){E=b+3;while(f<E){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}l>>>=b;f-=b;C=0;d=3+(l&7);l>>>=3;f-=3}else{E=b+7;while(f<E){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}l>>>=b;f-=b;C=0;d=11+(l&127);l>>>=7;f-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat";r.mode=Ct;break}while(d--){r.lens[r.have++]=C}}}if(r.mode===Ct){break}if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block";r.mode=Ct;break}r.lenbits=9;S={bits:r.lenbits};k=I(j,r.lens,0,r.nlen,r.lencode,0,r.work,S);r.lenbits=S.bits;if(k){t.msg="invalid literal/lengths set";r.mode=Ct;break}r.distbits=6;r.distcode=r.distdyn;S={bits:r.distbits};k=I(L,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S);r.distbits=S.bits;if(k){t.msg="invalid distances set";r.mode=Ct;break}r.mode=dt;if(e===W){break t}case dt:r.mode=pt;case pt:if(a>=6&&u>=258){t.next_out=o;t.avail_out=u;t.next_in=s;t.avail_in=a;r.hold=l;r.bits=f;P(t,c);o=t.next_out;n=t.output;u=t.avail_out;s=t.next_in;i=t.input;a=t.avail_in;l=r.hold;f=r.bits;if(r.mode===st){r.back=-1}break}r.back=0;for(;;){y=r.lencode[l&(1<<r.lenbits)-1];b=y>>>24;m=y>>>16&255;v=y&65535;if(b<=f){break}if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(m&&(m&240)===0){w=b;_=m;x=v;for(;;){y=r.lencode[x+((l&(1<<w+_)-1)>>w)];b=y>>>24;m=y>>>16&255;v=y&65535;if(w+b<=f){break}if(a===0){break t}a--;l+=i[s++]<<f;f+=8}l>>>=w;f-=w;r.back+=w}l>>>=b;f-=b;r.back+=b;r.length=v;if(m===0){r.mode=vt;break}if(m&32){r.back=-1;r.mode=st;break}if(m&64){t.msg="invalid literal/length code";r.mode=Ct;break}r.extra=m&15;r.mode=gt;case gt:if(r.extra){E=r.extra;while(f<E){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.length+=l&(1<<r.extra)-1;l>>>=r.extra;f-=r.extra;r.back+=r.extra}r.was=r.length;r.mode=yt;case yt:for(;;){y=r.distcode[l&(1<<r.distbits)-1];b=y>>>24;m=y>>>16&255;v=y&65535;if(b<=f){break}if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if((m&240)===0){w=b;_=m;x=v;for(;;){y=r.distcode[x+((l&(1<<w+_)-1)>>w)];b=y>>>24;m=y>>>16&255;v=y&65535;if(w+b<=f){break}if(a===0){break t}a--;l+=i[s++]<<f;f+=8}l>>>=w;f-=w;r.back+=w}l>>>=b;f-=b;r.back+=b;if(m&64){t.msg="invalid distance code";r.mode=Ct;break}r.offset=v;r.extra=m&15;r.mode=bt;case bt:if(r.extra){E=r.extra;while(f<E){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}r.offset+=l&(1<<r.extra)-1;l>>>=r.extra;f-=r.extra;r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back";r.mode=Ct;break}r.mode=mt;case mt:if(u===0){break t}d=c-u;if(r.offset>d){d=r.offset-d;if(d>r.whave){if(r.sane){t.msg="invalid distance too far back";r.mode=Ct;break}}if(d>r.wnext){d-=r.wnext;p=r.wsize-d}else{p=r.wnext-d}if(d>r.length){d=r.length}g=r.window}else{g=n;p=o-r.offset;d=r.length}if(d>u){d=u}u-=d;r.length-=d;do{n[o++]=g[p++]}while(--d);if(r.length===0){r.mode=pt}break;case vt:if(u===0){break t}n[o++]=r.length;u--;r.mode=pt;break;case wt:if(r.wrap){while(f<32){if(a===0){break t}a--;l|=i[s++]<<f;f+=8}c-=u;t.total_out+=c;r.total+=c;if(c){t.adler=r.check=r.flags?O(r.check,n,c,o-c):B(r.check,n,c,o-c)}c=u;if((r.flags?l:St(l))!==r.check){t.msg="incorrect data check";r.mode=Ct;break}l=0;f=0}r.mode=_t;case _t:if(r.wrap&&r.flags){while(f<32){if(a===0){break t}a--;l+=i[s++]<<f;f+=8}if(l!==(r.total&4294967295)){t.msg="incorrect length check";r.mode=Ct;break}l=0;f=0}r.mode=xt;case xt:k=N;break t;case Ct:k=Y;break t;case kt:return V;case Tt:default:return z}}t.next_out=o;t.avail_out=u;t.next_in=s;t.avail_in=a;r.hold=l;r.bits=f;if(r.wsize||c!==t.avail_out&&r.mode<Ct&&(r.mode<wt||e!==D)){if(At(t,t.output,t.next_out,c-t.avail_out)){r.mode=kt;return V}}h-=t.avail_in;c-=t.avail_out;t.total_in+=h;t.total_out+=c;r.total+=c;if(r.wrap&&c){t.adler=r.check=r.flags?O(r.check,n,c,t.next_out-c):B(r.check,n,c,t.next_out-c)}t.data_type=r.bits+(r.last?64:0)+(r.mode===st?128:0)+(r.mode===dt||r.mode===ut?256:0);if((h===0&&c===0||e===D)&&k===H){k=G}return k}function b(t){if(!t||!t.state){return z}var e=t.state;if(e.window){e.window=null}t.state=null;return H}function m(t,e){var r;if(!t||!t.state){return z}r=t.state;if((r.wrap&2)===0){return z}r.head=e;e.done=false;return H}function v(t,e){var r=e.length;var i;var n;var s;if(!t||!t.state){return z}i=t.state;if(i.wrap!==0&&i.mode!==nt){return z}if(i.mode===nt){n=1;n=B(n,e,r,0);if(n!==i.check){return Y}}s=At(t,e,r,r);if(s){i.mode=kt;return V}i.havedict=1;return H}r.inflateReset=l;r.inflateReset2=f;r.inflateResetKeep=u;r.inflateInit=c;r.inflateInit2=h;r.inflate=y;r.inflateEnd=b;r.inflateGetHeader=m;r.inflateSetDictionary=v;r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":167,"./adler32":168,"./crc32":170,"./inffast":172,"./inftrees":174}],174:[function(t,e,r){"use strict";var j=t("../utils/common");var L=15;var D=852;var F=592;var W=0;var H=1;var N=2;var U=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0];var z=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78];var Y=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0];var V=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function t(e,r,i,n,s,o,a,u){var l=u.bits;var f=0;var h=0;var c=0,d=0;var p=0;var g=0;var y=0;var b=0;var m=0;var v=0;var w;var _;var x;var C;var k;var T=null;var S=0;var E;var A=new j.Buf16(L+1);var R=new j.Buf16(L+1);var B=null;var O=0;var P,I,M;for(f=0;f<=L;f++){A[f]=0}for(h=0;h<n;h++){A[r[i+h]]++}p=l;for(d=L;d>=1;d--){if(A[d]!==0){break}}if(p>d){p=d}if(d===0){s[o++]=1<<24|64<<16|0;s[o++]=1<<24|64<<16|0;u.bits=1;return 0}for(c=1;c<d;c++){if(A[c]!==0){break}}if(p<c){p=c}b=1;for(f=1;f<=L;f++){b<<=1;b-=A[f];if(b<0){return-1}}if(b>0&&(e===W||d!==1)){return-1}R[1]=0;for(f=1;f<L;f++){R[f+1]=R[f]+A[f]}for(h=0;h<n;h++){if(r[i+h]!==0){a[R[r[i+h]]++]=h}}if(e===W){T=B=a;E=19}else if(e===H){T=U;S-=257;B=z;O-=257;E=256}else{T=Y;B=V;E=-1}v=0;h=0;f=c;k=o;g=p;y=0;x=-1;m=1<<p;C=m-1;if(e===H&&m>D||e===N&&m>F){return 1}for(;;){P=f-y;if(a[h]<E){I=0;M=a[h]}else if(a[h]>E){I=B[O+a[h]];M=T[S+a[h]]}else{I=32+64;M=0}w=1<<f-y;_=1<<g;c=_;do{_-=w;s[k+(v>>y)+_]=P<<24|I<<16|M|0}while(_!==0);w=1<<f-1;while(v&w){w>>=1}if(w!==0){v&=w-1;v+=w}else{v=0}h++;if(--A[f]===0){if(f===d){break}f=r[i+a[h]]}if(f>p&&(v&C)!==x){if(y===0){y=p}k+=c;g=f-y;b=1<<g;while(g+y<d){b-=A[g+y];if(b<=0){break}g++;b<<=1}m+=1<<g;if(e===H&&m>D||e===N&&m>F){return 1}x=v&C;s[x]=p<<24|g<<16|k-o|0}}if(v!==0){s[k+v]=f-y<<24|64<<16|0}u.bits=p;return 0}},{"../utils/common":167}],175:[function(t,e,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],176:[function(t,e,r){"use strict";var n=t("../utils/common");var a=4;var i=0;var s=1;var u=2;function o(t){var e=t.length;while(--e>=0){t[e]=0}}var l=0;var f=1;var h=2;var c=3;var d=258;var p=29;var g=256;var y=g+1+p;var b=30;var m=19;var v=2*y+1;var w=15;var _=16;var x=7;var C=256;var k=16;var T=17;var S=18;var E=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var A=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var O=512;var P=new Array((y+2)*2);o(P);var I=new Array(b*2);o(I);var M=new Array(O);o(M);var j=new Array(d-c+1);o(j);var L=new Array(p);o(L);var D=new Array(b);o(D);function F(t,e,r,i,n){this.static_tree=t;this.extra_bits=e;this.extra_base=r;this.elems=i;this.max_length=n;this.has_stree=t&&t.length}var W;var H;var N;function U(t,e){this.dyn_tree=t;this.max_code=0;this.stat_desc=e}function z(t){return t<256?M[t]:M[256+(t>>>7)]}function Y(t,e){t.pending_buf[t.pending++]=e&255;t.pending_buf[t.pending++]=e>>>8&255}function V(t,e,r){if(t.bi_valid>_-r){t.bi_buf|=e<<t.bi_valid&65535;Y(t,t.bi_buf);t.bi_buf=e>>_-t.bi_valid;t.bi_valid+=r-_}else{t.bi_buf|=e<<t.bi_valid&65535;t.bi_valid+=r}}function G(t,e,r){V(t,r[e*2],r[e*2+1])}function Z(t,e){var r=0;do{r|=t&1;t>>>=1;r<<=1}while(--e>0);return r>>>1}function K(t){if(t.bi_valid===16){Y(t,t.bi_buf);t.bi_buf=0;t.bi_valid=0}else if(t.bi_valid>=8){t.pending_buf[t.pending++]=t.bi_buf&255;t.bi_buf>>=8;t.bi_valid-=8}}function X(t,e){var r=e.dyn_tree;var i=e.max_code;var n=e.stat_desc.static_tree;var s=e.stat_desc.has_stree;var o=e.stat_desc.extra_bits;var a=e.stat_desc.extra_base;var u=e.stat_desc.max_length;var l;var f,h;var c;var d;var p;var g=0;for(c=0;c<=w;c++){t.bl_count[c]=0}r[t.heap[t.heap_max]*2+1]=0;for(l=t.heap_max+1;l<v;l++){f=t.heap[l];c=r[r[f*2+1]*2+1]+1;if(c>u){c=u;g++}r[f*2+1]=c;if(f>i){continue}t.bl_count[c]++;d=0;if(f>=a){d=o[f-a]}p=r[f*2];t.opt_len+=p*(c+d);if(s){t.static_len+=p*(n[f*2+1]+d)}}if(g===0){return}do{c=u-1;while(t.bl_count[c]===0){c--}t.bl_count[c]--;t.bl_count[c+1]+=2;t.bl_count[u]--;g-=2}while(g>0);for(c=u;c!==0;c--){f=t.bl_count[c];while(f!==0){h=t.heap[--l];if(h>i){continue}if(r[h*2+1]!==c){t.opt_len+=(c-r[h*2+1])*r[h*2];r[h*2+1]=c}f--}}}function q(t,e,r){var i=new Array(w+1);var n=0;var s;var o;for(s=1;s<=w;s++){i[s]=n=n+r[s-1]<<1}for(o=0;o<=e;o++){var a=t[o*2+1];if(a===0){continue}t[o*2]=Z(i[a]++,a)}}function J(){var t;var e;var r;var i;var n;var s=new Array(w+1);r=0;for(i=0;i<p-1;i++){L[i]=r;for(t=0;t<1<<E[i];t++){j[r++]=i}}j[r-1]=i;n=0;for(i=0;i<16;i++){D[i]=n;for(t=0;t<1<<A[i];t++){M[n++]=i}}n>>=7;for(;i<b;i++){D[i]=n<<7;for(t=0;t<1<<A[i]-7;t++){M[256+n++]=i}}for(e=0;e<=w;e++){s[e]=0}t=0;while(t<=143){P[t*2+1]=8;t++;s[8]++}while(t<=255){P[t*2+1]=9;t++;s[9]++}while(t<=279){P[t*2+1]=7;t++;s[7]++}while(t<=287){P[t*2+1]=8;t++;s[8]++}q(P,y+1,s);for(t=0;t<b;t++){I[t*2+1]=5;I[t*2]=Z(t,5)}W=new F(P,E,g+1,y,w);H=new F(I,A,0,b,w);N=new F(new Array(0),R,0,m,x)}function $(t){var e;for(e=0;e<y;e++){t.dyn_ltree[e*2]=0}for(e=0;e<b;e++){t.dyn_dtree[e*2]=0}for(e=0;e<m;e++){t.bl_tree[e*2]=0}t.dyn_ltree[C*2]=1;t.opt_len=t.static_len=0;t.last_lit=t.matches=0}function Q(t){if(t.bi_valid>8){Y(t,t.bi_buf)}else if(t.bi_valid>0){t.pending_buf[t.pending++]=t.bi_buf}t.bi_buf=0;t.bi_valid=0}function tt(t,e,r,i){Q(t);if(i){Y(t,r);Y(t,~r)}n.arraySet(t.pending_buf,t.window,e,r,t.pending);t.pending+=r}function et(t,e,r,i){var n=e*2;var s=r*2;return t[n]<t[s]||t[n]===t[s]&&i[e]<=i[r]}function rt(t,e,r){var i=t.heap[r];var n=r<<1;while(n<=t.heap_len){if(n<t.heap_len&&et(e,t.heap[n+1],t.heap[n],t.depth)){n++}if(et(e,i,t.heap[n],t.depth)){break}t.heap[r]=t.heap[n];r=n;n<<=1}t.heap[r]=i}function it(t,e,r){var i;var n;var s=0;var o;var a;if(t.last_lit!==0){do{i=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1];n=t.pending_buf[t.l_buf+s];s++;if(i===0){G(t,n,e)}else{o=j[n];G(t,o+g+1,e);a=E[o];if(a!==0){n-=L[o];V(t,n,a)}i--;o=z(i);G(t,o,r);a=A[o];if(a!==0){i-=D[o];V(t,i,a)}}}while(s<t.last_lit)}G(t,C,e)}function nt(t,e){var r=e.dyn_tree;var i=e.stat_desc.static_tree;var n=e.stat_desc.has_stree;var s=e.stat_desc.elems;var o,a;var u=-1;var l;t.heap_len=0;t.heap_max=v;for(o=0;o<s;o++){if(r[o*2]!==0){t.heap[++t.heap_len]=u=o;t.depth[o]=0}else{r[o*2+1]=0}}while(t.heap_len<2){l=t.heap[++t.heap_len]=u<2?++u:0;r[l*2]=1;t.depth[l]=0;t.opt_len--;if(n){t.static_len-=i[l*2+1]}}e.max_code=u;for(o=t.heap_len>>1;o>=1;o--){rt(t,r,o)}l=s;do{o=t.heap[1];t.heap[1]=t.heap[t.heap_len--];rt(t,r,1);a=t.heap[1];t.heap[--t.heap_max]=o;t.heap[--t.heap_max]=a;r[l*2]=r[o*2]+r[a*2];t.depth[l]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1;r[o*2+1]=r[a*2+1]=l;t.heap[1]=l++;rt(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1];X(t,e);q(r,u,t.bl_count)}function st(t,e,r){var i;var n=-1;var s;var o=e[0*2+1];var a=0;var u=7;var l=4;if(o===0){u=138;l=3}e[(r+1)*2+1]=65535;for(i=0;i<=r;i++){s=o;o=e[(i+1)*2+1];if(++a<u&&s===o){continue}else if(a<l){t.bl_tree[s*2]+=a}else if(s!==0){if(s!==n){t.bl_tree[s*2]++}t.bl_tree[k*2]++}else if(a<=10){t.bl_tree[T*2]++}else{t.bl_tree[S*2]++}a=0;n=s;if(o===0){u=138;l=3}else if(s===o){u=6;l=3}else{u=7;l=4}}}function ot(t,e,r){var i;var n=-1;var s;var o=e[0*2+1];var a=0;var u=7;var l=4;if(o===0){u=138;l=3}for(i=0;i<=r;i++){s=o;o=e[(i+1)*2+1];if(++a<u&&s===o){continue}else if(a<l){do{G(t,s,t.bl_tree)}while(--a!==0)}else if(s!==0){if(s!==n){G(t,s,t.bl_tree);a--}G(t,k,t.bl_tree);V(t,a-3,2)}else if(a<=10){G(t,T,t.bl_tree);V(t,a-3,3)}else{G(t,S,t.bl_tree);V(t,a-11,7)}a=0;n=s;if(o===0){u=138;l=3}else if(s===o){u=6;l=3}else{u=7;l=4}}}function at(t){var e;st(t,t.dyn_ltree,t.l_desc.max_code);st(t,t.dyn_dtree,t.d_desc.max_code);nt(t,t.bl_desc);for(e=m-1;e>=3;e--){if(t.bl_tree[B[e]*2+1]!==0){break}}t.opt_len+=3*(e+1)+5+5+4;return e}function ut(t,e,r,i){var n;V(t,e-257,5);V(t,r-1,5);V(t,i-4,4);for(n=0;n<i;n++){V(t,t.bl_tree[B[n]*2+1],3)}ot(t,t.dyn_ltree,e-1);ot(t,t.dyn_dtree,r-1)}function lt(t){var e=4093624447;var r;for(r=0;r<=31;r++,e>>>=1){if(e&1&&t.dyn_ltree[r*2]!==0){return i}}if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0){return s}for(r=32;r<g;r++){if(t.dyn_ltree[r*2]!==0){return s}}return i}var ft=false;function ht(t){if(!ft){J();ft=true}t.l_desc=new U(t.dyn_ltree,W);t.d_desc=new U(t.dyn_dtree,H);t.bl_desc=new U(t.bl_tree,N);t.bi_buf=0;t.bi_valid=0;$(t)}function ct(t,e,r,i){V(t,(l<<1)+(i?1:0),3);tt(t,e,r,true)}function dt(t){V(t,f<<1,3);G(t,C,P);K(t)}function pt(t,e,r,i){var n,s;var o=0;if(t.level>0){if(t.strm.data_type===u){t.strm.data_type=lt(t)}nt(t,t.l_desc);nt(t,t.d_desc);o=at(t);n=t.opt_len+3+7>>>3;s=t.static_len+3+7>>>3;if(s<=n){n=s}}else{n=s=r+5}if(r+4<=n&&e!==-1){ct(t,e,r,i)}else if(t.strategy===a||s===n){V(t,(f<<1)+(i?1:0),3);it(t,P,I)}else{V(t,(h<<1)+(i?1:0),3);ut(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1);it(t,t.dyn_ltree,t.dyn_dtree)}$(t);if(i){Q(t)}}function gt(t,e,r){t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255;t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255;t.pending_buf[t.l_buf+t.last_lit]=r&255;t.last_lit++;if(e===0){t.dyn_ltree[r*2]++}else{t.matches++;e--;t.dyn_ltree[(j[r]+g+1)*2]++;t.dyn_dtree[z(e)*2]++}return t.last_lit===t.lit_bufsize-1}r._tr_init=ht;r._tr_stored_block=ct;r._tr_flush_block=pt;r._tr_tally=gt;r._tr_align=dt},{"../utils/common":167}],177:[function(t,e,r){"use strict";function i(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}e.exports=i},{}],178:[function(t,e,r){(function(a){(function(){"use strict";function g(t){if(typeof t!=="string"){throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}}function o(t,e){var r="";var i=0;var n=-1;var s=0;var o;for(var a=0;a<=t.length;++a){if(a<t.length)o=t.charCodeAt(a);else if(o===47)break;else o=47;if(o===47){if(n===a-1||s===1){}else if(n!==a-1&&s===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var u=r.lastIndexOf("/");if(u!==r.length-1){if(u===-1){r="";i=0}else{r=r.slice(0,u);i=r.length-1-r.lastIndexOf("/")}n=a;s=0;continue}}else if(r.length===2||r.length===1){r="";i=0;n=a;s=0;continue}}if(e){if(r.length>0)r+="/..";else r="..";i=2}}else{if(r.length>0)r+="/"+t.slice(n+1,a);else r=t.slice(n+1,a);i=a-n-1}n=a;s=0}else if(o===46&&s!==-1){++s}else{s=-1}}return r}function r(t,e){var r=e.dir||e.root;var i=e.base||(e.name||"")+(e.ext||"");if(!r){return i}if(r===e.root){return r+i}return r+t+i}var y={resolve:function t(){var e="";var r=false;var i;for(var n=arguments.length-1;n>=-1&&!r;n--){var s;if(n>=0)s=arguments[n];else{if(i===undefined)i=a.cwd();s=i}g(s);if(s.length===0){continue}e=s+"/"+e;r=s.charCodeAt(0)===47}e=o(e,!r);if(r){if(e.length>0)return"/"+e;else return"/"}else if(e.length>0){return e}else{return"."}},normalize:function t(e){g(e);if(e.length===0)return".";var r=e.charCodeAt(0)===47;var i=e.charCodeAt(e.length-1)===47;e=o(e,!r);if(e.length===0&&!r)e=".";if(e.length>0&&i)e+="/";if(r)return"/"+e;return e},isAbsolute:function t(e){g(e);return e.length>0&&e.charCodeAt(0)===47},join:function t(){if(arguments.length===0)return".";var e;for(var r=0;r<arguments.length;++r){var i=arguments[r];g(i);if(i.length>0){if(e===undefined)e=i;else e+="/"+i}}if(e===undefined)return".";return y.normalize(e)},relative:function t(e,r){g(e);g(r);if(e===r)return"";e=y.resolve(e);r=y.resolve(r);if(e===r)return"";var i=1;for(;i<e.length;++i){if(e.charCodeAt(i)!==47)break}var n=e.length;var s=n-i;var o=1;for(;o<r.length;++o){if(r.charCodeAt(o)!==47)break}var a=r.length;var u=a-o;var l=s<u?s:u;var f=-1;var h=0;for(;h<=l;++h){if(h===l){if(u>l){if(r.charCodeAt(o+h)===47){return r.slice(o+h+1)}else if(h===0){return r.slice(o+h)}}else if(s>l){if(e.charCodeAt(i+h)===47){f=h}else if(h===0){f=0}}break}var c=e.charCodeAt(i+h);var d=r.charCodeAt(o+h);if(c!==d)break;else if(c===47)f=h}var p="";for(h=i+f+1;h<=n;++h){if(h===n||e.charCodeAt(h)===47){if(p.length===0)p+="..";else p+="/.."}}if(p.length>0)return p+r.slice(o+f);else{o+=f;if(r.charCodeAt(o)===47)++o;return r.slice(o)}},_makeLong:function t(e){return e},dirname:function t(e){g(e);if(e.length===0)return".";var r=e.charCodeAt(0);var i=r===47;var n=-1;var s=true;for(var o=e.length-1;o>=1;--o){r=e.charCodeAt(o);if(r===47){if(!s){n=o;break}}else{s=false}}if(n===-1)return i?"/":".";if(i&&n===1)return"//";return e.slice(0,n)},basename:function t(e,r){if(r!==undefined&&typeof r!=="string")throw new TypeError('"ext" argument must be a string');g(e);var i=0;var n=-1;var s=true;var o;if(r!==undefined&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1;var u=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!s){i=o+1;break}}else{if(u===-1){s=false;u=o+1}if(a>=0){if(l===r.charCodeAt(a)){if(--a===-1){n=o}}else{a=-1;n=u}}}}if(i===n)n=u;else if(n===-1)n=e.length;return e.slice(i,n)}else{for(o=e.length-1;o>=0;--o){if(e.charCodeAt(o)===47){if(!s){i=o+1;break}}else if(n===-1){s=false;n=o+1}}if(n===-1)return"";return e.slice(i,n)}},extname:function t(e){g(e);var r=-1;var i=0;var n=-1;var s=true;var o=0;for(var a=e.length-1;a>=0;--a){var u=e.charCodeAt(a);if(u===47){if(!s){i=a+1;break}continue}if(n===-1){s=false;n=a+1}if(u===46){if(r===-1)r=a;else if(o!==1)o=1}else if(r!==-1){o=-1}}if(r===-1||n===-1||o===0||o===1&&r===n-1&&r===i+1){return""}return e.slice(r,n)},format:function t(e){if(e===null||typeof e!=="object"){throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e)}return r("/",e)},parse:function t(e){g(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0);var n=i===47;var s;if(n){r.root="/";s=1}else{s=0}var o=-1;var a=0;var u=-1;var l=true;var f=e.length-1;var h=0;for(;f>=s;--f){i=e.charCodeAt(f);if(i===47){if(!l){a=f+1;break}continue}if(u===-1){l=false;u=f+1}if(i===46){if(o===-1)o=f;else if(h!==1)h=1}else if(o!==-1){h=-1}}if(o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1){if(u!==-1){if(a===0&&n)r.base=r.name=e.slice(1,u);else r.base=r.name=e.slice(a,u)}}else{if(a===0&&n){r.name=e.slice(1,o);r.base=e.slice(1,u)}else{r.name=e.slice(a,o);r.base=e.slice(a,u)}r.ext=e.slice(o,u)}if(a>0)r.dir=e.slice(0,a-1);else if(n)r.dir="/";return r},sep:"/",delimiter:":",win32:null,posix:null};y.posix=y;e.exports=y}).call(this)}).call(this,t("_process"))},{_process:179}],179:[function(t,e,r){var i=e.exports={};var n;var s;function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){n=setTimeout}else{n=o}}catch(t){n=o}try{if(typeof clearTimeout==="function"){s=clearTimeout}else{s=a}}catch(t){s=a}})();function u(e){if(n===setTimeout){return setTimeout(e,0)}if((n===o||!n)&&setTimeout){n=setTimeout;return setTimeout(e,0)}try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function l(e){if(s===clearTimeout){return clearTimeout(e)}if((s===a||!s)&&clearTimeout){s=clearTimeout;return clearTimeout(e)}try{return s(e)}catch(t){try{return s.call(null,e)}catch(t){return s.call(this,e)}}}var f=[];var h=false;var c;var d=-1;function p(){if(!h||!c){return}h=false;if(c.length){f=c.concat(f)}else{d=-1}if(f.length){g()}}function g(){if(h){return}var t=u(p);h=true;var e=f.length;while(e){c=f;f=[];while(++d<e){if(c){c[d].run()}}d=-1;e=f.length}c=null;h=false;l(t)}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1){for(var r=1;r<arguments.length;r++){e[r-1]=arguments[r]}}f.push(new y(t,e));if(f.length===1&&!h){u(g)}};function y(t,e){this.fun=t;this.array=e}y.prototype.run=function(){this.fun.apply(null,this.array)};i.title="browser";i.browser=true;i.env={};i.argv=[];i.version="";i.versions={};function b(){}i.on=b;i.addListener=b;i.once=b;i.off=b;i.removeListener=b;i.removeAllListeners=b;i.emit=b;i.prependListener=b;i.prependOnceListener=b;i.listeners=function(t){return[]};i.binding=function(t){throw new Error("process.binding is not supported")};i.cwd=function(){return"/"};i.chdir=function(t){throw new Error("process.chdir is not supported")};i.umask=function(){return 0}},{}],180:[function(t,e,r){var i=t("buffer");var n=i.Buffer;function s(t,e){for(var r in t){e[r]=t[r]}}if(n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow){e.exports=i}else{s(i,r);r.Buffer=o}function o(t,e,r){return n(t,e,r)}o.prototype=Object.create(n.prototype);s(n,o);o.from=function(t,e,r){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return n(t,e,r)};o.alloc=function(t,e,r){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var i=n(t);if(e!==undefined){if(typeof r==="string"){i.fill(e,r)}else{i.fill(e)}}else{i.fill(0)}return i};o.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return n(t)};o.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return i.SlowBuffer(t)}},{buffer:147}],181:[function(t,e,r){e.exports=n;var f=t("events").EventEmitter;var i=t("inherits");i(n,f);n.Readable=t("readable-stream/lib/_stream_readable.js");n.Writable=t("readable-stream/lib/_stream_writable.js");n.Duplex=t("readable-stream/lib/_stream_duplex.js");n.Transform=t("readable-stream/lib/_stream_transform.js");n.PassThrough=t("readable-stream/lib/_stream_passthrough.js");n.finished=t("readable-stream/lib/internal/streams/end-of-stream.js");n.pipeline=t("readable-stream/lib/internal/streams/pipeline.js");n.Stream=n;function n(){f.call(this)}n.prototype.pipe=function(e,t){var r=this;function i(t){if(e.writable){if(false===e.write(t)&&r.pause){r.pause()}}}r.on("data",i);function n(){if(r.readable&&r.resume){r.resume()}}e.on("drain",n);if(!e._isStdio&&(!t||t.end!==false)){r.on("end",o);r.on("close",a)}var s=false;function o(){if(s)return;s=true;e.end()}function a(){if(s)return;s=true;if(typeof e.destroy==="function")e.destroy()}function u(t){l();if(f.listenerCount(this,"error")===0){throw t}}r.on("error",u);e.on("error",u);function l(){r.removeListener("data",i);e.removeListener("drain",n);r.removeListener("end",o);r.removeListener("close",a);r.removeListener("error",u);e.removeListener("error",u);r.removeListener("end",l);r.removeListener("close",l);e.removeListener("close",l)}r.on("end",l);r.on("close",l);e.on("close",l);e.emit("pipe",r);return e}},{events:151,inherits:160,"readable-stream/lib/_stream_duplex.js":183,"readable-stream/lib/_stream_passthrough.js":184,"readable-stream/lib/_stream_readable.js":185,"readable-stream/lib/_stream_transform.js":186,"readable-stream/lib/_stream_writable.js":187,"readable-stream/lib/internal/streams/end-of-stream.js":191,"readable-stream/lib/internal/streams/pipeline.js":193}],182:[function(t,e,r){"use strict";function s(t,e){t.prototype=Object.create(e.prototype);t.prototype.constructor=t;t.__proto__=e}var o={};function i(t,i,e){if(!e){e=Error}function n(t,e,r){if(typeof i==="string"){return i}else{return i(t,e,r)}}var r=function(i){s(t,i);function t(t,e,r){return i.call(this,n(t,e,r))||this}return t}(e);r.prototype.name=e.name;r.prototype.code=t;o[t]=r}function a(t,e){if(Array.isArray(t)){var r=t.length;t=t.map(function(t){return String(t)});if(r>2){return"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]}else if(r===2){return"one of ".concat(e," ").concat(t[0]," or ").concat(t[1])}else{return"of ".concat(e," ").concat(t[0])}}else{return"of ".concat(e," ").concat(String(t))}}function u(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function l(t,e,r){if(r===undefined||r>t.length){r=t.length}return t.substring(r-e.length,r)===e}function f(t,e,r){if(typeof r!=="number"){r=0}if(r+e.length>t.length){return false}else{return t.indexOf(e,r)!==-1}}i("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);i("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;if(typeof e==="string"&&u(e,"not ")){i="must not be";e=e.replace(/^not /,"")}else{i="must be"}var n;if(l(t," argument")){n="The ".concat(t," ").concat(i," ").concat(a(e,"type"))}else{var s=f(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(a(e,"type"))}n+=". Received type ".concat(typeof r);return n},TypeError);i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");i("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});i("ERR_STREAM_PREMATURE_CLOSE","Premature close");i("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});i("ERR_MULTIPLE_CALLBACK","Callback called multiple times");i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");i("ERR_STREAM_WRITE_AFTER_END","write after end");i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);i("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.codes=o},{}],183:[function(f,h,t){(function(l){(function(){"use strict";var t=Object.keys||function(t){var e=[];for(var r in t){e.push(r)}return e};h.exports=o;var e=f("./_stream_readable");var r=f("./_stream_writable");f("inherits")(o,e);{var i=t(r.prototype);for(var n=0;n<i.length;n++){var s=i[n];if(!o.prototype[s])o.prototype[s]=r.prototype[s]}}function o(t){if(!(this instanceof o))return new o(t);e.call(this,t);r.call(this,t);this.allowHalfOpen=true;if(t){if(t.readable===false)this.readable=false;if(t.writable===false)this.writable=false;if(t.allowHalfOpen===false){this.allowHalfOpen=false;this.once("end",a)}}}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:false,get:function t(){return this._writableState.highWaterMark}});Object.defineProperty(o.prototype,"writableBuffer",{enumerable:false,get:function t(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(o.prototype,"writableLength",{enumerable:false,get:function t(){return this._writableState.length}});function a(){if(this._writableState.ended)return;l.nextTick(u,this)}function u(t){t.end()}Object.defineProperty(o.prototype,"destroyed",{enumerable:false,get:function t(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function t(e){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=e;this._writableState.destroyed=e}})}).call(this)}).call(this,f("_process"))},{"./_stream_readable":185,"./_stream_writable":187,_process:179,inherits:160}],184:[function(t,e,r){"use strict";e.exports=n;var i=t("./_stream_transform");t("inherits")(n,i);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}n.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":186,inherits:160}],185:[function(q,J,t){(function(K,X){(function(){"use strict";J.exports=S;var i;S.ReadableState=T;var t=q("events").EventEmitter;var y=function t(e,r){return e.listeners(r).length};var n=q("./internal/streams/stream");var a=q("buffer").Buffer;var e=X.Uint8Array||function(){};function u(t){return a.from(t)}function s(t){return a.isBuffer(t)||t instanceof e}var r=q("util");var b;if(r&&r.debuglog){b=r.debuglog("stream")}else{b=function t(){}}var o=q("./internal/streams/buffer_list");var l=q("./internal/streams/destroy");var f=q("./internal/streams/state"),h=f.getHighWaterMark;var c=q("../errors").codes,d=c.ERR_INVALID_ARG_TYPE,p=c.ERR_STREAM_PUSH_AFTER_EOF,g=c.ERR_METHOD_NOT_IMPLEMENTED,m=c.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var v;var w;var _;q("inherits")(S,n);var x=l.errorOrDestroy;var C=["error","close","destroy","pause","resume"];function k(t,e,r){if(typeof t.prependListener==="function")return t.prependListener(e,r);if(!t._events||!t._events[e])t.on(e,r);else if(Array.isArray(t._events[e]))t._events[e].unshift(r);else t._events[e]=[r,t._events[e]]}function T(t,e,r){i=i||q("./_stream_duplex");t=t||{};if(typeof r!=="boolean")r=e instanceof i;this.objectMode=!!t.objectMode;if(r)this.objectMode=this.objectMode||!!t.readableObjectMode;this.highWaterMark=h(this,t,"readableHighWaterMark",r);this.buffer=new o;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.destroyed=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!v)v=q("string_decoder/").StringDecoder;this.decoder=new v(t.encoding);this.encoding=t.encoding}}function S(t){i=i||q("./_stream_duplex");if(!(this instanceof S))return new S(t);var e=this instanceof i;this._readableState=new T(t,this,e);this.readable=true;if(t){if(typeof t.read==="function")this._read=t.read;if(typeof t.destroy==="function")this._destroy=t.destroy}n.call(this)}Object.defineProperty(S.prototype,"destroyed",{enumerable:false,get:function t(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function t(e){if(!this._readableState){return}this._readableState.destroyed=e}});S.prototype.destroy=l.destroy;S.prototype._undestroy=l.undestroy;S.prototype._destroy=function(t,e){e(t)};S.prototype.push=function(t,e){var r=this._readableState;var i;if(!r.objectMode){if(typeof t==="string"){e=e||r.defaultEncoding;if(e!==r.encoding){t=a.from(t,e);e=""}i=true}}else{i=true}return E(this,t,e,false,i)};S.prototype.unshift=function(t){return E(this,t,null,true,false)};function E(t,e,r,i,n){b("readableAddChunk",e);var s=t._readableState;if(e===null){s.reading=false;I(t,s)}else{var o;if(!n)o=R(s,e);if(o){x(t,o)}else if(s.objectMode||e&&e.length>0){if(typeof e!=="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==a.prototype){e=u(e)}if(i){if(s.endEmitted)x(t,new m);else A(t,s,e,true)}else if(s.ended){x(t,new p)}else if(s.destroyed){return false}else{s.reading=false;if(s.decoder&&!r){e=s.decoder.write(e);if(s.objectMode||e.length!==0)A(t,s,e,false);else L(t,s)}else{A(t,s,e,false)}}}else if(!i){s.reading=false;L(t,s)}}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function A(t,e,r,i){if(e.flowing&&e.length===0&&!e.sync){e.awaitDrain=0;t.emit("data",r)}else{e.length+=e.objectMode?1:r.length;if(i)e.buffer.unshift(r);else e.buffer.push(r);if(e.needReadable)M(t)}L(t,e)}function R(t,e){var r;if(!s(e)&&typeof e!=="string"&&e!==undefined&&!t.objectMode){r=new d("chunk",["string","Buffer","Uint8Array"],e)}return r}S.prototype.isPaused=function(){return this._readableState.flowing===false};S.prototype.setEncoding=function(t){if(!v)v=q("string_decoder/").StringDecoder;var e=new v(t);this._readableState.decoder=e;this._readableState.encoding=this._readableState.decoder.encoding;var r=this._readableState.buffer.head;var i="";while(r!==null){i+=e.write(r.data);r=r.next}this._readableState.buffer.clear();if(i!=="")this._readableState.buffer.push(i);this._readableState.length=i.length;return this};var B=1073741824;function O(t){if(t>=B){t=B}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function P(t,e){if(t<=0||e.length===0&&e.ended)return 0;if(e.objectMode)return 1;if(t!==t){if(e.flowing&&e.length)return e.buffer.head.data.length;else return e.length}if(t>e.highWaterMark)e.highWaterMark=O(t);if(t<=e.length)return t;if(!e.ended){e.needReadable=true;return 0}return e.length}S.prototype.read=function(t){b("read",t);t=parseInt(t,10);var e=this._readableState;var r=t;if(t!==0)e.emittedReadable=false;if(t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended)){b("read: emitReadable",e.length,e.ended);if(e.length===0&&e.ended)V(this);else M(this);return null}t=P(t,e);if(t===0&&e.ended){if(e.length===0)V(this);return null}var i=e.needReadable;b("need readable",i);if(e.length===0||e.length-t<e.highWaterMark){i=true;b("length less than watermark",i)}if(e.ended||e.reading){i=false;b("reading or ended",i)}else if(i){b("do read");e.reading=true;e.sync=true;if(e.length===0)e.needReadable=true;this._read(e.highWaterMark);e.sync=false;if(!e.reading)t=P(r,e)}var n;if(t>0)n=Y(t,e);else n=null;if(n===null){e.needReadable=e.length<=e.highWaterMark;t=0}else{e.length-=t;e.awaitDrain=0}if(e.length===0){if(!e.ended)e.needReadable=true;if(r!==t&&e.ended)V(this)}if(n!==null)this.emit("data",n);return n};function I(t,e){b("onEofChunk");if(e.ended)return;if(e.decoder){var r=e.decoder.end();if(r&&r.length){e.buffer.push(r);e.length+=e.objectMode?1:r.length}}e.ended=true;if(e.sync){M(t)}else{e.needReadable=false;if(!e.emittedReadable){e.emittedReadable=true;j(t)}}}function M(t){var e=t._readableState;b("emitReadable",e.needReadable,e.emittedReadable);e.needReadable=false;if(!e.emittedReadable){b("emitReadable",e.flowing);e.emittedReadable=true;K.nextTick(j,t)}}function j(t){var e=t._readableState;b("emitReadable_",e.destroyed,e.length,e.ended);if(!e.destroyed&&(e.length||e.ended)){t.emit("readable");e.emittedReadable=false}e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark;z(t)}function L(t,e){if(!e.readingMore){e.readingMore=true;K.nextTick(D,t,e)}}function D(t,e){while(!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0)){var r=e.length;b("maybeReadMore read 0");t.read(0);if(r===e.length)break}e.readingMore=false}S.prototype._read=function(t){x(this,new g("_read()"))};S.prototype.pipe=function(r,t){var i=this;var n=this._readableState;switch(n.pipesCount){case 0:n.pipes=r;break;case 1:n.pipes=[n.pipes,r];break;default:n.pipes.push(r);break}n.pipesCount+=1;b("pipe count=%d opts=%j",n.pipesCount,t);var e=(!t||t.end!==false)&&r!==K.stdout&&r!==K.stderr;var s=e?a:g;if(n.endEmitted)K.nextTick(s);else i.once("end",s);r.on("unpipe",o);function o(t,e){b("onunpipe");if(t===i){if(e&&e.hasUnpiped===false){e.hasUnpiped=true;f()}}}function a(){b("onend");r.end()}var u=F(i);r.on("drain",u);var l=false;function f(){b("cleanup");r.removeListener("close",d);r.removeListener("finish",p);r.removeListener("drain",u);r.removeListener("error",c);r.removeListener("unpipe",o);i.removeListener("end",a);i.removeListener("end",g);i.removeListener("data",h);l=true;if(n.awaitDrain&&(!r._writableState||r._writableState.needDrain))u()}i.on("data",h);function h(t){b("ondata");var e=r.write(t);b("dest.write",e);if(e===false){if((n.pipesCount===1&&n.pipes===r||n.pipesCount>1&&Z(n.pipes,r)!==-1)&&!l){b("false write response, pause",n.awaitDrain);n.awaitDrain++}i.pause()}}function c(t){b("onerror",t);g();r.removeListener("error",c);if(y(r,"error")===0)x(r,t)}k(r,"error",c);function d(){r.removeListener("finish",p);g()}r.once("close",d);function p(){b("onfinish");r.removeListener("close",d);g()}r.once("finish",p);function g(){b("unpipe");i.unpipe(r)}r.emit("pipe",i);if(!n.flowing){b("pipe resume");i.resume()}return r};function F(r){return function t(){var e=r._readableState;b("pipeOnDrain",e.awaitDrain);if(e.awaitDrain)e.awaitDrain--;if(e.awaitDrain===0&&y(r,"data")){e.flowing=true;z(r)}}}S.prototype.unpipe=function(t){var e=this._readableState;var r={hasUnpiped:false};if(e.pipesCount===0)return this;if(e.pipesCount===1){if(t&&t!==e.pipes)return this;if(!t)t=e.pipes;e.pipes=null;e.pipesCount=0;e.flowing=false;if(t)t.emit("unpipe",this,r);return this}if(!t){var i=e.pipes;var n=e.pipesCount;e.pipes=null;e.pipesCount=0;e.flowing=false;for(var s=0;s<n;s++){i[s].emit("unpipe",this,{hasUnpiped:false})}return this}var o=Z(e.pipes,t);if(o===-1)return this;e.pipes.splice(o,1);e.pipesCount-=1;if(e.pipesCount===1)e.pipes=e.pipes[0];t.emit("unpipe",this,r);return this};S.prototype.on=function(t,e){var r=n.prototype.on.call(this,t,e);var i=this._readableState;if(t==="data"){i.readableListening=this.listenerCount("readable")>0;if(i.flowing!==false)this.resume()}else if(t==="readable"){if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.flowing=false;i.emittedReadable=false;b("on readable",i.length,i.reading);if(i.length){M(this)}else if(!i.reading){K.nextTick(H,this)}}}return r};S.prototype.addListener=S.prototype.on;S.prototype.removeListener=function(t,e){var r=n.prototype.removeListener.call(this,t,e);if(t==="readable"){K.nextTick(W,this)}return r};S.prototype.removeAllListeners=function(t){var e=n.prototype.removeAllListeners.apply(this,arguments);if(t==="readable"||t===undefined){K.nextTick(W,this)}return e};function W(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0;if(e.resumeScheduled&&!e.paused){e.flowing=true}else if(t.listenerCount("data")>0){t.resume()}}function H(t){b("readable nexttick read 0");t.read(0)}S.prototype.resume=function(){var t=this._readableState;if(!t.flowing){b("resume");t.flowing=!t.readableListening;N(this,t)}t.paused=false;return this};function N(t,e){if(!e.resumeScheduled){e.resumeScheduled=true;K.nextTick(U,t,e)}}function U(t,e){b("resume",e.reading);if(!e.reading){t.read(0)}e.resumeScheduled=false;t.emit("resume");z(t);if(e.flowing&&!e.reading)t.read(0)}S.prototype.pause=function(){b("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){b("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function z(t){var e=t._readableState;b("flow",e.flowing);while(e.flowing&&t.read()!==null){}}S.prototype.wrap=function(r){var i=this;var n=this._readableState;var s=false;r.on("end",function(){b("wrapped end");if(n.decoder&&!n.ended){var t=n.decoder.end();if(t&&t.length)i.push(t)}i.push(null)});r.on("data",function(t){b("wrapped data");if(n.decoder)t=n.decoder.write(t);if(n.objectMode&&(t===null||t===undefined))return;else if(!n.objectMode&&(!t||!t.length))return;var e=i.push(t);if(!e){s=true;r.pause()}});for(var t in r){if(this[t]===undefined&&typeof r[t]==="function"){this[t]=function t(e){return function t(){return r[e].apply(r,arguments)}}(t)}}for(var e=0;e<C.length;e++){r.on(C[e],this.emit.bind(this,C[e]))}this._read=function(t){b("wrapped _read",t);if(s){s=false;r.resume()}};return this};if(typeof Symbol==="function"){S.prototype[Symbol.asyncIterator]=function(){if(w===undefined){w=q("./internal/streams/async_iterator")}return w(this)}}Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:false,get:function t(){return this._readableState.highWaterMark}});Object.defineProperty(S.prototype,"readableBuffer",{enumerable:false,get:function t(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(S.prototype,"readableFlowing",{enumerable:false,get:function t(){return this._readableState.flowing},set:function t(e){if(this._readableState){this._readableState.flowing=e}}});S._fromList=Y;Object.defineProperty(S.prototype,"readableLength",{enumerable:false,get:function t(){return this._readableState.length}});function Y(t,e){if(e.length===0)return null;var r;if(e.objectMode)r=e.buffer.shift();else if(!t||t>=e.length){if(e.decoder)r=e.buffer.join("");else if(e.buffer.length===1)r=e.buffer.first();else r=e.buffer.concat(e.length);e.buffer.clear()}else{r=e.buffer.consume(t,e.decoder)}return r}function V(t){var e=t._readableState;b("endReadable",e.endEmitted);if(!e.endEmitted){e.ended=true;K.nextTick(G,e,t)}}function G(t,e){b("endReadableNT",t.endEmitted,t.length);if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end");if(t.autoDestroy){var r=e._writableState;if(!r||r.autoDestroy&&r.finished){e.destroy()}}}}if(typeof Symbol==="function"){S.from=function(t,e){if(_===undefined){_=q("./internal/streams/from")}return _(S,t,e)}}function Z(t,e){for(var r=0,i=t.length;r<i;r++){if(t[r]===e)return r}return-1}}).call(this)}).call(this,q("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../errors":182,"./_stream_duplex":183,"./internal/streams/async_iterator":188,"./internal/streams/buffer_list":189,"./internal/streams/destroy":190,"./internal/streams/from":192,"./internal/streams/state":194,"./internal/streams/stream":195,_process:179,buffer:147,events:151,inherits:160,"string_decoder/":196,util:144}],186:[function(t,e,r){"use strict";e.exports=f;var i=t("../errors").codes,n=i.ERR_METHOD_NOT_IMPLEMENTED,s=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0;var u=t("./_stream_duplex");t("inherits")(f,u);function l(t,e){var r=this._transformState;r.transforming=false;var i=r.writecb;if(i===null){return this.emit("error",new s)}r.writechunk=null;r.writecb=null;if(e!=null)this.push(e);i(t);var n=this._readableState;n.reading=false;if(n.needReadable||n.length<n.highWaterMark){this._read(n.highWaterMark)}}function f(t){if(!(this instanceof f))return new f(t);u.call(this,t);this._transformState={afterTransform:l.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(t){if(typeof t.transform==="function")this._transform=t.transform;if(typeof t.flush==="function")this._flush=t.flush}this.on("prefinish",h)}function h(){var r=this;if(typeof this._flush==="function"&&!this._readableState.destroyed){this._flush(function(t,e){c(r,t,e)})}else{c(this,null,null)}}f.prototype.push=function(t,e){this._transformState.needTransform=false;return u.prototype.push.call(this,t,e)};f.prototype._transform=function(t,e,r){r(new n("_transform()"))};f.prototype._write=function(t,e,r){var i=this._transformState;i.writecb=r;i.writechunk=t;i.writeencoding=e;if(!i.transforming){var n=this._readableState;if(i.needTransform||n.needReadable||n.length<n.highWaterMark)this._read(n.highWaterMark)}};f.prototype._read=function(t){var e=this._transformState;if(e.writechunk!==null&&!e.transforming){e.transforming=true;this._transform(e.writechunk,e.writeencoding,e.afterTransform)}else{e.needTransform=true}};f.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,function(t){e(t)})};function c(t,e,r){if(e)return t.emit("error",e);if(r!=null)t.push(r);if(t._writableState.length)throw new a;if(t._transformState.transforming)throw new o;return t.push(null)}},{"../errors":182,"./_stream_duplex":183,inherits:160}],187:[function(V,G,t){(function(z,Y){(function(){"use strict";G.exports=T;function t(t,e,r){this.chunk=t;this.encoding=e;this.callback=r;this.next=null}function c(t){var e=this;this.next=null;this.entry=null;this.finish=function(){U(e,t)}}var n;T.WritableState=C;var e={deprecate:V("util-deprecate")};var r=V("./internal/streams/stream");var o=V("buffer").Buffer;var i=Y.Uint8Array||function(){};function a(t){return o.from(t)}function u(t){return o.isBuffer(t)||t instanceof i}var s=V("./internal/streams/destroy");var l=V("./internal/streams/state"),f=l.getHighWaterMark;var h=V("../errors").codes,d=h.ERR_INVALID_ARG_TYPE,p=h.ERR_METHOD_NOT_IMPLEMENTED,g=h.ERR_MULTIPLE_CALLBACK,y=h.ERR_STREAM_CANNOT_PIPE,b=h.ERR_STREAM_DESTROYED,m=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,w=h.ERR_UNKNOWN_ENCODING;var _=s.errorOrDestroy;V("inherits")(T,r);function x(){}function C(t,e,r){n=n||V("./_stream_duplex");t=t||{};if(typeof r!=="boolean")r=e instanceof n;this.objectMode=!!t.objectMode;if(r)this.objectMode=this.objectMode||!!t.writableObjectMode;this.highWaterMark=f(this,t,"writableHighWaterMark",r);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var i=t.decodeStrings===false;this.decodeStrings=!i;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(t){I(e,t)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new c(this)}C.prototype.getBuffer=function t(){var e=this.bufferedRequest;var r=[];while(e){r.push(e);e=e.next}return r};(function(){try{Object.defineProperty(C.prototype,"buffer",{get:e.deprecate(function t(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(t){}})();var k;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){k=Function.prototype[Symbol.hasInstance];Object.defineProperty(T,Symbol.hasInstance,{value:function t(e){if(k.call(this,e))return true;if(this!==T)return false;return e&&e._writableState instanceof C}})}else{k=function t(e){return e instanceof this}}function T(t){n=n||V("./_stream_duplex");var e=this instanceof n;if(!e&&!k.call(T,this))return new T(t);this._writableState=new C(t,this,e);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev;if(typeof t.destroy==="function")this._destroy=t.destroy;if(typeof t.final==="function")this._final=t.final}r.call(this)}T.prototype.pipe=function(){_(this,new y)};function S(t,e){var r=new v;_(t,r);z.nextTick(e,r)}function E(t,e,r,i){var n;if(r===null){n=new m}else if(typeof r!=="string"&&!e.objectMode){n=new d("chunk",["string","Buffer"],r)}if(n){_(t,n);z.nextTick(i,n);return false}return true}T.prototype.write=function(t,e,r){var i=this._writableState;var n=false;var s=!i.objectMode&&u(t);if(s&&!o.isBuffer(t)){t=a(t)}if(typeof e==="function"){r=e;e=null}if(s)e="buffer";else if(!e)e=i.defaultEncoding;if(typeof r!=="function")r=x;if(i.ending)S(this,r);else if(s||E(this,i,t,r)){i.pendingcb++;n=R(this,i,s,t,e,r)}return n};T.prototype.cork=function(){this._writableState.corked++};T.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest)L(this,t)}};T.prototype.setDefaultEncoding=function t(e){if(typeof e==="string")e=e.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(T.prototype,"writableBuffer",{enumerable:false,get:function t(){return this._writableState&&this._writableState.getBuffer()}});function A(t,e,r){if(!t.objectMode&&t.decodeStrings!==false&&typeof e==="string"){e=o.from(e,r)}return e}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:false,get:function t(){return this._writableState.highWaterMark}});function R(t,e,r,i,n,s){if(!r){var o=A(e,i,n);if(i!==o){r=true;n="buffer";i=o}}var a=e.objectMode?1:i.length;e.length+=a;var u=e.length<e.highWaterMark;if(!u)e.needDrain=true;if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null};if(l){l.next=e.lastBufferedRequest}else{e.bufferedRequest=e.lastBufferedRequest}e.bufferedRequestCount+=1}else{B(t,e,false,a,i,n,s)}return u}function B(t,e,r,i,n,s,o){e.writelen=i;e.writecb=o;e.writing=true;e.sync=true;if(e.destroyed)e.onwrite(new b("write"));else if(r)t._writev(n,e.onwrite);else t._write(n,s,e.onwrite);e.sync=false}function O(t,e,r,i,n){--e.pendingcb;if(r){z.nextTick(n,i);z.nextTick(H,t,e);t._writableState.errorEmitted=true;_(t,i)}else{n(i);t._writableState.errorEmitted=true;_(t,i);H(t,e)}}function P(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}function I(t,e){var r=t._writableState;var i=r.sync;var n=r.writecb;if(typeof n!=="function")throw new g;P(r);if(e)O(t,r,i,e,n);else{var s=D(r)||t.destroyed;if(!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest){L(t,r)}if(i){z.nextTick(M,t,r,s,n)}else{M(t,r,s,n)}}}function M(t,e,r,i){if(!r)j(t,e);e.pendingcb--;i();H(t,e)}function j(t,e){if(e.length===0&&e.needDrain){e.needDrain=false;t.emit("drain")}}function L(t,e){e.bufferProcessing=true;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount;var n=new Array(i);var s=e.corkedRequestsFree;s.entry=r;var o=0;var a=true;while(r){n[o]=r;if(!r.isBuf)a=false;r=r.next;o+=1}n.allBuffers=a;B(t,e,true,e.length,n,"",s.finish);e.pendingcb++;e.lastBufferedRequest=null;if(s.next){e.corkedRequestsFree=s.next;s.next=null}else{e.corkedRequestsFree=new c(e)}e.bufferedRequestCount=0}else{while(r){var u=r.chunk;var l=r.encoding;var f=r.callback;var h=e.objectMode?1:u.length;B(t,e,false,h,u,l,f);r=r.next;e.bufferedRequestCount--;if(e.writing){break}}if(r===null)e.lastBufferedRequest=null}e.bufferedRequest=r;e.bufferProcessing=false}T.prototype._write=function(t,e,r){r(new p("_write()"))};T.prototype._writev=null;T.prototype.end=function(t,e,r){var i=this._writableState;if(typeof t==="function"){r=t;t=null;e=null}else if(typeof e==="function"){r=e;e=null}if(t!==null&&t!==undefined)this.write(t,e);if(i.corked){i.corked=1;this.uncork()}if(!i.ending)N(this,i,r);return this};Object.defineProperty(T.prototype,"writableLength",{enumerable:false,get:function t(){return this._writableState.length}});function D(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function F(e,r){e._final(function(t){r.pendingcb--;if(t){_(e,t)}r.prefinished=true;e.emit("prefinish");H(e,r)})}function W(t,e){if(!e.prefinished&&!e.finalCalled){if(typeof t._final==="function"&&!e.destroyed){e.pendingcb++;e.finalCalled=true;z.nextTick(F,t,e)}else{e.prefinished=true;t.emit("prefinish")}}}function H(t,e){var r=D(e);if(r){W(t,e);if(e.pendingcb===0){e.finished=true;t.emit("finish");if(e.autoDestroy){var i=t._readableState;if(!i||i.autoDestroy&&i.endEmitted){t.destroy()}}}}return r}function N(t,e,r){e.ending=true;H(t,e);if(r){if(e.finished)z.nextTick(r);else t.once("finish",r)}e.ended=true;t.writable=false}function U(t,e,r){var i=t.entry;t.entry=null;while(i){var n=i.callback;e.pendingcb--;n(r);i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(T.prototype,"destroyed",{enumerable:false,get:function t(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function t(e){if(!this._writableState){return}this._writableState.destroyed=e}});T.prototype.destroy=s.destroy;T.prototype._undestroy=s.undestroy;T.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,V("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../errors":182,"./_stream_duplex":183,"./internal/streams/destroy":190,"./internal/streams/state":194,"./internal/streams/stream":195,_process:179,buffer:147,inherits:160,"util-deprecate":199}],188:[function(m,v,t){(function(b){(function(){"use strict";var t;function i(t,e,r){if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}var s=m("./end-of-stream");var o=Symbol("lastResolve");var a=Symbol("lastReject");var u=Symbol("error");var l=Symbol("ended");var f=Symbol("lastPromise");var h=Symbol("handlePromise");var c=Symbol("stream");function d(t,e){return{value:t,done:e}}function e(t){var e=t[o];if(e!==null){var r=t[c].read();if(r!==null){t[f]=null;t[o]=null;t[a]=null;e(d(r,false))}}}function p(t){b.nextTick(e,t)}function g(r,i){return function(t,e){r.then(function(){if(i[l]){t(d(undefined,true));return}i[h](t,e)},e)}}var r=Object.getPrototypeOf(function(){});var y=Object.setPrototypeOf((t={get stream(){return this[c]},next:function t(){var r=this;var e=this[u];if(e!==null){return Promise.reject(e)}if(this[l]){return Promise.resolve(d(undefined,true))}if(this[c].destroyed){return new Promise(function(t,e){b.nextTick(function(){if(r[u]){e(r[u])}else{t(d(undefined,true))}})})}var i=this[f];var n;if(i){n=new Promise(g(i,this))}else{var s=this[c].read();if(s!==null){return Promise.resolve(d(s,false))}n=new Promise(this[h])}this[f]=n;return n}},i(t,Symbol.asyncIterator,function(){return this}),i(t,"return",function t(){var i=this;return new Promise(function(e,r){i[c].destroy(null,function(t){if(t){r(t);return}e(d(undefined,true))})})}),t),r);var n=function t(e){var r;var n=Object.create(y,(r={},i(r,c,{value:e,writable:true}),i(r,o,{value:null,writable:true}),i(r,a,{value:null,writable:true}),i(r,u,{value:null,writable:true}),i(r,l,{value:e._readableState.endEmitted,writable:true}),i(r,h,{value:function t(e,r){var i=n[c].read();if(i){n[f]=null;n[o]=null;n[a]=null;e(d(i,false))}else{n[o]=e;n[a]=r}},writable:true}),r));n[f]=null;s(e,function(t){if(t&&t.code!=="ERR_STREAM_PREMATURE_CLOSE"){var e=n[a];if(e!==null){n[f]=null;n[o]=null;n[a]=null;e(t)}n[u]=t;return}var r=n[o];if(r!==null){n[f]=null;n[o]=null;n[a]=null;r(d(undefined,true))}n[l]=true});e.on("readable",p.bind(null,n));return n};v.exports=n}).call(this)}).call(this,m("_process"))},{"./end-of-stream":191,_process:179}],189:[function(t,e,r){"use strict";function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);if(t)i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable});r.push.apply(r,i)}return r}function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};if(t%2){i(Object(r),true).forEach(function(t){s(e,t,r[t])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}}return e}function s(t,e,r){if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function o(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function a(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(t,i.key,i)}}function u(t,e,r){if(e)a(t.prototype,e);if(r)a(t,r);return t}var l=t("buffer"),f=l.Buffer;var h=t("util"),c=h.inspect;var d=c&&c.custom||"inspect";function p(t,e,r){f.prototype.copy.call(t,e,r)}e.exports=function(){function t(){o(this,t);this.head=null;this.tail=null;this.length=0}u(t,[{key:"push",value:function t(e){var r={data:e,next:null};if(this.length>0)this.tail.next=r;else this.head=r;this.tail=r;++this.length}},{key:"unshift",value:function t(e){var r={data:e,next:this.head};if(this.length===0)this.tail=r;this.head=r;++this.length}},{key:"shift",value:function t(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function t(){this.head=this.tail=null;this.length=0}},{key:"join",value:function t(e){if(this.length===0)return"";var r=this.head;var i=""+r.data;while(r=r.next){i+=e+r.data}return i}},{key:"concat",value:function t(e){if(this.length===0)return f.alloc(0);var r=f.allocUnsafe(e>>>0);var i=this.head;var n=0;while(i){p(i.data,r,n);n+=i.data.length;i=i.next}return r}},{key:"consume",value:function t(e,r){var i;if(e<this.head.data.length){i=this.head.data.slice(0,e);this.head.data=this.head.data.slice(e)}else if(e===this.head.data.length){i=this.shift()}else{i=r?this._getString(e):this._getBuffer(e)}return i}},{key:"first",value:function t(){return this.head.data}},{key:"_getString",value:function t(e){var r=this.head;var i=1;var n=r.data;e-=n.length;while(r=r.next){var s=r.data;var o=e>s.length?s.length:e;if(o===s.length)n+=s;else n+=s.slice(0,e);e-=o;if(e===0){if(o===s.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=s.slice(o)}break}++i}this.length-=i;return n}},{key:"_getBuffer",value:function t(e){var r=f.allocUnsafe(e);var i=this.head;var n=1;i.data.copy(r);e-=i.data.length;while(i=i.next){var s=i.data;var o=e>s.length?s.length:e;s.copy(r,r.length-e,0,o);e-=o;if(e===0){if(o===s.length){++n;if(i.next)this.head=i.next;else this.head=this.tail=null}else{this.head=i;i.data=s.slice(o)}break}++n}this.length-=n;return r}},{key:d,value:function t(e,r){return c(this,n({},r,{depth:0,customInspect:false}))}}]);return t}()},{buffer:147,util:144}],190:[function(t,i,e){(function(u){(function(){"use strict";function t(t,e){var r=this;var i=this._readableState&&this._readableState.destroyed;var n=this._writableState&&this._writableState.destroyed;if(i||n){if(e){e(t)}else if(t){if(!this._writableState){u.nextTick(a,this,t)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;u.nextTick(a,this,t)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,function(t){if(!e&&t){if(!r._writableState){u.nextTick(s,r,t)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;u.nextTick(s,r,t)}else{u.nextTick(o,r)}}else if(e){u.nextTick(o,r);e(t)}else{u.nextTick(o,r)}});return this}function s(t,e){a(t,e);o(t)}function o(t){if(t._writableState&&!t._writableState.emitClose)return;if(t._readableState&&!t._readableState.emitClose)return;t.emit("close")}function e(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function a(t,e){t.emit("error",e)}function r(t,e){var r=t._readableState;var i=t._writableState;if(r&&r.autoDestroy||i&&i.autoDestroy)t.destroy(e);else t.emit("error",e)}i.exports={destroy:t,undestroy:e,errorOrDestroy:r}}).call(this)}).call(this,t("_process"))},{_process:179}],191:[function(t,e,r){"use strict";var d=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function p(i){var n=false;return function(){if(n)return;n=true;for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}i.apply(this,e)}}function g(){}function y(t){return t.setHeader&&typeof t.abort==="function"}function b(r,t,i){if(typeof t==="function")return b(r,null,t);if(!t)t={};i=p(i||g);var n=t.readable||t.readable!==false&&r.readable;var s=t.writable||t.writable!==false&&r.writable;var e=function t(){if(!r.writable)a()};var o=r._writableState&&r._writableState.finished;var a=function t(){s=false;o=true;if(!n)i.call(r)};var u=r._readableState&&r._readableState.endEmitted;var l=function t(){n=false;u=true;if(!s)i.call(r)};var f=function t(e){i.call(r,e)};var h=function t(){var e;if(n&&!u){if(!r._readableState||!r._readableState.ended)e=new d;return i.call(r,e)}if(s&&!o){if(!r._writableState||!r._writableState.ended)e=new d;return i.call(r,e)}};var c=function t(){r.req.on("finish",a)};if(y(r)){r.on("complete",a);r.on("abort",h);if(r.req)c();else r.on("request",c)}else if(s&&!r._writableState){r.on("end",e);r.on("close",e)}r.on("end",l);r.on("finish",a);if(t.error!==false)r.on("error",f);r.on("close",h);return function(){r.removeListener("complete",a);r.removeListener("abort",h);r.removeListener("request",c);if(r.req)r.req.removeListener("finish",a);r.removeListener("end",e);r.removeListener("close",e);r.removeListener("finish",a);r.removeListener("end",l);r.removeListener("error",f);r.removeListener("close",h)}}e.exports=b},{"../../../errors":182}],192:[function(t,e,r){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],193:[function(o,t,e){"use strict";var a;function u(t){var e=false;return function(){if(e)return;e=true;t.apply(void 0,arguments)}}var r=o("../../../errors").codes,i=r.ERR_MISSING_ARGS,l=r.ERR_STREAM_DESTROYED;function n(t){if(t)throw t}function f(t){return t.setHeader&&typeof t.abort==="function"}function h(e,t,r,i){i=u(i);var n=false;e.on("close",function(){n=true});if(a===undefined)a=o("./end-of-stream");a(e,{readable:t,writable:r},function(t){if(t)return i(t);n=true;i()});var s=false;return function(t){if(n)return;if(s)return;s=true;if(f(e))return e.abort();if(typeof e.destroy==="function")return e.destroy();i(t||new l("pipe"))}}function c(t){t()}function d(t,e){return t.pipe(e)}function p(t){if(!t.length)return n;if(typeof t[t.length-1]!=="function")return n;return t.pop()}function s(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var s=p(n);if(Array.isArray(n[0]))n=n[0];if(n.length<2){throw new i("streams")}var o;var a=n.map(function(t,e){var r=e<n.length-1;var i=e>0;return h(t,r,i,function(t){if(!o)o=t;if(t)a.forEach(c);if(r)return;a.forEach(c);s(o)})});return n.reduce(d)}t.exports=s},{"../../../errors":182,"./end-of-stream":191}],194:[function(t,e,r){"use strict";var o=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;function a(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function i(t,e,r,i){var n=a(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new o(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}e.exports={getHighWaterMark:i}},{"../../../errors":182}],195:[function(t,e,r){e.exports=t("events").EventEmitter},{events:151}],196:[function(t,e,r){"use strict";var i=t("safe-buffer").Buffer;var n=i.isEncoding||function(t){t=""+t;switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function s(t){if(!t)return"utf8";var e;while(true){switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase();e=true}}}function o(t){var e=s(t);if(typeof e!=="string"&&(i.isEncoding===n||!n(t)))throw new Error("Unknown encoding: "+t);return e||t}r.StringDecoder=a;function a(t){this.encoding=o(t);var e;switch(this.encoding){case"utf16le":this.text=p;this.end=g;e=4;break;case"utf8":this.fillLast=h;e=4;break;case"base64":this.text=y;this.end=b;e=3;break;default:this.write=m;this.end=v;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=i.allocUnsafe(e)}a.prototype.write=function(t){if(t.length===0)return"";var e;var r;if(this.lastNeed){e=this.fillLast(t);if(e===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r<t.length)return e?e+this.text(t,r):this.text(t,r);return e||""};a.prototype.end=d;a.prototype.text=c;a.prototype.fillLast=function(t){if(this.lastNeed<=t.length){t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length);this.lastNeed-=t.length};function u(t){if(t<=127)return 0;else if(t>>5===6)return 2;else if(t>>4===14)return 3;else if(t>>3===30)return 4;return t>>6===2?-1:-2}function l(t,e,r){var i=e.length-1;if(i<r)return 0;var n=u(e[i]);if(n>=0){if(n>0)t.lastNeed=n-1;return n}if(--i<r||n===-2)return 0;n=u(e[i]);if(n>=0){if(n>0)t.lastNeed=n-2;return n}if(--i<r||n===-2)return 0;n=u(e[i]);if(n>=0){if(n>0){if(n===2)n=0;else t.lastNeed=n-3}return n}return 0}function f(t,e,r){if((e[0]&192)!==128){t.lastNeed=0;return"�"}if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128){t.lastNeed=1;return"�"}if(t.lastNeed>2&&e.length>2){if((e[2]&192)!==128){t.lastNeed=2;return"�"}}}}function h(t){var e=this.lastTotal-this.lastNeed;var r=f(this,t,e);if(r!==undefined)return r;if(this.lastNeed<=t.length){t.copy(this.lastChar,e,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,e,0,t.length);this.lastNeed-=t.length}function c(t,e){var r=l(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);t.copy(this.lastChar,0,i);return t.toString("utf8",e,i)}function d(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+"�";return e}function p(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=t[t.length-1];return t.toString("utf16le",e,t.length-1)}function g(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function y(t,e){var r=(t.length-e)%3;if(r===0)return t.toString("base64",e);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=t[t.length-1]}else{this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1]}return t.toString("base64",e,t.length-r)}function b(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed)return e+this.lastChar.toString("base64",0,3-this.lastNeed);return e}function m(t){return t.toString(this.encoding)}function v(t){return t&&t.length?this.write(t):""}},{"safe-buffer":180}],197:[function(u,t,l){(function(i,a){(function(){var t=u("process/browser.js").nextTick;var e=Function.prototype.apply;var n=Array.prototype.slice;var s={};var o=0;l.setTimeout=function(){return new r(e.call(setTimeout,window,arguments),clearTimeout)};l.setInterval=function(){return new r(e.call(setInterval,window,arguments),clearInterval)};l.clearTimeout=l.clearInterval=function(t){t.close()};function r(t,e){this._id=t;this._clearFn=e}r.prototype.unref=r.prototype.ref=function(){};r.prototype.close=function(){this._clearFn.call(window,this._id)};l.enroll=function(t,e){clearTimeout(t._idleTimeoutId);t._idleTimeout=e};l.unenroll=function(t){clearTimeout(t._idleTimeoutId);t._idleTimeout=-1};l._unrefActive=l.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;if(t>=0){e._idleTimeoutId=setTimeout(function t(){if(e._onTimeout)e._onTimeout()},t)}};l.setImmediate=typeof i==="function"?i:function(e){var r=o++;var i=arguments.length<2?false:n.call(arguments,1);s[r]=true;t(function t(){if(s[r]){if(i){e.apply(null,i)}else{e.call(null)}l.clearImmediate(r)}});return r};l.clearImmediate=typeof a==="function"?a:function(t){delete s[t]}}).call(this)}).call(this,u("timers").setImmediate,u("timers").clearImmediate)},{"process/browser.js":179,timers:197}],198:[function(t,e,r){r.isatty=function(){return false};function i(){throw new Error("tty.ReadStream is not implemented")}r.ReadStream=i;function n(){throw new Error("tty.WriteStream is not implemented")}r.WriteStream=n},{}],199:[function(t,e,r){(function(r){(function(){e.exports=t;function t(t,e){if(n("noDeprecation")){return t}var r=false;function i(){if(!r){if(n("throwDeprecation")){throw new Error(e)}else if(n("traceDeprecation")){console.trace(e)}else{console.warn(e)}r=true}return t.apply(this,arguments)}return i}function n(t){try{if(!r.localStorage)return false}catch(t){return false}var e=r.localStorage[t];if(null==e)return false;return String(e).toLowerCase()==="true"}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],200:[function(t,e,r){arguments[4][140][0].apply(r,arguments)},{dup:140}],201:[function(t,e,r){"use strict";var i=t("is-arguments");var n=t("is-generator-function");var s=t("which-typed-array");var o=t("is-typed-array");function a(t){return t.call.bind(t)}var u=typeof BigInt!=="undefined";var l=typeof Symbol!=="undefined";var f=a(Object.prototype.toString);var h=a(Number.prototype.valueOf);var c=a(String.prototype.valueOf);var d=a(Boolean.prototype.valueOf);if(u){var p=a(BigInt.prototype.valueOf)}if(l){var g=a(Symbol.prototype.valueOf)}function y(t,e){if(typeof t!=="object"){return false}try{e(t);return true}catch(t){return false}}r.isArgumentsObject=i;r.isGeneratorFunction=n;r.isTypedArray=o;function b(t){return typeof Promise!=="undefined"&&t instanceof Promise||t!==null&&typeof t==="object"&&typeof t.then==="function"&&typeof t.catch==="function"}r.isPromise=b;function m(t){if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){return ArrayBuffer.isView(t)}return o(t)||N(t)}r.isArrayBufferView=m;function v(t){return s(t)==="Uint8Array"}r.isUint8Array=v;function w(t){return s(t)==="Uint8ClampedArray"}r.isUint8ClampedArray=w;function _(t){return s(t)==="Uint16Array"}r.isUint16Array=_;function x(t){return s(t)==="Uint32Array"}r.isUint32Array=x;function C(t){return s(t)==="Int8Array"}r.isInt8Array=C;function k(t){return s(t)==="Int16Array"}r.isInt16Array=k;function T(t){return s(t)==="Int32Array"}r.isInt32Array=T;function S(t){return s(t)==="Float32Array"}r.isFloat32Array=S;function E(t){return s(t)==="Float64Array"}r.isFloat64Array=E;function A(t){return s(t)==="BigInt64Array"}r.isBigInt64Array=A;function R(t){return s(t)==="BigUint64Array"}r.isBigUint64Array=R;function B(t){return f(t)==="[object Map]"}B.working=typeof Map!=="undefined"&&B(new Map);function O(t){if(typeof Map==="undefined"){return false}return B.working?B(t):t instanceof Map}r.isMap=O;function P(t){return f(t)==="[object Set]"}P.working=typeof Set!=="undefined"&&P(new Set);function I(t){if(typeof Set==="undefined"){return false}return P.working?P(t):t instanceof Set}r.isSet=I;function M(t){return f(t)==="[object WeakMap]"}M.working=typeof WeakMap!=="undefined"&&M(new WeakMap);function j(t){if(typeof WeakMap==="undefined"){return false}return M.working?M(t):t instanceof WeakMap}r.isWeakMap=j;function L(t){return f(t)==="[object WeakSet]"}L.working=typeof WeakSet!=="undefined"&&L(new WeakSet);function D(t){return L(t)}r.isWeakSet=D;function F(t){return f(t)==="[object ArrayBuffer]"}F.working=typeof ArrayBuffer!=="undefined"&&F(new ArrayBuffer);function W(t){if(typeof ArrayBuffer==="undefined"){return false}return F.working?F(t):t instanceof ArrayBuffer}r.isArrayBuffer=W;function H(t){return f(t)==="[object DataView]"}H.working=typeof ArrayBuffer!=="undefined"&&typeof DataView!=="undefined"&&H(new DataView(new ArrayBuffer(1),0,1));function N(t){if(typeof DataView==="undefined"){return false}return H.working?H(t):t instanceof DataView}r.isDataView=N;function U(t){return f(t)==="[object SharedArrayBuffer]"}U.working=typeof SharedArrayBuffer!=="undefined"&&U(new SharedArrayBuffer);function z(t){if(typeof SharedArrayBuffer==="undefined"){return false}return U.working?U(t):t instanceof SharedArrayBuffer}r.isSharedArrayBuffer=z;function Y(t){return f(t)==="[object AsyncFunction]"}r.isAsyncFunction=Y;function V(t){return f(t)==="[object Map Iterator]"}r.isMapIterator=V;function G(t){return f(t)==="[object Set Iterator]"}r.isSetIterator=G;function Z(t){return f(t)==="[object Generator]"}r.isGeneratorObject=Z;function K(t){return f(t)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=K;function X(t){return y(t,h)}r.isNumberObject=X;function q(t){return y(t,c)}r.isStringObject=q;function J(t){return y(t,d)}r.isBooleanObject=J;function $(t){return u&&y(t,p)}r.isBigIntObject=$;function Q(t){return l&&y(t,g)}r.isSymbolObject=Q;function tt(t){return X(t)||q(t)||J(t)||$(t)||Q(t)}r.isBoxedPrimitive=tt;function et(t){return typeof Uint8Array!=="undefined"&&(W(t)||z(t))}r.isAnyArrayBuffer=et;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(r,t,{enumerable:false,value:function(){throw new Error(t+" is not supported in userland")}})})},{"is-arguments":161,"is-generator-function":163,"is-typed-array":164,"which-typed-array":203}],202:[function(F,t,W){(function(D){(function(){var r=Object.getOwnPropertyDescriptors||function t(e){var r=Object.keys(e);var i={};for(var n=0;n<r.length;n++){i[r[n]]=Object.getOwnPropertyDescriptor(e,r[n])}return i};var a=/%[sdj%]/g;W.format=function(t){if(!_(t)){var e=[];for(var r=0;r<arguments.length;r++){e.push(u(arguments[r]))}return e.join(" ")}var r=1;var i=arguments;var n=i.length;var s=String(t).replace(a,function(t){if(t==="%%")return"%";if(r>=n)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(t){return"[Circular]"}default:return t}});for(var o=i[r];r<n;o=i[++r]){if(l(o)||!k(o)){s+=" "+o}else{s+=" "+u(o)}}return s};W.deprecate=function(t,e){if(typeof D!=="undefined"&&D.noDeprecation===true){return t}if(typeof D==="undefined"){return function(){return W.deprecate(t,e).apply(this,arguments)}}var r=false;function i(){if(!r){if(D.throwDeprecation){throw new Error(e)}else if(D.traceDeprecation){console.trace(e)}else{console.error(e)}r=true}return t.apply(this,arguments)}return i};var t={};var i=/^$/;if(D.env.NODE_DEBUG){var e=D.env.NODE_DEBUG;e=e.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase();i=new RegExp("^"+e+"$","i")}W.debuglog=function(e){e=e.toUpperCase();if(!t[e]){if(i.test(e)){var r=D.pid;t[e]=function(){var t=W.format.apply(W,arguments);console.error("%s %d: %s",e,r,t)}}else{t[e]=function(){}}}return t[e]};function u(t,e){var r={seen:[],stylize:s};if(arguments.length>=3)r.depth=arguments[2];if(arguments.length>=4)r.colors=arguments[3];if(o(e)){r.showHidden=e}else if(e){W._extend(r,e)}if(x(r.showHidden))r.showHidden=false;if(x(r.depth))r.depth=2;if(x(r.colors))r.colors=false;if(x(r.customInspect))r.customInspect=true;if(r.colors)r.stylize=n;return p(r,t,r.depth)}W.inspect=u;u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(t,e){var r=u.styles[e];if(r){return"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m"}else{return t}}function s(t,e){return t}function d(t){var r={};t.forEach(function(t,e){r[t]=true});return r}function p(e,r,i){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==W.inspect&&!(r.constructor&&r.constructor.prototype===r)){var t=r.inspect(i,e);if(!_(t)){t=p(e,t,i)}return t}var n=g(e,r);if(n){return n}var s=Object.keys(r);var o=d(s);if(e.showHidden){s=Object.getOwnPropertyNames(r)}if(S(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return y(r)}if(s.length===0){if(E(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(C(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}if(T(r)){return e.stylize(Date.prototype.toString.call(r),"date")}if(S(r)){return y(r)}}var u="",l=false,f=["{","}"];if(w(r)){l=true;f=["[","]"]}if(E(r)){var h=r.name?": "+r.name:"";u=" [Function"+h+"]"}if(C(r)){u=" "+RegExp.prototype.toString.call(r)}if(T(r)){u=" "+Date.prototype.toUTCString.call(r)}if(S(r)){u=" "+y(r)}if(s.length===0&&(!l||r.length==0)){return f[0]+u+f[1]}if(i<0){if(C(r)){return e.stylize(RegExp.prototype.toString.call(r),"regexp")}else{return e.stylize("[Object]","special")}}e.seen.push(r);var c;if(l){c=b(e,r,i,o,s)}else{c=s.map(function(t){return m(e,r,i,o,t,l)})}e.seen.pop();return v(c,u,f)}function g(t,e){if(x(e))return t.stylize("undefined","undefined");if(_(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(h(e))return t.stylize(""+e,"number");if(o(e))return t.stylize(""+e,"boolean");if(l(e))return t.stylize("null","null")}function y(t){return"["+Error.prototype.toString.call(t)+"]"}function b(e,r,i,n,t){var s=[];for(var o=0,a=r.length;o<a;++o){if(I(r,String(o))){s.push(m(e,r,i,n,String(o),true))}else{s.push("")}}t.forEach(function(t){if(!t.match(/^\d+$/)){s.push(m(e,r,i,n,t,true))}});return s}function m(t,e,r,i,n,s){var o,a,u;u=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]};if(u.get){if(u.set){a=t.stylize("[Getter/Setter]","special")}else{a=t.stylize("[Getter]","special")}}else{if(u.set){a=t.stylize("[Setter]","special")}}if(!I(i,n)){o="["+n+"]"}if(!a){if(t.seen.indexOf(u.value)<0){if(l(r)){a=p(t,u.value,null)}else{a=p(t,u.value,r-1)}if(a.indexOf("\n")>-1){if(s){a=a.split("\n").map(function(t){return"  "+t}).join("\n").substr(2)}else{a="\n"+a.split("\n").map(function(t){return"   "+t}).join("\n")}}}else{a=t.stylize("[Circular]","special")}}if(x(o)){if(s&&n.match(/^\d+$/)){return a}o=JSON.stringify(""+n);if(o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){o=o.substr(1,o.length-2);o=t.stylize(o,"name")}else{o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");o=t.stylize(o,"string")}}return o+": "+a}function v(t,e,r){var i=0;var n=t.reduce(function(t,e){i++;if(e.indexOf("\n")>=0)i++;return t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60){return r[0]+(e===""?"":e+"\n ")+" "+t.join(",\n  ")+" "+r[1]}return r[0]+e+" "+t.join(", ")+" "+r[1]}W.types=F("./support/types");function w(t){return Array.isArray(t)}W.isArray=w;function o(t){return typeof t==="boolean"}W.isBoolean=o;function l(t){return t===null}W.isNull=l;function f(t){return t==null}W.isNullOrUndefined=f;function h(t){return typeof t==="number"}W.isNumber=h;function _(t){return typeof t==="string"}W.isString=_;function c(t){return typeof t==="symbol"}W.isSymbol=c;function x(t){return t===void 0}W.isUndefined=x;function C(t){return k(t)&&R(t)==="[object RegExp]"}W.isRegExp=C;W.types.isRegExp=C;function k(t){return typeof t==="object"&&t!==null}W.isObject=k;function T(t){return k(t)&&R(t)==="[object Date]"}W.isDate=T;W.types.isDate=T;function S(t){return k(t)&&(R(t)==="[object Error]"||t instanceof Error)}W.isError=S;W.types.isNativeError=S;function E(t){return typeof t==="function"}W.isFunction=E;function A(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}W.isPrimitive=A;W.isBuffer=F("./support/isBuffer");function R(t){return Object.prototype.toString.call(t)}function B(t){return t<10?"0"+t.toString(10):t.toString(10)}var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var t=new Date;var e=[B(t.getHours()),B(t.getMinutes()),B(t.getSeconds())].join(":");return[t.getDate(),O[t.getMonth()],e].join(" ")}W.log=function(){console.log("%s - %s",P(),W.format.apply(W,arguments))};W.inherits=F("inherits");W._extend=function(t,e){if(!e||!k(e))return t;var r=Object.keys(e);var i=r.length;while(i--){t[r[i]]=e[r[i]]}return t};function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var M=typeof Symbol!=="undefined"?Symbol("util.promisify.custom"):undefined;W.promisify=function t(s){if(typeof s!=="function")throw new TypeError('The "original" argument must be of type Function');if(M&&s[M]){var e=s[M];if(typeof e!=="function"){throw new TypeError('The "util.promisify.custom" argument must be of type Function')}Object.defineProperty(e,M,{value:e,enumerable:false,writable:false,configurable:true});return e}function e(){var r,i;var t=new Promise(function(t,e){r=t;i=e});var e=[];for(var n=0;n<arguments.length;n++){e.push(arguments[n])}e.push(function(t,e){if(t){i(t)}else{r(e)}});try{s.apply(this,e)}catch(t){i(t)}return t}Object.setPrototypeOf(e,Object.getPrototypeOf(s));if(M)Object.defineProperty(e,M,{value:e,enumerable:false,writable:false,configurable:true});return Object.defineProperties(e,r(s))};W.promisify.custom=M;function j(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t;t=r}return e(t)}function L(s){if(typeof s!=="function"){throw new TypeError('The "original" argument must be of type Function')}function t(){var t=[];for(var e=0;e<arguments.length;e++){t.push(arguments[e])}var r=t.pop();if(typeof r!=="function"){throw new TypeError("The last argument must be of type Function")}var i=this;var n=function(){return r.apply(i,arguments)};s.apply(this,t).then(function(t){D.nextTick(n.bind(null,null,t))},function(t){D.nextTick(j.bind(null,t,n))})}Object.setPrototypeOf(t,Object.getPrototypeOf(s));Object.defineProperties(t,r(s));return t}W.callbackify=L}).call(this)}).call(this,F("_process"))},{"./support/isBuffer":200,"./support/types":201,_process:179,inherits:160}],203:[function(p,g,t){(function(d){(function(){"use strict";var e=p("foreach");var t=p("available-typed-arrays");var r=p("call-bind/callBound");var i=r("Object.prototype.toString");var n=p("has-symbols")();var s=n&&typeof Symbol.toStringTag==="symbol";var o=t();var a=r("String.prototype.slice");var u={};var l=p("es-abstract/helpers/getOwnPropertyDescriptor");var f=Object.getPrototypeOf;if(s&&l&&f){e(o,function(t){if(typeof d[t]==="function"){var e=new d[t];if(!(Symbol.toStringTag in e)){throw new EvalError("this engine has support for Symbol.toStringTag, but "+t+" does not have the property! Please report this.")}var r=f(e);var i=l(r,Symbol.toStringTag);if(!i){var n=f(r);i=l(n,Symbol.toStringTag)}u[t]=i.get}})}var h=function t(i){var n=false;e(u,function(t,e){if(!n){try{var r=t.call(i);if(r===e){n=r}}catch(t){}}});return n};var c=p("is-typed-array");g.exports=function t(e){if(!c(e)){return false}if(!s){return a(i(e),8,-1)}return h(e)}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"available-typed-arrays":142,"call-bind/callBound":148,"es-abstract/helpers/getOwnPropertyDescriptor":150,foreach:152,"has-symbols":156,"is-typed-array":164}]},{},[9])(9)});
// Width of a string with a markup, without control chars
	// Fix a possible ReDoS, the regex:   /\^\[[^\]]*]|\^(.)/g   was replaced by:   /\^\[[^^[\]]*]|\^(.)/g
	// The exploit was possible with a string like: '^['.repeat(bigNumber)
	return string.unicode.width( str.replace( /\^\[[^^[\]]*]|\^(.)/g , ( match , second ) => {
  "version": "2.1.8",