UNPKG

uninspected

Version:

util.inspect replacement based on Unexpected's output and type system

2 lines 327 kB
-n <!DOCTYPE html><html><body><a href="javascript: !function(t,e){&quot;object&quot;==typeof exports&amp;&amp;&quot;undefined&quot;!=typeof module?module.exports=e(require(&quot;os&quot;)):&quot;function&quot;==typeof define&amp;&amp;define.amd?define([&quot;os&quot;],e):(t=&quot;undefined&quot;!=typeof globalThis?globalThis:t||self).uninspected=e(t.os)}(this,(function(t){&quot;use strict&quot;;function e(t){return t&amp;&amp;&quot;object&quot;==typeof t&amp;&amp;&quot;default&quot;in t?t:{default:t}}var n=e(t),r=function(t){this.text=t},i=function(t,e,n,i,o){void 0===o&amp;&amp;(o={});var s=&quot;expected&quot;,a=t.clone();e&amp;&amp;e.call(a,a);var u=t.clone();if(&quot;function&quot;==typeof i)i.call(u,u);else if(i.length>0){var c=!1;i.forEach((function(t,e){var n=t&amp;&amp;&quot;object&quot;==typeof t&amp;&amp;t instanceof r;e>0&amp;&amp;(n||c||u.text(&quot;,&quot;),u.sp()),n?u.error(t.text):t.call(u,u),c=n}))}var l=a.size(),f=u.size(),p=s.length+l.width+f.width+n.length,h=Math.max(l.height,f.height);if(&quot;omitSubject&quot;in t&amp;&amp;t.omitSubject===o.subject){var d=/^(not )?to (.*)/.exec(n);d?(t.error(&quot;should &quot;),d[1]&amp;&amp;t.error(&quot;not &quot;),n=d[2]):n=&quot;expected: &quot;+n}else o.compact&amp;&amp;o.compactSubject&amp;&amp;(l.height>1||l.width>(o.compactWidth||35))?(t.error(&quot;expected&quot;).sp(),o.compactSubject.call(t,t),t.sp()):(t.error(s),l.height>1?t.nl():t.sp(),t.append(a),l.height>1||1===h&amp;&amp;p>t.preferredWidth?t.nl():t.sp());return t.error(n),f.height>1?t.nl():f.width>0&amp;&amp;t.sp(),t.append(u),t},o=&quot;undefined&quot;!=typeof global?global:&quot;undefined&quot;!=typeof self?self:&quot;undefined&quot;!=typeof window?window:{};function s(){throw new Error(&quot;setTimeout has not been defined&quot;)}function a(){throw new Error(&quot;clearTimeout has not been defined&quot;)}var u=s,c=a;function l(t){if(u===setTimeout)return setTimeout(t,0);if((u===s||!u)&amp;&amp;setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}&quot;function&quot;==typeof o.setTimeout&amp;&amp;(u=setTimeout),&quot;function&quot;==typeof o.clearTimeout&amp;&amp;(c=clearTimeout);var f,p=[],h=!1,d=-1;function g(){h&amp;&amp;f&amp;&amp;(h=!1,f.length?p=f.concat(p):d=-1,p.length&amp;&amp;y())}function y(){if(!h){var t=l(g);h=!0;for(var e=p.length;e;){for(f=p,p=[];++d<e;)f&amp;&amp;f[d].run();d=-1,e=p.length}f=null,h=!1,function(t){if(c===clearTimeout)return clearTimeout(t);if((c===a||!c)&amp;&amp;clearTimeout)return c=clearTimeout,clearTimeout(t);try{c(t)}catch(e){try{return c.call(null,t)}catch(e){return c.call(this,t)}}}(t)}}function v(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new m(t,e)),1!==p.length||h||l(y)}function m(t,e){this.fun=t,this.array=e}m.prototype.run=function(){this.fun.apply(null,this.array)};function b(){}var _=b,w=b,x=b,E=b,A=b,F=b,k=b;var j=o.performance||{},C=j.now||j.mozNow||j.msNow||j.oNow||j.webkitNow||function(){return(new Date).getTime()};var S=new Date;var T={nextTick:v,title:&quot;browser&quot;,browser:!0,env:{},argv:[],version:&quot;&quot;,versions:{},on:_,addListener:w,once:x,off:E,removeListener:A,removeAllListeners:F,emit:k,binding:function(t){throw new Error(&quot;process.binding is not supported&quot;)},cwd:function(){return&quot;/&quot;},chdir:function(t){throw new Error(&quot;process.chdir is not supported&quot;)},umask:function(){return 0},hrtime:function(t){var e=.001*C.call(j),n=Math.floor(e),r=Math.floor(e%1*1e9);return t&amp;&amp;(n-=t[0],(r-=t[1])<0&amp;&amp;(n--,r+=1e9)),[n,r]},platform:&quot;browser&quot;,release:{},config:{},uptime:function(){return(new Date-S)/1e3}},O=&quot;undefined&quot;!=typeof globalThis?globalThis:&quot;undefined&quot;!=typeof window?window:&quot;undefined&quot;!=typeof global?global:&quot;undefined&quot;!=typeof self?self:{};function P(t,e){return t(e={exports:{}},e.exports),e.exports}var D={intersects:function(t,e){return t.start<e.end&amp;&amp;e.start<t.end||t.start===e.start},intersectsWithSome:function(t,e){return t.some((function(t){return D.intersects(e,t)}))}},R=function(t,e){var n=e.start-t.start;return 0!==n?n:t.end-t.start-(e.end-e.start)},M=D.intersectsWithSome,B=P((function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array,n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r=t.exports={objectIs:Object.is||function(t,e){return 0===t&amp;&amp;0===e?1/t==1/e:t!=t?e!=e:t===e},checkObjectEqualityUsingType:function(t,e,n,r){if(t===e)return!0;if(e.constructor!==t.constructor)return!1;var i=n.getKeys(t).filter((function(e){return void 0!==n.valueForKey(t,e)})),o=n.getKeys(e).filter((function(t){return void 0!==n.valueForKey(e,t)}));if(i.length!==o.length)return!1;i.sort(n.keyComparator),o.sort(n.keyComparator);for(var s=0;s<i.length;s+=1)if(i[s]!==o[s])return!1;for(var a=0;a<i.length;a+=1){var u=i[a];if(!r(n.valueForKey(t,u),n.valueForKey(e,u)))return!1}return!0},duplicateArrayLikeUsingType:function(t,e){var n=e.getKeys(t),i=n.length;if(!e.numericalPropertiesOnly){for(var o=0,s=n.length-1;s>-1;s-=1){var a=n[s];if(&quot;symbol&quot;!=typeof a&amp;&amp;r.numericalRegExp.test(a))break;o+=1}i-=o}var u=new Array(i);return n.forEach((function(n,r){r>=i&amp;&amp;!e.hasKey(t,n)||(u[n]=e.hasKey(t,n)?e.valueForKey(t,n):void 0)})),u},isArray:Array.isArray||function(t){return&quot;[object Array]&quot;===Object.prototype.toString.call(t)},isPromise:function(t){return t&amp;&amp;&quot;function&quot;==typeof t.then},isRegExp:function(t){return&quot;[object RegExp]&quot;===Object.prototype.toString.call(t)},isError:function(t){return&quot;object&quot;==typeof t&amp;&amp;(&quot;[object Error]&quot;===Object.prototype.toString.call(t)||t instanceof Error)},extend:function(t){for(var e=arguments,n=function(n){var r=e[n];r&amp;&amp;Object.keys(r).forEach((function(e){t[e]=r[e]}))},r=1;r<arguments.length;r+=1)n(r);return t},findFirst:function(t,e){for(var n=0;n<t.length;n+=1)if(e(t[n]))return t[n];return null},leftPad:function(t,e,n){for(void 0===n&amp;&amp;(n=&quot; &quot;);t.length<e;)t=n+t;return t},escapeRegExpMetaChars:function(t){return t.replace(/[[\]{}()*+?.\\^$|]/g,&quot;\\$&amp;&quot;)},escapeChar:function(t){if(&quot;\t&quot;===t)return&quot;\\t&quot;;if(&quot;\r&quot;===t)return&quot;\\r&quot;;var e=t.charCodeAt(0),n=e.toString(16).toUpperCase();return e<256?&quot;\\x&quot;+r.leftPad(n,2,&quot;0&quot;):&quot;\\u&quot;+r.leftPad(n,4,&quot;0&quot;)},getFunctionName:function(t){if(&quot;string&quot;==typeof t.name)return t.name;var e=Function.prototype.toString.call(t).match(/function ([^(]+)/);return e?e[1]:t===Object?&quot;Object&quot;:t===Function?&quot;Function&quot;:&quot;&quot;},wrapConstructorNameAroundOutput:function(t,e){var n=e.constructor,i=n&amp;&amp;n!==Object&amp;&amp;r.getFunctionName(n);return i&amp;&amp;&quot;Object&quot;!==i?t.clone().text(i+&quot;(&quot;).append(t).text(&quot;)&quot;):t},setPrototypeOfOrExtend:e?n:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&amp;&amp;(t[n]=e[n]);return t},uniqueStringsAndSymbols:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];&quot;function&quot;==typeof e[0]&amp;&amp;(t=e[0]);var r={},i=[];function o(e){Array.isArray(e)?e.forEach(o):Object.prototype.hasOwnProperty.call(r,e)||t&amp;&amp;!t(e)||(r[e]=!0,i.push(e))}for(var s=t?1:0;s<e.length;s+=1)o(e[s]);return i},uniqueNonNumericalStringsAndSymbols:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return r.uniqueStringsAndSymbols((function(t){return&quot;symbol&quot;==typeof t||!r.numericalRegExp.test(t)}),Array.prototype.slice.call(t))},forwardFlags:function(t,e){return t.replace(/\[(!?)([^\]]+)\] ?/g,(function(t,n,r){return Boolean(e[r])!==Boolean(n)?r+&quot; &quot;:&quot;&quot;})).trim()},numericalRegExp:/^(?:0|[1-9][0-9]*)$/,packArrows:function(t){var e={};t.forEach((function(t,n){&quot;moveSource&quot;===t.type?(t.changeIndex=n,(e[t.actualIndex]=e[t.actualIndex]||{}).source=t):&quot;moveTarget&quot;===t.type&amp;&amp;(t.changeIndex=n,(e[t.actualIndex]=e[t.actualIndex]||{}).target=t)}));var n=Object.keys(e);if(n.length>0){var r=[];n.sort((function(t,n){return Math.abs(e[n].source.changeIndex-e[n].target.changeIndex)-Math.abs(e[t].source.changeIndex-e[t].target.changeIndex)})).forEach((function(t,n,i){var o=e[t],s=Math.min(o.source.changeIndex,o.target.changeIndex),a=Math.max(o.source.changeIndex,o.target.changeIndex);r.push({start:s,end:a,direction:o.source.changeIndex<o.target.changeIndex?&quot;down&quot;:&quot;up&quot;})}));for(var i=function(t,e){if(e=e||{},!Array.isArray(t))throw new Error(&quot;The interval packer requires an array of objects with start and end properties.&quot;);if(0===t.length)return[];var n;t.forEach((function(t){if(&quot;object&quot;!=typeof t||&quot;number&quot;!=typeof t.start||&quot;number&quot;!=typeof t.end||t.end<=t.start)throw new Error(&quot;Intervals must be objects with integer properties start and end where start < end.&quot;)})),t=[].concat(t).sort(R);for(var r=[],i=-1/0;t.length>0;){var o=t.pop();i<=o.start&amp;&amp;(n=[[]],r.push(n));for(var s=0;s<n.length&amp;&amp;M(n[s],o);)s+=1;(n[s]=n[s]||[]).push(o),i=Math.max(i,o.end)}return e.groupPartitions?r:r.reduce((function(t,e){return e.forEach((function(e,n){return t[n]=t[n]||[],Array.prototype.push.apply(t[n],e),t})),t}),[])}(r);i.length>3;)i.shift().forEach((function(e){var n=e.direction,r=e.start,i=e.end;t[&quot;up&quot;===n?r:i].type=&quot;insert&quot;,t[&quot;up&quot;===n?i:r].type=&quot;remove&quot;}));return i}},truncateSubjectStringForBegin:function(t,e){var n=e.length+25;if(t.length<=n)return null;var r=t.indexOf(&quot; &quot;,e.length+1);return r>-1&amp;&amp;r<n?t.substring(0,r):t.substring(0,n)},truncateSubjectStringForEnd:function(t,e){var n=t.length-e.length-25;if(n<=0)return null;var r=t.lastIndexOf(&quot; &quot;,e.length+1);return r>-1&amp;&amp;r>=n?t.substring(r+1,t.length):t.substring(n,t.length)},getEnv:function(t){if(&quot;object&quot;==typeof Deno)try{return Deno.env()[t]}catch(t){}else if(&quot;object&quot;==typeof T&amp;&amp;T.env)return T.env[t]}}}));B.objectIs,B.checkObjectEqualityUsingType,B.duplicateArrayLikeUsingType,B.isArray,B.isPromise,B.isRegExp,B.isError,B.extend,B.findFirst,B.leftPad,B.escapeRegExpMetaChars,B.escapeChar,B.getFunctionName,B.wrapConstructorNameAroundOutput,B.setPrototypeOfOrExtend,B.uniqueStringsAndSymbols,B.uniqueNonNumericalStringsAndSymbols,B.forwardFlags,B.numericalRegExp,B.packArrows,B.truncateSubjectStringForBegin,B.truncateSubjectStringForEnd,B.getEnv;for(var I={extend:function(t){for(var e=1;e<arguments.length;e+=1){var n=arguments[e];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},calculateOutputEntrySize:function(t){if(t.size)return t.size;var e;switch(t.style){case&quot;text&quot;:e={width:String(t.args.content).length,height:1};break;case&quot;block&quot;:e=I.calculateSize(t.args);break;case&quot;raw&quot;:var n=t.args;e={width:n.width,height:n.height};break;default:e={width:0,height:0}}return t.size=e,e},calculateLineSize:function(t){var e={height:1,width:0};return t.forEach((function(t){var n=I.calculateOutputEntrySize(t);e.width+=n.width,e.height=Math.max(n.height,e.height)})),e},calculateSize:function(t){var e={height:0,width:0};return t.forEach((function(t){var n=I.calculateLineSize(t);e.height+=n.height,e.width=Math.max(e.width,n.width)})),e},arrayEquals:function(t,e){if(t===e)return!0;if(!t||t.length!==e.length)return!1;for(var n=0;n<t.length;n+=1)if(t[n]!==e[n])return!1;return!0},escapeRegExp:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,&quot;\\$1&quot;)},findFirst:function(t,e,n){for(var r=n||null,i=0;i<t.length;i+=1)if(e.call(r,t[i],i,t))return t[i];return null},getFunctionName:function(t){if(&quot;string&quot;==typeof t.name)return t.name;var e=Function.prototype.toString.call(t).match(/function ([^\(]+)/);return e?e[1]:t===Object?&quot;Object&quot;:t===Function?&quot;Function&quot;:void 0}},L=I,N=256,z=[&quot;&quot;],U=1;U<=N;U+=1)z[U]=z[U-1]+&quot; &quot;;var q=function(t,e){if(e<0)return&quot;&quot;;var n=&quot;&quot;;if(&quot; &quot;===t){if(e<=N)return z[e];for(var r=z[256],i=Math.floor(e/N),o=0;o<i;o+=1)n+=r;n+=z[e%N]}else for(var s=0;s<e;s+=1)n+=t;return n},$=/^(?:bg)?#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,H={bold:&quot;font-weight: bold&quot;,dim:&quot;opacity: 0.7&quot;,italic:&quot;font-style: italic&quot;,underline:&quot;text-decoration: underline&quot;,inverse:&quot;-webkit-filter: invert(%100); filter: invert(100%)&quot;,hidden:&quot;visibility: hidden&quot;,strikeThrough:&quot;text-decoration: line-through&quot;,black:&quot;color: black&quot;,red:&quot;color: red&quot;,green:&quot;color: green&quot;,yellow:&quot;color: yellow&quot;,blue:&quot;color: blue&quot;,magenta:&quot;color: magenta&quot;,cyan:&quot;color: cyan&quot;,white:&quot;color: white&quot;,gray:&quot;color: gray&quot;,bgBlack:&quot;background-color: black&quot;,bgRed:&quot;background-color: red&quot;,bgGreen:&quot;background-color: green&quot;,bgYellow:&quot;background-color: yellow&quot;,bgBlue:&quot;background-color: blue&quot;,bgMagenta:&quot;background-color: magenta&quot;,bgCyan:&quot;background-color: cyan&quot;,bgWhite:&quot;background-color: white&quot;};Object.keys(H).forEach((function(t){H[t.toLowerCase()]=H[t]}));var K,W=H,Y=!(void 0===T||!T.versions||!T.versions.node),V=function(){if(&quot;undefined&quot;!=typeof Deno){var t={};try{t=Deno.env()}catch(t){}return{argv:Deno.args,color:Deno.noColor?0:1,env:t,runtime:&quot;deno&quot;}}if(Y){var e;try{e=n.default}catch(t){return{argv:[],env:{},runtime:&quot;browser&quot;}}return{argv:T.argv,env:T.env,runtime:&quot;node&quot;,getNodeRelease:e.release}}return{argv:[],env:{},runtime:&quot;browser&quot;}}(),J=function(t,e){e=e||V.argv;var n=0===t.indexOf(&quot;-&quot;)?&quot;&quot;:1===t.length?&quot;-&quot;:&quot;--&quot;,r=e.indexOf(n+t),i=e.indexOf(&quot;--&quot;);return-1!==r&amp;&amp;(-1===i||r<i)},Q=V.env;function G(t){var e=function(t){if(0===K)return 0;if(J(&quot;color=16m&quot;)||J(&quot;color=full&quot;)||J(&quot;color=truecolor&quot;))return 3;if(J(&quot;color=256&quot;))return 2;if(t&amp;&amp;!t.isTTY&amp;&amp;void 0===K)return 0;var e=K||0;if(&quot;dumb&quot;===Q.TERM)return e;if(&quot;node&quot;===V.runtime&amp;&amp;&quot;win32&quot;===T.platform){var n=V.getNodeRelease().split(&quot;.&quot;);return Number(T.versions.node.split(&quot;.&quot;)[0])>=8&amp;&amp;Number(n[0])>=10&amp;&amp;Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if(&quot;CI&quot;in Q)return[&quot;TRAVIS&quot;,&quot;CIRCLECI&quot;,&quot;APPVEYOR&quot;,&quot;GITLAB_CI&quot;].some((function(t){return t in Q}))||&quot;codeship&quot;===Q.CI_NAME?1:e;if(&quot;TEAMCITY_VERSION&quot;in Q)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Q.TEAMCITY_VERSION)?1:0;if(&quot;truecolor&quot;===Q.COLORTERM)return 3;if(&quot;TERM_PROGRAM&quot;in Q){var r=parseInt((Q.TERM_PROGRAM_VERSION||&quot;&quot;).split(&quot;.&quot;)[0],10);switch(Q.TERM_PROGRAM){case&quot;iTerm.app&quot;:return r>=3?3:2;case&quot;Apple_Terminal&quot;:return 2}}return/-256(color)?$/i.test(Q.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Q.TERM)||&quot;COLORTERM&quot;in Q?1:e}(t);return function(t){return 0!==t&amp;&amp;{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(e)}J(&quot;no-color&quot;)||J(&quot;no-colors&quot;)||J(&quot;color=false&quot;)||J(&quot;color=never&quot;)?K=0:J(&quot;color&quot;)||J(&quot;colors&quot;)||J(&quot;color=true&quot;)||J(&quot;color=always&quot;)?K=1:&quot;deno&quot;===V.runtime&amp;&amp;(K=V.color),&quot;FORCE_COLOR&quot;in Q&amp;&amp;(K=&quot;true&quot;===Q.FORCE_COLOR?1:&quot;false&quot;===Q.FORCE_COLOR?0:0===Q.FORCE_COLOR.length?1:Math.min(parseInt(Q.FORCE_COLOR,10),3));var Z=void 0===T?0:G(T.stdout);void 0===T||G(T.stderr);function X(t){if(0===t.length)return[[]];if(!function(t){return t.some((function(t){return&quot;block&quot;===t.style||&quot;text&quot;===t.style&amp;&amp;-1!==String(t.args.content).indexOf(&quot;\n&quot;)}))}(t))return[t];var e=[],n=[],r=0;return t.forEach((function(t,i){var o=function(t){switch(t.style){case&quot;text&quot;:return String(t.args.content).split(&quot;\n&quot;).map((function(e){return&quot;&quot;===e?[]:[{style:&quot;text&quot;,args:{content:e,styles:t.args.styles},themes:t.themes}]}));case&quot;block&quot;:return tt(t.args);default:return[]}}(t),s=o.map((function(t){return L.calculateLineSize(t).width})),a=Math.max.apply(null,s);o.forEach((function(i,o){var a,u,c=e[o];if(c||(e[o]=c=[],n[o]=0),i.length){var l=r-n[o];c.push((a=l,u=t.themes,{style:&quot;text&quot;,args:{content:q(&quot; &quot;,a),styles:[]},themes:u})),Array.prototype.push.apply(c,i),n[o]=r+s[o]}})),r+=a}),this),e}function tt(t){var e=[];return t.forEach((function(t){X(t).forEach((function(t){e.push(t)}))})),e}var et=tt;function nt(){}nt.prototype.format=&quot;text&quot;,nt.prototype.serialize=function(t){return(t=et(t)).map(this.serializeLine,this).join(&quot;\n&quot;)},nt.prototype.serializeLine=function(t){return t.map((function(t){return this[t.style]?String(this[t.style](t.args,t.themes)):&quot;&quot;}),this).join(&quot;&quot;)},nt.prototype.text=function(t){return String(t.content)},nt.prototype.block=function(t){return this.serialize(t)},nt.prototype.raw=function(t){return String(t.content(this))};var rt=nt,it=function(t,e){if(1===e.length){for(var n=0,r=[],i=e[0],o=t.styles||{};&quot;string&quot;==typeof i&amp;&amp;o[i];)if(i=o[i],(n+=1)>100){var s=r.indexOf(i);if(r.push(i),-1!==s)throw new Error(&quot;Your theme contains a loop: &quot;+r.slice(s).join(&quot; -> &quot;))}return Array.isArray(i)?i:[i]}return e};function ot(){}ot.prototype.format=&quot;html&quot;,ot.prototype.serialize=function(t){return'<div style=&quot;font-family: monospace; white-space: nowrap&quot;>'+this.serializeLines(t)+&quot;</div>&quot;},ot.prototype.serializeLines=function(t){return t.map((function(t){return&quot;<div>&quot;+(this.serializeLine(t).join(&quot;&quot;)||&quot;&amp;nbsp;&quot;)+&quot;</div>&quot;}),this).join(&quot;&quot;)},ot.prototype.serializeLine=function(t){return t.map((function(t){return this[t.style]?this[t.style](t.args,t.themes):&quot;&quot;}),this)},ot.prototype.block=function(t){return'<div style=&quot;display: inline-block; vertical-align: top&quot;>'+this.serializeLines(t)+&quot;</div>&quot;},ot.prototype.text=function(t,e){var n=String(t.content);if(&quot;&quot;===n)return&quot;&quot;;n=n.replace(/&amp;/g,&quot;&amp;amp;&quot;).replace(/ /g,&quot;&amp;nbsp;&quot;).replace(/</g,&quot;&amp;lt;&quot;).replace(/>/g,&quot;&amp;gt;&quot;).replace(/&quot;/g,&quot;&amp;quot;&quot;);var r=it(e.html||{},t.styles);if(r.length>0){for(var i=[],o=0;o<r.length;o+=1){var s=r[o];$.test(s)?&quot;bg&quot;===s.substring(0,2)?i.push(&quot;background-color: &quot;+s.substring(2)):i.push(&quot;color: &quot;+s):W[s]&amp;&amp;i.push(W[s])}i.length>0&amp;&amp;(n='<span style=&quot;'+i.join(&quot;; &quot;)+'&quot;>'+n+&quot;</span>&quot;)}return n},ot.prototype.raw=function(t){return String(t.content(this))};var st=ot,at=function(t,e){var n=t.L,r=t.a,i=t.b,o=e.L,s=e.a,a=e.b,u=ut(ct(r,2)+ct(i,2)),c=ut(ct(s,2)+ct(a,2)),l=(u+c)/2,f=.5*(1-ut(ct(l,7)/(ct(l,7)+ct(25,7)))),p=(1+f)*r,h=(1+f)*s,d=ut(ct(p,2)+ct(i,2)),g=ut(ct(h,2)+ct(a,2)),y=function(t,e){if(0==t&amp;&amp;0==e)return 0;var n=ft(t,e)*(180/gt);return n>=0?n:n+360},v=y(i,p),m=y(a,h),b=o-n,_=g-d,w=function(t,e,n,r){if(t*e==0)return 0;if(ht(r-n)<=180)return r-n;if(r-n>180)return r-n-360;if(r-n<-180)return r-n+360;throw new Error}(u,c,v,m),x=2*ut(d*g)*pt(yt(w)/2),E=(n+o)/2,A=(d+g)/2,F=function(t,e,n,r){if(t*e==0)return n+r;if(ht(n-r)<=180)return(n+r)/2;if(ht(n-r)>180&amp;&amp;n+r<360)return(n+r+360)/2;if(ht(n-r)>180&amp;&amp;n+r>=360)return(n+r-360)/2;throw new Error}(u,c,v,m),k=1-.17*lt(yt(F-30))+.24*lt(yt(2*F))+.32*lt(yt(3*F+6))-.2*lt(yt(4*F-63)),j=30*dt(-ct((F-275)/25,2)),C=ut(ct(A,7)/(ct(A,7)+ct(25,7))),S=1+.015*ct(E-50,2)/ut(20+ct(E-50,2)),T=1+.045*A,O=1+.015*A*k,P=-2*C*pt(yt(2*j));return ut(ct(b/(1*S),2)+ct(_/(1*T),2)+ct(x/(1*O),2)+P*(_/(1*T))*(x/(1*O)))},ut=Math.sqrt,ct=Math.pow,lt=Math.cos,ft=Math.atan2,pt=Math.sin,ht=Math.abs,dt=Math.exp,gt=Math.PI;/** * @author Markus Ekholm * @copyright 2012-2015 (c) Markus Ekholm <markus at botten dot org > * @license Copyright (c) 2012-2015, Markus Ekholm * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the <organization> nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL MARKUS EKHOLM BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */function yt(t){return t*(gt/180)}var vt={ciede2000:at},mt=function(t){return function(t){var e=100,n=108.883,r=95.047,i=t.Y/e,o=t.Z/n,s=t.X/r;s=s>.008856?bt(s,1/3):7.787*s+16/116;i=i>.008856?bt(i,1/3):7.787*i+16/116;o=o>.008856?bt(o,1/3):7.787*o+16/116;return{L:116*i-16,a:500*(s-i),b:200*(i-o)}}(function(t){var e=t.R/255,n=t.G/255,r=t.B/255;e>.04045?e=bt((e+.055)/1.055,2.4):e/=12.92;n>.04045?n=bt((n+.055)/1.055,2.4):n/=12.92;r>.04045?r=bt((r+.055)/1.055,2.4):r/=12.92;return{X:.4124*(e*=100)+.3576*(n*=100)+.1805*(r*=100),Y:.2126*e+.7152*n+.0722*r,Z:.0193*e+.1192*n+.9505*r}}(t))},bt=Math.pow;/** * @author Markus Ekholm * @copyright 2012-2015 (c) Markus Ekholm <markus at botten dot org > * @license Copyright (c) 2012-2015, Markus Ekholm * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the <organization> nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL MARKUS EKHOLM BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */var _t={rgb_to_lab:mt},wt=function(t,e,n){var r={};n=n||&quot;closest&quot;;for(var i=0;i<t.length;i+=1){for(var o=t[i],s=void 0,a=void 0,u=0;u<e.length;u+=1){var c=e[u],l=Et(o,c);null==s||&quot;closest&quot;===n&amp;&amp;l<a?(s=c,a=l):&quot;furthest&quot;===n&amp;&amp;l>a&amp;&amp;(s=c,a=l)}r[xt(o)]=s}return r};/** * @author Markus Ekholm * @copyright 2012-2015 (c) Markus Ekholm <markus at botten dot org > * @license Copyright (c) 2012-2015, Markus Ekholm * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the <organization> nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL MARKUS EKHOLM BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */function xt(t){return&quot;R&quot;+t.R+&quot;B&quot;+t.B+&quot;G&quot;+t.G}function Et(t,e){return t=_t.rgb_to_lab(t),e=_t.rgb_to_lab(e),vt.ciede2000(t,e)}var At={map_palette:wt,palette_map_key:xt},Ft=P((function(t){var e=t.exports={};e.diff=vt.ciede2000,e.rgb_to_lab=_t.rgb_to_lab,e.map_palette=At.map_palette,e.palette_map_key=At.palette_map_key,e.closest=function(t,n){var r=e.palette_map_key(t);return e.map_palette([t],n,&quot;closest&quot;)[r]},e.furthest=function(t,n){var r=e.palette_map_key(t);return e.map_palette([t],n,&quot;furthest&quot;)[r]}})),kt=P((function(t){var e=t.exports={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{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]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};e.colors.grey=e.colors.gray,Object.keys(e).forEach((function(t){var n=e[t];Object.keys(n).forEach((function(t){var r=n[t];e[t]=n[t]={open:&quot;[&quot;+r[0]+&quot;m&quot;,close:&quot;[&quot;+r[1]+&quot;m&quot;}})),Object.defineProperty(e,t,{value:n,enumerable:!1})}))}));kt.modifiers,kt.colors,kt.bgColors;var jt=0,Ct=L.extend({},kt);function St(){}Object.keys(Ct).forEach((function(t){Ct[t.toLowerCase()]=Ct[t]})),St.prototype=new rt,St.prototype.format=&quot;ansi&quot;;var Tt={16:{&quot;#000000&quot;:&quot;black&quot;,&quot;#ff0000&quot;:&quot;red&quot;,&quot;#00ff00&quot;:&quot;green&quot;,&quot;#ffff00&quot;:&quot;yellow&quot;,&quot;#0000ff&quot;:&quot;blue&quot;,&quot;#ff00ff&quot;:&quot;magenta&quot;,&quot;#00ffff&quot;:&quot;cyan&quot;,&quot;#ffffff&quot;:&quot;white&quot;,&quot;#808080&quot;:&quot;gray&quot;},256:{}},Ot={};function Pt(t){t.length<6&amp;&amp;(t=t.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,&quot;$1$1$2$2$3$3&quot;));var e=t.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/i);if(e)return{R:parseInt(e[1],16),G:parseInt(e[2],16),B:parseInt(e[3],16)}}function Dt(t){var e=(65536*Math.round(t.R)+256*Math.round(t.G)+Math.round(t.B)).toString(16);return&quot;#&quot;+&quot;00000&quot;.substr(0,6-e.length)+e}Ot[16]=Object.keys(Tt[16]).map(Pt),Ot.bg16=Object.keys(Tt[16]).filter((function(t){return&quot;#808080&quot;!==t})).map(Pt),Ot[256]=[].concat(Ot[16]);var Rt=16;function Mt(t){Ot[256].push(t),Tt[256][Dt(t)]=Rt,Rt+=1}for(var Bt=0;Bt<6;Bt+=1)for(var It=0;It<6;It+=1)for(var Lt=0;Lt<6;Lt+=1)Mt({R:Math.round(256*Bt/6),G:Math.round(256*It/6),B:Math.round(256*Lt/6)});[8,18,28,38,48,58,68,78,88,96,102,118,128,138,148,158,168,178,188,198,208,218,228,238].forEach((function(t){Mt({R:t,G:t,B:t})})),St.prototype.text=function(t,e){var n=String(t.content);if(&quot;&quot;===n)return&quot;&quot;;var r,i=it(e.ansi||{},t.styles);if(i.length>0)for(var o=i.length-1;o>=0;o-=1){var s=i[o];if(Ct[s])n=Ct[s].open+n+Ct[s].close;else if($.test(s)){var a=s,u=&quot;bg&quot;===s.substring(0,2),c=u?s.substring(2):s,l=Dt(Ft.closest(Pt(c),Ot[u?&quot;bg16&quot;:16])),f=Tt[16][l],p=Dt(Ft.closest(Pt(c),Ot[256])),h=Tt[256][p];s=u?&quot;bg&quot;+((r=f).substring(0,1).toUpperCase()+r.substring(1)):f;var d=Ct[s].open,g=Ct[s].close;l!==p&amp;&amp;(d+=&quot;[&quot;+(u?48:38)+&quot;;5;&quot;+h+&quot;m&quot;),jt<1024&amp;&amp;(Ct[a]={open:d,close:g},jt+=1),n=d+n+g}}return n};var Nt=St;function zt(){}zt.prototype.format=&quot;coloredConsole&quot;,zt.prototype.serialize=function(t){var e=&quot;&quot;,n=[];return this.serializeLines(et(t)).forEach((function(t){t&amp;&amp;(e+=t[0],t.length>1&amp;&amp;n.push(t[1]))})),[e].concat(n)},zt.prototype.serializeLines=function(t){var e=[];return t.forEach((function(t,n){n>0&amp;&amp;e.push([&quot;%c\n &quot;,&quot;&quot;]),Array.prototype.push.apply(e,this.serializeLine(t))}),this),e},zt.prototype.serializeLine=function(t){var e=[];return t.forEach((function(t){this[t.style]&amp;&amp;e.push(this[t.style](t.args,t.themes))}),this),e},zt.prototype.block=function(t){return this.serializeLines(t)},zt.prototype.text=function(t,e){var n=String(t.content);if(&quot;&quot;===n)return&quot;&quot;;var r=it(e.coloredConsole||{},t.styles),i=[&quot;%c&quot;+n.replace(/%/g,&quot;%%&quot;)],o=[];if(r.length>0)for(var s=0;s<r.length;s+=1){var a=r[s];$.test(a)?&quot;bg&quot;===a.substring(0,2)?o.push(&quot;background-color: &quot;+a.substring(2)):o.push(&quot;color: &quot;+a):W[a]&amp;&amp;o.push(W[a])}return i.push(o.join(&quot;; &quot;)),i},zt.prototype.raw=function(t){return String(t.content(this))};var Ut=zt,qt=P((function(t,e){var n=L.extend,r=[&quot;bold&quot;,&quot;dim&quot;,&quot;italic&quot;,&quot;underline&quot;,&quot;inverse&quot;,&quot;hidden&quot;,&quot;strikeThrough&quot;,&quot;black&quot;,&quot;red&quot;,&quot;green&quot;,&quot;yellow&quot;,&quot;blue&quot;,&quot;magenta&quot;,&quot;cyan&quot;,&quot;white&quot;,&quot;gray&quot;,&quot;bgBlack&quot;,&quot;bgRed&quot;,&quot;bgGreen&quot;,&quot;bgYellow&quot;,&quot;bgBlue&quot;,&quot;bgMagenta&quot;,&quot;bgCyan&quot;,&quot;bgWhite&quot;];function i(t){if(!(this instanceof i))return new i(t);&quot;string&quot;==typeof(t=t||{})&amp;&amp;(t={format:t});var e=&quot;indentationWidth&quot;in t?t.indentationWidth:2;this.indentationWidth=Math.max(e,0),this.indentationLevel=0,this.output=[[]],this.styles=Object.create(null),this.installedPlugins=[],this._themes={},Object.keys(i.serializers).forEach((function(t){this._themes[t]={styles:{}}}),this),this.preferredWidth=80,t.format&amp;&amp;(this.format=t.format)}function o(t,e){return!(!t||!e||&quot;text&quot;!==t.style||&quot;text&quot;!==e.style)&amp;&amp;(L.arrayEquals(t.args.styles,e.args.styles)&amp;&amp;t.themes===e.themes)}function s(t){if(0===t.length)return t;for(var e=[t[0]],n=1;n<t.length;n+=1){var r=e[e.length-1],i=t[n];&quot;text&quot;===i.style&amp;&amp;&quot;&quot;===i.args.content||(o(r,i)?e[e.length-1]={style:r.style,args:{content:r.args.content+i.args.content,styles:r.args.styles},themes:r.themes}:e.push(i))}return e}function a(t){return t&amp;&amp;&quot;object&quot;==typeof t&amp;&amp;&quot;number&quot;==typeof t.width&amp;&amp;&quot;number&quot;==typeof t.height&amp;&amp;(&quot;function&quot;==typeof t.content||&quot;string&quot;==typeof t.content)}function u(t,e){var n=t[t.length-1].slice(),r=t.slice(0,-1),i=n[n.length-1];return i&amp;&amp;&quot;block&quot;===i.style?(n[n.length-1]={style:&quot;block&quot;,args:u(i.args,e),themes:e._themes},r[t.length-1]=n):(Array.prototype.push.apply(n,e.output[0]),r[t.length-1]=s(n),r.push.apply(r,e.output.slice(1))),r}function c(t,e,n,r){var i=t;return e.forEach((function(e,o){o>0&amp;&amp;i.nl(),e.forEach((function(e,o){if(&quot;block&quot;===e.style)return i.output[i.output.length-1].push({style:&quot;block&quot;,args:c(t.clone(),e.args,n,r),themes:e.themes});if(&quot;text&quot;!==e.style)return i.output[i.output.length-1].push(e);var s;n.global&amp;&amp;(n.lastIndex=0);for(var a=!0,u=0,l=e.args.content,f=e.args.styles;null!==(s=n.exec(l))&amp;&amp;(n.global||a);)u<s.index&amp;&amp;i.text.apply(i,[l.substring(u,s.index)].concat(f)),r.apply(i,[f].concat(s)),a=!1,u=s.index+s[0].length;0===u?(0===i.output.length?i.output[0]=[]:i.output[i.output.length-1]).push(e):u<l.length&amp;&amp;i.text.apply(i,[l.substring(u,l.length)].concat(f))}),this)}),this),i.output.map(s)}&quot;string&quot;!=typeof e.nodeName&amp;&amp;Z?i.defaultFormat=&quot;ansi&quot;:&quot;undefined&quot;!=typeof window&amp;&amp;void 0!==window.navigator?window._phantom||window.mochaPhantomJS||window.__karma__&amp;&amp;window.__karma__.config.captureConsole?i.defaultFormat=&quot;ansi&quot;:i.defaultFormat=&quot;html&quot;:i.defaultFormat=&quot;text&quot;,i.prototype.newline=i.prototype.nl=function(t){if(void 0===t&amp;&amp;(t=1),0===t)return this;for(var e=0;e<t;e+=1)this.output.push([]);return this},i.serializers={},[rt,st,Nt,Ut].forEach((function(t){i.serializers[t.prototype.format]=t})),i.prototype.write=function(t){if(this.styles[t.style])return this.styles[t.style].apply(this,t.args),this;var e=this.output[this.output.length-1],n=e[e.length-1];return o(n,t)?e[e.length-1]={style:n.style,args:{content:n.args.content+t.args.content,styles:n.args.styles},themes:this._themes}:e.push(t),this},i.prototype.indentLines=function(){return this.indentationLevel+=1,this},i.prototype.indent=i.prototype.i=function(){for(var t=0;t<this.indentationLevel;t+=1)this.space(this.indentationWidth);return this},i.prototype.outdentLines=function(){return this.indentationLevel=Math.max(0,this.indentationLevel-1),this},i.prototype.addStyle=function(t,e,n){if(!1===this[t]||(this.hasOwnProperty(t)||i.prototype[t])&amp;&amp;!Object.prototype.hasOwnProperty.call(this.styles,t)&amp;&amp;-1===r.indexOf(t))throw new Error('&quot;'+t+'&quot; style cannot be defined, it clashes with a built-in attribute');if((this.hasOwnProperty(t)||-1!==r.indexOf(t))&amp;&amp;(&quot;function&quot;===typeof this[t]&amp;&amp;!n))throw new Error('&quot;'+t+'&quot; style is already defined, set 3rd arg (allowRedefinition) to true to define it anyway');return this._stylesHaveNotBeenClonedYet&amp;&amp;(this.styles=Object.create(this.styles),this._stylesHaveNotBeenClonedYet=!1),this.styles[t]=e,this[t]=function(){return e.apply(this,arguments),this},this},i.prototype.toString=function(t){if(t&amp;&amp;this.format&amp;&amp;t!==this.format)throw new Error(&quot;A pen with format: &quot;+this.format+&quot; cannot be serialized to: &quot;+t);return&quot;auto&quot;===(t=this.format||t||&quot;text&quot;)&amp;&amp;(t=i.defaultFormat),this._themes[t],(new i.serializers[t]).serialize(this.output)},i.prototype.text=function(){var t=arguments[0];if(&quot;&quot;===t)return this;for(var e=new Array(arguments.length-1),n=1;n<arguments.length;n+=1)e[n-1]=arguments[n];if(-1!==(t=String(t)).indexOf(&quot;\n&quot;)){var r=t.split(/\n/);return r.forEach((function(t,n){t.length&amp;&amp;this.write({style:&quot;text&quot;,args:{content:t,styles:e},themes:this._themes}),n<r.length-1&amp;&amp;this.nl()}),this),this}return this.write({style:&quot;text&quot;,args:{content:t,styles:e},themes:this._themes})},i.prototype.removeFormatting=function(){var t=this.clone();return this.output.forEach((function(e,n){t.output[n]=s(e.map((function(t){return&quot;text&quot;===t.style?{style:&quot;text&quot;,args:{content:t.args.content,styles:[]},themes:t.themes}:t})))})),t.indentationLevel=this.indentationLevel,t},i.prototype.getContentFromArguments=function(t){var e;if(t[0].isMagicPen)return this.ensureCompatibleFormat(t[0].format),t[0];if(&quot;function&quot;==typeof t[0])return e=this.clone(),t[0].call(e,e),e;if(&quot;string&quot;==typeof t[0]&amp;&amp;1===t.length)return(e=this.clone()).text(t[0]),e;if(&quot;string&quot;==typeof t[0])return(e=this.clone())[t[0]].apply(e,Array.prototype.slice.call(t,1)),e;throw new Error(&quot;Requires the arguments to be:\na pen or\na callback appending content to a pen or\na style and arguments for that style or\njust a string.&quot;)},i.prototype.isMultiline=function(){return this.output.length>1||this.size().height>1},i.prototype.isAtStartOfLine=function(){return 0===this.output.length||0===this.output[this.output.length-1].length},i.prototype.isBlock=function(){return 1===this.output.length&amp;&amp;1===this.output[0].length&amp;&amp;&quot;block&quot;===this.output[0][0].style},i.prototype.ensureCompatibleFormat=function(t){if(t&amp;&amp;this.format&amp;&amp;t!==this.format)throw new Error(&quot;This pen is only compatible with the format: &quot;+this.format)},i.prototype.block=function(){var t=this.getContentFromArguments(arguments),e=t.output.map((function(t){return[].concat(t)}));return this.write({style:&quot;block&quot;,args:e,themes:this._themes})},i.prototype.alt=function(t){var e=this.format;if(!e)throw new Error(&quot;The alt method is only supported on a pen where the format has already been set&quot;);var n=t[e];return void 0===n?t.fallback?this.append(t.fallback):this:&quot;string&quot;==typeof n||a(n)?this.raw(n):this.append(n)},i.prototype.raw=function(t){if(!this.format)throw new Error(&quot;The raw method is only supported on a pen where the format has already been set&quot;);if(&quot;string&quot;==typeof t)return this.write({style:&quot;raw&quot;,args:{height:0,width:0,content:function(){return t}},themes:this._themes});if(a(t)){if(&quot;string&quot;==typeof t.content){var e=(t=n({},t)).content;t.content=function(){return e}}return this.write({style:&quot;raw&quot;,args:t,themes:this._themes})}throw new Error(&quot;Raw &quot;+this.format+&quot; content needs to adhere to one of the following forms:\na string of raw content\na function returning a string of raw content or\nan object with the following form { width: <number>, height: <number>, content: <string function() {}|string> }&quot;)},i.prototype.amend=function(){var t=this.getContentFromArguments(arguments);return t.isEmpty()||(this.output=u(this.output,t)),this},i.prototype.append=function(){var t=this.getContentFromArguments(arguments);if(t.isEmpty())return this;var e=this.output[this.output.length-1];return Array.prototype.push.apply(e,t.output[0]),this.output[this.output.length-1]=s(e),this.output.push.apply(this.output,t.output.slice(1)),this},i.prototype.prependLinesWith=function(){var t=this.getContentFromArguments(arguments);if(t.isEmpty())return this;if(t.output.length>1)throw new Error(&quot;PrependLinesWith only supports a pen with single line content&quot;);var e=this.size().height,n=this.clone();return n.block((function(){for(var n=0;n<e;n+=1)n>0&amp;&amp;this.nl(),this.append(t)})),n.block(this),this.output=n.output,this},i.prototype.space=i.prototype.sp=function(t){return 0===t?this:(void 0===t&amp;&amp;(t=1),this.text(q(&quot; &quot;,t)))},r.forEach((function(t){i.prototype[t]=i.prototype[t.toLowerCase()]=function(e){return this.text(e,t)}})),i.prototype.clone=function(t){function e(){}this.isEmpty()||this.ensureCompatibleFormat(t),e.prototype=this;var n=new e;return n.styles=this.styles,n._stylesHaveNotBeenClonedYet=!0,n.indentationLevel=0,n.output=[[]],n.installedPlugins=[],n._themes=this._themes,n._themesHaveNotBeenClonedYet=!0,n.format=t||this.format,n.parent=this,n},i.prototype.isMagicPen=!0,i.prototype.size=function(){return L.calculateSize(this.output)},i.prototype.use=function(t){var e=L.findFirst(this.installedPlugins,(function(e){if(e===t)return!0;if(&quot;function&quot;==typeof t&amp;&amp;&quot;function&quot;==typeof e){var n=L.getFunctionName(t);return&quot;&quot;!==n&amp;&amp;n===L.getFunctionName(e)}return e.name===t.name}));if(e){if(e===t||void 0!==t.version&amp;&amp;t.version===e.version)return this;throw new Error(&quot;Another instance of the plugin '&quot;+t.name+&quot;' is already installed&quot;+(void 0!==e.version?&quot; (version &quot;+e.version+(void 0!==t.version?&quot;, trying to install &quot;+t.version:&quot;&quot;)+&quot;)&quot;:&quot;&quot;)+&quot;. Please check your node_modules folder for unmet peerDependencies.&quot;)}if(&quot;function&quot;!=typeof t&amp;&amp;(&quot;object&quot;!=typeof t||&quot;function&quot;!=typeof t.installInto)||void 0!==t.name&amp;&amp;&quot;string&quot;!=typeof t.name||void 0!==t.dependencies&amp;&amp;!Array.isArray(t.dependencies))throw new Error(&quot;Plugins must be functions or adhere to the following interface\n{\n name: <an optional plugin name>,\n version: <an optional semver version string>,\n dependencies: <an optional list of dependencies>,\n installInto: <a function that will update the given magicpen instance>\n}&quot;);if(t.dependencies){var n=this,r=[];do{r.push(n),n=n.parent}while(n);var i=t.dependencies.filter((function(t){return!r.some((function(e){return e.installedPlugins.some((function(e){return e.name===t}))}))}));if(1===i.length)throw new Error(t.name+&quot; requires plugin &quot;+i[0]);if(i.length>1)throw new Error(t.name+&quot; requires plugins &quot;+i.slice(0,-1).join(&quot;, &quot;)+&quot; and &quot;+i[i.length-1])}return this.installedPlugins.push(t),&quot;function&quot;==typeof t?t(this):t.installInto(this),this},i.prototype.installPlugin=i.prototype.use,i.prototype.isEmpty=function(){return 1===this.output.length&amp;&amp;0===this.output[0].length},i.prototype.replaceText=function(t,e){if(this.isEmpty())return this;if(&quot;string&quot;==typeof t&amp;&amp;(t=new RegExp(L.escapeRegExp(t),&quot;g&quot;)),&quot;string&quot;==typeof e){var n=e;e=function(t,e){var r=[n].concat(t);this.text.apply(this,r)}}return 1===arguments.length&amp;&amp;(e=t,t=/.*/),this.output=c(this.clone(),this.output,t,e),this},i.prototype.theme=function(t){if(!(t=t||this.format))throw new Error(&quot;Could not detect which format you want to retrieve theme information for. Set the format of the pen or provide it as an argument to the theme method.&quot;);return this._themes[t]},i.prototype.installTheme=function(t,e){var r=this;if(1===arguments.length&amp;&amp;(e=t,t=Object.keys(i.serializers)),&quot;string&quot;==typeof t&amp;&amp;(t=[t]),&quot;object&quot;!=typeof e||!Array.isArray(t)||t.some((function(t){return&quot;string&quot;!=typeof t})))throw new Error(&quot;Themes must be installed the following way:\nInstall theme for all formats: pen.installTheme({ comment: 'gray' })\nInstall theme for a specific format: pen.installTheme('ansi', { comment: 'gray' }) or\nInstall theme for a list of formats: pen.installTheme(['ansi', 'html'], { comment: 'gray' })&quot;);if(e.styles&amp;&amp;&quot;object&quot;==typeof e.styles||(e={styles:e}),r._themesHaveNotBeenClonedYet){var o={};Object.keys(r._themes).forEach((function(t){o[t]=Object.create(r._themes[t])})),r._themes=o,r._themesHaveNotBeenClonedYet=!1}return Object.keys(e.styles).forEach((function(t){if($.test(t)||W[t])throw new Error(&quot;Invalid theme key: '&quot;+t+&quot;' you can't map build styles.&quot;);r[t]||r.addStyle(t,(function(e){this.text(e,t)}))})),t.forEach((function(t){var i=r._themes[t]||{styles:{}},o=n({},i,e);o.styles=n({},i.styles,e.styles),r._themes[t]=o})),this},t.exports=i}));var $t=function(t,e,n){if(t===e)return 0;if(n=&quot;number&quot;==typeof n?n:1/0,t.length>e.length){var r=t;t=e,e=r}for(var i=t.length,o=e.length;i>0&amp;&amp;t.charCodeAt(~-i)===e.charCodeAt(~-o);)i--,o--;if(0===i)return o<n?o:n;for(var s=0;s<i&amp;&amp;t.charCodeAt(s)===e.charCodeAt(s);)s++;if(o-=s,0===(i-=s))return o<n?o:n;var a=o-i;if((n=o<n?o:n)<a)return n;for(var u=2+((i<n?i:n)>>1),c=a+2*u+2,l=new Array(c),f=new Array(c),p=0;p<c;p++)l[p]=-1,f[p]=-1;for(var h=new Array(i),d=new Array(o),g=(p=0,s);p<i;p++,g++)h[p]=t.charCodeAt(g),d[p]=e.charCodeAt(g);for(;p<o;)d[p++]=e.charCodeAt(g++);p=0;var y=a+u,v=y<<1;do{var m,b;r=l;l=f,f=r;var _,w,x=-1;++p<=u?(m=1-p,_=p-2):_=l[u+(m=p-(u<<1)+1)],p<=y?(w=p,f[u+p]=-1):w=v-p;for(var E=m,A=m+u;E<w;E++,A++){for(b=x,g=(g=(g=(x=_)+1)<b?b:g)<(_=l[A+1])+1?_+1:g;g<i&amp;&amp;g+E<o&amp;&amp;h[g]===d[g+E];)g++;f[A]=g}}while(f[y]<i&amp;&amp;p<=n);return p-1},Ht=P((function(t){var e=function(){return void 0===this}();if(e)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:e,propertyIsWritable:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!(n&amp;&amp;!n.writable&amp;&amp;!n.set)}};else{var n={}.hasOwnProperty,r={}.toString,i={}.constructor.prototype,o=function(t){var e=[];for(var r in t)n.call(t,r)&amp;&amp;e.push(r);return e};t.exports={isArray:function(t){try{return&quot;[object Array]&quot;===r.call(t)}catch(t){return!1}},keys:o,names:o,defineProperty:function(t,e,n){return t[e]=n.value,t},getDescriptor:function(t,e){return{value:t[e]}},freeze:function(t){return t},getPrototypeOf:function(t){try{return Object(t).constructor.prototype}catch(t){return i}},isES5:e,propertyIsWritable:function(){return!0}}}}));Ht.freeze,Ht.defineProperty,Ht.getDescriptor,Ht.keys,Ht.names,Ht.getPrototypeOf,Ht.isArray,Ht.isES5,Ht.propertyIsWritable;var Kt,Wt=&quot;undefined&quot;==typeof navigator,Yt=function(){try{var t={};return Ht.defineProperty(t,&quot;f&quot;,{get:function(){return 3}}),3===t.f}catch(t){return!1}}(),Vt={e:{}};function Jt(){try{var t=Kt;return Kt=null,t.apply(this,arguments)}catch(t){return Vt.e=t,Vt}}function Qt(t){return null==t||!0===t||!1===t||&quot;string&quot;==typeof t||&quot;number&quot;==typeof t}function Gt(t,e,n){if(Qt(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return Ht.defineProperty(t,e,r),t}var Zt=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(Ht.isES5){var n=Object.getOwnPropertyNames;return function(t){for(var r=[],i=Object.create(null);null!=t&amp;&amp;!e(t);){var o;try{o=n(t)}catch(t){return r}for(var s=0;s<o.length;++s){var a=o[s];if(!i[a]){i[a]=!0;var u=Object.getOwnPropertyDescriptor(t,a);null!=u&amp;&amp;null==u.get&amp;&amp;null==u.set&amp;&amp;r.push(a)}}t=Ht.getPrototypeOf(t)}return r}}var r={}.hasOwnProperty;return function(n){if(e(n))return[];var i=[];t:for(var o in n)if(r.call(n,o))i.push(o);else{for(var s=0;s<t.length;++s)if(r.call(t[s],o))continue t;i.push(o)}return i}}(),Xt=/this\s*\.\s*\S+\s*=/;var te=/^[a-z$_][a-z$_0-9]*$/i;function ee(t){try{return t+&quot;&quot;}catch(t){return&quot;[no string representation]&quot;}}function ne(t){return t instanceof Error&amp;&amp;Ht.propertyIsWritable(t,&quot;stack&quot;)}var re=&quot;stack&quot;in new Error?function(t){return ne(t)?t:new Error(ee(t))}:function(t){if(ne(t))return t;try{throw new Error(ee(t))}catch(t){return t}};function ie(t){return{}.toString.call(t)}var oe={isClass:function(t){try{if(&quot;function&quot;==typeof t){var e=Ht.names(t.prototype),n=Ht.isES5&amp;&amp;e.length>1,r=e.length>0&amp;&amp;!(1===e.length&amp;&amp;&quot;constructor&quot;===e[0]),i=Xt.test(t+&quot;&quot;)&amp;&amp;Ht.names(t).length>0;if(n||r||i)return!0}return!1}catch(t){return!1}},isIdentifier:function(t){return te.test(t)},inheritedDataKeys:Zt,getDataPropertyOrDefault:function(t,e,n){if(!Ht.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&amp;&amp;null==r.set?r.value:n:void 0},thrower:function(t){throw t},isArray:Ht.isArray,haveGetters:Yt,notEnumerableProp:Gt,isPrimitive:Qt,isObject:function(t){return!Qt(t)},canEvaluate:Wt,errorObj:Vt,tryCatch:function(t){return Kt=t,Jt},inherits:function(t,e){var n={}.hasOwnProperty;function r(){for(var r in this.constructor=t,this.constructor$=e,e.prototype)n.call(e.prototype,r)&amp;&amp;&quot;$&quot;!==r.charAt(r.length-1)&amp;&amp;(this[r+&quot;$&quot;]=e.prototype[r])}return r.prototype=e.prototype,t.prototype=new r,t.prototype},withAppended:function(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;n<r;++n)i[n]=t[n];return i[n]=e,i},maybeWrapAsError:function(t){return Qt(t)?new Error(ee(t)):t},toFastProperties:function(t){return t},filledRange:function(t,e,n){for(var r=new Array(t),i=0;i<t;++i)r[i]=e+i+n;return r},toString:ee,canAttachTrace:ne,ensureErrorObject:re,originatesFromRejection:function(t){return null!=t&amp;&amp;(t instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===t.isOperational)},markAsOriginatingFromRejection:function(t){try{Gt(t,&quot;isOperational&quot;,!0)}catch(t){}},classString:ie,copyDescriptors:function(t,e,n){for(var r=Ht.names(t),i=0;i<r.length;++i){var o=r[i];if(n(o))try{Ht.defineProperty(e,o,Ht.getDescriptor(t,o))}catch(t){}}},hasDevTools:&quot;undefined&quot;!=typeof chrome&amp;&amp;chrome&amp;&amp;&quot;function&quot;==typeof chrome.loadTimes,isNode:void 0!==T&amp;&amp;&quot;[object process]&quot;===ie(T).toLowerCase()};oe.isRecentNode=oe.isNode&amp;&amp;function(){var t=T.versions.node.split(&quot;.&quot;).map(