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

tartan

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tartan - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

10

dist/tartan.js

@@ -501,3 +501,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

module.exports = {"version":"5.0.0"}
module.exports = {"version":"5.0.1"}

@@ -1144,3 +1144,3 @@ /***/ },

while (true) {
var chunk = source.substr(offset, chunkSize);
var chunk = source.substr(offset + result.length, chunkSize);
var matches = pattern.exec(chunk);

@@ -2128,2 +2128,8 @@ if (!matches) {

result.flush = function() {
result.cancel();
repaint();
return this;
};
result.cancel = function() {

@@ -2130,0 +2136,0 @@ if (callbackId) {

2

dist/tartan.min.js

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

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("_")):"function"==typeof define&&define.amd?define(["_"],r):"object"==typeof exports?exports.tartan=r(require("_")):e.tartan=r(e._)}(this,function(e){return function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var t={};return r.m=e,r.c=t,r.p="",r(0)}([function(e,r,t){"use strict";var n=t(1);n.extend(e.exports,t(2)),e.exports.defaults=t(3),e.exports.parse=t(11),e.exports.filter=t(25),e.exports.transform=t(28),e.exports.syntax=t(31),e.exports.render=t(33),e.exports.schema=t(35),e.exports.utils=t(4)},function(r,t){r.exports=e},function(e,r){e.exports={version:"5.0.0"}},function(e,r,t){"use strict";var n=t(4);e.exports.weave={plain:[1,1],serge:[2,2]},e.exports.colors=n.color.buildColorMap({B:"#304080",G:"#004c00",K:"#000000",N:"#666666",R:"#c80000",T:"#603311",W:"#ffffff",Y:"#ffe600"}),e.exports.warpAndWeftSeparator="//",e.exports.insignificantTokens=["invalid","whitespace"]},function(e,r,t){"use strict";e.exports.error=t(5),e.exports.color=t(6),e.exports.token=t(7),e.exports.node=t(8),e.exports.sett=t(9),e.exports.repaint=t(10)},function(e,r){"use strict";var t={error:"error",warning:"warning",notice:"notice"},n={invalidToken:"Invalid token",zeroWidthStripe:"Zero-width stripe",unexpectedToken:"Unexpected token",orphanedPivot:"Orphaned pivot",multipleWarpAnWeftSeparator:"Only one warp/weft separator is allowed",unmatchedBlockStart:"Unmatched block start",unmatchedBlockEnd:"Unmatched block end",extraTokenInInputSequence:"Extra token in input sequence",invalidMultiplier:"Invalid multiplier value; replaced with default (1)"};e.exports.severity=t,e.exports.message=n},function(e,r,t){"use strict";function n(e,r){return r?/^#[0-9a-f]{3}([0-9a-f]{3})?$/i.test(e):/^#[0-9a-f]{6}$/i.test(e)}function o(e,r){return e=e.replace(/^\s*#/g,"").replace(/\s+$/g,"").toUpperCase(),r=r.replace(/^\s*#/g,"").replace(/\s+$/g,"").toUpperCase(),e==r}function i(e){return/^#?[0-9a-f]{6}$/i.test(e)?"#"+e.replace(/^#/,"").toUpperCase():/^#?[0-9a-f]{3}$/i.test(e)?"#"+e.replace(/^#/,"").replace(/[0-9a-f]/gi,"$&$&").toUpperCase():e}function s(e){var r={};return a.isArray(e)?a.each(e,function(e){r[e.name.toUpperCase()]={value:i(e.color),comment:a.isString(e.comment)?e.comment:""}}):a.isObject(e)&&a.each(e,function(e,t){r[t.toUpperCase()]={value:i(e),comment:""}}),r}var a=t(1);e.exports.isValidColor=n,e.exports.isSameColor=o,e.exports.normalizeColor=i,e.exports.buildColorMap=s},function(e,r,t){"use strict";function n(e,r){return B.isObject(e)&&e.type==r}function o(e){return n(e,L.invalid)}function i(e){return n(e,L.whitespace)}function s(e){return n(e,L.color)}function a(e){return n(e,L.stripe)}function u(e){return n(e,L.pivot)}function c(e){return n(e,L.literal)}function f(e){return n(e,L.repeat)}function l(e){return c(e)&&("["==e.value||"]"==e.value)}function p(e){return c(e)&&"["==e.value}function m(e){return c(e)&&"]"==e.value}function x(e){return c(e)&&("("==e.value||")"==e.value)}function d(e){return c(e)&&"("==e.value}function v(e){return c(e)&&")"==e.value}function h(e){return u(e)&&(e=B.clone(e),e.type=L.stripe),e}function w(e){return a(e)&&(e=B.clone(e),e.type=L.pivot),e}function g(e,r){var t={type:e,source:"",offset:-1,length:-1};return B.isString(r)&&(t.value=r,t.length=r.length),t}function S(e){return g(L.invalid,e)}function k(e){return g(L.whitespace,e)}function b(e,r){var t=g(L.color);return t.name=e,t.color=r,t}function y(e,r){r=parseInt(r,10)||0,r<0&&(r=0);var t=g(L.stripe);return t.name=e,t.count=r,t}function A(e,r){r=parseInt(r,10)||0,r<0&&(r=0);var t=g(L.pivot);return t.name=e,t.count=r,t}function j(e){return g(L.literal,e)}function C(){return g(L.literal,"[")}function O(){return g(L.literal,"]")}function F(e){return g(L.literal,e)}function W(){return g(L.literal,"(")}function P(){return g(L.literal,")")}function T(e){return g(L.literal,e)}function R(e){var r=g(L.repeat);return r.count=parseInt(e,10)||0,r.count<=0&&(r.count=1),r}var B=t(1),L={invalid:"invalid",whitespace:"whitespace",color:"color",stripe:"stripe",pivot:"pivot",literal:"literal",repeat:"repeat"};e.exports=L,e.exports.isToken=n,e.exports.isInvalid=o,e.exports.isWhitespace=i,e.exports.isColor=s,e.exports.isStripe=a,e.exports.isPivot=u,e.exports.isSquareBracket=l,e.exports.isOpeningSquareBracket=p,e.exports.isClosingSquareBracket=m,e.exports.isParenthesis=x,e.exports.isOpeningParenthesis=d,e.exports.isClosingParenthesis=v,e.exports.isLiteral=c,e.exports.isRepeat=f,e.exports.pivotToStripe=h,e.exports.stripeToPivot=w,e.exports.newToken=g,e.exports.newInvalid=S,e.exports.newWhitespace=k,e.exports.newColor=b,e.exports.newStripe=y,e.exports.newPivot=A,e.exports.newSquareBracket=j,e.exports.newOpeningSquareBracket=C,e.exports.newClosingSquareBracket=O,e.exports.newParenthesis=F,e.exports.newOpeningParenthesis=W,e.exports.newClosingParenthesis=P,e.exports.newLiteral=T,e.exports.newRepeat=R},function(e,r,t){"use strict";function n(e){return{isStripe:!0,name:e.name,count:e.count}}function o(e,r,t){return t=parseInt(t,10)||0,{isBlock:!0,items:f.filter(e,f.isObject),reflect:!!r,repeat:t>=1?t:1}}function i(e,r,t){var n=o(e,r,t);return n.isRoot=!0,n}function s(e){var r=parseInt(e,10)||0;return r>1?r:1}function a(e){return f.isObject(e)?e.isStripe&&e.count>0?e.name+e.count*s(e.repeat):e.isBlock&&f.isArray(e.items)&&e.items.length>0?"["+(e.isRoot?"R":"B")+"*"+s(e.repeat)+"/"+(e.reflect?"RF":"RP")+":"+f.chain(e.items).map(a).join("").value()+"]":"":""}function u(e,r){var t=0,n=0;if(f.isObject(e)&&(e.isStripe&&t++,e.isBlock&&f.isArray(e.items)&&e.items.length>0)){e.isRoot||n++;var o=e.reflect?2:1;f.each(e.items,function(r){if(f.isObject(r)){if(r.isBlock){var i=u(r,!0);n+=i.blocks*o}r.isStripe&&e.isRoot&&!e.reflect&&t++}})}return r?{blocks:n,stripes:t}:0==n&&0==t?e.isRoot?0:Number.MAX_VALUE:Math.sqrt(n*n+t*t)}function c(e,r){if(!f.isObject(e)||!f.isObject(r))return!1;if(e.isStripe&&r.isStripe)return e.name==r.name&&e.count*s(e.repeat)==r.count*s(r.repeat);if(e.isBlock&&r.isBlock){if(e.isRoot!=r.isRoot)return!1;if(e.reflect!=r.reflect)return!1;if(s(e.repeat)!=s(r.repeat))return!1;if(!f.isArray(e.items)||!f.isArray(r.items))return!1;if(e.items.length!=r.items.length)return!1;var t=!0;return f.each(e.items,function(e,n){var o=r.items[n];if(!c(e,o))return t=!1,!1}),t}return!1}var f=t(1);e.exports.newStripe=n,e.exports.newBlock=o,e.exports.newRootBlock=i,e.exports.isSameNode=c,e.exports.calculateNodeHash=a,e.exports.calculateNodeWeight=u},function(e,r,t){"use strict";function n(e,r,t){var n=r[e];return a.isObject(n)&&u.isValidColor(n.value)?n.value:(n=t[e],a.isObject(n)&&u.isValidColor(n.value)?n.value:null)}function o(e,r,t){return r=a.extend({},r),t=a.extend({},t),a.chain(e).map(function(e){if(a.isObject(e)&&e.isStripe){var o=parseInt(e.count,10)||0;if(o>0){var i=n(e.name,r,t);if(i)return[i,o]}}return null}).filter().reduce(function(e,r){var t=a.last(e);return t&&u.isSameColor(t[0],r[0])?(t[1]+=r[1],e):(e.push(r),e)},[]).value()}function i(e,r){r=!a.isArray(r)||r.length<2?[1,1]:r.slice(0,2),e=a.filter(e,function(e){return a.isArray(e)&&e.length>=2&&e[1]>0});var t=0,n=0;if(e.length>0){t=a.reduce(e,function(e,r){return e+r[1]},0);var o=a.sum(r);for(n=t;n%o!=0;)n+=t}return{length:t,fullCycle:n}}function s(e){var r=e.items,t=e.repeat,n=e.reflect;if(r.length<=1){if(1==r.length&&t>1){var o=a.clone(r[0]);o.count*=t,e=a.clone(e),e.items=[o]}return e}var i,s;n?(s=r.slice(1,-1),s.reverse(),i=r.concat(s)):i=r,s=[];for(var u=1;u<=t;u++)[].push.apply(s,i);return i=s,n&&!e.isRoot&&i.push(r[0]),e=a.clone(e),e.items=i,e.reflect=!1,e.repeat=1,e}var a=t(1),u=t(6);e.exports.compile=o,e.exports.getPatternMetrics=i,e.exports.reflectAndRepeat=s},function(e,r,t){"use strict";function n(e){function r(){t=null,n=null,e(n)}if(!o.isFunction(e))return o.identity;var t=null,n=null,a=function(e){t||(t=i(r),n=e)};return a.cancel=function(){return t&&s(t),t=null,n=null,this},a}var o=t(1),i=function(){var e=null;return"undefined"!=typeof window&&o.isObject(window)&&(e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame),e||setTimeout}(),s=function(){var e=null;return"undefined"!=typeof window&&o.isObject(window)&&(e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame),e||clearTimeout}();e.exports=n},function(e,r,t){"use strict";function n(e){var r=a.filter(e,function(e){return a.isString(e)&&e.length>0});return r.length>0?a.first(r):""}function o(e){var r=a.filter(e,function(e){return a.isObject(e)&&e.isBlock&&e.isRoot&&a.isArrayLike(e.items)});return r.length>0?a.first(r):f.node.newRootBlock([])}function i(e,r,t){var n=c(r,e,t),o=n.parse();return a.isFunction(t.processTokens)&&(o=t.processTokens(o)),a.isFunction(t.buildSyntaxTree)&&(o=t.buildSyntaxTree(o)),o}function s(e,r){return r=a.extend({},p,r),function(t){t=u(t);var s;if(a.isString(t.warp)||a.isString(t.weft)){var c=a.trim(n([t.warp,t.weft])),l=a.trim(n([t.weft,t.warp])),p=c==l;c=i(e,c,r),p?(s={meta:a.extend({},c.meta),warp:o([c.warp,c.weft])},s.weft=s.warp):(l=i(e,l,r),a.isArrayLike(c)&&a.isArrayLike(l)?s=a.concat(c,f.token.newLiteral(r.warpAndWeftSeparator),l):a.isObject(c)&&a.isObject(l)&&(s={meta:a.extend({},c.meta,l.meta),warp:o([c.warp,c.weft]),weft:o([l.warp,l.weft])}))}else if(a.isString(t.threadcount)||a.isString(t.sett)){var m=n([t.threadcount,t.sett]);s=i(e,m,r)}else s=i(e,"",r);if(a.isString(t.palette)||a.isString(t.colors)){var x=n([t.palette,t.colors]);x=i(e,x,r),a.isArrayLike(s)?a.isArrayLike(x)&&(s=a.concat(x,s)):a.isObject(s)&&a.isObject(x)&&(s.colors=x.colors,s.meta=a.extend({},x.meta,s.meta))}return a.isObject(s)&&(s.colors=a.extend({},s.colors),a.isFunction(r.getSourceMeta)?s.meta=a.extend({},s.meta,r.getSourceMeta(t)):s.meta=a.extend({},s.meta)),s}}var a=t(1),u=t(12),c=t(15),f=t(4),l=t(3),p={errorHandler:null,processTokens:null,buildSyntaxTree:null,foreseeLimit:1,getSourceMeta:function(e){return a.omit(e,["warp","weft","threadcount","sett","palette","colors"])},warpAndWeftSeparator:l.warpAndWeftSeparator};e.exports=s,e.exports.source=t(18),e.exports.color=t(20),e.exports.stripe=t(21),e.exports.pivot=t(22),e.exports.repeat=t(23),e.exports.literal=t(24)},function(e,r,t){"use strict";function n(e){return o.isFunction(e)&&(e=e()),o.isString(e)?i(e):s(e)}var o=t(1),i=t(13),s=t(14);e.exports=n,Object.defineProperty(e.exports,"id",{enumerable:!0,value:"autodetect"}),Object.defineProperty(e.exports,"name",{enumerable:!0,value:"Autodetect"})},function(e,r,t){"use strict";function n(e){return{threadcount:o.isString(e)?e:""}}var o=t(1);e.exports=n,Object.defineProperty(e.exports,"id",{enumerable:!0,value:"string"}),Object.defineProperty(e.exports,"name",{enumerable:!0,value:"String"})},function(e,r,t){"use strict";function n(e){return o.extend({threadcount:""},e)}var o=t(1);e.exports=n,Object.defineProperty(e.exports,"id",{enumerable:!0,value:"object"}),Object.defineProperty(e.exports,"name",{enumerable:!0,value:"Object"})},function(e,r,t){"use strict";function n(e,r,t){this.source=s.isString(e)?e:"",r=s.filter(r,s.isFunction),r.splice(0,0,a()),r.push(u()),this.parsers=r,this.options=t,this.inForesee=0,s.isFunction(t.errorHandler)&&(this.errorHandler=function(e,r,n){t.errorHandler(e,r,n||"error")})}function o(e,r){var t=null;return s.each(e.parsers,function(n){if(t=n(e,r),s.isObject(t))return t.offset=t.offset||r,!1}),t}function i(e,r,t){return t=s.extend({},t),t.foreseeLimit=parseInt(t.foreseeLimit,10)||0,t.foreseeLimit<1&&(t.foreseeLimit=1),new n(e,r,t)}var s=t(1),a=t(16),u=t(17);n.prototype={},n.prototype.errorHandler=function(e,r,t){},n.prototype.foresee=function(e){var r=this.options.foreseeLimit;if(this.inForesee>=r)return null;if(e=parseInt(e,10)||0,e<0&&(e=0),e<=this.offset)return this.errorHandler(new Error("Parser should not go back."),{currentOffset:this.offset,requestedOffset:e,source:this.source}),null;this.inForesee++;var t=o(this,e);return this.inForesee>0&&this.inForesee--,t},n.prototype.parse=function(e){var r=[];for(e=parseInt(e,10)||0,e<0&&(e=0);e<this.source.length;){this.offset=e;var t=o(this,e);s.isObject(t)&&(r.push(t),e=t.offset+t.length)}return r},e.exports=i},function(e,r,t){"use strict";function n(e,r){for(var t=e.source,n=10,o="";;){var a=t.substr(r,n),u=i.exec(a);if(!u)break;if(o+=u[0],u[0].length<n)break}if(""!=o)return{type:s.token.whitespace,value:o,length:o.length}}function o(){return n}var i=/^\s+/i,s=t(4);e.exports=o},function(e,r,t){"use strict";function n(e,r){var t=e.source,n=t.charAt(r);if(!e.inForesee)for(var o=r+1;;){var a=e.foresee(o);{if(!i.isObject(a)||"invalid"!=a.type)break;n+=a.value,o+=a.length}}if(""!=n)return n={type:s.token.invalid,value:n,length:n.length},e.inForesee||e.errorHandler(new Error(s.error.message.invalidToken),{token:n},s.error.severity.error),n}function o(){return n}var i=t(1),s=t(4);e.exports=o},function(e,r,t){"use strict";e.exports.autodetect=t(12),e.exports.string=t(13),e.exports.object=t(14),e.exports.json=t(19)},function(e,r,t){"use strict";function n(e){return o.extend({threadcount:""},o.isString(e)?JSON.parse(e):e)}var o=t(1);e.exports=n,Object.defineProperty(e.exports,"id",{enumerable:!0,value:"json"}),Object.defineProperty(e.exports,"name",{enumerable:!0,value:"JSON"})},function(e,r,t){"use strict";function n(e){if(e.colorFormat=a.trim((""+e.colorFormat).toLowerCase()),["long","short","both"].indexOf(e.colorFormat)==-1&&(e.colorFormat=c.colorFormat),e.colorPrefix instanceof RegExp?e.colorPrefix=e.colorPrefix.source:a.isString(e.colorPrefix)||(e.colorPrefix=""),e.colorSuffix instanceof RegExp?e.colorSuffix=e.colorSuffix.source:a.isString(e.colorSuffix)||(e.colorSuffix=""),e.commentSuffix instanceof RegExp){var r=e.commentSuffix.ignoreCase?"i":"";e.commentSuffix=new RegExp("^"+e.commentSuffix.source,r)}else e.commentSuffix=null;return e.commentFormat instanceof RegExp||(e.commentFormat=null),e}function o(e){var r=["^"],t="[a-z]";switch(e.allowLongNames&&(t+="{1,100}"),r.push("("+t+")"),r.push("("+e.colorPrefix+")"),e.colorFormat){case"long":r.push("([0-9a-f]{6})");break;case"short":r.push("([0-9a-f]{3})");break;case"both":r.push("([0-9a-f]{6}|[0-9a-f]{3})")}return r.push(e.colorSuffix),new RegExp(r.join(""),"i")}function i(e,r,t,n){var o,i,s,c=e.source;if(i=c.substr(r,200),o=t.exec(i)){var f={type:u.token.color,name:o[1].toUpperCase(),color:u.color.normalizeColor(o[3]),comment:"",length:o[0].length};if(!e.inForesee){if(n.allowComment){var l=r+f.length;if(n.commentSuffix&&n.requireCommentSuffix){for(s=l;s<c.length;s++)if(i=c.substr(s,10),o=n.commentSuffix.exec(i)){f.comment=c.substr(l,s-l+o[0].length);break}s>=c.length&&(f.comment=c.substr(l,c.length))}else{var p=["whitespace","invalid"];for(s=l;s<c.length;s++){if(i=c.substr(s,10),o=n.commentSuffix.exec(i)){f.comment=c.substr(l,s-l+o[0].length);break}var m=e.foresee(s);if(a.isObject(m)&&p.indexOf(m.type)==-1){f.comment=c.substr(l,s-l);break}}s>=c.length&&(f.comment=c.substr(l,c.length))}}f.length+=f.comment.length,n.commentFormat&&(o=n.commentFormat.exec(f.comment),o&&a.isString(o[1])&&(f.comment=o[1])),f.comment=a.trim(f.comment)}return f}}function s(e){e=n(a.extend({},c,e));var r=o(e);return function(t,n){return i(t,n,r,e)}}var a=t(1),u=t(4),c={allowLongNames:!0,colorPrefix:/[=]?[#]/,colorSuffix:/;?/,colorFormat:"both",allowComment:!1,commentSuffix:/;/,requireCommentSuffix:!0,commentFormat:/^\s*(.*)\s*;\s*$/};e.exports=s},function(e,r,t){"use strict";function n(e){var r=["^"],t="[a-z]";return e.allowLongNames&&(t+="{1,100}"),r.push("("+t+")"),r.push("([0-9]+)"),new RegExp(r.join(""),"i")}function o(e,r,t,n){var o=e.source,i=t.exec(o.substr(r,20));if(i){var s=parseInt(i[2],10)||0;s<0&&(s=0);var u={type:a.token.stripe,name:i[1].toUpperCase(),count:s,length:i[0].length};return 0==u.count&&e.errorHandler(new Error(a.error.message.zeroWidthStripe),{token:u},a.error.severity.warning),u}}function i(e){e=s.extend({},u,e);var r=n(e);return function(t,n){return o(t,n,r,e)}}var s=t(1),a=t(4),u={allowLongNames:!0};e.exports=i},function(e,r,t){"use strict";function n(e){var r=["^"],t="[a-z]";return e.allowLongNames&&(t+="{1,100}"),r.push("("+t+")"),r.push("/([0-9]+)"),new RegExp(r.join(""),"i")}function o(e,r,t,n){var o=e.source,i=t.exec(o.substr(r,20));if(i){var s=parseInt(i[2],10)||0;s<0&&(s=0);var u={type:a.token.pivot,name:i[1].toUpperCase(),count:s,length:i[0].length};return 0==u.count&&e.errorHandler(new Error(a.error.message.zeroWidthStripe),{token:u},a.error.severity.warning),u}}function i(e){e=s.extend({},u,e);var r=n(e);return function(t,n){return o(t,n,r,e)}}var s=t(1),a=t(4),u={allowLongNames:!0};e.exports=i},function(e,r,t){"use strict";function n(e,r,t){var n=e.source,o=null,a=!1,f=!1;if(t.allowAsPrefix&&(o=u.exec(n.substr(r,20)),a=!!o),t.allowAsSuffix&&!o&&(o=c.exec(n.substr(r,20)),f=!!o),o){var l=parseInt(o[1],10)||0;l<=0&&(l=1);var p={type:s.token.repeat,count:l>=1?l:1,isPrefix:a,isSuffix:f,length:o[0].length};return l<1&&e.errorHandler(new Error(s.error.message.invalidMultiplier),{token:i.extend({},p,{count:l})},s.error.severity.warning),p}}function o(e){return e=i.extend({},a,e),function(r,t){return n(r,t,e)}}var i=t(1),s=t(4),a={allowAsPrefix:!0,allowAsSuffix:!0},u=/^([0-9]+)\s*[*]/i,c=/^[*]\s*([0-9]+)/i;e.exports=o},function(e,r,t){"use strict";function n(e,r,t){var n=e.source;if(""!=t.string){var o=n.substr(r,t.string.length),i=t.ignoreCase?o.toUpperCase():o;if(i==t.string)return{type:s.token.literal,value:o,length:o.length}}}function o(e){return i.isString(e)&&(e={string:e}),e=i.extend({},a,e),i.isString(e.string)||(e.string=""),e.ignoreCase&&(e.string=e.string.toUpperCase()),function(r,t){return n(r,t,e)}}var i=t(1),s=t(4),a={string:"",ignoreCase:!1};e.exports=o},function(e,r,t){"use strict";function n(e){return e=o.filter(e,o.isFunction),function(r){if(o.isArray(r))for(var t=0;t<e.length;t++)r=e[t](r);return r}}var o=t(1);e.exports=n,e.exports.classify=t(26),e.exports.removeTokens=t(27)},function(e,r,t){"use strict";function n(e,r,t){return!1}function o(e,r){return s.map(e,function(t,n){var o=s.clone(t);return s.each(r,function(r,i){o[i]=r(t,n,e)}),o})}function i(e){return e=s.extend({},c,e),s.each(c,function(r,t){s.isFunction(e[t])||(e[t]=n)}),function(r){return o(r,e)}}var s=t(1),a=t(4),u=t(3),c={isColor:function(e,r,t){return a.token.isColor(e)},isStripe:function(e,r,t){return a.token.isStripe(e)},isPivot:function(e,r,t){return a.token.isPivot(e)},isRepeat:function(e,r,t){return a.token.isRepeat(e)},isWarpAndWeftSeparator:function(e,r,t){return a.token.isLiteral(e)&&e.value==u.warpAndWeftSeparator},isBlockStart:function(e,r,t){return a.token.isOpeningSquareBracket(e)||a.token.isOpeningParenthesis(e)},isBlockEnd:function(e,r,t){return a.token.isClosingSquareBracket(e)||a.token.isClosingParenthesis(e)}};e.exports=i},function(e,r,t){"use strict";function n(e){return i.isFunction(e)?e:(i.isArray(e)||(e=s.insignificantTokens),function(r){return!i.isObject(r)||e.indexOf(r.type)>=0})}function o(e){var r=n(e);return function(e){return i.filter(e,function(e){return!r(e)})}}var i=t(1),s=t(3);e.exports=o},function(e,r,t){"use strict";function n(e){return e=o.filter(e,o.isFunction),function(r){return o.isObject(r)&&o.each(e,function(e){r=e(r)}),r}}var o=t(1);e.exports=n,e.exports.flatten=t(29),e.exports.fold=t(30)},function(e,r,t){"use strict";function n(e){var r=[];return s.each(e.items,function(e){e.isBlock?(e=n(e),[].push.apply(r,e.items)):r.push(e)}),e=s.clone(e),e.items=r,a.sett.reflectAndRepeat(e)}function o(e){var r=s.clone(e),t=e.warp==e.weft;return s.isObject(e.warp)&&(r.warp=n(e.warp)),s.isObject(e.weft)&&(t?r.weft=r.warp:r.weft=n(e.weft)),r}function i(){return o}var s=t(1),a=t(4);e.exports=i},function(e,r,t){"use strict";function n(e){if(!(e.length<5||e.length%2!=1)){for(var r,t,n=[],o=0,i=e.length-1;;){if(r=e[o],t=e[i],!c.node.isSameNode(r,t))return;if(n.push(r),o==i)break;o++,i--}return n}}function o(e,r,t){if(!e.reflect&&0!=e.items.length){var o=u.concat(e.items,e.items[0]),i=n(o);if(u.isArray(i)){var s=u.clone(e);s.items=i,s.reflect=!0,t.push({node:s,hash:c.node.calculateNodeHash(s),weight:r.calculateNodeWeight(s)})}}}function i(e,r,t){var n=[];return o(e,r,n),n.push({node:e,hash:c.node.calculateNodeHash(e),weight:r.calculateNodeWeight(e)}),n}function s(e,r){var t=u.clone(e),n=e.warp===e.weft;return u.isObject(e.warp)&&(t.warpVariants=i(e.warp,r,!0)),u.isObject(e.weft)&&(n?t.weftVariants=t.warpVariants:t.weftVariants=i(e.weft,r,!0)),t.warp=u.first(t.warpVariants).node,t.weft=u.first(t.weftVariants).node,t}function a(e){return e=u.extend({},f,e),function(r){return s(r,e)}}var u=t(1),c=t(4),f={calculateNodeWeight:c.node.calculateNodeWeight};e.exports=a},function(e,r,t){"use strict";e.exports.classic=t(32)},function(e,r,t){"use strict";function n(e,r){var t=[],n=!1,o=null,i=null;return e.length>=2&&(o=s.first(e),i=s.last(e),o.isPivot&&i.isPivot&&(n=!0)),s.each(e,function(e){return e.isStripe?void t.push(a.node.newStripe(e)):e.isPivot?!n||e!==o&&e!==i?(r.errorHandler(new Error(a.error.message.orphanedPivot),{token:e},a.error.severity.warning),void t.push(a.node.newStripe(e))):void t.push(a.node.newStripe(e)):void r.errorHandler(new Error(a.error.message.unexpectedToken),{token:e},a.error.severity.error)}),a.node.newRootBlock(t,n)}function o(e,r){if(!s.isArray(e))return e;if(s.isFunction(r.processTokens)&&(e=r.processTokens(e),!s.isArray(e)))return e;var t=[],o=[],i=[],u=o;s.each(e,function(e){return e.isColor?void t.push(e):void(e.isWarpAndWeftSeparator?(u===i&&r.errorHandler(new Error(a.error.message.multipleWarpAnWeftSeparator),{token:e},a.error.severity.warning),u=i):u.push(e))}),0==o.length&&(o=i,i=[]),0==i.length&&(i=o);var c={};return c.colors=a.color.buildColorMap(t),c.warp=n(o,r),i===o?c.weft=c.warp:c.weft=n(i,r),s.isFunction(r.transformSyntaxTree)&&(c=r.transformSyntaxTree(c)),c}function i(e){return e=s.extend({},u,e),s.isFunction(e.errorHandler)||(e.errorHandler=u.errorHandler),function(r){return o(r,e)}}var s=t(1),a=t(4),u={errorHandler:function(e,r,t){},processTokens:null,transformSyntaxTree:null};e.exports=i},function(e,r,t){"use strict";e.exports.format=t(34)},function(e,r,t){"use strict";function n(e,r,t){var n=a.extend({},t.defaultColors),o=a.intersection(a.keys(r),a.keys(e));t.includeUnusedColors&&(o=a.keys(r)),t.includeDefaultColors&&(o=a.union(a.keys(r),a.keys(e)));var i=t.format;return a.isFunction(i.color)?a.chain(o).sortBy().map(function(e){var t=r[e]||n[e];return t?i.color(a.extend({name:e},t)):null}).filter(function(e){return a.isString(e)&&e.length>0}).value():[]}function o(e,r,t){var n=r.format;return a.isFunction(n.stripe)&&a.isFunction(n.block)?(e=a.clone(e),e.formattedItems=a.chain(e.items).map(function(e){return e.isStripe?(t[e.name]=!0,n.stripe(e)):e.isBlock?o(e,r,t):""}).filter(function(e){return e.length>0}).value(),a.isFunction(n.block)?n.block(e):""):""}function i(e,r){var t=e.warp===e.weft,i={},s=o(e.warp,r,i),u=s;t||(u=o(e.weft,r,i));var c=n(i,e.colors,r);return a.trim(r.join({colors:c,warp:s,weft:u},e))}function s(e){return e=a.merge({},u,e),function(r){return a.isObject(r)?(a.isFunction(e.transformSyntaxTree)&&(r=e.transformSyntaxTree(r)),i(r,e)):""}}var a=t(1),u={transformSyntaxTree:null,format:{color:function(e){var r=""!=e.comment?" "+e.comment:"";return e.name+e.value+r+";"},stripe:function(e){return e.name+e.count},block:function(e){var r=a.chain(e.formattedItems).join(" ").trim().value();if(""==r)return"";var t=e.repeat>1?"*"+e.repeat:"";return r=e.isRoot?e.reflect?"["+r+"]":r:e.reflect?"["+r+"]":"("+r+")",r+t}},join:function(e){var r=[];return e.colors.length>0&&r.push(e.colors.join(" ")),e.warp!=e.weft?r.push(e.warp+" // "+e.weft):r.push(e.warp),r.join("\n")},defaultColors:{},includeUnusedColors:!0,includeDefaultColors:!0};e.exports=s},function(e,r,t){"use strict";e.exports.classic=t(36)},function(e,r,t){"use strict";var n=t(3);e.exports.id="classic",e.exports.name="Classic (strict syntax)",e.exports.parse=t(37),e.exports.format=t(38),e.exports.colors=n.colors,e.exports.warpAndWeftSeparator=n.warpAndWeftSeparator},function(e,r,t){"use strict";function n(e){return e=o.extend({},e),o.isString(e.warpAndWeftSeparator)||(e.warpAndWeftSeparator=""),""==e.warpAndWeftSeparator&&(e.warpAndWeftSeparator=i.warpAndWeftSeparator),a([a.pivot(),a.stripe(),a.literal(e.warpAndWeftSeparator),a.color({allowLongNames:!0,colorPrefix:/[=]?[#]/,colorSuffix:null,colorFormat:"long",allowComment:!0,commentSuffix:/;/,requireCommentSuffix:!0,commentFormat:/^\s*(.*)\s*;\s*$/})],{errorHandler:e.errorHandler,processTokens:u([e.processTokens,u.removeTokens(s.insignificantTokens)]),buildSyntaxTree:c.classic({errorHandler:e.errorHandler,processTokens:u.classify({isWarpAndWeftSeparator:function(r){return f.token.isLiteral(r)&&r.value==e.warpAndWeftSeparator}}),transformSyntaxTree:e.transformSyntaxTree})})}var o=t(1),i=t(36),s=t(3),a=t(11),u=t(25),c=t(31),f=t(4);e.exports=n},function(e,r,t){"use strict";function n(e){return e.replace(/^([a-z]+)([0-9]+)$/i,"$1/$2")}function o(e){return e=i.extend({},e,c),i.isString(e.warpAndWeftSeparator)||(e.warpAndWeftSeparator=""),""==e.warpAndWeftSeparator&&(e.warpAndWeftSeparator=s.warpAndWeftSeparator),e.transformSyntaxTree=u([e.transformSyntaxTree,u.flatten(),u.fold({allowRootReorder:!1,allowNestedBlocks:!1,maxFoldLevels:2,minBlockSize:3,greedy:!1,allowSplitStripe:!1,processExistingBlocks:!1})]),e.join=function(r){var t=[];return r.colors.length>0&&t.push(r.colors.join(" ")),r.warp!=r.weft?t.push(r.warp+" "+e.warpAndWeftSeparator+" "+r.weft):t.push(r.warp),t.join("\n")},a.format(e)}var i=t(1),s=t(36),a=t(33),u=t(28),c={format:{color:function(e){var r=""!=e.comment?" "+e.comment:"";return e.name+e.value+r+";"},stripe:function(e){return e.name+e.count},block:function(e){var r=e.formattedItems;return e.reflect&&r.length>=2&&(r[0]=n(r[0]),r[r.length-1]=n(r[r.length-1])),i.chain(r).join(" ").trim().value()}}};e.exports=o}])});
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("_")):"function"==typeof define&&define.amd?define(["_"],r):"object"==typeof exports?exports.tartan=r(require("_")):e.tartan=r(e._)}(this,function(e){return function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var t={};return r.m=e,r.c=t,r.p="",r(0)}([function(e,r,t){"use strict";var n=t(1);n.extend(e.exports,t(2)),e.exports.defaults=t(3),e.exports.parse=t(11),e.exports.filter=t(25),e.exports.transform=t(28),e.exports.syntax=t(31),e.exports.render=t(33),e.exports.schema=t(35),e.exports.utils=t(4)},function(r,t){r.exports=e},function(e,r){e.exports={version:"5.0.1"}},function(e,r,t){"use strict";var n=t(4);e.exports.weave={plain:[1,1],serge:[2,2]},e.exports.colors=n.color.buildColorMap({B:"#304080",G:"#004c00",K:"#000000",N:"#666666",R:"#c80000",T:"#603311",W:"#ffffff",Y:"#ffe600"}),e.exports.warpAndWeftSeparator="//",e.exports.insignificantTokens=["invalid","whitespace"]},function(e,r,t){"use strict";e.exports.error=t(5),e.exports.color=t(6),e.exports.token=t(7),e.exports.node=t(8),e.exports.sett=t(9),e.exports.repaint=t(10)},function(e,r){"use strict";var t={error:"error",warning:"warning",notice:"notice"},n={invalidToken:"Invalid token",zeroWidthStripe:"Zero-width stripe",unexpectedToken:"Unexpected token",orphanedPivot:"Orphaned pivot",multipleWarpAnWeftSeparator:"Only one warp/weft separator is allowed",unmatchedBlockStart:"Unmatched block start",unmatchedBlockEnd:"Unmatched block end",extraTokenInInputSequence:"Extra token in input sequence",invalidMultiplier:"Invalid multiplier value; replaced with default (1)"};e.exports.severity=t,e.exports.message=n},function(e,r,t){"use strict";function n(e,r){return r?/^#[0-9a-f]{3}([0-9a-f]{3})?$/i.test(e):/^#[0-9a-f]{6}$/i.test(e)}function o(e,r){return e=e.replace(/^\s*#/g,"").replace(/\s+$/g,"").toUpperCase(),r=r.replace(/^\s*#/g,"").replace(/\s+$/g,"").toUpperCase(),e==r}function i(e){return/^#?[0-9a-f]{6}$/i.test(e)?"#"+e.replace(/^#/,"").toUpperCase():/^#?[0-9a-f]{3}$/i.test(e)?"#"+e.replace(/^#/,"").replace(/[0-9a-f]/gi,"$&$&").toUpperCase():e}function s(e){var r={};return a.isArray(e)?a.each(e,function(e){r[e.name.toUpperCase()]={value:i(e.color),comment:a.isString(e.comment)?e.comment:""}}):a.isObject(e)&&a.each(e,function(e,t){r[t.toUpperCase()]={value:i(e),comment:""}}),r}var a=t(1);e.exports.isValidColor=n,e.exports.isSameColor=o,e.exports.normalizeColor=i,e.exports.buildColorMap=s},function(e,r,t){"use strict";function n(e,r){return B.isObject(e)&&e.type==r}function o(e){return n(e,L.invalid)}function i(e){return n(e,L.whitespace)}function s(e){return n(e,L.color)}function a(e){return n(e,L.stripe)}function u(e){return n(e,L.pivot)}function c(e){return n(e,L.literal)}function f(e){return n(e,L.repeat)}function l(e){return c(e)&&("["==e.value||"]"==e.value)}function p(e){return c(e)&&"["==e.value}function m(e){return c(e)&&"]"==e.value}function x(e){return c(e)&&("("==e.value||")"==e.value)}function d(e){return c(e)&&"("==e.value}function v(e){return c(e)&&")"==e.value}function h(e){return u(e)&&(e=B.clone(e),e.type=L.stripe),e}function w(e){return a(e)&&(e=B.clone(e),e.type=L.pivot),e}function g(e,r){var t={type:e,source:"",offset:-1,length:-1};return B.isString(r)&&(t.value=r,t.length=r.length),t}function S(e){return g(L.invalid,e)}function k(e){return g(L.whitespace,e)}function b(e,r){var t=g(L.color);return t.name=e,t.color=r,t}function y(e,r){r=parseInt(r,10)||0,r<0&&(r=0);var t=g(L.stripe);return t.name=e,t.count=r,t}function A(e,r){r=parseInt(r,10)||0,r<0&&(r=0);var t=g(L.pivot);return t.name=e,t.count=r,t}function j(e){return g(L.literal,e)}function C(){return g(L.literal,"[")}function O(){return g(L.literal,"]")}function F(e){return g(L.literal,e)}function W(){return g(L.literal,"(")}function P(){return g(L.literal,")")}function T(e){return g(L.literal,e)}function R(e){var r=g(L.repeat);return r.count=parseInt(e,10)||0,r.count<=0&&(r.count=1),r}var B=t(1),L={invalid:"invalid",whitespace:"whitespace",color:"color",stripe:"stripe",pivot:"pivot",literal:"literal",repeat:"repeat"};e.exports=L,e.exports.isToken=n,e.exports.isInvalid=o,e.exports.isWhitespace=i,e.exports.isColor=s,e.exports.isStripe=a,e.exports.isPivot=u,e.exports.isSquareBracket=l,e.exports.isOpeningSquareBracket=p,e.exports.isClosingSquareBracket=m,e.exports.isParenthesis=x,e.exports.isOpeningParenthesis=d,e.exports.isClosingParenthesis=v,e.exports.isLiteral=c,e.exports.isRepeat=f,e.exports.pivotToStripe=h,e.exports.stripeToPivot=w,e.exports.newToken=g,e.exports.newInvalid=S,e.exports.newWhitespace=k,e.exports.newColor=b,e.exports.newStripe=y,e.exports.newPivot=A,e.exports.newSquareBracket=j,e.exports.newOpeningSquareBracket=C,e.exports.newClosingSquareBracket=O,e.exports.newParenthesis=F,e.exports.newOpeningParenthesis=W,e.exports.newClosingParenthesis=P,e.exports.newLiteral=T,e.exports.newRepeat=R},function(e,r,t){"use strict";function n(e){return{isStripe:!0,name:e.name,count:e.count}}function o(e,r,t){return t=parseInt(t,10)||0,{isBlock:!0,items:f.filter(e,f.isObject),reflect:!!r,repeat:t>=1?t:1}}function i(e,r,t){var n=o(e,r,t);return n.isRoot=!0,n}function s(e){var r=parseInt(e,10)||0;return r>1?r:1}function a(e){return f.isObject(e)?e.isStripe&&e.count>0?e.name+e.count*s(e.repeat):e.isBlock&&f.isArray(e.items)&&e.items.length>0?"["+(e.isRoot?"R":"B")+"*"+s(e.repeat)+"/"+(e.reflect?"RF":"RP")+":"+f.chain(e.items).map(a).join("").value()+"]":"":""}function u(e,r){var t=0,n=0;if(f.isObject(e)&&(e.isStripe&&t++,e.isBlock&&f.isArray(e.items)&&e.items.length>0)){e.isRoot||n++;var o=e.reflect?2:1;f.each(e.items,function(r){if(f.isObject(r)){if(r.isBlock){var i=u(r,!0);n+=i.blocks*o}r.isStripe&&e.isRoot&&!e.reflect&&t++}})}return r?{blocks:n,stripes:t}:0==n&&0==t?e.isRoot?0:Number.MAX_VALUE:Math.sqrt(n*n+t*t)}function c(e,r){if(!f.isObject(e)||!f.isObject(r))return!1;if(e.isStripe&&r.isStripe)return e.name==r.name&&e.count*s(e.repeat)==r.count*s(r.repeat);if(e.isBlock&&r.isBlock){if(e.isRoot!=r.isRoot)return!1;if(e.reflect!=r.reflect)return!1;if(s(e.repeat)!=s(r.repeat))return!1;if(!f.isArray(e.items)||!f.isArray(r.items))return!1;if(e.items.length!=r.items.length)return!1;var t=!0;return f.each(e.items,function(e,n){var o=r.items[n];if(!c(e,o))return t=!1,!1}),t}return!1}var f=t(1);e.exports.newStripe=n,e.exports.newBlock=o,e.exports.newRootBlock=i,e.exports.isSameNode=c,e.exports.calculateNodeHash=a,e.exports.calculateNodeWeight=u},function(e,r,t){"use strict";function n(e,r,t){var n=r[e];return a.isObject(n)&&u.isValidColor(n.value)?n.value:(n=t[e],a.isObject(n)&&u.isValidColor(n.value)?n.value:null)}function o(e,r,t){return r=a.extend({},r),t=a.extend({},t),a.chain(e).map(function(e){if(a.isObject(e)&&e.isStripe){var o=parseInt(e.count,10)||0;if(o>0){var i=n(e.name,r,t);if(i)return[i,o]}}return null}).filter().reduce(function(e,r){var t=a.last(e);return t&&u.isSameColor(t[0],r[0])?(t[1]+=r[1],e):(e.push(r),e)},[]).value()}function i(e,r){r=!a.isArray(r)||r.length<2?[1,1]:r.slice(0,2),e=a.filter(e,function(e){return a.isArray(e)&&e.length>=2&&e[1]>0});var t=0,n=0;if(e.length>0){t=a.reduce(e,function(e,r){return e+r[1]},0);var o=a.sum(r);for(n=t;n%o!=0;)n+=t}return{length:t,fullCycle:n}}function s(e){var r=e.items,t=e.repeat,n=e.reflect;if(r.length<=1){if(1==r.length&&t>1){var o=a.clone(r[0]);o.count*=t,e=a.clone(e),e.items=[o]}return e}var i,s;n?(s=r.slice(1,-1),s.reverse(),i=r.concat(s)):i=r,s=[];for(var u=1;u<=t;u++)[].push.apply(s,i);return i=s,n&&!e.isRoot&&i.push(r[0]),e=a.clone(e),e.items=i,e.reflect=!1,e.repeat=1,e}var a=t(1),u=t(6);e.exports.compile=o,e.exports.getPatternMetrics=i,e.exports.reflectAndRepeat=s},function(e,r,t){"use strict";function n(e){function r(){t=null,n=null,e(n)}if(!o.isFunction(e))return o.identity;var t=null,n=null,a=function(e){t||(t=i(r),n=e)};return a.flush=function(){return a.cancel(),r(),this},a.cancel=function(){return t&&s(t),t=null,n=null,this},a}var o=t(1),i=function(){var e=null;return"undefined"!=typeof window&&o.isObject(window)&&(e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame),e||setTimeout}(),s=function(){var e=null;return"undefined"!=typeof window&&o.isObject(window)&&(e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame),e||clearTimeout}();e.exports=n},function(e,r,t){"use strict";function n(e){var r=a.filter(e,function(e){return a.isString(e)&&e.length>0});return r.length>0?a.first(r):""}function o(e){var r=a.filter(e,function(e){return a.isObject(e)&&e.isBlock&&e.isRoot&&a.isArrayLike(e.items)});return r.length>0?a.first(r):f.node.newRootBlock([])}function i(e,r,t){var n=c(r,e,t),o=n.parse();return a.isFunction(t.processTokens)&&(o=t.processTokens(o)),a.isFunction(t.buildSyntaxTree)&&(o=t.buildSyntaxTree(o)),o}function s(e,r){return r=a.extend({},p,r),function(t){t=u(t);var s;if(a.isString(t.warp)||a.isString(t.weft)){var c=a.trim(n([t.warp,t.weft])),l=a.trim(n([t.weft,t.warp])),p=c==l;c=i(e,c,r),p?(s={meta:a.extend({},c.meta),warp:o([c.warp,c.weft])},s.weft=s.warp):(l=i(e,l,r),a.isArrayLike(c)&&a.isArrayLike(l)?s=a.concat(c,f.token.newLiteral(r.warpAndWeftSeparator),l):a.isObject(c)&&a.isObject(l)&&(s={meta:a.extend({},c.meta,l.meta),warp:o([c.warp,c.weft]),weft:o([l.warp,l.weft])}))}else if(a.isString(t.threadcount)||a.isString(t.sett)){var m=n([t.threadcount,t.sett]);s=i(e,m,r)}else s=i(e,"",r);if(a.isString(t.palette)||a.isString(t.colors)){var x=n([t.palette,t.colors]);x=i(e,x,r),a.isArrayLike(s)?a.isArrayLike(x)&&(s=a.concat(x,s)):a.isObject(s)&&a.isObject(x)&&(s.colors=x.colors,s.meta=a.extend({},x.meta,s.meta))}return a.isObject(s)&&(s.colors=a.extend({},s.colors),a.isFunction(r.getSourceMeta)?s.meta=a.extend({},s.meta,r.getSourceMeta(t)):s.meta=a.extend({},s.meta)),s}}var a=t(1),u=t(12),c=t(15),f=t(4),l=t(3),p={errorHandler:null,processTokens:null,buildSyntaxTree:null,foreseeLimit:1,getSourceMeta:function(e){return a.omit(e,["warp","weft","threadcount","sett","palette","colors"])},warpAndWeftSeparator:l.warpAndWeftSeparator};e.exports=s,e.exports.source=t(18),e.exports.color=t(20),e.exports.stripe=t(21),e.exports.pivot=t(22),e.exports.repeat=t(23),e.exports.literal=t(24)},function(e,r,t){"use strict";function n(e){return o.isFunction(e)&&(e=e()),o.isString(e)?i(e):s(e)}var o=t(1),i=t(13),s=t(14);e.exports=n,Object.defineProperty(e.exports,"id",{enumerable:!0,value:"autodetect"}),Object.defineProperty(e.exports,"name",{enumerable:!0,value:"Autodetect"})},function(e,r,t){"use strict";function n(e){return{threadcount:o.isString(e)?e:""}}var o=t(1);e.exports=n,Object.defineProperty(e.exports,"id",{enumerable:!0,value:"string"}),Object.defineProperty(e.exports,"name",{enumerable:!0,value:"String"})},function(e,r,t){"use strict";function n(e){return o.extend({threadcount:""},e)}var o=t(1);e.exports=n,Object.defineProperty(e.exports,"id",{enumerable:!0,value:"object"}),Object.defineProperty(e.exports,"name",{enumerable:!0,value:"Object"})},function(e,r,t){"use strict";function n(e,r,t){this.source=s.isString(e)?e:"",r=s.filter(r,s.isFunction),r.splice(0,0,a()),r.push(u()),this.parsers=r,this.options=t,this.inForesee=0,s.isFunction(t.errorHandler)&&(this.errorHandler=function(e,r,n){t.errorHandler(e,r,n||"error")})}function o(e,r){var t=null;return s.each(e.parsers,function(n){if(t=n(e,r),s.isObject(t))return t.offset=t.offset||r,!1}),t}function i(e,r,t){return t=s.extend({},t),t.foreseeLimit=parseInt(t.foreseeLimit,10)||0,t.foreseeLimit<1&&(t.foreseeLimit=1),new n(e,r,t)}var s=t(1),a=t(16),u=t(17);n.prototype={},n.prototype.errorHandler=function(e,r,t){},n.prototype.foresee=function(e){var r=this.options.foreseeLimit;if(this.inForesee>=r)return null;if(e=parseInt(e,10)||0,e<0&&(e=0),e<=this.offset)return this.errorHandler(new Error("Parser should not go back."),{currentOffset:this.offset,requestedOffset:e,source:this.source}),null;this.inForesee++;var t=o(this,e);return this.inForesee>0&&this.inForesee--,t},n.prototype.parse=function(e){var r=[];for(e=parseInt(e,10)||0,e<0&&(e=0);e<this.source.length;){this.offset=e;var t=o(this,e);s.isObject(t)&&(r.push(t),e=t.offset+t.length)}return r},e.exports=i},function(e,r,t){"use strict";function n(e,r){for(var t=e.source,n=10,o="";;){var a=t.substr(r+o.length,n),u=i.exec(a);if(!u)break;if(o+=u[0],u[0].length<n)break}if(""!=o)return{type:s.token.whitespace,value:o,length:o.length}}function o(){return n}var i=/^\s+/i,s=t(4);e.exports=o},function(e,r,t){"use strict";function n(e,r){var t=e.source,n=t.charAt(r);if(!e.inForesee)for(var o=r+1;;){var a=e.foresee(o);{if(!i.isObject(a)||"invalid"!=a.type)break;n+=a.value,o+=a.length}}if(""!=n)return n={type:s.token.invalid,value:n,length:n.length},e.inForesee||e.errorHandler(new Error(s.error.message.invalidToken),{token:n},s.error.severity.error),n}function o(){return n}var i=t(1),s=t(4);e.exports=o},function(e,r,t){"use strict";e.exports.autodetect=t(12),e.exports.string=t(13),e.exports.object=t(14),e.exports.json=t(19)},function(e,r,t){"use strict";function n(e){return o.extend({threadcount:""},o.isString(e)?JSON.parse(e):e)}var o=t(1);e.exports=n,Object.defineProperty(e.exports,"id",{enumerable:!0,value:"json"}),Object.defineProperty(e.exports,"name",{enumerable:!0,value:"JSON"})},function(e,r,t){"use strict";function n(e){if(e.colorFormat=a.trim((""+e.colorFormat).toLowerCase()),["long","short","both"].indexOf(e.colorFormat)==-1&&(e.colorFormat=c.colorFormat),e.colorPrefix instanceof RegExp?e.colorPrefix=e.colorPrefix.source:a.isString(e.colorPrefix)||(e.colorPrefix=""),e.colorSuffix instanceof RegExp?e.colorSuffix=e.colorSuffix.source:a.isString(e.colorSuffix)||(e.colorSuffix=""),e.commentSuffix instanceof RegExp){var r=e.commentSuffix.ignoreCase?"i":"";e.commentSuffix=new RegExp("^"+e.commentSuffix.source,r)}else e.commentSuffix=null;return e.commentFormat instanceof RegExp||(e.commentFormat=null),e}function o(e){var r=["^"],t="[a-z]";switch(e.allowLongNames&&(t+="{1,100}"),r.push("("+t+")"),r.push("("+e.colorPrefix+")"),e.colorFormat){case"long":r.push("([0-9a-f]{6})");break;case"short":r.push("([0-9a-f]{3})");break;case"both":r.push("([0-9a-f]{6}|[0-9a-f]{3})")}return r.push(e.colorSuffix),new RegExp(r.join(""),"i")}function i(e,r,t,n){var o,i,s,c=e.source;if(i=c.substr(r,200),o=t.exec(i)){var f={type:u.token.color,name:o[1].toUpperCase(),color:u.color.normalizeColor(o[3]),comment:"",length:o[0].length};if(!e.inForesee){if(n.allowComment){var l=r+f.length;if(n.commentSuffix&&n.requireCommentSuffix){for(s=l;s<c.length;s++)if(i=c.substr(s,10),o=n.commentSuffix.exec(i)){f.comment=c.substr(l,s-l+o[0].length);break}s>=c.length&&(f.comment=c.substr(l,c.length))}else{var p=["whitespace","invalid"];for(s=l;s<c.length;s++){if(i=c.substr(s,10),o=n.commentSuffix.exec(i)){f.comment=c.substr(l,s-l+o[0].length);break}var m=e.foresee(s);if(a.isObject(m)&&p.indexOf(m.type)==-1){f.comment=c.substr(l,s-l);break}}s>=c.length&&(f.comment=c.substr(l,c.length))}}f.length+=f.comment.length,n.commentFormat&&(o=n.commentFormat.exec(f.comment),o&&a.isString(o[1])&&(f.comment=o[1])),f.comment=a.trim(f.comment)}return f}}function s(e){e=n(a.extend({},c,e));var r=o(e);return function(t,n){return i(t,n,r,e)}}var a=t(1),u=t(4),c={allowLongNames:!0,colorPrefix:/[=]?[#]/,colorSuffix:/;?/,colorFormat:"both",allowComment:!1,commentSuffix:/;/,requireCommentSuffix:!0,commentFormat:/^\s*(.*)\s*;\s*$/};e.exports=s},function(e,r,t){"use strict";function n(e){var r=["^"],t="[a-z]";return e.allowLongNames&&(t+="{1,100}"),r.push("("+t+")"),r.push("([0-9]+)"),new RegExp(r.join(""),"i")}function o(e,r,t,n){var o=e.source,i=t.exec(o.substr(r,20));if(i){var s=parseInt(i[2],10)||0;s<0&&(s=0);var u={type:a.token.stripe,name:i[1].toUpperCase(),count:s,length:i[0].length};return 0==u.count&&e.errorHandler(new Error(a.error.message.zeroWidthStripe),{token:u},a.error.severity.warning),u}}function i(e){e=s.extend({},u,e);var r=n(e);return function(t,n){return o(t,n,r,e)}}var s=t(1),a=t(4),u={allowLongNames:!0};e.exports=i},function(e,r,t){"use strict";function n(e){var r=["^"],t="[a-z]";return e.allowLongNames&&(t+="{1,100}"),r.push("("+t+")"),r.push("/([0-9]+)"),new RegExp(r.join(""),"i")}function o(e,r,t,n){var o=e.source,i=t.exec(o.substr(r,20));if(i){var s=parseInt(i[2],10)||0;s<0&&(s=0);var u={type:a.token.pivot,name:i[1].toUpperCase(),count:s,length:i[0].length};return 0==u.count&&e.errorHandler(new Error(a.error.message.zeroWidthStripe),{token:u},a.error.severity.warning),u}}function i(e){e=s.extend({},u,e);var r=n(e);return function(t,n){return o(t,n,r,e)}}var s=t(1),a=t(4),u={allowLongNames:!0};e.exports=i},function(e,r,t){"use strict";function n(e,r,t){var n=e.source,o=null,a=!1,f=!1;if(t.allowAsPrefix&&(o=u.exec(n.substr(r,20)),a=!!o),t.allowAsSuffix&&!o&&(o=c.exec(n.substr(r,20)),f=!!o),o){var l=parseInt(o[1],10)||0;l<=0&&(l=1);var p={type:s.token.repeat,count:l>=1?l:1,isPrefix:a,isSuffix:f,length:o[0].length};return l<1&&e.errorHandler(new Error(s.error.message.invalidMultiplier),{token:i.extend({},p,{count:l})},s.error.severity.warning),p}}function o(e){return e=i.extend({},a,e),function(r,t){return n(r,t,e)}}var i=t(1),s=t(4),a={allowAsPrefix:!0,allowAsSuffix:!0},u=/^([0-9]+)\s*[*]/i,c=/^[*]\s*([0-9]+)/i;e.exports=o},function(e,r,t){"use strict";function n(e,r,t){var n=e.source;if(""!=t.string){var o=n.substr(r,t.string.length),i=t.ignoreCase?o.toUpperCase():o;if(i==t.string)return{type:s.token.literal,value:o,length:o.length}}}function o(e){return i.isString(e)&&(e={string:e}),e=i.extend({},a,e),i.isString(e.string)||(e.string=""),e.ignoreCase&&(e.string=e.string.toUpperCase()),function(r,t){return n(r,t,e)}}var i=t(1),s=t(4),a={string:"",ignoreCase:!1};e.exports=o},function(e,r,t){"use strict";function n(e){return e=o.filter(e,o.isFunction),function(r){if(o.isArray(r))for(var t=0;t<e.length;t++)r=e[t](r);return r}}var o=t(1);e.exports=n,e.exports.classify=t(26),e.exports.removeTokens=t(27)},function(e,r,t){"use strict";function n(e,r,t){return!1}function o(e,r){return s.map(e,function(t,n){var o=s.clone(t);return s.each(r,function(r,i){o[i]=r(t,n,e)}),o})}function i(e){return e=s.extend({},c,e),s.each(c,function(r,t){s.isFunction(e[t])||(e[t]=n)}),function(r){return o(r,e)}}var s=t(1),a=t(4),u=t(3),c={isColor:function(e,r,t){return a.token.isColor(e)},isStripe:function(e,r,t){return a.token.isStripe(e)},isPivot:function(e,r,t){return a.token.isPivot(e)},isRepeat:function(e,r,t){return a.token.isRepeat(e)},isWarpAndWeftSeparator:function(e,r,t){return a.token.isLiteral(e)&&e.value==u.warpAndWeftSeparator},isBlockStart:function(e,r,t){return a.token.isOpeningSquareBracket(e)||a.token.isOpeningParenthesis(e)},isBlockEnd:function(e,r,t){return a.token.isClosingSquareBracket(e)||a.token.isClosingParenthesis(e)}};e.exports=i},function(e,r,t){"use strict";function n(e){return i.isFunction(e)?e:(i.isArray(e)||(e=s.insignificantTokens),function(r){return!i.isObject(r)||e.indexOf(r.type)>=0})}function o(e){var r=n(e);return function(e){return i.filter(e,function(e){return!r(e)})}}var i=t(1),s=t(3);e.exports=o},function(e,r,t){"use strict";function n(e){return e=o.filter(e,o.isFunction),function(r){return o.isObject(r)&&o.each(e,function(e){r=e(r)}),r}}var o=t(1);e.exports=n,e.exports.flatten=t(29),e.exports.fold=t(30)},function(e,r,t){"use strict";function n(e){var r=[];return s.each(e.items,function(e){e.isBlock?(e=n(e),[].push.apply(r,e.items)):r.push(e)}),e=s.clone(e),e.items=r,a.sett.reflectAndRepeat(e)}function o(e){var r=s.clone(e),t=e.warp==e.weft;return s.isObject(e.warp)&&(r.warp=n(e.warp)),s.isObject(e.weft)&&(t?r.weft=r.warp:r.weft=n(e.weft)),r}function i(){return o}var s=t(1),a=t(4);e.exports=i},function(e,r,t){"use strict";function n(e){if(!(e.length<5||e.length%2!=1)){for(var r,t,n=[],o=0,i=e.length-1;;){if(r=e[o],t=e[i],!c.node.isSameNode(r,t))return;if(n.push(r),o==i)break;o++,i--}return n}}function o(e,r,t){if(!e.reflect&&0!=e.items.length){var o=u.concat(e.items,e.items[0]),i=n(o);if(u.isArray(i)){var s=u.clone(e);s.items=i,s.reflect=!0,t.push({node:s,hash:c.node.calculateNodeHash(s),weight:r.calculateNodeWeight(s)})}}}function i(e,r,t){var n=[];return o(e,r,n),n.push({node:e,hash:c.node.calculateNodeHash(e),weight:r.calculateNodeWeight(e)}),n}function s(e,r){var t=u.clone(e),n=e.warp===e.weft;return u.isObject(e.warp)&&(t.warpVariants=i(e.warp,r,!0)),u.isObject(e.weft)&&(n?t.weftVariants=t.warpVariants:t.weftVariants=i(e.weft,r,!0)),t.warp=u.first(t.warpVariants).node,t.weft=u.first(t.weftVariants).node,t}function a(e){return e=u.extend({},f,e),function(r){return s(r,e)}}var u=t(1),c=t(4),f={calculateNodeWeight:c.node.calculateNodeWeight};e.exports=a},function(e,r,t){"use strict";e.exports.classic=t(32)},function(e,r,t){"use strict";function n(e,r){var t=[],n=!1,o=null,i=null;return e.length>=2&&(o=s.first(e),i=s.last(e),o.isPivot&&i.isPivot&&(n=!0)),s.each(e,function(e){return e.isStripe?void t.push(a.node.newStripe(e)):e.isPivot?!n||e!==o&&e!==i?(r.errorHandler(new Error(a.error.message.orphanedPivot),{token:e},a.error.severity.warning),void t.push(a.node.newStripe(e))):void t.push(a.node.newStripe(e)):void r.errorHandler(new Error(a.error.message.unexpectedToken),{token:e},a.error.severity.error)}),a.node.newRootBlock(t,n)}function o(e,r){if(!s.isArray(e))return e;if(s.isFunction(r.processTokens)&&(e=r.processTokens(e),!s.isArray(e)))return e;var t=[],o=[],i=[],u=o;s.each(e,function(e){return e.isColor?void t.push(e):void(e.isWarpAndWeftSeparator?(u===i&&r.errorHandler(new Error(a.error.message.multipleWarpAnWeftSeparator),{token:e},a.error.severity.warning),u=i):u.push(e))}),0==o.length&&(o=i,i=[]),0==i.length&&(i=o);var c={};return c.colors=a.color.buildColorMap(t),c.warp=n(o,r),i===o?c.weft=c.warp:c.weft=n(i,r),s.isFunction(r.transformSyntaxTree)&&(c=r.transformSyntaxTree(c)),c}function i(e){return e=s.extend({},u,e),s.isFunction(e.errorHandler)||(e.errorHandler=u.errorHandler),function(r){return o(r,e)}}var s=t(1),a=t(4),u={errorHandler:function(e,r,t){},processTokens:null,transformSyntaxTree:null};e.exports=i},function(e,r,t){"use strict";e.exports.format=t(34)},function(e,r,t){"use strict";function n(e,r,t){var n=a.extend({},t.defaultColors),o=a.intersection(a.keys(r),a.keys(e));t.includeUnusedColors&&(o=a.keys(r)),t.includeDefaultColors&&(o=a.union(a.keys(r),a.keys(e)));var i=t.format;return a.isFunction(i.color)?a.chain(o).sortBy().map(function(e){var t=r[e]||n[e];return t?i.color(a.extend({name:e},t)):null}).filter(function(e){return a.isString(e)&&e.length>0}).value():[]}function o(e,r,t){var n=r.format;return a.isFunction(n.stripe)&&a.isFunction(n.block)?(e=a.clone(e),e.formattedItems=a.chain(e.items).map(function(e){return e.isStripe?(t[e.name]=!0,n.stripe(e)):e.isBlock?o(e,r,t):""}).filter(function(e){return e.length>0}).value(),a.isFunction(n.block)?n.block(e):""):""}function i(e,r){var t=e.warp===e.weft,i={},s=o(e.warp,r,i),u=s;t||(u=o(e.weft,r,i));var c=n(i,e.colors,r);return a.trim(r.join({colors:c,warp:s,weft:u},e))}function s(e){return e=a.merge({},u,e),function(r){return a.isObject(r)?(a.isFunction(e.transformSyntaxTree)&&(r=e.transformSyntaxTree(r)),i(r,e)):""}}var a=t(1),u={transformSyntaxTree:null,format:{color:function(e){var r=""!=e.comment?" "+e.comment:"";return e.name+e.value+r+";"},stripe:function(e){return e.name+e.count},block:function(e){var r=a.chain(e.formattedItems).join(" ").trim().value();if(""==r)return"";var t=e.repeat>1?"*"+e.repeat:"";return r=e.isRoot?e.reflect?"["+r+"]":r:e.reflect?"["+r+"]":"("+r+")",r+t}},join:function(e){var r=[];return e.colors.length>0&&r.push(e.colors.join(" ")),e.warp!=e.weft?r.push(e.warp+" // "+e.weft):r.push(e.warp),r.join("\n")},defaultColors:{},includeUnusedColors:!0,includeDefaultColors:!0};e.exports=s},function(e,r,t){"use strict";e.exports.classic=t(36)},function(e,r,t){"use strict";var n=t(3);e.exports.id="classic",e.exports.name="Classic (strict syntax)",e.exports.parse=t(37),e.exports.format=t(38),e.exports.colors=n.colors,e.exports.warpAndWeftSeparator=n.warpAndWeftSeparator},function(e,r,t){"use strict";function n(e){return e=o.extend({},e),o.isString(e.warpAndWeftSeparator)||(e.warpAndWeftSeparator=""),""==e.warpAndWeftSeparator&&(e.warpAndWeftSeparator=i.warpAndWeftSeparator),a([a.pivot(),a.stripe(),a.literal(e.warpAndWeftSeparator),a.color({allowLongNames:!0,colorPrefix:/[=]?[#]/,colorSuffix:null,colorFormat:"long",allowComment:!0,commentSuffix:/;/,requireCommentSuffix:!0,commentFormat:/^\s*(.*)\s*;\s*$/})],{errorHandler:e.errorHandler,processTokens:u([e.processTokens,u.removeTokens(s.insignificantTokens)]),buildSyntaxTree:c.classic({errorHandler:e.errorHandler,processTokens:u.classify({isWarpAndWeftSeparator:function(r){return f.token.isLiteral(r)&&r.value==e.warpAndWeftSeparator}}),transformSyntaxTree:e.transformSyntaxTree})})}var o=t(1),i=t(36),s=t(3),a=t(11),u=t(25),c=t(31),f=t(4);e.exports=n},function(e,r,t){"use strict";function n(e){return e.replace(/^([a-z]+)([0-9]+)$/i,"$1/$2")}function o(e){return e=i.extend({},e,c),i.isString(e.warpAndWeftSeparator)||(e.warpAndWeftSeparator=""),""==e.warpAndWeftSeparator&&(e.warpAndWeftSeparator=s.warpAndWeftSeparator),e.transformSyntaxTree=u([e.transformSyntaxTree,u.flatten(),u.fold({allowRootReorder:!1,allowNestedBlocks:!1,maxFoldLevels:2,minBlockSize:3,greedy:!1,allowSplitStripe:!1,processExistingBlocks:!1})]),e.join=function(r){var t=[];return r.colors.length>0&&t.push(r.colors.join(" ")),r.warp!=r.weft?t.push(r.warp+" "+e.warpAndWeftSeparator+" "+r.weft):t.push(r.warp),t.join("\n")},a.format(e)}var i=t(1),s=t(36),a=t(33),u=t(28),c={format:{color:function(e){var r=""!=e.comment?" "+e.comment:"";return e.name+e.value+r+";"},stripe:function(e){return e.name+e.count},block:function(e){var r=e.formattedItems;return e.reflect&&r.length>=2&&(r[0]=n(r[0]),r[r.length-1]=n(r[r.length-1])),i.chain(r).join(" ").trim().value()}}};e.exports=o}])});
//# sourceMappingURL=tartan.min.js.map
{
"name": "tartan",
"version": "5.0.0",
"version": "5.0.1",
"description": "This library allows to parse tartan threadcount.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -11,3 +11,3 @@ 'use strict';

while (true) {
var chunk = source.substr(offset, chunkSize);
var chunk = source.substr(offset + result.length, chunkSize);
var matches = pattern.exec(chunk);

@@ -14,0 +14,0 @@ if (!matches) {

@@ -53,2 +53,8 @@ 'use strict';

result.flush = function() {
result.cancel();
repaint();
return this;
};
result.cancel = function() {

@@ -55,0 +61,0 @@ if (callbackId) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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