Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dead-code-checker

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dead-code-checker - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

1

bin/index.js
#!/usr/bin/env node
const { Command } = require('commander');
const package = require('../package.json');
const DeadCodeChecker = require('../dist/index.js');

@@ -4,0 +5,0 @@

2

dist/index.es.js

@@ -1,1 +0,1 @@

import e from"fs";import t from"path";import r from"cli-table3";import n from"os";import o from"cfonts";function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t,r,n,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).then(n,o)}function l(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=p(e))||t){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}function c(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,i=Object.create(a.prototype),l=new L(n||[]);return o(i,"_invoke",{value:C(e,r,l)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",g="suspendedYield",d="executing",b="completed",y={};function v(){}function m(){}function w(){}var k={};c(k,i,(function(){return this}));var M=Object.getPrototypeOf,x=M&&M(M(A([])));x&&x!==r&&n.call(x,i)&&(k=x);var O=w.prototype=v.prototype=Object.create(k);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,i,l)}),(function(e){r("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function C(t,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===b){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var l=n.delegate;if(l){var s=_(l,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?b:g,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=b,n.method="throw",n.arg=c.arg)}}}function _(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=w,o(O,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},E(j.prototype),c(j.prototype,l,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(h(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},E(O),c(O,s,"Generator"),c(O,i,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function h(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function p(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={exports:{}},b=/[|\\{}()[\]^$+*?.]/g,y=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(b,"\\$&")},v={exports:{}},m={exports:{}},w={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]},k={};for(var M in w)w.hasOwnProperty(M)&&(k[w[M]]=M);var x=m.exports={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"]}};for(var O in x)if(x.hasOwnProperty(O)){if(!("channels"in x[O]))throw new Error("missing channels property: "+O);if(!("labels"in x[O]))throw new Error("missing channel labels property: "+O);if(x[O].labels.length!==x[O].channels)throw new Error("channel and label counts mismatch: "+O);var E=x[O].channels,j=x[O].labels;delete x[O].channels,delete x[O].labels,Object.defineProperty(x[O],"channels",{value:E}),Object.defineProperty(x[O],"labels",{value:j})}x.rgb.hsl=function(e){var t,r,n=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(n,o,a),l=Math.max(n,o,a),s=l-i;return l===i?t=0:n===l?t=(o-a)/s:o===l?t=2+(a-n)/s:a===l&&(t=4+(n-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),r=(i+l)/2,[t,100*(l===i?0:r<=.5?s/(l+i):s/(2-l-i)),100*r]},x.rgb.hsv=function(e){var t,r,n,o,a,i=e[0]/255,l=e[1]/255,s=e[2]/255,c=Math.max(i,l,s),u=c-Math.min(i,l,s),h=function(e){return(c-e)/6/u+.5};return 0===u?o=a=0:(a=u/c,t=h(i),r=h(l),n=h(s),i===c?o=n-r:l===c?o=1/3+t-n:s===c&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*c]},x.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[x.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,n))),100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},x.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-o)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},x.rgb.keyword=function(e){var t=k[e];if(t)return t;var r,n,o,a=1/0;for(var i in w)if(w.hasOwnProperty(i)){var l=w[i],s=(n=e,o=l,Math.pow(n[0]-o[0],2)+Math.pow(n[1]-o[1],2)+Math.pow(n[2]-o[2],2));s<a&&(a=s,r=i)}return r},x.keyword.rgb=function(e){return w[e]},x.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},x.rgb.lab=function(e){var t=x.rgb.xyz(e),r=t[0],n=t[1],o=t[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},x.hsl.rgb=function(e){var t,r,n,o,a,i=e[0]/360,l=e[1]/100,s=e[2]/100;if(0===l)return[a=255*s,a,a];t=2*s-(r=s<.5?s*(1+l):s+l-s*l),o=[0,0,0];for(var c=0;c<3;c++)(n=i+1/3*-(c-1))<0&&n++,n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,o[c]=255*a;return o},x.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,o=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=a<=1?a:2-a,[t,100*(0===n?2*o/(a+o):2*r/(n+r)),100*((n+r)/2)]},x.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,a=t-Math.floor(t),i=255*n*(1-r),l=255*n*(1-r*a),s=255*n*(1-r*(1-a));switch(n*=255,o){case 0:return[n,s,i];case 1:return[l,n,i];case 2:return[i,n,s];case 3:return[i,l,n];case 4:return[s,i,n];case 5:return[n,i,l]}},x.hsv.hsl=function(e){var t,r,n,o=e[0],a=e[1]/100,i=e[2]/100,l=Math.max(i,.01);return n=(2-a)*i,r=a*l,[o,100*(r=(r/=(t=(2-a)*l)<=1?t:2-t)||0),100*(n/=2)]},x.hwb.rgb=function(e){var t,r,n,o,a,i,l,s=e[0]/360,c=e[1]/100,u=e[2]/100,h=c+u;switch(h>1&&(c/=h,u/=h),n=6*s-(t=Math.floor(6*s)),1&t&&(n=1-n),o=c+n*((r=1-u)-c),t){default:case 6:case 0:a=r,i=o,l=c;break;case 1:a=o,i=r,l=c;break;case 2:a=c,i=r,l=o;break;case 3:a=c,i=o,l=r;break;case 4:a=o,i=c,l=r;break;case 5:a=r,i=c,l=o}return[255*a,255*i,255*l]},x.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},x.xyz.rgb=function(e){var t,r,n,o=e[0]/100,a=e[1]/100,i=e[2]/100;return r=-.9689*o+1.8758*a+.0415*i,n=.0557*o+-.204*a+1.057*i,t=(t=3.2406*o+-1.5372*a+-.4986*i)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},x.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},x.lab.xyz=function(e){var t,r,n,o=e[0];t=e[1]/500+(r=(o+16)/116),n=r-e[2]/200;var a=Math.pow(r,3),i=Math.pow(t,3),l=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},x.lab.lch=function(e){var t,r=e[0],n=e[1],o=e[2];return(t=360*Math.atan2(o,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+o*o),t]},x.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},x.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],o=1 in arguments?arguments[1]:x.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===o&&(a+=60),a},x.hsv.ansi16=function(e){return x.rgb.ansi16(x.hsv.rgb(e),e[2])},x.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},x.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},x.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},x.rgb.hex=function(e){var 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},x.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},x.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255,a=Math.max(Math.max(r,n),o),i=Math.min(Math.min(r,n),o),l=a-i;return t=l<=0?0:a===r?(n-o)/l%6:a===n?2+(o-r)/l:4+(r-n)/l+4,t/=6,[360*(t%=1),100*l,100*(l<1?i/(1-l):0)]},x.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,o=0;return(n=r<.5?2*t*r:2*t*(1-r))<1&&(o=(r-.5*n)/(1-n)),[e[0],100*n,100*o]},x.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var o,a=[0,0,0],i=t%1*6,l=i%1,s=1-l;switch(Math.floor(i)){case 0:a[0]=1,a[1]=l,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=l;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=l,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return o=(1-r)*n,[255*(r*a[0]+o),255*(r*a[1]+o),255*(r*a[2]+o)]},x.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},x.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},x.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},x.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},x.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},x.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},x.gray.hsl=x.gray.hsv=function(e){return[0,0,e[0]]},x.gray.hwb=function(e){return[0,100,e[0]]},x.gray.cmyk=function(e){return[0,0,0,e[0]]},x.gray.lab=function(e){return[e[0],0,0]},x.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},x.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var C=m.exports,_=C;function R(e){var t=function(){for(var e={},t=Object.keys(_),r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var n=r.pop(),o=Object.keys(_[n]),a=o.length,i=0;i<a;i++){var l=o[i],s=t[l];-1===s.distance&&(s.distance=t[n].distance+1,s.parent=n,r.unshift(l))}return t}function P(e,t){return function(r){return t(e(r))}}function L(e,t){for(var r=[t[e].parent,e],n=_[t[e].parent][e],o=t[e].parent;t[o].parent;)r.unshift(t[o].parent),n=P(_[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}var A=C,S=function(e){for(var t=R(e),r={},n=Object.keys(t),o=n.length,a=0;a<o;a++){var i=n[a];null!==t[i].parent&&(r[i]=L(i,t))}return r},I={};Object.keys(A).forEach((function(e){I[e]={},Object.defineProperty(I[e],"channels",{value:A[e].channels}),Object.defineProperty(I[e],"labels",{value:A[e].labels});var t=S(e);Object.keys(t).forEach((function(r){var n=t[r];I[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,o=0;o<n;o++)r[o]=Math.round(r[o]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),I[e][r].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))}));var T=I;!function(e){const t=T,r=(e,r)=>function(){return`[${e.apply(t,arguments)+r}m`},n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`},o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};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],gray:[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.grey=a.color.gray;for(const t of Object.keys(a)){const r=a[t];for(const t of Object.keys(r)){const n=r[t];a[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=a[t],e.set(n[0],n[1])}Object.defineProperty(a,t,{value:r,enumerable:!1}),Object.defineProperty(a,"codes",{value:e,enumerable:!1})}const i=e=>e,l=(e,t,r)=>[e,t,r];a.color.close="",a.bgColor.close="",a.color.ansi={ansi:r(i,0)},a.color.ansi256={ansi256:n(i,0)},a.color.ansi16m={rgb:o(l,0)},a.bgColor.ansi={ansi:r(i,10)},a.bgColor.ansi256={ansi256:n(i,10)},a.bgColor.ansi16m={rgb:o(l,10)};for(let e of Object.keys(t)){if("object"!=typeof t[e])continue;const i=t[e];"ansi16"===e&&(e="ansi"),"ansi16"in i&&(a.color.ansi[e]=r(i.ansi16,0),a.bgColor.ansi[e]=r(i.ansi16,10)),"ansi256"in i&&(a.color.ansi256[e]=n(i.ansi256,0),a.bgColor.ansi256[e]=n(i.ansi256,10)),"rgb"in i&&(a.color.ansi16m[e]=o(i.rgb,0),a.bgColor.ansi16m[e]=o(i.rgb,10))}return a}})}(v);var F=v.exports;const B=n,$=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)},N=process.env;let G;function z(e){const t=function(e){if(!1===G)return 0;if($("color=16m")||$("color=full")||$("color=truecolor"))return 3;if($("color=256"))return 2;if(e&&!e.isTTY&&!0!==G)return 0;const t=G?1:0;if("win32"===process.platform){const e=B.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in N)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in N))||"codeship"===N.CI_NAME?1:t;if("TEAMCITY_VERSION"in N)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(N.TEAMCITY_VERSION)?1:0;if("truecolor"===N.COLORTERM)return 3;if("TERM_PROGRAM"in N){const e=parseInt((N.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(N.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(N.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(N.TERM)||"COLORTERM"in N?1:(N.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}$("no-color")||$("no-colors")||$("color=false")?G=!1:($("color")||$("colors")||$("color=true")||$("color=always"))&&(G=!0),"FORCE_COLOR"in N&&(G=0===N.FORCE_COLOR.length||0!==parseInt(N.FORCE_COLOR,10));var V={supportsColor:z,stdout:z(process.stdout),stderr:z(process.stderr)};const q=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Y=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,U=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,W=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,D=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function Z(e){return"u"===e[0]&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):D.get(e)||e}function H(e,t){const r=[],n=t.trim().split(/\s*,\s*/g);let o;for(const t of n)if(isNaN(t)){if(!(o=t.match(U)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);r.push(o[2].replace(W,((e,t,r)=>t?Z(t):r)))}else r.push(Number(t));return r}function J(e){Y.lastIndex=0;const t=[];let r;for(;null!==(r=Y.exec(e));){const e=r[1];if(r[2]){const n=H(e,r[2]);t.push([e].concat(n))}else t.push([e])}return t}function K(e,t){const r={};for(const e of t)for(const t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let n=e;for(const e of Object.keys(r))if(Array.isArray(r[e])){if(!(e in n))throw new Error(`Unknown Chalk style: ${e}`);n=r[e].length>0?n[e].apply(n,r[e]):n[e]}return n}var Q=(e,t)=>{const r=[],n=[];let o=[];if(t.replace(q,((t,a,i,l,s,c)=>{if(a)o.push(Z(a));else if(l){const t=o.join("");o=[],n.push(0===r.length?t:K(e,r)(t)),r.push({inverse:i,styles:J(l)})}else if(s){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");n.push(K(e,r)(o.join(""))),o=[],r.pop()}else o.push(c)})),n.push(o.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};!function(e){const t=y,r=F,n=V.stdout,o=Q,a="win32"===process.platform&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),i=["ansi","ansi","ansi256","ansi16m"],l=new Set(["gray"]),s=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=void 0===t.level?r:t.level,e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};return c(t,e),t.template=function(){const e=[].slice.call(arguments);return g.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,u.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=u,t.template}c(this,e)}a&&(r.blue.open="");for(const e of Object.keys(r))r[e].closeRe=new RegExp(t(r[e].close),"g"),s[e]={get(){const t=r[e];return f.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}};s.visible={get(){return f.call(this,this._styles||[],!0,"visible")}},r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi))l.has(e)||(s[e]={get(){const t=this.level;return function(){const n={open:r.color[i[t]][e].apply(null,arguments),close:r.color.close,closeRe:r.color.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}});r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(l.has(e))continue;s["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const t=this.level;return function(){const n={open:r.bgColor[i[t]][e].apply(null,arguments),close:r.bgColor.close,closeRe:r.bgColor.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const h=Object.defineProperties((()=>{}),s);function f(e,t,r){const n=function(){return p.apply(n,arguments)};n._styles=e,n._empty=t;const o=this;return Object.defineProperty(n,"level",{enumerable:!0,get:()=>o.level,set(e){o.level=e}}),Object.defineProperty(n,"enabled",{enumerable:!0,get:()=>o.enabled,set(e){o.enabled=e}}),n.hasGrey=this.hasGrey||"gray"===r||"grey"===r,n.__proto__=h,n}function p(){const e=arguments,t=e.length;let n=String(arguments[0]);if(0===t)return"";if(t>1)for(let r=1;r<t;r++)n+=" "+e[r];if(!this.enabled||this.level<=0||!n)return this._empty?"":n;const o=r.dim.open;a&&this.hasGrey&&(r.dim.open="");for(const e of this._styles.slice().reverse())n=e.open+n.replace(e.closeRe,e.open)+e.close,n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`);return r.dim.open=o,n}function g(e,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");const r=[].slice.call(arguments,2),n=[t.raw[0]];for(let e=1;e<t.length;e++)n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&")),n.push(String(t.raw[e]));return o(e,n.join(""))}Object.defineProperties(u.prototype,s),e.exports=u(),e.exports.supportsColor=n,e.exports.default=e.exports}(d);var X=g(d.exports),ee=["if","for","while","catch","switch","case","const","let","var","function","mounted","unmounted","created","updated","beforeMount","beforeUpdate","beforeDestroy","destroyed","setup"],te=[".js",".jsx",".ts",".tsx",".vue",".svelte",".astro"],re={font:"tiny",align:"left",colors:["red"],background:"transparent",letterSpacing:1,lineHeight:1,space:!0,maxLength:"0",gradient:!1,independentGradient:!1,transitionGradient:!1,env:"node"},ne=function(){return l((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"filesPath","."),c(this,"deadMap",{}),c(this,"deadCodeFound",!1),c(this,"cliTable",new r({head:[X.red("📁 File"),X.red("🔢 Line"),X.red("🔍 Name")],colWidths:[100,10,30]})),this.filesPath=t}),[{key:"getAllFiles",value:function(r){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{return e.readdirSync(r).forEach((function(a){var i=t.join(r,a);e.statSync(i).isDirectory()?o=n.getAllFiles(i,o):te.some((function(e){return a.endsWith(e)}))&&o.push(i)})),o}catch(e){return[]}}},{key:"isBuiltInFunctionOrVariable",value:function(e){return ee.includes(e)}},{key:"getDeclaredFunctionsAndVariables",value:function(e){var t,r=this,n=/function\s+([a-zA-Z0-9_]+)/g,o=/const\s+([a-zA-Z0-9_]+)\s*=\s*\(/g,a=/([a-zA-Z0-9_]+)\s*\(([^)]*)\)\s*{/g,i=/(?:const|let|var)\s+([a-zA-Z0-9_]+)/g,l=/methods\s*:\s*{([^}]*)}/g,s=/return\s*{([^}]*)}/g,c=[],u=[],h=new Set,f=0;for(e.split("\n").forEach((function(e){f++,null!==(t=n.exec(e))||null!==(t=o.exec(e))||null!==(t=a.exec(e))?r.isBuiltInFunctionOrVariable(t[1])||c.push({name:t[1],line:f}):null!==(t=i.exec(e))&&(r.isBuiltInFunctionOrVariable(t[1])||u.push({name:t[1],line:f}))}));null!==(t=l.exec(e));){(t[1].match(/([a-zA-Z0-9_]+)\s*\(/g)||[]).forEach((function(e,t){e=e.trim().replace("(",""),r.isBuiltInFunctionOrVariable(e)||c.push({name:e,line:f+t})}))}for(;null!==(t=s.exec(e));){(t[1].split(",")||[]).forEach((function(e){e=e.trim().replace(":",""),h.add(e)}))}return{declaredFunctions:c,declaredVariables:u,setupReturnFunctions:h}}},{key:"removeComments",value:function(e){return e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"")}},{key:"run",value:(n=u().mark((function t(){var r,n,a,i,l,c=this;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=this.getAllFiles(this.filesPath),n=new Set,a=s(r),t.prev=3,l=u().mark((function t(){var r,o,a,l,s;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=i.value,o=e.readFileSync(r,"utf8"),a=c.getDeclaredFunctionsAndVariables(o),l=a.declaredFunctions,s=a.declaredVariables,a.setupReturnFunctions.forEach((function(e){return n.add(e)})),[].concat(h(s),h(l)).forEach((function(e){c.deadMap[e.name]||(c.deadMap[e.name]={count:0,declaredIn:[]}),c.deadMap[e.name].declaredIn.push({filePath:r,line:e.line})}));case 5:case"end":return t.stop()}}),t)})),a.s();case 6:if((i=a.n()).done){t.next=10;break}return t.delegateYield(l(),"t0",8);case 8:t.next=6;break;case 10:t.next=15;break;case 12:t.prev=12,t.t1=t.catch(3),a.e(t.t1);case 15:return t.prev=15,a.f(),t.finish(15);case 18:r.forEach((function(t){var r=e.readFileSync(t,"utf8"),n=c.removeComments(r);Object.keys(c.deadMap).forEach((function(e){var t=new RegExp("\\b".concat(e,"\\b"),"g"),r=n.match(t);r&&(c.deadMap[e].count+=r.length)}))})),Object.keys(this.deadMap).forEach((function(e){var t=c.deadMap[e],r=2===t.count&&n.has(e);(1===t.count||r)&&(c.deadCodeFound=!0,t.declaredIn.forEach((function(t){c.cliTable.push([t.filePath,t.line,e])})))})),o.say("Dead Code Checker",re),this.deadCodeFound?console.log(this.cliTable.toString()):console.log(X.greenBright("✅ No dead code found!"));case 22:case"end":return t.stop()}}),t,this,[[3,12,15,18]])})),a=function(){var e=this,t=arguments;return new Promise((function(r,o){var a=n.apply(e,t);function l(e){i(a,r,o,l,s,"next",e)}function s(e){i(a,r,o,l,s,"throw",e)}l(void 0)}))},function(){return a.apply(this,arguments)})}]);var n,a}();export{ne as default};
import e from"fs";import t from"path";import r from"cli-table3";import n from"os";import o from"cfonts";function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t,r,n,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).then(n,o)}function l(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=p(e))||t){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}function c(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,i=Object.create(a.prototype),l=new L(n||[]);return o(i,"_invoke",{value:C(e,r,l)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",g="suspendedYield",d="executing",b="completed",y={};function v(){}function m(){}function w(){}var k={};c(k,i,(function(){return this}));var M=Object.getPrototypeOf,x=M&&M(M(A([])));x&&x!==r&&n.call(x,i)&&(k=x);var O=w.prototype=v.prototype=Object.create(k);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,i,l)}),(function(e){r("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function C(t,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===b){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var l=n.delegate;if(l){var s=_(l,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?b:g,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=b,n.method="throw",n.arg=c.arg)}}}function _(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=w,o(O,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},E(j.prototype),c(j.prototype,l,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(h(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},E(O),c(O,s,"Generator"),c(O,i,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function h(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function p(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={exports:{}},b=/[|\\{}()[\]^$+*?.]/g,y=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(b,"\\$&")},v={exports:{}},m={exports:{}},w={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]},k={};for(var M in w)w.hasOwnProperty(M)&&(k[w[M]]=M);var x=m.exports={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"]}};for(var O in x)if(x.hasOwnProperty(O)){if(!("channels"in x[O]))throw new Error("missing channels property: "+O);if(!("labels"in x[O]))throw new Error("missing channel labels property: "+O);if(x[O].labels.length!==x[O].channels)throw new Error("channel and label counts mismatch: "+O);var E=x[O].channels,j=x[O].labels;delete x[O].channels,delete x[O].labels,Object.defineProperty(x[O],"channels",{value:E}),Object.defineProperty(x[O],"labels",{value:j})}x.rgb.hsl=function(e){var t,r,n=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(n,o,a),l=Math.max(n,o,a),s=l-i;return l===i?t=0:n===l?t=(o-a)/s:o===l?t=2+(a-n)/s:a===l&&(t=4+(n-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),r=(i+l)/2,[t,100*(l===i?0:r<=.5?s/(l+i):s/(2-l-i)),100*r]},x.rgb.hsv=function(e){var t,r,n,o,a,i=e[0]/255,l=e[1]/255,s=e[2]/255,c=Math.max(i,l,s),u=c-Math.min(i,l,s),h=function(e){return(c-e)/6/u+.5};return 0===u?o=a=0:(a=u/c,t=h(i),r=h(l),n=h(s),i===c?o=n-r:l===c?o=1/3+t-n:s===c&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*c]},x.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[x.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,n))),100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},x.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-o)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},x.rgb.keyword=function(e){var t=k[e];if(t)return t;var r,n,o,a=1/0;for(var i in w)if(w.hasOwnProperty(i)){var l=w[i],s=(n=e,o=l,Math.pow(n[0]-o[0],2)+Math.pow(n[1]-o[1],2)+Math.pow(n[2]-o[2],2));s<a&&(a=s,r=i)}return r},x.keyword.rgb=function(e){return w[e]},x.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},x.rgb.lab=function(e){var t=x.rgb.xyz(e),r=t[0],n=t[1],o=t[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},x.hsl.rgb=function(e){var t,r,n,o,a,i=e[0]/360,l=e[1]/100,s=e[2]/100;if(0===l)return[a=255*s,a,a];t=2*s-(r=s<.5?s*(1+l):s+l-s*l),o=[0,0,0];for(var c=0;c<3;c++)(n=i+1/3*-(c-1))<0&&n++,n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,o[c]=255*a;return o},x.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,o=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=a<=1?a:2-a,[t,100*(0===n?2*o/(a+o):2*r/(n+r)),100*((n+r)/2)]},x.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,a=t-Math.floor(t),i=255*n*(1-r),l=255*n*(1-r*a),s=255*n*(1-r*(1-a));switch(n*=255,o){case 0:return[n,s,i];case 1:return[l,n,i];case 2:return[i,n,s];case 3:return[i,l,n];case 4:return[s,i,n];case 5:return[n,i,l]}},x.hsv.hsl=function(e){var t,r,n,o=e[0],a=e[1]/100,i=e[2]/100,l=Math.max(i,.01);return n=(2-a)*i,r=a*l,[o,100*(r=(r/=(t=(2-a)*l)<=1?t:2-t)||0),100*(n/=2)]},x.hwb.rgb=function(e){var t,r,n,o,a,i,l,s=e[0]/360,c=e[1]/100,u=e[2]/100,h=c+u;switch(h>1&&(c/=h,u/=h),n=6*s-(t=Math.floor(6*s)),1&t&&(n=1-n),o=c+n*((r=1-u)-c),t){default:case 6:case 0:a=r,i=o,l=c;break;case 1:a=o,i=r,l=c;break;case 2:a=c,i=r,l=o;break;case 3:a=c,i=o,l=r;break;case 4:a=o,i=c,l=r;break;case 5:a=r,i=c,l=o}return[255*a,255*i,255*l]},x.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},x.xyz.rgb=function(e){var t,r,n,o=e[0]/100,a=e[1]/100,i=e[2]/100;return r=-.9689*o+1.8758*a+.0415*i,n=.0557*o+-.204*a+1.057*i,t=(t=3.2406*o+-1.5372*a+-.4986*i)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},x.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},x.lab.xyz=function(e){var t,r,n,o=e[0];t=e[1]/500+(r=(o+16)/116),n=r-e[2]/200;var a=Math.pow(r,3),i=Math.pow(t,3),l=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},x.lab.lch=function(e){var t,r=e[0],n=e[1],o=e[2];return(t=360*Math.atan2(o,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+o*o),t]},x.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},x.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],o=1 in arguments?arguments[1]:x.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===o&&(a+=60),a},x.hsv.ansi16=function(e){return x.rgb.ansi16(x.hsv.rgb(e),e[2])},x.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},x.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},x.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},x.rgb.hex=function(e){var 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},x.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},x.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255,a=Math.max(Math.max(r,n),o),i=Math.min(Math.min(r,n),o),l=a-i;return t=l<=0?0:a===r?(n-o)/l%6:a===n?2+(o-r)/l:4+(r-n)/l+4,t/=6,[360*(t%=1),100*l,100*(l<1?i/(1-l):0)]},x.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,o=0;return(n=r<.5?2*t*r:2*t*(1-r))<1&&(o=(r-.5*n)/(1-n)),[e[0],100*n,100*o]},x.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var o,a=[0,0,0],i=t%1*6,l=i%1,s=1-l;switch(Math.floor(i)){case 0:a[0]=1,a[1]=l,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=l;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=l,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return o=(1-r)*n,[255*(r*a[0]+o),255*(r*a[1]+o),255*(r*a[2]+o)]},x.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},x.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},x.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},x.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},x.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},x.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},x.gray.hsl=x.gray.hsv=function(e){return[0,0,e[0]]},x.gray.hwb=function(e){return[0,100,e[0]]},x.gray.cmyk=function(e){return[0,0,0,e[0]]},x.gray.lab=function(e){return[e[0],0,0]},x.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},x.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var C=m.exports,_=C;function R(e){var t=function(){for(var e={},t=Object.keys(_),r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var n=r.pop(),o=Object.keys(_[n]),a=o.length,i=0;i<a;i++){var l=o[i],s=t[l];-1===s.distance&&(s.distance=t[n].distance+1,s.parent=n,r.unshift(l))}return t}function P(e,t){return function(r){return t(e(r))}}function L(e,t){for(var r=[t[e].parent,e],n=_[t[e].parent][e],o=t[e].parent;t[o].parent;)r.unshift(t[o].parent),n=P(_[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}var A=C,S=function(e){for(var t=R(e),r={},n=Object.keys(t),o=n.length,a=0;a<o;a++){var i=n[a];null!==t[i].parent&&(r[i]=L(i,t))}return r},I={};Object.keys(A).forEach((function(e){I[e]={},Object.defineProperty(I[e],"channels",{value:A[e].channels}),Object.defineProperty(I[e],"labels",{value:A[e].labels});var t=S(e);Object.keys(t).forEach((function(r){var n=t[r];I[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,o=0;o<n;o++)r[o]=Math.round(r[o]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),I[e][r].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))}));var T=I;!function(e){const t=T,r=(e,r)=>function(){return`[${e.apply(t,arguments)+r}m`},n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`},o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};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],gray:[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.grey=a.color.gray;for(const t of Object.keys(a)){const r=a[t];for(const t of Object.keys(r)){const n=r[t];a[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=a[t],e.set(n[0],n[1])}Object.defineProperty(a,t,{value:r,enumerable:!1}),Object.defineProperty(a,"codes",{value:e,enumerable:!1})}const i=e=>e,l=(e,t,r)=>[e,t,r];a.color.close="",a.bgColor.close="",a.color.ansi={ansi:r(i,0)},a.color.ansi256={ansi256:n(i,0)},a.color.ansi16m={rgb:o(l,0)},a.bgColor.ansi={ansi:r(i,10)},a.bgColor.ansi256={ansi256:n(i,10)},a.bgColor.ansi16m={rgb:o(l,10)};for(let e of Object.keys(t)){if("object"!=typeof t[e])continue;const i=t[e];"ansi16"===e&&(e="ansi"),"ansi16"in i&&(a.color.ansi[e]=r(i.ansi16,0),a.bgColor.ansi[e]=r(i.ansi16,10)),"ansi256"in i&&(a.color.ansi256[e]=n(i.ansi256,0),a.bgColor.ansi256[e]=n(i.ansi256,10)),"rgb"in i&&(a.color.ansi16m[e]=o(i.rgb,0),a.bgColor.ansi16m[e]=o(i.rgb,10))}return a}})}(v);var F=v.exports;const B=n,$=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)},N=process.env;let G;function z(e){const t=function(e){if(!1===G)return 0;if($("color=16m")||$("color=full")||$("color=truecolor"))return 3;if($("color=256"))return 2;if(e&&!e.isTTY&&!0!==G)return 0;const t=G?1:0;if("win32"===process.platform){const e=B.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in N)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in N))||"codeship"===N.CI_NAME?1:t;if("TEAMCITY_VERSION"in N)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(N.TEAMCITY_VERSION)?1:0;if("truecolor"===N.COLORTERM)return 3;if("TERM_PROGRAM"in N){const e=parseInt((N.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(N.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(N.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(N.TERM)||"COLORTERM"in N?1:(N.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}$("no-color")||$("no-colors")||$("color=false")?G=!1:($("color")||$("colors")||$("color=true")||$("color=always"))&&(G=!0),"FORCE_COLOR"in N&&(G=0===N.FORCE_COLOR.length||0!==parseInt(N.FORCE_COLOR,10));var V={supportsColor:z,stdout:z(process.stdout),stderr:z(process.stderr)};const q=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Y=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,U=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,W=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,D=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function Z(e){return"u"===e[0]&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):D.get(e)||e}function H(e,t){const r=[],n=t.trim().split(/\s*,\s*/g);let o;for(const t of n)if(isNaN(t)){if(!(o=t.match(U)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);r.push(o[2].replace(W,((e,t,r)=>t?Z(t):r)))}else r.push(Number(t));return r}function J(e){Y.lastIndex=0;const t=[];let r;for(;null!==(r=Y.exec(e));){const e=r[1];if(r[2]){const n=H(e,r[2]);t.push([e].concat(n))}else t.push([e])}return t}function K(e,t){const r={};for(const e of t)for(const t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let n=e;for(const e of Object.keys(r))if(Array.isArray(r[e])){if(!(e in n))throw new Error(`Unknown Chalk style: ${e}`);n=r[e].length>0?n[e].apply(n,r[e]):n[e]}return n}var Q=(e,t)=>{const r=[],n=[];let o=[];if(t.replace(q,((t,a,i,l,s,c)=>{if(a)o.push(Z(a));else if(l){const t=o.join("");o=[],n.push(0===r.length?t:K(e,r)(t)),r.push({inverse:i,styles:J(l)})}else if(s){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");n.push(K(e,r)(o.join(""))),o=[],r.pop()}else o.push(c)})),n.push(o.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};!function(e){const t=y,r=F,n=V.stdout,o=Q,a="win32"===process.platform&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),i=["ansi","ansi","ansi256","ansi16m"],l=new Set(["gray"]),s=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=void 0===t.level?r:t.level,e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};return c(t,e),t.template=function(){const e=[].slice.call(arguments);return g.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,u.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=u,t.template}c(this,e)}a&&(r.blue.open="");for(const e of Object.keys(r))r[e].closeRe=new RegExp(t(r[e].close),"g"),s[e]={get(){const t=r[e];return f.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}};s.visible={get(){return f.call(this,this._styles||[],!0,"visible")}},r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi))l.has(e)||(s[e]={get(){const t=this.level;return function(){const n={open:r.color[i[t]][e].apply(null,arguments),close:r.color.close,closeRe:r.color.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}});r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(l.has(e))continue;s["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const t=this.level;return function(){const n={open:r.bgColor[i[t]][e].apply(null,arguments),close:r.bgColor.close,closeRe:r.bgColor.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const h=Object.defineProperties((()=>{}),s);function f(e,t,r){const n=function(){return p.apply(n,arguments)};n._styles=e,n._empty=t;const o=this;return Object.defineProperty(n,"level",{enumerable:!0,get:()=>o.level,set(e){o.level=e}}),Object.defineProperty(n,"enabled",{enumerable:!0,get:()=>o.enabled,set(e){o.enabled=e}}),n.hasGrey=this.hasGrey||"gray"===r||"grey"===r,n.__proto__=h,n}function p(){const e=arguments,t=e.length;let n=String(arguments[0]);if(0===t)return"";if(t>1)for(let r=1;r<t;r++)n+=" "+e[r];if(!this.enabled||this.level<=0||!n)return this._empty?"":n;const o=r.dim.open;a&&this.hasGrey&&(r.dim.open="");for(const e of this._styles.slice().reverse())n=e.open+n.replace(e.closeRe,e.open)+e.close,n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`);return r.dim.open=o,n}function g(e,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");const r=[].slice.call(arguments,2),n=[t.raw[0]];for(let e=1;e<t.length;e++)n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&")),n.push(String(t.raw[e]));return o(e,n.join(""))}Object.defineProperties(u.prototype,s),e.exports=u(),e.exports.supportsColor=n,e.exports.default=e.exports}(d);var X=g(d.exports),ee=["if","for","while","catch","switch","case","json","const","let","var","function","mounted","unmounted","created","updated","beforeMount","beforeUpdate","beforeDestroy","destroyed","setup","constructor"],te=[".js",".jsx",".ts",".tsx",".vue",".svelte",".astro"],re=["node_modules",".git","dist","build"],ne={font:"tiny",align:"left",colors:["red"],background:"transparent",letterSpacing:1,lineHeight:1,space:!0,maxLength:"0",gradient:!1,independentGradient:!1,transitionGradient:!1,env:"node"},oe=function(){return l((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"filesPath","."),c(this,"deadMap",{}),c(this,"deadCodeFound",!1),c(this,"cliTable",new r({head:[X.red("📁 File"),X.red("🔢 Line"),X.red("🔍 Name")],colWidths:[100,10,30]})),this.filesPath=t}),[{key:"getAllFiles",value:function(r){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{return e.readdirSync(r).forEach((function(a){var i=t.join(r,a);e.statSync(i).isDirectory()?re.includes(a)||(o=n.getAllFiles(i,o)):te.some((function(e){return a.endsWith(e)}))&&o.push(i)})),o}catch(e){return[]}}},{key:"isBuiltInFunctionOrVariable",value:function(e){return ee.includes(e)}},{key:"getDeclaredFunctionsAndVariables",value:function(e){var t,r=this,n=/\bfunction\s+([a-zA-Z0-9_]+)\s*\(/g,o=/\bconst\s+([a-zA-Z0-9_]+)\s*=\s*\(/g,a=/([a-zA-Z0-9_]+)\s*\(([^)]*)\)\s*{/g,i=/\bmethods\s*:\s*{([^}]*)}/g,l=/\breturn\s*{([^}]*)}/g,s=/\b(?:const|let|var)\s+([a-zA-Z0-9_]+)\s*=?/g,c=[],u=[],h=new Set,f=0;for(e.split("\n").forEach((function(e){f++,null!==(t=n.exec(e))||null!==(t=o.exec(e))||null!==(t=a.exec(e))?r.isBuiltInFunctionOrVariable(t[1])||c.push({name:t[1],line:f}):null!==(t=s.exec(e))&&(r.isBuiltInFunctionOrVariable(t[1])||u.push({name:t[1],line:f}))}));null!==(t=i.exec(e));){(t[1].match(/([a-zA-Z0-9_]+)\s*\(/g)||[]).forEach((function(e,t){e=e.trim().replace("(",""),r.isBuiltInFunctionOrVariable(e)||c.push({name:e,line:f+t})}))}for(;null!==(t=l.exec(e));){(t[1].split(",")||[]).forEach((function(e){e=e.trim().replace(":",""),h.add(e)}))}return{declaredFunctions:c,declaredVariables:u,setupReturnFunctions:h}}},{key:"removeComments",value:function(e){return e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"")}},{key:"run",value:(n=u().mark((function t(){var r,n,a,i,l,c=this;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=this.getAllFiles(this.filesPath),n=new Set,a=s(r),t.prev=3,l=u().mark((function t(){var r,o,a,l,s;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=i.value,o=e.readFileSync(r,"utf8"),a=c.getDeclaredFunctionsAndVariables(o),l=a.declaredFunctions,s=a.declaredVariables,a.setupReturnFunctions.forEach((function(e){return n.add(e)})),[].concat(h(s),h(l)).forEach((function(e){c.deadMap[e.name]||(c.deadMap[e.name]={count:0,declaredIn:[]}),c.deadMap[e.name].declaredIn.push({filePath:r,line:e.line})}));case 5:case"end":return t.stop()}}),t)})),a.s();case 6:if((i=a.n()).done){t.next=10;break}return t.delegateYield(l(),"t0",8);case 8:t.next=6;break;case 10:t.next=15;break;case 12:t.prev=12,t.t1=t.catch(3),a.e(t.t1);case 15:return t.prev=15,a.f(),t.finish(15);case 18:r.forEach((function(t){var r=e.readFileSync(t,"utf8"),n=c.removeComments(r);Object.keys(c.deadMap).forEach((function(e){var t=new RegExp("\\b".concat(e,"\\b"),"g"),r=n.match(t);r&&(c.deadMap[e].count+=r.length)}))})),Object.keys(this.deadMap).forEach((function(e){var t=c.deadMap[e],r=2===t.count&&n.has(e);(1===t.count||r)&&(c.deadCodeFound=!0,t.declaredIn.forEach((function(t){c.cliTable.push([t.filePath,t.line,e])})))})),o.say("Dead Code Checker",ne),this.deadCodeFound?console.log(this.cliTable.toString()):console.log(X.greenBright("✅ No dead code found!"));case 22:case"end":return t.stop()}}),t,this,[[3,12,15,18]])})),a=function(){var e=this,t=arguments;return new Promise((function(r,o){var a=n.apply(e,t);function l(e){i(a,r,o,l,s,"next",e)}function s(e){i(a,r,o,l,s,"throw",e)}l(void 0)}))},function(){return a.apply(this,arguments)})}]);var n,a}();export{oe as default};

@@ -1,1 +0,1 @@

"use strict";var e=require("fs"),t=require("path"),r=require("cli-table3"),n=require("os"),o=require("cfonts");function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t,r,n,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).then(n,o)}function l(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=p(e))||t){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}function c(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,i=Object.create(a.prototype),l=new L(n||[]);return o(i,"_invoke",{value:C(e,r,l)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",g="suspendedYield",d="executing",b="completed",y={};function v(){}function m(){}function w(){}var k={};c(k,i,(function(){return this}));var M=Object.getPrototypeOf,x=M&&M(M(A([])));x&&x!==r&&n.call(x,i)&&(k=x);var O=w.prototype=v.prototype=Object.create(k);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,i,l)}),(function(e){r("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function C(t,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===b){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var l=n.delegate;if(l){var s=_(l,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?b:g,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=b,n.method="throw",n.arg=c.arg)}}}function _(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=w,o(O,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},E(j.prototype),c(j.prototype,l,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(h(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},E(O),c(O,s,"Generator"),c(O,i,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function h(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function p(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={exports:{}},b=/[|\\{}()[\]^$+*?.]/g,y=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(b,"\\$&")},v={exports:{}},m={exports:{}},w={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]},k={};for(var M in w)w.hasOwnProperty(M)&&(k[w[M]]=M);var x=m.exports={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"]}};for(var O in x)if(x.hasOwnProperty(O)){if(!("channels"in x[O]))throw new Error("missing channels property: "+O);if(!("labels"in x[O]))throw new Error("missing channel labels property: "+O);if(x[O].labels.length!==x[O].channels)throw new Error("channel and label counts mismatch: "+O);var E=x[O].channels,j=x[O].labels;delete x[O].channels,delete x[O].labels,Object.defineProperty(x[O],"channels",{value:E}),Object.defineProperty(x[O],"labels",{value:j})}x.rgb.hsl=function(e){var t,r,n=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(n,o,a),l=Math.max(n,o,a),s=l-i;return l===i?t=0:n===l?t=(o-a)/s:o===l?t=2+(a-n)/s:a===l&&(t=4+(n-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),r=(i+l)/2,[t,100*(l===i?0:r<=.5?s/(l+i):s/(2-l-i)),100*r]},x.rgb.hsv=function(e){var t,r,n,o,a,i=e[0]/255,l=e[1]/255,s=e[2]/255,c=Math.max(i,l,s),u=c-Math.min(i,l,s),h=function(e){return(c-e)/6/u+.5};return 0===u?o=a=0:(a=u/c,t=h(i),r=h(l),n=h(s),i===c?o=n-r:l===c?o=1/3+t-n:s===c&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*c]},x.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[x.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,n))),100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},x.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-o)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},x.rgb.keyword=function(e){var t=k[e];if(t)return t;var r,n,o,a=1/0;for(var i in w)if(w.hasOwnProperty(i)){var l=w[i],s=(n=e,o=l,Math.pow(n[0]-o[0],2)+Math.pow(n[1]-o[1],2)+Math.pow(n[2]-o[2],2));s<a&&(a=s,r=i)}return r},x.keyword.rgb=function(e){return w[e]},x.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},x.rgb.lab=function(e){var t=x.rgb.xyz(e),r=t[0],n=t[1],o=t[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},x.hsl.rgb=function(e){var t,r,n,o,a,i=e[0]/360,l=e[1]/100,s=e[2]/100;if(0===l)return[a=255*s,a,a];t=2*s-(r=s<.5?s*(1+l):s+l-s*l),o=[0,0,0];for(var c=0;c<3;c++)(n=i+1/3*-(c-1))<0&&n++,n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,o[c]=255*a;return o},x.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,o=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=a<=1?a:2-a,[t,100*(0===n?2*o/(a+o):2*r/(n+r)),100*((n+r)/2)]},x.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,a=t-Math.floor(t),i=255*n*(1-r),l=255*n*(1-r*a),s=255*n*(1-r*(1-a));switch(n*=255,o){case 0:return[n,s,i];case 1:return[l,n,i];case 2:return[i,n,s];case 3:return[i,l,n];case 4:return[s,i,n];case 5:return[n,i,l]}},x.hsv.hsl=function(e){var t,r,n,o=e[0],a=e[1]/100,i=e[2]/100,l=Math.max(i,.01);return n=(2-a)*i,r=a*l,[o,100*(r=(r/=(t=(2-a)*l)<=1?t:2-t)||0),100*(n/=2)]},x.hwb.rgb=function(e){var t,r,n,o,a,i,l,s=e[0]/360,c=e[1]/100,u=e[2]/100,h=c+u;switch(h>1&&(c/=h,u/=h),n=6*s-(t=Math.floor(6*s)),1&t&&(n=1-n),o=c+n*((r=1-u)-c),t){default:case 6:case 0:a=r,i=o,l=c;break;case 1:a=o,i=r,l=c;break;case 2:a=c,i=r,l=o;break;case 3:a=c,i=o,l=r;break;case 4:a=o,i=c,l=r;break;case 5:a=r,i=c,l=o}return[255*a,255*i,255*l]},x.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},x.xyz.rgb=function(e){var t,r,n,o=e[0]/100,a=e[1]/100,i=e[2]/100;return r=-.9689*o+1.8758*a+.0415*i,n=.0557*o+-.204*a+1.057*i,t=(t=3.2406*o+-1.5372*a+-.4986*i)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},x.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},x.lab.xyz=function(e){var t,r,n,o=e[0];t=e[1]/500+(r=(o+16)/116),n=r-e[2]/200;var a=Math.pow(r,3),i=Math.pow(t,3),l=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},x.lab.lch=function(e){var t,r=e[0],n=e[1],o=e[2];return(t=360*Math.atan2(o,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+o*o),t]},x.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},x.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],o=1 in arguments?arguments[1]:x.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===o&&(a+=60),a},x.hsv.ansi16=function(e){return x.rgb.ansi16(x.hsv.rgb(e),e[2])},x.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},x.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},x.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},x.rgb.hex=function(e){var 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},x.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},x.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255,a=Math.max(Math.max(r,n),o),i=Math.min(Math.min(r,n),o),l=a-i;return t=l<=0?0:a===r?(n-o)/l%6:a===n?2+(o-r)/l:4+(r-n)/l+4,t/=6,[360*(t%=1),100*l,100*(l<1?i/(1-l):0)]},x.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,o=0;return(n=r<.5?2*t*r:2*t*(1-r))<1&&(o=(r-.5*n)/(1-n)),[e[0],100*n,100*o]},x.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var o,a=[0,0,0],i=t%1*6,l=i%1,s=1-l;switch(Math.floor(i)){case 0:a[0]=1,a[1]=l,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=l;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=l,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return o=(1-r)*n,[255*(r*a[0]+o),255*(r*a[1]+o),255*(r*a[2]+o)]},x.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},x.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},x.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},x.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},x.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},x.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},x.gray.hsl=x.gray.hsv=function(e){return[0,0,e[0]]},x.gray.hwb=function(e){return[0,100,e[0]]},x.gray.cmyk=function(e){return[0,0,0,e[0]]},x.gray.lab=function(e){return[e[0],0,0]},x.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},x.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var C=m.exports,_=C;function R(e){var t=function(){for(var e={},t=Object.keys(_),r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var n=r.pop(),o=Object.keys(_[n]),a=o.length,i=0;i<a;i++){var l=o[i],s=t[l];-1===s.distance&&(s.distance=t[n].distance+1,s.parent=n,r.unshift(l))}return t}function P(e,t){return function(r){return t(e(r))}}function L(e,t){for(var r=[t[e].parent,e],n=_[t[e].parent][e],o=t[e].parent;t[o].parent;)r.unshift(t[o].parent),n=P(_[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}var A=C,S=function(e){for(var t=R(e),r={},n=Object.keys(t),o=n.length,a=0;a<o;a++){var i=n[a];null!==t[i].parent&&(r[i]=L(i,t))}return r},I={};Object.keys(A).forEach((function(e){I[e]={},Object.defineProperty(I[e],"channels",{value:A[e].channels}),Object.defineProperty(I[e],"labels",{value:A[e].labels});var t=S(e);Object.keys(t).forEach((function(r){var n=t[r];I[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,o=0;o<n;o++)r[o]=Math.round(r[o]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),I[e][r].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))}));var T=I;!function(e){const t=T,r=(e,r)=>function(){return`[${e.apply(t,arguments)+r}m`},n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`},o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};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],gray:[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.grey=a.color.gray;for(const t of Object.keys(a)){const r=a[t];for(const t of Object.keys(r)){const n=r[t];a[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=a[t],e.set(n[0],n[1])}Object.defineProperty(a,t,{value:r,enumerable:!1}),Object.defineProperty(a,"codes",{value:e,enumerable:!1})}const i=e=>e,l=(e,t,r)=>[e,t,r];a.color.close="",a.bgColor.close="",a.color.ansi={ansi:r(i,0)},a.color.ansi256={ansi256:n(i,0)},a.color.ansi16m={rgb:o(l,0)},a.bgColor.ansi={ansi:r(i,10)},a.bgColor.ansi256={ansi256:n(i,10)},a.bgColor.ansi16m={rgb:o(l,10)};for(let e of Object.keys(t)){if("object"!=typeof t[e])continue;const i=t[e];"ansi16"===e&&(e="ansi"),"ansi16"in i&&(a.color.ansi[e]=r(i.ansi16,0),a.bgColor.ansi[e]=r(i.ansi16,10)),"ansi256"in i&&(a.color.ansi256[e]=n(i.ansi256,0),a.bgColor.ansi256[e]=n(i.ansi256,10)),"rgb"in i&&(a.color.ansi16m[e]=o(i.rgb,0),a.bgColor.ansi16m[e]=o(i.rgb,10))}return a}})}(v);var F=v.exports;const B=n,$=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)},N=process.env;let G;function q(e){const t=function(e){if(!1===G)return 0;if($("color=16m")||$("color=full")||$("color=truecolor"))return 3;if($("color=256"))return 2;if(e&&!e.isTTY&&!0!==G)return 0;const t=G?1:0;if("win32"===process.platform){const e=B.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in N)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in N))||"codeship"===N.CI_NAME?1:t;if("TEAMCITY_VERSION"in N)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(N.TEAMCITY_VERSION)?1:0;if("truecolor"===N.COLORTERM)return 3;if("TERM_PROGRAM"in N){const e=parseInt((N.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(N.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(N.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(N.TERM)||"COLORTERM"in N?1:(N.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}$("no-color")||$("no-colors")||$("color=false")?G=!1:($("color")||$("colors")||$("color=true")||$("color=always"))&&(G=!0),"FORCE_COLOR"in N&&(G=0===N.FORCE_COLOR.length||0!==parseInt(N.FORCE_COLOR,10));var z={supportsColor:q,stdout:q(process.stdout),stderr:q(process.stderr)};const V=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Y=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,U=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,W=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,D=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function Z(e){return"u"===e[0]&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):D.get(e)||e}function H(e,t){const r=[],n=t.trim().split(/\s*,\s*/g);let o;for(const t of n)if(isNaN(t)){if(!(o=t.match(U)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);r.push(o[2].replace(W,((e,t,r)=>t?Z(t):r)))}else r.push(Number(t));return r}function J(e){Y.lastIndex=0;const t=[];let r;for(;null!==(r=Y.exec(e));){const e=r[1];if(r[2]){const n=H(e,r[2]);t.push([e].concat(n))}else t.push([e])}return t}function K(e,t){const r={};for(const e of t)for(const t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let n=e;for(const e of Object.keys(r))if(Array.isArray(r[e])){if(!(e in n))throw new Error(`Unknown Chalk style: ${e}`);n=r[e].length>0?n[e].apply(n,r[e]):n[e]}return n}var Q=(e,t)=>{const r=[],n=[];let o=[];if(t.replace(V,((t,a,i,l,s,c)=>{if(a)o.push(Z(a));else if(l){const t=o.join("");o=[],n.push(0===r.length?t:K(e,r)(t)),r.push({inverse:i,styles:J(l)})}else if(s){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");n.push(K(e,r)(o.join(""))),o=[],r.pop()}else o.push(c)})),n.push(o.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};!function(e){const t=y,r=F,n=z.stdout,o=Q,a="win32"===process.platform&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),i=["ansi","ansi","ansi256","ansi16m"],l=new Set(["gray"]),s=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=void 0===t.level?r:t.level,e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};return c(t,e),t.template=function(){const e=[].slice.call(arguments);return g.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,u.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=u,t.template}c(this,e)}a&&(r.blue.open="");for(const e of Object.keys(r))r[e].closeRe=new RegExp(t(r[e].close),"g"),s[e]={get(){const t=r[e];return f.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}};s.visible={get(){return f.call(this,this._styles||[],!0,"visible")}},r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi))l.has(e)||(s[e]={get(){const t=this.level;return function(){const n={open:r.color[i[t]][e].apply(null,arguments),close:r.color.close,closeRe:r.color.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}});r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(l.has(e))continue;s["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const t=this.level;return function(){const n={open:r.bgColor[i[t]][e].apply(null,arguments),close:r.bgColor.close,closeRe:r.bgColor.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const h=Object.defineProperties((()=>{}),s);function f(e,t,r){const n=function(){return p.apply(n,arguments)};n._styles=e,n._empty=t;const o=this;return Object.defineProperty(n,"level",{enumerable:!0,get:()=>o.level,set(e){o.level=e}}),Object.defineProperty(n,"enabled",{enumerable:!0,get:()=>o.enabled,set(e){o.enabled=e}}),n.hasGrey=this.hasGrey||"gray"===r||"grey"===r,n.__proto__=h,n}function p(){const e=arguments,t=e.length;let n=String(arguments[0]);if(0===t)return"";if(t>1)for(let r=1;r<t;r++)n+=" "+e[r];if(!this.enabled||this.level<=0||!n)return this._empty?"":n;const o=r.dim.open;a&&this.hasGrey&&(r.dim.open="");for(const e of this._styles.slice().reverse())n=e.open+n.replace(e.closeRe,e.open)+e.close,n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`);return r.dim.open=o,n}function g(e,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");const r=[].slice.call(arguments,2),n=[t.raw[0]];for(let e=1;e<t.length;e++)n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&")),n.push(String(t.raw[e]));return o(e,n.join(""))}Object.defineProperties(u.prototype,s),e.exports=u(),e.exports.supportsColor=n,e.exports.default=e.exports}(d);var X=g(d.exports),ee=["if","for","while","catch","switch","case","const","let","var","function","mounted","unmounted","created","updated","beforeMount","beforeUpdate","beforeDestroy","destroyed","setup"],te=[".js",".jsx",".ts",".tsx",".vue",".svelte",".astro"],re={font:"tiny",align:"left",colors:["red"],background:"transparent",letterSpacing:1,lineHeight:1,space:!0,maxLength:"0",gradient:!1,independentGradient:!1,transitionGradient:!1,env:"node"},ne=function(){return l((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"filesPath","."),c(this,"deadMap",{}),c(this,"deadCodeFound",!1),c(this,"cliTable",new r({head:[X.red("📁 File"),X.red("🔢 Line"),X.red("🔍 Name")],colWidths:[100,10,30]})),this.filesPath=t}),[{key:"getAllFiles",value:function(r){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{return e.readdirSync(r).forEach((function(a){var i=t.join(r,a);e.statSync(i).isDirectory()?o=n.getAllFiles(i,o):te.some((function(e){return a.endsWith(e)}))&&o.push(i)})),o}catch(e){return[]}}},{key:"isBuiltInFunctionOrVariable",value:function(e){return ee.includes(e)}},{key:"getDeclaredFunctionsAndVariables",value:function(e){var t,r=this,n=/function\s+([a-zA-Z0-9_]+)/g,o=/const\s+([a-zA-Z0-9_]+)\s*=\s*\(/g,a=/([a-zA-Z0-9_]+)\s*\(([^)]*)\)\s*{/g,i=/(?:const|let|var)\s+([a-zA-Z0-9_]+)/g,l=/methods\s*:\s*{([^}]*)}/g,s=/return\s*{([^}]*)}/g,c=[],u=[],h=new Set,f=0;for(e.split("\n").forEach((function(e){f++,null!==(t=n.exec(e))||null!==(t=o.exec(e))||null!==(t=a.exec(e))?r.isBuiltInFunctionOrVariable(t[1])||c.push({name:t[1],line:f}):null!==(t=i.exec(e))&&(r.isBuiltInFunctionOrVariable(t[1])||u.push({name:t[1],line:f}))}));null!==(t=l.exec(e));){(t[1].match(/([a-zA-Z0-9_]+)\s*\(/g)||[]).forEach((function(e,t){e=e.trim().replace("(",""),r.isBuiltInFunctionOrVariable(e)||c.push({name:e,line:f+t})}))}for(;null!==(t=s.exec(e));){(t[1].split(",")||[]).forEach((function(e){e=e.trim().replace(":",""),h.add(e)}))}return{declaredFunctions:c,declaredVariables:u,setupReturnFunctions:h}}},{key:"removeComments",value:function(e){return e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"")}},{key:"run",value:(n=u().mark((function t(){var r,n,a,i,l,c=this;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=this.getAllFiles(this.filesPath),n=new Set,a=s(r),t.prev=3,l=u().mark((function t(){var r,o,a,l,s;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=i.value,o=e.readFileSync(r,"utf8"),a=c.getDeclaredFunctionsAndVariables(o),l=a.declaredFunctions,s=a.declaredVariables,a.setupReturnFunctions.forEach((function(e){return n.add(e)})),[].concat(h(s),h(l)).forEach((function(e){c.deadMap[e.name]||(c.deadMap[e.name]={count:0,declaredIn:[]}),c.deadMap[e.name].declaredIn.push({filePath:r,line:e.line})}));case 5:case"end":return t.stop()}}),t)})),a.s();case 6:if((i=a.n()).done){t.next=10;break}return t.delegateYield(l(),"t0",8);case 8:t.next=6;break;case 10:t.next=15;break;case 12:t.prev=12,t.t1=t.catch(3),a.e(t.t1);case 15:return t.prev=15,a.f(),t.finish(15);case 18:r.forEach((function(t){var r=e.readFileSync(t,"utf8"),n=c.removeComments(r);Object.keys(c.deadMap).forEach((function(e){var t=new RegExp("\\b".concat(e,"\\b"),"g"),r=n.match(t);r&&(c.deadMap[e].count+=r.length)}))})),Object.keys(this.deadMap).forEach((function(e){var t=c.deadMap[e],r=2===t.count&&n.has(e);(1===t.count||r)&&(c.deadCodeFound=!0,t.declaredIn.forEach((function(t){c.cliTable.push([t.filePath,t.line,e])})))})),o.say("Dead Code Checker",re),this.deadCodeFound?console.log(this.cliTable.toString()):console.log(X.greenBright("✅ No dead code found!"));case 22:case"end":return t.stop()}}),t,this,[[3,12,15,18]])})),a=function(){var e=this,t=arguments;return new Promise((function(r,o){var a=n.apply(e,t);function l(e){i(a,r,o,l,s,"next",e)}function s(e){i(a,r,o,l,s,"throw",e)}l(void 0)}))},function(){return a.apply(this,arguments)})}]);var n,a}();module.exports=ne;
"use strict";var e=require("fs"),t=require("path"),r=require("cli-table3"),n=require("os"),o=require("cfonts");function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t,r,n,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).then(n,o)}function l(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=p(e))||t){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}function c(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,i=Object.create(a.prototype),l=new L(n||[]);return o(i,"_invoke",{value:C(e,r,l)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",g="suspendedYield",d="executing",b="completed",y={};function v(){}function m(){}function w(){}var k={};c(k,i,(function(){return this}));var M=Object.getPrototypeOf,x=M&&M(M(A([])));x&&x!==r&&n.call(x,i)&&(k=x);var O=w.prototype=v.prototype=Object.create(k);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,i,l)}),(function(e){r("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function C(t,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===b){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var l=n.delegate;if(l){var s=_(l,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?b:g,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=b,n.method="throw",n.arg=c.arg)}}}function _(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=w,o(O,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},E(j.prototype),c(j.prototype,l,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(h(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},E(O),c(O,s,"Generator"),c(O,i,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function h(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function p(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={exports:{}},b=/[|\\{}()[\]^$+*?.]/g,y=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(b,"\\$&")},v={exports:{}},m={exports:{}},w={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]},k={};for(var M in w)w.hasOwnProperty(M)&&(k[w[M]]=M);var x=m.exports={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"]}};for(var O in x)if(x.hasOwnProperty(O)){if(!("channels"in x[O]))throw new Error("missing channels property: "+O);if(!("labels"in x[O]))throw new Error("missing channel labels property: "+O);if(x[O].labels.length!==x[O].channels)throw new Error("channel and label counts mismatch: "+O);var E=x[O].channels,j=x[O].labels;delete x[O].channels,delete x[O].labels,Object.defineProperty(x[O],"channels",{value:E}),Object.defineProperty(x[O],"labels",{value:j})}x.rgb.hsl=function(e){var t,r,n=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(n,o,a),l=Math.max(n,o,a),s=l-i;return l===i?t=0:n===l?t=(o-a)/s:o===l?t=2+(a-n)/s:a===l&&(t=4+(n-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),r=(i+l)/2,[t,100*(l===i?0:r<=.5?s/(l+i):s/(2-l-i)),100*r]},x.rgb.hsv=function(e){var t,r,n,o,a,i=e[0]/255,l=e[1]/255,s=e[2]/255,c=Math.max(i,l,s),u=c-Math.min(i,l,s),h=function(e){return(c-e)/6/u+.5};return 0===u?o=a=0:(a=u/c,t=h(i),r=h(l),n=h(s),i===c?o=n-r:l===c?o=1/3+t-n:s===c&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*c]},x.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[x.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,n))),100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},x.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-o)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},x.rgb.keyword=function(e){var t=k[e];if(t)return t;var r,n,o,a=1/0;for(var i in w)if(w.hasOwnProperty(i)){var l=w[i],s=(n=e,o=l,Math.pow(n[0]-o[0],2)+Math.pow(n[1]-o[1],2)+Math.pow(n[2]-o[2],2));s<a&&(a=s,r=i)}return r},x.keyword.rgb=function(e){return w[e]},x.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},x.rgb.lab=function(e){var t=x.rgb.xyz(e),r=t[0],n=t[1],o=t[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},x.hsl.rgb=function(e){var t,r,n,o,a,i=e[0]/360,l=e[1]/100,s=e[2]/100;if(0===l)return[a=255*s,a,a];t=2*s-(r=s<.5?s*(1+l):s+l-s*l),o=[0,0,0];for(var c=0;c<3;c++)(n=i+1/3*-(c-1))<0&&n++,n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,o[c]=255*a;return o},x.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,o=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=a<=1?a:2-a,[t,100*(0===n?2*o/(a+o):2*r/(n+r)),100*((n+r)/2)]},x.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,a=t-Math.floor(t),i=255*n*(1-r),l=255*n*(1-r*a),s=255*n*(1-r*(1-a));switch(n*=255,o){case 0:return[n,s,i];case 1:return[l,n,i];case 2:return[i,n,s];case 3:return[i,l,n];case 4:return[s,i,n];case 5:return[n,i,l]}},x.hsv.hsl=function(e){var t,r,n,o=e[0],a=e[1]/100,i=e[2]/100,l=Math.max(i,.01);return n=(2-a)*i,r=a*l,[o,100*(r=(r/=(t=(2-a)*l)<=1?t:2-t)||0),100*(n/=2)]},x.hwb.rgb=function(e){var t,r,n,o,a,i,l,s=e[0]/360,c=e[1]/100,u=e[2]/100,h=c+u;switch(h>1&&(c/=h,u/=h),n=6*s-(t=Math.floor(6*s)),1&t&&(n=1-n),o=c+n*((r=1-u)-c),t){default:case 6:case 0:a=r,i=o,l=c;break;case 1:a=o,i=r,l=c;break;case 2:a=c,i=r,l=o;break;case 3:a=c,i=o,l=r;break;case 4:a=o,i=c,l=r;break;case 5:a=r,i=c,l=o}return[255*a,255*i,255*l]},x.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},x.xyz.rgb=function(e){var t,r,n,o=e[0]/100,a=e[1]/100,i=e[2]/100;return r=-.9689*o+1.8758*a+.0415*i,n=.0557*o+-.204*a+1.057*i,t=(t=3.2406*o+-1.5372*a+-.4986*i)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},x.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},x.lab.xyz=function(e){var t,r,n,o=e[0];t=e[1]/500+(r=(o+16)/116),n=r-e[2]/200;var a=Math.pow(r,3),i=Math.pow(t,3),l=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},x.lab.lch=function(e){var t,r=e[0],n=e[1],o=e[2];return(t=360*Math.atan2(o,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+o*o),t]},x.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},x.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],o=1 in arguments?arguments[1]:x.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===o&&(a+=60),a},x.hsv.ansi16=function(e){return x.rgb.ansi16(x.hsv.rgb(e),e[2])},x.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},x.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},x.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},x.rgb.hex=function(e){var 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},x.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},x.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255,a=Math.max(Math.max(r,n),o),i=Math.min(Math.min(r,n),o),l=a-i;return t=l<=0?0:a===r?(n-o)/l%6:a===n?2+(o-r)/l:4+(r-n)/l+4,t/=6,[360*(t%=1),100*l,100*(l<1?i/(1-l):0)]},x.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,o=0;return(n=r<.5?2*t*r:2*t*(1-r))<1&&(o=(r-.5*n)/(1-n)),[e[0],100*n,100*o]},x.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var o,a=[0,0,0],i=t%1*6,l=i%1,s=1-l;switch(Math.floor(i)){case 0:a[0]=1,a[1]=l,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=l;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=l,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return o=(1-r)*n,[255*(r*a[0]+o),255*(r*a[1]+o),255*(r*a[2]+o)]},x.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},x.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},x.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},x.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},x.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},x.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},x.gray.hsl=x.gray.hsv=function(e){return[0,0,e[0]]},x.gray.hwb=function(e){return[0,100,e[0]]},x.gray.cmyk=function(e){return[0,0,0,e[0]]},x.gray.lab=function(e){return[e[0],0,0]},x.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},x.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var C=m.exports,_=C;function R(e){var t=function(){for(var e={},t=Object.keys(_),r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var n=r.pop(),o=Object.keys(_[n]),a=o.length,i=0;i<a;i++){var l=o[i],s=t[l];-1===s.distance&&(s.distance=t[n].distance+1,s.parent=n,r.unshift(l))}return t}function P(e,t){return function(r){return t(e(r))}}function L(e,t){for(var r=[t[e].parent,e],n=_[t[e].parent][e],o=t[e].parent;t[o].parent;)r.unshift(t[o].parent),n=P(_[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}var A=C,S=function(e){for(var t=R(e),r={},n=Object.keys(t),o=n.length,a=0;a<o;a++){var i=n[a];null!==t[i].parent&&(r[i]=L(i,t))}return r},I={};Object.keys(A).forEach((function(e){I[e]={},Object.defineProperty(I[e],"channels",{value:A[e].channels}),Object.defineProperty(I[e],"labels",{value:A[e].labels});var t=S(e);Object.keys(t).forEach((function(r){var n=t[r];I[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,o=0;o<n;o++)r[o]=Math.round(r[o]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),I[e][r].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))}));var T=I;!function(e){const t=T,r=(e,r)=>function(){return`[${e.apply(t,arguments)+r}m`},n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`},o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};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],gray:[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.grey=a.color.gray;for(const t of Object.keys(a)){const r=a[t];for(const t of Object.keys(r)){const n=r[t];a[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=a[t],e.set(n[0],n[1])}Object.defineProperty(a,t,{value:r,enumerable:!1}),Object.defineProperty(a,"codes",{value:e,enumerable:!1})}const i=e=>e,l=(e,t,r)=>[e,t,r];a.color.close="",a.bgColor.close="",a.color.ansi={ansi:r(i,0)},a.color.ansi256={ansi256:n(i,0)},a.color.ansi16m={rgb:o(l,0)},a.bgColor.ansi={ansi:r(i,10)},a.bgColor.ansi256={ansi256:n(i,10)},a.bgColor.ansi16m={rgb:o(l,10)};for(let e of Object.keys(t)){if("object"!=typeof t[e])continue;const i=t[e];"ansi16"===e&&(e="ansi"),"ansi16"in i&&(a.color.ansi[e]=r(i.ansi16,0),a.bgColor.ansi[e]=r(i.ansi16,10)),"ansi256"in i&&(a.color.ansi256[e]=n(i.ansi256,0),a.bgColor.ansi256[e]=n(i.ansi256,10)),"rgb"in i&&(a.color.ansi16m[e]=o(i.rgb,0),a.bgColor.ansi16m[e]=o(i.rgb,10))}return a}})}(v);var F=v.exports;const B=n,$=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)},N=process.env;let G;function q(e){const t=function(e){if(!1===G)return 0;if($("color=16m")||$("color=full")||$("color=truecolor"))return 3;if($("color=256"))return 2;if(e&&!e.isTTY&&!0!==G)return 0;const t=G?1:0;if("win32"===process.platform){const e=B.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in N)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in N))||"codeship"===N.CI_NAME?1:t;if("TEAMCITY_VERSION"in N)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(N.TEAMCITY_VERSION)?1:0;if("truecolor"===N.COLORTERM)return 3;if("TERM_PROGRAM"in N){const e=parseInt((N.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(N.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(N.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(N.TERM)||"COLORTERM"in N?1:(N.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}$("no-color")||$("no-colors")||$("color=false")?G=!1:($("color")||$("colors")||$("color=true")||$("color=always"))&&(G=!0),"FORCE_COLOR"in N&&(G=0===N.FORCE_COLOR.length||0!==parseInt(N.FORCE_COLOR,10));var z={supportsColor:q,stdout:q(process.stdout),stderr:q(process.stderr)};const V=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Y=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,U=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,W=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,D=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function Z(e){return"u"===e[0]&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):D.get(e)||e}function H(e,t){const r=[],n=t.trim().split(/\s*,\s*/g);let o;for(const t of n)if(isNaN(t)){if(!(o=t.match(U)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);r.push(o[2].replace(W,((e,t,r)=>t?Z(t):r)))}else r.push(Number(t));return r}function J(e){Y.lastIndex=0;const t=[];let r;for(;null!==(r=Y.exec(e));){const e=r[1];if(r[2]){const n=H(e,r[2]);t.push([e].concat(n))}else t.push([e])}return t}function K(e,t){const r={};for(const e of t)for(const t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let n=e;for(const e of Object.keys(r))if(Array.isArray(r[e])){if(!(e in n))throw new Error(`Unknown Chalk style: ${e}`);n=r[e].length>0?n[e].apply(n,r[e]):n[e]}return n}var Q=(e,t)=>{const r=[],n=[];let o=[];if(t.replace(V,((t,a,i,l,s,c)=>{if(a)o.push(Z(a));else if(l){const t=o.join("");o=[],n.push(0===r.length?t:K(e,r)(t)),r.push({inverse:i,styles:J(l)})}else if(s){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");n.push(K(e,r)(o.join(""))),o=[],r.pop()}else o.push(c)})),n.push(o.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};!function(e){const t=y,r=F,n=z.stdout,o=Q,a="win32"===process.platform&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),i=["ansi","ansi","ansi256","ansi16m"],l=new Set(["gray"]),s=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=void 0===t.level?r:t.level,e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};return c(t,e),t.template=function(){const e=[].slice.call(arguments);return g.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,u.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=u,t.template}c(this,e)}a&&(r.blue.open="");for(const e of Object.keys(r))r[e].closeRe=new RegExp(t(r[e].close),"g"),s[e]={get(){const t=r[e];return f.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}};s.visible={get(){return f.call(this,this._styles||[],!0,"visible")}},r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi))l.has(e)||(s[e]={get(){const t=this.level;return function(){const n={open:r.color[i[t]][e].apply(null,arguments),close:r.color.close,closeRe:r.color.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}});r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(l.has(e))continue;s["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const t=this.level;return function(){const n={open:r.bgColor[i[t]][e].apply(null,arguments),close:r.bgColor.close,closeRe:r.bgColor.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const h=Object.defineProperties((()=>{}),s);function f(e,t,r){const n=function(){return p.apply(n,arguments)};n._styles=e,n._empty=t;const o=this;return Object.defineProperty(n,"level",{enumerable:!0,get:()=>o.level,set(e){o.level=e}}),Object.defineProperty(n,"enabled",{enumerable:!0,get:()=>o.enabled,set(e){o.enabled=e}}),n.hasGrey=this.hasGrey||"gray"===r||"grey"===r,n.__proto__=h,n}function p(){const e=arguments,t=e.length;let n=String(arguments[0]);if(0===t)return"";if(t>1)for(let r=1;r<t;r++)n+=" "+e[r];if(!this.enabled||this.level<=0||!n)return this._empty?"":n;const o=r.dim.open;a&&this.hasGrey&&(r.dim.open="");for(const e of this._styles.slice().reverse())n=e.open+n.replace(e.closeRe,e.open)+e.close,n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`);return r.dim.open=o,n}function g(e,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");const r=[].slice.call(arguments,2),n=[t.raw[0]];for(let e=1;e<t.length;e++)n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&")),n.push(String(t.raw[e]));return o(e,n.join(""))}Object.defineProperties(u.prototype,s),e.exports=u(),e.exports.supportsColor=n,e.exports.default=e.exports}(d);var X=g(d.exports),ee=["if","for","while","catch","switch","case","json","const","let","var","function","mounted","unmounted","created","updated","beforeMount","beforeUpdate","beforeDestroy","destroyed","setup","constructor"],te=[".js",".jsx",".ts",".tsx",".vue",".svelte",".astro"],re=["node_modules",".git","dist","build"],ne={font:"tiny",align:"left",colors:["red"],background:"transparent",letterSpacing:1,lineHeight:1,space:!0,maxLength:"0",gradient:!1,independentGradient:!1,transitionGradient:!1,env:"node"},oe=function(){return l((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"filesPath","."),c(this,"deadMap",{}),c(this,"deadCodeFound",!1),c(this,"cliTable",new r({head:[X.red("📁 File"),X.red("🔢 Line"),X.red("🔍 Name")],colWidths:[100,10,30]})),this.filesPath=t}),[{key:"getAllFiles",value:function(r){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{return e.readdirSync(r).forEach((function(a){var i=t.join(r,a);e.statSync(i).isDirectory()?re.includes(a)||(o=n.getAllFiles(i,o)):te.some((function(e){return a.endsWith(e)}))&&o.push(i)})),o}catch(e){return[]}}},{key:"isBuiltInFunctionOrVariable",value:function(e){return ee.includes(e)}},{key:"getDeclaredFunctionsAndVariables",value:function(e){var t,r=this,n=/\bfunction\s+([a-zA-Z0-9_]+)\s*\(/g,o=/\bconst\s+([a-zA-Z0-9_]+)\s*=\s*\(/g,a=/([a-zA-Z0-9_]+)\s*\(([^)]*)\)\s*{/g,i=/\bmethods\s*:\s*{([^}]*)}/g,l=/\breturn\s*{([^}]*)}/g,s=/\b(?:const|let|var)\s+([a-zA-Z0-9_]+)\s*=?/g,c=[],u=[],h=new Set,f=0;for(e.split("\n").forEach((function(e){f++,null!==(t=n.exec(e))||null!==(t=o.exec(e))||null!==(t=a.exec(e))?r.isBuiltInFunctionOrVariable(t[1])||c.push({name:t[1],line:f}):null!==(t=s.exec(e))&&(r.isBuiltInFunctionOrVariable(t[1])||u.push({name:t[1],line:f}))}));null!==(t=i.exec(e));){(t[1].match(/([a-zA-Z0-9_]+)\s*\(/g)||[]).forEach((function(e,t){e=e.trim().replace("(",""),r.isBuiltInFunctionOrVariable(e)||c.push({name:e,line:f+t})}))}for(;null!==(t=l.exec(e));){(t[1].split(",")||[]).forEach((function(e){e=e.trim().replace(":",""),h.add(e)}))}return{declaredFunctions:c,declaredVariables:u,setupReturnFunctions:h}}},{key:"removeComments",value:function(e){return e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"")}},{key:"run",value:(n=u().mark((function t(){var r,n,a,i,l,c=this;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=this.getAllFiles(this.filesPath),n=new Set,a=s(r),t.prev=3,l=u().mark((function t(){var r,o,a,l,s;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=i.value,o=e.readFileSync(r,"utf8"),a=c.getDeclaredFunctionsAndVariables(o),l=a.declaredFunctions,s=a.declaredVariables,a.setupReturnFunctions.forEach((function(e){return n.add(e)})),[].concat(h(s),h(l)).forEach((function(e){c.deadMap[e.name]||(c.deadMap[e.name]={count:0,declaredIn:[]}),c.deadMap[e.name].declaredIn.push({filePath:r,line:e.line})}));case 5:case"end":return t.stop()}}),t)})),a.s();case 6:if((i=a.n()).done){t.next=10;break}return t.delegateYield(l(),"t0",8);case 8:t.next=6;break;case 10:t.next=15;break;case 12:t.prev=12,t.t1=t.catch(3),a.e(t.t1);case 15:return t.prev=15,a.f(),t.finish(15);case 18:r.forEach((function(t){var r=e.readFileSync(t,"utf8"),n=c.removeComments(r);Object.keys(c.deadMap).forEach((function(e){var t=new RegExp("\\b".concat(e,"\\b"),"g"),r=n.match(t);r&&(c.deadMap[e].count+=r.length)}))})),Object.keys(this.deadMap).forEach((function(e){var t=c.deadMap[e],r=2===t.count&&n.has(e);(1===t.count||r)&&(c.deadCodeFound=!0,t.declaredIn.forEach((function(t){c.cliTable.push([t.filePath,t.line,e])})))})),o.say("Dead Code Checker",ne),this.deadCodeFound?console.log(this.cliTable.toString()):console.log(X.greenBright("✅ No dead code found!"));case 22:case"end":return t.stop()}}),t,this,[[3,12,15,18]])})),a=function(){var e=this,t=arguments;return new Promise((function(r,o){var a=n.apply(e,t);function l(e){i(a,r,o,l,s,"next",e)}function s(e){i(a,r,o,l,s,"throw",e)}l(void 0)}))},function(){return a.apply(this,arguments)})}]);var n,a}();module.exports=oe;

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("fs"),require("path"),require("cli-table3"),require("os"),require("cfonts")):"function"==typeof define&&define.amd?define(["fs","path","cli-table3","os","cfonts"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["dead-code-checker"]=t(e.fs,e.path,e.Table,e.require$$0,e.cfonts)}(this,(function(e,t,r,n,o){"use strict";function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t,r,n,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).then(n,o)}function l(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=p(e))||t){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}function c(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,i=Object.create(a.prototype),l=new L(n||[]);return o(i,"_invoke",{value:C(e,r,l)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",g="suspendedYield",d="executing",b="completed",y={};function v(){}function m(){}function w(){}var k={};c(k,i,(function(){return this}));var M=Object.getPrototypeOf,x=M&&M(M(A([])));x&&x!==r&&n.call(x,i)&&(k=x);var O=w.prototype=v.prototype=Object.create(k);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,i,l)}),(function(e){r("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function C(t,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===b){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var l=n.delegate;if(l){var s=_(l,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?b:g,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=b,n.method="throw",n.arg=c.arg)}}}function _(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=w,o(O,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},E(j.prototype),c(j.prototype,l,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(h(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},E(O),c(O,s,"Generator"),c(O,i,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function h(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function p(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={exports:{}},b=/[|\\{}()[\]^$+*?.]/g,y=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(b,"\\$&")},v={exports:{}},m={exports:{}},w={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]},k={};for(var M in w)w.hasOwnProperty(M)&&(k[w[M]]=M);var x=m.exports={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"]}};for(var O in x)if(x.hasOwnProperty(O)){if(!("channels"in x[O]))throw new Error("missing channels property: "+O);if(!("labels"in x[O]))throw new Error("missing channel labels property: "+O);if(x[O].labels.length!==x[O].channels)throw new Error("channel and label counts mismatch: "+O);var E=x[O].channels,j=x[O].labels;delete x[O].channels,delete x[O].labels,Object.defineProperty(x[O],"channels",{value:E}),Object.defineProperty(x[O],"labels",{value:j})}x.rgb.hsl=function(e){var t,r,n=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(n,o,a),l=Math.max(n,o,a),s=l-i;return l===i?t=0:n===l?t=(o-a)/s:o===l?t=2+(a-n)/s:a===l&&(t=4+(n-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),r=(i+l)/2,[t,100*(l===i?0:r<=.5?s/(l+i):s/(2-l-i)),100*r]},x.rgb.hsv=function(e){var t,r,n,o,a,i=e[0]/255,l=e[1]/255,s=e[2]/255,c=Math.max(i,l,s),u=c-Math.min(i,l,s),h=function(e){return(c-e)/6/u+.5};return 0===u?o=a=0:(a=u/c,t=h(i),r=h(l),n=h(s),i===c?o=n-r:l===c?o=1/3+t-n:s===c&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*c]},x.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[x.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,n))),100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},x.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-o)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},x.rgb.keyword=function(e){var t=k[e];if(t)return t;var r,n,o,a=1/0;for(var i in w)if(w.hasOwnProperty(i)){var l=w[i],s=(n=e,o=l,Math.pow(n[0]-o[0],2)+Math.pow(n[1]-o[1],2)+Math.pow(n[2]-o[2],2));s<a&&(a=s,r=i)}return r},x.keyword.rgb=function(e){return w[e]},x.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},x.rgb.lab=function(e){var t=x.rgb.xyz(e),r=t[0],n=t[1],o=t[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},x.hsl.rgb=function(e){var t,r,n,o,a,i=e[0]/360,l=e[1]/100,s=e[2]/100;if(0===l)return[a=255*s,a,a];t=2*s-(r=s<.5?s*(1+l):s+l-s*l),o=[0,0,0];for(var c=0;c<3;c++)(n=i+1/3*-(c-1))<0&&n++,n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,o[c]=255*a;return o},x.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,o=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=a<=1?a:2-a,[t,100*(0===n?2*o/(a+o):2*r/(n+r)),100*((n+r)/2)]},x.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,a=t-Math.floor(t),i=255*n*(1-r),l=255*n*(1-r*a),s=255*n*(1-r*(1-a));switch(n*=255,o){case 0:return[n,s,i];case 1:return[l,n,i];case 2:return[i,n,s];case 3:return[i,l,n];case 4:return[s,i,n];case 5:return[n,i,l]}},x.hsv.hsl=function(e){var t,r,n,o=e[0],a=e[1]/100,i=e[2]/100,l=Math.max(i,.01);return n=(2-a)*i,r=a*l,[o,100*(r=(r/=(t=(2-a)*l)<=1?t:2-t)||0),100*(n/=2)]},x.hwb.rgb=function(e){var t,r,n,o,a,i,l,s=e[0]/360,c=e[1]/100,u=e[2]/100,h=c+u;switch(h>1&&(c/=h,u/=h),n=6*s-(t=Math.floor(6*s)),1&t&&(n=1-n),o=c+n*((r=1-u)-c),t){default:case 6:case 0:a=r,i=o,l=c;break;case 1:a=o,i=r,l=c;break;case 2:a=c,i=r,l=o;break;case 3:a=c,i=o,l=r;break;case 4:a=o,i=c,l=r;break;case 5:a=r,i=c,l=o}return[255*a,255*i,255*l]},x.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},x.xyz.rgb=function(e){var t,r,n,o=e[0]/100,a=e[1]/100,i=e[2]/100;return r=-.9689*o+1.8758*a+.0415*i,n=.0557*o+-.204*a+1.057*i,t=(t=3.2406*o+-1.5372*a+-.4986*i)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},x.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},x.lab.xyz=function(e){var t,r,n,o=e[0];t=e[1]/500+(r=(o+16)/116),n=r-e[2]/200;var a=Math.pow(r,3),i=Math.pow(t,3),l=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},x.lab.lch=function(e){var t,r=e[0],n=e[1],o=e[2];return(t=360*Math.atan2(o,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+o*o),t]},x.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},x.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],o=1 in arguments?arguments[1]:x.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===o&&(a+=60),a},x.hsv.ansi16=function(e){return x.rgb.ansi16(x.hsv.rgb(e),e[2])},x.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},x.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},x.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},x.rgb.hex=function(e){var 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},x.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},x.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255,a=Math.max(Math.max(r,n),o),i=Math.min(Math.min(r,n),o),l=a-i;return t=l<=0?0:a===r?(n-o)/l%6:a===n?2+(o-r)/l:4+(r-n)/l+4,t/=6,[360*(t%=1),100*l,100*(l<1?i/(1-l):0)]},x.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,o=0;return(n=r<.5?2*t*r:2*t*(1-r))<1&&(o=(r-.5*n)/(1-n)),[e[0],100*n,100*o]},x.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var o,a=[0,0,0],i=t%1*6,l=i%1,s=1-l;switch(Math.floor(i)){case 0:a[0]=1,a[1]=l,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=l;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=l,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return o=(1-r)*n,[255*(r*a[0]+o),255*(r*a[1]+o),255*(r*a[2]+o)]},x.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},x.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},x.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},x.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},x.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},x.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},x.gray.hsl=x.gray.hsv=function(e){return[0,0,e[0]]},x.gray.hwb=function(e){return[0,100,e[0]]},x.gray.cmyk=function(e){return[0,0,0,e[0]]},x.gray.lab=function(e){return[e[0],0,0]},x.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},x.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var C=m.exports,_=C;function R(e){var t=function(){for(var e={},t=Object.keys(_),r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var n=r.pop(),o=Object.keys(_[n]),a=o.length,i=0;i<a;i++){var l=o[i],s=t[l];-1===s.distance&&(s.distance=t[n].distance+1,s.parent=n,r.unshift(l))}return t}function P(e,t){return function(r){return t(e(r))}}function L(e,t){for(var r=[t[e].parent,e],n=_[t[e].parent][e],o=t[e].parent;t[o].parent;)r.unshift(t[o].parent),n=P(_[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}var A=C,S=function(e){for(var t=R(e),r={},n=Object.keys(t),o=n.length,a=0;a<o;a++){var i=n[a];null!==t[i].parent&&(r[i]=L(i,t))}return r},T={};Object.keys(A).forEach((function(e){T[e]={},Object.defineProperty(T[e],"channels",{value:A[e].channels}),Object.defineProperty(T[e],"labels",{value:A[e].labels});var t=S(e);Object.keys(t).forEach((function(r){var n=t[r];T[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,o=0;o<n;o++)r[o]=Math.round(r[o]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),T[e][r].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))}));var I=T;!function(e){const t=I,r=(e,r)=>function(){return`[${e.apply(t,arguments)+r}m`},n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`},o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};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],gray:[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.grey=a.color.gray;for(const t of Object.keys(a)){const r=a[t];for(const t of Object.keys(r)){const n=r[t];a[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=a[t],e.set(n[0],n[1])}Object.defineProperty(a,t,{value:r,enumerable:!1}),Object.defineProperty(a,"codes",{value:e,enumerable:!1})}const i=e=>e,l=(e,t,r)=>[e,t,r];a.color.close="",a.bgColor.close="",a.color.ansi={ansi:r(i,0)},a.color.ansi256={ansi256:n(i,0)},a.color.ansi16m={rgb:o(l,0)},a.bgColor.ansi={ansi:r(i,10)},a.bgColor.ansi256={ansi256:n(i,10)},a.bgColor.ansi16m={rgb:o(l,10)};for(let e of Object.keys(t)){if("object"!=typeof t[e])continue;const i=t[e];"ansi16"===e&&(e="ansi"),"ansi16"in i&&(a.color.ansi[e]=r(i.ansi16,0),a.bgColor.ansi[e]=r(i.ansi16,10)),"ansi256"in i&&(a.color.ansi256[e]=n(i.ansi256,0),a.bgColor.ansi256[e]=n(i.ansi256,10)),"rgb"in i&&(a.color.ansi16m[e]=o(i.rgb,0),a.bgColor.ansi16m[e]=o(i.rgb,10))}return a}})}(v);var F=v.exports;const B=n,$=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)},N=process.env;let G;function q(e){const t=function(e){if(!1===G)return 0;if($("color=16m")||$("color=full")||$("color=truecolor"))return 3;if($("color=256"))return 2;if(e&&!e.isTTY&&!0!==G)return 0;const t=G?1:0;if("win32"===process.platform){const e=B.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in N)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in N))||"codeship"===N.CI_NAME?1:t;if("TEAMCITY_VERSION"in N)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(N.TEAMCITY_VERSION)?1:0;if("truecolor"===N.COLORTERM)return 3;if("TERM_PROGRAM"in N){const e=parseInt((N.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(N.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(N.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(N.TERM)||"COLORTERM"in N?1:(N.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}$("no-color")||$("no-colors")||$("color=false")?G=!1:($("color")||$("colors")||$("color=true")||$("color=always"))&&(G=!0),"FORCE_COLOR"in N&&(G=0===N.FORCE_COLOR.length||0!==parseInt(N.FORCE_COLOR,10));var z={supportsColor:q,stdout:q(process.stdout),stderr:q(process.stderr)};const V=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Y=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,U=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,W=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,D=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function Z(e){return"u"===e[0]&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):D.get(e)||e}function H(e,t){const r=[],n=t.trim().split(/\s*,\s*/g);let o;for(const t of n)if(isNaN(t)){if(!(o=t.match(U)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);r.push(o[2].replace(W,((e,t,r)=>t?Z(t):r)))}else r.push(Number(t));return r}function J(e){Y.lastIndex=0;const t=[];let r;for(;null!==(r=Y.exec(e));){const e=r[1];if(r[2]){const n=H(e,r[2]);t.push([e].concat(n))}else t.push([e])}return t}function K(e,t){const r={};for(const e of t)for(const t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let n=e;for(const e of Object.keys(r))if(Array.isArray(r[e])){if(!(e in n))throw new Error(`Unknown Chalk style: ${e}`);n=r[e].length>0?n[e].apply(n,r[e]):n[e]}return n}var Q=(e,t)=>{const r=[],n=[];let o=[];if(t.replace(V,((t,a,i,l,s,c)=>{if(a)o.push(Z(a));else if(l){const t=o.join("");o=[],n.push(0===r.length?t:K(e,r)(t)),r.push({inverse:i,styles:J(l)})}else if(s){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");n.push(K(e,r)(o.join(""))),o=[],r.pop()}else o.push(c)})),n.push(o.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};!function(e){const t=y,r=F,n=z.stdout,o=Q,a="win32"===process.platform&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),i=["ansi","ansi","ansi256","ansi16m"],l=new Set(["gray"]),s=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=void 0===t.level?r:t.level,e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};return c(t,e),t.template=function(){const e=[].slice.call(arguments);return g.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,u.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=u,t.template}c(this,e)}a&&(r.blue.open="");for(const e of Object.keys(r))r[e].closeRe=new RegExp(t(r[e].close),"g"),s[e]={get(){const t=r[e];return f.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}};s.visible={get(){return f.call(this,this._styles||[],!0,"visible")}},r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi))l.has(e)||(s[e]={get(){const t=this.level;return function(){const n={open:r.color[i[t]][e].apply(null,arguments),close:r.color.close,closeRe:r.color.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}});r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(l.has(e))continue;s["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const t=this.level;return function(){const n={open:r.bgColor[i[t]][e].apply(null,arguments),close:r.bgColor.close,closeRe:r.bgColor.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const h=Object.defineProperties((()=>{}),s);function f(e,t,r){const n=function(){return p.apply(n,arguments)};n._styles=e,n._empty=t;const o=this;return Object.defineProperty(n,"level",{enumerable:!0,get:()=>o.level,set(e){o.level=e}}),Object.defineProperty(n,"enabled",{enumerable:!0,get:()=>o.enabled,set(e){o.enabled=e}}),n.hasGrey=this.hasGrey||"gray"===r||"grey"===r,n.__proto__=h,n}function p(){const e=arguments,t=e.length;let n=String(arguments[0]);if(0===t)return"";if(t>1)for(let r=1;r<t;r++)n+=" "+e[r];if(!this.enabled||this.level<=0||!n)return this._empty?"":n;const o=r.dim.open;a&&this.hasGrey&&(r.dim.open="");for(const e of this._styles.slice().reverse())n=e.open+n.replace(e.closeRe,e.open)+e.close,n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`);return r.dim.open=o,n}function g(e,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");const r=[].slice.call(arguments,2),n=[t.raw[0]];for(let e=1;e<t.length;e++)n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&")),n.push(String(t.raw[e]));return o(e,n.join(""))}Object.defineProperties(u.prototype,s),e.exports=u(),e.exports.supportsColor=n,e.exports.default=e.exports}(d);var X=g(d.exports),ee=["if","for","while","catch","switch","case","const","let","var","function","mounted","unmounted","created","updated","beforeMount","beforeUpdate","beforeDestroy","destroyed","setup"],te=[".js",".jsx",".ts",".tsx",".vue",".svelte",".astro"],re={font:"tiny",align:"left",colors:["red"],background:"transparent",letterSpacing:1,lineHeight:1,space:!0,maxLength:"0",gradient:!1,independentGradient:!1,transitionGradient:!1,env:"node"},ne=function(){return l((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"filesPath","."),c(this,"deadMap",{}),c(this,"deadCodeFound",!1),c(this,"cliTable",new r({head:[X.red("📁 File"),X.red("🔢 Line"),X.red("🔍 Name")],colWidths:[100,10,30]})),this.filesPath=t}),[{key:"getAllFiles",value:function(r){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{return e.readdirSync(r).forEach((function(a){var i=t.join(r,a);e.statSync(i).isDirectory()?o=n.getAllFiles(i,o):te.some((function(e){return a.endsWith(e)}))&&o.push(i)})),o}catch(e){return[]}}},{key:"isBuiltInFunctionOrVariable",value:function(e){return ee.includes(e)}},{key:"getDeclaredFunctionsAndVariables",value:function(e){var t,r=this,n=/function\s+([a-zA-Z0-9_]+)/g,o=/const\s+([a-zA-Z0-9_]+)\s*=\s*\(/g,a=/([a-zA-Z0-9_]+)\s*\(([^)]*)\)\s*{/g,i=/(?:const|let|var)\s+([a-zA-Z0-9_]+)/g,l=/methods\s*:\s*{([^}]*)}/g,s=/return\s*{([^}]*)}/g,c=[],u=[],h=new Set,f=0;for(e.split("\n").forEach((function(e){f++,null!==(t=n.exec(e))||null!==(t=o.exec(e))||null!==(t=a.exec(e))?r.isBuiltInFunctionOrVariable(t[1])||c.push({name:t[1],line:f}):null!==(t=i.exec(e))&&(r.isBuiltInFunctionOrVariable(t[1])||u.push({name:t[1],line:f}))}));null!==(t=l.exec(e));){(t[1].match(/([a-zA-Z0-9_]+)\s*\(/g)||[]).forEach((function(e,t){e=e.trim().replace("(",""),r.isBuiltInFunctionOrVariable(e)||c.push({name:e,line:f+t})}))}for(;null!==(t=s.exec(e));){(t[1].split(",")||[]).forEach((function(e){e=e.trim().replace(":",""),h.add(e)}))}return{declaredFunctions:c,declaredVariables:u,setupReturnFunctions:h}}},{key:"removeComments",value:function(e){return e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"")}},{key:"run",value:(n=u().mark((function t(){var r,n,a,i,l,c=this;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=this.getAllFiles(this.filesPath),n=new Set,a=s(r),t.prev=3,l=u().mark((function t(){var r,o,a,l,s;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=i.value,o=e.readFileSync(r,"utf8"),a=c.getDeclaredFunctionsAndVariables(o),l=a.declaredFunctions,s=a.declaredVariables,a.setupReturnFunctions.forEach((function(e){return n.add(e)})),[].concat(h(s),h(l)).forEach((function(e){c.deadMap[e.name]||(c.deadMap[e.name]={count:0,declaredIn:[]}),c.deadMap[e.name].declaredIn.push({filePath:r,line:e.line})}));case 5:case"end":return t.stop()}}),t)})),a.s();case 6:if((i=a.n()).done){t.next=10;break}return t.delegateYield(l(),"t0",8);case 8:t.next=6;break;case 10:t.next=15;break;case 12:t.prev=12,t.t1=t.catch(3),a.e(t.t1);case 15:return t.prev=15,a.f(),t.finish(15);case 18:r.forEach((function(t){var r=e.readFileSync(t,"utf8"),n=c.removeComments(r);Object.keys(c.deadMap).forEach((function(e){var t=new RegExp("\\b".concat(e,"\\b"),"g"),r=n.match(t);r&&(c.deadMap[e].count+=r.length)}))})),Object.keys(this.deadMap).forEach((function(e){var t=c.deadMap[e],r=2===t.count&&n.has(e);(1===t.count||r)&&(c.deadCodeFound=!0,t.declaredIn.forEach((function(t){c.cliTable.push([t.filePath,t.line,e])})))})),o.say("Dead Code Checker",re),this.deadCodeFound?console.log(this.cliTable.toString()):console.log(X.greenBright("✅ No dead code found!"));case 22:case"end":return t.stop()}}),t,this,[[3,12,15,18]])})),a=function(){var e=this,t=arguments;return new Promise((function(r,o){var a=n.apply(e,t);function l(e){i(a,r,o,l,s,"next",e)}function s(e){i(a,r,o,l,s,"throw",e)}l(void 0)}))},function(){return a.apply(this,arguments)})}]);var n,a}();return ne}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("fs"),require("path"),require("cli-table3"),require("os"),require("cfonts")):"function"==typeof define&&define.amd?define(["fs","path","cli-table3","os","cfonts"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["dead-code-checker"]=t(e.fs,e.path,e.Table,e.require$$0,e.cfonts)}(this,(function(e,t,r,n,o){"use strict";function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t,r,n,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).then(n,o)}function l(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=p(e))||t){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}function c(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,i=Object.create(a.prototype),l=new L(n||[]);return o(i,"_invoke",{value:C(e,r,l)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",g="suspendedYield",d="executing",b="completed",y={};function v(){}function m(){}function w(){}var k={};c(k,i,(function(){return this}));var M=Object.getPrototypeOf,x=M&&M(M(A([])));x&&x!==r&&n.call(x,i)&&(k=x);var O=w.prototype=v.prototype=Object.create(k);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,i,l)}),(function(e){r("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function C(t,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===b){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var l=n.delegate;if(l){var s=_(l,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?b:g,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=b,n.method="throw",n.arg=c.arg)}}}function _(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=w,o(O,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},E(j.prototype),c(j.prototype,l,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new j(h(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},E(O),c(O,s,"Generator"),c(O,i,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=A,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function h(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function p(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={exports:{}},b=/[|\\{}()[\]^$+*?.]/g,y=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(b,"\\$&")},v={exports:{}},m={exports:{}},w={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]},k={};for(var M in w)w.hasOwnProperty(M)&&(k[w[M]]=M);var x=m.exports={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"]}};for(var O in x)if(x.hasOwnProperty(O)){if(!("channels"in x[O]))throw new Error("missing channels property: "+O);if(!("labels"in x[O]))throw new Error("missing channel labels property: "+O);if(x[O].labels.length!==x[O].channels)throw new Error("channel and label counts mismatch: "+O);var E=x[O].channels,j=x[O].labels;delete x[O].channels,delete x[O].labels,Object.defineProperty(x[O],"channels",{value:E}),Object.defineProperty(x[O],"labels",{value:j})}x.rgb.hsl=function(e){var t,r,n=e[0]/255,o=e[1]/255,a=e[2]/255,i=Math.min(n,o,a),l=Math.max(n,o,a),s=l-i;return l===i?t=0:n===l?t=(o-a)/s:o===l?t=2+(a-n)/s:a===l&&(t=4+(n-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),r=(i+l)/2,[t,100*(l===i?0:r<=.5?s/(l+i):s/(2-l-i)),100*r]},x.rgb.hsv=function(e){var t,r,n,o,a,i=e[0]/255,l=e[1]/255,s=e[2]/255,c=Math.max(i,l,s),u=c-Math.min(i,l,s),h=function(e){return(c-e)/6/u+.5};return 0===u?o=a=0:(a=u/c,t=h(i),r=h(l),n=h(s),i===c?o=n-r:l===c?o=1/3+t-n:s===c&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*c]},x.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[x.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,n))),100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},x.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-o)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},x.rgb.keyword=function(e){var t=k[e];if(t)return t;var r,n,o,a=1/0;for(var i in w)if(w.hasOwnProperty(i)){var l=w[i],s=(n=e,o=l,Math.pow(n[0]-o[0],2)+Math.pow(n[1]-o[1],2)+Math.pow(n[2]-o[2],2));s<a&&(a=s,r=i)}return r},x.keyword.rgb=function(e){return w[e]},x.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},x.rgb.lab=function(e){var t=x.rgb.xyz(e),r=t[0],n=t[1],o=t[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},x.hsl.rgb=function(e){var t,r,n,o,a,i=e[0]/360,l=e[1]/100,s=e[2]/100;if(0===l)return[a=255*s,a,a];t=2*s-(r=s<.5?s*(1+l):s+l-s*l),o=[0,0,0];for(var c=0;c<3;c++)(n=i+1/3*-(c-1))<0&&n++,n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,o[c]=255*a;return o},x.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,o=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=a<=1?a:2-a,[t,100*(0===n?2*o/(a+o):2*r/(n+r)),100*((n+r)/2)]},x.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,o=Math.floor(t)%6,a=t-Math.floor(t),i=255*n*(1-r),l=255*n*(1-r*a),s=255*n*(1-r*(1-a));switch(n*=255,o){case 0:return[n,s,i];case 1:return[l,n,i];case 2:return[i,n,s];case 3:return[i,l,n];case 4:return[s,i,n];case 5:return[n,i,l]}},x.hsv.hsl=function(e){var t,r,n,o=e[0],a=e[1]/100,i=e[2]/100,l=Math.max(i,.01);return n=(2-a)*i,r=a*l,[o,100*(r=(r/=(t=(2-a)*l)<=1?t:2-t)||0),100*(n/=2)]},x.hwb.rgb=function(e){var t,r,n,o,a,i,l,s=e[0]/360,c=e[1]/100,u=e[2]/100,h=c+u;switch(h>1&&(c/=h,u/=h),n=6*s-(t=Math.floor(6*s)),1&t&&(n=1-n),o=c+n*((r=1-u)-c),t){default:case 6:case 0:a=r,i=o,l=c;break;case 1:a=o,i=r,l=c;break;case 2:a=c,i=r,l=o;break;case 3:a=c,i=o,l=r;break;case 4:a=o,i=c,l=r;break;case 5:a=r,i=c,l=o}return[255*a,255*i,255*l]},x.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},x.xyz.rgb=function(e){var t,r,n,o=e[0]/100,a=e[1]/100,i=e[2]/100;return r=-.9689*o+1.8758*a+.0415*i,n=.0557*o+-.204*a+1.057*i,t=(t=3.2406*o+-1.5372*a+-.4986*i)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},x.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},x.lab.xyz=function(e){var t,r,n,o=e[0];t=e[1]/500+(r=(o+16)/116),n=r-e[2]/200;var a=Math.pow(r,3),i=Math.pow(t,3),l=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},x.lab.lch=function(e){var t,r=e[0],n=e[1],o=e[2];return(t=360*Math.atan2(o,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+o*o),t]},x.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},x.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],o=1 in arguments?arguments[1]:x.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===o&&(a+=60),a},x.hsv.ansi16=function(e){return x.rgb.ansi16(x.hsv.rgb(e),e[2])},x.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},x.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},x.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},x.rgb.hex=function(e){var 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},x.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},x.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,o=e[2]/255,a=Math.max(Math.max(r,n),o),i=Math.min(Math.min(r,n),o),l=a-i;return t=l<=0?0:a===r?(n-o)/l%6:a===n?2+(o-r)/l:4+(r-n)/l+4,t/=6,[360*(t%=1),100*l,100*(l<1?i/(1-l):0)]},x.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,o=0;return(n=r<.5?2*t*r:2*t*(1-r))<1&&(o=(r-.5*n)/(1-n)),[e[0],100*n,100*o]},x.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var o,a=[0,0,0],i=t%1*6,l=i%1,s=1-l;switch(Math.floor(i)){case 0:a[0]=1,a[1]=l,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=l;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=l,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return o=(1-r)*n,[255*(r*a[0]+o),255*(r*a[1]+o),255*(r*a[2]+o)]},x.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},x.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},x.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},x.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,o=0;return n<1&&(o=(r-n)/(1-n)),[e[0],100*n,100*o]},x.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},x.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},x.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},x.gray.hsl=x.gray.hsv=function(e){return[0,0,e[0]]},x.gray.hwb=function(e){return[0,100,e[0]]},x.gray.cmyk=function(e){return[0,0,0,e[0]]},x.gray.lab=function(e){return[e[0],0,0]},x.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},x.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var C=m.exports,_=C;function R(e){var t=function(){for(var e={},t=Object.keys(_),r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var n=r.pop(),o=Object.keys(_[n]),a=o.length,i=0;i<a;i++){var l=o[i],s=t[l];-1===s.distance&&(s.distance=t[n].distance+1,s.parent=n,r.unshift(l))}return t}function P(e,t){return function(r){return t(e(r))}}function L(e,t){for(var r=[t[e].parent,e],n=_[t[e].parent][e],o=t[e].parent;t[o].parent;)r.unshift(t[o].parent),n=P(_[t[o].parent][o],n),o=t[o].parent;return n.conversion=r,n}var A=C,S=function(e){for(var t=R(e),r={},n=Object.keys(t),o=n.length,a=0;a<o;a++){var i=n[a];null!==t[i].parent&&(r[i]=L(i,t))}return r},T={};Object.keys(A).forEach((function(e){T[e]={},Object.defineProperty(T[e],"channels",{value:A[e].channels}),Object.defineProperty(T[e],"labels",{value:A[e].labels});var t=S(e);Object.keys(t).forEach((function(r){var n=t[r];T[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,o=0;o<n;o++)r[o]=Math.round(r[o]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),T[e][r].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))}));var I=T;!function(e){const t=I,r=(e,r)=>function(){return`[${e.apply(t,arguments)+r}m`},n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`},o=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};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],gray:[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.grey=a.color.gray;for(const t of Object.keys(a)){const r=a[t];for(const t of Object.keys(r)){const n=r[t];a[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=a[t],e.set(n[0],n[1])}Object.defineProperty(a,t,{value:r,enumerable:!1}),Object.defineProperty(a,"codes",{value:e,enumerable:!1})}const i=e=>e,l=(e,t,r)=>[e,t,r];a.color.close="",a.bgColor.close="",a.color.ansi={ansi:r(i,0)},a.color.ansi256={ansi256:n(i,0)},a.color.ansi16m={rgb:o(l,0)},a.bgColor.ansi={ansi:r(i,10)},a.bgColor.ansi256={ansi256:n(i,10)},a.bgColor.ansi16m={rgb:o(l,10)};for(let e of Object.keys(t)){if("object"!=typeof t[e])continue;const i=t[e];"ansi16"===e&&(e="ansi"),"ansi16"in i&&(a.color.ansi[e]=r(i.ansi16,0),a.bgColor.ansi[e]=r(i.ansi16,10)),"ansi256"in i&&(a.color.ansi256[e]=n(i.ansi256,0),a.bgColor.ansi256[e]=n(i.ansi256,10)),"rgb"in i&&(a.color.ansi16m[e]=o(i.rgb,0),a.bgColor.ansi16m[e]=o(i.rgb,10))}return a}})}(v);var F=v.exports;const B=n,$=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)},N=process.env;let G;function q(e){const t=function(e){if(!1===G)return 0;if($("color=16m")||$("color=full")||$("color=truecolor"))return 3;if($("color=256"))return 2;if(e&&!e.isTTY&&!0!==G)return 0;const t=G?1:0;if("win32"===process.platform){const e=B.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in N)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in N))||"codeship"===N.CI_NAME?1:t;if("TEAMCITY_VERSION"in N)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(N.TEAMCITY_VERSION)?1:0;if("truecolor"===N.COLORTERM)return 3;if("TERM_PROGRAM"in N){const e=parseInt((N.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(N.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(N.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(N.TERM)||"COLORTERM"in N?1:(N.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}$("no-color")||$("no-colors")||$("color=false")?G=!1:($("color")||$("colors")||$("color=true")||$("color=always"))&&(G=!0),"FORCE_COLOR"in N&&(G=0===N.FORCE_COLOR.length||0!==parseInt(N.FORCE_COLOR,10));var z={supportsColor:q,stdout:q(process.stdout),stderr:q(process.stderr)};const V=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Y=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,U=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,W=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,D=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function Z(e){return"u"===e[0]&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):D.get(e)||e}function H(e,t){const r=[],n=t.trim().split(/\s*,\s*/g);let o;for(const t of n)if(isNaN(t)){if(!(o=t.match(U)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);r.push(o[2].replace(W,((e,t,r)=>t?Z(t):r)))}else r.push(Number(t));return r}function J(e){Y.lastIndex=0;const t=[];let r;for(;null!==(r=Y.exec(e));){const e=r[1];if(r[2]){const n=H(e,r[2]);t.push([e].concat(n))}else t.push([e])}return t}function K(e,t){const r={};for(const e of t)for(const t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let n=e;for(const e of Object.keys(r))if(Array.isArray(r[e])){if(!(e in n))throw new Error(`Unknown Chalk style: ${e}`);n=r[e].length>0?n[e].apply(n,r[e]):n[e]}return n}var Q=(e,t)=>{const r=[],n=[];let o=[];if(t.replace(V,((t,a,i,l,s,c)=>{if(a)o.push(Z(a));else if(l){const t=o.join("");o=[],n.push(0===r.length?t:K(e,r)(t)),r.push({inverse:i,styles:J(l)})}else if(s){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");n.push(K(e,r)(o.join(""))),o=[],r.pop()}else o.push(c)})),n.push(o.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return n.join("")};!function(e){const t=y,r=F,n=z.stdout,o=Q,a="win32"===process.platform&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),i=["ansi","ansi","ansi256","ansi16m"],l=new Set(["gray"]),s=Object.create(null);function c(e,t){t=t||{};const r=n?n.level:0;e.level=void 0===t.level?r:t.level,e.enabled="enabled"in t?t.enabled:e.level>0}function u(e){if(!this||!(this instanceof u)||this.template){const t={};return c(t,e),t.template=function(){const e=[].slice.call(arguments);return g.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,u.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=u,t.template}c(this,e)}a&&(r.blue.open="");for(const e of Object.keys(r))r[e].closeRe=new RegExp(t(r[e].close),"g"),s[e]={get(){const t=r[e];return f.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}};s.visible={get(){return f.call(this,this._styles||[],!0,"visible")}},r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi))l.has(e)||(s[e]={get(){const t=this.level;return function(){const n={open:r.color[i[t]][e].apply(null,arguments),close:r.color.close,closeRe:r.color.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}});r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(l.has(e))continue;s["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const t=this.level;return function(){const n={open:r.bgColor[i[t]][e].apply(null,arguments),close:r.bgColor.close,closeRe:r.bgColor.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const h=Object.defineProperties((()=>{}),s);function f(e,t,r){const n=function(){return p.apply(n,arguments)};n._styles=e,n._empty=t;const o=this;return Object.defineProperty(n,"level",{enumerable:!0,get:()=>o.level,set(e){o.level=e}}),Object.defineProperty(n,"enabled",{enumerable:!0,get:()=>o.enabled,set(e){o.enabled=e}}),n.hasGrey=this.hasGrey||"gray"===r||"grey"===r,n.__proto__=h,n}function p(){const e=arguments,t=e.length;let n=String(arguments[0]);if(0===t)return"";if(t>1)for(let r=1;r<t;r++)n+=" "+e[r];if(!this.enabled||this.level<=0||!n)return this._empty?"":n;const o=r.dim.open;a&&this.hasGrey&&(r.dim.open="");for(const e of this._styles.slice().reverse())n=e.open+n.replace(e.closeRe,e.open)+e.close,n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`);return r.dim.open=o,n}function g(e,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");const r=[].slice.call(arguments,2),n=[t.raw[0]];for(let e=1;e<t.length;e++)n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&")),n.push(String(t.raw[e]));return o(e,n.join(""))}Object.defineProperties(u.prototype,s),e.exports=u(),e.exports.supportsColor=n,e.exports.default=e.exports}(d);var X=g(d.exports),ee=["if","for","while","catch","switch","case","json","const","let","var","function","mounted","unmounted","created","updated","beforeMount","beforeUpdate","beforeDestroy","destroyed","setup","constructor"],te=[".js",".jsx",".ts",".tsx",".vue",".svelte",".astro"],re=["node_modules",".git","dist","build"],ne={font:"tiny",align:"left",colors:["red"],background:"transparent",letterSpacing:1,lineHeight:1,space:!0,maxLength:"0",gradient:!1,independentGradient:!1,transitionGradient:!1,env:"node"},oe=function(){return l((function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"filesPath","."),c(this,"deadMap",{}),c(this,"deadCodeFound",!1),c(this,"cliTable",new r({head:[X.red("📁 File"),X.red("🔢 Line"),X.red("🔍 Name")],colWidths:[100,10,30]})),this.filesPath=t}),[{key:"getAllFiles",value:function(r){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{return e.readdirSync(r).forEach((function(a){var i=t.join(r,a);e.statSync(i).isDirectory()?re.includes(a)||(o=n.getAllFiles(i,o)):te.some((function(e){return a.endsWith(e)}))&&o.push(i)})),o}catch(e){return[]}}},{key:"isBuiltInFunctionOrVariable",value:function(e){return ee.includes(e)}},{key:"getDeclaredFunctionsAndVariables",value:function(e){var t,r=this,n=/\bfunction\s+([a-zA-Z0-9_]+)\s*\(/g,o=/\bconst\s+([a-zA-Z0-9_]+)\s*=\s*\(/g,a=/([a-zA-Z0-9_]+)\s*\(([^)]*)\)\s*{/g,i=/\bmethods\s*:\s*{([^}]*)}/g,l=/\breturn\s*{([^}]*)}/g,s=/\b(?:const|let|var)\s+([a-zA-Z0-9_]+)\s*=?/g,c=[],u=[],h=new Set,f=0;for(e.split("\n").forEach((function(e){f++,null!==(t=n.exec(e))||null!==(t=o.exec(e))||null!==(t=a.exec(e))?r.isBuiltInFunctionOrVariable(t[1])||c.push({name:t[1],line:f}):null!==(t=s.exec(e))&&(r.isBuiltInFunctionOrVariable(t[1])||u.push({name:t[1],line:f}))}));null!==(t=i.exec(e));){(t[1].match(/([a-zA-Z0-9_]+)\s*\(/g)||[]).forEach((function(e,t){e=e.trim().replace("(",""),r.isBuiltInFunctionOrVariable(e)||c.push({name:e,line:f+t})}))}for(;null!==(t=l.exec(e));){(t[1].split(",")||[]).forEach((function(e){e=e.trim().replace(":",""),h.add(e)}))}return{declaredFunctions:c,declaredVariables:u,setupReturnFunctions:h}}},{key:"removeComments",value:function(e){return e.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"")}},{key:"run",value:(n=u().mark((function t(){var r,n,a,i,l,c=this;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=this.getAllFiles(this.filesPath),n=new Set,a=s(r),t.prev=3,l=u().mark((function t(){var r,o,a,l,s;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=i.value,o=e.readFileSync(r,"utf8"),a=c.getDeclaredFunctionsAndVariables(o),l=a.declaredFunctions,s=a.declaredVariables,a.setupReturnFunctions.forEach((function(e){return n.add(e)})),[].concat(h(s),h(l)).forEach((function(e){c.deadMap[e.name]||(c.deadMap[e.name]={count:0,declaredIn:[]}),c.deadMap[e.name].declaredIn.push({filePath:r,line:e.line})}));case 5:case"end":return t.stop()}}),t)})),a.s();case 6:if((i=a.n()).done){t.next=10;break}return t.delegateYield(l(),"t0",8);case 8:t.next=6;break;case 10:t.next=15;break;case 12:t.prev=12,t.t1=t.catch(3),a.e(t.t1);case 15:return t.prev=15,a.f(),t.finish(15);case 18:r.forEach((function(t){var r=e.readFileSync(t,"utf8"),n=c.removeComments(r);Object.keys(c.deadMap).forEach((function(e){var t=new RegExp("\\b".concat(e,"\\b"),"g"),r=n.match(t);r&&(c.deadMap[e].count+=r.length)}))})),Object.keys(this.deadMap).forEach((function(e){var t=c.deadMap[e],r=2===t.count&&n.has(e);(1===t.count||r)&&(c.deadCodeFound=!0,t.declaredIn.forEach((function(t){c.cliTable.push([t.filePath,t.line,e])})))})),o.say("Dead Code Checker",ne),this.deadCodeFound?console.log(this.cliTable.toString()):console.log(X.greenBright("✅ No dead code found!"));case 22:case"end":return t.stop()}}),t,this,[[3,12,15,18]])})),a=function(){var e=this,t=arguments;return new Promise((function(r,o){var a=n.apply(e,t);function l(e){i(a,r,o,l,s,"next",e)}function s(e){i(a,r,o,l,s,"throw",e)}l(void 0)}))},function(){return a.apply(this,arguments)})}]);var n,a}();return oe}));
{
"name": "dead-code-checker",
"version": "0.0.4",
"version": "0.0.5",
"description": "Dead code checker",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc