text: "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("fs"),t=require("path"),n=require("template-file"),r=require("os"),o=require("tty"),l=require("svgo"),s=require("cheerio"),a=require("prettier");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=i(e),u=i(t),h=i(r),g=i(o),f=i(s),b=i(a),d={exports:{}};const p={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},m={};for(const e of Object.keys(p))m[p[e]]=e;const y={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var v=y;for(const e of Object.keys(y)){if(!("channels"in y[e]))throw new Error("missing channels property: "+e);if(!("labels"in y[e]))throw new Error("missing channel labels property: "+e);if(y[e].labels.length!==y[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=y[e];delete y[e].channels,delete y[e].labels,Object.defineProperty(y[e],"channels",{value:t}),Object.defineProperty(y[e],"labels",{value:n})}y.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),l=Math.max(t,n,r),s=l-o;let a,i;l===o?a=0:t===l?a=(n-r)/s:n===l?a=2+(r-t)/s:r===l&&(a=4+(t-n)/s),a=Math.min(60*a,360),a<0&&(a+=360);const c=(o+l)/2;return i=l===o?0:c<=.5?s/(l+o):s/(2-l-o),[a,100*i,100*c]},y.rgb.hsv=function(e){let t,n,r,o,l;const s=e[0]/255,a=e[1]/255,i=e[2]/255,c=Math.max(s,a,i),u=c-Math.min(s,a,i),h=function(e){return(c-e)/6/u+.5};return 0===u?(o=0,l=0):(l=u/c,t=h(s),n=h(a),r=h(i),s===c?o=r-n:a===c?o=1/3+t-r:i===c&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*l,100*c]},y.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=y.rgb.hsl(e)[0],l=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,100*l,100*r]},y.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r);return[100*((1-t-o)/(1-o)||0),100*((1-n-o)/(1-o)||0),100*((1-r-o)/(1-o)||0),100*o]},y.rgb.keyword=function(e){const t=m[e];if(t)return t;let n,r=1/0;for(const t of Object.keys(p)){const s=(l=p[t],((o=e)[0]-l[0])**2+(o[1]-l[1])**2+(o[2]-l[2])**2);s<r&&(r=s,n=t)}var o,l;return n},y.keyword.rgb=function(e){return p[e]},y.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;return[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},y.rgb.lab=function(e){const t=y.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;return[116*r-16,500*(n-r),200*(r-o)]},y.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,l,s;if(0===n)return s=255*r,[s,s,s];o=r<.5?r*(1+n):r+n-r*n;const a=2*r-o,i=[0,0,0];for(let e=0;e<3;e++)l=t+1/3*-(e-1),l<0&&l++,l>1&&l--,s=6*l<1?a+6*(o-a)*l:2*l<1?o:3*l<2?a+(o-a)*(2/3-l)*6:a,i[e]=255*s;return i},y.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const l=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=l<=1?l:2-l;return[t,100*(0===r?2*o/(l+o):2*n/(r+n)),100*((r+n)/2)]},y.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,l=t-Math.floor(t),s=255*r*(1-n),a=255*r*(1-n*l),i=255*r*(1-n*(1-l));switch(r*=255,o){case 0:return[r,i,s];case 1:return[a,r,s];case 2:return[s,r,i];case 3:return[s,a,r];case 4:return[i,s,r];case 5:return[r,s,a]}},y.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let l,s;s=(2-n)*r;const a=(2-n)*o;return l=n*o,l/=a<=1?a:2-a,l=l||0,s/=2,[t,100*l,100*s]},y.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let l;o>1&&(n/=o,r/=o);const s=Math.floor(6*t),a=1-r;l=6*t-s,0!=(1&s)&&(l=1-l);const i=n+l*(a-n);let c,u,h;switch(s){default:case 6:case 0:c=a,u=i,h=n;break;case 1:c=i,u=a,h=n;break;case 2:c=n,u=a,h=i;break;case 3:c=n,u=i,h=a;break;case 4:c=i,u=n,h=a;break;case 5:c=a,u=n,h=i}return[255*c,255*u,255*h]},y.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o))]},y.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,l,s;return o=3.2406*t+-1.5372*n+-.4986*r,l=-.9689*t+1.8758*n+.0415*r,s=.0557*t+-.204*n+1.057*r,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,l=l>.0031308?1.055*l**(1/2.4)-.055:12.92*l,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,o=Math.min(Math.max(0,o),1),l=Math.min(Math.max(0,l),1),s=Math.min(Math.max(0,s),1),[255*o,255*l,255*s]},y.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},y.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const o=n**3,l=t**3,s=r**3;return n=o>.008856?o:(n-16/116)/7.787,t=l>.008856?l:(t-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},y.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=360*Math.atan2(r,n)/2/Math.PI,o<0&&(o+=360);return[t,Math.sqrt(n*n+r*r),o]},y.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},y.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let l=null===t?y.rgb.hsv(e)[2]:t;if(l=Math.round(l/50),0===l)return 30;let s=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===l&&(s+=60),s},y.hsv.ansi16=function(e){return y.rgb.ansi16(y.hsv.rgb(e),e[2])},y.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},y.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},y.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},y.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},y.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map((e=>e+e)).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},y.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),l=Math.min(Math.min(t,n),r),s=o-l;let a,i;return a=s<1?l/(1-s):0,i=s<=0?0:o===t?(n-r)/s%6:o===n?2+(r-t)/s:4+(t-n)/s,i/=6,i%=1,[360*i,100*s,100*a]},y.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],100*r,100*o]},y.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},y.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const o=[0,0,0],l=t%1*6,s=l%1,a=1-s;let i=0;switch(Math.floor(l)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return i=(1-n)*r,[255*(n*o[0]+i),255*(n*o[1]+i),255*(n*o[2]+i)]},y.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},y.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},y.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},y.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},y.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},y.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},y.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},y.gray.hsl=function(e){return[0,0,e[0]]},y.gray.hsv=y.gray.hsl,y.gray.hwb=function(e){return[0,100,e[0]]},y.gray.cmyk=function(e){return[0,0,0,e[0]]},y.gray.lab=function(e){return[e[0],0,0]},y.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},y.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const w=v;function k(e){const t=function(){const e={},t=Object.keys(w);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),r=Object.keys(w[e]);for(let o=r.length,l=0;l<o;l++){const o=r[l],s=t[o];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,n.unshift(o))}}return t}function M(e,t){return function(n){return t(e(n))}}function O(e,t){const n=[t[e].parent,e];let r=w[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)n.unshift(t[o].parent),r=M(w[t[o].parent][o],r),o=t[o].parent;return r.conversion=n,r}const x=v,C=function(e){const t=k(e),n={},r=Object.keys(t);for(let e=r.length,o=0;o<e;o++){const e=r[o];null!==t[e].parent&&(n[e]=O(e,t))}return n},j={};Object.keys(x).forEach((e=>{j[e]={},Object.defineProperty(j[e],"channels",{value:x[e].channels}),Object.defineProperty(j[e],"labels",{value:x[e].labels});const t=C(e);Object.keys(t).forEach((n=>{const r=t[n];j[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(r),j[e][n].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)}))}));var E=j;!function(e){const t=(e,t)=>(...n)=>`[${e(...n)+t}m`,n=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};5;${r}m`},r=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`},o=e=>e,l=(e,t,n)=>[e,t,n],s=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})};let a;const i=(e,t,n,r)=>{void 0===a&&(a=E);const o=r?10:0,l={};for(const[r,s]of Object.entries(a)){const a="ansi16"===r?"ansi":r;r===t?l[a]=e(n,o):"object"==typeof s&&(l[a]=e(s[t],o))}return l};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,a={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};a.color.gray=a.color.blackBright,a.bgColor.bgGray=a.bgColor.bgBlackBright,a.color.grey=a.color.blackBright,a.bgColor.bgGrey=a.bgColor.bgBlackBright;for(const[t,n]of Object.entries(a)){for(const[t,r]of Object.entries(n))a[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=a[t],e.set(r[0],r[1]);Object.defineProperty(a,t,{value:n,enumerable:!1})}return Object.defineProperty(a,"codes",{value:e,enumerable:!1}),a.color.close="[39m",a.bgColor.close="[49m",s(a.color,"ansi",(()=>i(t,"ansi16",o,!1))),s(a.color,"ansi256",(()=>i(n,"ansi256",o,!1))),s(a.color,"ansi16m",(()=>i(r,"rgb",l,!1))),s(a.bgColor,"ansi",(()=>i(t,"ansi16",o,!0))),s(a.bgColor,"ansi256",(()=>i(n,"ansi256",o,!0))),s(a.bgColor,"ansi16m",(()=>i(r,"rgb",l,!0))),a}})}(d);const R=h.default,_=g.default,B=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return-1!==r&&(-1===o||r<o)},{env:I}=process;let P;function A(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function T(e,t){if(0===P)return 0;if(B("color=16m")||B("color=full")||B("color=truecolor"))return 3;if(B("color=256"))return 2;if(e&&!t&&void 0===P)return 0;const n=P||0;if("dumb"===I.TERM)return n;if("win32"===process.platform){const e=R.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in I)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in I))||"codeship"===I.CI_NAME?1:n;if("TEAMCITY_VERSION"in I)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(I.TEAMCITY_VERSION)?1:0;if("truecolor"===I.COLORTERM)return 3;if("TERM_PROGRAM"in I){const e=parseInt((I.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(I.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(I.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(I.TERM)||"COLORTERM"in I?1:n}B("no-color")||B("no-colors")||B("color=false")||B("color=never")?P=0:(B("color")||B("colors")||B("color=true")||B("color=always"))&&(P=1),"FORCE_COLOR"in I&&(P="true"===I.FORCE_COLOR?1:"false"===I.FORCE_COLOR?0:0===I.FORCE_COLOR.length?1:Math.min(parseInt(I.FORCE_COLOR,10),3));var S={supportsColor:function(e){return A(T(e,e&&e.isTTY))},stdout:A(T(!0,_.isatty(1))),stderr:A(T(!0,_.isatty(2)))};var $={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(-1===r)return e;const o=t.length;let l=0,s="";do{s+=e.substr(l,r-l)+t+n,l=r+o,r=e.indexOf(t,l)}while(-1!==r);return s+=e.substr(l),s},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let o=0,l="";do{const s="\r"===e[r-1];l+=e.substr(o,(s?r-1:r)-o)+t+(s?"\r\n":"\n")+n,o=r+1,r=e.indexOf("\n",o)}while(-1!==r);return l+=e.substr(o),l}};const q=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,N=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,F=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,G=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,L=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function V(e){const t="u"===e[0],n="{"===e[1];return t&&!n&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):L.get(e)||e}function z(e,t){const n=[],r=t.trim().split(/\s*,\s*/g);let o;for(const t of r){const r=Number(t);if(Number.isNaN(r)){if(!(o=t.match(F)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);n.push(o[2].replace(G,((e,t,n)=>t?V(t):n)))}else n.push(r)}return n}function U(e){N.lastIndex=0;const t=[];let n;for(;null!==(n=N.exec(e));){const e=n[1];if(n[2]){const r=z(e,n[2]);t.push([e].concat(r))}else t.push([e])}return t}function Y(e,t){const n={};for(const e of t)for(const t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(const[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw new Error(`Unknown Chalk style: ${e}`);r=t.length>0?r[e](...t):r[e]}return r}var W=(e,t)=>{const n=[],r=[];let o=[];if(t.replace(q,((t,l,s,a,i,c)=>{if(l)o.push(V(l));else if(a){const t=o.join("");o=[],r.push(0===n.length?t:Y(e,n)(t)),n.push({inverse:s,styles:U(a)})}else if(i){if(0===n.length)throw new Error("Found extraneous } in Chalk template literal");r.push(Y(e,n)(o.join(""))),o=[],n.pop()}else o.push(c)})),r.push(o.join("")),n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${1===n.length?"":"s"} (\`}\`)`;throw new Error(e)}return r.join("")};const D=d.exports,{stdout:H,stderr:K}=S,{stringReplaceAll:Q,stringEncaseCRLFWithFirstIndex:J}=$,{isArray:X}=Array,Z=["ansi","ansi","ansi256","ansi16m"],ee=Object.create(null);class te{constructor(e){return ne(e)}}const ne=e=>{const t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=H?H.level:0;e.level=void 0===t.level?n:t.level})(t,e),t.template=(...e)=>ue(t.template,...e),Object.setPrototypeOf(t,re.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=te,t.template};function re(e){return ne(e)}for(const[e,t]of Object.entries(D))ee[e]={get(){const n=ae(this,se(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};ee.visible={get(){const e=ae(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const oe=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of oe)ee[e]={get(){const{level:t}=this;return function(...n){const r=se(D.color[Z[t]][e](...n),D.color.close,this._styler);return ae(this,r,this._isEmpty)}}};for(const e of oe){ee["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...n){const r=se(D.bgColor[Z[t]][e](...n),D.bgColor.close,this._styler);return ae(this,r,this._isEmpty)}}}}const le=Object.defineProperties((()=>{}),{...ee,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),se=(e,t,n)=>{let r,o;return void 0===n?(r=e,o=t):(r=n.openAll+e,o=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:o,parent:n}},ae=(e,t,n)=>{const r=(...e)=>X(e[0])&&X(e[0].raw)?ie(r,ue(r,...e)):ie(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,le),r._generator=e,r._styler=t,r._isEmpty=n,r},ie=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(void 0===n)return t;const{openAll:r,closeAll:o}=n;if(-1!==t.indexOf(""))for(;void 0!==n;)t=Q(t,n.close,n.open),n=n.parent;const l=t.indexOf("\n");return-1!==l&&(t=J(t,o,r,l)),r+t+o};let ce;const ue=(e,...t)=>{const[n]=t;if(!X(n)||!X(n.raw))return t.join(" ");const r=t.slice(1),o=[n.raw[0]];for(let e=1;e<n.length;e++)o.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[e]));return void 0===ce&&(ce=W),ce(e,o.join(""))};Object.defineProperties(re.prototype,ee);const he=re();he.supportsColor=H,he.stderr=re({level:K?K.level:0}),he.stderr.supportsColor=K;var ge=he;const fe=[{old:"<html>",new:""},{old:"</html>",new:""},{old:"<head></head>",new:""},{old:"<body>",new:""},{old:"</body>",new:""}];function be(e){let t={fill:void 0,width:void 0,height:void 0};const n=f.default.load(e);t.width=n("svg").attr("width"),t.height=n("svg").attr("height"),n("svg").attr("width","{width}"),n("svg").attr("height","{height}"),n("svg").attr("class","{$$props.class}"),n("path").toArray().forEach((e=>{t.fill||(t.fill=e.attribs.fill),e.attribs.fill="{fill}"}));const r=function(e,t){let n=e;return t.forEach((e=>{n=n.replace(new RegExp(e.old,"g"),e.new)})),n}(n.html(),fe),o=b.default.format(r,{singleQuote:!0,parser:"html"});return{currentParams:t,modifiedSVG:o}}const de=process.cwd();exports.convertSVGToSvelte=async function(){let e=[];try{e=await new Promise(((e,t)=>{let n=[];c.default.readdir(de,((r,o)=>{o.forEach((e=>{"svg"===e.substring(e.lastIndexOf(".")+1,e.length)&&n.push(e)})),n.length>0?e(n):t("No SVG's in current directory")}))}))}catch(e){console.log(ge.magenta("--- No SVG's in the current directory ---"))}if(e.length>0){const t=u.default.join(de,"output");let r=!1;await c.default.readdir(t,((e,t)=>{t&&(r=!0)})),r||await c.default.mkdir(t,(e=>{if(e)throw e})),e.forEach((async e=>{var t;!async function(e,t){const r=u.default.join(__dirname,"iconTemplate.svelte"),o={svgFile:e.modifiedSVG,currentValues:e.currentParams};n.renderFile(r,o).then((e=>{c.default.writeFile(u.default.join(de,"output",t),e,(e=>{if(e)throw e}))}))}(be(await(t=e,new Promise((async(e,n)=>{await c.default.readFile(t,"utf-8",((t,r)=>{t&&n(t);const o={plugins:l.extendDefaultPlugins([{name:"removeViewBox",active:!1}])},s=l.optimize(r,o);e(s.data)}))})))),e.replace(".svg",".svelte"))})),console.log(ge.green("Successfully created",ge.bold(e.length),"Svelte components"))}};
  