Last active
August 29, 2015 14:13
-
-
Save doowb/675b0d33b678533d14eb to your computer and use it in GitHub Desktop.
requirebin sketch - https://github.com/jonschlinkert/template dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require() some stuff from npm (like you were using browserify) | |
// and then hit Rebuild to run it on the rightvar | |
// dependencies | |
var styles = require('ansi-styles'); | |
var flatten = require('arr-flatten'); | |
var slice = require('array-slice'); | |
var compact = require('arrayify-compact'); | |
var chalk = require('chalk'); | |
var clone = require('clone-deep'); | |
var Config = require('config-cache'); | |
var debug = require('debug'); | |
var delims = require('delims'); | |
var Route = require('en-route'); | |
var Engine = require('engine-cache'); | |
var engineLodash = require('engine-lodash'); | |
var extend = require('extend-shallow'); | |
var forOwn = require('for-own'); | |
var globby = require('globby'); | |
var Helper = require('helper-cache'); | |
var kind = require('kind-of'); | |
var Layouts = require('layouts'); | |
//var Loader = require('load-templates'); // error from `coffee-script` module | |
var mixin = require('mixin-deep'); | |
var reduce = require('object.reduce'); | |
var parser = require('parser-front-matter'); | |
// devDepdencies | |
var async = require("async"); | |
var bluebird = require("bluebird"); | |
// var consolidate = require("consolidate"); // error from `jade` module | |
var coveralls = requier("coveralls"); | |
var engineHandlebars = require("engine-handlebars"); | |
// var engines = require("engines"); // error from `jade` module | |
var es = require("event-stream"); | |
var glob = require("glob"); | |
var gIstanbul = require("gulp-istanbul"); | |
//var gJshint = require("gulp-jshint"); // error from `daemon` module | |
//var gMocha = require("gulp-mocha"); // error from `./runnable` | |
var Handlebars = require("handlebars"); | |
var istanbul = require("istanbul"); | |
var _ = require("lodash"); | |
// var mocha = require("mocha"); // error from `./runnable` | |
var preserve = require("preserve"); | |
var should = require("should"); | |
var swig = require("swig"); | |
// var verb = require("verb"); // error from `coffee-script` module | |
var vPrettify = require("verb-prettify"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({"arr-flatten":[function(require,module,exports){"use strict";module.exports=function flatten(arr){return flat(arr,[])};function flat(arr,res){var len=arr.length;var i=-1;while(len--){var cur=arr[++i];if(Array.isArray(cur)){flat(cur,res)}else{res.push(cur)}}return res}},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({"ansi-styles":[function(require,module,exports){"use strict";var styles=module.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]}};styles.colors.grey=styles.colors.gray;Object.keys(styles).forEach(function(groupName){var group=styles[groupName];Object.keys(group).forEach(function(styleName){var style=group[styleName];styles[styleName]=group[styleName]={open:"["+style[0]+"m",close:"["+style[1]+"m"}});Object.defineProperty(styles,groupName,{value:group,enumerable:false})})},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({"array-slice":[function(require,module,exports){"use strict";module.exports=function slice(arr,start,end){var len=arr.length>>>0;var range=[];start=idx(arr,start);end=idx(arr,end,len);while(start<end){range.push(arr[start++])}return range};function idx(arr,pos,end){var len=arr.length>>>0;if(pos==null){pos=end||0}else if(pos<0){pos=Math.max(len+pos,0)}else{pos=Math.min(pos,len)}return pos}},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){function flatten(array,result,depth){for(var i=0;i<array.length;i++){if(depth>0&&Array.isArray(array[i])){flatten(array[i],result,depth-1)}else{result.push(array[i])}}return result}module.exports=function(array,depth){return flatten(array,[],depth||Infinity)}},{}],"arrayify-compact":[function(require,module,exports){"use strict";var flatten=require("array-flatten");module.exports=function(arr){return flatten(!Array.isArray(arr)?[arr]:arr).filter(Boolean)}},{"array-flatten":1}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],2:[function(require,module,exports){"use strict";var styles=module.exports;var codes={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],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],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]};Object.keys(codes).forEach(function(key){var val=codes[key];var style=styles[key]={};style.open="["+val[0]+"m";style.close="["+val[1]+"m"})},{}],3:[function(require,module,exports){"use strict";var matchOperatorsRe=/[|\\{}()[\]^$+*?.]/g;module.exports=function(str){if(typeof str!=="string"){throw new TypeError("Expected a string")}return str.replace(matchOperatorsRe,"\\$&")}},{}],4:[function(require,module,exports){"use strict";var ansiRegex=require("ansi-regex");var re=new RegExp(ansiRegex().source);module.exports=re.test.bind(re)},{"ansi-regex":5}],5:[function(require,module,exports){"use strict";module.exports=function(){return/\u001b\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]/g}},{}],6:[function(require,module,exports){"use strict";var ansiRegex=require("ansi-regex")();module.exports=function(str){return typeof str==="string"?str.replace(ansiRegex,""):str}},{"ansi-regex":7}],7:[function(require,module,exports){arguments[4][5][0].apply(exports,arguments)},{dup:5}],8:[function(require,module,exports){(function(process){"use strict";module.exports=function(){if(process.argv.indexOf("--no-color")!==-1){return false}if(process.argv.indexOf("--color")!==-1){return true}if(process.stdout&&!process.stdout.isTTY){return false}if(process.platform==="win32"){return true}if("COLORTERM"in process.env){return true}if(process.env.TERM==="dumb"){return false}if(/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)){return true}return false}()}).call(this,require("_process"))},{_process:1}],chalk:[function(require,module,exports){"use strict";var escapeStringRegexp=require("escape-string-regexp");var ansiStyles=require("ansi-styles");var stripAnsi=require("strip-ansi");var hasAnsi=require("has-ansi");var supportsColor=require("supports-color");var defineProps=Object.defineProperties;var chalk=module.exports;function build(_styles){var builder=function builder(){return applyStyle.apply(builder,arguments)};builder._styles=_styles;builder.__proto__=proto;return builder}var styles=function(){var ret={};ansiStyles.grey=ansiStyles.gray;Object.keys(ansiStyles).forEach(function(key){ansiStyles[key].closeRe=new RegExp(escapeStringRegexp(ansiStyles[key].close),"g");ret[key]={get:function(){return build(this._styles.concat(key))}}});return ret}();var proto=defineProps(function chalk(){},styles);function applyStyle(){var args=arguments;var argsLen=args.length;var str=argsLen!==0&&String(arguments[0]);if(argsLen>1){for(var a=1;a<argsLen;a++){str+=" "+args[a]}}if(!chalk.enabled||!str){return str}var nestedStyles=this._styles;for(var i=0;i<nestedStyles.length;i++){var code=ansiStyles[nestedStyles[i]];str=code.open+str.replace(code.closeRe,code.open)+code.close}return str}function init(){var ret={};Object.keys(styles).forEach(function(name){ret[name]={get:function(){return build([name])}}});return ret}defineProps(chalk,init());chalk.styles=ansiStyles;chalk.hasColor=hasAnsi;chalk.stripColor=stripAnsi;chalk.supportsColor=supportsColor;if(chalk.enabled===undefined){chalk.enabled=chalk.supportsColor}},{"ansi-styles":2,"escape-string-regexp":3,"has-ansi":4,"strip-ansi":6,"supports-color":8}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";var forIn=require("for-in");module.exports=function forOwn(o,fn,thisArg){forIn(o,function(val,key){if(hasOwn(o,key)){return fn.call(thisArg,o[key],key,o)}})};function hasOwn(o,prop){return{}.hasOwnProperty.call(o,prop)}},{"for-in":2}],2:[function(require,module,exports){"use strict";module.exports=function forIn(o,fn,thisArg){for(var key in o){if(fn.call(thisArg,o[key],key,o)===false){break}}}},{}],3:[function(require,module,exports){"use strict";module.exports=function isPlainObject(o){return!!o&&typeof o==="object"&&o.constructor===Object}},{}],4:[function(require,module,exports){"use strict";module.exports=function typeOf(val){if(val===null){return"null"}if(val===undefined){return"undefined"}if(typeof val!=="object"){return typeof val}if(Array.isArray(val)){return"array"}return{}.toString.call(val).slice(8,-1).toLowerCase()}},{}],5:[function(require,module,exports){"use strict";var forOwn=require("for-own");module.exports=function mixIn(o){var args=[].slice.call(arguments);var len=args.length;if(o==null){return{}}if(len===0){return o}function copy(value,key){this[key]=value}for(var i=0;i<len;i++){var obj=args[i];if(obj!=null){forOwn(obj,copy,o)}}return o}},{"for-own":1}],"clone-deep":[function(require,module,exports){"use strict";var typeOf=require("kind-of");var forOwn=require("for-own");var isPlainObject=require("is-plain-object");var mixin=require("mixin-object");function cloneDeep(val,instanceClone){switch(typeOf(val)){case"object":return cloneObjectDeep(val,instanceClone);case"array":return cloneArrayDeep(val,instanceClone);default:return clone(val)}}function cloneObjectDeep(obj,instanceClone){if(isPlainObject(obj)){var res={};forOwn(obj,function(obj,key){this[key]=cloneDeep(obj,instanceClone)},res);return res}else if(instanceClone){return instanceClone(obj)}else{return obj}}function cloneArrayDeep(arr,instanceClone){var len=arr.length;var res=[];var i=-1;while(++i<len){res[i]=cloneDeep(arr[i],instanceClone)}return res}function clone(val){switch(typeOf(val)){case"object":return cloneObject(val);case"array":return cloneArray(val);case"regexp":return cloneRegExp(val);case"date":return cloneDate(val);default:return val}}function cloneObject(obj){if(isPlainObject(obj)){return mixin({},obj)}else{return obj}}function cloneRegExp(re){var flags="";flags+=re.multiline?"m":"";flags+=re.global?"g":"";flags+=re.ignorecase?"i":"";return new RegExp(re.source,flags)}function cloneDate(date){return new Date(+date)}function cloneArray(arr){return arr.slice()}module.exports=cloneDeep},{"for-own":1,"is-plain-object":3,"kind-of":4,"mixin-object":5}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){exports=module.exports=debug;exports.coerce=coerce;exports.disable=disable;exports.enable=enable;exports.enabled=enabled;exports.humanize=require("ms");exports.names=[];exports.skips=[];exports.formatters={};var prevColor=0;var prevTime;function selectColor(){return exports.colors[prevColor++%exports.colors.length]}function debug(namespace){function disabled(){}disabled.enabled=false;function enabled(){var self=enabled;var curr=+new Date;var ms=curr-(prevTime||curr);self.diff=ms;self.prev=prevTime;self.curr=curr;prevTime=curr;if(null==self.useColors)self.useColors=exports.useColors();if(null==self.color&&self.useColors)self.color=selectColor();var args=Array.prototype.slice.call(arguments);args[0]=exports.coerce(args[0]);if("string"!==typeof args[0]){args=["%o"].concat(args)}var index=0;args[0]=args[0].replace(/%([a-z%])/g,function(match,format){if(match==="%%")return match;index++;var formatter=exports.formatters[format];if("function"===typeof formatter){var val=args[index];match=formatter.call(self,val);args.splice(index,1);index--}return match});if("function"===typeof exports.formatArgs){args=exports.formatArgs.apply(self,args)}var logFn=enabled.log||exports.log||console.log.bind(console);logFn.apply(self,args)}enabled.enabled=true;var fn=exports.enabled(namespace)?enabled:disabled;fn.namespace=namespace;return fn}function enable(namespaces){exports.save(namespaces);var split=(namespaces||"").split(/[\s,]+/);var len=split.length;for(var i=0;i<len;i++){if(!split[i])continue;namespaces=split[i].replace(/\*/g,".*?");if(namespaces[0]==="-"){exports.skips.push(new RegExp("^"+namespaces.substr(1)+"$"))}else{exports.names.push(new RegExp("^"+namespaces+"$"))}}}function disable(){exports.enable("")}function enabled(name){var i,len;for(i=0,len=exports.skips.length;i<len;i++){if(exports.skips[i].test(name)){return false}}for(i=0,len=exports.names.length;i<len;i++){if(exports.names[i].test(name)){return true}}return false}function coerce(val){if(val instanceof Error)return val.stack||val.message;return val}},{ms:2}],2:[function(require,module,exports){var s=1e3;var m=s*60;var h=m*60;var d=h*24;var y=d*365.25;module.exports=function(val,options){options=options||{};if("string"==typeof val)return parse(val);return options.long?long(val):short(val)};function parse(str){var match=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);if(!match)return;var n=parseFloat(match[1]);var type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"h":return n*h;case"minutes":case"minute":case"m":return n*m;case"seconds":case"second":case"s":return n*s;case"ms":return n}}function short(ms){if(ms>=d)return Math.round(ms/d)+"d";if(ms>=h)return Math.round(ms/h)+"h";if(ms>=m)return Math.round(ms/m)+"m";if(ms>=s)return Math.round(ms/s)+"s";return ms+"ms"}function long(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(ms<n)return;if(ms<n*1.5)return Math.floor(ms/n)+" "+name;return Math.ceil(ms/n)+" "+name+"s"}},{}],debug:[function(require,module,exports){exports=module.exports=require("./debug");exports.log=log;exports.formatArgs=formatArgs;exports.save=save;exports.load=load;exports.useColors=useColors;var storage;if(typeof chrome!=="undefined"&&typeof chrome.storage!=="undefined")storage=chrome.storage.local;else storage=window.localStorage;exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function useColors(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}exports.formatters.j=function(v){return JSON.stringify(v)};function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff);if(!useColors)return args;var c="color: "+this.color;args=[args[0],c,"color: inherit"].concat(Array.prototype.slice.call(args,1));var index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if("%%"===match)return;index++;if("%c"===match){lastC=index}});args.splice(lastC,0,c);return args}function log(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{if(null==namespaces){storage.removeItem("debug")}else{storage.debug=namespaces}}catch(e){}}function load(){var r;try{r=storage.debug}catch(e){}return r}exports.enable(load())},{"./debug":1}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";var merge=require("mixin-deep");var arrayify=require("arrayify-compact");exports.escapeDelim=function(re){return re.replace(/(.)/g,"\\$1")};exports.buildRegexGroup=function(re,options){var opts=merge({escape:false,noncapture:false},options);re=arrayify(re);var len=re.length;re=len>0?re.join("|"):re;re=opts.escape===true?exports.escapeDelim(re):re;if(opts.noncapture===true||len>1){re="(?:"+re+")"}return re}},{"arrayify-compact":2,"mixin-deep":4}],2:[function(require,module,exports){"use strict";var flatten=require("array-flatten");module.exports=function(arr){return flatten(!Array.isArray(arr)?[arr]:arr).filter(Boolean)}},{"array-flatten":3}],3:[function(require,module,exports){function flatten(array,result,depth){for(var i=0;i<array.length;i++){if(depth>0&&Array.isArray(array[i])){flatten(array[i],result,depth-1)}else{result.push(array[i])}}return result}module.exports=function(array,depth){return flatten(array,[],depth||Infinity)}},{}],4:[function(require,module,exports){"use strict";var isObject=require("is-plain-object");var forOwn=require("for-own");module.exports=function deepMixin(o){var args=[].slice.call(arguments,1);var len=args.length;if(o==null){return{}}if(len===0){return o}function copy(value,key){var obj=this[key];if(isObject(value)&&isObject(obj)){deepMixin(obj,value)}else{this[key]=value}}for(var i=0;i<len;i++){var obj=args[i];if(obj!=null){forOwn(obj,copy,o)}}return o}},{"for-own":5,"is-plain-object":7}],5:[function(require,module,exports){"use strict";var forIn=require("for-in");module.exports=function forOwn(o,fn,thisArg){forIn(o,function(val,key){if(hasOwn(o,key)){return fn.call(thisArg,o[key],key,o)}})};function hasOwn(o,prop){return{}.hasOwnProperty.call(o,prop)}},{"for-in":6}],6:[function(require,module,exports){"use strict";module.exports=function forIn(o,fn,thisArg){for(var key in o){if(fn.call(thisArg,o[key],key,o)===false){break}}}},{}],7:[function(require,module,exports){"use strict";module.exports=function isPlainObject(o){return!!o&&typeof o==="object"&&o.constructor===Object}},{}],8:[function(require,module,exports){"use strict";module.exports=function pick(orig,keys){if(orig==null){return{}}if(typeof keys==="string"){keys=[].slice.call(arguments,1)}var len=keys.length;var o={};for(var i=0;i<len;i++){var key=keys[i];if(orig.hasOwnProperty(key)){o[key]=orig[key]}}return o}},{}],delims:[function(require,module,exports){"use strict";var pick=require("object-pick");var merge=require("mixin-deep");var utils=require("./lib/utils");var Delimiters=function Delimiters(delims,options){this.options=options||{};this.delims=delims||[];this.defaults=merge({},{beginning:"^",matter:"([\\s\\S]+?)",body:"([\\s\\S]+|\\s?)",end:"$",flags:""},options)};Delimiters.prototype.create=function(delims,options){if(!Array.isArray(delims)){options=delims;delims=["---","---"]}var opts=merge({},this.defaults,options);opts.body=delims[2]||opts.body||"";var open=utils.buildRegexGroup(delims[0],opts);var close=utils.buildRegexGroup(delims[1],opts);var block=opts.matter+close+opts.body+opts.end;return merge(opts,{open:open,close:close,delims:delims},{evaluate:new RegExp(opts.beginning+open+block,opts.flags),interpolate:new RegExp(opts.beginning+open+"="+block,opts.flags),escape:new RegExp(opts.beginning+open+"-"+block,opts.flags)})};Delimiters.prototype.matter=function(delims,opts){return pick(this.create(delims,opts),["evaluate"]).evaluate};Delimiters.prototype.templates=function(delims,opts){var defaults={body:"",beginning:"",end:"",flags:"g",noncapture:false};var delimiters=this.create(delims,merge(defaults,opts));return pick(delimiters,["interpolate","evaluate","escape"])};module.exports=Delimiters},{"./lib/utils":1,"mixin-deep":4,"object-pick":8}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";var slice=require("array-slice");var flatten=require("arr-flatten");var typeOf=require("kind-of");var mixin=require("utils-merge");var debug=require("debug")("router");var Route=require("./route");var Layer=require("./layer");var proto=module.exports=function(options){options=options||{};function router(file,next){router.handle(file,next)}router.__proto__=proto;router.params={};router._params=[];router.caseSensitive=options.caseSensitive;router.mergeParams=options.mergeParams;router.strict=options.strict;router.stack=[];router.methods=Array.isArray(options.methods)?options.methods:options.methods&&[options.methods]||[];decorate(router,router.methods);return router};proto.param=function(name,fn){if("function"==typeof name){this._params.push(name);return}var params=this._params;var len=params.length;var ret;if(name[0]===":"){name=name.substr(1)}for(var i=0;i<len;++i){if(ret=params[i](name,fn)){fn=ret}}if("function"!=typeof fn){throw new Error("invalid param() call for "+name+", got "+fn)}(this.params[name]=this.params[name]||[]).push(fn);return this};proto.handle=function(file,done){var self=this;file.options=file.options||{};debug("dispatching %s",file.path);var idx=0;var removed="";var slashAdded=false;var paramcalled={};var stack=self.stack;var parentParams=file.options.params;var parentPath=file.options.basePath||"";done=restore(done,file.options,"basePath","next","params");file.options.next=next;file.options.basePath=parentPath;file.options.originalPath=file.options.originalPath||file.path;next();function next(err){var layerError=err==="route"?null:err;var layer=stack[idx++];if(slashAdded){file.path=file.path.substr(1);slashAdded=false}if(removed.length!==0){file.options.basePath=parentPath;file.path=removed+file.path;removed=""}if(!layer){return done(layerError)}self.matchLayer(layer,file,function(err,path){if(err||path===undefined){return next(layerError||err)}var route=layer.route;if(route){if(layerError){return next(layerError)}var method=file.options.method;var hasMethod=route.handlesMethod(method);if(!hasMethod){return next()}file.options.route=route}file.options.params=self.mergeParams?mergeParams(layer.params,parentParams):layer.params;var layerPath=layer.path;self.processParams(layer,paramcalled,file,function(err){if(err){return next(layerError||err)}if(route){return layer.handleFile(file,next)}trimPrefix(layer,layerError,layerPath,path)})})}function trimPrefix(layer,layerError,layerPath,path){var c=path[layerPath.length];if(layerPath.length!==0){debug("trim prefix (%s) from path %s",layerPath,file.path);removed=layerPath;file.path=file.path.substr(removed.length);if(file.path[0]!=="/"){file.path="/"+file.path;slashAdded=true}file.options.basePath=parentPath+(removed[removed.length-1]==="/"?removed.substring(0,removed.length-1):removed)}debug("%s %s : %s",layer.name,layerPath,file.options.originalPath);if(layerError){layer.handleError(layerError,file,next)}else{layer.handleFile(file,next)}}};proto.matchLayer=function matchLayer(layer,file,done){var error=null;var path;try{path=file.path;if(!layer.match(path)){path=undefined}}catch(err){error=err}done(error,path)};proto.processParams=function(layer,called,file,done){var params=this.params;var keys=layer.keys;if(!keys||keys.length===0){return done()}var i=0;var name;var paramIndex=0;var key;var paramVal;var paramCallbacks;var paramCalled;function param(err){if(err){return done(err)}if(i>=keys.length){return done()}paramIndex=0;key=keys[i++];if(!key){return done()}name=key.name;paramVal=file.options.params[name];paramCallbacks=params[name];paramCalled=called[name];if(paramVal===undefined||!paramCallbacks){return param()}if(paramCalled&&(paramCalled.error||paramCalled.match===paramVal)){file.options.params[name]=paramCalled.value;return param(paramCalled.error)}called[name]=paramCalled={error:null,match:paramVal,value:paramVal};paramCallback()}function paramCallback(err){var fn=paramCallbacks[paramIndex++];paramCalled.value=file.options.params[key.name];if(err){paramCalled.error=err;param(err);return}if(!fn)return param();try{fn(file,paramCallback,paramVal,key.name)}catch(e){paramCallback(e)}}param()};proto.use=function use(fn){var offset=0;var path="/";if(typeof fn!=="function"){var arg=fn;while(Array.isArray(arg)&&arg.length!==0){arg=arg[0]}if(typeof arg!=="function"){offset=1;path=fn}}var callbacks=flatten(slice(arguments,offset));if(callbacks.length===0){throw new TypeError("Router#use() requires middleware functions")}callbacks.forEach(function(fn){if(typeof fn!=="function"){throw new TypeError("Router#use() requires middleware function but got: "+typeOf(fn))}debug("use %s %s",path,fn.name||"<anonymous>");var layer=new Layer(path,{sensitive:this.caseSensitive,strict:false,end:false},fn);layer.route=undefined;this.stack.push(layer)},this);return this};proto.route=function(path){var route=new Route(path,this.methods);var layer=new Layer(path,{sensitive:this.caseSensitive,strict:this.strict,end:true},route.dispatch.bind(route));layer.route=route;this.stack.push(layer);return route};var decorate=function(router,methods){methods.concat(["all"]).forEach(function(method){router[method]=function(path){var route=this.route(path);route[method].apply(route,slice(arguments,1));return this}})};function mergeParams(params,parent){if(typeof parent!=="object"||!parent){return params}var obj=mixin({},parent);if(!(0 in params)||!(0 in parent)){return mixin(obj,params)}var i=0;var o=0;while(i===o||o in parent){if(i in params)i++;if(o in parent)o++}for(i--;i>=0;i--){params[i+o]=params[i];if(i<o){delete params[i]}}return mixin(parent,params)}function restore(fn,obj){var props=new Array(arguments.length-2);var vals=new Array(arguments.length-2);for(var i=0;i<props.length;i++){props[i]=arguments[i+2];vals[i]=obj[props[i]]}return function(err){for(var i=0;i<props.length;i++){obj[props[i]]=vals[i]}return fn.apply(this,arguments)}}},{"./layer":2,"./route":3,"arr-flatten":5,"array-slice":6,debug:7,"kind-of":10,"utils-merge":12}],2:[function(require,module,exports){var pathRegexp=require("path-to-regexp");var debug=require("debug")("router:layer");var utils=require("./utils");module.exports=Layer;function Layer(path,options,fn){if(!(this instanceof Layer)){return new Layer(path,options,fn)}debug("new %s",path);options=options||{};this.handle=fn;this.name=fn.name||"<anonymous>";this.params=undefined;this.path=undefined;this.regexp=pathRegexp(path,this.keys=[],options);if(path==="/"&&options.end===false){this.regexp.fast_slash=true}}Layer.prototype.handleError=function handleError(error,file,next){var fn=this.handle;if(fn.length!==3){return next(error)}try{fn(error,file,next)}catch(err){next(err)}};Layer.prototype.handleFile=function handleFile(file,next){var fn=this.handle;if(fn.length>2){return next()}try{fn(file,next)}catch(err){next(err)}};Layer.prototype.match=function match(path){if(path==null){this.params=undefined;this.path=undefined;return false}if(this.regexp.fast_slash){this.params={};this.path="";return true}var m=this.regexp.exec(path);if(!m){this.params=undefined;this.path=undefined;return false}this.params={};this.path=m[0];var keys=this.keys;var params=this.params;var prop;var n=0;var key;var val;for(var i=1,len=m.length;i<len;++i){key=keys[i-1];prop=key?key.name:n++;val=utils.decodeParam(m[i]);if(val!==undefined||!{}.hasOwnProperty.call(params,prop)){params[prop]=val}}return true}},{"./utils":4,debug:7,"path-to-regexp":11}],3:[function(require,module,exports){"use strict";var debug=require("debug")("router:route");var slice=require("array-slice");var flatten=require("arr-flatten");var Layer=require("./layer");module.exports=Route;function Route(path,methods){debug("new %s",path);this.path=path;this.stack=[];this.methods={};decorate(this,methods||[])}Route.prototype.handlesMethod=function handlesMethod(method){if(this.methods._all){return true}method=method&&method.toLowerCase();return Boolean(this.methods[method])};Route.prototype.dispatch=function dispatch(file,done){var idx=0;var stack=this.stack;if(stack.length===0){return done()}file.options=file.options||{};var method=file.options.method&&file.options.method.toLowerCase();file.options.route=this;next();function next(err){if(err&&err==="route"){return done()}var layer=stack[idx++];if(!layer){return done(err)}if(layer.method&&layer.method!==method){return next(err)}if(err){layer.handleError(err,file,next)}else{layer.handleFile(file,next)}}};Route.prototype.all=function all(){var callbacks=flatten(slice(arguments));callbacks.forEach(function(fn){if(typeof fn!=="function"){var type={}.toString.call(fn);var msg="Route.all() requires callback functions but got a "+type;throw new Error(msg)}var layer=Layer("/",{},fn);layer.method=undefined;this.methods._all=true;this.stack.push(layer)},this);return this};var decorate=function(route,methods){methods.forEach(function(method){route[method]=function(){var callbacks=flatten(slice(arguments));callbacks.forEach(function(fn){if(typeof fn!=="function"){var type={}.toString.call(fn);var msg="route."+method+"() requires callback functions but got a "+type;throw new Error(msg)}method=method&&method.toLowerCase();debug("%s %s",method,this.path);var layer=new Layer("/",{},fn);layer.method=method;this.methods[method]=true;this.stack.push(layer)},this);return this}})}},{"./layer":2,"arr-flatten":5,"array-slice":6,debug:7}],4:[function(require,module,exports){"use strict";exports.decodeParam=function decodeParam(val){if(typeof val!=="string"){return val}try{return decodeURIComponent(val)}catch(e){var err=new TypeError("Failed to decode param '"+val+"'"); | |
err.status=400;throw err}}},{}],5:[function(require,module,exports){"use strict";module.exports=function flatten(arr){return flat(arr,[])};function flat(arr,res){var len=arr.length;var num=0;while(len--){var i=num++;if(Array.isArray(arr[i])){flat(arr[i],res)}else{res.push(arr[i])}}return res}},{}],6:[function(require,module,exports){"use strict";module.exports=function slice(arr,start,end){var len=arr.length>>>0;var range=[];start=idx(arr,start);end=idx(arr,end,len);while(start<end){range.push(arr[start++])}return range};function idx(arr,pos,end){var len=arr.length>>>0;if(pos==null){pos=end||0}else if(pos<0){pos=Math.max(len+pos,0)}else{pos=Math.min(pos,len)}return pos}},{}],7:[function(require,module,exports){exports=module.exports=require("./debug");exports.log=log;exports.formatArgs=formatArgs;exports.save=save;exports.load=load;exports.useColors=useColors;exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function useColors(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}exports.formatters.j=function(v){return JSON.stringify(v)};function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff);if(!useColors)return args;var c="color: "+this.color;args=[args[0],c,"color: inherit"].concat(Array.prototype.slice.call(args,1));var index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if("%%"===match)return;index++;if("%c"===match){lastC=index}});args.splice(lastC,0,c);return args}function log(){return"object"==typeof console&&"function"==typeof console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{if(null==namespaces){localStorage.removeItem("debug")}else{localStorage.debug=namespaces}}catch(e){}}function load(){var r;try{r=localStorage.debug}catch(e){}return r}exports.enable(load())},{"./debug":8}],8:[function(require,module,exports){exports=module.exports=debug;exports.coerce=coerce;exports.disable=disable;exports.enable=enable;exports.enabled=enabled;exports.humanize=require("ms");exports.names=[];exports.skips=[];exports.formatters={};var prevColor=0;var prevTime;function selectColor(){return exports.colors[prevColor++%exports.colors.length]}function debug(namespace){function disabled(){}disabled.enabled=false;function enabled(){var self=enabled;var curr=+new Date;var ms=curr-(prevTime||curr);self.diff=ms;self.prev=prevTime;self.curr=curr;prevTime=curr;if(null==self.useColors)self.useColors=exports.useColors();if(null==self.color&&self.useColors)self.color=selectColor();var args=Array.prototype.slice.call(arguments);args[0]=exports.coerce(args[0]);if("string"!==typeof args[0]){args=["%o"].concat(args)}var index=0;args[0]=args[0].replace(/%([a-z%])/g,function(match,format){if(match==="%%")return match;index++;var formatter=exports.formatters[format];if("function"===typeof formatter){var val=args[index];match=formatter.call(self,val);args.splice(index,1);index--}return match});if("function"===typeof exports.formatArgs){args=exports.formatArgs.apply(self,args)}var logFn=enabled.log||exports.log||console.log.bind(console);logFn.apply(self,args)}enabled.enabled=true;var fn=exports.enabled(namespace)?enabled:disabled;fn.namespace=namespace;return fn}function enable(namespaces){exports.save(namespaces);var split=(namespaces||"").split(/[\s,]+/);var len=split.length;for(var i=0;i<len;i++){if(!split[i])continue;namespaces=split[i].replace(/\*/g,".*?");if(namespaces[0]==="-"){exports.skips.push(new RegExp("^"+namespaces.substr(1)+"$"))}else{exports.names.push(new RegExp("^"+namespaces+"$"))}}}function disable(){exports.enable("")}function enabled(name){var i,len;for(i=0,len=exports.skips.length;i<len;i++){if(exports.skips[i].test(name)){return false}}for(i=0,len=exports.names.length;i<len;i++){if(exports.names[i].test(name)){return true}}return false}function coerce(val){if(val instanceof Error)return val.stack||val.message;return val}},{ms:9}],9:[function(require,module,exports){var s=1e3;var m=s*60;var h=m*60;var d=h*24;var y=d*365.25;module.exports=function(val,options){options=options||{};if("string"==typeof val)return parse(val);return options.long?long(val):short(val)};function parse(str){var match=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);if(!match)return;var n=parseFloat(match[1]);var type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"h":return n*h;case"minutes":case"minute":case"m":return n*m;case"seconds":case"second":case"s":return n*s;case"ms":return n}}function short(ms){if(ms>=d)return Math.round(ms/d)+"d";if(ms>=h)return Math.round(ms/h)+"h";if(ms>=m)return Math.round(ms/m)+"m";if(ms>=s)return Math.round(ms/s)+"s";return ms+"ms"}function long(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(ms<n)return;if(ms<n*1.5)return Math.floor(ms/n)+" "+name;return Math.ceil(ms/n)+" "+name+"s"}},{}],10:[function(require,module,exports){"use strict";module.exports=function typeOf(val){if(val===null){return"null"}if(val===undefined){return"undefined"}if(typeof val!=="object"){return typeof val}if(Array.isArray(val)){return"array"}return{}.toString.call(val).slice(8,-1).toLowerCase()}},{}],11:[function(require,module,exports){module.exports=pathtoRegexp;var PATH_REGEXP=new RegExp(["(\\\\.)","([\\/.])?(?:\\:(\\w+)(?:\\(((?:\\\\.|[^)])*)\\))?|\\(((?:\\\\.|[^)])*)\\))([+*?])?","([.+*?=^!:${}()[\\]|\\/])"].join("|"),"g");function escapeGroup(group){return group.replace(/([=!:$\/()])/g,"\\$1")}var attachKeys=function(re,keys){re.keys=keys;return re};function pathtoRegexp(path,keys,options){if(keys&&!Array.isArray(keys)){options=keys;keys=null}keys=keys||[];options=options||{};var strict=options.strict;var end=options.end!==false;var flags=options.sensitive?"":"i";var index=0;if(path instanceof RegExp){var groups=path.source.match(/\((?!\?)/g)||[];keys.push.apply(keys,groups.map(function(match,index){return{name:index,delimiter:null,optional:false,repeat:false}}));return attachKeys(path,keys)}if(Array.isArray(path)){path=path.map(function(value){return pathtoRegexp(value,keys,options).source});return attachKeys(new RegExp("(?:"+path.join("|")+")",flags),keys)}path=path.replace(PATH_REGEXP,function(match,escaped,prefix,key,capture,group,suffix,escape){if(escaped){return escaped}if(escape){return"\\"+escape}var repeat=suffix==="+"||suffix==="*";var optional=suffix==="?"||suffix==="*";keys.push({name:key||index++,delimiter:prefix||"/",optional:optional,repeat:repeat});prefix=prefix?"\\"+prefix:"";capture=escapeGroup(capture||group||"[^"+(prefix||"\\/")+"]+?");if(repeat){capture=capture+"(?:"+prefix+capture+")*"}if(optional){return"(?:"+prefix+"("+capture+"))?"}return prefix+"("+capture+")"});var endsWithSlash=path[path.length-1]==="/";if(!strict){path=(endsWithSlash?path.slice(0,-2):path)+"(?:\\/(?=$))?"}if(!end){path+=strict&&endsWithSlash?"":"(?=\\/|$)"}return attachKeys(new RegExp("^"+path+(end?"$":""),flags),keys)}},{}],12:[function(require,module,exports){exports=module.exports=function(a,b){if(a&&b){for(var key in b){a[key]=b[key]}}return a}},{}],"en-route":[function(require,module,exports){"use strict";var Route=require("./lib/route");var Router=require("./lib");module.exports.Route=Route;module.exports.Router=Router},{"./lib":1,"./lib/route":3}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:3}],3:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],4:[function(require,module,exports){"use strict";var escapeStringRegexp=require("escape-string-regexp");var ansiStyles=require("ansi-styles");var stripAnsi=require("strip-ansi");var hasAnsi=require("has-ansi");var supportsColor=require("supports-color");var defineProps=Object.defineProperties;var chalk=module.exports;function build(_styles){var builder=function builder(){return applyStyle.apply(builder,arguments)};builder._styles=_styles;builder.__proto__=proto;return builder}var styles=function(){var ret={};ansiStyles.grey=ansiStyles.gray;Object.keys(ansiStyles).forEach(function(key){ansiStyles[key].closeRe=new RegExp(escapeStringRegexp(ansiStyles[key].close),"g");ret[key]={get:function(){return build(this._styles.concat(key))}}});return ret}();var proto=defineProps(function chalk(){},styles);function applyStyle(){var args=arguments;var argsLen=args.length;var str=argsLen!==0&&String(arguments[0]);if(argsLen>1){for(var a=1;a<argsLen;a++){str+=" "+args[a]}}if(!chalk.enabled||!str){return str}var nestedStyles=this._styles;for(var i=0;i<nestedStyles.length;i++){var code=ansiStyles[nestedStyles[i]];str=code.open+str.replace(code.closeRe,code.open)+code.close}return str}function init(){var ret={};Object.keys(styles).forEach(function(name){ret[name]={get:function(){return build([name])}}});return ret}defineProps(chalk,init());chalk.styles=ansiStyles;chalk.hasColor=hasAnsi;chalk.stripColor=stripAnsi;chalk.supportsColor=supportsColor;if(chalk.enabled===undefined){chalk.enabled=chalk.supportsColor}},{"ansi-styles":5,"escape-string-regexp":6,"has-ansi":7,"strip-ansi":9,"supports-color":11}],5:[function(require,module,exports){"use strict";var styles=module.exports;var codes={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],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],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]};Object.keys(codes).forEach(function(key){var val=codes[key];var style=styles[key]={};style.open="["+val[0]+"m";style.close="["+val[1]+"m"})},{}],6:[function(require,module,exports){"use strict";var matchOperatorsRe=/[|\\{}()[\]^$+*?.]/g;module.exports=function(str){if(typeof str!=="string"){throw new TypeError("Expected a string")}return str.replace(matchOperatorsRe,"\\$&")}},{}],7:[function(require,module,exports){"use strict";var ansiRegex=require("ansi-regex");var re=new RegExp(ansiRegex().source);module.exports=re.test.bind(re)},{"ansi-regex":8}],8:[function(require,module,exports){"use strict";module.exports=function(){return/\u001b\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]/g}},{}],9:[function(require,module,exports){"use strict";var ansiRegex=require("ansi-regex")();module.exports=function(str){return typeof str==="string"?str.replace(ansiRegex,""):str}},{"ansi-regex":10}],10:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],11:[function(require,module,exports){(function(process){"use strict";module.exports=function(){if(process.argv.indexOf("--no-color")!==-1){return false}if(process.argv.indexOf("--color")!==-1){return true}if(process.stdout&&!process.stdout.isTTY){return false}if(process.platform==="win32"){return true}if("COLORTERM"in process.env){return true}if(process.env.TERM==="dumb"){return false}if(/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)){return true}return false}()}).call(this,require("_process"))},{_process:3}],12:[function(require,module,exports){exports=module.exports=require("./debug");exports.log=log;exports.formatArgs=formatArgs;exports.save=save;exports.load=load;exports.useColors=useColors;var storage;if(typeof chrome!=="undefined"&&typeof chrome.storage!=="undefined")storage=chrome.storage.local;else storage=window.localStorage;exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function useColors(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}exports.formatters.j=function(v){return JSON.stringify(v)};function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff);if(!useColors)return args;var c="color: "+this.color;args=[args[0],c,"color: inherit"].concat(Array.prototype.slice.call(args,1));var index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if("%%"===match)return;index++;if("%c"===match){lastC=index}});args.splice(lastC,0,c);return args}function log(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{if(null==namespaces){storage.removeItem("debug")}else{storage.debug=namespaces}}catch(e){}}function load(){var r;try{r=storage.debug}catch(e){}return r}exports.enable(load())},{"./debug":13}],13:[function(require,module,exports){exports=module.exports=debug;exports.coerce=coerce;exports.disable=disable;exports.enable=enable;exports.enabled=enabled;exports.humanize=require("ms");exports.names=[];exports.skips=[];exports.formatters={};var prevColor=0;var prevTime;function selectColor(){return exports.colors[prevColor++%exports.colors.length]}function debug(namespace){function disabled(){}disabled.enabled=false;function enabled(){var self=enabled;var curr=+new Date;var ms=curr-(prevTime||curr);self.diff=ms;self.prev=prevTime;self.curr=curr;prevTime=curr;if(null==self.useColors)self.useColors=exports.useColors();if(null==self.color&&self.useColors)self.color=selectColor();var args=Array.prototype.slice.call(arguments);args[0]=exports.coerce(args[0]);if("string"!==typeof args[0]){args=["%o"].concat(args)}var index=0;args[0]=args[0].replace(/%([a-z%])/g,function(match,format){if(match==="%%")return match;index++;var formatter=exports.formatters[format];if("function"===typeof formatter){var val=args[index];match=formatter.call(self,val);args.splice(index,1);index--}return match});if("function"===typeof exports.formatArgs){args=exports.formatArgs.apply(self,args)}var logFn=enabled.log||exports.log||console.log.bind(console);logFn.apply(self,args)}enabled.enabled=true;var fn=exports.enabled(namespace)?enabled:disabled;fn.namespace=namespace;return fn}function enable(namespaces){exports.save(namespaces);var split=(namespaces||"").split(/[\s,]+/);var len=split.length;for(var i=0;i<len;i++){if(!split[i])continue;namespaces=split[i].replace(/\*/g,".*?");if(namespaces[0]==="-"){exports.skips.push(new RegExp("^"+namespaces.substr(1)+"$"))}else{exports.names.push(new RegExp("^"+namespaces+"$"))}}}function disable(){exports.enable("")}function enabled(name){var i,len;for(i=0,len=exports.skips.length;i<len;i++){if(exports.skips[i].test(name)){return false}}for(i=0,len=exports.names.length;i<len;i++){if(exports.names[i].test(name)){return true}}return false}function coerce(val){if(val instanceof Error)return val.stack||val.message;return val}},{ms:14}],14:[function(require,module,exports){var s=1e3;var m=s*60;var h=m*60;var d=h*24;var y=d*365.25;module.exports=function(val,options){options=options||{};if("string"==typeof val)return parse(val);return options.long?long(val):short(val)};function parse(str){var match=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);if(!match)return;var n=parseFloat(match[1]);var type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"h":return n*h;case"minutes":case"minute":case"m":return n*m;case"seconds":case"second":case"s":return n*s;case"ms":return n}}function short(ms){if(ms>=d)return Math.round(ms/d)+"d";if(ms>=h)return Math.round(ms/h)+"h";if(ms>=m)return Math.round(ms/m)+"m";if(ms>=s)return Math.round(ms/s)+"s";return ms+"ms"}function long(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(ms<n)return;if(ms<n*1.5)return Math.floor(ms/n)+" "+name;return Math.ceil(ms/n)+" "+name+"s"}},{}],15:[function(require,module,exports){"use strict";var pick=require("object-pick");var merge=require("mixin-deep");var utils=require("./lib/utils");var Delimiters=function Delimiters(delims,options){this.options=options||{};this.delims=delims||[];this.defaults=merge({},{beginning:"^",matter:"([\\s\\S]+?)",body:"([\\s\\S]+|\\s?)",end:"$",flags:""},options)};Delimiters.prototype.create=function(delims,options){if(!Array.isArray(delims)){options=delims;delims=["---","---"]}var opts=merge({},this.defaults,options);opts.body=delims[2]||opts.body||"";var open=utils.buildRegexGroup(delims[0],opts);var close=utils.buildRegexGroup(delims[1],opts);var block=opts.matter+close+opts.body+opts.end;return merge(opts,{open:open,close:close,delims:delims},{evaluate:new RegExp(opts.beginning+open+block,opts.flags),interpolate:new RegExp(opts.beginning+open+"="+block,opts.flags),escape:new RegExp(opts.beginning+open+"-"+block,opts.flags)})};Delimiters.prototype.matter=function(delims,opts){return pick(this.create(delims,opts),["evaluate"]).evaluate};Delimiters.prototype.templates=function(delims,opts){var defaults={body:"",beginning:"",end:"",flags:"g",noncapture:false};var delimiters=this.create(delims,merge(defaults,opts));return pick(delimiters,["interpolate","evaluate","escape"])};module.exports=Delimiters},{"./lib/utils":16,"mixin-deep":19,"object-pick":23}],16:[function(require,module,exports){"use strict";var merge=require("mixin-deep");var arrayify=require("arrayify-compact");exports.escapeDelim=function(re){return re.replace(/(.)/g,"\\$1")};exports.buildRegexGroup=function(re,options){var opts=merge({escape:false,noncapture:false},options);re=arrayify(re);var len=re.length;re=len>0?re.join("|"):re;re=opts.escape===true?exports.escapeDelim(re):re;if(opts.noncapture===true||len>1){re="(?:"+re+")"}return re}},{"arrayify-compact":17,"mixin-deep":19}],17:[function(require,module,exports){"use strict";var flatten=require("array-flatten");module.exports=function(arr){return flatten(!Array.isArray(arr)?[arr]:arr).filter(Boolean)}},{"array-flatten":18}],18:[function(require,module,exports){function flatten(array,result,depth){for(var i=0;i<array.length;i++){if(depth>0&&Array.isArray(array[i])){flatten(array[i],result,depth-1)}else{result.push(array[i])}}return result}module.exports=function(array,depth){return flatten(array,[],depth||Infinity)}},{}],19:[function(require,module,exports){"use strict";var isObject=require("is-plain-object");var forOwn=require("for-own");module.exports=function deepMixin(o){var args=[].slice.call(arguments,1);var len=args.length;if(o==null){return{}}if(len===0){return o}function copy(value,key){var obj=this[key];if(isObject(value)&&isObject(obj)){deepMixin(obj,value)}else{this[key]=value}}for(var i=0;i<len;i++){var obj=args[i];if(obj!=null){forOwn(obj,copy,o)}}return o}},{"for-own":20,"is-plain-object":22}],20:[function(require,module,exports){"use strict";var forIn=require("for-in");module.exports=function forOwn(o,fn,thisArg){forIn(o,function(val,key){if(hasOwn(o,key)){return fn.call(thisArg,o[key],key,o)}})};function hasOwn(o,prop){return{}.hasOwnProperty.call(o,prop)}},{"for-in":21}],21:[function(require,module,exports){"use strict";module.exports=function forIn(o,fn,thisArg){for(var key in o){if(fn.call(thisArg,o[key],key,o)===false){break}}}},{}],22:[function(require,module,exports){"use strict";module.exports=function isPlainObject(o){return!!o&&typeof o==="object"&&o.constructor===Object}},{}],23:[function(require,module,exports){"use strict";module.exports=function pick(orig,keys){if(orig==null){return{}}if(typeof keys==="string"){keys=[].slice.call(arguments,1)}var len=keys.length;var o={};for(var i=0;i<len;i++){var key=keys[i];if(orig.hasOwnProperty(key)){o[key]=orig[key]}}return o}},{}],24:[function(require,module,exports){"use strict";var fs=require("fs");var path=require("path");var readCache={};exports.requires={};var cacheStore={};exports.clearCache=function(){cacheStore={}};exports.cache=function cache(options,compiled){if(compiled&&options.filename&&options.cache){delete readCache[options.filename];cacheStore[options.filename]=compiled;return compiled}if(options.filename&&options.cache){return cacheStore[options.filename]}return compiled};function read(path,options,callback){var str=readCache[path];var cached=options.cache&&str&&"string"===typeof str;if(cached){return callback(null,str)}fs.readFile(path,"utf8",function(err,str){if(err){return callback(err)}str=str.replace(/^\uFEFF/,"");if(options.cache){readCache[path]=str}callback(null,str)})}exports.readPartials=function(filepath,options,callback){if(!options.partials){return callback()}var partials=options.partials;var keys=Object.keys(partials);function next(index){if(index===keys.length){return callback(null)}var key=keys[index];var file=path.join(path.dirname(filepath),partials[key]+path.extname(filepath));read(file,options,function(err,str){if(err){return callback(err)}options.partials[key]=str;next(++index)})}next(0)};exports.fromStringRenderer=function(name){return function(path,options,callback){options.filename=path;exports.readPartials(path,options,function(err){if(err){return callback(err)}if(exports.cache(options)){exports[name].render("",options,callback)}else{read(path,options,function(err,str){if(err){return callback(err)}exports[name].render(str,options,callback)})}})}}},{fs:1,path:2}],25:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index<length){if(array[index]===value){return index}}return-1}function cacheIndexOf(cache,value){var type=typeof value;cache=cache.cache;if(type=="boolean"||value==null){return cache[value]?0:-1}if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value;cache=(cache=cache[type])&&cache[key];return type=="object"?cache&&baseIndexOf(cache,value)>-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++index<length){var value=ac[index],other=bc[index];if(value!==other){if(value>other||typeof value=="undefined"){return 1}if(value<other||typeof other=="undefined"){return-1}}}return a.index-b.index}function createCache(array){var index=-1,length=array.length,first=array[0],mid=array[length/2|0],last=array[length-1];if(first&&typeof first=="object"&&mid&&typeof mid=="object"&&last&&typeof last=="object"){return false}var cache=getObject();cache["false"]=cache["null"]=cache["true"]=cache["undefined"]=false;var result=getObject();result.array=array;result.cache=cache;result.push=cachePush;while(++index<length){result.push(array[index])}return result}function escapeStringChar(match){return"\\"+stringEscapes[match]}function getArray(){return arrayPool.pop()||[]}function getObject(){return objectPool.pop()||{array:null,cache:null,criteria:null,"false":false,index:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,value:null}}function releaseArray(array){array.length=0;if(arrayPool.length<maxPoolSize){arrayPool.push(array)}}function releaseObject(object){var cache=object.cache;if(cache){releaseObject(cache)}object.array=object.cache=object.criteria=object.object=object.number=object.string=object.value=null;if(objectPool.length<maxPoolSize){objectPool.push(object)}}function slice(array,start,end){start||(start=0);if(typeof end=="undefined"){end=array?array.length:0}var index=-1,length=end-start||0,result=Array(length<0?0:length);while(++index<length){result[index]=array[start+index]}return result}function runInContext(context){context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Boolean=context.Boolean,Date=context.Date,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;var arrayRef=[];var objectProto=Object.prototype;var oldDash=context._;var toString=objectProto.toString;var reNative=RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");var ceil=Math.ceil,clearTimeout=context.clearTimeout,floor=Math.floor,fnToString=Function.prototype.toString,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,hasOwnProperty=objectProto.hasOwnProperty,push=arrayRef.push,setTimeout=context.setTimeout,splice=arrayRef.splice,unshift=arrayRef.unshift; | |
var defineProperty=function(){try{var o={},func=isNative(func=Object.defineProperty)&&func,result=func(o,o,o)&&func}catch(e){}return result}();var nativeCreate=isNative(nativeCreate=Object.create)&&nativeCreate,nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeIsFinite=context.isFinite,nativeIsNaN=context.isNaN,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,nativeParseInt=context.parseInt,nativeRandom=Math.random;var ctorByClass={};ctorByClass[arrayClass]=Array;ctorByClass[boolClass]=Boolean;ctorByClass[dateClass]=Date;ctorByClass[funcClass]=Function;ctorByClass[objectClass]=Object;ctorByClass[numberClass]=Number;ctorByClass[regexpClass]=RegExp;ctorByClass[stringClass]=String;function lodash(value){return value&&typeof value=="object"&&!isArray(value)&&hasOwnProperty.call(value,"__wrapped__")?value:new lodashWrapper(value)}function lodashWrapper(value,chainAll){this.__chain__=!!chainAll;this.__wrapped__=value}lodashWrapper.prototype=lodash.prototype;var support=lodash.support={};support.funcDecomp=!isNative(context.WinRTError)&&reThis.test(runInContext);support.funcNames=typeof Function.name=="string";lodash.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length<arity){bitmask|=16&~32;return baseCreateWrapper([func,isCurryBound?bitmask:bitmask&~3,args,null,thisArg,arity])}}args||(args=arguments);if(isBindKey){func=thisBinding[key]}if(this instanceof bound){thisBinding=baseCreate(func.prototype);var result=func.apply(thisBinding,args);return isObject(result)?result:thisBinding}return func.apply(thisBinding,args)}setBindData(bound,bindData);return bound}function baseDifference(array,values){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,isLarge=length>=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index<length){var value=array[index];if(indexOf(values,value)<0){result.push(value)}}if(isLarge){releaseObject(values)}return result}function baseFlatten(array,isShallow,isStrict,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value&&typeof value=="object"&&typeof value.length=="number"&&(isArray(value)||isArguments(value))){if(!isShallow){value=baseFlatten(value,isShallow,isStrict)}var valIndex=-1,valLength=value.length,resIndex=result.length;result.length+=valLength;while(++valIndex<valLength){result[resIndex++]=value[valIndex]}}else if(!isStrict){result.push(value)}}return result}function baseIsEqual(a,b,callback,isWhere,stackA,stackB){if(callback){var result=callback(a,b);if(typeof result!="undefined"){return!!result}}if(a===b){return a!==0||1/a==1/b}var type=typeof a,otherType=typeof b;if(a===a&&!(a&&objectTypes[type])&&!(b&&objectTypes[otherType])){return false}if(a==null||b==null){return a===b}var className=toString.call(a),otherClass=toString.call(b);if(className==argsClass){className=objectClass}if(otherClass==argsClass){otherClass=objectClass}if(className!=otherClass){return false}switch(className){case boolClass:case dateClass:return+a==+b;case numberClass:return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case regexpClass:case stringClass:return a==String(b)}var isArr=className==arrayClass;if(!isArr){var aWrapped=hasOwnProperty.call(a,"__wrapped__"),bWrapped=hasOwnProperty.call(b,"__wrapped__");if(aWrapped||bWrapped){return baseIsEqual(aWrapped?a.__wrapped__:a,bWrapped?b.__wrapped__:b,callback,isWhere,stackA,stackB)}if(className!=objectClass){return false}var ctorA=a.constructor,ctorB=b.constructor;if(ctorA!=ctorB&&!(isFunction(ctorA)&&ctorA instanceof ctorA&&isFunction(ctorB)&&ctorB instanceof ctorB)&&("constructor"in a&&"constructor"in b)){return false}}var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==a){return stackB[length]==b}}var size=0;result=true;stackA.push(a);stackB.push(b);if(isArr){length=a.length;size=b.length;result=size==length;if(result||isWhere){while(size--){var index=length,value=b[size];if(isWhere){while(index--){if(result=baseIsEqual(a[index],value,callback,isWhere,stackA,stackB)){break}}}else if(!(result=baseIsEqual(a[size],value,callback,isWhere,stackA,stackB))){break}}}}else{forIn(b,function(value,key,b){if(hasOwnProperty.call(b,key)){size++;return result=hasOwnProperty.call(a,key)&&baseIsEqual(a[key],value,callback,isWhere,stackA,stackB)}});if(result&&!isWhere){forIn(a,function(value,key,a){if(hasOwnProperty.call(a,key)){return result=--size>-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index<length){var value=array[index],computed=callback?callback(value,index,array):value;if(isSorted?!index||seen[seen.length-1]!==computed:indexOf(seen,computed)<0){if(callback||isLarge){seen.push(computed)}result.push(value)}}if(isLarge){releaseArray(seen.array);releaseObject(seen)}else if(callback){releaseArray(seen)}return result}function createAggregator(setter){return function(collection,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];setter(result,value,callback(value,index,collection),collection)}}else{forOwn(collection,function(value,key,collection){setter(result,value,callback(value,key,collection),collection)})}return result}}function createWrapper(func,bitmask,partialArgs,partialRightArgs,thisArg,arity){var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,isPartial=bitmask&16,isPartialRight=bitmask&32;if(!isBindKey&&!isFunction(func)){throw new TypeError}if(isPartial&&!partialArgs.length){bitmask&=~16;isPartial=partialArgs=false}if(isPartialRight&&!partialRightArgs.length){bitmask&=~32;isPartialRight=partialRightArgs=false}var bindData=func&&func.__bindData__;if(bindData&&bindData!==true){bindData=slice(bindData);if(bindData[2]){bindData[2]=slice(bindData[2])}if(bindData[3]){bindData[3]=slice(bindData[3])}if(isBind&&!(bindData[1]&1)){bindData[4]=thisArg}if(!isBind&&bindData[1]&1){bitmask|=8}if(isCurry&&!(bindData[1]&4)){bindData[5]=arity}if(isPartial){push.apply(bindData[2]||(bindData[2]=[]),partialArgs)}if(isPartialRight){unshift.apply(bindData[3]||(bindData[3]=[]),partialRightArgs)}bindData[1]|=bitmask;return createWrapper.apply(null,bindData)}var creater=bitmask==1||bitmask===17?baseBind:baseCreateWrapper;return creater([func,bitmask,partialArgs,partialRightArgs,thisArg,arity])}function escapeHtmlChar(match){return htmlEscapes[match]}function getIndexOf(){var result=(result=lodash.indexOf)===indexOf?baseIndexOf:result;return result}function isNative(value){return typeof value=="function"&&reNative.test(value)}var setBindData=!defineProperty?noop:function(func,value){descriptor.value=value;defineProperty(func,"__bindData__",descriptor)};function shimIsPlainObject(value){var ctor,result;if(!(value&&toString.call(value)==objectClass)||(ctor=value.constructor,isFunction(ctor)&&!(ctor instanceof ctor))){return false}forIn(value,function(value,key){result=key});return typeof result=="undefined"||hasOwnProperty.call(value,result)}function unescapeHtmlChar(match){return htmlUnescapes[match]}function isArguments(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==argsClass||false}var isArray=nativeIsArray||function(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==arrayClass||false};var shimKeys=function(object){var index,iterable=object,result=[];if(!iterable)return result;if(!objectTypes[typeof object])return result;for(index in iterable){if(hasOwnProperty.call(iterable,index)){result.push(index)}}return result};var keys=!nativeKeys?shimKeys:function(object){if(!isObject(object)){return[]}return nativeKeys(object)};var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];result[index]=callback?callback(result[index],iterable[index]):iterable[index]}}}return result};function clone(value,isDeep,callback,thisArg){if(typeof isDeep!="boolean"&&isDeep!=null){thisArg=callback;callback=isDeep;isDeep=false}return baseClone(value,isDeep,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function cloneDeep(value,callback,thisArg){return baseClone(value,true,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function create(prototype,properties){var result=baseCreate(prototype);return properties?assign(result,properties):result}var defaults=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(typeof result[index]=="undefined")result[index]=iterable[index]}}}return result};function findKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}function findLastKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwnRight(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}var forIn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);for(index in iterable){if(callback(iterable[index],index,collection)===false)return result}return result};function forInRight(object,callback,thisArg){var pairs=[];forIn(object,function(value,key){pairs.push(key,value)});var length=pairs.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){if(callback(pairs[length--],pairs[length],object)===false){break}}return object}var forOwn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(callback(iterable[index],index,collection)===false)return result}return result};function forOwnRight(object,callback,thisArg){var props=keys(object),length=props.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){var key=props[length];if(callback(object[key],key,object)===false){break}}return object}function functions(object){var result=[];forIn(object,function(value,key){if(isFunction(value)){result.push(key)}});return result.sort()}function has(object,key){return object?hasOwnProperty.call(object,key):false}function invert(object){var index=-1,props=keys(object),length=props.length,result={};while(++index<length){var key=props[index];result[object[key]]=key}return result}function isBoolean(value){return value===true||value===false||value&&typeof value=="object"&&toString.call(value)==boolClass||false}function isDate(value){return value&&typeof value=="object"&&toString.call(value)==dateClass||false}function isElement(value){return value&&value.nodeType===1||false}function isEmpty(value){var result=true;if(!value){return result}var className=toString.call(value),length=value.length;if(className==arrayClass||className==stringClass||className==argsClass||className==objectClass&&typeof length=="number"&&isFunction(value.splice)){return!length}forOwn(value,function(){return result=false});return result}function isEqual(a,b,callback,thisArg){return baseIsEqual(a,b,typeof callback=="function"&&baseCreateCallback(callback,thisArg,2))}function isFinite(value){return nativeIsFinite(value)&&!nativeIsNaN(parseFloat(value))}function isFunction(value){return typeof value=="function"}function isObject(value){return!!(value&&objectTypes[typeof value])}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||value&&typeof value=="object"&&toString.call(value)==numberClass||false}var isPlainObject=!getPrototypeOf?shimIsPlainObject:function(value){if(!(value&&toString.call(value)==objectClass)){return false}var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)};function isRegExp(value){return value&&typeof value=="object"&&toString.call(value)==regexpClass||false}function isString(value){return typeof value=="string"||value&&typeof value=="object"&&toString.call(value)==stringClass||false}function isUndefined(value){return typeof value=="undefined"}function mapValues(object,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){result[key]=callback(value,key,object)});return result}function merge(object){var args=arguments,length=2;if(!isObject(object)){return object}if(typeof args[2]!="number"){length=args.length}if(length>3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index<length){baseMerge(object,sources[index],callback,stackA,stackB)}releaseArray(stackA);releaseArray(stackB);return object}function omit(object,callback,thisArg){var result={};if(typeof callback!="function"){var props=[];forIn(object,function(value,key){props.push(key)});props=baseDifference(props,baseFlatten(arguments,true,false,1));var index=-1,length=props.length;while(++index<length){var key=props[index];result[key]=object[key]}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(!callback(value,key,object)){result[key]=value}})}return result}function pairs(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}function pick(object,callback,thisArg){var result={};if(typeof callback!="function"){var index=-1,props=baseFlatten(arguments,true,false,1),length=isObject(object)?props.length:0;while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(callback(value,key,object)){result[key]=value}})}return result}function transform(object,callback,accumulator,thisArg){var isArr=isArray(object);if(accumulator==null){if(isArr){accumulator=[]}else{var ctor=object&&object.constructor,proto=ctor&&ctor.prototype;accumulator=baseCreate(proto)}}if(callback){callback=lodash.createCallback(callback,thisArg,4);(isArr?forEach:forOwn)(object,function(value,index,object){return callback(accumulator,value,index,object)})}return accumulator}function values(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){result[index]=object[props[index]]}return result}function at(collection){var args=arguments,index=-1,props=baseFlatten(args,true,false,1),length=args[2]&&args[2][args[1]]===collection?1:props.length,result=Array(length);while(++index<length){result[index]=collection[props[index]]}return result}function contains(collection,target,fromIndex){var index=-1,indexOf=getIndexOf(),length=collection?collection.length:0,result=false;fromIndex=(fromIndex<0?nativeMax(0,length+fromIndex):fromIndex)||0;if(isArray(collection)){result=indexOf(collection,target,fromIndex)>-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(!(result=!!callback(collection[index],index,collection))){break}}}else{forOwn(collection,function(value,index,collection){return result=!!callback(value,index,collection)})}return result}function filter(collection,callback,thisArg){var result=[];callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){result.push(value)}}}else{forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result.push(value)}})}return result}function find(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){return value}}}else{var result;forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}}function findLast(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forEachRight(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}function forEach(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(++index<length){if(callback(collection[index],index,collection)===false){break}}}else{forOwn(collection,callback)}return collection}function forEachRight(collection,callback,thisArg){var length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(length--){if(callback(collection[length],length,collection)===false){break}}}else{var props=keys(collection);length=props.length;forOwn(collection,function(value,key,collection){key=props?props[--length]:--length;return callback(collection[key],key,collection)})}return collection}var groupBy=createAggregator(function(result,value,key){(hasOwnProperty.call(result,key)?result[key]:result[key]=[]).push(value)});var indexBy=createAggregator(function(result,value,key){result[key]=value});function invoke(collection,methodName){var args=slice(arguments,2),index=-1,isFunc=typeof methodName=="function",length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){result[++index]=(isFunc?methodName:value[methodName]).apply(value,args)});return result}function map(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=lodash.createCallback(callback,thisArg,3);if(typeof length=="number"){var result=Array(length);while(++index<length){result[index]=callback(collection[index],index,collection)}}else{result=[];forOwn(collection,function(value,key,collection){result[++index]=callback(value,key,collection)})}return result}function max(collection,callback,thisArg){var computed=-Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value>result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value<result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current<computed){computed=current;result=value}})}return result}var pluck=map;function reduce(collection,callback,accumulator,thisArg){if(!collection)return accumulator;var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);var index=-1,length=collection.length;if(typeof length=="number"){if(noaccum){accumulator=collection[++index]}while(++index<length){accumulator=callback(accumulator,collection[index],index,collection)}}else{forOwn(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)})}return accumulator}function reduceRight(collection,callback,accumulator,thisArg){var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);forEachRight(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)});return accumulator}function reject(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);return filter(collection,function(value,index,collection){return!callback(value,index,collection)})}function sample(collection,n,guard){if(collection&&typeof collection.length!="number"){collection=values(collection)}if(n==null||guard){return collection?collection[baseRandom(0,collection.length-1)]:undefined}var result=shuffle(collection);result.length=nativeMin(nativeMax(0,n),result.length);return result}function shuffle(collection){var index=-1,length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){var rand=baseRandom(0,++index);result[index]=result[rand];result[rand]=value});return result}function size(collection){var length=collection?collection.length:0;return typeof length=="number"?length:keys(collection).length}function some(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(result=callback(collection[index],index,collection)){break}}}else{forOwn(collection,function(value,index,collection){return!(result=callback(value,index,collection))})}return!!result}function sortBy(collection,callback,thisArg){var index=-1,isArr=isArray(callback),length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);if(!isArr){callback=lodash.createCallback(callback,thisArg,3)}forEach(collection,function(value,key,collection){var object=result[++index]=getObject();if(isArr){object.criteria=map(callback,function(key){return value[key]})}else{(object.criteria=getArray())[0]=callback(value,key,collection)}object.index=index;object.value=value});length=result.length;result.sort(compareAscending);while(length--){var object=result[length];result[length]=object.value;if(!isArr){releaseArray(object.criteria)}releaseObject(object)}return result}function toArray(collection){if(collection&&typeof collection.length=="number"){return slice(collection)}return values(collection)}var where=filter;function compact(array){var index=-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value){result.push(value)}}return result}function difference(array){return baseDifference(array,baseFlatten(arguments,true,true,1))}function findIndex(array,callback,thisArg){var index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length){if(callback(array[index],index,array)){return index}}return-1}function findLastIndex(array,callback,thisArg){var length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(length--){if(callback(array[length],length,array)){return length}}return-1}function first(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=-1;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[0]:undefined}}return slice(array,0,nativeMin(nativeMax(0,n),length))}function flatten(array,isShallow,callback,thisArg){if(typeof isShallow!="boolean"&&isShallow!=null){thisArg=callback;callback=typeof isShallow!="function"&&thisArg&&thisArg[isShallow]===array?null:isShallow;isShallow=false}if(callback!=null){array=map(array,callback,thisArg)}return baseFlatten(array,isShallow)}function indexOf(array,value,fromIndex){if(typeof fromIndex=="number"){var length=array?array.length:0;fromIndex=fromIndex<0?nativeMax(0,length+fromIndex):fromIndex||0}else if(fromIndex){var index=sortedIndex(array,value);return array[index]===value?index:-1}return baseIndexOf(array,value,fromIndex)}function initial(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:callback||n}return slice(array,0,nativeMin(nativeMax(0,length-n),length))}function intersection(){var args=[],argsIndex=-1,argsLength=arguments.length,caches=getArray(),indexOf=getIndexOf(),trustIndexOf=indexOf===baseIndexOf,seen=getArray();while(++argsIndex<argsLength){var value=arguments[argsIndex];if(isArray(value)||isArguments(value)){args.push(value);caches.push(trustIndexOf&&value.length>=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[]; | |
outer:while(++index<length){var cache=caches[0];value=array[index];if((cache?cacheIndexOf(cache,value):indexOf(seen,value))<0){argsIndex=argsLength;(cache||seen).push(value);while(--argsIndex){cache=caches[argsIndex];if((cache?cacheIndexOf(cache,value):indexOf(args[argsIndex],value))<0){continue outer}}result.push(value)}}while(argsLength--){cache=caches[argsLength];if(cache){releaseObject(cache)}}releaseArray(caches);releaseArray(seen);return result}function last(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[length-1]:undefined}}return slice(array,nativeMax(0,length-n))}function lastIndexOf(array,value,fromIndex){var index=array?array.length:0;if(typeof fromIndex=="number"){index=(fromIndex<0?nativeMax(0,index+fromIndex):nativeMin(fromIndex,index-1))+1}while(index--){if(array[index]===value){return index}}return-1}function pull(array){var args=arguments,argsIndex=0,argsLength=args.length,length=array?array.length:0;while(++argsIndex<argsLength){var index=-1,value=args[argsIndex];while(++index<length){if(array[index]===value){splice.call(array,index--,1);length--}}}return array}function range(start,end,step){start=+start||0;step=typeof step=="number"?step:+step||1;if(end==null){end=start;start=0}var index=-1,length=nativeMax(0,ceil((end-start)/(step||1))),result=Array(length);while(++index<length){result[index]=start;start+=step}return result}function remove(array,callback,thisArg){var index=-1,length=array?array.length:0,result=[];callback=lodash.createCallback(callback,thisArg,3);while(++index<length){var value=array[index];if(callback(value,index,array)){result.push(value);splice.call(array,index--,1);length--}}return result}function rest(array,callback,thisArg){if(typeof callback!="number"&&callback!=null){var n=0,index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:nativeMax(0,callback)}return slice(array,n)}function sortedIndex(array,value,callback,thisArg){var low=0,high=array?array.length:low;callback=callback?lodash.createCallback(callback,thisArg,1):identity;value=callback(value);while(low<high){var mid=low+high>>>1;callback(array[mid])<value?low=mid+1:high=mid}return low}function union(){return baseUniq(baseFlatten(arguments,true,true))}function uniq(array,isSorted,callback,thisArg){if(typeof isSorted!="boolean"&&isSorted!=null){thisArg=callback;callback=typeof isSorted!="function"&&thisArg&&thisArg[isSorted]===array?null:isSorted;isSorted=false}if(callback!=null){callback=lodash.createCallback(callback,thisArg,3)}return baseUniq(array,isSorted,callback)}function without(array){return baseDifference(array,slice(arguments,1))}function xor(){var index=-1,length=arguments.length;while(++index<length){var array=arguments[index];if(isArray(array)||isArguments(array)){var result=result?baseUniq(baseDifference(result,array).concat(baseDifference(array,result))):array}}return result||[]}function zip(){var array=arguments.length>1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index<length){result[index]=pluck(array,index)}return result}function zipObject(keys,values){var index=-1,length=keys?keys.length:0,result={};if(!values&&length&&!isArray(keys[0])){values=[]}while(++index<length){var key=keys[index];if(values){result[key]=values[index]}else if(key){result[key[0]]=key[1]}}return result}function after(n,func){if(!isFunction(func)){throw new TypeError}return function(){if(--n<1){return func.apply(this,arguments)}}}function bind(func,thisArg){return arguments.length>2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index<length){var key=funcs[index];object[key]=createWrapper(object[key],1,null,null,object)}return object}function bindKey(object,key){return arguments.length>2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index<n){result[index]=callback(index)}return result}function unescape(string){return string==null?"":String(string).replace(reEscapedHtml,unescapeHtmlChar)}function uniqueId(prefix){var id=++idCounter;return String(prefix==null?"":prefix)+id}function chain(value){value=new lodashWrapper(value);value.__chain__=true;return value}function tap(value,interceptor){interceptor(value);return value}function wrapperChain(){this.__chain__=true;return this}function wrapperToString(){return String(this.__wrapped__)}function wrapperValueOf(){return this.__wrapped__}lodash.after=after;lodash.assign=assign;lodash.at=at;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.chain=chain;lodash.compact=compact;lodash.compose=compose;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.createCallback=createCallback;lodash.curry=curry;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.filter=filter;lodash.flatten=flatten;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.functions=functions;lodash.groupBy=groupBy;lodash.indexBy=indexBy;lodash.initial=initial;lodash.intersection=intersection;lodash.invert=invert;lodash.invoke=invoke;lodash.keys=keys;lodash.map=map;lodash.mapValues=mapValues;lodash.max=max;lodash.memoize=memoize;lodash.merge=merge;lodash.min=min;lodash.omit=omit;lodash.once=once;lodash.pairs=pairs;lodash.partial=partial;lodash.partialRight=partialRight;lodash.pick=pick;lodash.pluck=pluck;lodash.property=property;lodash.pull=pull;lodash.range=range;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.shuffle=shuffle;lodash.sortBy=sortBy;lodash.tap=tap;lodash.throttle=throttle;lodash.times=times;lodash.toArray=toArray;lodash.transform=transform;lodash.union=union;lodash.uniq=uniq;lodash.values=values;lodash.where=where;lodash.without=without;lodash.wrap=wrap;lodash.xor=xor;lodash.zip=zip;lodash.zipObject=zipObject;lodash.collect=map;lodash.drop=rest;lodash.each=forEach;lodash.eachRight=forEachRight;lodash.extend=assign;lodash.methods=functions;lodash.object=zipObject;lodash.select=filter;lodash.tail=rest;lodash.unique=uniq;lodash.unzip=zip;mixin(lodash);lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.contains=contains;lodash.escape=escape;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.has=has;lodash.identity=identity;lodash.indexOf=indexOf;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isBoolean=isBoolean;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isNaN=isNaN;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isString=isString;lodash.isUndefined=isUndefined;lodash.lastIndexOf=lastIndexOf;lodash.mixin=mixin;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.result=result;lodash.runInContext=runInContext;lodash.size=size;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.template=template;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.all=every;lodash.any=some;lodash.detect=find;lodash.findWhere=find;lodash.foldl=reduce;lodash.foldr=reduceRight;lodash.include=contains;lodash.inject=reduce;mixin(function(){var source={};forOwn(lodash,function(func,methodName){if(!lodash.prototype[methodName]){source[methodName]=func}});return source}(),false);lodash.first=first;lodash.last=last;lodash.sample=sample;lodash.take=first;lodash.head=first;forOwn(lodash,function(func,methodName){var callbackable=methodName!=="sample";if(!lodash.prototype[methodName]){lodash.prototype[methodName]=function(n,guard){var chainAll=this.__chain__,result=func(this.__wrapped__,n,guard);return!chainAll&&(n==null||guard&&!(callbackable&&typeof n=="function"))?result:new lodashWrapper(result,chainAll)}}});lodash.VERSION="2.4.1";lodash.prototype.chain=wrapperChain;lodash.prototype.toString=wrapperToString;lodash.prototype.value=wrapperValueOf;lodash.prototype.valueOf=wrapperValueOf;forEach(["join","pop","shift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){var chainAll=this.__chain__,result=func.apply(this.__wrapped__,arguments);return chainAll?new lodashWrapper(result,chainAll):result}});forEach(["push","reverse","sort","unshift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){func.apply(this.__wrapped__,arguments);return this}});forEach(["concat","slice","splice"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){return new lodashWrapper(func.apply(this.__wrapped__,arguments),this.__chain__)}});return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],"engine-lodash":[function(require,module,exports){"use strict";var fs=require("fs");var utils=require("engine-utils");var debug=require("debug")("engine:lodash");var chalk=require("chalk");var Delimiters=require("delims");var delimiters=new Delimiters;var _=require("lodash");var engine=utils.fromStringRenderer("lodash");engine.render=function lodashRender(str,options,cb){if(typeof options==="function"){cb=options;options={}}options=options||{};if(options.mixins){_.mixin(options.mixins)}var delims=_.pick(options,["interpolate","evaluate","escape"]);var opts=_.omit(options,["helpers","imports"]);var fns=_.pick(options,["helpers","imports"]);var settings={};if(options.delims){delims=_.merge({},delimiters.templates(options.delims),delims)}settings.imports=_.extend({},fns.helpers,fns.imports);settings=_.extend({},settings,delims);if(options.debugEngine){var helpers=Object.keys(settings.imports);for(var key in opts){if(helpers.indexOf(key)!==-1){console.log(chalk.yellow('[engine-lodash] property "'+key+'" is on both:'));console.log(chalk.yellow(" - settings.imports as a(n): ",typeof settings.imports[key]));console.log(chalk.yellow(" - options as a(n): ",typeof options[key]))}}}opts=_.merge({},opts,settings.imports);try{cb(null,_.template(str,opts,settings),".html")}catch(err){console.log(chalk.red("%j"),err);debug("engine lodash [render]: %j",err);cb(err)}};engine.renderSync=function lodashRenderSync(str,options){var opts=_.merge({},options);var settings={};_.merge(settings,opts);_.merge(settings,opts.settings);settings.imports=opts.imports||opts.helpers||{};if(opts.mixins){_.mixin(opts.mixins)}if(opts.delims){var delims=delimiters.templates(opts.delims);_.merge(settings,delims,opts)}try{return _.template(str,opts,settings)}catch(err){console.log(chalk.red("%j"),err);debug("engine lodash [renderSync]: %j",err);return err}};engine.renderFile=function lodashRenderFile(filepath,options,cb){if(typeof options==="function"){cb=options;options={}}try{var str=fs.readFileSync(filepath,"utf8");engine.render(str,options,cb)}catch(err){console.log(chalk.red("%j"),err);debug("engine lodash [renderFile]: %j",err);cb(err);return}};engine.__express=engine.renderFile;module.exports=engine},{chalk:4,debug:12,delims:15,"engine-utils":24,fs:1,lodash:25}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";module.exports=function slice(arr,start,end){var len=arr.length>>>0;var range=[];start=idx(arr,start);end=idx(arr,end,len);while(start<end){range.push(arr[start++])}return range};function idx(arr,pos,end){var len=arr.length>>>0;if(pos==null){pos=end||0}else if(pos<0){pos=Math.max(len+pos,0)}else{pos=Math.min(pos,len)}return pos}},{}],"extend-shallow":[function(require,module,exports){"use strict";var slice=require("array-slice");module.exports=function extend(o){if(o==null){return{}}var args=slice(arguments,1);var len=args.length;for(var i=0;i<len;i++){var obj=args[i];for(var key in obj){if(obj.hasOwnProperty(key)){o[key]=obj[key]}}}return o}},{"array-slice":1}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";module.exports=function forIn(o,fn,thisArg){for(var key in o){if(fn.call(thisArg,o[key],key,o)===false){break}}}},{}],"for-own":[function(require,module,exports){"use strict";var forIn=require("for-in");module.exports=function forOwn(o,fn,thisArg){forIn(o,function(val,key){if(hasOwn(o,key)){return fn.call(thisArg,o[key],key,o)}})};function hasOwn(o,prop){return{}.hasOwnProperty.call(o,prop)}},{"for-in":1}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){var util=require("util/");var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;var assert=module.exports=ok;assert.AssertionError=function AssertionError(options){this.name="AssertionError";this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false}else{this.message=getMessage(this);this.generatedMessage=true}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction)}else{var err=new Error;if(err.stack){var out=err.stack;var fn_name=stackStartFunction.name;var idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&(isNaN(value)||!isFinite(value))){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n)}else{return s}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}assert.fail=fail;function ok(value,message){if(!value)fail(value,true,message,"==",assert.ok)}assert.ok=ok;assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,"==",assert.equal)};assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,"!=",assert.notEqual)}};assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,"deepEqual",assert.deepEqual)}};function _deepEqual(actual,expected){if(actual===expected){return true}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false}return true}else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime()}else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase}else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected}else{return objEquiv(actual,expected)}}function isArguments(object){return Object.prototype.toString.call(object)=="[object Arguments]"}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;if(a.prototype!==b.prototype)return false;if(isArguments(a)){if(!isArguments(b)){return false}a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b)}try{var ka=objectKeys(a),kb=objectKeys(b),key,i}catch(e){return false}if(ka.length!=kb.length)return false;ka.sort();kb.sort();for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":8}],3:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}throw TypeError('Uncaught, unspecified "error" event.')}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){var m;if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret; | |
if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],4:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],5:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:6}],6:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],7:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],8:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":7,_process:6,inherits:4}],9:[function(require,module,exports){"use strict";var arrayUniq=require("array-uniq");module.exports=function(){return arrayUniq([].concat.apply([],arguments))}},{"array-uniq":10}],10:[function(require,module,exports){(function(global){"use strict";function uniqNoSet(arr){var ret=[];for(var i=0;i<arr.length;i++){if(ret.indexOf(arr[i])===-1){ret.push(arr[i])}}return ret}function uniqSet(arr){var seen=new Set;return arr.filter(function(el){if(!seen.has(el)){seen.add(el);return true}})}function uniqSetWithForEach(arr){var ret=[];new Set(arr).forEach(function(el){ret.push(el)});return ret}function doesForEachActuallyWork(){var ret=false;new Set([true]).forEach(function(el){ret=el});return ret===true}if("Set"in global){if(typeof Set.prototype.forEach==="function"&&doesForEachActuallyWork()){module.exports=uniqSetWithForEach}else{module.exports=uniqSet}}else{module.exports=uniqNoSet}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],11:[function(require,module,exports){(function(process){(function(){var async={};var root,previous_async;root=this;if(root!=null){previous_async=root.async}async.noConflict=function(){root.async=previous_async;return async};function only_once(fn){var called=false;return function(){if(called)throw new Error("Callback was already called.");called=true;fn.apply(root,arguments)}}var _toString=Object.prototype.toString;var _isArray=Array.isArray||function(obj){return _toString.call(obj)==="[object Array]"};var _each=function(arr,iterator){if(arr.forEach){return arr.forEach(iterator)}for(var i=0;i<arr.length;i+=1){iterator(arr[i],i,arr)}};var _map=function(arr,iterator){if(arr.map){return arr.map(iterator)}var results=[];_each(arr,function(x,i,a){results.push(iterator(x,i,a))});return results};var _reduce=function(arr,iterator,memo){if(arr.reduce){return arr.reduce(iterator,memo)}_each(arr,function(x,i,a){memo=iterator(memo,x,i,a)});return memo};var _keys=function(obj){if(Object.keys){return Object.keys(obj)}var keys=[];for(var k in obj){if(obj.hasOwnProperty(k)){keys.push(k)}}return keys};if(typeof process==="undefined"||!process.nextTick){if(typeof setImmediate==="function"){async.nextTick=function(fn){setImmediate(fn)};async.setImmediate=async.nextTick}else{async.nextTick=function(fn){setTimeout(fn,0)};async.setImmediate=async.nextTick}}else{async.nextTick=process.nextTick;if(typeof setImmediate!=="undefined"){async.setImmediate=function(fn){setImmediate(fn)}}else{async.setImmediate=async.nextTick}}async.each=function(arr,iterator,callback){callback=callback||function(){};if(!arr.length){return callback()}var completed=0;_each(arr,function(x){iterator(x,only_once(done))});function done(err){if(err){callback(err);callback=function(){}}else{completed+=1;if(completed>=arr.length){callback()}}}};async.forEach=async.each;async.eachSeries=function(arr,iterator,callback){callback=callback||function(){};if(!arr.length){return callback()}var completed=0;var iterate=function(){iterator(arr[completed],function(err){if(err){callback(err);callback=function(){}}else{completed+=1;if(completed>=arr.length){callback()}else{iterate()}}})};iterate()};async.forEachSeries=async.eachSeries;async.eachLimit=function(arr,limit,iterator,callback){var fn=_eachLimit(limit);fn.apply(null,[arr,iterator,callback])};async.forEachLimit=async.eachLimit;var _eachLimit=function(limit){return function(arr,iterator,callback){callback=callback||function(){};if(!arr.length||limit<=0){return callback()}var completed=0;var started=0;var running=0;(function replenish(){if(completed>=arr.length){return callback()}while(running<limit&&started<arr.length){started+=1;running+=1;iterator(arr[started-1],function(err){if(err){callback(err);callback=function(){}}else{completed+=1;running-=1;if(completed>=arr.length){callback()}else{replenish()}}})}})()}};var doParallel=function(fn){return function(){var args=Array.prototype.slice.call(arguments);return fn.apply(null,[async.each].concat(args))}};var doParallelLimit=function(limit,fn){return function(){var args=Array.prototype.slice.call(arguments);return fn.apply(null,[_eachLimit(limit)].concat(args))}};var doSeries=function(fn){return function(){var args=Array.prototype.slice.call(arguments);return fn.apply(null,[async.eachSeries].concat(args))}};var _asyncMap=function(eachfn,arr,iterator,callback){arr=_map(arr,function(x,i){return{index:i,value:x}});if(!callback){eachfn(arr,function(x,callback){iterator(x.value,function(err){callback(err)})})}else{var results=[];eachfn(arr,function(x,callback){iterator(x.value,function(err,v){results[x.index]=v;callback(err)})},function(err){callback(err,results)})}};async.map=doParallel(_asyncMap);async.mapSeries=doSeries(_asyncMap);async.mapLimit=function(arr,limit,iterator,callback){return _mapLimit(limit)(arr,iterator,callback)};var _mapLimit=function(limit){return doParallelLimit(limit,_asyncMap)};async.reduce=function(arr,memo,iterator,callback){async.eachSeries(arr,function(x,callback){iterator(memo,x,function(err,v){memo=v;callback(err)})},function(err){callback(err,memo)})};async.inject=async.reduce;async.foldl=async.reduce;async.reduceRight=function(arr,memo,iterator,callback){var reversed=_map(arr,function(x){return x}).reverse();async.reduce(reversed,memo,iterator,callback)};async.foldr=async.reduceRight;var _filter=function(eachfn,arr,iterator,callback){var results=[];arr=_map(arr,function(x,i){return{index:i,value:x}});eachfn(arr,function(x,callback){iterator(x.value,function(v){if(v){results.push(x)}callback()})},function(err){callback(_map(results.sort(function(a,b){return a.index-b.index}),function(x){return x.value}))})};async.filter=doParallel(_filter);async.filterSeries=doSeries(_filter);async.select=async.filter;async.selectSeries=async.filterSeries;var _reject=function(eachfn,arr,iterator,callback){var results=[];arr=_map(arr,function(x,i){return{index:i,value:x}});eachfn(arr,function(x,callback){iterator(x.value,function(v){if(!v){results.push(x)}callback()})},function(err){callback(_map(results.sort(function(a,b){return a.index-b.index}),function(x){return x.value}))})};async.reject=doParallel(_reject);async.rejectSeries=doSeries(_reject);var _detect=function(eachfn,arr,iterator,main_callback){eachfn(arr,function(x,callback){iterator(x,function(result){if(result){main_callback(x);main_callback=function(){}}else{callback()}})},function(err){main_callback()})};async.detect=doParallel(_detect);async.detectSeries=doSeries(_detect);async.some=function(arr,iterator,main_callback){async.each(arr,function(x,callback){iterator(x,function(v){if(v){main_callback(true);main_callback=function(){}}callback()})},function(err){main_callback(false)})};async.any=async.some;async.every=function(arr,iterator,main_callback){async.each(arr,function(x,callback){iterator(x,function(v){if(!v){main_callback(false);main_callback=function(){}}callback()})},function(err){main_callback(true)})};async.all=async.every;async.sortBy=function(arr,iterator,callback){async.map(arr,function(x,callback){iterator(x,function(err,criteria){if(err){callback(err)}else{callback(null,{value:x,criteria:criteria})}})},function(err,results){if(err){return callback(err)}else{var fn=function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0};callback(null,_map(results.sort(fn),function(x){return x.value}))}})};async.auto=function(tasks,callback){callback=callback||function(){};var keys=_keys(tasks);var remainingTasks=keys.length;if(!remainingTasks){return callback()}var results={};var listeners=[];var addListener=function(fn){listeners.unshift(fn)};var removeListener=function(fn){for(var i=0;i<listeners.length;i+=1){if(listeners[i]===fn){listeners.splice(i,1);return}}};var taskComplete=function(){remainingTasks--;_each(listeners.slice(0),function(fn){fn()})};addListener(function(){if(!remainingTasks){var theCallback=callback;callback=function(){};theCallback(null,results)}});_each(keys,function(k){var task=_isArray(tasks[k])?tasks[k]:[tasks[k]];var taskCallback=function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}if(err){var safeResults={};_each(_keys(results),function(rkey){safeResults[rkey]=results[rkey]});safeResults[k]=args;callback(err,safeResults);callback=function(){}}else{results[k]=args;async.setImmediate(taskComplete)}};var requires=task.slice(0,Math.abs(task.length-1))||[];var ready=function(){return _reduce(requires,function(a,x){return a&&results.hasOwnProperty(x)},true)&&!results.hasOwnProperty(k)};if(ready()){task[task.length-1](taskCallback,results)}else{var listener=function(){if(ready()){removeListener(listener);task[task.length-1](taskCallback,results)}};addListener(listener)}})};async.retry=function(times,task,callback){var DEFAULT_TIMES=5;var attempts=[];if(typeof times==="function"){callback=task;task=times;times=DEFAULT_TIMES}times=parseInt(times,10)||DEFAULT_TIMES;var wrappedTask=function(wrappedCallback,wrappedResults){var retryAttempt=function(task,finalAttempt){return function(seriesCallback){task(function(err,result){seriesCallback(!err||finalAttempt,{err:err,result:result})},wrappedResults)}};while(times){attempts.push(retryAttempt(task,!(times-=1)))}async.series(attempts,function(done,data){data=data[data.length-1];(wrappedCallback||callback)(data.err,data.result)})};return callback?wrappedTask():wrappedTask};async.waterfall=function(tasks,callback){callback=callback||function(){};if(!_isArray(tasks)){var err=new Error("First argument to waterfall must be an array of functions");return callback(err)}if(!tasks.length){return callback()}var wrapIterator=function(iterator){return function(err){if(err){callback.apply(null,arguments);callback=function(){}}else{var args=Array.prototype.slice.call(arguments,1);var next=iterator.next();if(next){args.push(wrapIterator(next))}else{args.push(callback)}async.setImmediate(function(){iterator.apply(null,args)})}}};wrapIterator(async.iterator(tasks))()};var _parallel=function(eachfn,tasks,callback){callback=callback||function(){};if(_isArray(tasks)){eachfn.map(tasks,function(fn,callback){if(fn){fn(function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}callback.call(null,err,args)})}},callback)}else{var results={};eachfn.each(_keys(tasks),function(k,callback){tasks[k](function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}results[k]=args;callback(err)})},function(err){callback(err,results)})}};async.parallel=function(tasks,callback){_parallel({map:async.map,each:async.each},tasks,callback)};async.parallelLimit=function(tasks,limit,callback){_parallel({map:_mapLimit(limit),each:_eachLimit(limit)},tasks,callback)};async.series=function(tasks,callback){callback=callback||function(){};if(_isArray(tasks)){async.mapSeries(tasks,function(fn,callback){if(fn){fn(function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}callback.call(null,err,args)})}},callback)}else{var results={};async.eachSeries(_keys(tasks),function(k,callback){tasks[k](function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}results[k]=args;callback(err)})},function(err){callback(err,results)})}};async.iterator=function(tasks){var makeCallback=function(index){var fn=function(){if(tasks.length){tasks[index].apply(null,arguments)}return fn.next()};fn.next=function(){return index<tasks.length-1?makeCallback(index+1):null};return fn};return makeCallback(0)};async.apply=function(fn){var args=Array.prototype.slice.call(arguments,1);return function(){return fn.apply(null,args.concat(Array.prototype.slice.call(arguments)))}};var _concat=function(eachfn,arr,fn,callback){var r=[];eachfn(arr,function(x,cb){fn(x,function(err,y){r=r.concat(y||[]);cb(err)})},function(err){callback(err,r)})};async.concat=doParallel(_concat);async.concatSeries=doSeries(_concat);async.whilst=function(test,iterator,callback){if(test()){iterator(function(err){if(err){return callback(err)}async.whilst(test,iterator,callback)})}else{callback()}};async.doWhilst=function(iterator,test,callback){iterator(function(err){if(err){return callback(err)}var args=Array.prototype.slice.call(arguments,1);if(test.apply(null,args)){async.doWhilst(iterator,test,callback)}else{callback()}})};async.until=function(test,iterator,callback){if(!test()){iterator(function(err){if(err){return callback(err)}async.until(test,iterator,callback)})}else{callback()}};async.doUntil=function(iterator,test,callback){iterator(function(err){if(err){return callback(err)}var args=Array.prototype.slice.call(arguments,1);if(!test.apply(null,args)){async.doUntil(iterator,test,callback)}else{callback()}})};async.queue=function(worker,concurrency){if(concurrency===undefined){concurrency=1}function _insert(q,data,pos,callback){if(!q.started){q.started=true}if(!_isArray(data)){data=[data]}if(data.length==0){return async.setImmediate(function(){if(q.drain){q.drain()}})}_each(data,function(task){var item={data:task,callback:typeof callback==="function"?callback:null};if(pos){q.tasks.unshift(item)}else{q.tasks.push(item)}if(q.saturated&&q.tasks.length===q.concurrency){q.saturated()}async.setImmediate(q.process)})}var workers=0;var q={tasks:[],concurrency:concurrency,saturated:null,empty:null,drain:null,started:false,paused:false,push:function(data,callback){_insert(q,data,false,callback)},kill:function(){q.drain=null;q.tasks=[]},unshift:function(data,callback){_insert(q,data,true,callback)},process:function(){if(!q.paused&&workers<q.concurrency&&q.tasks.length){var task=q.tasks.shift();if(q.empty&&q.tasks.length===0){q.empty()}workers+=1;var next=function(){workers-=1;if(task.callback){task.callback.apply(task,arguments)}if(q.drain&&q.tasks.length+workers===0){q.drain()}q.process()};var cb=only_once(next);worker(task.data,cb)}},length:function(){return q.tasks.length},running:function(){return workers},idle:function(){return q.tasks.length+workers===0},pause:function(){if(q.paused===true){return}q.paused=true;q.process()},resume:function(){if(q.paused===false){return}q.paused=false;q.process()}};return q};async.priorityQueue=function(worker,concurrency){function _compareTasks(a,b){return a.priority-b.priority}function _binarySearch(sequence,item,compare){var beg=-1,end=sequence.length-1;while(beg<end){var mid=beg+(end-beg+1>>>1);if(compare(item,sequence[mid])>=0){beg=mid}else{end=mid-1}}return beg}function _insert(q,data,priority,callback){if(!q.started){q.started=true}if(!_isArray(data)){data=[data]}if(data.length==0){return async.setImmediate(function(){if(q.drain){q.drain()}})}_each(data,function(task){var item={data:task,priority:priority,callback:typeof callback==="function"?callback:null};q.tasks.splice(_binarySearch(q.tasks,item,_compareTasks)+1,0,item);if(q.saturated&&q.tasks.length===q.concurrency){q.saturated()}async.setImmediate(q.process)})}var q=async.queue(worker,concurrency);q.push=function(data,priority,callback){_insert(q,data,priority,callback)};delete q.unshift;return q};async.cargo=function(worker,payload){var working=false,tasks=[];var cargo={tasks:tasks,payload:payload,saturated:null,empty:null,drain:null,drained:true,push:function(data,callback){if(!_isArray(data)){data=[data]}_each(data,function(task){tasks.push({data:task,callback:typeof callback==="function"?callback:null});cargo.drained=false;if(cargo.saturated&&tasks.length===payload){cargo.saturated()}});async.setImmediate(cargo.process)},process:function process(){if(working)return;if(tasks.length===0){if(cargo.drain&&!cargo.drained)cargo.drain();cargo.drained=true;return}var ts=typeof payload==="number"?tasks.splice(0,payload):tasks.splice(0,tasks.length);var ds=_map(ts,function(task){return task.data});if(cargo.empty)cargo.empty();working=true;worker(ds,function(){working=false;var args=arguments;_each(ts,function(data){if(data.callback){data.callback.apply(null,args)}});process()})},length:function(){return tasks.length},running:function(){return working}};return cargo};var _console_fn=function(name){return function(fn){var args=Array.prototype.slice.call(arguments,1);fn.apply(null,args.concat([function(err){var args=Array.prototype.slice.call(arguments,1);if(typeof console!=="undefined"){if(err){if(console.error){console.error(err)}}else if(console[name]){_each(args,function(x){console[name](x)})}}}]))}};async.log=_console_fn("log");async.dir=_console_fn("dir");async.memoize=function(fn,hasher){var memo={};var queues={};hasher=hasher||function(x){return x};var memoized=function(){var args=Array.prototype.slice.call(arguments);var callback=args.pop();var key=hasher.apply(null,args);if(key in memo){async.nextTick(function(){callback.apply(null,memo[key])})}else if(key in queues){queues[key].push(callback)}else{queues[key]=[callback];fn.apply(null,args.concat([function(){memo[key]=arguments; | |
var q=queues[key];delete queues[key];for(var i=0,l=q.length;i<l;i++){q[i].apply(null,arguments)}}]))}};memoized.memo=memo;memoized.unmemoized=fn;return memoized};async.unmemoize=function(fn){return function(){return(fn.unmemoized||fn).apply(null,arguments)}};async.times=function(count,iterator,callback){var counter=[];for(var i=0;i<count;i++){counter.push(i)}return async.map(counter,iterator,callback)};async.timesSeries=function(count,iterator,callback){var counter=[];for(var i=0;i<count;i++){counter.push(i)}return async.mapSeries(counter,iterator,callback)};async.seq=function(){var fns=arguments;return function(){var that=this;var args=Array.prototype.slice.call(arguments);var callback=args.pop();async.reduce(fns,args,function(newargs,fn,cb){fn.apply(that,newargs.concat([function(){var err=arguments[0];var nextargs=Array.prototype.slice.call(arguments,1);cb(err,nextargs)}]))},function(err,results){callback.apply(that,[err].concat(results))})}};async.compose=function(){return async.seq.apply(null,Array.prototype.reverse.call(arguments))};var _applyEach=function(eachfn,fns){var go=function(){var that=this;var args=Array.prototype.slice.call(arguments);var callback=args.pop();return eachfn(fns,function(fn,cb){fn.apply(that,args.concat([cb]))},callback)};if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);return go.apply(this,args)}else{return go}};async.applyEach=doParallel(_applyEach);async.applyEachSeries=doSeries(_applyEach);async.forever=function(fn,callback){function next(err){if(err){if(callback){return callback(err)}throw err}fn(next)}next()};if(typeof module!=="undefined"&&module.exports){module.exports=async}else if(typeof define!=="undefined"&&define.amd){define([],function(){return async})}else{root.async=async}})()}).call(this,require("_process"))},{_process:6}],12:[function(require,module,exports){(function(process){exports.alphasort=alphasort;exports.alphasorti=alphasorti;exports.isAbsolute=process.platform==="win32"?absWin:absUnix;exports.setopts=setopts;exports.ownProp=ownProp;exports.makeAbs=makeAbs;exports.finish=finish;exports.mark=mark;function ownProp(obj,field){return Object.prototype.hasOwnProperty.call(obj,field)}var path=require("path");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;function absWin(p){if(absUnix(p))return true;var splitDeviceRe=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var result=splitDeviceRe.exec(p);var device=result[1]||"";var isUnc=device&&device.charAt(1)!==":";var isAbsolute=!!result[2]||isUnc;return isAbsolute}function absUnix(p){return p.charAt(0)==="/"||p===""}function alphasorti(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())}function alphasort(a,b){return a.localeCompare(b)}function setopts(self,pattern,options){if(!options)options={};if(options.matchBase&&-1===pattern.indexOf("/")){if(options.noglobstar){throw new Error("base matching requires globstar")}pattern="**/"+pattern}self.pattern=pattern;self.strict=options.strict!==false;self.dot=!!options.dot;self.mark=!!options.mark;self.nodir=!!options.nodir;if(self.nodir)self.mark=true;self.sync=!!options.sync;self.nounique=!!options.nounique;self.nonull=!!options.nonull;self.nosort=!!options.nosort;self.nocase=!!options.nocase;self.stat=!!options.stat;self.noprocess=!!options.noprocess;self.maxLength=options.maxLength||Infinity;self.cache=options.cache||Object.create(null);self.statCache=options.statCache||Object.create(null);self.symlinks=options.symlinks||Object.create(null);self.changedCwd=false;var cwd=process.cwd();if(!ownProp(options,"cwd"))self.cwd=cwd;else{self.cwd=options.cwd;self.changedCwd=path.resolve(options.cwd)!==cwd}self.root=options.root||path.resolve(self.cwd,"/");self.root=path.resolve(self.root);if(process.platform==="win32")self.root=self.root.replace(/\\/g,"/");self.nomount=!!options.nomount;self.minimatch=new Minimatch(pattern,options);self.options=self.minimatch.options}function finish(self){var nou=self.nounique;var all=nou?[]:Object.create(null);for(var i=0,l=self.matches.length;i<l;i++){var matches=self.matches[i];if(!matches){if(self.nonull){var literal=self.minimatch.globSet[i];if(nou)all.push(literal);else all[literal]=true}}else{var m=Object.keys(matches);if(nou)all.push.apply(all,m);else m.forEach(function(m){all[m]=true})}}if(!nou)all=Object.keys(all);if(!self.nosort)all=all.sort(self.nocase?alphasorti:alphasort);if(self.mark){for(var i=0;i<all.length;i++){all[i]=self._mark(all[i])}if(self.nodir){all=all.filter(function(e){return!/\/$/.test(e)})}}self.found=all}function mark(self,p){var c=self.cache[p];var m=p;if(c){var isDir=c==="DIR"||Array.isArray(c);var slash=p.slice(-1)==="/";if(isDir&&!slash)m+="/";else if(!isDir&&slash)m=m.slice(0,-1);if(m!==p){self.statCache[m]=self.statCache[p];self.cache[m]=self.cache[p]}}return m}function makeAbs(self,f){var abs=f;if(f.charAt(0)==="/"){abs=path.join(self.root,f)}else if(exports.isAbsolute(f)){abs=f}else if(self.changedCwd){abs=path.resolve(self.cwd,f)}return abs}}).call(this,require("_process"))},{_process:6,minimatch:20,path:5}],13:[function(require,module,exports){(function(process){module.exports=glob;var fs=require("fs");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;var inherits=require("inherits");var EE=require("events").EventEmitter;var path=require("path");var assert=require("assert");var globSync=require("./sync.js");var common=require("./common.js");var alphasort=common.alphasort;var alphasorti=common.alphasorti;var isAbsolute=common.isAbsolute;var setopts=common.setopts;var ownProp=common.ownProp;var inflight=require("inflight");var util=require("util");var once=require("once");function glob(pattern,options,cb){if(typeof options==="function")cb=options,options={};if(!options)options={};if(options.sync){if(cb)throw new TypeError("callback provided to sync glob");return globSync(pattern,options)}return new Glob(pattern,options,cb)}glob.sync=globSync;var GlobSync=glob.GlobSync=globSync.GlobSync;glob.glob=glob;glob.hasMagic=function(pattern,options_){var options=util._extend({},options_);options.noprocess=true;var g=new Glob(pattern,options);var set=g.minimatch.set;if(set.length>1)return true;for(var j=0;j<set[0].length;j++){if(typeof set[0][j]!=="string")return true}return false};glob.Glob=Glob;inherits(Glob,EE);function Glob(pattern,options,cb){if(typeof options==="function"){cb=options;options=null}if(options&&options.sync){if(cb)throw new TypeError("callback provided to sync glob");return new GlobSync(pattern,options)}if(!(this instanceof Glob))return new Glob(pattern,options,cb);setopts(this,pattern,options);var n=this.minimatch.set.length;this.matches=new Array(n);if(typeof cb==="function"){cb=once(cb);this.on("error",cb);this.on("end",function(matches){cb(null,matches)})}var self=this;var n=this.minimatch.set.length;this._processing=0;this.matches=new Array(n);this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(n===0)return done();for(var i=0;i<n;i++){this._process(this.minimatch.set[i],i,false,done)}function done(){--self._processing;if(self._processing<=0)self._finish()}}Glob.prototype._finish=function(){assert(this instanceof Glob);if(this.aborted)return;common.finish(this);this.emit("end",this.found)};Glob.prototype._mark=function(p){return common.mark(this,p)};Glob.prototype._makeAbs=function(f){return common.makeAbs(this,f)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var eq=this._emitQueue.slice(0);this._emitQueue.length=0;for(var i=0;i<eq.length;i++){var e=eq[i];this._emitMatch(e[0],e[1])}}if(this._processQueue.length){var pq=this._processQueue.slice(0);this._processQueue.length=0;for(var i=0;i<pq.length;i++){var p=pq[i];this._processing--;this._process(p[0],p[1],p[2],p[3])}}}};Glob.prototype._process=function(pattern,index,inGlobStar,cb){assert(this instanceof Glob);assert(typeof cb==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([pattern,index,inGlobStar,cb]);return}var n=0;while(typeof pattern[n]==="string"){n++}var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index,cb);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n);var read;if(prefix===null)read=".";else if(isAbsolute(prefix)||isAbsolute(pattern.join("/"))){if(!prefix||!isAbsolute(prefix))prefix="/"+prefix;read=prefix}else read=prefix;var abs=this._makeAbs(read);var isGlobStar=remain[0]===minimatch.GLOBSTAR;if(isGlobStar)this._processGlobStar(prefix,read,abs,remain,index,inGlobStar,cb);else this._processReaddir(prefix,read,abs,remain,index,inGlobStar,cb)};Glob.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar,cb){var self=this;this._readdir(abs,inGlobStar,function(er,entries){return self._processReaddir2(prefix,read,abs,remain,index,inGlobStar,entries,cb)})};Glob.prototype._processReaddir2=function(prefix,read,abs,remain,index,inGlobStar,entries,cb){if(!entries)return cb();var pn=remain[0];var negate=!!this.minimatch.negate;var rawGlob=pn._glob;var dotOk=this.dot||rawGlob.charAt(0)===".";var matchedEntries=[];for(var i=0;i<entries.length;i++){var e=entries[i];if(e.charAt(0)!=="."||dotOk){var m;if(negate&&!prefix){m=!e.match(pn)}else{m=e.match(pn)}if(m)matchedEntries.push(e)}}var len=matchedEntries.length;if(len===0)return cb();if(remain.length===1&&!this.mark&&!this.stat){if(!this.matches[index])this.matches[index]=Object.create(null);for(var i=0;i<len;i++){var e=matchedEntries[i];if(prefix){if(prefix!=="/")e=prefix+"/"+e;else e=prefix+e}if(e.charAt(0)==="/"&&!this.nomount){e=path.join(this.root,e)}this._emitMatch(index,e)}return cb()}remain.shift();for(var i=0;i<len;i++){var e=matchedEntries[i];var newPattern;if(prefix){if(prefix!=="/")e=prefix+"/"+e;else e=prefix+e}this._process([e].concat(remain),index,inGlobStar,cb)}cb()};Glob.prototype._emitMatch=function(index,e){if(this.aborted)return;if(!this.matches[index][e]){if(this.paused){this._emitQueue.push([index,e]);return}if(this.nodir){var c=this.cache[this._makeAbs(e)];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e]=true;if(!this.stat&&!this.mark)return this.emit("match",e);var self=this;this._stat(this._makeAbs(e),function(er,c,st){self.emit("stat",e,st);self.emit("match",e)})}};Glob.prototype._readdirInGlobStar=function(abs,cb){if(this.aborted)return;var lstatkey="lstat\x00"+abs;var self=this;var lstatcb=inflight(lstatkey,lstatcb_);if(lstatcb)fs.lstat(abs,lstatcb);function lstatcb_(er,lstat){if(er)return cb();var isSym=lstat.isSymbolicLink();self.symlinks[abs]=isSym;if(!isSym&&!lstat.isDirectory()){self.cache[abs]="FILE";cb()}else self._readdir(abs,false,cb)}};Glob.prototype._readdir=function(abs,inGlobStar,cb){if(this.aborted)return;cb=inflight("readdir\x00"+abs+"\x00"+inGlobStar,cb);if(!cb)return;if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs,cb);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return cb();if(Array.isArray(c))return cb(null,c)}var self=this;fs.readdir(abs,readdirCb(this,abs,cb))};function readdirCb(self,abs,cb){return function(er,entries){if(er)self._readdirError(abs,er,cb);else self._readdirEntries(abs,entries,cb)}}Glob.prototype._readdirEntries=function(abs,entries,cb){if(this.aborted)return;if(!this.mark&&!this.stat){for(var i=0;i<entries.length;i++){var e=entries[i];if(abs==="/")e=abs+e;else e=abs+"/"+e;this.cache[e]=true}}this.cache[abs]=entries;return cb(null,entries)};Glob.prototype._readdirError=function(f,er,cb){if(this.aborted)return;switch(er.code){case"ENOTDIR":this.cache[f]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[f]=false;break;default:this.cache[f]=false;if(this.strict)return this.emit("error",er);if(!this.silent)console.error("glob error",er);break}return cb()};Glob.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar,cb){var self=this;this._readdir(abs,inGlobStar,function(er,entries){self._processGlobStar2(prefix,read,abs,remain,index,inGlobStar,entries,cb)})};Glob.prototype._processGlobStar2=function(prefix,read,abs,remain,index,inGlobStar,entries,cb){if(!entries)return cb();var remainWithoutGlobStar=remain.slice(1);var gspref=prefix?[prefix]:[];var noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,false,cb);var isSym=this.symlinks[abs];var len=entries.length;if(isSym&&inGlobStar)return cb();for(var i=0;i<len;i++){var e=entries[i];if(e.charAt(0)==="."&&!this.dot)continue;var instead=gspref.concat(entries[i],remainWithoutGlobStar);this._process(instead,index,true,cb);var below=gspref.concat(entries[i],remain);this._process(below,index,true,cb)}cb()};Glob.prototype._processSimple=function(prefix,index,cb){var self=this;this._stat(prefix,function(er,exists){self._processSimple2(prefix,index,er,exists,cb)})};Glob.prototype._processSimple2=function(prefix,index,er,exists,cb){if(!this.matches[index])this.matches[index]=Object.create(null);if(!exists)return cb();if(prefix&&isAbsolute(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);if(prefix.charAt(0)==="/"){prefix=path.join(this.root,prefix)}else{prefix=path.resolve(this.root,prefix);if(trail)prefix+="/"}}if(process.platform==="win32")prefix=prefix.replace(/\\/g,"/");this._emitMatch(index,prefix);cb()};Glob.prototype._stat=function(f,cb){var abs=f;if(f.charAt(0)==="/")abs=path.join(this.root,f);else if(this.changedCwd)abs=path.resolve(this.cwd,f);if(f.length>this.maxLength)return cb();if(!this.stat&&ownProp(this.cache,f)){var c=this.cache[f];if(Array.isArray(c))c="DIR";if(abs.slice(-1)==="/"&&c!=="DIR")return cb();return cb(null,c)}var exists;var stat=this.statCache[abs];if(stat!==undefined){if(stat===false)return cb(null,stat);else return cb(null,stat.isDirectory()?"DIR":"FILE",stat)}var self=this;var statcb=inflight("stat\x00"+abs,statcb_);if(statcb)fs.stat(abs,statcb);function statcb_(er,stat){self._stat2(f,abs,er,stat,cb)}};Glob.prototype._stat2=function(f,abs,er,stat,cb){if(er){this.statCache[abs]=false;return cb()}this.statCache[abs]=stat;if(abs.slice(-1)==="/"&&!stat.isDirectory())return cb(null,false,stat);var c=stat.isDirectory()?"DIR":"FILE";this.cache[f]=this.cache[f]||c;return cb(null,c,stat)}}).call(this,require("_process"))},{"./common.js":12,"./sync.js":19,_process:6,assert:2,events:3,fs:1,inflight:14,inherits:16,minimatch:20,once:18,path:5,util:8}],14:[function(require,module,exports){(function(process){var wrappy=require("wrappy");var reqs=Object.create(null);var once=require("once");module.exports=wrappy(inflight);function inflight(key,cb){if(reqs[key]){reqs[key].push(cb);return null}else{reqs[key]=[cb];return makeres(key)}}function makeres(key){return once(function RES(){var cbs=reqs[key];var len=cbs.length;var args=slice(arguments);for(var i=0;i<len;i++){cbs[i].apply(null,args)}if(cbs.length>len){cbs.splice(0,len);process.nextTick(function(){RES.apply(null,args)})}else{delete reqs[key]}})}function slice(args){var length=args.length;var array=[];for(var i=0;i<length;i++)array[i]=args[i];return array}}).call(this,require("_process"))},{_process:6,once:18,wrappy:15}],15:[function(require,module,exports){module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=="function")throw new TypeError("need wrapper function");Object.keys(fn).forEach(function(k){wrapper[k]=fn[k]});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i]}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==="function"&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k]})}return ret}}},{}],16:[function(require,module,exports){arguments[4][4][0].apply(exports,arguments)},{dup:4}],17:[function(require,module,exports){arguments[4][15][0].apply(exports,arguments)},{dup:15}],18:[function(require,module,exports){var wrappy=require("wrappy");module.exports=wrappy(once);once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true})});function once(fn){var f=function(){if(f.called)return f.value;f.called=true;return f.value=fn.apply(this,arguments)};f.called=false;return f}},{wrappy:17}],19:[function(require,module,exports){(function(process){module.exports=globSync;globSync.GlobSync=GlobSync;var fs=require("fs");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;var Glob=require("./glob.js").Glob;var util=require("util");var path=require("path");var assert=require("assert");var common=require("./common.js");var alphasort=common.alphasort;var alphasorti=common.alphasorti;var isAbsolute=common.isAbsolute;var setopts=common.setopts;var ownProp=common.ownProp;function globSync(pattern,options){if(typeof options==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob");return new GlobSync(pattern,options).found}function GlobSync(pattern,options){if(!pattern)throw new Error("must provide pattern");if(typeof options==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob");if(!(this instanceof GlobSync))return new GlobSync(pattern,options);setopts(this,pattern,options);if(this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var i=0;i<n;i++){this._process(this.minimatch.set[i],i,false)}this._finish()}GlobSync.prototype._finish=function(){assert(this instanceof GlobSync);common.finish(this)};GlobSync.prototype._process=function(pattern,index,inGlobStar){assert(this instanceof GlobSync);var n=0;while(typeof pattern[n]==="string"){n++}var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n);var read;if(prefix===null)read=".";else if(isAbsolute(prefix)||isAbsolute(pattern.join("/"))){if(!prefix||!isAbsolute(prefix))prefix="/"+prefix;read=prefix}else read=prefix;var abs=this._makeAbs(read);var isGlobStar=remain[0]===minimatch.GLOBSTAR;if(isGlobStar)this._processGlobStar(prefix,read,abs,remain,index,inGlobStar);else this._processReaddir(prefix,read,abs,remain,index,inGlobStar)};GlobSync.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar){var entries=this._readdir(abs,inGlobStar);if(!entries)return;var pn=remain[0];var negate=!!this.minimatch.negate;var rawGlob=pn._glob;var dotOk=this.dot||rawGlob.charAt(0)===".";var matchedEntries=[];for(var i=0;i<entries.length;i++){var e=entries[i];if(e.charAt(0)!=="."||dotOk){var m;if(negate&&!prefix){m=!e.match(pn)}else{m=e.match(pn)}if(m)matchedEntries.push(e)}}var len=matchedEntries.length;if(len===0)return;if(remain.length===1&&!this.mark&&!this.stat){if(!this.matches[index])this.matches[index]=Object.create(null);for(var i=0;i<len;i++){var e=matchedEntries[i];if(prefix){if(prefix.slice(-1)!=="/")e=prefix+"/"+e;else e=prefix+e}if(e.charAt(0)==="/"&&!this.nomount){e=path.join(this.root,e)}this.matches[index][e]=true}return}remain.shift();for(var i=0;i<len;i++){var e=matchedEntries[i];var newPattern;if(prefix)newPattern=[prefix,e];else newPattern=[e];this._process(newPattern.concat(remain),index,inGlobStar)}};GlobSync.prototype._emitMatch=function(index,e){if(!this.matches[index][e]){if(this.nodir){var c=this.cache[this._makeAbs(e)];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e]=true;if(this.stat||this.mark)this._stat(this._makeAbs(e))}};GlobSync.prototype._readdirInGlobStar=function(abs){var entries;var lstat;var stat;try{lstat=fs.lstatSync(abs)}catch(er){return null}var isSym=lstat.isSymbolicLink();this.symlinks[abs]=isSym;if(!isSym&&!lstat.isDirectory())this.cache[abs]="FILE";else entries=this._readdir(abs,false);return entries};GlobSync.prototype._readdir=function(abs,inGlobStar){var entries;if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return null;if(Array.isArray(c))return c}try{return this._readdirEntries(abs,fs.readdirSync(abs))}catch(er){this._readdirError(abs,er);return null}};GlobSync.prototype._readdirEntries=function(abs,entries){if(!this.mark&&!this.stat){for(var i=0;i<entries.length;i++){var e=entries[i];if(abs==="/")e=abs+e;else e=abs+"/"+e;this.cache[e]=true}}this.cache[abs]=entries;return entries};GlobSync.prototype._readdirError=function(f,er){switch(er.code){case"ENOTDIR":this.cache[f]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[f]=false;break;default:this.cache[f]=false;if(this.strict)throw er;if(!this.silent)console.error("glob error",er);break}};GlobSync.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar){var entries=this._readdir(abs,inGlobStar);if(!entries)return;var remainWithoutGlobStar=remain.slice(1);var gspref=prefix?[prefix]:[];var noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,false);var len=entries.length;var isSym=this.symlinks[abs];if(isSym&&inGlobStar)return;for(var i=0;i<len;i++){var e=entries[i];if(e.charAt(0)==="."&&!this.dot)continue;var instead=gspref.concat(entries[i],remainWithoutGlobStar);this._process(instead,index,true);var below=gspref.concat(entries[i],remain);this._process(below,index,true)}};GlobSync.prototype._processSimple=function(prefix,index){var exists=this._stat(prefix);if(!this.matches[index])this.matches[index]=Object.create(null);if(!exists)return;if(prefix&&isAbsolute(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);if(prefix.charAt(0)==="/"){prefix=path.join(this.root,prefix)}else{prefix=path.resolve(this.root,prefix);if(trail)prefix+="/"}}if(process.platform==="win32")prefix=prefix.replace(/\\/g,"/");this.matches[index][prefix]=true};GlobSync.prototype._stat=function(f){var abs=f;if(f.charAt(0)==="/")abs=path.join(this.root,f);else if(this.changedCwd)abs=path.resolve(this.cwd,f);if(f.length>this.maxLength)return false;if(!this.stat&&ownProp(this.cache,f)){var c=this.cache[f];if(Array.isArray(c))c="DIR";if(abs.slice(-1)==="/"&&c!=="DIR")return false;return c}var exists;var stat=this.statCache[abs];if(!stat){try{stat=fs.statSync(abs)}catch(er){return false}}this.statCache[abs]=stat;if(abs.slice(-1)==="/"&&!stat.isDirectory())return false;var c=stat.isDirectory()?"DIR":"FILE";this.cache[f]=this.cache[f]||c;return c};GlobSync.prototype._mark=function(p){return common.mark(this,p)};GlobSync.prototype._makeAbs=function(f){return common.makeAbs(this,f)}}).call(this,require("_process"))},{"./common.js":12,"./glob.js":13,_process:6,assert:2,fs:1,minimatch:20,path:5,util:8}],20:[function(require,module,exports){(function(process){module.exports=minimatch;minimatch.Minimatch=Minimatch;var isWindows=false;if(typeof process!=="undefined"&&process.platform==="win32")isWindows=true;var GLOBSTAR=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={},expand=require("brace-expansion"),qmark="[^/]",star=qmark+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",reSpecials=charSet("().*{}+?[]^$\\!");function charSet(s){return s.split("").reduce(function(set,c){set[c]=true;return set},{})}var slashSplit=/\/+/;minimatch.filter=filter;function filter(pattern,options){options=options||{};return function(p,i,list){return minimatch(p,pattern,options)}}function ext(a,b){a=a||{};b=b||{};var t={};Object.keys(b).forEach(function(k){t[k]=b[k]});Object.keys(a).forEach(function(k){t[k]=a[k]});return t}minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return minimatch;var orig=minimatch;var m=function minimatch(p,pattern,options){return orig.minimatch(p,pattern,ext(def,options))};m.Minimatch=function Minimatch(pattern,options){return new orig.Minimatch(pattern,ext(def,options))};return m};Minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return Minimatch;return minimatch.defaults(def).Minimatch};function minimatch(p,pattern,options){if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};if(!options.nocomment&&pattern.charAt(0)==="#"){return false}if(pattern.trim()==="")return p==="";return new Minimatch(pattern,options).match(p)}function Minimatch(pattern,options){if(!(this instanceof Minimatch)){return new Minimatch(pattern,options)}if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};pattern=pattern.trim();if(isWindows)pattern=pattern.split("\\").join("/");this.options=options;this.set=[];this.pattern=pattern;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){if(this._made)return;var pattern=this.pattern;var options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=true;return}if(!pattern){this.empty=true;return}this.parseNegate();var set=this.globSet=this.braceExpand();if(options.debug)this.debug=console.error;this.debug(this.pattern,set);set=this.globParts=set.map(function(s){return s.split(slashSplit)});this.debug(this.pattern,set);set=set.map(function(s,si,set){return s.map(this.parse,this)},this);this.debug(this.pattern,set);set=set.filter(function(s){return-1===s.indexOf(false)});this.debug(this.pattern,set);this.set=set}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var pattern=this.pattern,negate=false,options=this.options,negateOffset=0;if(options.nonegate)return;for(var i=0,l=pattern.length;i<l&&pattern.charAt(i)==="!";i++){negate=!negate;negateOffset++}if(negateOffset)this.pattern=pattern.substr(negateOffset);this.negate=negate}minimatch.braceExpand=function(pattern,options){return braceExpand(pattern,options)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(pattern,options){if(!options){if(this instanceof Minimatch)options=this.options;else options={}}pattern=typeof pattern==="undefined"?this.pattern:pattern;if(typeof pattern==="undefined"){throw new Error("undefined pattern")}if(options.nobrace||!pattern.match(/\{.*\}/)){return[pattern]}return expand(pattern)}Minimatch.prototype.parse=parse;var SUBPARSE={};function parse(pattern,isSub){var options=this.options;if(!options.noglobstar&&pattern==="**")return GLOBSTAR;if(pattern==="")return"";var re="",hasMagic=!!options.nocase,escaping=false,patternListStack=[],plType,stateChar,inClass=false,reClassStart=-1,classStart=-1,patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",self=this;function clearStateChar(){if(stateChar){switch(stateChar){case"*":re+=star;hasMagic=true;break;case"?":re+=qmark;hasMagic=true;break;default:re+="\\"+stateChar;break}self.debug("clearStateChar %j %j",stateChar,re);stateChar=false}}for(var i=0,len=pattern.length,c;i<len&&(c=pattern.charAt(i));i++){this.debug("%s %s %s %j",pattern,i,re,c);if(escaping&&reSpecials[c]){re+="\\"+c;escaping=false;continue}SWITCH:switch(c){case"/":return false;case"\\":clearStateChar();escaping=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c);if(inClass){this.debug(" in class");if(c==="!"&&i===classStart+1)c="^";re+=c;continue}self.debug("call clearStateChar %j",stateChar);clearStateChar();stateChar=c;if(options.noext)clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}plType=stateChar;patternListStack.push({type:plType,start:i-1,reStart:re.length});re+=stateChar==="!"?"(?:(?!":"(?:";this.debug("plType %j %j",stateChar,re);stateChar=false;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar();hasMagic=true;re+=")";plType=patternListStack.pop().type;switch(plType){case"!":re+="[^/]*?)";break;case"?":case"+":case"*":re+=plType;case"@":break}continue;case"|":if(inClass||!patternListStack.length||escaping){re+="\\|";escaping=false;continue}clearStateChar();re+="|";continue;case"[":clearStateChar();if(inClass){re+="\\"+c;continue}inClass=true;classStart=i;reClassStart=re.length;re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c;escaping=false;continue}hasMagic=true;inClass=false;re+=c;continue;default:clearStateChar();if(escaping){escaping=false}else if(reSpecials[c]&&!(c==="^"&&inClass)){re+="\\"}re+=c}}if(inClass){var cs=pattern.substr(classStart+1),sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0];hasMagic=hasMagic||sp[1]}var pl;while(pl=patternListStack.pop()){var tail=re.slice(pl.reStart+3);tail=tail.replace(/((?:\\{2})*)(\\?)\|/g,function(_,$1,$2){if(!$2){$2="\\"}return $1+$1+$2+"|"});this.debug("tail=%j\n %s",tail,tail);var t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=true;re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar();if(escaping){re+="\\\\"}var addPatternStart=false;switch(re.charAt(0)){case".":case"[":case"(":addPatternStart=true}if(re!==""&&hasMagic)re="(?=.)"+re;if(addPatternStart)re=patternStart+re;if(isSub===SUBPARSE){return[re,hasMagic]}if(!hasMagic){return globUnescape(pattern)}var flags=options.nocase?"i":"",regExp=new RegExp("^"+re+"$",flags);regExp._glob=pattern;regExp._src=re;return regExp}minimatch.makeRe=function(pattern,options){return new Minimatch(pattern,options||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var set=this.set;if(!set.length)return this.regexp=false;var options=this.options;var twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot,flags=options.nocase?"i":"";var re=set.map(function(pattern){return pattern.map(function(p){return p===GLOBSTAR?twoStar:typeof p==="string"?regExpEscape(p):p._src}).join("\\/")}).join("|");re="^(?:"+re+")$";if(this.negate)re="^(?!"+re+").*$";try{return this.regexp=new RegExp(re,flags)}catch(ex){return this.regexp=false}}minimatch.match=function(list,pattern,options){options=options||{};var mm=new Minimatch(pattern,options);list=list.filter(function(f){return mm.match(f)});if(mm.options.nonull&&!list.length){list.push(pattern)}return list};Minimatch.prototype.match=match;function match(f,partial){this.debug("match",f,this.pattern);if(this.comment)return false;if(this.empty)return f==="";if(f==="/"&&partial)return true;var options=this.options;if(isWindows)f=f.split("\\").join("/");f=f.split(slashSplit);this.debug(this.pattern,"split",f);var set=this.set;this.debug(this.pattern,"set",set);var filename;for(var i=f.length-1;i>=0;i--){filename=f[i];if(filename)break}for(var i=0,l=set.length;i<l;i++){var pattern=set[i],file=f;if(options.matchBase&&pattern.length===1){file=[filename]}var hit=this.matchOne(file,pattern,partial);if(hit){if(options.flipNegate)return true;return!this.negate}}if(options.flipNegate)return false;return this.negate}Minimatch.prototype.matchOne=function(file,pattern,partial){var options=this.options;this.debug("matchOne",{"this":this,file:file,pattern:pattern});this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f=file[fi];this.debug(pattern,p,f);if(p===false)return false;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi,pr=pi+1;if(pr===pl){this.debug("** at the end");for(;fi<fl;fi++){if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return false}return true}WHILE:while(fr<fl){var swallowee=file[fr];this.debug("\nglobstar while",file,fr,pattern,pr,swallowee);if(this.matchOne(file.slice(fr),pattern.slice(pr),partial)){this.debug("globstar found match!",fr,fl,swallowee);return true}else{if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break WHILE}this.debug("globstar swallow a segment, and continue");fr++}}if(partial){this.debug("\n>>> no match, partial?",file,fr,pattern,pr); | |
if(fr===fl)return true}return false}var hit;if(typeof p==="string"){if(options.nocase){hit=f.toLowerCase()===p.toLowerCase()}else{hit=f===p}this.debug("string match",p,f,hit)}else{hit=f.match(p);this.debug("pattern match",p,f,hit)}if(!hit)return false}if(fi===fl&&pi===pl){return true}else if(fi===fl){return partial}else if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}}).call(this,require("_process"))},{_process:6,"brace-expansion":21}],21:[function(require,module,exports){var concatMap=require("concat-map");var balanced=require("balanced-match");module.exports=expandTop;var escSlash="\x00SLASH"+Math.random()+"\x00";var escOpen="\x00OPEN"+Math.random()+"\x00";var escClose="\x00CLOSE"+Math.random()+"\x00";var escComma="\x00COMMA"+Math.random()+"\x00";var escPeriod="\x00PERIOD"+Math.random()+"\x00";function numeric(str){return parseInt(str,10)==str?parseInt(str,10):str.charCodeAt(0)}function escapeBraces(str){return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod)}function unescapeBraces(str){return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".")}function parseCommaParts(str){if(!str)return[""];var parts=[];var m=balanced("{","}",str);if(!m)return str.split(",");var pre=m.pre;var body=m.body;var post=m.post;var p=pre.split(",");p[p.length-1]+="{"+body+"}";var postParts=parseCommaParts(post);if(post.length){p[p.length-1]+=postParts.shift();p.push.apply(p,postParts)}parts.push.apply(parts,p);return parts}function expandTop(str){if(!str)return[];return expand(escapeBraces(str),true).map(unescapeBraces)}function identity(e){return e}function embrace(str){return"{"+str+"}"}function isPadded(el){return/^-?0\d/.test(el)}function lte(i,y){return i<=y}function gte(i,y){return i>=y}function expand(str,isTop){var expansions=[];var m=balanced("{","}",str);if(!m||/\$$/.test(m.pre))return[str];var isNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);var isAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);var isSequence=isNumericSequence||isAlphaSequence;var isOptions=/^(.*,)+(.+)?$/.test(m.body);if(!isSequence&&!isOptions){if(m.post.match(/,.*}/)){str=m.pre+"{"+m.body+escClose+m.post;return expand(str)}return[str]}var n;if(isSequence){n=m.body.split(/\.\./)}else{n=parseCommaParts(m.body);if(n.length===1){n=expand(n[0],false).map(embrace);if(n.length===1){var post=m.post.length?expand(m.post,false):[""];return post.map(function(p){return m.pre+n[0]+p})}}}var pre=m.pre;var post=m.post.length?expand(m.post,false):[""];var N;if(isSequence){var x=numeric(n[0]);var y=numeric(n[1]);var width=Math.max(n[0].length,n[1].length);var incr=n.length==3?Math.abs(numeric(n[2])):1;var test=lte;var reverse=y<x;if(reverse){incr*=-1;test=gte}var pad=n.some(isPadded);N=[];for(var i=x;test(i,y);i+=incr){var c;if(isAlphaSequence){c=String.fromCharCode(i);if(c==="\\")c=""}else{c=String(i);if(pad){var need=width-c.length;if(need>0){var z=new Array(need+1).join("0");if(i<0)c="-"+z+c.slice(1);else c=z+c}}}N.push(c)}}else{N=concatMap(n,function(el){return expand(el,false)})}for(var j=0;j<N.length;j++){for(var k=0;k<post.length;k++){var expansion=pre+N[j]+post[k];if(!isTop||isSequence||expansion)expansions.push(expansion)}}return expansions}},{"balanced-match":22,"concat-map":23}],22:[function(require,module,exports){module.exports=balanced;function balanced(a,b,str){var bal=0;var m={};var ended=false;for(var i=0;i<str.length;i++){if(a==str.substr(i,a.length)){if(!("start"in m))m.start=i;bal++}else if(b==str.substr(i,b.length)&&"start"in m){ended=true;bal--;if(!bal){m.end=i;m.pre=str.substr(0,m.start);m.body=m.end-m.start>1?str.substring(m.start+a.length,m.end):"";m.post=str.slice(m.end+b.length);return m}}}if(bal&&ended){var start=m.start+a.length;m=balanced(a,b,str.substr(start));if(m){m.start+=start;m.end+=start;m.pre=str.slice(0,start)+m.pre}return m}}},{}],23:[function(require,module,exports){module.exports=function(xs,fn){var res=[];for(var i=0;i<xs.length;i++){var x=fn(xs[i],i);if(isArray(x))res.push.apply(res,x);else res.push(x)}return res};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}},{}],globby:[function(require,module,exports){"use strict";var union=require("array-union");var async=require("async");var glob=require("glob");var Minimatch=require("minimatch").Minimatch;function arrayify(arr){return Array.isArray(arr)?arr:[arr]}module.exports=function(patterns,opts,cb){patterns=arrayify(patterns);if(typeof opts==="function"){cb=opts;opts={}}var positives=[];var negatives=[];patterns.forEach(function(pattern,index){(pattern[0]==="!"?negatives:positives).push({index:index,pattern:pattern})});if(positives.length===0){cb(null,[]);return}negatives.forEach(function(negative){negative.matcher=new Minimatch(negative.pattern,opts)});async.parallel(positives.map(function(positive){return function(cb2){glob(positive.pattern,opts,function(err,paths){if(err){cb2(err);return}var negativeMatchers=negatives.filter(function(negative){return negative.index>positive.index}).map(function(negative){return negative.matcher});if(negativeMatchers.length===0){cb2(null,paths);return}cb2(null,paths.filter(function(path){return negativeMatchers.every(function(matcher){return matcher.match(path)})}))})}}),function(err,paths){if(err){cb(err);return}cb(null,union.apply(null,paths))})};module.exports.sync=function(patterns,opts){patterns=arrayify(patterns);if(patterns.length===0){return[]}opts=opts||{};return patterns.reduce(function(ret,pattern){if(pattern[0]==="!"){var matcher=new Minimatch(pattern,opts);return ret.filter(function(path){return matcher.match(path)})}return union(ret,glob.sync(pattern,opts))},[])}},{"array-union":9,async:11,glob:13,minimatch:20}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){var util=require("util/");var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;var assert=module.exports=ok;assert.AssertionError=function AssertionError(options){this.name="AssertionError";this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false}else{this.message=getMessage(this);this.generatedMessage=true}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction)}else{var err=new Error;if(err.stack){var out=err.stack;var fn_name=stackStartFunction.name;var idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&(isNaN(value)||!isFinite(value))){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n)}else{return s}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}assert.fail=fail;function ok(value,message){if(!value)fail(value,true,message,"==",assert.ok)}assert.ok=ok;assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,"==",assert.equal)};assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,"!=",assert.notEqual)}};assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,"deepEqual",assert.deepEqual)}};function _deepEqual(actual,expected){if(actual===expected){return true}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false}return true}else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime()}else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase}else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected}else{return objEquiv(actual,expected)}}function isArguments(object){return Object.prototype.toString.call(object)=="[object Arguments]"}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;if(a.prototype!==b.prototype)return false;if(isArguments(a)){if(!isArguments(b)){return false}a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b)}try{var ka=objectKeys(a),kb=objectKeys(b),key,i}catch(e){return false}if(ka.length!=kb.length)return false;ka.sort();kb.sort();for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":8}],3:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}throw TypeError('Uncaught, unspecified "error" event.')}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){var m;if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],4:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],5:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:6}],6:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],7:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],8:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":7,_process:6,inherits:4}],9:[function(require,module,exports){"use strict";module.exports=function slice(arr,start,end){var len=arr.length>>>0;var range=[];start=idx(arr,start);end=idx(arr,end,len);while(start<end){range.push(arr[start++])}return range};function idx(arr,pos,end){var len=arr.length>>>0;if(pos==null){pos=end||0}else if(pos<0){pos=Math.max(len+pos,0)}else{pos=Math.min(pos,len)}return pos}},{}],10:[function(require,module,exports){exports=module.exports=require("./debug");exports.log=log;exports.formatArgs=formatArgs;exports.save=save;exports.load=load;exports.useColors=useColors;var storage;if(typeof chrome!=="undefined"&&typeof chrome.storage!=="undefined")storage=chrome.storage.local;else storage=window.localStorage;exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function useColors(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31 | |
}exports.formatters.j=function(v){return JSON.stringify(v)};function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff);if(!useColors)return args;var c="color: "+this.color;args=[args[0],c,"color: inherit"].concat(Array.prototype.slice.call(args,1));var index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if("%%"===match)return;index++;if("%c"===match){lastC=index}});args.splice(lastC,0,c);return args}function log(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{if(null==namespaces){storage.removeItem("debug")}else{storage.debug=namespaces}}catch(e){}}function load(){var r;try{r=storage.debug}catch(e){}return r}exports.enable(load())},{"./debug":11}],11:[function(require,module,exports){exports=module.exports=debug;exports.coerce=coerce;exports.disable=disable;exports.enable=enable;exports.enabled=enabled;exports.humanize=require("ms");exports.names=[];exports.skips=[];exports.formatters={};var prevColor=0;var prevTime;function selectColor(){return exports.colors[prevColor++%exports.colors.length]}function debug(namespace){function disabled(){}disabled.enabled=false;function enabled(){var self=enabled;var curr=+new Date;var ms=curr-(prevTime||curr);self.diff=ms;self.prev=prevTime;self.curr=curr;prevTime=curr;if(null==self.useColors)self.useColors=exports.useColors();if(null==self.color&&self.useColors)self.color=selectColor();var args=Array.prototype.slice.call(arguments);args[0]=exports.coerce(args[0]);if("string"!==typeof args[0]){args=["%o"].concat(args)}var index=0;args[0]=args[0].replace(/%([a-z%])/g,function(match,format){if(match==="%%")return match;index++;var formatter=exports.formatters[format];if("function"===typeof formatter){var val=args[index];match=formatter.call(self,val);args.splice(index,1);index--}return match});if("function"===typeof exports.formatArgs){args=exports.formatArgs.apply(self,args)}var logFn=enabled.log||exports.log||console.log.bind(console);logFn.apply(self,args)}enabled.enabled=true;var fn=exports.enabled(namespace)?enabled:disabled;fn.namespace=namespace;return fn}function enable(namespaces){exports.save(namespaces);var split=(namespaces||"").split(/[\s,]+/);var len=split.length;for(var i=0;i<len;i++){if(!split[i])continue;namespaces=split[i].replace(/\*/g,".*?");if(namespaces[0]==="-"){exports.skips.push(new RegExp("^"+namespaces.substr(1)+"$"))}else{exports.names.push(new RegExp("^"+namespaces+"$"))}}}function disable(){exports.enable("")}function enabled(name){var i,len;for(i=0,len=exports.skips.length;i<len;i++){if(exports.skips[i].test(name)){return false}}for(i=0,len=exports.names.length;i<len;i++){if(exports.names[i].test(name)){return true}}return false}function coerce(val){if(val instanceof Error)return val.stack||val.message;return val}},{ms:12}],12:[function(require,module,exports){var s=1e3;var m=s*60;var h=m*60;var d=h*24;var y=d*365.25;module.exports=function(val,options){options=options||{};if("string"==typeof val)return parse(val);return options.long?long(val):short(val)};function parse(str){var match=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);if(!match)return;var n=parseFloat(match[1]);var type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"h":return n*h;case"minutes":case"minute":case"m":return n*m;case"seconds":case"second":case"s":return n*s;case"ms":return n}}function short(ms){if(ms>=d)return Math.round(ms/d)+"d";if(ms>=h)return Math.round(ms/h)+"h";if(ms>=m)return Math.round(ms/m)+"m";if(ms>=s)return Math.round(ms/s)+"s";return ms+"ms"}function long(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(ms<n)return;if(ms<n*1.5)return Math.floor(ms/n)+" "+name;return Math.ceil(ms/n)+" "+name+"s"}},{}],13:[function(require,module,exports){"use strict";var slice=require("array-slice");module.exports=function extend(o){if(o==null){return{}}var args=slice(arguments,1);var len=args.length;var i=0;if(len===0){return o}while(len--){var obj=args[i++];for(var key in obj){if(obj.hasOwnProperty(key)){o[key]=obj[key]}}}return o}},{"array-slice":9}],14:[function(require,module,exports){"use strict";var forIn=require("for-in");module.exports=function forOwn(o,fn,thisArg){forIn(o,function(val,key){if(hasOwn(o,key)){return fn.call(thisArg,o[key],key,o)}})};function hasOwn(o,prop){return{}.hasOwnProperty.call(o,prop)}},{"for-in":15}],15:[function(require,module,exports){"use strict";module.exports=function forIn(o,fn,thisArg){for(var key in o){if(fn.call(thisArg,o[key],key,o)===false){break}}}},{}],16:[function(require,module,exports){"use strict";var loader=require("load-helpers");var randomize=require("randomatic");var _=require("lodash");function Helpers(options){if(!(this instanceof Helpers)){return new Helpers(options)}var opts=_.defaults({},options,{bind:false,thisArg:this});defineGetter(this,"options",function(){return opts});var obj={asyncHelpers:{},waiting:[]};defineGetter(this,"_",function(){return obj})}defineGetter(Helpers.prototype,"addHelper",function(){return function(key,fn,thisArg){thisArg=thisArg||this.options.thisArg;if(typeof key!=="string"){_.extend(this,key)}else{if(this.options.bind){this[key]=_.bind(fn,thisArg)}else{this[key]=fn}}return this}.bind(this)});defineGetter(Helpers.prototype,"addAsyncHelper",function(){return function(key,fn,thisArg){thisArg=thisArg||this.options.thisArg;if(typeof key!=="string"){_.forOwn(key,function(value,k){this.addAsyncHelper(k,value,thisArg)},this)}else{var self=this;if(this.options.bind){this._.asyncHelpers[key]=_.bind(fn,thisArg||this)}else{this._.asyncHelpers[key]=fn}this.addHelper(key,function(){var id="__async_helper_id__"+randomize("Aa0",42)+"__";var args=[].slice.call(arguments);self._.waiting.push({id:id,key:key,args:args,fn:fn.bind(this)});return id})}return this}});defineGetter(Helpers.prototype,"addHelpers",function(){return function(){var thisArg=this.options.thisArg;loader.init();var helpers=loader.load.apply(loader,arguments);_.forIn(helpers.cache,function(value,key){var o={};if(this.options.bind){o[key]=_.bind(value,thisArg)}else{o[key]=value}_.extend(this,o)},this);return this}.bind(this)});defineGetter(Helpers.prototype,"addAsyncHelpers",function(){return function(){var thisArg=this.options.thisArg;loader.init();var helpers=loader.load.apply(loader,arguments);return this.addAsyncHelper(helpers.cache)}.bind(this)});defineGetter(Helpers.prototype,"getHelper",function(){return function(key){if(!key){return this}return this[key]}.bind(this)});defineGetter(Helpers.prototype,"getAsyncHelper",function(){return function(key){if(!key){return this._.asyncHelpers}return this._.asyncHelpers[key]}.bind(this)});defineGetter(Helpers.prototype,"resolve",function(){return function(content,cb){var self=this;var i=0;var next=function(err,content){var helper=self._.waiting[i++];if(helper){var fn=helper.fn;if(!fn)return next(null,content);if(content.indexOf(helper.id)===-1){return next(null,content)}var args=helper.args||[];var nextCallback=function(err,results){if(err)return cb(err);content=content.replace(helper.id,results);next(null,content)};if(args[args.length-1].toString()!==nextCallback.toString()){args.push(nextCallback)}fn.apply(fn,args)}else{return cb(null,content)}};return next(null,content)}});function defineGetter(obj,name,getter){Object.defineProperty(obj,name,{configurable:false,enumerable:false,get:getter,set:function(){}})}module.exports=Helpers},{"load-helpers":17,lodash:68,randomatic:69}],17:[function(require,module,exports){"use strict";var _=require("lodash");var boson=require("boson");var debug=require("debug")("helpers-loader");var extend=_.extend;function loader(options){loader.init(options);return loader}loader.options={};loader.cache={};loader.init=function(opts){debug("init",arguments);this.options=opts||{};this.cache={}};loader.option=function(key,value){var args=[].slice.call(arguments);if(args.length===1&&typeof key==="string"){return this.options[key]}if(typeof key==="object"){extend.apply(_,[this.options].concat(args));return this}this.options[key]=value;return this};loader.load=function(value){var args=[].slice.call(arguments);debug("helpers",arguments);if(!value){return value}var method=this["_"+typeOf(value)];if(method){return method.apply(this,args)}return null};loader.set=function(name,helper){var o={};o[name]=helper;this.load(o);return this};loader.get=function(helper){if(!helper){return this.cache}return this.cache[helper]};loader._string=function(name,options){var opts=extend({},this.options,options);var helpers=boson(name,opts);this.load(helpers);return this};loader._object=function(helper){_.extend.apply(_,[this.cache].concat(helper));return this};loader._function=function(fn){var helper=fn.call();if(typeOf(helper)==="object"){return this._object(helper)}this.load(helper);return this};loader._array=function(arr){_.unique(arr).forEach(function(helper){return loader.load(helper)});return this};function typeOf(value){return Object.prototype.toString.call(value).toLowerCase().replace(/\[object ([\S]+)\]/,"$1")}module.exports=loader},{boson:18,debug:65,lodash:68}],18:[function(require,module,exports){"use strict";var resolve=require("resolve-dep");var boson=module.exports=function(patterns,config,options){return boson.register(patterns,options).map(function(fn){if(typeof fn==="function"){try{return fn(config)}catch(err){return fn}}return fn})};boson.find=function(patterns,options){return resolve(patterns,options)};boson.register=function(patterns,options){return boson.find(patterns,options).map(function(filepath){return require(filepath)})}},{"resolve-dep":19}],19:[function(require,module,exports){(function(process){"use strict";var cwd=require("cwd");var glob=require("globby");var resolve=require("resolve");var arrayify=require("arrayify-compact");var multimatch=require("multimatch");var lookup=require("lookup-path");var pkg=require("load-pkg");var _=require("lodash");var extend=_.extend;var resolveDep=function(patterns,options){if(options&&options.strict){if(patterns[0]!=="."){return resolveDep.npm(patterns,options)}return resolveDep.local(patterns,options)}else{var locals=resolveDep.local(patterns,options);var npm=resolveDep.npm(patterns,options);return locals.concat(npm)}};resolveDep.npm=function(patterns,options){options=options||{};var defaults=["dependencies","devDependencies","peerDependencies"];var types=options.type||defaults;patterns=arrayify(patterns);types=arrayify(types);if(types[0]==="all"){types=defaults}var configObj=options.config||pkg;var modules=arrayify(types.map(function(type){return configObj[type]?Object.keys(configObj[type]):null})).filter(Boolean);if(!modules.length||!patterns.length){return[]}var deps=[];var matches=multimatch(modules,patterns,options);if(matches.length){matches.forEach(function(match){deps=deps.concat(resolve.sync(match,{basedir:cwd()}))})}return deps.map(function(filepath){return lookup(filepath,options.cwd)})};resolveDep.local=function(patterns,options){options=options||{};options.cwd=options.srcBase=cwd(options.cwd||process.cwd());patterns=arrayify(arrayify(patterns));if(!patterns.length){return[]}return glob.sync(patterns,options).map(function(filepath){return lookup(filepath,options.cwd)})};resolveDep.deps=function(patterns,options){return resolveDep.npm(patterns,extend({type:"dependencies"},options))};resolveDep.dev=function(patterns,options){return resolveDep.npm(patterns,extend({type:"devDependencies"},options))};resolveDep.peer=function(patterns,options){return resolveDep.npm(patterns,extend({type:"peerDependencies"},options))};module.exports=resolveDep}).call(this,require("_process"))},{_process:6,"arrayify-compact":20,cwd:22,globby:30,"load-pkg":47,lodash:68,"lookup-path":48,multimatch:51,resolve:58}],20:[function(require,module,exports){"use strict";var flatten=require("array-flatten");module.exports=function(arr){return flatten(!Array.isArray(arr)?[arr]:arr).filter(Boolean)}},{"array-flatten":21}],21:[function(require,module,exports){function flatten(array,result,depth){for(var i=0;i<array.length;i++){if(depth>0&&Array.isArray(array[i])){flatten(array[i],result,depth-1)}else{result.push(array[i])}}return result}module.exports=function(array,depth){return flatten(array,[],depth||Infinity)}},{}],22:[function(require,module,exports){(function(process){var path=require("path");var normalize=require("normalize-path");var findup=require("findup-sync");module.exports=function cwd(){var filepath=path.join.apply(path,[].slice.call(arguments));var base=path.dirname(findup("package.json",{cwd:process.cwd()}));return normalize(path.resolve(base,filepath||""))}}).call(this,require("_process"))},{_process:6,"findup-sync":23,"normalize-path":29,path:5}],23:[function(require,module,exports){"use strict";var path=require("path");var glob=require("glob");var _=require("lodash");module.exports=function(patterns,options){if(!Array.isArray(patterns)){patterns=[patterns]}var globOptions=Object.create(options||{});globOptions.maxDepth=1;globOptions.cwd=path.resolve(globOptions.cwd||".");var files,lastpath;do{files=_(patterns).map(function(pattern){return glob.sync(pattern,globOptions)}).flatten().uniq().value();if(files.length>0){return path.resolve(path.join(globOptions.cwd,files[0]))}lastpath=globOptions.cwd;globOptions.cwd=path.resolve(globOptions.cwd,"..")}while(globOptions.cwd!==lastpath);return null}},{glob:24,lodash:68,path:5}],24:[function(require,module,exports){(function(process){module.exports=glob;var fs=require("fs"),minimatch=require("minimatch"),Minimatch=minimatch.Minimatch,inherits=require("inherits"),EE=require("events").EventEmitter,path=require("path"),isDir={},assert=require("assert").ok;function glob(pattern,options,cb){if(typeof options==="function")cb=options,options={};if(!options)options={};if(typeof options==="number"){deprecated();return}var g=new Glob(pattern,options,cb);return g.sync?g.found:g}glob.fnmatch=deprecated;function deprecated(){throw new Error("glob's interface has changed. Please see the docs.")}glob.sync=globSync;function globSync(pattern,options){if(typeof options==="number"){deprecated();return}options=options||{};options.sync=true;return glob(pattern,options)}this._processingEmitQueue=false;glob.Glob=Glob;inherits(Glob,EE);function Glob(pattern,options,cb){if(!(this instanceof Glob)){return new Glob(pattern,options,cb)}if(typeof options==="function"){cb=options;options=null}if(typeof cb==="function"){this.on("error",cb);this.on("end",function(matches){cb(null,matches)})}options=options||{};this._endEmitted=false;this.EOF={};this._emitQueue=[];this.paused=false;this._processingEmitQueue=false;this.maxDepth=options.maxDepth||1e3;this.maxLength=options.maxLength||Infinity;this.cache=options.cache||{};this.statCache=options.statCache||{};this.changedCwd=false;var cwd=process.cwd();if(!options.hasOwnProperty("cwd"))this.cwd=cwd;else{this.cwd=options.cwd;this.changedCwd=path.resolve(options.cwd)!==cwd}this.root=options.root||path.resolve(this.cwd,"/");this.root=path.resolve(this.root);if(process.platform==="win32")this.root=this.root.replace(/\\/g,"/");this.nomount=!!options.nomount;if(!pattern){throw new Error("must provide pattern")}if(options.matchBase&&-1===pattern.indexOf("/")){if(options.noglobstar){throw new Error("base matching requires globstar")}pattern="**/"+pattern}this.strict=options.strict!==false;this.dot=!!options.dot;this.mark=!!options.mark;this.sync=!!options.sync;this.nounique=!!options.nounique;this.nonull=!!options.nonull;this.nosort=!!options.nosort;this.nocase=!!options.nocase;this.stat=!!options.stat;this.debug=!!options.debug||!!options.globDebug;if(this.debug)this.log=console.error;this.silent=!!options.silent;var mm=this.minimatch=new Minimatch(pattern,options);this.options=mm.options;pattern=this.pattern=mm.pattern;this.error=null;this.aborted=false;this._globstars={};EE.call(this);var n=this.minimatch.set.length;this.matches=new Array(n);this.minimatch.set.forEach(iterator.bind(this));function iterator(pattern,i,set){this._process(pattern,0,i,function(er){if(er)this.emit("error",er);if(--n<=0)this._finish()})}}Glob.prototype.log=function(){};Glob.prototype._finish=function(){assert(this instanceof Glob);var nou=this.nounique,all=nou?[]:{};for(var i=0,l=this.matches.length;i<l;i++){var matches=this.matches[i];this.log("matches[%d] =",i,matches);if(!matches){if(this.nonull){var literal=this.minimatch.globSet[i];if(nou)all.push(literal);else all[literal]=true}}else{var m=Object.keys(matches);if(nou)all.push.apply(all,m);else m.forEach(function(m){all[m]=true})}}if(!nou)all=Object.keys(all);if(!this.nosort){all=all.sort(this.nocase?alphasorti:alphasort)}if(this.mark){all=all.map(this._mark,this)}this.log("emitting end",all);this.EOF=this.found=all;this.emitMatch(this.EOF)};function alphasorti(a,b){a=a.toLowerCase();b=b.toLowerCase();return alphasort(a,b)}function alphasort(a,b){return a>b?1:a<b?-1:0}Glob.prototype._mark=function(p){var c=this.cache[p];var m=p;if(c){var isDir=c===2||Array.isArray(c);var slash=p.slice(-1)==="/";if(isDir&&!slash)m+="/";else if(!isDir&&slash)m=m.slice(0,-1);if(m!==p){this.statCache[m]=this.statCache[p];this.cache[m]=this.cache[p]}}return m};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(this.paused)return;if(this.sync)this.emit("error",new Error("Can't pause/resume sync glob"));this.paused=true;this.emit("pause")};Glob.prototype.resume=function(){if(!this.paused)return;if(this.sync)this.emit("error",new Error("Can't pause/resume sync glob"));this.paused=false;this.emit("resume");this._processEmitQueue()};Glob.prototype.emitMatch=function(m){this.log("emitMatch",m);this._emitQueue.push(m);this._processEmitQueue()};Glob.prototype._processEmitQueue=function(m){this.log("pEQ paused=%j processing=%j m=%j",this.paused,this._processingEmitQueue,m);var done=false;while(!this._processingEmitQueue&&!this.paused){this._processingEmitQueue=true;var m=this._emitQueue.shift();this.log(">processEmitQueue",m===this.EOF?":EOF:":m);if(!m){this.log(">processEmitQueue, falsey m");this._processingEmitQueue=false;break}if(m===this.EOF||!(this.mark&&!this.stat)){this.log("peq: unmarked, or eof");next.call(this,0,false)}else if(this.statCache[m]){var sc=this.statCache[m];var exists;if(sc)exists=sc.isDirectory()?2:1;this.log("peq: stat cached");next.call(this,exists,exists===2)}else{this.log("peq: _stat, then next");this._stat(m,next)}function next(exists,isDir){this.log("next",m,exists,isDir);var ev=m===this.EOF?"end":"match";assert(!this._endEmitted);if(ev==="end")this._endEmitted=true;if(exists){if(isDir&&!m.match(/\/$/)){m=m+"/"}else if(!isDir&&m.match(/\/$/)){m=m.replace(/\/+$/,"")}}this.log("emit",ev,m);this.emit(ev,m);this._processingEmitQueue=false;if(done&&m!==this.EOF&&!this.paused)this._processEmitQueue()}}done=true};Glob.prototype._process=function(pattern,depth,index,cb_){assert(this instanceof Glob);var cb=function cb(er,res){assert(this instanceof Glob);if(this.paused){if(!this._processQueue){this._processQueue=[];this.once("resume",function(){var q=this._processQueue;this._processQueue=null;q.forEach(function(cb){cb()})})}this._processQueue.push(cb_.bind(this,er,res))}else{cb_.call(this,er,res)}}.bind(this);if(this.aborted)return cb();if(depth>this.maxDepth)return cb();var n=0;while(typeof pattern[n]==="string"){n++}var prefix;switch(n){case pattern.length:prefix=pattern.join("/");this._stat(prefix,function(exists,isDir){if(exists){if(prefix&&isAbsolute(prefix)&&!this.nomount){if(prefix.charAt(0)==="/"){prefix=path.join(this.root,prefix)}else{prefix=path.resolve(this.root,prefix)}}if(process.platform==="win32")prefix=prefix.replace(/\\/g,"/");this.matches[index]=this.matches[index]||{};this.matches[index][prefix]=true;this.emitMatch(prefix)}return cb()});return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n);prefix=prefix.join("/");break}var read;if(prefix===null)read=".";else if(isAbsolute(prefix)||isAbsolute(pattern.join("/"))){if(!prefix||!isAbsolute(prefix)){prefix=path.join("/",prefix)}read=prefix=path.resolve(prefix);this.log("absolute: ",prefix,this.root,pattern,read)}else{read=prefix}this.log("readdir(%j)",read,this.cwd,this.root);return this._readdir(read,function(er,entries){if(er){return cb()}if(pattern[n]===minimatch.GLOBSTAR){var s=[pattern.slice(0,n).concat(pattern.slice(n+1))];entries.forEach(function(e){if(e.charAt(0)==="."&&!this.dot)return;s.push(pattern.slice(0,n).concat(e).concat(pattern.slice(n+1)));s.push(pattern.slice(0,n).concat(e).concat(pattern.slice(n)))},this);s=s.filter(function(pattern){var key=gsKey(pattern);var seen=!this._globstars[key];this._globstars[key]=true;return seen},this);if(!s.length)return cb();var l=s.length,errState=null;s.forEach(function(gsPattern){this._process(gsPattern,depth+1,index,function(er){if(errState)return;if(er)return cb(errState=er);if(--l<=0)return cb()})},this);return}var pn=pattern[n];var rawGlob=pattern[n]._glob,dotOk=this.dot||rawGlob.charAt(0)===".";entries=entries.filter(function(e){return(e.charAt(0)!=="."||dotOk)&&e.match(pattern[n])});if(n===pattern.length-1&&!this.mark&&!this.stat){entries.forEach(function(e){if(prefix){if(prefix!=="/")e=prefix+"/"+e;else e=prefix+e}if(e.charAt(0)==="/"&&!this.nomount){e=path.join(this.root,e)}if(process.platform==="win32")e=e.replace(/\\/g,"/");this.matches[index]=this.matches[index]||{};this.matches[index][e]=true;this.emitMatch(e)},this);return cb.call(this)}var l=entries.length,errState=null;if(l===0)return cb();entries.forEach(function(e){var p=pattern.slice(0,n).concat(e).concat(pattern.slice(n+1));this._process(p,depth+1,index,function(er){if(errState)return;if(er)return cb(errState=er);if(--l===0)return cb.call(this)})},this)})};function gsKey(pattern){return"**"+pattern.map(function(p){return p===minimatch.GLOBSTAR?"**":""+p}).join("/")}Glob.prototype._stat=function(f,cb){assert(this instanceof Glob);var abs=f;if(f.charAt(0)==="/"){abs=path.join(this.root,f)}else if(this.changedCwd){abs=path.resolve(this.cwd,f)}if(f.length>this.maxLength){var er=new Error("Path name too long");er.code="ENAMETOOLONG";er.path=f;return this._afterStat(f,abs,cb,er)}this.log("stat",[this.cwd,f,"=",abs]);if(!this.stat&&this.cache.hasOwnProperty(f)){var exists=this.cache[f],isDir=exists&&(Array.isArray(exists)||exists===2);if(this.sync)return cb.call(this,!!exists,isDir);return process.nextTick(cb.bind(this,!!exists,isDir))}var stat=this.statCache[abs];if(this.sync||stat){var er;try{stat=fs.statSync(abs)}catch(e){er=e}this._afterStat(f,abs,cb,er,stat)}else{fs.stat(abs,this._afterStat.bind(this,f,abs,cb))}};Glob.prototype._afterStat=function(f,abs,cb,er,stat){var exists;assert(this instanceof Glob);if(abs.slice(-1)==="/"&&stat&&!stat.isDirectory()){this.log("should be ENOTDIR, fake it");er=new Error("ENOTDIR, not a directory '"+abs+"'");er.path=abs;er.code="ENOTDIR";stat=null}var emit=!this.statCache[abs];this.statCache[abs]=stat;if(er||!stat){exists=false}else{exists=stat.isDirectory()?2:1;if(emit)this.emit("stat",f,stat)}this.cache[f]=this.cache[f]||exists;cb.call(this,!!exists,exists===2)};Glob.prototype._readdir=function(f,cb){assert(this instanceof Glob);var abs=f;if(f.charAt(0)==="/"){abs=path.join(this.root,f)}else if(isAbsolute(f)){abs=f}else if(this.changedCwd){abs=path.resolve(this.cwd,f)}if(f.length>this.maxLength){var er=new Error("Path name too long");er.code="ENAMETOOLONG";er.path=f;return this._afterReaddir(f,abs,cb,er)}this.log("readdir",[this.cwd,f,abs]);if(this.cache.hasOwnProperty(f)){var c=this.cache[f];if(Array.isArray(c)){if(this.sync)return cb.call(this,null,c);return process.nextTick(cb.bind(this,null,c))}if(!c||c===1){var code=c?"ENOTDIR":"ENOENT",er=new Error((c?"Not a directory":"Not found")+": "+f);er.path=f;er.code=code;this.log(f,er);if(this.sync)return cb.call(this,er);return process.nextTick(cb.bind(this,er))}}if(this.sync){var er,entries;try{entries=fs.readdirSync(abs)}catch(e){er=e}return this._afterReaddir(f,abs,cb,er,entries)}fs.readdir(abs,this._afterReaddir.bind(this,f,abs,cb))};Glob.prototype._afterReaddir=function(f,abs,cb,er,entries){assert(this instanceof Glob);if(entries&&!er){this.cache[f]=entries;if(!this.mark&&!this.stat){entries.forEach(function(e){if(f==="/")e=f+e;else e=f+"/"+e;this.cache[e]=true},this)}return cb.call(this,er,entries)}if(er)switch(er.code){case"ENOTDIR":this.cache[f]=1;return cb.call(this,er);case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[f]=false;return cb.call(this,er);default:this.cache[f]=false;if(this.strict)this.emit("error",er);if(!this.silent)console.error("glob error",er);return cb.call(this,er)}};var isAbsolute=process.platform==="win32"?absWin:absUnix;function absWin(p){if(absUnix(p))return true;var splitDeviceRe=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,result=splitDeviceRe.exec(p),device=result[1]||"",isUnc=device&&device.charAt(1)!==":",isAbsolute=!!result[2]||isUnc;return isAbsolute}function absUnix(p){return p.charAt(0)==="/"||p===""}}).call(this,require("_process"))},{_process:6,assert:2,events:3,fs:1,inherits:25,minimatch:26,path:5}],25:[function(require,module,exports){arguments[4][4][0].apply(exports,arguments)},{dup:4}],26:[function(require,module,exports){(function(process){(function(require,exports,module,platform){if(module)module.exports=minimatch;else exports.minimatch=minimatch;if(!require){require=function(id){switch(id){case"sigmund":return function sigmund(obj){return JSON.stringify(obj)};case"path":return{basename:function(f){f=f.split(/[\/\\]/);var e=f.pop();if(!e)e=f.pop();return e}};case"lru-cache":return function LRUCache(){var cache={};var cnt=0;this.set=function(k,v){cnt++;if(cnt>=100)cache={};cache[k]=v};this.get=function(k){return cache[k]}}}}}minimatch.Minimatch=Minimatch;var LRU=require("lru-cache"),cache=minimatch.cache=new LRU({max:100}),GLOBSTAR=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={},sigmund=require("sigmund");var path=require("path"),qmark="[^/]",star=qmark+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",reSpecials=charSet("().*{}+?[]^$\\!");function charSet(s){return s.split("").reduce(function(set,c){set[c]=true;return set},{})}var slashSplit=/\/+/;minimatch.filter=filter;function filter(pattern,options){options=options||{};return function(p,i,list){return minimatch(p,pattern,options)}}function ext(a,b){a=a||{};b=b||{};var t={};Object.keys(b).forEach(function(k){t[k]=b[k]});Object.keys(a).forEach(function(k){t[k]=a[k]});return t}minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return minimatch;var orig=minimatch;var m=function minimatch(p,pattern,options){return orig.minimatch(p,pattern,ext(def,options))};m.Minimatch=function Minimatch(pattern,options){return new orig.Minimatch(pattern,ext(def,options))};return m};Minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return Minimatch;return minimatch.defaults(def).Minimatch};function minimatch(p,pattern,options){if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};if(!options.nocomment&&pattern.charAt(0)==="#"){return false}if(pattern.trim()==="")return p==="";return new Minimatch(pattern,options).match(p)}function Minimatch(pattern,options){if(!(this instanceof Minimatch)){return new Minimatch(pattern,options,cache)}if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};pattern=pattern.trim();if(platform==="win32"){pattern=pattern.split("\\").join("/")}var cacheKey=pattern+"\n"+sigmund(options);var cached=minimatch.cache.get(cacheKey);if(cached)return cached;minimatch.cache.set(cacheKey,this);this.options=options;this.set=[];this.pattern=pattern;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){if(this._made)return;var pattern=this.pattern;var options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=true;return}if(!pattern){this.empty=true;return}this.parseNegate();var set=this.globSet=this.braceExpand();if(options.debug)this.debug=console.error;this.debug(this.pattern,set);set=this.globParts=set.map(function(s){return s.split(slashSplit)});this.debug(this.pattern,set);set=set.map(function(s,si,set){return s.map(this.parse,this)},this);this.debug(this.pattern,set);set=set.filter(function(s){return-1===s.indexOf(false)});this.debug(this.pattern,set);this.set=set}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var pattern=this.pattern,negate=false,options=this.options,negateOffset=0;if(options.nonegate)return;for(var i=0,l=pattern.length;i<l&&pattern.charAt(i)==="!";i++){negate=!negate;negateOffset++}if(negateOffset)this.pattern=pattern.substr(negateOffset);this.negate=negate}minimatch.braceExpand=function(pattern,options){return new Minimatch(pattern,options).braceExpand()};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(pattern,options){options=options||this.options;pattern=typeof pattern==="undefined"?this.pattern:pattern;if(typeof pattern==="undefined"){throw new Error("undefined pattern")}if(options.nobrace||!pattern.match(/\{.*\}/)){return[pattern]}var escaping=false;if(pattern.charAt(0)!=="{"){this.debug(pattern);var prefix=null;for(var i=0,l=pattern.length;i<l;i++){var c=pattern.charAt(i);this.debug(i,c);if(c==="\\"){escaping=!escaping}else if(c==="{"&&!escaping){prefix=pattern.substr(0,i);break}}if(prefix===null){this.debug("no sets");return[pattern]}var tail=braceExpand.call(this,pattern.substr(i),options);return tail.map(function(t){return prefix+t})}var numset=pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(numset){this.debug("numset",numset[1],numset[2]);var suf=braceExpand.call(this,pattern.substr(numset[0].length),options),start=+numset[1],end=+numset[2],inc=start>end?-1:1,set=[];for(var i=start;i!=end+inc;i+=inc){for(var ii=0,ll=suf.length;ii<ll;ii++){set.push(i+suf[ii])}}return set}var i=1,depth=1,set=[],member="",sawEnd=false,escaping=false;function addMember(){set.push(member);member=""}this.debug("Entering for");FOR:for(i=1,l=pattern.length;i<l;i++){var c=pattern.charAt(i);this.debug("",i,c);if(escaping){escaping=false;member+="\\"+c}else{switch(c){case"\\":escaping=true;continue;case"{":depth++;member+="{";continue;case"}":depth--;if(depth===0){addMember();i++;break FOR}else{member+=c;continue}case",":if(depth===1){addMember()}else{member+=c}continue;default:member+=c;continue}}}if(depth!==0){this.debug("didn't close",pattern);return braceExpand.call(this,"\\"+pattern,options)}this.debug("set",set);this.debug("suffix",pattern.substr(i));var suf=braceExpand.call(this,pattern.substr(i),options);var addBraces=set.length===1;this.debug("set pre-expanded",set);set=set.map(function(p){return braceExpand.call(this,p,options)},this);this.debug("set expanded",set);set=set.reduce(function(l,r){return l.concat(r)});if(addBraces){set=set.map(function(s){return"{"+s+"}"})}var ret=[];for(var i=0,l=set.length;i<l;i++){for(var ii=0,ll=suf.length;ii<ll;ii++){ret.push(set[i]+suf[ii])}}return ret}Minimatch.prototype.parse=parse;var SUBPARSE={};function parse(pattern,isSub){var options=this.options;if(!options.noglobstar&&pattern==="**")return GLOBSTAR;if(pattern==="")return"";var re="",hasMagic=!!options.nocase,escaping=false,patternListStack=[],plType,stateChar,inClass=false,reClassStart=-1,classStart=-1,patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",self=this;function clearStateChar(){if(stateChar){switch(stateChar){case"*":re+=star;hasMagic=true;break;case"?":re+=qmark;hasMagic=true;break;default:re+="\\"+stateChar; | |
break}self.debug("clearStateChar %j %j",stateChar,re);stateChar=false}}for(var i=0,len=pattern.length,c;i<len&&(c=pattern.charAt(i));i++){this.debug("%s %s %s %j",pattern,i,re,c);if(escaping&&reSpecials[c]){re+="\\"+c;escaping=false;continue}SWITCH:switch(c){case"/":return false;case"\\":clearStateChar();escaping=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c);if(inClass){this.debug(" in class");if(c==="!"&&i===classStart+1)c="^";re+=c;continue}self.debug("call clearStateChar %j",stateChar);clearStateChar();stateChar=c;if(options.noext)clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}plType=stateChar;patternListStack.push({type:plType,start:i-1,reStart:re.length});re+=stateChar==="!"?"(?:(?!":"(?:";this.debug("plType %j %j",stateChar,re);stateChar=false;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar();hasMagic=true;re+=")";plType=patternListStack.pop().type;switch(plType){case"!":re+="[^/]*?)";break;case"?":case"+":case"*":re+=plType;case"@":break}continue;case"|":if(inClass||!patternListStack.length||escaping){re+="\\|";escaping=false;continue}clearStateChar();re+="|";continue;case"[":clearStateChar();if(inClass){re+="\\"+c;continue}inClass=true;classStart=i;reClassStart=re.length;re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c;escaping=false;continue}hasMagic=true;inClass=false;re+=c;continue;default:clearStateChar();if(escaping){escaping=false}else if(reSpecials[c]&&!(c==="^"&&inClass)){re+="\\"}re+=c}}if(inClass){var cs=pattern.substr(classStart+1),sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0];hasMagic=hasMagic||sp[1]}var pl;while(pl=patternListStack.pop()){var tail=re.slice(pl.reStart+3);tail=tail.replace(/((?:\\{2})*)(\\?)\|/g,function(_,$1,$2){if(!$2){$2="\\"}return $1+$1+$2+"|"});this.debug("tail=%j\n %s",tail,tail);var t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=true;re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar();if(escaping){re+="\\\\"}var addPatternStart=false;switch(re.charAt(0)){case".":case"[":case"(":addPatternStart=true}if(re!==""&&hasMagic)re="(?=.)"+re;if(addPatternStart)re=patternStart+re;if(isSub===SUBPARSE){return[re,hasMagic]}if(!hasMagic){return globUnescape(pattern)}var flags=options.nocase?"i":"",regExp=new RegExp("^"+re+"$",flags);regExp._glob=pattern;regExp._src=re;return regExp}minimatch.makeRe=function(pattern,options){return new Minimatch(pattern,options||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var set=this.set;if(!set.length)return this.regexp=false;var options=this.options;var twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot,flags=options.nocase?"i":"";var re=set.map(function(pattern){return pattern.map(function(p){return p===GLOBSTAR?twoStar:typeof p==="string"?regExpEscape(p):p._src}).join("\\/")}).join("|");re="^(?:"+re+")$";if(this.negate)re="^(?!"+re+").*$";try{return this.regexp=new RegExp(re,flags)}catch(ex){return this.regexp=false}}minimatch.match=function(list,pattern,options){options=options||{};var mm=new Minimatch(pattern,options);list=list.filter(function(f){return mm.match(f)});if(mm.options.nonull&&!list.length){list.push(pattern)}return list};Minimatch.prototype.match=match;function match(f,partial){this.debug("match",f,this.pattern);if(this.comment)return false;if(this.empty)return f==="";if(f==="/"&&partial)return true;var options=this.options;if(platform==="win32"){f=f.split("\\").join("/")}f=f.split(slashSplit);this.debug(this.pattern,"split",f);var set=this.set;this.debug(this.pattern,"set",set);var filename;for(var i=f.length-1;i>=0;i--){filename=f[i];if(filename)break}for(var i=0,l=set.length;i<l;i++){var pattern=set[i],file=f;if(options.matchBase&&pattern.length===1){file=[filename]}var hit=this.matchOne(file,pattern,partial);if(hit){if(options.flipNegate)return true;return!this.negate}}if(options.flipNegate)return false;return this.negate}Minimatch.prototype.matchOne=function(file,pattern,partial){var options=this.options;this.debug("matchOne",{"this":this,file:file,pattern:pattern});this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f=file[fi];this.debug(pattern,p,f);if(p===false)return false;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi,pr=pi+1;if(pr===pl){this.debug("** at the end");for(;fi<fl;fi++){if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return false}return true}WHILE:while(fr<fl){var swallowee=file[fr];this.debug("\nglobstar while",file,fr,pattern,pr,swallowee);if(this.matchOne(file.slice(fr),pattern.slice(pr),partial)){this.debug("globstar found match!",fr,fl,swallowee);return true}else{if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break WHILE}this.debug("globstar swallow a segment, and continue");fr++}}if(partial){this.debug("\n>>> no match, partial?",file,fr,pattern,pr);if(fr===fl)return true}return false}var hit;if(typeof p==="string"){if(options.nocase){hit=f.toLowerCase()===p.toLowerCase()}else{hit=f===p}this.debug("string match",p,f,hit)}else{hit=f.match(p);this.debug("pattern match",p,f,hit)}if(!hit)return false}if(fi===fl&&pi===pl){return true}else if(fi===fl){return partial}else if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}})(typeof require==="function"?require:null,this,typeof module==="object"?module:null,typeof process==="object"?process.platform:"win32")}).call(this,require("_process"))},{_process:6,"lru-cache":27,path:5,sigmund:28}],27:[function(require,module,exports){(function(){if(typeof module==="object"&&module.exports){module.exports=LRUCache}else{this.LRUCache=LRUCache}function hOP(obj,key){return Object.prototype.hasOwnProperty.call(obj,key)}function naiveLength(){return 1}function LRUCache(options){if(!(this instanceof LRUCache))return new LRUCache(options);if(typeof options==="number")options={max:options};if(!options)options={};this._max=options.max;if(!this._max||!(typeof this._max==="number")||this._max<=0)this._max=Infinity;this._lengthCalculator=options.length||naiveLength;if(typeof this._lengthCalculator!=="function")this._lengthCalculator=naiveLength;this._allowStale=options.stale||false;this._maxAge=options.maxAge||null;this._dispose=options.dispose;this.reset()}Object.defineProperty(LRUCache.prototype,"max",{set:function(mL){if(!mL||!(typeof mL==="number")||mL<=0)mL=Infinity;this._max=mL;if(this._length>this._max)trim(this)},get:function(){return this._max},enumerable:true});Object.defineProperty(LRUCache.prototype,"lengthCalculator",{set:function(lC){if(typeof lC!=="function"){this._lengthCalculator=naiveLength;this._length=this._itemCount;for(var key in this._cache){this._cache[key].length=1}}else{this._lengthCalculator=lC;this._length=0;for(var key in this._cache){this._cache[key].length=this._lengthCalculator(this._cache[key].value);this._length+=this._cache[key].length}}if(this._length>this._max)trim(this)},get:function(){return this._lengthCalculator},enumerable:true});Object.defineProperty(LRUCache.prototype,"length",{get:function(){return this._length},enumerable:true});Object.defineProperty(LRUCache.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:true});LRUCache.prototype.forEach=function(fn,thisp){thisp=thisp||this;var i=0;for(var k=this._mru-1;k>=0&&i<this._itemCount;k--)if(this._lruList[k]){i++;var hit=this._lruList[k];if(this._maxAge&&Date.now()-hit.now>this._maxAge){del(this,hit);if(!this._allowStale)hit=undefined}if(hit){fn.call(thisp,hit.value,hit.key,this)}}};LRUCache.prototype.keys=function(){var keys=new Array(this._itemCount);var i=0;for(var k=this._mru-1;k>=0&&i<this._itemCount;k--)if(this._lruList[k]){var hit=this._lruList[k];keys[i++]=hit.key}return keys};LRUCache.prototype.values=function(){var values=new Array(this._itemCount);var i=0;for(var k=this._mru-1;k>=0&&i<this._itemCount;k--)if(this._lruList[k]){var hit=this._lruList[k];values[i++]=hit.value}return values};LRUCache.prototype.reset=function(){if(this._dispose&&this._cache){for(var k in this._cache){this._dispose(k,this._cache[k].value)}}this._cache=Object.create(null);this._lruList=Object.create(null);this._mru=0;this._lru=0;this._length=0;this._itemCount=0};LRUCache.prototype.dump=function(){return this._cache};LRUCache.prototype.dumpLru=function(){return this._lruList};LRUCache.prototype.set=function(key,value){if(hOP(this._cache,key)){if(this._dispose)this._dispose(key,this._cache[key].value);if(this._maxAge)this._cache[key].now=Date.now();this._cache[key].value=value;this.get(key);return true}var len=this._lengthCalculator(value);var age=this._maxAge?Date.now():0;var hit=new Entry(key,value,this._mru++,len,age);if(hit.length>this._max){if(this._dispose)this._dispose(key,value);return false}this._length+=hit.length;this._lruList[hit.lu]=this._cache[key]=hit;this._itemCount++;if(this._length>this._max)trim(this);return true};LRUCache.prototype.has=function(key){if(!hOP(this._cache,key))return false;var hit=this._cache[key];if(this._maxAge&&Date.now()-hit.now>this._maxAge){return false}return true};LRUCache.prototype.get=function(key){return get(this,key,true)};LRUCache.prototype.peek=function(key){return get(this,key,false)};LRUCache.prototype.pop=function(){var hit=this._lruList[this._lru];del(this,hit);return hit||null};LRUCache.prototype.del=function(key){del(this,this._cache[key])};function get(self,key,doUse){var hit=self._cache[key];if(hit){if(self._maxAge&&Date.now()-hit.now>self._maxAge){del(self,hit);if(!self._allowStale)hit=undefined}else{if(doUse)use(self,hit)}if(hit)hit=hit.value}return hit}function use(self,hit){shiftLU(self,hit);hit.lu=self._mru++;self._lruList[hit.lu]=hit}function trim(self){while(self._lru<self._mru&&self._length>self._max)del(self,self._lruList[self._lru])}function shiftLU(self,hit){delete self._lruList[hit.lu];while(self._lru<self._mru&&!self._lruList[self._lru])self._lru++}function del(self,hit){if(hit){if(self._dispose)self._dispose(hit.key,hit.value);self._length-=hit.length;self._itemCount--;delete self._cache[hit.key];shiftLU(self,hit)}}function Entry(key,value,lu,length,now){this.key=key;this.value=value;this.lu=lu;this.length=length;this.now=now}})()},{}],28:[function(require,module,exports){module.exports=sigmund;function sigmund(subject,maxSessions){maxSessions=maxSessions||10;var notes=[];var analysis="";var RE=RegExp;function psychoAnalyze(subject,session){if(session>maxSessions)return;if(typeof subject==="function"||typeof subject==="undefined"){return}if(typeof subject!=="object"||!subject||subject instanceof RE){analysis+=subject;return}if(notes.indexOf(subject)!==-1||session===maxSessions)return;notes.push(subject);analysis+="{";Object.keys(subject).forEach(function(issue,_,__){if(issue.charAt(0)==="_")return;var to=typeof subject[issue];if(to==="function"||to==="undefined")return;analysis+=issue;psychoAnalyze(subject[issue],session+1)})}psychoAnalyze(subject,0);return analysis}},{}],29:[function(require,module,exports){"use strict";var path=require("path");module.exports=function(filepath){return path.normalize(filepath).replace(/\\/g,"/").replace(/\/$/g,"")}},{path:5}],30:[function(require,module,exports){"use strict";var union=require("array-union");var diff=require("array-differ");var async=require("async");var glob=require("glob");function arrayify(arr){return Array.isArray(arr)?arr:[arr]}module.exports=function(patterns,opts,cb){patterns=arrayify(patterns);if(patterns.length===0){cb(null,[]);return}if(typeof opts==="function"){cb=opts;opts={}}async.reduce(patterns,[],function(ret,pattern,next){var process=union;if(pattern[0]==="!"){pattern=pattern.slice(1);process=diff}glob(pattern,opts,function(err,paths){if(err){next(err);return}next(null,process(ret,paths))})},cb)};module.exports.sync=function(patterns,opts){patterns=arrayify(patterns);if(patterns.length===0){return[]}opts=opts||{};return patterns.reduce(function(ret,pattern){var process=union;if(pattern[0]==="!"){pattern=pattern.slice(1);process=diff}return process(ret,glob.sync(pattern,opts))},[])}},{"array-differ":31,"array-union":32,async:34,glob:36}],31:[function(require,module,exports){"use strict";module.exports=function(arr){var rest=[].concat.apply([],[].slice.call(arguments,1));return arr.filter(function(el){return rest.indexOf(el)===-1})}},{}],32:[function(require,module,exports){"use strict";var arrayUniq=require("array-uniq");module.exports=function(){return arrayUniq([].concat.apply([],arguments))}},{"array-uniq":33}],33:[function(require,module,exports){(function(global){"use strict";function uniqNoSet(arr){var ret=[];for(var i=0;i<arr.length;i++){if(ret.indexOf(arr[i])===-1){ret.push(arr[i])}}return ret}function uniqSet(arr){var seen=new Set;return arr.filter(function(el){if(!seen.has(el)){seen.add(el);return true}})}function uniqSetWithForEach(arr){var ret=[];new Set(arr).forEach(function(el){ret.push(el)});return ret}if("Set"in global){if(typeof Set.prototype.forEach==="function"){module.exports=uniqSetWithForEach}else{module.exports=uniqSet}}else{module.exports=uniqNoSet}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],34:[function(require,module,exports){(function(process){(function(){var async={};var root,previous_async;root=this;if(root!=null){previous_async=root.async}async.noConflict=function(){root.async=previous_async;return async};function only_once(fn){var called=false;return function(){if(called)throw new Error("Callback was already called.");called=true;fn.apply(root,arguments)}}var _toString=Object.prototype.toString;var _isArray=Array.isArray||function(obj){return _toString.call(obj)==="[object Array]"};var _each=function(arr,iterator){if(arr.forEach){return arr.forEach(iterator)}for(var i=0;i<arr.length;i+=1){iterator(arr[i],i,arr)}};var _map=function(arr,iterator){if(arr.map){return arr.map(iterator)}var results=[];_each(arr,function(x,i,a){results.push(iterator(x,i,a))});return results};var _reduce=function(arr,iterator,memo){if(arr.reduce){return arr.reduce(iterator,memo)}_each(arr,function(x,i,a){memo=iterator(memo,x,i,a)});return memo};var _keys=function(obj){if(Object.keys){return Object.keys(obj)}var keys=[];for(var k in obj){if(obj.hasOwnProperty(k)){keys.push(k)}}return keys};if(typeof process==="undefined"||!process.nextTick){if(typeof setImmediate==="function"){async.nextTick=function(fn){setImmediate(fn)};async.setImmediate=async.nextTick}else{async.nextTick=function(fn){setTimeout(fn,0)};async.setImmediate=async.nextTick}}else{async.nextTick=process.nextTick;if(typeof setImmediate!=="undefined"){async.setImmediate=function(fn){setImmediate(fn)}}else{async.setImmediate=async.nextTick}}async.each=function(arr,iterator,callback){callback=callback||function(){};if(!arr.length){return callback()}var completed=0;_each(arr,function(x){iterator(x,only_once(done))});function done(err){if(err){callback(err);callback=function(){}}else{completed+=1;if(completed>=arr.length){callback()}}}};async.forEach=async.each;async.eachSeries=function(arr,iterator,callback){callback=callback||function(){};if(!arr.length){return callback()}var completed=0;var iterate=function(){iterator(arr[completed],function(err){if(err){callback(err);callback=function(){}}else{completed+=1;if(completed>=arr.length){callback()}else{iterate()}}})};iterate()};async.forEachSeries=async.eachSeries;async.eachLimit=function(arr,limit,iterator,callback){var fn=_eachLimit(limit);fn.apply(null,[arr,iterator,callback])};async.forEachLimit=async.eachLimit;var _eachLimit=function(limit){return function(arr,iterator,callback){callback=callback||function(){};if(!arr.length||limit<=0){return callback()}var completed=0;var started=0;var running=0;(function replenish(){if(completed>=arr.length){return callback()}while(running<limit&&started<arr.length){started+=1;running+=1;iterator(arr[started-1],function(err){if(err){callback(err);callback=function(){}}else{completed+=1;running-=1;if(completed>=arr.length){callback()}else{replenish()}}})}})()}};var doParallel=function(fn){return function(){var args=Array.prototype.slice.call(arguments);return fn.apply(null,[async.each].concat(args))}};var doParallelLimit=function(limit,fn){return function(){var args=Array.prototype.slice.call(arguments);return fn.apply(null,[_eachLimit(limit)].concat(args))}};var doSeries=function(fn){return function(){var args=Array.prototype.slice.call(arguments);return fn.apply(null,[async.eachSeries].concat(args))}};var _asyncMap=function(eachfn,arr,iterator,callback){arr=_map(arr,function(x,i){return{index:i,value:x}});if(!callback){eachfn(arr,function(x,callback){iterator(x.value,function(err){callback(err)})})}else{var results=[];eachfn(arr,function(x,callback){iterator(x.value,function(err,v){results[x.index]=v;callback(err)})},function(err){callback(err,results)})}};async.map=doParallel(_asyncMap);async.mapSeries=doSeries(_asyncMap);async.mapLimit=function(arr,limit,iterator,callback){return _mapLimit(limit)(arr,iterator,callback)};var _mapLimit=function(limit){return doParallelLimit(limit,_asyncMap)};async.reduce=function(arr,memo,iterator,callback){async.eachSeries(arr,function(x,callback){iterator(memo,x,function(err,v){memo=v;callback(err)})},function(err){callback(err,memo)})};async.inject=async.reduce;async.foldl=async.reduce;async.reduceRight=function(arr,memo,iterator,callback){var reversed=_map(arr,function(x){return x}).reverse();async.reduce(reversed,memo,iterator,callback)};async.foldr=async.reduceRight;var _filter=function(eachfn,arr,iterator,callback){var results=[];arr=_map(arr,function(x,i){return{index:i,value:x}});eachfn(arr,function(x,callback){iterator(x.value,function(v){if(v){results.push(x)}callback()})},function(err){callback(_map(results.sort(function(a,b){return a.index-b.index}),function(x){return x.value}))})};async.filter=doParallel(_filter);async.filterSeries=doSeries(_filter);async.select=async.filter;async.selectSeries=async.filterSeries;var _reject=function(eachfn,arr,iterator,callback){var results=[];arr=_map(arr,function(x,i){return{index:i,value:x}});eachfn(arr,function(x,callback){iterator(x.value,function(v){if(!v){results.push(x)}callback()})},function(err){callback(_map(results.sort(function(a,b){return a.index-b.index}),function(x){return x.value}))})};async.reject=doParallel(_reject);async.rejectSeries=doSeries(_reject);var _detect=function(eachfn,arr,iterator,main_callback){eachfn(arr,function(x,callback){iterator(x,function(result){if(result){main_callback(x);main_callback=function(){}}else{callback()}})},function(err){main_callback()})};async.detect=doParallel(_detect);async.detectSeries=doSeries(_detect);async.some=function(arr,iterator,main_callback){async.each(arr,function(x,callback){iterator(x,function(v){if(v){main_callback(true);main_callback=function(){}}callback()})},function(err){main_callback(false)})};async.any=async.some;async.every=function(arr,iterator,main_callback){async.each(arr,function(x,callback){iterator(x,function(v){if(!v){main_callback(false);main_callback=function(){}}callback()})},function(err){main_callback(true)})};async.all=async.every;async.sortBy=function(arr,iterator,callback){async.map(arr,function(x,callback){iterator(x,function(err,criteria){if(err){callback(err)}else{callback(null,{value:x,criteria:criteria})}})},function(err,results){if(err){return callback(err)}else{var fn=function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0};callback(null,_map(results.sort(fn),function(x){return x.value}))}})};async.auto=function(tasks,callback){callback=callback||function(){};var keys=_keys(tasks);var remainingTasks=keys.length;if(!remainingTasks){return callback()}var results={};var listeners=[];var addListener=function(fn){listeners.unshift(fn)};var removeListener=function(fn){for(var i=0;i<listeners.length;i+=1){if(listeners[i]===fn){listeners.splice(i,1);return}}};var taskComplete=function(){remainingTasks--;_each(listeners.slice(0),function(fn){fn()})};addListener(function(){if(!remainingTasks){var theCallback=callback;callback=function(){};theCallback(null,results)}});_each(keys,function(k){var task=_isArray(tasks[k])?tasks[k]:[tasks[k]];var taskCallback=function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}if(err){var safeResults={};_each(_keys(results),function(rkey){safeResults[rkey]=results[rkey]});safeResults[k]=args;callback(err,safeResults);callback=function(){}}else{results[k]=args;async.setImmediate(taskComplete)}};var requires=task.slice(0,Math.abs(task.length-1))||[];var ready=function(){return _reduce(requires,function(a,x){return a&&results.hasOwnProperty(x)},true)&&!results.hasOwnProperty(k)};if(ready()){task[task.length-1](taskCallback,results)}else{var listener=function(){if(ready()){removeListener(listener);task[task.length-1](taskCallback,results)}};addListener(listener)}})};async.retry=function(times,task,callback){var DEFAULT_TIMES=5;var attempts=[];if(typeof times==="function"){callback=task;task=times;times=DEFAULT_TIMES}times=parseInt(times,10)||DEFAULT_TIMES;var wrappedTask=function(wrappedCallback,wrappedResults){var retryAttempt=function(task,finalAttempt){return function(seriesCallback){task(function(err,result){seriesCallback(!err||finalAttempt,{err:err,result:result})},wrappedResults)}};while(times){attempts.push(retryAttempt(task,!(times-=1)))}async.series(attempts,function(done,data){data=data[data.length-1];(wrappedCallback||callback)(data.err,data.result)})};return callback?wrappedTask():wrappedTask};async.waterfall=function(tasks,callback){callback=callback||function(){};if(!_isArray(tasks)){var err=new Error("First argument to waterfall must be an array of functions");return callback(err)}if(!tasks.length){return callback()}var wrapIterator=function(iterator){return function(err){if(err){callback.apply(null,arguments);callback=function(){}}else{var args=Array.prototype.slice.call(arguments,1);var next=iterator.next();if(next){args.push(wrapIterator(next))}else{args.push(callback)}async.setImmediate(function(){iterator.apply(null,args)})}}};wrapIterator(async.iterator(tasks))()};var _parallel=function(eachfn,tasks,callback){callback=callback||function(){};if(_isArray(tasks)){eachfn.map(tasks,function(fn,callback){if(fn){fn(function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}callback.call(null,err,args)})}},callback)}else{var results={};eachfn.each(_keys(tasks),function(k,callback){tasks[k](function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}results[k]=args;callback(err)})},function(err){callback(err,results)})}};async.parallel=function(tasks,callback){_parallel({map:async.map,each:async.each},tasks,callback)};async.parallelLimit=function(tasks,limit,callback){_parallel({map:_mapLimit(limit),each:_eachLimit(limit)},tasks,callback)};async.series=function(tasks,callback){callback=callback||function(){};if(_isArray(tasks)){async.mapSeries(tasks,function(fn,callback){if(fn){fn(function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}callback.call(null,err,args)})}},callback)}else{var results={};async.eachSeries(_keys(tasks),function(k,callback){tasks[k](function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}results[k]=args;callback(err)})},function(err){callback(err,results)})}};async.iterator=function(tasks){var makeCallback=function(index){var fn=function(){if(tasks.length){tasks[index].apply(null,arguments)}return fn.next()};fn.next=function(){return index<tasks.length-1?makeCallback(index+1):null};return fn};return makeCallback(0)};async.apply=function(fn){var args=Array.prototype.slice.call(arguments,1);return function(){return fn.apply(null,args.concat(Array.prototype.slice.call(arguments)))}};var _concat=function(eachfn,arr,fn,callback){var r=[];eachfn(arr,function(x,cb){fn(x,function(err,y){r=r.concat(y||[]);cb(err)})},function(err){callback(err,r)})};async.concat=doParallel(_concat);async.concatSeries=doSeries(_concat);async.whilst=function(test,iterator,callback){if(test()){iterator(function(err){if(err){return callback(err)}async.whilst(test,iterator,callback)})}else{callback()}};async.doWhilst=function(iterator,test,callback){iterator(function(err){if(err){return callback(err)}var args=Array.prototype.slice.call(arguments,1);if(test.apply(null,args)){async.doWhilst(iterator,test,callback)}else{callback()}})};async.until=function(test,iterator,callback){if(!test()){iterator(function(err){if(err){return callback(err)}async.until(test,iterator,callback)})}else{callback()}};async.doUntil=function(iterator,test,callback){iterator(function(err){if(err){return callback(err)}var args=Array.prototype.slice.call(arguments,1);if(!test.apply(null,args)){async.doUntil(iterator,test,callback)}else{callback()}})};async.queue=function(worker,concurrency){if(concurrency===undefined){concurrency=1}function _insert(q,data,pos,callback){if(!q.started){q.started=true}if(!_isArray(data)){data=[data]}if(data.length==0){return async.setImmediate(function(){if(q.drain){q.drain()}})}_each(data,function(task){var item={data:task,callback:typeof callback==="function"?callback:null};if(pos){q.tasks.unshift(item)}else{q.tasks.push(item)}if(q.saturated&&q.tasks.length===q.concurrency){q.saturated()}async.setImmediate(q.process)})}var workers=0;var q={tasks:[],concurrency:concurrency,saturated:null,empty:null,drain:null,started:false,paused:false,push:function(data,callback){_insert(q,data,false,callback)},kill:function(){q.drain=null;q.tasks=[]},unshift:function(data,callback){_insert(q,data,true,callback)},process:function(){if(!q.paused&&workers<q.concurrency&&q.tasks.length){var task=q.tasks.shift();if(q.empty&&q.tasks.length===0){q.empty()}workers+=1;var next=function(){workers-=1;if(task.callback){task.callback.apply(task,arguments)}if(q.drain&&q.tasks.length+workers===0){q.drain()}q.process()};var cb=only_once(next);worker(task.data,cb)}},length:function(){return q.tasks.length},running:function(){return workers},idle:function(){return q.tasks.length+workers===0},pause:function(){if(q.paused===true){return}q.paused=true;q.process()},resume:function(){if(q.paused===false){return}q.paused=false;q.process()}};return q};async.priorityQueue=function(worker,concurrency){function _compareTasks(a,b){return a.priority-b.priority}function _binarySearch(sequence,item,compare){var beg=-1,end=sequence.length-1;while(beg<end){var mid=beg+(end-beg+1>>>1);if(compare(item,sequence[mid])>=0){beg=mid}else{end=mid-1}}return beg}function _insert(q,data,priority,callback){if(!q.started){q.started=true}if(!_isArray(data)){data=[data]}if(data.length==0){return async.setImmediate(function(){if(q.drain){q.drain()}})}_each(data,function(task){var item={data:task,priority:priority,callback:typeof callback==="function"?callback:null};q.tasks.splice(_binarySearch(q.tasks,item,_compareTasks)+1,0,item);if(q.saturated&&q.tasks.length===q.concurrency){q.saturated()}async.setImmediate(q.process)})}var q=async.queue(worker,concurrency);q.push=function(data,priority,callback){_insert(q,data,priority,callback)};delete q.unshift;return q};async.cargo=function(worker,payload){var working=false,tasks=[];var cargo={tasks:tasks,payload:payload,saturated:null,empty:null,drain:null,drained:true,push:function(data,callback){if(!_isArray(data)){data=[data]}_each(data,function(task){tasks.push({data:task,callback:typeof callback==="function"?callback:null});cargo.drained=false;if(cargo.saturated&&tasks.length===payload){cargo.saturated()}});async.setImmediate(cargo.process)},process:function process(){if(working)return;if(tasks.length===0){if(cargo.drain&&!cargo.drained)cargo.drain();cargo.drained=true;return}var ts=typeof payload==="number"?tasks.splice(0,payload):tasks.splice(0,tasks.length);var ds=_map(ts,function(task){return task.data});if(cargo.empty)cargo.empty();working=true;worker(ds,function(){working=false;var args=arguments;_each(ts,function(data){if(data.callback){data.callback.apply(null,args)}});process()})},length:function(){return tasks.length},running:function(){return working}};return cargo};var _console_fn=function(name){return function(fn){var args=Array.prototype.slice.call(arguments,1);fn.apply(null,args.concat([function(err){var args=Array.prototype.slice.call(arguments,1);if(typeof console!=="undefined"){if(err){if(console.error){console.error(err)}}else if(console[name]){_each(args,function(x){console[name](x)})}}}]))}};async.log=_console_fn("log");async.dir=_console_fn("dir");async.memoize=function(fn,hasher){var memo={};var queues={};hasher=hasher||function(x){return x};var memoized=function(){var args=Array.prototype.slice.call(arguments);var callback=args.pop();var key=hasher.apply(null,args);if(key in memo){async.nextTick(function(){callback.apply(null,memo[key])})}else if(key in queues){queues[key].push(callback)}else{queues[key]=[callback];fn.apply(null,args.concat([function(){memo[key]=arguments;var q=queues[key];delete queues[key];for(var i=0,l=q.length;i<l;i++){q[i].apply(null,arguments)}}]))}};memoized.memo=memo;memoized.unmemoized=fn;return memoized};async.unmemoize=function(fn){return function(){return(fn.unmemoized||fn).apply(null,arguments)}};async.times=function(count,iterator,callback){var counter=[];for(var i=0;i<count;i++){counter.push(i)}return async.map(counter,iterator,callback)};async.timesSeries=function(count,iterator,callback){var counter=[];for(var i=0;i<count;i++){counter.push(i)}return async.mapSeries(counter,iterator,callback)};async.seq=function(){var fns=arguments;return function(){var that=this;var args=Array.prototype.slice.call(arguments);var callback=args.pop();async.reduce(fns,args,function(newargs,fn,cb){fn.apply(that,newargs.concat([function(){var err=arguments[0];var nextargs=Array.prototype.slice.call(arguments,1);cb(err,nextargs)}]))},function(err,results){callback.apply(that,[err].concat(results))})}};async.compose=function(){return async.seq.apply(null,Array.prototype.reverse.call(arguments))};var _applyEach=function(eachfn,fns){var go=function(){var that=this;var args=Array.prototype.slice.call(arguments);var callback=args.pop();return eachfn(fns,function(fn,cb){fn.apply(that,args.concat([cb]))},callback)};if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);return go.apply(this,args)}else{return go}};async.applyEach=doParallel(_applyEach);async.applyEachSeries=doSeries(_applyEach);async.forever=function(fn,callback){function next(err){if(err){if(callback){return callback(err)}throw err}fn(next)}next()};if(typeof module!=="undefined"&&module.exports){module.exports=async}else if(typeof define!=="undefined"&&define.amd){define([],function(){return async})}else{root.async=async}})()}).call(this,require("_process"))},{_process:6}],35:[function(require,module,exports){(function(process){exports.alphasort=alphasort;exports.alphasorti=alphasorti;exports.isAbsolute=process.platform==="win32"?absWin:absUnix;exports.setopts=setopts;exports.ownProp=ownProp;exports.makeAbs=makeAbs;exports.finish=finish;exports.mark=mark;function ownProp(obj,field){return Object.prototype.hasOwnProperty.call(obj,field)}var path=require("path");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;function absWin(p){if(absUnix(p))return true;var splitDeviceRe=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var result=splitDeviceRe.exec(p);var device=result[1]||"";var isUnc=device&&device.charAt(1)!==":";var isAbsolute=!!result[2]||isUnc; | |
return isAbsolute}function absUnix(p){return p.charAt(0)==="/"||p===""}function alphasorti(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())}function alphasort(a,b){return a.localeCompare(b)}function setopts(self,pattern,options){if(!options)options={};if(options.matchBase&&-1===pattern.indexOf("/")){if(options.noglobstar){throw new Error("base matching requires globstar")}pattern="**/"+pattern}self.pattern=pattern;self.strict=options.strict!==false;self.dot=!!options.dot;self.mark=!!options.mark;self.nodir=!!options.nodir;if(self.nodir)self.mark=true;self.sync=!!options.sync;self.nounique=!!options.nounique;self.nonull=!!options.nonull;self.nosort=!!options.nosort;self.nocase=!!options.nocase;self.stat=!!options.stat;self.noprocess=!!options.noprocess;self.maxLength=options.maxLength||Infinity;self.cache=options.cache||Object.create(null);self.statCache=options.statCache||Object.create(null);self.symlinks=options.symlinks||Object.create(null);self.changedCwd=false;var cwd=process.cwd();if(!ownProp(options,"cwd"))self.cwd=cwd;else{self.cwd=options.cwd;self.changedCwd=path.resolve(options.cwd)!==cwd}self.root=options.root||path.resolve(self.cwd,"/");self.root=path.resolve(self.root);if(process.platform==="win32")self.root=self.root.replace(/\\/g,"/");self.nomount=!!options.nomount;self.minimatch=new Minimatch(pattern,options);self.options=self.minimatch.options}function finish(self){var nou=self.nounique;var all=nou?[]:Object.create(null);for(var i=0,l=self.matches.length;i<l;i++){var matches=self.matches[i];if(!matches){if(self.nonull){var literal=self.minimatch.globSet[i];if(nou)all.push(literal);else all[literal]=true}}else{var m=Object.keys(matches);if(nou)all.push.apply(all,m);else m.forEach(function(m){all[m]=true})}}if(!nou)all=Object.keys(all);if(!self.nosort)all=all.sort(self.nocase?alphasorti:alphasort);if(self.mark){for(var i=0;i<all.length;i++){all[i]=self._mark(all[i])}if(self.nodir){all=all.filter(function(e){return!/\/$/.test(e)})}}self.found=all}function mark(self,p){var c=self.cache[p];var m=p;if(c){var isDir=c==="DIR"||Array.isArray(c);var slash=p.slice(-1)==="/";if(isDir&&!slash)m+="/";else if(!isDir&&slash)m=m.slice(0,-1);if(m!==p){self.statCache[m]=self.statCache[p];self.cache[m]=self.cache[p]}}return m}function makeAbs(self,f){var abs=f;if(f.charAt(0)==="/"){abs=path.join(self.root,f)}else if(exports.isAbsolute(f)){abs=f}else if(self.changedCwd){abs=path.resolve(self.cwd,f)}return abs}}).call(this,require("_process"))},{_process:6,minimatch:40,path:5}],36:[function(require,module,exports){(function(process){module.exports=glob;var fs=require("fs");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;var inherits=require("inherits");var EE=require("events").EventEmitter;var path=require("path");var assert=require("assert");var globSync=require("./sync.js");var common=require("./common.js");var alphasort=common.alphasort;var alphasorti=common.alphasorti;var isAbsolute=common.isAbsolute;var setopts=common.setopts;var ownProp=common.ownProp;var inflight=require("inflight");var util=require("util");var once=require("once");function glob(pattern,options,cb){if(typeof options==="function")cb=options,options={};if(!options)options={};if(options.sync){if(cb)throw new TypeError("callback provided to sync glob");return globSync(pattern,options)}return new Glob(pattern,options,cb)}glob.sync=globSync;var GlobSync=glob.GlobSync=globSync.GlobSync;glob.glob=glob;glob.hasMagic=function(pattern,options_){var options=util._extend({},options_);options.noprocess=true;var g=new Glob(pattern,options);var set=g.minimatch.set;if(set.length>1)return true;for(var j=0;j<set[0].length;j++){if(typeof set[0][j]!=="string")return true}return false};glob.Glob=Glob;inherits(Glob,EE);function Glob(pattern,options,cb){if(typeof options==="function"){cb=options;options=null}if(options&&options.sync){if(cb)throw new TypeError("callback provided to sync glob");return new GlobSync(pattern,options)}if(!(this instanceof Glob))return new Glob(pattern,options,cb);setopts(this,pattern,options);var n=this.minimatch.set.length;this.matches=new Array(n);if(typeof cb==="function"){cb=once(cb);this.on("error",cb);this.on("end",function(matches){cb(null,matches)})}var self=this;var n=this.minimatch.set.length;this._processing=0;this.matches=new Array(n);this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(n===0)return done();for(var i=0;i<n;i++){this._process(this.minimatch.set[i],i,false,done)}function done(){--self._processing;if(self._processing<=0)self._finish()}}Glob.prototype._finish=function(){assert(this instanceof Glob);if(this.aborted)return;common.finish(this);this.emit("end",this.found)};Glob.prototype._mark=function(p){return common.mark(this,p)};Glob.prototype._makeAbs=function(f){return common.makeAbs(this,f)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var eq=this._emitQueue.slice(0);this._emitQueue.length=0;for(var i=0;i<eq.length;i++){var e=eq[i];this._emitMatch(e[0],e[1])}}if(this._processQueue.length){var pq=this._processQueue.slice(0);this._processQueue.length=0;for(var i=0;i<pq.length;i++){var p=pq[i];this._processing--;this._process(p[0],p[1],p[2],p[3])}}}};Glob.prototype._process=function(pattern,index,inGlobStar,cb){assert(this instanceof Glob);assert(typeof cb==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([pattern,index,inGlobStar,cb]);return}var n=0;while(typeof pattern[n]==="string"){n++}var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index,cb);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n);var read;if(prefix===null)read=".";else if(isAbsolute(prefix)||isAbsolute(pattern.join("/"))){if(!prefix||!isAbsolute(prefix))prefix="/"+prefix;read=prefix}else read=prefix;var abs=this._makeAbs(read);var isGlobStar=remain[0]===minimatch.GLOBSTAR;if(isGlobStar)this._processGlobStar(prefix,read,abs,remain,index,inGlobStar,cb);else this._processReaddir(prefix,read,abs,remain,index,inGlobStar,cb)};Glob.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar,cb){var self=this;this._readdir(abs,inGlobStar,function(er,entries){return self._processReaddir2(prefix,read,abs,remain,index,inGlobStar,entries,cb)})};Glob.prototype._processReaddir2=function(prefix,read,abs,remain,index,inGlobStar,entries,cb){if(!entries)return cb();var pn=remain[0];var negate=!!this.minimatch.negate;var rawGlob=pn._glob;var dotOk=this.dot||rawGlob.charAt(0)===".";var matchedEntries=[];for(var i=0;i<entries.length;i++){var e=entries[i];if(e.charAt(0)!=="."||dotOk){var m;if(negate&&!prefix){m=!e.match(pn)}else{m=e.match(pn)}if(m)matchedEntries.push(e)}}var len=matchedEntries.length;if(len===0)return cb();if(remain.length===1&&!this.mark&&!this.stat){if(!this.matches[index])this.matches[index]=Object.create(null);for(var i=0;i<len;i++){var e=matchedEntries[i];if(prefix){if(prefix!=="/")e=prefix+"/"+e;else e=prefix+e}if(e.charAt(0)==="/"&&!this.nomount){e=path.join(this.root,e)}this._emitMatch(index,e)}return cb()}remain.shift();for(var i=0;i<len;i++){var e=matchedEntries[i];var newPattern;if(prefix){if(prefix!=="/")e=prefix+"/"+e;else e=prefix+e}this._process([e].concat(remain),index,inGlobStar,cb)}cb()};Glob.prototype._emitMatch=function(index,e){if(this.aborted)return;if(!this.matches[index][e]){if(this.paused){this._emitQueue.push([index,e]);return}if(this.nodir){var c=this.cache[this._makeAbs(e)];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e]=true;if(!this.stat&&!this.mark)return this.emit("match",e);var self=this;this._stat(this._makeAbs(e),function(er,c,st){self.emit("stat",e,st);self.emit("match",e)})}};Glob.prototype._readdirInGlobStar=function(abs,cb){if(this.aborted)return;var lstatkey="lstat\x00"+abs;var self=this;var lstatcb=inflight(lstatkey,lstatcb_);if(lstatcb)fs.lstat(abs,lstatcb);function lstatcb_(er,lstat){if(er)return cb();var isSym=lstat.isSymbolicLink();self.symlinks[abs]=isSym;if(!isSym&&!lstat.isDirectory()){self.cache[abs]="FILE";cb()}else self._readdir(abs,false,cb)}};Glob.prototype._readdir=function(abs,inGlobStar,cb){if(this.aborted)return;cb=inflight("readdir\x00"+abs+"\x00"+inGlobStar,cb);if(!cb)return;if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs,cb);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return cb();if(Array.isArray(c))return cb(null,c)}var self=this;fs.readdir(abs,readdirCb(this,abs,cb))};function readdirCb(self,abs,cb){return function(er,entries){if(er)self._readdirError(abs,er,cb);else self._readdirEntries(abs,entries,cb)}}Glob.prototype._readdirEntries=function(abs,entries,cb){if(this.aborted)return;if(!this.mark&&!this.stat){for(var i=0;i<entries.length;i++){var e=entries[i];if(abs==="/")e=abs+e;else e=abs+"/"+e;this.cache[e]=true}}this.cache[abs]=entries;return cb(null,entries)};Glob.prototype._readdirError=function(f,er,cb){if(this.aborted)return;switch(er.code){case"ENOTDIR":this.cache[f]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[f]=false;break;default:this.cache[f]=false;if(this.strict)return this.emit("error",er);if(!this.silent)console.error("glob error",er);break}return cb()};Glob.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar,cb){var self=this;this._readdir(abs,inGlobStar,function(er,entries){self._processGlobStar2(prefix,read,abs,remain,index,inGlobStar,entries,cb)})};Glob.prototype._processGlobStar2=function(prefix,read,abs,remain,index,inGlobStar,entries,cb){if(!entries)return cb();var remainWithoutGlobStar=remain.slice(1);var gspref=prefix?[prefix]:[];var noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,false,cb);var isSym=this.symlinks[abs];var len=entries.length;if(isSym&&inGlobStar)return cb();for(var i=0;i<len;i++){var e=entries[i];if(e.charAt(0)==="."&&!this.dot)continue;var instead=gspref.concat(entries[i],remainWithoutGlobStar);this._process(instead,index,true,cb);var below=gspref.concat(entries[i],remain);this._process(below,index,true,cb)}cb()};Glob.prototype._processSimple=function(prefix,index,cb){var self=this;this._stat(prefix,function(er,exists){self._processSimple2(prefix,index,er,exists,cb)})};Glob.prototype._processSimple2=function(prefix,index,er,exists,cb){if(!this.matches[index])this.matches[index]=Object.create(null);if(!exists)return cb();if(prefix&&isAbsolute(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);if(prefix.charAt(0)==="/"){prefix=path.join(this.root,prefix)}else{prefix=path.resolve(this.root,prefix);if(trail)prefix+="/"}}if(process.platform==="win32")prefix=prefix.replace(/\\/g,"/");this._emitMatch(index,prefix);cb()};Glob.prototype._stat=function(f,cb){var abs=f;if(f.charAt(0)==="/")abs=path.join(this.root,f);else if(this.changedCwd)abs=path.resolve(this.cwd,f);if(f.length>this.maxLength)return cb();if(!this.stat&&ownProp(this.cache,f)){var c=this.cache[f];if(Array.isArray(c))c="DIR";if(abs.slice(-1)==="/"&&c!=="DIR")return cb();return cb(null,c)}var exists;var stat=this.statCache[abs];if(stat!==undefined){if(stat===false)return cb(null,stat);else return cb(null,stat.isDirectory()?"DIR":"FILE",stat)}var self=this;var statcb=inflight("stat\x00"+abs,statcb_);if(statcb)fs.stat(abs,statcb);function statcb_(er,stat){self._stat2(f,abs,er,stat,cb)}};Glob.prototype._stat2=function(f,abs,er,stat,cb){if(er){this.statCache[abs]=false;return cb()}this.statCache[abs]=stat;if(abs.slice(-1)==="/"&&!stat.isDirectory())return cb(null,false,stat);var c=stat.isDirectory()?"DIR":"FILE";this.cache[f]=this.cache[f]||c;return cb(null,c,stat)}}).call(this,require("_process"))},{"./common.js":35,"./sync.js":46,_process:6,assert:2,events:3,fs:1,inflight:37,inherits:39,minimatch:40,once:45,path:5,util:8}],37:[function(require,module,exports){(function(process){var wrappy=require("wrappy");var reqs=Object.create(null);var once=require("once");module.exports=wrappy(inflight);function inflight(key,cb){if(reqs[key]){reqs[key].push(cb);return null}else{reqs[key]=[cb];return makeres(key)}}function makeres(key){return once(function RES(){var cbs=reqs[key];var len=cbs.length;var args=slice(arguments);for(var i=0;i<len;i++){cbs[i].apply(null,args)}if(cbs.length>len){cbs.splice(0,len);process.nextTick(function(){RES.apply(null,args)})}else{delete reqs[key]}})}function slice(args){var length=args.length;var array=[];for(var i=0;i<length;i++)array[i]=args[i];return array}}).call(this,require("_process"))},{_process:6,once:45,wrappy:38}],38:[function(require,module,exports){module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=="function")throw new TypeError("need wrapper function");Object.keys(fn).forEach(function(k){wrapper[k]=fn[k]});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i]}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==="function"&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k]})}return ret}}},{}],39:[function(require,module,exports){arguments[4][4][0].apply(exports,arguments)},{dup:4}],40:[function(require,module,exports){(function(process){module.exports=minimatch;minimatch.Minimatch=Minimatch;var isWindows=false;if(typeof process!=="undefined"&&process.platform==="win32")isWindows=true;var GLOBSTAR=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={},expand=require("brace-expansion"),qmark="[^/]",star=qmark+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",reSpecials=charSet("().*{}+?[]^$\\!");function charSet(s){return s.split("").reduce(function(set,c){set[c]=true;return set},{})}var slashSplit=/\/+/;minimatch.filter=filter;function filter(pattern,options){options=options||{};return function(p,i,list){return minimatch(p,pattern,options)}}function ext(a,b){a=a||{};b=b||{};var t={};Object.keys(b).forEach(function(k){t[k]=b[k]});Object.keys(a).forEach(function(k){t[k]=a[k]});return t}minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return minimatch;var orig=minimatch;var m=function minimatch(p,pattern,options){return orig.minimatch(p,pattern,ext(def,options))};m.Minimatch=function Minimatch(pattern,options){return new orig.Minimatch(pattern,ext(def,options))};return m};Minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return Minimatch;return minimatch.defaults(def).Minimatch};function minimatch(p,pattern,options){if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};if(!options.nocomment&&pattern.charAt(0)==="#"){return false}if(pattern.trim()==="")return p==="";return new Minimatch(pattern,options).match(p)}function Minimatch(pattern,options){if(!(this instanceof Minimatch)){return new Minimatch(pattern,options)}if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};pattern=pattern.trim();if(isWindows)pattern=pattern.split("\\").join("/");this.options=options;this.set=[];this.pattern=pattern;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){if(this._made)return;var pattern=this.pattern;var options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=true;return}if(!pattern){this.empty=true;return}this.parseNegate();var set=this.globSet=this.braceExpand();if(options.debug)this.debug=console.error;this.debug(this.pattern,set);set=this.globParts=set.map(function(s){return s.split(slashSplit)});this.debug(this.pattern,set);set=set.map(function(s,si,set){return s.map(this.parse,this)},this);this.debug(this.pattern,set);set=set.filter(function(s){return-1===s.indexOf(false)});this.debug(this.pattern,set);this.set=set}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var pattern=this.pattern,negate=false,options=this.options,negateOffset=0;if(options.nonegate)return;for(var i=0,l=pattern.length;i<l&&pattern.charAt(i)==="!";i++){negate=!negate;negateOffset++}if(negateOffset)this.pattern=pattern.substr(negateOffset);this.negate=negate}minimatch.braceExpand=function(pattern,options){return braceExpand(pattern,options)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(pattern,options){if(!options){if(this instanceof Minimatch)options=this.options;else options={}}pattern=typeof pattern==="undefined"?this.pattern:pattern;if(typeof pattern==="undefined"){throw new Error("undefined pattern")}if(options.nobrace||!pattern.match(/\{.*\}/)){return[pattern]}return expand(pattern)}Minimatch.prototype.parse=parse;var SUBPARSE={};function parse(pattern,isSub){var options=this.options;if(!options.noglobstar&&pattern==="**")return GLOBSTAR;if(pattern==="")return"";var re="",hasMagic=!!options.nocase,escaping=false,patternListStack=[],plType,stateChar,inClass=false,reClassStart=-1,classStart=-1,patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",self=this;function clearStateChar(){if(stateChar){switch(stateChar){case"*":re+=star;hasMagic=true;break;case"?":re+=qmark;hasMagic=true;break;default:re+="\\"+stateChar;break}self.debug("clearStateChar %j %j",stateChar,re);stateChar=false}}for(var i=0,len=pattern.length,c;i<len&&(c=pattern.charAt(i));i++){this.debug("%s %s %s %j",pattern,i,re,c);if(escaping&&reSpecials[c]){re+="\\"+c;escaping=false;continue}SWITCH:switch(c){case"/":return false;case"\\":clearStateChar();escaping=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c);if(inClass){this.debug(" in class");if(c==="!"&&i===classStart+1)c="^";re+=c;continue}self.debug("call clearStateChar %j",stateChar);clearStateChar();stateChar=c;if(options.noext)clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}plType=stateChar;patternListStack.push({type:plType,start:i-1,reStart:re.length});re+=stateChar==="!"?"(?:(?!":"(?:";this.debug("plType %j %j",stateChar,re);stateChar=false;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar();hasMagic=true;re+=")";plType=patternListStack.pop().type;switch(plType){case"!":re+="[^/]*?)";break;case"?":case"+":case"*":re+=plType;case"@":break}continue;case"|":if(inClass||!patternListStack.length||escaping){re+="\\|";escaping=false;continue}clearStateChar();re+="|";continue;case"[":clearStateChar();if(inClass){re+="\\"+c;continue}inClass=true;classStart=i;reClassStart=re.length;re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c;escaping=false;continue}hasMagic=true;inClass=false;re+=c;continue;default:clearStateChar();if(escaping){escaping=false}else if(reSpecials[c]&&!(c==="^"&&inClass)){re+="\\"}re+=c}}if(inClass){var cs=pattern.substr(classStart+1),sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0];hasMagic=hasMagic||sp[1]}var pl;while(pl=patternListStack.pop()){var tail=re.slice(pl.reStart+3);tail=tail.replace(/((?:\\{2})*)(\\?)\|/g,function(_,$1,$2){if(!$2){$2="\\"}return $1+$1+$2+"|"});this.debug("tail=%j\n %s",tail,tail);var t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=true;re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar();if(escaping){re+="\\\\"}var addPatternStart=false;switch(re.charAt(0)){case".":case"[":case"(":addPatternStart=true}if(re!==""&&hasMagic)re="(?=.)"+re;if(addPatternStart)re=patternStart+re;if(isSub===SUBPARSE){return[re,hasMagic]}if(!hasMagic){return globUnescape(pattern)}var flags=options.nocase?"i":"",regExp=new RegExp("^"+re+"$",flags);regExp._glob=pattern;regExp._src=re;return regExp}minimatch.makeRe=function(pattern,options){return new Minimatch(pattern,options||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var set=this.set;if(!set.length)return this.regexp=false;var options=this.options;var twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot,flags=options.nocase?"i":"";var re=set.map(function(pattern){return pattern.map(function(p){return p===GLOBSTAR?twoStar:typeof p==="string"?regExpEscape(p):p._src}).join("\\/")}).join("|");re="^(?:"+re+")$";if(this.negate)re="^(?!"+re+").*$";try{return this.regexp=new RegExp(re,flags)}catch(ex){return this.regexp=false}}minimatch.match=function(list,pattern,options){options=options||{};var mm=new Minimatch(pattern,options);list=list.filter(function(f){return mm.match(f)});if(mm.options.nonull&&!list.length){list.push(pattern)}return list};Minimatch.prototype.match=match;function match(f,partial){this.debug("match",f,this.pattern);if(this.comment)return false;if(this.empty)return f==="";if(f==="/"&&partial)return true;var options=this.options;if(isWindows)f=f.split("\\").join("/");f=f.split(slashSplit);this.debug(this.pattern,"split",f);var set=this.set;this.debug(this.pattern,"set",set);var filename;for(var i=f.length-1;i>=0;i--){filename=f[i];if(filename)break}for(var i=0,l=set.length;i<l;i++){var pattern=set[i],file=f;if(options.matchBase&&pattern.length===1){file=[filename]}var hit=this.matchOne(file,pattern,partial);if(hit){if(options.flipNegate)return true;return!this.negate}}if(options.flipNegate)return false;return this.negate}Minimatch.prototype.matchOne=function(file,pattern,partial){var options=this.options;this.debug("matchOne",{"this":this,file:file,pattern:pattern});this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f=file[fi];this.debug(pattern,p,f);if(p===false)return false;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi,pr=pi+1;if(pr===pl){this.debug("** at the end");for(;fi<fl;fi++){if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return false}return true}WHILE:while(fr<fl){var swallowee=file[fr];this.debug("\nglobstar while",file,fr,pattern,pr,swallowee);if(this.matchOne(file.slice(fr),pattern.slice(pr),partial)){this.debug("globstar found match!",fr,fl,swallowee);return true}else{if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break WHILE}this.debug("globstar swallow a segment, and continue");fr++}}if(partial){this.debug("\n>>> no match, partial?",file,fr,pattern,pr);if(fr===fl)return true}return false}var hit;if(typeof p==="string"){if(options.nocase){hit=f.toLowerCase()===p.toLowerCase()}else{hit=f===p}this.debug("string match",p,f,hit)}else{hit=f.match(p);this.debug("pattern match",p,f,hit)}if(!hit)return false}if(fi===fl&&pi===pl){return true}else if(fi===fl){return partial}else if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}}).call(this,require("_process"))},{_process:6,"brace-expansion":41}],41:[function(require,module,exports){var concatMap=require("concat-map");var balanced=require("balanced-match");module.exports=expandTop;var escSlash="\x00SLASH"+Math.random()+"\x00";var escOpen="\x00OPEN"+Math.random()+"\x00";var escClose="\x00CLOSE"+Math.random()+"\x00";var escComma="\x00COMMA"+Math.random()+"\x00";var escPeriod="\x00PERIOD"+Math.random()+"\x00";function numeric(str){return parseInt(str,10)==str?parseInt(str,10):str.charCodeAt(0)}function escapeBraces(str){return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod)}function unescapeBraces(str){return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".")}function parseCommaParts(str){if(!str)return[""];var parts=[];var m=balanced("{","}",str);if(!m)return str.split(",");var pre=m.pre;var body=m.body;var post=m.post;var p=pre.split(",");p[p.length-1]+="{"+body+"}";var postParts=parseCommaParts(post);if(post.length){p[p.length-1]+=postParts.shift();p.push.apply(p,postParts)}parts.push.apply(parts,p);return parts}function expandTop(str){if(!str)return[];return expand(escapeBraces(str),true).map(unescapeBraces)}function identity(e){return e}function embrace(str){return"{"+str+"}"}function isPadded(el){return/^-?0\d/.test(el)}function lte(i,y){return i<=y}function gte(i,y){return i>=y}function expand(str,isTop){var expansions=[];var m=balanced("{","}",str);if(!m||/\$$/.test(m.pre))return[str];var isNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);var isAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);var isSequence=isNumericSequence||isAlphaSequence;var isOptions=/^(.*,)+(.+)?$/.test(m.body);if(!isSequence&&!isOptions){if(m.post.match(/,.*}/)){str=m.pre+"{"+m.body+escClose+m.post;return expand(str)}return[str]}var n;if(isSequence){n=m.body.split(/\.\./)}else{n=parseCommaParts(m.body);if(n.length===1){n=expand(n[0],false).map(embrace);if(n.length===1){var post=m.post.length?expand(m.post,false):[""];return post.map(function(p){return m.pre+n[0]+p})}}}var pre=m.pre;var post=m.post.length?expand(m.post,false):[""];var N;if(isSequence){var x=numeric(n[0]);var y=numeric(n[1]);var width=Math.max(n[0].length,n[1].length);var incr=n.length==3?Math.abs(numeric(n[2])):1;var test=lte;var reverse=y<x;if(reverse){incr*=-1;test=gte}var pad=n.some(isPadded);N=[];for(var i=x;test(i,y);i+=incr){var c;if(isAlphaSequence){c=String.fromCharCode(i);if(c==="\\")c=""}else{c=String(i);if(pad){var need=width-c.length;if(need>0){var z=new Array(need+1).join("0");if(i<0)c="-"+z+c.slice(1);else c=z+c}}}N.push(c)}}else{N=concatMap(n,function(el){return expand(el,false)})}for(var j=0;j<N.length;j++){for(var k=0;k<post.length;k++){var expansion=pre+N[j]+post[k];if(!isTop||isSequence||expansion)expansions.push(expansion)}}return expansions}},{"balanced-match":42,"concat-map":43}],42:[function(require,module,exports){module.exports=balanced;function balanced(a,b,str){var bal=0;var m={};var ended=false;for(var i=0;i<str.length;i++){if(a==str.substr(i,a.length)){if(!("start"in m))m.start=i;bal++}else if(b==str.substr(i,b.length)&&"start"in m){ended=true;bal--;if(!bal){m.end=i;m.pre=str.substr(0,m.start);m.body=m.end-m.start>1?str.substring(m.start+a.length,m.end):"";m.post=str.slice(m.end+b.length);return m}}}if(bal&&ended){var start=m.start+a.length;m=balanced(a,b,str.substr(start));if(m){m.start+=start;m.end+=start;m.pre=str.slice(0,start)+m.pre}return m}}},{}],43:[function(require,module,exports){module.exports=function(xs,fn){var res=[];for(var i=0;i<xs.length;i++){var x=fn(xs[i],i);if(isArray(x))res.push.apply(res,x);else res.push(x)}return res};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}},{}],44:[function(require,module,exports){arguments[4][38][0].apply(exports,arguments)},{dup:38}],45:[function(require,module,exports){var wrappy=require("wrappy");module.exports=wrappy(once);once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true})});function once(fn){var f=function(){if(f.called)return f.value;f.called=true;return f.value=fn.apply(this,arguments)};f.called=false;return f}},{wrappy:44}],46:[function(require,module,exports){(function(process){module.exports=globSync;globSync.GlobSync=GlobSync;var fs=require("fs");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;var Glob=require("./glob.js").Glob;var util=require("util");var path=require("path");var assert=require("assert");var common=require("./common.js");var alphasort=common.alphasort;var alphasorti=common.alphasorti;var isAbsolute=common.isAbsolute;var setopts=common.setopts;var ownProp=common.ownProp;function globSync(pattern,options){if(typeof options==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob");return new GlobSync(pattern,options).found}function GlobSync(pattern,options){if(!pattern)throw new Error("must provide pattern");if(typeof options==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob");if(!(this instanceof GlobSync))return new GlobSync(pattern,options);setopts(this,pattern,options);if(this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var i=0;i<n;i++){this._process(this.minimatch.set[i],i,false)}this._finish()}GlobSync.prototype._finish=function(){assert(this instanceof GlobSync);common.finish(this)};GlobSync.prototype._process=function(pattern,index,inGlobStar){assert(this instanceof GlobSync);var n=0;while(typeof pattern[n]==="string"){n++}var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n);var read;if(prefix===null)read=".";else if(isAbsolute(prefix)||isAbsolute(pattern.join("/"))){if(!prefix||!isAbsolute(prefix))prefix="/"+prefix;read=prefix}else read=prefix;var abs=this._makeAbs(read);var isGlobStar=remain[0]===minimatch.GLOBSTAR;if(isGlobStar)this._processGlobStar(prefix,read,abs,remain,index,inGlobStar);else this._processReaddir(prefix,read,abs,remain,index,inGlobStar)};GlobSync.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar){var entries=this._readdir(abs,inGlobStar);if(!entries)return;var pn=remain[0];var negate=!!this.minimatch.negate;var rawGlob=pn._glob;var dotOk=this.dot||rawGlob.charAt(0)===".";var matchedEntries=[];for(var i=0;i<entries.length;i++){var e=entries[i];if(e.charAt(0)!=="."||dotOk){var m;if(negate&&!prefix){m=!e.match(pn)}else{m=e.match(pn)}if(m)matchedEntries.push(e)}}var len=matchedEntries.length;if(len===0)return;if(remain.length===1&&!this.mark&&!this.stat){if(!this.matches[index])this.matches[index]=Object.create(null);for(var i=0;i<len;i++){var e=matchedEntries[i];if(prefix){if(prefix.slice(-1)!=="/")e=prefix+"/"+e;else e=prefix+e}if(e.charAt(0)==="/"&&!this.nomount){e=path.join(this.root,e)}this.matches[index][e]=true}return}remain.shift();for(var i=0;i<len;i++){var e=matchedEntries[i];var newPattern;if(prefix)newPattern=[prefix,e];else newPattern=[e];this._process(newPattern.concat(remain),index,inGlobStar)}};GlobSync.prototype._emitMatch=function(index,e){if(!this.matches[index][e]){if(this.nodir){var c=this.cache[this._makeAbs(e)];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e]=true;if(this.stat||this.mark)this._stat(this._makeAbs(e))}};GlobSync.prototype._readdirInGlobStar=function(abs){var entries;var lstat;var stat;try{lstat=fs.lstatSync(abs)}catch(er){return null}var isSym=lstat.isSymbolicLink();this.symlinks[abs]=isSym;if(!isSym&&!lstat.isDirectory())this.cache[abs]="FILE";else entries=this._readdir(abs,false);return entries};GlobSync.prototype._readdir=function(abs,inGlobStar){var entries;if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return null;if(Array.isArray(c))return c}try{return this._readdirEntries(abs,fs.readdirSync(abs))}catch(er){this._readdirError(abs,er);return null}};GlobSync.prototype._readdirEntries=function(abs,entries){if(!this.mark&&!this.stat){for(var i=0;i<entries.length;i++){var e=entries[i];if(abs==="/")e=abs+e;else e=abs+"/"+e;this.cache[e]=true}}this.cache[abs]=entries;return entries};GlobSync.prototype._readdirError=function(f,er){switch(er.code){case"ENOTDIR":this.cache[f]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[f]=false;break;default:this.cache[f]=false;if(this.strict)throw er;if(!this.silent)console.error("glob error",er); | |
break}};GlobSync.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar){var entries=this._readdir(abs,inGlobStar);if(!entries)return;var remainWithoutGlobStar=remain.slice(1);var gspref=prefix?[prefix]:[];var noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,false);var len=entries.length;var isSym=this.symlinks[abs];if(isSym&&inGlobStar)return;for(var i=0;i<len;i++){var e=entries[i];if(e.charAt(0)==="."&&!this.dot)continue;var instead=gspref.concat(entries[i],remainWithoutGlobStar);this._process(instead,index,true);var below=gspref.concat(entries[i],remain);this._process(below,index,true)}};GlobSync.prototype._processSimple=function(prefix,index){var exists=this._stat(prefix);if(!this.matches[index])this.matches[index]=Object.create(null);if(!exists)return;if(prefix&&isAbsolute(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);if(prefix.charAt(0)==="/"){prefix=path.join(this.root,prefix)}else{prefix=path.resolve(this.root,prefix);if(trail)prefix+="/"}}if(process.platform==="win32")prefix=prefix.replace(/\\/g,"/");this.matches[index][prefix]=true};GlobSync.prototype._stat=function(f){var abs=f;if(f.charAt(0)==="/")abs=path.join(this.root,f);else if(this.changedCwd)abs=path.resolve(this.cwd,f);if(f.length>this.maxLength)return false;if(!this.stat&&ownProp(this.cache,f)){var c=this.cache[f];if(Array.isArray(c))c="DIR";if(abs.slice(-1)==="/"&&c!=="DIR")return false;return c}var exists;var stat=this.statCache[abs];if(!stat){try{stat=fs.statSync(abs)}catch(er){return false}}this.statCache[abs]=stat;if(abs.slice(-1)==="/"&&!stat.isDirectory())return false;var c=stat.isDirectory()?"DIR":"FILE";this.cache[f]=this.cache[f]||c;return c};GlobSync.prototype._mark=function(p){return common.mark(this,p)};GlobSync.prototype._makeAbs=function(f){return common.makeAbs(this,f)}}).call(this,require("_process"))},{"./common.js":35,"./glob.js":36,_process:6,assert:2,fs:1,minimatch:40,path:5,util:8}],47:[function(require,module,exports){"use strict";var cwd=require("cwd");module.exports=require(cwd("package.json"))},{cwd:22}],48:[function(require,module,exports){(function(process){"use strict";var fs=require("fs");var path=require("path");var debug=require("debug")("lookup-path");var isAbsolute=require("is-absolute");module.exports=function lookup(filepath,cwd){if(typeof filepath!=="string"){return filepath}cwd=cwd||process.cwd();if(isAbsolute(filepath)){return filepath}else if(fs.existsSync(path.join(cwd,filepath))){return path.join(cwd,filepath)}else if(fs.existsSync(path.resolve(cwd,filepath))){return path.resolve(cwd,filepath)}else{debug("cannot find: %s",filepath);return null}}}).call(this,require("_process"))},{_process:6,debug:65,fs:1,"is-absolute":49,path:5}],49:[function(require,module,exports){"use strict";var isRelative=require("is-relative");module.exports=function isAbsolute(filepath){if("/"===filepath[0]){return true}if(":"===filepath[1]&&"\\"===filepath[2]){return true}if("\\\\"==filepath.substring(0,2)){return true}if(!isRelative(filepath)){return true}}},{"is-relative":50}],50:[function(require,module,exports){"use strict";module.exports=function isRelative(filepath){if(typeof filepath!=="string"){throw new Error("isRelative expects a string.")}return!/^([a-z]+:)?[\\\/]/i.test(filepath)}},{}],51:[function(require,module,exports){"use strict";var minimatch=require("minimatch");var union=require("array-union");var diff=require("array-differ");function arrayify(arr){return Array.isArray(arr)?arr:[arr]}module.exports=function(list,patterns,options){list=arrayify(list);patterns=arrayify(patterns);if(list.length===0||patterns.length===0){return[]}options=options||{};return patterns.reduce(function(ret,pattern,i){if(pattern[0]==="!"){return diff(ret,minimatch.match(ret,pattern.slice(1),options))}return union(ret,minimatch.match(list,pattern,options))},[])}},{"array-differ":52,"array-union":53,minimatch:55}],52:[function(require,module,exports){arguments[4][31][0].apply(exports,arguments)},{dup:31}],53:[function(require,module,exports){arguments[4][32][0].apply(exports,arguments)},{"array-uniq":54,dup:32}],54:[function(require,module,exports){(function(global){"use strict";function uniqNoSet(arr){var ret=[];for(var i=0;i<arr.length;i++){if(ret.indexOf(arr[i])===-1){ret.push(arr[i])}}return ret}function uniqSet(arr){var seen=new Set;return arr.filter(function(el){if(!seen.has(el)){seen.add(el);return true}})}function uniqSetWithForEach(arr){var ret=[];new Set(arr).forEach(function(el){ret.push(el)});return ret}if("Set"in global){if(typeof Set.prototype.forEach==="function"){module.exports=uniqSetWithForEach}else{module.exports=uniqSet}}else{module.exports=uniqNoSet}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],55:[function(require,module,exports){(function(process){(function(require,exports,module,platform){if(module)module.exports=minimatch;else exports.minimatch=minimatch;if(!require){require=function(id){switch(id){case"sigmund":return function sigmund(obj){return JSON.stringify(obj)};case"path":return{basename:function(f){f=f.split(/[\/\\]/);var e=f.pop();if(!e)e=f.pop();return e}};case"lru-cache":return function LRUCache(){var cache={};var cnt=0;this.set=function(k,v){cnt++;if(cnt>=100)cache={};cache[k]=v};this.get=function(k){return cache[k]}}}}}minimatch.Minimatch=Minimatch;var LRU=require("lru-cache"),cache=minimatch.cache=new LRU({max:100}),GLOBSTAR=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={},sigmund=require("sigmund");var path=require("path"),qmark="[^/]",star=qmark+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",reSpecials=charSet("().*{}+?[]^$\\!");function charSet(s){return s.split("").reduce(function(set,c){set[c]=true;return set},{})}var slashSplit=/\/+/;minimatch.filter=filter;function filter(pattern,options){options=options||{};return function(p,i,list){return minimatch(p,pattern,options)}}function ext(a,b){a=a||{};b=b||{};var t={};Object.keys(b).forEach(function(k){t[k]=b[k]});Object.keys(a).forEach(function(k){t[k]=a[k]});return t}minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return minimatch;var orig=minimatch;var m=function minimatch(p,pattern,options){return orig.minimatch(p,pattern,ext(def,options))};m.Minimatch=function Minimatch(pattern,options){return new orig.Minimatch(pattern,ext(def,options))};return m};Minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return Minimatch;return minimatch.defaults(def).Minimatch};function minimatch(p,pattern,options){if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};if(!options.nocomment&&pattern.charAt(0)==="#"){return false}if(pattern.trim()==="")return p==="";return new Minimatch(pattern,options).match(p)}function Minimatch(pattern,options){if(!(this instanceof Minimatch)){return new Minimatch(pattern,options,cache)}if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};pattern=pattern.trim();if(platform==="win32"){pattern=pattern.split("\\").join("/")}var cacheKey=pattern+"\n"+sigmund(options);var cached=minimatch.cache.get(cacheKey);if(cached)return cached;minimatch.cache.set(cacheKey,this);this.options=options;this.set=[];this.pattern=pattern;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){if(this._made)return;var pattern=this.pattern;var options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=true;return}if(!pattern){this.empty=true;return}this.parseNegate();var set=this.globSet=this.braceExpand();if(options.debug)this.debug=console.error;this.debug(this.pattern,set);set=this.globParts=set.map(function(s){return s.split(slashSplit)});this.debug(this.pattern,set);set=set.map(function(s,si,set){return s.map(this.parse,this)},this);this.debug(this.pattern,set);set=set.filter(function(s){return-1===s.indexOf(false)});this.debug(this.pattern,set);this.set=set}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var pattern=this.pattern,negate=false,options=this.options,negateOffset=0;if(options.nonegate)return;for(var i=0,l=pattern.length;i<l&&pattern.charAt(i)==="!";i++){negate=!negate;negateOffset++}if(negateOffset)this.pattern=pattern.substr(negateOffset);this.negate=negate}minimatch.braceExpand=function(pattern,options){return new Minimatch(pattern,options).braceExpand()};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(pattern,options){options=options||this.options;pattern=typeof pattern==="undefined"?this.pattern:pattern;if(typeof pattern==="undefined"){throw new Error("undefined pattern")}if(options.nobrace||!pattern.match(/\{.*\}/)){return[pattern]}var escaping=false;if(pattern.charAt(0)!=="{"){this.debug(pattern);var prefix=null;for(var i=0,l=pattern.length;i<l;i++){var c=pattern.charAt(i);this.debug(i,c);if(c==="\\"){escaping=!escaping}else if(c==="{"&&!escaping){prefix=pattern.substr(0,i);break}}if(prefix===null){this.debug("no sets");return[pattern]}var tail=braceExpand.call(this,pattern.substr(i),options);return tail.map(function(t){return prefix+t})}var numset=pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(numset){this.debug("numset",numset[1],numset[2]);var suf=braceExpand.call(this,pattern.substr(numset[0].length),options),start=+numset[1],end=+numset[2],inc=start>end?-1:1,set=[];for(var i=start;i!=end+inc;i+=inc){for(var ii=0,ll=suf.length;ii<ll;ii++){set.push(i+suf[ii])}}return set}var i=1,depth=1,set=[],member="",sawEnd=false,escaping=false;function addMember(){set.push(member);member=""}this.debug("Entering for");FOR:for(i=1,l=pattern.length;i<l;i++){var c=pattern.charAt(i);this.debug("",i,c);if(escaping){escaping=false;member+="\\"+c}else{switch(c){case"\\":escaping=true;continue;case"{":depth++;member+="{";continue;case"}":depth--;if(depth===0){addMember();i++;break FOR}else{member+=c;continue}case",":if(depth===1){addMember()}else{member+=c}continue;default:member+=c;continue}}}if(depth!==0){this.debug("didn't close",pattern);return braceExpand.call(this,"\\"+pattern,options)}this.debug("set",set);this.debug("suffix",pattern.substr(i));var suf=braceExpand.call(this,pattern.substr(i),options);var addBraces=set.length===1;this.debug("set pre-expanded",set);set=set.map(function(p){return braceExpand.call(this,p,options)},this);this.debug("set expanded",set);set=set.reduce(function(l,r){return l.concat(r)});if(addBraces){set=set.map(function(s){return"{"+s+"}"})}var ret=[];for(var i=0,l=set.length;i<l;i++){for(var ii=0,ll=suf.length;ii<ll;ii++){ret.push(set[i]+suf[ii])}}return ret}Minimatch.prototype.parse=parse;var SUBPARSE={};function parse(pattern,isSub){var options=this.options;if(!options.noglobstar&&pattern==="**")return GLOBSTAR;if(pattern==="")return"";var re="",hasMagic=!!options.nocase,escaping=false,patternListStack=[],plType,stateChar,inClass=false,reClassStart=-1,classStart=-1,patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",self=this;function clearStateChar(){if(stateChar){switch(stateChar){case"*":re+=star;hasMagic=true;break;case"?":re+=qmark;hasMagic=true;break;default:re+="\\"+stateChar;break}self.debug("clearStateChar %j %j",stateChar,re);stateChar=false}}for(var i=0,len=pattern.length,c;i<len&&(c=pattern.charAt(i));i++){this.debug("%s %s %s %j",pattern,i,re,c);if(escaping&&reSpecials[c]){re+="\\"+c;escaping=false;continue}SWITCH:switch(c){case"/":return false;case"\\":clearStateChar();escaping=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c);if(inClass){this.debug(" in class");if(c==="!"&&i===classStart+1)c="^";re+=c;continue}self.debug("call clearStateChar %j",stateChar);clearStateChar();stateChar=c;if(options.noext)clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}plType=stateChar;patternListStack.push({type:plType,start:i-1,reStart:re.length});re+=stateChar==="!"?"(?:(?!":"(?:";this.debug("plType %j %j",stateChar,re);stateChar=false;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar();hasMagic=true;re+=")";plType=patternListStack.pop().type;switch(plType){case"!":re+="[^/]*?)";break;case"?":case"+":case"*":re+=plType;case"@":break}continue;case"|":if(inClass||!patternListStack.length||escaping){re+="\\|";escaping=false;continue}clearStateChar();re+="|";continue;case"[":clearStateChar();if(inClass){re+="\\"+c;continue}inClass=true;classStart=i;reClassStart=re.length;re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c;escaping=false;continue}hasMagic=true;inClass=false;re+=c;continue;default:clearStateChar();if(escaping){escaping=false}else if(reSpecials[c]&&!(c==="^"&&inClass)){re+="\\"}re+=c}}if(inClass){var cs=pattern.substr(classStart+1),sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0];hasMagic=hasMagic||sp[1]}var pl;while(pl=patternListStack.pop()){var tail=re.slice(pl.reStart+3);tail=tail.replace(/((?:\\{2})*)(\\?)\|/g,function(_,$1,$2){if(!$2){$2="\\"}return $1+$1+$2+"|"});this.debug("tail=%j\n %s",tail,tail);var t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=true;re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar();if(escaping){re+="\\\\"}var addPatternStart=false;switch(re.charAt(0)){case".":case"[":case"(":addPatternStart=true}if(re!==""&&hasMagic)re="(?=.)"+re;if(addPatternStart)re=patternStart+re;if(isSub===SUBPARSE){return[re,hasMagic]}if(!hasMagic){return globUnescape(pattern)}var flags=options.nocase?"i":"",regExp=new RegExp("^"+re+"$",flags);regExp._glob=pattern;regExp._src=re;return regExp}minimatch.makeRe=function(pattern,options){return new Minimatch(pattern,options||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var set=this.set;if(!set.length)return this.regexp=false;var options=this.options;var twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot,flags=options.nocase?"i":"";var re=set.map(function(pattern){return pattern.map(function(p){return p===GLOBSTAR?twoStar:typeof p==="string"?regExpEscape(p):p._src}).join("\\/")}).join("|");re="^(?:"+re+")$";if(this.negate)re="^(?!"+re+").*$";try{return this.regexp=new RegExp(re,flags)}catch(ex){return this.regexp=false}}minimatch.match=function(list,pattern,options){options=options||{};var mm=new Minimatch(pattern,options);list=list.filter(function(f){return mm.match(f)});if(mm.options.nonull&&!list.length){list.push(pattern)}return list};Minimatch.prototype.match=match;function match(f,partial){this.debug("match",f,this.pattern);if(this.comment)return false;if(this.empty)return f==="";if(f==="/"&&partial)return true;var options=this.options;if(platform==="win32"){f=f.split("\\").join("/")}f=f.split(slashSplit);this.debug(this.pattern,"split",f);var set=this.set;this.debug(this.pattern,"set",set);var filename;for(var i=f.length-1;i>=0;i--){filename=f[i];if(filename)break}for(var i=0,l=set.length;i<l;i++){var pattern=set[i],file=f;if(options.matchBase&&pattern.length===1){file=[filename]}var hit=this.matchOne(file,pattern,partial);if(hit){if(options.flipNegate)return true;return!this.negate}}if(options.flipNegate)return false;return this.negate}Minimatch.prototype.matchOne=function(file,pattern,partial){var options=this.options;this.debug("matchOne",{"this":this,file:file,pattern:pattern});this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f=file[fi];this.debug(pattern,p,f);if(p===false)return false;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi,pr=pi+1;if(pr===pl){this.debug("** at the end");for(;fi<fl;fi++){if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return false}return true}WHILE:while(fr<fl){var swallowee=file[fr];this.debug("\nglobstar while",file,fr,pattern,pr,swallowee);if(this.matchOne(file.slice(fr),pattern.slice(pr),partial)){this.debug("globstar found match!",fr,fl,swallowee);return true}else{if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break WHILE}this.debug("globstar swallow a segment, and continue");fr++}}if(partial){this.debug("\n>>> no match, partial?",file,fr,pattern,pr);if(fr===fl)return true}return false}var hit;if(typeof p==="string"){if(options.nocase){hit=f.toLowerCase()===p.toLowerCase()}else{hit=f===p}this.debug("string match",p,f,hit)}else{hit=f.match(p);this.debug("pattern match",p,f,hit)}if(!hit)return false}if(fi===fl&&pi===pl){return true}else if(fi===fl){return partial}else if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}})(typeof require==="function"?require:null,this,typeof module==="object"?module:null,typeof process==="object"?process.platform:"win32")}).call(this,require("_process"))},{_process:6,"lru-cache":56,path:5,sigmund:57}],56:[function(require,module,exports){arguments[4][27][0].apply(exports,arguments)},{dup:27}],57:[function(require,module,exports){arguments[4][28][0].apply(exports,arguments)},{dup:28}],58:[function(require,module,exports){var core=require("./lib/core");exports=module.exports=require("./lib/async");exports.core=core;exports.isCore=function(x){return core[x]};exports.sync=require("./lib/sync")},{"./lib/async":59,"./lib/core":62,"./lib/sync":64}],59:[function(require,module,exports){(function(process){var core=require("./core");var fs=require("fs");var path=require("path");var caller=require("./caller.js");var nodeModulesPaths=require("./node-modules-paths.js");module.exports=function resolve(x,opts,cb){if(typeof opts==="function"){cb=opts;opts={}}if(!opts)opts={};if(typeof x!=="string"){return process.nextTick(function(){cb(new Error("path must be a string"))})}var isFile=opts.isFile||function(file,cb){fs.stat(file,function(err,stat){if(err&&err.code==="ENOENT")cb(null,false);else if(err)cb(err);else cb(null,stat.isFile()||stat.isFIFO())})};var readFile=opts.readFile||fs.readFile;var extensions=opts.extensions||[".js"];var y=opts.basedir||path.dirname(caller());opts.paths=opts.paths||[];if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[\\\/])/.test(x)){var res=path.resolve(y,x);if(x==="..")res+="/";loadAsFile(res,function(err,m,pkg){if(err)cb(err);else if(m)cb(null,m,pkg);else loadAsDirectory(path.resolve(y,x),function(err,d,pkg){if(err)cb(err);else if(d)cb(null,d,pkg);else cb(new Error("Cannot find module '"+x+"' from '"+y+"'"))})})}else loadNodeModules(x,y,function(err,n,pkg){if(err)cb(err);else if(n)cb(null,n,pkg);else if(core[x])return cb(null,x);else cb(new Error("Cannot find module '"+x+"' from '"+y+"'"))});function loadAsFile(x,pkg,cb){if(typeof pkg==="function"){cb=pkg;pkg=opts.package}(function load(exts){if(exts.length===0)return cb(null,undefined,pkg);var file=x+exts[0];isFile(file,function(err,ex){if(err)cb(err);else if(ex)cb(null,file,pkg);else load(exts.slice(1))})})([""].concat(extensions))}function loadAsDirectory(x,fpkg,cb){if(typeof fpkg==="function"){cb=fpkg;fpkg=opts.package}var pkgfile=path.join(x,"/package.json");isFile(pkgfile,function(err,ex){if(err)return cb(err);if(!ex)return loadAsFile(path.join(x,"/index"),fpkg,cb);readFile(pkgfile,function(err,body){if(err)return cb(err);try{var pkg=JSON.parse(body)}catch(err){}if(opts.packageFilter){pkg=opts.packageFilter(pkg,x)}if(pkg.main){if(pkg.main==="."||pkg.main==="./"){pkg.main="index"}loadAsFile(path.resolve(x,pkg.main),pkg,function(err,m,pkg){if(err)return cb(err);if(m)return cb(null,m,pkg);if(!pkg)return loadAsFile(path.join(x,"/index"),pkg,cb);var dir=path.resolve(x,pkg.main);loadAsDirectory(dir,pkg,function(err,n,pkg){if(err)return cb(err);if(n)return cb(null,n,pkg);loadAsFile(path.join(x,"/index"),pkg,cb)})});return}loadAsFile(path.join(x,"/index"),pkg,cb)})})}function loadNodeModules(x,start,cb){(function process(dirs){if(dirs.length===0)return cb(null,undefined);var dir=dirs[0];loadAsFile(path.join(dir,"/",x),undefined,function(err,m,pkg){if(err)return cb(err);if(m)return cb(null,m,pkg);loadAsDirectory(path.join(dir,"/",x),undefined,function(err,n,pkg){if(err)return cb(err);if(n)return cb(null,n,pkg);process(dirs.slice(1))})})})(nodeModulesPaths(start,opts))}}}).call(this,require("_process"))},{"./caller.js":60,"./core":62,"./node-modules-paths.js":63,_process:6,fs:1,path:5}],60:[function(require,module,exports){module.exports=function(){var origPrepareStackTrace=Error.prepareStackTrace;Error.prepareStackTrace=function(_,stack){return stack};var stack=(new Error).stack;Error.prepareStackTrace=origPrepareStackTrace;return stack[2].getFileName()}},{}],61:[function(require,module,exports){module.exports=["assert","buffer_ieee754","buffer","child_process","cluster","console","constants","crypto","_debugger","dgram","dns","domain","events","freelist","fs","http","https","_linklist","module","net","os","path","punycode","querystring","readline","repl","stream","string_decoder","sys","timers","tls","tty","url","util","vm","zlib"]},{}],62:[function(require,module,exports){module.exports=require("./core.json").reduce(function(acc,x){acc[x]=true;return acc},{})},{"./core.json":61}],63:[function(require,module,exports){(function(process){var path=require("path");module.exports=function(start,opts){var modules=opts.moduleDirectory?[].concat(opts.moduleDirectory):["node_modules"];var prefix="/";if(/^([A-Za-z]:)/.test(start)){prefix=""}else if(/^\\\\/.test(start)){prefix="\\\\"}var splitRe=process.platform==="win32"?/[\/\\]/:/\/+/;start=path.resolve(start);var parts=start.split(splitRe);var dirs=[];for(var i=parts.length-1;i>=0;i--){if(modules.indexOf(parts[i])!==-1)continue;dirs=dirs.concat(modules.map(function(module_dir){return prefix+path.join(path.join.apply(path,parts.slice(0,i+1)),module_dir)}))}if(process.platform==="win32"){dirs[dirs.length-1]=dirs[dirs.length-1].replace(":",":\\")}return dirs.concat(opts.paths)}}).call(this,require("_process"))},{_process:6,path:5}],64:[function(require,module,exports){var core=require("./core");var fs=require("fs");var path=require("path");var caller=require("./caller.js");var nodeModulesPaths=require("./node-modules-paths.js");module.exports=function(x,opts){if(!opts)opts={};var isFile=opts.isFile||function(file){try{var stat=fs.statSync(file)}catch(err){if(err&&err.code==="ENOENT")return false}return stat.isFile()||stat.isFIFO()};var readFileSync=opts.readFileSync||fs.readFileSync;var extensions=opts.extensions||[".js"];var y=opts.basedir||path.dirname(caller());opts.paths=opts.paths||[];if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[\\\/])/.test(x)){var res=path.resolve(y,x);if(x==="..")res+="/";var m=loadAsFileSync(res)||loadAsDirectorySync(res);if(m)return m}else{var n=loadNodeModulesSync(x,y);if(n)return n}if(core[x])return x;throw new Error("Cannot find module '"+x+"' from '"+y+"'");function loadAsFileSync(x){if(isFile(x)){return x}for(var i=0;i<extensions.length;i++){var file=x+extensions[i];if(isFile(file)){return file}}}function loadAsDirectorySync(x){var pkgfile=path.join(x,"/package.json");if(isFile(pkgfile)){var body=readFileSync(pkgfile,"utf8");try{var pkg=JSON.parse(body);if(opts.packageFilter){pkg=opts.packageFilter(pkg,x)}if(pkg.main){var m=loadAsFileSync(path.resolve(x,pkg.main));if(m)return m;var n=loadAsDirectorySync(path.resolve(x,pkg.main));if(n)return n}}catch(err){}}return loadAsFileSync(path.join(x,"/index"))}function loadNodeModulesSync(x,start){var dirs=nodeModulesPaths(start,opts);for(var i=0;i<dirs.length;i++){var dir=dirs[i];var m=loadAsFileSync(path.join(dir,"/",x));if(m)return m;var n=loadAsDirectorySync(path.join(dir,"/",x));if(n)return n}}}},{"./caller.js":60,"./core":62,"./node-modules-paths.js":63,fs:1,path:5}],65:[function(require,module,exports){exports=module.exports=require("./debug");exports.log=log;exports.formatArgs=formatArgs;exports.save=save;exports.load=load;exports.useColors=useColors;exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function useColors(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}exports.formatters.j=function(v){return JSON.stringify(v)};function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff);if(!useColors)return args;var c="color: "+this.color;args=[args[0],c,"color: inherit"].concat(Array.prototype.slice.call(args,1));var index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if("%%"===match)return;index++;if("%c"===match){lastC=index}});args.splice(lastC,0,c);return args}function log(){return"object"==typeof console&&"function"==typeof console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{if(null==namespaces){localStorage.removeItem("debug")}else{localStorage.debug=namespaces}}catch(e){}}function load(){var r;try{r=localStorage.debug}catch(e){}return r}exports.enable(load())},{"./debug":66}],66:[function(require,module,exports){arguments[4][11][0].apply(exports,arguments)},{dup:11,ms:67}],67:[function(require,module,exports){arguments[4][12][0].apply(exports,arguments)},{dup:12}],68:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index<length){if(array[index]===value){return index}}return-1}function cacheIndexOf(cache,value){var type=typeof value;cache=cache.cache;if(type=="boolean"||value==null){return cache[value]?0:-1}if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value;cache=(cache=cache[type])&&cache[key];return type=="object"?cache&&baseIndexOf(cache,value)>-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++index<length){var value=ac[index],other=bc[index];if(value!==other){if(value>other||typeof value=="undefined"){return 1}if(value<other||typeof other=="undefined"){return-1}}}return a.index-b.index}function createCache(array){var index=-1,length=array.length,first=array[0],mid=array[length/2|0],last=array[length-1];if(first&&typeof first=="object"&&mid&&typeof mid=="object"&&last&&typeof last=="object"){return false}var cache=getObject();cache["false"]=cache["null"]=cache["true"]=cache["undefined"]=false;var result=getObject();result.array=array;result.cache=cache;result.push=cachePush;while(++index<length){result.push(array[index])}return result}function escapeStringChar(match){return"\\"+stringEscapes[match]}function getArray(){return arrayPool.pop()||[]}function getObject(){return objectPool.pop()||{array:null,cache:null,criteria:null,"false":false,index:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,value:null}}function releaseArray(array){array.length=0;if(arrayPool.length<maxPoolSize){arrayPool.push(array)}}function releaseObject(object){var cache=object.cache;if(cache){releaseObject(cache)}object.array=object.cache=object.criteria=object.object=object.number=object.string=object.value=null;if(objectPool.length<maxPoolSize){objectPool.push(object)}}function slice(array,start,end){start||(start=0);if(typeof end=="undefined"){end=array?array.length:0}var index=-1,length=end-start||0,result=Array(length<0?0:length);while(++index<length){result[index]=array[start+index]}return result}function runInContext(context){context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Boolean=context.Boolean,Date=context.Date,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;var arrayRef=[];var objectProto=Object.prototype;var oldDash=context._;var toString=objectProto.toString;var reNative=RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");var ceil=Math.ceil,clearTimeout=context.clearTimeout,floor=Math.floor,fnToString=Function.prototype.toString,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,hasOwnProperty=objectProto.hasOwnProperty,push=arrayRef.push,setTimeout=context.setTimeout,splice=arrayRef.splice,unshift=arrayRef.unshift;var defineProperty=function(){try{var o={},func=isNative(func=Object.defineProperty)&&func,result=func(o,o,o)&&func}catch(e){}return result}();var nativeCreate=isNative(nativeCreate=Object.create)&&nativeCreate,nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeIsFinite=context.isFinite,nativeIsNaN=context.isNaN,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,nativeParseInt=context.parseInt,nativeRandom=Math.random;var ctorByClass={};ctorByClass[arrayClass]=Array;ctorByClass[boolClass]=Boolean;ctorByClass[dateClass]=Date;ctorByClass[funcClass]=Function; | |
ctorByClass[objectClass]=Object;ctorByClass[numberClass]=Number;ctorByClass[regexpClass]=RegExp;ctorByClass[stringClass]=String;function lodash(value){return value&&typeof value=="object"&&!isArray(value)&&hasOwnProperty.call(value,"__wrapped__")?value:new lodashWrapper(value)}function lodashWrapper(value,chainAll){this.__chain__=!!chainAll;this.__wrapped__=value}lodashWrapper.prototype=lodash.prototype;var support=lodash.support={};support.funcDecomp=!isNative(context.WinRTError)&&reThis.test(runInContext);support.funcNames=typeof Function.name=="string";lodash.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length<arity){bitmask|=16&~32;return baseCreateWrapper([func,isCurryBound?bitmask:bitmask&~3,args,null,thisArg,arity])}}args||(args=arguments);if(isBindKey){func=thisBinding[key]}if(this instanceof bound){thisBinding=baseCreate(func.prototype);var result=func.apply(thisBinding,args);return isObject(result)?result:thisBinding}return func.apply(thisBinding,args)}setBindData(bound,bindData);return bound}function baseDifference(array,values){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,isLarge=length>=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index<length){var value=array[index];if(indexOf(values,value)<0){result.push(value)}}if(isLarge){releaseObject(values)}return result}function baseFlatten(array,isShallow,isStrict,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value&&typeof value=="object"&&typeof value.length=="number"&&(isArray(value)||isArguments(value))){if(!isShallow){value=baseFlatten(value,isShallow,isStrict)}var valIndex=-1,valLength=value.length,resIndex=result.length;result.length+=valLength;while(++valIndex<valLength){result[resIndex++]=value[valIndex]}}else if(!isStrict){result.push(value)}}return result}function baseIsEqual(a,b,callback,isWhere,stackA,stackB){if(callback){var result=callback(a,b);if(typeof result!="undefined"){return!!result}}if(a===b){return a!==0||1/a==1/b}var type=typeof a,otherType=typeof b;if(a===a&&!(a&&objectTypes[type])&&!(b&&objectTypes[otherType])){return false}if(a==null||b==null){return a===b}var className=toString.call(a),otherClass=toString.call(b);if(className==argsClass){className=objectClass}if(otherClass==argsClass){otherClass=objectClass}if(className!=otherClass){return false}switch(className){case boolClass:case dateClass:return+a==+b;case numberClass:return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case regexpClass:case stringClass:return a==String(b)}var isArr=className==arrayClass;if(!isArr){var aWrapped=hasOwnProperty.call(a,"__wrapped__"),bWrapped=hasOwnProperty.call(b,"__wrapped__");if(aWrapped||bWrapped){return baseIsEqual(aWrapped?a.__wrapped__:a,bWrapped?b.__wrapped__:b,callback,isWhere,stackA,stackB)}if(className!=objectClass){return false}var ctorA=a.constructor,ctorB=b.constructor;if(ctorA!=ctorB&&!(isFunction(ctorA)&&ctorA instanceof ctorA&&isFunction(ctorB)&&ctorB instanceof ctorB)&&("constructor"in a&&"constructor"in b)){return false}}var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==a){return stackB[length]==b}}var size=0;result=true;stackA.push(a);stackB.push(b);if(isArr){length=a.length;size=b.length;result=size==length;if(result||isWhere){while(size--){var index=length,value=b[size];if(isWhere){while(index--){if(result=baseIsEqual(a[index],value,callback,isWhere,stackA,stackB)){break}}}else if(!(result=baseIsEqual(a[size],value,callback,isWhere,stackA,stackB))){break}}}}else{forIn(b,function(value,key,b){if(hasOwnProperty.call(b,key)){size++;return result=hasOwnProperty.call(a,key)&&baseIsEqual(a[key],value,callback,isWhere,stackA,stackB)}});if(result&&!isWhere){forIn(a,function(value,key,a){if(hasOwnProperty.call(a,key)){return result=--size>-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index<length){var value=array[index],computed=callback?callback(value,index,array):value;if(isSorted?!index||seen[seen.length-1]!==computed:indexOf(seen,computed)<0){if(callback||isLarge){seen.push(computed)}result.push(value)}}if(isLarge){releaseArray(seen.array);releaseObject(seen)}else if(callback){releaseArray(seen)}return result}function createAggregator(setter){return function(collection,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];setter(result,value,callback(value,index,collection),collection)}}else{forOwn(collection,function(value,key,collection){setter(result,value,callback(value,key,collection),collection)})}return result}}function createWrapper(func,bitmask,partialArgs,partialRightArgs,thisArg,arity){var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,isPartial=bitmask&16,isPartialRight=bitmask&32;if(!isBindKey&&!isFunction(func)){throw new TypeError}if(isPartial&&!partialArgs.length){bitmask&=~16;isPartial=partialArgs=false}if(isPartialRight&&!partialRightArgs.length){bitmask&=~32;isPartialRight=partialRightArgs=false}var bindData=func&&func.__bindData__;if(bindData&&bindData!==true){bindData=slice(bindData);if(bindData[2]){bindData[2]=slice(bindData[2])}if(bindData[3]){bindData[3]=slice(bindData[3])}if(isBind&&!(bindData[1]&1)){bindData[4]=thisArg}if(!isBind&&bindData[1]&1){bitmask|=8}if(isCurry&&!(bindData[1]&4)){bindData[5]=arity}if(isPartial){push.apply(bindData[2]||(bindData[2]=[]),partialArgs)}if(isPartialRight){unshift.apply(bindData[3]||(bindData[3]=[]),partialRightArgs)}bindData[1]|=bitmask;return createWrapper.apply(null,bindData)}var creater=bitmask==1||bitmask===17?baseBind:baseCreateWrapper;return creater([func,bitmask,partialArgs,partialRightArgs,thisArg,arity])}function escapeHtmlChar(match){return htmlEscapes[match]}function getIndexOf(){var result=(result=lodash.indexOf)===indexOf?baseIndexOf:result;return result}function isNative(value){return typeof value=="function"&&reNative.test(value)}var setBindData=!defineProperty?noop:function(func,value){descriptor.value=value;defineProperty(func,"__bindData__",descriptor)};function shimIsPlainObject(value){var ctor,result;if(!(value&&toString.call(value)==objectClass)||(ctor=value.constructor,isFunction(ctor)&&!(ctor instanceof ctor))){return false}forIn(value,function(value,key){result=key});return typeof result=="undefined"||hasOwnProperty.call(value,result)}function unescapeHtmlChar(match){return htmlUnescapes[match]}function isArguments(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==argsClass||false}var isArray=nativeIsArray||function(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==arrayClass||false};var shimKeys=function(object){var index,iterable=object,result=[];if(!iterable)return result;if(!objectTypes[typeof object])return result;for(index in iterable){if(hasOwnProperty.call(iterable,index)){result.push(index)}}return result};var keys=!nativeKeys?shimKeys:function(object){if(!isObject(object)){return[]}return nativeKeys(object)};var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];result[index]=callback?callback(result[index],iterable[index]):iterable[index]}}}return result};function clone(value,isDeep,callback,thisArg){if(typeof isDeep!="boolean"&&isDeep!=null){thisArg=callback;callback=isDeep;isDeep=false}return baseClone(value,isDeep,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function cloneDeep(value,callback,thisArg){return baseClone(value,true,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function create(prototype,properties){var result=baseCreate(prototype);return properties?assign(result,properties):result}var defaults=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(typeof result[index]=="undefined")result[index]=iterable[index]}}}return result};function findKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}function findLastKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwnRight(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}var forIn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);for(index in iterable){if(callback(iterable[index],index,collection)===false)return result}return result};function forInRight(object,callback,thisArg){var pairs=[];forIn(object,function(value,key){pairs.push(key,value)});var length=pairs.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){if(callback(pairs[length--],pairs[length],object)===false){break}}return object}var forOwn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(callback(iterable[index],index,collection)===false)return result}return result};function forOwnRight(object,callback,thisArg){var props=keys(object),length=props.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){var key=props[length];if(callback(object[key],key,object)===false){break}}return object}function functions(object){var result=[];forIn(object,function(value,key){if(isFunction(value)){result.push(key)}});return result.sort()}function has(object,key){return object?hasOwnProperty.call(object,key):false}function invert(object){var index=-1,props=keys(object),length=props.length,result={};while(++index<length){var key=props[index];result[object[key]]=key}return result}function isBoolean(value){return value===true||value===false||value&&typeof value=="object"&&toString.call(value)==boolClass||false}function isDate(value){return value&&typeof value=="object"&&toString.call(value)==dateClass||false}function isElement(value){return value&&value.nodeType===1||false}function isEmpty(value){var result=true;if(!value){return result}var className=toString.call(value),length=value.length;if(className==arrayClass||className==stringClass||className==argsClass||className==objectClass&&typeof length=="number"&&isFunction(value.splice)){return!length}forOwn(value,function(){return result=false});return result}function isEqual(a,b,callback,thisArg){return baseIsEqual(a,b,typeof callback=="function"&&baseCreateCallback(callback,thisArg,2))}function isFinite(value){return nativeIsFinite(value)&&!nativeIsNaN(parseFloat(value))}function isFunction(value){return typeof value=="function"}function isObject(value){return!!(value&&objectTypes[typeof value])}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||value&&typeof value=="object"&&toString.call(value)==numberClass||false}var isPlainObject=!getPrototypeOf?shimIsPlainObject:function(value){if(!(value&&toString.call(value)==objectClass)){return false}var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)};function isRegExp(value){return value&&typeof value=="object"&&toString.call(value)==regexpClass||false}function isString(value){return typeof value=="string"||value&&typeof value=="object"&&toString.call(value)==stringClass||false}function isUndefined(value){return typeof value=="undefined"}function mapValues(object,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){result[key]=callback(value,key,object)});return result}function merge(object){var args=arguments,length=2;if(!isObject(object)){return object}if(typeof args[2]!="number"){length=args.length}if(length>3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index<length){baseMerge(object,sources[index],callback,stackA,stackB)}releaseArray(stackA);releaseArray(stackB);return object}function omit(object,callback,thisArg){var result={};if(typeof callback!="function"){var props=[];forIn(object,function(value,key){props.push(key)});props=baseDifference(props,baseFlatten(arguments,true,false,1));var index=-1,length=props.length;while(++index<length){var key=props[index];result[key]=object[key]}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(!callback(value,key,object)){result[key]=value}})}return result}function pairs(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}function pick(object,callback,thisArg){var result={};if(typeof callback!="function"){var index=-1,props=baseFlatten(arguments,true,false,1),length=isObject(object)?props.length:0;while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(callback(value,key,object)){result[key]=value}})}return result}function transform(object,callback,accumulator,thisArg){var isArr=isArray(object);if(accumulator==null){if(isArr){accumulator=[]}else{var ctor=object&&object.constructor,proto=ctor&&ctor.prototype;accumulator=baseCreate(proto)}}if(callback){callback=lodash.createCallback(callback,thisArg,4);(isArr?forEach:forOwn)(object,function(value,index,object){return callback(accumulator,value,index,object)})}return accumulator}function values(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){result[index]=object[props[index]]}return result}function at(collection){var args=arguments,index=-1,props=baseFlatten(args,true,false,1),length=args[2]&&args[2][args[1]]===collection?1:props.length,result=Array(length);while(++index<length){result[index]=collection[props[index]]}return result}function contains(collection,target,fromIndex){var index=-1,indexOf=getIndexOf(),length=collection?collection.length:0,result=false;fromIndex=(fromIndex<0?nativeMax(0,length+fromIndex):fromIndex)||0;if(isArray(collection)){result=indexOf(collection,target,fromIndex)>-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(!(result=!!callback(collection[index],index,collection))){break}}}else{forOwn(collection,function(value,index,collection){return result=!!callback(value,index,collection)})}return result}function filter(collection,callback,thisArg){var result=[];callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){result.push(value)}}}else{forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result.push(value)}})}return result}function find(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){return value}}}else{var result;forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}}function findLast(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forEachRight(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}function forEach(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(++index<length){if(callback(collection[index],index,collection)===false){break}}}else{forOwn(collection,callback)}return collection}function forEachRight(collection,callback,thisArg){var length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(length--){if(callback(collection[length],length,collection)===false){break}}}else{var props=keys(collection);length=props.length;forOwn(collection,function(value,key,collection){key=props?props[--length]:--length;return callback(collection[key],key,collection)})}return collection}var groupBy=createAggregator(function(result,value,key){(hasOwnProperty.call(result,key)?result[key]:result[key]=[]).push(value)});var indexBy=createAggregator(function(result,value,key){result[key]=value});function invoke(collection,methodName){var args=slice(arguments,2),index=-1,isFunc=typeof methodName=="function",length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){result[++index]=(isFunc?methodName:value[methodName]).apply(value,args)});return result}function map(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=lodash.createCallback(callback,thisArg,3);if(typeof length=="number"){var result=Array(length);while(++index<length){result[index]=callback(collection[index],index,collection)}}else{result=[];forOwn(collection,function(value,key,collection){result[++index]=callback(value,key,collection)})}return result}function max(collection,callback,thisArg){var computed=-Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value>result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value<result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current<computed){computed=current;result=value}})}return result}var pluck=map;function reduce(collection,callback,accumulator,thisArg){if(!collection)return accumulator;var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);var index=-1,length=collection.length;if(typeof length=="number"){if(noaccum){accumulator=collection[++index]}while(++index<length){accumulator=callback(accumulator,collection[index],index,collection)}}else{forOwn(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)})}return accumulator}function reduceRight(collection,callback,accumulator,thisArg){var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);forEachRight(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)});return accumulator}function reject(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);return filter(collection,function(value,index,collection){return!callback(value,index,collection)})}function sample(collection,n,guard){if(collection&&typeof collection.length!="number"){collection=values(collection)}if(n==null||guard){return collection?collection[baseRandom(0,collection.length-1)]:undefined}var result=shuffle(collection);result.length=nativeMin(nativeMax(0,n),result.length);return result}function shuffle(collection){var index=-1,length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){var rand=baseRandom(0,++index);result[index]=result[rand];result[rand]=value});return result}function size(collection){var length=collection?collection.length:0;return typeof length=="number"?length:keys(collection).length}function some(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(result=callback(collection[index],index,collection)){break}}}else{forOwn(collection,function(value,index,collection){return!(result=callback(value,index,collection))})}return!!result}function sortBy(collection,callback,thisArg){var index=-1,isArr=isArray(callback),length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);if(!isArr){callback=lodash.createCallback(callback,thisArg,3)}forEach(collection,function(value,key,collection){var object=result[++index]=getObject();if(isArr){object.criteria=map(callback,function(key){return value[key]})}else{(object.criteria=getArray())[0]=callback(value,key,collection)}object.index=index;object.value=value});length=result.length;result.sort(compareAscending);while(length--){var object=result[length];result[length]=object.value;if(!isArr){releaseArray(object.criteria)}releaseObject(object)}return result}function toArray(collection){if(collection&&typeof collection.length=="number"){return slice(collection)}return values(collection)}var where=filter;function compact(array){var index=-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value){result.push(value)}}return result}function difference(array){return baseDifference(array,baseFlatten(arguments,true,true,1))}function findIndex(array,callback,thisArg){var index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length){if(callback(array[index],index,array)){return index}}return-1}function findLastIndex(array,callback,thisArg){var length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(length--){if(callback(array[length],length,array)){return length}}return-1}function first(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=-1;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[0]:undefined}}return slice(array,0,nativeMin(nativeMax(0,n),length))}function flatten(array,isShallow,callback,thisArg){if(typeof isShallow!="boolean"&&isShallow!=null){thisArg=callback;callback=typeof isShallow!="function"&&thisArg&&thisArg[isShallow]===array?null:isShallow;isShallow=false}if(callback!=null){array=map(array,callback,thisArg)}return baseFlatten(array,isShallow)}function indexOf(array,value,fromIndex){if(typeof fromIndex=="number"){var length=array?array.length:0;fromIndex=fromIndex<0?nativeMax(0,length+fromIndex):fromIndex||0}else if(fromIndex){var index=sortedIndex(array,value);return array[index]===value?index:-1}return baseIndexOf(array,value,fromIndex)}function initial(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:callback||n}return slice(array,0,nativeMin(nativeMax(0,length-n),length))}function intersection(){var args=[],argsIndex=-1,argsLength=arguments.length,caches=getArray(),indexOf=getIndexOf(),trustIndexOf=indexOf===baseIndexOf,seen=getArray();while(++argsIndex<argsLength){var value=arguments[argsIndex];if(isArray(value)||isArguments(value)){args.push(value);caches.push(trustIndexOf&&value.length>=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index<length){var cache=caches[0];value=array[index];if((cache?cacheIndexOf(cache,value):indexOf(seen,value))<0){argsIndex=argsLength;(cache||seen).push(value);while(--argsIndex){cache=caches[argsIndex];if((cache?cacheIndexOf(cache,value):indexOf(args[argsIndex],value))<0){continue outer}}result.push(value)}}while(argsLength--){cache=caches[argsLength];if(cache){releaseObject(cache)}}releaseArray(caches);releaseArray(seen);return result}function last(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3); | |
while(index--&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[length-1]:undefined}}return slice(array,nativeMax(0,length-n))}function lastIndexOf(array,value,fromIndex){var index=array?array.length:0;if(typeof fromIndex=="number"){index=(fromIndex<0?nativeMax(0,index+fromIndex):nativeMin(fromIndex,index-1))+1}while(index--){if(array[index]===value){return index}}return-1}function pull(array){var args=arguments,argsIndex=0,argsLength=args.length,length=array?array.length:0;while(++argsIndex<argsLength){var index=-1,value=args[argsIndex];while(++index<length){if(array[index]===value){splice.call(array,index--,1);length--}}}return array}function range(start,end,step){start=+start||0;step=typeof step=="number"?step:+step||1;if(end==null){end=start;start=0}var index=-1,length=nativeMax(0,ceil((end-start)/(step||1))),result=Array(length);while(++index<length){result[index]=start;start+=step}return result}function remove(array,callback,thisArg){var index=-1,length=array?array.length:0,result=[];callback=lodash.createCallback(callback,thisArg,3);while(++index<length){var value=array[index];if(callback(value,index,array)){result.push(value);splice.call(array,index--,1);length--}}return result}function rest(array,callback,thisArg){if(typeof callback!="number"&&callback!=null){var n=0,index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:nativeMax(0,callback)}return slice(array,n)}function sortedIndex(array,value,callback,thisArg){var low=0,high=array?array.length:low;callback=callback?lodash.createCallback(callback,thisArg,1):identity;value=callback(value);while(low<high){var mid=low+high>>>1;callback(array[mid])<value?low=mid+1:high=mid}return low}function union(){return baseUniq(baseFlatten(arguments,true,true))}function uniq(array,isSorted,callback,thisArg){if(typeof isSorted!="boolean"&&isSorted!=null){thisArg=callback;callback=typeof isSorted!="function"&&thisArg&&thisArg[isSorted]===array?null:isSorted;isSorted=false}if(callback!=null){callback=lodash.createCallback(callback,thisArg,3)}return baseUniq(array,isSorted,callback)}function without(array){return baseDifference(array,slice(arguments,1))}function xor(){var index=-1,length=arguments.length;while(++index<length){var array=arguments[index];if(isArray(array)||isArguments(array)){var result=result?baseUniq(baseDifference(result,array).concat(baseDifference(array,result))):array}}return result||[]}function zip(){var array=arguments.length>1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index<length){result[index]=pluck(array,index)}return result}function zipObject(keys,values){var index=-1,length=keys?keys.length:0,result={};if(!values&&length&&!isArray(keys[0])){values=[]}while(++index<length){var key=keys[index];if(values){result[key]=values[index]}else if(key){result[key[0]]=key[1]}}return result}function after(n,func){if(!isFunction(func)){throw new TypeError}return function(){if(--n<1){return func.apply(this,arguments)}}}function bind(func,thisArg){return arguments.length>2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index<length){var key=funcs[index];object[key]=createWrapper(object[key],1,null,null,object)}return object}function bindKey(object,key){return arguments.length>2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index<n){result[index]=callback(index)}return result}function unescape(string){return string==null?"":String(string).replace(reEscapedHtml,unescapeHtmlChar)}function uniqueId(prefix){var id=++idCounter;return String(prefix==null?"":prefix)+id}function chain(value){value=new lodashWrapper(value);value.__chain__=true;return value}function tap(value,interceptor){interceptor(value);return value}function wrapperChain(){this.__chain__=true;return this}function wrapperToString(){return String(this.__wrapped__)}function wrapperValueOf(){return this.__wrapped__}lodash.after=after;lodash.assign=assign;lodash.at=at;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.chain=chain;lodash.compact=compact;lodash.compose=compose;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.createCallback=createCallback;lodash.curry=curry;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.filter=filter;lodash.flatten=flatten;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.functions=functions;lodash.groupBy=groupBy;lodash.indexBy=indexBy;lodash.initial=initial;lodash.intersection=intersection;lodash.invert=invert;lodash.invoke=invoke;lodash.keys=keys;lodash.map=map;lodash.mapValues=mapValues;lodash.max=max;lodash.memoize=memoize;lodash.merge=merge;lodash.min=min;lodash.omit=omit;lodash.once=once;lodash.pairs=pairs;lodash.partial=partial;lodash.partialRight=partialRight;lodash.pick=pick;lodash.pluck=pluck;lodash.property=property;lodash.pull=pull;lodash.range=range;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.shuffle=shuffle;lodash.sortBy=sortBy;lodash.tap=tap;lodash.throttle=throttle;lodash.times=times;lodash.toArray=toArray;lodash.transform=transform;lodash.union=union;lodash.uniq=uniq;lodash.values=values;lodash.where=where;lodash.without=without;lodash.wrap=wrap;lodash.xor=xor;lodash.zip=zip;lodash.zipObject=zipObject;lodash.collect=map;lodash.drop=rest;lodash.each=forEach;lodash.eachRight=forEachRight;lodash.extend=assign;lodash.methods=functions;lodash.object=zipObject;lodash.select=filter;lodash.tail=rest;lodash.unique=uniq;lodash.unzip=zip;mixin(lodash);lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.contains=contains;lodash.escape=escape;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.has=has;lodash.identity=identity;lodash.indexOf=indexOf;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isBoolean=isBoolean;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isNaN=isNaN;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isString=isString;lodash.isUndefined=isUndefined;lodash.lastIndexOf=lastIndexOf;lodash.mixin=mixin;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.result=result;lodash.runInContext=runInContext;lodash.size=size;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.template=template;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.all=every;lodash.any=some;lodash.detect=find;lodash.findWhere=find;lodash.foldl=reduce;lodash.foldr=reduceRight;lodash.include=contains;lodash.inject=reduce;mixin(function(){var source={};forOwn(lodash,function(func,methodName){if(!lodash.prototype[methodName]){source[methodName]=func}});return source}(),false);lodash.first=first;lodash.last=last;lodash.sample=sample;lodash.take=first;lodash.head=first;forOwn(lodash,function(func,methodName){var callbackable=methodName!=="sample";if(!lodash.prototype[methodName]){lodash.prototype[methodName]=function(n,guard){var chainAll=this.__chain__,result=func(this.__wrapped__,n,guard);return!chainAll&&(n==null||guard&&!(callbackable&&typeof n=="function"))?result:new lodashWrapper(result,chainAll)}}});lodash.VERSION="2.4.1";lodash.prototype.chain=wrapperChain;lodash.prototype.toString=wrapperToString;lodash.prototype.value=wrapperValueOf;lodash.prototype.valueOf=wrapperValueOf;forEach(["join","pop","shift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){var chainAll=this.__chain__,result=func.apply(this.__wrapped__,arguments);return chainAll?new lodashWrapper(result,chainAll):result}});forEach(["push","reverse","sort","unshift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){func.apply(this.__wrapped__,arguments);return this}});forEach(["concat","slice","splice"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){return new lodashWrapper(func.apply(this.__wrapped__,arguments),this.__chain__)}});return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],69:[function(require,module,exports){var type={lower:"abcdefghijklmnopqrstuvwxyz",upper:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",numeric:"0123456789",special:"~!@#$%^&()_+-={}[];',."};module.exports=function(chars,length,opts){opts=opts||{};opts.chars=opts.chars||"";if(typeof length==="object"){opts=length;length=opts.chars.length}if(typeof length==="undefined"){length=chars.length}type.custom=opts.chars;type.all=Object.keys(type).map(function(key){return type[key]}).join("");var mask="";var result=[];if(chars.indexOf("?")>-1){mask+=type.custom}if(chars.indexOf("a")>-1){mask+=type.lower}if(chars.indexOf("A")>-1){mask+=type.upper}if(chars.indexOf("0")>-1){mask+=type.numeric}if(chars.indexOf("!")>-1){mask+=type.special}if(chars.indexOf("*")>-1){mask+=type.all}for(var i=length;i>0;--i){result.push(mask[Math.round(Math.random()*(mask.length-1))])}return result.join("")}},{}],"engine-cache":[function(require,module,exports){"use strict";var debug=require("debug")("engine-cache");var Helpers=require("helper-cache");var slice=require("array-slice");var extend=require("extend-shallow");var forOwn=require("for-own");module.exports=Engines;function Engines(engines){this.init(engines)}Engines.prototype.init=function(engines){debug("init",arguments);this.cache=engines||{}};Engines.prototype.setEngine=function(ext,fn,options){var args=slice(arguments);debug("[set]",arguments);var engine={};if(args.length===3){if(options&&(typeof options==="function"||options.hasOwnProperty("render")||options.hasOwnProperty("renderSync")||options.hasOwnProperty("renderFile"))){var opts=fn;fn=options;options=opts}}if(typeof fn==="function"){engine.render=fn.render||fn;if(fn.renderSync){engine.renderSync=fn.renderSync}}else if(typeof fn==="object"){engine=fn||this.noop;engine.renderFile=fn.renderFile||fn.__express}engine.compile=engine.compile||fn.compile;engine.options=engine.options||fn.options||options||{};engine.helpers=new Helpers(options);if(typeof engine.render!=="function"&&typeof engine.renderSync!=="function"){throw new Error("Engines are expected to have a `render` or `renderSync` method.")}if(engine.render){engine.name=engine.render.name||"unknown"}else{engine.name=engine.renderSync.name||"unknown"}this.decorate(engine);if(ext[0]!=="."){ext="."+ext}debug("[set] %s: %j",ext,engine);this.cache[ext]=engine;return this};Engines.prototype.getEngine=function(ext){if(!ext){return this.cache}if(ext[0]!=="."){ext="."+ext}var engine=this.cache[ext];if(!engine){engine=this.cache[".*"]}return engine};Engines.prototype.decorate=function(engine){debug("[decorate]",arguments);var renderSync=engine.renderSync;var render=engine.render;var compile=engine.compile||function(str,options){return str};engine.render=function(str,options,callback){if(typeof options==="function"){callback=options;options={}}if(typeof str!=="function"){str=this.compile(str,options)}if(typeof str==="function"){return engine.helpers.resolve(str(options),callback)}var opts=options||{};opts.helpers=extend({},engine.helpers,opts.helpers);return render.call(this,str,opts,function(err,content){if(err)return callback(err);return engine.helpers.resolve(content,callback)})};engine.renderSync=function(str,options){if(typeof str!=="function"){str=this.compile(str,options)}if(typeof str==="function"){return str(options)}var opts=options||{};opts.helpers=extend({},engine.helpers,opts.helpers);return renderSync(str,opts)};engine.compile=function(str,options){if(typeof str==="function"){return str}var opts=options||{};opts.helpers=extend({},engine.helpers,opts.helpers);return compile(str,opts)}};Engines.prototype.load=function(obj){debug("[load]",arguments);var engines=Object.keys(obj);var len=engines.length;var i=0;while(i<len){var name=engines[i++];var engine=obj[name];if(name!=="clearCache"){this.setEngine(name,engine)}}return this};Engines.prototype.helpers=function(ext){return this.getEngine(ext).helpers};Engines.prototype.clear=function(ext){if(ext){if(ext[0]!=="."){ext="."+ext}delete this.cache[ext]}else{this.cache={}}}},{"array-slice":9,debug:10,"extend-shallow":13,"for-own":14,"helper-cache":16}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({"kind-of":[function(require,module,exports){var toString=Object.prototype.toString;module.exports=function kindOf(val){if(val===undefined){return"undefined"}if(val===null){return"null"}if(typeof val!=="object"){return typeof val}if(Array.isArray(val)){return"array"}var type=toString.call(val);if(val instanceof RegExp||type==="[object RegExp]"){return"regexp"}if(val instanceof Date||type==="[object Date]"){return"date"}if(type==="[object Function]"){return"function"}return type.slice(8,-1).toLowerCase()}},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],2:[function(require,module,exports){"use strict";var makeRe=require("./make-regex");var re=/\{% ([^\}]+) %\}/g;module.exports=function(content,obj,syntax){if(syntax)syntax=makeRe(syntax);return toString(content).replace(syntax||re,function(match,prop){if(/\./.test(prop)){var get=require("get-value");return toString(get(obj,prop.trim()))}return obj[prop.trim()]})};function toString(val){return val==null?"":val.toString()}},{"./make-regex":3,"get-value":21}],3:[function(require,module,exports){"use strict";var typeOf=require("kind-of");module.exports=function(syntax){var regex=syntax;var escaped=false;if(typeOf(syntax)==="regexp"){regex=syntax}if(typeOf(syntax)==="string"){regex=new RegExp(syntax,"g")}if(Array.isArray(syntax)&&escaped===false){escaped=true;var Delims=require("delims");var delims=new Delims(syntax,{escape:true});var re=delims.templates(syntax);regex=re.evaluate}return regex}},{delims:12,"kind-of":23}],4:[function(require,module,exports){"use strict";var escapeStringRegexp=require("escape-string-regexp");var ansiStyles=require("ansi-styles");var stripAnsi=require("strip-ansi");var hasAnsi=require("has-ansi");var supportsColor=require("supports-color");var defineProps=Object.defineProperties;var chalk=module.exports;function build(_styles){var builder=function builder(){return applyStyle.apply(builder,arguments)};builder._styles=_styles;builder.__proto__=proto;return builder}var styles=function(){var ret={};ansiStyles.grey=ansiStyles.gray;Object.keys(ansiStyles).forEach(function(key){ansiStyles[key].closeRe=new RegExp(escapeStringRegexp(ansiStyles[key].close),"g");ret[key]={get:function(){return build(this._styles.concat(key))}}});return ret}();var proto=defineProps(function chalk(){},styles);function applyStyle(){var args=arguments;var argsLen=args.length;var str=argsLen!==0&&String(arguments[0]);if(argsLen>1){for(var a=1;a<argsLen;a++){str+=" "+args[a]}}if(!chalk.enabled||!str){return str}var nestedStyles=this._styles;for(var i=0;i<nestedStyles.length;i++){var code=ansiStyles[nestedStyles[i]];str=code.open+str.replace(code.closeRe,code.open)+code.close}return str}function init(){var ret={};Object.keys(styles).forEach(function(name){ret[name]={get:function(){return build([name])}}});return ret}defineProps(chalk,init());chalk.styles=ansiStyles;chalk.hasColor=hasAnsi;chalk.stripColor=stripAnsi;chalk.supportsColor=supportsColor;if(chalk.enabled===undefined){chalk.enabled=chalk.supportsColor}},{"ansi-styles":5,"escape-string-regexp":6,"has-ansi":7,"strip-ansi":9,"supports-color":11}],5:[function(require,module,exports){"use strict";var styles=module.exports;var codes={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],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],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]};Object.keys(codes).forEach(function(key){var val=codes[key];var style=styles[key]={};style.open="["+val[0]+"m";style.close="["+val[1]+"m"})},{}],6:[function(require,module,exports){"use strict";var matchOperatorsRe=/[|\\{}()[\]^$+*?.]/g;module.exports=function(str){if(typeof str!=="string"){throw new TypeError("Expected a string")}return str.replace(matchOperatorsRe,"\\$&")}},{}],7:[function(require,module,exports){"use strict";var ansiRegex=require("ansi-regex");var re=new RegExp(ansiRegex().source);module.exports=re.test.bind(re)},{"ansi-regex":8}],8:[function(require,module,exports){"use strict";module.exports=function(){return/\u001b\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]/g}},{}],9:[function(require,module,exports){"use strict";var ansiRegex=require("ansi-regex")();module.exports=function(str){return typeof str==="string"?str.replace(ansiRegex,""):str}},{"ansi-regex":10}],10:[function(require,module,exports){arguments[4][8][0].apply(exports,arguments)},{dup:8}],11:[function(require,module,exports){(function(process){"use strict";module.exports=function(){if(process.argv.indexOf("--no-color")!==-1){return false}if(process.argv.indexOf("--color")!==-1){return true}if(process.stdout&&!process.stdout.isTTY){return false}if(process.platform==="win32"){return true}if("COLORTERM"in process.env){return true}if(process.env.TERM==="dumb"){return false}if(/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)){return true}return false}()}).call(this,require("_process"))},{_process:1}],12:[function(require,module,exports){"use strict";var pick=require("object-pick");var merge=require("mixin-deep");var utils=require("./lib/utils");var Delimiters=function Delimiters(delims,options){this.options=options||{};this.delims=delims||[];this.defaults=merge({},{beginning:"^",matter:"([\\s\\S]+?)",body:"([\\s\\S]+|\\s?)",end:"$",flags:""},options)};Delimiters.prototype.create=function(delims,options){if(!Array.isArray(delims)){options=delims;delims=["---","---"]}var opts=merge({},this.defaults,options);opts.body=delims[2]||opts.body||"";var open=utils.buildRegexGroup(delims[0],opts);var close=utils.buildRegexGroup(delims[1],opts);var block=opts.matter+close+opts.body+opts.end;return merge(opts,{open:open,close:close,delims:delims},{evaluate:new RegExp(opts.beginning+open+block,opts.flags),interpolate:new RegExp(opts.beginning+open+"="+block,opts.flags),escape:new RegExp(opts.beginning+open+"-"+block,opts.flags)})};Delimiters.prototype.matter=function(delims,opts){return pick(this.create(delims,opts),["evaluate"]).evaluate};Delimiters.prototype.templates=function(delims,opts){var defaults={body:"",beginning:"",end:"",flags:"g",noncapture:false};var delimiters=this.create(delims,merge(defaults,opts));return pick(delimiters,["interpolate","evaluate","escape"])};module.exports=Delimiters},{"./lib/utils":13,"mixin-deep":16,"object-pick":20}],13:[function(require,module,exports){"use strict";var merge=require("mixin-deep");var arrayify=require("arrayify-compact");exports.escapeDelim=function(re){return re.replace(/(.)/g,"\\$1")};exports.buildRegexGroup=function(re,options){var opts=merge({escape:false,noncapture:false},options);re=arrayify(re);var len=re.length;re=len>0?re.join("|"):re;re=opts.escape===true?exports.escapeDelim(re):re;if(opts.noncapture===true||len>1){re="(?:"+re+")"}return re}},{"arrayify-compact":14,"mixin-deep":16}],14:[function(require,module,exports){"use strict";var flatten=require("array-flatten");module.exports=function(arr){return flatten(!Array.isArray(arr)?[arr]:arr).filter(Boolean)}},{"array-flatten":15}],15:[function(require,module,exports){function flatten(array,result,depth){for(var i=0;i<array.length;i++){if(depth>0&&Array.isArray(array[i])){flatten(array[i],result,depth-1)}else{result.push(array[i])}}return result}module.exports=function(array,depth){return flatten(array,[],depth||Infinity)}},{}],16:[function(require,module,exports){"use strict";var isObject=require("is-plain-object");var forOwn=require("for-own");module.exports=function deepMixin(o){var args=[].slice.call(arguments,1);var len=args.length;if(o==null){return{}}if(len===0){return o}function copy(value,key){var obj=this[key];if(isObject(value)&&isObject(obj)){deepMixin(obj,value)}else{this[key]=value}}for(var i=0;i<len;i++){var obj=args[i];if(obj!=null){forOwn(obj,copy,o)}}return o}},{"for-own":17,"is-plain-object":19}],17:[function(require,module,exports){"use strict";var forIn=require("for-in");module.exports=function forOwn(o,fn,thisArg){forIn(o,function(val,key){if(hasOwn(o,key)){return fn.call(thisArg,o[key],key,o)}})};function hasOwn(o,prop){return{}.hasOwnProperty.call(o,prop)}},{"for-in":18}],18:[function(require,module,exports){"use strict"; | |
module.exports=function forIn(o,fn,thisArg){for(var key in o){if(fn.call(thisArg,o[key],key,o)===false){break}}}},{}],19:[function(require,module,exports){"use strict";module.exports=function isPlainObject(o){return!!o&&typeof o==="object"&&o.constructor===Object}},{}],20:[function(require,module,exports){"use strict";module.exports=function pick(orig,keys){if(orig==null){return{}}if(typeof keys==="string"){keys=[].slice.call(arguments,1)}var len=keys.length;var o={};for(var i=0;i<len;i++){var key=keys[i];if(orig.hasOwnProperty(key)){o[key]=orig[key]}}return o}},{}],21:[function(require,module,exports){"use strict";var isObject=require("isobject");module.exports=function getValue(obj,str,fn){if(obj==null||!isObject(obj)){return{}}if(str==null||typeof str!=="string"){return obj}var path;if(fn&&typeof fn==="function"){path=fn(str)}else if(fn===true){str=replaceStr(str,"\\.","___DOT___");path=str.split(".").map(function(seg){return replaceStr(seg,"___DOT___",".")})}else{path=str.split(".")}var len=path.length;var i=0;var last;while(i<len){var key=path[i];last=obj[key];if(last==null){return null}if(typeof last==="object"){obj=last}i++}return last};function replaceStr(str,token,replacement){var i,from=0;while(str.indexOf(token,from)!==-1){i=str.indexOf(token,from);from=i+token.length;str=str.substr(0,i)+replacement+str.substr(from,str.length);from=i+replacement.length}return str}},{isobject:22}],22:[function(require,module,exports){"use strict";module.exports=function isObject(o){return o!=null&&typeof o==="object"&&!Array.isArray(o)}},{}],23:[function(require,module,exports){"use strict";module.exports=function typeOf(val){if(val===null){return"null"}if(val===undefined){return"undefined"}if(typeof val!=="object"){return typeof val}if(Array.isArray(val)){return"array"}return{}.toString.call(val).slice(8,-1).toLowerCase()}},{}],24:[function(require,module,exports){"use strict";module.exports=function createStack(name,layouts,opts){opts=opts||{};var template={};var stack=[];var prev=null;while(name&&prev!==name&&(template=layouts[name])){stack.unshift(name);prev=name;name=assertLayout(template.layout,opts.defaultLayout)}return stack};function assertLayout(value,defaultLayout){var isFalsey=require("falsey");if(value===false||value&&isFalsey(value)){return null}else if(!value||value===true){return defaultLayout||null}else{return value}}},{falsey:25}],25:[function(require,module,exports){"use strict";function typeOf(val){return toString.call(val).toLowerCase().replace(/\[object ([\w]+)\]/,"$1")}function isArguments(obj){return obj&&typeof obj==="object"&&typeof obj.length==="number"&&typeOf(obj)==="arguments"||false}module.exports=function(value,arr){var falsey=["false","none","nil","null"];if(isArguments(value)){return!Boolean(Object.keys(value).length)}if(typeOf(value)==="object"){return!Boolean(Object.keys(value).length)}if(Array.isArray(value)){return!Boolean(value.length)}return!Boolean(value)||(arr||falsey).indexOf(value)!==-1}},{}],layouts:[function(require,module,exports){"use strict";var createStack=require("layout-stack");var process=require("./lib/interpolate");module.exports=function wrapLayout(str,name,layouts,options){options=options||{};var arr=createStack(name,layouts,options);var orig=str;var len=arr.length-1;var layout;while(layout=layouts[arr[len--]]){var res=str;try{var tag={},body=options.tag||"body";tag[body]=str;res=process(layout.content,tag,options.delims)}catch(err){if(options.debugLayouts){delimiterError(name,options)}}str=res}if(str.indexOf(orig)===-1&&options.debugLayouts){delimiterError(name,options);return str}return str};function delimiterError(name,opts){var chalk=require("chalk");var msg=chalk.yellow('layout delimiter error for template: "'+name+'".');return console.log(msg+"\n",opts.regex)}},{"./lib/interpolate":2,chalk:4,"layout-stack":24}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){var util=require("util/");var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;var assert=module.exports=ok;assert.AssertionError=function AssertionError(options){this.name="AssertionError";this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false}else{this.message=getMessage(this);this.generatedMessage=true}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction)}else{var err=new Error;if(err.stack){var out=err.stack;var fn_name=stackStartFunction.name;var idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&(isNaN(value)||!isFinite(value))){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n)}else{return s}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}assert.fail=fail;function ok(value,message){if(!value)fail(value,true,message,"==",assert.ok)}assert.ok=ok;assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,"==",assert.equal)};assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,"!=",assert.notEqual)}};assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,"deepEqual",assert.deepEqual)}};function _deepEqual(actual,expected){if(actual===expected){return true}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false}return true}else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime()}else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase}else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected}else{return objEquiv(actual,expected)}}function isArguments(object){return Object.prototype.toString.call(object)=="[object Arguments]"}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;if(a.prototype!==b.prototype)return false;if(isArguments(a)){if(!isArguments(b)){return false}a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b)}try{var ka=objectKeys(a),kb=objectKeys(b),key,i}catch(e){return false}if(ka.length!=kb.length)return false;ka.sort();kb.sort();for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":9}],3:[function(require,module,exports){arguments[4][1][0].apply(exports,arguments)},{dup:1}],4:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}throw TypeError('Uncaught, unspecified "error" event.')}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){var m;if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],5:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],6:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:7}],7:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],8:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],9:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":8,_process:7,inherits:5}],10:[function(require,module,exports){"use strict";var EventEmitter2=require("eventemitter2").EventEmitter2;var Base=require("class-extend");var Emitter=Base.extend(EventEmitter2.prototype);Emitter.extend=Base.extend;var Event=Emitter.extend({constructor:function(){Event.__super__.constructor.call(this,{wildcard:true,delimiter:":",newListener:false,maxListeners:0})}});Event.extend=Emitter.extend;module.exports=Event},{"class-extend":15,eventemitter2:20}],11:[function(require,module,exports){"use strict";module.exports=function flatten(arr){return flat(arr,[])};function flat(arr,res){var len=arr.length;var num=0;while(len--){var i=num++;if(Array.isArray(arr[i])){flat(arr[i],res)}else{res.push(arr[i])}}return res}},{}],12:[function(require,module,exports){"use strict";var slice=require("array-slice");var isNumber=require("is-number");module.exports=function(arr,num){if(!Array.isArray(arr)){throw new Error("array-rest expects an array as the first argument.")}return slice(arr,isNumber(num)?num:1)}},{"array-slice":14,"is-number":13}],13:[function(require,module,exports){"use strict";module.exports=function isNumber(n){return!!+n||n===0||n==="0"}},{}],14:[function(require,module,exports){"use strict";module.exports=function slice(arr,start,end){var len=arr.length>>>0;var range=[];start=idx(arr,start);end=idx(arr,end,len);while(start<end){range.push(arr[start++])}return range};function idx(arr,pos,end){var len=arr.length>>>0;if(pos==null){pos=end||0}else if(pos<0){pos=Math.max(len+pos,0)}else{pos=Math.min(pos,len)}return pos}},{}],15:[function(require,module,exports){var _=require("lodash");var Base=module.exports=function(){};Base.extend=extend;function extend(protoProps,staticProps){var parent=this;var child;if(protoProps&&_.has(protoProps,"constructor")){child=protoProps.constructor}else{child=function(){return parent.apply(this,arguments)}}_.extend(child,parent,staticProps);child.prototype=Object.create(parent.prototype,{constructor:{value:child,enumerable:false,writable:true,configurable:true}});if(protoProps)_.extend(child.prototype,protoProps);child.__super__=parent.prototype;return child}},{lodash:29}],16:[function(require,module,exports){"use strict";var typeOf=require("kind-of");var forOwn=require("for-own");var isPlainObject=require("is-plain-object");var mixin=require("mixin-object");function cloneDeep(val,instanceClone){switch(typeOf(val)){case"object":return cloneObjectDeep(val,instanceClone);case"array":return cloneArrayDeep(val,instanceClone);default:return clone(val)}}function cloneObjectDeep(obj,instanceClone){if(isPlainObject(obj)){var res={};forOwn(obj,function(obj,key){this[key]=cloneDeep(obj,instanceClone)},res);return res}else if(instanceClone){return instanceClone(obj)}else{return obj}}function cloneArrayDeep(arr,instanceClone){var len=arr.length;var res=[];var i=-1;while(++i<len){res[i]=cloneDeep(arr[i],instanceClone)}return res}function clone(val){switch(typeOf(val)){case"object":return cloneObject(val);case"array":return cloneArray(val);case"regexp":return cloneRegExp(val);case"date":return cloneDate(val);default:return val}}function cloneObject(obj){if(isPlainObject(obj)){return mixin({},obj) | |
}else{return obj}}function cloneRegExp(re){var flags="";flags+=re.multiline?"m":"";flags+=re.global?"g":"";flags+=re.ignorecase?"i":"";return new RegExp(re.source,flags)}function cloneDate(date){return new Date(+date)}function cloneArray(arr){return arr.slice()}module.exports=cloneDeep},{"for-own":17,"is-plain-object":18,"kind-of":28,"mixin-object":19}],17:[function(require,module,exports){"use strict";var forIn=require("for-in");module.exports=function forOwn(o,fn,thisArg){forIn(o,function(val,key){if(hasOwn(o,key)){return fn.call(thisArg,o[key],key,o)}})};function hasOwn(o,prop){return{}.hasOwnProperty.call(o,prop)}},{"for-in":25}],18:[function(require,module,exports){"use strict";module.exports=function isPlainObject(o){return!!o&&typeof o==="object"&&o.constructor===Object}},{}],19:[function(require,module,exports){"use strict";var forOwn=require("for-own");module.exports=function mixIn(o){var args=[].slice.call(arguments);var len=args.length;if(o==null){return{}}if(len===0){return o}function copy(value,key){this[key]=value}for(var i=0;i<len;i++){var obj=args[i];if(obj!=null){forOwn(obj,copy,o)}}return o}},{"for-own":17}],20:[function(require,module,exports){!function(undefined){var isArray=Array.isArray?Array.isArray:function _isArray(obj){return Object.prototype.toString.call(obj)==="[object Array]"};var defaultMaxListeners=10;function init(){this._events={};if(this._conf){configure.call(this,this._conf)}}function configure(conf){if(conf){this._conf=conf;conf.delimiter&&(this.delimiter=conf.delimiter);conf.maxListeners&&(this._events.maxListeners=conf.maxListeners);conf.wildcard&&(this.wildcard=conf.wildcard);conf.newListener&&(this.newListener=conf.newListener);if(this.wildcard){this.listenerTree={}}}}function EventEmitter(conf){this._events={};this.newListener=false;configure.call(this,conf)}function searchListenerTree(handlers,type,tree,i){if(!tree){return[]}var listeners=[],leaf,len,branch,xTree,xxTree,isolatedBranch,endReached,typeLength=type.length,currentType=type[i],nextType=type[i+1];if(i===typeLength&&tree._listeners){if(typeof tree._listeners==="function"){handlers&&handlers.push(tree._listeners);return[tree]}else{for(leaf=0,len=tree._listeners.length;leaf<len;leaf++){handlers&&handlers.push(tree._listeners[leaf])}return[tree]}}if(currentType==="*"||currentType==="**"||tree[currentType]){if(currentType==="*"){for(branch in tree){if(branch!=="_listeners"&&tree.hasOwnProperty(branch)){listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],i+1))}}return listeners}else if(currentType==="**"){endReached=i+1===typeLength||i+2===typeLength&&nextType==="*";if(endReached&&tree._listeners){listeners=listeners.concat(searchListenerTree(handlers,type,tree,typeLength))}for(branch in tree){if(branch!=="_listeners"&&tree.hasOwnProperty(branch)){if(branch==="*"||branch==="**"){if(tree[branch]._listeners&&!endReached){listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],typeLength))}listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],i))}else if(branch===nextType){listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],i+2))}else{listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],i))}}}return listeners}listeners=listeners.concat(searchListenerTree(handlers,type,tree[currentType],i+1))}xTree=tree["*"];if(xTree){searchListenerTree(handlers,type,xTree,i+1)}xxTree=tree["**"];if(xxTree){if(i<typeLength){if(xxTree._listeners){searchListenerTree(handlers,type,xxTree,typeLength)}for(branch in xxTree){if(branch!=="_listeners"&&xxTree.hasOwnProperty(branch)){if(branch===nextType){searchListenerTree(handlers,type,xxTree[branch],i+2)}else if(branch===currentType){searchListenerTree(handlers,type,xxTree[branch],i+1)}else{isolatedBranch={};isolatedBranch[branch]=xxTree[branch];searchListenerTree(handlers,type,{"**":isolatedBranch},i+1)}}}}else if(xxTree._listeners){searchListenerTree(handlers,type,xxTree,typeLength)}else if(xxTree["*"]&&xxTree["*"]._listeners){searchListenerTree(handlers,type,xxTree["*"],typeLength)}}return listeners}function growListenerTree(type,listener){type=typeof type==="string"?type.split(this.delimiter):type.slice();for(var i=0,len=type.length;i+1<len;i++){if(type[i]==="**"&&type[i+1]==="**"){return}}var tree=this.listenerTree;var name=type.shift();while(name){if(!tree[name]){tree[name]={}}tree=tree[name];if(type.length===0){if(!tree._listeners){tree._listeners=listener}else if(typeof tree._listeners==="function"){tree._listeners=[tree._listeners,listener]}else if(isArray(tree._listeners)){tree._listeners.push(listener);if(!tree._listeners.warned){var m=defaultMaxListeners;if(typeof this._events.maxListeners!=="undefined"){m=this._events.maxListeners}if(m>0&&tree._listeners.length>m){tree._listeners.warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",tree._listeners.length);console.trace()}}}return true}name=type.shift()}return true}EventEmitter.prototype.delimiter=".";EventEmitter.prototype.setMaxListeners=function(n){this._events||init.call(this);this._events.maxListeners=n;if(!this._conf)this._conf={};this._conf.maxListeners=n};EventEmitter.prototype.event="";EventEmitter.prototype.once=function(event,fn){this.many(event,1,fn);return this};EventEmitter.prototype.many=function(event,ttl,fn){var self=this;if(typeof fn!=="function"){throw new Error("many only accepts instances of Function")}function listener(){if(--ttl===0){self.off(event,listener)}fn.apply(this,arguments)}listener._origin=fn;this.on(event,listener);return self};EventEmitter.prototype.emit=function(){this._events||init.call(this);var type=arguments[0];if(type==="newListener"&&!this.newListener){if(!this._events.newListener){return false}}if(this._all){var l=arguments.length;var args=new Array(l-1);for(var i=1;i<l;i++)args[i-1]=arguments[i];for(i=0,l=this._all.length;i<l;i++){this.event=type;this._all[i].apply(this,args)}}if(type==="error"){if(!this._all&&!this._events.error&&!(this.wildcard&&this.listenerTree.error)){if(arguments[1]instanceof Error){throw arguments[1]}else{throw new Error("Uncaught, unspecified 'error' event.")}return false}}var handler;if(this.wildcard){handler=[];var ns=typeof type==="string"?type.split(this.delimiter):type.slice();searchListenerTree.call(this,handler,ns,this.listenerTree,0)}else{handler=this._events[type]}if(typeof handler==="function"){this.event=type;if(arguments.length===1){handler.call(this)}else if(arguments.length>1)switch(arguments.length){case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:var l=arguments.length;var args=new Array(l-1);for(var i=1;i<l;i++)args[i-1]=arguments[i];handler.apply(this,args)}return true}else if(handler){var l=arguments.length;var args=new Array(l-1);for(var i=1;i<l;i++)args[i-1]=arguments[i];var listeners=handler.slice();for(var i=0,l=listeners.length;i<l;i++){this.event=type;listeners[i].apply(this,args)}return listeners.length>0||!!this._all}else{return!!this._all}};EventEmitter.prototype.on=function(type,listener){if(typeof type==="function"){this.onAny(type);return this}if(typeof listener!=="function"){throw new Error("on only accepts instances of Function")}this._events||init.call(this);this.emit("newListener",type,listener);if(this.wildcard){growListenerTree.call(this,type,listener);return this}if(!this._events[type]){this._events[type]=listener}else if(typeof this._events[type]==="function"){this._events[type]=[this._events[type],listener]}else if(isArray(this._events[type])){this._events[type].push(listener);if(!this._events[type].warned){var m=defaultMaxListeners;if(typeof this._events.maxListeners!=="undefined"){m=this._events.maxListeners}if(m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);console.trace()}}}return this};EventEmitter.prototype.onAny=function(fn){if(typeof fn!=="function"){throw new Error("onAny only accepts instances of Function")}if(!this._all){this._all=[]}this._all.push(fn);return this};EventEmitter.prototype.addListener=EventEmitter.prototype.on;EventEmitter.prototype.off=function(type,listener){if(typeof listener!=="function"){throw new Error("removeListener only takes instances of Function")}var handlers,leafs=[];if(this.wildcard){var ns=typeof type==="string"?type.split(this.delimiter):type.slice();leafs=searchListenerTree.call(this,null,ns,this.listenerTree,0)}else{if(!this._events[type])return this;handlers=this._events[type];leafs.push({_listeners:handlers})}for(var iLeaf=0;iLeaf<leafs.length;iLeaf++){var leaf=leafs[iLeaf];handlers=leaf._listeners;if(isArray(handlers)){var position=-1;for(var i=0,length=handlers.length;i<length;i++){if(handlers[i]===listener||handlers[i].listener&&handlers[i].listener===listener||handlers[i]._origin&&handlers[i]._origin===listener){position=i;break}}if(position<0){continue}if(this.wildcard){leaf._listeners.splice(position,1)}else{this._events[type].splice(position,1)}if(handlers.length===0){if(this.wildcard){delete leaf._listeners}else{delete this._events[type]}}return this}else if(handlers===listener||handlers.listener&&handlers.listener===listener||handlers._origin&&handlers._origin===listener){if(this.wildcard){delete leaf._listeners}else{delete this._events[type]}}}return this};EventEmitter.prototype.offAny=function(fn){var i=0,l=0,fns;if(fn&&this._all&&this._all.length>0){fns=this._all;for(i=0,l=fns.length;i<l;i++){if(fn===fns[i]){fns.splice(i,1);return this}}}else{this._all=[]}return this};EventEmitter.prototype.removeListener=EventEmitter.prototype.off;EventEmitter.prototype.removeAllListeners=function(type){if(arguments.length===0){!this._events||init.call(this);return this}if(this.wildcard){var ns=typeof type==="string"?type.split(this.delimiter):type.slice();var leafs=searchListenerTree.call(this,null,ns,this.listenerTree,0);for(var iLeaf=0;iLeaf<leafs.length;iLeaf++){var leaf=leafs[iLeaf];leaf._listeners=null}}else{if(!this._events[type])return this;this._events[type]=null}return this};EventEmitter.prototype.listeners=function(type){if(this.wildcard){var handlers=[];var ns=typeof type==="string"?type.split(this.delimiter):type.slice();searchListenerTree.call(this,handlers,ns,this.listenerTree,0);return handlers}this._events||init.call(this);if(!this._events[type])this._events[type]=[];if(!isArray(this._events[type])){this._events[type]=[this._events[type]]}return this._events[type]};EventEmitter.prototype.listenersAny=function(){if(this._all){return this._all}else{return[]}};if(typeof define==="function"&&define.amd){define(function(){return EventEmitter})}else if(typeof exports==="object"){exports.EventEmitter2=EventEmitter}else{window.EventEmitter2=EventEmitter}}()},{}],21:[function(require,module,exports){const _=require("lodash");const getobject=require("getobject");const EventEmitter=require("events").EventEmitter;var expander=module.exports={};var tmplRegExp=/\s*(?:\${\s*([a-z0-9_]+(?:\.[a-z0-9_]+)*)\s*}|<%=\s*([a-z0-9_]+(?:\.[a-z0-9_]+)*)\s*%>)\s*/i;var findProperty=function(lookup){var matches=tmplRegExp.exec(lookup);if(matches){return{src:matches&&matches[0],prop:matches&&matches[1]||matches[2]}}else{return false}};var hasTemplate=function(lookup){return _.isString(lookup)&&(lookup.indexOf("<%=")!==-1||lookup.indexOf("${")!==-1)};var stringExpand=function(data,lookup,options){var property;while(property=findProperty(lookup)){if(property.src!==lookup){lookup=_.template(lookup,data,options)}else{lookup=expander.process(data,getobject.get(data,property.prop),options)}}if(hasTemplate(lookup)){lookup=_.template(lookup,data,options)}return lookup};var arrayExpand=function(data,arr,options){return arr.map(function(lookup){return expander.process(data,lookup,options)})};var objectExpand=function(data,obj,options){var result={};Object.keys(obj).forEach(function(key){result[key]=expander.process(data,obj[key],options)});return result};expander.fn=function(method){method.__expanderFn__=true;return method};expander.process=function(data,lookup,options){if(_.isFunction(lookup)&&lookup.__expanderFn__===true){return lookup.call(this,data)}else if(_.isString(lookup)){return stringExpand(data,lookup,options)}else if(_.isArray(lookup)){return arrayExpand(data,lookup,options)}else if(_.isPlainObject(lookup)){return objectExpand(data,lookup,options)}else{return lookup}};expander.getRaw=function(data,lookup){if(!lookup){return data}else{return getobject.get(data,lookup)}};expander.get=function(data,lookup,options){if(!lookup){return objectExpand(data,data,options)}else{return expander.process(data,getobject.get(data,lookup),options)}};expander.set=function(data,lookup,value){return getobject.set(data,lookup,value)};expander.interface=function(data,options){var emitter=new EventEmitter;options=options||{};var API=function(prop,value){if(arguments.length===2){emitter.emit("set",prop,value);return getobject.set(data,prop,value)}else{return expander.get(data,prop,options)}};API.on=emitter.on.bind(emitter);API.getRaw=expander.getRaw.bind(null,data);API.get=function(prop,opts){return expander.get(data,prop,_.extend({},options,opts))};API.process=function(lookup,opts){return expander.process(data,lookup,_.extend({},options,opts))};API.set=function(prop,value){return API(prop,value)};return API}},{events:4,getobject:22,lodash:23}],22:[function(require,module,exports){"use strict";var getobject=module.exports={};function getParts(str){return str.replace(/\\\./g,"").split(".").map(function(s){return s.replace(/\uffff/g,".")})}getobject.get=function(obj,parts,create){if(typeof parts==="string"){parts=getParts(parts)}var part;while(typeof obj==="object"&&obj&&parts.length){part=parts.shift();if(!(part in obj)&&create){obj[part]={}}obj=obj[part]}return obj};getobject.set=function(obj,parts,value){parts=getParts(parts);var prop=parts.pop();obj=getobject.get(obj,parts,true);if(obj&&typeof obj==="object"){return obj[prop]=value}};getobject.exists=function(obj,parts){parts=getParts(parts);var prop=parts.pop();obj=getobject.get(obj,parts);return typeof obj==="object"&&obj&&prop in obj}},{}],23:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setImmediate","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index<length){if(array[index]===value){return index}}return-1}function cacheIndexOf(cache,value){var type=typeof value;cache=cache.cache;if(type=="boolean"||value==null){return cache[value]?0:-1}if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value;cache=(cache=cache[type])&&cache[key];return type=="object"?cache&&baseIndexOf(cache,value)>-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria;if(ac!==bc){if(ac>bc||typeof ac=="undefined"){return 1}if(ac<bc||typeof bc=="undefined"){return-1}}return a.index-b.index}function createCache(array){var index=-1,length=array.length,first=array[0],mid=array[length/2|0],last=array[length-1];if(first&&typeof first=="object"&&mid&&typeof mid=="object"&&last&&typeof last=="object"){return false}var cache=getObject();cache["false"]=cache["null"]=cache["true"]=cache["undefined"]=false;var result=getObject();result.array=array;result.cache=cache;result.push=cachePush;while(++index<length){result.push(array[index])}return result}function escapeStringChar(match){return"\\"+stringEscapes[match]}function getArray(){return arrayPool.pop()||[]}function getObject(){return objectPool.pop()||{array:null,cache:null,criteria:null,"false":false,index:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,value:null}}function noop(){}function releaseArray(array){array.length=0;if(arrayPool.length<maxPoolSize){arrayPool.push(array)}}function releaseObject(object){var cache=object.cache;if(cache){releaseObject(cache)}object.array=object.cache=object.criteria=object.object=object.number=object.string=object.value=null;if(objectPool.length<maxPoolSize){objectPool.push(object)}}function slice(array,start,end){start||(start=0);if(typeof end=="undefined"){end=array?array.length:0}var index=-1,length=end-start||0,result=Array(length<0?0:length);while(++index<length){result[index]=array[start+index]}return result}function runInContext(context){context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Boolean=context.Boolean,Date=context.Date,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;var arrayRef=[];var objectProto=Object.prototype;var oldDash=context._;var reNative=RegExp("^"+String(objectProto.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$");var ceil=Math.ceil,clearTimeout=context.clearTimeout,floor=Math.floor,fnToString=Function.prototype.toString,getPrototypeOf=reNative.test(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,hasOwnProperty=objectProto.hasOwnProperty,now=reNative.test(now=Date.now)&&now||function(){return+new Date},push=arrayRef.push,setImmediate=context.setImmediate,setTimeout=context.setTimeout,splice=arrayRef.splice,toString=objectProto.toString,unshift=arrayRef.unshift;var defineProperty=function(){try{var o={},func=reNative.test(func=Object.defineProperty)&&func,result=func(o,o,o)&&func}catch(e){}return result}();var nativeBind=reNative.test(nativeBind=toString.bind)&&nativeBind,nativeCreate=reNative.test(nativeCreate=Object.create)&&nativeCreate,nativeIsArray=reNative.test(nativeIsArray=Array.isArray)&&nativeIsArray,nativeIsFinite=context.isFinite,nativeIsNaN=context.isNaN,nativeKeys=reNative.test(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,nativeParseInt=context.parseInt,nativeRandom=Math.random,nativeSlice=arrayRef.slice;var isIeOpera=reNative.test(context.attachEvent),isV8=nativeBind&&!/\n|true/.test(nativeBind+isIeOpera);var ctorByClass={};ctorByClass[arrayClass]=Array;ctorByClass[boolClass]=Boolean;ctorByClass[dateClass]=Date;ctorByClass[funcClass]=Function;ctorByClass[objectClass]=Object;ctorByClass[numberClass]=Number;ctorByClass[regexpClass]=RegExp;ctorByClass[stringClass]=String;function lodash(value){return value&&typeof value=="object"&&!isArray(value)&&hasOwnProperty.call(value,"__wrapped__")?value:new lodashWrapper(value)}function lodashWrapper(value,chainAll){this.__chain__=!!chainAll;this.__wrapped__=value}lodashWrapper.prototype=lodash.prototype;var support=lodash.support={};support.fastBind=nativeBind&&!isV8;support.funcDecomp=!reNative.test(context.WinRTError)&&reThis.test(runInContext);support.funcNames=typeof Function.name=="string";lodash.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseClone(value,deep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(deep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!deep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,deep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"){return func}var bindData=func.__bindData__||support.funcNames&&!func.name;if(typeof bindData=="undefined"){var source=reThis&&fnToString.call(func);if(!support.funcNames&&source&&!reFuncName.test(source)){bindData=true}if(support.funcNames||!bindData){bindData=!support.funcDecomp||reThis.test(source);setBindData(func,bindData)}}if(bindData!==true&&(bindData&&bindData[1]&1)){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseFlatten(array,isShallow,isArgArrays,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value&&typeof value=="object"&&typeof value.length=="number"&&(isArray(value)||isArguments(value))){if(!isShallow){value=baseFlatten(value,isShallow,isArgArrays)}var valIndex=-1,valLength=value.length,resIndex=result.length;result.length+=valLength;while(++valIndex<valLength){result[resIndex++]=value[valIndex]}}else if(!isArgArrays){result.push(value)}}return result}function baseIsEqual(a,b,callback,isWhere,stackA,stackB){if(callback){var result=callback(a,b);if(typeof result!="undefined"){return!!result}}if(a===b){return a!==0||1/a==1/b}var type=typeof a,otherType=typeof b;if(a===a&&!(a&&objectTypes[type])&&!(b&&objectTypes[otherType])){return false}if(a==null||b==null){return a===b}var className=toString.call(a),otherClass=toString.call(b);if(className==argsClass){className=objectClass}if(otherClass==argsClass){otherClass=objectClass}if(className!=otherClass){return false}switch(className){case boolClass:case dateClass:return+a==+b;case numberClass:return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case regexpClass:case stringClass:return a==String(b)}var isArr=className==arrayClass;if(!isArr){if(hasOwnProperty.call(a,"__wrapped__ ")||hasOwnProperty.call(b,"__wrapped__")){return baseIsEqual(a.__wrapped__||a,b.__wrapped__||b,callback,isWhere,stackA,stackB)}if(className!=objectClass){return false}var ctorA=a.constructor,ctorB=b.constructor;if(ctorA!=ctorB&&!(isFunction(ctorA)&&ctorA instanceof ctorA&&isFunction(ctorB)&&ctorB instanceof ctorB)){return false}}var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==a){return stackB[length]==b}}var size=0;result=true;stackA.push(a);stackB.push(b);if(isArr){length=a.length;size=b.length;result=size==a.length;if(!result&&!isWhere){return result}while(size--){var index=length,value=b[size];if(isWhere){while(index--){if(result=baseIsEqual(a[index],value,callback,isWhere,stackA,stackB)){break}}}else if(!(result=baseIsEqual(a[size],value,callback,isWhere,stackA,stackB))){break}}return result}forIn(b,function(value,key,b){if(hasOwnProperty.call(b,key)){size++;return result=hasOwnProperty.call(a,key)&&baseIsEqual(a[key],value,callback,isWhere,stackA,stackB)}});if(result&&!isWhere){forIn(a,function(value,key,a){if(hasOwnProperty.call(a,key)){return result=--size>-1}})}if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);if(cache){indexOf=cacheIndexOf;seen=cache}else{isLarge=false;seen=callback?seen:(releaseArray(seen),result)}}while(++index<length){var value=array[index],computed=callback?callback(value,index,array):value;if(isSorted?!index||seen[seen.length-1]!==computed:indexOf(seen,computed)<0){if(callback||isLarge){seen.push(computed)}result.push(value)}}if(isLarge){releaseArray(seen.array);releaseObject(seen)}else if(callback){releaseArray(seen)}return result}function createAggregator(setter){return function(collection,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];setter(result,value,callback(value,index,collection),collection)}}else{forOwn(collection,function(value,key,collection){setter(result,value,callback(value,key,collection),collection)})}return result}}function createBound(func,bitmask,partialArgs,partialRightArgs,thisArg,arity){var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,isPartial=bitmask&16,isPartialRight=bitmask&32,key=func;if(!isBindKey&&!isFunction(func)){throw new TypeError}if(isPartial&&!partialArgs.length){bitmask&=~16;isPartial=partialArgs=false}if(isPartialRight&&!partialRightArgs.length){bitmask&=~32;isPartialRight=partialRightArgs=false}var bindData=func&&func.__bindData__;if(bindData){if(isBind&&!(bindData[1]&1)){bindData[4]=thisArg}if(!isBind&&bindData[1]&1){bitmask|=8}if(isCurry&&!(bindData[1]&4)){bindData[5]=arity}if(isPartial){push.apply(bindData[2]||(bindData[2]=[]),partialArgs)}if(isPartialRight){push.apply(bindData[3]||(bindData[3]=[]),partialRightArgs)}bindData[1]|=bitmask;return createBound.apply(null,bindData)}if(isBind&&!(isBindKey||isCurry||isPartialRight)&&(support.fastBind||nativeBind&&isPartial)){if(isPartial){var args=[thisArg];push.apply(args,partialArgs)}var bound=isPartial?nativeBind.apply(func,args):nativeBind.call(func,thisArg)}else{bound=function(){var args=arguments,thisBinding=isBind?thisArg:this;if(isCurry||isPartial||isPartialRight){args=nativeSlice.call(args);if(isPartial){unshift.apply(args,partialArgs)}if(isPartialRight){push.apply(args,partialRightArgs)}if(isCurry&&args.length<arity){bitmask|=16&~32;return createBound(func,isCurryBound?bitmask:bitmask&~3,args,null,thisArg,arity)}}if(isBindKey){func=thisBinding[key]}if(this instanceof bound){thisBinding=createObject(func.prototype);var result=func.apply(thisBinding,args);return isObject(result)?result:thisBinding}return func.apply(thisBinding,args)}}setBindData(bound,nativeSlice.call(arguments));return bound}function createObject(prototype){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){createObject=function(prototype){if(isObject(prototype)){noop.prototype=prototype;var result=new noop;noop.prototype=null}return result||{}}}function escapeHtmlChar(match){return htmlEscapes[match]}function getIndexOf(){var result=(result=lodash.indexOf)===indexOf?baseIndexOf:result;return result}var setBindData=!defineProperty?noop:function(func,value){descriptor.value=value;defineProperty(func,"__bindData__",descriptor)};function shimIsPlainObject(value){var ctor,result;if(!(value&&toString.call(value)==objectClass)||(ctor=value.constructor,isFunction(ctor)&&!(ctor instanceof ctor))){return false}forIn(value,function(value,key){result=key});return typeof result=="undefined"||hasOwnProperty.call(value,result)}function unescapeHtmlChar(match){return htmlUnescapes[match]}function isArguments(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==argsClass||false}var isArray=nativeIsArray||function(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==arrayClass||false};var shimKeys=function(object){var index,iterable=object,result=[];if(!iterable)return result;if(!objectTypes[typeof object])return result;for(index in iterable){if(hasOwnProperty.call(iterable,index)){result.push(index)}}return result};var keys=!nativeKeys?shimKeys:function(object){if(!isObject(object)){return[]}return nativeKeys(object)};var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2) | |
}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];result[index]=callback?callback(result[index],iterable[index]):iterable[index]}}}return result};function clone(value,deep,callback,thisArg){if(typeof deep!="boolean"&&deep!=null){thisArg=callback;callback=deep;deep=false}return baseClone(value,deep,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function cloneDeep(value,callback,thisArg){return baseClone(value,true,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}var defaults=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(typeof result[index]=="undefined")result[index]=iterable[index]}}}return result};function findKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}function findLastKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwnRight(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}var forIn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);for(index in iterable){if(callback(iterable[index],index,collection)===false)return result}return result};function forInRight(object,callback,thisArg){var pairs=[];forIn(object,function(value,key){pairs.push(key,value)});var length=pairs.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){if(callback(pairs[length--],pairs[length],object)===false){break}}return object}var forOwn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(callback(iterable[index],index,collection)===false)return result}return result};function forOwnRight(object,callback,thisArg){var props=keys(object),length=props.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){var key=props[length];if(callback(object[key],key,object)===false){break}}return object}function functions(object){var result=[];forIn(object,function(value,key){if(isFunction(value)){result.push(key)}});return result.sort()}function has(object,property){return object?hasOwnProperty.call(object,property):false}function invert(object){var index=-1,props=keys(object),length=props.length,result={};while(++index<length){var key=props[index];result[object[key]]=key}return result}function isBoolean(value){return value===true||value===false||toString.call(value)==boolClass}function isDate(value){return value?typeof value=="object"&&toString.call(value)==dateClass:false}function isElement(value){return value?value.nodeType===1:false}function isEmpty(value){var result=true;if(!value){return result}var className=toString.call(value),length=value.length;if(className==arrayClass||className==stringClass||className==argsClass||className==objectClass&&typeof length=="number"&&isFunction(value.splice)){return!length}forOwn(value,function(){return result=false});return result}function isEqual(a,b,callback,thisArg){return baseIsEqual(a,b,typeof callback=="function"&&baseCreateCallback(callback,thisArg,2))}function isFinite(value){return nativeIsFinite(value)&&!nativeIsNaN(parseFloat(value))}function isFunction(value){return typeof value=="function"}function isObject(value){return!!(value&&objectTypes[typeof value])}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||toString.call(value)==numberClass}var isPlainObject=function(value){if(!(value&&toString.call(value)==objectClass)){return false}var valueOf=value.valueOf,objProto=typeof valueOf=="function"&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)};function isRegExp(value){return value?typeof value=="object"&&toString.call(value)==regexpClass:false}function isString(value){return typeof value=="string"||toString.call(value)==stringClass}function isUndefined(value){return typeof value=="undefined"}function merge(object){var args=arguments,length=2;if(!isObject(object)){return object}if(typeof args[2]!="number"){length=args.length}if(length>3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=nativeSlice.call(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index<length){baseMerge(object,sources[index],callback,stackA,stackB)}releaseArray(stackA);releaseArray(stackB);return object}function omit(object,callback,thisArg){var indexOf=getIndexOf(),isFunc=typeof callback=="function",result={};if(isFunc){callback=lodash.createCallback(callback,thisArg,3)}else{var props=baseFlatten(arguments,true,false,1)}forIn(object,function(value,key,object){if(isFunc?!callback(value,key,object):indexOf(props,key)<0){result[key]=value}});return result}function pairs(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}function pick(object,callback,thisArg){var result={};if(typeof callback!="function"){var index=-1,props=baseFlatten(arguments,true,false,1),length=isObject(object)?props.length:0;while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(callback(value,key,object)){result[key]=value}})}return result}function transform(object,callback,accumulator,thisArg){var isArr=isArray(object);callback=baseCreateCallback(callback,thisArg,4);if(accumulator==null){if(isArr){accumulator=[]}else{var ctor=object&&object.constructor,proto=ctor&&ctor.prototype;accumulator=createObject(proto)}}(isArr?forEach:forOwn)(object,function(value,index,object){return callback(accumulator,value,index,object)});return accumulator}function values(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){result[index]=object[props[index]]}return result}function at(collection){var args=arguments,index=-1,props=baseFlatten(args,true,false,1),length=args[2]&&args[2][args[1]]===collection?1:props.length,result=Array(length);while(++index<length){result[index]=collection[props[index]]}return result}function contains(collection,target,fromIndex){var index=-1,indexOf=getIndexOf(),length=collection?collection.length:0,result=false;fromIndex=(fromIndex<0?nativeMax(0,length+fromIndex):fromIndex)||0;if(isArray(collection)){result=indexOf(collection,target,fromIndex)>-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(!(result=!!callback(collection[index],index,collection))){break}}}else{forOwn(collection,function(value,index,collection){return result=!!callback(value,index,collection)})}return result}function filter(collection,callback,thisArg){var result=[];callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){result.push(value)}}}else{forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result.push(value)}})}return result}function find(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){return value}}}else{var result;forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}}function findLast(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forEachRight(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}function forEach(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(++index<length){if(callback(collection[index],index,collection)===false){break}}}else{forOwn(collection,callback)}return collection}function forEachRight(collection,callback,thisArg){var length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(length--){if(callback(collection[length],length,collection)===false){break}}}else{var props=keys(collection);length=props.length;forOwn(collection,function(value,key,collection){key=props?props[--length]:--length;return callback(collection[key],key,collection)})}return collection}var groupBy=createAggregator(function(result,value,key){(hasOwnProperty.call(result,key)?result[key]:result[key]=[]).push(value)});var indexBy=createAggregator(function(result,value,key){result[key]=value});function invoke(collection,methodName){var args=nativeSlice.call(arguments,2),index=-1,isFunc=typeof methodName=="function",length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){result[++index]=(isFunc?methodName:value[methodName]).apply(value,args)});return result}function map(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=lodash.createCallback(callback,thisArg,3);if(typeof length=="number"){var result=Array(length);while(++index<length){result[index]=callback(collection[index],index,collection)}}else{result=[];forOwn(collection,function(value,key,collection){result[++index]=callback(value,key,collection)})}return result}function max(collection,callback,thisArg){var computed=-Infinity,result=computed;if(!callback&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value>result){result=value}}}else{callback=!callback&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(!callback&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value<result){result=value}}}else{callback=!callback&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current<computed){computed=current;result=value}})}return result}function pluck(collection,property){var index=-1,length=collection?collection.length:0;if(typeof length=="number"){var result=Array(length);while(++index<length){result[index]=collection[index][property]}}return result||map(collection,property)}function reduce(collection,callback,accumulator,thisArg){if(!collection)return accumulator;var noaccum=arguments.length<3;callback=baseCreateCallback(callback,thisArg,4);var index=-1,length=collection.length;if(typeof length=="number"){if(noaccum){accumulator=collection[++index]}while(++index<length){accumulator=callback(accumulator,collection[index],index,collection)}}else{forOwn(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)})}return accumulator}function reduceRight(collection,callback,accumulator,thisArg){var noaccum=arguments.length<3;callback=baseCreateCallback(callback,thisArg,4);forEachRight(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)});return accumulator}function reject(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);return filter(collection,function(value,index,collection){return!callback(value,index,collection)})}function sample(collection,n,guard){var length=collection?collection.length:0;if(typeof length!="number"){collection=values(collection)}if(n==null||guard){return collection?collection[random(length-1)]:undefined}var result=shuffle(collection);result.length=nativeMin(nativeMax(0,n),result.length);return result}function shuffle(collection){var index=-1,length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){var rand=random(++index);result[index]=result[rand];result[rand]=value});return result}function size(collection){var length=collection?collection.length:0;return typeof length=="number"?length:keys(collection).length}function some(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(result=callback(collection[index],index,collection)){break}}}else{forOwn(collection,function(value,index,collection){return!(result=callback(value,index,collection))})}return!!result}function sortBy(collection,callback,thisArg){var index=-1,length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);callback=lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,key,collection){var object=result[++index]=getObject();object.criteria=callback(value,key,collection);object.index=index;object.value=value});length=result.length;result.sort(compareAscending);while(length--){var object=result[length];result[length]=object.value;releaseObject(object)}return result}function toArray(collection){if(collection&&typeof collection.length=="number"){return slice(collection)}return values(collection)}var where=filter;function compact(array){var index=-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value){result.push(value)}}return result}function difference(array){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,seen=baseFlatten(arguments,true,true,1),result=[];var isLarge=length>=largeArraySize&&indexOf===baseIndexOf;if(isLarge){var cache=createCache(seen);if(cache){indexOf=cacheIndexOf;seen=cache}else{isLarge=false}}while(++index<length){var value=array[index];if(indexOf(seen,value)<0){result.push(value)}}if(isLarge){releaseObject(seen)}return result}function findIndex(array,callback,thisArg){var index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length){if(callback(array[index],index,array)){return index}}return-1}function findLastIndex(array,callback,thisArg){var length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(length--){if(callback(array[length],length,array)){return length}}return-1}function first(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=-1;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[0]:undefined}}return slice(array,0,nativeMin(nativeMax(0,n),length))}function flatten(array,isShallow,callback,thisArg){if(typeof isShallow!="boolean"&&isShallow!=null){thisArg=callback;callback=!(thisArg&&thisArg[isShallow]===array)?isShallow:null;isShallow=false}if(callback!=null){array=map(array,callback,thisArg)}return baseFlatten(array,isShallow)}function indexOf(array,value,fromIndex){if(typeof fromIndex=="number"){var length=array?array.length:0;fromIndex=fromIndex<0?nativeMax(0,length+fromIndex):fromIndex||0}else if(fromIndex){var index=sortedIndex(array,value);return array[index]===value?index:-1}return baseIndexOf(array,value,fromIndex)}function initial(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:callback||n}return slice(array,0,nativeMin(nativeMax(0,length-n),length))}function intersection(array){var args=arguments,argsLength=args.length,argsIndex=-1,caches=getArray(),index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[],seen=getArray();while(++argsIndex<argsLength){var value=args[argsIndex];caches[argsIndex]=indexOf===baseIndexOf&&(value?value.length:0)>=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen)}outer:while(++index<length){var cache=caches[0];value=array[index];if((cache?cacheIndexOf(cache,value):indexOf(seen,value))<0){argsIndex=argsLength;(cache||seen).push(value);while(--argsIndex){cache=caches[argsIndex];if((cache?cacheIndexOf(cache,value):indexOf(args[argsIndex],value))<0){continue outer}}result.push(value)}}while(argsLength--){cache=caches[argsLength];if(cache){releaseObject(cache)}}releaseArray(caches);releaseArray(seen);return result}function last(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[length-1]:undefined}}return slice(array,nativeMax(0,length-n))}function lastIndexOf(array,value,fromIndex){var index=array?array.length:0;if(typeof fromIndex=="number"){index=(fromIndex<0?nativeMax(0,index+fromIndex):nativeMin(fromIndex,index-1))+1}while(index--){if(array[index]===value){return index}}return-1}function pull(array){var args=arguments,argsIndex=0,argsLength=args.length,length=array?array.length:0;while(++argsIndex<argsLength){var index=-1,value=args[argsIndex];while(++index<length){if(array[index]===value){splice.call(array,index--,1);length--}}}return array}function range(start,end,step){start=+start||0;step=typeof step=="number"?step:+step||1;if(end==null){end=start;start=0}var index=-1,length=nativeMax(0,ceil((end-start)/(step||1))),result=Array(length);while(++index<length){result[index]=start;start+=step}return result}function remove(array,callback,thisArg){var index=-1,length=array?array.length:0,result=[];callback=lodash.createCallback(callback,thisArg,3);while(++index<length){var value=array[index];if(callback(value,index,array)){result.push(value);splice.call(array,index--,1);length--}}return result}function rest(array,callback,thisArg){if(typeof callback!="number"&&callback!=null){var n=0,index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:nativeMax(0,callback)}return slice(array,n)}function sortedIndex(array,value,callback,thisArg){var low=0,high=array?array.length:low;callback=callback?lodash.createCallback(callback,thisArg,1):identity;value=callback(value);while(low<high){var mid=low+high>>>1;callback(array[mid])<value?low=mid+1:high=mid}return low}function union(array){return baseUniq(baseFlatten(arguments,true,true))}function uniq(array,isSorted,callback,thisArg){if(typeof isSorted!="boolean"&&isSorted!=null){thisArg=callback;callback=!(thisArg&&thisArg[isSorted]===array)?isSorted:null;isSorted=false}if(callback!=null){callback=lodash.createCallback(callback,thisArg,3)}return baseUniq(array,isSorted,callback)}function without(array){return difference(array,nativeSlice.call(arguments,1))}function zip(){var array=arguments.length>1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index<length){result[index]=pluck(array,index)}return result}function zipObject(keys,values){var index=-1,length=keys?keys.length:0,result={};while(++index<length){var key=keys[index];if(values){result[key]=values[index]}else if(key){result[key[0]]=key[1]}}return result}function after(n,func){if(!isFunction(func)){throw new TypeError}return function(){if(--n<1){return func.apply(this,arguments)}}}function bind(func,thisArg){return arguments.length>2?createBound(func,17,nativeSlice.call(arguments,2),null,thisArg):createBound(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index<length){var key=funcs[index];object[key]=createBound(object[key],1,null,null,object)}return object}function bindKey(object,key){return arguments.length>2?createBound(key,19,nativeSlice.call(arguments,2),null,object):createBound(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return function(object){return object[func]}}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createBound(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args)}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args)}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled);if(remaining<=0){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){result=func.apply(thisArg,args)}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=nativeSlice.call(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}if(isV8&&moduleExports&&typeof setImmediate=="function"){defer=function(func){if(!isFunction(func)){throw new TypeError}return setImmediate.apply(context,arguments)}}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=nativeSlice.call(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createBound(func,16,nativeSlice.call(arguments,1))}function partialRight(func){return createBound(func,32,null,nativeSlice.call(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;var result=debounce(func,wait,debounceOptions);return result}function wrap(value,wrapper){if(!isFunction(wrapper)){throw new TypeError}return function(){var args=[value];push.apply(args,arguments);return wrapper.apply(this,args)}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source){var ctor=object,isFunc=!source||isFunction(ctor);if(!source){ctor=lodashWrapper;source=object;object=lodash}forEach(functions(source),function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(value&&typeof value=="object"&&value===result){return this}result=new ctor(result);result.__chain__=this.__chain__;return result}}})}function noConflict(){context._=oldDash;return this}var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}var rand=nativeRandom();return floating||min%1||max%1?nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max):min+floor(rand*(max-min+1))}function result(object,property){if(object){var value=object[property];return isFunction(value)?object[property]():value}}function template(text,data,options){var settings=lodash.templateSettings;text||(text="");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index<n){result[index]=callback(index)}return result}function unescape(string){return string==null?"":String(string).replace(reEscapedHtml,unescapeHtmlChar)}function uniqueId(prefix){var id=++idCounter;return String(prefix==null?"":prefix)+id}function chain(value){value=new lodashWrapper(value);value.__chain__=true;return value}function tap(value,interceptor){interceptor(value);return value}function wrapperChain(){this.__chain__=true;return this}function wrapperToString(){return String(this.__wrapped__)}function wrapperValueOf(){return this.__wrapped__}lodash.after=after;lodash.assign=assign;lodash.at=at;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.chain=chain;lodash.compact=compact;lodash.compose=compose;lodash.countBy=countBy;lodash.createCallback=createCallback;lodash.curry=curry;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.filter=filter;lodash.flatten=flatten;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.functions=functions;lodash.groupBy=groupBy;lodash.indexBy=indexBy;lodash.initial=initial;lodash.intersection=intersection;lodash.invert=invert;lodash.invoke=invoke;lodash.keys=keys;lodash.map=map;lodash.max=max;lodash.memoize=memoize;lodash.merge=merge;lodash.min=min;lodash.omit=omit;lodash.once=once;lodash.pairs=pairs;lodash.partial=partial;lodash.partialRight=partialRight;lodash.pick=pick;lodash.pluck=pluck;lodash.pull=pull;lodash.range=range;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.shuffle=shuffle;lodash.sortBy=sortBy;lodash.tap=tap;lodash.throttle=throttle;lodash.times=times;lodash.toArray=toArray;lodash.transform=transform;lodash.union=union;lodash.uniq=uniq;lodash.values=values;lodash.where=where;lodash.without=without;lodash.wrap=wrap;lodash.zip=zip;lodash.zipObject=zipObject;lodash.collect=map; | |
lodash.drop=rest;lodash.each=forEach;lodash.eachRight=forEachRight;lodash.extend=assign;lodash.methods=functions;lodash.object=zipObject;lodash.select=filter;lodash.tail=rest;lodash.unique=uniq;lodash.unzip=zip;mixin(lodash);lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.contains=contains;lodash.escape=escape;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.has=has;lodash.identity=identity;lodash.indexOf=indexOf;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isBoolean=isBoolean;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isNaN=isNaN;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isString=isString;lodash.isUndefined=isUndefined;lodash.lastIndexOf=lastIndexOf;lodash.mixin=mixin;lodash.noConflict=noConflict;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.result=result;lodash.runInContext=runInContext;lodash.size=size;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.template=template;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.all=every;lodash.any=some;lodash.detect=find;lodash.findWhere=find;lodash.foldl=reduce;lodash.foldr=reduceRight;lodash.include=contains;lodash.inject=reduce;forOwn(lodash,function(func,methodName){if(!lodash.prototype[methodName]){lodash.prototype[methodName]=function(){var args=[this.__wrapped__],chainAll=this.__chain__;push.apply(args,arguments);var result=func.apply(lodash,args);return chainAll?new lodashWrapper(result,chainAll):result}}});lodash.first=first;lodash.last=last;lodash.sample=sample;lodash.take=first;lodash.head=first;forOwn(lodash,function(func,methodName){var callbackable=methodName!=="sample";if(!lodash.prototype[methodName]){lodash.prototype[methodName]=function(n,guard){var chainAll=this.__chain__,result=func(this.__wrapped__,n,guard);return!chainAll&&(n==null||guard&&!(callbackable&&typeof n=="function"))?result:new lodashWrapper(result,chainAll)}}});lodash.VERSION="2.2.1";lodash.prototype.chain=wrapperChain;lodash.prototype.toString=wrapperToString;lodash.prototype.value=wrapperValueOf;lodash.prototype.valueOf=wrapperValueOf;forEach(["join","pop","shift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){var chainAll=this.__chain__,result=func.apply(this.__wrapped__,arguments);return chainAll?new lodashWrapper(result,chainAll):result}});forEach(["push","reverse","sort","unshift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){func.apply(this.__wrapped__,arguments);return this}});forEach(["concat","slice","splice"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){return new lodashWrapper(func.apply(this.__wrapped__,arguments),this.__chain__)}});return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],24:[function(require,module,exports){"use strict";var slice=require("array-slice");module.exports=function extend(o){if(o==null){return{}}var args=slice(arguments,1);var len=args.length;for(var i=0;i<len;i++){var obj=args[i];for(var key in obj){if(obj.hasOwnProperty(key)){o[key]=obj[key]}}}return o}},{"array-slice":14}],25:[function(require,module,exports){"use strict";module.exports=function forIn(o,fn,thisArg){for(var key in o){if(fn.call(thisArg,o[key],key,o)===false){break}}}},{}],26:[function(require,module,exports){"use strict";var isObject=require("isobject");module.exports=function getValue(obj,str,fn){if(obj==null||!isObject(obj)){return{}}if(str==null||typeof str!=="string"){return obj}var path;if(fn&&typeof fn==="function"){path=fn(str)}else if(fn===true){str=replaceStr(str,"\\.","___DOT___");path=str.split(".").map(function(seg){return replaceStr(seg,"___DOT___",".")})}else{path=str.split(".")}var len=path.length;var i=0;var last;while(i<len){var key=path[i];last=obj[key];if(last==null){return null}if(typeof last==="object"){obj=last}i++}return last};function replaceStr(str,token,replacement){var i,from=0;while(str.indexOf(token,from)!==-1){i=str.indexOf(token,from);from=i+token.length;str=str.substr(0,i)+replacement+str.substr(from,str.length);from=i+replacement.length}return str}},{isobject:27}],27:[function(require,module,exports){"use strict";module.exports=function isObject(o){return o!=null&&typeof o==="object"&&!Array.isArray(o)}},{}],28:[function(require,module,exports){"use strict";module.exports=function typeOf(val){if(val===null){return"null"}if(val===undefined){return"undefined"}if(typeof val!=="object"){return typeof val}if(Array.isArray(val)){return"array"}return{}.toString.call(val).slice(8,-1).toLowerCase()}},{}],29:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index<length){if(array[index]===value){return index}}return-1}function cacheIndexOf(cache,value){var type=typeof value;cache=cache.cache;if(type=="boolean"||value==null){return cache[value]?0:-1}if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value;cache=(cache=cache[type])&&cache[key];return type=="object"?cache&&baseIndexOf(cache,value)>-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++index<length){var value=ac[index],other=bc[index];if(value!==other){if(value>other||typeof value=="undefined"){return 1}if(value<other||typeof other=="undefined"){return-1}}}return a.index-b.index}function createCache(array){var index=-1,length=array.length,first=array[0],mid=array[length/2|0],last=array[length-1];if(first&&typeof first=="object"&&mid&&typeof mid=="object"&&last&&typeof last=="object"){return false}var cache=getObject();cache["false"]=cache["null"]=cache["true"]=cache["undefined"]=false;var result=getObject();result.array=array;result.cache=cache;result.push=cachePush;while(++index<length){result.push(array[index])}return result}function escapeStringChar(match){return"\\"+stringEscapes[match]}function getArray(){return arrayPool.pop()||[]}function getObject(){return objectPool.pop()||{array:null,cache:null,criteria:null,"false":false,index:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,value:null}}function releaseArray(array){array.length=0;if(arrayPool.length<maxPoolSize){arrayPool.push(array)}}function releaseObject(object){var cache=object.cache;if(cache){releaseObject(cache)}object.array=object.cache=object.criteria=object.object=object.number=object.string=object.value=null;if(objectPool.length<maxPoolSize){objectPool.push(object)}}function slice(array,start,end){start||(start=0);if(typeof end=="undefined"){end=array?array.length:0}var index=-1,length=end-start||0,result=Array(length<0?0:length);while(++index<length){result[index]=array[start+index]}return result}function runInContext(context){context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Boolean=context.Boolean,Date=context.Date,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;var arrayRef=[];var objectProto=Object.prototype;var oldDash=context._;var toString=objectProto.toString;var reNative=RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");var ceil=Math.ceil,clearTimeout=context.clearTimeout,floor=Math.floor,fnToString=Function.prototype.toString,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,hasOwnProperty=objectProto.hasOwnProperty,push=arrayRef.push,setTimeout=context.setTimeout,splice=arrayRef.splice,unshift=arrayRef.unshift;var defineProperty=function(){try{var o={},func=isNative(func=Object.defineProperty)&&func,result=func(o,o,o)&&func}catch(e){}return result}();var nativeCreate=isNative(nativeCreate=Object.create)&&nativeCreate,nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeIsFinite=context.isFinite,nativeIsNaN=context.isNaN,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,nativeParseInt=context.parseInt,nativeRandom=Math.random;var ctorByClass={};ctorByClass[arrayClass]=Array;ctorByClass[boolClass]=Boolean;ctorByClass[dateClass]=Date;ctorByClass[funcClass]=Function;ctorByClass[objectClass]=Object;ctorByClass[numberClass]=Number;ctorByClass[regexpClass]=RegExp;ctorByClass[stringClass]=String;function lodash(value){return value&&typeof value=="object"&&!isArray(value)&&hasOwnProperty.call(value,"__wrapped__")?value:new lodashWrapper(value)}function lodashWrapper(value,chainAll){this.__chain__=!!chainAll;this.__wrapped__=value}lodashWrapper.prototype=lodash.prototype;var support=lodash.support={};support.funcDecomp=!isNative(context.WinRTError)&&reThis.test(runInContext);support.funcNames=typeof Function.name=="string";lodash.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length<arity){bitmask|=16&~32;return baseCreateWrapper([func,isCurryBound?bitmask:bitmask&~3,args,null,thisArg,arity])}}args||(args=arguments);if(isBindKey){func=thisBinding[key]}if(this instanceof bound){thisBinding=baseCreate(func.prototype);var result=func.apply(thisBinding,args);return isObject(result)?result:thisBinding}return func.apply(thisBinding,args)}setBindData(bound,bindData);return bound}function baseDifference(array,values){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,isLarge=length>=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index<length){var value=array[index];if(indexOf(values,value)<0){result.push(value)}}if(isLarge){releaseObject(values)}return result}function baseFlatten(array,isShallow,isStrict,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value&&typeof value=="object"&&typeof value.length=="number"&&(isArray(value)||isArguments(value))){if(!isShallow){value=baseFlatten(value,isShallow,isStrict)}var valIndex=-1,valLength=value.length,resIndex=result.length;result.length+=valLength;while(++valIndex<valLength){result[resIndex++]=value[valIndex]}}else if(!isStrict){result.push(value)}}return result}function baseIsEqual(a,b,callback,isWhere,stackA,stackB){if(callback){var result=callback(a,b);if(typeof result!="undefined"){return!!result}}if(a===b){return a!==0||1/a==1/b}var type=typeof a,otherType=typeof b;if(a===a&&!(a&&objectTypes[type])&&!(b&&objectTypes[otherType])){return false}if(a==null||b==null){return a===b}var className=toString.call(a),otherClass=toString.call(b);if(className==argsClass){className=objectClass}if(otherClass==argsClass){otherClass=objectClass}if(className!=otherClass){return false}switch(className){case boolClass:case dateClass:return+a==+b;case numberClass:return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case regexpClass:case stringClass:return a==String(b)}var isArr=className==arrayClass;if(!isArr){var aWrapped=hasOwnProperty.call(a,"__wrapped__"),bWrapped=hasOwnProperty.call(b,"__wrapped__");if(aWrapped||bWrapped){return baseIsEqual(aWrapped?a.__wrapped__:a,bWrapped?b.__wrapped__:b,callback,isWhere,stackA,stackB)}if(className!=objectClass){return false}var ctorA=a.constructor,ctorB=b.constructor;if(ctorA!=ctorB&&!(isFunction(ctorA)&&ctorA instanceof ctorA&&isFunction(ctorB)&&ctorB instanceof ctorB)&&("constructor"in a&&"constructor"in b)){return false}}var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==a){return stackB[length]==b}}var size=0;result=true;stackA.push(a);stackB.push(b);if(isArr){length=a.length;size=b.length;result=size==length;if(result||isWhere){while(size--){var index=length,value=b[size];if(isWhere){while(index--){if(result=baseIsEqual(a[index],value,callback,isWhere,stackA,stackB)){break}}}else if(!(result=baseIsEqual(a[size],value,callback,isWhere,stackA,stackB))){break}}}}else{forIn(b,function(value,key,b){if(hasOwnProperty.call(b,key)){size++;return result=hasOwnProperty.call(a,key)&&baseIsEqual(a[key],value,callback,isWhere,stackA,stackB)}});if(result&&!isWhere){forIn(a,function(value,key,a){if(hasOwnProperty.call(a,key)){return result=--size>-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index<length){var value=array[index],computed=callback?callback(value,index,array):value;if(isSorted?!index||seen[seen.length-1]!==computed:indexOf(seen,computed)<0){if(callback||isLarge){seen.push(computed)}result.push(value)}}if(isLarge){releaseArray(seen.array);releaseObject(seen)}else if(callback){releaseArray(seen)}return result}function createAggregator(setter){return function(collection,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];setter(result,value,callback(value,index,collection),collection)}}else{forOwn(collection,function(value,key,collection){setter(result,value,callback(value,key,collection),collection)})}return result}}function createWrapper(func,bitmask,partialArgs,partialRightArgs,thisArg,arity){var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,isPartial=bitmask&16,isPartialRight=bitmask&32;if(!isBindKey&&!isFunction(func)){throw new TypeError}if(isPartial&&!partialArgs.length){bitmask&=~16;isPartial=partialArgs=false}if(isPartialRight&&!partialRightArgs.length){bitmask&=~32;isPartialRight=partialRightArgs=false}var bindData=func&&func.__bindData__;if(bindData&&bindData!==true){bindData=slice(bindData);if(bindData[2]){bindData[2]=slice(bindData[2])}if(bindData[3]){bindData[3]=slice(bindData[3])}if(isBind&&!(bindData[1]&1)){bindData[4]=thisArg}if(!isBind&&bindData[1]&1){bitmask|=8}if(isCurry&&!(bindData[1]&4)){bindData[5]=arity}if(isPartial){push.apply(bindData[2]||(bindData[2]=[]),partialArgs)}if(isPartialRight){unshift.apply(bindData[3]||(bindData[3]=[]),partialRightArgs)}bindData[1]|=bitmask;return createWrapper.apply(null,bindData)}var creater=bitmask==1||bitmask===17?baseBind:baseCreateWrapper;return creater([func,bitmask,partialArgs,partialRightArgs,thisArg,arity])}function escapeHtmlChar(match){return htmlEscapes[match]}function getIndexOf(){var result=(result=lodash.indexOf)===indexOf?baseIndexOf:result;return result}function isNative(value){return typeof value=="function"&&reNative.test(value)}var setBindData=!defineProperty?noop:function(func,value){descriptor.value=value;defineProperty(func,"__bindData__",descriptor)};function shimIsPlainObject(value){var ctor,result;if(!(value&&toString.call(value)==objectClass)||(ctor=value.constructor,isFunction(ctor)&&!(ctor instanceof ctor))){return false}forIn(value,function(value,key){result=key});return typeof result=="undefined"||hasOwnProperty.call(value,result)}function unescapeHtmlChar(match){return htmlUnescapes[match]}function isArguments(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==argsClass||false}var isArray=nativeIsArray||function(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==arrayClass||false};var shimKeys=function(object){var index,iterable=object,result=[];if(!iterable)return result;if(!objectTypes[typeof object])return result;for(index in iterable){if(hasOwnProperty.call(iterable,index)){result.push(index)}}return result};var keys=!nativeKeys?shimKeys:function(object){if(!isObject(object)){return[]}return nativeKeys(object)};var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];result[index]=callback?callback(result[index],iterable[index]):iterable[index]}}}return result};function clone(value,isDeep,callback,thisArg){if(typeof isDeep!="boolean"&&isDeep!=null){thisArg=callback;callback=isDeep;isDeep=false}return baseClone(value,isDeep,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function cloneDeep(value,callback,thisArg){return baseClone(value,true,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function create(prototype,properties){var result=baseCreate(prototype);return properties?assign(result,properties):result}var defaults=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(typeof result[index]=="undefined")result[index]=iterable[index]}}}return result};function findKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}function findLastKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwnRight(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}var forIn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);for(index in iterable){if(callback(iterable[index],index,collection)===false)return result}return result};function forInRight(object,callback,thisArg){var pairs=[];forIn(object,function(value,key){pairs.push(key,value)});var length=pairs.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){if(callback(pairs[length--],pairs[length],object)===false){break}}return object}var forOwn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(callback(iterable[index],index,collection)===false)return result}return result};function forOwnRight(object,callback,thisArg){var props=keys(object),length=props.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){var key=props[length];if(callback(object[key],key,object)===false){break}}return object}function functions(object){var result=[];forIn(object,function(value,key){if(isFunction(value)){result.push(key)}});return result.sort()}function has(object,key){return object?hasOwnProperty.call(object,key):false}function invert(object){var index=-1,props=keys(object),length=props.length,result={};while(++index<length){var key=props[index];result[object[key]]=key}return result}function isBoolean(value){return value===true||value===false||value&&typeof value=="object"&&toString.call(value)==boolClass||false}function isDate(value){return value&&typeof value=="object"&&toString.call(value)==dateClass||false}function isElement(value){return value&&value.nodeType===1||false}function isEmpty(value){var result=true;if(!value){return result}var className=toString.call(value),length=value.length;if(className==arrayClass||className==stringClass||className==argsClass||className==objectClass&&typeof length=="number"&&isFunction(value.splice)){return!length}forOwn(value,function(){return result=false});return result}function isEqual(a,b,callback,thisArg){return baseIsEqual(a,b,typeof callback=="function"&&baseCreateCallback(callback,thisArg,2))}function isFinite(value){return nativeIsFinite(value)&&!nativeIsNaN(parseFloat(value))}function isFunction(value){return typeof value=="function"}function isObject(value){return!!(value&&objectTypes[typeof value])}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||value&&typeof value=="object"&&toString.call(value)==numberClass||false}var isPlainObject=!getPrototypeOf?shimIsPlainObject:function(value){if(!(value&&toString.call(value)==objectClass)){return false}var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)};function isRegExp(value){return value&&typeof value=="object"&&toString.call(value)==regexpClass||false}function isString(value){return typeof value=="string"||value&&typeof value=="object"&&toString.call(value)==stringClass||false}function isUndefined(value){return typeof value=="undefined"}function mapValues(object,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){result[key]=callback(value,key,object)});return result}function merge(object){var args=arguments,length=2;if(!isObject(object)){return object}if(typeof args[2]!="number"){length=args.length}if(length>3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index<length){baseMerge(object,sources[index],callback,stackA,stackB)}releaseArray(stackA);releaseArray(stackB);return object}function omit(object,callback,thisArg){var result={};if(typeof callback!="function"){var props=[];forIn(object,function(value,key){props.push(key)});props=baseDifference(props,baseFlatten(arguments,true,false,1));var index=-1,length=props.length;while(++index<length){var key=props[index];result[key]=object[key]}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(!callback(value,key,object)){result[key]=value}})}return result}function pairs(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}function pick(object,callback,thisArg){var result={};if(typeof callback!="function"){var index=-1,props=baseFlatten(arguments,true,false,1),length=isObject(object)?props.length:0;while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(callback(value,key,object)){result[key]=value}})}return result}function transform(object,callback,accumulator,thisArg){var isArr=isArray(object);if(accumulator==null){if(isArr){accumulator=[]}else{var ctor=object&&object.constructor,proto=ctor&&ctor.prototype;accumulator=baseCreate(proto)}}if(callback){callback=lodash.createCallback(callback,thisArg,4);(isArr?forEach:forOwn)(object,function(value,index,object){return callback(accumulator,value,index,object)})}return accumulator}function values(object){var index=-1,props=keys(object),length=props.length,result=Array(length); | |
while(++index<length){result[index]=object[props[index]]}return result}function at(collection){var args=arguments,index=-1,props=baseFlatten(args,true,false,1),length=args[2]&&args[2][args[1]]===collection?1:props.length,result=Array(length);while(++index<length){result[index]=collection[props[index]]}return result}function contains(collection,target,fromIndex){var index=-1,indexOf=getIndexOf(),length=collection?collection.length:0,result=false;fromIndex=(fromIndex<0?nativeMax(0,length+fromIndex):fromIndex)||0;if(isArray(collection)){result=indexOf(collection,target,fromIndex)>-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(!(result=!!callback(collection[index],index,collection))){break}}}else{forOwn(collection,function(value,index,collection){return result=!!callback(value,index,collection)})}return result}function filter(collection,callback,thisArg){var result=[];callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){result.push(value)}}}else{forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result.push(value)}})}return result}function find(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){return value}}}else{var result;forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}}function findLast(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forEachRight(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}function forEach(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(++index<length){if(callback(collection[index],index,collection)===false){break}}}else{forOwn(collection,callback)}return collection}function forEachRight(collection,callback,thisArg){var length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(length--){if(callback(collection[length],length,collection)===false){break}}}else{var props=keys(collection);length=props.length;forOwn(collection,function(value,key,collection){key=props?props[--length]:--length;return callback(collection[key],key,collection)})}return collection}var groupBy=createAggregator(function(result,value,key){(hasOwnProperty.call(result,key)?result[key]:result[key]=[]).push(value)});var indexBy=createAggregator(function(result,value,key){result[key]=value});function invoke(collection,methodName){var args=slice(arguments,2),index=-1,isFunc=typeof methodName=="function",length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){result[++index]=(isFunc?methodName:value[methodName]).apply(value,args)});return result}function map(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=lodash.createCallback(callback,thisArg,3);if(typeof length=="number"){var result=Array(length);while(++index<length){result[index]=callback(collection[index],index,collection)}}else{result=[];forOwn(collection,function(value,key,collection){result[++index]=callback(value,key,collection)})}return result}function max(collection,callback,thisArg){var computed=-Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value>result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value<result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current<computed){computed=current;result=value}})}return result}var pluck=map;function reduce(collection,callback,accumulator,thisArg){if(!collection)return accumulator;var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);var index=-1,length=collection.length;if(typeof length=="number"){if(noaccum){accumulator=collection[++index]}while(++index<length){accumulator=callback(accumulator,collection[index],index,collection)}}else{forOwn(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)})}return accumulator}function reduceRight(collection,callback,accumulator,thisArg){var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);forEachRight(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)});return accumulator}function reject(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);return filter(collection,function(value,index,collection){return!callback(value,index,collection)})}function sample(collection,n,guard){if(collection&&typeof collection.length!="number"){collection=values(collection)}if(n==null||guard){return collection?collection[baseRandom(0,collection.length-1)]:undefined}var result=shuffle(collection);result.length=nativeMin(nativeMax(0,n),result.length);return result}function shuffle(collection){var index=-1,length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){var rand=baseRandom(0,++index);result[index]=result[rand];result[rand]=value});return result}function size(collection){var length=collection?collection.length:0;return typeof length=="number"?length:keys(collection).length}function some(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(result=callback(collection[index],index,collection)){break}}}else{forOwn(collection,function(value,index,collection){return!(result=callback(value,index,collection))})}return!!result}function sortBy(collection,callback,thisArg){var index=-1,isArr=isArray(callback),length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);if(!isArr){callback=lodash.createCallback(callback,thisArg,3)}forEach(collection,function(value,key,collection){var object=result[++index]=getObject();if(isArr){object.criteria=map(callback,function(key){return value[key]})}else{(object.criteria=getArray())[0]=callback(value,key,collection)}object.index=index;object.value=value});length=result.length;result.sort(compareAscending);while(length--){var object=result[length];result[length]=object.value;if(!isArr){releaseArray(object.criteria)}releaseObject(object)}return result}function toArray(collection){if(collection&&typeof collection.length=="number"){return slice(collection)}return values(collection)}var where=filter;function compact(array){var index=-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value){result.push(value)}}return result}function difference(array){return baseDifference(array,baseFlatten(arguments,true,true,1))}function findIndex(array,callback,thisArg){var index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length){if(callback(array[index],index,array)){return index}}return-1}function findLastIndex(array,callback,thisArg){var length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(length--){if(callback(array[length],length,array)){return length}}return-1}function first(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=-1;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[0]:undefined}}return slice(array,0,nativeMin(nativeMax(0,n),length))}function flatten(array,isShallow,callback,thisArg){if(typeof isShallow!="boolean"&&isShallow!=null){thisArg=callback;callback=typeof isShallow!="function"&&thisArg&&thisArg[isShallow]===array?null:isShallow;isShallow=false}if(callback!=null){array=map(array,callback,thisArg)}return baseFlatten(array,isShallow)}function indexOf(array,value,fromIndex){if(typeof fromIndex=="number"){var length=array?array.length:0;fromIndex=fromIndex<0?nativeMax(0,length+fromIndex):fromIndex||0}else if(fromIndex){var index=sortedIndex(array,value);return array[index]===value?index:-1}return baseIndexOf(array,value,fromIndex)}function initial(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:callback||n}return slice(array,0,nativeMin(nativeMax(0,length-n),length))}function intersection(){var args=[],argsIndex=-1,argsLength=arguments.length,caches=getArray(),indexOf=getIndexOf(),trustIndexOf=indexOf===baseIndexOf,seen=getArray();while(++argsIndex<argsLength){var value=arguments[argsIndex];if(isArray(value)||isArguments(value)){args.push(value);caches.push(trustIndexOf&&value.length>=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index<length){var cache=caches[0];value=array[index];if((cache?cacheIndexOf(cache,value):indexOf(seen,value))<0){argsIndex=argsLength;(cache||seen).push(value);while(--argsIndex){cache=caches[argsIndex];if((cache?cacheIndexOf(cache,value):indexOf(args[argsIndex],value))<0){continue outer}}result.push(value)}}while(argsLength--){cache=caches[argsLength];if(cache){releaseObject(cache)}}releaseArray(caches);releaseArray(seen);return result}function last(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[length-1]:undefined}}return slice(array,nativeMax(0,length-n))}function lastIndexOf(array,value,fromIndex){var index=array?array.length:0;if(typeof fromIndex=="number"){index=(fromIndex<0?nativeMax(0,index+fromIndex):nativeMin(fromIndex,index-1))+1}while(index--){if(array[index]===value){return index}}return-1}function pull(array){var args=arguments,argsIndex=0,argsLength=args.length,length=array?array.length:0;while(++argsIndex<argsLength){var index=-1,value=args[argsIndex];while(++index<length){if(array[index]===value){splice.call(array,index--,1);length--}}}return array}function range(start,end,step){start=+start||0;step=typeof step=="number"?step:+step||1;if(end==null){end=start;start=0}var index=-1,length=nativeMax(0,ceil((end-start)/(step||1))),result=Array(length);while(++index<length){result[index]=start;start+=step}return result}function remove(array,callback,thisArg){var index=-1,length=array?array.length:0,result=[];callback=lodash.createCallback(callback,thisArg,3);while(++index<length){var value=array[index];if(callback(value,index,array)){result.push(value);splice.call(array,index--,1);length--}}return result}function rest(array,callback,thisArg){if(typeof callback!="number"&&callback!=null){var n=0,index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:nativeMax(0,callback)}return slice(array,n)}function sortedIndex(array,value,callback,thisArg){var low=0,high=array?array.length:low;callback=callback?lodash.createCallback(callback,thisArg,1):identity;value=callback(value);while(low<high){var mid=low+high>>>1;callback(array[mid])<value?low=mid+1:high=mid}return low}function union(){return baseUniq(baseFlatten(arguments,true,true))}function uniq(array,isSorted,callback,thisArg){if(typeof isSorted!="boolean"&&isSorted!=null){thisArg=callback;callback=typeof isSorted!="function"&&thisArg&&thisArg[isSorted]===array?null:isSorted;isSorted=false}if(callback!=null){callback=lodash.createCallback(callback,thisArg,3)}return baseUniq(array,isSorted,callback)}function without(array){return baseDifference(array,slice(arguments,1))}function xor(){var index=-1,length=arguments.length;while(++index<length){var array=arguments[index];if(isArray(array)||isArguments(array)){var result=result?baseUniq(baseDifference(result,array).concat(baseDifference(array,result))):array}}return result||[]}function zip(){var array=arguments.length>1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index<length){result[index]=pluck(array,index)}return result}function zipObject(keys,values){var index=-1,length=keys?keys.length:0,result={};if(!values&&length&&!isArray(keys[0])){values=[]}while(++index<length){var key=keys[index];if(values){result[key]=values[index]}else if(key){result[key[0]]=key[1]}}return result}function after(n,func){if(!isFunction(func)){throw new TypeError}return function(){if(--n<1){return func.apply(this,arguments)}}}function bind(func,thisArg){return arguments.length>2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index<length){var key=funcs[index];object[key]=createWrapper(object[key],1,null,null,object)}return object}function bindKey(object,key){return arguments.length>2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index<n){result[index]=callback(index)}return result}function unescape(string){return string==null?"":String(string).replace(reEscapedHtml,unescapeHtmlChar)}function uniqueId(prefix){var id=++idCounter;return String(prefix==null?"":prefix)+id}function chain(value){value=new lodashWrapper(value);value.__chain__=true;return value}function tap(value,interceptor){interceptor(value);return value}function wrapperChain(){this.__chain__=true;return this}function wrapperToString(){return String(this.__wrapped__)}function wrapperValueOf(){return this.__wrapped__}lodash.after=after;lodash.assign=assign;lodash.at=at;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.chain=chain;lodash.compact=compact;lodash.compose=compose;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.createCallback=createCallback;lodash.curry=curry;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.filter=filter;lodash.flatten=flatten;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.functions=functions;lodash.groupBy=groupBy;lodash.indexBy=indexBy;lodash.initial=initial;lodash.intersection=intersection;lodash.invert=invert;lodash.invoke=invoke;lodash.keys=keys;lodash.map=map;lodash.mapValues=mapValues;lodash.max=max;lodash.memoize=memoize;lodash.merge=merge;lodash.min=min;lodash.omit=omit;lodash.once=once;lodash.pairs=pairs;lodash.partial=partial;lodash.partialRight=partialRight;lodash.pick=pick;lodash.pluck=pluck;lodash.property=property;lodash.pull=pull;lodash.range=range;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.shuffle=shuffle;lodash.sortBy=sortBy;lodash.tap=tap;lodash.throttle=throttle;lodash.times=times;lodash.toArray=toArray;lodash.transform=transform;lodash.union=union;lodash.uniq=uniq;lodash.values=values;lodash.where=where;lodash.without=without;lodash.wrap=wrap;lodash.xor=xor;lodash.zip=zip;lodash.zipObject=zipObject;lodash.collect=map;lodash.drop=rest;lodash.each=forEach;lodash.eachRight=forEachRight;lodash.extend=assign;lodash.methods=functions;lodash.object=zipObject;lodash.select=filter;lodash.tail=rest;lodash.unique=uniq;lodash.unzip=zip;mixin(lodash);lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.contains=contains;lodash.escape=escape;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.has=has;lodash.identity=identity;lodash.indexOf=indexOf;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isBoolean=isBoolean;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isNaN=isNaN;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isString=isString;lodash.isUndefined=isUndefined;lodash.lastIndexOf=lastIndexOf;lodash.mixin=mixin;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.result=result;lodash.runInContext=runInContext;lodash.size=size;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.template=template;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.all=every;lodash.any=some;lodash.detect=find;lodash.findWhere=find;lodash.foldl=reduce;lodash.foldr=reduceRight;lodash.include=contains;lodash.inject=reduce;mixin(function(){var source={};forOwn(lodash,function(func,methodName){if(!lodash.prototype[methodName]){source[methodName]=func}});return source}(),false);lodash.first=first;lodash.last=last;lodash.sample=sample;lodash.take=first;lodash.head=first;forOwn(lodash,function(func,methodName){var callbackable=methodName!=="sample";if(!lodash.prototype[methodName]){lodash.prototype[methodName]=function(n,guard){var chainAll=this.__chain__,result=func(this.__wrapped__,n,guard);return!chainAll&&(n==null||guard&&!(callbackable&&typeof n=="function"))?result:new lodashWrapper(result,chainAll)}}});lodash.VERSION="2.4.1";lodash.prototype.chain=wrapperChain;lodash.prototype.toString=wrapperToString;lodash.prototype.value=wrapperValueOf;lodash.prototype.valueOf=wrapperValueOf;forEach(["join","pop","shift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){var chainAll=this.__chain__,result=func.apply(this.__wrapped__,arguments);return chainAll?new lodashWrapper(result,chainAll):result}});forEach(["push","reverse","sort","unshift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){func.apply(this.__wrapped__,arguments);return this}});forEach(["concat","slice","splice"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){return new lodashWrapper(func.apply(this.__wrapped__,arguments),this.__chain__)}});return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],30:[function(require,module,exports){"use strict";var typeOf=require("kind-of");var merge=require("lodash")._.merge;var Options=module.exports=function(options){this.options=options||{}};Options.prototype.option=function(key,value){var args=[].slice.call(arguments);if(args.length===1&&typeOf(key)==="string"){return this.options[key]}if(typeOf(key)==="object"){merge.apply(merge,[this.options].concat(args));return this}this.options[key]=value;return this};Options.prototype.enabled=function(key){return Boolean(this.options[key])};Options.prototype.disabled=function(key){return!Boolean(this.options[key])};Options.prototype.enable=function(key){return this.option(key,true)};Options.prototype.disable=function(key){return this.option(key,false)}},{"kind-of":28,lodash:29}],31:[function(require,module,exports){(function(process){"use strict";var fs=require("fs");var path=require("path");var util=require("util");var yaml=require("js-yaml");var typeOf=require("kind-of");var Options=require("option-cache");var relative=require("relative");var _=require("lodash");var Plasma=module.exports=function Plasma(data){Options.call(this);this.data=data||{};this._initPlasma()};util.inherits(Plasma,Options);Plasma.prototype._initPlasma=function(){this.enable("namespace")};Plasma.prototype.load=function(value,options){if(typeOf(options)==="function"){return options.call(this,value)}var opts=_.extend({},this.options,options);if(typeOf(value)==="object"){return this.merge(value)}if(Array.isArray(value)||typeof value==="string"){if(typeOf(value[0])==="object"){return this.mergeArray(value)}return this.glob(value,opts)}};Plasma.prototype.merge=function(obj){return _.merge(this.data,obj)};Plasma.prototype.mergeArray=function(arr){return arr.reduce(function(acc,val){return _.merge(acc,val)},this.data)};Plasma.prototype.glob=function(patterns,options){var glob=require("globby");var opts=_.merge({cwd:process.cwd()},this.options,options);var files=glob.sync(patterns,opts);if(!files||files.length===0){return patterns}return files.reduce(function(cache,fp){fp=relative(path.resolve(opts.cwd,fp));var key=name(fp,opts);var obj=read(fp,opts);if(key==="data"||opts.namespace===false){this.merge(obj)}else{cache[key]=obj}return cache}.bind(this),this.data)};function name(fp,options){var opts=options||{};if(typeof opts.namespace==="function"){return opts.namespace(fp,opts)}if(typeof opts.namespace===false){return fp}var ext=path.extname(fp);return path.basename(fp,ext)}function read(fp,opts){if(opts&&opts.read){return opts.read(fp,opts)}return readData(fp,opts)}function readData(fp,options){var opts=_.extend({},options);var ext=opts.lang||path.extname(fp);if(ext[0]!=="."){ext="."+ext}try{switch(ext){case".json":return require(path.resolve(fp));case".csv":var csv=require("parse-csv");opts.csv=opts.csv||{};opts.csv.format=opts.csv.format||"jsonDict";opts.csv.options=opts.csv.options||{headers:{included:true}};var str=fs.readFileSync(fp,"utf8");return JSON.parse(csv.to(opts.csv.format,str,opts.csv.options));case".yml":case".yaml":return yaml.safeLoad(fs.readFileSync(fp,"utf8"),opts)}}catch(err){}return{}}}).call(this,require("_process"))},{_process:7,fs:1,globby:32,"js-yaml":49,"kind-of":28,lodash:29,"option-cache":30,"parse-csv":80,path:6,relative:84,util:9}],32:[function(require,module,exports){"use strict"; | |
var union=require("array-union");var diff=require("array-differ");var async=require("async");var glob=require("glob");function arrayify(arr){return Array.isArray(arr)?arr:[arr]}module.exports=function(patterns,opts,cb){patterns=arrayify(patterns);if(patterns.length===0){cb(null,[]);return}if(typeof opts==="function"){cb=opts;opts={}}async.reduce(patterns,[],function(ret,pattern,next){var process=union;if(pattern[0]==="!"){pattern=pattern.slice(1);process=diff}glob(pattern,opts,function(err,paths){if(err){next(err);return}next(null,process(ret,paths))})},cb)};module.exports.sync=function(patterns,opts){patterns=arrayify(patterns);if(patterns.length===0){return[]}opts=opts||{};return patterns.reduce(function(ret,pattern){var process=union;if(pattern[0]==="!"){pattern=pattern.slice(1);process=diff}return process(ret,glob.sync(pattern,opts))},[])}},{"array-differ":33,"array-union":34,async:36,glob:38}],33:[function(require,module,exports){"use strict";module.exports=function(arr){var rest=[].concat.apply([],[].slice.call(arguments,1));return arr.filter(function(el){return rest.indexOf(el)===-1})}},{}],34:[function(require,module,exports){"use strict";var arrayUniq=require("array-uniq");module.exports=function(){return arrayUniq([].concat.apply([],arguments))}},{"array-uniq":35}],35:[function(require,module,exports){(function(global){"use strict";function uniqNoSet(arr){var ret=[];for(var i=0;i<arr.length;i++){if(ret.indexOf(arr[i])===-1){ret.push(arr[i])}}return ret}function uniqSet(arr){var seen=new Set;return arr.filter(function(el){if(!seen.has(el)){seen.add(el);return true}})}function uniqSetWithForEach(arr){var ret=[];new Set(arr).forEach(function(el){ret.push(el)});return ret}if("Set"in global){if(typeof Set.prototype.forEach==="function"){module.exports=uniqSetWithForEach}else{module.exports=uniqSet}}else{module.exports=uniqNoSet}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],36:[function(require,module,exports){(function(process){(function(){var async={};var root,previous_async;root=this;if(root!=null){previous_async=root.async}async.noConflict=function(){root.async=previous_async;return async};function only_once(fn){var called=false;return function(){if(called)throw new Error("Callback was already called.");called=true;fn.apply(root,arguments)}}var _toString=Object.prototype.toString;var _isArray=Array.isArray||function(obj){return _toString.call(obj)==="[object Array]"};var _each=function(arr,iterator){if(arr.forEach){return arr.forEach(iterator)}for(var i=0;i<arr.length;i+=1){iterator(arr[i],i,arr)}};var _map=function(arr,iterator){if(arr.map){return arr.map(iterator)}var results=[];_each(arr,function(x,i,a){results.push(iterator(x,i,a))});return results};var _reduce=function(arr,iterator,memo){if(arr.reduce){return arr.reduce(iterator,memo)}_each(arr,function(x,i,a){memo=iterator(memo,x,i,a)});return memo};var _keys=function(obj){if(Object.keys){return Object.keys(obj)}var keys=[];for(var k in obj){if(obj.hasOwnProperty(k)){keys.push(k)}}return keys};if(typeof process==="undefined"||!process.nextTick){if(typeof setImmediate==="function"){async.nextTick=function(fn){setImmediate(fn)};async.setImmediate=async.nextTick}else{async.nextTick=function(fn){setTimeout(fn,0)};async.setImmediate=async.nextTick}}else{async.nextTick=process.nextTick;if(typeof setImmediate!=="undefined"){async.setImmediate=function(fn){setImmediate(fn)}}else{async.setImmediate=async.nextTick}}async.each=function(arr,iterator,callback){callback=callback||function(){};if(!arr.length){return callback()}var completed=0;_each(arr,function(x){iterator(x,only_once(done))});function done(err){if(err){callback(err);callback=function(){}}else{completed+=1;if(completed>=arr.length){callback()}}}};async.forEach=async.each;async.eachSeries=function(arr,iterator,callback){callback=callback||function(){};if(!arr.length){return callback()}var completed=0;var iterate=function(){iterator(arr[completed],function(err){if(err){callback(err);callback=function(){}}else{completed+=1;if(completed>=arr.length){callback()}else{iterate()}}})};iterate()};async.forEachSeries=async.eachSeries;async.eachLimit=function(arr,limit,iterator,callback){var fn=_eachLimit(limit);fn.apply(null,[arr,iterator,callback])};async.forEachLimit=async.eachLimit;var _eachLimit=function(limit){return function(arr,iterator,callback){callback=callback||function(){};if(!arr.length||limit<=0){return callback()}var completed=0;var started=0;var running=0;(function replenish(){if(completed>=arr.length){return callback()}while(running<limit&&started<arr.length){started+=1;running+=1;iterator(arr[started-1],function(err){if(err){callback(err);callback=function(){}}else{completed+=1;running-=1;if(completed>=arr.length){callback()}else{replenish()}}})}})()}};var doParallel=function(fn){return function(){var args=Array.prototype.slice.call(arguments);return fn.apply(null,[async.each].concat(args))}};var doParallelLimit=function(limit,fn){return function(){var args=Array.prototype.slice.call(arguments);return fn.apply(null,[_eachLimit(limit)].concat(args))}};var doSeries=function(fn){return function(){var args=Array.prototype.slice.call(arguments);return fn.apply(null,[async.eachSeries].concat(args))}};var _asyncMap=function(eachfn,arr,iterator,callback){arr=_map(arr,function(x,i){return{index:i,value:x}});if(!callback){eachfn(arr,function(x,callback){iterator(x.value,function(err){callback(err)})})}else{var results=[];eachfn(arr,function(x,callback){iterator(x.value,function(err,v){results[x.index]=v;callback(err)})},function(err){callback(err,results)})}};async.map=doParallel(_asyncMap);async.mapSeries=doSeries(_asyncMap);async.mapLimit=function(arr,limit,iterator,callback){return _mapLimit(limit)(arr,iterator,callback)};var _mapLimit=function(limit){return doParallelLimit(limit,_asyncMap)};async.reduce=function(arr,memo,iterator,callback){async.eachSeries(arr,function(x,callback){iterator(memo,x,function(err,v){memo=v;callback(err)})},function(err){callback(err,memo)})};async.inject=async.reduce;async.foldl=async.reduce;async.reduceRight=function(arr,memo,iterator,callback){var reversed=_map(arr,function(x){return x}).reverse();async.reduce(reversed,memo,iterator,callback)};async.foldr=async.reduceRight;var _filter=function(eachfn,arr,iterator,callback){var results=[];arr=_map(arr,function(x,i){return{index:i,value:x}});eachfn(arr,function(x,callback){iterator(x.value,function(v){if(v){results.push(x)}callback()})},function(err){callback(_map(results.sort(function(a,b){return a.index-b.index}),function(x){return x.value}))})};async.filter=doParallel(_filter);async.filterSeries=doSeries(_filter);async.select=async.filter;async.selectSeries=async.filterSeries;var _reject=function(eachfn,arr,iterator,callback){var results=[];arr=_map(arr,function(x,i){return{index:i,value:x}});eachfn(arr,function(x,callback){iterator(x.value,function(v){if(!v){results.push(x)}callback()})},function(err){callback(_map(results.sort(function(a,b){return a.index-b.index}),function(x){return x.value}))})};async.reject=doParallel(_reject);async.rejectSeries=doSeries(_reject);var _detect=function(eachfn,arr,iterator,main_callback){eachfn(arr,function(x,callback){iterator(x,function(result){if(result){main_callback(x);main_callback=function(){}}else{callback()}})},function(err){main_callback()})};async.detect=doParallel(_detect);async.detectSeries=doSeries(_detect);async.some=function(arr,iterator,main_callback){async.each(arr,function(x,callback){iterator(x,function(v){if(v){main_callback(true);main_callback=function(){}}callback()})},function(err){main_callback(false)})};async.any=async.some;async.every=function(arr,iterator,main_callback){async.each(arr,function(x,callback){iterator(x,function(v){if(!v){main_callback(false);main_callback=function(){}}callback()})},function(err){main_callback(true)})};async.all=async.every;async.sortBy=function(arr,iterator,callback){async.map(arr,function(x,callback){iterator(x,function(err,criteria){if(err){callback(err)}else{callback(null,{value:x,criteria:criteria})}})},function(err,results){if(err){return callback(err)}else{var fn=function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0};callback(null,_map(results.sort(fn),function(x){return x.value}))}})};async.auto=function(tasks,callback){callback=callback||function(){};var keys=_keys(tasks);var remainingTasks=keys.length;if(!remainingTasks){return callback()}var results={};var listeners=[];var addListener=function(fn){listeners.unshift(fn)};var removeListener=function(fn){for(var i=0;i<listeners.length;i+=1){if(listeners[i]===fn){listeners.splice(i,1);return}}};var taskComplete=function(){remainingTasks--;_each(listeners.slice(0),function(fn){fn()})};addListener(function(){if(!remainingTasks){var theCallback=callback;callback=function(){};theCallback(null,results)}});_each(keys,function(k){var task=_isArray(tasks[k])?tasks[k]:[tasks[k]];var taskCallback=function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}if(err){var safeResults={};_each(_keys(results),function(rkey){safeResults[rkey]=results[rkey]});safeResults[k]=args;callback(err,safeResults);callback=function(){}}else{results[k]=args;async.setImmediate(taskComplete)}};var requires=task.slice(0,Math.abs(task.length-1))||[];var ready=function(){return _reduce(requires,function(a,x){return a&&results.hasOwnProperty(x)},true)&&!results.hasOwnProperty(k)};if(ready()){task[task.length-1](taskCallback,results)}else{var listener=function(){if(ready()){removeListener(listener);task[task.length-1](taskCallback,results)}};addListener(listener)}})};async.retry=function(times,task,callback){var DEFAULT_TIMES=5;var attempts=[];if(typeof times==="function"){callback=task;task=times;times=DEFAULT_TIMES}times=parseInt(times,10)||DEFAULT_TIMES;var wrappedTask=function(wrappedCallback,wrappedResults){var retryAttempt=function(task,finalAttempt){return function(seriesCallback){task(function(err,result){seriesCallback(!err||finalAttempt,{err:err,result:result})},wrappedResults)}};while(times){attempts.push(retryAttempt(task,!(times-=1)))}async.series(attempts,function(done,data){data=data[data.length-1];(wrappedCallback||callback)(data.err,data.result)})};return callback?wrappedTask():wrappedTask};async.waterfall=function(tasks,callback){callback=callback||function(){};if(!_isArray(tasks)){var err=new Error("First argument to waterfall must be an array of functions");return callback(err)}if(!tasks.length){return callback()}var wrapIterator=function(iterator){return function(err){if(err){callback.apply(null,arguments);callback=function(){}}else{var args=Array.prototype.slice.call(arguments,1);var next=iterator.next();if(next){args.push(wrapIterator(next))}else{args.push(callback)}async.setImmediate(function(){iterator.apply(null,args)})}}};wrapIterator(async.iterator(tasks))()};var _parallel=function(eachfn,tasks,callback){callback=callback||function(){};if(_isArray(tasks)){eachfn.map(tasks,function(fn,callback){if(fn){fn(function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}callback.call(null,err,args)})}},callback)}else{var results={};eachfn.each(_keys(tasks),function(k,callback){tasks[k](function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}results[k]=args;callback(err)})},function(err){callback(err,results)})}};async.parallel=function(tasks,callback){_parallel({map:async.map,each:async.each},tasks,callback)};async.parallelLimit=function(tasks,limit,callback){_parallel({map:_mapLimit(limit),each:_eachLimit(limit)},tasks,callback)};async.series=function(tasks,callback){callback=callback||function(){};if(_isArray(tasks)){async.mapSeries(tasks,function(fn,callback){if(fn){fn(function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}callback.call(null,err,args)})}},callback)}else{var results={};async.eachSeries(_keys(tasks),function(k,callback){tasks[k](function(err){var args=Array.prototype.slice.call(arguments,1);if(args.length<=1){args=args[0]}results[k]=args;callback(err)})},function(err){callback(err,results)})}};async.iterator=function(tasks){var makeCallback=function(index){var fn=function(){if(tasks.length){tasks[index].apply(null,arguments)}return fn.next()};fn.next=function(){return index<tasks.length-1?makeCallback(index+1):null};return fn};return makeCallback(0)};async.apply=function(fn){var args=Array.prototype.slice.call(arguments,1);return function(){return fn.apply(null,args.concat(Array.prototype.slice.call(arguments)))}};var _concat=function(eachfn,arr,fn,callback){var r=[];eachfn(arr,function(x,cb){fn(x,function(err,y){r=r.concat(y||[]);cb(err)})},function(err){callback(err,r)})};async.concat=doParallel(_concat);async.concatSeries=doSeries(_concat);async.whilst=function(test,iterator,callback){if(test()){iterator(function(err){if(err){return callback(err)}async.whilst(test,iterator,callback)})}else{callback()}};async.doWhilst=function(iterator,test,callback){iterator(function(err){if(err){return callback(err)}var args=Array.prototype.slice.call(arguments,1);if(test.apply(null,args)){async.doWhilst(iterator,test,callback)}else{callback()}})};async.until=function(test,iterator,callback){if(!test()){iterator(function(err){if(err){return callback(err)}async.until(test,iterator,callback)})}else{callback()}};async.doUntil=function(iterator,test,callback){iterator(function(err){if(err){return callback(err)}var args=Array.prototype.slice.call(arguments,1);if(!test.apply(null,args)){async.doUntil(iterator,test,callback)}else{callback()}})};async.queue=function(worker,concurrency){if(concurrency===undefined){concurrency=1}function _insert(q,data,pos,callback){if(!q.started){q.started=true}if(!_isArray(data)){data=[data]}if(data.length==0){return async.setImmediate(function(){if(q.drain){q.drain()}})}_each(data,function(task){var item={data:task,callback:typeof callback==="function"?callback:null};if(pos){q.tasks.unshift(item)}else{q.tasks.push(item)}if(q.saturated&&q.tasks.length===q.concurrency){q.saturated()}async.setImmediate(q.process)})}var workers=0;var q={tasks:[],concurrency:concurrency,saturated:null,empty:null,drain:null,started:false,paused:false,push:function(data,callback){_insert(q,data,false,callback)},kill:function(){q.drain=null;q.tasks=[]},unshift:function(data,callback){_insert(q,data,true,callback)},process:function(){if(!q.paused&&workers<q.concurrency&&q.tasks.length){var task=q.tasks.shift();if(q.empty&&q.tasks.length===0){q.empty()}workers+=1;var next=function(){workers-=1;if(task.callback){task.callback.apply(task,arguments)}if(q.drain&&q.tasks.length+workers===0){q.drain()}q.process()};var cb=only_once(next);worker(task.data,cb)}},length:function(){return q.tasks.length},running:function(){return workers},idle:function(){return q.tasks.length+workers===0},pause:function(){if(q.paused===true){return}q.paused=true;q.process()},resume:function(){if(q.paused===false){return}q.paused=false;q.process()}};return q};async.priorityQueue=function(worker,concurrency){function _compareTasks(a,b){return a.priority-b.priority}function _binarySearch(sequence,item,compare){var beg=-1,end=sequence.length-1;while(beg<end){var mid=beg+(end-beg+1>>>1);if(compare(item,sequence[mid])>=0){beg=mid}else{end=mid-1}}return beg}function _insert(q,data,priority,callback){if(!q.started){q.started=true}if(!_isArray(data)){data=[data]}if(data.length==0){return async.setImmediate(function(){if(q.drain){q.drain()}})}_each(data,function(task){var item={data:task,priority:priority,callback:typeof callback==="function"?callback:null};q.tasks.splice(_binarySearch(q.tasks,item,_compareTasks)+1,0,item);if(q.saturated&&q.tasks.length===q.concurrency){q.saturated()}async.setImmediate(q.process)})}var q=async.queue(worker,concurrency);q.push=function(data,priority,callback){_insert(q,data,priority,callback)};delete q.unshift;return q};async.cargo=function(worker,payload){var working=false,tasks=[];var cargo={tasks:tasks,payload:payload,saturated:null,empty:null,drain:null,drained:true,push:function(data,callback){if(!_isArray(data)){data=[data]}_each(data,function(task){tasks.push({data:task,callback:typeof callback==="function"?callback:null});cargo.drained=false;if(cargo.saturated&&tasks.length===payload){cargo.saturated()}});async.setImmediate(cargo.process)},process:function process(){if(working)return;if(tasks.length===0){if(cargo.drain&&!cargo.drained)cargo.drain();cargo.drained=true;return}var ts=typeof payload==="number"?tasks.splice(0,payload):tasks.splice(0,tasks.length);var ds=_map(ts,function(task){return task.data});if(cargo.empty)cargo.empty();working=true;worker(ds,function(){working=false;var args=arguments;_each(ts,function(data){if(data.callback){data.callback.apply(null,args)}});process()})},length:function(){return tasks.length},running:function(){return working}};return cargo};var _console_fn=function(name){return function(fn){var args=Array.prototype.slice.call(arguments,1);fn.apply(null,args.concat([function(err){var args=Array.prototype.slice.call(arguments,1);if(typeof console!=="undefined"){if(err){if(console.error){console.error(err)}}else if(console[name]){_each(args,function(x){console[name](x)})}}}]))}};async.log=_console_fn("log");async.dir=_console_fn("dir");async.memoize=function(fn,hasher){var memo={};var queues={};hasher=hasher||function(x){return x};var memoized=function(){var args=Array.prototype.slice.call(arguments);var callback=args.pop();var key=hasher.apply(null,args);if(key in memo){async.nextTick(function(){callback.apply(null,memo[key])})}else if(key in queues){queues[key].push(callback)}else{queues[key]=[callback];fn.apply(null,args.concat([function(){memo[key]=arguments;var q=queues[key];delete queues[key];for(var i=0,l=q.length;i<l;i++){q[i].apply(null,arguments)}}]))}};memoized.memo=memo;memoized.unmemoized=fn;return memoized};async.unmemoize=function(fn){return function(){return(fn.unmemoized||fn).apply(null,arguments)}};async.times=function(count,iterator,callback){var counter=[];for(var i=0;i<count;i++){counter.push(i)}return async.map(counter,iterator,callback)};async.timesSeries=function(count,iterator,callback){var counter=[];for(var i=0;i<count;i++){counter.push(i)}return async.mapSeries(counter,iterator,callback)};async.seq=function(){var fns=arguments;return function(){var that=this;var args=Array.prototype.slice.call(arguments);var callback=args.pop();async.reduce(fns,args,function(newargs,fn,cb){fn.apply(that,newargs.concat([function(){var err=arguments[0];var nextargs=Array.prototype.slice.call(arguments,1);cb(err,nextargs)}]))},function(err,results){callback.apply(that,[err].concat(results))})}};async.compose=function(){return async.seq.apply(null,Array.prototype.reverse.call(arguments))};var _applyEach=function(eachfn,fns){var go=function(){var that=this;var args=Array.prototype.slice.call(arguments);var callback=args.pop();return eachfn(fns,function(fn,cb){fn.apply(that,args.concat([cb]))},callback)};if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);return go.apply(this,args)}else{return go}};async.applyEach=doParallel(_applyEach);async.applyEachSeries=doSeries(_applyEach);async.forever=function(fn,callback){function next(err){if(err){if(callback){return callback(err)}throw err}fn(next)}next()};if(typeof module!=="undefined"&&module.exports){module.exports=async}else if(typeof define!=="undefined"&&define.amd){define([],function(){return async})}else{root.async=async}})()}).call(this,require("_process"))},{_process:7}],37:[function(require,module,exports){(function(process){exports.alphasort=alphasort;exports.alphasorti=alphasorti;exports.isAbsolute=process.platform==="win32"?absWin:absUnix;exports.setopts=setopts;exports.ownProp=ownProp;exports.makeAbs=makeAbs;exports.finish=finish;exports.mark=mark;function ownProp(obj,field){return Object.prototype.hasOwnProperty.call(obj,field)}var path=require("path");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;function absWin(p){if(absUnix(p))return true;var splitDeviceRe=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var result=splitDeviceRe.exec(p);var device=result[1]||"";var isUnc=device&&device.charAt(1)!==":";var isAbsolute=!!result[2]||isUnc;return isAbsolute}function absUnix(p){return p.charAt(0)==="/"||p===""}function alphasorti(a,b){return a.toLowerCase().localeCompare(b.toLowerCase())}function alphasort(a,b){return a.localeCompare(b)}function setopts(self,pattern,options){if(!options)options={};if(options.matchBase&&-1===pattern.indexOf("/")){if(options.noglobstar){throw new Error("base matching requires globstar")}pattern="**/"+pattern}self.pattern=pattern;self.strict=options.strict!==false;self.dot=!!options.dot;self.mark=!!options.mark;self.nodir=!!options.nodir;if(self.nodir)self.mark=true;self.sync=!!options.sync;self.nounique=!!options.nounique;self.nonull=!!options.nonull;self.nosort=!!options.nosort;self.nocase=!!options.nocase;self.stat=!!options.stat;self.noprocess=!!options.noprocess;self.maxLength=options.maxLength||Infinity;self.cache=options.cache||Object.create(null);self.statCache=options.statCache||Object.create(null);self.symlinks=options.symlinks||Object.create(null);self.changedCwd=false;var cwd=process.cwd();if(!ownProp(options,"cwd"))self.cwd=cwd;else{self.cwd=options.cwd;self.changedCwd=path.resolve(options.cwd)!==cwd}self.root=options.root||path.resolve(self.cwd,"/");self.root=path.resolve(self.root);if(process.platform==="win32")self.root=self.root.replace(/\\/g,"/");self.nomount=!!options.nomount;self.minimatch=new Minimatch(pattern,options);self.options=self.minimatch.options}function finish(self){var nou=self.nounique;var all=nou?[]:Object.create(null);for(var i=0,l=self.matches.length;i<l;i++){var matches=self.matches[i];if(!matches){if(self.nonull){var literal=self.minimatch.globSet[i];if(nou)all.push(literal);else all[literal]=true}}else{var m=Object.keys(matches);if(nou)all.push.apply(all,m);else m.forEach(function(m){all[m]=true})}}if(!nou)all=Object.keys(all);if(!self.nosort)all=all.sort(self.nocase?alphasorti:alphasort);if(self.mark){for(var i=0;i<all.length;i++){all[i]=self._mark(all[i])}if(self.nodir){all=all.filter(function(e){return!/\/$/.test(e)})}}self.found=all}function mark(self,p){var c=self.cache[p];var m=p;if(c){var isDir=c==="DIR"||Array.isArray(c);var slash=p.slice(-1)==="/";if(isDir&&!slash)m+="/";else if(!isDir&&slash)m=m.slice(0,-1);if(m!==p){self.statCache[m]=self.statCache[p];self.cache[m]=self.cache[p]}}return m}function makeAbs(self,f){var abs=f;if(f.charAt(0)==="/"){abs=path.join(self.root,f)}else if(exports.isAbsolute(f)){abs=f}else if(self.changedCwd){abs=path.resolve(self.cwd,f)}return abs}}).call(this,require("_process"))},{_process:7,minimatch:42,path:6}],38:[function(require,module,exports){(function(process){module.exports=glob;var fs=require("fs");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;var inherits=require("inherits");var EE=require("events").EventEmitter;var path=require("path");var assert=require("assert");var globSync=require("./sync.js");var common=require("./common.js");var alphasort=common.alphasort;var alphasorti=common.alphasorti;var isAbsolute=common.isAbsolute;var setopts=common.setopts;var ownProp=common.ownProp;var inflight=require("inflight");var util=require("util");var once=require("once");function glob(pattern,options,cb){if(typeof options==="function")cb=options,options={};if(!options)options={};if(options.sync){if(cb)throw new TypeError("callback provided to sync glob");return globSync(pattern,options)}return new Glob(pattern,options,cb)}glob.sync=globSync;var GlobSync=glob.GlobSync=globSync.GlobSync;glob.glob=glob;glob.hasMagic=function(pattern,options_){var options=util._extend({},options_);options.noprocess=true;var g=new Glob(pattern,options);var set=g.minimatch.set;if(set.length>1)return true;for(var j=0;j<set[0].length;j++){if(typeof set[0][j]!=="string")return true}return false};glob.Glob=Glob;inherits(Glob,EE);function Glob(pattern,options,cb){if(typeof options==="function"){cb=options;options=null}if(options&&options.sync){if(cb)throw new TypeError("callback provided to sync glob");return new GlobSync(pattern,options)}if(!(this instanceof Glob))return new Glob(pattern,options,cb);setopts(this,pattern,options);var n=this.minimatch.set.length;this.matches=new Array(n);if(typeof cb==="function"){cb=once(cb);this.on("error",cb);this.on("end",function(matches){cb(null,matches)})}var self=this;var n=this.minimatch.set.length;this._processing=0;this.matches=new Array(n);this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(n===0)return done();for(var i=0;i<n;i++){this._process(this.minimatch.set[i],i,false,done)}function done(){--self._processing;if(self._processing<=0)self._finish()}}Glob.prototype._finish=function(){assert(this instanceof Glob);if(this.aborted)return;common.finish(this);this.emit("end",this.found)};Glob.prototype._mark=function(p){return common.mark(this,p)};Glob.prototype._makeAbs=function(f){return common.makeAbs(this,f)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var eq=this._emitQueue.slice(0);this._emitQueue.length=0;for(var i=0;i<eq.length;i++){var e=eq[i];this._emitMatch(e[0],e[1])}}if(this._processQueue.length){var pq=this._processQueue.slice(0);this._processQueue.length=0;for(var i=0;i<pq.length;i++){var p=pq[i];this._processing--;this._process(p[0],p[1],p[2],p[3])}}}};Glob.prototype._process=function(pattern,index,inGlobStar,cb){assert(this instanceof Glob);assert(typeof cb==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([pattern,index,inGlobStar,cb]);return}var n=0;while(typeof pattern[n]==="string"){n++}var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index,cb);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n);var read;if(prefix===null)read=".";else if(isAbsolute(prefix)||isAbsolute(pattern.join("/"))){if(!prefix||!isAbsolute(prefix))prefix="/"+prefix;read=prefix}else read=prefix;var abs=this._makeAbs(read);var isGlobStar=remain[0]===minimatch.GLOBSTAR;if(isGlobStar)this._processGlobStar(prefix,read,abs,remain,index,inGlobStar,cb);else this._processReaddir(prefix,read,abs,remain,index,inGlobStar,cb)};Glob.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar,cb){var self=this;this._readdir(abs,inGlobStar,function(er,entries){return self._processReaddir2(prefix,read,abs,remain,index,inGlobStar,entries,cb)})};Glob.prototype._processReaddir2=function(prefix,read,abs,remain,index,inGlobStar,entries,cb){if(!entries)return cb();var pn=remain[0];var negate=!!this.minimatch.negate;var rawGlob=pn._glob;var dotOk=this.dot||rawGlob.charAt(0)===".";var matchedEntries=[];for(var i=0;i<entries.length;i++){var e=entries[i];if(e.charAt(0)!=="."||dotOk){var m;if(negate&&!prefix){m=!e.match(pn)}else{m=e.match(pn)}if(m)matchedEntries.push(e)}}var len=matchedEntries.length;if(len===0)return cb();if(remain.length===1&&!this.mark&&!this.stat){if(!this.matches[index])this.matches[index]=Object.create(null);for(var i=0;i<len;i++){var e=matchedEntries[i];if(prefix){if(prefix!=="/")e=prefix+"/"+e;else e=prefix+e}if(e.charAt(0)==="/"&&!this.nomount){e=path.join(this.root,e)}this._emitMatch(index,e)}return cb()}remain.shift();for(var i=0;i<len;i++){var e=matchedEntries[i];var newPattern;if(prefix){if(prefix!=="/")e=prefix+"/"+e;else e=prefix+e}this._process([e].concat(remain),index,inGlobStar,cb)}cb()};Glob.prototype._emitMatch=function(index,e){if(this.aborted)return;if(!this.matches[index][e]){if(this.paused){this._emitQueue.push([index,e]);return}if(this.nodir){var c=this.cache[this._makeAbs(e)];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e]=true;if(!this.stat&&!this.mark)return this.emit("match",e);var self=this;this._stat(this._makeAbs(e),function(er,c,st){self.emit("stat",e,st);self.emit("match",e)})}};Glob.prototype._readdirInGlobStar=function(abs,cb){if(this.aborted)return;var lstatkey="lstat\x00"+abs;var self=this;var lstatcb=inflight(lstatkey,lstatcb_);if(lstatcb)fs.lstat(abs,lstatcb);function lstatcb_(er,lstat){if(er)return cb();var isSym=lstat.isSymbolicLink();self.symlinks[abs]=isSym;if(!isSym&&!lstat.isDirectory()){self.cache[abs]="FILE";cb()}else self._readdir(abs,false,cb)}};Glob.prototype._readdir=function(abs,inGlobStar,cb){if(this.aborted)return;cb=inflight("readdir\x00"+abs+"\x00"+inGlobStar,cb);if(!cb)return;if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs,cb);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return cb();if(Array.isArray(c))return cb(null,c)}var self=this;fs.readdir(abs,readdirCb(this,abs,cb))};function readdirCb(self,abs,cb){return function(er,entries){if(er)self._readdirError(abs,er,cb);else self._readdirEntries(abs,entries,cb)}}Glob.prototype._readdirEntries=function(abs,entries,cb){if(this.aborted)return;if(!this.mark&&!this.stat){for(var i=0;i<entries.length;i++){var e=entries[i];if(abs==="/")e=abs+e;else e=abs+"/"+e;this.cache[e]=true}}this.cache[abs]=entries;return cb(null,entries)};Glob.prototype._readdirError=function(f,er,cb){if(this.aborted)return;switch(er.code){case"ENOTDIR":this.cache[f]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[f]=false;break;default:this.cache[f]=false;if(this.strict)return this.emit("error",er);if(!this.silent)console.error("glob error",er);break}return cb()};Glob.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar,cb){var self=this;this._readdir(abs,inGlobStar,function(er,entries){self._processGlobStar2(prefix,read,abs,remain,index,inGlobStar,entries,cb)})};Glob.prototype._processGlobStar2=function(prefix,read,abs,remain,index,inGlobStar,entries,cb){if(!entries)return cb();var remainWithoutGlobStar=remain.slice(1);var gspref=prefix?[prefix]:[];var noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,false,cb);var isSym=this.symlinks[abs];var len=entries.length;if(isSym&&inGlobStar)return cb();for(var i=0;i<len;i++){var e=entries[i];if(e.charAt(0)==="."&&!this.dot)continue;var instead=gspref.concat(entries[i],remainWithoutGlobStar);this._process(instead,index,true,cb);var below=gspref.concat(entries[i],remain);this._process(below,index,true,cb)}cb()};Glob.prototype._processSimple=function(prefix,index,cb){var self=this;this._stat(prefix,function(er,exists){self._processSimple2(prefix,index,er,exists,cb)})};Glob.prototype._processSimple2=function(prefix,index,er,exists,cb){if(!this.matches[index])this.matches[index]=Object.create(null);if(!exists)return cb();if(prefix&&isAbsolute(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);if(prefix.charAt(0)==="/"){prefix=path.join(this.root,prefix)}else{prefix=path.resolve(this.root,prefix);if(trail)prefix+="/"}}if(process.platform==="win32")prefix=prefix.replace(/\\/g,"/");this._emitMatch(index,prefix);cb()};Glob.prototype._stat=function(f,cb){var abs=f;if(f.charAt(0)==="/")abs=path.join(this.root,f);else if(this.changedCwd)abs=path.resolve(this.cwd,f);if(f.length>this.maxLength)return cb();if(!this.stat&&ownProp(this.cache,f)){var c=this.cache[f];if(Array.isArray(c))c="DIR";if(abs.slice(-1)==="/"&&c!=="DIR")return cb();return cb(null,c)}var exists;var stat=this.statCache[abs];if(stat!==undefined){if(stat===false)return cb(null,stat);else return cb(null,stat.isDirectory()?"DIR":"FILE",stat)}var self=this;var statcb=inflight("stat\x00"+abs,statcb_);if(statcb)fs.stat(abs,statcb);function statcb_(er,stat){self._stat2(f,abs,er,stat,cb)}};Glob.prototype._stat2=function(f,abs,er,stat,cb){if(er){this.statCache[abs]=false; | |
return cb()}this.statCache[abs]=stat;if(abs.slice(-1)==="/"&&!stat.isDirectory())return cb(null,false,stat);var c=stat.isDirectory()?"DIR":"FILE";this.cache[f]=this.cache[f]||c;return cb(null,c,stat)}}).call(this,require("_process"))},{"./common.js":37,"./sync.js":48,_process:7,assert:2,events:4,fs:1,inflight:39,inherits:41,minimatch:42,once:47,path:6,util:9}],39:[function(require,module,exports){(function(process){var wrappy=require("wrappy");var reqs=Object.create(null);var once=require("once");module.exports=wrappy(inflight);function inflight(key,cb){if(reqs[key]){reqs[key].push(cb);return null}else{reqs[key]=[cb];return makeres(key)}}function makeres(key){return once(function RES(){var cbs=reqs[key];var len=cbs.length;var args=slice(arguments);for(var i=0;i<len;i++){cbs[i].apply(null,args)}if(cbs.length>len){cbs.splice(0,len);process.nextTick(function(){RES.apply(null,args)})}else{delete reqs[key]}})}function slice(args){var length=args.length;var array=[];for(var i=0;i<length;i++)array[i]=args[i];return array}}).call(this,require("_process"))},{_process:7,once:47,wrappy:40}],40:[function(require,module,exports){module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=="function")throw new TypeError("need wrapper function");Object.keys(fn).forEach(function(k){wrapper[k]=fn[k]});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i]}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==="function"&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k]})}return ret}}},{}],41:[function(require,module,exports){arguments[4][5][0].apply(exports,arguments)},{dup:5}],42:[function(require,module,exports){(function(process){module.exports=minimatch;minimatch.Minimatch=Minimatch;var isWindows=false;if(typeof process!=="undefined"&&process.platform==="win32")isWindows=true;var GLOBSTAR=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={},expand=require("brace-expansion"),qmark="[^/]",star=qmark+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",reSpecials=charSet("().*{}+?[]^$\\!");function charSet(s){return s.split("").reduce(function(set,c){set[c]=true;return set},{})}var slashSplit=/\/+/;minimatch.filter=filter;function filter(pattern,options){options=options||{};return function(p,i,list){return minimatch(p,pattern,options)}}function ext(a,b){a=a||{};b=b||{};var t={};Object.keys(b).forEach(function(k){t[k]=b[k]});Object.keys(a).forEach(function(k){t[k]=a[k]});return t}minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return minimatch;var orig=minimatch;var m=function minimatch(p,pattern,options){return orig.minimatch(p,pattern,ext(def,options))};m.Minimatch=function Minimatch(pattern,options){return new orig.Minimatch(pattern,ext(def,options))};return m};Minimatch.defaults=function(def){if(!def||!Object.keys(def).length)return Minimatch;return minimatch.defaults(def).Minimatch};function minimatch(p,pattern,options){if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};if(!options.nocomment&&pattern.charAt(0)==="#"){return false}if(pattern.trim()==="")return p==="";return new Minimatch(pattern,options).match(p)}function Minimatch(pattern,options){if(!(this instanceof Minimatch)){return new Minimatch(pattern,options)}if(typeof pattern!=="string"){throw new TypeError("glob pattern string required")}if(!options)options={};pattern=pattern.trim();if(isWindows)pattern=pattern.split("\\").join("/");this.options=options;this.set=[];this.pattern=pattern;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){if(this._made)return;var pattern=this.pattern;var options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=true;return}if(!pattern){this.empty=true;return}this.parseNegate();var set=this.globSet=this.braceExpand();if(options.debug)this.debug=console.error;this.debug(this.pattern,set);set=this.globParts=set.map(function(s){return s.split(slashSplit)});this.debug(this.pattern,set);set=set.map(function(s,si,set){return s.map(this.parse,this)},this);this.debug(this.pattern,set);set=set.filter(function(s){return-1===s.indexOf(false)});this.debug(this.pattern,set);this.set=set}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var pattern=this.pattern,negate=false,options=this.options,negateOffset=0;if(options.nonegate)return;for(var i=0,l=pattern.length;i<l&&pattern.charAt(i)==="!";i++){negate=!negate;negateOffset++}if(negateOffset)this.pattern=pattern.substr(negateOffset);this.negate=negate}minimatch.braceExpand=function(pattern,options){return braceExpand(pattern,options)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(pattern,options){if(!options){if(this instanceof Minimatch)options=this.options;else options={}}pattern=typeof pattern==="undefined"?this.pattern:pattern;if(typeof pattern==="undefined"){throw new Error("undefined pattern")}if(options.nobrace||!pattern.match(/\{.*\}/)){return[pattern]}return expand(pattern)}Minimatch.prototype.parse=parse;var SUBPARSE={};function parse(pattern,isSub){var options=this.options;if(!options.noglobstar&&pattern==="**")return GLOBSTAR;if(pattern==="")return"";var re="",hasMagic=!!options.nocase,escaping=false,patternListStack=[],plType,stateChar,inClass=false,reClassStart=-1,classStart=-1,patternStart=pattern.charAt(0)==="."?"":options.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",self=this;function clearStateChar(){if(stateChar){switch(stateChar){case"*":re+=star;hasMagic=true;break;case"?":re+=qmark;hasMagic=true;break;default:re+="\\"+stateChar;break}self.debug("clearStateChar %j %j",stateChar,re);stateChar=false}}for(var i=0,len=pattern.length,c;i<len&&(c=pattern.charAt(i));i++){this.debug("%s %s %s %j",pattern,i,re,c);if(escaping&&reSpecials[c]){re+="\\"+c;escaping=false;continue}SWITCH:switch(c){case"/":return false;case"\\":clearStateChar();escaping=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",pattern,i,re,c);if(inClass){this.debug(" in class");if(c==="!"&&i===classStart+1)c="^";re+=c;continue}self.debug("call clearStateChar %j",stateChar);clearStateChar();stateChar=c;if(options.noext)clearStateChar();continue;case"(":if(inClass){re+="(";continue}if(!stateChar){re+="\\(";continue}plType=stateChar;patternListStack.push({type:plType,start:i-1,reStart:re.length});re+=stateChar==="!"?"(?:(?!":"(?:";this.debug("plType %j %j",stateChar,re);stateChar=false;continue;case")":if(inClass||!patternListStack.length){re+="\\)";continue}clearStateChar();hasMagic=true;re+=")";plType=patternListStack.pop().type;switch(plType){case"!":re+="[^/]*?)";break;case"?":case"+":case"*":re+=plType;case"@":break}continue;case"|":if(inClass||!patternListStack.length||escaping){re+="\\|";escaping=false;continue}clearStateChar();re+="|";continue;case"[":clearStateChar();if(inClass){re+="\\"+c;continue}inClass=true;classStart=i;reClassStart=re.length;re+=c;continue;case"]":if(i===classStart+1||!inClass){re+="\\"+c;escaping=false;continue}hasMagic=true;inClass=false;re+=c;continue;default:clearStateChar();if(escaping){escaping=false}else if(reSpecials[c]&&!(c==="^"&&inClass)){re+="\\"}re+=c}}if(inClass){var cs=pattern.substr(classStart+1),sp=this.parse(cs,SUBPARSE);re=re.substr(0,reClassStart)+"\\["+sp[0];hasMagic=hasMagic||sp[1]}var pl;while(pl=patternListStack.pop()){var tail=re.slice(pl.reStart+3);tail=tail.replace(/((?:\\{2})*)(\\?)\|/g,function(_,$1,$2){if(!$2){$2="\\"}return $1+$1+$2+"|"});this.debug("tail=%j\n %s",tail,tail);var t=pl.type==="*"?star:pl.type==="?"?qmark:"\\"+pl.type;hasMagic=true;re=re.slice(0,pl.reStart)+t+"\\("+tail}clearStateChar();if(escaping){re+="\\\\"}var addPatternStart=false;switch(re.charAt(0)){case".":case"[":case"(":addPatternStart=true}if(re!==""&&hasMagic)re="(?=.)"+re;if(addPatternStart)re=patternStart+re;if(isSub===SUBPARSE){return[re,hasMagic]}if(!hasMagic){return globUnescape(pattern)}var flags=options.nocase?"i":"",regExp=new RegExp("^"+re+"$",flags);regExp._glob=pattern;regExp._src=re;return regExp}minimatch.makeRe=function(pattern,options){return new Minimatch(pattern,options||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var set=this.set;if(!set.length)return this.regexp=false;var options=this.options;var twoStar=options.noglobstar?star:options.dot?twoStarDot:twoStarNoDot,flags=options.nocase?"i":"";var re=set.map(function(pattern){return pattern.map(function(p){return p===GLOBSTAR?twoStar:typeof p==="string"?regExpEscape(p):p._src}).join("\\/")}).join("|");re="^(?:"+re+")$";if(this.negate)re="^(?!"+re+").*$";try{return this.regexp=new RegExp(re,flags)}catch(ex){return this.regexp=false}}minimatch.match=function(list,pattern,options){options=options||{};var mm=new Minimatch(pattern,options);list=list.filter(function(f){return mm.match(f)});if(mm.options.nonull&&!list.length){list.push(pattern)}return list};Minimatch.prototype.match=match;function match(f,partial){this.debug("match",f,this.pattern);if(this.comment)return false;if(this.empty)return f==="";if(f==="/"&&partial)return true;var options=this.options;if(isWindows)f=f.split("\\").join("/");f=f.split(slashSplit);this.debug(this.pattern,"split",f);var set=this.set;this.debug(this.pattern,"set",set);var filename;for(var i=f.length-1;i>=0;i--){filename=f[i];if(filename)break}for(var i=0,l=set.length;i<l;i++){var pattern=set[i],file=f;if(options.matchBase&&pattern.length===1){file=[filename]}var hit=this.matchOne(file,pattern,partial);if(hit){if(options.flipNegate)return true;return!this.negate}}if(options.flipNegate)return false;return this.negate}Minimatch.prototype.matchOne=function(file,pattern,partial){var options=this.options;this.debug("matchOne",{"this":this,file:file,pattern:pattern});this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f=file[fi];this.debug(pattern,p,f);if(p===false)return false;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi,pr=pi+1;if(pr===pl){this.debug("** at the end");for(;fi<fl;fi++){if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return false}return true}WHILE:while(fr<fl){var swallowee=file[fr];this.debug("\nglobstar while",file,fr,pattern,pr,swallowee);if(this.matchOne(file.slice(fr),pattern.slice(pr),partial)){this.debug("globstar found match!",fr,fl,swallowee);return true}else{if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break WHILE}this.debug("globstar swallow a segment, and continue");fr++}}if(partial){this.debug("\n>>> no match, partial?",file,fr,pattern,pr);if(fr===fl)return true}return false}var hit;if(typeof p==="string"){if(options.nocase){hit=f.toLowerCase()===p.toLowerCase()}else{hit=f===p}this.debug("string match",p,f,hit)}else{hit=f.match(p);this.debug("pattern match",p,f,hit)}if(!hit)return false}if(fi===fl&&pi===pl){return true}else if(fi===fl){return partial}else if(pi===pl){var emptyFileEnd=fi===fl-1&&file[fi]==="";return emptyFileEnd}throw new Error("wtf?")};function globUnescape(s){return s.replace(/\\(.)/g,"$1")}function regExpEscape(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}}).call(this,require("_process"))},{_process:7,"brace-expansion":43}],43:[function(require,module,exports){var concatMap=require("concat-map");var balanced=require("balanced-match");module.exports=expandTop;var escSlash="\x00SLASH"+Math.random()+"\x00";var escOpen="\x00OPEN"+Math.random()+"\x00";var escClose="\x00CLOSE"+Math.random()+"\x00";var escComma="\x00COMMA"+Math.random()+"\x00";var escPeriod="\x00PERIOD"+Math.random()+"\x00";function numeric(str){return parseInt(str,10)==str?parseInt(str,10):str.charCodeAt(0)}function escapeBraces(str){return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod)}function unescapeBraces(str){return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".")}function parseCommaParts(str){if(!str)return[""];var parts=[];var m=balanced("{","}",str);if(!m)return str.split(",");var pre=m.pre;var body=m.body;var post=m.post;var p=pre.split(",");p[p.length-1]+="{"+body+"}";var postParts=parseCommaParts(post);if(post.length){p[p.length-1]+=postParts.shift();p.push.apply(p,postParts)}parts.push.apply(parts,p);return parts}function expandTop(str){if(!str)return[];return expand(escapeBraces(str),true).map(unescapeBraces)}function identity(e){return e}function embrace(str){return"{"+str+"}"}function isPadded(el){return/^-?0\d/.test(el)}function lte(i,y){return i<=y}function gte(i,y){return i>=y}function expand(str,isTop){var expansions=[];var m=balanced("{","}",str);if(!m||/\$$/.test(m.pre))return[str];var isNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);var isAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);var isSequence=isNumericSequence||isAlphaSequence;var isOptions=/^(.*,)+(.+)?$/.test(m.body);if(!isSequence&&!isOptions){if(m.post.match(/,.*}/)){str=m.pre+"{"+m.body+escClose+m.post;return expand(str)}return[str]}var n;if(isSequence){n=m.body.split(/\.\./)}else{n=parseCommaParts(m.body);if(n.length===1){n=expand(n[0],false).map(embrace);if(n.length===1){var post=m.post.length?expand(m.post,false):[""];return post.map(function(p){return m.pre+n[0]+p})}}}var pre=m.pre;var post=m.post.length?expand(m.post,false):[""];var N;if(isSequence){var x=numeric(n[0]);var y=numeric(n[1]);var width=Math.max(n[0].length,n[1].length);var incr=n.length==3?Math.abs(numeric(n[2])):1;var test=lte;var reverse=y<x;if(reverse){incr*=-1;test=gte}var pad=n.some(isPadded);N=[];for(var i=x;test(i,y);i+=incr){var c;if(isAlphaSequence){c=String.fromCharCode(i);if(c==="\\")c=""}else{c=String(i);if(pad){var need=width-c.length;if(need>0){var z=new Array(need+1).join("0");if(i<0)c="-"+z+c.slice(1);else c=z+c}}}N.push(c)}}else{N=concatMap(n,function(el){return expand(el,false)})}for(var j=0;j<N.length;j++){for(var k=0;k<post.length;k++){var expansion=pre+N[j]+post[k];if(!isTop||isSequence||expansion)expansions.push(expansion)}}return expansions}},{"balanced-match":44,"concat-map":45}],44:[function(require,module,exports){module.exports=balanced;function balanced(a,b,str){var bal=0;var m={};var ended=false;for(var i=0;i<str.length;i++){if(a==str.substr(i,a.length)){if(!("start"in m))m.start=i;bal++}else if(b==str.substr(i,b.length)&&"start"in m){ended=true;bal--;if(!bal){m.end=i;m.pre=str.substr(0,m.start);m.body=m.end-m.start>1?str.substring(m.start+a.length,m.end):"";m.post=str.slice(m.end+b.length);return m}}}if(bal&&ended){var start=m.start+a.length;m=balanced(a,b,str.substr(start));if(m){m.start+=start;m.end+=start;m.pre=str.slice(0,start)+m.pre}return m}}},{}],45:[function(require,module,exports){module.exports=function(xs,fn){var res=[];for(var i=0;i<xs.length;i++){var x=fn(xs[i],i);if(isArray(x))res.push.apply(res,x);else res.push(x)}return res};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}},{}],46:[function(require,module,exports){arguments[4][40][0].apply(exports,arguments)},{dup:40}],47:[function(require,module,exports){var wrappy=require("wrappy");module.exports=wrappy(once);once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true})});function once(fn){var f=function(){if(f.called)return f.value;f.called=true;return f.value=fn.apply(this,arguments)};f.called=false;return f}},{wrappy:46}],48:[function(require,module,exports){(function(process){module.exports=globSync;globSync.GlobSync=GlobSync;var fs=require("fs");var minimatch=require("minimatch");var Minimatch=minimatch.Minimatch;var Glob=require("./glob.js").Glob;var util=require("util");var path=require("path");var assert=require("assert");var common=require("./common.js");var alphasort=common.alphasort;var alphasorti=common.alphasorti;var isAbsolute=common.isAbsolute;var setopts=common.setopts;var ownProp=common.ownProp;function globSync(pattern,options){if(typeof options==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob");return new GlobSync(pattern,options).found}function GlobSync(pattern,options){if(!pattern)throw new Error("must provide pattern");if(typeof options==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob");if(!(this instanceof GlobSync))return new GlobSync(pattern,options);setopts(this,pattern,options);if(this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var i=0;i<n;i++){this._process(this.minimatch.set[i],i,false)}this._finish()}GlobSync.prototype._finish=function(){assert(this instanceof GlobSync);common.finish(this)};GlobSync.prototype._process=function(pattern,index,inGlobStar){assert(this instanceof GlobSync);var n=0;while(typeof pattern[n]==="string"){n++}var prefix;switch(n){case pattern.length:this._processSimple(pattern.join("/"),index);return;case 0:prefix=null;break;default:prefix=pattern.slice(0,n).join("/");break}var remain=pattern.slice(n);var read;if(prefix===null)read=".";else if(isAbsolute(prefix)||isAbsolute(pattern.join("/"))){if(!prefix||!isAbsolute(prefix))prefix="/"+prefix;read=prefix}else read=prefix;var abs=this._makeAbs(read);var isGlobStar=remain[0]===minimatch.GLOBSTAR;if(isGlobStar)this._processGlobStar(prefix,read,abs,remain,index,inGlobStar);else this._processReaddir(prefix,read,abs,remain,index,inGlobStar)};GlobSync.prototype._processReaddir=function(prefix,read,abs,remain,index,inGlobStar){var entries=this._readdir(abs,inGlobStar);if(!entries)return;var pn=remain[0];var negate=!!this.minimatch.negate;var rawGlob=pn._glob;var dotOk=this.dot||rawGlob.charAt(0)===".";var matchedEntries=[];for(var i=0;i<entries.length;i++){var e=entries[i];if(e.charAt(0)!=="."||dotOk){var m;if(negate&&!prefix){m=!e.match(pn)}else{m=e.match(pn)}if(m)matchedEntries.push(e)}}var len=matchedEntries.length;if(len===0)return;if(remain.length===1&&!this.mark&&!this.stat){if(!this.matches[index])this.matches[index]=Object.create(null);for(var i=0;i<len;i++){var e=matchedEntries[i];if(prefix){if(prefix.slice(-1)!=="/")e=prefix+"/"+e;else e=prefix+e}if(e.charAt(0)==="/"&&!this.nomount){e=path.join(this.root,e)}this.matches[index][e]=true}return}remain.shift();for(var i=0;i<len;i++){var e=matchedEntries[i];var newPattern;if(prefix)newPattern=[prefix,e];else newPattern=[e];this._process(newPattern.concat(remain),index,inGlobStar)}};GlobSync.prototype._emitMatch=function(index,e){if(!this.matches[index][e]){if(this.nodir){var c=this.cache[this._makeAbs(e)];if(c==="DIR"||Array.isArray(c))return}this.matches[index][e]=true;if(this.stat||this.mark)this._stat(this._makeAbs(e))}};GlobSync.prototype._readdirInGlobStar=function(abs){var entries;var lstat;var stat;try{lstat=fs.lstatSync(abs)}catch(er){return null}var isSym=lstat.isSymbolicLink();this.symlinks[abs]=isSym;if(!isSym&&!lstat.isDirectory())this.cache[abs]="FILE";else entries=this._readdir(abs,false);return entries};GlobSync.prototype._readdir=function(abs,inGlobStar){var entries;if(inGlobStar&&!ownProp(this.symlinks,abs))return this._readdirInGlobStar(abs);if(ownProp(this.cache,abs)){var c=this.cache[abs];if(!c||c==="FILE")return null;if(Array.isArray(c))return c}try{return this._readdirEntries(abs,fs.readdirSync(abs))}catch(er){this._readdirError(abs,er);return null}};GlobSync.prototype._readdirEntries=function(abs,entries){if(!this.mark&&!this.stat){for(var i=0;i<entries.length;i++){var e=entries[i];if(abs==="/")e=abs+e;else e=abs+"/"+e;this.cache[e]=true}}this.cache[abs]=entries;return entries};GlobSync.prototype._readdirError=function(f,er){switch(er.code){case"ENOTDIR":this.cache[f]="FILE";break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[f]=false;break;default:this.cache[f]=false;if(this.strict)throw er;if(!this.silent)console.error("glob error",er);break}};GlobSync.prototype._processGlobStar=function(prefix,read,abs,remain,index,inGlobStar){var entries=this._readdir(abs,inGlobStar);if(!entries)return;var remainWithoutGlobStar=remain.slice(1);var gspref=prefix?[prefix]:[];var noGlobStar=gspref.concat(remainWithoutGlobStar);this._process(noGlobStar,index,false);var len=entries.length;var isSym=this.symlinks[abs];if(isSym&&inGlobStar)return;for(var i=0;i<len;i++){var e=entries[i];if(e.charAt(0)==="."&&!this.dot)continue;var instead=gspref.concat(entries[i],remainWithoutGlobStar);this._process(instead,index,true);var below=gspref.concat(entries[i],remain);this._process(below,index,true)}};GlobSync.prototype._processSimple=function(prefix,index){var exists=this._stat(prefix);if(!this.matches[index])this.matches[index]=Object.create(null);if(!exists)return;if(prefix&&isAbsolute(prefix)&&!this.nomount){var trail=/[\/\\]$/.test(prefix);if(prefix.charAt(0)==="/"){prefix=path.join(this.root,prefix)}else{prefix=path.resolve(this.root,prefix);if(trail)prefix+="/"}}if(process.platform==="win32")prefix=prefix.replace(/\\/g,"/");this.matches[index][prefix]=true};GlobSync.prototype._stat=function(f){var abs=f;if(f.charAt(0)==="/")abs=path.join(this.root,f);else if(this.changedCwd)abs=path.resolve(this.cwd,f);if(f.length>this.maxLength)return false;if(!this.stat&&ownProp(this.cache,f)){var c=this.cache[f];if(Array.isArray(c))c="DIR";if(abs.slice(-1)==="/"&&c!=="DIR")return false;return c}var exists;var stat=this.statCache[abs];if(!stat){try{stat=fs.statSync(abs)}catch(er){return false}}this.statCache[abs]=stat;if(abs.slice(-1)==="/"&&!stat.isDirectory())return false;var c=stat.isDirectory()?"DIR":"FILE";this.cache[f]=this.cache[f]||c;return c};GlobSync.prototype._mark=function(p){return common.mark(this,p)};GlobSync.prototype._makeAbs=function(f){return common.makeAbs(this,f)}}).call(this,require("_process"))},{"./common.js":37,"./glob.js":38,_process:7,assert:2,fs:1,minimatch:42,path:6,util:9}],49:[function(require,module,exports){"use strict";var yaml=require("./lib/js-yaml.js");module.exports=yaml},{"./lib/js-yaml.js":50}],50:[function(require,module,exports){"use strict";var loader=require("./js-yaml/loader");var dumper=require("./js-yaml/dumper");function deprecated(name){return function(){throw new Error("Function "+name+" is deprecated and cannot be used.")}}module.exports.Type=require("./js-yaml/type");module.exports.Schema=require("./js-yaml/schema");module.exports.FAILSAFE_SCHEMA=require("./js-yaml/schema/failsafe");module.exports.JSON_SCHEMA=require("./js-yaml/schema/json");module.exports.CORE_SCHEMA=require("./js-yaml/schema/core");module.exports.DEFAULT_SAFE_SCHEMA=require("./js-yaml/schema/default_safe");module.exports.DEFAULT_FULL_SCHEMA=require("./js-yaml/schema/default_full");module.exports.load=loader.load;module.exports.loadAll=loader.loadAll;module.exports.safeLoad=loader.safeLoad;module.exports.safeLoadAll=loader.safeLoadAll;module.exports.dump=dumper.dump;module.exports.safeDump=dumper.safeDump;module.exports.YAMLException=require("./js-yaml/exception");module.exports.MINIMAL_SCHEMA=require("./js-yaml/schema/failsafe");module.exports.SAFE_SCHEMA=require("./js-yaml/schema/default_safe");module.exports.DEFAULT_SCHEMA=require("./js-yaml/schema/default_full");module.exports.scan=deprecated("scan");module.exports.parse=deprecated("parse");module.exports.compose=deprecated("compose");module.exports.addConstructor=deprecated("addConstructor")},{"./js-yaml/dumper":52,"./js-yaml/exception":53,"./js-yaml/loader":54,"./js-yaml/schema":56,"./js-yaml/schema/core":57,"./js-yaml/schema/default_full":58,"./js-yaml/schema/default_safe":59,"./js-yaml/schema/failsafe":60,"./js-yaml/schema/json":61,"./js-yaml/type":62}],51:[function(require,module,exports){"use strict";function isNothing(subject){return undefined===subject||null===subject}function isObject(subject){return"object"===typeof subject&&null!==subject}function toArray(sequence){if(Array.isArray(sequence)){return sequence}else if(isNothing(sequence)){return[]}else{return[sequence]}}function extend(target,source){var index,length,key,sourceKeys;if(source){sourceKeys=Object.keys(source);for(index=0,length=sourceKeys.length;index<length;index+=1){key=sourceKeys[index];target[key]=source[key]}}return target}function repeat(string,count){var result="",cycle;for(cycle=0;cycle<count;cycle+=1){result+=string}return result}function isNegativeZero(number){return 0===number&&Number.NEGATIVE_INFINITY===1/number}module.exports.isNothing=isNothing;module.exports.isObject=isObject;module.exports.toArray=toArray;module.exports.repeat=repeat;module.exports.isNegativeZero=isNegativeZero;module.exports.extend=extend},{}],52:[function(require,module,exports){"use strict";var common=require("./common");var YAMLException=require("./exception");var DEFAULT_FULL_SCHEMA=require("./schema/default_full");var DEFAULT_SAFE_SCHEMA=require("./schema/default_safe");var _toString=Object.prototype.toString;var _hasOwnProperty=Object.prototype.hasOwnProperty;var CHAR_TAB=9;var CHAR_LINE_FEED=10;var CHAR_CARRIAGE_RETURN=13;var CHAR_SPACE=32;var CHAR_EXCLAMATION=33;var CHAR_DOUBLE_QUOTE=34;var CHAR_SHARP=35;var CHAR_PERCENT=37;var CHAR_AMPERSAND=38;var CHAR_SINGLE_QUOTE=39;var CHAR_ASTERISK=42;var CHAR_COMMA=44;var CHAR_MINUS=45;var CHAR_COLON=58;var CHAR_GREATER_THAN=62;var CHAR_QUESTION=63;var CHAR_COMMERCIAL_AT=64;var CHAR_LEFT_SQUARE_BRACKET=91;var CHAR_RIGHT_SQUARE_BRACKET=93;var CHAR_GRAVE_ACCENT=96;var CHAR_LEFT_CURLY_BRACKET=123;var CHAR_VERTICAL_LINE=124;var CHAR_RIGHT_CURLY_BRACKET=125;var ESCAPE_SEQUENCES={};ESCAPE_SEQUENCES[0]="\\0";ESCAPE_SEQUENCES[7]="\\a";ESCAPE_SEQUENCES[8]="\\b";ESCAPE_SEQUENCES[9]="\\t";ESCAPE_SEQUENCES[10]="\\n";ESCAPE_SEQUENCES[11]="\\v";ESCAPE_SEQUENCES[12]="\\f";ESCAPE_SEQUENCES[13]="\\r";ESCAPE_SEQUENCES[27]="\\e";ESCAPE_SEQUENCES[34]='\\"';ESCAPE_SEQUENCES[92]="\\\\";ESCAPE_SEQUENCES[133]="\\N";ESCAPE_SEQUENCES[160]="\\_";ESCAPE_SEQUENCES[8232]="\\L";ESCAPE_SEQUENCES[8233]="\\P";var DEPRECATED_BOOLEANS_SYNTAX=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function compileStyleMap(schema,map){var result,keys,index,length,tag,style,type;if(null===map){return{}}result={};keys=Object.keys(map);for(index=0,length=keys.length;index<length;index+=1){tag=keys[index];style=String(map[tag]);if("!!"===tag.slice(0,2)){tag="tag:yaml.org,2002:"+tag.slice(2)}type=schema.compiledTypeMap[tag];if(type&&_hasOwnProperty.call(type.styleAliases,style)){style=type.styleAliases[style]}result[tag]=style}return result}function encodeHex(character){var string,handle,length;string=character.toString(16).toUpperCase();if(character<=255){handle="x";length=2}else if(character<=65535){handle="u";length=4}else if(character<=4294967295){handle="U";length=8}else{throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF")}return"\\"+handle+common.repeat("0",length-string.length)+string}function State(options){this.schema=options["schema"]||DEFAULT_FULL_SCHEMA;this.indent=Math.max(1,options["indent"]||2);this.skipInvalid=options["skipInvalid"]||false;this.flowLevel=common.isNothing(options["flowLevel"])?-1:options["flowLevel"];this.styleMap=compileStyleMap(this.schema,options["styles"]||null);this.implicitTypes=this.schema.compiledImplicit;this.explicitTypes=this.schema.compiledExplicit;this.tag=null;this.result="";this.duplicates=[];this.usedDuplicates=null}function generateNextLine(state,level){return"\n"+common.repeat(" ",state.indent*level)}function testImplicitResolving(state,str){var index,length,type;for(index=0,length=state.implicitTypes.length;index<length;index+=1){type=state.implicitTypes[index];if(type.resolve(str)){return true}}return false}function writeScalar(state,object){var isQuoted,checkpoint,position,length,character,first;state.dump="";isQuoted=false;checkpoint=0;first=object.charCodeAt(0)||0;if(-1!==DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)){isQuoted=true}else if(0===object.length){isQuoted=true}else if(CHAR_SPACE===first||CHAR_SPACE===object.charCodeAt(object.length-1)){isQuoted=true}else if(CHAR_MINUS===first||CHAR_QUESTION===first){isQuoted=true}for(position=0,length=object.length;position<length;position+=1){character=object.charCodeAt(position);if(!isQuoted){if(CHAR_TAB===character||CHAR_LINE_FEED===character||CHAR_CARRIAGE_RETURN===character||CHAR_COMMA===character||CHAR_LEFT_SQUARE_BRACKET===character||CHAR_RIGHT_SQUARE_BRACKET===character||CHAR_LEFT_CURLY_BRACKET===character||CHAR_RIGHT_CURLY_BRACKET===character||CHAR_SHARP===character||CHAR_AMPERSAND===character||CHAR_ASTERISK===character||CHAR_EXCLAMATION===character||CHAR_VERTICAL_LINE===character||CHAR_GREATER_THAN===character||CHAR_SINGLE_QUOTE===character||CHAR_DOUBLE_QUOTE===character||CHAR_PERCENT===character||CHAR_COMMERCIAL_AT===character||CHAR_COLON===character||CHAR_GRAVE_ACCENT===character){isQuoted=true}}if(ESCAPE_SEQUENCES[character]||!(32<=character&&character<=126||133===character||160<=character&&character<=55295||57344<=character&&character<=65533||65536<=character&&character<=1114111)){state.dump+=object.slice(checkpoint,position);state.dump+=ESCAPE_SEQUENCES[character]||encodeHex(character);checkpoint=position+1;isQuoted=true}}if(checkpoint<position){state.dump+=object.slice(checkpoint,position)}if(!isQuoted&&testImplicitResolving(state,state.dump)){isQuoted=true}if(isQuoted){state.dump='"'+state.dump+'"'}}function writeFlowSequence(state,level,object){var _result="",_tag=state.tag,index,length;for(index=0,length=object.length;index<length;index+=1){if(writeNode(state,level,object[index],false,false)){if(0!==index){_result+=", "}_result+=state.dump}}state.tag=_tag;state.dump="["+_result+"]"}function writeBlockSequence(state,level,object,compact){var _result="",_tag=state.tag,index,length;for(index=0,length=object.length;index<length;index+=1){if(writeNode(state,level+1,object[index],true,true)){if(!compact||0!==index){_result+=generateNextLine(state,level)}_result+="- "+state.dump}}state.tag=_tag;state.dump=_result||"[]"}function writeFlowMapping(state,level,object){var _result="",_tag=state.tag,objectKeyList=Object.keys(object),index,length,objectKey,objectValue,pairBuffer;for(index=0,length=objectKeyList.length;index<length;index+=1){pairBuffer="";if(0!==index){pairBuffer+=", "}objectKey=objectKeyList[index];objectValue=object[objectKey];if(!writeNode(state,level,objectKey,false,false)){continue}if(state.dump.length>1024){pairBuffer+="? "}pairBuffer+=state.dump+": ";if(!writeNode(state,level,objectValue,false,false)){continue}pairBuffer+=state.dump;_result+=pairBuffer}state.tag=_tag;state.dump="{"+_result+"}"}function writeBlockMapping(state,level,object,compact){var _result="",_tag=state.tag,objectKeyList=Object.keys(object),index,length,objectKey,objectValue,explicitPair,pairBuffer;for(index=0,length=objectKeyList.length;index<length;index+=1){pairBuffer="";if(!compact||0!==index){pairBuffer+=generateNextLine(state,level)}objectKey=objectKeyList[index];objectValue=object[objectKey];if(!writeNode(state,level+1,objectKey,true,true)){continue}explicitPair=null!==state.tag&&"?"!==state.tag||state.dump&&state.dump.length>1024;if(explicitPair){if(state.dump&&CHAR_LINE_FEED===state.dump.charCodeAt(0)){pairBuffer+="?"}else{pairBuffer+="? "}}pairBuffer+=state.dump;if(explicitPair){pairBuffer+=generateNextLine(state,level)}if(!writeNode(state,level+1,objectValue,true,explicitPair)){continue}if(state.dump&&CHAR_LINE_FEED===state.dump.charCodeAt(0)){pairBuffer+=":"}else{pairBuffer+=": "}pairBuffer+=state.dump;_result+=pairBuffer}state.tag=_tag;state.dump=_result||"{}"}function detectType(state,object,explicit){var _result,typeList,index,length,type,style; | |
typeList=explicit?state.explicitTypes:state.implicitTypes;for(index=0,length=typeList.length;index<length;index+=1){type=typeList[index];if((type.instanceOf||type.predicate)&&(!type.instanceOf||"object"===typeof object&&object instanceof type.instanceOf)&&(!type.predicate||type.predicate(object))){state.tag=explicit?type.tag:"?";if(type.represent){style=state.styleMap[type.tag]||type.defaultStyle;if("[object Function]"===_toString.call(type.represent)){_result=type.represent(object,style)}else if(_hasOwnProperty.call(type.represent,style)){_result=type.represent[style](object,style)}else{throw new YAMLException("!<"+type.tag+'> tag resolver accepts not "'+style+'" style')}state.dump=_result}return true}}return false}function writeNode(state,level,object,block,compact){state.tag=null;state.dump=object;if(!detectType(state,object,false)){detectType(state,object,true)}var type=_toString.call(state.dump);if(block){block=0>state.flowLevel||state.flowLevel>level}if(null!==state.tag&&"?"!==state.tag||2!==state.indent&&level>0){compact=false}var objectOrArray="[object Object]"===type||"[object Array]"===type,duplicateIndex,duplicate;if(objectOrArray){duplicateIndex=state.duplicates.indexOf(object);duplicate=duplicateIndex!==-1}if(duplicate&&state.usedDuplicates[duplicateIndex]){state.dump="*ref_"+duplicateIndex}else{if(objectOrArray&&duplicate&&!state.usedDuplicates[duplicateIndex]){state.usedDuplicates[duplicateIndex]=true}if("[object Object]"===type){if(block&&0!==Object.keys(state.dump).length){writeBlockMapping(state,level,state.dump,compact);if(duplicate){state.dump="&ref_"+duplicateIndex+(0===level?"\n":"")+state.dump}}else{writeFlowMapping(state,level,state.dump);if(duplicate){state.dump="&ref_"+duplicateIndex+" "+state.dump}}}else if("[object Array]"===type){if(block&&0!==state.dump.length){writeBlockSequence(state,level,state.dump,compact);if(duplicate){state.dump="&ref_"+duplicateIndex+(0===level?"\n":"")+state.dump}}else{writeFlowSequence(state,level,state.dump);if(duplicate){state.dump="&ref_"+duplicateIndex+" "+state.dump}}}else if("[object String]"===type){if("?"!==state.tag){writeScalar(state,state.dump)}}else if(state.skipInvalid){return false}else{throw new YAMLException("unacceptable kind of an object to dump "+type)}if(null!==state.tag&&"?"!==state.tag){state.dump="!<"+state.tag+"> "+state.dump}}return true}function getDuplicateReferences(object,state){var objects=[],duplicatesIndexes=[],index,length;inspectNode(object,objects,duplicatesIndexes);for(index=0,length=duplicatesIndexes.length;index<length;index+=1){state.duplicates.push(objects[duplicatesIndexes[index]])}state.usedDuplicates=new Array(length)}function inspectNode(object,objects,duplicatesIndexes){var type=_toString.call(object),objectKeyList,index,length;if(null!==object&&"object"===typeof object){index=objects.indexOf(object);if(-1!==index){if(-1===duplicatesIndexes.indexOf(index)){duplicatesIndexes.push(index)}}else{objects.push(object);if(Array.isArray(object)){for(index=0,length=object.length;index<length;index+=1){inspectNode(object[index],objects,duplicatesIndexes)}}else{objectKeyList=Object.keys(object);for(index=0,length=objectKeyList.length;index<length;index+=1){inspectNode(object[objectKeyList[index]],objects,duplicatesIndexes)}}}}}function dump(input,options){options=options||{};var state=new State(options);getDuplicateReferences(input,state);if(writeNode(state,0,input,true,true)){return state.dump+"\n"}else{return""}}function safeDump(input,options){return dump(input,common.extend({schema:DEFAULT_SAFE_SCHEMA},options))}module.exports.dump=dump;module.exports.safeDump=safeDump},{"./common":51,"./exception":53,"./schema/default_full":58,"./schema/default_safe":59}],53:[function(require,module,exports){"use strict";function YAMLException(reason,mark){this.name="YAMLException";this.reason=reason;this.mark=mark;this.message=this.toString(false)}YAMLException.prototype.toString=function toString(compact){var result;result="JS-YAML: "+(this.reason||"(unknown reason)");if(!compact&&this.mark){result+=" "+this.mark.toString()}return result};module.exports=YAMLException},{}],54:[function(require,module,exports){"use strict";var common=require("./common");var YAMLException=require("./exception");var Mark=require("./mark");var DEFAULT_SAFE_SCHEMA=require("./schema/default_safe");var DEFAULT_FULL_SCHEMA=require("./schema/default_full");var _hasOwnProperty=Object.prototype.hasOwnProperty;var CONTEXT_FLOW_IN=1;var CONTEXT_FLOW_OUT=2;var CONTEXT_BLOCK_IN=3;var CONTEXT_BLOCK_OUT=4;var CHOMPING_CLIP=1;var CHOMPING_STRIP=2;var CHOMPING_KEEP=3;var PATTERN_NON_PRINTABLE=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/;var PATTERN_NON_ASCII_LINE_BREAKS=/[\x85\u2028\u2029]/;var PATTERN_FLOW_INDICATORS=/[,\[\]\{\}]/;var PATTERN_TAG_HANDLE=/^(?:!|!!|![a-z\-]+!)$/i;var PATTERN_TAG_URI=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function is_EOL(c){return c===10||c===13}function is_WHITE_SPACE(c){return c===9||c===32}function is_WS_OR_EOL(c){return c===9||c===32||c===10||c===13}function is_FLOW_INDICATOR(c){return 44===c||91===c||93===c||123===c||125===c}function fromHexCode(c){var lc;if(48<=c&&c<=57){return c-48}lc=c|32;if(97<=lc&&lc<=102){return lc-97+10}return-1}function escapedHexLen(c){if(c===120){return 2}if(c===117){return 4}if(c===85){return 8}return 0}function fromDecimalCode(c){if(48<=c&&c<=57){return c-48}return-1}function simpleEscapeSequence(c){return c===48?"\x00":c===97?"":c===98?"\b":c===116?" ":c===9?" ":c===110?"\n":c===118?"":c===102?"\f":c===114?"\r":c===101?"":c===32?" ":c===34?'"':c===47?"/":c===92?"\\":c===78?" ":c===95?" ":c===76?"\u2028":c===80?"\u2029":""}var simpleEscapeCheck=new Array(256);var simpleEscapeMap=new Array(256);for(var i=0;i<256;i++){simpleEscapeCheck[i]=simpleEscapeSequence(i)?1:0;simpleEscapeMap[i]=simpleEscapeSequence(i)}function State(input,options){this.input=input;this.filename=options["filename"]||null;this.schema=options["schema"]||DEFAULT_FULL_SCHEMA;this.onWarning=options["onWarning"]||null;this.legacy=options["legacy"]||false;this.implicitTypes=this.schema.compiledImplicit;this.typeMap=this.schema.compiledTypeMap;this.length=input.length;this.position=0;this.line=0;this.lineStart=0;this.lineIndent=0;this.documents=[]}function generateError(state,message){return new YAMLException(message,new Mark(state.filename,state.input,state.position,state.line,state.position-state.lineStart))}function throwError(state,message){throw generateError(state,message)}function throwWarning(state,message){var error=generateError(state,message);if(state.onWarning){state.onWarning.call(null,error)}else{throw error}}var directiveHandlers={YAML:function handleYamlDirective(state,name,args){var match,major,minor;if(null!==state.version){throwError(state,"duplication of %YAML directive")}if(1!==args.length){throwError(state,"YAML directive accepts exactly one argument")}match=/^([0-9]+)\.([0-9]+)$/.exec(args[0]);if(null===match){throwError(state,"ill-formed argument of the YAML directive")}major=parseInt(match[1],10);minor=parseInt(match[2],10);if(1!==major){throwError(state,"unacceptable YAML version of the document")}state.version=args[0];state.checkLineBreaks=minor<2;if(1!==minor&&2!==minor){throwWarning(state,"unsupported YAML version of the document")}},TAG:function handleTagDirective(state,name,args){var handle,prefix;if(2!==args.length){throwError(state,"TAG directive accepts exactly two arguments")}handle=args[0];prefix=args[1];if(!PATTERN_TAG_HANDLE.test(handle)){throwError(state,"ill-formed tag handle (first argument) of the TAG directive")}if(_hasOwnProperty.call(state.tagMap,handle)){throwError(state,'there is a previously declared suffix for "'+handle+'" tag handle')}if(!PATTERN_TAG_URI.test(prefix)){throwError(state,"ill-formed tag prefix (second argument) of the TAG directive")}state.tagMap[handle]=prefix}};function captureSegment(state,start,end,checkJson){var _position,_length,_character,_result;if(start<end){_result=state.input.slice(start,end);if(checkJson){for(_position=0,_length=_result.length;_position<_length;_position+=1){_character=_result.charCodeAt(_position);if(!(9===_character||32<=_character&&_character<=1114111)){throwError(state,"expected valid JSON character")}}}state.result+=_result}}function mergeMappings(state,destination,source){var sourceKeys,key,index,quantity;if(!common.isObject(source)){throwError(state,"cannot merge mappings; the provided source object is unacceptable")}sourceKeys=Object.keys(source);for(index=0,quantity=sourceKeys.length;index<quantity;index+=1){key=sourceKeys[index];if(!_hasOwnProperty.call(destination,key)){destination[key]=source[key]}}}function storeMappingPair(state,_result,keyTag,keyNode,valueNode){var index,quantity;keyNode=String(keyNode);if(null===_result){_result={}}if("tag:yaml.org,2002:merge"===keyTag){if(Array.isArray(valueNode)){for(index=0,quantity=valueNode.length;index<quantity;index+=1){mergeMappings(state,_result,valueNode[index])}}else{mergeMappings(state,_result,valueNode)}}else{_result[keyNode]=valueNode}return _result}function readLineBreak(state){var ch;ch=state.input.charCodeAt(state.position);if(10===ch){state.position++}else if(13===ch){state.position++;if(10===state.input.charCodeAt(state.position)){state.position++}}else{throwError(state,"a line break is expected")}state.line+=1;state.lineStart=state.position}function skipSeparationSpace(state,allowComments,checkIndent){var lineBreaks=0,ch=state.input.charCodeAt(state.position);while(0!==ch){while(is_WHITE_SPACE(ch)){ch=state.input.charCodeAt(++state.position)}if(allowComments&&35===ch){do{ch=state.input.charCodeAt(++state.position)}while(ch!==10&&ch!==13&&0!==ch)}if(is_EOL(ch)){readLineBreak(state);ch=state.input.charCodeAt(state.position);lineBreaks++;state.lineIndent=0;while(32===ch){state.lineIndent++;ch=state.input.charCodeAt(++state.position)}}else{break}}if(-1!==checkIndent&&0!==lineBreaks&&state.lineIndent<checkIndent){throwWarning(state,"deficient indentation")}return lineBreaks}function testDocumentSeparator(state){var _position=state.position,ch;ch=state.input.charCodeAt(_position);if((45===ch||46===ch)&&state.input.charCodeAt(_position+1)===ch&&state.input.charCodeAt(_position+2)===ch){_position+=3;ch=state.input.charCodeAt(_position);if(ch===0||is_WS_OR_EOL(ch)){return true}}return false}function writeFoldedLines(state,count){if(1===count){state.result+=" "}else if(count>1){state.result+=common.repeat("\n",count-1)}}function readPlainScalar(state,nodeIndent,withinFlowCollection){var preceding,following,captureStart,captureEnd,hasPendingContent,_line,_lineStart,_lineIndent,_kind=state.kind,_result=state.result,ch;ch=state.input.charCodeAt(state.position);if(is_WS_OR_EOL(ch)||is_FLOW_INDICATOR(ch)||35===ch||38===ch||42===ch||33===ch||124===ch||62===ch||39===ch||34===ch||37===ch||64===ch||96===ch){return false}if(63===ch||45===ch){following=state.input.charCodeAt(state.position+1);if(is_WS_OR_EOL(following)||withinFlowCollection&&is_FLOW_INDICATOR(following)){return false}}state.kind="scalar";state.result="";captureStart=captureEnd=state.position;hasPendingContent=false;while(0!==ch){if(58===ch){following=state.input.charCodeAt(state.position+1);if(is_WS_OR_EOL(following)||withinFlowCollection&&is_FLOW_INDICATOR(following)){break}}else if(35===ch){preceding=state.input.charCodeAt(state.position-1);if(is_WS_OR_EOL(preceding)){break}}else if(state.position===state.lineStart&&testDocumentSeparator(state)||withinFlowCollection&&is_FLOW_INDICATOR(ch)){break}else if(is_EOL(ch)){_line=state.line;_lineStart=state.lineStart;_lineIndent=state.lineIndent;skipSeparationSpace(state,false,-1);if(state.lineIndent>=nodeIndent){hasPendingContent=true;ch=state.input.charCodeAt(state.position);continue}else{state.position=captureEnd;state.line=_line;state.lineStart=_lineStart;state.lineIndent=_lineIndent;break}}if(hasPendingContent){captureSegment(state,captureStart,captureEnd,false);writeFoldedLines(state,state.line-_line);captureStart=captureEnd=state.position;hasPendingContent=false}if(!is_WHITE_SPACE(ch)){captureEnd=state.position+1}ch=state.input.charCodeAt(++state.position)}captureSegment(state,captureStart,captureEnd,false);if(state.result){return true}else{state.kind=_kind;state.result=_result;return false}}function readSingleQuotedScalar(state,nodeIndent){var ch,captureStart,captureEnd;ch=state.input.charCodeAt(state.position);if(39!==ch){return false}state.kind="scalar";state.result="";state.position++;captureStart=captureEnd=state.position;while(0!==(ch=state.input.charCodeAt(state.position))){if(39===ch){captureSegment(state,captureStart,state.position,true);ch=state.input.charCodeAt(++state.position);if(39===ch){captureStart=captureEnd=state.position;state.position++}else{return true}}else if(is_EOL(ch)){captureSegment(state,captureStart,captureEnd,true);writeFoldedLines(state,skipSeparationSpace(state,false,nodeIndent));captureStart=captureEnd=state.position}else if(state.position===state.lineStart&&testDocumentSeparator(state)){throwError(state,"unexpected end of the document within a single quoted scalar")}else{state.position++;captureEnd=state.position}}throwError(state,"unexpected end of the stream within a single quoted scalar")}function readDoubleQuotedScalar(state,nodeIndent){var captureStart,captureEnd,hexLength,hexResult,tmp,tmpEsc,ch;ch=state.input.charCodeAt(state.position);if(34!==ch){return false}state.kind="scalar";state.result="";state.position++;captureStart=captureEnd=state.position;while(0!==(ch=state.input.charCodeAt(state.position))){if(34===ch){captureSegment(state,captureStart,state.position,true);state.position++;return true}else if(92===ch){captureSegment(state,captureStart,state.position,true);ch=state.input.charCodeAt(++state.position);if(is_EOL(ch)){skipSeparationSpace(state,false,nodeIndent)}else if(ch<256&&simpleEscapeCheck[ch]){state.result+=simpleEscapeMap[ch];state.position++}else if((tmp=escapedHexLen(ch))>0){hexLength=tmp;hexResult=0;for(;hexLength>0;hexLength--){ch=state.input.charCodeAt(++state.position);if((tmp=fromHexCode(ch))>=0){hexResult=(hexResult<<4)+tmp}else{throwError(state,"expected hexadecimal character")}}state.result+=String.fromCharCode(hexResult);state.position++}else{throwError(state,"unknown escape sequence")}captureStart=captureEnd=state.position}else if(is_EOL(ch)){captureSegment(state,captureStart,captureEnd,true);writeFoldedLines(state,skipSeparationSpace(state,false,nodeIndent));captureStart=captureEnd=state.position}else if(state.position===state.lineStart&&testDocumentSeparator(state)){throwError(state,"unexpected end of the document within a double quoted scalar")}else{state.position++;captureEnd=state.position}}throwError(state,"unexpected end of the stream within a double quoted scalar")}function readFlowCollection(state,nodeIndent){var readNext=true,_line,_tag=state.tag,_result,_anchor=state.anchor,following,terminator,isPair,isExplicitPair,isMapping,keyNode,keyTag,valueNode,ch;ch=state.input.charCodeAt(state.position);if(ch===91){terminator=93;isMapping=false;_result=[]}else if(ch===123){terminator=125;isMapping=true;_result={}}else{return false}if(null!==state.anchor){state.anchorMap[state.anchor]=_result}ch=state.input.charCodeAt(++state.position);while(0!==ch){skipSeparationSpace(state,true,nodeIndent);ch=state.input.charCodeAt(state.position);if(ch===terminator){state.position++;state.tag=_tag;state.anchor=_anchor;state.kind=isMapping?"mapping":"sequence";state.result=_result;return true}else if(!readNext){throwError(state,"missed comma between flow collection entries")}keyTag=keyNode=valueNode=null;isPair=isExplicitPair=false;if(63===ch){following=state.input.charCodeAt(state.position+1);if(is_WS_OR_EOL(following)){isPair=isExplicitPair=true;state.position++;skipSeparationSpace(state,true,nodeIndent)}}_line=state.line;composeNode(state,nodeIndent,CONTEXT_FLOW_IN,false,true);keyTag=state.tag;keyNode=state.result;skipSeparationSpace(state,true,nodeIndent);ch=state.input.charCodeAt(state.position);if((isExplicitPair||state.line===_line)&&58===ch){isPair=true;ch=state.input.charCodeAt(++state.position);skipSeparationSpace(state,true,nodeIndent);composeNode(state,nodeIndent,CONTEXT_FLOW_IN,false,true);valueNode=state.result}if(isMapping){storeMappingPair(state,_result,keyTag,keyNode,valueNode)}else if(isPair){_result.push(storeMappingPair(state,null,keyTag,keyNode,valueNode))}else{_result.push(keyNode)}skipSeparationSpace(state,true,nodeIndent);ch=state.input.charCodeAt(state.position);if(44===ch){readNext=true;ch=state.input.charCodeAt(++state.position)}else{readNext=false}}throwError(state,"unexpected end of the stream within a flow collection")}function readBlockScalar(state,nodeIndent){var captureStart,folding,chomping=CHOMPING_CLIP,detectedIndent=false,textIndent=nodeIndent,emptyLines=0,atMoreIndented=false,tmp,ch;ch=state.input.charCodeAt(state.position);if(ch===124){folding=false}else if(ch===62){folding=true}else{return false}state.kind="scalar";state.result="";while(0!==ch){ch=state.input.charCodeAt(++state.position);if(43===ch||45===ch){if(CHOMPING_CLIP===chomping){chomping=43===ch?CHOMPING_KEEP:CHOMPING_STRIP}else{throwError(state,"repeat of a chomping mode identifier")}}else if((tmp=fromDecimalCode(ch))>=0){if(tmp===0){throwError(state,"bad explicit indentation width of a block scalar; it cannot be less than one")}else if(!detectedIndent){textIndent=nodeIndent+tmp-1;detectedIndent=true}else{throwError(state,"repeat of an indentation width identifier")}}else{break}}if(is_WHITE_SPACE(ch)){do{ch=state.input.charCodeAt(++state.position)}while(is_WHITE_SPACE(ch));if(35===ch){do{ch=state.input.charCodeAt(++state.position)}while(!is_EOL(ch)&&0!==ch)}}while(0!==ch){readLineBreak(state);state.lineIndent=0;ch=state.input.charCodeAt(state.position);while((!detectedIndent||state.lineIndent<textIndent)&&32===ch){state.lineIndent++;ch=state.input.charCodeAt(++state.position)}if(!detectedIndent&&state.lineIndent>textIndent){textIndent=state.lineIndent}if(is_EOL(ch)){emptyLines++;continue}if(state.lineIndent<textIndent){if(chomping===CHOMPING_KEEP){state.result+=common.repeat("\n",emptyLines)}else if(chomping===CHOMPING_CLIP){if(detectedIndent){state.result+="\n"}}break}if(folding){if(is_WHITE_SPACE(ch)){atMoreIndented=true;state.result+=common.repeat("\n",emptyLines+1)}else if(atMoreIndented){atMoreIndented=false;state.result+=common.repeat("\n",emptyLines+1)}else if(0===emptyLines){if(detectedIndent){state.result+=" "}}else{state.result+=common.repeat("\n",emptyLines)}}else{if(detectedIndent){state.result+=common.repeat("\n",emptyLines+1)}else{state.result+=common.repeat("\n",emptyLines)}}detectedIndent=true;emptyLines=0;captureStart=state.position;while(!is_EOL(ch)&&0!==ch){ch=state.input.charCodeAt(++state.position)}captureSegment(state,captureStart,state.position,false)}return true}function readBlockSequence(state,nodeIndent){var _line,_tag=state.tag,_anchor=state.anchor,_result=[],following,detected=false,ch;if(null!==state.anchor){state.anchorMap[state.anchor]=_result}ch=state.input.charCodeAt(state.position);while(0!==ch){if(45!==ch){break}following=state.input.charCodeAt(state.position+1);if(!is_WS_OR_EOL(following)){break}detected=true;state.position++;if(skipSeparationSpace(state,true,-1)){if(state.lineIndent<=nodeIndent){_result.push(null);ch=state.input.charCodeAt(state.position);continue}}_line=state.line;composeNode(state,nodeIndent,CONTEXT_BLOCK_IN,false,true);_result.push(state.result);skipSeparationSpace(state,true,-1);ch=state.input.charCodeAt(state.position);if((state.line===_line||state.lineIndent>nodeIndent)&&0!==ch){throwError(state,"bad indentation of a sequence entry")}else if(state.lineIndent<nodeIndent){break}}if(detected){state.tag=_tag;state.anchor=_anchor;state.kind="sequence";state.result=_result;return true}else{return false}}function readBlockMapping(state,nodeIndent,flowIndent){var following,allowCompact,_line,_tag=state.tag,_anchor=state.anchor,_result={},keyTag=null,keyNode=null,valueNode=null,atExplicitKey=false,detected=false,ch;if(null!==state.anchor){state.anchorMap[state.anchor]=_result}ch=state.input.charCodeAt(state.position);while(0!==ch){following=state.input.charCodeAt(state.position+1);_line=state.line;if((63===ch||58===ch)&&is_WS_OR_EOL(following)){if(63===ch){if(atExplicitKey){storeMappingPair(state,_result,keyTag,keyNode,null);keyTag=keyNode=valueNode=null}detected=true;atExplicitKey=true;allowCompact=true}else if(atExplicitKey){atExplicitKey=false;allowCompact=true}else{throwError(state,"incomplete explicit mapping pair; a key node is missed")}state.position+=1;ch=following}else if(composeNode(state,flowIndent,CONTEXT_FLOW_OUT,false,true)){if(state.line===_line){ch=state.input.charCodeAt(state.position);while(is_WHITE_SPACE(ch)){ch=state.input.charCodeAt(++state.position)}if(58===ch){ch=state.input.charCodeAt(++state.position);if(!is_WS_OR_EOL(ch)){throwError(state,"a whitespace character is expected after the key-value separator within a block mapping")}if(atExplicitKey){storeMappingPair(state,_result,keyTag,keyNode,null);keyTag=keyNode=valueNode=null}detected=true;atExplicitKey=false;allowCompact=false;keyTag=state.tag;keyNode=state.result}else if(detected){throwError(state,"can not read an implicit mapping pair; a colon is missed")}else{state.tag=_tag;state.anchor=_anchor;return true}}else if(detected){throwError(state,"can not read a block mapping entry; a multiline key may not be an implicit key")}else{state.tag=_tag;state.anchor=_anchor;return true}}else{break}if(state.line===_line||state.lineIndent>nodeIndent){if(composeNode(state,nodeIndent,CONTEXT_BLOCK_OUT,true,allowCompact)){if(atExplicitKey){keyNode=state.result}else{valueNode=state.result}}if(!atExplicitKey){storeMappingPair(state,_result,keyTag,keyNode,valueNode);keyTag=keyNode=valueNode=null}skipSeparationSpace(state,true,-1);ch=state.input.charCodeAt(state.position)}if(state.lineIndent>nodeIndent&&0!==ch){throwError(state,"bad indentation of a mapping entry")}else if(state.lineIndent<nodeIndent){break}}if(atExplicitKey){storeMappingPair(state,_result,keyTag,keyNode,null)}if(detected){state.tag=_tag;state.anchor=_anchor;state.kind="mapping";state.result=_result}return detected}function readTagProperty(state){var _position,isVerbatim=false,isNamed=false,tagHandle,tagName,ch;ch=state.input.charCodeAt(state.position);if(33!==ch){return false}if(null!==state.tag){throwError(state,"duplication of a tag property")}ch=state.input.charCodeAt(++state.position);if(60===ch){isVerbatim=true;ch=state.input.charCodeAt(++state.position)}else if(33===ch){isNamed=true;tagHandle="!!";ch=state.input.charCodeAt(++state.position)}else{tagHandle="!"}_position=state.position;if(isVerbatim){do{ch=state.input.charCodeAt(++state.position)}while(0!==ch&&62!==ch);if(state.position<state.length){tagName=state.input.slice(_position,state.position);ch=state.input.charCodeAt(++state.position)}else{throwError(state,"unexpected end of the stream within a verbatim tag")}}else{while(0!==ch&&!is_WS_OR_EOL(ch)){if(33===ch){if(!isNamed){tagHandle=state.input.slice(_position-1,state.position+1);if(!PATTERN_TAG_HANDLE.test(tagHandle)){throwError(state,"named tag handle cannot contain such characters")}isNamed=true;_position=state.position+1}else{throwError(state,"tag suffix cannot contain exclamation marks")}}ch=state.input.charCodeAt(++state.position)}tagName=state.input.slice(_position,state.position);if(PATTERN_FLOW_INDICATORS.test(tagName)){throwError(state,"tag suffix cannot contain flow indicator characters")}}if(tagName&&!PATTERN_TAG_URI.test(tagName)){throwError(state,"tag name cannot contain such characters: "+tagName)}if(isVerbatim){state.tag=tagName}else if(_hasOwnProperty.call(state.tagMap,tagHandle)){state.tag=state.tagMap[tagHandle]+tagName}else if("!"===tagHandle){state.tag="!"+tagName}else if("!!"===tagHandle){state.tag="tag:yaml.org,2002:"+tagName}else{throwError(state,'undeclared tag handle "'+tagHandle+'"')}return true}function readAnchorProperty(state){var _position,ch;ch=state.input.charCodeAt(state.position);if(38!==ch){return false}if(null!==state.anchor){throwError(state,"duplication of an anchor property")}ch=state.input.charCodeAt(++state.position);_position=state.position;while(0!==ch&&!is_WS_OR_EOL(ch)&&!is_FLOW_INDICATOR(ch)){ch=state.input.charCodeAt(++state.position)}if(state.position===_position){throwError(state,"name of an anchor node must contain at least one character")}state.anchor=state.input.slice(_position,state.position);return true}function readAlias(state){var _position,alias,len=state.length,input=state.input,ch;ch=state.input.charCodeAt(state.position);if(42!==ch){return false}ch=state.input.charCodeAt(++state.position);_position=state.position;while(0!==ch&&!is_WS_OR_EOL(ch)&&!is_FLOW_INDICATOR(ch)){ch=state.input.charCodeAt(++state.position)}if(state.position===_position){throwError(state,"name of an alias node must contain at least one character")}alias=state.input.slice(_position,state.position);if(!state.anchorMap.hasOwnProperty(alias)){throwError(state,'unidentified alias "'+alias+'"')}state.result=state.anchorMap[alias];skipSeparationSpace(state,true,-1);return true}function composeNode(state,parentIndent,nodeContext,allowToSeek,allowCompact){var allowBlockStyles,allowBlockScalars,allowBlockCollections,indentStatus=1,atNewLine=false,hasContent=false,typeIndex,typeQuantity,type,flowIndent,blockIndent,_result;state.tag=null;state.anchor=null;state.kind=null;state.result=null;allowBlockStyles=allowBlockScalars=allowBlockCollections=CONTEXT_BLOCK_OUT===nodeContext||CONTEXT_BLOCK_IN===nodeContext;if(allowToSeek){if(skipSeparationSpace(state,true,-1)){atNewLine=true;if(state.lineIndent>parentIndent){indentStatus=1}else if(state.lineIndent===parentIndent){indentStatus=0}else if(state.lineIndent<parentIndent){indentStatus=-1}}}if(1===indentStatus){while(readTagProperty(state)||readAnchorProperty(state)){if(skipSeparationSpace(state,true,-1)){atNewLine=true;allowBlockCollections=allowBlockStyles;if(state.lineIndent>parentIndent){indentStatus=1}else if(state.lineIndent===parentIndent){indentStatus=0}else if(state.lineIndent<parentIndent){indentStatus=-1}}else{allowBlockCollections=false}}}if(allowBlockCollections){allowBlockCollections=atNewLine||allowCompact}if(1===indentStatus||CONTEXT_BLOCK_OUT===nodeContext){if(CONTEXT_FLOW_IN===nodeContext||CONTEXT_FLOW_OUT===nodeContext){flowIndent=parentIndent}else{flowIndent=parentIndent+1}blockIndent=state.position-state.lineStart;if(1===indentStatus){if(allowBlockCollections&&(readBlockSequence(state,blockIndent)||readBlockMapping(state,blockIndent,flowIndent))||readFlowCollection(state,flowIndent)){hasContent=true}else{if(allowBlockScalars&&readBlockScalar(state,flowIndent)||readSingleQuotedScalar(state,flowIndent)||readDoubleQuotedScalar(state,flowIndent)){hasContent=true}else if(readAlias(state)){hasContent=true;if(null!==state.tag||null!==state.anchor){throwError(state,"alias node should not have any properties")}}else if(readPlainScalar(state,flowIndent,CONTEXT_FLOW_IN===nodeContext)){hasContent=true;if(null===state.tag){state.tag="?"}}if(null!==state.anchor){state.anchorMap[state.anchor]=state.result}}}else if(0===indentStatus){hasContent=allowBlockCollections&&readBlockSequence(state,blockIndent)}}if(null!==state.tag&&"!"!==state.tag){if("?"===state.tag){for(typeIndex=0,typeQuantity=state.implicitTypes.length;typeIndex<typeQuantity;typeIndex+=1){type=state.implicitTypes[typeIndex];if(type.resolve(state.result)){state.result=type.construct(state.result);state.tag=type.tag;if(null!==state.anchor){state.anchorMap[state.anchor]=state.result}break}}}else if(_hasOwnProperty.call(state.typeMap,state.tag)){type=state.typeMap[state.tag];if(null!==state.result&&type.kind!==state.kind){throwError(state,"unacceptable node kind for !<"+state.tag+'> tag; it should be "'+type.kind+'", not "'+state.kind+'"')}if(!type.resolve(state.result)){throwError(state,"cannot resolve a node with !<"+state.tag+"> explicit tag")}else{state.result=type.construct(state.result);if(null!==state.anchor){state.anchorMap[state.anchor]=state.result}}}else{throwWarning(state,"unknown tag !<"+state.tag+">")}}return null!==state.tag||null!==state.anchor||hasContent}function readDocument(state){var documentStart=state.position,_position,directiveName,directiveArgs,hasDirectives=false,ch;state.version=null;state.checkLineBreaks=state.legacy;state.tagMap={};state.anchorMap={};while(0!==(ch=state.input.charCodeAt(state.position))){skipSeparationSpace(state,true,-1);ch=state.input.charCodeAt(state.position);if(state.lineIndent>0||37!==ch){break}hasDirectives=true;ch=state.input.charCodeAt(++state.position);_position=state.position;while(0!==ch&&!is_WS_OR_EOL(ch)){ch=state.input.charCodeAt(++state.position)}directiveName=state.input.slice(_position,state.position);directiveArgs=[];if(directiveName.length<1){throwError(state,"directive name must not be less than one character in length")}while(0!==ch){while(is_WHITE_SPACE(ch)){ch=state.input.charCodeAt(++state.position)}if(35===ch){do{ch=state.input.charCodeAt(++state.position)}while(0!==ch&&!is_EOL(ch));break}if(is_EOL(ch)){break}_position=state.position;while(0!==ch&&!is_WS_OR_EOL(ch)){ch=state.input.charCodeAt(++state.position)}directiveArgs.push(state.input.slice(_position,state.position))}if(0!==ch){readLineBreak(state)}if(_hasOwnProperty.call(directiveHandlers,directiveName)){directiveHandlers[directiveName](state,directiveName,directiveArgs)}else{throwWarning(state,'unknown document directive "'+directiveName+'"')}}skipSeparationSpace(state,true,-1);if(0===state.lineIndent&&45===state.input.charCodeAt(state.position)&&45===state.input.charCodeAt(state.position+1)&&45===state.input.charCodeAt(state.position+2)){state.position+=3;skipSeparationSpace(state,true,-1)}else if(hasDirectives){throwError(state,"directives end mark is expected")}composeNode(state,state.lineIndent-1,CONTEXT_BLOCK_OUT,false,true);skipSeparationSpace(state,true,-1);if(state.checkLineBreaks&&PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart,state.position))){throwWarning(state,"non-ASCII line breaks are interpreted as content")}state.documents.push(state.result);if(state.position===state.lineStart&&testDocumentSeparator(state)){if(46===state.input.charCodeAt(state.position)){state.position+=3;skipSeparationSpace(state,true,-1)}return}if(state.position<state.length-1){throwError(state,"end of the stream or a document separator is expected")}else{return}}function loadDocuments(input,options){input=String(input);options=options||{};if(0!==input.length&&10!==input.charCodeAt(input.length-1)&&13!==input.charCodeAt(input.length-1)){input+="\n"}var state=new State(input,options);if(PATTERN_NON_PRINTABLE.test(state.input)){throwError(state,"the stream contains non-printable characters")}state.input+="\x00";while(32===state.input.charCodeAt(state.position)){state.lineIndent+=1;state.position+=1}while(state.position<state.length-1){readDocument(state)}return state.documents}function loadAll(input,iterator,options){var documents=loadDocuments(input,options),index,length;for(index=0,length=documents.length;index<length;index+=1){iterator(documents[index])}}function load(input,options){var documents=loadDocuments(input,options),index,length;if(0===documents.length){return undefined}else if(1===documents.length){return documents[0]}else{throw new YAMLException("expected a single document in the stream, but found more")}}function safeLoadAll(input,output,options){loadAll(input,output,common.extend({schema:DEFAULT_SAFE_SCHEMA},options))}function safeLoad(input,options){return load(input,common.extend({schema:DEFAULT_SAFE_SCHEMA},options))}module.exports.loadAll=loadAll;module.exports.load=load;module.exports.safeLoadAll=safeLoadAll;module.exports.safeLoad=safeLoad},{"./common":51,"./exception":53,"./mark":55,"./schema/default_full":58,"./schema/default_safe":59}],55:[function(require,module,exports){"use strict"; | |
var common=require("./common");function Mark(name,buffer,position,line,column){this.name=name;this.buffer=buffer;this.position=position;this.line=line;this.column=column}Mark.prototype.getSnippet=function getSnippet(indent,maxLength){var head,start,tail,end,snippet;if(!this.buffer){return null}indent=indent||4;maxLength=maxLength||75;head="";start=this.position;while(start>0&&-1==="\x00\r\n \u2028\u2029".indexOf(this.buffer.charAt(start-1))){start-=1;if(this.position-start>maxLength/2-1){head=" ... ";start+=5;break}}tail="";end=this.position;while(end<this.buffer.length&&-1==="\x00\r\n \u2028\u2029".indexOf(this.buffer.charAt(end))){end+=1;if(end-this.position>maxLength/2-1){tail=" ... ";end-=5;break}}snippet=this.buffer.slice(start,end);return common.repeat(" ",indent)+head+snippet+tail+"\n"+common.repeat(" ",indent+this.position-start+head.length)+"^"};Mark.prototype.toString=function toString(compact){var snippet,where="";if(this.name){where+='in "'+this.name+'" '}where+="at line "+(this.line+1)+", column "+(this.column+1);if(!compact){snippet=this.getSnippet();if(snippet){where+=":\n"+snippet}}return where};module.exports=Mark},{"./common":51}],56:[function(require,module,exports){"use strict";var common=require("./common");var YAMLException=require("./exception");var Type=require("./type");function compileList(schema,name,result){var exclude=[];schema.include.forEach(function(includedSchema){result=compileList(includedSchema,name,result)});schema[name].forEach(function(currentType){result.forEach(function(previousType,previousIndex){if(previousType.tag===currentType.tag){exclude.push(previousIndex)}});result.push(currentType)});return result.filter(function(type,index){return-1===exclude.indexOf(index)})}function compileMap(){var result={},index,length;function collectType(type){result[type.tag]=type}for(index=0,length=arguments.length;index<length;index+=1){arguments[index].forEach(collectType)}return result}function Schema(definition){this.include=definition.include||[];this.implicit=definition.implicit||[];this.explicit=definition.explicit||[];this.implicit.forEach(function(type){if(type.loadKind&&"scalar"!==type.loadKind){throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}});this.compiledImplicit=compileList(this,"implicit",[]);this.compiledExplicit=compileList(this,"explicit",[]);this.compiledTypeMap=compileMap(this.compiledImplicit,this.compiledExplicit)}Schema.DEFAULT=null;Schema.create=function createSchema(){var schemas,types;switch(arguments.length){case 1:schemas=Schema.DEFAULT;types=arguments[0];break;case 2:schemas=arguments[0];types=arguments[1];break;default:throw new YAMLException("Wrong number of arguments for Schema.create function")}schemas=common.toArray(schemas);types=common.toArray(types);if(!schemas.every(function(schema){return schema instanceof Schema})){throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.")}if(!types.every(function(type){return type instanceof Type})){throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.")}return new Schema({include:schemas,explicit:types})};module.exports=Schema},{"./common":51,"./exception":53,"./type":62}],57:[function(require,module,exports){"use strict";var Schema=require("../schema");module.exports=new Schema({include:[require("./json")]})},{"../schema":56,"./json":61}],58:[function(require,module,exports){"use strict";var Schema=require("../schema");module.exports=Schema.DEFAULT=new Schema({include:[require("./default_safe")],explicit:[require("../type/js/undefined"),require("../type/js/regexp"),require("../type/js/function")]})},{"../schema":56,"../type/js/function":67,"../type/js/regexp":68,"../type/js/undefined":69,"./default_safe":59}],59:[function(require,module,exports){"use strict";var Schema=require("../schema");module.exports=new Schema({include:[require("./core")],implicit:[require("../type/timestamp"),require("../type/merge")],explicit:[require("../type/binary"),require("../type/omap"),require("../type/pairs"),require("../type/set")]})},{"../schema":56,"../type/binary":63,"../type/merge":71,"../type/omap":73,"../type/pairs":74,"../type/set":76,"../type/timestamp":78,"./core":57}],60:[function(require,module,exports){"use strict";var Schema=require("../schema");module.exports=new Schema({explicit:[require("../type/str"),require("../type/seq"),require("../type/map")]})},{"../schema":56,"../type/map":70,"../type/seq":75,"../type/str":77}],61:[function(require,module,exports){"use strict";var Schema=require("../schema");module.exports=new Schema({include:[require("./failsafe")],implicit:[require("../type/null"),require("../type/bool"),require("../type/int"),require("../type/float")]})},{"../schema":56,"../type/bool":64,"../type/float":65,"../type/int":66,"../type/null":72,"./failsafe":60}],62:[function(require,module,exports){"use strict";var YAMLException=require("./exception");var TYPE_CONSTRUCTOR_OPTIONS=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"];var YAML_NODE_KINDS=["scalar","sequence","mapping"];function compileStyleAliases(map){var result={};if(null!==map){Object.keys(map).forEach(function(style){map[style].forEach(function(alias){result[String(alias)]=style})})}return result}function Type(tag,options){options=options||{};Object.keys(options).forEach(function(name){if(-1===TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)){throw new YAMLException('Unknown option "'+name+'" is met in definition of "'+tag+'" YAML type.')}});this.tag=tag;this.kind=options["kind"]||null;this.resolve=options["resolve"]||function(){return true};this.construct=options["construct"]||function(data){return data};this.instanceOf=options["instanceOf"]||null;this.predicate=options["predicate"]||null;this.represent=options["represent"]||null;this.defaultStyle=options["defaultStyle"]||null;this.styleAliases=compileStyleAliases(options["styleAliases"]||null);if(-1===YAML_NODE_KINDS.indexOf(this.kind)){throw new YAMLException('Unknown kind "'+this.kind+'" is specified for "'+tag+'" YAML type.')}}module.exports=Type},{"./exception":53}],63:[function(require,module,exports){"use strict";var NodeBuffer=require("buffer").Buffer;var Type=require("../type");var BASE64_MAP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function resolveYamlBinary(data){if(null===data){return false}var code,idx,bitlen=0,len=0,max=data.length,map=BASE64_MAP;for(idx=0;idx<max;idx++){code=map.indexOf(data.charAt(idx));if(code>64){continue}if(code<0){return false}bitlen+=6}return bitlen%8===0}function constructYamlBinary(data){var code,idx,tailbits,input=data.replace(/[\r\n=]/g,""),max=input.length,map=BASE64_MAP,bits=0,result=[];for(idx=0;idx<max;idx++){if(idx%4===0&&idx){result.push(bits>>16&255);result.push(bits>>8&255);result.push(bits&255)}bits=bits<<6|map.indexOf(input.charAt(idx))}tailbits=max%4*6;if(tailbits===0){result.push(bits>>16&255);result.push(bits>>8&255);result.push(bits&255)}else if(tailbits===18){result.push(bits>>10&255);result.push(bits>>2&255)}else if(tailbits===12){result.push(bits>>4&255)}if(NodeBuffer){return new NodeBuffer(result)}return result}function representYamlBinary(object){var result="",bits=0,idx,tail,max=object.length,map=BASE64_MAP;for(idx=0;idx<max;idx++){if(idx%3===0&&idx){result+=map[bits>>18&63];result+=map[bits>>12&63];result+=map[bits>>6&63];result+=map[bits&63]}bits=(bits<<8)+object[idx]}tail=max%3;if(tail===0){result+=map[bits>>18&63];result+=map[bits>>12&63];result+=map[bits>>6&63];result+=map[bits&63]}else if(tail===2){result+=map[bits>>10&63];result+=map[bits>>4&63];result+=map[bits<<2&63];result+=map[64]}else if(tail===1){result+=map[bits>>2&63];result+=map[bits<<4&63];result+=map[64];result+=map[64]}return result}function isBinary(object){return NodeBuffer&&NodeBuffer.isBuffer(object)}module.exports=new Type("tag:yaml.org,2002:binary",{kind:"scalar",resolve:resolveYamlBinary,construct:constructYamlBinary,predicate:isBinary,represent:representYamlBinary})},{"../type":62,buffer:3}],64:[function(require,module,exports){"use strict";var Type=require("../type");function resolveYamlBoolean(data){if(null===data){return false}var max=data.length;return max===4&&(data==="true"||data==="True"||data==="TRUE")||max===5&&(data==="false"||data==="False"||data==="FALSE")}function constructYamlBoolean(data){return data==="true"||data==="True"||data==="TRUE"}function isBoolean(object){return"[object Boolean]"===Object.prototype.toString.call(object)}module.exports=new Type("tag:yaml.org,2002:bool",{kind:"scalar",resolve:resolveYamlBoolean,construct:constructYamlBoolean,predicate:isBoolean,represent:{lowercase:function(object){return object?"true":"false"},uppercase:function(object){return object?"TRUE":"FALSE"},camelcase:function(object){return object?"True":"False"}},defaultStyle:"lowercase"})},{"../type":62}],65:[function(require,module,exports){"use strict";var common=require("../common");var Type=require("../type");var YAML_FLOAT_PATTERN=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?"+"|\\.[0-9_]+(?:[eE][-+][0-9]+)?"+"|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*"+"|[-+]?\\.(?:inf|Inf|INF)"+"|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat(data){if(null===data){return false}var value,sign,base,digits;if(!YAML_FLOAT_PATTERN.test(data)){return false}return true}function constructYamlFloat(data){var value,sign,base,digits;value=data.replace(/_/g,"").toLowerCase();sign="-"===value[0]?-1:1;digits=[];if(0<="+-".indexOf(value[0])){value=value.slice(1)}if(".inf"===value){return 1===sign?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY}else if(".nan"===value){return NaN}else if(0<=value.indexOf(":")){value.split(":").forEach(function(v){digits.unshift(parseFloat(v,10))});value=0;base=1;digits.forEach(function(d){value+=d*base;base*=60});return sign*value}else{return sign*parseFloat(value,10)}}function representYamlFloat(object,style){if(isNaN(object)){switch(style){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}}else if(Number.POSITIVE_INFINITY===object){switch(style){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}}else if(Number.NEGATIVE_INFINITY===object){switch(style){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}}else if(common.isNegativeZero(object)){return"-0.0"}else{return object.toString(10)}}function isFloat(object){return"[object Number]"===Object.prototype.toString.call(object)&&(0!==object%1||common.isNegativeZero(object))}module.exports=new Type("tag:yaml.org,2002:float",{kind:"scalar",resolve:resolveYamlFloat,construct:constructYamlFloat,predicate:isFloat,represent:representYamlFloat,defaultStyle:"lowercase"})},{"../common":51,"../type":62}],66:[function(require,module,exports){"use strict";var common=require("../common");var Type=require("../type");function isHexCode(c){return 48<=c&&c<=57||65<=c&&c<=70||97<=c&&c<=102}function isOctCode(c){return 48<=c&&c<=55}function isDecCode(c){return 48<=c&&c<=57}function resolveYamlInteger(data){if(null===data){return false}var max=data.length,index=0,hasDigits=false,ch;if(!max){return false}ch=data[index];if(ch==="-"||ch==="+"){ch=data[++index]}if(ch==="0"){if(index+1===max){return true}ch=data[++index];if(ch==="b"){index++;for(;index<max;index++){ch=data[index];if(ch==="_"){continue}if(ch!=="0"&&ch!=="1"){return false}hasDigits=true}return hasDigits}if(ch==="x"){index++;for(;index<max;index++){ch=data[index];if(ch==="_"){continue}if(!isHexCode(data.charCodeAt(index))){return false}hasDigits=true}return hasDigits}for(;index<max;index++){ch=data[index];if(ch==="_"){continue}if(!isOctCode(data.charCodeAt(index))){return false}hasDigits=true}return hasDigits}for(;index<max;index++){ch=data[index];if(ch==="_"){continue}if(ch===":"){break}if(!isDecCode(data.charCodeAt(index))){return false}hasDigits=true}if(!hasDigits){return false}if(ch!==":"){return true}return/^(:[0-5]?[0-9])+$/.test(data.slice(index))}function constructYamlInteger(data){var value=data,sign=1,ch,base,digits=[];if(value.indexOf("_")!==-1){value=value.replace(/_/g,"")}ch=value[0];if(ch==="-"||ch==="+"){if(ch==="-"){sign=-1}value=value.slice(1);ch=value[0]}if("0"===value){return 0}if(ch==="0"){if(value[1]==="b"){return sign*parseInt(value.slice(2),2)}if(value[1]==="x"){return sign*parseInt(value,16)}return sign*parseInt(value,8)}if(value.indexOf(":")!==-1){value.split(":").forEach(function(v){digits.unshift(parseInt(v,10))});value=0;base=1;digits.forEach(function(d){value+=d*base;base*=60});return sign*value}return sign*parseInt(value,10)}function isInteger(object){return"[object Number]"===Object.prototype.toString.call(object)&&(0===object%1&&!common.isNegativeZero(object))}module.exports=new Type("tag:yaml.org,2002:int",{kind:"scalar",resolve:resolveYamlInteger,construct:constructYamlInteger,predicate:isInteger,represent:{binary:function(object){return"0b"+object.toString(2)},octal:function(object){return"0"+object.toString(8)},decimal:function(object){return object.toString(10)},hexadecimal:function(object){return"0x"+object.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":51,"../type":62}],67:[function(require,module,exports){"use strict";var esprima;try{esprima=require("esprima")}catch(_){if(typeof window!=="undefined"){esprima=window.esprima}}var Type=require("../../type");function resolveJavascriptFunction(data){if(null===data){return false}try{var source="("+data+")",ast=esprima.parse(source,{range:true}),params=[],body;if("Program"!==ast.type||1!==ast.body.length||"ExpressionStatement"!==ast.body[0].type||"FunctionExpression"!==ast.body[0].expression.type){return false}return true}catch(err){return false}}function constructJavascriptFunction(data){var source="("+data+")",ast=esprima.parse(source,{range:true}),params=[],body;if("Program"!==ast.type||1!==ast.body.length||"ExpressionStatement"!==ast.body[0].type||"FunctionExpression"!==ast.body[0].expression.type){throw new Error("Failed to resolve function")}ast.body[0].expression.params.forEach(function(param){params.push(param.name)});body=ast.body[0].expression.body.range;return new Function(params,source.slice(body[0]+1,body[1]-1))}function representJavascriptFunction(object){return object.toString()}function isFunction(object){return"[object Function]"===Object.prototype.toString.call(object)}module.exports=new Type("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:resolveJavascriptFunction,construct:constructJavascriptFunction,predicate:isFunction,represent:representJavascriptFunction})},{"../../type":62,esprima:79}],68:[function(require,module,exports){"use strict";var Type=require("../../type");function resolveJavascriptRegExp(data){if(null===data){return false}if(0===data.length){return false}var regexp=data,tail=/\/([gim]*)$/.exec(data),modifiers="";if("/"===regexp[0]){if(tail){modifiers=tail[1]}if(modifiers.length>3){return false}if(regexp[regexp.length-modifiers.length-1]!=="/"){return false}regexp=regexp.slice(1,regexp.length-modifiers.length-1)}try{var dummy=new RegExp(regexp,modifiers);return true}catch(error){return false}}function constructJavascriptRegExp(data){var regexp=data,tail=/\/([gim]*)$/.exec(data),modifiers="";if("/"===regexp[0]){if(tail){modifiers=tail[1]}regexp=regexp.slice(1,regexp.length-modifiers.length-1)}return new RegExp(regexp,modifiers)}function representJavascriptRegExp(object){var result="/"+object.source+"/";if(object.global){result+="g"}if(object.multiline){result+="m"}if(object.ignoreCase){result+="i"}return result}function isRegExp(object){return"[object RegExp]"===Object.prototype.toString.call(object)}module.exports=new Type("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:resolveJavascriptRegExp,construct:constructJavascriptRegExp,predicate:isRegExp,represent:representJavascriptRegExp})},{"../../type":62}],69:[function(require,module,exports){"use strict";var Type=require("../../type");function resolveJavascriptUndefined(){return true}function constructJavascriptUndefined(){return undefined}function representJavascriptUndefined(){return""}function isUndefined(object){return"undefined"===typeof object}module.exports=new Type("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:resolveJavascriptUndefined,construct:constructJavascriptUndefined,predicate:isUndefined,represent:representJavascriptUndefined})},{"../../type":62}],70:[function(require,module,exports){"use strict";var Type=require("../type");module.exports=new Type("tag:yaml.org,2002:map",{kind:"mapping",construct:function(data){return null!==data?data:{}}})},{"../type":62}],71:[function(require,module,exports){"use strict";var Type=require("../type");function resolveYamlMerge(data){return"<<"===data||null===data}module.exports=new Type("tag:yaml.org,2002:merge",{kind:"scalar",resolve:resolveYamlMerge})},{"../type":62}],72:[function(require,module,exports){"use strict";var Type=require("../type");function resolveYamlNull(data){if(null===data){return true}var max=data.length;return max===1&&data==="~"||max===4&&(data==="null"||data==="Null"||data==="NULL")}function constructYamlNull(){return null}function isNull(object){return null===object}module.exports=new Type("tag:yaml.org,2002:null",{kind:"scalar",resolve:resolveYamlNull,construct:constructYamlNull,predicate:isNull,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":62}],73:[function(require,module,exports){"use strict";var Type=require("../type");var _hasOwnProperty=Object.prototype.hasOwnProperty;var _toString=Object.prototype.toString;function resolveYamlOmap(data){if(null===data){return true}var objectKeys=[],index,length,pair,pairKey,pairHasKey,object=data;for(index=0,length=object.length;index<length;index+=1){pair=object[index];pairHasKey=false;if("[object Object]"!==_toString.call(pair)){return false}for(pairKey in pair){if(_hasOwnProperty.call(pair,pairKey)){if(!pairHasKey){pairHasKey=true}else{return false}}}if(!pairHasKey){return false}if(-1===objectKeys.indexOf(pairKey)){objectKeys.push(pairKey)}else{return false}}return true}function constructYamlOmap(data){return null!==data?data:[]}module.exports=new Type("tag:yaml.org,2002:omap",{kind:"sequence",resolve:resolveYamlOmap,construct:constructYamlOmap})},{"../type":62}],74:[function(require,module,exports){"use strict";var Type=require("../type");var _toString=Object.prototype.toString;function resolveYamlPairs(data){if(null===data){return true}var index,length,pair,keys,result,object=data;result=new Array(object.length);for(index=0,length=object.length;index<length;index+=1){pair=object[index];if("[object Object]"!==_toString.call(pair)){return false}keys=Object.keys(pair);if(1!==keys.length){return false}result[index]=[keys[0],pair[keys[0]]]}return true}function constructYamlPairs(data){if(null===data){return[]}var index,length,pair,keys,result,object=data;result=new Array(object.length);for(index=0,length=object.length;index<length;index+=1){pair=object[index];keys=Object.keys(pair);result[index]=[keys[0],pair[keys[0]]]}return result}module.exports=new Type("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:resolveYamlPairs,construct:constructYamlPairs})},{"../type":62}],75:[function(require,module,exports){"use strict";var Type=require("../type");module.exports=new Type("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(data){return null!==data?data:[]}})},{"../type":62}],76:[function(require,module,exports){"use strict";var Type=require("../type");var _hasOwnProperty=Object.prototype.hasOwnProperty;function resolveYamlSet(data){if(null===data){return true}var key,object=data;for(key in object){if(_hasOwnProperty.call(object,key)){if(null!==object[key]){return false}}}return true}function constructYamlSet(data){return null!==data?data:{}}module.exports=new Type("tag:yaml.org,2002:set",{kind:"mapping",resolve:resolveYamlSet,construct:constructYamlSet})},{"../type":62}],77:[function(require,module,exports){"use strict";var Type=require("../type");module.exports=new Type("tag:yaml.org,2002:str",{kind:"scalar",construct:function(data){return null!==data?data:""}})},{"../type":62}],78:[function(require,module,exports){"use strict";var Type=require("../type");var YAML_TIMESTAMP_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])"+"-([0-9][0-9]?)"+"-([0-9][0-9]?)"+"(?:(?:[Tt]|[ \\t]+)"+"([0-9][0-9]?)"+":([0-9][0-9])"+":([0-9][0-9])"+"(?:\\.([0-9]*))?"+"(?:[ \\t]*(Z|([-+])([0-9][0-9]?)"+"(?::([0-9][0-9]))?))?)?$");function resolveYamlTimestamp(data){if(null===data){return false}var match,year,month,day,hour,minute,second,fraction=0,delta=null,tz_hour,tz_minute,date;match=YAML_TIMESTAMP_REGEXP.exec(data);if(null===match){return false}return true}function constructYamlTimestamp(data){var match,year,month,day,hour,minute,second,fraction=0,delta=null,tz_hour,tz_minute,date;match=YAML_TIMESTAMP_REGEXP.exec(data);if(null===match){throw new Error("Date resolve error")}year=+match[1];month=+match[2]-1;day=+match[3];if(!match[4]){return new Date(Date.UTC(year,month,day))}hour=+match[4];minute=+match[5];second=+match[6];if(match[7]){fraction=match[7].slice(0,3);while(fraction.length<3){fraction+="0"}fraction=+fraction}if(match[9]){tz_hour=+match[10];tz_minute=+(match[11]||0);delta=(tz_hour*60+tz_minute)*6e4;if("-"===match[9]){delta=-delta}}date=new Date(Date.UTC(year,month,day,hour,minute,second,fraction));if(delta){date.setTime(date.getTime()-delta)}return date}function representYamlTimestamp(object){return object.toISOString()}module.exports=new Type("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:resolveYamlTimestamp,construct:constructYamlTimestamp,instanceOf:Date,represent:representYamlTimestamp})},{"../type":62}],79:[function(require,module,exports){(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],factory)}else if(typeof exports!=="undefined"){factory(exports)}else{factory(root.esprima={})}})(this,function(exports){"use strict";var Token,TokenName,Syntax,PropertyKind,Messages,Regex,source,strict,index,lineNumber,lineStart,length,buffer,state,extra;Token={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8};TokenName={};TokenName[Token.BooleanLiteral]="Boolean";TokenName[Token.EOF]="<end>";TokenName[Token.Identifier]="Identifier";TokenName[Token.Keyword]="Keyword";TokenName[Token.NullLiteral]="Null";TokenName[Token.NumericLiteral]="Numeric";TokenName[Token.Punctuator]="Punctuator";TokenName[Token.StringLiteral]="String";Syntax={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"};PropertyKind={Data:1,Get:2,Set:4};Messages={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"};Regex={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")};function assert(condition,message){if(!condition){throw new Error("ASSERT: "+message)}}function sliceSource(from,to){return source.slice(from,to)}if(typeof"esprima"[0]==="undefined"){sliceSource=function sliceArraySource(from,to){return source.slice(from,to).join("")}}function isDecimalDigit(ch){return"0123456789".indexOf(ch)>=0}function isHexDigit(ch){return"0123456789abcdefABCDEF".indexOf(ch)>=0}function isOctalDigit(ch){return"01234567".indexOf(ch)>=0}function isWhiteSpace(ch){return ch===" "||ch===" "||ch===""||ch==="\f"||ch===" "||ch.charCodeAt(0)>=5760&&" ".indexOf(ch)>=0}function isLineTerminator(ch){return ch==="\n"||ch==="\r"||ch==="\u2028"||ch==="\u2029"}function isIdentifierStart(ch){return ch==="$"||ch==="_"||ch==="\\"||ch>="a"&&ch<="z"||ch>="A"&&ch<="Z"||ch.charCodeAt(0)>=128&&Regex.NonAsciiIdentifierStart.test(ch)}function isIdentifierPart(ch){return ch==="$"||ch==="_"||ch==="\\"||ch>="a"&&ch<="z"||ch>="A"&&ch<="Z"||ch>="0"&&ch<="9"||ch.charCodeAt(0)>=128&&Regex.NonAsciiIdentifierPart.test(ch)}function isFutureReservedWord(id){switch(id){case"class":case"enum":case"export":case"extends":case"import":case"super":return true}return false}function isStrictModeReservedWord(id){switch(id){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return true}return false}function isRestrictedWord(id){return id==="eval"||id==="arguments"}function isKeyword(id){var keyword=false;switch(id.length){case 2:keyword=id==="if"||id==="in"||id==="do";break;case 3:keyword=id==="var"||id==="for"||id==="new"||id==="try";break;case 4:keyword=id==="this"||id==="else"||id==="case"||id==="void"||id==="with";break;case 5:keyword=id==="while"||id==="break"||id==="catch"||id==="throw";break;case 6:keyword=id==="return"||id==="typeof"||id==="delete"||id==="switch";break;case 7:keyword=id==="default"||id==="finally";break;case 8:keyword=id==="function"||id==="continue"||id==="debugger";break;case 10:keyword=id==="instanceof";break}if(keyword){return true}switch(id){case"const":return true;case"yield":case"let":return true}if(strict&&isStrictModeReservedWord(id)){return true}return isFutureReservedWord(id)}function skipComment(){var ch,blockComment,lineComment;blockComment=false;lineComment=false;while(index<length){ch=source[index];if(lineComment){ch=source[index++];if(isLineTerminator(ch)){lineComment=false;if(ch==="\r"&&source[index]==="\n"){++index}++lineNumber;lineStart=index}}else if(blockComment){if(isLineTerminator(ch)){if(ch==="\r"&&source[index+1]==="\n"){++index}++lineNumber;++index;lineStart=index;if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}else{ch=source[index++];if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(ch==="*"){ch=source[index];if(ch==="/"){++index;blockComment=false}}}}else if(ch==="/"){ch=source[index+1];if(ch==="/"){index+=2;lineComment=true}else if(ch==="*"){index+=2;blockComment=true;if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}else{break}}else if(isWhiteSpace(ch)){++index}else if(isLineTerminator(ch)){++index;if(ch==="\r"&&source[index]==="\n"){++index}++lineNumber;lineStart=index}else{break}}}function scanHexEscape(prefix){var i,len,ch,code=0;len=prefix==="u"?4:2;for(i=0;i<len;++i){if(index<length&&isHexDigit(source[index])){ch=source[index++];code=code*16+"0123456789abcdef".indexOf(ch.toLowerCase())}else{return""}}return String.fromCharCode(code)}function scanIdentifier(){var ch,start,id,restore;ch=source[index];if(!isIdentifierStart(ch)){return | |
}start=index;if(ch==="\\"){++index;if(source[index]!=="u"){return}++index;restore=index;ch=scanHexEscape("u");if(ch){if(ch==="\\"||!isIdentifierStart(ch)){return}id=ch}else{index=restore;id="u"}}else{id=source[index++]}while(index<length){ch=source[index];if(!isIdentifierPart(ch)){break}if(ch==="\\"){++index;if(source[index]!=="u"){return}++index;restore=index;ch=scanHexEscape("u");if(ch){if(ch==="\\"||!isIdentifierPart(ch)){return}id+=ch}else{index=restore;id+="u"}}else{id+=source[index++]}}if(id.length===1){return{type:Token.Identifier,value:id,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(isKeyword(id)){return{type:Token.Keyword,value:id,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(id==="null"){return{type:Token.NullLiteral,value:id,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(id==="true"||id==="false"){return{type:Token.BooleanLiteral,value:id,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}return{type:Token.Identifier,value:id,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanPunctuator(){var start=index,ch1=source[index],ch2,ch3,ch4;if(ch1===";"||ch1==="{"||ch1==="}"){++index;return{type:Token.Punctuator,value:ch1,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1===","||ch1==="("||ch1===")"){++index;return{type:Token.Punctuator,value:ch1,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}ch2=source[index+1];if(ch1==="."&&!isDecimalDigit(ch2)){return{type:Token.Punctuator,value:source[index++],lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}ch3=source[index+2];ch4=source[index+3];if(ch1===">"&&ch2===">"&&ch3===">"){if(ch4==="="){index+=4;return{type:Token.Punctuator,value:">>>=",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}}if(ch1==="="&&ch2==="="&&ch3==="="){index+=3;return{type:Token.Punctuator,value:"===",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1==="!"&&ch2==="="&&ch3==="="){index+=3;return{type:Token.Punctuator,value:"!==",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1===">"&&ch2===">"&&ch3===">"){index+=3;return{type:Token.Punctuator,value:">>>",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1==="<"&&ch2==="<"&&ch3==="="){index+=3;return{type:Token.Punctuator,value:"<<=",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch1===">"&&ch2===">"&&ch3==="="){index+=3;return{type:Token.Punctuator,value:">>=",lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(ch2==="="){if("<>=!+-*%&|^/".indexOf(ch1)>=0){index+=2;return{type:Token.Punctuator,value:ch1+ch2,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}}if(ch1===ch2&&"+-<>&|".indexOf(ch1)>=0){if("+-<>&|".indexOf(ch2)>=0){index+=2;return{type:Token.Punctuator,value:ch1+ch2,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}}if("[]<>+-*%&|^!~?:=/".indexOf(ch1)>=0){return{type:Token.Punctuator,value:source[index++],lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}}function scanNumericLiteral(){var number,start,ch;ch=source[index];assert(isDecimalDigit(ch)||ch===".","Numeric literal must start with a decimal digit or a decimal point");start=index;number="";if(ch!=="."){number=source[index++];ch=source[index];if(number==="0"){if(ch==="x"||ch==="X"){number+=source[index++];while(index<length){ch=source[index];if(!isHexDigit(ch)){break}number+=source[index++]}if(number.length<=2){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(index<length){ch=source[index];if(isIdentifierStart(ch)){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}return{type:Token.NumericLiteral,value:parseInt(number,16),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}else if(isOctalDigit(ch)){number+=source[index++];while(index<length){ch=source[index];if(!isOctalDigit(ch)){break}number+=source[index++]}if(index<length){ch=source[index];if(isIdentifierStart(ch)||isDecimalDigit(ch)){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}return{type:Token.NumericLiteral,value:parseInt(number,8),octal:true,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}if(isDecimalDigit(ch)){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}while(index<length){ch=source[index];if(!isDecimalDigit(ch)){break}number+=source[index++]}}if(ch==="."){number+=source[index++];while(index<length){ch=source[index];if(!isDecimalDigit(ch)){break}number+=source[index++]}}if(ch==="e"||ch==="E"){number+=source[index++];ch=source[index];if(ch==="+"||ch==="-"){number+=source[index++]}ch=source[index];if(isDecimalDigit(ch)){number+=source[index++];while(index<length){ch=source[index];if(!isDecimalDigit(ch)){break}number+=source[index++]}}else{ch="character "+ch;if(index>=length){ch="<end>"}throwError({},Messages.UnexpectedToken,"ILLEGAL")}}if(index<length){ch=source[index];if(isIdentifierStart(ch)){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}return{type:Token.NumericLiteral,value:parseFloat(number),lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanStringLiteral(){var str="",quote,start,ch,code,unescaped,restore,octal=false;quote=source[index];assert(quote==="'"||quote==='"',"String literal must starts with a quote");start=index;++index;while(index<length){ch=source[index++];if(ch===quote){quote="";break}else if(ch==="\\"){ch=source[index++];if(!isLineTerminator(ch)){switch(ch){case"n":str+="\n";break;case"r":str+="\r";break;case"t":str+=" ";break;case"u":case"x":restore=index;unescaped=scanHexEscape(ch);if(unescaped){str+=unescaped}else{index=restore;str+=ch}break;case"b":str+="\b";break;case"f":str+="\f";break;case"v":str+="";break;default:if(isOctalDigit(ch)){code="01234567".indexOf(ch);if(code!==0){octal=true}if(index<length&&isOctalDigit(source[index])){octal=true;code=code*8+"01234567".indexOf(source[index++]);if("0123".indexOf(ch)>=0&&index<length&&isOctalDigit(source[index])){code=code*8+"01234567".indexOf(source[index++])}}str+=String.fromCharCode(code)}else{str+=ch}break}}else{++lineNumber;if(ch==="\r"&&source[index]==="\n"){++index}}}else if(isLineTerminator(ch)){break}else{str+=ch}}if(quote!==""){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.StringLiteral,value:str,octal:octal,lineNumber:lineNumber,lineStart:lineStart,range:[start,index]}}function scanRegExp(){var str,ch,start,pattern,flags,value,classMarker=false,restore,terminated=false;buffer=null;skipComment();start=index;ch=source[index];assert(ch==="/","Regular expression literal must start with a slash");str=source[index++];while(index<length){ch=source[index++];str+=ch;if(ch==="\\"){ch=source[index++];if(isLineTerminator(ch)){throwError({},Messages.UnterminatedRegExp)}str+=ch}else if(classMarker){if(ch==="]"){classMarker=false}}else{if(ch==="/"){terminated=true;break}else if(ch==="["){classMarker=true}else if(isLineTerminator(ch)){throwError({},Messages.UnterminatedRegExp)}}}if(!terminated){throwError({},Messages.UnterminatedRegExp)}pattern=str.substr(1,str.length-2);flags="";while(index<length){ch=source[index];if(!isIdentifierPart(ch)){break}++index;if(ch==="\\"&&index<length){ch=source[index];if(ch==="u"){++index;restore=index;ch=scanHexEscape("u");if(ch){flags+=ch;str+="\\u";for(;restore<index;++restore){str+=source[restore]}}else{index=restore;flags+="u";str+="\\u"}}else{str+="\\"}}else{flags+=ch;str+=ch}}try{value=new RegExp(pattern,flags)}catch(e){throwError({},Messages.InvalidRegExp)}return{literal:str,value:value,range:[start,index]}}function isIdentifierName(token){return token.type===Token.Identifier||token.type===Token.Keyword||token.type===Token.BooleanLiteral||token.type===Token.NullLiteral}function advance(){var ch,token;skipComment();if(index>=length){return{type:Token.EOF,lineNumber:lineNumber,lineStart:lineStart,range:[index,index]}}token=scanPunctuator();if(typeof token!=="undefined"){return token}ch=source[index];if(ch==="'"||ch==='"'){return scanStringLiteral()}if(ch==="."||isDecimalDigit(ch)){return scanNumericLiteral()}token=scanIdentifier();if(typeof token!=="undefined"){return token}throwError({},Messages.UnexpectedToken,"ILLEGAL")}function lex(){var token;if(buffer){index=buffer.range[1];lineNumber=buffer.lineNumber;lineStart=buffer.lineStart;token=buffer;buffer=null;return token}buffer=null;return advance()}function lookahead(){var pos,line,start;if(buffer!==null){return buffer}pos=index;line=lineNumber;start=lineStart;buffer=advance();index=pos;lineNumber=line;lineStart=start;return buffer}function peekLineTerminator(){var pos,line,start,found;pos=index;line=lineNumber;start=lineStart;skipComment();found=lineNumber!==line;index=pos;lineNumber=line;lineStart=start;return found}function throwError(token,messageFormat){var error,args=Array.prototype.slice.call(arguments,2),msg=messageFormat.replace(/%(\d)/g,function(whole,index){return args[index]||""});if(typeof token.lineNumber==="number"){error=new Error("Line "+token.lineNumber+": "+msg);error.index=token.range[0];error.lineNumber=token.lineNumber;error.column=token.range[0]-lineStart+1}else{error=new Error("Line "+lineNumber+": "+msg);error.index=index;error.lineNumber=lineNumber;error.column=index-lineStart+1}throw error}function throwErrorTolerant(){try{throwError.apply(null,arguments)}catch(e){if(extra.errors){extra.errors.push(e)}else{throw e}}}function throwUnexpected(token){if(token.type===Token.EOF){throwError(token,Messages.UnexpectedEOS)}if(token.type===Token.NumericLiteral){throwError(token,Messages.UnexpectedNumber)}if(token.type===Token.StringLiteral){throwError(token,Messages.UnexpectedString)}if(token.type===Token.Identifier){throwError(token,Messages.UnexpectedIdentifier)}if(token.type===Token.Keyword){if(isFutureReservedWord(token.value)){throwError(token,Messages.UnexpectedReserved)}else if(strict&&isStrictModeReservedWord(token.value)){throwErrorTolerant(token,Messages.StrictReservedWord);return}throwError(token,Messages.UnexpectedToken,token.value)}throwError(token,Messages.UnexpectedToken,token.value)}function expect(value){var token=lex();if(token.type!==Token.Punctuator||token.value!==value){throwUnexpected(token)}}function expectKeyword(keyword){var token=lex();if(token.type!==Token.Keyword||token.value!==keyword){throwUnexpected(token)}}function match(value){var token=lookahead();return token.type===Token.Punctuator&&token.value===value}function matchKeyword(keyword){var token=lookahead();return token.type===Token.Keyword&&token.value===keyword}function matchAssign(){var token=lookahead(),op=token.value;if(token.type!==Token.Punctuator){return false}return op==="="||op==="*="||op==="/="||op==="%="||op==="+="||op==="-="||op==="<<="||op===">>="||op===">>>="||op==="&="||op==="^="||op==="|="}function consumeSemicolon(){var token,line;if(source[index]===";"){lex();return}line=lineNumber;skipComment();if(lineNumber!==line){return}if(match(";")){lex();return}token=lookahead();if(token.type!==Token.EOF&&!match("}")){throwUnexpected(token)}}function isLeftHandSide(expr){return expr.type===Syntax.Identifier||expr.type===Syntax.MemberExpression}function parseArrayInitialiser(){var elements=[];expect("[");while(!match("]")){if(match(",")){lex();elements.push(null)}else{elements.push(parseAssignmentExpression());if(!match("]")){expect(",")}}}expect("]");return{type:Syntax.ArrayExpression,elements:elements}}function parsePropertyFunction(param,first){var previousStrict,body;previousStrict=strict;body=parseFunctionSourceElements();if(first&&strict&&isRestrictedWord(param[0].name)){throwErrorTolerant(first,Messages.StrictParamName)}strict=previousStrict;return{type:Syntax.FunctionExpression,id:null,params:param,defaults:[],body:body,rest:null,generator:false,expression:false}}function parseObjectPropertyKey(){var token=lex();if(token.type===Token.StringLiteral||token.type===Token.NumericLiteral){if(strict&&token.octal){throwErrorTolerant(token,Messages.StrictOctalLiteral)}return createLiteral(token)}return{type:Syntax.Identifier,name:token.value}}function parseObjectProperty(){var token,key,id,param;token=lookahead();if(token.type===Token.Identifier){id=parseObjectPropertyKey();if(token.value==="get"&&!match(":")){key=parseObjectPropertyKey();expect("(");expect(")");return{type:Syntax.Property,key:key,value:parsePropertyFunction([]),kind:"get"}}else if(token.value==="set"&&!match(":")){key=parseObjectPropertyKey();expect("(");token=lookahead();if(token.type!==Token.Identifier){expect(")");throwErrorTolerant(token,Messages.UnexpectedToken,token.value);return{type:Syntax.Property,key:key,value:parsePropertyFunction([]),kind:"set"}}else{param=[parseVariableIdentifier()];expect(")");return{type:Syntax.Property,key:key,value:parsePropertyFunction(param,token),kind:"set"}}}else{expect(":");return{type:Syntax.Property,key:id,value:parseAssignmentExpression(),kind:"init"}}}else if(token.type===Token.EOF||token.type===Token.Punctuator){throwUnexpected(token)}else{key=parseObjectPropertyKey();expect(":");return{type:Syntax.Property,key:key,value:parseAssignmentExpression(),kind:"init"}}}function parseObjectInitialiser(){var properties=[],property,name,kind,map={},toString=String;expect("{");while(!match("}")){property=parseObjectProperty();if(property.key.type===Syntax.Identifier){name=property.key.name}else{name=toString(property.key.value)}kind=property.kind==="init"?PropertyKind.Data:property.kind==="get"?PropertyKind.Get:PropertyKind.Set;if(Object.prototype.hasOwnProperty.call(map,name)){if(map[name]===PropertyKind.Data){if(strict&&kind===PropertyKind.Data){throwErrorTolerant({},Messages.StrictDuplicateProperty)}else if(kind!==PropertyKind.Data){throwErrorTolerant({},Messages.AccessorDataProperty)}}else{if(kind===PropertyKind.Data){throwErrorTolerant({},Messages.AccessorDataProperty)}else if(map[name]&kind){throwErrorTolerant({},Messages.AccessorGetSet)}}map[name]|=kind}else{map[name]=kind}properties.push(property);if(!match("}")){expect(",")}}expect("}");return{type:Syntax.ObjectExpression,properties:properties}}function parseGroupExpression(){var expr;expect("(");expr=parseExpression();expect(")");return expr}function parsePrimaryExpression(){var token=lookahead(),type=token.type;if(type===Token.Identifier){return{type:Syntax.Identifier,name:lex().value}}if(type===Token.StringLiteral||type===Token.NumericLiteral){if(strict&&token.octal){throwErrorTolerant(token,Messages.StrictOctalLiteral)}return createLiteral(lex())}if(type===Token.Keyword){if(matchKeyword("this")){lex();return{type:Syntax.ThisExpression}}if(matchKeyword("function")){return parseFunctionExpression()}}if(type===Token.BooleanLiteral){lex();token.value=token.value==="true";return createLiteral(token)}if(type===Token.NullLiteral){lex();token.value=null;return createLiteral(token)}if(match("[")){return parseArrayInitialiser()}if(match("{")){return parseObjectInitialiser()}if(match("(")){return parseGroupExpression()}if(match("/")||match("/=")){return createLiteral(scanRegExp())}return throwUnexpected(lex())}function parseArguments(){var args=[];expect("(");if(!match(")")){while(index<length){args.push(parseAssignmentExpression());if(match(")")){break}expect(",")}}expect(")");return args}function parseNonComputedProperty(){var token=lex();if(!isIdentifierName(token)){throwUnexpected(token)}return{type:Syntax.Identifier,name:token.value}}function parseNonComputedMember(){expect(".");return parseNonComputedProperty()}function parseComputedMember(){var expr;expect("[");expr=parseExpression();expect("]");return expr}function parseNewExpression(){var expr;expectKeyword("new");expr={type:Syntax.NewExpression,callee:parseLeftHandSideExpression(),arguments:[]};if(match("(")){expr["arguments"]=parseArguments()}return expr}function parseLeftHandSideExpressionAllowCall(){var expr;expr=matchKeyword("new")?parseNewExpression():parsePrimaryExpression();while(match(".")||match("[")||match("(")){if(match("(")){expr={type:Syntax.CallExpression,callee:expr,arguments:parseArguments()}}else if(match("[")){expr={type:Syntax.MemberExpression,computed:true,object:expr,property:parseComputedMember()}}else{expr={type:Syntax.MemberExpression,computed:false,object:expr,property:parseNonComputedMember()}}}return expr}function parseLeftHandSideExpression(){var expr;expr=matchKeyword("new")?parseNewExpression():parsePrimaryExpression();while(match(".")||match("[")){if(match("[")){expr={type:Syntax.MemberExpression,computed:true,object:expr,property:parseComputedMember()}}else{expr={type:Syntax.MemberExpression,computed:false,object:expr,property:parseNonComputedMember()}}}return expr}function parsePostfixExpression(){var expr=parseLeftHandSideExpressionAllowCall(),token;token=lookahead();if(token.type!==Token.Punctuator){return expr}if((match("++")||match("--"))&&!peekLineTerminator()){if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){throwErrorTolerant({},Messages.StrictLHSPostfix)}if(!isLeftHandSide(expr)){throwErrorTolerant({},Messages.InvalidLHSInAssignment)}expr={type:Syntax.UpdateExpression,operator:lex().value,argument:expr,prefix:false}}return expr}function parseUnaryExpression(){var token,expr;token=lookahead();if(token.type!==Token.Punctuator&&token.type!==Token.Keyword){return parsePostfixExpression()}if(match("++")||match("--")){token=lex();expr=parseUnaryExpression();if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){throwErrorTolerant({},Messages.StrictLHSPrefix)}if(!isLeftHandSide(expr)){throwErrorTolerant({},Messages.InvalidLHSInAssignment)}expr={type:Syntax.UpdateExpression,operator:token.value,argument:expr,prefix:true};return expr}if(match("+")||match("-")||match("~")||match("!")){expr={type:Syntax.UnaryExpression,operator:lex().value,argument:parseUnaryExpression(),prefix:true};return expr}if(matchKeyword("delete")||matchKeyword("void")||matchKeyword("typeof")){expr={type:Syntax.UnaryExpression,operator:lex().value,argument:parseUnaryExpression(),prefix:true};if(strict&&expr.operator==="delete"&&expr.argument.type===Syntax.Identifier){throwErrorTolerant({},Messages.StrictDelete)}return expr}return parsePostfixExpression()}function parseMultiplicativeExpression(){var expr=parseUnaryExpression();while(match("*")||match("/")||match("%")){expr={type:Syntax.BinaryExpression,operator:lex().value,left:expr,right:parseUnaryExpression()}}return expr}function parseAdditiveExpression(){var expr=parseMultiplicativeExpression();while(match("+")||match("-")){expr={type:Syntax.BinaryExpression,operator:lex().value,left:expr,right:parseMultiplicativeExpression()}}return expr}function parseShiftExpression(){var expr=parseAdditiveExpression();while(match("<<")||match(">>")||match(">>>")){expr={type:Syntax.BinaryExpression,operator:lex().value,left:expr,right:parseAdditiveExpression()}}return expr}function parseRelationalExpression(){var expr,previousAllowIn;previousAllowIn=state.allowIn;state.allowIn=true;expr=parseShiftExpression();while(match("<")||match(">")||match("<=")||match(">=")||previousAllowIn&&matchKeyword("in")||matchKeyword("instanceof")){expr={type:Syntax.BinaryExpression,operator:lex().value,left:expr,right:parseShiftExpression()}}state.allowIn=previousAllowIn;return expr}function parseEqualityExpression(){var expr=parseRelationalExpression();while(match("==")||match("!=")||match("===")||match("!==")){expr={type:Syntax.BinaryExpression,operator:lex().value,left:expr,right:parseRelationalExpression()}}return expr}function parseBitwiseANDExpression(){var expr=parseEqualityExpression();while(match("&")){lex();expr={type:Syntax.BinaryExpression,operator:"&",left:expr,right:parseEqualityExpression()}}return expr}function parseBitwiseXORExpression(){var expr=parseBitwiseANDExpression();while(match("^")){lex();expr={type:Syntax.BinaryExpression,operator:"^",left:expr,right:parseBitwiseANDExpression()}}return expr}function parseBitwiseORExpression(){var expr=parseBitwiseXORExpression();while(match("|")){lex();expr={type:Syntax.BinaryExpression,operator:"|",left:expr,right:parseBitwiseXORExpression()}}return expr}function parseLogicalANDExpression(){var expr=parseBitwiseORExpression();while(match("&&")){lex();expr={type:Syntax.LogicalExpression,operator:"&&",left:expr,right:parseBitwiseORExpression()}}return expr}function parseLogicalORExpression(){var expr=parseLogicalANDExpression();while(match("||")){lex();expr={type:Syntax.LogicalExpression,operator:"||",left:expr,right:parseLogicalANDExpression()}}return expr}function parseConditionalExpression(){var expr,previousAllowIn,consequent;expr=parseLogicalORExpression();if(match("?")){lex();previousAllowIn=state.allowIn;state.allowIn=true;consequent=parseAssignmentExpression();state.allowIn=previousAllowIn;expect(":");expr={type:Syntax.ConditionalExpression,test:expr,consequent:consequent,alternate:parseAssignmentExpression()}}return expr}function parseAssignmentExpression(){var token,expr;token=lookahead();expr=parseConditionalExpression();if(matchAssign()){if(!isLeftHandSide(expr)){throwErrorTolerant({},Messages.InvalidLHSInAssignment)}if(strict&&expr.type===Syntax.Identifier&&isRestrictedWord(expr.name)){throwErrorTolerant(token,Messages.StrictLHSAssignment)}expr={type:Syntax.AssignmentExpression,operator:lex().value,left:expr,right:parseAssignmentExpression()}}return expr}function parseExpression(){var expr=parseAssignmentExpression();if(match(",")){expr={type:Syntax.SequenceExpression,expressions:[expr]};while(index<length){if(!match(",")){break}lex();expr.expressions.push(parseAssignmentExpression())}}return expr}function parseStatementList(){var list=[],statement;while(index<length){if(match("}")){break}statement=parseSourceElement();if(typeof statement==="undefined"){break}list.push(statement)}return list}function parseBlock(){var block;expect("{");block=parseStatementList();expect("}");return{type:Syntax.BlockStatement,body:block}}function parseVariableIdentifier(){var token=lex();if(token.type!==Token.Identifier){throwUnexpected(token)}return{type:Syntax.Identifier,name:token.value}}function parseVariableDeclaration(kind){var id=parseVariableIdentifier(),init=null;if(strict&&isRestrictedWord(id.name)){throwErrorTolerant({},Messages.StrictVarName)}if(kind==="const"){expect("=");init=parseAssignmentExpression()}else if(match("=")){lex();init=parseAssignmentExpression()}return{type:Syntax.VariableDeclarator,id:id,init:init}}function parseVariableDeclarationList(kind){var list=[];do{list.push(parseVariableDeclaration(kind));if(!match(",")){break}lex()}while(index<length);return list}function parseVariableStatement(){var declarations;expectKeyword("var");declarations=parseVariableDeclarationList();consumeSemicolon();return{type:Syntax.VariableDeclaration,declarations:declarations,kind:"var"}}function parseConstLetDeclaration(kind){var declarations;expectKeyword(kind);declarations=parseVariableDeclarationList(kind);consumeSemicolon();return{type:Syntax.VariableDeclaration,declarations:declarations,kind:kind}}function parseEmptyStatement(){expect(";");return{type:Syntax.EmptyStatement}}function parseExpressionStatement(){var expr=parseExpression();consumeSemicolon();return{type:Syntax.ExpressionStatement,expression:expr}}function parseIfStatement(){var test,consequent,alternate;expectKeyword("if");expect("(");test=parseExpression();expect(")");consequent=parseStatement();if(matchKeyword("else")){lex();alternate=parseStatement()}else{alternate=null}return{type:Syntax.IfStatement,test:test,consequent:consequent,alternate:alternate}}function parseDoWhileStatement(){var body,test,oldInIteration;expectKeyword("do");oldInIteration=state.inIteration;state.inIteration=true;body=parseStatement();state.inIteration=oldInIteration;expectKeyword("while");expect("(");test=parseExpression();expect(")");if(match(";")){lex()}return{type:Syntax.DoWhileStatement,body:body,test:test}}function parseWhileStatement(){var test,body,oldInIteration;expectKeyword("while");expect("(");test=parseExpression();expect(")");oldInIteration=state.inIteration;state.inIteration=true;body=parseStatement();state.inIteration=oldInIteration;return{type:Syntax.WhileStatement,test:test,body:body}}function parseForVariableDeclaration(){var token=lex();return{type:Syntax.VariableDeclaration,declarations:parseVariableDeclarationList(),kind:token.value}}function parseForStatement(){var init,test,update,left,right,body,oldInIteration;init=test=update=null;expectKeyword("for");expect("(");if(match(";")){lex()}else{if(matchKeyword("var")||matchKeyword("let")){state.allowIn=false;init=parseForVariableDeclaration();state.allowIn=true;if(init.declarations.length===1&&matchKeyword("in")){lex();left=init;right=parseExpression();init=null}}else{state.allowIn=false;init=parseExpression();state.allowIn=true;if(matchKeyword("in")){if(!isLeftHandSide(init)){throwErrorTolerant({},Messages.InvalidLHSInForIn)}lex();left=init;right=parseExpression();init=null}}if(typeof left==="undefined"){expect(";")}}if(typeof left==="undefined"){if(!match(";")){test=parseExpression()}expect(";");if(!match(")")){update=parseExpression()}}expect(")");oldInIteration=state.inIteration;state.inIteration=true;body=parseStatement();state.inIteration=oldInIteration;if(typeof left==="undefined"){return{type:Syntax.ForStatement,init:init,test:test,update:update,body:body}}return{type:Syntax.ForInStatement,left:left,right:right,body:body,each:false}}function parseContinueStatement(){var token,label=null;expectKeyword("continue");if(source[index]===";"){lex();if(!state.inIteration){throwError({},Messages.IllegalContinue)}return{type:Syntax.ContinueStatement,label:null}}if(peekLineTerminator()){if(!state.inIteration){throwError({},Messages.IllegalContinue)}return{type:Syntax.ContinueStatement,label:null}}token=lookahead();if(token.type===Token.Identifier){label=parseVariableIdentifier();if(!Object.prototype.hasOwnProperty.call(state.labelSet,label.name)){throwError({},Messages.UnknownLabel,label.name)}}consumeSemicolon();if(label===null&&!state.inIteration){throwError({},Messages.IllegalContinue)}return{type:Syntax.ContinueStatement,label:label}}function parseBreakStatement(){var token,label=null;expectKeyword("break");if(source[index]===";"){lex();if(!(state.inIteration||state.inSwitch)){throwError({},Messages.IllegalBreak)}return{type:Syntax.BreakStatement,label:null}}if(peekLineTerminator()){if(!(state.inIteration||state.inSwitch)){throwError({},Messages.IllegalBreak)}return{type:Syntax.BreakStatement,label:null}}token=lookahead();if(token.type===Token.Identifier){label=parseVariableIdentifier();if(!Object.prototype.hasOwnProperty.call(state.labelSet,label.name)){throwError({},Messages.UnknownLabel,label.name)}}consumeSemicolon();if(label===null&&!(state.inIteration||state.inSwitch)){throwError({},Messages.IllegalBreak)}return{type:Syntax.BreakStatement,label:label}}function parseReturnStatement(){var token,argument=null;expectKeyword("return");if(!state.inFunctionBody){throwErrorTolerant({},Messages.IllegalReturn)}if(source[index]===" "){if(isIdentifierStart(source[index+1])){argument=parseExpression();consumeSemicolon();return{type:Syntax.ReturnStatement,argument:argument}}}if(peekLineTerminator()){return{type:Syntax.ReturnStatement,argument:null}}if(!match(";")){token=lookahead();if(!match("}")&&token.type!==Token.EOF){argument=parseExpression()}}consumeSemicolon();return{type:Syntax.ReturnStatement,argument:argument}}function parseWithStatement(){var object,body;if(strict){throwErrorTolerant({},Messages.StrictModeWith)}expectKeyword("with");expect("(");object=parseExpression();expect(")");body=parseStatement();return{type:Syntax.WithStatement,object:object,body:body}}function parseSwitchCase(){var test,consequent=[],statement;if(matchKeyword("default")){lex();test=null}else{expectKeyword("case");test=parseExpression()}expect(":");while(index<length){if(match("}")||matchKeyword("default")||matchKeyword("case")){break}statement=parseStatement();if(typeof statement==="undefined"){break}consequent.push(statement)}return{type:Syntax.SwitchCase,test:test,consequent:consequent}}function parseSwitchStatement(){var discriminant,cases,clause,oldInSwitch,defaultFound;expectKeyword("switch");expect("(");discriminant=parseExpression();expect(")");expect("{");cases=[];if(match("}")){lex();return{type:Syntax.SwitchStatement,discriminant:discriminant,cases:cases}}oldInSwitch=state.inSwitch;state.inSwitch=true;defaultFound=false;while(index<length){if(match("}")){break}clause=parseSwitchCase();if(clause.test===null){if(defaultFound){throwError({},Messages.MultipleDefaultsInSwitch)}defaultFound=true}cases.push(clause)}state.inSwitch=oldInSwitch;expect("}");return{type:Syntax.SwitchStatement,discriminant:discriminant,cases:cases}}function parseThrowStatement(){var argument;expectKeyword("throw");if(peekLineTerminator()){throwError({},Messages.NewlineAfterThrow)}argument=parseExpression();consumeSemicolon();return{type:Syntax.ThrowStatement,argument:argument}}function parseCatchClause(){var param;expectKeyword("catch");expect("(");if(match(")")){throwUnexpected(lookahead())}param=parseVariableIdentifier();if(strict&&isRestrictedWord(param.name)){throwErrorTolerant({},Messages.StrictCatchVariable)}expect(")");return{type:Syntax.CatchClause,param:param,body:parseBlock()}}function parseTryStatement(){var block,handlers=[],finalizer=null;expectKeyword("try");block=parseBlock();if(matchKeyword("catch")){handlers.push(parseCatchClause())}if(matchKeyword("finally")){lex();finalizer=parseBlock()}if(handlers.length===0&&!finalizer){throwError({},Messages.NoCatchOrFinally)}return{type:Syntax.TryStatement,block:block,guardedHandlers:[],handlers:handlers,finalizer:finalizer}}function parseDebuggerStatement(){expectKeyword("debugger");consumeSemicolon();return{type:Syntax.DebuggerStatement}}function parseStatement(){var token=lookahead(),expr,labeledBody;if(token.type===Token.EOF){throwUnexpected(token)}if(token.type===Token.Punctuator){switch(token.value){case";":return parseEmptyStatement();case"{":return parseBlock();case"(":return parseExpressionStatement();default:break}}if(token.type===Token.Keyword){switch(token.value){case"break":return parseBreakStatement();case"continue":return parseContinueStatement();case"debugger":return parseDebuggerStatement();case"do":return parseDoWhileStatement();case"for":return parseForStatement();case"function":return parseFunctionDeclaration();case"if":return parseIfStatement();case"return":return parseReturnStatement();case"switch":return parseSwitchStatement();case"throw":return parseThrowStatement();case"try":return parseTryStatement();case"var":return parseVariableStatement();case"while":return parseWhileStatement();case"with":return parseWithStatement();default:break}}expr=parseExpression();if(expr.type===Syntax.Identifier&&match(":")){lex();if(Object.prototype.hasOwnProperty.call(state.labelSet,expr.name)){throwError({},Messages.Redeclaration,"Label",expr.name)}state.labelSet[expr.name]=true;labeledBody=parseStatement();delete state.labelSet[expr.name];return{type:Syntax.LabeledStatement,label:expr,body:labeledBody}}consumeSemicolon();return{type:Syntax.ExpressionStatement,expression:expr}}function parseFunctionSourceElements(){var sourceElement,sourceElements=[],token,directive,firstRestricted,oldLabelSet,oldInIteration,oldInSwitch,oldInFunctionBody;expect("{");while(index<length){token=lookahead();if(token.type!==Token.StringLiteral){break}sourceElement=parseSourceElement();sourceElements.push(sourceElement);if(sourceElement.expression.type!==Syntax.Literal){break}directive=sliceSource(token.range[0]+1,token.range[1]-1);if(directive==="use strict"){strict=true;if(firstRestricted){throwErrorTolerant(firstRestricted,Messages.StrictOctalLiteral)}}else{if(!firstRestricted&&token.octal){firstRestricted=token}}}oldLabelSet=state.labelSet;oldInIteration=state.inIteration;oldInSwitch=state.inSwitch;oldInFunctionBody=state.inFunctionBody;state.labelSet={};state.inIteration=false;state.inSwitch=false;state.inFunctionBody=true;while(index<length){if(match("}")){break}sourceElement=parseSourceElement();if(typeof sourceElement==="undefined"){break | |
}sourceElements.push(sourceElement)}expect("}");state.labelSet=oldLabelSet;state.inIteration=oldInIteration;state.inSwitch=oldInSwitch;state.inFunctionBody=oldInFunctionBody;return{type:Syntax.BlockStatement,body:sourceElements}}function parseFunctionDeclaration(){var id,param,params=[],body,token,stricted,firstRestricted,message,previousStrict,paramSet;expectKeyword("function");token=lookahead();id=parseVariableIdentifier();if(strict){if(isRestrictedWord(token.value)){throwErrorTolerant(token,Messages.StrictFunctionName)}}else{if(isRestrictedWord(token.value)){firstRestricted=token;message=Messages.StrictFunctionName}else if(isStrictModeReservedWord(token.value)){firstRestricted=token;message=Messages.StrictReservedWord}}expect("(");if(!match(")")){paramSet={};while(index<length){token=lookahead();param=parseVariableIdentifier();if(strict){if(isRestrictedWord(token.value)){stricted=token;message=Messages.StrictParamName}if(Object.prototype.hasOwnProperty.call(paramSet,token.value)){stricted=token;message=Messages.StrictParamDupe}}else if(!firstRestricted){if(isRestrictedWord(token.value)){firstRestricted=token;message=Messages.StrictParamName}else if(isStrictModeReservedWord(token.value)){firstRestricted=token;message=Messages.StrictReservedWord}else if(Object.prototype.hasOwnProperty.call(paramSet,token.value)){firstRestricted=token;message=Messages.StrictParamDupe}}params.push(param);paramSet[param.name]=true;if(match(")")){break}expect(",")}}expect(")");previousStrict=strict;body=parseFunctionSourceElements();if(strict&&firstRestricted){throwError(firstRestricted,message)}if(strict&&stricted){throwErrorTolerant(stricted,message)}strict=previousStrict;return{type:Syntax.FunctionDeclaration,id:id,params:params,defaults:[],body:body,rest:null,generator:false,expression:false}}function parseFunctionExpression(){var token,id=null,stricted,firstRestricted,message,param,params=[],body,previousStrict,paramSet;expectKeyword("function");if(!match("(")){token=lookahead();id=parseVariableIdentifier();if(strict){if(isRestrictedWord(token.value)){throwErrorTolerant(token,Messages.StrictFunctionName)}}else{if(isRestrictedWord(token.value)){firstRestricted=token;message=Messages.StrictFunctionName}else if(isStrictModeReservedWord(token.value)){firstRestricted=token;message=Messages.StrictReservedWord}}}expect("(");if(!match(")")){paramSet={};while(index<length){token=lookahead();param=parseVariableIdentifier();if(strict){if(isRestrictedWord(token.value)){stricted=token;message=Messages.StrictParamName}if(Object.prototype.hasOwnProperty.call(paramSet,token.value)){stricted=token;message=Messages.StrictParamDupe}}else if(!firstRestricted){if(isRestrictedWord(token.value)){firstRestricted=token;message=Messages.StrictParamName}else if(isStrictModeReservedWord(token.value)){firstRestricted=token;message=Messages.StrictReservedWord}else if(Object.prototype.hasOwnProperty.call(paramSet,token.value)){firstRestricted=token;message=Messages.StrictParamDupe}}params.push(param);paramSet[param.name]=true;if(match(")")){break}expect(",")}}expect(")");previousStrict=strict;body=parseFunctionSourceElements();if(strict&&firstRestricted){throwError(firstRestricted,message)}if(strict&&stricted){throwErrorTolerant(stricted,message)}strict=previousStrict;return{type:Syntax.FunctionExpression,id:id,params:params,defaults:[],body:body,rest:null,generator:false,expression:false}}function parseSourceElement(){var token=lookahead();if(token.type===Token.Keyword){switch(token.value){case"const":case"let":return parseConstLetDeclaration(token.value);case"function":return parseFunctionDeclaration();default:return parseStatement()}}if(token.type!==Token.EOF){return parseStatement()}}function parseSourceElements(){var sourceElement,sourceElements=[],token,directive,firstRestricted;while(index<length){token=lookahead();if(token.type!==Token.StringLiteral){break}sourceElement=parseSourceElement();sourceElements.push(sourceElement);if(sourceElement.expression.type!==Syntax.Literal){break}directive=sliceSource(token.range[0]+1,token.range[1]-1);if(directive==="use strict"){strict=true;if(firstRestricted){throwErrorTolerant(firstRestricted,Messages.StrictOctalLiteral)}}else{if(!firstRestricted&&token.octal){firstRestricted=token}}}while(index<length){sourceElement=parseSourceElement();if(typeof sourceElement==="undefined"){break}sourceElements.push(sourceElement)}return sourceElements}function parseProgram(){var program;strict=false;program={type:Syntax.Program,body:parseSourceElements()};return program}function addComment(type,value,start,end,loc){assert(typeof start==="number","Comment must have valid position");if(extra.comments.length>0){if(extra.comments[extra.comments.length-1].range[1]>start){return}}extra.comments.push({type:type,value:value,range:[start,end],loc:loc})}function scanComment(){var comment,ch,loc,start,blockComment,lineComment;comment="";blockComment=false;lineComment=false;while(index<length){ch=source[index];if(lineComment){ch=source[index++];if(isLineTerminator(ch)){loc.end={line:lineNumber,column:index-lineStart-1};lineComment=false;addComment("Line",comment,start,index-1,loc);if(ch==="\r"&&source[index]==="\n"){++index}++lineNumber;lineStart=index;comment=""}else if(index>=length){lineComment=false;comment+=ch;loc.end={line:lineNumber,column:length-lineStart};addComment("Line",comment,start,length,loc)}else{comment+=ch}}else if(blockComment){if(isLineTerminator(ch)){if(ch==="\r"&&source[index+1]==="\n"){++index;comment+="\r\n"}else{comment+=ch}++lineNumber;++index;lineStart=index;if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}else{ch=source[index++];if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}comment+=ch;if(ch==="*"){ch=source[index];if(ch==="/"){comment=comment.substr(0,comment.length-1);blockComment=false;++index;loc.end={line:lineNumber,column:index-lineStart};addComment("Block",comment,start,index,loc);comment=""}}}}else if(ch==="/"){ch=source[index+1];if(ch==="/"){loc={start:{line:lineNumber,column:index-lineStart}};start=index;index+=2;lineComment=true;if(index>=length){loc.end={line:lineNumber,column:index-lineStart};lineComment=false;addComment("Line",comment,start,index,loc)}}else if(ch==="*"){start=index;index+=2;blockComment=true;loc={start:{line:lineNumber,column:index-lineStart-2}};if(index>=length){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}else{break}}else if(isWhiteSpace(ch)){++index}else if(isLineTerminator(ch)){++index;if(ch==="\r"&&source[index]==="\n"){++index}++lineNumber;lineStart=index}else{break}}}function filterCommentLocation(){var i,entry,comment,comments=[];for(i=0;i<extra.comments.length;++i){entry=extra.comments[i];comment={type:entry.type,value:entry.value};if(extra.range){comment.range=entry.range}if(extra.loc){comment.loc=entry.loc}comments.push(comment)}extra.comments=comments}function collectToken(){var start,loc,token,range,value;skipComment();start=index;loc={start:{line:lineNumber,column:index-lineStart}};token=extra.advance();loc.end={line:lineNumber,column:index-lineStart};if(token.type!==Token.EOF){range=[token.range[0],token.range[1]];value=sliceSource(token.range[0],token.range[1]);extra.tokens.push({type:TokenName[token.type],value:value,range:range,loc:loc})}return token}function collectRegex(){var pos,loc,regex,token;skipComment();pos=index;loc={start:{line:lineNumber,column:index-lineStart}};regex=extra.scanRegExp();loc.end={line:lineNumber,column:index-lineStart};if(extra.tokens.length>0){token=extra.tokens[extra.tokens.length-1];if(token.range[0]===pos&&token.type==="Punctuator"){if(token.value==="/"||token.value==="/="){extra.tokens.pop()}}}extra.tokens.push({type:"RegularExpression",value:regex.literal,range:[pos,index],loc:loc});return regex}function filterTokenLocation(){var i,entry,token,tokens=[];for(i=0;i<extra.tokens.length;++i){entry=extra.tokens[i];token={type:entry.type,value:entry.value};if(extra.range){token.range=entry.range}if(extra.loc){token.loc=entry.loc}tokens.push(token)}extra.tokens=tokens}function createLiteral(token){return{type:Syntax.Literal,value:token.value}}function createRawLiteral(token){return{type:Syntax.Literal,value:token.value,raw:sliceSource(token.range[0],token.range[1])}}function createLocationMarker(){var marker={};marker.range=[index,index];marker.loc={start:{line:lineNumber,column:index-lineStart},end:{line:lineNumber,column:index-lineStart}};marker.end=function(){this.range[1]=index;this.loc.end.line=lineNumber;this.loc.end.column=index-lineStart};marker.applyGroup=function(node){if(extra.range){node.groupRange=[this.range[0],this.range[1]]}if(extra.loc){node.groupLoc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}}}};marker.apply=function(node){if(extra.range){node.range=[this.range[0],this.range[1]]}if(extra.loc){node.loc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}}}};return marker}function trackGroupExpression(){var marker,expr;skipComment();marker=createLocationMarker();expect("(");expr=parseExpression();expect(")");marker.end();marker.applyGroup(expr);return expr}function trackLeftHandSideExpression(){var marker,expr;skipComment();marker=createLocationMarker();expr=matchKeyword("new")?parseNewExpression():parsePrimaryExpression();while(match(".")||match("[")){if(match("[")){expr={type:Syntax.MemberExpression,computed:true,object:expr,property:parseComputedMember()};marker.end();marker.apply(expr)}else{expr={type:Syntax.MemberExpression,computed:false,object:expr,property:parseNonComputedMember()};marker.end();marker.apply(expr)}}return expr}function trackLeftHandSideExpressionAllowCall(){var marker,expr;skipComment();marker=createLocationMarker();expr=matchKeyword("new")?parseNewExpression():parsePrimaryExpression();while(match(".")||match("[")||match("(")){if(match("(")){expr={type:Syntax.CallExpression,callee:expr,arguments:parseArguments()};marker.end();marker.apply(expr)}else if(match("[")){expr={type:Syntax.MemberExpression,computed:true,object:expr,property:parseComputedMember()};marker.end();marker.apply(expr)}else{expr={type:Syntax.MemberExpression,computed:false,object:expr,property:parseNonComputedMember()};marker.end();marker.apply(expr)}}return expr}function filterGroup(node){var n,i,entry;n=Object.prototype.toString.apply(node)==="[object Array]"?[]:{};for(i in node){if(node.hasOwnProperty(i)&&i!=="groupRange"&&i!=="groupLoc"){entry=node[i];if(entry===null||typeof entry!=="object"||entry instanceof RegExp){n[i]=entry}else{n[i]=filterGroup(entry)}}}return n}function wrapTrackingFunction(range,loc){return function(parseFunction){function isBinary(node){return node.type===Syntax.LogicalExpression||node.type===Syntax.BinaryExpression}function visit(node){var start,end;if(isBinary(node.left)){visit(node.left)}if(isBinary(node.right)){visit(node.right)}if(range){if(node.left.groupRange||node.right.groupRange){start=node.left.groupRange?node.left.groupRange[0]:node.left.range[0];end=node.right.groupRange?node.right.groupRange[1]:node.right.range[1];node.range=[start,end]}else if(typeof node.range==="undefined"){start=node.left.range[0];end=node.right.range[1];node.range=[start,end]}}if(loc){if(node.left.groupLoc||node.right.groupLoc){start=node.left.groupLoc?node.left.groupLoc.start:node.left.loc.start;end=node.right.groupLoc?node.right.groupLoc.end:node.right.loc.end;node.loc={start:start,end:end}}else if(typeof node.loc==="undefined"){node.loc={start:node.left.loc.start,end:node.right.loc.end}}}}return function(){var marker,node;skipComment();marker=createLocationMarker();node=parseFunction.apply(null,arguments);marker.end();if(range&&typeof node.range==="undefined"){marker.apply(node)}if(loc&&typeof node.loc==="undefined"){marker.apply(node)}if(isBinary(node)){visit(node)}return node}}}function patch(){var wrapTracking;if(extra.comments){extra.skipComment=skipComment;skipComment=scanComment}if(extra.raw){extra.createLiteral=createLiteral;createLiteral=createRawLiteral}if(extra.range||extra.loc){extra.parseGroupExpression=parseGroupExpression;extra.parseLeftHandSideExpression=parseLeftHandSideExpression;extra.parseLeftHandSideExpressionAllowCall=parseLeftHandSideExpressionAllowCall;parseGroupExpression=trackGroupExpression;parseLeftHandSideExpression=trackLeftHandSideExpression;parseLeftHandSideExpressionAllowCall=trackLeftHandSideExpressionAllowCall;wrapTracking=wrapTrackingFunction(extra.range,extra.loc);extra.parseAdditiveExpression=parseAdditiveExpression;extra.parseAssignmentExpression=parseAssignmentExpression;extra.parseBitwiseANDExpression=parseBitwiseANDExpression;extra.parseBitwiseORExpression=parseBitwiseORExpression;extra.parseBitwiseXORExpression=parseBitwiseXORExpression;extra.parseBlock=parseBlock;extra.parseFunctionSourceElements=parseFunctionSourceElements;extra.parseCatchClause=parseCatchClause;extra.parseComputedMember=parseComputedMember;extra.parseConditionalExpression=parseConditionalExpression;extra.parseConstLetDeclaration=parseConstLetDeclaration;extra.parseEqualityExpression=parseEqualityExpression;extra.parseExpression=parseExpression;extra.parseForVariableDeclaration=parseForVariableDeclaration;extra.parseFunctionDeclaration=parseFunctionDeclaration;extra.parseFunctionExpression=parseFunctionExpression;extra.parseLogicalANDExpression=parseLogicalANDExpression;extra.parseLogicalORExpression=parseLogicalORExpression;extra.parseMultiplicativeExpression=parseMultiplicativeExpression;extra.parseNewExpression=parseNewExpression;extra.parseNonComputedProperty=parseNonComputedProperty;extra.parseObjectProperty=parseObjectProperty;extra.parseObjectPropertyKey=parseObjectPropertyKey;extra.parsePostfixExpression=parsePostfixExpression;extra.parsePrimaryExpression=parsePrimaryExpression;extra.parseProgram=parseProgram;extra.parsePropertyFunction=parsePropertyFunction;extra.parseRelationalExpression=parseRelationalExpression;extra.parseStatement=parseStatement;extra.parseShiftExpression=parseShiftExpression;extra.parseSwitchCase=parseSwitchCase;extra.parseUnaryExpression=parseUnaryExpression;extra.parseVariableDeclaration=parseVariableDeclaration;extra.parseVariableIdentifier=parseVariableIdentifier;parseAdditiveExpression=wrapTracking(extra.parseAdditiveExpression);parseAssignmentExpression=wrapTracking(extra.parseAssignmentExpression);parseBitwiseANDExpression=wrapTracking(extra.parseBitwiseANDExpression);parseBitwiseORExpression=wrapTracking(extra.parseBitwiseORExpression);parseBitwiseXORExpression=wrapTracking(extra.parseBitwiseXORExpression);parseBlock=wrapTracking(extra.parseBlock);parseFunctionSourceElements=wrapTracking(extra.parseFunctionSourceElements);parseCatchClause=wrapTracking(extra.parseCatchClause);parseComputedMember=wrapTracking(extra.parseComputedMember);parseConditionalExpression=wrapTracking(extra.parseConditionalExpression);parseConstLetDeclaration=wrapTracking(extra.parseConstLetDeclaration);parseEqualityExpression=wrapTracking(extra.parseEqualityExpression);parseExpression=wrapTracking(extra.parseExpression);parseForVariableDeclaration=wrapTracking(extra.parseForVariableDeclaration);parseFunctionDeclaration=wrapTracking(extra.parseFunctionDeclaration);parseFunctionExpression=wrapTracking(extra.parseFunctionExpression);parseLeftHandSideExpression=wrapTracking(parseLeftHandSideExpression);parseLogicalANDExpression=wrapTracking(extra.parseLogicalANDExpression);parseLogicalORExpression=wrapTracking(extra.parseLogicalORExpression);parseMultiplicativeExpression=wrapTracking(extra.parseMultiplicativeExpression);parseNewExpression=wrapTracking(extra.parseNewExpression);parseNonComputedProperty=wrapTracking(extra.parseNonComputedProperty);parseObjectProperty=wrapTracking(extra.parseObjectProperty);parseObjectPropertyKey=wrapTracking(extra.parseObjectPropertyKey);parsePostfixExpression=wrapTracking(extra.parsePostfixExpression);parsePrimaryExpression=wrapTracking(extra.parsePrimaryExpression);parseProgram=wrapTracking(extra.parseProgram);parsePropertyFunction=wrapTracking(extra.parsePropertyFunction);parseRelationalExpression=wrapTracking(extra.parseRelationalExpression);parseStatement=wrapTracking(extra.parseStatement);parseShiftExpression=wrapTracking(extra.parseShiftExpression);parseSwitchCase=wrapTracking(extra.parseSwitchCase);parseUnaryExpression=wrapTracking(extra.parseUnaryExpression);parseVariableDeclaration=wrapTracking(extra.parseVariableDeclaration);parseVariableIdentifier=wrapTracking(extra.parseVariableIdentifier)}if(typeof extra.tokens!=="undefined"){extra.advance=advance;extra.scanRegExp=scanRegExp;advance=collectToken;scanRegExp=collectRegex}}function unpatch(){if(typeof extra.skipComment==="function"){skipComment=extra.skipComment}if(extra.raw){createLiteral=extra.createLiteral}if(extra.range||extra.loc){parseAdditiveExpression=extra.parseAdditiveExpression;parseAssignmentExpression=extra.parseAssignmentExpression;parseBitwiseANDExpression=extra.parseBitwiseANDExpression;parseBitwiseORExpression=extra.parseBitwiseORExpression;parseBitwiseXORExpression=extra.parseBitwiseXORExpression;parseBlock=extra.parseBlock;parseFunctionSourceElements=extra.parseFunctionSourceElements;parseCatchClause=extra.parseCatchClause;parseComputedMember=extra.parseComputedMember;parseConditionalExpression=extra.parseConditionalExpression;parseConstLetDeclaration=extra.parseConstLetDeclaration;parseEqualityExpression=extra.parseEqualityExpression;parseExpression=extra.parseExpression;parseForVariableDeclaration=extra.parseForVariableDeclaration;parseFunctionDeclaration=extra.parseFunctionDeclaration;parseFunctionExpression=extra.parseFunctionExpression;parseGroupExpression=extra.parseGroupExpression;parseLeftHandSideExpression=extra.parseLeftHandSideExpression;parseLeftHandSideExpressionAllowCall=extra.parseLeftHandSideExpressionAllowCall;parseLogicalANDExpression=extra.parseLogicalANDExpression;parseLogicalORExpression=extra.parseLogicalORExpression;parseMultiplicativeExpression=extra.parseMultiplicativeExpression;parseNewExpression=extra.parseNewExpression;parseNonComputedProperty=extra.parseNonComputedProperty;parseObjectProperty=extra.parseObjectProperty;parseObjectPropertyKey=extra.parseObjectPropertyKey;parsePrimaryExpression=extra.parsePrimaryExpression;parsePostfixExpression=extra.parsePostfixExpression;parseProgram=extra.parseProgram;parsePropertyFunction=extra.parsePropertyFunction;parseRelationalExpression=extra.parseRelationalExpression;parseStatement=extra.parseStatement;parseShiftExpression=extra.parseShiftExpression;parseSwitchCase=extra.parseSwitchCase;parseUnaryExpression=extra.parseUnaryExpression;parseVariableDeclaration=extra.parseVariableDeclaration;parseVariableIdentifier=extra.parseVariableIdentifier}if(typeof extra.scanRegExp==="function"){advance=extra.advance;scanRegExp=extra.scanRegExp}}function stringToArray(str){var length=str.length,result=[],i;for(i=0;i<length;++i){result[i]=str.charAt(i)}return result}function parse(code,options){var program,toString;toString=String;if(typeof code!=="string"&&!(code instanceof String)){code=toString(code)}source=code;index=0;lineNumber=source.length>0?1:0;lineStart=0;length=source.length;buffer=null;state={allowIn:true,labelSet:{},inFunctionBody:false,inIteration:false,inSwitch:false};extra={};if(typeof options!=="undefined"){extra.range=typeof options.range==="boolean"&&options.range;extra.loc=typeof options.loc==="boolean"&&options.loc;extra.raw=typeof options.raw==="boolean"&&options.raw;if(typeof options.tokens==="boolean"&&options.tokens){extra.tokens=[]}if(typeof options.comment==="boolean"&&options.comment){extra.comments=[]}if(typeof options.tolerant==="boolean"&&options.tolerant){extra.errors=[]}}if(length>0){if(typeof source[0]==="undefined"){if(code instanceof String){source=code.valueOf()}if(typeof source[0]==="undefined"){source=stringToArray(code)}}}patch();try{program=parseProgram();if(typeof extra.comments!=="undefined"){filterCommentLocation();program.comments=extra.comments}if(typeof extra.tokens!=="undefined"){filterTokenLocation();program.tokens=extra.tokens}if(typeof extra.errors!=="undefined"){program.errors=extra.errors}if(extra.range||extra.loc){program.body=filterGroup(program.body)}}catch(e){throw e}finally{unpatch();extra={}}return program}exports.version="1.0.4";exports.parse=parse;exports.Syntax=function(){var name,types={};if(typeof Object.create==="function"){types=Object.create(null)}for(name in Syntax){if(Syntax.hasOwnProperty(name)){types[name]=Syntax[name]}}if(typeof Object.freeze==="function"){Object.freeze(types)}return types}()})},{}],80:[function(require,module,exports){"use strict";module.exports=require("./lib")},{"./lib":82}],81:[function(require,module,exports){"use strict";var _=require("lodash");var decimalRe=/^\s*(\+|-)?((\d+([,\.]\d+)?)|([,\.]\d+))\s*$/;var csv=module.exports;csv.parse=function(str,options){str=str.replace(/\r/g,"");var opts=_.defaults({},options,{headers:{included:false,downcase:true,upcase:true},delimiter:"tab",decimalSign:"comma"});var dataArray=[];var numCommas=str.replace(/[^,]/g,"").length;var numTabs=str.replace(/[^\t]/g,"").length;var delimiter=",";if(opts.delimiter==="tab"){delimiter=" "}else if(numTabs>numCommas){delimiter=" "}str=str.replace(/^\n+|\n+$/g,"");dataArray=toArray(str,opts);for(var i=dataArray.length-1;i>=0;i--){for(var j=dataArray[i].length-1;j>=0;j--){dataArray[i][j]=dataArray[i][j].replace(/([\t\n])/,"\\$1")}}var headerNames=[];var headerTypes=[];var numColumns=dataArray[0].length;var numRows=dataArray.length;if(opts.headers.included){headerNames=dataArray.splice(0,1)[0];numRows=dataArray.length}else{for(var k=0;k<numColumns;k++){headerNames.push("val"+String(k));headerTypes.push("")}}if(opts.headers.upcase){for(var l=headerNames.length-1;l>=0;l--){headerNames[l]=headerNames[l].toUpperCase()}}if(opts.headers.downcase){for(var m=headerNames.length-1;m>=0;m--){headerNames[m]=headerNames[m].toLowerCase()}}for(var ii=0;ii<dataArray.length;ii++){var numValues=dataArray[ii].length;if(numValues!=numColumns){this.log("Error parsing row "+String(ii)+". Wrong number of columns.")}}var numRowsToTest=dataArray.length;var threshold=.9;for(var iii=0;iii<headerNames.length;iii++){var numFloats=0;var numInts=0;for(var r=0;r<numRowsToTest;r++){if(dataArray[r]){if(opts.decimalSign==="comma"&&decimalRe.test(dataArray[r][iii])){dataArray[r][iii]=dataArray[r][iii].replace(",",".")}if(isNumber(dataArray[r][iii])){numInts++;if(String(dataArray[r][iii]).indexOf(".")>0){numFloats++}}}}if(numInts/numRowsToTest>threshold){if(numFloats>0){headerTypes[i]="float"}else{headerTypes[i]="int"}}else{headerTypes[i]="string"}}return{data:dataArray,header:{names:headerNames,types:headerTypes}}};function toArray(str,options){var opts=_.extend({delim:","},options);var re=new RegExp("(\\"+opts.delim+"|\\n|^)"+'(?:"([^"]*(?:""[^"]*)*)"|'+'([^"\\'+opts.delim+"\\n]*))","gi");var arr=[[]];var match=null;var value;while(match=re.exec(str)){var matchedDelim=match[1];if(matchedDelim.length&&matchedDelim!=opts.delim){arr.push([])}if(match[2]){value=match[2].replace(/""/g,'"')}else{value=match[3]}arr[arr.length-1].push(value)}return arr}function isNumber(string){if(string==null||isNaN(Number(string))){return false}return true}},{lodash:29}],82:[function(require,module,exports){"use strict";var render=require("./render");Object.keys(render).forEach(function(type){module.exports[type]=function(data,options){return render(type,data,options)}});module.exports.to=render},{"./render":83}],83:[function(require,module,exports){"use strict";var csv=require("./csv");var _=require("lodash");module.exports=render;function render(type,data,options){var parsed;var res="";if(typeof type!=="string"){options=type;type="json"}var converter=render[type];var defaults={headers:{included:true,downcase:true,upcase:true},delimiter:"tab",decimalSign:"comma",outputDataType:"json",columnDelimiter:" ",rowDelimiter:"\n",inputHeader:{},outputHeader:{},dataSelect:{},outputText:"",newline:"\n",indent:" ",commentLine:"//",commentLineEnd:"",tableName:"converter",useUnderscores:true,includeWhiteSpace:true,useTabsForIndent:false};var opts=_.extend(defaults,options);if(data&&data.length>0){if(opts.includeWhiteSpace){opts.newline="\n"}else{opts.indent="";opts.newline=""}parsed=csv.parse(data,opts);opts.header=parsed.header;res=converter(parsed.data,opts)}return res}render.as=function as(datagrid,options){var opts=_.extend({},options);var header=opts.header;var newline=opts.newline;var res="[";var numRows=datagrid.length;var numColumns=header.names.length;var rowOutput;for(var i=0;i<numRows;i++){var row=datagrid[i];res+="{";for(var j=0;j<numColumns;j++){if(header.types[j]=="int"||header.types[j]=="float"){rowOutput=row[j]||"null"}else{rowOutput='"'+(row[j]||"")+'"'}res+=header.names[j]+":"+rowOutput;if(j<numColumns-1){res+=","}}res+="}";if(i<numRows-1){res+=","+newline}}res+="];";return res};render.asp=function asp(datagrid,options){var opts=_.extend({},options);var header=opts.header;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;var rowOutput;for(var i=0;i<numRows;i++){var row=datagrid[i];for(var j=0;j<numColumns;j++){if(header.types[j]=="int"||header.types[j]=="float"){rowOutput=row[j]||"null"}else{rowOutput='"'+(row[j]||"")+'"'}res+="myArray("+j+","+i+") = "+rowOutput+newline}res="Dim myArray("+(j-1)+","+(i-1)+")"+newline+res}return res};render.html=function html(datagrid,options){var opts=_.extend({},options);var header=opts.header;var indent=opts.indent;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;res+="<table>"+newline;res+=indent+"<thead>"+newline;res+=indent+indent+"<tr>"+newline;for(var i=0;i<numColumns;i++){res+=indent+indent+indent+'<th class="'+header.names[i]+'-cell">';res+=header.names[i];res+="</th>"+newline}res+=indent+indent+"</tr>"+newline;res+=indent+"</thead>"+newline;res+=indent+"<tbody>"+newline;for(var ii=0;ii<numRows;ii++){var row=datagrid[ii];var rowClassName="";if(ii===numRows-1){rowClassName=' class="lastRow"'}else if(ii===0){rowClassName=' class="firstRow"'}res+=indent+indent+"<tr"+rowClassName+">"+newline;for(var iii=0;iii<numColumns;iii++){res+=indent+indent+indent+'<td class="'+header.names[iii]+'-cell">';res+=row[iii];res+="</td>"+newline}res+=indent+indent+"</tr>"+newline}res+=indent+"</tbody>"+newline;res+="</table>";return res};render.json=function json(datagrid,options){var opts=_.extend({},options);var header=opts.header;var newline=opts.newline;var res="[";var numRows=datagrid.length;var numColumns=header.names.length;var rowOutput;for(var i=0;i<numRows;i++){var row=datagrid[i];res+="{";for(var j=0;j<numColumns;j++){if(header.types[j]=="int"||header.types[j]=="float"){rowOutput=row[j]||"null"}else{rowOutput='"'+(row[j]||"")+'"'}res+='"'+header.names[j]+'"'+":"+rowOutput;if(j<numColumns-1){res+=","}}res+="}";if(i<numRows-1){res+=","+newline}}res+="]";return res};render.jsonArrayCols=function jsonArrayCols(datagrid,options){var opts=_.extend({},options);var header=opts.header;var indent=opts.indent;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;res+="{"+newline;for(var i=0;i<numColumns;i++){res+=indent+'"'+header.names[i]+'":[';for(var j=0;j<numRows;j++){if(header.types[i]=="int"||header.types[i]=="float"){res+=datagrid[j][i]||0}else{res+='"'+(datagrid[j][i]||"")+'"'}if(j<numRows-1){res+=","}}res+="]";if(i<numColumns-1){res+=","+newline}}res+=newline+"}";return res};render.jsonArrayRows=function jsonArrayRows(datagrid,options){var opts=_.extend({},options);var header=opts.header;var indent=opts.indent;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;res+="["+newline;for(var i=0;i<numRows;i++){res+=indent+"[";for(var j=0;j<numColumns;j++){if(header.types[j]=="int"||header.types[j]=="float"){res+=datagrid[i][j]||0}else{res+='"'+(datagrid[i][j]||"")+'"'}if(j<numColumns-1){res+=","}}res+="]";if(i<numRows-1){res+=","+newline}}res+=newline+"]";return res};render.jsonDict=function jsonDict(datagrid,options){var opts=_.extend({},options);var header=opts.header;var indent=opts.indent;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;res+="{"+newline;for(var i=0;i<numRows;i++){res+=indent+'"'+datagrid[i][0]+'": ';if(numColumns==2){res+=_fmtVal(i,1,datagrid)}else{res+="{ ";for(var j=1;j<numColumns;j++){if(j>1)res+=", ";res+='"'+header.names[j]+'"'+":"+_fmtVal(i,j,datagrid)}res+="}"}if(i<numRows-1){res+=","+newline}}res+=newline+"}";function _fmtVal(i,j){if(header.types[j]=="int"||header.types[j]=="float"){return datagrid[i][j]||0}else{return'"'+(datagrid[i][j]||"")+'"'}}return res};render.mysql=function mysql(datagrid,options){var opts=_.extend({},options);var header=opts.header;var indent=opts.indent;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;var tableName="converter";res+="CREATE TABLE "+tableName+" ("+newline;res+=indent+"id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,"+newline;for(var i=0;i<numColumns;i++){var dataType="VARCHAR(255)";if(header.types[i]=="int"||header.types[i]=="float"){dataType=header.types[i].toUpperCase()}res+=indent+""+header.names[i]+" "+dataType;if(i<numColumns-1){res+=","}res+=newline}res+=");"+newline;res+="INSERT INTO "+tableName+" "+newline+indent+"(";for(var ii=0;ii<numColumns;ii++){res+=header.names[ii];if(ii<numColumns-1){res+=","}}res+=") "+newline+"VALUES "+newline;for(var iii=0;iii<numRows;iii++){res+=indent+"(";for(var j=0;j<numColumns;j++){if(header.types[j]=="int"||header.types[j]=="float"){res+=datagrid[iii][j]||"null"}else{res+="'"+(datagrid[iii][j]||"")+"'"}if(j<numColumns-1){res+=","}}res+=")";if(iii<numRows-1){res+=","+newline}}res+=";";return res};render.php=function php(datagrid,options){var opts=_.extend({},options);var header=opts.header;var indent=opts.indent;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;var rowOutput;res+="array("+newline;for(var i=0;i<numRows;i++){var row=datagrid[i];res+=indent+"array(";for(var j=0;j<numColumns;j++){if(header.types[j]=="int"||header.types[j]=="float"){rowOutput=row[j]||"null"}else{rowOutput='"'+(row[j]||"")+'"'}res+='"'+header.names[j]+'"'+"=>"+rowOutput;if(j<numColumns-1){res+=","}}res+=")";if(i<numRows-1){res+=","+newline}}res+=newline+");";return res};render.python=function python(datagrid,options){var opts=_.extend({},options);var header=opts.header;var newline=opts.newline;var res="[";var numRows=datagrid.length;var numColumns=header.names.length;var rowOutput;for(var i=0;i<numRows;i++){var row=datagrid[i];res+="{";for(var j=0;j<numColumns;j++){if(header.types[j]=="int"||header.types[j]=="float"){rowOutput=row[j]||"None"}else{rowOutput='"'+(row[j]||"")+'"'}res+='"'+header.names[j]+'"'+":"+rowOutput;if(j<numColumns-1){res+=","}}res+="}";if(i<numRows-1){res+=","+newline}}res+="];";return res};render.ruby=function ruby(datagrid,options){var opts=_.extend({},options);var header=opts.header;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;var rowOutput;res+="[";for(var i=0;i<numRows;i++){var row=datagrid[i];res+="{";for(var j=0;j<numColumns;j++){if(header.types[j]=="int"||header.types[j]=="float"){rowOutput=row[j]||"nil"}else{rowOutput='"'+(row[j]||"")+'"'}res+='"'+header.names[j]+'"'+"=>"+rowOutput;if(j<numColumns-1){res+=","}}res+="}";if(i<numRows-1){res+=","+newline}}res+="];";return res};render.xml=function xml(datagrid,options){var opts=_.extend({},options);var header=opts.header;var indent=opts.indent;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;res='<?xml version="1.0" encoding="UTF-8"?>'+newline;res+="<rows>"+newline;for(var i=0;i<numRows;i++){var row=datagrid[i];res+=indent+"<row>"+newline;for(var j=0;j<numColumns;j++){res+=indent+indent+"<"+header.names[j]+">"; | |
res+=row[j]||"";res+="</"+header.names[j]+">"+newline}res+=indent+"</row>"+newline}res+="</rows>";return res};render.xmlProperties=function xmlProperties(datagrid,options){var opts=_.extend({},options);var header=opts.header;var indent=opts.indent;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;res='<?xml version="1.0" encoding="UTF-8"?>'+newline;res+="<rows>"+newline;for(var i=0;i<numRows;i++){var row=datagrid[i];res+=indent+"<row ";for(var j=0;j<numColumns;j++){res+=header.names[j]+"=";res+='"'+row[j]+'" '}res+="></row>"+newline}res+="</rows>";return res};render.xmlIllustrator=function xmlIllustrator(datagrid,options){var opts=_.extend({},options);var header=opts.header;var indent=opts.indent;var newline=opts.newline;var res="";var numRows=datagrid.length;var numColumns=header.names.length;res='<?xml version="1.0" encoding="utf-8"?>'+newline;res+='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd" ['+newline;res+=indent+'<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">'+newline;res+=indent+'<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">'+newline;res+=indent+'<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">'+newline;res+=indent+'<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">'+newline;res+=indent+'<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">'+newline;res+=indent+'<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">'+newline;res+="]>"+newline;res+="<svg>"+newline;res+='<variableSets xmlns="&ns_vars;">'+newline;res+=indent+'<variableSet varSetName="binding1" locked="none">'+newline;res+=indent+indent+"<variables>"+newline;for(var i=0;i<numColumns;i++){res+=indent+indent+indent+'<variable varName="'+header.names[i]+'" trait="textcontent" category="&ns_flows;"></variable>'+newline}res+=indent+indent+"</variables>"+newline;res+=indent+indent+'<v:sampleDataSets xmlns:v="http://ns.adobe.com/Variables/1.0/" xmlns="http://ns.adobe.com/GenericCustomNamespace/1.0/">'+newline;for(var ii=0;ii<numRows;ii++){var row=datagrid[ii];res+=indent+indent+indent+'<v:sampleDataSet dataSetName="'+row[0]+'">'+newline;for(var j=0;j<numColumns;j++){res+=indent+indent+indent+indent+"<"+header.names[j]+">"+newline;res+=indent+indent+indent+indent+indent+"<p>"+row[j]+"</p>"+newline;res+=indent+indent+indent+indent+"</"+header.names[j]+">"+newline}res+=indent+indent+indent+"</v:sampleDataSet>"+newline}res+=indent+indent+"</v:sampleDataSets>"+newline;res+=indent+"</variableSet>"+newline;res+="</variableSets>"+newline;res+="</svg>"+newline;return res}},{"./csv":81,lodash:29}],84:[function(require,module,exports){(function(process){"use strict";var path=require("path");module.exports=relative;function relative(a,b){if(arguments.length===1){b=a;a=process.cwd()}a=normalize(path.resolve(a));b=normalize(path.resolve(b));if(/\./.test(path.basename(a))){a=path.dirname(a)}var relativePath=path.relative(a,b);return relativePath.charAt(0)!=="."?"./"+relativePath:relativePath}relative.toBase=function toBase(base,fp){base=normalize(path.resolve(base));fp=normalize(path.resolve(fp));if(fp.indexOf(base)===0){fp=fp.replace(base,"")}return fp.replace(/^[\\\/]*/,"")};function normalize(str){return str.replace(/[\\\/]+/g,"/")}}).call(this,require("_process"))},{_process:7,path:6}],85:[function(require,module,exports){"use strict";var isObject=require("isobject");var Tokens=require("preserve");var get=require("get-value");module.exports=function set(obj,prop,val){if(prop==null){return obj}var tokens=new Tokens(/\\\./g);prop=tokens.before(prop);var parts=/^([\s\S]+)\.([\s\S]+)$/.exec(prop);if(parts){create(obj,parts[1])[parts[2]]=val}else{prop=tokens.after(prop).replace(/\\\./g,".");obj[prop]=val;return obj}return obj};function create(obj,path){if(!path){return obj}forEach(path.split("."),function(key){if(!obj[key]||!isObject(obj[key])){obj[key]={}}obj=obj[key]});return obj}function forEach(arr,fn,thisArg){if(arr==null){return}var len=arr.length;var i=-1;while(++i<len){if(fn.call(thisArg,arr[i],i,arr)===false){break}}}},{"get-value":26,isobject:86,preserve:87}],86:[function(require,module,exports){arguments[4][27][0].apply(exports,arguments)},{dup:27}],87:[function(require,module,exports){"use strict";function Tokens(re){this.cache={};this.re=re}Tokens.prototype.makeId=function(num){return"__ID"+num+"__"};Tokens.prototype.before=function(str){var tokens=this;var i=0;return str.replace(this.re,function(match){var id=i++;tokens.cache[id]=match;return tokens.makeId(id)})};Tokens.prototype.after=function(str){var re=/__ID(\d+)__/g;var tokens=this;return str.replace(re,function(_,id){return tokens.cache[id]})};module.exports=Tokens},{}],"config-cache":[function(require,module,exports){"use strict";var typeOf=require("kind-of");var expander=require("expander");var Options=require("option-cache");var extend=require("extend-shallow");var flatten=require("arr-flatten");var clone=require("clone-deep");var slice=require("array-slice");var rest=require("array-rest");var set=require("set-object");var get=require("get-value");var forIn=require("for-in");var Plasma=require("plasma");var Events=require("./events");var expand=expander.process;var Cache=Events.extend({constructor:function(o){Cache.__super__.constructor.call(this);this.cache=o||{};this.cache.data=this.cache.data||{};Options.call(this,this.cache.options);this._plasma=new Plasma}});Cache.extend=Events.extend;extend(Cache.prototype,Options.prototype);Cache.prototype.set=function(key,value,expand){if(arguments.length===1&&typeOf(key)==="object"){this.extend(key);this.emit("set",key,value);return this}if(expand){value=this.process(value,this.cache);this.set(key,value,false)}else{set(this.cache,key,value)}this.emit("set",key,value);return this};Cache.prototype.get=function(key,create){if(!key){return this.cache}var args=slice(arguments);var last=args[args.length-1];if(typeOf(last)==="boolean"){create=last;args.pop()}if(Array.isArray(key)||typeof key==="string"&&args.length>1){key=flatten(args).join(".")}var val;if(/\./.test(key)){val=get(this.cache,key,create)}else{val=this.cache[key]}if(val==null){if(create){set(this.cache,key,create);return this.cache[key]}}return val};Cache.prototype.constant=function(key,value,namespace){var getter;if(typeof value!=="function"){getter=function(){return value}}else{getter=value}namespace=namespace||"cache";if(!this[namespace]){this[namespace]={}}this[namespace].__defineGetter__(key,getter);return this};Cache.prototype.exists=function(key){if(this.hasOwn(key)){return true}var val=get(this.cache,key,true);return typeof val!=="undefined"&&val!==null};Cache.prototype.union=function(key){var args=slice(arguments,1);var arr=this.get(key)||[];if(!Array.isArray(arr)){throw new Error("Cache#union expected an array but got",arr)}this.set(key,union(arr,args));return this};Cache.prototype.extend=function(){var args=slice(arguments);if(typeof args[0]==="string"){var o=this.get(args[0])||{};o=extend.apply(extend,union([o],rest(args)));this.set(args[0],o);this.emit("extend");return this}extend.apply(extend,union([this.cache],args));this.emit("extend");return this};Cache.prototype.keys=function(o){return Object.keys(o||this.cache)};Cache.prototype.hasOwn=function(key,o){return{}.hasOwnProperty.call(o||this.cache,key)};Cache.prototype.clone=function(o){return clone(o||this.cache)};Cache.prototype.methods=function(o){return methods(o||this.cache)};Cache.prototype.process=function(lookup,context){var args=slice(arguments);if(!args.length){lookup=context=this.cache.data}else{context=context||this.cache.data;if(typeOf(lookup)==="object"){context=extend({},context,lookup)}}var methods=this.methods(context);var o=expand(context,lookup,{imports:methods});if(!args.length){extend(this.cache.data,o)}return o};Cache.prototype.flattenData=function(data,name){name=name||"data";name=!Array.isArray(name)?[name]:name;name.forEach(function(prop){if(data&&data.hasOwnProperty(prop)){extend(data,data[prop]);delete data[prop]}});return data};Cache.prototype.extendData=function(){var args=slice(arguments);if(typeof args[0]==="string"){this.extend.apply(this,["data."+args[0]].concat(rest(args)));this.emit("extendData");return this}this.extend.apply(this,["data"].concat(args));this.emit("extendData");return this};Cache.prototype.plasma=function(){var args=slice(arguments);return this._plasma.load.apply(this._plasma,args)};Cache.prototype.data=function(){var args=slice(arguments);var len=args.length;if(!len){return this.cache.data}var o={},last;if(typeof args[len-1]==="boolean"){last=args[len-1];args=slice(args,1)}extend(o,this._plasma.load.apply(this._plasma,args));o=this.flattenData(o);if(last){this.extendData(this.process(o));return this}this.extendData(o);return this};Cache.prototype.omit=function(keys){if(keys==null){return this}var args=slice(arguments);var len=args.length;var omit=[];var i=0;while(len--){omit=omit.concat(args[i++])}var o={};for(var key in this.cache){if(this.hasOwn(key,this.cache)&&omit.indexOf(key)===-1){o[key]=this.cache[key]}}this.cache=o;this.emit("omit");return this};Cache.prototype.clear=function(key){if(key){this.emit("clear",key);delete this.cache[key]}else{this.cache={};this.emit("clear")}};function union(){return flatten([].concat.apply([],arguments))}function methods(o){var res={};forIn(o,function(val,key){if(typeof val==="function"){res[key]=val}});return res}module.exports=Cache},{"./events":10,"arr-flatten":11,"array-rest":12,"array-slice":14,"clone-deep":16,expander:21,"extend-shallow":24,"for-in":25,"get-value":26,"kind-of":28,"option-cache":30,plasma:31,"set-object":85}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";var forIn=require("for-in");module.exports=function forOwn(o,fn,thisArg){forIn(o,function(val,key){if(hasOwn(o,key)){return fn.call(thisArg,o[key],key,o)}})};function hasOwn(o,prop){return{}.hasOwnProperty.call(o,prop)}},{"for-in":2}],2:[function(require,module,exports){"use strict";module.exports=function forIn(o,fn,thisArg){for(var key in o){if(fn.call(thisArg,o[key],key,o)===false){break}}}},{}],3:[function(require,module,exports){"use strict";module.exports=function isPlainObject(o){return!!o&&typeof o==="object"&&o.constructor===Object}},{}],"mixin-deep":[function(require,module,exports){"use strict";var isObject=require("is-plain-object");var forOwn=require("for-own");module.exports=function deepMixin(o){var args=[].slice.call(arguments,1);var len=args.length;if(o==null){return{}}if(len===0){return o}function copy(value,key){var obj=this[key];if(isObject(value)&&isObject(obj)){deepMixin(obj,value)}else{this[key]=value}}for(var i=0;i<len;i++){var obj=args[i];if(obj!=null){forOwn(obj,copy,o)}}return o}},{"for-own":1,"is-plain-object":3}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";var forIn=require("for-in");module.exports=function forOwn(o,fn,thisArg){forIn(o,function(val,key){if(hasOwn(o,key)){return fn.call(thisArg,o[key],key,o)}})};function hasOwn(o,prop){return{}.hasOwnProperty.call(o,prop)}},{"for-in":2}],2:[function(require,module,exports){"use strict";module.exports=function forIn(o,fn,thisArg){for(var key in o){if(fn.call(thisArg,o[key],key,o)===false){break}}}},{}],"object.reduce":[function(require,module,exports){"use strict";var forOwn=require("for-own");module.exports=function reduce(o,fn,acc,thisArg){var first=arguments.length>2;if(o&&!Object.keys(o).length&&!first){return null}forOwn(o,function(value,key,orig){if(!first){acc=value;first=true}else{acc=fn.call(thisArg,acc,value,key,orig)}});return acc}},{"for-own":1}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:3}],3:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],4:[function(require,module,exports){"use strict";var fs=require("fs");var path=require("path");var readCache={};exports.requires={};var cacheStore={};exports.clearCache=function(){cacheStore={}};exports.cache=function cache(options,compiled){if(compiled&&options.filename&&options.cache){delete readCache[options.filename];cacheStore[options.filename]=compiled;return compiled}if(options.filename&&options.cache){return cacheStore[options.filename]}return compiled};function read(path,options,callback){var str=readCache[path];var cached=options.cache&&str&&"string"===typeof str;if(cached){return callback(null,str)}fs.readFile(path,"utf8",function(err,str){if(err){return callback(err)}str=str.replace(/^\uFEFF/,"");if(options.cache){readCache[path]=str}callback(null,str)})}exports.readPartials=function(filepath,options,callback){if(!options.partials){return callback()}var partials=options.partials;var keys=Object.keys(partials);function next(index){if(index===keys.length){return callback(null)}var key=keys[index];var file=path.join(path.dirname(filepath),partials[key]+path.extname(filepath));read(file,options,function(err,str){if(err){return callback(err)}options.partials[key]=str;next(++index)})}next(0)};exports.fromStringRenderer=function(name){return function(path,options,callback){options.filename=path;exports.readPartials(path,options,function(err){if(err){return callback(err)}if(exports.cache(options)){exports[name].render("",options,callback)}else{read(path,options,function(err,str){if(err){return callback(err)}exports[name].render(str,options,callback)})}})}}},{fs:1,path:2}],5:[function(require,module,exports){"use strict";var Handlebars=require("./handlebars.runtime")["default"];var AST=require("./handlebars/compiler/ast")["default"];var Parser=require("./handlebars/compiler/base").parser;var parse=require("./handlebars/compiler/base").parse;var Compiler=require("./handlebars/compiler/compiler").Compiler;var compile=require("./handlebars/compiler/compiler").compile;var precompile=require("./handlebars/compiler/compiler").precompile;var JavaScriptCompiler=require("./handlebars/compiler/javascript-compiler")["default"];var _create=Handlebars.create;var create=function(){var hb=_create();hb.compile=function(input,options){return compile(input,options,hb)};hb.precompile=function(input,options){return precompile(input,options,hb)};hb.AST=AST;hb.Compiler=Compiler;hb.JavaScriptCompiler=JavaScriptCompiler;hb.Parser=Parser;hb.parse=parse;return hb};Handlebars=create();Handlebars.create=create;Handlebars["default"]=Handlebars;exports["default"]=Handlebars},{"./handlebars.runtime":6,"./handlebars/compiler/ast":8,"./handlebars/compiler/base":9,"./handlebars/compiler/compiler":10,"./handlebars/compiler/javascript-compiler":12}],6:[function(require,module,exports){"use strict";var base=require("./handlebars/base");var SafeString=require("./handlebars/safe-string")["default"];var Exception=require("./handlebars/exception")["default"];var Utils=require("./handlebars/utils");var runtime=require("./handlebars/runtime");var create=function(){var hb=new base.HandlebarsEnvironment;Utils.extend(hb,base);hb.SafeString=SafeString;hb.Exception=Exception;hb.Utils=Utils;hb.escapeExpression=Utils.escapeExpression;hb.VM=runtime;hb.template=function(spec){return runtime.template(spec,hb)};return hb};var Handlebars=create();Handlebars.create=create;Handlebars["default"]=Handlebars;exports["default"]=Handlebars},{"./handlebars/base":7,"./handlebars/exception":16,"./handlebars/runtime":17,"./handlebars/safe-string":18,"./handlebars/utils":19}],7:[function(require,module,exports){"use strict";var Utils=require("./utils");var Exception=require("./exception")["default"];var VERSION="2.0.0";exports.VERSION=VERSION;var COMPILER_REVISION=6;exports.COMPILER_REVISION=COMPILER_REVISION;var REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};exports.REVISION_CHANGES=REVISION_CHANGES;var isArray=Utils.isArray,isFunction=Utils.isFunction,toString=Utils.toString,objectType="[object Object]";function HandlebarsEnvironment(helpers,partials){this.helpers=helpers||{};this.partials=partials||{};registerDefaultHelpers(this)}exports.HandlebarsEnvironment=HandlebarsEnvironment;HandlebarsEnvironment.prototype={constructor:HandlebarsEnvironment,logger:logger,log:log,registerHelper:function(name,fn){if(toString.call(name)===objectType){if(fn){throw new Exception("Arg not supported with multiple helpers")}Utils.extend(this.helpers,name)}else{this.helpers[name]=fn}},unregisterHelper:function(name){delete this.helpers[name]},registerPartial:function(name,partial){if(toString.call(name)===objectType){Utils.extend(this.partials,name)}else{this.partials[name]=partial}},unregisterPartial:function(name){delete this.partials[name]}};function registerDefaultHelpers(instance){instance.registerHelper("helperMissing",function(){if(arguments.length===1){return undefined}else{throw new Exception("Missing helper: '"+arguments[arguments.length-1].name+"'")}});instance.registerHelper("blockHelperMissing",function(context,options){var inverse=options.inverse,fn=options.fn;if(context===true){return fn(this)}else if(context===false||context==null){return inverse(this)}else if(isArray(context)){if(context.length>0){if(options.ids){options.ids=[options.name]}return instance.helpers.each(context,options)}else{return inverse(this)}}else{if(options.data&&options.ids){var data=createFrame(options.data);data.contextPath=Utils.appendContextPath(options.data.contextPath,options.name);options={data:data}}return fn(context,options)}});instance.registerHelper("each",function(context,options){if(!options){throw new Exception("Must pass iterator to #each")}var fn=options.fn,inverse=options.inverse;var i=0,ret="",data;var contextPath;if(options.data&&options.ids){contextPath=Utils.appendContextPath(options.data.contextPath,options.ids[0])+"."}if(isFunction(context)){context=context.call(this)}if(options.data){data=createFrame(options.data)}if(context&&typeof context==="object"){if(isArray(context)){for(var j=context.length;i<j;i++){if(data){data.index=i;data.first=i===0;data.last=i===context.length-1;if(contextPath){data.contextPath=contextPath+i}}ret=ret+fn(context[i],{data:data})}}else{for(var key in context){if(context.hasOwnProperty(key)){if(data){data.key=key;data.index=i;data.first=i===0;if(contextPath){data.contextPath=contextPath+key}}ret=ret+fn(context[key],{data:data});i++}}}}if(i===0){ret=inverse(this)}return ret});instance.registerHelper("if",function(conditional,options){if(isFunction(conditional)){conditional=conditional.call(this)}if(!options.hash.includeZero&&!conditional||Utils.isEmpty(conditional)){return options.inverse(this)}else{return options.fn(this)}});instance.registerHelper("unless",function(conditional,options){return instance.helpers["if"].call(this,conditional,{fn:options.inverse,inverse:options.fn,hash:options.hash})});instance.registerHelper("with",function(context,options){if(isFunction(context)){context=context.call(this)}var fn=options.fn;if(!Utils.isEmpty(context)){if(options.data&&options.ids){var data=createFrame(options.data);data.contextPath=Utils.appendContextPath(options.data.contextPath,options.ids[0]);options={data:data}}return fn(context,options)}else{return options.inverse(this)}});instance.registerHelper("log",function(message,options){var level=options.data&&options.data.level!=null?parseInt(options.data.level,10):1;instance.log(level,message)});instance.registerHelper("lookup",function(obj,field){return obj&&obj[field]})}var logger={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(level,message){if(logger.level<=level){var method=logger.methodMap[level];if(typeof console!=="undefined"&&console[method]){console[method].call(console,message)}}}};exports.logger=logger;var log=logger.log;exports.log=log;var createFrame=function(object){var frame=Utils.extend({},object);frame._parent=object;return frame};exports.createFrame=createFrame},{"./exception":16,"./utils":19}],8:[function(require,module,exports){"use strict";var Exception=require("../exception")["default"];function LocationInfo(locInfo){locInfo=locInfo||{};this.firstLine=locInfo.first_line;this.firstColumn=locInfo.first_column;this.lastColumn=locInfo.last_column;this.lastLine=locInfo.last_line}var AST={ProgramNode:function(statements,strip,locInfo){LocationInfo.call(this,locInfo);this.type="program";this.statements=statements;this.strip=strip},MustacheNode:function(rawParams,hash,open,strip,locInfo){LocationInfo.call(this,locInfo);this.type="mustache";this.strip=strip;if(open!=null&&open.charAt){var escapeFlag=open.charAt(3)||open.charAt(2);this.escaped=escapeFlag!=="{"&&escapeFlag!=="&"}else{this.escaped=!!open}if(rawParams instanceof AST.SexprNode){this.sexpr=rawParams}else{this.sexpr=new AST.SexprNode(rawParams,hash)}this.id=this.sexpr.id;this.params=this.sexpr.params;this.hash=this.sexpr.hash;this.eligibleHelper=this.sexpr.eligibleHelper;this.isHelper=this.sexpr.isHelper},SexprNode:function(rawParams,hash,locInfo){LocationInfo.call(this,locInfo);this.type="sexpr";this.hash=hash;var id=this.id=rawParams[0];var params=this.params=rawParams.slice(1);this.isHelper=!!(params.length||hash);this.eligibleHelper=this.isHelper||id.isSimple},PartialNode:function(partialName,context,hash,strip,locInfo){LocationInfo.call(this,locInfo);this.type="partial";this.partialName=partialName;this.context=context;this.hash=hash;this.strip=strip;this.strip.inlineStandalone=true},BlockNode:function(mustache,program,inverse,strip,locInfo){LocationInfo.call(this,locInfo);this.type="block";this.mustache=mustache;this.program=program;this.inverse=inverse;this.strip=strip;if(inverse&&!program){this.isInverse=true}},RawBlockNode:function(mustache,content,close,locInfo){LocationInfo.call(this,locInfo);if(mustache.sexpr.id.original!==close){throw new Exception(mustache.sexpr.id.original+" doesn't match "+close,this)}content=new AST.ContentNode(content,locInfo);this.type="block";this.mustache=mustache;this.program=new AST.ProgramNode([content],{},locInfo)},ContentNode:function(string,locInfo){LocationInfo.call(this,locInfo);this.type="content";this.original=this.string=string},HashNode:function(pairs,locInfo){LocationInfo.call(this,locInfo);this.type="hash";this.pairs=pairs},IdNode:function(parts,locInfo){LocationInfo.call(this,locInfo);this.type="ID";var original="",dig=[],depth=0,depthString="";for(var i=0,l=parts.length;i<l;i++){var part=parts[i].part;original+=(parts[i].separator||"")+part;if(part===".."||part==="."||part==="this"){if(dig.length>0){throw new Exception("Invalid path: "+original,this)}else if(part===".."){depth++;depthString+="../"}else{this.isScoped=true}}else{dig.push(part)}}this.original=original;this.parts=dig;this.string=dig.join(".");this.depth=depth;this.idName=depthString+this.string;this.isSimple=parts.length===1&&!this.isScoped&&depth===0;this.stringModeValue=this.string},PartialNameNode:function(name,locInfo){LocationInfo.call(this,locInfo);this.type="PARTIAL_NAME";this.name=name.original},DataNode:function(id,locInfo){LocationInfo.call(this,locInfo);this.type="DATA";this.id=id;this.stringModeValue=id.stringModeValue;this.idName="@"+id.stringModeValue},StringNode:function(string,locInfo){LocationInfo.call(this,locInfo);this.type="STRING";this.original=this.string=this.stringModeValue=string},NumberNode:function(number,locInfo){LocationInfo.call(this,locInfo);this.type="NUMBER";this.original=this.number=number;this.stringModeValue=Number(number)},BooleanNode:function(bool,locInfo){LocationInfo.call(this,locInfo);this.type="BOOLEAN";this.bool=bool;this.stringModeValue=bool==="true"},CommentNode:function(comment,locInfo){LocationInfo.call(this,locInfo);this.type="comment";this.comment=comment;this.strip={inlineStandalone:true}}};exports["default"]=AST},{"../exception":16}],9:[function(require,module,exports){"use strict";var parser=require("./parser")["default"];var AST=require("./ast")["default"];var Helpers=require("./helpers");var extend=require("../utils").extend;exports.parser=parser;var yy={};extend(yy,Helpers,AST);function parse(input){if(input.constructor===AST.ProgramNode){return input}parser.yy=yy;return parser.parse(input)}exports.parse=parse},{"../utils":19,"./ast":8,"./helpers":11,"./parser":13}],10:[function(require,module,exports){"use strict";var Exception=require("../exception")["default"];var isArray=require("../utils").isArray;var slice=[].slice;function Compiler(){}exports.Compiler=Compiler;Compiler.prototype={compiler:Compiler,equals:function(other){var len=this.opcodes.length;if(other.opcodes.length!==len){return false}for(var i=0;i<len;i++){var opcode=this.opcodes[i],otherOpcode=other.opcodes[i];if(opcode.opcode!==otherOpcode.opcode||!argEquals(opcode.args,otherOpcode.args)){return false}}len=this.children.length;for(i=0;i<len;i++){if(!this.children[i].equals(other.children[i])){return false}}return true},guid:0,compile:function(program,options){this.opcodes=[];this.children=[];this.depths={list:[]};this.options=options;this.stringParams=options.stringParams;this.trackIds=options.trackIds;var knownHelpers=this.options.knownHelpers;this.options.knownHelpers={helperMissing:true,blockHelperMissing:true,each:true,"if":true,unless:true,"with":true,log:true,lookup:true};if(knownHelpers){for(var name in knownHelpers){this.options.knownHelpers[name]=knownHelpers[name]}}return this.accept(program)},accept:function(node){return this[node.type](node)},program:function(program){var statements=program.statements;for(var i=0,l=statements.length;i<l;i++){this.accept(statements[i])}this.isSimple=l===1;this.depths.list=this.depths.list.sort(function(a,b){return a-b});return this},compileProgram:function(program){var result=(new this.compiler).compile(program,this.options);var guid=this.guid++,depth;this.usePartial=this.usePartial||result.usePartial;this.children[guid]=result;for(var i=0,l=result.depths.list.length;i<l;i++){depth=result.depths.list[i];if(depth<2){continue}else{this.addDepth(depth-1)}}return guid},block:function(block){var mustache=block.mustache,program=block.program,inverse=block.inverse;if(program){program=this.compileProgram(program)}if(inverse){inverse=this.compileProgram(inverse)}var sexpr=mustache.sexpr; | |
var type=this.classifySexpr(sexpr);if(type==="helper"){this.helperSexpr(sexpr,program,inverse)}else if(type==="simple"){this.simpleSexpr(sexpr);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);this.opcode("emptyHash");this.opcode("blockValue",sexpr.id.original)}else{this.ambiguousSexpr(sexpr,program,inverse);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);this.opcode("emptyHash");this.opcode("ambiguousBlockValue")}this.opcode("append")},hash:function(hash){var pairs=hash.pairs,i,l;this.opcode("pushHash");for(i=0,l=pairs.length;i<l;i++){this.pushParam(pairs[i][1])}while(i--){this.opcode("assignToHash",pairs[i][0])}this.opcode("popHash")},partial:function(partial){var partialName=partial.partialName;this.usePartial=true;if(partial.hash){this.accept(partial.hash)}else{this.opcode("push","undefined")}if(partial.context){this.accept(partial.context)}else{this.opcode("getContext",0);this.opcode("pushContext")}this.opcode("invokePartial",partialName.name,partial.indent||"");this.opcode("append")},content:function(content){if(content.string){this.opcode("appendContent",content.string)}},mustache:function(mustache){this.sexpr(mustache.sexpr);if(mustache.escaped&&!this.options.noEscape){this.opcode("appendEscaped")}else{this.opcode("append")}},ambiguousSexpr:function(sexpr,program,inverse){var id=sexpr.id,name=id.parts[0],isBlock=program!=null||inverse!=null;this.opcode("getContext",id.depth);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);this.ID(id);this.opcode("invokeAmbiguous",name,isBlock)},simpleSexpr:function(sexpr){var id=sexpr.id;if(id.type==="DATA"){this.DATA(id)}else if(id.parts.length){this.ID(id)}else{this.addDepth(id.depth);this.opcode("getContext",id.depth);this.opcode("pushContext")}this.opcode("resolvePossibleLambda")},helperSexpr:function(sexpr,program,inverse){var params=this.setupFullMustacheParams(sexpr,program,inverse),id=sexpr.id,name=id.parts[0];if(this.options.knownHelpers[name]){this.opcode("invokeKnownHelper",params.length,name)}else if(this.options.knownHelpersOnly){throw new Exception("You specified knownHelpersOnly, but used the unknown helper "+name,sexpr)}else{id.falsy=true;this.ID(id);this.opcode("invokeHelper",params.length,id.original,id.isSimple)}},sexpr:function(sexpr){var type=this.classifySexpr(sexpr);if(type==="simple"){this.simpleSexpr(sexpr)}else if(type==="helper"){this.helperSexpr(sexpr)}else{this.ambiguousSexpr(sexpr)}},ID:function(id){this.addDepth(id.depth);this.opcode("getContext",id.depth);var name=id.parts[0];if(!name){this.opcode("pushContext")}else{this.opcode("lookupOnContext",id.parts,id.falsy,id.isScoped)}},DATA:function(data){this.options.data=true;this.opcode("lookupData",data.id.depth,data.id.parts)},STRING:function(string){this.opcode("pushString",string.string)},NUMBER:function(number){this.opcode("pushLiteral",number.number)},BOOLEAN:function(bool){this.opcode("pushLiteral",bool.bool)},comment:function(){},opcode:function(name){this.opcodes.push({opcode:name,args:slice.call(arguments,1)})},addDepth:function(depth){if(depth===0){return}if(!this.depths[depth]){this.depths[depth]=true;this.depths.list.push(depth)}},classifySexpr:function(sexpr){var isHelper=sexpr.isHelper;var isEligible=sexpr.eligibleHelper;var options=this.options;if(isEligible&&!isHelper){var name=sexpr.id.parts[0];if(options.knownHelpers[name]){isHelper=true}else if(options.knownHelpersOnly){isEligible=false}}if(isHelper){return"helper"}else if(isEligible){return"ambiguous"}else{return"simple"}},pushParams:function(params){for(var i=0,l=params.length;i<l;i++){this.pushParam(params[i])}},pushParam:function(val){if(this.stringParams){if(val.depth){this.addDepth(val.depth)}this.opcode("getContext",val.depth||0);this.opcode("pushStringParam",val.stringModeValue,val.type);if(val.type==="sexpr"){this.sexpr(val)}}else{if(this.trackIds){this.opcode("pushId",val.type,val.idName||val.stringModeValue)}this.accept(val)}},setupFullMustacheParams:function(sexpr,program,inverse){var params=sexpr.params;this.pushParams(params);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);if(sexpr.hash){this.hash(sexpr.hash)}else{this.opcode("emptyHash")}return params}};function precompile(input,options,env){if(input==null||typeof input!=="string"&&input.constructor!==env.AST.ProgramNode){throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+input)}options=options||{};if(!("data"in options)){options.data=true}if(options.compat){options.useDepths=true}var ast=env.parse(input);var environment=(new env.Compiler).compile(ast,options);return(new env.JavaScriptCompiler).compile(environment,options)}exports.precompile=precompile;function compile(input,options,env){if(input==null||typeof input!=="string"&&input.constructor!==env.AST.ProgramNode){throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+input)}options=options||{};if(!("data"in options)){options.data=true}if(options.compat){options.useDepths=true}var compiled;function compileInput(){var ast=env.parse(input);var environment=(new env.Compiler).compile(ast,options);var templateSpec=(new env.JavaScriptCompiler).compile(environment,options,undefined,true);return env.template(templateSpec)}var ret=function(context,options){if(!compiled){compiled=compileInput()}return compiled.call(this,context,options)};ret._setup=function(options){if(!compiled){compiled=compileInput()}return compiled._setup(options)};ret._child=function(i,data,depths){if(!compiled){compiled=compileInput()}return compiled._child(i,data,depths)};return ret}exports.compile=compile;function argEquals(a,b){if(a===b){return true}if(isArray(a)&&isArray(b)&&a.length===b.length){for(var i=0;i<a.length;i++){if(!argEquals(a[i],b[i])){return false}}return true}}},{"../exception":16,"../utils":19}],11:[function(require,module,exports){"use strict";var Exception=require("../exception")["default"];function stripFlags(open,close){return{left:open.charAt(2)==="~",right:close.charAt(close.length-3)==="~"}}exports.stripFlags=stripFlags;function prepareBlock(mustache,program,inverseAndProgram,close,inverted,locInfo){if(mustache.sexpr.id.original!==close.path.original){throw new Exception(mustache.sexpr.id.original+" doesn't match "+close.path.original,mustache)}var inverse=inverseAndProgram&&inverseAndProgram.program;var strip={left:mustache.strip.left,right:close.strip.right,openStandalone:isNextWhitespace(program.statements),closeStandalone:isPrevWhitespace((inverse||program).statements)};if(mustache.strip.right){omitRight(program.statements,null,true)}if(inverse){var inverseStrip=inverseAndProgram.strip;if(inverseStrip.left){omitLeft(program.statements,null,true)}if(inverseStrip.right){omitRight(inverse.statements,null,true)}if(close.strip.left){omitLeft(inverse.statements,null,true)}if(isPrevWhitespace(program.statements)&&isNextWhitespace(inverse.statements)){omitLeft(program.statements);omitRight(inverse.statements)}}else{if(close.strip.left){omitLeft(program.statements,null,true)}}if(inverted){return new this.BlockNode(mustache,inverse,program,strip,locInfo)}else{return new this.BlockNode(mustache,program,inverse,strip,locInfo)}}exports.prepareBlock=prepareBlock;function prepareProgram(statements,isRoot){for(var i=0,l=statements.length;i<l;i++){var current=statements[i],strip=current.strip;if(!strip){continue}var _isPrevWhitespace=isPrevWhitespace(statements,i,isRoot,current.type==="partial"),_isNextWhitespace=isNextWhitespace(statements,i,isRoot),openStandalone=strip.openStandalone&&_isPrevWhitespace,closeStandalone=strip.closeStandalone&&_isNextWhitespace,inlineStandalone=strip.inlineStandalone&&_isPrevWhitespace&&_isNextWhitespace;if(strip.right){omitRight(statements,i,true)}if(strip.left){omitLeft(statements,i,true)}if(inlineStandalone){omitRight(statements,i);if(omitLeft(statements,i)){if(current.type==="partial"){current.indent=/([ \t]+$)/.exec(statements[i-1].original)?RegExp.$1:""}}}if(openStandalone){omitRight((current.program||current.inverse).statements);omitLeft(statements,i)}if(closeStandalone){omitRight(statements,i);omitLeft((current.inverse||current.program).statements)}}return statements}exports.prepareProgram=prepareProgram;function isPrevWhitespace(statements,i,isRoot){if(i===undefined){i=statements.length}var prev=statements[i-1],sibling=statements[i-2];if(!prev){return isRoot}if(prev.type==="content"){return(sibling||!isRoot?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(prev.original)}}function isNextWhitespace(statements,i,isRoot){if(i===undefined){i=-1}var next=statements[i+1],sibling=statements[i+2];if(!next){return isRoot}if(next.type==="content"){return(sibling||!isRoot?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(next.original)}}function omitRight(statements,i,multiple){var current=statements[i==null?0:i+1];if(!current||current.type!=="content"||!multiple&¤t.rightStripped){return}var original=current.string;current.string=current.string.replace(multiple?/^\s+/:/^[ \t]*\r?\n?/,"");current.rightStripped=current.string!==original}function omitLeft(statements,i,multiple){var current=statements[i==null?statements.length-1:i-1];if(!current||current.type!=="content"||!multiple&¤t.leftStripped){return}var original=current.string;current.string=current.string.replace(multiple?/\s+$/:/[ \t]+$/,"");current.leftStripped=current.string!==original;return current.leftStripped}},{"../exception":16}],12:[function(require,module,exports){"use strict";var COMPILER_REVISION=require("../base").COMPILER_REVISION;var REVISION_CHANGES=require("../base").REVISION_CHANGES;var Exception=require("../exception")["default"];function Literal(value){this.value=value}function JavaScriptCompiler(){}JavaScriptCompiler.prototype={nameLookup:function(parent,name){if(JavaScriptCompiler.isValidJavaScriptVariableName(name)){return parent+"."+name}else{return parent+"['"+name+"']"}},depthedLookup:function(name){this.aliases.lookup="this.lookup";return'lookup(depths, "'+name+'")'},compilerInfo:function(){var revision=COMPILER_REVISION,versions=REVISION_CHANGES[revision];return[revision,versions]},appendToBuffer:function(string){if(this.environment.isSimple){return"return "+string+";"}else{return{appendToBuffer:true,content:string,toString:function(){return"buffer += "+string+";"}}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(environment,options,context,asObject){this.environment=environment;this.options=options;this.stringParams=this.options.stringParams;this.trackIds=this.options.trackIds;this.precompile=!asObject;this.name=this.environment.name;this.isChild=!!context;this.context=context||{programs:[],environments:[]};this.preamble();this.stackSlot=0;this.stackVars=[];this.aliases={};this.registers={list:[]};this.hashes=[];this.compileStack=[];this.inlineStack=[];this.compileChildren(environment,options);this.useDepths=this.useDepths||environment.depths.list.length||this.options.compat;var opcodes=environment.opcodes,opcode,i,l;for(i=0,l=opcodes.length;i<l;i++){opcode=opcodes[i];this[opcode.opcode].apply(this,opcode.args)}this.pushSource("");if(this.stackSlot||this.inlineStack.length||this.compileStack.length){throw new Exception("Compile completed with content left on stack")}var fn=this.createFunctionContext(asObject);if(!this.isChild){var ret={compiler:this.compilerInfo(),main:fn};var programs=this.context.programs;for(i=0,l=programs.length;i<l;i++){if(programs[i]){ret[i]=programs[i]}}if(this.environment.usePartial){ret.usePartial=true}if(this.options.data){ret.useData=true}if(this.useDepths){ret.useDepths=true}if(this.options.compat){ret.compat=true}if(!asObject){ret.compiler=JSON.stringify(ret.compiler);ret=this.objectLiteral(ret)}return ret}else{return fn}},preamble:function(){this.lastContext=0;this.source=[]},createFunctionContext:function(asObject){var varDeclarations="";var locals=this.stackVars.concat(this.registers.list);if(locals.length>0){varDeclarations+=", "+locals.join(", ")}for(var alias in this.aliases){if(this.aliases.hasOwnProperty(alias)){varDeclarations+=", "+alias+"="+this.aliases[alias]}}var params=["depth0","helpers","partials","data"];if(this.useDepths){params.push("depths")}var source=this.mergeSource(varDeclarations);if(asObject){params.push(source);return Function.apply(this,params)}else{return"function("+params.join(",")+") {\n "+source+"}"}},mergeSource:function(varDeclarations){var source="",buffer,appendOnly=!this.forceBuffer,appendFirst;for(var i=0,len=this.source.length;i<len;i++){var line=this.source[i];if(line.appendToBuffer){if(buffer){buffer=buffer+"\n + "+line.content}else{buffer=line.content}}else{if(buffer){if(!source){appendFirst=true;source=buffer+";\n "}else{source+="buffer += "+buffer+";\n "}buffer=undefined}source+=line+"\n ";if(!this.environment.isSimple){appendOnly=false}}}if(appendOnly){if(buffer||!source){source+="return "+(buffer||'""')+";\n"}}else{varDeclarations+=", buffer = "+(appendFirst?"":this.initializeBuffer());if(buffer){source+="return buffer + "+buffer+";\n"}else{source+="return buffer;\n"}}if(varDeclarations){source="var "+varDeclarations.substring(2)+(appendFirst?"":";\n ")+source}return source},blockValue:function(name){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var params=[this.contextName(0)];this.setupParams(name,0,params);var blockName=this.popStack();params.splice(1,0,blockName);this.push("blockHelperMissing.call("+params.join(", ")+")")},ambiguousBlockValue:function(){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var params=[this.contextName(0)];this.setupParams("",0,params,true);this.flushInline();var current=this.topStack();params.splice(1,0,current);this.pushSource("if (!"+this.lastHelper+") { "+current+" = blockHelperMissing.call("+params.join(", ")+"); }")},appendContent:function(content){if(this.pendingContent){content=this.pendingContent+content}this.pendingContent=content},append:function(){this.flushInline();var local=this.popStack();this.pushSource("if ("+local+" != null) { "+this.appendToBuffer(local)+" }");if(this.environment.isSimple){this.pushSource("else { "+this.appendToBuffer("''")+" }")}},appendEscaped:function(){this.aliases.escapeExpression="this.escapeExpression";this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(depth){this.lastContext=depth},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(parts,falsy,scoped){var i=0,len=parts.length;if(!scoped&&this.options.compat&&!this.lastContext){this.push(this.depthedLookup(parts[i++]))}else{this.pushContext()}for(;i<len;i++){this.replaceStack(function(current){var lookup=this.nameLookup(current,parts[i],"context");if(!falsy){return" != null ? "+lookup+" : "+current}else{return" && "+lookup}})}},lookupData:function(depth,parts){if(!depth){this.pushStackLiteral("data")}else{this.pushStackLiteral("this.data(data, "+depth+")")}var len=parts.length;for(var i=0;i<len;i++){this.replaceStack(function(current){return" && "+this.nameLookup(current,parts[i],"data")})}},resolvePossibleLambda:function(){this.aliases.lambda="this.lambda";this.push("lambda("+this.popStack()+", "+this.contextName(0)+")")},pushStringParam:function(string,type){this.pushContext();this.pushString(type);if(type!=="sexpr"){if(typeof string==="string"){this.pushString(string)}else{this.pushStackLiteral(string)}}},emptyHash:function(){this.pushStackLiteral("{}");if(this.trackIds){this.push("{}")}if(this.stringParams){this.push("{}");this.push("{}")}},pushHash:function(){if(this.hash){this.hashes.push(this.hash)}this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var hash=this.hash;this.hash=this.hashes.pop();if(this.trackIds){this.push("{"+hash.ids.join(",")+"}")}if(this.stringParams){this.push("{"+hash.contexts.join(",")+"}");this.push("{"+hash.types.join(",")+"}")}this.push("{\n "+hash.values.join(",\n ")+"\n }")},pushString:function(string){this.pushStackLiteral(this.quotedString(string))},push:function(expr){this.inlineStack.push(expr);return expr},pushLiteral:function(value){this.pushStackLiteral(value)},pushProgram:function(guid){if(guid!=null){this.pushStackLiteral(this.programExpression(guid))}else{this.pushStackLiteral(null)}},invokeHelper:function(paramSize,name,isSimple){this.aliases.helperMissing="helpers.helperMissing";var nonHelper=this.popStack();var helper=this.setupHelper(paramSize,name);var lookup=(isSimple?helper.name+" || ":"")+nonHelper+" || helperMissing";this.push("(("+lookup+").call("+helper.callParams+"))")},invokeKnownHelper:function(paramSize,name){var helper=this.setupHelper(paramSize,name);this.push(helper.name+".call("+helper.callParams+")")},invokeAmbiguous:function(name,helperCall){this.aliases.functionType='"function"';this.aliases.helperMissing="helpers.helperMissing";this.useRegister("helper");var nonHelper=this.popStack();this.emptyHash();var helper=this.setupHelper(0,name,helperCall);var helperName=this.lastHelper=this.nameLookup("helpers",name,"helper");this.push("((helper = (helper = "+helperName+" || "+nonHelper+") != null ? helper : helperMissing"+(helper.paramsInit?"),("+helper.paramsInit:"")+"),"+"(typeof helper === functionType ? helper.call("+helper.callParams+") : helper))")},invokePartial:function(name,indent){var params=[this.nameLookup("partials",name,"partial"),"'"+indent+"'","'"+name+"'",this.popStack(),this.popStack(),"helpers","partials"];if(this.options.data){params.push("data")}else if(this.options.compat){params.push("undefined")}if(this.options.compat){params.push("depths")}this.push("this.invokePartial("+params.join(", ")+")")},assignToHash:function(key){var value=this.popStack(),context,type,id;if(this.trackIds){id=this.popStack()}if(this.stringParams){type=this.popStack();context=this.popStack()}var hash=this.hash;if(context){hash.contexts.push("'"+key+"': "+context)}if(type){hash.types.push("'"+key+"': "+type)}if(id){hash.ids.push("'"+key+"': "+id)}hash.values.push("'"+key+"': ("+value+")")},pushId:function(type,name){if(type==="ID"||type==="DATA"){this.pushString(name)}else if(type==="sexpr"){this.pushStackLiteral("true")}else{this.pushStackLiteral("null")}},compiler:JavaScriptCompiler,compileChildren:function(environment,options){var children=environment.children,child,compiler;for(var i=0,l=children.length;i<l;i++){child=children[i];compiler=new this.compiler;var index=this.matchExistingProgram(child);if(index==null){this.context.programs.push("");index=this.context.programs.length;child.index=index;child.name="program"+index;this.context.programs[index]=compiler.compile(child,options,this.context,!this.precompile);this.context.environments[index]=child;this.useDepths=this.useDepths||compiler.useDepths}else{child.index=index;child.name="program"+index}}},matchExistingProgram:function(child){for(var i=0,len=this.context.environments.length;i<len;i++){var environment=this.context.environments[i];if(environment&&environment.equals(child)){return i}}},programExpression:function(guid){var child=this.environment.children[guid],depths=child.depths.list,useDepths=this.useDepths,depth;var programParams=[child.index,"data"];if(useDepths){programParams.push("depths")}return"this.program("+programParams.join(", ")+")"},useRegister:function(name){if(!this.registers[name]){this.registers[name]=true;this.registers.list.push(name)}},pushStackLiteral:function(item){return this.push(new Literal(item))},pushSource:function(source){if(this.pendingContent){this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent)));this.pendingContent=undefined}if(source){this.source.push(source)}},pushStack:function(item){this.flushInline();var stack=this.incrStack();this.pushSource(stack+" = "+item+";");this.compileStack.push(stack);return stack},replaceStack:function(callback){var prefix="",inline=this.isInline(),stack,createdStack,usedLiteral;if(!this.isInline()){throw new Exception("replaceStack on non-inline")}var top=this.popStack(true);if(top instanceof Literal){prefix=stack=top.value;usedLiteral=true}else{createdStack=!this.stackSlot;var name=!createdStack?this.topStackName():this.incrStack();prefix="("+this.push(name)+" = "+top+")";stack=this.topStack()}var item=callback.call(this,stack);if(!usedLiteral){this.popStack()}if(createdStack){this.stackSlot--}this.push("("+prefix+item+")")},incrStack:function(){this.stackSlot++;if(this.stackSlot>this.stackVars.length){this.stackVars.push("stack"+this.stackSlot)}return this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var inlineStack=this.inlineStack;if(inlineStack.length){this.inlineStack=[];for(var i=0,len=inlineStack.length;i<len;i++){var entry=inlineStack[i];if(entry instanceof Literal){this.compileStack.push(entry)}else{this.pushStack(entry)}}}},isInline:function(){return this.inlineStack.length},popStack:function(wrapped){var inline=this.isInline(),item=(inline?this.inlineStack:this.compileStack).pop();if(!wrapped&&item instanceof Literal){return item.value}else{if(!inline){if(!this.stackSlot){throw new Exception("Invalid stack pop")}this.stackSlot--}return item}},topStack:function(){var stack=this.isInline()?this.inlineStack:this.compileStack,item=stack[stack.length-1];if(item instanceof Literal){return item.value}else{return item}},contextName:function(context){if(this.useDepths&&context){return"depths["+context+"]"}else{return"depth"+context}},quotedString:function(str){return'"'+str.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(obj){var pairs=[];for(var key in obj){if(obj.hasOwnProperty(key)){pairs.push(this.quotedString(key)+":"+obj[key])}}return"{"+pairs.join(",")+"}"},setupHelper:function(paramSize,name,blockHelper){var params=[],paramsInit=this.setupParams(name,paramSize,params,blockHelper);var foundHelper=this.nameLookup("helpers",name,"helper");return{params:params,paramsInit:paramsInit,name:foundHelper,callParams:[this.contextName(0)].concat(params).join(", ")}},setupOptions:function(helper,paramSize,params){var options={},contexts=[],types=[],ids=[],param,inverse,program;options.name=this.quotedString(helper);options.hash=this.popStack();if(this.trackIds){options.hashIds=this.popStack()}if(this.stringParams){options.hashTypes=this.popStack();options.hashContexts=this.popStack()}inverse=this.popStack();program=this.popStack();if(program||inverse){if(!program){program="this.noop"}if(!inverse){inverse="this.noop"}options.fn=program;options.inverse=inverse}var i=paramSize;while(i--){param=this.popStack();params[i]=param;if(this.trackIds){ids[i]=this.popStack()}if(this.stringParams){types[i]=this.popStack();contexts[i]=this.popStack()}}if(this.trackIds){options.ids="["+ids.join(",")+"]"}if(this.stringParams){options.types="["+types.join(",")+"]";options.contexts="["+contexts.join(",")+"]"}if(this.options.data){options.data="data"}return options},setupParams:function(helperName,paramSize,params,useRegister){var options=this.objectLiteral(this.setupOptions(helperName,paramSize,params));if(useRegister){this.useRegister("options");params.push("options");return"options="+options}else{params.push(options);return""}}};var reservedWords=("break else new var"+" case finally return void"+" catch for switch while"+" continue function this with"+" default if throw"+" delete in try"+" do instanceof typeof"+" abstract enum int short"+" boolean export interface static"+" byte extends long super"+" char final native synchronized"+" class float package throws"+" const goto private transient"+" debugger implements protected volatile"+" double import public let yield").split(" ");var compilerWords=JavaScriptCompiler.RESERVED_WORDS={};for(var i=0,l=reservedWords.length;i<l;i++){compilerWords[reservedWords[i]]=true}JavaScriptCompiler.isValidJavaScriptVariableName=function(name){return!JavaScriptCompiler.RESERVED_WORDS[name]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)};exports["default"]=JavaScriptCompiler},{"../base":7,"../exception":16}],13:[function(require,module,exports){"use strict";var handlebars=function(){var parser={trace:function trace(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:yy.prepareProgram($$[$0-1].statements,true);return $$[$0-1];break;case 2:this.$=new yy.ProgramNode(yy.prepareProgram($$[$0]),{},this._$);break;case 3:this.$=$$[$0];break;case 4:this.$=$$[$0];break;case 5:this.$=$$[$0];break;case 6:this.$=$$[$0];break;case 7:this.$=new yy.ContentNode($$[$0],this._$);break;case 8:this.$=new yy.CommentNode($$[$0],this._$);break;case 9:this.$=new yy.RawBlockNode($$[$0-2],$$[$0-1],$$[$0],this._$);break;case 10:this.$=new yy.MustacheNode($$[$0-1],null,"","",this._$);break;case 11:this.$=yy.prepareBlock($$[$0-3],$$[$0-2],$$[$0-1],$$[$0],false,this._$);break;case 12:this.$=yy.prepareBlock($$[$0-3],$$[$0-2],$$[$0-1],$$[$0],true,this._$);break;case 13:this.$=new yy.MustacheNode($$[$0-1],null,$$[$0-2],yy.stripFlags($$[$0-2],$$[$0]),this._$);break;case 14:this.$=new yy.MustacheNode($$[$0-1],null,$$[$0-2],yy.stripFlags($$[$0-2],$$[$0]),this._$);break;case 15:this.$={strip:yy.stripFlags($$[$0-1],$$[$0-1]),program:$$[$0]};break;case 16:this.$={path:$$[$0-1],strip:yy.stripFlags($$[$0-2],$$[$0])};break;case 17:this.$=new yy.MustacheNode($$[$0-1],null,$$[$0-2],yy.stripFlags($$[$0-2],$$[$0]),this._$);break;case 18:this.$=new yy.MustacheNode($$[$0-1],null,$$[$0-2],yy.stripFlags($$[$0-2],$$[$0]),this._$);break;case 19:this.$=new yy.PartialNode($$[$0-3],$$[$0-2],$$[$0-1],yy.stripFlags($$[$0-4],$$[$0]),this._$);break;case 20:this.$=new yy.PartialNode($$[$0-2],undefined,$$[$0-1],yy.stripFlags($$[$0-3],$$[$0]),this._$);break;case 21:this.$=new yy.SexprNode([$$[$0-2]].concat($$[$0-1]),$$[$0],this._$);break;case 22:this.$=new yy.SexprNode([$$[$0]],null,this._$);break;case 23:this.$=$$[$0];break;case 24:this.$=new yy.StringNode($$[$0],this._$);break;case 25:this.$=new yy.NumberNode($$[$0],this._$);break;case 26:this.$=new yy.BooleanNode($$[$0],this._$);break;case 27:this.$=$$[$0];break;case 28:$$[$0-1].isHelper=true;this.$=$$[$0-1];break;case 29:this.$=new yy.HashNode($$[$0],this._$);break;case 30:this.$=[$$[$0-2],$$[$0]];break;case 31:this.$=new yy.PartialNameNode($$[$0],this._$);break;case 32:this.$=new yy.PartialNameNode(new yy.StringNode($$[$0],this._$),this._$);break;case 33:this.$=new yy.PartialNameNode(new yy.NumberNode($$[$0],this._$));break;case 34:this.$=new yy.DataNode($$[$0],this._$);break;case 35:this.$=new yy.IdNode($$[$0],this._$);break;case 36:$$[$0-2].push({part:$$[$0],separator:$$[$0-1]});this.$=$$[$0-2];break;case 37:this.$=[{part:$$[$0]}];break;case 38:this.$=[];break;case 39:$$[$0-1].push($$[$0]);break;case 48:this.$=[];break;case 49:$$[$0-1].push($$[$0]);break;case 52:this.$=[$$[$0]];break;case 53:$$[$0-1].push($$[$0]);break}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function parseError(str,hash){throw new Error(str) | |
},parse:function parse(input){var self=this,stack=[0],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,recovering=0,TERROR=2,EOF=1;this.lexer.setInput(input);this.lexer.yy=this.yy;this.yy.lexer=this.lexer;this.yy.parser=this;if(typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var yyloc=this.lexer.yylloc;lstack.push(yyloc);var ranges=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function popStack(n){stack.length=stack.length-2*n;vstack.length=vstack.length-n;lstack.length=lstack.length-n}function lex(){var token;token=self.lexer.lex()||1;if(typeof token!=="number"){token=self.symbols_[token]||token}return token}var symbol,preErrorSymbol,state,action,a,r,yyval={},p,len,newState,expected;while(true){state=stack[stack.length-1];if(this.defaultActions[state]){action=this.defaultActions[state]}else{if(symbol===null||typeof symbol=="undefined"){symbol=lex()}action=table[state]&&table[state][symbol]}if(typeof action==="undefined"||!action.length||!action[0]){var errStr="";if(!recovering){expected=[];for(p in table[state])if(this.terminals_[p]&&p>2){expected.push("'"+this.terminals_[p]+"'")}if(this.lexer.showPosition){errStr="Parse error on line "+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'"}else{errStr="Parse error on line "+(yylineno+1)+": Unexpected "+(symbol==1?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'")}this.parseError(errStr,{text:this.lexer.match,token:this.terminals_[symbol]||symbol,line:this.lexer.yylineno,loc:yyloc,expected:expected})}}if(action[0]instanceof Array&&action.length>1){throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol)}switch(action[0]){case 1:stack.push(symbol);vstack.push(this.lexer.yytext);lstack.push(this.lexer.yylloc);stack.push(action[1]);symbol=null;if(!preErrorSymbol){yyleng=this.lexer.yyleng;yytext=this.lexer.yytext;yylineno=this.lexer.yylineno;yyloc=this.lexer.yylloc;if(recovering>0)recovering--}else{symbol=preErrorSymbol;preErrorSymbol=null}break;case 2:len=this.productions_[action[1]][1];yyval.$=vstack[vstack.length-len];yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column};if(ranges){yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]}r=this.performAction.call(yyval,yytext,yyleng,yylineno,this.yy,action[1],vstack,lstack);if(typeof r!=="undefined"){return r}if(len){stack=stack.slice(0,-1*len*2);vstack=vstack.slice(0,-1*len);lstack=lstack.slice(0,-1*len)}stack.push(this.productions_[action[1]][0]);vstack.push(yyval.$);lstack.push(yyval._$);newState=table[stack[stack.length-2]][stack[stack.length-1]];stack.push(newState);break;case 3:return true}}return true}};var lexer=function(){var lexer={EOF:1,parseError:function parseError(str,hash){if(this.yy.parser){this.yy.parser.parseError(str,hash)}else{throw new Error(str)}},setInput:function(input){this._input=input;this._more=this._less=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges)this.yylloc.range=[0,0];this.offset=0;return this},input:function(){var ch=this._input[0];this.yytext+=ch;this.yyleng++;this.offset++;this.match+=ch;this.matched+=ch;var lines=ch.match(/(?:\r\n?|\n).*/g);if(lines){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges)this.yylloc.range[1]++;this._input=this._input.slice(1);return ch},unput:function(ch){var len=ch.length;var lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-len-1);this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(lines.length-1)this.yylineno-=lines.length-1;var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len};if(this.options.ranges){this.yylloc.range=[r[0],r[0]+this.yyleng-len]}return this},more:function(){this._more=true;return this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var next=this.match;if(next.length<20){next+=this._input.substr(0,20-next.length)}return(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var pre=this.pastInput();var c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},next:function(){if(this.done){return this.EOF}if(!this._input)this.done=true;var token,match,tempMatch,index,col,lines;if(!this._more){this.yytext="";this.match=""}var rules=this._currentRules();for(var i=0;i<rules.length;i++){tempMatch=this._input.match(this.rules[rules[i]]);if(tempMatch&&(!match||tempMatch[0].length>match[0].length)){match=tempMatch;index=i;if(!this.options.flex)break}}if(match){lines=match[0].match(/(?:\r\n?|\n).*/g);if(lines)this.yylineno+=lines.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length};this.yytext+=match[0];this.match+=match[0];this.matches=match;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._input=this._input.slice(match[0].length);this.matched+=match[0];token=this.performAction.call(this,this.yy,this,rules[index],this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input)this.done=false;if(token)return token;else return}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function lex(){var r=this.next();if(typeof r!=="undefined"){return r}else{return this.lex()}},begin:function begin(condition){this.conditionStack.push(condition)},popState:function popState(){return this.conditionStack.pop()},_currentRules:function _currentRules(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function begin(condition){this.begin(condition)}};lexer.options={};lexer.performAction=function anonymous(yy,yy_,$avoiding_name_collisions,YY_START){function strip(start,end){return yy_.yytext=yy_.yytext.substr(start,yy_.yyleng-end)}var YYSTATE=YY_START;switch($avoiding_name_collisions){case 0:if(yy_.yytext.slice(-2)==="\\\\"){strip(0,1);this.begin("mu")}else if(yy_.yytext.slice(-1)==="\\"){strip(0,1);this.begin("emu")}else{this.begin("mu")}if(yy_.yytext)return 12;break;case 1:return 12;break;case 2:this.popState();return 12;break;case 3:yy_.yytext=yy_.yytext.substr(5,yy_.yyleng-9);this.popState();return 15;break;case 4:return 12;break;case 5:strip(0,4);this.popState();return 13;break;case 6:return 45;break;case 7:return 46;break;case 8:return 16;break;case 9:this.popState();this.begin("raw");return 18;break;case 10:return 34;break;case 11:return 24;break;case 12:return 29;break;case 13:this.popState();return 28;break;case 14:this.popState();return 28;break;case 15:return 26;break;case 16:return 26;break;case 17:return 32;break;case 18:return 31;break;case 19:this.popState();this.begin("com");break;case 20:strip(3,5);this.popState();return 13;break;case 21:return 31;break;case 22:return 51;break;case 23:return 50;break;case 24:return 50;break;case 25:return 54;break;case 26:break;case 27:this.popState();return 33;break;case 28:this.popState();return 25;break;case 29:yy_.yytext=strip(1,2).replace(/\\"/g,'"');return 42;break;case 30:yy_.yytext=strip(1,2).replace(/\\'/g,"'");return 42;break;case 31:return 52;break;case 32:return 44;break;case 33:return 44;break;case 34:return 43;break;case 35:return 50;break;case 36:yy_.yytext=strip(1,2);return 50;break;case 37:return"INVALID";break;case 38:return 5;break}};lexer.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];lexer.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:false},emu:{rules:[2],inclusive:false},com:{rules:[5],inclusive:false},raw:{rules:[3,4],inclusive:false},INITIAL:{rules:[0,1,38],inclusive:true}};return lexer}();parser.lexer=lexer;function Parser(){this.yy={}}Parser.prototype=parser;parser.Parser=Parser;return new Parser}();exports["default"]=handlebars},{}],14:[function(require,module,exports){"use strict";var Visitor=require("./visitor")["default"];function print(ast){return(new PrintVisitor).accept(ast)}exports.print=print;function PrintVisitor(){this.padding=0}exports.PrintVisitor=PrintVisitor;PrintVisitor.prototype=new Visitor;PrintVisitor.prototype.pad=function(string){var out="";for(var i=0,l=this.padding;i<l;i++){out=out+" "}out=out+string+"\n";return out};PrintVisitor.prototype.program=function(program){var out="",statements=program.statements,i,l;for(i=0,l=statements.length;i<l;i++){out=out+this.accept(statements[i])}this.padding--;return out};PrintVisitor.prototype.block=function(block){var out="";out=out+this.pad("BLOCK:");this.padding++;out=out+this.accept(block.mustache);if(block.program){out=out+this.pad("PROGRAM:");this.padding++;out=out+this.accept(block.program);this.padding--}if(block.inverse){if(block.program){this.padding++}out=out+this.pad("{{^}}");this.padding++;out=out+this.accept(block.inverse);this.padding--;if(block.program){this.padding--}}this.padding--;return out};PrintVisitor.prototype.sexpr=function(sexpr){var params=sexpr.params,paramStrings=[],hash;for(var i=0,l=params.length;i<l;i++){paramStrings.push(this.accept(params[i]))}params="["+paramStrings.join(", ")+"]";hash=sexpr.hash?" "+this.accept(sexpr.hash):"";return this.accept(sexpr.id)+" "+params+hash};PrintVisitor.prototype.mustache=function(mustache){return this.pad("{{ "+this.accept(mustache.sexpr)+" }}")};PrintVisitor.prototype.partial=function(partial){var content=this.accept(partial.partialName);if(partial.context){content+=" "+this.accept(partial.context)}if(partial.hash){content+=" "+this.accept(partial.hash)}return this.pad("{{> "+content+" }}")};PrintVisitor.prototype.hash=function(hash){var pairs=hash.pairs;var joinedPairs=[],left,right;for(var i=0,l=pairs.length;i<l;i++){left=pairs[i][0];right=this.accept(pairs[i][1]);joinedPairs.push(left+"="+right)}return"HASH{"+joinedPairs.join(", ")+"}"};PrintVisitor.prototype.STRING=function(string){return'"'+string.string+'"'};PrintVisitor.prototype.NUMBER=function(number){return"NUMBER{"+number.number+"}"};PrintVisitor.prototype.BOOLEAN=function(bool){return"BOOLEAN{"+bool.bool+"}"};PrintVisitor.prototype.ID=function(id){var path=id.parts.join("/");if(id.parts.length>1){return"PATH:"+path}else{return"ID:"+path}};PrintVisitor.prototype.PARTIAL_NAME=function(partialName){return"PARTIAL:"+partialName.name};PrintVisitor.prototype.DATA=function(data){return"@"+this.accept(data.id)};PrintVisitor.prototype.content=function(content){return this.pad("CONTENT[ '"+content.string+"' ]")};PrintVisitor.prototype.comment=function(comment){return this.pad("{{! '"+comment.comment+"' }}")}},{"./visitor":15}],15:[function(require,module,exports){"use strict";function Visitor(){}Visitor.prototype={constructor:Visitor,accept:function(object){return this[object.type](object)}};exports["default"]=Visitor},{}],16:[function(require,module,exports){"use strict";var errorProps=["description","fileName","lineNumber","message","name","number","stack"];function Exception(message,node){var line;if(node&&node.firstLine){line=node.firstLine;message+=" - "+line+":"+node.firstColumn}var tmp=Error.prototype.constructor.call(this,message);for(var idx=0;idx<errorProps.length;idx++){this[errorProps[idx]]=tmp[errorProps[idx]]}if(line){this.lineNumber=line;this.column=node.firstColumn}}Exception.prototype=new Error;exports["default"]=Exception},{}],17:[function(require,module,exports){"use strict";var Utils=require("./utils");var Exception=require("./exception")["default"];var COMPILER_REVISION=require("./base").COMPILER_REVISION;var REVISION_CHANGES=require("./base").REVISION_CHANGES;var createFrame=require("./base").createFrame;function checkRevision(compilerInfo){var compilerRevision=compilerInfo&&compilerInfo[0]||1,currentRevision=COMPILER_REVISION;if(compilerRevision!==currentRevision){if(compilerRevision<currentRevision){var runtimeVersions=REVISION_CHANGES[currentRevision],compilerVersions=REVISION_CHANGES[compilerRevision];throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+"Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").")}else{throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+"Please update your runtime to a newer version ("+compilerInfo[1]+").")}}}exports.checkRevision=checkRevision;function template(templateSpec,env){if(!env){throw new Exception("No environment passed to template")}if(!templateSpec||!templateSpec.main){throw new Exception("Unknown template object: "+typeof templateSpec)}env.VM.checkRevision(templateSpec.compiler);var invokePartialWrapper=function(partial,indent,name,context,hash,helpers,partials,data,depths){if(hash){context=Utils.extend({},context,hash)}var result=env.VM.invokePartial.call(this,partial,name,context,helpers,partials,data,depths);if(result==null&&env.compile){var options={helpers:helpers,partials:partials,data:data,depths:depths};partials[name]=env.compile(partial,{data:data!==undefined,compat:templateSpec.compat},env);result=partials[name](context,options)}if(result!=null){if(indent){var lines=result.split("\n");for(var i=0,l=lines.length;i<l;i++){if(!lines[i]&&i+1===l){break}lines[i]=indent+lines[i]}result=lines.join("\n")}return result}else{throw new Exception("The partial "+name+" could not be compiled when running in runtime-only mode")}};var container={lookup:function(depths,name){var len=depths.length;for(var i=0;i<len;i++){if(depths[i]&&depths[i][name]!=null){return depths[i][name]}}},lambda:function(current,context){return typeof current==="function"?current.call(context):current},escapeExpression:Utils.escapeExpression,invokePartial:invokePartialWrapper,fn:function(i){return templateSpec[i]},programs:[],program:function(i,data,depths){var programWrapper=this.programs[i],fn=this.fn(i);if(data||depths){programWrapper=program(this,i,fn,data,depths)}else if(!programWrapper){programWrapper=this.programs[i]=program(this,i,fn)}return programWrapper},data:function(data,depth){while(data&&depth--){data=data._parent}return data},merge:function(param,common){var ret=param||common;if(param&&common&¶m!==common){ret=Utils.extend({},common,param)}return ret},noop:env.VM.noop,compilerInfo:templateSpec.compiler};var ret=function(context,options){options=options||{};var data=options.data;ret._setup(options);if(!options.partial&&templateSpec.useData){data=initData(context,data)}var depths;if(templateSpec.useDepths){depths=options.depths?[context].concat(options.depths):[context]}return templateSpec.main.call(container,context,container.helpers,container.partials,data,depths)};ret.isTop=true;ret._setup=function(options){if(!options.partial){container.helpers=container.merge(options.helpers,env.helpers);if(templateSpec.usePartial){container.partials=container.merge(options.partials,env.partials)}}else{container.helpers=options.helpers;container.partials=options.partials}};ret._child=function(i,data,depths){if(templateSpec.useDepths&&!depths){throw new Exception("must pass parent depths")}return program(container,i,templateSpec[i],data,depths)};return ret}exports.template=template;function program(container,i,fn,data,depths){var prog=function(context,options){options=options||{};return fn.call(container,context,container.helpers,container.partials,options.data||data,depths&&[context].concat(depths))};prog.program=i;prog.depth=depths?depths.length:0;return prog}exports.program=program;function invokePartial(partial,name,context,helpers,partials,data,depths){var options={partial:true,helpers:helpers,partials:partials,data:data,depths:depths};if(partial===undefined){throw new Exception("The partial "+name+" could not be found")}else if(partial instanceof Function){return partial(context,options)}}exports.invokePartial=invokePartial;function noop(){return""}exports.noop=noop;function initData(context,data){if(!data||!("root"in data)){data=data?createFrame(data):{};data.root=context}return data}},{"./base":7,"./exception":16,"./utils":19}],18:[function(require,module,exports){"use strict";function SafeString(string){this.string=string}SafeString.prototype.toString=function(){return""+this.string};exports["default"]=SafeString},{}],19:[function(require,module,exports){"use strict";var SafeString=require("./safe-string")["default"];var escape={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};var badChars=/[&<>"'`]/g;var possible=/[&<>"'`]/;function escapeChar(chr){return escape[chr]}function extend(obj){for(var i=1;i<arguments.length;i++){for(var key in arguments[i]){if(Object.prototype.hasOwnProperty.call(arguments[i],key)){obj[key]=arguments[i][key]}}}return obj}exports.extend=extend;var toString=Object.prototype.toString;exports.toString=toString;var isFunction=function(value){return typeof value==="function"};if(isFunction(/x/)){isFunction=function(value){return typeof value==="function"&&toString.call(value)==="[object Function]"}}var isFunction;exports.isFunction=isFunction;var isArray=Array.isArray||function(value){return value&&typeof value==="object"?toString.call(value)==="[object Array]":false};exports.isArray=isArray;function escapeExpression(string){if(string instanceof SafeString){return string.toString()}else if(string==null){return""}else if(!string){return string+""}string=""+string;if(!possible.test(string)){return string}return string.replace(badChars,escapeChar)}exports.escapeExpression=escapeExpression;function isEmpty(value){if(!value&&value!==0){return true}else if(isArray(value)&&value.length===0){return true}else{return false}}exports.isEmpty=isEmpty;function appendContextPath(contextPath,id){return(contextPath?contextPath+".":"")+id}exports.appendContextPath=appendContextPath},{"./safe-string":18}],20:[function(require,module,exports){var handlebars=require("../dist/cjs/handlebars")["default"];handlebars.Visitor=require("../dist/cjs/handlebars/compiler/visitor")["default"];var printer=require("../dist/cjs/handlebars/compiler/printer");handlebars.PrintVisitor=printer.PrintVisitor;handlebars.print=printer.print;module.exports=handlebars;if(typeof require!=="undefined"&&require.extensions){var extension=function(module,filename){var fs=require("fs");var templateString=fs.readFileSync(filename,"utf8");module.exports=handlebars.compile(templateString)};require.extensions[".handlebars"]=extension;require.extensions[".hbs"]=extension}},{"../dist/cjs/handlebars":5,"../dist/cjs/handlebars/compiler/printer":14,"../dist/cjs/handlebars/compiler/visitor":15,fs:1}],"engine-handlebars":[function(require,module,exports){"use strict";var fs=require("fs");var utils=require("engine-utils");var requires={};var engine=module.exports=utils.fromStringRenderer("handlebars");engine.compile=function compile(str,settings){var handlebars=require.handlebars||(require.handlebars=require("handlebars"));settings=settings||{};for(var partial in settings.partials){handlebars.registerPartial(partial,settings.partials[partial])}for(var helper in settings.helpers){handlebars.registerHelper(helper,settings.helpers[helper])}if(typeof str==="function")return str;return handlebars.compile(str)};engine.render=function render(str,context,cb){var handlebars=requires.handlebars||(requires.handlebars=require("handlebars"));if(typeof context==="function"){cb=context;context={}}context=context||{};try{var fn=typeof str==="function"?str:engine.compile(str,context);cb(null,fn(context),".html")}catch(err){cb(err);return}};engine.renderSync=function renderSync(str,context){var handlebars=requires.handlebars||(requires.handlebars=require("handlebars"));context=context||{};try{var fn=typeof str==="function"?str:engine.compile(str,context);return fn(context)}catch(err){return err}};engine.renderFile=function renderFile(path,options,cb){if(typeof options==="function"){cb=options;options={}}var opts=options||{};try{engine.render(fs.readFileSync(path,"utf8"),opts,cb)}catch(err){cb(err);return}};engine.__express=engine.renderFile},{"engine-utils":4,fs:1,handlebars:20}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){var base64=require("base64-js");var ieee754=require("ieee754");var isArray=require("is-array");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;Buffer.poolSize=8192;var kMaxLength=1073741823;var rootParent={};Buffer.TYPED_ARRAY_SUPPORT=function(){try{var buf=new ArrayBuffer(0);var arr=new Uint8Array(buf);arr.foo=function(){return 42};return 42===arr.foo()&&typeof arr.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(e){return false}}();function Buffer(subject,encoding,noZero){if(!(this instanceof Buffer))return new Buffer(subject,encoding,noZero);var type=typeof subject;var length;if(type==="number")length=subject>0?subject>>>0:0;else if(type==="string"){length=Buffer.byteLength(subject,encoding)}else if(type==="object"&&subject!==null){if(subject.type==="Buffer"&&isArray(subject.data))subject=subject.data;length=+subject.length>0?Math.floor(+subject.length):0}else throw new TypeError("must start with number, buffer, array or string");if(length>kMaxLength)throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength.toString(16)+" bytes");var buf;if(Buffer.TYPED_ARRAY_SUPPORT){buf=Buffer._augment(new Uint8Array(length))}else{buf=this;buf.length=length;buf._isBuffer=true}var i;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof subject.byteLength==="number"){buf._set(subject)}else if(isArrayish(subject)){if(Buffer.isBuffer(subject)){for(i=0;i<length;i++)buf[i]=subject.readUInt8(i)}else{for(i=0;i<length;i++)buf[i]=(subject[i]%256+256)%256}}else if(type==="string"){buf.write(subject,0,encoding)}else if(type==="number"&&!Buffer.TYPED_ARRAY_SUPPORT&&!noZero){for(i=0;i<length;i++){buf[i]=0}}if(length>0&&length<=Buffer.poolSize)buf.parent=rootParent;return buf}function SlowBuffer(subject,encoding,noZero){if(!(this instanceof SlowBuffer))return new SlowBuffer(subject,encoding,noZero);var buf=new Buffer(subject,encoding,noZero);delete buf.parent;return buf}Buffer.isBuffer=function(b){return!!(b!=null&&b._isBuffer)};Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len&&a[i]===b[i];i++){}if(i!==len){x=a[i];y=b[i]}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function(list,totalLength){if(!isArray(list))throw new TypeError("Usage: Buffer.concat(list[, length])");if(list.length===0){return new Buffer(0)}else if(list.length===1){return list[0]}var i;if(totalLength===undefined){totalLength=0;for(i=0;i<list.length;i++){totalLength+=list[i].length}}var buf=new Buffer(totalLength);var pos=0;for(i=0;i<list.length;i++){var item=list[i];item.copy(buf,pos);pos+=item.length}return buf};Buffer.byteLength=function(str,encoding){var ret;str=str+"";switch(encoding||"utf8"){case"ascii":case"binary":case"raw":ret=str.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=str.length*2;break;case"hex":ret=str.length>>>1;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"base64":ret=base64ToBytes(str).length;break;default:ret=str.length}return ret};Buffer.prototype.length=undefined;Buffer.prototype.parent=undefined;Buffer.prototype.toString=function(encoding,start,end){var loweredCase=false;start=start>>>0;end=end===undefined||end===Infinity?this.length:end>>>0;if(!encoding)encoding="utf8";if(start<0)start=0;if(end>this.length)end=this.length;if(end<=start)return"";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return"<Buffer "+str+">"};Buffer.prototype.compare=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)};Buffer.prototype.get=function(offset){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(offset)};Buffer.prototype.set=function(v,offset){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(v,offset)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;i<length;i++){var byte=parseInt(string.substr(i*2,2),16);if(isNaN(byte))throw new Error("Invalid hex string");buf[offset+i]=byte}return i}function utf8Write(buf,string,offset,length){var charsWritten=blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length);return charsWritten}function asciiWrite(buf,string,offset,length){var charsWritten=blitBuffer(asciiToBytes(string),buf,offset,length);return charsWritten}function binaryWrite(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){var charsWritten=blitBuffer(base64ToBytes(string),buf,offset,length);return charsWritten}function utf16leWrite(buf,string,offset,length){var charsWritten=blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length,2);return charsWritten}Buffer.prototype.write=function(string,offset,length,encoding){if(isFinite(offset)){if(!isFinite(length)){encoding=length;length=undefined}}else{var swap=encoding;encoding=offset;offset=length;length=swap}offset=Number(offset)||0;if(length<0||offset<0||offset>this.length)throw new RangeError("attempt to write outside buffer bounds");var remaining=this.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new TypeError("Unknown encoding: "+encoding)}return ret};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){if(buf[i]<=127){res+=decodeUtf8Char(tmp)+String.fromCharCode(buf[i]);tmp=""}else{tmp+="%"+buf[i].toString(16)}}return res+decodeUtf8Char(tmp)}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i]&127)}return ret}function binarySlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i])}return ret}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;i++){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;var newBuf;if(Buffer.TYPED_ARRAY_SUPPORT){newBuf=Buffer._augment(this.subarray(start,end))}else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,undefined,true);for(var i=0;i<sliceLen;i++){newBuf[i]=this[i+start]}}if(newBuf.length)newBuf.parent=this.parent||this;return newBuf};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256))val+=this[offset+i]*mul;return val};Buffer.prototype.readUIntBE=function(offset,byteLength,noAssert){offset=offset>>>0; | |
byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256))val+=this[offset+--byteLength]*mul;return val};Buffer.prototype.readUInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256))val+=this[offset+i]*mul;mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256))val+=this[offset+--i]*mul;mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||value<min)throw new RangeError("value is out of bounds");if(offset+ext>buf.length)throw new RangeError("index out of range")}Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength),0);var mul=1;var i=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256))this[offset+i]=value/mul>>>0&255;return offset+byteLength};Buffer.prototype.writeUIntBE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength),0);var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256))this[offset+i]=value/mul>>>0&255;return offset+byteLength};Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i<j;i++){buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i<j;i++){buf[offset+i]=value>>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength-1)-1,-Math.pow(2,8*byteLength-1))}var i=0;var mul=1;var sub=value<0?1:0;this[offset]=value&255;while(++i<byteLength&&(mul*=256))this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength};Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength-1)-1,-Math.pow(2,8*byteLength-1))}var i=byteLength-1;var mul=1;var sub=value<0?1:0;this[offset+i]=value&255;while(--i>=0&&(mul*=256))this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength};Buffer.prototype.writeInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||value<min)throw new RangeError("value is out of bounds");if(offset+ext>buf.length)throw new RangeError("index out of range");if(offset<0)throw new RangeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38);ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308);ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(!start)start=0;if(!end&&end!==0)end=this.length;if(target_start>=target.length)target_start=target.length;if(!target_start)target_start=0;if(end>0&&end<start)end=start;if(end===start)return 0;if(target.length===0||source.length===0)return 0;if(target_start<0)throw new RangeError("targetStart out of bounds");if(start<0||start>=source.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-target_start<end-start)end=target.length-target_start+start;var len=end-start;if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i<len;i++){target[i+target_start]=this[i+start]}}else{target._set(this.subarray(start,start+len),target_start)}return len};Buffer.prototype.fill=function(value,start,end){if(!value)value=0;if(!start)start=0;if(!end)end=this.length;if(end<start)throw new RangeError("end < start");if(end===start)return;if(this.length===0)return;if(start<0||start>=this.length)throw new RangeError("start out of bounds");if(end<0||end>this.length)throw new RangeError("end out of bounds");var i;if(typeof value==="number"){for(i=start;i<end;i++){this[i]=value}}else{var bytes=utf8ToBytes(value.toString());var len=bytes.length;for(i=start;i<end;i++){this[i]=bytes[i%len]}}return this};Buffer.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(Buffer.TYPED_ARRAY_SUPPORT){return new Buffer(this).buffer}else{var buf=new Uint8Array(this.length);for(var i=0,len=buf.length;i<len;i+=1){buf[i]=this[i]}return buf.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var BP=Buffer.prototype;Buffer._augment=function(arr){arr.constructor=Buffer;arr._isBuffer=true;arr._get=arr.get;arr._set=arr.set;arr.get=BP.get;arr.set=BP.set;arr.write=BP.write;arr.toString=BP.toString;arr.toLocaleString=BP.toString;arr.toJSON=BP.toJSON;arr.equals=BP.equals;arr.compare=BP.compare;arr.copy=BP.copy;arr.slice=BP.slice;arr.readUIntLE=BP.readUIntLE;arr.readUIntBE=BP.readUIntBE;arr.readUInt8=BP.readUInt8;arr.readUInt16LE=BP.readUInt16LE;arr.readUInt16BE=BP.readUInt16BE;arr.readUInt32LE=BP.readUInt32LE;arr.readUInt32BE=BP.readUInt32BE;arr.readIntLE=BP.readIntLE;arr.readIntBE=BP.readIntBE;arr.readInt8=BP.readInt8;arr.readInt16LE=BP.readInt16LE;arr.readInt16BE=BP.readInt16BE;arr.readInt32LE=BP.readInt32LE;arr.readInt32BE=BP.readInt32BE;arr.readFloatLE=BP.readFloatLE;arr.readFloatBE=BP.readFloatBE;arr.readDoubleLE=BP.readDoubleLE;arr.readDoubleBE=BP.readDoubleBE;arr.writeUInt8=BP.writeUInt8;arr.writeUIntLE=BP.writeUIntLE;arr.writeUIntBE=BP.writeUIntBE;arr.writeUInt16LE=BP.writeUInt16LE;arr.writeUInt16BE=BP.writeUInt16BE;arr.writeUInt32LE=BP.writeUInt32LE;arr.writeUInt32BE=BP.writeUInt32BE;arr.writeIntLE=BP.writeIntLE;arr.writeIntBE=BP.writeIntBE;arr.writeInt8=BP.writeInt8;arr.writeInt16LE=BP.writeInt16LE;arr.writeInt16BE=BP.writeInt16BE;arr.writeInt32LE=BP.writeInt32LE;arr.writeInt32BE=BP.writeInt32BE;arr.writeFloatLE=BP.writeFloatLE;arr.writeFloatBE=BP.writeFloatBE;arr.writeDoubleLE=BP.writeDoubleLE;arr.writeDoubleBE=BP.writeDoubleBE;arr.fill=BP.fill;arr.inspect=BP.inspect;arr.toArrayBuffer=BP.toArrayBuffer;return arr};var INVALID_BASE64_RE=/[^+\/0-9A-z\-]/g;function base64clean(str){str=stringtrim(str).replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function stringtrim(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,"")}function isArrayish(subject){return isArray(subject)||Buffer.isBuffer(subject)||subject&&typeof subject==="object"&&typeof subject.length==="number"}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(string,units){var codePoint,length=string.length;var leadSurrogate=null;units=units||Infinity;var bytes=[];var i=0;for(;i<length;i++){codePoint=string.charCodeAt(i);if(codePoint>55295&&codePoint<57344){if(leadSurrogate){if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}else{codePoint=leadSurrogate-55296<<10|codePoint-56320|65536;leadSurrogate=null}}else{if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}else{leadSurrogate=codePoint;continue}}}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=null}if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<2097152){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str,units){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;i++){if((units-=2)<0)break;c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length,unitSize){if(unitSize)length-=length%unitSize;for(var i=0;i<length;i++){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}},{"base64-js":2,ieee754:3,"is-array":4}],2:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);var PLUS_URL_SAFE="-".charCodeAt(0);var SLASH_URL_SAFE="_".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS||code===PLUS_URL_SAFE)return 62;if(code===SLASH||code===SLASH_URL_SAFE)return 63;if(code<NUMBER)return-1;if(code<NUMBER+10)return code-NUMBER+26+26;if(code<UPPER+26)return code-UPPER;if(code<LOWER+26)return code-LOWER+26}function b64ToByteArray(b64){var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i<l;i+=4,j+=3){tmp=decode(b64.charAt(i))<<18|decode(b64.charAt(i+1))<<12|decode(b64.charAt(i+2))<<6|decode(b64.charAt(i+3));push((tmp&16711680)>>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i<length;i+=3){temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output+=tripletToBase64(temp)}switch(extraBytes){case 1:temp=uint8[uint8.length-1];output+=encode(temp>>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],3:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8);m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8);if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8);e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=s*128}},{}],4:[function(require,module,exports){var isArray=Array.isArray;var str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}],5:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}throw TypeError('Uncaught, unspecified "error" event.')}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){var m;if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],6:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],7:[function(require,module,exports){module.exports=Array.isArray||function(arr){return Object.prototype.toString.call(arr)=="[object Array]"}},{}],8:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],9:[function(require,module,exports){module.exports=require("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":10}],10:[function(require,module,exports){(function(process){module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};var util=require("core-util-is");util.inherits=require("inherits");var Readable=require("./_stream_readable");var Writable=require("./_stream_writable");util.inherits(Duplex,Readable);forEach(objectKeys(Writable.prototype),function(method){if(!Duplex.prototype[method])Duplex.prototype[method]=Writable.prototype[method]});function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options);Writable.call(this,options);if(options&&options.readable===false)this.readable=false;if(options&&options.writable===false)this.writable=false;this.allowHalfOpen=true;if(options&&options.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}function onend(){if(this.allowHalfOpen||this._writableState.ended)return;process.nextTick(this.end.bind(this))}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}}).call(this,require("_process"))},{"./_stream_readable":12,"./_stream_writable":14,_process:8,"core-util-is":15,inherits:6}],11:[function(require,module,exports){module.exports=PassThrough;var Transform=require("./_stream_transform");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},{"./_stream_transform":13,"core-util-is":15,inherits:6}],12:[function(require,module,exports){(function(process){module.exports=Readable;var isArray=require("isarray");var Buffer=require("buffer").Buffer;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter;if(!EE.listenerCount)EE.listenerCount=function(emitter,type){return emitter.listeners(type).length};var Stream=require("stream");var util=require("core-util-is");util.inherits=require("inherits");var StringDecoder;util.inherits(Readable,Stream);function ReadableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=false;this.ended=false;this.endEmitted=false;this.reading=false;this.calledRead=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!options.objectMode;this.defaultEncoding=options.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(options.encoding){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this.decoder=new StringDecoder(options.encoding);this.encoding=options.encoding}}function Readable(options){if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this);this.readable=true;Stream.call(this)}Readable.prototype.push=function(chunk,encoding){var state=this._readableState;if(typeof chunk==="string"&&!state.objectMode){encoding=encoding||state.defaultEncoding;if(encoding!==state.encoding){chunk=new Buffer(chunk,encoding);encoding=""}}return readableAddChunk(this,state,chunk,encoding,false)};Readable.prototype.unshift=function(chunk){var state=this._readableState;return readableAddChunk(this,state,chunk,"",true)};function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er){stream.emit("error",er)}else if(chunk===null||chunk===undefined){state.reading=false;if(!state.ended)onEofChunk(stream,state)}else if(state.objectMode||chunk&&chunk.length>0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else{if(state.decoder&&!addToFront&&!encoding)chunk=state.decoder.write(chunk);state.length+=state.objectMode?1:chunk.length;if(addToFront){state.buffer.unshift(chunk)}else{state.reading=false;state.buffer.push(chunk)}if(state.needReadable)emitReadable(stream);maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.setEncoding=function(enc){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this._readableState.decoder=new StringDecoder(enc);this._readableState.encoding=enc};var MAX_HWM=8388608;function roundUpToNextPowerOf2(n){if(n>=MAX_HWM){n=MAX_HWM}else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){if(state.length===0&&state.ended)return 0;if(state.objectMode)return n===0?0:1;if(n===null||isNaN(n)){if(state.flowing&&state.buffer.length)return state.buffer[0].length;else return state.length}if(n<=0)return 0;if(n>state.highWaterMark)state.highWaterMark=roundUpToNextPowerOf2(n);if(n>state.length){if(!state.ended){state.needReadable=true;return 0}else return state.length}return n}Readable.prototype.read=function(n){var state=this._readableState;state.calledRead=true;var nOrig=n;var ret;if(typeof n!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){ret=null;if(state.length>0&&state.decoder){ret=fromList(n,state);state.length-=ret.length}if(state.length===0)endReadable(this);return ret}var doRead=state.needReadable;if(state.length-n<=state.highWaterMark)doRead=true;if(state.ended||state.reading)doRead=false;if(doRead){state.reading=true;state.sync=true;if(state.length===0)state.needReadable=true;this._read(state.highWaterMark);state.sync=false}if(doRead&&!state.reading)n=howMuchToRead(nOrig,state);if(n>0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true; | |
n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(state.ended&&!state.endEmitted&&state.length===0)endReadable(this);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;if(state.length>0)emitReadable(stream);else endReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(state.emittedReadable)return;state.emittedReadable=true;if(state.sync)process.nextTick(function(){emitReadable_(stream)});else emitReadable_(stream)}function emitReadable_(stream){stream.emit("readable")}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(function(){maybeReadMore_(stream,state)})}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark){stream.read(0);if(len===state.length)break;else len=state.length}state.readingMore=false}Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this;var state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1;var doEnd=(!pipeOpts||pipeOpts.end!==false)&&dest!==process.stdout&&dest!==process.stderr;var endFn=doEnd?onend:cleanup;if(state.endEmitted)process.nextTick(endFn);else src.once("end",endFn);dest.on("unpipe",onunpipe);function onunpipe(readable){if(readable!==src)return;cleanup()}function onend(){dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);function cleanup(){dest.removeListener("close",onclose);dest.removeListener("finish",onfinish);dest.removeListener("drain",ondrain);dest.removeListener("error",onerror);dest.removeListener("unpipe",onunpipe);src.removeListener("end",onend);src.removeListener("end",cleanup);if(!dest._writableState||dest._writableState.needDrain)ondrain()}function onerror(er){unpipe();dest.removeListener("error",onerror);if(EE.listenerCount(dest,"error")===0)dest.emit("error",er)}if(!dest._events||!dest._events.error)dest.on("error",onerror);else if(isArray(dest._events.error))dest._events.error.unshift(onerror);else dest._events.error=[onerror,dest._events.error];function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){this.on("readable",pipeOnReadable);state.flowing=true;process.nextTick(function(){flow(src)})}return dest};function pipeOnDrain(src){return function(){var dest=this;var state=src._readableState;state.awaitDrain--;if(state.awaitDrain===0)flow(src)}}function flow(src){var state=src._readableState;var chunk;state.awaitDrain=0;function write(dest,i,list){var written=dest.write(chunk);if(false===written){state.awaitDrain++}}while(state.pipesCount&&null!==(chunk=src.read())){if(state.pipesCount===1)write(state.pipes,0,null);else forEach(state.pipes,write);src.emit("data",chunk);if(state.awaitDrain>0)return}if(state.pipesCount===0){state.flowing=false;if(EE.listenerCount(src,"data")>0)emitDataEvents(src);return}state.ranOut=true}function pipeOnReadable(){if(this._readableState.ranOut){this._readableState.ranOut=false;flow(this)}}Readable.prototype.unpipe=function(dest){var state=this._readableState;if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;if(dest)dest.emit("unpipe",this);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;for(var i=0;i<len;i++)dests[i].emit("unpipe",this);return this}var i=indexOf(state.pipes,dest);if(i===-1)return this;state.pipes.splice(i,1);state.pipesCount-=1;if(state.pipesCount===1)state.pipes=state.pipes[0];dest.emit("unpipe",this);return this};Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if(ev==="data"&&!this._readableState.flowing)emitDataEvents(this);if(ev==="readable"&&this.readable){var state=this._readableState;if(!state.readableListening){state.readableListening=true;state.emittedReadable=false;state.needReadable=true;if(!state.reading){this.read(0)}else if(state.length){emitReadable(this,state)}}}return res};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.resume=function(){emitDataEvents(this);this.read(0);this.emit("resume")};Readable.prototype.pause=function(){emitDataEvents(this,true);this.emit("pause")};function emitDataEvents(stream,startPaused){var state=stream._readableState;if(state.flowing){throw new Error("Cannot switch to old mode now.")}var paused=startPaused||false;var readable=false;stream.readable=true;stream.pipe=Stream.prototype.pipe;stream.on=stream.addListener=Stream.prototype.on;stream.on("readable",function(){readable=true;var c;while(!paused&&null!==(c=stream.read()))stream.emit("data",c);if(c===null){readable=false;stream._readableState.needReadable=true}});stream.pause=function(){paused=true;this.emit("pause")};stream.resume=function(){paused=false;if(readable)process.nextTick(function(){stream.emit("readable")});else this.read(0);this.emit("resume")};stream.emit("readable")}Readable.prototype.wrap=function(stream){var state=this._readableState;var paused=false;var self=this;stream.on("end",function(){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length)self.push(chunk)}self.push(null)});stream.on("data",function(chunk){if(state.decoder)chunk=state.decoder.write(chunk);if(state.objectMode&&(chunk===null||chunk===undefined))return;else if(!state.objectMode&&(!chunk||!chunk.length))return;var ret=self.push(chunk);if(!ret){paused=true;stream.pause()}});for(var i in stream){if(typeof stream[i]==="function"&&typeof this[i]==="undefined"){this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i)}}var events=["error","close","destroy","pause","resume"];forEach(events,function(ev){stream.on(ev,self.emit.bind(self,ev))});self._read=function(n){if(paused){paused=false;stream.resume()}};return self};Readable._fromList=fromList;function fromList(n,state){var list=state.buffer;var length=state.length;var stringMode=!!state.decoder;var objectMode=!!state.objectMode;var ret;if(list.length===0)return null;if(length===0)ret=null;else if(objectMode)ret=list.shift();else if(!n||n>=length){if(stringMode)ret=list.join("");else ret=Buffer.concat(list,length);list.length=0}else{if(n<list[0].length){var buf=list[0];ret=buf.slice(0,n);list[0]=buf.slice(n)}else if(n===list[0].length){ret=list.shift()}else{if(stringMode)ret="";else ret=new Buffer(n);var c=0;for(var i=0,l=list.length;i<l&&c<n;i++){var buf=list[0];var cpy=Math.min(n-c,buf.length);if(stringMode)ret+=buf.slice(0,cpy);else buf.copy(ret,c,0,cpy);if(cpy<buf.length)list[0]=buf.slice(cpy);else list.shift();c+=cpy}}}return ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error("endReadable called on non-empty stream");if(!state.endEmitted&&state.calledRead){state.ended=true;process.nextTick(function(){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}})}}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i}return-1}}).call(this,require("_process"))},{_process:8,buffer:1,"core-util-is":15,events:5,inherits:6,isarray:7,stream:20,"string_decoder/":21}],13:[function(require,module,exports){module.exports=Transform;var Duplex=require("./_stream_duplex");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(Transform,Duplex);function TransformState(options,stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=false;var cb=ts.writecb;if(!cb)return stream.emit("error",new Error("no writecb in Transform class"));ts.writechunk=null;ts.writecb=null;if(data!==null&&data!==undefined)stream.push(data);if(cb)cb(er);var rs=stream._readableState;rs.reading=false;if(rs.needReadable||rs.length<rs.highWaterMark){stream._read(rs.highWaterMark)}}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options);var ts=this._transformState=new TransformState(options,this);var stream=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("finish",function(){if("function"===typeof this._flush)this._flush(function(er){done(stream,er)});else done(stream)})}Transform.prototype.push=function(chunk,encoding){this._transformState.needTransform=false;return Duplex.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;ts.writecb=cb;ts.writechunk=chunk;ts.writeencoding=encoding;if(!ts.transforming){var rs=this._readableState;if(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;if(ts.writechunk!==null&&ts.writecb&&!ts.transforming){ts.transforming=true;this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)}else{ts.needTransform=true}};function done(stream,er){if(er)return stream.emit("error",er);var ws=stream._writableState;var rs=stream._readableState;var ts=stream._transformState;if(ws.length)throw new Error("calling transform done when ws.length != 0");if(ts.transforming)throw new Error("calling transform done when still transforming");return stream.push(null)}},{"./_stream_duplex":10,"core-util-is":15,inherits:6}],14:[function(require,module,exports){(function(process){module.exports=Writable;var Buffer=require("buffer").Buffer;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var Stream=require("stream");util.inherits(Writable,Stream);function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb}function WritableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.objectMode=!!options.objectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.buffer=[];this.errorEmitted=false}function Writable(options){var Duplex=require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))};function writeAfterEnd(stream,state,cb){var er=new Error("write after end");stream.emit("error",er);process.nextTick(function(){cb(er)})}function validChunk(stream,state,chunk,cb){var valid=true;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){var er=new TypeError("Invalid non-string/buffer chunk");stream.emit("error",er);process.nextTick(function(){cb(er)});valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=function(){};if(state.ended)writeAfterEnd(this,state,cb);else if(validChunk(this,state,chunk,cb))ret=writeOrBuffer(this,state,chunk,encoding,cb);return ret};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=new Buffer(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(!ret)state.needDrain=true;if(state.writing)state.buffer.push(new WriteReq(chunk,encoding,cb));else doWrite(stream,state,len,chunk,encoding,cb);return ret}function doWrite(stream,state,len,chunk,encoding,cb){state.writelen=len;state.writecb=cb;state.writing=true;state.sync=true;stream._write(chunk,encoding,state.onwrite);state.sync=false}function onwriteError(stream,state,sync,er,cb){if(sync)process.nextTick(function(){cb(er)});else cb(er);stream._writableState.errorEmitted=true;stream.emit("error",er)}function onwriteStateUpdate(state){state.writing=false;state.writecb=null;state.length-=state.writelen;state.writelen=0}function onwrite(stream,er){var state=stream._writableState;var sync=state.sync;var cb=state.writecb;onwriteStateUpdate(state);if(er)onwriteError(stream,state,sync,er,cb);else{var finished=needFinish(stream,state);if(!finished&&!state.bufferProcessing&&state.buffer.length)clearBuffer(stream,state);if(sync){process.nextTick(function(){afterWrite(stream,state,finished,cb)})}else{afterWrite(stream,state,finished,cb)}}}function afterWrite(stream,state,finished,cb){if(!finished)onwriteDrain(stream,state);cb();if(finished)finishMaybe(stream,state)}function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit("drain")}}function clearBuffer(stream,state){state.bufferProcessing=true;for(var c=0;c<state.buffer.length;c++){var entry=state.buffer[c];var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,len,chunk,encoding,cb);if(state.writing){c++;break}}state.bufferProcessing=false;if(c<state.buffer.length)state.buffer=state.buffer.slice(c);else state.buffer.length=0}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("not implemented"))};Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;if(typeof chunk==="function"){cb=chunk;chunk=null;encoding=null}else if(typeof encoding==="function"){cb=encoding;encoding=null}if(typeof chunk!=="undefined"&&chunk!==null)this.write(chunk,encoding);if(!state.ending&&!state.finished)endWritable(this,state,cb)};function needFinish(stream,state){return state.ending&&state.length===0&&!state.finished&&!state.writing}function finishMaybe(stream,state){var need=needFinish(stream,state);if(need){state.finished=true;stream.emit("finish")}return need}function endWritable(stream,state,cb){state.ending=true;finishMaybe(stream,state);if(cb){if(state.finished)process.nextTick(cb);else stream.once("finish",cb)}state.ended=true}}).call(this,require("_process"))},{"./_stream_duplex":10,_process:8,buffer:1,"core-util-is":15,inherits:6,stream:20}],15:[function(require,module,exports){(function(Buffer){function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;function isBuffer(arg){return Buffer.isBuffer(arg)}exports.isBuffer=isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}).call(this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment