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

gear

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gear - npm Package Compare versions

Comparing version 0.8.18 to 0.9.0

8

build/gear.min.js

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

var requirejs,require,define;(function(global){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.5",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=!!(typeof window!=="undefined"&&navigator&&document),isWebWorker=!isBrowser&&typeof importScripts!=="undefined",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=false;function isFunction(it){return ostring.call(it)==="[object Function]"}function isArray(it){return ostring.call(it)==="[object Array]"}function each(ary,func){if(ary){var i;for(i=0;i<ary.length;i+=1){if(ary[i]&&func(ary[i],i,ary)){break}}}}function eachReverse(ary,func){if(ary){var i;for(i=ary.length-1;i>-1;i-=1){if(ary[i]&&func(ary[i],i,ary)){break}}}}function hasProp(obj,prop){return hasOwn.call(obj,prop)}function getOwn(obj,prop){return hasProp(obj,prop)&&obj[prop]}function eachProp(obj,func){var prop;for(prop in obj){if(hasProp(obj,prop)){if(func(obj[prop],prop)){break}}}}function mixin(target,source,force,deepStringMixin){if(source){eachProp(source,function(value,prop){if(force||!hasProp(target,prop)){if(deepStringMixin&&typeof value!=="string"){if(!target[prop]){target[prop]={}}mixin(target[prop],value,force,deepStringMixin)}else{target[prop]=value}}})}return target}function bind(obj,fn){return function(){return fn.apply(obj,arguments)}}function scripts(){return document.getElementsByTagName("script")}function getGlobal(value){if(!value){return value}var g=global;each(value.split("."),function(part){g=g[part]});return g}function makeError(id,msg,err,requireModules){var e=new Error(msg+"\nhttp://requirejs.org/docs/errors.html#"+id);e.requireType=id;e.requireModules=requireModules;if(err){e.originalError=err}return e}if(typeof define!=="undefined"){return}if(typeof requirejs!=="undefined"){if(isFunction(requirejs)){return}cfg=requirejs;requirejs=undefined}if(typeof require!=="undefined"&&!isFunction(require)){cfg=require;require=undefined}function newContext(contextName){var inCheckLoaded,Module,context,handlers,checkLoadedTimeoutId,config={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{},config:{}},registry={},enabledRegistry={},undefEvents={},defQueue=[],defined={},urlFetched={},requireCounter=1,unnormalizedCounter=1;function trimDots(ary){var i,part;for(i=0;ary[i];i+=1){part=ary[i];if(part==="."){ary.splice(i,1);i-=1}else if(part===".."){if(i===1&&(ary[2]===".."||ary[0]==="..")){break}else if(i>0){ary.splice(i-1,2);i-=2}}}}function normalize(name,baseName,applyMap){var pkgName,pkgConfig,mapValue,nameParts,i,j,nameSegment,foundMap,foundI,foundStarMap,starI,baseParts=baseName&&baseName.split("/"),normalizedBaseParts=baseParts,map=config.map,starMap=map&&map["*"];if(name&&name.charAt(0)==="."){if(baseName){if(getOwn(config.pkgs,baseName)){normalizedBaseParts=baseParts=[baseName]}else{normalizedBaseParts=baseParts.slice(0,baseParts.length-1)}name=normalizedBaseParts.concat(name.split("/"));trimDots(name);pkgConfig=getOwn(config.pkgs,pkgName=name[0]);name=name.join("/");if(pkgConfig&&name===pkgName+"/"+pkgConfig.main){name=pkgName}}else if(name.indexOf("./")===0){name=name.substring(2)}}if(applyMap&&map&&(baseParts||starMap)){nameParts=name.split("/");for(i=nameParts.length;i>0;i-=1){nameSegment=nameParts.slice(0,i).join("/");if(baseParts){for(j=baseParts.length;j>0;j-=1){mapValue=getOwn(map,baseParts.slice(0,j).join("/"));if(mapValue){mapValue=getOwn(mapValue,nameSegment);if(mapValue){foundMap=mapValue;foundI=i;break}}}}if(foundMap){break}if(!foundStarMap&&starMap&&getOwn(starMap,nameSegment)){foundStarMap=getOwn(starMap,nameSegment);starI=i}}if(!foundMap&&foundStarMap){foundMap=foundStarMap;foundI=starI}if(foundMap){nameParts.splice(0,foundI,foundMap);name=nameParts.join("/")}}return name}function removeScript(name){if(isBrowser){each(scripts(),function(scriptNode){if(scriptNode.getAttribute("data-requiremodule")===name&&scriptNode.getAttribute("data-requirecontext")===context.contextName){scriptNode.parentNode.removeChild(scriptNode);return true}})}}function hasPathFallback(id){var pathConfig=getOwn(config.paths,id);if(pathConfig&&isArray(pathConfig)&&pathConfig.length>1){removeScript(id);pathConfig.shift();context.require.undef(id);context.require([id]);return true}}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;if(index>-1){prefix=name.substring(0,index);name=name.substring(index+1,name.length)}return[prefix,name]}function makeModuleMap(name,parentModuleMap,isNormalized,applyMap){var url,pluginModule,suffix,nameParts,prefix=null,parentName=parentModuleMap?parentModuleMap.name:null,originalName=name,isDefine=true,normalizedName="";if(!name){isDefine=false;name="_@r"+(requireCounter+=1)}nameParts=splitPrefix(name);prefix=nameParts[0];name=nameParts[1];if(prefix){prefix=normalize(prefix,parentName,applyMap);pluginModule=getOwn(defined,prefix)}if(name){if(prefix){if(pluginModule&&pluginModule.normalize){normalizedName=pluginModule.normalize(name,function(name){return normalize(name,parentName,applyMap)})}else{normalizedName=normalize(name,parentName,applyMap)}}else{normalizedName=normalize(name,parentName,applyMap);nameParts=splitPrefix(normalizedName);prefix=nameParts[0];normalizedName=nameParts[1];isNormalized=true;url=context.nameToUrl(normalizedName)}}suffix=prefix&&!pluginModule&&!isNormalized?"_unnormalized"+(unnormalizedCounter+=1):"";return{prefix:prefix,name:normalizedName,parentMap:parentModuleMap,unnormalized:!!suffix,url:url,originalName:originalName,isDefine:isDefine,id:(prefix?prefix+"!"+normalizedName:normalizedName)+suffix}}function getModule(depMap){var id=depMap.id,mod=getOwn(registry,id);if(!mod){mod=registry[id]=new context.Module(depMap)}return mod}function on(depMap,name,fn){var id=depMap.id,mod=getOwn(registry,id);if(hasProp(defined,id)&&(!mod||mod.defineEmitComplete)){if(name==="defined"){fn(defined[id])}}else{getModule(depMap).on(name,fn)}}function onError(err,errback){var ids=err.requireModules,notified=false;if(errback){errback(err)}else{each(ids,function(id){var mod=getOwn(registry,id);if(mod){mod.error=err;if(mod.events.error){notified=true;mod.emit("error",err)}}});if(!notified){req.onError(err)}}}function takeGlobalQueue(){if(globalDefQueue.length){apsp.apply(defQueue,[defQueue.length-1,0].concat(globalDefQueue));globalDefQueue=[]}}handlers={require:function(mod){if(mod.require){return mod.require}else{return mod.require=context.makeRequire(mod.map)}},exports:function(mod){mod.usingExports=true;if(mod.map.isDefine){if(mod.exports){return mod.exports}else{return mod.exports=defined[mod.map.id]={}}}},module:function(mod){if(mod.module){return mod.module}else{return mod.module={id:mod.map.id,uri:mod.map.url,config:function(){return config.config&&getOwn(config.config,mod.map.id)||{}},exports:defined[mod.map.id]}}}};function cleanRegistry(id){delete registry[id];delete enabledRegistry[id]}function breakCycle(mod,traced,processed){var id=mod.map.id;if(mod.error){mod.emit("error",mod.error)}else{traced[id]=true;each(mod.depMaps,function(depMap,i){var depId=depMap.id,dep=getOwn(registry,depId);if(dep&&!mod.depMatched[i]&&!processed[depId]){if(getOwn(traced,depId)){mod.defineDep(i,defined[depId]);mod.check()}else{breakCycle(dep,traced,processed)}}});processed[id]=true}}function checkLoaded(){var map,modId,err,usingPathFallback,waitInterval=config.waitSeconds*1e3,expired=waitInterval&&context.startTime+waitInterval<(new Date).getTime(),noLoads=[],reqCalls=[],stillLoading=false,needCycleCheck=true;if(inCheckLoaded){return}inCheckLoaded=true;eachProp(enabledRegistry,function(mod){map=mod.map;modId=map.id;if(!mod.enabled){return}if(!map.isDefine){reqCalls.push(mod)}if(!mod.error){if(!mod.inited&&expired){if(hasPathFallback(modId)){usingPathFallback=true;stillLoading=true}else{noLoads.push(modId);removeScript(modId)}}else if(!mod.inited&&mod.fetched&&map.isDefine){stillLoading=true;if(!map.prefix){return needCycleCheck=false}}}});if(expired&&noLoads.length){err=makeError("timeout","Load timeout for modules: "+noLoads,null,noLoads);err.contextName=context.contextName;return onError(err)}if(needCycleCheck){each(reqCalls,function(mod){breakCycle(mod,{},{})})}if((!expired||usingPathFallback)&&stillLoading){if((isBrowser||isWebWorker)&&!checkLoadedTimeoutId){checkLoadedTimeoutId=setTimeout(function(){checkLoadedTimeoutId=0;checkLoaded()},50)}}inCheckLoaded=false}Module=function(map){this.events=getOwn(undefEvents,map.id)||{};this.map=map;this.shim=getOwn(config.shim,map.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Module.prototype={init:function(depMaps,factory,errback,options){options=options||{};if(this.inited){return}this.factory=factory;if(errback){this.on("error",errback)}else if(this.events.error){errback=bind(this,function(err){this.emit("error",err)})}this.depMaps=depMaps&&depMaps.slice(0);this.errback=errback;this.inited=true;this.ignore=options.ignore;if(options.enabled||this.enabled){this.enable()}else{this.check()}},defineDep:function(i,depExports){if(!this.depMatched[i]){this.depMatched[i]=true;this.depCount-=1;this.depExports[i]=depExports}},fetch:function(){if(this.fetched){return}this.fetched=true;context.startTime=(new Date).getTime();var map=this.map;if(this.shim){context.makeRequire(this.map,{enableBuildCallback:true})(this.shim.deps||[],bind(this,function(){return map.prefix?this.callPlugin():this.load()}))}else{return map.prefix?this.callPlugin():this.load()}},load:function(){var url=this.map.url;if(!urlFetched[url]){urlFetched[url]=true;context.load(this.map.id,url)}},check:function(){if(!this.enabled||this.enabling){return}var err,cjsModule,id=this.map.id,depExports=this.depExports,exports=this.exports,factory=this.factory;if(!this.inited){this.fetch()}else if(this.error){this.emit("error",this.error)}else if(!this.defining){this.defining=true;if(this.depCount<1&&!this.defined){if(isFunction(factory)){if(this.events.error){try{exports=context.execCb(id,factory,depExports,exports)}catch(e){err=e}}else{exports=context.execCb(id,factory,depExports,exports)}if(this.map.isDefine){cjsModule=this.module;if(cjsModule&&cjsModule.exports!==undefined&&cjsModule.exports!==this.exports){exports=cjsModule.exports}else if(exports===undefined&&this.usingExports){exports=this.exports}}if(err){err.requireMap=this.map;err.requireModules=[this.map.id];err.requireType="define";return onError(this.error=err)}}else{exports=factory}this.exports=exports;if(this.map.isDefine&&!this.ignore){defined[id]=exports;if(req.onResourceLoad){req.onResourceLoad(context,this.map,this.depMaps)}}cleanRegistry(id);this.defined=true}this.defining=false;if(this.defined&&!this.defineEmitted){this.defineEmitted=true;this.emit("defined",this.exports);this.defineEmitComplete=true}}},callPlugin:function(){var map=this.map,id=map.id,pluginMap=makeModuleMap(map.prefix);this.depMaps.push(pluginMap);on(pluginMap,"defined",bind(this,function(plugin){var load,normalizedMap,normalizedMod,name=this.map.name,parentName=this.map.parentMap?this.map.parentMap.name:null,localRequire=context.makeRequire(map.parentMap,{enableBuildCallback:true});if(this.map.unnormalized){if(plugin.normalize){name=plugin.normalize(name,function(name){return normalize(name,parentName,true)})||""}normalizedMap=makeModuleMap(map.prefix+"!"+name,this.map.parentMap);on(normalizedMap,"defined",bind(this,function(value){this.init([],function(){return value},null,{enabled:true,ignore:true})}));normalizedMod=getOwn(registry,normalizedMap.id);if(normalizedMod){this.depMaps.push(normalizedMap);if(this.events.error){normalizedMod.on("error",bind(this,function(err){this.emit("error",err)}))}normalizedMod.enable()}return}load=bind(this,function(value){this.init([],function(){return value},null,{enabled:true})});load.error=bind(this,function(err){this.inited=true;this.error=err;err.requireModules=[id];eachProp(registry,function(mod){if(mod.map.id.indexOf(id+"_unnormalized")===0){cleanRegistry(mod.map.id)}});onError(err)});load.fromText=bind(this,function(text,textAlt){var moduleName=map.name,moduleMap=makeModuleMap(moduleName),hasInteractive=useInteractive;if(textAlt){text=textAlt}if(hasInteractive){useInteractive=false}getModule(moduleMap);if(hasProp(config.config,id)){config.config[moduleName]=config.config[id]}try{req.exec(text)}catch(e){return onError(makeError("fromtexteval","fromText eval for "+id+" failed: "+e,e,[id]))}if(hasInteractive){useInteractive=true}this.depMaps.push(moduleMap);context.completeLoad(moduleName);localRequire([moduleName],load)});plugin.load(map.name,localRequire,load,config)}));context.enable(pluginMap,this);this.pluginMaps[pluginMap.id]=pluginMap},enable:function(){enabledRegistry[this.map.id]=this;this.enabled=true;this.enabling=true;each(this.depMaps,bind(this,function(depMap,i){var id,mod,handler;if(typeof depMap==="string"){depMap=makeModuleMap(depMap,this.map.isDefine?this.map:this.map.parentMap,false,!this.skipMap);this.depMaps[i]=depMap;handler=getOwn(handlers,depMap.id);if(handler){this.depExports[i]=handler(this);return}this.depCount+=1;on(depMap,"defined",bind(this,function(depExports){this.defineDep(i,depExports);this.check()}));if(this.errback){on(depMap,"error",this.errback)}}id=depMap.id;mod=registry[id];if(!hasProp(handlers,id)&&mod&&!mod.enabled){context.enable(depMap,this)}}));eachProp(this.pluginMaps,bind(this,function(pluginMap){var mod=getOwn(registry,pluginMap.id);if(mod&&!mod.enabled){context.enable(pluginMap,this)}}));this.enabling=false;this.check()},on:function(name,cb){var cbs=this.events[name];if(!cbs){cbs=this.events[name]=[]}cbs.push(cb)},emit:function(name,evt){each(this.events[name],function(cb){cb(evt)});if(name==="error"){delete this.events[name]}}};function callGetModule(args){if(!hasProp(defined,args[0])){getModule(makeModuleMap(args[0],null,true)).init(args[1],args[2])}}function removeListener(node,func,name,ieName){if(node.detachEvent&&!isOpera){if(ieName){node.detachEvent(ieName,func)}}else{node.removeEventListener(name,func,false)}}function getScriptData(evt){var node=evt.currentTarget||evt.srcElement;removeListener(node,context.onScriptLoad,"load","onreadystatechange");removeListener(node,context.onScriptError,"error");return{node:node,id:node&&node.getAttribute("data-requiremodule")}}function intakeDefines(){var args;takeGlobalQueue();while(defQueue.length){args=defQueue.shift();if(args[0]===null){return onError(makeError("mismatch","Mismatched anonymous define() module: "+args[args.length-1]))}else{callGetModule(args)}}}context={config:config,contextName:contextName,registry:registry,defined:defined,urlFetched:urlFetched,defQueue:defQueue,Module:Module,makeModuleMap:makeModuleMap,nextTick:req.nextTick,onError:onError,configure:function(cfg){if(cfg.baseUrl){if(cfg.baseUrl.charAt(cfg.baseUrl.length-1)!=="/"){cfg.baseUrl+="/"}}var pkgs=config.pkgs,shim=config.shim,objs={paths:true,config:true,map:true};eachProp(cfg,function(value,prop){if(objs[prop]){if(prop==="map"){if(!config.map){config.map={}}mixin(config[prop],value,true,true)}else{mixin(config[prop],value,true)}}else{config[prop]=value}});if(cfg.shim){eachProp(cfg.shim,function(value,id){if(isArray(value)){value={deps:value}}if((value.exports||value.init)&&!value.exportsFn){value.exportsFn=context.makeShimExports(value)}shim[id]=value});config.shim=shim}if(cfg.packages){each(cfg.packages,function(pkgObj){var location;pkgObj=typeof pkgObj==="string"?{name:pkgObj}:pkgObj;location=pkgObj.location;pkgs[pkgObj.name]={name:pkgObj.name,location:location||pkgObj.name,main:(pkgObj.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}});config.pkgs=pkgs}eachProp(registry,function(mod,id){if(!mod.inited&&!mod.map.unnormalized){mod.map=makeModuleMap(id)}});if(cfg.deps||cfg.callback){context.require(cfg.deps||[],cfg.callback)}},makeShimExports:function(value){function fn(){var ret;if(value.init){ret=value.init.apply(global,arguments)}return ret||value.exports&&getGlobal(value.exports)}return fn},makeRequire:function(relMap,options){options=options||{};function localRequire(deps,callback,errback){var id,map,requireMod;if(options.enableBuildCallback&&callback&&isFunction(callback)){callback.__requireJsBuild=true}if(typeof deps==="string"){if(isFunction(callback)){return onError(makeError("requireargs","Invalid require call"),errback)}if(relMap&&hasProp(handlers,deps)){return handlers[deps](registry[relMap.id])}if(req.get){return req.get(context,deps,relMap,localRequire)}map=makeModuleMap(deps,relMap,false,true);id=map.id;if(!hasProp(defined,id)){return onError(makeError("notloaded",'Module name "'+id+'" has not been loaded yet for context: '+contextName+(relMap?"":". Use require([])")))}return defined[id]}intakeDefines();context.nextTick(function(){intakeDefines();requireMod=getModule(makeModuleMap(null,relMap));requireMod.skipMap=options.skipMap;requireMod.init(deps,callback,errback,{enabled:true});checkLoaded()});return localRequire}mixin(localRequire,{isBrowser:isBrowser,toUrl:function(moduleNamePlusExt){var ext,index=moduleNamePlusExt.lastIndexOf("."),segment=moduleNamePlusExt.split("/")[0],isRelative=segment==="."||segment==="..";if(index!==-1&&(!isRelative||index>1)){ext=moduleNamePlusExt.substring(index,moduleNamePlusExt.length);moduleNamePlusExt=moduleNamePlusExt.substring(0,index)}return context.nameToUrl(normalize(moduleNamePlusExt,relMap&&relMap.id,true),ext,true)},defined:function(id){return hasProp(defined,makeModuleMap(id,relMap,false,true).id)},specified:function(id){id=makeModuleMap(id,relMap,false,true).id;return hasProp(defined,id)||hasProp(registry,id)}});if(!relMap){localRequire.undef=function(id){takeGlobalQueue();var map=makeModuleMap(id,relMap,true),mod=getOwn(registry,id);delete defined[id];delete urlFetched[map.url];delete undefEvents[id];if(mod){if(mod.events.defined){undefEvents[id]=mod.events}cleanRegistry(id)}}}return localRequire},enable:function(depMap){var mod=getOwn(registry,depMap.id);if(mod){getModule(depMap).enable()}},completeLoad:function(moduleName){var found,args,mod,shim=getOwn(config.shim,moduleName)||{},shExports=shim.exports;takeGlobalQueue();while(defQueue.length){args=defQueue.shift();if(args[0]===null){args[0]=moduleName;if(found){break}found=true}else if(args[0]===moduleName){found=true}callGetModule(args)}mod=getOwn(registry,moduleName);if(!found&&!hasProp(defined,moduleName)&&mod&&!mod.inited){if(config.enforceDefine&&(!shExports||!getGlobal(shExports))){if(hasPathFallback(moduleName)){return}else{return onError(makeError("nodefine","No define call for "+moduleName,null,[moduleName]))}}else{callGetModule([moduleName,shim.deps||[],shim.exportsFn])}}checkLoaded()},nameToUrl:function(moduleName,ext,skipExt){var paths,pkgs,pkg,pkgPath,syms,i,parentModule,url,parentPath;if(req.jsExtRegExp.test(moduleName)){url=moduleName+(ext||"")}else{paths=config.paths;pkgs=config.pkgs;syms=moduleName.split("/");for(i=syms.length;i>0;i-=1){parentModule=syms.slice(0,i).join("/");pkg=getOwn(pkgs,parentModule);parentPath=getOwn(paths,parentModule);if(parentPath){if(isArray(parentPath)){parentPath=parentPath[0]}syms.splice(0,i,parentPath);break}else if(pkg){if(moduleName===pkg.name){pkgPath=pkg.location+"/"+pkg.main}else{pkgPath=pkg.location}syms.splice(0,i,pkgPath);break}}url=syms.join("/");url+=ext||(/\?/.test(url)||skipExt?"":".js");url=(url.charAt(0)==="/"||url.match(/^[\w\+\.\-]+:/)?"":config.baseUrl)+url}return config.urlArgs?url+((url.indexOf("?")===-1?"?":"&")+config.urlArgs):url},load:function(id,url){req.load(context,id,url)},execCb:function(name,callback,args,exports){return callback.apply(exports,args)},onScriptLoad:function(evt){if(evt.type==="load"||readyRegExp.test((evt.currentTarget||evt.srcElement).readyState)){interactiveScript=null;var data=getScriptData(evt);context.completeLoad(data.id)}},onScriptError:function(evt){var data=getScriptData(evt);if(!hasPathFallback(data.id)){return onError(makeError("scripterror","Script error",evt,[data.id]))}}};context.require=context.makeRequire();return context}req=requirejs=function(deps,callback,errback,optional){var context,config,contextName=defContextName;if(!isArray(deps)&&typeof deps!=="string"){config=deps;if(isArray(callback)){deps=callback;callback=errback;errback=optional}else{deps=[]}}if(config&&config.context){contextName=config.context}context=getOwn(contexts,contextName);if(!context){context=contexts[contextName]=req.s.newContext(contextName)}if(config){context.configure(config)}return context.require(deps,callback,errback)};req.config=function(config){return req(config)};req.nextTick=typeof setTimeout!=="undefined"?function(fn){setTimeout(fn,4)}:function(fn){fn()};if(!require){require=req}req.version=version;req.jsExtRegExp=/^\/|:|\?|\.js$/;req.isBrowser=isBrowser;s=req.s={contexts:contexts,newContext:newContext};req({});each(["toUrl","undef","defined","specified"],function(prop){req[prop]=function(){var ctx=contexts[defContextName];return ctx.require[prop].apply(ctx,arguments)}});if(isBrowser){head=s.head=document.getElementsByTagName("head")[0];baseElement=document.getElementsByTagName("base")[0];if(baseElement){head=s.head=baseElement.parentNode}}req.onError=function(err){throw err};req.load=function(context,moduleName,url){var config=context&&context.config||{},node;if(isBrowser){node=config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");node.type=config.scriptType||"text/javascript";node.charset="utf-8";node.async=true;node.setAttribute("data-requirecontext",context.contextName);node.setAttribute("data-requiremodule",moduleName);if(node.attachEvent&&!(node.attachEvent.toString&&node.attachEvent.toString().indexOf("[native code")<0)&&!isOpera){useInteractive=true;node.attachEvent("onreadystatechange",context.onScriptLoad)}else{node.addEventListener("load",context.onScriptLoad,false);node.addEventListener("error",context.onScriptError,false)}node.src=url;currentlyAddingScript=node;if(baseElement){head.insertBefore(node,baseElement)}else{head.appendChild(node)}currentlyAddingScript=null;return node}else if(isWebWorker){try{importScripts(url);context.completeLoad(moduleName)}catch(e){context.onError(makeError("importscripts","importScripts failed for "+moduleName+" at "+url,e,[moduleName]))}}};function getInteractiveScript(){if(interactiveScript&&interactiveScript.readyState==="interactive"){return interactiveScript}eachReverse(scripts(),function(script){if(script.readyState==="interactive"){return interactiveScript=script}});return interactiveScript}if(isBrowser){eachReverse(scripts(),function(script){if(!head){head=script.parentNode}dataMain=script.getAttribute("data-main");if(dataMain){if(!cfg.baseUrl){src=dataMain.split("/");mainScript=src.pop();subPath=src.length?src.join("/")+"/":"./";cfg.baseUrl=subPath;dataMain=mainScript}dataMain=dataMain.replace(jsSuffixRegExp,"");cfg.deps=cfg.deps?cfg.deps.concat(dataMain):[dataMain];return true}})}define=function(name,deps,callback){var node,context;if(typeof name!=="string"){callback=deps;deps=name;name=null}if(!isArray(deps)){callback=deps;deps=[]}if(!deps.length&&isFunction(callback)){if(callback.length){callback.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(match,dep){deps.push(dep)});deps=(callback.length===1?["require"]:["require","exports","module"]).concat(deps)}}if(useInteractive){node=currentlyAddingScript||getInteractiveScript();if(node){if(!name){name=node.getAttribute("data-requiremodule")}context=contexts[node.getAttribute("data-requirecontext")]}}(context?context.defQueue:globalDefQueue).push([name,deps,callback])};define.amd={jQuery:true};req.exec=function(text){return eval(text)};req(cfg)})(this);(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 _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)}}else{async.nextTick=function(fn){setTimeout(fn,0)}}}else{async.nextTick=process.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(function(err){if(err){callback(err);callback=function(){}}else{completed+=1;if(completed>=arr.length){callback(null)}}}))})};async.forEach=async.each;async.eachSeries=function(arr,iterator,callback){callback=callback||function(){};if(!arr.length){return callback()}var completed=0;var iterate=function(){var sync=true;iterator(arr[completed],function(err){if(err){callback(err);callback=function(){}}else{completed+=1;if(completed>=arr.length){callback(null)}else{if(sync){async.nextTick(iterate)}else{iterate()}}}});sync=false};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){var results=[];arr=_map(arr,function(x,i){return{index:i,value:x}});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);if(!keys.length){return callback(null)}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(){_each(listeners.slice(0),function(fn){fn()})};addListener(function(){if(_keys(results).length===keys.length){callback(null,results);callback=function(){}}});_each(keys,function(k){var task=tasks[k]instanceof Function?[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.nextTick(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.waterfall=function(tasks,callback){callback=callback||function(){};if(tasks.constructor!==Array){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.nextTick(function(){iterator.apply(null,args)})}}};wrapIterator(async.iterator(tasks))()};var _parallel=function(eachfn,tasks,callback){callback=callback||function(){};if(tasks.constructor===Array){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(tasks.constructor===Array){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()){var sync=true;iterator(function(err){if(err){return callback(err)}if(sync){async.nextTick(function(){async.whilst(test,iterator,callback)})}else{async.whilst(test,iterator,callback)}});sync=false}else{callback()}};async.doWhilst=function(iterator,test,callback){var sync=true;iterator(function(err){if(err){return callback(err)}if(test()){if(sync){async.nextTick(function(){async.doWhilst(iterator,test,callback)})}else{async.doWhilst(iterator,test,callback)}}else{callback()}});sync=false};async.until=function(test,iterator,callback){if(!test()){var sync=true;iterator(function(err){if(err){return callback(err)}if(sync){async.nextTick(function(){async.until(test,iterator,callback)})}else{async.until(test,iterator,callback)}});sync=false}else{callback()}};async.doUntil=function(iterator,test,callback){var sync=true;iterator(function(err){if(err){return callback(err)}if(!test()){if(sync){async.nextTick(function(){async.doUntil(iterator,test,callback)})}else{async.doUntil(iterator,test,callback)}}else{callback()}});sync=false};async.queue=function(worker,concurrency){if(concurrency===undefined){concurrency=1}function _insert(q,data,pos,callback){if(data.constructor!==Array){data=[data]}_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===concurrency){q.saturated()}async.nextTick(q.process)})}var workers=0;var q={tasks:[],concurrency:concurrency,saturated:null,empty:null,drain:null,push:function(data,callback){_insert(q,data,false,callback)},unshift:function(data,callback){_insert(q,data,true,callback)},process:function(){if(workers<q.concurrency&&q.tasks.length){var task=q.tasks.shift();if(q.empty&&q.tasks.length===0){q.empty()}workers+=1;var sync=true;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(function(){var cbArgs=arguments;if(sync){async.nextTick(function(){next.apply(null,cbArgs)})}else{next.apply(null,arguments)}});worker(task.data,cb);sync=false}},length:function(){return q.tasks.length},running:function(){return workers}};return q};async.cargo=function(worker,payload){var working=false,tasks=[];var cargo={tasks:tasks,payload:payload,saturated:null,empty:null,drain:null,push:function(data,callback){if(data.constructor!==Array){data=[data]}_each(data,function(task){tasks.push({data:task,callback:typeof callback==="function"?callback:null});if(cargo.saturated&&tasks.length===payload){cargo.saturated()}});async.nextTick(cargo.process)},process:function process(){if(working)return;if(tasks.length===0){if(cargo.drain)cargo.drain();return}var ts=typeof payload==="number"?tasks.splice(0,payload):tasks.splice(0);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){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.compose=function(){var fns=Array.prototype.reverse.call(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.applyEach=function(fns){var go=function(){var that=this;var args=Array.prototype.slice.call(arguments);var callback=args.pop();return async.each(fns,function(fn,cb){fn.apply(that,args.concat([cb]))},callback)};if(arguments.length>1){var args=Array.prototype.slice.call(arguments,1);return go.apply(this,args)}else{return go}};if(typeof define!=="undefined"&&define.amd){define("async",function(){return async})}else if(typeof module!=="undefined"&&module.exports){module.exports=async}else{root.async=async}})();define("./blob",["require","exports"],function(require,exports){var Blob=exports.Blob=function Blob(parts,properties){parts=typeof parts==="undefined"?[]:Array.prototype.concat(parts);properties=properties||{};function mergeProps(object,props){Object.keys(props).forEach(function(prop){object[prop]=props[prop]})}var result=parts.length?parts.shift():"",props={},self=this;if(result instanceof Blob){mergeProps(props,result);result=result.result}parts.forEach(function(part){if(part instanceof Blob){mergeProps(props,part);result+=part.result}else{result+=part}});mergeProps(props,properties);Object.keys(props).forEach(function(prop){if(prop!=="result"){Object.defineProperty(self,prop,{enumerable:true,value:props[prop]})}});Object.defineProperty(this,"result",{value:result})};Blob.prototype.toString=function(){return this.result};var readFile={server:function(name,encoding,callback,sync){var fs=require("fs");if(sync){readFile.serverSync(name,encoding,callback)}else{fs.readFile(name,encoding==="bin"?undefined:encoding,function(err,data){if(err){callback(err)}else{callback(null,new Blob(data,{name:name}))}})}},serverSync:function(name,encoding,callback){var fs=require("fs"),data;try{data=fs.readFileSync(name,encoding==="bin"?undefined:encoding);callback(null,new Blob(data,{name:name}))}catch(e){callback(e)}},client:function(name,encoding,callback){if(name in localStorage){callback(null,new Blob(localStorage[name],{name:name}))}else{callback("localStorage has no item "+name)}}};Blob.readFile=Blob.prototype.readFile=typeof module==="undefined"?readFile.client:readFile.server;var writeFile={server:function(name,blob,encoding,callback){var fs=require("fs"),path=require("path"),nodeExists=fs.exists||path.exists,mkdirp=require("mkdirp").mkdirp,Crypto=require("crypto");function writeFile(filename,b){fs.writeFile(filename,b.result,encoding==="bin"?undefined:encoding,function(err){callback(err,new Blob(b,{name:filename}))})}var dirname=path.resolve(path.dirname(name)),checksum;if(name.indexOf("{checksum}")>-1){checksum=Crypto.createHash("md5");checksum.update(blob.result);name=name.replace("{checksum}",checksum.digest("hex"))}nodeExists(dirname,function(exists){if(!exists){mkdirp(dirname,"0755",function(err){if(err){callback(err)}else{writeFile(name,blob)}})}else{writeFile(name,blob)}})},client:function(name,blob,encoding,callback){localStorage[name]=blob.result;callback(null,new blob.constructor(blob,{name:name}))}};Blob.writeFile=Blob.prototype.writeFile=typeof module==="undefined"?writeFile.client:writeFile.server});define("./tasks/concat",["require","exports"],function(require,exports){exports.concat=function(options,prev,blob,done){options=options||{};done(null,new blob.constructor([prev,options.callback?options.callback(blob):blob]))}});define("./tasks/core",["require","exports","../blob"],function(require,exports){var Blob=require("../blob").Blob;function loadfn(){return function(string,done){done(null,new Blob(string))}}exports.append=exports.load=loadfn();var prepend=exports.prepend=loadfn();prepend.type="prepend";var test=exports.test=function(options,blob,done){options=options||{};done(options.callback?options.callback(blob):null)};test.type="each";var get=exports.get=function get(index,blobs,done){done(null,blobs.slice(index,index+1))};get.type="collect";var log=exports.log=function log(string,blobs,done){this._log(string);done(null,blobs)};log.type="collect";var inspect=exports.inspect=function inspect(options,blobs,done){var self=this;blobs.forEach(function(blob,index){var obj={result:blob.result};Object.keys(blob).forEach(function(attr){obj[attr]=blob[attr]});self._log("blob "+(index+1)+": "+JSON.stringify(obj,null," "))});done(null,blobs)};inspect.type="collect";exports.noop=function(dummy,blob,done){done(null,blob)}});define("./tasks/replace",["require","exports"],function(require,exports){exports.replace=function(items,blob,done){var output=blob.result;if(!Array.isArray(items)){items=[items]}items.forEach(function(params){var replace=params.replace||"",flags=params.flags!==undefined?params.flags:"mg",regex=typeof params.regex==="string"?new RegExp(params.regex,flags):params.regex;output=output.replace(regex,replace)});done(null,new blob.constructor(output,blob))}});define("./tasks/stamp",["require","exports"],function(require,exports){exports.stamp=function(options,blob,done){options=options||{};options.prefix=options.prefix||"";options.postfix=options.postfix||"";var result=options.callback?options.callback(blob):blob.result,stamped=options.prefix+result+options.postfix;done(null,new blob.constructor(stamped,blob))}});define("./tasks/read",["require","exports","../blob"],function(require,exports){var Blob=require("../blob").Blob;function readfn(){return function(options,done){options=typeof options==="string"?{name:options}:options;var encoding=options.encoding||"utf8";Blob.readFile(options.name,encoding,done,options.sync)}}exports.read=readfn();var readBefore=exports.readBefore=readfn();readBefore.type="prepend"});define("./tasks/write",["require","exports"],function(require,exports){var write=exports.write=function write(options,blob,done){options=typeof options==="string"?{name:options}:options;var encoding=options.encoding||"utf8";blob.writeFile(options.name,blob,encoding,done)};write.type="slice"});define("./tasks/tasks",["require","exports","async"],function(require,exports){var async=require("async");var tasks=exports.tasks=function tasks(workflow,blobs,done){var item,task,name,requires,fn,auto={},self=this;function runTask(name,options,requires){return function(callback,result){var new_blobs=requires.length?[]:blobs;result=result||[];requires.forEach(function(item){new_blobs=new_blobs.concat(result[item])});self._dispatch(name,options,new_blobs,callback)}}for(item in workflow){task=workflow[item].task;if(task===undefined){task=["noop"]}else{if(!Array.isArray(task)){task=[task]}}requires=workflow[item].requires;if(requires===undefined){requires=[]}else{if(!Array.isArray(requires)){requires=[requires]}}fn=runTask(task[0],task[1],requires);auto[item]=requires?requires.concat(fn):fn}async.auto(auto,function(err,results){if(err){done(err);return}done(err,results&&results.join?results.join:[])})};tasks.type="collect"});define("./registry",["require","exports","./tasks/concat","./default_tasks"],function(require,exports){if(typeof module!=="undefined"){var fs=require("fs"),path=require("path"),existsSync=fs.existsSync||path.existsSync}else{var default_tasks=require("./default_tasks")}var Registry=exports.Registry=function Registry(options){var self=this;this._tasks={};if(typeof __dirname!=="undefined"){this.load({dirname:__dirname+"/tasks"})}else if(typeof default_tasks!=="undefined"){this.load({tasks:default_tasks})}if(options){this.load(options)}Object.defineProperty(this,"tasks",{get:function(){return Object.keys(self._tasks)}})};Registry.prototype={load:function(options){options=options||{};var module=options.module,dirname=options.dirname,filename=options.filename,tasks=options.tasks;if(module){if(!this._loadModule(module)){throw new Error("Module "+module+" doesn't exist")}}if(dirname){if(!this._loadDir(dirname)){throw new Error("Directory "+dirname+" doesn't exist")}}if(filename){if(!this._loadFile(filename)){throw new Error("File "+filename+" doesn't exist")}}if(tasks){if(!this._loadTasks(tasks)){throw new Error("Failed to load tasks")}}return this},_loadModule:function(name){if(require){try{return this._loadTasks(require(name))}catch(err){}}return this._loadDir(path.resolve("node_modules",name,"lib"))},_loadDir:function(dirname){if(!existsSync(dirname)){return false}var fs=require("fs"),files=fs.readdirSync(dirname),self=this;files.forEach(function(filename){var name=path.join(dirname,filename);if(path.extname(name)!==".js"){return}self._loadFile(name)});return true},_loadFile:function(filename){if(!existsSync(filename)){return false}return this._loadTasks(require(filename))},_loadTasks:function(tasks){var name;for(name in tasks){this._tasks[name]=tasks[name]}return true},task:function(name){if(!(name in this._tasks)){throw new Error("Task "+name+" doesn't exist")}return this._tasks[name]}}});define("./queue",["require","exports","async","./registry","./blob"],function(require,exports){var async=require("async"),Registry=require("./registry").Registry,Blob=require("./blob").Blob;function zip(arr1,arr2){var zipped=[];for(var i=0;i<Math.min(arr1.length,arr2.length);i++){zipped.push([arr1[i],arr2[i]])}return zipped}function arrayize(arr){return typeof arr==="undefined"?[]:Array.prototype.concat(arr)}var Queue=exports.Queue=function Queue(options){var self=this;options=options||{};this._logger=options.logger||console;if(typeof options.registry==="string"){this._registry=new Registry({module:options.registry})}else{this._registry=options.registry||new Registry}this._clear();this._registry.tasks.forEach(function(name){self[name]=self.task.bind(self,name)})};Queue.prototype._clear=function(){this._queue=[function(callback){callback(null,[])}]};Queue.prototype._log=function(message){this._logger.log(message)};Queue.prototype._dispatch=function(name,options,blobs,done){var task=this._registry.task(name),types={2:"append",3:"map",4:"reduce"},type=task.type?task.type:types[task.length];function doneWrap(err,res){if(err){err={task:name,error:err}}done(err,res)}switch(type){case"append":async.map(arrayize(options),task.bind(this),function(err,results){doneWrap(err,blobs.concat(results))});break;case"prepend":async.map(arrayize(options),task.bind(this),function(err,results){doneWrap(err,results.concat(blobs))});break;case"collect":task.call(this,options,blobs,doneWrap);break;case"slice":async.map(zip(arrayize(options),blobs),function(arr,cb){task.call(this,arr[0],arr[1],cb)}.bind(this),doneWrap);break;case"each":async.forEach(blobs,task.bind(this,options),function(err){doneWrap(err,blobs)});break;case"map":async.map(blobs,task.bind(this,options),doneWrap);break;case"syncmap":async.mapSeries(blobs,task.bind(this,options),doneWrap);break;case"reduce":async.reduce(blobs,new Blob,task.bind(this,options),function(err,results){doneWrap(err,[results])});break;default:throw new Error('Task "'+name+'" has unknown type. Add a type property to the task function.')}};Queue.prototype.task=function(name,options){this._queue.push(this._dispatch.bind(this,name,options));return this};Queue.prototype.run=function(callback){var self=this;async.waterfall(this._queue,callback||function(err,res){if(err){self._log(err)}})}});define("../blob",["require","exports","blob"],function(require,exports,blob){exports.Blob=blob.Blob});define("./default_tasks",["require","exports","./tasks/concat","./tasks/core","./tasks/replace","./tasks/stamp","./tasks/read","./tasks/write","./tasks/tasks"],function(require,exports){var tasks=[];tasks.push(require("./tasks/concat"));tasks.push(require("./tasks/core"));tasks.push(require("./tasks/replace"));tasks.push(require("./tasks/stamp"));tasks.push(require("./tasks/read"));tasks.push(require("./tasks/write"));tasks.push(require("./tasks/tasks"));tasks.forEach(function(mod){for(var task in mod){exports[task]=mod[task]}})});define("gear",["require","exports","blob","registry","queue"],function(require,exports,blob,registry,queue){exports.Blob=blob.Blob;exports.Registry=registry.Registry;exports.Queue=queue.Queue});
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.1.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
var requirejs,require,define;!function(global){function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var n;for(n=0;n<e.length&&(!e[n]||!t(e[n],n,e));n+=1);}}function eachReverse(e,t){if(e){var n;for(n=e.length-1;n>-1&&(!e[n]||!t(e[n],n,e));n-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var n;for(n in e)if(hasProp(e,n)&&t(e[n],n))break}function mixin(e,t,n,r){return t&&eachProp(t,function(t,i){(n||!hasProp(e,i))&&(r&&"string"!=typeof t?(e[i]||(e[i]={}),mixin(e[i],t,n,r)):e[i]=t)}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,n,r){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=r,n&&(i.originalError=n),i}function newContext(e){function t(e){var t,n;for(t=0;e[t];t+=1)if(n=e[t],"."===n)e.splice(t,1),t-=1;else if(".."===n){if(1===t&&(".."===e[2]||".."===e[0]))break;t>0&&(e.splice(t-1,2),t-=2)}}function n(e,n,r){var i,o,a,u,c,s,l,f,p,d,h,m=n&&n.split("/"),g=m,v=q.map,y=v&&v["*"];if(e&&"."===e.charAt(0)&&(n?(g=getOwn(q.pkgs,n)?m=[n]:m.slice(0,m.length-1),e=g.concat(e.split("/")),t(e),o=getOwn(q.pkgs,i=e[0]),e=e.join("/"),o&&e===i+"/"+o.main&&(e=i)):0===e.indexOf("./")&&(e=e.substring(2))),r&&v&&(m||y)){for(u=e.split("/"),c=u.length;c>0;c-=1){if(l=u.slice(0,c).join("/"),m)for(s=m.length;s>0;s-=1)if(a=getOwn(v,m.slice(0,s).join("/")),a&&(a=getOwn(a,l))){f=a,p=c;break}if(f)break;!d&&y&&getOwn(y,l)&&(d=getOwn(y,l),h=c)}!f&&d&&(f=d,p=h),f&&(u.splice(0,p,f),e=u.join("/"))}return e}function r(e){isBrowser&&each(scripts(),function(t){return t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===x.contextName?(t.parentNode.removeChild(t),!0):void 0})}function i(e){var t=getOwn(q.paths,e);return t&&isArray(t)&&t.length>1?(r(e),t.shift(),x.require.undef(e),x.require([e]),!0):void 0}function o(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function a(e,t,r,i){var a,u,c,s,l=null,f=t?t.name:null,p=e,d=!0,h="";return e||(d=!1,e="_@r"+(j+=1)),s=o(e),l=s[0],e=s[1],l&&(l=n(l,f,i),u=getOwn(M,l)),e&&(l?h=u&&u.normalize?u.normalize(e,function(e){return n(e,f,i)}):n(e,f,i):(h=n(e,f,i),s=o(h),l=s[0],h=s[1],r=!0,a=x.nameToUrl(h))),c=!l||u||r?"":"_unnormalized"+(T+=1),{prefix:l,name:h,parentMap:t,unnormalized:!!c,url:a,originalName:p,isDefine:d,id:(l?l+"!"+h:h)+c}}function u(e){var t=e.id,n=getOwn(E,t);return n||(n=E[t]=new x.Module(e)),n}function c(e,t,n){var r=e.id,i=getOwn(E,r);!hasProp(M,r)||i&&!i.defineEmitComplete?u(e).on(t,n):"defined"===t&&n(M[r])}function s(e,t){var n=e.requireModules,r=!1;t?t(e):(each(n,function(t){var n=getOwn(E,t);n&&(n.error=e,n.events.error&&(r=!0,n.emit("error",e)))}),r||req.onError(e))}function l(){globalDefQueue.length&&(apsp.apply(O,[O.length-1,0].concat(globalDefQueue)),globalDefQueue=[])}function f(e){delete E[e],delete S[e]}function p(e,t,n){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,i){var o=r.id,a=getOwn(E,o);!a||e.depMatched[i]||n[o]||(getOwn(t,o)?(e.defineDep(i,M[o]),e.check()):p(a,t,n))}),n[r]=!0)}function d(){var e,t,n,o,a=1e3*q.waitSeconds,u=a&&x.startTime+a<(new Date).getTime(),c=[],l=[],f=!1,h=!0;if(!y){if(y=!0,eachProp(S,function(n){if(e=n.map,t=e.id,n.enabled&&(e.isDefine||l.push(n),!n.error))if(!n.inited&&u)i(t)?(o=!0,f=!0):(c.push(t),r(t));else if(!n.inited&&n.fetched&&e.isDefine&&(f=!0,!e.prefix))return h=!1}),u&&c.length)return n=makeError("timeout","Load timeout for modules: "+c,null,c),n.contextName=x.contextName,s(n);h&&each(l,function(e){p(e,{},{})}),u&&!o||!f||!isBrowser&&!isWebWorker||w||(w=setTimeout(function(){w=0,d()},50)),y=!1}}function h(e){hasProp(M,e[0])||u(a(e[0],null,!0)).init(e[1],e[2])}function m(e,t,n,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(n,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,x.onScriptLoad,"load","onreadystatechange"),m(t,x.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(l();O.length;){if(e=O.shift(),null===e[0])return s(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}}var y,b,x,k,w,q={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{},config:{}},E={},S={},A={},O=[],M={},_={},j=1,T=1;return k={require:function(e){return e.require?e.require:e.require=x.makeRequire(e.map)},exports:function(e){return e.usingExports=!0,e.map.isDefine?e.exports?e.exports:e.exports=M[e.map.id]={}:void 0},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return q.config&&getOwn(q.config,e.map.id)||{}},exports:M[e.map.id]}}},b=function(e){this.events=getOwn(A,e.id)||{},this.map=e,this.shim=getOwn(q.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,n,r){r=r||{},this.inited||(this.factory=t,n?this.on("error",n):this.events.error&&(n=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,x.startTime=(new Date).getTime();var e=this.map;return this.shim?void x.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()})):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;_[e]||(_[e]=!0,x.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,n=this.map.id,r=this.depExports,i=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error)try{i=x.execCb(n,o,r,i)}catch(a){e=a}else i=x.execCb(n,o,r,i);if(this.map.isDefine&&(t=this.module,t&&void 0!==t.exports&&t.exports!==this.exports?i=t.exports:void 0===i&&this.usingExports&&(i=this.exports)),e)return e.requireMap=this.map,e.requireModules=[this.map.id],e.requireType="define",s(this.error=e)}else i=o;this.exports=i,this.map.isDefine&&!this.ignore&&(M[n]=i,req.onResourceLoad&&req.onResourceLoad(x,this.map,this.depMaps)),f(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),c(r,"defined",bind(this,function(r){var i,o,l,p=this.map.name,d=this.map.parentMap?this.map.parentMap.name:null,h=x.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(p=r.normalize(p,function(e){return n(e,d,!0)})||""),o=a(e.prefix+"!"+p,this.map.parentMap),c(o,"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),l=getOwn(E,o.id),void(l&&(this.depMaps.push(o),this.events.error&&l.on("error",bind(this,function(e){this.emit("error",e)})),l.enable()))):(i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),i.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(E,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&f(e.map.id)}),s(e)}),i.fromText=bind(this,function(n,r){var o=e.name,c=a(o),l=useInteractive;r&&(n=r),l&&(useInteractive=!1),u(c),hasProp(q.config,t)&&(q.config[o]=q.config[t]);try{req.exec(n)}catch(f){return s(makeError("fromtexteval","fromText eval for "+t+" failed: "+f,f,[t]))}l&&(useInteractive=!0),this.depMaps.push(c),x.completeLoad(o),h([o],i)}),void r.load(e.name,h,i,q))})),x.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){S[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var n,r,i;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,i=getOwn(k,e.id))return void(this.depExports[t]=i(this));this.depCount+=1,c(e,"defined",bind(this,function(e){this.defineDep(t,e),this.check()})),this.errback&&c(e,"error",this.errback)}n=e.id,r=E[n],hasProp(k,n)||!r||r.enabled||x.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(E,e.id);t&&!t.enabled&&x.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var n=this.events[e];n||(n=this.events[e]=[]),n.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},x={config:q,contextName:e,registry:E,defined:M,urlFetched:_,defQueue:O,Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:s,configure:function(e){e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/");var t=q.pkgs,n=q.shim,r={paths:!0,config:!0,map:!0};eachProp(e,function(e,t){r[t]?"map"===t?(q.map||(q.map={}),mixin(q[t],e,!0,!0)):mixin(q[t],e,!0):q[t]=e}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=x.makeShimExports(e)),n[t]=e}),q.shim=n),e.packages&&(each(e.packages,function(e){var n;e="string"==typeof e?{name:e}:e,n=e.location,t[e.name]={name:e.name,location:n||e.name,main:(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}}),q.pkgs=t),eachProp(E,function(e,t){e.inited||e.map.unnormalized||(e.map=a(t))}),(e.deps||e.callback)&&x.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,r){function i(n,o,c){var l,f,p;return r.enableBuildCallback&&o&&isFunction(o)&&(o.__requireJsBuild=!0),"string"==typeof n?isFunction(o)?s(makeError("requireargs","Invalid require call"),c):t&&hasProp(k,n)?k[n](E[t.id]):req.get?req.get(x,n,t,i):(f=a(n,t,!1,!0),l=f.id,hasProp(M,l)?M[l]:s(makeError("notloaded",'Module name "'+l+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),x.nextTick(function(){v(),p=u(a(null,t)),p.skipMap=r.skipMap,p.init(n,o,c,{enabled:!0}),d()}),i)}return r=r||{},mixin(i,{isBrowser:isBrowser,toUrl:function(e){var r,i=e.lastIndexOf("."),o=e.split("/")[0],a="."===o||".."===o;return-1!==i&&(!a||i>1)&&(r=e.substring(i,e.length),e=e.substring(0,i)),x.nameToUrl(n(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(M,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(M,e)||hasProp(E,e)}}),t||(i.undef=function(e){l();var n=a(e,t,!0),r=getOwn(E,e);delete M[e],delete _[n.url],delete A[e],r&&(r.events.defined&&(A[e]=r.events),f(e))}),i},enable:function(e){var t=getOwn(E,e.id);t&&u(e).enable()},completeLoad:function(e){var t,n,r,o=getOwn(q.shim,e)||{},a=o.exports;for(l();O.length;){if(n=O.shift(),null===n[0]){if(n[0]=e,t)break;t=!0}else n[0]===e&&(t=!0);h(n)}if(r=getOwn(E,e),!t&&!hasProp(M,e)&&r&&!r.inited){if(!(!q.enforceDefine||a&&getGlobal(a)))return i(e)?void 0:s(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}d()},nameToUrl:function(e,t,n){var r,i,o,a,u,c,s,l,f;if(req.jsExtRegExp.test(e))l=e+(t||"");else{for(r=q.paths,i=q.pkgs,u=e.split("/"),c=u.length;c>0;c-=1){if(s=u.slice(0,c).join("/"),o=getOwn(i,s),f=getOwn(r,s)){isArray(f)&&(f=f[0]),u.splice(0,c,f);break}if(o){a=e===o.name?o.location+"/"+o.main:o.location,u.splice(0,c,a);break}}l=u.join("/"),l+=t||(/\?/.test(l)||n?"":".js"),l=("/"===l.charAt(0)||l.match(/^[\w\+\.\-]+:/)?"":q.baseUrl)+l}return q.urlArgs?l+((-1===l.indexOf("?")?"?":"&")+q.urlArgs):l},load:function(e,t){req.load(x,e,t)},execCb:function(e,t,n,r){return t.apply(r,n)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);x.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);return i(t.id)?void 0:s(makeError("scripterror","Script error",e,[t.id]))}},x.require=x.makeRequire(),x}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(e){return"interactive"===e.readyState?interactiveScript=e:void 0}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.5",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=!("undefined"==typeof window||!navigator||!document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,n,r){var i,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=n,n=r):e=[]),o&&o.context&&(a=o.context),i=getOwn(contexts,a),i||(i=contexts[a]=req.s.newContext(a)),o&&i.configure(o),i.require(e,t,n)},req.config=function(e){return req(e)},req.nextTick="undefined"!=typeof setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=function(e){throw e},req.load=function(e,t,n){var r,i=e&&e.config||{};if(isBrowser)return r=i.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),r.type=i.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r.setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=n,currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{importScripts(n),e.completeLoad(t)}catch(o){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+n,o,[t]))}},isBrowser&&eachReverse(scripts(),function(e){return head||(head=e.parentNode),dataMain=e.getAttribute("data-main"),dataMain?(cfg.baseUrl||(src=dataMain.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath,dataMain=mainScript),dataMain=dataMain.replace(jsSuffixRegExp,""),cfg.deps=cfg.deps?cfg.deps.concat(dataMain):[dataMain],!0):void 0}),define=function(e,t,n){var r,i;"string"!=typeof e&&(n=t,t=e,e=null),isArray(t)||(n=t,t=[]),!t.length&&isFunction(n)&&n.length&&(n.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,n){t.push(n)}),t=(1===n.length?["require"]:["require","exports","module"]).concat(t)),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),i=contexts[r.getAttribute("data-requirecontext")])),(i?i.defQueue:globalDefQueue).push([e,t,n])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this),function(){function e(e){var n=!1;return function(){if(n)throw new Error("Callback was already called.");n=!0,e.apply(t,arguments)}}var t,n,r={};t=this,null!=t&&(n=t.async),r.noConflict=function(){return t.async=n,r};var i=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n+=1)t(e[n],n,e)},o=function(e,t){if(e.map)return e.map(t);var n=[];return i(e,function(e,r,i){n.push(t(e,r,i))}),n},a=function(e,t,n){return e.reduce?e.reduce(t,n):(i(e,function(e,r,i){n=t(n,e,r,i)}),n)},u=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};r.nextTick="undefined"!=typeof process&&process.nextTick?process.nextTick:"function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){setTimeout(e,0)},r.each=function(t,n,r){if(r=r||function(){},!t.length)return r();var o=0;i(t,function(i){n(i,e(function(e){e?(r(e),r=function(){}):(o+=1,o>=t.length&&r(null))}))})},r.forEach=r.each,r.eachSeries=function(e,t,n){if(n=n||function(){},!e.length)return n();var i=0,o=function(){var a=!0;t(e[i],function(t){t?(n(t),n=function(){}):(i+=1,i>=e.length?n(null):a?r.nextTick(o):o())}),a=!1};o()},r.forEachSeries=r.eachSeries,r.eachLimit=function(e,t,n,r){var i=c(t);i.apply(null,[e,n,r])},r.forEachLimit=r.eachLimit;var c=function(e){return function(t,n,r){if(r=r||function(){},!t.length||0>=e)return r();var i=0,o=0,a=0;!function u(){if(i>=t.length)return r();for(;e>a&&o<t.length;)o+=1,a+=1,n(t[o-1],function(e){e?(r(e),r=function(){}):(i+=1,a-=1,i>=t.length?r():u())})}()}},s=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[r.each].concat(t))}},l=function(e,t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[c(e)].concat(n))}},f=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[r.eachSeries].concat(t))}},p=function(e,t,n,r){var i=[];t=o(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){n(e.value,function(n,r){i[e.index]=r,t(n)})},function(e){r(e,i)})};r.map=s(p),r.mapSeries=f(p),r.mapLimit=function(e,t,n,r){return d(t)(e,n,r)};var d=function(e){return l(e,p)};r.reduce=function(e,t,n,i){r.eachSeries(e,function(e,r){n(t,e,function(e,n){t=n,r(e)})},function(e){i(e,t)})},r.inject=r.reduce,r.foldl=r.reduce,r.reduceRight=function(e,t,n,i){var a=o(e,function(e){return e}).reverse();r.reduce(a,t,n,i)},r.foldr=r.reduceRight;var h=function(e,t,n,r){var i=[];t=o(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){n(e.value,function(n){n&&i.push(e),t()})},function(){r(o(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};r.filter=s(h),r.filterSeries=f(h),r.select=r.filter,r.selectSeries=r.filterSeries;var m=function(e,t,n,r){var i=[];t=o(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){n(e.value,function(n){n||i.push(e),t()})},function(){r(o(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};r.reject=s(m),r.rejectSeries=f(m);var g=function(e,t,n,r){e(t,function(e,t){n(e,function(n){n?(r(e),r=function(){}):t()})},function(){r()})};r.detect=s(g),r.detectSeries=f(g),r.some=function(e,t,n){r.each(e,function(e,r){t(e,function(e){e&&(n(!0),n=function(){}),r()})},function(){n(!1)})},r.any=r.some,r.every=function(e,t,n){r.each(e,function(e,r){t(e,function(e){e||(n(!1),n=function(){}),r()})},function(){n(!0)})},r.all=r.every,r.sortBy=function(e,t,n){r.map(e,function(e,n){t(e,function(t,r){t?n(t):n(null,{value:e,criteria:r})})},function(e,t){if(e)return n(e);var r=function(e,t){var n=e.criteria,r=t.criteria;return r>n?-1:n>r?1:0};n(null,o(t.sort(r),function(e){return e.value}))})},r.auto=function(e,t){t=t||function(){};var n=u(e);if(!n.length)return t(null);var o={},c=[],s=function(e){c.unshift(e)},l=function(e){for(var t=0;t<c.length;t+=1)if(c[t]===e)return void c.splice(t,1)},f=function(){i(c.slice(0),function(e){e()})};s(function(){u(o).length===n.length&&(t(null,o),t=function(){})}),i(n,function(n){var c=e[n]instanceof Function?[e[n]]:e[n],p=function(e){var a=Array.prototype.slice.call(arguments,1);if(a.length<=1&&(a=a[0]),e){var c={};i(u(o),function(e){c[e]=o[e]}),c[n]=a,t(e,c),t=function(){}}else o[n]=a,r.nextTick(f)},d=c.slice(0,Math.abs(c.length-1))||[],h=function(){return a(d,function(e,t){return e&&o.hasOwnProperty(t)},!0)&&!o.hasOwnProperty(n)};if(h())c[c.length-1](p,o);else{var m=function(){h()&&(l(m),c[c.length-1](p,o))};s(m)}})},r.waterfall=function(e,t){if(t=t||function(){},e.constructor!==Array){var n=new Error("First argument to waterfall must be an array of functions");return t(n)}if(!e.length)return t();var i=function(e){return function(n){if(n)t.apply(null,arguments),t=function(){};else{var o=Array.prototype.slice.call(arguments,1),a=e.next();o.push(a?i(a):t),r.nextTick(function(){e.apply(null,o)})}}};i(r.iterator(e))()};var v=function(e,t,n){if(n=n||function(){},t.constructor===Array)e.map(t,function(e,t){e&&e(function(e){var n=Array.prototype.slice.call(arguments,1);n.length<=1&&(n=n[0]),t.call(null,e,n)})},n);else{var r={};e.each(u(t),function(e,n){t[e](function(t){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),r[e]=i,n(t)})},function(e){n(e,r)})}};r.parallel=function(e,t){v({map:r.map,each:r.each},e,t)},r.parallelLimit=function(e,t,n){v({map:d(t),each:c(t)},e,n)},r.series=function(e,t){if(t=t||function(){},e.constructor===Array)r.mapSeries(e,function(e,t){e&&e(function(e){var n=Array.prototype.slice.call(arguments,1);n.length<=1&&(n=n[0]),t.call(null,e,n)})},t);else{var n={};r.eachSeries(u(e),function(t,r){e[t](function(e){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),n[t]=i,r(e)})},function(e){t(e,n)})}},r.iterator=function(e){var t=function(n){var r=function(){return e.length&&e[n].apply(null,arguments),r.next()};return r.next=function(){return n<e.length-1?t(n+1):null},r};return t(0)},r.apply=function(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t.concat(Array.prototype.slice.call(arguments)))}};var y=function(e,t,n,r){var i=[];e(t,function(e,t){n(e,function(e,n){i=i.concat(n||[]),t(e)})},function(e){r(e,i)})};r.concat=s(y),r.concatSeries=f(y),r.whilst=function(e,t,n){if(e()){var i=!0;t(function(o){return o?n(o):void(i?r.nextTick(function(){r.whilst(e,t,n)}):r.whilst(e,t,n))}),i=!1}else n()},r.doWhilst=function(e,t,n){var i=!0;e(function(o){return o?n(o):void(t()?i?r.nextTick(function(){r.doWhilst(e,t,n)}):r.doWhilst(e,t,n):n())}),i=!1},r.until=function(e,t,n){if(e())n();else{var i=!0;t(function(o){return o?n(o):void(i?r.nextTick(function(){r.until(e,t,n)}):r.until(e,t,n))}),i=!1}},r.doUntil=function(e,t,n){var i=!0;e(function(o){return o?n(o):void(t()?n():i?r.nextTick(function(){r.doUntil(e,t,n)}):r.doUntil(e,t,n))}),i=!1},r.queue=function(t,n){function o(e,t,o,a){t.constructor!==Array&&(t=[t]),i(t,function(t){var i={data:t,callback:"function"==typeof a?a:null};o?e.tasks.unshift(i):e.tasks.push(i),e.saturated&&e.tasks.length===n&&e.saturated(),r.nextTick(e.process)})}void 0===n&&(n=1);var a=0,u={tasks:[],concurrency:n,saturated:null,empty:null,drain:null,push:function(e,t){o(u,e,!1,t)},unshift:function(e,t){o(u,e,!0,t)},process:function(){if(a<u.concurrency&&u.tasks.length){var n=u.tasks.shift();u.empty&&0===u.tasks.length&&u.empty(),a+=1;var i=!0,o=function(){a-=1,n.callback&&n.callback.apply(n,arguments),u.drain&&u.tasks.length+a===0&&u.drain(),u.process()},c=e(function(){var e=arguments;i?r.nextTick(function(){o.apply(null,e)}):o.apply(null,arguments)});t(n.data,c),i=!1}},length:function(){return u.tasks.length},running:function(){return a}};return u},r.cargo=function(e,t){var n=!1,a=[],u={tasks:a,payload:t,saturated:null,empty:null,drain:null,push:function(e,n){e.constructor!==Array&&(e=[e]),i(e,function(e){a.push({data:e,callback:"function"==typeof n?n:null}),u.saturated&&a.length===t&&u.saturated()}),r.nextTick(u.process)},process:function c(){if(!n){if(0===a.length)return void(u.drain&&u.drain());var r="number"==typeof t?a.splice(0,t):a.splice(0),s=o(r,function(e){return e.data});u.empty&&u.empty(),n=!0,e(s,function(){n=!1;var e=arguments;i(r,function(t){t.callback&&t.callback.apply(null,e)}),c()})}},length:function(){return a.length},running:function(){return n}};return u};var b=function(e){return function(t){var n=Array.prototype.slice.call(arguments,1);t.apply(null,n.concat([function(t){var n=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(t?console.error&&console.error(t):console[e]&&i(n,function(t){console[e](t)}))}]))}};r.log=b("log"),r.dir=b("dir"),r.memoize=function(e,t){var n={},r={};t=t||function(e){return e};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=t.apply(null,i);a in n?o.apply(null,n[a]):a in r?r[a].push(o):(r[a]=[o],e.apply(null,i.concat([function(){n[a]=arguments;var e=r[a];delete r[a];for(var t=0,i=e.length;i>t;t++)e[t].apply(null,arguments)}])))};return i.memo=n,i.unmemoized=e,i},r.unmemoize=function(e){return function(){return(e.unmemoized||e).apply(null,arguments)}},r.times=function(e,t,n){for(var i=[],o=0;e>o;o++)i.push(o);return r.map(i,t,n)},r.timesSeries=function(e,t,n){for(var i=[],o=0;e>o;o++)i.push(o);return r.mapSeries(i,t,n)},r.compose=function(){var e=Array.prototype.reverse.call(arguments);return function(){var t=this,n=Array.prototype.slice.call(arguments),i=n.pop();r.reduce(e,n,function(e,n,r){n.apply(t,e.concat([function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);r(e,t)}]))},function(e,n){i.apply(t,[e].concat(n))})}},r.applyEach=function(e){var t=function(){var t=this,n=Array.prototype.slice.call(arguments),i=n.pop();return r.each(e,function(e,r){e.apply(t,n.concat([r]))},i)};if(arguments.length>1){var n=Array.prototype.slice.call(arguments,1);return t.apply(this,n)}return t},"undefined"!=typeof define&&define.amd?define("async",function(){return r}):"undefined"!=typeof module&&module.exports?module.exports=r:t.async=r}(),define("./blob",["require","exports"],function(e,t){var n=t.Blob=function o(e,t){function n(e,t){Object.keys(t).forEach(function(n){e[n]=t[n]})}e="undefined"==typeof e?[]:Array.prototype.concat(e),t=t||{};var r=e.length?e.shift():"",i={},a=this;r instanceof o&&(n(i,r),r=r.result),e.forEach(function(e){e instanceof o?(n(i,e),r+=e.result):r+=e}),n(i,t),Object.keys(i).forEach(function(e){"result"!==e&&Object.defineProperty(a,e,{enumerable:!0,value:i[e]})}),Object.defineProperty(this,"result",{value:r})};n.prototype.toString=function(){return this.result};var r={server:function(t,i,o,a){var u=e("fs");a?r.serverSync(t,i,o):u.readFile(t,"bin"===i?void 0:i,function(e,r){e?o(e):o(null,new n(r,{name:t}))})},serverSync:function(t,r,i){var o,a=e("fs");try{o=a.readFileSync(t,"bin"===r?void 0:r),i(null,new n(o,{name:t}))}catch(u){i(u)}},client:function(e,t,r){e in localStorage?r(null,new n(localStorage[e],{name:e})):r("localStorage has no item "+e)}};n.readFile=n.prototype.readFile="undefined"==typeof module?r.client:r.server;var i={server:function(t,r,i,o){function a(e,t){c.writeFile(e,t.result,"bin"===i?void 0:i,function(r){o(r,new n(t,{name:e}))})}var u,c=e("fs"),s=e("path"),l=c.exists||s.exists,f=e("mkdirp").mkdirp,p=e("crypto"),d=s.resolve(s.dirname(t));t.indexOf("{checksum}")>-1&&(u=p.createHash("md5"),u.update(r.result),t=t.replace("{checksum}",u.digest("hex"))),l(d,function(e){e?a(t,r):f(d,"0755",function(e){e?o(e):a(t,r)})})},client:function(e,t,n,r){localStorage[e]=t.result,r(null,new t.constructor(t,{name:e}))}};n.writeFile=n.prototype.writeFile="undefined"==typeof module?i.client:i.server}),define("./tasks/concat",["require","exports"],function(e,t){t.concat=function(e,t,n,r){e=e||{},r(null,new n.constructor([t,e.callback?e.callback(n):n]))}}),define("./tasks/core",["require","exports","../blob"],function(e,t){function n(){return function(e,t){t(null,new r(e))}}var r=e("../blob").Blob;t.append=t.load=n();var i=t.prepend=n();i.type="prepend";var o=t.test=function(e,t,n){e=e||{},n(e.callback?e.callback(t):null)};o.type="each";var a=t.get=function(e,t,n){n(null,t.slice(e,e+1))};a.type="collect";var u=t.log=function(e,t,n){this._log(e),n(null,t)};u.type="collect";var c=t.inspect=function(e,t,n){var r=this;t.forEach(function(e,t){var n={result:e.result};Object.keys(e).forEach(function(t){n[t]=e[t]}),r._log("blob "+(t+1)+": "+JSON.stringify(n,null," "))}),n(null,t)};c.type="collect",t.noop=function(e,t,n){n(null,t)}}),define("./tasks/replace",["require","exports"],function(e,t){t.replace=function(e,t,n){var r=t.result;Array.isArray(e)||(e=[e]),e.forEach(function(e){var t=e.replace||"",n=void 0!==e.flags?e.flags:"mg",i="string"==typeof e.regex?new RegExp(e.regex,n):e.regex;r=r.replace(i,t)}),n(null,new t.constructor(r,t))}}),define("./tasks/stamp",["require","exports"],function(e,t){t.stamp=function(e,t,n){e=e||{},e.prefix=e.prefix||"",e.postfix=e.postfix||"";var r=e.callback?e.callback(t):t.result,i=e.prefix+r+e.postfix;n(null,new t.constructor(i,t))}}),define("./tasks/read",["require","exports","../blob"],function(e,t){function n(){return function(e,t){e="string"==typeof e?{name:e}:e;var n=e.encoding||"utf8";r.readFile(e.name,n,t,e.sync)}}var r=e("../blob").Blob;t.read=n();var i=t.readBefore=n();i.type="prepend"}),define("./tasks/write",["require","exports"],function(e,t){var n=t.write=function(e,t,n){e="string"==typeof e?{name:e}:e;var r=e.encoding||"utf8";t.writeFile(e.name,t,r,n)};n.type="slice"}),define("./tasks/tasks",["require","exports","async"],function(e,t){var n=e("async"),r=t.tasks=function(e,t,r){function i(e,n,r){return function(i,o){var a=r.length?[]:t;o=o||[],r.forEach(function(e){a=a.concat(o[e])}),l._dispatch(e,n,a,i)}}var o,a,u,c,s={},l=this;for(o in e)a=e[o].task,void 0===a?a=["noop"]:Array.isArray(a)||(a=[a]),u=e[o].requires,void 0===u?u=[]:Array.isArray(u)||(u=[u]),c=i(a[0],a[1],u),s[o]=u?u.concat(c):c;n.auto(s,function(e,t){return e?void r(e):void r(e,t&&t.join?t.join:[])})};r.type="collect"}),define("./registry",["require","exports","./tasks/concat","./default_tasks"],function(e,t){if("undefined"!=typeof module)var n=e("fs"),r=e("path"),i=n.existsSync||r.existsSync;else var o=e("./default_tasks");var a=t.Registry=function(e){var t=this;this._tasks={},"undefined"!=typeof __dirname?this.load({dirname:__dirname+"/tasks"}):"undefined"!=typeof o&&this.load({tasks:o}),e&&this.load(e),Object.defineProperty(this,"tasks",{get:function(){return Object.keys(t._tasks)}})};a.prototype={load:function(e){e=e||{};var t=e.module,n=e.dirname,r=e.filename,i=e.tasks;if(t&&!this._loadModule(t))throw new Error("Module "+t+" doesn't exist");if(n&&!this._loadDir(n))throw new Error("Directory "+n+" doesn't exist");if(r&&!this._loadFile(r))throw new Error("File "+r+" doesn't exist");if(i&&!this._loadTasks(i))throw new Error("Failed to load tasks");return this},_loadModule:function(t){if(e)try{return this._loadTasks(e(t))}catch(n){}return this._loadDir(r.resolve("node_modules",t,"lib"))},_loadDir:function(t){if(!i(t))return!1;var n=e("fs"),o=n.readdirSync(t),a=this;return o.forEach(function(e){var n=r.join(t,e);".js"===r.extname(n)&&a._loadFile(n)}),!0},_loadFile:function(t){return i(t)?this._loadTasks(e(t)):!1},_loadTasks:function(e){var t;for(t in e)this._tasks[t]=e[t];return!0},task:function(e){if(!(e in this._tasks))throw new Error("Task "+e+" doesn't exist");return this._tasks[e]}}}),define("./queue",["require","exports","async","./registry","./blob"],function(e,t){function n(e,t){for(var n=[],r=0;r<Math.min(e.length,t.length);r++)n.push([e[r],t[r]]);return n}function r(e){return"undefined"==typeof e?[]:Array.prototype.concat(e)}var i=e("async"),o=e("./registry").Registry,a=e("./blob").Blob,u=t.Queue=function(e){var t=this;e=e||{},this._logger=e.logger||console,this._registry="string"==typeof e.registry?new o({module:e.registry}):e.registry||new o,this._clear(),this._registry.tasks.forEach(function(e){t[e]=t.task.bind(t,e)
})};u.prototype._clear=function(){this._queue=[function(e){e(null,[])}]},u.prototype._log=function(e){this._logger.log(e)},u.prototype._dispatch=function(e,t,o,u){function c(t,n){t&&(t={task:e,error:t}),u(t,n)}var s=this._registry.task(e),l={2:"append",3:"map",4:"reduce"},f=s.type?s.type:l[s.length];switch(f){case"append":i.map(r(t),s.bind(this),function(e,t){c(e,o.concat(t))});break;case"prepend":i.map(r(t),s.bind(this),function(e,t){c(e,t.concat(o))});break;case"collect":s.call(this,t,o,c);break;case"slice":i.map(n(r(t),o),function(e,t){s.call(this,e[0],e[1],t)}.bind(this),c);break;case"each":i.forEach(o,s.bind(this,t),function(e){c(e,o)});break;case"map":i.map(o,s.bind(this,t),c);break;case"syncmap":i.mapSeries(o,s.bind(this,t),c);break;case"reduce":i.reduce(o,new a,s.bind(this,t),function(e,t){c(e,[t])});break;default:throw new Error('Task "'+e+'" has unknown type. Add a type property to the task function.')}},u.prototype.task=function(e,t){return this._queue.push(this._dispatch.bind(this,e,t)),this},u.prototype.run=function(e){var t=this;i.waterfall(this._queue,e||function(e){e&&t._log(e)})}}),define("../blob",["require","exports","blob"],function(e,t,n){t.Blob=n.Blob}),define("./default_tasks",["require","exports","./tasks/concat","./tasks/core","./tasks/replace","./tasks/stamp","./tasks/read","./tasks/write","./tasks/tasks"],function(e,t){var n=[];n.push(e("./tasks/concat")),n.push(e("./tasks/core")),n.push(e("./tasks/replace")),n.push(e("./tasks/stamp")),n.push(e("./tasks/read")),n.push(e("./tasks/write")),n.push(e("./tasks/tasks")),n.forEach(function(e){for(var n in e)t[n]=e[n]})}),define("gear",["require","exports","blob","registry","queue"],function(e,t,n,r,i){t.Blob=n.Blob,t.Registry=r.Registry,t.Queue=i.Queue});

4

package.json
{
"name": "gear",
"version": "0.8.18",
"version": "0.9.0",
"description": "Gear.js - Build System for Node.js and the Browser",

@@ -24,4 +24,4 @@ "author": "Stephen Murphy <stephen@hypernaut.com>",

"istanbul": "*",
"gear-lib": ">= 0.8.x"
"gear-lib": ">= 0.9.x"
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc